1a3680546Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2a3680546Smrg#
3a3680546Smrg#   Copyright (C) 1996-2001, 2003-2019, 2021-2024 Free Software
4a3680546Smrg#   Foundation, Inc.
5a3680546Smrg#   Written by Gordon Matzigkeit, 1996
6a3680546Smrg#
7a3680546Smrg# This file is free software; the Free Software Foundation gives
8a3680546Smrg# unlimited permission to copy and/or distribute it, with or without
9a3680546Smrg# modifications, as long as this notice is preserved.
10a3680546Smrg
11a3680546Smrgm4_define([_LT_COPYING], [dnl
12a3680546Smrg# Copyright (C) 2024 Free Software Foundation, Inc.
13a3680546Smrg# This is free software; see the source for copying conditions.  There is NO
14a3680546Smrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15a3680546Smrg
16a3680546Smrg# GNU Libtool is free software; you can redistribute it and/or modify
17a3680546Smrg# it under the terms of the GNU General Public License as published by
18a3680546Smrg# the Free Software Foundation; either version 2 of the License, or
19a3680546Smrg# (at your option) any later version.
20a3680546Smrg#
21a3680546Smrg# As a special exception to the GNU General Public License, if you
22a3680546Smrg# distribute this file as part of a program or library that is built
23a3680546Smrg# using GNU Libtool, you may include this file under the  same
24a3680546Smrg# distribution terms that you use for the rest of that program.
25a3680546Smrg#
26a3680546Smrg# GNU Libtool is distributed in the hope that it will be useful, but
27a3680546Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
28a3680546Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
29a3680546Smrg# GNU General Public License for more details.
30a3680546Smrg#
31a3680546Smrg# You should have received a copy of the GNU General Public License
32a3680546Smrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
33a3680546Smrg])
34a3680546Smrg
35a3680546Smrg# serial 63 LT_INIT
36a3680546Smrg
37a3680546Smrg
38a3680546Smrg# LT_PREREQ(VERSION)
39a3680546Smrg# ------------------
40a3680546Smrg# Complain and exit if this libtool version is less that VERSION.
41a3680546Smrgm4_defun([LT_PREREQ],
42a3680546Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
43a3680546Smrg       [m4_default([$3],
44a3680546Smrg		   [m4_fatal([Libtool version $1 or higher is required],
45a3680546Smrg		             63)])],
46a3680546Smrg       [$2])])
47a3680546Smrg
48a3680546Smrg
49a3680546Smrg# _LT_CHECK_BUILDDIR
50a3680546Smrg# ------------------
51a3680546Smrg# Complain if the absolute build directory name contains unusual characters
52a3680546Smrgm4_defun([_LT_CHECK_BUILDDIR],
53a3680546Smrg[case `pwd` in
54a3680546Smrg  *\ * | *\	*)
55a3680546Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
56a3680546Smrgesac
57a3680546Smrg])
58a3680546Smrg
59a3680546Smrg
60a3680546Smrg# LT_INIT([OPTIONS])
61a3680546Smrg# ------------------
62a3680546SmrgAC_DEFUN([LT_INIT],
63a3680546Smrg[AC_PREREQ([2.64])dnl We use AC_PATH_PROGS_FEATURE_CHECK
64a3680546SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
65a3680546SmrgAC_BEFORE([$0], [LT_LANG])dnl
66a3680546SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
67a3680546SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
68a3680546Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
69a3680546Smrg
70a3680546Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
71a3680546Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
72a3680546Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
73a3680546Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
74a3680546Smrgdnl unless we require an AC_DEFUNed macro:
75a3680546SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
76a3680546SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
77a3680546SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
78a3680546SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
79a3680546Smrgm4_require([_LT_PROG_LTMAIN])dnl
80a3680546Smrg
81a3680546Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
82a3680546Smrg
83a3680546Smrgdnl Parse OPTIONS
84a3680546Smrg_LT_SET_OPTIONS([$0], [$1])
85a3680546Smrg
86a3680546Smrg# This can be used to rebuild libtool when needed
87a3680546SmrgLIBTOOL_DEPS=$ltmain
88a3680546Smrg
89a3680546Smrg# Always use our own libtool.
90a3680546SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
91a3680546SmrgAC_SUBST(LIBTOOL)dnl
92a3680546Smrg
93a3680546Smrg_LT_SETUP
94a3680546Smrg
95a3680546Smrg# Only expand once:
96a3680546Smrgm4_define([LT_INIT])
97a3680546Smrg])# LT_INIT
98a3680546Smrg
99a3680546Smrg# Old names:
100a3680546SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
101a3680546SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
102a3680546Smrgdnl aclocal-1.4 backwards compatibility:
103a3680546Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
104a3680546Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
105a3680546Smrg
106a3680546Smrg
107a3680546Smrg# _LT_PREPARE_CC_BASENAME
108a3680546Smrg# -----------------------
109a3680546Smrgm4_defun([_LT_PREPARE_CC_BASENAME], [
110a3680546Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
111a3680546Smrgfunc_cc_basename ()
112a3680546Smrg{
113a3680546Smrg    for cc_temp in @S|@*""; do
114a3680546Smrg      case $cc_temp in
115a3680546Smrg        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
116a3680546Smrg        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
117a3680546Smrg        \-*) ;;
118a3680546Smrg        *) break;;
119a3680546Smrg      esac
120a3680546Smrg    done
121a3680546Smrg    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
122a3680546Smrg}
123a3680546Smrg])# _LT_PREPARE_CC_BASENAME
124a3680546Smrg
125a3680546Smrg
126a3680546Smrg# _LT_CC_BASENAME(CC)
127a3680546Smrg# -------------------
128a3680546Smrg# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
129a3680546Smrg# but that macro is also expanded into generated libtool script, which
130a3680546Smrg# arranges for $SED and $ECHO to be set by different means.
131a3680546Smrgm4_defun([_LT_CC_BASENAME],
132a3680546Smrg[m4_require([_LT_PREPARE_CC_BASENAME])dnl
133a3680546SmrgAC_REQUIRE([_LT_DECL_SED])dnl
134a3680546SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
135a3680546Smrgfunc_cc_basename $1
136a3680546Smrgcc_basename=$func_cc_basename_result
137a3680546Smrg])
138a3680546Smrg
139a3680546Smrg
140a3680546Smrg# _LT_FILEUTILS_DEFAULTS
141a3680546Smrg# ----------------------
142a3680546Smrg# It is okay to use these file commands and assume they have been set
143a3680546Smrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
144a3680546Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
145a3680546Smrg[: ${CP="cp -f"}
146a3680546Smrg: ${MV="mv -f"}
147a3680546Smrg: ${RM="rm -f"}
148a3680546Smrg])# _LT_FILEUTILS_DEFAULTS
149a3680546Smrg
150a3680546Smrg
151a3680546Smrg# _LT_SETUP
152a3680546Smrg# ---------
153a3680546Smrgm4_defun([_LT_SETUP],
154a3680546Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
155a3680546SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
156a3680546SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
157a3680546SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
158a3680546Smrg
159a3680546Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
160a3680546Smrgdnl
161a3680546Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
162a3680546Smrg_LT_DECL([], [host], [0])dnl
163a3680546Smrg_LT_DECL([], [host_os], [0])dnl
164a3680546Smrgdnl
165a3680546Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
166a3680546Smrg_LT_DECL([], [build], [0])dnl
167a3680546Smrg_LT_DECL([], [build_os], [0])dnl
168a3680546Smrgdnl
169a3680546SmrgAC_REQUIRE([AC_PROG_CC])dnl
170a3680546SmrgAC_REQUIRE([LT_PATH_LD])dnl
171a3680546SmrgAC_REQUIRE([LT_PATH_NM])dnl
172a3680546Smrgdnl
173a3680546SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
174a3680546Smrgtest -z "$LN_S" && LN_S="ln -s"
175a3680546Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
176a3680546Smrgdnl
177a3680546SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
178a3680546Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
179a3680546Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
180a3680546Smrgdnl
181a3680546Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
182a3680546Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
183a3680546Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
184a3680546Smrgm4_require([_LT_CMD_RELOAD])dnl
185a3680546Smrgm4_require([_LT_DECL_FILECMD])dnl
186a3680546Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
187a3680546Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
188a3680546Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
189a3680546Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
190a3680546Smrgm4_require([_LT_WITH_SYSROOT])dnl
191a3680546Smrgm4_require([_LT_CMD_TRUNCATE])dnl
192a3680546Smrg
193a3680546Smrg_LT_CONFIG_LIBTOOL_INIT([
194a3680546Smrg# See if we are running on zsh, and set the options that allow our
195a3680546Smrg# commands through without removal of \ escapes INIT.
196a3680546Smrgif test -n "\${ZSH_VERSION+set}"; then
197a3680546Smrg   setopt NO_GLOB_SUBST
198a3680546Smrgfi
199a3680546Smrg])
200a3680546Smrgif test -n "${ZSH_VERSION+set}"; then
201a3680546Smrg   setopt NO_GLOB_SUBST
202a3680546Smrgfi
203a3680546Smrg
204a3680546Smrg_LT_CHECK_OBJDIR
205a3680546Smrg
206a3680546Smrgm4_require([_LT_TAG_COMPILER])dnl
207a3680546Smrg
208a3680546Smrgcase $host_os in
209a3680546Smrgaix3*)
210a3680546Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
211a3680546Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
212a3680546Smrg  # vanish in a puff of smoke.
213a3680546Smrg  if test set != "${COLLECT_NAMES+set}"; then
214a3680546Smrg    COLLECT_NAMES=
215a3680546Smrg    export COLLECT_NAMES
216a3680546Smrg  fi
217a3680546Smrg  ;;
218a3680546Smrgesac
219a3680546Smrg
220a3680546Smrg# Global variables:
221a3680546Smrgofile=libtool
222a3680546Smrgcan_build_shared=yes
223a3680546Smrg
224a3680546Smrg# All known linkers require a '.a' archive for static linking (except MSVC and
225a3680546Smrg# ICC, which need '.lib').
226a3680546Smrglibext=a
227a3680546Smrg
228a3680546Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
229a3680546Smrg
230a3680546Smrgold_CC=$CC
231a3680546Smrgold_CFLAGS=$CFLAGS
232a3680546Smrg
233a3680546Smrg# Set sane defaults for various variables
234a3680546Smrgtest -z "$CC" && CC=cc
235a3680546Smrgtest -z "$LTCC" && LTCC=$CC
236a3680546Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
237a3680546Smrgtest -z "$LD" && LD=ld
238a3680546Smrgtest -z "$ac_objext" && ac_objext=o
239a3680546Smrg
240a3680546Smrg_LT_CC_BASENAME([$compiler])
241a3680546Smrg
242a3680546Smrg# Only perform the check for file, if the check method requires it
243a3680546Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
244a3680546Smrgcase $deplibs_check_method in
245a3680546Smrgfile_magic*)
246a3680546Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
247a3680546Smrg    _LT_PATH_MAGIC
248a3680546Smrg  fi
249a3680546Smrg  ;;
250a3680546Smrgesac
251a3680546Smrg
252a3680546Smrg# Use C for the default configuration in the libtool script
253a3680546SmrgLT_SUPPORTED_TAG([CC])
254a3680546Smrg_LT_LANG_C_CONFIG
255a3680546Smrg_LT_LANG_DEFAULT_CONFIG
256a3680546Smrg_LT_CONFIG_COMMANDS
257a3680546Smrg])# _LT_SETUP
258a3680546Smrg
259a3680546Smrg
260a3680546Smrg# _LT_PREPARE_SED_QUOTE_VARS
261a3680546Smrg# --------------------------
262a3680546Smrg# Define a few sed substitution that help us do robust quoting.
263a3680546Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
264a3680546Smrg[# Backslashify metacharacters that are still active within
265a3680546Smrg# double-quoted strings.
266a3680546Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
267a3680546Smrg
268a3680546Smrg# Same as above, but do not quote variable references.
269a3680546Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
270a3680546Smrg
271a3680546Smrg# Sed substitution to delay expansion of an escaped shell variable in a
272a3680546Smrg# double_quote_subst'ed string.
273a3680546Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
274a3680546Smrg
275a3680546Smrg# Sed substitution to delay expansion of an escaped single quote.
276a3680546Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
277a3680546Smrg
278a3680546Smrg# Sed substitution to avoid accidental globbing in evaled expressions
279a3680546Smrgno_glob_subst='s/\*/\\\*/g'
280a3680546Smrg])
281a3680546Smrg
282a3680546Smrg# _LT_PROG_LTMAIN
283a3680546Smrg# ---------------
284a3680546Smrg# Note that this code is called both from 'configure', and 'config.status'
285a3680546Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
286a3680546Smrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
287a3680546Smrg# so we pass a copy along to make sure it has a sensible value anyway.
288a3680546Smrgm4_defun([_LT_PROG_LTMAIN],
289a3680546Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
290a3680546Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
291a3680546Smrgltmain=$ac_aux_dir/ltmain.sh
292a3680546Smrg])# _LT_PROG_LTMAIN
293a3680546Smrg
294a3680546Smrg
295a3680546Smrg## ------------------------------------- ##
296a3680546Smrg## Accumulate code for creating libtool. ##
297a3680546Smrg## ------------------------------------- ##
298a3680546Smrg
299a3680546Smrg# So that we can recreate a full libtool script including additional
300a3680546Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
301a3680546Smrg# in macros and then make a single call at the end using the 'libtool'
302a3680546Smrg# label.
303a3680546Smrg
304a3680546Smrg
305a3680546Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
306a3680546Smrg# ----------------------------------------
307a3680546Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
308a3680546Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
309a3680546Smrg[m4_ifval([$1],
310a3680546Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
311a3680546Smrg                     [$1
312a3680546Smrg])])])
313a3680546Smrg
314a3680546Smrg# Initialize.
315a3680546Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
316a3680546Smrg
317a3680546Smrg
318a3680546Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
319a3680546Smrg# ------------------------------
320a3680546Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
321a3680546Smrgm4_define([_LT_CONFIG_LIBTOOL],
322a3680546Smrg[m4_ifval([$1],
323a3680546Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
324a3680546Smrg                     [$1
325a3680546Smrg])])])
326a3680546Smrg
327a3680546Smrg# Initialize.
328a3680546Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
329a3680546Smrg
330a3680546Smrg
331a3680546Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
332a3680546Smrg# -----------------------------------------------------
333a3680546Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
334a3680546Smrg[_LT_CONFIG_LIBTOOL([$1])
335a3680546Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
336a3680546Smrg])
337a3680546Smrg
338a3680546Smrg
339a3680546Smrg# _LT_FORMAT_COMMENT([COMMENT])
340a3680546Smrg# -----------------------------
341a3680546Smrg# Add leading comment marks to the start of each line, and a trailing
342a3680546Smrg# full-stop to the whole comment if one is not present already.
343a3680546Smrgm4_define([_LT_FORMAT_COMMENT],
344a3680546Smrg[m4_ifval([$1], [
345a3680546Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
346a3680546Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
347a3680546Smrg)])
348a3680546Smrg
349a3680546Smrg
350a3680546Smrg
351a3680546Smrg## ------------------------ ##
352a3680546Smrg## FIXME: Eliminate VARNAME ##
353a3680546Smrg## ------------------------ ##
354a3680546Smrg
355a3680546Smrg
356a3680546Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
357a3680546Smrg# -------------------------------------------------------------------
358a3680546Smrg# CONFIGNAME is the name given to the value in the libtool script.
359a3680546Smrg# VARNAME is the (base) name used in the configure script.
360a3680546Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
361a3680546Smrg# VARNAME.  Any other value will be used directly.
362a3680546Smrgm4_define([_LT_DECL],
363a3680546Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
364a3680546Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
365a3680546Smrg	[m4_ifval([$1], [$1], [$2])])
366a3680546Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
367a3680546Smrg    m4_ifval([$4],
368a3680546Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
369a3680546Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
370a3680546Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
371a3680546Smrg])
372a3680546Smrg
373a3680546Smrg
374a3680546Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
375a3680546Smrg# --------------------------------------------------------
376a3680546Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
377a3680546Smrg
378a3680546Smrg
379a3680546Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
380a3680546Smrg# ------------------------------------------------
381a3680546Smrgm4_define([lt_decl_tag_varnames],
382a3680546Smrg[_lt_decl_filter([tagged?], [yes], $@)])
383a3680546Smrg
384a3680546Smrg
385a3680546Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
386a3680546Smrg# ---------------------------------------------------------
387a3680546Smrgm4_define([_lt_decl_filter],
388a3680546Smrg[m4_case([$#],
389a3680546Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
390a3680546Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
391a3680546Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
392a3680546Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
393a3680546Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
394a3680546Smrg])
395a3680546Smrg
396a3680546Smrg
397a3680546Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
398a3680546Smrg# --------------------------------------------------
399a3680546Smrgm4_define([lt_decl_quote_varnames],
400a3680546Smrg[_lt_decl_filter([value], [1], $@)])
401a3680546Smrg
402a3680546Smrg
403a3680546Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
404a3680546Smrg# ---------------------------------------------------
405a3680546Smrgm4_define([lt_decl_dquote_varnames],
406a3680546Smrg[_lt_decl_filter([value], [2], $@)])
407a3680546Smrg
408a3680546Smrg
409a3680546Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
410a3680546Smrg# ---------------------------------------------------
411a3680546Smrgm4_define([lt_decl_varnames_tagged],
412a3680546Smrg[m4_assert([$# <= 2])dnl
413a3680546Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
414a3680546Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
415a3680546Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
416a3680546Smrgm4_define([_lt_decl_varnames_tagged],
417a3680546Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
418a3680546Smrg
419a3680546Smrg
420a3680546Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
421a3680546Smrg# ------------------------------------------------
422a3680546Smrgm4_define([lt_decl_all_varnames],
423a3680546Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
424a3680546Smrg     m4_if([$2], [],
425a3680546Smrg	   m4_quote(lt_decl_varnames),
426a3680546Smrg	m4_quote(m4_shift($@))))[]dnl
427a3680546Smrg])
428a3680546Smrgm4_define([_lt_decl_all_varnames],
429a3680546Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
430a3680546Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
431a3680546Smrg])
432a3680546Smrg
433a3680546Smrg
434a3680546Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
435a3680546Smrg# ------------------------------------
436a3680546Smrg# Quote a variable value, and forward it to 'config.status' so that its
437a3680546Smrg# declaration there will have the same value as in 'configure'.  VARNAME
438a3680546Smrg# must have a single quote delimited value for this to work.
439a3680546Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
440a3680546Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
441a3680546Smrg
442a3680546Smrg
443a3680546Smrg# _LT_CONFIG_STATUS_DECLARATIONS
444a3680546Smrg# ------------------------------
445a3680546Smrg# We delimit libtool config variables with single quotes, so when
446a3680546Smrg# we write them to config.status, we have to be sure to quote all
447a3680546Smrg# embedded single quotes properly.  In configure, this macro expands
448a3680546Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
449a3680546Smrg#
450a3680546Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
451a3680546Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
452a3680546Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
453a3680546Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
454a3680546Smrg
455a3680546Smrg
456a3680546Smrg# _LT_LIBTOOL_TAGS
457a3680546Smrg# ----------------
458a3680546Smrg# Output comment and list of tags supported by the script
459a3680546Smrgm4_defun([_LT_LIBTOOL_TAGS],
460a3680546Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
461a3680546Smrgavailable_tags='_LT_TAGS'dnl
462a3680546Smrg])
463a3680546Smrg
464a3680546Smrg
465a3680546Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
466a3680546Smrg# -----------------------------------
467a3680546Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
468a3680546Smrg# expand to a commented shell variable setting:
469a3680546Smrg#
470a3680546Smrg#    # Some comment about what VAR is for.
471a3680546Smrg#    visible_name=$lt_internal_name
472a3680546Smrgm4_define([_LT_LIBTOOL_DECLARE],
473a3680546Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
474a3680546Smrg					   [description])))[]dnl
475a3680546Smrgm4_pushdef([_libtool_name],
476a3680546Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
477a3680546Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
478a3680546Smrg    [0], [_libtool_name=[$]$1],
479a3680546Smrg    [1], [_libtool_name=$lt_[]$1],
480a3680546Smrg    [2], [_libtool_name=$lt_[]$1],
481a3680546Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
482a3680546Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
483a3680546Smrg])
484a3680546Smrg
485a3680546Smrg
486a3680546Smrg# _LT_LIBTOOL_CONFIG_VARS
487a3680546Smrg# -----------------------
488a3680546Smrg# Produce commented declarations of non-tagged libtool config variables
489a3680546Smrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
490a3680546Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
491a3680546Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
492a3680546Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
493a3680546Smrg[m4_foreach([_lt_var],
494a3680546Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
495a3680546Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
496a3680546Smrg
497a3680546Smrg
498a3680546Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
499a3680546Smrg# -------------------------
500a3680546Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
501a3680546Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
502a3680546Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
503a3680546Smrg
504a3680546Smrg
505a3680546Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
506a3680546Smrg# ------------------------------
507a3680546Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
508a3680546Smrg
509a3680546Smrg
510a3680546Smrg# _LT_CONFIG_COMMANDS
511a3680546Smrg# -------------------
512a3680546Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
513a3680546Smrg# variables for single and double quote escaping we saved from calls
514a3680546Smrg# to _LT_DECL, we can put quote escaped variables declarations
515a3680546Smrg# into 'config.status', and then the shell code to quote escape them in
516a3680546Smrg# for loops in 'config.status'.  Finally, any additional code accumulated
517a3680546Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
518a3680546Smrgm4_defun([_LT_CONFIG_COMMANDS],
519a3680546Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
520a3680546Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
521a3680546Smrg	dnl instead of duplicating it all over again into config.status,
522a3680546Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
523a3680546Smrg	dnl needs to know what name is stored there:
524a3680546Smrg        [AC_CONFIG_COMMANDS([libtool],
525a3680546Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
526a3680546Smrg    dnl If the libtool generation code is destined for config.status,
527a3680546Smrg    dnl expand the accumulated commands and init code now:
528a3680546Smrg    [AC_CONFIG_COMMANDS([libtool],
529a3680546Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
530a3680546Smrg])#_LT_CONFIG_COMMANDS
531a3680546Smrg
532a3680546Smrg
533a3680546Smrg# Initialize.
534a3680546Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
535a3680546Smrg[
536a3680546Smrg
537a3680546Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
538a3680546Smrg# if CDPATH is set.
539a3680546Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
540a3680546Smrg
541a3680546Smrgsed_quote_subst='$sed_quote_subst'
542a3680546Smrgdouble_quote_subst='$double_quote_subst'
543a3680546Smrgdelay_variable_subst='$delay_variable_subst'
544a3680546Smrg_LT_CONFIG_STATUS_DECLARATIONS
545a3680546SmrgLTCC='$LTCC'
546a3680546SmrgLTCFLAGS='$LTCFLAGS'
547a3680546Smrgcompiler='$compiler_DEFAULT'
548a3680546Smrg
549a3680546Smrg# A function that is used when there is no print builtin or printf.
550a3680546Smrgfunc_fallback_echo ()
551a3680546Smrg{
552a3680546Smrg  eval 'cat <<_LTECHO_EOF
553a3680546Smrg\$[]1
554a3680546Smrg_LTECHO_EOF'
555a3680546Smrg}
556a3680546Smrg
557a3680546Smrg# Quote evaled strings.
558a3680546Smrgfor var in lt_decl_all_varnames([[ \
559a3680546Smrg]], lt_decl_quote_varnames); do
560a3680546Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
561a3680546Smrg    *[[\\\\\\\`\\"\\\$]]*)
562a3680546Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
563a3680546Smrg      ;;
564a3680546Smrg    *)
565a3680546Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
566a3680546Smrg      ;;
567a3680546Smrg    esac
568a3680546Smrgdone
569a3680546Smrg
570a3680546Smrg# Double-quote double-evaled strings.
571a3680546Smrgfor var in lt_decl_all_varnames([[ \
572a3680546Smrg]], lt_decl_dquote_varnames); do
573a3680546Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
574a3680546Smrg    *[[\\\\\\\`\\"\\\$]]*)
575a3680546Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
576a3680546Smrg      ;;
577a3680546Smrg    *)
578a3680546Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
579a3680546Smrg      ;;
580a3680546Smrg    esac
581a3680546Smrgdone
582a3680546Smrg
583a3680546Smrg_LT_OUTPUT_LIBTOOL_INIT
584a3680546Smrg])
585a3680546Smrg
586a3680546Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
587a3680546Smrg# ------------------------------------
588a3680546Smrg# Generate a child script FILE with all initialization necessary to
589a3680546Smrg# reuse the environment learned by the parent script, and make the
590a3680546Smrg# file executable.  If COMMENT is supplied, it is inserted after the
591a3680546Smrg# '#!' sequence but before initialization text begins.  After this
592a3680546Smrg# macro, additional text can be appended to FILE to form the body of
593a3680546Smrg# the child script.  The macro ends with non-zero status if the
594a3680546Smrg# file could not be fully written (such as if the disk is full).
595a3680546Smrgm4_ifdef([AS_INIT_GENERATED],
596a3680546Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
597a3680546Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
598a3680546Smrg[m4_require([AS_PREPARE])]dnl
599a3680546Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
600a3680546Smrg[lt_write_fail=0
601a3680546Smrgcat >$1 <<_ASEOF || lt_write_fail=1
602a3680546Smrg#! $SHELL
603a3680546Smrg# Generated by $as_me.
604a3680546Smrg$2
605a3680546SmrgSHELL=\${CONFIG_SHELL-$SHELL}
606a3680546Smrgexport SHELL
607a3680546Smrg_ASEOF
608a3680546Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
609a3680546SmrgAS_SHELL_SANITIZE
610a3680546Smrg_AS_PREPARE
611a3680546Smrgexec AS_MESSAGE_FD>&1
612a3680546Smrg_ASEOF
613a3680546Smrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
614a3680546Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
615a3680546Smrg
616a3680546Smrg# LT_OUTPUT
617a3680546Smrg# ---------
618a3680546Smrg# This macro allows early generation of the libtool script (before
619a3680546Smrg# AC_OUTPUT is called), in case it is used in configure for compilation
620a3680546Smrg# tests.
621a3680546SmrgAC_DEFUN([LT_OUTPUT],
622a3680546Smrg[: ${CONFIG_LT=./config.lt}
623a3680546SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
624a3680546Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
625a3680546Smrg[# Run this file to recreate a libtool stub with the current configuration.])
626a3680546Smrg
627a3680546Smrgcat >>"$CONFIG_LT" <<\_LTEOF
628a3680546Smrglt_cl_silent=false
629a3680546Smrgexec AS_MESSAGE_LOG_FD>>config.log
630a3680546Smrg{
631a3680546Smrg  echo
632a3680546Smrg  AS_BOX([Running $as_me.])
633a3680546Smrg} >&AS_MESSAGE_LOG_FD
634a3680546Smrg
635a3680546Smrglt_cl_help="\
636a3680546Smrg'$as_me' creates a local libtool stub from the current configuration,
637a3680546Smrgfor use in further configure time tests before the real libtool is
638a3680546Smrggenerated.
639a3680546Smrg
640a3680546SmrgUsage: $[0] [[OPTIONS]]
641a3680546Smrg
642a3680546Smrg  -h, --help      print this help, then exit
643a3680546Smrg  -V, --version   print version number, then exit
644a3680546Smrg  -q, --quiet     do not print progress messages
645a3680546Smrg  -d, --debug     don't remove temporary files
646a3680546Smrg
647a3680546SmrgReport bugs to <bug-libtool@gnu.org>."
648a3680546Smrg
649a3680546Smrglt_cl_version="\
650a3680546Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
651a3680546Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
652a3680546Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
653a3680546Smrg
654a3680546SmrgCopyright (C) 2024 Free Software Foundation, Inc.
655a3680546SmrgThis config.lt script is free software; the Free Software Foundation
656a3680546Smrggives unlimited permission to copy, distribute and modify it."
657a3680546Smrg
658a3680546Smrgwhile test 0 != $[#]
659a3680546Smrgdo
660a3680546Smrg  case $[1] in
661a3680546Smrg    --version | --v* | -V )
662a3680546Smrg      echo "$lt_cl_version"; exit 0 ;;
663a3680546Smrg    --help | --h* | -h )
664a3680546Smrg      echo "$lt_cl_help"; exit 0 ;;
665a3680546Smrg    --debug | --d* | -d )
666a3680546Smrg      debug=: ;;
667a3680546Smrg    --quiet | --q* | --silent | --s* | -q )
668a3680546Smrg      lt_cl_silent=: ;;
669a3680546Smrg
670a3680546Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
671a3680546SmrgTry '$[0] --help' for more information.]) ;;
672a3680546Smrg
673a3680546Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
674a3680546SmrgTry '$[0] --help' for more information.]) ;;
675a3680546Smrg  esac
676a3680546Smrg  shift
677a3680546Smrgdone
678a3680546Smrg
679a3680546Smrgif $lt_cl_silent; then
680a3680546Smrg  exec AS_MESSAGE_FD>/dev/null
681a3680546Smrgfi
682a3680546Smrg_LTEOF
683a3680546Smrg
684a3680546Smrgcat >>"$CONFIG_LT" <<_LTEOF
685a3680546Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
686a3680546Smrg_LTEOF
687a3680546Smrg
688a3680546Smrgcat >>"$CONFIG_LT" <<\_LTEOF
689a3680546SmrgAC_MSG_NOTICE([creating $ofile])
690a3680546Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
691a3680546SmrgAS_EXIT(0)
692a3680546Smrg_LTEOF
693a3680546Smrgchmod +x "$CONFIG_LT"
694a3680546Smrg
695a3680546Smrg# configure is writing to config.log, but config.lt does its own redirection,
696a3680546Smrg# appending to config.log, which fails on DOS, as config.log is still kept
697a3680546Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
698a3680546Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
699a3680546Smrglt_cl_success=:
700a3680546Smrgtest yes = "$silent" &&
701a3680546Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
702a3680546Smrgexec AS_MESSAGE_LOG_FD>/dev/null
703a3680546Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
704a3680546Smrgexec AS_MESSAGE_LOG_FD>>config.log
705a3680546Smrg$lt_cl_success || AS_EXIT(1)
706a3680546Smrg])# LT_OUTPUT
707a3680546Smrg
708a3680546Smrg
709a3680546Smrg# _LT_CONFIG(TAG)
710a3680546Smrg# ---------------
711a3680546Smrg# If TAG is the built-in tag, create an initial libtool script with a
712a3680546Smrg# default configuration from the untagged config vars.  Otherwise add code
713a3680546Smrg# to config.status for appending the configuration named by TAG from the
714a3680546Smrg# matching tagged config vars.
715a3680546Smrgm4_defun([_LT_CONFIG],
716a3680546Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
717a3680546Smrg_LT_CONFIG_SAVE_COMMANDS([
718a3680546Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
719a3680546Smrg  m4_if(_LT_TAG, [C], [
720a3680546Smrg    # See if we are running on zsh, and set the options that allow our
721a3680546Smrg    # commands through without removal of \ escapes.
722a3680546Smrg    if test -n "${ZSH_VERSION+set}"; then
723a3680546Smrg      setopt NO_GLOB_SUBST
724a3680546Smrg    fi
725a3680546Smrg
726a3680546Smrg    cfgfile=${ofile}T
727a3680546Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
728a3680546Smrg    $RM "$cfgfile"
729a3680546Smrg
730a3680546Smrg    cat <<_LT_EOF >> "$cfgfile"
731a3680546Smrg#! $SHELL
732a3680546Smrg# Generated automatically by $as_me ($PACKAGE) $VERSION
733a3680546Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
734a3680546Smrg
735a3680546Smrg# Provide generalized library-building support services.
736a3680546Smrg# Written by Gordon Matzigkeit, 1996
737a3680546Smrg
738a3680546Smrg_LT_COPYING
739a3680546Smrg_LT_LIBTOOL_TAGS
740a3680546Smrg
741a3680546Smrg# Configured defaults for sys_lib_dlsearch_path munging.
742a3680546Smrg: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
743a3680546Smrg
744a3680546Smrg# ### BEGIN LIBTOOL CONFIG
745a3680546Smrg_LT_LIBTOOL_CONFIG_VARS
746a3680546Smrg_LT_LIBTOOL_TAG_VARS
747a3680546Smrg# ### END LIBTOOL CONFIG
748a3680546Smrg
749a3680546Smrg_LT_EOF
750a3680546Smrg
751a3680546Smrg    cat <<'_LT_EOF' >> "$cfgfile"
752a3680546Smrg
753a3680546Smrg# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
754a3680546Smrg
755a3680546Smrg_LT_PREPARE_MUNGE_PATH_LIST
756a3680546Smrg_LT_PREPARE_CC_BASENAME
757a3680546Smrg
758a3680546Smrg# ### END FUNCTIONS SHARED WITH CONFIGURE
759a3680546Smrg
760a3680546Smrg_LT_EOF
761a3680546Smrg
762a3680546Smrg  case $host_os in
763a3680546Smrg  aix3*)
764a3680546Smrg    cat <<\_LT_EOF >> "$cfgfile"
765a3680546Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
766a3680546Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
767a3680546Smrg# vanish in a puff of smoke.
768a3680546Smrgif test set != "${COLLECT_NAMES+set}"; then
769a3680546Smrg  COLLECT_NAMES=
770a3680546Smrg  export COLLECT_NAMES
771a3680546Smrgfi
772a3680546Smrg_LT_EOF
773a3680546Smrg    ;;
774a3680546Smrg  esac
775a3680546Smrg
776a3680546Smrg  _LT_PROG_LTMAIN
777a3680546Smrg
778a3680546Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
779a3680546Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
780a3680546Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
781a3680546Smrg  # is reportedly fixed, but why not run on old versions too?
782a3680546Smrg  $SED '$q' "$ltmain" >> "$cfgfile" \
783a3680546Smrg     || (rm -f "$cfgfile"; exit 1)
784a3680546Smrg
785a3680546Smrg   mv -f "$cfgfile" "$ofile" ||
786a3680546Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
787a3680546Smrg  chmod +x "$ofile"
788a3680546Smrg],
789a3680546Smrg[cat <<_LT_EOF >> "$ofile"
790a3680546Smrg
791a3680546Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
792a3680546Smrgdnl in a comment (ie after a #).
793a3680546Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
794a3680546Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
795a3680546Smrg# ### END LIBTOOL TAG CONFIG: $1
796a3680546Smrg_LT_EOF
797a3680546Smrg])dnl /m4_if
798a3680546Smrg],
799a3680546Smrg[m4_if([$1], [], [
800a3680546Smrg    PACKAGE='$PACKAGE'
801a3680546Smrg    VERSION='$VERSION'
802a3680546Smrg    RM='$RM'
803a3680546Smrg    ofile='$ofile'], [])
804a3680546Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
805a3680546Smrg])# _LT_CONFIG
806a3680546Smrg
807a3680546Smrg
808a3680546Smrg# LT_SUPPORTED_TAG(TAG)
809a3680546Smrg# ---------------------
810a3680546Smrg# Trace this macro to discover what tags are supported by the libtool
811a3680546Smrg# --tag option, using:
812a3680546Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
813a3680546SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
814a3680546Smrg
815a3680546Smrg
816a3680546Smrg# C support is built-in for now
817a3680546Smrgm4_define([_LT_LANG_C_enabled], [])
818a3680546Smrgm4_define([_LT_TAGS], [])
819a3680546Smrg
820a3680546Smrg
821a3680546Smrg# LT_LANG(LANG)
822a3680546Smrg# -------------
823a3680546Smrg# Enable libtool support for the given language if not already enabled.
824a3680546SmrgAC_DEFUN([LT_LANG],
825a3680546Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
826a3680546Smrgm4_case([$1],
827a3680546Smrg  [C],			[_LT_LANG(C)],
828a3680546Smrg  [C++],		[_LT_LANG(CXX)],
829a3680546Smrg  [Go],			[_LT_LANG(GO)],
830a3680546Smrg  [Java],		[_LT_LANG(GCJ)],
831a3680546Smrg  [Fortran 77],		[_LT_LANG(F77)],
832a3680546Smrg  [Fortran],		[_LT_LANG(FC)],
833a3680546Smrg  [Windows Resource],	[_LT_LANG(RC)],
834a3680546Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
835a3680546Smrg    [_LT_LANG($1)],
836a3680546Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
837a3680546Smrg])# LT_LANG
838a3680546Smrg
839a3680546Smrg
840a3680546Smrg# _LT_LANG(LANGNAME)
841a3680546Smrg# ------------------
842a3680546Smrgm4_defun([_LT_LANG],
843a3680546Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
844a3680546Smrg  [LT_SUPPORTED_TAG([$1])dnl
845a3680546Smrg  m4_append([_LT_TAGS], [$1 ])dnl
846a3680546Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
847a3680546Smrg  _LT_LANG_$1_CONFIG($1)])dnl
848a3680546Smrg])# _LT_LANG
849a3680546Smrg
850a3680546Smrg
851a3680546Smrgm4_ifndef([AC_PROG_GO], [
852a3680546Smrg############################################################
853a3680546Smrg# NOTE: This macro has been submitted for inclusion into   #
854a3680546Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
855a3680546Smrg#  a released version of Autoconf we should remove this    #
856a3680546Smrg#  macro and use it instead.                               #
857a3680546Smrg############################################################
858a3680546Smrgm4_defun([AC_PROG_GO],
859a3680546Smrg[AC_LANG_PUSH(Go)dnl
860a3680546SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
861a3680546SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
862a3680546Smrg_AC_ARG_VAR_LDFLAGS()dnl
863a3680546SmrgAC_CHECK_TOOL(GOC, gccgo)
864a3680546Smrgif test -z "$GOC"; then
865a3680546Smrg  if test -n "$ac_tool_prefix"; then
866a3680546Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
867a3680546Smrg  fi
868a3680546Smrgfi
869a3680546Smrgif test -z "$GOC"; then
870a3680546Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
871a3680546Smrgfi
872a3680546Smrg])#m4_defun
873a3680546Smrg])#m4_ifndef
874a3680546Smrg
875a3680546Smrg
876a3680546Smrg# _LT_LANG_DEFAULT_CONFIG
877a3680546Smrg# -----------------------
878a3680546Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
879a3680546Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
880a3680546Smrg  [LT_LANG(CXX)],
881a3680546Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
882a3680546Smrg
883a3680546SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
884a3680546Smrg  [LT_LANG(F77)],
885a3680546Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
886a3680546Smrg
887a3680546SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
888a3680546Smrg  [LT_LANG(FC)],
889a3680546Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
890a3680546Smrg
891a3680546Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
892a3680546Smrgdnl pulling things in needlessly.
893a3680546SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
894a3680546Smrg  [LT_LANG(GCJ)],
895a3680546Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
896a3680546Smrg    [LT_LANG(GCJ)],
897a3680546Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
898a3680546Smrg      [LT_LANG(GCJ)],
899a3680546Smrg      [m4_ifdef([AC_PROG_GCJ],
900a3680546Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
901a3680546Smrg       m4_ifdef([A][M_PROG_GCJ],
902a3680546Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
903a3680546Smrg       m4_ifdef([LT_PROG_GCJ],
904a3680546Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
905a3680546Smrg
906a3680546SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
907a3680546Smrg  [LT_LANG(GO)],
908a3680546Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
909a3680546Smrg
910a3680546SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
911a3680546Smrg  [LT_LANG(RC)],
912a3680546Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
913a3680546Smrg])# _LT_LANG_DEFAULT_CONFIG
914a3680546Smrg
915a3680546Smrg# Obsolete macros:
916a3680546SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
917a3680546SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
918a3680546SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
919a3680546SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
920a3680546SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
921a3680546Smrgdnl aclocal-1.4 backwards compatibility:
922a3680546Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
923a3680546Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
924a3680546Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
925a3680546Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
926a3680546Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
927a3680546Smrg
928a3680546Smrg
929a3680546Smrg# _LT_TAG_COMPILER
930a3680546Smrg# ----------------
931a3680546Smrgm4_defun([_LT_TAG_COMPILER],
932a3680546Smrg[AC_REQUIRE([AC_PROG_CC])dnl
933a3680546Smrg
934a3680546Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
935a3680546Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
936a3680546Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
937a3680546Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
938a3680546Smrg
939a3680546Smrg# If no C compiler was specified, use CC.
940a3680546SmrgLTCC=${LTCC-"$CC"}
941a3680546Smrg
942a3680546Smrg# If no C compiler flags were specified, use CFLAGS.
943a3680546SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
944a3680546Smrg
945a3680546Smrg# Allow CC to be a program name with arguments.
946a3680546Smrgcompiler=$CC
947a3680546Smrg])# _LT_TAG_COMPILER
948a3680546Smrg
949a3680546Smrg
950a3680546Smrg# _LT_COMPILER_BOILERPLATE
951a3680546Smrg# ------------------------
952a3680546Smrg# Check for compiler boilerplate output or warnings with
953a3680546Smrg# the simple compiler test code.
954a3680546Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
955a3680546Smrg[m4_require([_LT_DECL_SED])dnl
956a3680546Smrgac_outfile=conftest.$ac_objext
957a3680546Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
958a3680546Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
959a3680546Smrg_lt_compiler_boilerplate=`cat conftest.err`
960a3680546Smrg$RM conftest*
961a3680546Smrg])# _LT_COMPILER_BOILERPLATE
962a3680546Smrg
963a3680546Smrg
964a3680546Smrg# _LT_LINKER_BOILERPLATE
965a3680546Smrg# ----------------------
966a3680546Smrg# Check for linker boilerplate output or warnings with
967a3680546Smrg# the simple link test code.
968a3680546Smrgm4_defun([_LT_LINKER_BOILERPLATE],
969a3680546Smrg[m4_require([_LT_DECL_SED])dnl
970a3680546Smrgac_outfile=conftest.$ac_objext
971a3680546Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
972a3680546Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
973a3680546Smrg_lt_linker_boilerplate=`cat conftest.err`
974a3680546Smrg$RM -r conftest*
975a3680546Smrg])# _LT_LINKER_BOILERPLATE
976a3680546Smrg
977a3680546Smrg
978a3680546Smrg# _LT_REQUIRED_DARWIN_CHECKS
979a3680546Smrg# -------------------------
980a3680546Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
981a3680546Smrg  case $host_os in
982a3680546Smrg    rhapsody* | darwin*)
983a3680546Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
984a3680546Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
985a3680546Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
986a3680546Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
987a3680546Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
988a3680546Smrg    _LT_DECL([], [DSYMUTIL], [1],
989a3680546Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
990a3680546Smrg    _LT_DECL([], [NMEDIT], [1],
991a3680546Smrg      [Tool to change global to local symbols on Mac OS X])
992a3680546Smrg    _LT_DECL([], [LIPO], [1],
993a3680546Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
994a3680546Smrg    _LT_DECL([], [OTOOL], [1],
995a3680546Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
996a3680546Smrg    _LT_DECL([], [OTOOL64], [1],
997a3680546Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
998a3680546Smrg
999a3680546Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
1000a3680546Smrg      [lt_cv_apple_cc_single_mod=no
1001a3680546Smrg      if test -z "$LT_MULTI_MODULE"; then
1002a3680546Smrg	# By default we will add the -single_module flag. You can override
1003a3680546Smrg	# by either setting the environment variable LT_MULTI_MODULE
1004a3680546Smrg	# non-empty at configure time, or by adding -multi_module to the
1005a3680546Smrg	# link flags.
1006a3680546Smrg	rm -rf libconftest.dylib*
1007a3680546Smrg	echo "int foo(void){return 1;}" > conftest.c
1008a3680546Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1009a3680546Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1010a3680546Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1011a3680546Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1012a3680546Smrg        _lt_result=$?
1013a3680546Smrg	# If there is a non-empty error log, and "single_module"
1014a3680546Smrg	# appears in it, assume the flag caused a linker warning
1015a3680546Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
1016a3680546Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1017a3680546Smrg	# Otherwise, if the output was created with a 0 exit code from
1018a3680546Smrg	# the compiler, it worked.
1019a3680546Smrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
1020a3680546Smrg	  lt_cv_apple_cc_single_mod=yes
1021a3680546Smrg	else
1022a3680546Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1023a3680546Smrg	fi
1024a3680546Smrg	rm -rf libconftest.dylib*
1025a3680546Smrg	rm -f conftest.*
1026a3680546Smrg      fi])
1027a3680546Smrg
1028a3680546Smrg    # Feature test to disable chained fixups since it is not
1029a3680546Smrg    # compatible with '-undefined dynamic_lookup'
1030a3680546Smrg    AC_CACHE_CHECK([for -no_fixup_chains linker flag],
1031a3680546Smrg      [lt_cv_support_no_fixup_chains],
1032a3680546Smrg      [ save_LDFLAGS=$LDFLAGS
1033a3680546Smrg        LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains"
1034a3680546Smrg        AC_LINK_IFELSE(
1035a3680546Smrg          [AC_LANG_PROGRAM([],[])],
1036a3680546Smrg          lt_cv_support_no_fixup_chains=yes,
1037a3680546Smrg          lt_cv_support_no_fixup_chains=no
1038a3680546Smrg        )
1039a3680546Smrg        LDFLAGS=$save_LDFLAGS
1040a3680546Smrg      ]
1041a3680546Smrg    )
1042a3680546Smrg
1043a3680546Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1044a3680546Smrg      [lt_cv_ld_exported_symbols_list],
1045a3680546Smrg      [lt_cv_ld_exported_symbols_list=no
1046a3680546Smrg      save_LDFLAGS=$LDFLAGS
1047a3680546Smrg      echo "_main" > conftest.sym
1048a3680546Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1049a3680546Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1050a3680546Smrg	[lt_cv_ld_exported_symbols_list=yes],
1051a3680546Smrg	[lt_cv_ld_exported_symbols_list=no])
1052a3680546Smrg	LDFLAGS=$save_LDFLAGS
1053a3680546Smrg    ])
1054a3680546Smrg
1055a3680546Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1056a3680546Smrg      [lt_cv_ld_force_load=no
1057a3680546Smrg      cat > conftest.c << _LT_EOF
1058a3680546Smrgint forced_loaded() { return 2;}
1059a3680546Smrg_LT_EOF
1060a3680546Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1061a3680546Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1062a3680546Smrg      echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1063a3680546Smrg      $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1064a3680546Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1065a3680546Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1066a3680546Smrg      cat > conftest.c << _LT_EOF
1067a3680546Smrgint main(void) { return 0;}
1068a3680546Smrg_LT_EOF
1069a3680546Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1070a3680546Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1071a3680546Smrg      _lt_result=$?
1072a3680546Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
1073a3680546Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1074a3680546Smrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
1075a3680546Smrg	lt_cv_ld_force_load=yes
1076a3680546Smrg      else
1077a3680546Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1078a3680546Smrg      fi
1079a3680546Smrg        rm -f conftest.err libconftest.a conftest conftest.c
1080a3680546Smrg        rm -rf conftest.dSYM
1081a3680546Smrg    ])
1082a3680546Smrg    case $host_os in
1083a3680546Smrg    rhapsody* | darwin1.[[012]])
1084a3680546Smrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
1085a3680546Smrg    darwin1.*)
1086a3680546Smrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1087a3680546Smrg    darwin*)
1088a3680546Smrg      case $MACOSX_DEPLOYMENT_TARGET,$host in
1089a3680546Smrg        10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
1090a3680546Smrg          _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1091a3680546Smrg        *)
1092a3680546Smrg          _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup'
1093a3680546Smrg          if test yes = "$lt_cv_support_no_fixup_chains"; then
1094a3680546Smrg            AS_VAR_APPEND([_lt_dar_allow_undefined], [' $wl-no_fixup_chains'])
1095a3680546Smrg          fi
1096a3680546Smrg        ;;
1097a3680546Smrg      esac
1098a3680546Smrg    ;;
1099a3680546Smrg  esac
1100a3680546Smrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
1101a3680546Smrg      _lt_dar_single_mod='$single_module'
1102a3680546Smrg    fi
1103a3680546Smrg    _lt_dar_needs_single_mod=no
1104a3680546Smrg    case $host_os in
1105a3680546Smrg    rhapsody* | darwin1.*)
1106a3680546Smrg      _lt_dar_needs_single_mod=yes ;;
1107a3680546Smrg    darwin*)
1108a3680546Smrg      # When targeting Mac OS X 10.4 (darwin 8) or later,
1109a3680546Smrg      # -single_module is the default and -multi_module is unsupported.
1110a3680546Smrg      # The toolchain on macOS 10.14 (darwin 18) and later cannot
1111a3680546Smrg      # target any OS version that needs -single_module.
1112a3680546Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1113a3680546Smrg      10.0,*-darwin[[567]].*|10.[[0-3]],*-darwin[[5-9]].*|10.[[0-3]],*-darwin1[[0-7]].*)
1114a3680546Smrg        _lt_dar_needs_single_mod=yes ;;
1115a3680546Smrg      esac
1116a3680546Smrg    ;;
1117a3680546Smrg    esac
1118a3680546Smrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
1119a3680546Smrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
1120a3680546Smrg    else
1121a3680546Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
1122a3680546Smrg    fi
1123a3680546Smrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
1124a3680546Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
1125a3680546Smrg    else
1126a3680546Smrg      _lt_dsymutil=
1127a3680546Smrg    fi
1128a3680546Smrg    ;;
1129a3680546Smrg  esac
1130a3680546Smrg])
1131a3680546Smrg
1132a3680546Smrg
1133a3680546Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
1134a3680546Smrg# ---------------------------------
1135a3680546Smrg# Checks for linker and compiler features on darwin
1136a3680546Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
1137a3680546Smrg[
1138a3680546Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1139a3680546Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1140a3680546Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
1141a3680546Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1142a3680546Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1143a3680546Smrg  if test yes = "$lt_cv_ld_force_load"; then
1144a3680546Smrg    _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\"`'
1145a3680546Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1146a3680546Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1147a3680546Smrg  else
1148a3680546Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1149a3680546Smrg  fi
1150a3680546Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1151a3680546Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
1152a3680546Smrg  case $cc_basename in
1153a3680546Smrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
1154a3680546Smrg     *) _lt_dar_can_shared=$GCC ;;
1155a3680546Smrg  esac
1156a3680546Smrg  if test yes = "$_lt_dar_can_shared"; then
1157a3680546Smrg    output_verbose_link_cmd=func_echo_all
1158a3680546Smrg    _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"
1159a3680546Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
1160a3680546Smrg    _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"
1161a3680546Smrg    _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"
1162a3680546Smrg    m4_if([$1], [CXX],
1163a3680546Smrg[   if test yes = "$_lt_dar_needs_single_mod" -a yes != "$lt_cv_apple_cc_single_mod"; then
1164a3680546Smrg      _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"
1165a3680546Smrg      _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"
1166a3680546Smrg    fi
1167a3680546Smrg],[])
1168a3680546Smrg  else
1169a3680546Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
1170a3680546Smrg  fi
1171a3680546Smrg])
1172a3680546Smrg
1173a3680546Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1174a3680546Smrg# ----------------------------------
1175a3680546Smrg# Links a minimal program and checks the executable
1176a3680546Smrg# for the system default hardcoded library path. In most cases,
1177a3680546Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
1178a3680546Smrg# the location of the communication and MPI libs are included too.
1179a3680546Smrg# If we don't find anything, use the default library path according
1180a3680546Smrg# to the aix ld manual.
1181a3680546Smrg# Store the results from the different compilers for each TAGNAME.
1182a3680546Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
1183a3680546Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1184a3680546Smrg[m4_require([_LT_DECL_SED])dnl
1185a3680546Smrgif test set = "${lt_cv_aix_libpath+set}"; then
1186a3680546Smrg  aix_libpath=$lt_cv_aix_libpath
1187a3680546Smrgelse
1188a3680546Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1189a3680546Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1190a3680546Smrg  lt_aix_libpath_sed='[
1191a3680546Smrg      /Import File Strings/,/^$/ {
1192a3680546Smrg	  /^0/ {
1193a3680546Smrg	      s/^0  *\([^ ]*\) *$/\1/
1194a3680546Smrg	      p
1195a3680546Smrg	  }
1196a3680546Smrg      }]'
1197a3680546Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1198a3680546Smrg  # Check for a 64-bit object if we didn't find anything.
1199a3680546Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1200a3680546Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1201a3680546Smrg  fi],[])
1202a3680546Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1203a3680546Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
1204a3680546Smrg  fi
1205a3680546Smrg  ])
1206a3680546Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1207a3680546Smrgfi
1208a3680546Smrg])# _LT_SYS_MODULE_PATH_AIX
1209a3680546Smrg
1210a3680546Smrg
1211a3680546Smrg# _LT_SHELL_INIT(ARG)
1212a3680546Smrg# -------------------
1213a3680546Smrgm4_define([_LT_SHELL_INIT],
1214a3680546Smrg[m4_divert_text([M4SH-INIT], [$1
1215a3680546Smrg])])# _LT_SHELL_INIT
1216a3680546Smrg
1217a3680546Smrg
1218a3680546Smrg
1219a3680546Smrg# _LT_PROG_ECHO_BACKSLASH
1220a3680546Smrg# -----------------------
1221a3680546Smrg# Find how we can fake an echo command that does not interpret backslash.
1222a3680546Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
1223a3680546Smrg# of the generated configure script that will find a shell with a builtin
1224a3680546Smrg# printf (that we can use as an echo command).
1225a3680546Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
1226a3680546Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1227a3680546SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1228a3680546SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1229a3680546Smrg
1230a3680546SmrgAC_MSG_CHECKING([how to print strings])
1231a3680546Smrg# Test print first, because it will be a builtin if present.
1232a3680546Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1233a3680546Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1234a3680546Smrg  ECHO='print -r --'
1235a3680546Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1236a3680546Smrg  ECHO='printf %s\n'
1237a3680546Smrgelse
1238a3680546Smrg  # Use this function as a fallback that always works.
1239a3680546Smrg  func_fallback_echo ()
1240a3680546Smrg  {
1241a3680546Smrg    eval 'cat <<_LTECHO_EOF
1242a3680546Smrg$[]1
1243a3680546Smrg_LTECHO_EOF'
1244a3680546Smrg  }
1245a3680546Smrg  ECHO='func_fallback_echo'
1246a3680546Smrgfi
1247a3680546Smrg
1248a3680546Smrg# func_echo_all arg...
1249a3680546Smrg# Invoke $ECHO with all args, space-separated.
1250a3680546Smrgfunc_echo_all ()
1251a3680546Smrg{
1252a3680546Smrg    $ECHO "$*"
1253a3680546Smrg}
1254a3680546Smrg
1255a3680546Smrgcase $ECHO in
1256a3680546Smrg  printf*) AC_MSG_RESULT([printf]) ;;
1257a3680546Smrg  print*) AC_MSG_RESULT([print -r]) ;;
1258a3680546Smrg  *) AC_MSG_RESULT([cat]) ;;
1259a3680546Smrgesac
1260a3680546Smrg
1261a3680546Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
1262a3680546Smrg[_AS_DETECT_SUGGESTED([
1263a3680546Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1264a3680546Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1265a3680546Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1266a3680546Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1267a3680546Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
1268a3680546Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
1269a3680546Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1270a3680546Smrg
1271a3680546Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1272a3680546Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1273a3680546Smrg])# _LT_PROG_ECHO_BACKSLASH
1274a3680546Smrg
1275a3680546Smrg
1276a3680546Smrg# _LT_WITH_SYSROOT
1277a3680546Smrg# ----------------
1278a3680546SmrgAC_DEFUN([_LT_WITH_SYSROOT],
1279a3680546Smrg[m4_require([_LT_DECL_SED])dnl
1280a3680546SmrgAC_MSG_CHECKING([for sysroot])
1281a3680546SmrgAC_ARG_WITH([sysroot],
1282a3680546Smrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
1283a3680546Smrg  [Search for dependent libraries within DIR (or the compiler's sysroot
1284a3680546Smrg   if not specified).])],
1285a3680546Smrg[], [with_sysroot=no])
1286a3680546Smrg
1287a3680546Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
1288a3680546Smrgdnl in case the user passed a directory name.
1289a3680546Smrglt_sysroot=
1290a3680546Smrgcase $with_sysroot in #(
1291a3680546Smrg yes)
1292a3680546Smrg   if test yes = "$GCC"; then
1293a3680546Smrg     # Trim trailing / since we'll always append absolute paths and we want
1294a3680546Smrg     # to avoid //, if only for less confusing output for the user.
1295a3680546Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'`
1296a3680546Smrg   fi
1297a3680546Smrg   ;; #(
1298a3680546Smrg /*)
1299a3680546Smrg   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
1300a3680546Smrg   ;; #(
1301a3680546Smrg no|'')
1302a3680546Smrg   ;; #(
1303a3680546Smrg *)
1304a3680546Smrg   AC_MSG_RESULT([$with_sysroot])
1305a3680546Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
1306a3680546Smrg   ;;
1307a3680546Smrgesac
1308a3680546Smrg
1309a3680546Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
1310a3680546Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1311a3680546Smrg[dependent libraries, and where our libraries should be installed.])])
1312a3680546Smrg
1313a3680546Smrg# _LT_ENABLE_LOCK
1314a3680546Smrg# ---------------
1315a3680546Smrgm4_defun([_LT_ENABLE_LOCK],
1316a3680546Smrg[AC_ARG_ENABLE([libtool-lock],
1317a3680546Smrg  [AS_HELP_STRING([--disable-libtool-lock],
1318a3680546Smrg    [avoid locking (might break parallel builds)])])
1319a3680546Smrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
1320a3680546Smrg
1321a3680546Smrg# Some flags need to be propagated to the compiler or linker for good
1322a3680546Smrg# libtool support.
1323a3680546Smrgcase $host in
1324a3680546Smrgia64-*-hpux*)
1325a3680546Smrg  # Find out what ABI is being produced by ac_compile, and set mode
1326a3680546Smrg  # options accordingly.
1327a3680546Smrg  echo 'int i;' > conftest.$ac_ext
1328a3680546Smrg  if AC_TRY_EVAL(ac_compile); then
1329a3680546Smrg    case `$FILECMD conftest.$ac_objext` in
1330a3680546Smrg      *ELF-32*)
1331a3680546Smrg	HPUX_IA64_MODE=32
1332a3680546Smrg	;;
1333a3680546Smrg      *ELF-64*)
1334a3680546Smrg	HPUX_IA64_MODE=64
1335a3680546Smrg	;;
1336a3680546Smrg    esac
1337a3680546Smrg  fi
1338a3680546Smrg  rm -rf conftest*
1339a3680546Smrg  ;;
1340a3680546Smrg*-*-irix6*)
1341a3680546Smrg  # Find out what ABI is being produced by ac_compile, and set linker
1342a3680546Smrg  # options accordingly.
1343a3680546Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1344a3680546Smrg  if AC_TRY_EVAL(ac_compile); then
1345a3680546Smrg    if test yes = "$lt_cv_prog_gnu_ld"; then
1346a3680546Smrg      case `$FILECMD conftest.$ac_objext` in
1347a3680546Smrg	*32-bit*)
1348a3680546Smrg	  LD="${LD-ld} -melf32bsmip"
1349a3680546Smrg	  ;;
1350a3680546Smrg	*N32*)
1351a3680546Smrg	  LD="${LD-ld} -melf32bmipn32"
1352a3680546Smrg	  ;;
1353a3680546Smrg	*64-bit*)
1354a3680546Smrg	  LD="${LD-ld} -melf64bmip"
1355a3680546Smrg	;;
1356a3680546Smrg      esac
1357a3680546Smrg    else
1358a3680546Smrg      case `$FILECMD conftest.$ac_objext` in
1359a3680546Smrg	*32-bit*)
1360a3680546Smrg	  LD="${LD-ld} -32"
1361a3680546Smrg	  ;;
1362a3680546Smrg	*N32*)
1363a3680546Smrg	  LD="${LD-ld} -n32"
1364a3680546Smrg	  ;;
1365a3680546Smrg	*64-bit*)
1366a3680546Smrg	  LD="${LD-ld} -64"
1367a3680546Smrg	  ;;
1368a3680546Smrg      esac
1369a3680546Smrg    fi
1370a3680546Smrg  fi
1371a3680546Smrg  rm -rf conftest*
1372a3680546Smrg  ;;
1373a3680546Smrg
1374a3680546Smrgmips64*-*linux*)
1375a3680546Smrg  # Find out what ABI is being produced by ac_compile, and set linker
1376a3680546Smrg  # options accordingly.
1377a3680546Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1378a3680546Smrg  if AC_TRY_EVAL(ac_compile); then
1379a3680546Smrg    emul=elf
1380a3680546Smrg    case `$FILECMD conftest.$ac_objext` in
1381a3680546Smrg      *32-bit*)
1382a3680546Smrg	emul="${emul}32"
1383a3680546Smrg	;;
1384a3680546Smrg      *64-bit*)
1385a3680546Smrg	emul="${emul}64"
1386a3680546Smrg	;;
1387a3680546Smrg    esac
1388a3680546Smrg    case `$FILECMD conftest.$ac_objext` in
1389a3680546Smrg      *MSB*)
1390a3680546Smrg	emul="${emul}btsmip"
1391a3680546Smrg	;;
1392a3680546Smrg      *LSB*)
1393a3680546Smrg	emul="${emul}ltsmip"
1394a3680546Smrg	;;
1395a3680546Smrg    esac
1396a3680546Smrg    case `$FILECMD conftest.$ac_objext` in
1397a3680546Smrg      *N32*)
1398a3680546Smrg	emul="${emul}n32"
1399a3680546Smrg	;;
1400a3680546Smrg    esac
1401a3680546Smrg    LD="${LD-ld} -m $emul"
1402a3680546Smrg  fi
1403a3680546Smrg  rm -rf conftest*
1404a3680546Smrg  ;;
1405a3680546Smrg
1406a3680546Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
1407a3680546Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*)
1408a3680546Smrg  # Find out what ABI is being produced by ac_compile, and set linker
1409a3680546Smrg  # options accordingly.  Note that the listed cases only cover the
1410a3680546Smrg  # situations where additional linker options are needed (such as when
1411a3680546Smrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
1412a3680546Smrg  # vice versa); the common cases where no linker options are needed do
1413a3680546Smrg  # not appear in the list.
1414a3680546Smrg  echo 'int i;' > conftest.$ac_ext
1415a3680546Smrg  if AC_TRY_EVAL(ac_compile); then
1416a3680546Smrg    case `$FILECMD conftest.o` in
1417a3680546Smrg      *32-bit*)
1418a3680546Smrg	case $host in
1419a3680546Smrg	  x86_64-*kfreebsd*-gnu)
1420a3680546Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
1421a3680546Smrg	    ;;
1422a3680546Smrg	  x86_64-*linux*|x86_64-gnu*)
1423a3680546Smrg	    case `$FILECMD conftest.o` in
1424a3680546Smrg	      *x86-64*)
1425a3680546Smrg		LD="${LD-ld} -m elf32_x86_64"
1426a3680546Smrg		;;
1427a3680546Smrg	      *)
1428a3680546Smrg		LD="${LD-ld} -m elf_i386"
1429a3680546Smrg		;;
1430a3680546Smrg	    esac
1431a3680546Smrg	    ;;
1432a3680546Smrg	  powerpc64le-*linux*)
1433a3680546Smrg	    LD="${LD-ld} -m elf32lppclinux"
1434a3680546Smrg	    ;;
1435a3680546Smrg	  powerpc64-*linux*)
1436a3680546Smrg	    LD="${LD-ld} -m elf32ppclinux"
1437a3680546Smrg	    ;;
1438a3680546Smrg	  s390x-*linux*)
1439a3680546Smrg	    LD="${LD-ld} -m elf_s390"
1440a3680546Smrg	    ;;
1441a3680546Smrg	  sparc64-*linux*)
1442a3680546Smrg	    LD="${LD-ld} -m elf32_sparc"
1443a3680546Smrg	    ;;
1444a3680546Smrg	esac
1445a3680546Smrg	;;
1446a3680546Smrg      *64-bit*)
1447a3680546Smrg	case $host in
1448a3680546Smrg	  x86_64-*kfreebsd*-gnu)
1449a3680546Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1450a3680546Smrg	    ;;
1451a3680546Smrg	  x86_64-*linux*|x86_64-gnu*)
1452a3680546Smrg	    LD="${LD-ld} -m elf_x86_64"
1453a3680546Smrg	    ;;
1454a3680546Smrg	  powerpcle-*linux*)
1455a3680546Smrg	    LD="${LD-ld} -m elf64lppc"
1456a3680546Smrg	    ;;
1457a3680546Smrg	  powerpc-*linux*)
1458a3680546Smrg	    LD="${LD-ld} -m elf64ppc"
1459a3680546Smrg	    ;;
1460a3680546Smrg	  s390*-*linux*|s390*-*tpf*)
1461a3680546Smrg	    LD="${LD-ld} -m elf64_s390"
1462a3680546Smrg	    ;;
1463a3680546Smrg	  sparc*-*linux*)
1464a3680546Smrg	    LD="${LD-ld} -m elf64_sparc"
1465a3680546Smrg	    ;;
1466a3680546Smrg	esac
1467a3680546Smrg	;;
1468a3680546Smrg    esac
1469a3680546Smrg  fi
1470a3680546Smrg  rm -rf conftest*
1471a3680546Smrg  ;;
1472a3680546Smrg
1473a3680546Smrg*-*-sco3.2v5*)
1474a3680546Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1475a3680546Smrg  SAVE_CFLAGS=$CFLAGS
1476a3680546Smrg  CFLAGS="$CFLAGS -belf"
1477a3680546Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1478a3680546Smrg    [AC_LANG_PUSH(C)
1479a3680546Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1480a3680546Smrg     AC_LANG_POP])
1481a3680546Smrg  if test yes != "$lt_cv_cc_needs_belf"; then
1482a3680546Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1483a3680546Smrg    CFLAGS=$SAVE_CFLAGS
1484a3680546Smrg  fi
1485a3680546Smrg  ;;
1486a3680546Smrg*-*solaris*)
1487a3680546Smrg  # Find out what ABI is being produced by ac_compile, and set linker
1488a3680546Smrg  # options accordingly.
1489a3680546Smrg  echo 'int i;' > conftest.$ac_ext
1490a3680546Smrg  if AC_TRY_EVAL(ac_compile); then
1491a3680546Smrg    case `$FILECMD conftest.o` in
1492a3680546Smrg    *64-bit*)
1493a3680546Smrg      case $lt_cv_prog_gnu_ld in
1494a3680546Smrg      yes*)
1495a3680546Smrg        case $host in
1496a3680546Smrg        i?86-*-solaris*|x86_64-*-solaris*)
1497a3680546Smrg          LD="${LD-ld} -m elf_x86_64"
1498a3680546Smrg          ;;
1499a3680546Smrg        sparc*-*-solaris*)
1500a3680546Smrg          LD="${LD-ld} -m elf64_sparc"
1501a3680546Smrg          ;;
1502a3680546Smrg        esac
1503a3680546Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
1504a3680546Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1505a3680546Smrg          LD=${LD-ld}_sol2
1506a3680546Smrg        fi
1507a3680546Smrg        ;;
1508a3680546Smrg      *)
1509a3680546Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1510a3680546Smrg	  LD="${LD-ld} -64"
1511a3680546Smrg	fi
1512a3680546Smrg	;;
1513a3680546Smrg      esac
1514a3680546Smrg      ;;
1515a3680546Smrg    esac
1516a3680546Smrg  fi
1517a3680546Smrg  rm -rf conftest*
1518a3680546Smrg  ;;
1519a3680546Smrgesac
1520a3680546Smrg
1521a3680546Smrgneed_locks=$enable_libtool_lock
1522a3680546Smrg])# _LT_ENABLE_LOCK
1523a3680546Smrg
1524a3680546Smrg
1525a3680546Smrg# _LT_PROG_AR
1526a3680546Smrg# -----------
1527a3680546Smrgm4_defun([_LT_PROG_AR],
1528a3680546Smrg[AC_CHECK_TOOLS(AR, [ar], false)
1529a3680546Smrg: ${AR=ar}
1530a3680546Smrg_LT_DECL([], [AR], [1], [The archiver])
1531a3680546Smrg
1532a3680546Smrg# Use ARFLAGS variable as AR's operation code to sync the variable naming with
1533a3680546Smrg# Automake.  If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
1534a3680546Smrg# higher priority because that's what people were doing historically (setting
1535a3680546Smrg# ARFLAGS for automake and AR_FLAGS for libtool).  FIXME: Make the AR_FLAGS
1536a3680546Smrg# variable obsoleted/removed.
1537a3680546Smrg
1538a3680546Smrgtest ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
1539a3680546Smrglt_ar_flags=$AR_FLAGS
1540a3680546Smrg_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
1541a3680546Smrg
1542a3680546Smrg# Make AR_FLAGS overridable by 'make ARFLAGS='.  Don't try to run-time override
1543a3680546Smrg# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
1544a3680546Smrg_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
1545a3680546Smrg         [Flags to create an archive])
1546a3680546Smrg
1547a3680546SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1548a3680546Smrg  [lt_cv_ar_at_file=no
1549a3680546Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1550a3680546Smrg     [echo conftest.$ac_objext > conftest.lst
1551a3680546Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1552a3680546Smrg      AC_TRY_EVAL([lt_ar_try])
1553a3680546Smrg      if test 0 -eq "$ac_status"; then
1554a3680546Smrg	# Ensure the archiver fails upon bogus file names.
1555a3680546Smrg	rm -f conftest.$ac_objext libconftest.a
1556a3680546Smrg	AC_TRY_EVAL([lt_ar_try])
1557a3680546Smrg	if test 0 -ne "$ac_status"; then
1558a3680546Smrg          lt_cv_ar_at_file=@
1559a3680546Smrg        fi
1560a3680546Smrg      fi
1561a3680546Smrg      rm -f conftest.* libconftest.a
1562a3680546Smrg     ])
1563a3680546Smrg  ])
1564a3680546Smrg
1565a3680546Smrgif test no = "$lt_cv_ar_at_file"; then
1566a3680546Smrg  archiver_list_spec=
1567a3680546Smrgelse
1568a3680546Smrg  archiver_list_spec=$lt_cv_ar_at_file
1569a3680546Smrgfi
1570a3680546Smrg_LT_DECL([], [archiver_list_spec], [1],
1571a3680546Smrg  [How to feed a file listing to the archiver])
1572a3680546Smrg])# _LT_PROG_AR
1573a3680546Smrg
1574a3680546Smrg
1575a3680546Smrg# _LT_CMD_OLD_ARCHIVE
1576a3680546Smrg# -------------------
1577a3680546Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1578a3680546Smrg[_LT_PROG_AR
1579a3680546Smrg
1580a3680546SmrgAC_CHECK_TOOL(STRIP, strip, :)
1581a3680546Smrgtest -z "$STRIP" && STRIP=:
1582a3680546Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1583a3680546Smrg
1584a3680546SmrgAC_REQUIRE([AC_PROG_RANLIB])
1585a3680546Smrgtest -z "$RANLIB" && RANLIB=:
1586a3680546Smrg_LT_DECL([], [RANLIB], [1],
1587a3680546Smrg    [Commands used to install an old-style archive])
1588a3680546Smrg
1589a3680546Smrg# Determine commands to create old-style static archives.
1590a3680546Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1591a3680546Smrgold_postinstall_cmds='chmod 644 $oldlib'
1592a3680546Smrgold_postuninstall_cmds=
1593a3680546Smrg
1594a3680546Smrgif test -n "$RANLIB"; then
1595a3680546Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1596a3680546Smrg  old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1597a3680546Smrgfi
1598a3680546Smrg
1599a3680546Smrgcase $host_os in
1600a3680546Smrg  darwin*)
1601a3680546Smrg    lock_old_archive_extraction=yes ;;
1602a3680546Smrg  *)
1603a3680546Smrg    lock_old_archive_extraction=no ;;
1604a3680546Smrgesac
1605a3680546Smrg_LT_DECL([], [old_postinstall_cmds], [2])
1606a3680546Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
1607a3680546Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
1608a3680546Smrg    [Commands used to build an old-style archive])
1609a3680546Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
1610a3680546Smrg    [Whether to use a lock for old archive extraction])
1611a3680546Smrg])# _LT_CMD_OLD_ARCHIVE
1612a3680546Smrg
1613a3680546Smrg
1614a3680546Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1615a3680546Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1616a3680546Smrg# ----------------------------------------------------------------
1617a3680546Smrg# Check whether the given compiler option works
1618a3680546SmrgAC_DEFUN([_LT_COMPILER_OPTION],
1619a3680546Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1620a3680546Smrgm4_require([_LT_DECL_SED])dnl
1621a3680546SmrgAC_CACHE_CHECK([$1], [$2],
1622a3680546Smrg  [$2=no
1623a3680546Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1624a3680546Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1625a3680546Smrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
1626a3680546Smrg   # Insert the option either (1) after the last *FLAGS variable, or
1627a3680546Smrg   # (2) before a word containing "conftest.", or (3) at the end.
1628a3680546Smrg   # Note that $ac_compile itself does not contain backslashes and begins
1629a3680546Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1630a3680546Smrg   # The option is referenced via a variable to avoid confusing sed.
1631a3680546Smrg   lt_compile=`echo "$ac_compile" | $SED \
1632a3680546Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1633a3680546Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1634a3680546Smrg   -e 's:$: $lt_compiler_flag:'`
1635a3680546Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1636a3680546Smrg   (eval "$lt_compile" 2>conftest.err)
1637a3680546Smrg   ac_status=$?
1638a3680546Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
1639a3680546Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1640a3680546Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1641a3680546Smrg     # The compiler can only warn and ignore the option if not recognized
1642a3680546Smrg     # So say no if there are warnings other than the usual output.
1643a3680546Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1644a3680546Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1645a3680546Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1646a3680546Smrg       $2=yes
1647a3680546Smrg     fi
1648a3680546Smrg   fi
1649a3680546Smrg   $RM conftest*
1650a3680546Smrg])
1651a3680546Smrg
1652a3680546Smrgif test yes = "[$]$2"; then
1653a3680546Smrg    m4_if([$5], , :, [$5])
1654a3680546Smrgelse
1655a3680546Smrg    m4_if([$6], , :, [$6])
1656a3680546Smrgfi
1657a3680546Smrg])# _LT_COMPILER_OPTION
1658a3680546Smrg
1659a3680546Smrg# Old name:
1660a3680546SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1661a3680546Smrgdnl aclocal-1.4 backwards compatibility:
1662a3680546Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1663a3680546Smrg
1664a3680546Smrg
1665a3680546Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1666a3680546Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1667a3680546Smrg# ----------------------------------------------------
1668a3680546Smrg# Check whether the given linker option works
1669a3680546SmrgAC_DEFUN([_LT_LINKER_OPTION],
1670a3680546Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1671a3680546Smrgm4_require([_LT_DECL_SED])dnl
1672a3680546SmrgAC_CACHE_CHECK([$1], [$2],
1673a3680546Smrg  [$2=no
1674a3680546Smrg   save_LDFLAGS=$LDFLAGS
1675a3680546Smrg   LDFLAGS="$LDFLAGS $3"
1676a3680546Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1677a3680546Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1678a3680546Smrg     # The linker can only warn and ignore the option if not recognized
1679a3680546Smrg     # So say no if there are warnings
1680a3680546Smrg     if test -s conftest.err; then
1681a3680546Smrg       # Append any errors to the config.log.
1682a3680546Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1683a3680546Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1684a3680546Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1685a3680546Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
1686a3680546Smrg         $2=yes
1687a3680546Smrg       fi
1688a3680546Smrg     else
1689a3680546Smrg       $2=yes
1690a3680546Smrg     fi
1691a3680546Smrg   fi
1692a3680546Smrg   $RM -r conftest*
1693a3680546Smrg   LDFLAGS=$save_LDFLAGS
1694a3680546Smrg])
1695a3680546Smrg
1696a3680546Smrgif test yes = "[$]$2"; then
1697a3680546Smrg    m4_if([$4], , :, [$4])
1698a3680546Smrgelse
1699a3680546Smrg    m4_if([$5], , :, [$5])
1700a3680546Smrgfi
1701a3680546Smrg])# _LT_LINKER_OPTION
1702a3680546Smrg
1703a3680546Smrg# Old name:
1704a3680546SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1705a3680546Smrgdnl aclocal-1.4 backwards compatibility:
1706a3680546Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1707a3680546Smrg
1708a3680546Smrg
1709a3680546Smrg# LT_CMD_MAX_LEN
1710a3680546Smrg#---------------
1711a3680546SmrgAC_DEFUN([LT_CMD_MAX_LEN],
1712a3680546Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1713a3680546Smrg# find the maximum length of command line arguments
1714a3680546SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
1715a3680546SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1716a3680546Smrg  i=0
1717a3680546Smrg  teststring=ABCD
1718a3680546Smrg
1719a3680546Smrg  case $build_os in
1720a3680546Smrg  msdosdjgpp*)
1721a3680546Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
1722a3680546Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
1723a3680546Smrg    # during glob expansion).  Even if it were fixed, the result of this
1724a3680546Smrg    # check would be larger than it should be.
1725a3680546Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1726a3680546Smrg    ;;
1727a3680546Smrg
1728a3680546Smrg  gnu* | ironclad*)
1729a3680546Smrg    # Under GNU Hurd and Ironclad, this test is not required because there
1730a3680546Smrg    # is no limit to the length of command line arguments.
1731a3680546Smrg    # Libtool will interpret -1 as no limit whatsoever
1732a3680546Smrg    lt_cv_sys_max_cmd_len=-1;
1733a3680546Smrg    ;;
1734a3680546Smrg
1735a3680546Smrg  cygwin* | mingw* | windows* | cegcc*)
1736a3680546Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
1737a3680546Smrg    # about 5 minutes as the teststring grows exponentially.
1738a3680546Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
1739a3680546Smrg    # you end up with a "frozen" computer, even though with patience
1740a3680546Smrg    # the test eventually succeeds (with a max line length of 256k).
1741a3680546Smrg    # Instead, let's just punt: use the minimum linelength reported by
1742a3680546Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
1743a3680546Smrg    lt_cv_sys_max_cmd_len=8192;
1744a3680546Smrg    ;;
1745a3680546Smrg
1746a3680546Smrg  mint*)
1747a3680546Smrg    # On MiNT this can take a long time and run out of memory.
1748a3680546Smrg    lt_cv_sys_max_cmd_len=8192;
1749a3680546Smrg    ;;
1750a3680546Smrg
1751a3680546Smrg  amigaos*)
1752a3680546Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
1753a3680546Smrg    # So we just punt and use a minimum line length of 8192.
1754a3680546Smrg    lt_cv_sys_max_cmd_len=8192;
1755a3680546Smrg    ;;
1756a3680546Smrg
1757a3680546Smrg  darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
1758a3680546Smrg    # This has been around since 386BSD, at least.  Likely further.
1759a3680546Smrg    if test -x /sbin/sysctl; then
1760a3680546Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1761a3680546Smrg    elif test -x /usr/sbin/sysctl; then
1762a3680546Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1763a3680546Smrg    else
1764a3680546Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1765a3680546Smrg    fi
1766a3680546Smrg    # And add a safety zone
1767a3680546Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1768a3680546Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1769a3680546Smrg    ;;
1770a3680546Smrg
1771a3680546Smrg  interix*)
1772a3680546Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1773a3680546Smrg    lt_cv_sys_max_cmd_len=196608
1774a3680546Smrg    ;;
1775a3680546Smrg
1776a3680546Smrg  os2*)
1777a3680546Smrg    # The test takes a long time on OS/2.
1778a3680546Smrg    lt_cv_sys_max_cmd_len=8192
1779a3680546Smrg    ;;
1780a3680546Smrg
1781a3680546Smrg  osf*)
1782a3680546Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1783a3680546Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1784a3680546Smrg    # nice to cause kernel panics so lets avoid the loop below.
1785a3680546Smrg    # First set a reasonable default.
1786a3680546Smrg    lt_cv_sys_max_cmd_len=16384
1787a3680546Smrg    #
1788a3680546Smrg    if test -x /sbin/sysconfig; then
1789a3680546Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1790a3680546Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1791a3680546Smrg      esac
1792a3680546Smrg    fi
1793a3680546Smrg    ;;
1794a3680546Smrg  sco3.2v5*)
1795a3680546Smrg    lt_cv_sys_max_cmd_len=102400
1796a3680546Smrg    ;;
1797a3680546Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
1798a3680546Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1799a3680546Smrg    if test -n "$kargmax"; then
1800a3680546Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[	 ]]//'`
1801a3680546Smrg    else
1802a3680546Smrg      lt_cv_sys_max_cmd_len=32768
1803a3680546Smrg    fi
1804a3680546Smrg    ;;
1805a3680546Smrg  *)
1806a3680546Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1807a3680546Smrg    if test -n "$lt_cv_sys_max_cmd_len" && \
1808a3680546Smrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
1809a3680546Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1810a3680546Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1811a3680546Smrg    else
1812a3680546Smrg      # Make teststring a little bigger before we do anything with it.
1813a3680546Smrg      # a 1K string should be a reasonable start.
1814a3680546Smrg      for i in 1 2 3 4 5 6 7 8; do
1815a3680546Smrg        teststring=$teststring$teststring
1816a3680546Smrg      done
1817a3680546Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1818a3680546Smrg      # If test is not a shell built-in, we'll probably end up computing a
1819a3680546Smrg      # maximum length that is only half of the actual maximum length, but
1820a3680546Smrg      # we can't tell.
1821a3680546Smrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
1822a3680546Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1823a3680546Smrg	      test 17 != "$i" # 1/2 MB should be enough
1824a3680546Smrg      do
1825a3680546Smrg        i=`expr $i + 1`
1826a3680546Smrg        teststring=$teststring$teststring
1827a3680546Smrg      done
1828a3680546Smrg      # Only check the string length outside the loop.
1829a3680546Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1830a3680546Smrg      teststring=
1831a3680546Smrg      # Add a significant safety factor because C++ compilers can tack on
1832a3680546Smrg      # massive amounts of additional arguments before passing them to the
1833a3680546Smrg      # linker.  It appears as though 1/2 is a usable value.
1834a3680546Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1835a3680546Smrg    fi
1836a3680546Smrg    ;;
1837a3680546Smrg  esac
1838a3680546Smrg])
1839a3680546Smrgif test -n "$lt_cv_sys_max_cmd_len"; then
1840a3680546Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1841a3680546Smrgelse
1842a3680546Smrg  AC_MSG_RESULT(none)
1843a3680546Smrgfi
1844a3680546Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1845a3680546Smrg_LT_DECL([], [max_cmd_len], [0],
1846a3680546Smrg    [What is the maximum length of a command?])
1847a3680546Smrg])# LT_CMD_MAX_LEN
1848a3680546Smrg
1849a3680546Smrg# Old name:
1850a3680546SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1851a3680546Smrgdnl aclocal-1.4 backwards compatibility:
1852a3680546Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1853a3680546Smrg
1854a3680546Smrg
1855a3680546Smrg# _LT_HEADER_DLFCN
1856a3680546Smrg# ----------------
1857a3680546Smrgm4_defun([_LT_HEADER_DLFCN],
1858a3680546Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1859a3680546Smrg])# _LT_HEADER_DLFCN
1860a3680546Smrg
1861a3680546Smrg
1862a3680546Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1863a3680546Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1864a3680546Smrg# ----------------------------------------------------------------
1865a3680546Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
1866a3680546Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1867a3680546Smrgif test yes = "$cross_compiling"; then :
1868a3680546Smrg  [$4]
1869a3680546Smrgelse
1870a3680546Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1871a3680546Smrg  lt_status=$lt_dlunknown
1872a3680546Smrg  cat > conftest.$ac_ext <<_LT_EOF
1873a3680546Smrg[#line $LINENO "configure"
1874a3680546Smrg#include "confdefs.h"
1875a3680546Smrg
1876a3680546Smrg#if HAVE_DLFCN_H
1877a3680546Smrg#include <dlfcn.h>
1878a3680546Smrg#endif
1879a3680546Smrg
1880a3680546Smrg#include <stdio.h>
1881a3680546Smrg
1882a3680546Smrg#ifdef RTLD_GLOBAL
1883a3680546Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
1884a3680546Smrg#else
1885a3680546Smrg#  ifdef DL_GLOBAL
1886a3680546Smrg#    define LT_DLGLOBAL		DL_GLOBAL
1887a3680546Smrg#  else
1888a3680546Smrg#    define LT_DLGLOBAL		0
1889a3680546Smrg#  endif
1890a3680546Smrg#endif
1891a3680546Smrg
1892a3680546Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1893a3680546Smrg   find out it does not work in some platform. */
1894a3680546Smrg#ifndef LT_DLLAZY_OR_NOW
1895a3680546Smrg#  ifdef RTLD_LAZY
1896a3680546Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1897a3680546Smrg#  else
1898a3680546Smrg#    ifdef DL_LAZY
1899a3680546Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
1900a3680546Smrg#    else
1901a3680546Smrg#      ifdef RTLD_NOW
1902a3680546Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1903a3680546Smrg#      else
1904a3680546Smrg#        ifdef DL_NOW
1905a3680546Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
1906a3680546Smrg#        else
1907a3680546Smrg#          define LT_DLLAZY_OR_NOW	0
1908a3680546Smrg#        endif
1909a3680546Smrg#      endif
1910a3680546Smrg#    endif
1911a3680546Smrg#  endif
1912a3680546Smrg#endif
1913a3680546Smrg
1914a3680546Smrg/* When -fvisibility=hidden is used, assume the code has been annotated
1915a3680546Smrg   correspondingly for the symbols needed.  */
1916a3680546Smrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1917a3680546Smrgint fnord (void) __attribute__((visibility("default")));
1918a3680546Smrg#endif
1919a3680546Smrg
1920a3680546Smrgint fnord (void) { return 42; }
1921a3680546Smrgint main (void)
1922a3680546Smrg{
1923a3680546Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1924a3680546Smrg  int status = $lt_dlunknown;
1925a3680546Smrg
1926a3680546Smrg  if (self)
1927a3680546Smrg    {
1928a3680546Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1929a3680546Smrg      else
1930a3680546Smrg        {
1931a3680546Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
1932a3680546Smrg          else puts (dlerror ());
1933a3680546Smrg	}
1934a3680546Smrg      /* dlclose (self); */
1935a3680546Smrg    }
1936a3680546Smrg  else
1937a3680546Smrg    puts (dlerror ());
1938a3680546Smrg
1939a3680546Smrg  return status;
1940a3680546Smrg}]
1941a3680546Smrg_LT_EOF
1942a3680546Smrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
1943a3680546Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1944a3680546Smrg    lt_status=$?
1945a3680546Smrg    case x$lt_status in
1946a3680546Smrg      x$lt_dlno_uscore) $1 ;;
1947a3680546Smrg      x$lt_dlneed_uscore) $2 ;;
1948a3680546Smrg      x$lt_dlunknown|x*) $3 ;;
1949a3680546Smrg    esac
1950a3680546Smrg  else :
1951a3680546Smrg    # compilation failed
1952a3680546Smrg    $3
1953a3680546Smrg  fi
1954a3680546Smrgfi
1955a3680546Smrgrm -fr conftest*
1956a3680546Smrg])# _LT_TRY_DLOPEN_SELF
1957a3680546Smrg
1958a3680546Smrg
1959a3680546Smrg# LT_SYS_DLOPEN_SELF
1960a3680546Smrg# ------------------
1961a3680546SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1962a3680546Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1963a3680546Smrgif test yes != "$enable_dlopen"; then
1964a3680546Smrg  enable_dlopen=unknown
1965a3680546Smrg  enable_dlopen_self=unknown
1966a3680546Smrg  enable_dlopen_self_static=unknown
1967a3680546Smrgelse
1968a3680546Smrg  lt_cv_dlopen=no
1969a3680546Smrg  lt_cv_dlopen_libs=
1970a3680546Smrg
1971a3680546Smrg  case $host_os in
1972a3680546Smrg  beos*)
1973a3680546Smrg    lt_cv_dlopen=load_add_on
1974a3680546Smrg    lt_cv_dlopen_libs=
1975a3680546Smrg    lt_cv_dlopen_self=yes
1976a3680546Smrg    ;;
1977a3680546Smrg
1978a3680546Smrg  mingw* | windows* | pw32* | cegcc*)
1979a3680546Smrg    lt_cv_dlopen=LoadLibrary
1980a3680546Smrg    lt_cv_dlopen_libs=
1981a3680546Smrg    ;;
1982a3680546Smrg
1983a3680546Smrg  cygwin*)
1984a3680546Smrg    lt_cv_dlopen=dlopen
1985a3680546Smrg    lt_cv_dlopen_libs=
1986a3680546Smrg    ;;
1987a3680546Smrg
1988a3680546Smrg  darwin*)
1989a3680546Smrg    # if libdl is installed we need to link against it
1990a3680546Smrg    AC_CHECK_LIB([dl], [dlopen],
1991a3680546Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
1992a3680546Smrg    lt_cv_dlopen=dyld
1993a3680546Smrg    lt_cv_dlopen_libs=
1994a3680546Smrg    lt_cv_dlopen_self=yes
1995a3680546Smrg    ])
1996a3680546Smrg    ;;
1997a3680546Smrg
1998a3680546Smrg  tpf*)
1999a3680546Smrg    # Don't try to run any link tests for TPF.  We know it's impossible
2000a3680546Smrg    # because TPF is a cross-compiler, and we know how we open DSOs.
2001a3680546Smrg    lt_cv_dlopen=dlopen
2002a3680546Smrg    lt_cv_dlopen_libs=
2003a3680546Smrg    lt_cv_dlopen_self=no
2004a3680546Smrg    ;;
2005a3680546Smrg
2006a3680546Smrg  *)
2007a3680546Smrg    AC_CHECK_FUNC([shl_load],
2008a3680546Smrg	  [lt_cv_dlopen=shl_load],
2009a3680546Smrg      [AC_CHECK_LIB([dld], [shl_load],
2010a3680546Smrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
2011a3680546Smrg	[AC_CHECK_FUNC([dlopen],
2012a3680546Smrg	      [lt_cv_dlopen=dlopen],
2013a3680546Smrg	  [AC_CHECK_LIB([dl], [dlopen],
2014a3680546Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
2015a3680546Smrg	    [AC_CHECK_LIB([svld], [dlopen],
2016a3680546Smrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
2017a3680546Smrg	      [AC_CHECK_LIB([dld], [dld_link],
2018a3680546Smrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
2019a3680546Smrg	      ])
2020a3680546Smrg	    ])
2021a3680546Smrg	  ])
2022a3680546Smrg	])
2023a3680546Smrg      ])
2024a3680546Smrg    ;;
2025a3680546Smrg  esac
2026a3680546Smrg
2027a3680546Smrg  if test no = "$lt_cv_dlopen"; then
2028a3680546Smrg    enable_dlopen=no
2029a3680546Smrg  else
2030a3680546Smrg    enable_dlopen=yes
2031a3680546Smrg  fi
2032a3680546Smrg
2033a3680546Smrg  case $lt_cv_dlopen in
2034a3680546Smrg  dlopen)
2035a3680546Smrg    save_CPPFLAGS=$CPPFLAGS
2036a3680546Smrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2037a3680546Smrg
2038a3680546Smrg    save_LDFLAGS=$LDFLAGS
2039a3680546Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2040a3680546Smrg
2041a3680546Smrg    save_LIBS=$LIBS
2042a3680546Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
2043a3680546Smrg
2044a3680546Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
2045a3680546Smrg	  lt_cv_dlopen_self, [dnl
2046a3680546Smrg	  _LT_TRY_DLOPEN_SELF(
2047a3680546Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2048a3680546Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2049a3680546Smrg    ])
2050a3680546Smrg
2051a3680546Smrg    if test yes = "$lt_cv_dlopen_self"; then
2052a3680546Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2053a3680546Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2054a3680546Smrg	  lt_cv_dlopen_self_static, [dnl
2055a3680546Smrg	  _LT_TRY_DLOPEN_SELF(
2056a3680546Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2057a3680546Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2058a3680546Smrg      ])
2059a3680546Smrg    fi
2060a3680546Smrg
2061a3680546Smrg    CPPFLAGS=$save_CPPFLAGS
2062a3680546Smrg    LDFLAGS=$save_LDFLAGS
2063a3680546Smrg    LIBS=$save_LIBS
2064a3680546Smrg    ;;
2065a3680546Smrg  esac
2066a3680546Smrg
2067a3680546Smrg  case $lt_cv_dlopen_self in
2068a3680546Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2069a3680546Smrg  *) enable_dlopen_self=unknown ;;
2070a3680546Smrg  esac
2071a3680546Smrg
2072a3680546Smrg  case $lt_cv_dlopen_self_static in
2073a3680546Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2074a3680546Smrg  *) enable_dlopen_self_static=unknown ;;
2075a3680546Smrg  esac
2076a3680546Smrgfi
2077a3680546Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
2078a3680546Smrg	 [Whether dlopen is supported])
2079a3680546Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2080a3680546Smrg	 [Whether dlopen of programs is supported])
2081a3680546Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2082a3680546Smrg	 [Whether dlopen of statically linked programs is supported])
2083a3680546Smrg])# LT_SYS_DLOPEN_SELF
2084a3680546Smrg
2085a3680546Smrg# Old name:
2086a3680546SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2087a3680546Smrgdnl aclocal-1.4 backwards compatibility:
2088a3680546Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2089a3680546Smrg
2090a3680546Smrg
2091a3680546Smrg# _LT_COMPILER_C_O([TAGNAME])
2092a3680546Smrg# ---------------------------
2093a3680546Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
2094a3680546Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
2095a3680546Smrgm4_defun([_LT_COMPILER_C_O],
2096a3680546Smrg[m4_require([_LT_DECL_SED])dnl
2097a3680546Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2098a3680546Smrgm4_require([_LT_TAG_COMPILER])dnl
2099a3680546SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2100a3680546Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2101a3680546Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2102a3680546Smrg   $RM -r conftest 2>/dev/null
2103a3680546Smrg   mkdir conftest
2104a3680546Smrg   cd conftest
2105a3680546Smrg   mkdir out
2106a3680546Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2107a3680546Smrg
2108a3680546Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
2109a3680546Smrg   # Insert the option either (1) after the last *FLAGS variable, or
2110a3680546Smrg   # (2) before a word containing "conftest.", or (3) at the end.
2111a3680546Smrg   # Note that $ac_compile itself does not contain backslashes and begins
2112a3680546Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
2113a3680546Smrg   lt_compile=`echo "$ac_compile" | $SED \
2114a3680546Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2115a3680546Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2116a3680546Smrg   -e 's:$: $lt_compiler_flag:'`
2117a3680546Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2118a3680546Smrg   (eval "$lt_compile" 2>out/conftest.err)
2119a3680546Smrg   ac_status=$?
2120a3680546Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
2121a3680546Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2122a3680546Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
2123a3680546Smrg   then
2124a3680546Smrg     # The compiler can only warn and ignore the option if not recognized
2125a3680546Smrg     # So say no if there are warnings
2126a3680546Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2127a3680546Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2128a3680546Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2129a3680546Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2130a3680546Smrg     fi
2131a3680546Smrg   fi
2132a3680546Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2133a3680546Smrg   $RM conftest*
2134a3680546Smrg   # SGI C++ compiler will create directory out/ii_files/ for
2135a3680546Smrg   # template instantiation
2136a3680546Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2137a3680546Smrg   $RM out/* && rmdir out
2138a3680546Smrg   cd ..
2139a3680546Smrg   $RM -r conftest
2140a3680546Smrg   $RM conftest*
2141a3680546Smrg])
2142a3680546Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2143a3680546Smrg	[Does compiler simultaneously support -c and -o options?])
2144a3680546Smrg])# _LT_COMPILER_C_O
2145a3680546Smrg
2146a3680546Smrg
2147a3680546Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2148a3680546Smrg# ----------------------------------
2149a3680546Smrg# Check to see if we can do hard links to lock some files if needed
2150a3680546Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
2151a3680546Smrg[m4_require([_LT_ENABLE_LOCK])dnl
2152a3680546Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2153a3680546Smrg_LT_COMPILER_C_O([$1])
2154a3680546Smrg
2155a3680546Smrghard_links=nottested
2156a3680546Smrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
2157a3680546Smrg  # do not overwrite the value of need_locks provided by the user
2158a3680546Smrg  AC_MSG_CHECKING([if we can lock with hard links])
2159a3680546Smrg  hard_links=yes
2160a3680546Smrg  $RM conftest*
2161a3680546Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2162a3680546Smrg  touch conftest.a
2163a3680546Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
2164a3680546Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2165a3680546Smrg  AC_MSG_RESULT([$hard_links])
2166a3680546Smrg  if test no = "$hard_links"; then
2167a3680546Smrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
2168a3680546Smrg    need_locks=warn
2169a3680546Smrg  fi
2170a3680546Smrgelse
2171a3680546Smrg  need_locks=no
2172a3680546Smrgfi
2173a3680546Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2174a3680546Smrg])# _LT_COMPILER_FILE_LOCKS
2175a3680546Smrg
2176a3680546Smrg
2177a3680546Smrg# _LT_CHECK_OBJDIR
2178a3680546Smrg# ----------------
2179a3680546Smrgm4_defun([_LT_CHECK_OBJDIR],
2180a3680546Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2181a3680546Smrg[rm -f .libs 2>/dev/null
2182a3680546Smrgmkdir .libs 2>/dev/null
2183a3680546Smrgif test -d .libs; then
2184a3680546Smrg  lt_cv_objdir=.libs
2185a3680546Smrgelse
2186a3680546Smrg  # MS-DOS does not allow filenames that begin with a dot.
2187a3680546Smrg  lt_cv_objdir=_libs
2188a3680546Smrgfi
2189a3680546Smrgrmdir .libs 2>/dev/null])
2190a3680546Smrgobjdir=$lt_cv_objdir
2191a3680546Smrg_LT_DECL([], [objdir], [0],
2192a3680546Smrg         [The name of the directory that contains temporary libtool files])dnl
2193a3680546Smrgm4_pattern_allow([LT_OBJDIR])dnl
2194a3680546SmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
2195a3680546Smrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
2196a3680546Smrg])# _LT_CHECK_OBJDIR
2197a3680546Smrg
2198a3680546Smrg
2199a3680546Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2200a3680546Smrg# --------------------------------------
2201a3680546Smrg# Check hardcoding attributes.
2202a3680546Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2203a3680546Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
2204a3680546Smrg_LT_TAGVAR(hardcode_action, $1)=
2205a3680546Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2206a3680546Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2207a3680546Smrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
2208a3680546Smrg
2209a3680546Smrg  # We can hardcode non-existent directories.
2210a3680546Smrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
2211a3680546Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2212a3680546Smrg     # have to relink, otherwise we might link with an installed library
2213a3680546Smrg     # when we should be linking with a yet-to-be-installed one
2214a3680546Smrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
2215a3680546Smrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
2216a3680546Smrg    # Linking always hardcodes the temporary library directory.
2217a3680546Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
2218a3680546Smrg  else
2219a3680546Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2220a3680546Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
2221a3680546Smrg  fi
2222a3680546Smrgelse
2223a3680546Smrg  # We cannot hardcode anything, or else we can only hardcode existing
2224a3680546Smrg  # directories.
2225a3680546Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
2226a3680546Smrgfi
2227a3680546SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2228a3680546Smrg
2229a3680546Smrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
2230a3680546Smrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
2231a3680546Smrg  # Fast installation is not supported
2232a3680546Smrg  enable_fast_install=no
2233a3680546Smrgelif test yes = "$shlibpath_overrides_runpath" ||
2234a3680546Smrg     test no = "$enable_shared"; then
2235a3680546Smrg  # Fast installation is not necessary
2236a3680546Smrg  enable_fast_install=needless
2237a3680546Smrgfi
2238a3680546Smrg_LT_TAGDECL([], [hardcode_action], [0],
2239a3680546Smrg    [How to hardcode a shared library path into an executable])
2240a3680546Smrg])# _LT_LINKER_HARDCODE_LIBPATH
2241a3680546Smrg
2242a3680546Smrg
2243a3680546Smrg# _LT_CMD_STRIPLIB
2244a3680546Smrg# ----------------
2245a3680546Smrgm4_defun([_LT_CMD_STRIPLIB],
2246a3680546Smrg[m4_require([_LT_DECL_EGREP])
2247a3680546Smrgstriplib=
2248a3680546Smrgold_striplib=
2249a3680546SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2250a3680546Smrgif test -z "$STRIP"; then
2251a3680546Smrg  AC_MSG_RESULT([no])
2252a3680546Smrgelse
2253a3680546Smrg  if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2254a3680546Smrg    old_striplib="$STRIP --strip-debug"
2255a3680546Smrg    striplib="$STRIP --strip-unneeded"
2256a3680546Smrg    AC_MSG_RESULT([yes])
2257a3680546Smrg  else
2258a3680546Smrg    case $host_os in
2259a3680546Smrg    darwin*)
2260a3680546Smrg      # FIXME - insert some real tests, host_os isn't really good enough
2261a3680546Smrg      striplib="$STRIP -x"
2262a3680546Smrg      old_striplib="$STRIP -S"
2263a3680546Smrg      AC_MSG_RESULT([yes])
2264a3680546Smrg      ;;
2265a3680546Smrg    freebsd*)
2266a3680546Smrg      if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
2267a3680546Smrg        old_striplib="$STRIP --strip-debug"
2268a3680546Smrg        striplib="$STRIP --strip-unneeded"
2269a3680546Smrg        AC_MSG_RESULT([yes])
2270a3680546Smrg      else
2271a3680546Smrg        AC_MSG_RESULT([no])
2272a3680546Smrg      fi
2273a3680546Smrg      ;;
2274a3680546Smrg    *)
2275a3680546Smrg      AC_MSG_RESULT([no])
2276a3680546Smrg      ;;
2277a3680546Smrg    esac
2278a3680546Smrg  fi
2279a3680546Smrgfi
2280a3680546Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2281a3680546Smrg_LT_DECL([], [striplib], [1])
2282a3680546Smrg])# _LT_CMD_STRIPLIB
2283a3680546Smrg
2284a3680546Smrg
2285a3680546Smrg# _LT_PREPARE_MUNGE_PATH_LIST
2286a3680546Smrg# ---------------------------
2287a3680546Smrg# Make sure func_munge_path_list() is defined correctly.
2288a3680546Smrgm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
2289a3680546Smrg[[# func_munge_path_list VARIABLE PATH
2290a3680546Smrg# -----------------------------------
2291a3680546Smrg# VARIABLE is name of variable containing _space_ separated list of
2292a3680546Smrg# directories to be munged by the contents of PATH, which is string
2293a3680546Smrg# having a format:
2294a3680546Smrg# "DIR[:DIR]:"
2295a3680546Smrg#       string "DIR[ DIR]" will be prepended to VARIABLE
2296a3680546Smrg# ":DIR[:DIR]"
2297a3680546Smrg#       string "DIR[ DIR]" will be appended to VARIABLE
2298a3680546Smrg# "DIRP[:DIRP]::[DIRA:]DIRA"
2299a3680546Smrg#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
2300a3680546Smrg#       "DIRA[ DIRA]" will be appended to VARIABLE
2301a3680546Smrg# "DIR[:DIR]"
2302a3680546Smrg#       VARIABLE will be replaced by "DIR[ DIR]"
2303a3680546Smrgfunc_munge_path_list ()
2304a3680546Smrg{
2305a3680546Smrg    case x@S|@2 in
2306a3680546Smrg    x)
2307a3680546Smrg        ;;
2308a3680546Smrg    *:)
2309a3680546Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
2310a3680546Smrg        ;;
2311a3680546Smrg    x:*)
2312a3680546Smrg        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
2313a3680546Smrg        ;;
2314a3680546Smrg    *::*)
2315a3680546Smrg        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
2316a3680546Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
2317a3680546Smrg        ;;
2318a3680546Smrg    *)
2319a3680546Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
2320a3680546Smrg        ;;
2321a3680546Smrg    esac
2322a3680546Smrg}
2323a3680546Smrg]])# _LT_PREPARE_PATH_LIST
2324a3680546Smrg
2325a3680546Smrg
2326a3680546Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
2327a3680546Smrg# -----------------------------
2328a3680546Smrg# PORTME Fill in your ld.so characteristics
2329a3680546Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2330a3680546Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2331a3680546Smrgm4_require([_LT_DECL_EGREP])dnl
2332a3680546Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2333a3680546Smrgm4_require([_LT_DECL_OBJDUMP])dnl
2334a3680546Smrgm4_require([_LT_DECL_SED])dnl
2335a3680546Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2336a3680546Smrgm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
2337a3680546SmrgAC_MSG_CHECKING([dynamic linker characteristics])
2338a3680546Smrgm4_if([$1],
2339a3680546Smrg	[], [
2340a3680546Smrgif test yes = "$GCC"; then
2341a3680546Smrg  case $host_os in
2342a3680546Smrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
2343a3680546Smrg    *) lt_awk_arg='/^libraries:/' ;;
2344a3680546Smrg  esac
2345a3680546Smrg  case $host_os in
2346a3680546Smrg    mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
2347a3680546Smrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
2348a3680546Smrg  esac
2349a3680546Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2350a3680546Smrg  case $lt_search_path_spec in
2351a3680546Smrg  *\;*)
2352a3680546Smrg    # if the path contains ";" then we assume it to be the separator
2353a3680546Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
2354a3680546Smrg    # assumed that no part of a normal pathname contains ";" but that should
2355a3680546Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
2356a3680546Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2357a3680546Smrg    ;;
2358a3680546Smrg  *)
2359a3680546Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2360a3680546Smrg    ;;
2361a3680546Smrg  esac
2362a3680546Smrg  # Ok, now we have the path, separated by spaces, we can step through it
2363a3680546Smrg  # and add multilib dir if necessary...
2364a3680546Smrg  lt_tmp_lt_search_path_spec=
2365a3680546Smrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2366a3680546Smrg  # ...but if some path component already ends with the multilib dir we assume
2367a3680546Smrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
2368a3680546Smrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
2369a3680546Smrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
2370a3680546Smrg    lt_multi_os_dir=
2371a3680546Smrg    ;;
2372a3680546Smrg  esac
2373a3680546Smrg  for lt_sys_path in $lt_search_path_spec; do
2374a3680546Smrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
2375a3680546Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
2376a3680546Smrg    elif test -n "$lt_multi_os_dir"; then
2377a3680546Smrg      test -d "$lt_sys_path" && \
2378a3680546Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2379a3680546Smrg    fi
2380a3680546Smrg  done
2381a3680546Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2382a3680546SmrgBEGIN {RS = " "; FS = "/|\n";} {
2383a3680546Smrg  lt_foo = "";
2384a3680546Smrg  lt_count = 0;
2385a3680546Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
2386a3680546Smrg    if ($lt_i != "" && $lt_i != ".") {
2387a3680546Smrg      if ($lt_i == "..") {
2388a3680546Smrg        lt_count++;
2389a3680546Smrg      } else {
2390a3680546Smrg        if (lt_count == 0) {
2391a3680546Smrg          lt_foo = "/" $lt_i lt_foo;
2392a3680546Smrg        } else {
2393a3680546Smrg          lt_count--;
2394a3680546Smrg        }
2395a3680546Smrg      }
2396a3680546Smrg    }
2397a3680546Smrg  }
2398a3680546Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2399a3680546Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2400a3680546Smrg}'`
2401a3680546Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
2402a3680546Smrg  # for these hosts.
2403a3680546Smrg  case $host_os in
2404a3680546Smrg    mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2405a3680546Smrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
2406a3680546Smrg  esac
2407a3680546Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2408a3680546Smrgelse
2409a3680546Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2410a3680546Smrgfi])
2411a3680546Smrglibrary_names_spec=
2412a3680546Smrglibname_spec='lib$name'
2413a3680546Smrgsoname_spec=
2414a3680546Smrgshrext_cmds=.so
2415a3680546Smrgpostinstall_cmds=
2416a3680546Smrgpostuninstall_cmds=
2417a3680546Smrgfinish_cmds=
2418a3680546Smrgfinish_eval=
2419a3680546Smrgshlibpath_var=
2420a3680546Smrgshlibpath_overrides_runpath=unknown
2421a3680546Smrgversion_type=none
2422a3680546Smrgdynamic_linker="$host_os ld.so"
2423a3680546Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
2424a3680546Smrgneed_lib_prefix=unknown
2425a3680546Smrghardcode_into_libs=no
2426a3680546Smrg
2427a3680546Smrg# when you set need_version to no, make sure it does not cause -set_version
2428a3680546Smrg# flags to be left without arguments
2429a3680546Smrgneed_version=unknown
2430a3680546Smrg
2431a3680546SmrgAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
2432a3680546Smrg[User-defined run-time library search path.])
2433a3680546Smrg
2434a3680546Smrgcase $host_os in
2435a3680546Smrgaix3*)
2436a3680546Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2437a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
2438a3680546Smrg  shlibpath_var=LIBPATH
2439a3680546Smrg
2440a3680546Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
2441a3680546Smrg  soname_spec='$libname$release$shared_ext$major'
2442a3680546Smrg  ;;
2443a3680546Smrg
2444a3680546Smrgaix[[4-9]]*)
2445a3680546Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2446a3680546Smrg  need_lib_prefix=no
2447a3680546Smrg  need_version=no
2448a3680546Smrg  hardcode_into_libs=yes
2449a3680546Smrg  if test ia64 = "$host_cpu"; then
2450a3680546Smrg    # AIX 5 supports IA64
2451a3680546Smrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
2452a3680546Smrg    shlibpath_var=LD_LIBRARY_PATH
2453a3680546Smrg  else
2454a3680546Smrg    # With GCC up to 2.95.x, collect2 would create an import file
2455a3680546Smrg    # for dependence libraries.  The import file would start with
2456a3680546Smrg    # the line '#! .'.  This would cause the generated library to
2457a3680546Smrg    # depend on '.', always an invalid library.  This was fixed in
2458a3680546Smrg    # development snapshots of GCC prior to 3.0.
2459a3680546Smrg    case $host_os in
2460a3680546Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
2461a3680546Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2462a3680546Smrg	   echo ' yes '
2463a3680546Smrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
2464a3680546Smrg	:
2465a3680546Smrg      else
2466a3680546Smrg	can_build_shared=no
2467a3680546Smrg      fi
2468a3680546Smrg      ;;
2469a3680546Smrg    esac
2470a3680546Smrg    # Using Import Files as archive members, it is possible to support
2471a3680546Smrg    # filename-based versioning of shared library archives on AIX. While
2472a3680546Smrg    # this would work for both with and without runtime linking, it will
2473a3680546Smrg    # prevent static linking of such archives. So we do filename-based
2474a3680546Smrg    # shared library versioning with .so extension only, which is used
2475a3680546Smrg    # when both runtime linking and shared linking is enabled.
2476a3680546Smrg    # Unfortunately, runtime linking may impact performance, so we do
2477a3680546Smrg    # not want this to be the default eventually. Also, we use the
2478a3680546Smrg    # versioned .so libs for executables only if there is the -brtl
2479a3680546Smrg    # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only.
2480a3680546Smrg    # To allow for filename-based versioning support, we need to create
2481a3680546Smrg    # libNAME.so.V as an archive file, containing:
2482a3680546Smrg    # *) an Import File, referring to the versioned filename of the
2483a3680546Smrg    #    archive as well as the shared archive member, telling the
2484a3680546Smrg    #    bitwidth (32 or 64) of that shared object, and providing the
2485a3680546Smrg    #    list of exported symbols of that shared object, eventually
2486a3680546Smrg    #    decorated with the 'weak' keyword
2487a3680546Smrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
2488a3680546Smrg    #    it being seen by the linker.
2489a3680546Smrg    # At run time we better use the real file rather than another symlink,
2490a3680546Smrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
2491a3680546Smrg
2492a3680546Smrg    case $with_aix_soname,$aix_use_runtimelinking in
2493a3680546Smrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
2494a3680546Smrg    # soname into executable. Probably we can add versioning support to
2495a3680546Smrg    # collect2, so additional links can be useful in future.
2496a3680546Smrg    aix,yes) # traditional libtool
2497a3680546Smrg      dynamic_linker='AIX unversionable lib.so'
2498a3680546Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2499a3680546Smrg      # instead of lib<name>.a to let people know that these are not
2500a3680546Smrg      # typical AIX shared libraries.
2501a3680546Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2502a3680546Smrg      ;;
2503a3680546Smrg    aix,no) # traditional AIX only
2504a3680546Smrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
2505a3680546Smrg      # We preserve .a as extension for shared libraries through AIX4.2
2506a3680546Smrg      # and later when we are not doing run time linking.
2507a3680546Smrg      library_names_spec='$libname$release.a $libname.a'
2508a3680546Smrg      soname_spec='$libname$release$shared_ext$major'
2509a3680546Smrg      ;;
2510a3680546Smrg    svr4,*) # full svr4 only
2511a3680546Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
2512a3680546Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2513a3680546Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
2514a3680546Smrg      shlibpath_overrides_runpath=yes
2515a3680546Smrg      ;;
2516a3680546Smrg    *,yes) # both, prefer svr4
2517a3680546Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
2518a3680546Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2519a3680546Smrg      # unpreferred sharedlib libNAME.a needs extra handling
2520a3680546Smrg      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"'
2521a3680546Smrg      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"'
2522a3680546Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
2523a3680546Smrg      shlibpath_overrides_runpath=yes
2524a3680546Smrg      ;;
2525a3680546Smrg    *,no) # both, prefer aix
2526a3680546Smrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
2527a3680546Smrg      library_names_spec='$libname$release.a $libname.a'
2528a3680546Smrg      soname_spec='$libname$release$shared_ext$major'
2529a3680546Smrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
2530a3680546Smrg      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)'
2531a3680546Smrg      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"'
2532a3680546Smrg      ;;
2533a3680546Smrg    esac
2534a3680546Smrg    shlibpath_var=LIBPATH
2535a3680546Smrg  fi
2536a3680546Smrg  ;;
2537a3680546Smrg
2538a3680546Smrgamigaos*)
2539a3680546Smrg  case $host_cpu in
2540a3680546Smrg  powerpc)
2541a3680546Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2542a3680546Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2543a3680546Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2544a3680546Smrg    ;;
2545a3680546Smrg  m68k)
2546a3680546Smrg    library_names_spec='$libname.ixlibrary $libname.a'
2547a3680546Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2548a3680546Smrg    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'
2549a3680546Smrg    ;;
2550a3680546Smrg  esac
2551a3680546Smrg  ;;
2552a3680546Smrg
2553a3680546Smrgbeos*)
2554a3680546Smrg  library_names_spec='$libname$shared_ext'
2555a3680546Smrg  dynamic_linker="$host_os ld.so"
2556a3680546Smrg  shlibpath_var=LIBRARY_PATH
2557a3680546Smrg  ;;
2558a3680546Smrg
2559a3680546Smrgbsdi[[45]]*)
2560a3680546Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2561a3680546Smrg  need_version=no
2562a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2563a3680546Smrg  soname_spec='$libname$release$shared_ext$major'
2564a3680546Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2565a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
2566a3680546Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2567a3680546Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2568a3680546Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
2569a3680546Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2570a3680546Smrg  # libtool to hard-code these into programs
2571a3680546Smrg  ;;
2572a3680546Smrg
2573a3680546Smrgcygwin* | mingw* | windows* | pw32* | cegcc*)
2574a3680546Smrg  version_type=windows
2575a3680546Smrg  shrext_cmds=.dll
2576a3680546Smrg  need_version=no
2577a3680546Smrg  need_lib_prefix=no
2578a3680546Smrg
2579a3680546Smrg  case $GCC,$cc_basename in
2580a3680546Smrg  yes,*)
2581a3680546Smrg    # gcc
2582a3680546Smrg    library_names_spec='$libname.dll.a'
2583a3680546Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2584a3680546Smrg    # If user builds GCC with multilib enabled,
2585a3680546Smrg    # it should just install on $(libdir)
2586a3680546Smrg    # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones.
2587a3680546Smrg    if test xyes = x"$multilib"; then
2588a3680546Smrg      postinstall_cmds='base_file=`basename \$file`~
2589a3680546Smrg        dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2590a3680546Smrg        dldir=$destdir/`dirname \$dlpath`~
2591a3680546Smrg        $install_prog $dir/$dlname $destdir/$dlname~
2592a3680546Smrg        chmod a+x $destdir/$dlname~
2593a3680546Smrg        if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2594a3680546Smrg          eval '\''$striplib $destdir/$dlname'\'' || exit \$?;
2595a3680546Smrg        fi'
2596a3680546Smrg    else
2597a3680546Smrg      postinstall_cmds='base_file=`basename \$file`~
2598a3680546Smrg        dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2599a3680546Smrg        dldir=$destdir/`dirname \$dlpath`~
2600a3680546Smrg        test -d \$dldir || mkdir -p \$dldir~
2601a3680546Smrg        $install_prog $dir/$dlname \$dldir/$dlname~
2602a3680546Smrg        chmod a+x \$dldir/$dlname~
2603a3680546Smrg        if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2604a3680546Smrg          eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2605a3680546Smrg        fi'
2606a3680546Smrg    fi
2607a3680546Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2608a3680546Smrg      dlpath=$dir/\$dldll~
2609a3680546Smrg       $RM \$dlpath'
2610a3680546Smrg    shlibpath_overrides_runpath=yes
2611a3680546Smrg
2612a3680546Smrg    case $host_os in
2613a3680546Smrg    cygwin*)
2614a3680546Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2615a3680546Smrg      soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2616a3680546Smrgm4_if([$1], [],[
2617a3680546Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2618a3680546Smrg      ;;
2619a3680546Smrg    mingw* | windows* | cegcc*)
2620a3680546Smrg      # MinGW DLLs use traditional 'lib' prefix
2621a3680546Smrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2622a3680546Smrg      ;;
2623a3680546Smrg    pw32*)
2624a3680546Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2625a3680546Smrg      library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2626a3680546Smrg      ;;
2627a3680546Smrg    esac
2628a3680546Smrg    dynamic_linker='Win32 ld.exe'
2629a3680546Smrg    ;;
2630a3680546Smrg
2631a3680546Smrg  *,cl* | *,icl*)
2632a3680546Smrg    # Native MSVC or ICC
2633a3680546Smrg    libname_spec='$name'
2634a3680546Smrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2635a3680546Smrg    library_names_spec='$libname.dll.lib'
2636a3680546Smrg
2637a3680546Smrg    case $build_os in
2638a3680546Smrg    mingw* | windows*)
2639a3680546Smrg      sys_lib_search_path_spec=
2640a3680546Smrg      lt_save_ifs=$IFS
2641a3680546Smrg      IFS=';'
2642a3680546Smrg      for lt_path in $LIB
2643a3680546Smrg      do
2644a3680546Smrg        IFS=$lt_save_ifs
2645a3680546Smrg        # Let DOS variable expansion print the short 8.3 style file name.
2646a3680546Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2647a3680546Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2648a3680546Smrg      done
2649a3680546Smrg      IFS=$lt_save_ifs
2650a3680546Smrg      # Convert to MSYS style.
2651a3680546Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2652a3680546Smrg      ;;
2653a3680546Smrg    cygwin*)
2654a3680546Smrg      # Convert to unix form, then to dos form, then back to unix form
2655a3680546Smrg      # but this time dos style (no spaces!) so that the unix form looks
2656a3680546Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
2657a3680546Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2658a3680546Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2659a3680546Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2660a3680546Smrg      ;;
2661a3680546Smrg    *)
2662a3680546Smrg      sys_lib_search_path_spec=$LIB
2663a3680546Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2664a3680546Smrg        # It is most probably a Windows format PATH.
2665a3680546Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2666a3680546Smrg      else
2667a3680546Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2668a3680546Smrg      fi
2669a3680546Smrg      # FIXME: find the short name or the path components, as spaces are
2670a3680546Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
2671a3680546Smrg      ;;
2672a3680546Smrg    esac
2673a3680546Smrg
2674a3680546Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2675a3680546Smrg    postinstall_cmds='base_file=`basename \$file`~
2676a3680546Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2677a3680546Smrg      dldir=$destdir/`dirname \$dlpath`~
2678a3680546Smrg      test -d \$dldir || mkdir -p \$dldir~
2679a3680546Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
2680a3680546Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2681a3680546Smrg      dlpath=$dir/\$dldll~
2682a3680546Smrg       $RM \$dlpath'
2683a3680546Smrg    shlibpath_overrides_runpath=yes
2684a3680546Smrg    dynamic_linker='Win32 link.exe'
2685a3680546Smrg    ;;
2686a3680546Smrg
2687a3680546Smrg  *)
2688a3680546Smrg    # Assume MSVC and ICC wrapper
2689a3680546Smrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
2690a3680546Smrg    dynamic_linker='Win32 ld.exe'
2691a3680546Smrg    ;;
2692a3680546Smrg  esac
2693a3680546Smrg  # FIXME: first we should search . and the directory the executable is in
2694a3680546Smrg  shlibpath_var=PATH
2695a3680546Smrg  ;;
2696a3680546Smrg
2697a3680546Smrgdarwin* | rhapsody*)
2698a3680546Smrg  dynamic_linker="$host_os dyld"
2699a3680546Smrg  version_type=darwin
2700a3680546Smrg  need_lib_prefix=no
2701a3680546Smrg  need_version=no
2702a3680546Smrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
2703a3680546Smrg  soname_spec='$libname$release$major$shared_ext'
2704a3680546Smrg  shlibpath_overrides_runpath=yes
2705a3680546Smrg  shlibpath_var=DYLD_LIBRARY_PATH
2706a3680546Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2707a3680546Smrgm4_if([$1], [],[
2708a3680546Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2709a3680546Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2710a3680546Smrg  ;;
2711a3680546Smrg
2712a3680546Smrgdgux*)
2713a3680546Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2714a3680546Smrg  need_lib_prefix=no
2715a3680546Smrg  need_version=no
2716a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2717a3680546Smrg  soname_spec='$libname$release$shared_ext$major'
2718a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
2719a3680546Smrg  ;;
2720a3680546Smrg
2721a3680546Smrgfreebsd* | dragonfly* | midnightbsd*)
2722a3680546Smrg  # DragonFly does not have aout.  When/if they implement a new
2723a3680546Smrg  # versioning mechanism, adjust this.
2724a3680546Smrg  if test -x /usr/bin/objformat; then
2725a3680546Smrg    objformat=`/usr/bin/objformat`
2726a3680546Smrg  else
2727a3680546Smrg    case $host_os in
2728a3680546Smrg    freebsd[[23]].*) objformat=aout ;;
2729a3680546Smrg    *) objformat=elf ;;
2730a3680546Smrg    esac
2731a3680546Smrg  fi
2732a3680546Smrg  version_type=freebsd-$objformat
2733a3680546Smrg  case $version_type in
2734a3680546Smrg    freebsd-elf*)
2735a3680546Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2736a3680546Smrg      soname_spec='$libname$release$shared_ext$major'
2737a3680546Smrg      need_version=no
2738a3680546Smrg      need_lib_prefix=no
2739a3680546Smrg      ;;
2740a3680546Smrg    freebsd-*)
2741a3680546Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2742a3680546Smrg      need_version=yes
2743a3680546Smrg      ;;
2744a3680546Smrg  esac
2745a3680546Smrg  case $host_cpu in
2746a3680546Smrg    powerpc64)
2747a3680546Smrg      # On FreeBSD bi-arch platforms, a different variable is used for 32-bit
2748a3680546Smrg      # binaries.  See <https://man.freebsd.org/cgi/man.cgi?query=ld.so>.
2749a3680546Smrg      AC_COMPILE_IFELSE(
2750a3680546Smrg        [AC_LANG_SOURCE(
2751a3680546Smrg           [[int test_pointer_size[sizeof (void *) - 5];
2752a3680546Smrg           ]])],
2753a3680546Smrg        [shlibpath_var=LD_LIBRARY_PATH],
2754a3680546Smrg        [shlibpath_var=LD_32_LIBRARY_PATH])
2755a3680546Smrg      ;;
2756a3680546Smrg    *)
2757a3680546Smrg      shlibpath_var=LD_LIBRARY_PATH
2758a3680546Smrg      ;;
2759a3680546Smrg  esac
2760a3680546Smrg  case $host_os in
2761a3680546Smrg  freebsd2.*)
2762a3680546Smrg    shlibpath_overrides_runpath=yes
2763a3680546Smrg    ;;
2764a3680546Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2765a3680546Smrg    shlibpath_overrides_runpath=yes
2766a3680546Smrg    hardcode_into_libs=yes
2767a3680546Smrg    ;;
2768a3680546Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2769a3680546Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2770a3680546Smrg    shlibpath_overrides_runpath=no
2771a3680546Smrg    hardcode_into_libs=yes
2772a3680546Smrg    ;;
2773a3680546Smrg  *) # from 4.6 on, and DragonFly
2774a3680546Smrg    shlibpath_overrides_runpath=yes
2775a3680546Smrg    hardcode_into_libs=yes
2776a3680546Smrg    ;;
2777a3680546Smrg  esac
2778a3680546Smrg  ;;
2779a3680546Smrg
2780a3680546Smrghaiku*)
2781a3680546Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2782a3680546Smrg  need_lib_prefix=no
2783a3680546Smrg  need_version=no
2784a3680546Smrg  dynamic_linker="$host_os runtime_loader"
2785a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2786a3680546Smrg  soname_spec='$libname$release$shared_ext$major'
2787a3680546Smrg  shlibpath_var=LIBRARY_PATH
2788a3680546Smrg  shlibpath_overrides_runpath=no
2789a3680546Smrg  sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
2790a3680546Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
2791a3680546Smrg  hardcode_into_libs=no
2792a3680546Smrg  ;;
2793a3680546Smrg
2794a3680546Smrghpux9* | hpux10* | hpux11*)
2795a3680546Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
2796a3680546Smrg  # link against other versions.
2797a3680546Smrg  version_type=sunos
2798a3680546Smrg  need_lib_prefix=no
2799a3680546Smrg  need_version=no
2800a3680546Smrg  case $host_cpu in
2801a3680546Smrg  ia64*)
2802a3680546Smrg    shrext_cmds='.so'
2803a3680546Smrg    hardcode_into_libs=yes
2804a3680546Smrg    dynamic_linker="$host_os dld.so"
2805a3680546Smrg    shlibpath_var=LD_LIBRARY_PATH
2806a3680546Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2807a3680546Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2808a3680546Smrg    soname_spec='$libname$release$shared_ext$major'
2809a3680546Smrg    if test 32 = "$HPUX_IA64_MODE"; then
2810a3680546Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2811a3680546Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
2812a3680546Smrg    else
2813a3680546Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2814a3680546Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
2815a3680546Smrg    fi
2816a3680546Smrg    ;;
2817a3680546Smrg  hppa*64*)
2818a3680546Smrg    shrext_cmds='.sl'
2819a3680546Smrg    hardcode_into_libs=yes
2820a3680546Smrg    dynamic_linker="$host_os dld.sl"
2821a3680546Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2822a3680546Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2823a3680546Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2824a3680546Smrg    soname_spec='$libname$release$shared_ext$major'
2825a3680546Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2826a3680546Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2827a3680546Smrg    ;;
2828a3680546Smrg  *)
2829a3680546Smrg    shrext_cmds='.sl'
2830a3680546Smrg    dynamic_linker="$host_os dld.sl"
2831a3680546Smrg    shlibpath_var=SHLIB_PATH
2832a3680546Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2833a3680546Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2834a3680546Smrg    soname_spec='$libname$release$shared_ext$major'
2835a3680546Smrg    ;;
2836a3680546Smrg  esac
2837a3680546Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2838a3680546Smrg  postinstall_cmds='chmod 555 $lib'
2839a3680546Smrg  # or fails outright, so override atomically:
2840a3680546Smrg  install_override_mode=555
2841a3680546Smrg  ;;
2842a3680546Smrg
2843a3680546Smrginterix[[3-9]]*)
2844a3680546Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2845a3680546Smrg  need_lib_prefix=no
2846a3680546Smrg  need_version=no
2847a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2848a3680546Smrg  soname_spec='$libname$release$shared_ext$major'
2849a3680546Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2850a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
2851a3680546Smrg  shlibpath_overrides_runpath=no
2852a3680546Smrg  hardcode_into_libs=yes
2853a3680546Smrg  ;;
2854a3680546Smrg
2855a3680546Smrgirix5* | irix6* | nonstopux*)
2856a3680546Smrg  case $host_os in
2857a3680546Smrg    nonstopux*) version_type=nonstopux ;;
2858a3680546Smrg    *)
2859a3680546Smrg	if test yes = "$lt_cv_prog_gnu_ld"; then
2860a3680546Smrg		version_type=linux # correct to gnu/linux during the next big refactor
2861a3680546Smrg	else
2862a3680546Smrg		version_type=irix
2863a3680546Smrg	fi ;;
2864a3680546Smrg  esac
2865a3680546Smrg  need_lib_prefix=no
2866a3680546Smrg  need_version=no
2867a3680546Smrg  soname_spec='$libname$release$shared_ext$major'
2868a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
2869a3680546Smrg  case $host_os in
2870a3680546Smrg  irix5* | nonstopux*)
2871a3680546Smrg    libsuff= shlibsuff=
2872a3680546Smrg    ;;
2873a3680546Smrg  *)
2874a3680546Smrg    case $LD in # libtool.m4 will add one of these switches to LD
2875a3680546Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2876a3680546Smrg      libsuff= shlibsuff= libmagic=32-bit;;
2877a3680546Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2878a3680546Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
2879a3680546Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2880a3680546Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2881a3680546Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
2882a3680546Smrg    esac
2883a3680546Smrg    ;;
2884a3680546Smrg  esac
2885a3680546Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2886a3680546Smrg  shlibpath_overrides_runpath=no
2887a3680546Smrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
2888a3680546Smrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
2889a3680546Smrg  hardcode_into_libs=yes
2890a3680546Smrg  ;;
2891a3680546Smrg
2892a3680546Smrg# No shared lib support for Linux oldld, aout, or coff.
2893a3680546Smrglinux*oldld* | linux*aout* | linux*coff*)
2894a3680546Smrg  dynamic_linker=no
2895a3680546Smrg  ;;
2896a3680546Smrg
2897a3680546Smrglinux*android*)
2898a3680546Smrg  version_type=none # Android doesn't support versioned libraries.
2899a3680546Smrg  need_lib_prefix=no
2900a3680546Smrg  need_version=no
2901a3680546Smrg  library_names_spec='$libname$release$shared_ext $libname$shared_ext'
2902a3680546Smrg  soname_spec='$libname$release$shared_ext'
2903a3680546Smrg  finish_cmds=
2904a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
2905a3680546Smrg  shlibpath_overrides_runpath=yes
2906a3680546Smrg
2907a3680546Smrg  # This implies no fast_install, which is unacceptable.
2908a3680546Smrg  # Some rework will be needed to allow for fast_install
2909a3680546Smrg  # before this can be enabled.
2910a3680546Smrg  hardcode_into_libs=yes
2911a3680546Smrg
2912a3680546Smrg  dynamic_linker='Android linker'
2913a3680546Smrg  # -rpath works at least for libraries that are not overridden by
2914a3680546Smrg  # libraries installed in system locations.
2915a3680546Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
2916a3680546Smrg  ;;
2917a3680546Smrg
2918a3680546Smrg# This must be glibc/ELF.
2919a3680546Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
2920a3680546Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2921a3680546Smrg  need_lib_prefix=no
2922a3680546Smrg  need_version=no
2923a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2924a3680546Smrg  soname_spec='$libname$release$shared_ext$major'
2925a3680546Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2926a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
2927a3680546Smrg  shlibpath_overrides_runpath=no
2928a3680546Smrg
2929a3680546Smrg  # Some binutils ld are patched to set DT_RUNPATH
2930a3680546Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2931a3680546Smrg    [lt_cv_shlibpath_overrides_runpath=no
2932a3680546Smrg    save_LDFLAGS=$LDFLAGS
2933a3680546Smrg    save_libdir=$libdir
2934a3680546Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2935a3680546Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2936a3680546Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2937a3680546Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2938a3680546Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
2939a3680546Smrg    LDFLAGS=$save_LDFLAGS
2940a3680546Smrg    libdir=$save_libdir
2941a3680546Smrg    ])
2942a3680546Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2943a3680546Smrg
2944a3680546Smrg  # This implies no fast_install, which is unacceptable.
2945a3680546Smrg  # Some rework will be needed to allow for fast_install
2946a3680546Smrg  # before this can be enabled.
2947a3680546Smrg  hardcode_into_libs=yes
2948a3680546Smrg
2949a3680546Smrg  # Ideally, we could use ldconfig to report *all* directories which are
2950a3680546Smrg  # searched for libraries, however this is still not possible.  Aside from not
2951a3680546Smrg  # being certain /sbin/ldconfig is available, command
2952a3680546Smrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
2953a3680546Smrg  # even though it is searched at run-time.  Try to do the best guess by
2954a3680546Smrg  # appending ld.so.conf contents (and includes) to the search path.
2955a3680546Smrg  if test -f /etc/ld.so.conf; then
2956a3680546Smrg    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' ' '`
2957a3680546Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2958a3680546Smrg  fi
2959a3680546Smrg
2960a3680546Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2961a3680546Smrg  # powerpc, because MkLinux only supported shared libraries with the
2962a3680546Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2963a3680546Smrg  # most powerpc-linux boxes support dynamic linking these days and
2964a3680546Smrg  # people can always --disable-shared, the test was removed, and we
2965a3680546Smrg  # assume the GNU/Linux dynamic linker is in use.
2966a3680546Smrg  dynamic_linker='GNU/Linux ld.so'
2967a3680546Smrg  ;;
2968a3680546Smrg
2969a3680546Smrgnetbsdelf*-gnu)
2970a3680546Smrg  version_type=linux
2971a3680546Smrg  need_lib_prefix=no
2972a3680546Smrg  need_version=no
2973a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2974a3680546Smrg  soname_spec='$libname$release$shared_ext$major'
2975a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
2976a3680546Smrg  shlibpath_overrides_runpath=no
2977a3680546Smrg  hardcode_into_libs=yes
2978a3680546Smrg  dynamic_linker='NetBSD ld.elf_so'
2979a3680546Smrg  ;;
2980a3680546Smrg
2981a3680546Smrgnetbsd*)
2982a3680546Smrg  version_type=sunos
2983a3680546Smrg  need_lib_prefix=no
2984a3680546Smrg  need_version=no
2985a3680546Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2986a3680546Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2987a3680546Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2988a3680546Smrg    dynamic_linker='NetBSD (a.out) ld.so'
2989a3680546Smrg  else
2990a3680546Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2991a3680546Smrg    soname_spec='$libname$release$shared_ext$major'
2992a3680546Smrg    dynamic_linker='NetBSD ld.elf_so'
2993a3680546Smrg  fi
2994a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
2995a3680546Smrg  shlibpath_overrides_runpath=yes
2996a3680546Smrg  hardcode_into_libs=yes
2997a3680546Smrg  ;;
2998a3680546Smrg
2999a3680546Smrg*-mlibc)
3000a3680546Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3001a3680546Smrg  need_lib_prefix=no
3002a3680546Smrg  need_version=no
3003a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3004a3680546Smrg  soname_spec='$libname$release$shared_ext$major'
3005a3680546Smrg  dynamic_linker='mlibc ld.so'
3006a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
3007a3680546Smrg  shlibpath_overrides_runpath=no
3008a3680546Smrg  hardcode_into_libs=yes
3009a3680546Smrg  ;;
3010a3680546Smrg
3011a3680546Smrgnewsos6)
3012a3680546Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3013a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3014a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
3015a3680546Smrg  shlibpath_overrides_runpath=yes
3016a3680546Smrg  ;;
3017a3680546Smrg
3018a3680546Smrg*nto* | *qnx*)
3019a3680546Smrg  version_type=qnx
3020a3680546Smrg  need_lib_prefix=no
3021a3680546Smrg  need_version=no
3022a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3023a3680546Smrg  soname_spec='$libname$release$shared_ext$major'
3024a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
3025a3680546Smrg  shlibpath_overrides_runpath=no
3026a3680546Smrg  hardcode_into_libs=yes
3027a3680546Smrg  dynamic_linker='ldqnx.so'
3028a3680546Smrg  ;;
3029a3680546Smrg
3030a3680546Smrgopenbsd*)
3031a3680546Smrg  version_type=sunos
3032a3680546Smrg  sys_lib_dlsearch_path_spec=/usr/lib
3033a3680546Smrg  need_lib_prefix=no
3034a3680546Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
3035a3680546Smrg    need_version=no
3036a3680546Smrg  else
3037a3680546Smrg    need_version=yes
3038a3680546Smrg  fi
3039a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
3040a3680546Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3041a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
3042a3680546Smrg  shlibpath_overrides_runpath=yes
3043a3680546Smrg  ;;
3044a3680546Smrg
3045a3680546Smrgos2*)
3046a3680546Smrg  libname_spec='$name'
3047a3680546Smrg  version_type=windows
3048a3680546Smrg  shrext_cmds=.dll
3049a3680546Smrg  need_version=no
3050a3680546Smrg  need_lib_prefix=no
3051a3680546Smrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
3052a3680546Smrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
3053a3680546Smrg    v=$($ECHO $release$versuffix | tr -d .-);
3054a3680546Smrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
3055a3680546Smrg    $ECHO $n$v`$shared_ext'
3056a3680546Smrg  library_names_spec='${libname}_dll.$libext'
3057a3680546Smrg  dynamic_linker='OS/2 ld.exe'
3058a3680546Smrg  shlibpath_var=BEGINLIBPATH
3059a3680546Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
3060a3680546Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3061a3680546Smrg  postinstall_cmds='base_file=`basename \$file`~
3062a3680546Smrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
3063a3680546Smrg    dldir=$destdir/`dirname \$dlpath`~
3064a3680546Smrg    test -d \$dldir || mkdir -p \$dldir~
3065a3680546Smrg    $install_prog $dir/$dlname \$dldir/$dlname~
3066a3680546Smrg    chmod a+x \$dldir/$dlname~
3067a3680546Smrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
3068a3680546Smrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
3069a3680546Smrg    fi'
3070a3680546Smrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
3071a3680546Smrg    dlpath=$dir/\$dldll~
3072a3680546Smrg    $RM \$dlpath'
3073a3680546Smrg  ;;
3074a3680546Smrg
3075a3680546Smrgosf3* | osf4* | osf5*)
3076a3680546Smrg  version_type=osf
3077a3680546Smrg  need_lib_prefix=no
3078a3680546Smrg  need_version=no
3079a3680546Smrg  soname_spec='$libname$release$shared_ext$major'
3080a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3081a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
3082a3680546Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3083a3680546Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3084a3680546Smrg  ;;
3085a3680546Smrg
3086a3680546Smrgrdos*)
3087a3680546Smrg  dynamic_linker=no
3088a3680546Smrg  ;;
3089a3680546Smrg
3090a3680546Smrgserenity*)
3091a3680546Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3092a3680546Smrg  need_lib_prefix=no
3093a3680546Smrg  need_version=no
3094a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3095a3680546Smrg  soname_spec='$libname$release$shared_ext$major'
3096a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
3097a3680546Smrg  shlibpath_overrides_runpath=no
3098a3680546Smrg  dynamic_linker='SerenityOS LibELF'
3099a3680546Smrg  ;;
3100a3680546Smrg
3101a3680546Smrgsolaris*)
3102a3680546Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3103a3680546Smrg  need_lib_prefix=no
3104a3680546Smrg  need_version=no
3105a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3106a3680546Smrg  soname_spec='$libname$release$shared_ext$major'
3107a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
3108a3680546Smrg  shlibpath_overrides_runpath=yes
3109a3680546Smrg  hardcode_into_libs=yes
3110a3680546Smrg  # ldd complains unless libraries are executable
3111a3680546Smrg  postinstall_cmds='chmod +x $lib'
3112a3680546Smrg  ;;
3113a3680546Smrg
3114a3680546Smrgsunos4*)
3115a3680546Smrg  version_type=sunos
3116a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
3117a3680546Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3118a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
3119a3680546Smrg  shlibpath_overrides_runpath=yes
3120a3680546Smrg  if test yes = "$with_gnu_ld"; then
3121a3680546Smrg    need_lib_prefix=no
3122a3680546Smrg  fi
3123a3680546Smrg  need_version=yes
3124a3680546Smrg  ;;
3125a3680546Smrg
3126a3680546Smrgsysv4 | sysv4.3*)
3127a3680546Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3128a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3129a3680546Smrg  soname_spec='$libname$release$shared_ext$major'
3130a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
3131a3680546Smrg  case $host_vendor in
3132a3680546Smrg    sni)
3133a3680546Smrg      shlibpath_overrides_runpath=no
3134a3680546Smrg      need_lib_prefix=no
3135a3680546Smrg      runpath_var=LD_RUN_PATH
3136a3680546Smrg      ;;
3137a3680546Smrg    siemens)
3138a3680546Smrg      need_lib_prefix=no
3139a3680546Smrg      ;;
3140a3680546Smrg    motorola)
3141a3680546Smrg      need_lib_prefix=no
3142a3680546Smrg      need_version=no
3143a3680546Smrg      shlibpath_overrides_runpath=no
3144a3680546Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3145a3680546Smrg      ;;
3146a3680546Smrg  esac
3147a3680546Smrg  ;;
3148a3680546Smrg
3149a3680546Smrgsysv4*MP*)
3150a3680546Smrg  if test -d /usr/nec; then
3151a3680546Smrg    version_type=linux # correct to gnu/linux during the next big refactor
3152a3680546Smrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
3153a3680546Smrg    soname_spec='$libname$shared_ext.$major'
3154a3680546Smrg    shlibpath_var=LD_LIBRARY_PATH
3155a3680546Smrg  fi
3156a3680546Smrg  ;;
3157a3680546Smrg
3158a3680546Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3159a3680546Smrg  version_type=sco
3160a3680546Smrg  need_lib_prefix=no
3161a3680546Smrg  need_version=no
3162a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
3163a3680546Smrg  soname_spec='$libname$release$shared_ext$major'
3164a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
3165a3680546Smrg  shlibpath_overrides_runpath=yes
3166a3680546Smrg  hardcode_into_libs=yes
3167a3680546Smrg  if test yes = "$with_gnu_ld"; then
3168a3680546Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3169a3680546Smrg  else
3170a3680546Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3171a3680546Smrg    case $host_os in
3172a3680546Smrg      sco3.2v5*)
3173a3680546Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3174a3680546Smrg	;;
3175a3680546Smrg    esac
3176a3680546Smrg  fi
3177a3680546Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
3178a3680546Smrg  ;;
3179a3680546Smrg
3180a3680546Smrgtpf*)
3181a3680546Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3182a3680546Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3183a3680546Smrg  need_lib_prefix=no
3184a3680546Smrg  need_version=no
3185a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3186a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
3187a3680546Smrg  shlibpath_overrides_runpath=no
3188a3680546Smrg  hardcode_into_libs=yes
3189a3680546Smrg  ;;
3190a3680546Smrg
3191a3680546Smrguts4*)
3192a3680546Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3193a3680546Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3194a3680546Smrg  soname_spec='$libname$release$shared_ext$major'
3195a3680546Smrg  shlibpath_var=LD_LIBRARY_PATH
3196a3680546Smrg  ;;
3197a3680546Smrg
3198a3680546Smrgemscripten*)
3199a3680546Smrg  version_type=none
3200a3680546Smrg  need_lib_prefix=no
3201a3680546Smrg  need_version=no
3202a3680546Smrg  library_names_spec='$libname$release$shared_ext'
3203a3680546Smrg  soname_spec='$libname$release$shared_ext'
3204a3680546Smrg  finish_cmds=
3205a3680546Smrg  dynamic_linker="Emscripten linker"
3206a3680546Smrg  _LT_COMPILER_PIC($1)='-fPIC'
3207a3680546Smrg  _LT_TAGVAR(archive_cmds, $1)='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib'
3208a3680546Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym'
3209a3680546Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
3210a3680546Smrg  _LT_TAGVAR(no_undefined_flag, $1)=
3211a3680546Smrg  ;;
3212a3680546Smrg
3213a3680546Smrg*)
3214a3680546Smrg  dynamic_linker=no
3215a3680546Smrg  ;;
3216a3680546Smrgesac
3217a3680546SmrgAC_MSG_RESULT([$dynamic_linker])
3218a3680546Smrgtest no = "$dynamic_linker" && can_build_shared=no
3219a3680546Smrg
3220a3680546Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3221a3680546Smrgif test yes = "$GCC"; then
3222a3680546Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3223a3680546Smrgfi
3224a3680546Smrg
3225a3680546Smrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
3226a3680546Smrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
3227a3680546Smrgfi
3228a3680546Smrg
3229a3680546Smrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
3230a3680546Smrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
3231a3680546Smrgfi
3232a3680546Smrg
3233a3680546Smrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
3234a3680546Smrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
3235a3680546Smrg
3236a3680546Smrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
3237a3680546Smrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
3238a3680546Smrg
3239a3680546Smrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
3240a3680546Smrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
3241a3680546Smrg
3242a3680546Smrg_LT_DECL([], [variables_saved_for_relink], [1],
3243a3680546Smrg    [Variables whose values should be saved in libtool wrapper scripts and
3244a3680546Smrg    restored at link time])
3245a3680546Smrg_LT_DECL([], [need_lib_prefix], [0],
3246a3680546Smrg    [Do we need the "lib" prefix for modules?])
3247a3680546Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3248a3680546Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
3249a3680546Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3250a3680546Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3251a3680546Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
3252a3680546Smrg    [Is shlibpath searched before the hard-coded library search path?])
3253a3680546Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3254a3680546Smrg_LT_DECL([], [library_names_spec], [1],
3255a3680546Smrg    [[List of archive names.  First name is the real one, the rest are links.
3256a3680546Smrg    The last name is the one that the linker finds with -lNAME]])
3257a3680546Smrg_LT_DECL([], [soname_spec], [1],
3258a3680546Smrg    [[The coded name of the library, if different from the real name]])
3259a3680546Smrg_LT_DECL([], [install_override_mode], [1],
3260a3680546Smrg    [Permission mode override for installation of shared libraries])
3261a3680546Smrg_LT_DECL([], [postinstall_cmds], [2],
3262a3680546Smrg    [Command to use after installation of a shared archive])
3263a3680546Smrg_LT_DECL([], [postuninstall_cmds], [2],
3264a3680546Smrg    [Command to use after uninstallation of a shared archive])
3265a3680546Smrg_LT_DECL([], [finish_cmds], [2],
3266a3680546Smrg    [Commands used to finish a libtool library installation in a directory])
3267a3680546Smrg_LT_DECL([], [finish_eval], [1],
3268a3680546Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
3269a3680546Smrg    not shown]])
3270a3680546Smrg_LT_DECL([], [hardcode_into_libs], [0],
3271a3680546Smrg    [Whether we should hardcode library paths into libraries])
3272a3680546Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
3273a3680546Smrg    [Compile-time system search path for libraries])
3274a3680546Smrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
3275a3680546Smrg    [Detected run-time system search path for libraries])
3276a3680546Smrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
3277a3680546Smrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
3278a3680546Smrg])# _LT_SYS_DYNAMIC_LINKER
3279a3680546Smrg
3280a3680546Smrg
3281a3680546Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
3282a3680546Smrg# --------------------------
3283a3680546Smrg# find a file program that can recognize shared library
3284a3680546SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
3285a3680546Smrg[m4_require([_LT_DECL_EGREP])dnl
3286a3680546SmrgAC_MSG_CHECKING([for $1])
3287a3680546SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3288a3680546Smrg[case $MAGIC_CMD in
3289a3680546Smrg[[\\/*] |  ?:[\\/]*])
3290a3680546Smrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
3291a3680546Smrg  ;;
3292a3680546Smrg*)
3293a3680546Smrg  lt_save_MAGIC_CMD=$MAGIC_CMD
3294a3680546Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3295a3680546Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
3296a3680546Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
3297a3680546Smrgdnl not every word.  This closes a longstanding sh security hole.
3298a3680546Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
3299a3680546Smrg  for ac_dir in $ac_dummy; do
3300a3680546Smrg    IFS=$lt_save_ifs
3301a3680546Smrg    test -z "$ac_dir" && ac_dir=.
3302a3680546Smrg    if test -f "$ac_dir/$1"; then
3303a3680546Smrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
3304a3680546Smrg      if test -n "$file_magic_test_file"; then
3305a3680546Smrg	case $deplibs_check_method in
3306a3680546Smrg	"file_magic "*)
3307a3680546Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3308a3680546Smrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
3309a3680546Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3310a3680546Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
3311a3680546Smrg	    :
3312a3680546Smrg	  else
3313a3680546Smrg	    cat <<_LT_EOF 1>&2
3314a3680546Smrg
3315a3680546Smrg*** Warning: the command libtool uses to detect shared libraries,
3316a3680546Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
3317a3680546Smrg*** The result is that libtool may fail to recognize shared libraries
3318a3680546Smrg*** as such.  This will affect the creation of libtool libraries that
3319a3680546Smrg*** depend on shared libraries, but programs linked with such libtool
3320a3680546Smrg*** libraries will work regardless of this problem.  Nevertheless, you
3321a3680546Smrg*** may want to report the problem to your system manager and/or to
3322a3680546Smrg*** bug-libtool@gnu.org
3323a3680546Smrg
3324a3680546Smrg_LT_EOF
3325a3680546Smrg	  fi ;;
3326a3680546Smrg	esac
3327a3680546Smrg      fi
3328a3680546Smrg      break
3329a3680546Smrg    fi
3330a3680546Smrg  done
3331a3680546Smrg  IFS=$lt_save_ifs
3332a3680546Smrg  MAGIC_CMD=$lt_save_MAGIC_CMD
3333a3680546Smrg  ;;
3334a3680546Smrgesac])
3335a3680546SmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
3336a3680546Smrgif test -n "$MAGIC_CMD"; then
3337a3680546Smrg  AC_MSG_RESULT($MAGIC_CMD)
3338a3680546Smrgelse
3339a3680546Smrg  AC_MSG_RESULT(no)
3340a3680546Smrgfi
3341a3680546Smrg_LT_DECL([], [MAGIC_CMD], [0],
3342a3680546Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3343a3680546Smrg])# _LT_PATH_TOOL_PREFIX
3344a3680546Smrg
3345a3680546Smrg# Old name:
3346a3680546SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3347a3680546Smrgdnl aclocal-1.4 backwards compatibility:
3348a3680546Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3349a3680546Smrg
3350a3680546Smrg
3351a3680546Smrg# _LT_PATH_MAGIC
3352a3680546Smrg# --------------
3353a3680546Smrg# find a file program that can recognize a shared library
3354a3680546Smrgm4_defun([_LT_PATH_MAGIC],
3355a3680546Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3356a3680546Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
3357a3680546Smrg  if test -n "$ac_tool_prefix"; then
3358a3680546Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3359a3680546Smrg  else
3360a3680546Smrg    MAGIC_CMD=:
3361a3680546Smrg  fi
3362a3680546Smrgfi
3363a3680546Smrg])# _LT_PATH_MAGIC
3364a3680546Smrg
3365a3680546Smrg
3366a3680546Smrg# LT_PATH_LD
3367a3680546Smrg# ----------
3368a3680546Smrg# find the pathname to the GNU or non-GNU linker
3369a3680546SmrgAC_DEFUN([LT_PATH_LD],
3370a3680546Smrg[AC_REQUIRE([AC_PROG_CC])dnl
3371a3680546SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
3372a3680546SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3373a3680546Smrgm4_require([_LT_DECL_SED])dnl
3374a3680546Smrgm4_require([_LT_DECL_EGREP])dnl
3375a3680546Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3376a3680546Smrg
3377a3680546SmrgAC_ARG_WITH([gnu-ld],
3378a3680546Smrg    [AS_HELP_STRING([--with-gnu-ld],
3379a3680546Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3380a3680546Smrg    [test no = "$withval" || with_gnu_ld=yes],
3381a3680546Smrg    [with_gnu_ld=no])dnl
3382a3680546Smrg
3383a3680546Smrgac_prog=ld
3384a3680546Smrgif test yes = "$GCC"; then
3385a3680546Smrg  # Check if gcc -print-prog-name=ld gives a path.
3386a3680546Smrg  AC_MSG_CHECKING([for ld used by $CC])
3387a3680546Smrg  case $host in
3388a3680546Smrg  *-*-mingw* | *-*-windows*)
3389a3680546Smrg    # gcc leaves a trailing carriage return, which upsets mingw
3390a3680546Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3391a3680546Smrg  *)
3392a3680546Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3393a3680546Smrg  esac
3394a3680546Smrg  case $ac_prog in
3395a3680546Smrg    # Accept absolute paths.
3396a3680546Smrg    [[\\/]]* | ?:[[\\/]]*)
3397a3680546Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
3398a3680546Smrg      # Canonicalize the pathname of ld
3399a3680546Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3400a3680546Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3401a3680546Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3402a3680546Smrg      done
3403a3680546Smrg      test -z "$LD" && LD=$ac_prog
3404a3680546Smrg      ;;
3405a3680546Smrg  "")
3406a3680546Smrg    # If it fails, then pretend we aren't using GCC.
3407a3680546Smrg    ac_prog=ld
3408a3680546Smrg    ;;
3409a3680546Smrg  *)
3410a3680546Smrg    # If it is relative, then search for the first ld in PATH.
3411a3680546Smrg    with_gnu_ld=unknown
3412a3680546Smrg    ;;
3413a3680546Smrg  esac
3414a3680546Smrgelif test yes = "$with_gnu_ld"; then
3415a3680546Smrg  AC_MSG_CHECKING([for GNU ld])
3416a3680546Smrgelse
3417a3680546Smrg  AC_MSG_CHECKING([for non-GNU ld])
3418a3680546Smrgfi
3419a3680546SmrgAC_CACHE_VAL(lt_cv_path_LD,
3420a3680546Smrg[if test -z "$LD"; then
3421a3680546Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3422a3680546Smrg  for ac_dir in $PATH; do
3423a3680546Smrg    IFS=$lt_save_ifs
3424a3680546Smrg    test -z "$ac_dir" && ac_dir=.
3425a3680546Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3426a3680546Smrg      lt_cv_path_LD=$ac_dir/$ac_prog
3427a3680546Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
3428a3680546Smrg      # but apparently some variants of GNU ld only accept -v.
3429a3680546Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
3430a3680546Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3431a3680546Smrg      *GNU* | *'with BFD'*)
3432a3680546Smrg	test no != "$with_gnu_ld" && break
3433a3680546Smrg	;;
3434a3680546Smrg      *)
3435a3680546Smrg	test yes != "$with_gnu_ld" && break
3436a3680546Smrg	;;
3437a3680546Smrg      esac
3438a3680546Smrg    fi
3439a3680546Smrg  done
3440a3680546Smrg  IFS=$lt_save_ifs
3441a3680546Smrgelse
3442a3680546Smrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
3443a3680546Smrgfi])
3444a3680546SmrgLD=$lt_cv_path_LD
3445a3680546Smrgif test -n "$LD"; then
3446a3680546Smrg  AC_MSG_RESULT($LD)
3447a3680546Smrgelse
3448a3680546Smrg  AC_MSG_RESULT(no)
3449a3680546Smrgfi
3450a3680546Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3451a3680546Smrg_LT_PATH_LD_GNU
3452a3680546SmrgAC_SUBST([LD])
3453a3680546Smrg
3454a3680546Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3455a3680546Smrg])# LT_PATH_LD
3456a3680546Smrg
3457a3680546Smrg# Old names:
3458a3680546SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3459a3680546SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3460a3680546Smrgdnl aclocal-1.4 backwards compatibility:
3461a3680546Smrgdnl AC_DEFUN([AM_PROG_LD], [])
3462a3680546Smrgdnl AC_DEFUN([AC_PROG_LD], [])
3463a3680546Smrg
3464a3680546Smrg
3465a3680546Smrg# _LT_PATH_LD_GNU
3466a3680546Smrg#- --------------
3467a3680546Smrgm4_defun([_LT_PATH_LD_GNU],
3468a3680546Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3469a3680546Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3470a3680546Smrgcase `$LD -v 2>&1 </dev/null` in
3471a3680546Smrg*GNU* | *'with BFD'*)
3472a3680546Smrg  lt_cv_prog_gnu_ld=yes
3473a3680546Smrg  ;;
3474a3680546Smrg*)
3475a3680546Smrg  lt_cv_prog_gnu_ld=no
3476a3680546Smrg  ;;
3477a3680546Smrgesac])
3478a3680546Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
3479a3680546Smrg])# _LT_PATH_LD_GNU
3480a3680546Smrg
3481a3680546Smrg
3482a3680546Smrg# _LT_CMD_RELOAD
3483a3680546Smrg# --------------
3484a3680546Smrg# find reload flag for linker
3485a3680546Smrg#   -- PORTME Some linkers may need a different reload flag.
3486a3680546Smrgm4_defun([_LT_CMD_RELOAD],
3487a3680546Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
3488a3680546Smrg  lt_cv_ld_reload_flag,
3489a3680546Smrg  [lt_cv_ld_reload_flag='-r'])
3490a3680546Smrgreload_flag=$lt_cv_ld_reload_flag
3491a3680546Smrgcase $reload_flag in
3492a3680546Smrg"" | " "*) ;;
3493a3680546Smrg*) reload_flag=" $reload_flag" ;;
3494a3680546Smrgesac
3495a3680546Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
3496a3680546Smrgcase $host_os in
3497a3680546Smrg  cygwin* | mingw* | windows* | pw32* | cegcc*)
3498a3680546Smrg    if test yes != "$GCC"; then
3499a3680546Smrg      reload_cmds=false
3500a3680546Smrg    fi
3501a3680546Smrg    ;;
3502a3680546Smrg  darwin*)
3503a3680546Smrg    if test yes = "$GCC"; then
3504a3680546Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
3505a3680546Smrg    else
3506a3680546Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3507a3680546Smrg    fi
3508a3680546Smrg    ;;
3509a3680546Smrgesac
3510a3680546Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3511a3680546Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
3512a3680546Smrg])# _LT_CMD_RELOAD
3513a3680546Smrg
3514a3680546Smrg
3515a3680546Smrg# _LT_PATH_DD
3516a3680546Smrg# -----------
3517a3680546Smrg# find a working dd
3518a3680546Smrgm4_defun([_LT_PATH_DD],
3519a3680546Smrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
3520a3680546Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
3521a3680546Smrgcat conftest.i conftest.i >conftest2.i
3522a3680546Smrg: ${lt_DD:=$DD}
3523a3680546SmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
3524a3680546Smrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3525a3680546Smrg  cmp -s conftest.i conftest.out \
3526a3680546Smrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
3527a3680546Smrgfi])
3528a3680546Smrgrm -f conftest.i conftest2.i conftest.out])
3529a3680546Smrg])# _LT_PATH_DD
3530a3680546Smrg
3531a3680546Smrg
3532a3680546Smrg# _LT_CMD_TRUNCATE
3533a3680546Smrg# ----------------
3534a3680546Smrg# find command to truncate a binary pipe
3535a3680546Smrgm4_defun([_LT_CMD_TRUNCATE],
3536a3680546Smrg[m4_require([_LT_PATH_DD])
3537a3680546SmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
3538a3680546Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
3539a3680546Smrgcat conftest.i conftest.i >conftest2.i
3540a3680546Smrglt_cv_truncate_bin=
3541a3680546Smrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3542a3680546Smrg  cmp -s conftest.i conftest.out \
3543a3680546Smrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
3544a3680546Smrgfi
3545a3680546Smrgrm -f conftest.i conftest2.i conftest.out
3546a3680546Smrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
3547a3680546Smrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
3548a3680546Smrg  [Command to truncate a binary pipe])
3549a3680546Smrg])# _LT_CMD_TRUNCATE
3550a3680546Smrg
3551a3680546Smrg
3552a3680546Smrg# _LT_CHECK_MAGIC_METHOD
3553a3680546Smrg# ----------------------
3554a3680546Smrg# how to check for library dependencies
3555a3680546Smrg#  -- PORTME fill in with the dynamic library characteristics
3556a3680546Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
3557a3680546Smrg[m4_require([_LT_DECL_EGREP])
3558a3680546Smrgm4_require([_LT_DECL_OBJDUMP])
3559a3680546SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
3560a3680546Smrglt_cv_deplibs_check_method,
3561a3680546Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
3562a3680546Smrglt_cv_file_magic_test_file=
3563a3680546Smrglt_cv_deplibs_check_method='unknown'
3564a3680546Smrg# Need to set the preceding variable on all platforms that support
3565a3680546Smrg# interlibrary dependencies.
3566a3680546Smrg# 'none' -- dependencies not supported.
3567a3680546Smrg# 'unknown' -- same as none, but documents that we really don't know.
3568a3680546Smrg# 'pass_all' -- all dependencies passed with no checks.
3569a3680546Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
3570a3680546Smrg# that responds to the $file_magic_cmd with a given extended regex.
3571a3680546Smrg# If you have 'file' or equivalent on your system and you're not sure
3572a3680546Smrg# whether 'pass_all' will *always* work, you probably want this one.
3573a3680546Smrg
3574a3680546Smrgcase $host_os in
3575a3680546Smrgaix[[4-9]]*)
3576a3680546Smrg  lt_cv_deplibs_check_method=pass_all
3577a3680546Smrg  ;;
3578a3680546Smrg
3579a3680546Smrgbeos*)
3580a3680546Smrg  lt_cv_deplibs_check_method=pass_all
3581a3680546Smrg  ;;
3582a3680546Smrg
3583a3680546Smrgbsdi[[45]]*)
3584a3680546Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3585a3680546Smrg  lt_cv_file_magic_cmd='$FILECMD -L'
3586a3680546Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
3587a3680546Smrg  ;;
3588a3680546Smrg
3589a3680546Smrgcygwin*)
3590a3680546Smrg  # func_win32_libid is a shell function defined in ltmain.sh
3591a3680546Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3592a3680546Smrg  lt_cv_file_magic_cmd='func_win32_libid'
3593a3680546Smrg  ;;
3594a3680546Smrg
3595a3680546Smrgmingw* | windows* | pw32*)
3596a3680546Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
3597a3680546Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3598a3680546Smrg  # unless we find 'file', for example because we are cross-compiling.
3599a3680546Smrg  if ( file / ) >/dev/null 2>&1; then
3600a3680546Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3601a3680546Smrg    lt_cv_file_magic_cmd='func_win32_libid'
3602a3680546Smrg  else
3603a3680546Smrg    # Keep this pattern in sync with the one in func_win32_libid.
3604a3680546Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)'
3605a3680546Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
3606a3680546Smrg  fi
3607a3680546Smrg  ;;
3608a3680546Smrg
3609a3680546Smrgcegcc*)
3610a3680546Smrg  # use the weaker test based on 'objdump'. See mingw*.
3611a3680546Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3612a3680546Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3613a3680546Smrg  ;;
3614a3680546Smrg
3615a3680546Smrgdarwin* | rhapsody*)
3616a3680546Smrg  lt_cv_deplibs_check_method=pass_all
3617a3680546Smrg  ;;
3618a3680546Smrg
3619a3680546Smrgfreebsd* | dragonfly* | midnightbsd*)
3620a3680546Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3621a3680546Smrg    case $host_cpu in
3622a3680546Smrg    i*86 )
3623a3680546Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
3624a3680546Smrg      # Let's accept both of them until this is cleared up.
3625a3680546Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3626a3680546Smrg      lt_cv_file_magic_cmd=$FILECMD
3627a3680546Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3628a3680546Smrg      ;;
3629a3680546Smrg    esac
3630a3680546Smrg  else
3631a3680546Smrg    lt_cv_deplibs_check_method=pass_all
3632a3680546Smrg  fi
3633a3680546Smrg  ;;
3634a3680546Smrg
3635a3680546Smrghaiku*)
3636a3680546Smrg  lt_cv_deplibs_check_method=pass_all
3637a3680546Smrg  ;;
3638a3680546Smrg
3639a3680546Smrghpux10.20* | hpux11*)
3640a3680546Smrg  lt_cv_file_magic_cmd=$FILECMD
3641a3680546Smrg  case $host_cpu in
3642a3680546Smrg  ia64*)
3643a3680546Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3644a3680546Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3645a3680546Smrg    ;;
3646a3680546Smrg  hppa*64*)
3647a3680546Smrg    [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]']
3648a3680546Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3649a3680546Smrg    ;;
3650a3680546Smrg  *)
3651a3680546Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3652a3680546Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3653a3680546Smrg    ;;
3654a3680546Smrg  esac
3655a3680546Smrg  ;;
3656a3680546Smrg
3657a3680546Smrginterix[[3-9]]*)
3658a3680546Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3659a3680546Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3660a3680546Smrg  ;;
3661a3680546Smrg
3662a3680546Smrgirix5* | irix6* | nonstopux*)
3663a3680546Smrg  case $LD in
3664a3680546Smrg  *-32|*"-32 ") libmagic=32-bit;;
3665a3680546Smrg  *-n32|*"-n32 ") libmagic=N32;;
3666a3680546Smrg  *-64|*"-64 ") libmagic=64-bit;;
3667a3680546Smrg  *) libmagic=never-match;;
3668a3680546Smrg  esac
3669a3680546Smrg  lt_cv_deplibs_check_method=pass_all
3670a3680546Smrg  ;;
3671a3680546Smrg
3672a3680546Smrg# This must be glibc/ELF.
3673a3680546Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
3674a3680546Smrg  lt_cv_deplibs_check_method=pass_all
3675a3680546Smrg  ;;
3676a3680546Smrg
3677a3680546Smrg*-mlibc)
3678a3680546Smrg  lt_cv_deplibs_check_method=pass_all
3679a3680546Smrg  ;;
3680a3680546Smrg
3681a3680546Smrgnetbsd* | netbsdelf*-gnu)
3682a3680546Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3683a3680546Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3684a3680546Smrg  else
3685a3680546Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3686a3680546Smrg  fi
3687a3680546Smrg  ;;
3688a3680546Smrg
3689a3680546Smrgnewos6*)
3690a3680546Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3691a3680546Smrg  lt_cv_file_magic_cmd=$FILECMD
3692a3680546Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3693a3680546Smrg  ;;
3694a3680546Smrg
3695a3680546Smrg*nto* | *qnx*)
3696a3680546Smrg  lt_cv_deplibs_check_method=pass_all
3697a3680546Smrg  ;;
3698a3680546Smrg
3699a3680546Smrgopenbsd*)
3700a3680546Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
3701a3680546Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3702a3680546Smrg  else
3703a3680546Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3704a3680546Smrg  fi
3705a3680546Smrg  ;;
3706a3680546Smrg
3707a3680546Smrgosf3* | osf4* | osf5*)
3708a3680546Smrg  lt_cv_deplibs_check_method=pass_all
3709a3680546Smrg  ;;
3710a3680546Smrg
3711a3680546Smrgrdos*)
3712a3680546Smrg  lt_cv_deplibs_check_method=pass_all
3713a3680546Smrg  ;;
3714a3680546Smrg
3715a3680546Smrgserenity*)
3716a3680546Smrg  lt_cv_deplibs_check_method=pass_all
3717a3680546Smrg  ;;
3718a3680546Smrg
3719a3680546Smrgsolaris*)
3720a3680546Smrg  lt_cv_deplibs_check_method=pass_all
3721a3680546Smrg  ;;
3722a3680546Smrg
3723a3680546Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3724a3680546Smrg  lt_cv_deplibs_check_method=pass_all
3725a3680546Smrg  ;;
3726a3680546Smrg
3727a3680546Smrgsysv4 | sysv4.3*)
3728a3680546Smrg  case $host_vendor in
3729a3680546Smrg  motorola)
3730a3680546Smrg    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]]'
3731a3680546Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3732a3680546Smrg    ;;
3733a3680546Smrg  ncr)
3734a3680546Smrg    lt_cv_deplibs_check_method=pass_all
3735a3680546Smrg    ;;
3736a3680546Smrg  sequent)
3737a3680546Smrg    lt_cv_file_magic_cmd='/bin/file'
3738a3680546Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3739a3680546Smrg    ;;
3740a3680546Smrg  sni)
3741a3680546Smrg    lt_cv_file_magic_cmd='/bin/file'
3742a3680546Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3743a3680546Smrg    lt_cv_file_magic_test_file=/lib/libc.so
3744a3680546Smrg    ;;
3745a3680546Smrg  siemens)
3746a3680546Smrg    lt_cv_deplibs_check_method=pass_all
3747a3680546Smrg    ;;
3748a3680546Smrg  pc)
3749a3680546Smrg    lt_cv_deplibs_check_method=pass_all
3750a3680546Smrg    ;;
3751a3680546Smrg  esac
3752a3680546Smrg  ;;
3753a3680546Smrg
3754a3680546Smrgtpf*)
3755a3680546Smrg  lt_cv_deplibs_check_method=pass_all
3756a3680546Smrg  ;;
3757a3680546Smrgos2*)
3758a3680546Smrg  lt_cv_deplibs_check_method=pass_all
3759a3680546Smrg  ;;
3760a3680546Smrgesac
3761a3680546Smrg])
3762a3680546Smrg
3763a3680546Smrgfile_magic_glob=
3764a3680546Smrgwant_nocaseglob=no
3765a3680546Smrgif test "$build" = "$host"; then
3766a3680546Smrg  case $host_os in
3767a3680546Smrg  mingw* | windows* | pw32*)
3768a3680546Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3769a3680546Smrg      want_nocaseglob=yes
3770a3680546Smrg    else
3771a3680546Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3772a3680546Smrg    fi
3773a3680546Smrg    ;;
3774a3680546Smrg  esac
3775a3680546Smrgfi
3776a3680546Smrg
3777a3680546Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
3778a3680546Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
3779a3680546Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3780a3680546Smrg
3781a3680546Smrg_LT_DECL([], [deplibs_check_method], [1],
3782a3680546Smrg    [Method to check whether dependent libraries are shared objects])
3783a3680546Smrg_LT_DECL([], [file_magic_cmd], [1],
3784a3680546Smrg    [Command to use when deplibs_check_method = "file_magic"])
3785a3680546Smrg_LT_DECL([], [file_magic_glob], [1],
3786a3680546Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
3787a3680546Smrg_LT_DECL([], [want_nocaseglob], [1],
3788a3680546Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3789a3680546Smrg])# _LT_CHECK_MAGIC_METHOD
3790a3680546Smrg
3791a3680546Smrg
3792a3680546Smrg# LT_PATH_NM
3793a3680546Smrg# ----------
3794a3680546Smrg# find the pathname to a BSD- or MS-compatible name lister
3795a3680546SmrgAC_DEFUN([LT_PATH_NM],
3796a3680546Smrg[AC_REQUIRE([AC_PROG_CC])dnl
3797a3680546SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3798a3680546Smrg[if test -n "$NM"; then
3799a3680546Smrg  # Let the user override the test.
3800a3680546Smrg  lt_cv_path_NM=$NM
3801a3680546Smrgelse
3802a3680546Smrg  lt_nm_to_check=${ac_tool_prefix}nm
3803a3680546Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3804a3680546Smrg    lt_nm_to_check="$lt_nm_to_check nm"
3805a3680546Smrg  fi
3806a3680546Smrg  for lt_tmp_nm in $lt_nm_to_check; do
3807a3680546Smrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3808a3680546Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3809a3680546Smrg      IFS=$lt_save_ifs
3810a3680546Smrg      test -z "$ac_dir" && ac_dir=.
3811a3680546Smrg      tmp_nm=$ac_dir/$lt_tmp_nm
3812a3680546Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
3813a3680546Smrg	# Check to see if the nm accepts a BSD-compat flag.
3814a3680546Smrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
3815a3680546Smrg	#   nm: unknown option "B" ignored
3816a3680546Smrg	# Tru64's nm complains that /dev/null is an invalid object file
3817a3680546Smrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
3818a3680546Smrg	case $build_os in
3819a3680546Smrg	mingw* | windows*) lt_bad_file=conftest.nm/nofile ;;
3820a3680546Smrg	*) lt_bad_file=/dev/null ;;
3821a3680546Smrg	esac
3822a3680546Smrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
3823a3680546Smrg	*$lt_bad_file* | *'Invalid file or object type'*)
3824a3680546Smrg	  lt_cv_path_NM="$tmp_nm -B"
3825a3680546Smrg	  break 2
3826a3680546Smrg	  ;;
3827a3680546Smrg	*)
3828a3680546Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
3829a3680546Smrg	  */dev/null*)
3830a3680546Smrg	    lt_cv_path_NM="$tmp_nm -p"
3831a3680546Smrg	    break 2
3832a3680546Smrg	    ;;
3833a3680546Smrg	  *)
3834a3680546Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3835a3680546Smrg	    continue # so that we can try to find one that supports BSD flags
3836a3680546Smrg	    ;;
3837a3680546Smrg	  esac
3838a3680546Smrg	  ;;
3839a3680546Smrg	esac
3840a3680546Smrg      fi
3841a3680546Smrg    done
3842a3680546Smrg    IFS=$lt_save_ifs
3843a3680546Smrg  done
3844a3680546Smrg  : ${lt_cv_path_NM=no}
3845a3680546Smrgfi])
3846a3680546Smrgif test no != "$lt_cv_path_NM"; then
3847a3680546Smrg  NM=$lt_cv_path_NM
3848a3680546Smrgelse
3849a3680546Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
3850a3680546Smrg  if test -n "$DUMPBIN"; then :
3851a3680546Smrg    # Let the user override the test.
3852a3680546Smrg  else
3853a3680546Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3854a3680546Smrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
3855a3680546Smrg    *COFF*)
3856a3680546Smrg      DUMPBIN="$DUMPBIN -symbols -headers"
3857a3680546Smrg      ;;
3858a3680546Smrg    *)
3859a3680546Smrg      DUMPBIN=:
3860a3680546Smrg      ;;
3861a3680546Smrg    esac
3862a3680546Smrg  fi
3863a3680546Smrg  AC_SUBST([DUMPBIN])
3864a3680546Smrg  if test : != "$DUMPBIN"; then
3865a3680546Smrg    NM=$DUMPBIN
3866a3680546Smrg  fi
3867a3680546Smrgfi
3868a3680546Smrgtest -z "$NM" && NM=nm
3869a3680546SmrgAC_SUBST([NM])
3870a3680546Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3871a3680546Smrg
3872a3680546SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3873a3680546Smrg  [lt_cv_nm_interface="BSD nm"
3874a3680546Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
3875a3680546Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3876a3680546Smrg  (eval "$ac_compile" 2>conftest.err)
3877a3680546Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3878a3680546Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3879a3680546Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3880a3680546Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3881a3680546Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3882a3680546Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
3883a3680546Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3884a3680546Smrg    lt_cv_nm_interface="MS dumpbin"
3885a3680546Smrg  fi
3886a3680546Smrg  rm -f conftest*])
3887a3680546Smrg])# LT_PATH_NM
3888a3680546Smrg
3889a3680546Smrg# Old names:
3890a3680546SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3891a3680546SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3892a3680546Smrgdnl aclocal-1.4 backwards compatibility:
3893a3680546Smrgdnl AC_DEFUN([AM_PROG_NM], [])
3894a3680546Smrgdnl AC_DEFUN([AC_PROG_NM], [])
3895a3680546Smrg
3896a3680546Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3897a3680546Smrg# --------------------------------
3898a3680546Smrg# how to determine the name of the shared library
3899a3680546Smrg# associated with a specific link library.
3900a3680546Smrg#  -- PORTME fill in with the dynamic library characteristics
3901a3680546Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3902a3680546Smrg[m4_require([_LT_DECL_EGREP])
3903a3680546Smrgm4_require([_LT_DECL_OBJDUMP])
3904a3680546Smrgm4_require([_LT_DECL_DLLTOOL])
3905a3680546SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
3906a3680546Smrglt_cv_sharedlib_from_linklib_cmd,
3907a3680546Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3908a3680546Smrg
3909a3680546Smrgcase $host_os in
3910a3680546Smrgcygwin* | mingw* | windows* | pw32* | cegcc*)
3911a3680546Smrg  # two different shell functions defined in ltmain.sh;
3912a3680546Smrg  # decide which one to use based on capabilities of $DLLTOOL
3913a3680546Smrg  case `$DLLTOOL --help 2>&1` in
3914a3680546Smrg  *--identify-strict*)
3915a3680546Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3916a3680546Smrg    ;;
3917a3680546Smrg  *)
3918a3680546Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3919a3680546Smrg    ;;
3920a3680546Smrg  esac
3921a3680546Smrg  ;;
3922a3680546Smrg*)
3923a3680546Smrg  # fallback: assume linklib IS sharedlib
3924a3680546Smrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
3925a3680546Smrg  ;;
3926a3680546Smrgesac
3927a3680546Smrg])
3928a3680546Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3929a3680546Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3930a3680546Smrg
3931a3680546Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3932a3680546Smrg    [Command to associate shared and link libraries])
3933a3680546Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3934a3680546Smrg
3935a3680546Smrg
3936a3680546Smrg# _LT_PATH_MANIFEST_TOOL
3937a3680546Smrg# ----------------------
3938a3680546Smrg# locate the manifest tool
3939a3680546Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
3940a3680546Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3941a3680546Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3942a3680546SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_manifest_tool],
3943a3680546Smrg  [lt_cv_path_manifest_tool=no
3944a3680546Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3945a3680546Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3946a3680546Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3947a3680546Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3948a3680546Smrg    lt_cv_path_manifest_tool=yes
3949a3680546Smrg  fi
3950a3680546Smrg  rm -f conftest*])
3951a3680546Smrgif test yes != "$lt_cv_path_manifest_tool"; then
3952a3680546Smrg  MANIFEST_TOOL=:
3953a3680546Smrgfi
3954a3680546Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3955a3680546Smrg])# _LT_PATH_MANIFEST_TOOL
3956a3680546Smrg
3957a3680546Smrg
3958a3680546Smrg# _LT_DLL_DEF_P([FILE])
3959a3680546Smrg# ---------------------
3960a3680546Smrg# True iff FILE is a Windows DLL '.def' file.
3961a3680546Smrg# Keep in sync with func_dll_def_p in the libtool script
3962a3680546SmrgAC_DEFUN([_LT_DLL_DEF_P],
3963a3680546Smrg[dnl
3964a3680546Smrg  test DEF = "`$SED -n dnl
3965a3680546Smrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
3966a3680546Smrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
3967a3680546Smrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
3968a3680546Smrg    -e q dnl                          Only consider the first "real" line
3969a3680546Smrg    $1`" dnl
3970a3680546Smrg])# _LT_DLL_DEF_P
3971a3680546Smrg
3972a3680546Smrg
3973a3680546Smrg# LT_LIB_M
3974a3680546Smrg# --------
3975a3680546Smrg# check for math library
3976a3680546SmrgAC_DEFUN([LT_LIB_M],
3977a3680546Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3978a3680546SmrgLIBM=
3979a3680546Smrgcase $host in
3980a3680546Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-mingw* | *-*-pw32* | *-*-darwin*)
3981a3680546Smrg  # These system don't have libm, or don't need it
3982a3680546Smrg  ;;
3983a3680546Smrg*-ncr-sysv4.3*)
3984a3680546Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
3985a3680546Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3986a3680546Smrg  ;;
3987a3680546Smrg*)
3988a3680546Smrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
3989a3680546Smrg  ;;
3990a3680546Smrgesac
3991a3680546SmrgAC_SUBST([LIBM])
3992a3680546Smrg])# LT_LIB_M
3993a3680546Smrg
3994a3680546Smrg# Old name:
3995a3680546SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3996a3680546Smrgdnl aclocal-1.4 backwards compatibility:
3997a3680546Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3998a3680546Smrg
3999a3680546Smrg
4000a3680546Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
4001a3680546Smrg# -------------------------------
4002a3680546Smrgm4_defun([_LT_COMPILER_NO_RTTI],
4003a3680546Smrg[m4_require([_LT_TAG_COMPILER])dnl
4004a3680546Smrg
4005a3680546Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4006a3680546Smrg
4007a3680546Smrgif test yes = "$GCC"; then
4008a3680546Smrg  case $cc_basename in
4009a3680546Smrg  nvcc*)
4010a3680546Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
4011a3680546Smrg  *)
4012a3680546Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
4013a3680546Smrg  esac
4014a3680546Smrg
4015a3680546Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4016a3680546Smrg    lt_cv_prog_compiler_rtti_exceptions,
4017a3680546Smrg    [-fno-rtti -fno-exceptions], [],
4018a3680546Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4019a3680546Smrgfi
4020a3680546Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
4021a3680546Smrg	[Compiler flag to turn off builtin functions])
4022a3680546Smrg])# _LT_COMPILER_NO_RTTI
4023a3680546Smrg
4024a3680546Smrg
4025a3680546Smrg# _LT_CMD_GLOBAL_SYMBOLS
4026a3680546Smrg# ----------------------
4027a3680546Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
4028a3680546Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4029a3680546SmrgAC_REQUIRE([AC_PROG_CC])dnl
4030a3680546SmrgAC_REQUIRE([AC_PROG_AWK])dnl
4031a3680546SmrgAC_REQUIRE([LT_PATH_NM])dnl
4032a3680546SmrgAC_REQUIRE([LT_PATH_LD])dnl
4033a3680546Smrgm4_require([_LT_DECL_SED])dnl
4034a3680546Smrgm4_require([_LT_DECL_EGREP])dnl
4035a3680546Smrgm4_require([_LT_TAG_COMPILER])dnl
4036a3680546Smrg
4037a3680546Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
4038a3680546SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
4039a3680546SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4040a3680546Smrg[
4041a3680546Smrg# These are sane defaults that work on at least a few old systems.
4042a3680546Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4043a3680546Smrg
4044a3680546Smrg# Character class describing NM global symbol codes.
4045a3680546Smrgsymcode='[[BCDEGRST]]'
4046a3680546Smrg
4047a3680546Smrg# Regexp to match symbols that can be accessed directly from C.
4048a3680546Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4049a3680546Smrg
4050a3680546Smrg# Define system-specific variables.
4051a3680546Smrgcase $host_os in
4052a3680546Smrgaix*)
4053a3680546Smrg  symcode='[[BCDT]]'
4054a3680546Smrg  ;;
4055a3680546Smrgcygwin* | mingw* | windows* | pw32* | cegcc*)
4056a3680546Smrg  symcode='[[ABCDGISTW]]'
4057a3680546Smrg  ;;
4058a3680546Smrghpux*)
4059a3680546Smrg  if test ia64 = "$host_cpu"; then
4060a3680546Smrg    symcode='[[ABCDEGRST]]'
4061a3680546Smrg  fi
4062a3680546Smrg  ;;
4063a3680546Smrgirix* | nonstopux*)
4064a3680546Smrg  symcode='[[BCDEGRST]]'
4065a3680546Smrg  ;;
4066a3680546Smrgosf*)
4067a3680546Smrg  symcode='[[BCDEGQRST]]'
4068a3680546Smrg  ;;
4069a3680546Smrgsolaris*)
4070a3680546Smrg  symcode='[[BCDRT]]'
4071a3680546Smrg  ;;
4072a3680546Smrgsco3.2v5*)
4073a3680546Smrg  symcode='[[DT]]'
4074a3680546Smrg  ;;
4075a3680546Smrgsysv4.2uw2*)
4076a3680546Smrg  symcode='[[DT]]'
4077a3680546Smrg  ;;
4078a3680546Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
4079a3680546Smrg  symcode='[[ABDT]]'
4080a3680546Smrg  ;;
4081a3680546Smrgsysv4)
4082a3680546Smrg  symcode='[[DFNSTU]]'
4083a3680546Smrg  ;;
4084a3680546Smrgesac
4085a3680546Smrg
4086a3680546Smrg# If we're using GNU nm, then use its standard symbol codes.
4087a3680546Smrgcase `$NM -V 2>&1` in
4088a3680546Smrg*GNU* | *'with BFD'*)
4089a3680546Smrg  symcode='[[ABCDGIRSTW]]' ;;
4090a3680546Smrgesac
4091a3680546Smrg
4092a3680546Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
4093a3680546Smrg  # Gets list of data symbols to import.
4094a3680546Smrg  lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
4095a3680546Smrg  # Adjust the below global symbol transforms to fixup imported variables.
4096a3680546Smrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
4097a3680546Smrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
4098a3680546Smrg  lt_c_name_lib_hook="\
4099a3680546Smrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
4100a3680546Smrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
4101a3680546Smrgelse
4102a3680546Smrg  # Disable hooks by default.
4103a3680546Smrg  lt_cv_sys_global_symbol_to_import=
4104a3680546Smrg  lt_cdecl_hook=
4105a3680546Smrg  lt_c_name_hook=
4106a3680546Smrg  lt_c_name_lib_hook=
4107a3680546Smrgfi
4108a3680546Smrg
4109a3680546Smrg# Transform an extracted symbol line into a proper C declaration.
4110a3680546Smrg# Some systems (esp. on ia64) link data and code symbols differently,
4111a3680546Smrg# so use this general approach.
4112a3680546Smrglt_cv_sys_global_symbol_to_cdecl="$SED -n"\
4113a3680546Smrg$lt_cdecl_hook\
4114a3680546Smrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
4115a3680546Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
4116a3680546Smrg
4117a3680546Smrg# Transform an extracted symbol line into symbol name and symbol address
4118a3680546Smrglt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
4119a3680546Smrg$lt_c_name_hook\
4120a3680546Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4121a3680546Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
4122a3680546Smrg
4123a3680546Smrg# Transform an extracted symbol line into symbol name with lib prefix and
4124a3680546Smrg# symbol address.
4125a3680546Smrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
4126a3680546Smrg$lt_c_name_lib_hook\
4127a3680546Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4128a3680546Smrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
4129a3680546Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
4130a3680546Smrg
4131a3680546Smrg# Handle CRLF in mingw tool chain
4132a3680546Smrgopt_cr=
4133a3680546Smrgcase $build_os in
4134a3680546Smrgmingw* | windows*)
4135a3680546Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4136a3680546Smrg  ;;
4137a3680546Smrgesac
4138a3680546Smrg
4139a3680546Smrg# Try without a prefix underscore, then with it.
4140a3680546Smrgfor ac_symprfx in "" "_"; do
4141a3680546Smrg
4142a3680546Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4143a3680546Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
4144a3680546Smrg
4145a3680546Smrg  # Write the raw and C identifiers.
4146a3680546Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4147a3680546Smrg    # Fake it for dumpbin and say T for any non-static function,
4148a3680546Smrg    # D for any global variable and I for any imported variable.
4149a3680546Smrg    # Also find C++ and __fastcall symbols from MSVC++ or ICC,
4150a3680546Smrg    # which start with @ or ?.
4151a3680546Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4152a3680546Smrg"     {last_section=section; section=\$ 3};"\
4153a3680546Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4154a3680546Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4155a3680546Smrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
4156a3680546Smrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
4157a3680546Smrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
4158a3680546Smrg"     \$ 0!~/External *\|/{next};"\
4159a3680546Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4160a3680546Smrg"     {if(hide[section]) next};"\
4161a3680546Smrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
4162a3680546Smrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
4163a3680546Smrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
4164a3680546Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
4165a3680546Smrg"     ' prfx=^$ac_symprfx]"
4166a3680546Smrg  else
4167a3680546Smrg    lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4168a3680546Smrg  fi
4169a3680546Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
4170a3680546Smrg
4171a3680546Smrg  # Check to see that the pipe works correctly.
4172a3680546Smrg  pipe_works=no
4173a3680546Smrg
4174a3680546Smrg  rm -f conftest*
4175a3680546Smrg  cat > conftest.$ac_ext <<_LT_EOF
4176a3680546Smrg#ifdef __cplusplus
4177a3680546Smrgextern "C" {
4178a3680546Smrg#endif
4179a3680546Smrgchar nm_test_var;
4180a3680546Smrgvoid nm_test_func(void);
4181a3680546Smrgvoid nm_test_func(void){}
4182a3680546Smrg#ifdef __cplusplus
4183a3680546Smrg}
4184a3680546Smrg#endif
4185a3680546Smrgint main(void){nm_test_var='a';nm_test_func();return(0);}
4186a3680546Smrg_LT_EOF
4187a3680546Smrg
4188a3680546Smrg  if AC_TRY_EVAL(ac_compile); then
4189a3680546Smrg    # Now try to grab the symbols.
4190a3680546Smrg    nlist=conftest.nm
4191a3680546Smrg    $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD
4192a3680546Smrg    if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then
4193a3680546Smrg      # Try sorting and uniquifying the output.
4194a3680546Smrg      if sort "$nlist" | uniq > "$nlist"T; then
4195a3680546Smrg	mv -f "$nlist"T "$nlist"
4196a3680546Smrg      else
4197a3680546Smrg	rm -f "$nlist"T
4198a3680546Smrg      fi
4199a3680546Smrg
4200a3680546Smrg      # Make sure that we snagged all the symbols we need.
4201a3680546Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4202a3680546Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4203a3680546Smrg	  cat <<_LT_EOF > conftest.$ac_ext
4204a3680546Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4205a3680546Smrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4206a3680546Smrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
4207a3680546Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4208a3680546Smrg# define LT@&t@_DLSYM_CONST
4209a3680546Smrg#elif defined __osf__
4210a3680546Smrg/* This system does not cope well with relocations in const data.  */
4211a3680546Smrg# define LT@&t@_DLSYM_CONST
4212a3680546Smrg#else
4213a3680546Smrg# define LT@&t@_DLSYM_CONST const
4214a3680546Smrg#endif
4215a3680546Smrg
4216a3680546Smrg#ifdef __cplusplus
4217a3680546Smrgextern "C" {
4218a3680546Smrg#endif
4219a3680546Smrg
4220a3680546Smrg_LT_EOF
4221a3680546Smrg	  # Now generate the symbol file.
4222a3680546Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4223a3680546Smrg
4224a3680546Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
4225a3680546Smrg
4226a3680546Smrg/* The mapping between symbol names and symbols.  */
4227a3680546SmrgLT@&t@_DLSYM_CONST struct {
4228a3680546Smrg  const char *name;
4229a3680546Smrg  void       *address;
4230a3680546Smrg}
4231a3680546Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
4232a3680546Smrg{
4233a3680546Smrg  { "@PROGRAM@", (void *) 0 },
4234a3680546Smrg_LT_EOF
4235a3680546Smrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4236a3680546Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
4237a3680546Smrg  {0, (void *) 0}
4238a3680546Smrg};
4239a3680546Smrg
4240a3680546Smrg/* This works around a problem in FreeBSD linker */
4241a3680546Smrg#ifdef FREEBSD_WORKAROUND
4242a3680546Smrgstatic const void *lt_preloaded_setup() {
4243a3680546Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
4244a3680546Smrg}
4245a3680546Smrg#endif
4246a3680546Smrg
4247a3680546Smrg#ifdef __cplusplus
4248a3680546Smrg}
4249a3680546Smrg#endif
4250a3680546Smrg_LT_EOF
4251a3680546Smrg	  # Now try linking the two files.
4252a3680546Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
4253a3680546Smrg	  lt_globsym_save_LIBS=$LIBS
4254a3680546Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
4255a3680546Smrg	  LIBS=conftstm.$ac_objext
4256a3680546Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4257a3680546Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
4258a3680546Smrg	    pipe_works=yes
4259a3680546Smrg	  fi
4260a3680546Smrg	  LIBS=$lt_globsym_save_LIBS
4261a3680546Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
4262a3680546Smrg	else
4263a3680546Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4264a3680546Smrg	fi
4265a3680546Smrg      else
4266a3680546Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4267a3680546Smrg      fi
4268a3680546Smrg    else
4269a3680546Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4270a3680546Smrg    fi
4271a3680546Smrg  else
4272a3680546Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4273a3680546Smrg    cat conftest.$ac_ext >&5
4274a3680546Smrg  fi
4275a3680546Smrg  rm -rf conftest* conftst*
4276a3680546Smrg
4277a3680546Smrg  # Do not use the global_symbol_pipe unless it works.
4278a3680546Smrg  if test yes = "$pipe_works"; then
4279a3680546Smrg    break
4280a3680546Smrg  else
4281a3680546Smrg    lt_cv_sys_global_symbol_pipe=
4282a3680546Smrg  fi
4283a3680546Smrgdone
4284a3680546Smrg])
4285a3680546Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
4286a3680546Smrg  lt_cv_sys_global_symbol_to_cdecl=
4287a3680546Smrgfi
4288a3680546Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4289a3680546Smrg  AC_MSG_RESULT(failed)
4290a3680546Smrgelse
4291a3680546Smrg  AC_MSG_RESULT(ok)
4292a3680546Smrgfi
4293a3680546Smrg
4294a3680546Smrg# Response file support.
4295a3680546Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
4296a3680546Smrg  nm_file_list_spec='@'
4297a3680546Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4298a3680546Smrg  nm_file_list_spec='@'
4299a3680546Smrgfi
4300a3680546Smrg
4301a3680546Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4302a3680546Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
4303a3680546Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4304a3680546Smrg    [Transform the output of nm in a proper C declaration])
4305a3680546Smrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
4306a3680546Smrg    [Transform the output of nm into a list of symbols to manually relocate])
4307a3680546Smrg_LT_DECL([global_symbol_to_c_name_address],
4308a3680546Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4309a3680546Smrg    [Transform the output of nm in a C name address pair])
4310a3680546Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4311a3680546Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4312a3680546Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
4313a3680546Smrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
4314a3680546Smrg    [The name lister interface])
4315a3680546Smrg_LT_DECL([], [nm_file_list_spec], [1],
4316a3680546Smrg    [Specify filename containing input files for $NM])
4317a3680546Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
4318a3680546Smrg
4319a3680546Smrg
4320a3680546Smrg# _LT_COMPILER_PIC([TAGNAME])
4321a3680546Smrg# ---------------------------
4322a3680546Smrgm4_defun([_LT_COMPILER_PIC],
4323a3680546Smrg[m4_require([_LT_TAG_COMPILER])dnl
4324a3680546Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4325a3680546Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4326a3680546Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
4327a3680546Smrg
4328a3680546Smrgm4_if([$1], [CXX], [
4329a3680546Smrg  # C++ specific cases for pic, static, wl, etc.
4330a3680546Smrg  if test yes = "$GXX"; then
4331a3680546Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4332a3680546Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4333a3680546Smrg
4334a3680546Smrg    case $host_os in
4335a3680546Smrg    aix*)
4336a3680546Smrg      # All AIX code is PIC.
4337a3680546Smrg      if test ia64 = "$host_cpu"; then
4338a3680546Smrg	# AIX 5 now supports IA64 processor
4339a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4340a3680546Smrg      fi
4341a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4342a3680546Smrg      ;;
4343a3680546Smrg
4344a3680546Smrg    amigaos*)
4345a3680546Smrg      case $host_cpu in
4346a3680546Smrg      powerpc)
4347a3680546Smrg            # see comment about AmigaOS4 .so support
4348a3680546Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4349a3680546Smrg        ;;
4350a3680546Smrg      m68k)
4351a3680546Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
4352a3680546Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
4353a3680546Smrg            # like '-m68040'.
4354a3680546Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4355a3680546Smrg        ;;
4356a3680546Smrg      esac
4357a3680546Smrg      ;;
4358a3680546Smrg
4359a3680546Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4360a3680546Smrg      # PIC is the default for these OSes.
4361a3680546Smrg      ;;
4362a3680546Smrg    mingw* | windows* | cygwin* | os2* | pw32* | cegcc*)
4363a3680546Smrg      # This hack is so that the source file can tell whether it is being
4364a3680546Smrg      # built for inclusion in a dll (and should export symbols for example).
4365a3680546Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4366a3680546Smrg      # (--disable-auto-import) libraries
4367a3680546Smrg      m4_if([$1], [GCJ], [],
4368a3680546Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4369a3680546Smrg      case $host_os in
4370a3680546Smrg      os2*)
4371a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4372a3680546Smrg	;;
4373a3680546Smrg      esac
4374a3680546Smrg      ;;
4375a3680546Smrg    darwin* | rhapsody*)
4376a3680546Smrg      # PIC is the default on this platform
4377a3680546Smrg      # Common symbols not allowed in MH_DYLIB files
4378a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4379a3680546Smrg      ;;
4380a3680546Smrg    *djgpp*)
4381a3680546Smrg      # DJGPP does not support shared libraries at all
4382a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4383a3680546Smrg      ;;
4384a3680546Smrg    haiku*)
4385a3680546Smrg      # PIC is the default for Haiku.
4386a3680546Smrg      # The "-static" flag exists, but is broken.
4387a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4388a3680546Smrg      ;;
4389a3680546Smrg    interix[[3-9]]*)
4390a3680546Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4391a3680546Smrg      # Instead, we relocate shared libraries at runtime.
4392a3680546Smrg      ;;
4393a3680546Smrg    sysv4*MP*)
4394a3680546Smrg      if test -d /usr/nec; then
4395a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4396a3680546Smrg      fi
4397a3680546Smrg      ;;
4398a3680546Smrg    hpux*)
4399a3680546Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4400a3680546Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4401a3680546Smrg      # sets the default TLS model and affects inlining.
4402a3680546Smrg      case $host_cpu in
4403a3680546Smrg      hppa*64*)
4404a3680546Smrg	;;
4405a3680546Smrg      *)
4406a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4407a3680546Smrg	;;
4408a3680546Smrg      esac
4409a3680546Smrg      ;;
4410a3680546Smrg    *qnx* | *nto*)
4411a3680546Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4412a3680546Smrg      # it will coredump.
4413a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4414a3680546Smrg      ;;
4415a3680546Smrg    *)
4416a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4417a3680546Smrg      ;;
4418a3680546Smrg    esac
4419a3680546Smrg  else
4420a3680546Smrg    case $host_os in
4421a3680546Smrg      aix[[4-9]]*)
4422a3680546Smrg	# All AIX code is PIC.
4423a3680546Smrg	if test ia64 = "$host_cpu"; then
4424a3680546Smrg	  # AIX 5 now supports IA64 processor
4425a3680546Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4426a3680546Smrg	else
4427a3680546Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4428a3680546Smrg	fi
4429a3680546Smrg	;;
4430a3680546Smrg      chorus*)
4431a3680546Smrg	case $cc_basename in
4432a3680546Smrg	cxch68*)
4433a3680546Smrg	  # Green Hills C++ Compiler
4434a3680546Smrg	  # _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"
4435a3680546Smrg	  ;;
4436a3680546Smrg	esac
4437a3680546Smrg	;;
4438a3680546Smrg      mingw* | windows* | cygwin* | os2* | pw32* | cegcc*)
4439a3680546Smrg	# This hack is so that the source file can tell whether it is being
4440a3680546Smrg	# built for inclusion in a dll (and should export symbols for example).
4441a3680546Smrg	m4_if([$1], [GCJ], [],
4442a3680546Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4443a3680546Smrg	;;
4444a3680546Smrg      dgux*)
4445a3680546Smrg	case $cc_basename in
4446a3680546Smrg	  ec++*)
4447a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4448a3680546Smrg	    ;;
4449a3680546Smrg	  ghcx*)
4450a3680546Smrg	    # Green Hills C++ Compiler
4451a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4452a3680546Smrg	    ;;
4453a3680546Smrg	  *)
4454a3680546Smrg	    ;;
4455a3680546Smrg	esac
4456a3680546Smrg	;;
4457a3680546Smrg      freebsd* | dragonfly* | midnightbsd*)
4458a3680546Smrg	# FreeBSD uses GNU C++
4459a3680546Smrg	;;
4460a3680546Smrg      hpux9* | hpux10* | hpux11*)
4461a3680546Smrg	case $cc_basename in
4462a3680546Smrg	  CC*)
4463a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4464a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4465a3680546Smrg	    if test ia64 != "$host_cpu"; then
4466a3680546Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4467a3680546Smrg	    fi
4468a3680546Smrg	    ;;
4469a3680546Smrg	  aCC*)
4470a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4471a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4472a3680546Smrg	    case $host_cpu in
4473a3680546Smrg	    hppa*64*|ia64*)
4474a3680546Smrg	      # +Z the default
4475a3680546Smrg	      ;;
4476a3680546Smrg	    *)
4477a3680546Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4478a3680546Smrg	      ;;
4479a3680546Smrg	    esac
4480a3680546Smrg	    ;;
4481a3680546Smrg	  *)
4482a3680546Smrg	    ;;
4483a3680546Smrg	esac
4484a3680546Smrg	;;
4485a3680546Smrg      interix*)
4486a3680546Smrg	# This is c89, which is MS Visual C++ (no shared libs)
4487a3680546Smrg	# Anyone wants to do a port?
4488a3680546Smrg	;;
4489a3680546Smrg      irix5* | irix6* | nonstopux*)
4490a3680546Smrg	case $cc_basename in
4491a3680546Smrg	  CC*)
4492a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4493a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4494a3680546Smrg	    # CC pic flag -KPIC is the default.
4495a3680546Smrg	    ;;
4496a3680546Smrg	  *)
4497a3680546Smrg	    ;;
4498a3680546Smrg	esac
4499a3680546Smrg	;;
4500a3680546Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4501a3680546Smrg	case $cc_basename in
4502a3680546Smrg	  KCC*)
4503a3680546Smrg	    # KAI C++ Compiler
4504a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4505a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4506a3680546Smrg	    ;;
4507a3680546Smrg	  ecpc* )
4508a3680546Smrg	    # old Intel C++ for x86_64, which still supported -KPIC.
4509a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4510a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4511a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4512a3680546Smrg	    ;;
4513a3680546Smrg	  icpc* )
4514a3680546Smrg	    # Intel C++, used to be incompatible with GCC.
4515a3680546Smrg	    # ICC 10 doesn't accept -KPIC any more.
4516a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4517a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4518a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4519a3680546Smrg	    ;;
4520a3680546Smrg	  pgCC* | pgcpp*)
4521a3680546Smrg	    # Portland Group C++ compiler
4522a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4523a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4524a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4525a3680546Smrg	    ;;
4526a3680546Smrg	  cxx*)
4527a3680546Smrg	    # Compaq C++
4528a3680546Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4529a3680546Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4530a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4531a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4532a3680546Smrg	    ;;
4533a3680546Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
4534a3680546Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
4535a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4536a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4537a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4538a3680546Smrg	    ;;
4539a3680546Smrg	  *)
4540a3680546Smrg	    case `$CC -V 2>&1 | $SED 5q` in
4541a3680546Smrg	    *Sun\ C*)
4542a3680546Smrg	      # Sun C++ 5.9
4543a3680546Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4544a3680546Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4545a3680546Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4546a3680546Smrg	      ;;
4547a3680546Smrg	    esac
4548a3680546Smrg	    ;;
4549a3680546Smrg	esac
4550a3680546Smrg	;;
4551a3680546Smrg      lynxos*)
4552a3680546Smrg	;;
4553a3680546Smrg      m88k*)
4554a3680546Smrg	;;
4555a3680546Smrg      mvs*)
4556a3680546Smrg	case $cc_basename in
4557a3680546Smrg	  cxx*)
4558a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4559a3680546Smrg	    ;;
4560a3680546Smrg	  *)
4561a3680546Smrg	    ;;
4562a3680546Smrg	esac
4563a3680546Smrg	;;
4564a3680546Smrg      netbsd* | netbsdelf*-gnu)
4565a3680546Smrg	;;
4566a3680546Smrg      *-mlibc)
4567a3680546Smrg	;;
4568a3680546Smrg      *qnx* | *nto*)
4569a3680546Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
4570a3680546Smrg        # it will coredump.
4571a3680546Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4572a3680546Smrg        ;;
4573a3680546Smrg      osf3* | osf4* | osf5*)
4574a3680546Smrg	case $cc_basename in
4575a3680546Smrg	  KCC*)
4576a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4577a3680546Smrg	    ;;
4578a3680546Smrg	  RCC*)
4579a3680546Smrg	    # Rational C++ 2.4.1
4580a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4581a3680546Smrg	    ;;
4582a3680546Smrg	  cxx*)
4583a3680546Smrg	    # Digital/Compaq C++
4584a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4585a3680546Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4586a3680546Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4587a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4588a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4589a3680546Smrg	    ;;
4590a3680546Smrg	  *)
4591a3680546Smrg	    ;;
4592a3680546Smrg	esac
4593a3680546Smrg	;;
4594a3680546Smrg      psos*)
4595a3680546Smrg	;;
4596a3680546Smrg      serenity*)
4597a3680546Smrg        ;;
4598a3680546Smrg      solaris*)
4599a3680546Smrg	case $cc_basename in
4600a3680546Smrg	  CC* | sunCC*)
4601a3680546Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
4602a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4603a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4604a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4605a3680546Smrg	    ;;
4606a3680546Smrg	  gcx*)
4607a3680546Smrg	    # Green Hills C++ Compiler
4608a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4609a3680546Smrg	    ;;
4610a3680546Smrg	  *)
4611a3680546Smrg	    ;;
4612a3680546Smrg	esac
4613a3680546Smrg	;;
4614a3680546Smrg      sunos4*)
4615a3680546Smrg	case $cc_basename in
4616a3680546Smrg	  CC*)
4617a3680546Smrg	    # Sun C++ 4.x
4618a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4619a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4620a3680546Smrg	    ;;
4621a3680546Smrg	  lcc*)
4622a3680546Smrg	    # Lucid
4623a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4624a3680546Smrg	    ;;
4625a3680546Smrg	  *)
4626a3680546Smrg	    ;;
4627a3680546Smrg	esac
4628a3680546Smrg	;;
4629a3680546Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4630a3680546Smrg	case $cc_basename in
4631a3680546Smrg	  CC*)
4632a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4633a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4634a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4635a3680546Smrg	    ;;
4636a3680546Smrg	esac
4637a3680546Smrg	;;
4638a3680546Smrg      tandem*)
4639a3680546Smrg	case $cc_basename in
4640a3680546Smrg	  NCC*)
4641a3680546Smrg	    # NonStop-UX NCC 3.20
4642a3680546Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4643a3680546Smrg	    ;;
4644a3680546Smrg	  *)
4645a3680546Smrg	    ;;
4646a3680546Smrg	esac
4647a3680546Smrg	;;
4648a3680546Smrg      vxworks*)
4649a3680546Smrg	;;
4650a3680546Smrg      *)
4651a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4652a3680546Smrg	;;
4653a3680546Smrg    esac
4654a3680546Smrg  fi
4655a3680546Smrg],
4656a3680546Smrg[
4657a3680546Smrg  if test yes = "$GCC"; then
4658a3680546Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4659a3680546Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4660a3680546Smrg
4661a3680546Smrg    case $host_os in
4662a3680546Smrg      aix*)
4663a3680546Smrg      # All AIX code is PIC.
4664a3680546Smrg      if test ia64 = "$host_cpu"; then
4665a3680546Smrg	# AIX 5 now supports IA64 processor
4666a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4667a3680546Smrg      fi
4668a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4669a3680546Smrg      ;;
4670a3680546Smrg
4671a3680546Smrg    amigaos*)
4672a3680546Smrg      case $host_cpu in
4673a3680546Smrg      powerpc)
4674a3680546Smrg            # see comment about AmigaOS4 .so support
4675a3680546Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4676a3680546Smrg        ;;
4677a3680546Smrg      m68k)
4678a3680546Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
4679a3680546Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
4680a3680546Smrg            # like '-m68040'.
4681a3680546Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4682a3680546Smrg        ;;
4683a3680546Smrg      esac
4684a3680546Smrg      ;;
4685a3680546Smrg
4686a3680546Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4687a3680546Smrg      # PIC is the default for these OSes.
4688a3680546Smrg      ;;
4689a3680546Smrg
4690a3680546Smrg    mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
4691a3680546Smrg      # This hack is so that the source file can tell whether it is being
4692a3680546Smrg      # built for inclusion in a dll (and should export symbols for example).
4693a3680546Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4694a3680546Smrg      # (--disable-auto-import) libraries
4695a3680546Smrg      m4_if([$1], [GCJ], [],
4696a3680546Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4697a3680546Smrg      case $host_os in
4698a3680546Smrg      os2*)
4699a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4700a3680546Smrg	;;
4701a3680546Smrg      esac
4702a3680546Smrg      ;;
4703a3680546Smrg
4704a3680546Smrg    darwin* | rhapsody*)
4705a3680546Smrg      # PIC is the default on this platform
4706a3680546Smrg      # Common symbols not allowed in MH_DYLIB files
4707a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4708a3680546Smrg      ;;
4709a3680546Smrg
4710a3680546Smrg    haiku*)
4711a3680546Smrg      # PIC is the default for Haiku.
4712a3680546Smrg      # The "-static" flag exists, but is broken.
4713a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4714a3680546Smrg      ;;
4715a3680546Smrg
4716a3680546Smrg    hpux*)
4717a3680546Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4718a3680546Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4719a3680546Smrg      # sets the default TLS model and affects inlining.
4720a3680546Smrg      case $host_cpu in
4721a3680546Smrg      hppa*64*)
4722a3680546Smrg	# +Z the default
4723a3680546Smrg	;;
4724a3680546Smrg      *)
4725a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4726a3680546Smrg	;;
4727a3680546Smrg      esac
4728a3680546Smrg      ;;
4729a3680546Smrg
4730a3680546Smrg    interix[[3-9]]*)
4731a3680546Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4732a3680546Smrg      # Instead, we relocate shared libraries at runtime.
4733a3680546Smrg      ;;
4734a3680546Smrg
4735a3680546Smrg    msdosdjgpp*)
4736a3680546Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
4737a3680546Smrg      # on systems that don't support them.
4738a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4739a3680546Smrg      enable_shared=no
4740a3680546Smrg      ;;
4741a3680546Smrg
4742a3680546Smrg    *nto* | *qnx*)
4743a3680546Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4744a3680546Smrg      # it will coredump.
4745a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4746a3680546Smrg      ;;
4747a3680546Smrg
4748a3680546Smrg    sysv4*MP*)
4749a3680546Smrg      if test -d /usr/nec; then
4750a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4751a3680546Smrg      fi
4752a3680546Smrg      ;;
4753a3680546Smrg
4754a3680546Smrg    *)
4755a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4756a3680546Smrg      ;;
4757a3680546Smrg    esac
4758a3680546Smrg
4759a3680546Smrg    case $cc_basename in
4760a3680546Smrg    nvcc*) # Cuda Compiler Driver 2.2
4761a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4762a3680546Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4763a3680546Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4764a3680546Smrg      fi
4765a3680546Smrg      ;;
4766a3680546Smrg    esac
4767a3680546Smrg  else
4768a3680546Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
4769a3680546Smrg    case $host_os in
4770a3680546Smrg    aix*)
4771a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4772a3680546Smrg      if test ia64 = "$host_cpu"; then
4773a3680546Smrg	# AIX 5 now supports IA64 processor
4774a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4775a3680546Smrg      else
4776a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4777a3680546Smrg      fi
4778a3680546Smrg      ;;
4779a3680546Smrg
4780a3680546Smrg    darwin* | rhapsody*)
4781a3680546Smrg      # PIC is the default on this platform
4782a3680546Smrg      # Common symbols not allowed in MH_DYLIB files
4783a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4784a3680546Smrg      case $cc_basename in
4785a3680546Smrg      nagfor*)
4786a3680546Smrg        # NAG Fortran compiler
4787a3680546Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4788a3680546Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4789a3680546Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4790a3680546Smrg        ;;
4791a3680546Smrg      esac
4792a3680546Smrg      ;;
4793a3680546Smrg
4794a3680546Smrg    mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
4795a3680546Smrg      # This hack is so that the source file can tell whether it is being
4796a3680546Smrg      # built for inclusion in a dll (and should export symbols for example).
4797a3680546Smrg      m4_if([$1], [GCJ], [],
4798a3680546Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4799a3680546Smrg      case $host_os in
4800a3680546Smrg      os2*)
4801a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4802a3680546Smrg	;;
4803a3680546Smrg      esac
4804a3680546Smrg      ;;
4805a3680546Smrg
4806a3680546Smrg    hpux9* | hpux10* | hpux11*)
4807a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4808a3680546Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4809a3680546Smrg      # not for PA HP-UX.
4810a3680546Smrg      case $host_cpu in
4811a3680546Smrg      hppa*64*|ia64*)
4812a3680546Smrg	# +Z the default
4813a3680546Smrg	;;
4814a3680546Smrg      *)
4815a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4816a3680546Smrg	;;
4817a3680546Smrg      esac
4818a3680546Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4819a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4820a3680546Smrg      ;;
4821a3680546Smrg
4822a3680546Smrg    irix5* | irix6* | nonstopux*)
4823a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4824a3680546Smrg      # PIC (with -KPIC) is the default.
4825a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4826a3680546Smrg      ;;
4827a3680546Smrg
4828a3680546Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4829a3680546Smrg      case $cc_basename in
4830a3680546Smrg      # old Intel for x86_64, which still supported -KPIC.
4831a3680546Smrg      ecc*)
4832a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4833a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4834a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4835a3680546Smrg        ;;
4836a3680546Smrg      *flang* | ftn | f18* | f95*)
4837a3680546Smrg        # Flang compiler.
4838a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4839a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4840a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4841a3680546Smrg        ;;
4842a3680546Smrg      # icc used to be incompatible with GCC.
4843a3680546Smrg      # ICC 10 doesn't accept -KPIC any more.
4844a3680546Smrg      icc* | ifort*)
4845a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4846a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4847a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4848a3680546Smrg        ;;
4849a3680546Smrg      # Lahey Fortran 8.1.
4850a3680546Smrg      lf95*)
4851a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4852a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4853a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4854a3680546Smrg	;;
4855a3680546Smrg      nagfor*)
4856a3680546Smrg	# NAG Fortran compiler
4857a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4858a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4859a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4860a3680546Smrg	;;
4861a3680546Smrg      tcc*)
4862a3680546Smrg	# Fabrice Bellard et al's Tiny C Compiler
4863a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4864a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4865a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4866a3680546Smrg	;;
4867a3680546Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4868a3680546Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
4869a3680546Smrg	# which looks to be a dead project)
4870a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4871a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4872a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4873a3680546Smrg        ;;
4874a3680546Smrg      ccc*)
4875a3680546Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4876a3680546Smrg        # All Alpha code is PIC.
4877a3680546Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4878a3680546Smrg        ;;
4879a3680546Smrg      xl* | bgxl* | bgf* | mpixl*)
4880a3680546Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4881a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4882a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4883a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4884a3680546Smrg	;;
4885a3680546Smrg      *)
4886a3680546Smrg	case `$CC -V 2>&1 | $SED 5q` in
4887a3680546Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
4888a3680546Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4889a3680546Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4890a3680546Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4891a3680546Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4892a3680546Smrg	  ;;
4893a3680546Smrg	*Sun\ F* | *Sun*Fortran*)
4894a3680546Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4895a3680546Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4896a3680546Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4897a3680546Smrg	  ;;
4898a3680546Smrg	*Sun\ C*)
4899a3680546Smrg	  # Sun C 5.9
4900a3680546Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4901a3680546Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4902a3680546Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4903a3680546Smrg	  ;;
4904a3680546Smrg        *Intel*\ [[CF]]*Compiler*)
4905a3680546Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4906a3680546Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4907a3680546Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4908a3680546Smrg	  ;;
4909a3680546Smrg	*Portland\ Group*)
4910a3680546Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4911a3680546Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4912a3680546Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4913a3680546Smrg	  ;;
4914a3680546Smrg	esac
4915a3680546Smrg	;;
4916a3680546Smrg      esac
4917a3680546Smrg      ;;
4918a3680546Smrg
4919a3680546Smrg    newsos6)
4920a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4921a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4922a3680546Smrg      ;;
4923a3680546Smrg
4924a3680546Smrg    *-mlibc)
4925a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4926a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4927a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4928a3680546Smrg      ;;
4929a3680546Smrg
4930a3680546Smrg    *nto* | *qnx*)
4931a3680546Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4932a3680546Smrg      # it will coredump.
4933a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4934a3680546Smrg      ;;
4935a3680546Smrg
4936a3680546Smrg    osf3* | osf4* | osf5*)
4937a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4938a3680546Smrg      # All OSF/1 code is PIC.
4939a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4940a3680546Smrg      ;;
4941a3680546Smrg
4942a3680546Smrg    rdos*)
4943a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4944a3680546Smrg      ;;
4945a3680546Smrg
4946a3680546Smrg    serenity*)
4947a3680546Smrg      ;;
4948a3680546Smrg
4949a3680546Smrg    solaris*)
4950a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4951a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4952a3680546Smrg      case $cc_basename in
4953a3680546Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4954a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4955a3680546Smrg      *)
4956a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4957a3680546Smrg      esac
4958a3680546Smrg      ;;
4959a3680546Smrg
4960a3680546Smrg    sunos4*)
4961a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4962a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4963a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4964a3680546Smrg      ;;
4965a3680546Smrg
4966a3680546Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
4967a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4968a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4969a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4970a3680546Smrg      ;;
4971a3680546Smrg
4972a3680546Smrg    sysv4*MP*)
4973a3680546Smrg      if test -d /usr/nec; then
4974a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4975a3680546Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4976a3680546Smrg      fi
4977a3680546Smrg      ;;
4978a3680546Smrg
4979a3680546Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4980a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4981a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4982a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4983a3680546Smrg      ;;
4984a3680546Smrg
4985a3680546Smrg    unicos*)
4986a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4987a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4988a3680546Smrg      ;;
4989a3680546Smrg
4990a3680546Smrg    uts4*)
4991a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4992a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4993a3680546Smrg      ;;
4994a3680546Smrg
4995a3680546Smrg    *)
4996a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4997a3680546Smrg      ;;
4998a3680546Smrg    esac
4999a3680546Smrg  fi
5000a3680546Smrg])
5001a3680546Smrgcase $host_os in
5002a3680546Smrg  # For platforms that do not support PIC, -DPIC is meaningless:
5003a3680546Smrg  *djgpp*)
5004a3680546Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5005a3680546Smrg    ;;
5006a3680546Smrg  *)
5007a3680546Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
5008a3680546Smrg    ;;
5009a3680546Smrgesac
5010a3680546Smrg
5011a3680546SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
5012a3680546Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
5013a3680546Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
5014a3680546Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
5015a3680546Smrg
5016a3680546Smrg#
5017a3680546Smrg# Check to make sure the PIC flag actually works.
5018a3680546Smrg#
5019a3680546Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5020a3680546Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
5021a3680546Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
5022a3680546Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
5023a3680546Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
5024a3680546Smrg     "" | " "*) ;;
5025a3680546Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5026a3680546Smrg     esac],
5027a3680546Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
5028a3680546Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5029a3680546Smrgfi
5030a3680546Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
5031a3680546Smrg	[Additional compiler flags for building library objects])
5032a3680546Smrg
5033a3680546Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
5034a3680546Smrg	[How to pass a linker flag through the compiler])
5035a3680546Smrg#
5036a3680546Smrg# Check to make sure the static flag actually works.
5037a3680546Smrg#
5038a3680546Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
5039a3680546Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5040a3680546Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
5041a3680546Smrg  $lt_tmp_static_flag,
5042a3680546Smrg  [],
5043a3680546Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
5044a3680546Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
5045a3680546Smrg	[Compiler flag to prevent dynamic linking])
5046a3680546Smrg])# _LT_COMPILER_PIC
5047a3680546Smrg
5048a3680546Smrg
5049a3680546Smrg# _LT_LINKER_SHLIBS([TAGNAME])
5050a3680546Smrg# ----------------------------
5051a3680546Smrg# See if the linker supports building shared libraries.
5052a3680546Smrgm4_defun([_LT_LINKER_SHLIBS],
5053a3680546Smrg[AC_REQUIRE([LT_PATH_LD])dnl
5054a3680546SmrgAC_REQUIRE([LT_PATH_NM])dnl
5055a3680546Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
5056a3680546Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5057a3680546Smrgm4_require([_LT_DECL_EGREP])dnl
5058a3680546Smrgm4_require([_LT_DECL_SED])dnl
5059a3680546Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
5060a3680546Smrgm4_require([_LT_TAG_COMPILER])dnl
5061a3680546SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5062a3680546Smrgm4_if([$1], [CXX], [
5063a3680546Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5064a3680546Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5065a3680546Smrg  case $host_os in
5066a3680546Smrg  aix[[4-9]]*)
5067a3680546Smrg    # If we're using GNU nm, then we don't want the "-C" option.
5068a3680546Smrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
5069a3680546Smrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
5070a3680546Smrg    # weak defined symbols like other global defined symbols, whereas
5071a3680546Smrg    # GNU nm marks them as "W".
5072a3680546Smrg    # While the 'weak' keyword is ignored in the Export File, we need
5073a3680546Smrg    # it in the Import File for the 'aix-soname' feature, so we have
5074a3680546Smrg    # to replace the "-B" option with "-P" for AIX nm.
5075a3680546Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5076a3680546Smrg      _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'
5077a3680546Smrg    else
5078a3680546Smrg      _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'
5079a3680546Smrg    fi
5080a3680546Smrg    ;;
5081a3680546Smrg  pw32*)
5082a3680546Smrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
5083a3680546Smrg    ;;
5084a3680546Smrg  cygwin* | mingw* | windows* | cegcc*)
5085a3680546Smrg    case $cc_basename in
5086a3680546Smrg    cl* | icl*)
5087a3680546Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5088a3680546Smrg      ;;
5089a3680546Smrg    *)
5090a3680546Smrg      _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'
5091a3680546Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5092a3680546Smrg      ;;
5093a3680546Smrg    esac
5094a3680546Smrg    ;;
5095a3680546Smrg  *)
5096a3680546Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5097a3680546Smrg    ;;
5098a3680546Smrg  esac
5099a3680546Smrg], [
5100a3680546Smrg  runpath_var=
5101a3680546Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
5102a3680546Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
5103a3680546Smrg  _LT_TAGVAR(archive_cmds, $1)=
5104a3680546Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
5105a3680546Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
5106a3680546Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5107a3680546Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5108a3680546Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5109a3680546Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
5110a3680546Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
5111a3680546Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5112a3680546Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5113a3680546Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5114a3680546Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
5115a3680546Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5116a3680546Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
5117a3680546Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
5118a3680546Smrg  _LT_TAGVAR(module_cmds, $1)=
5119a3680546Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
5120a3680546Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
5121a3680546Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5122a3680546Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
5123a3680546Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5124a3680546Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
5125a3680546Smrg  # included in the symbol list
5126a3680546Smrg  _LT_TAGVAR(include_expsyms, $1)=
5127a3680546Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
5128a3680546Smrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
5129a3680546Smrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
5130a3680546Smrg  # as well as any symbol that contains 'd'.
5131a3680546Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5132a3680546Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5133a3680546Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
5134a3680546Smrg  # the symbol is explicitly referenced.  Since portable code cannot
5135a3680546Smrg  # rely on this symbol name, it's probably fine to never include it in
5136a3680546Smrg  # preloaded symbol tables.
5137a3680546Smrg  # Exclude shared library initialization/finalization symbols.
5138a3680546Smrgdnl Note also adjust exclude_expsyms for C++ above.
5139a3680546Smrg  extract_expsyms_cmds=
5140a3680546Smrg
5141a3680546Smrg  case $host_os in
5142a3680546Smrg  cygwin* | mingw* | windows* | pw32* | cegcc*)
5143a3680546Smrg    # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
5144a3680546Smrg    # When not using gcc, we currently assume that we are using
5145a3680546Smrg    # Microsoft Visual C++ or Intel C++ Compiler.
5146a3680546Smrg    if test yes != "$GCC"; then
5147a3680546Smrg      with_gnu_ld=no
5148a3680546Smrg    fi
5149a3680546Smrg    ;;
5150a3680546Smrg  interix*)
5151a3680546Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
5152a3680546Smrg    with_gnu_ld=yes
5153a3680546Smrg    ;;
5154a3680546Smrg  esac
5155a3680546Smrg
5156a3680546Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
5157a3680546Smrg
5158a3680546Smrg  # On some targets, GNU ld is compatible enough with the native linker
5159a3680546Smrg  # that we're better off using the native interface for both.
5160a3680546Smrg  lt_use_gnu_ld_interface=no
5161a3680546Smrg  if test yes = "$with_gnu_ld"; then
5162a3680546Smrg    case $host_os in
5163a3680546Smrg      aix*)
5164a3680546Smrg	# The AIX port of GNU ld has always aspired to compatibility
5165a3680546Smrg	# with the native linker.  However, as the warning in the GNU ld
5166a3680546Smrg	# block says, versions before 2.19.5* couldn't really create working
5167a3680546Smrg	# shared libraries, regardless of the interface used.
5168a3680546Smrg	case `$LD -v 2>&1` in
5169a3680546Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5170a3680546Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5171a3680546Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5172a3680546Smrg	  *)
5173a3680546Smrg	    lt_use_gnu_ld_interface=yes
5174a3680546Smrg	    ;;
5175a3680546Smrg	esac
5176a3680546Smrg	;;
5177a3680546Smrg      *)
5178a3680546Smrg	lt_use_gnu_ld_interface=yes
5179a3680546Smrg	;;
5180a3680546Smrg    esac
5181a3680546Smrg  fi
5182a3680546Smrg
5183a3680546Smrg  if test yes = "$lt_use_gnu_ld_interface"; then
5184a3680546Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
5185a3680546Smrg    wlarc='$wl'
5186a3680546Smrg
5187a3680546Smrg    # Set some defaults for GNU ld with shared library support. These
5188a3680546Smrg    # are reset later if shared libraries are not supported. Putting them
5189a3680546Smrg    # here allows them to be overridden if necessary.
5190a3680546Smrg    runpath_var=LD_RUN_PATH
5191a3680546Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5192a3680546Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
5193a3680546Smrg    # ancient GNU ld didn't support --whole-archive et. al.
5194a3680546Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5195a3680546Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
5196a3680546Smrg    else
5197a3680546Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5198a3680546Smrg    fi
5199a3680546Smrg    supports_anon_versioning=no
5200a3680546Smrg    case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in
5201a3680546Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
5202a3680546Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5203a3680546Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5204a3680546Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5205a3680546Smrg      *\ 2.11.*) ;; # other 2.11 versions
5206a3680546Smrg      *) supports_anon_versioning=yes ;;
5207a3680546Smrg    esac
5208a3680546Smrg
5209a3680546Smrg    # See if GNU ld supports shared libraries.
5210a3680546Smrg    case $host_os in
5211a3680546Smrg    aix[[3-9]]*)
5212a3680546Smrg      # On AIX/PPC, the GNU linker is very broken
5213a3680546Smrg      if test ia64 != "$host_cpu"; then
5214a3680546Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
5215a3680546Smrg	cat <<_LT_EOF 1>&2
5216a3680546Smrg
5217a3680546Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
5218a3680546Smrg*** to be unable to reliably create shared libraries on AIX.
5219a3680546Smrg*** Therefore, libtool is disabling shared libraries support.  If you
5220a3680546Smrg*** really care for shared libraries, you may want to install binutils
5221a3680546Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5222a3680546Smrg*** You will then need to restart the configuration process.
5223a3680546Smrg
5224a3680546Smrg_LT_EOF
5225a3680546Smrg      fi
5226a3680546Smrg      ;;
5227a3680546Smrg
5228a3680546Smrg    amigaos*)
5229a3680546Smrg      case $host_cpu in
5230a3680546Smrg      powerpc)
5231a3680546Smrg            # see comment about AmigaOS4 .so support
5232a3680546Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5233a3680546Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5234a3680546Smrg        ;;
5235a3680546Smrg      m68k)
5236a3680546Smrg            _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)'
5237a3680546Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5238a3680546Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5239a3680546Smrg        ;;
5240a3680546Smrg      esac
5241a3680546Smrg      ;;
5242a3680546Smrg
5243a3680546Smrg    beos*)
5244a3680546Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5245a3680546Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5246a3680546Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5247a3680546Smrg	# support --undefined.  This deserves some investigation.  FIXME
5248a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5249a3680546Smrg      else
5250a3680546Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
5251a3680546Smrg      fi
5252a3680546Smrg      ;;
5253a3680546Smrg
5254a3680546Smrg    cygwin* | mingw* | windows* | pw32* | cegcc*)
5255a3680546Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5256a3680546Smrg      # as there is no search path for DLLs.
5257a3680546Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5258a3680546Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
5259a3680546Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5260a3680546Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
5261a3680546Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5262a3680546Smrg      _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'
5263a3680546Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5264a3680546Smrg      _LT_TAGVAR(file_list_spec, $1)='@'
5265a3680546Smrg
5266a3680546Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5267a3680546Smrg        _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'
5268a3680546Smrg	# If the export-symbols file already is a .def file, use it as
5269a3680546Smrg	# is; otherwise, prepend EXPORTS...
5270a3680546Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5271a3680546Smrg          cp $export_symbols $output_objdir/$soname.def;
5272a3680546Smrg        else
5273a3680546Smrg          echo EXPORTS > $output_objdir/$soname.def;
5274a3680546Smrg          cat $export_symbols >> $output_objdir/$soname.def;
5275a3680546Smrg        fi~
5276a3680546Smrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5277a3680546Smrg      else
5278a3680546Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
5279a3680546Smrg      fi
5280a3680546Smrg      ;;
5281a3680546Smrg
5282a3680546Smrg    haiku*)
5283a3680546Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5284a3680546Smrg      _LT_TAGVAR(link_all_deplibs, $1)=no
5285a3680546Smrg      ;;
5286a3680546Smrg
5287a3680546Smrg    os2*)
5288a3680546Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5289a3680546Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5290a3680546Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5291a3680546Smrg      shrext_cmds=.dll
5292a3680546Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5293a3680546Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5294a3680546Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5295a3680546Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5296a3680546Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5297a3680546Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5298a3680546Smrg	emximp -o $lib $output_objdir/$libname.def'
5299a3680546Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5300a3680546Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5301a3680546Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5302a3680546Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5303a3680546Smrg	prefix_cmds="$SED"~
5304a3680546Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5305a3680546Smrg	  prefix_cmds="$prefix_cmds -e 1d";
5306a3680546Smrg	fi~
5307a3680546Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5308a3680546Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5309a3680546Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5310a3680546Smrg	emximp -o $lib $output_objdir/$libname.def'
5311a3680546Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5312a3680546Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5313a3680546Smrg      _LT_TAGVAR(file_list_spec, $1)='@'
5314a3680546Smrg      ;;
5315a3680546Smrg
5316a3680546Smrg    interix[[3-9]]*)
5317a3680546Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
5318a3680546Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5319a3680546Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5320a3680546Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5321a3680546Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5322a3680546Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
5323a3680546Smrg      # default) and relocated if they conflict, which is a slow very memory
5324a3680546Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
5325a3680546Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5326a3680546Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5327a3680546Smrg      _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'
5328a3680546Smrg      _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'
5329a3680546Smrg      ;;
5330a3680546Smrg
5331a3680546Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5332a3680546Smrg      tmp_diet=no
5333a3680546Smrg      if test linux-dietlibc = "$host_os"; then
5334a3680546Smrg	case $cc_basename in
5335a3680546Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5336a3680546Smrg	esac
5337a3680546Smrg      fi
5338a3680546Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5339a3680546Smrg	 && test no = "$tmp_diet"
5340a3680546Smrg      then
5341a3680546Smrg	tmp_addflag=' $pic_flag'
5342a3680546Smrg	tmp_sharedflag='-shared'
5343a3680546Smrg	case $cc_basename,$host_cpu in
5344a3680546Smrg        pgcc*)				# Portland Group C compiler
5345a3680546Smrg	  _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'
5346a3680546Smrg	  tmp_addflag=' $pic_flag'
5347a3680546Smrg	  ;;
5348a3680546Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
5349a3680546Smrg					# Portland Group f77 and f90 compilers
5350a3680546Smrg	  _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'
5351a3680546Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
5352a3680546Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5353a3680546Smrg	  tmp_addflag=' -i_dynamic' ;;
5354a3680546Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5355a3680546Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5356a3680546Smrg	ifc* | ifort*)			# Intel Fortran compiler
5357a3680546Smrg	  tmp_addflag=' -nofor_main' ;;
5358a3680546Smrg	lf95*)				# Lahey Fortran 8.1
5359a3680546Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5360a3680546Smrg	  tmp_sharedflag='--shared' ;;
5361a3680546Smrg        nagfor*)                        # NAGFOR 5.3
5362a3680546Smrg          tmp_sharedflag='-Wl,-shared' ;;
5363a3680546Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5364a3680546Smrg	  tmp_sharedflag='-qmkshrobj'
5365a3680546Smrg	  tmp_addflag= ;;
5366a3680546Smrg	nvcc*)	# Cuda Compiler Driver 2.2
5367a3680546Smrg	  _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'
5368a3680546Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5369a3680546Smrg	  ;;
5370a3680546Smrg	esac
5371a3680546Smrg	case `$CC -V 2>&1 | $SED 5q` in
5372a3680546Smrg	*Sun\ C*)			# Sun C 5.9
5373a3680546Smrg	  _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'
5374a3680546Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5375a3680546Smrg	  tmp_sharedflag='-G' ;;
5376a3680546Smrg	*Sun\ F*)			# Sun Fortran 8.3
5377a3680546Smrg	  tmp_sharedflag='-G' ;;
5378a3680546Smrg	esac
5379a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5380a3680546Smrg
5381a3680546Smrg        if test yes = "$supports_anon_versioning"; then
5382a3680546Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5383a3680546Smrg            cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5384a3680546Smrg            echo "local: *; };" >> $output_objdir/$libname.ver~
5385a3680546Smrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
5386a3680546Smrg        fi
5387a3680546Smrg
5388a3680546Smrg	case $cc_basename in
5389a3680546Smrg	tcc*)
5390a3680546Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5391a3680546Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
5392a3680546Smrg	  ;;
5393a3680546Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
5394a3680546Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5395a3680546Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5396a3680546Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5397a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5398a3680546Smrg	  if test yes = "$supports_anon_versioning"; then
5399a3680546Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5400a3680546Smrg              cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5401a3680546Smrg              echo "local: *; };" >> $output_objdir/$libname.ver~
5402a3680546Smrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5403a3680546Smrg	  fi
5404a3680546Smrg	  ;;
5405a3680546Smrg	esac
5406a3680546Smrg      else
5407a3680546Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
5408a3680546Smrg      fi
5409a3680546Smrg      ;;
5410a3680546Smrg
5411a3680546Smrg    *-mlibc)
5412a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5413a3680546Smrg	_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'
5414a3680546Smrg      ;;
5415a3680546Smrg
5416a3680546Smrg    netbsd* | netbsdelf*-gnu)
5417a3680546Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5418a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5419a3680546Smrg	wlarc=
5420a3680546Smrg      else
5421a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5422a3680546Smrg	_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'
5423a3680546Smrg      fi
5424a3680546Smrg      ;;
5425a3680546Smrg
5426a3680546Smrg    solaris*)
5427a3680546Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5428a3680546Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
5429a3680546Smrg	cat <<_LT_EOF 1>&2
5430a3680546Smrg
5431a3680546Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5432a3680546Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
5433a3680546Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5434a3680546Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
5435a3680546Smrg*** your PATH or compiler configuration so that the native linker is
5436a3680546Smrg*** used, and then restart.
5437a3680546Smrg
5438a3680546Smrg_LT_EOF
5439a3680546Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5440a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5441a3680546Smrg	_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'
5442a3680546Smrg      else
5443a3680546Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
5444a3680546Smrg      fi
5445a3680546Smrg      ;;
5446a3680546Smrg
5447a3680546Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5448a3680546Smrg      case `$LD -v 2>&1` in
5449a3680546Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5450a3680546Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
5451a3680546Smrg	cat <<_LT_EOF 1>&2
5452a3680546Smrg
5453a3680546Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
5454a3680546Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
5455a3680546Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5456a3680546Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5457a3680546Smrg*** your PATH or compiler configuration so that the native linker is
5458a3680546Smrg*** used, and then restart.
5459a3680546Smrg
5460a3680546Smrg_LT_EOF
5461a3680546Smrg	;;
5462a3680546Smrg	*)
5463a3680546Smrg	  # For security reasons, it is highly recommended that you always
5464a3680546Smrg	  # use absolute paths for naming shared libraries, and exclude the
5465a3680546Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
5466a3680546Smrg	  # requires that you compile everything twice, which is a pain.
5467a3680546Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5468a3680546Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5469a3680546Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5470a3680546Smrg	    _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'
5471a3680546Smrg	  else
5472a3680546Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5473a3680546Smrg	  fi
5474a3680546Smrg	;;
5475a3680546Smrg      esac
5476a3680546Smrg      ;;
5477a3680546Smrg
5478a3680546Smrg    sunos4*)
5479a3680546Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5480a3680546Smrg      wlarc=
5481a3680546Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5482a3680546Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5483a3680546Smrg      ;;
5484a3680546Smrg
5485a3680546Smrg    *)
5486a3680546Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5487a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5488a3680546Smrg	_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'
5489a3680546Smrg      else
5490a3680546Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
5491a3680546Smrg      fi
5492a3680546Smrg      ;;
5493a3680546Smrg    esac
5494a3680546Smrg
5495a3680546Smrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
5496a3680546Smrg      runpath_var=
5497a3680546Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5498a3680546Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5499a3680546Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5500a3680546Smrg    fi
5501a3680546Smrg  else
5502a3680546Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
5503a3680546Smrg    case $host_os in
5504a3680546Smrg    aix3*)
5505a3680546Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5506a3680546Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5507a3680546Smrg      _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'
5508a3680546Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
5509a3680546Smrg      # are no directories specified by -L.
5510a3680546Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5511a3680546Smrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
5512a3680546Smrg	# Neither direct hardcoding nor static linking is supported with a
5513a3680546Smrg	# broken collect2.
5514a3680546Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
5515a3680546Smrg      fi
5516a3680546Smrg      ;;
5517a3680546Smrg
5518a3680546Smrg    aix[[4-9]]*)
5519a3680546Smrg      if test ia64 = "$host_cpu"; then
5520a3680546Smrg	# On IA64, the linker does run time linking by default, so we don't
5521a3680546Smrg	# have to do anything special.
5522a3680546Smrg	aix_use_runtimelinking=no
5523a3680546Smrg	exp_sym_flag='-Bexport'
5524a3680546Smrg	no_entry_flag=
5525a3680546Smrg      else
5526a3680546Smrg	# If we're using GNU nm, then we don't want the "-C" option.
5527a3680546Smrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
5528a3680546Smrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
5529a3680546Smrg	# weak defined symbols like other global defined symbols, whereas
5530a3680546Smrg	# GNU nm marks them as "W".
5531a3680546Smrg	# While the 'weak' keyword is ignored in the Export File, we need
5532a3680546Smrg	# it in the Import File for the 'aix-soname' feature, so we have
5533a3680546Smrg	# to replace the "-B" option with "-P" for AIX nm.
5534a3680546Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5535a3680546Smrg	  _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'
5536a3680546Smrg	else
5537a3680546Smrg	  _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'
5538a3680546Smrg	fi
5539a3680546Smrg	aix_use_runtimelinking=no
5540a3680546Smrg
5541a3680546Smrg	# Test if we are trying to use run time linking or normal
5542a3680546Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5543a3680546Smrg	# have runtime linking enabled, and use it for executables.
5544a3680546Smrg	# For shared libraries, we enable/disable runtime linking
5545a3680546Smrg	# depending on the kind of the shared library created -
5546a3680546Smrg	# when "with_aix_soname,aix_use_runtimelinking" is:
5547a3680546Smrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
5548a3680546Smrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
5549a3680546Smrg	#            lib.a           static archive
5550a3680546Smrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
5551a3680546Smrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
5552a3680546Smrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
5553a3680546Smrg	#            lib.a(lib.so.V) shared, rtl:no
5554a3680546Smrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
5555a3680546Smrg	#            lib.a           static archive
5556a3680546Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5557a3680546Smrg	  for ld_flag in $LDFLAGS; do
5558a3680546Smrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
5559a3680546Smrg	    aix_use_runtimelinking=yes
5560a3680546Smrg	    break
5561a3680546Smrg	  fi
5562a3680546Smrg	  done
5563a3680546Smrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
5564a3680546Smrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
5565a3680546Smrg	    # so we don't have lib.a shared libs to link our executables.
5566a3680546Smrg	    # We have to force runtime linking in this case.
5567a3680546Smrg	    aix_use_runtimelinking=yes
5568a3680546Smrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
5569a3680546Smrg	  fi
5570a3680546Smrg	  ;;
5571a3680546Smrg	esac
5572a3680546Smrg
5573a3680546Smrg	exp_sym_flag='-bexport'
5574a3680546Smrg	no_entry_flag='-bnoentry'
5575a3680546Smrg      fi
5576a3680546Smrg
5577a3680546Smrg      # When large executables or shared objects are built, AIX ld can
5578a3680546Smrg      # have problems creating the table of contents.  If linking a library
5579a3680546Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
5580a3680546Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5581a3680546Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5582a3680546Smrg
5583a3680546Smrg      _LT_TAGVAR(archive_cmds, $1)=''
5584a3680546Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5585a3680546Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5586a3680546Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5587a3680546Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5588a3680546Smrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
5589a3680546Smrg      case $with_aix_soname,$aix_use_runtimelinking in
5590a3680546Smrg      aix,*) ;; # traditional, no import file
5591a3680546Smrg      svr4,* | *,yes) # use import file
5592a3680546Smrg	# The Import File defines what to hardcode.
5593a3680546Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
5594a3680546Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5595a3680546Smrg	;;
5596a3680546Smrg      esac
5597a3680546Smrg
5598a3680546Smrg      if test yes = "$GCC"; then
5599a3680546Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5600a3680546Smrg	# We only want to do this on AIX 4.2 and lower, the check
5601a3680546Smrg	# below for broken collect2 doesn't work under 4.3+
5602a3680546Smrg	  collect2name=`$CC -print-prog-name=collect2`
5603a3680546Smrg	  if test -f "$collect2name" &&
5604a3680546Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5605a3680546Smrg	  then
5606a3680546Smrg	  # We have reworked collect2
5607a3680546Smrg	  :
5608a3680546Smrg	  else
5609a3680546Smrg	  # We have old collect2
5610a3680546Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
5611a3680546Smrg	  # It fails to find uninstalled libraries when the uninstalled
5612a3680546Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
5613a3680546Smrg	  # to unsupported forces relinking
5614a3680546Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5615a3680546Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5616a3680546Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5617a3680546Smrg	  fi
5618a3680546Smrg	  ;;
5619a3680546Smrg	esac
5620a3680546Smrg	shared_flag='-shared'
5621a3680546Smrg	if test yes = "$aix_use_runtimelinking"; then
5622a3680546Smrg	  shared_flag="$shared_flag "'$wl-G'
5623a3680546Smrg	fi
5624a3680546Smrg	# Need to ensure runtime linking is disabled for the traditional
5625a3680546Smrg	# shared library, or the linker may eventually find shared libraries
5626a3680546Smrg	# /with/ Import File - we do not want to mix them.
5627a3680546Smrg	shared_flag_aix='-shared'
5628a3680546Smrg	shared_flag_svr4='-shared $wl-G'
5629a3680546Smrg      else
5630a3680546Smrg	# not using gcc
5631a3680546Smrg	if test ia64 = "$host_cpu"; then
5632a3680546Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5633a3680546Smrg	# chokes on -Wl,-G. The following line is correct:
5634a3680546Smrg	  shared_flag='-G'
5635a3680546Smrg	else
5636a3680546Smrg	  if test yes = "$aix_use_runtimelinking"; then
5637a3680546Smrg	    shared_flag='$wl-G'
5638a3680546Smrg	  else
5639a3680546Smrg	    shared_flag='$wl-bM:SRE'
5640a3680546Smrg	  fi
5641a3680546Smrg	  shared_flag_aix='$wl-bM:SRE'
5642a3680546Smrg	  shared_flag_svr4='$wl-G'
5643a3680546Smrg	fi
5644a3680546Smrg      fi
5645a3680546Smrg
5646a3680546Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
5647a3680546Smrg      # It seems that -bexpall does not export symbols beginning with
5648a3680546Smrg      # underscore (_), so it is better to generate a list of symbols to export.
5649a3680546Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5650a3680546Smrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
5651a3680546Smrg	# Warning - without using the other runtime loading flags (-brtl),
5652a3680546Smrg	# -berok will link without error, but may produce a broken library.
5653a3680546Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5654a3680546Smrg        # Determine the default libpath from the value encoded in an
5655a3680546Smrg        # empty executable.
5656a3680546Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
5657a3680546Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5658a3680546Smrg        _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
5659a3680546Smrg      else
5660a3680546Smrg	if test ia64 = "$host_cpu"; then
5661a3680546Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
5662a3680546Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5663a3680546Smrg	  _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"
5664a3680546Smrg	else
5665a3680546Smrg	 # Determine the default libpath from the value encoded in an
5666a3680546Smrg	 # empty executable.
5667a3680546Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
5668a3680546Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5669a3680546Smrg	  # Warning - without using the other run time loading flags,
5670a3680546Smrg	  # -berok will link without error, but may produce a broken library.
5671a3680546Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
5672a3680546Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
5673a3680546Smrg	  if test yes = "$with_gnu_ld"; then
5674a3680546Smrg	    # We only use this code for GNU lds that support --whole-archive.
5675a3680546Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
5676a3680546Smrg	  else
5677a3680546Smrg	    # Exported symbols can be pulled into shared objects from archives
5678a3680546Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5679a3680546Smrg	  fi
5680a3680546Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5681a3680546Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
5682a3680546Smrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
5683a3680546Smrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
5684a3680546Smrg	  if test svr4 != "$with_aix_soname"; then
5685a3680546Smrg	    # This is similar to how AIX traditionally builds its shared libraries.
5686a3680546Smrg	    _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'
5687a3680546Smrg	  fi
5688a3680546Smrg	  if test aix != "$with_aix_soname"; then
5689a3680546Smrg	    _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'
5690a3680546Smrg	  else
5691a3680546Smrg	    # used by -dlpreopen to get the symbols
5692a3680546Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
5693a3680546Smrg	  fi
5694a3680546Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
5695a3680546Smrg	fi
5696a3680546Smrg      fi
5697a3680546Smrg      ;;
5698a3680546Smrg
5699a3680546Smrg    amigaos*)
5700a3680546Smrg      case $host_cpu in
5701a3680546Smrg      powerpc)
5702a3680546Smrg            # see comment about AmigaOS4 .so support
5703a3680546Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5704a3680546Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5705a3680546Smrg        ;;
5706a3680546Smrg      m68k)
5707a3680546Smrg            _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)'
5708a3680546Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5709a3680546Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5710a3680546Smrg        ;;
5711a3680546Smrg      esac
5712a3680546Smrg      ;;
5713a3680546Smrg
5714a3680546Smrg    bsdi[[45]]*)
5715a3680546Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5716a3680546Smrg      ;;
5717a3680546Smrg
5718a3680546Smrg    cygwin* | mingw* | windows* | pw32* | cegcc*)
5719a3680546Smrg      # When not using gcc, we currently assume that we are using
5720a3680546Smrg      # Microsoft Visual C++ or Intel C++ Compiler.
5721a3680546Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
5722a3680546Smrg      # no search path for DLLs.
5723a3680546Smrg      case $cc_basename in
5724a3680546Smrg      cl* | icl*)
5725a3680546Smrg	# Native MSVC or ICC
5726a3680546Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5727a3680546Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5728a3680546Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
5729a3680546Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
5730a3680546Smrg	# Tell ltmain to make .lib files, not .a files.
5731a3680546Smrg	libext=lib
5732a3680546Smrg	# Tell ltmain to make .dll files, not .so files.
5733a3680546Smrg	shrext_cmds=.dll
5734a3680546Smrg	# FIXME: Setting linknames here is a bad hack.
5735a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -Fe$output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
5736a3680546Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5737a3680546Smrg            cp "$export_symbols" "$output_objdir/$soname.def";
5738a3680546Smrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
5739a3680546Smrg          else
5740a3680546Smrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
5741a3680546Smrg          fi~
5742a3680546Smrg          $CC -Fe$tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5743a3680546Smrg          linknames='
5744a3680546Smrg	# The linker will not automatically build a static lib if we build a DLL.
5745a3680546Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5746a3680546Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5747a3680546Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5748a3680546Smrg	_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'
5749a3680546Smrg	# Don't use ranlib
5750a3680546Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5751a3680546Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5752a3680546Smrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
5753a3680546Smrg          case $lt_outputfile in
5754a3680546Smrg            *.exe|*.EXE) ;;
5755a3680546Smrg            *)
5756a3680546Smrg              lt_outputfile=$lt_outputfile.exe
5757a3680546Smrg              lt_tool_outputfile=$lt_tool_outputfile.exe
5758a3680546Smrg              ;;
5759a3680546Smrg          esac~
5760a3680546Smrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
5761a3680546Smrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5762a3680546Smrg            $RM "$lt_outputfile.manifest";
5763a3680546Smrg          fi'
5764a3680546Smrg	;;
5765a3680546Smrg      *)
5766a3680546Smrg	# Assume MSVC and ICC wrapper
5767a3680546Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5768a3680546Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5769a3680546Smrg	# Tell ltmain to make .lib files, not .a files.
5770a3680546Smrg	libext=lib
5771a3680546Smrg	# Tell ltmain to make .dll files, not .so files.
5772a3680546Smrg	shrext_cmds=.dll
5773a3680546Smrg	# FIXME: Setting linknames here is a bad hack.
5774a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5775a3680546Smrg	# The linker will automatically build a .lib file if we build a DLL.
5776a3680546Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5777a3680546Smrg	# FIXME: Should let the user specify the lib program.
5778a3680546Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5779a3680546Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5780a3680546Smrg	;;
5781a3680546Smrg      esac
5782a3680546Smrg      ;;
5783a3680546Smrg
5784a3680546Smrg    darwin* | rhapsody*)
5785a3680546Smrg      _LT_DARWIN_LINKER_FEATURES($1)
5786a3680546Smrg      ;;
5787a3680546Smrg
5788a3680546Smrg    dgux*)
5789a3680546Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5790a3680546Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5791a3680546Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5792a3680546Smrg      ;;
5793a3680546Smrg
5794a3680546Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5795a3680546Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
5796a3680546Smrg    # does not break anything, and helps significantly (at the cost of a little
5797a3680546Smrg    # extra space).
5798a3680546Smrg    freebsd2.2*)
5799a3680546Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5800a3680546Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5801a3680546Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5802a3680546Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5803a3680546Smrg      ;;
5804a3680546Smrg
5805a3680546Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5806a3680546Smrg    freebsd2.*)
5807a3680546Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5808a3680546Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5809a3680546Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5810a3680546Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5811a3680546Smrg      ;;
5812a3680546Smrg
5813a3680546Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5814a3680546Smrg    freebsd* | dragonfly* | midnightbsd*)
5815a3680546Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5816a3680546Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5817a3680546Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5818a3680546Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5819a3680546Smrg      ;;
5820a3680546Smrg
5821a3680546Smrg    hpux9*)
5822a3680546Smrg      if test yes = "$GCC"; then
5823a3680546Smrg	_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'
5824a3680546Smrg      else
5825a3680546Smrg	_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'
5826a3680546Smrg      fi
5827a3680546Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5828a3680546Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5829a3680546Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5830a3680546Smrg
5831a3680546Smrg      # hardcode_minus_L: Not really in the search PATH,
5832a3680546Smrg      # but as the default location of the library.
5833a3680546Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5834a3680546Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5835a3680546Smrg      ;;
5836a3680546Smrg
5837a3680546Smrg    hpux10*)
5838a3680546Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
5839a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5840a3680546Smrg      else
5841a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5842a3680546Smrg      fi
5843a3680546Smrg      if test no = "$with_gnu_ld"; then
5844a3680546Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5845a3680546Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5846a3680546Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5847a3680546Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5848a3680546Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5849a3680546Smrg	# hardcode_minus_L: Not really in the search PATH,
5850a3680546Smrg	# but as the default location of the library.
5851a3680546Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
5852a3680546Smrg      fi
5853a3680546Smrg      ;;
5854a3680546Smrg
5855a3680546Smrg    hpux11*)
5856a3680546Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
5857a3680546Smrg	case $host_cpu in
5858a3680546Smrg	hppa*64*)
5859a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5860a3680546Smrg	  ;;
5861a3680546Smrg	ia64*)
5862a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5863a3680546Smrg	  ;;
5864a3680546Smrg	*)
5865a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5866a3680546Smrg	  ;;
5867a3680546Smrg	esac
5868a3680546Smrg      else
5869a3680546Smrg	case $host_cpu in
5870a3680546Smrg	hppa*64*)
5871a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5872a3680546Smrg	  ;;
5873a3680546Smrg	ia64*)
5874a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5875a3680546Smrg	  ;;
5876a3680546Smrg	*)
5877a3680546Smrg	m4_if($1, [], [
5878a3680546Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
5879a3680546Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
5880a3680546Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
5881a3680546Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5882a3680546Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
5883a3680546Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5884a3680546Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5885a3680546Smrg	  ;;
5886a3680546Smrg	esac
5887a3680546Smrg      fi
5888a3680546Smrg      if test no = "$with_gnu_ld"; then
5889a3680546Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5890a3680546Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5891a3680546Smrg
5892a3680546Smrg	case $host_cpu in
5893a3680546Smrg	hppa*64*|ia64*)
5894a3680546Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5895a3680546Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5896a3680546Smrg	  ;;
5897a3680546Smrg	*)
5898a3680546Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
5899a3680546Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5900a3680546Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5901a3680546Smrg
5902a3680546Smrg	  # hardcode_minus_L: Not really in the search PATH,
5903a3680546Smrg	  # but as the default location of the library.
5904a3680546Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5905a3680546Smrg	  ;;
5906a3680546Smrg	esac
5907a3680546Smrg      fi
5908a3680546Smrg      ;;
5909a3680546Smrg
5910a3680546Smrg    irix5* | irix6* | nonstopux*)
5911a3680546Smrg      if test yes = "$GCC"; then
5912a3680546Smrg	_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'
5913a3680546Smrg	# Try to use the -exported_symbol ld option, if it does not
5914a3680546Smrg	# work, assume that -exports_file does not work either and
5915a3680546Smrg	# implicitly export all symbols.
5916a3680546Smrg	# This should be the same for all languages, so no per-tag cache variable.
5917a3680546Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5918a3680546Smrg	  [lt_cv_irix_exported_symbol],
5919a3680546Smrg	  [save_LDFLAGS=$LDFLAGS
5920a3680546Smrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
5921a3680546Smrg	   AC_LINK_IFELSE(
5922a3680546Smrg	     [AC_LANG_SOURCE(
5923a3680546Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5924a3680546Smrg			      [C++], [[int foo (void) { return 0; }]],
5925a3680546Smrg			      [Fortran 77], [[
5926a3680546Smrg      subroutine foo
5927a3680546Smrg      end]],
5928a3680546Smrg			      [Fortran], [[
5929a3680546Smrg      subroutine foo
5930a3680546Smrg      end]])])],
5931a3680546Smrg	      [lt_cv_irix_exported_symbol=yes],
5932a3680546Smrg	      [lt_cv_irix_exported_symbol=no])
5933a3680546Smrg           LDFLAGS=$save_LDFLAGS])
5934a3680546Smrg	if test yes = "$lt_cv_irix_exported_symbol"; then
5935a3680546Smrg          _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'
5936a3680546Smrg	fi
5937a3680546Smrg      else
5938a3680546Smrg	_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'
5939a3680546Smrg	_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'
5940a3680546Smrg      fi
5941a3680546Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5942a3680546Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5943a3680546Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5944a3680546Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
5945a3680546Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5946a3680546Smrg      ;;
5947a3680546Smrg
5948a3680546Smrg    linux*)
5949a3680546Smrg      case $cc_basename in
5950a3680546Smrg      tcc*)
5951a3680546Smrg	# Fabrice Bellard et al's Tiny C Compiler
5952a3680546Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5953a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5954a3680546Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5955a3680546Smrg	;;
5956a3680546Smrg      esac
5957a3680546Smrg      ;;
5958a3680546Smrg
5959a3680546Smrg    *-mlibc)
5960a3680546Smrg      ;;
5961a3680546Smrg
5962a3680546Smrg    netbsd* | netbsdelf*-gnu)
5963a3680546Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5964a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5965a3680546Smrg      else
5966a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5967a3680546Smrg      fi
5968a3680546Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5969a3680546Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5970a3680546Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5971a3680546Smrg      ;;
5972a3680546Smrg
5973a3680546Smrg    newsos6)
5974a3680546Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5975a3680546Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5976a3680546Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5977a3680546Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5978a3680546Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5979a3680546Smrg      ;;
5980a3680546Smrg
5981a3680546Smrg    *nto* | *qnx*)
5982a3680546Smrg      ;;
5983a3680546Smrg
5984a3680546Smrg    openbsd*)
5985a3680546Smrg      if test -f /usr/libexec/ld.so; then
5986a3680546Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5987a3680546Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5988a3680546Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5989a3680546Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
5990a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5991a3680546Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
5992a3680546Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5993a3680546Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5994a3680546Smrg	else
5995a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5996a3680546Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5997a3680546Smrg	fi
5998a3680546Smrg      else
5999a3680546Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6000a3680546Smrg      fi
6001a3680546Smrg      ;;
6002a3680546Smrg
6003a3680546Smrg    os2*)
6004a3680546Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6005a3680546Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6006a3680546Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6007a3680546Smrg      shrext_cmds=.dll
6008a3680546Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6009a3680546Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6010a3680546Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6011a3680546Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
6012a3680546Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
6013a3680546Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6014a3680546Smrg	emximp -o $lib $output_objdir/$libname.def'
6015a3680546Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6016a3680546Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6017a3680546Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6018a3680546Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
6019a3680546Smrg	prefix_cmds="$SED"~
6020a3680546Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
6021a3680546Smrg	  prefix_cmds="$prefix_cmds -e 1d";
6022a3680546Smrg	fi~
6023a3680546Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
6024a3680546Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
6025a3680546Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6026a3680546Smrg	emximp -o $lib $output_objdir/$libname.def'
6027a3680546Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
6028a3680546Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6029a3680546Smrg      _LT_TAGVAR(file_list_spec, $1)='@'
6030a3680546Smrg      ;;
6031a3680546Smrg
6032a3680546Smrg    osf3*)
6033a3680546Smrg      if test yes = "$GCC"; then
6034a3680546Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
6035a3680546Smrg	_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'
6036a3680546Smrg      else
6037a3680546Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6038a3680546Smrg	_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'
6039a3680546Smrg      fi
6040a3680546Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6041a3680546Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6042a3680546Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6043a3680546Smrg      ;;
6044a3680546Smrg
6045a3680546Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
6046a3680546Smrg      if test yes = "$GCC"; then
6047a3680546Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
6048a3680546Smrg	_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'
6049a3680546Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6050a3680546Smrg      else
6051a3680546Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6052a3680546Smrg	_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'
6053a3680546Smrg	_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~
6054a3680546Smrg          $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'
6055a3680546Smrg
6056a3680546Smrg	# Both c and cxx compiler support -rpath directly
6057a3680546Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6058a3680546Smrg      fi
6059a3680546Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6060a3680546Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6061a3680546Smrg      ;;
6062a3680546Smrg
6063a3680546Smrg    serenity*)
6064a3680546Smrg      ;;
6065a3680546Smrg
6066a3680546Smrg    solaris*)
6067a3680546Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
6068a3680546Smrg      if test yes = "$GCC"; then
6069a3680546Smrg	wlarc='$wl'
6070a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
6071a3680546Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6072a3680546Smrg          $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'
6073a3680546Smrg      else
6074a3680546Smrg	case `$CC -V 2>&1` in
6075a3680546Smrg	*"Compilers 5.0"*)
6076a3680546Smrg	  wlarc=''
6077a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
6078a3680546Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6079a3680546Smrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
6080a3680546Smrg	  ;;
6081a3680546Smrg	*)
6082a3680546Smrg	  wlarc='$wl'
6083a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
6084a3680546Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6085a3680546Smrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
6086a3680546Smrg	  ;;
6087a3680546Smrg	esac
6088a3680546Smrg      fi
6089a3680546Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6090a3680546Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6091a3680546Smrg      case $host_os in
6092a3680546Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6093a3680546Smrg      *)
6094a3680546Smrg	# The compiler driver will combine and reorder linker options,
6095a3680546Smrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
6096a3680546Smrg	# but is careful enough not to reorder.
6097a3680546Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
6098a3680546Smrg	if test yes = "$GCC"; then
6099a3680546Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
6100a3680546Smrg	else
6101a3680546Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6102a3680546Smrg	fi
6103a3680546Smrg	;;
6104a3680546Smrg      esac
6105a3680546Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6106a3680546Smrg      ;;
6107a3680546Smrg
6108a3680546Smrg    sunos4*)
6109a3680546Smrg      if test sequent = "$host_vendor"; then
6110a3680546Smrg	# Use $CC to link under sequent, because it throws in some extra .o
6111a3680546Smrg	# files that make .init and .fini sections work.
6112a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6113a3680546Smrg      else
6114a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6115a3680546Smrg      fi
6116a3680546Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6117a3680546Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6118a3680546Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6119a3680546Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6120a3680546Smrg      ;;
6121a3680546Smrg
6122a3680546Smrg    sysv4)
6123a3680546Smrg      case $host_vendor in
6124a3680546Smrg	sni)
6125a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6126a3680546Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6127a3680546Smrg	;;
6128a3680546Smrg	siemens)
6129a3680546Smrg	  ## LD is ld it makes a PLAMLIB
6130a3680546Smrg	  ## CC just makes a GrossModule.
6131a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6132a3680546Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6133a3680546Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
6134a3680546Smrg        ;;
6135a3680546Smrg	motorola)
6136a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6137a3680546Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6138a3680546Smrg	;;
6139a3680546Smrg      esac
6140a3680546Smrg      runpath_var='LD_RUN_PATH'
6141a3680546Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6142a3680546Smrg      ;;
6143a3680546Smrg
6144a3680546Smrg    sysv4.3*)
6145a3680546Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6146a3680546Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6147a3680546Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6148a3680546Smrg      ;;
6149a3680546Smrg
6150a3680546Smrg    sysv4*MP*)
6151a3680546Smrg      if test -d /usr/nec; then
6152a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6153a3680546Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6154a3680546Smrg	runpath_var=LD_RUN_PATH
6155a3680546Smrg	hardcode_runpath_var=yes
6156a3680546Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
6157a3680546Smrg      fi
6158a3680546Smrg      ;;
6159a3680546Smrg
6160a3680546Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6161a3680546Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6162a3680546Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6163a3680546Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6164a3680546Smrg      runpath_var='LD_RUN_PATH'
6165a3680546Smrg
6166a3680546Smrg      if test yes = "$GCC"; then
6167a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6168a3680546Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6169a3680546Smrg      else
6170a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6171a3680546Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6172a3680546Smrg      fi
6173a3680546Smrg      ;;
6174a3680546Smrg
6175a3680546Smrg    sysv5* | sco3.2v5* | sco5v6*)
6176a3680546Smrg      # Note: We CANNOT use -z defs as we might desire, because we do not
6177a3680546Smrg      # link with -lc, and that would cause any symbols used from libc to
6178a3680546Smrg      # always be unresolved, which means just about no library would
6179a3680546Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
6180a3680546Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
6181a3680546Smrg      # as -z defs.
6182a3680546Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6183a3680546Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
6184a3680546Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6185a3680546Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6186a3680546Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
6187a3680546Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6188a3680546Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6189a3680546Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
6190a3680546Smrg      runpath_var='LD_RUN_PATH'
6191a3680546Smrg
6192a3680546Smrg      if test yes = "$GCC"; then
6193a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6194a3680546Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6195a3680546Smrg      else
6196a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6197a3680546Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6198a3680546Smrg      fi
6199a3680546Smrg      ;;
6200a3680546Smrg
6201a3680546Smrg    uts4*)
6202a3680546Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6203a3680546Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6204a3680546Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6205a3680546Smrg      ;;
6206a3680546Smrg
6207a3680546Smrg    *)
6208a3680546Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
6209a3680546Smrg      ;;
6210a3680546Smrg    esac
6211a3680546Smrg
6212a3680546Smrg    if test sni = "$host_vendor"; then
6213a3680546Smrg      case $host in
6214a3680546Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6215a3680546Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
6216a3680546Smrg	;;
6217a3680546Smrg      esac
6218a3680546Smrg    fi
6219a3680546Smrg  fi
6220a3680546Smrg])
6221a3680546SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6222a3680546Smrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
6223a3680546Smrg
6224a3680546Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6225a3680546Smrg
6226a3680546Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6227a3680546Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6228a3680546Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
6229a3680546Smrg    [The commands to extract the exported symbol list from a shared archive])
6230a3680546Smrg
6231a3680546Smrg#
6232a3680546Smrg# Do we need to explicitly link libc?
6233a3680546Smrg#
6234a3680546Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6235a3680546Smrgx|xyes)
6236a3680546Smrg  # Assume -lc should be added
6237a3680546Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6238a3680546Smrg
6239a3680546Smrg  if test yes,yes = "$GCC,$enable_shared"; then
6240a3680546Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
6241a3680546Smrg    *'~'*)
6242a3680546Smrg      # FIXME: we may have to deal with multi-command sequences.
6243a3680546Smrg      ;;
6244a3680546Smrg    '$CC '*)
6245a3680546Smrg      # Test whether the compiler implicitly links with -lc since on some
6246a3680546Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6247a3680546Smrg      # to ld, don't add -lc before -lgcc.
6248a3680546Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6249a3680546Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6250a3680546Smrg	[$RM conftest*
6251a3680546Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6252a3680546Smrg
6253a3680546Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6254a3680546Smrg	  soname=conftest
6255a3680546Smrg	  lib=conftest
6256a3680546Smrg	  libobjs=conftest.$ac_objext
6257a3680546Smrg	  deplibs=
6258a3680546Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6259a3680546Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6260a3680546Smrg	  compiler_flags=-v
6261a3680546Smrg	  linker_flags=-v
6262a3680546Smrg	  verstring=
6263a3680546Smrg	  output_objdir=.
6264a3680546Smrg	  libname=conftest
6265a3680546Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6266a3680546Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
6267a3680546Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6268a3680546Smrg	  then
6269a3680546Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6270a3680546Smrg	  else
6271a3680546Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6272a3680546Smrg	  fi
6273a3680546Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6274a3680546Smrg	else
6275a3680546Smrg	  cat conftest.err 1>&5
6276a3680546Smrg	fi
6277a3680546Smrg	$RM conftest*
6278a3680546Smrg	])
6279a3680546Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6280a3680546Smrg      ;;
6281a3680546Smrg    esac
6282a3680546Smrg  fi
6283a3680546Smrg  ;;
6284a3680546Smrgesac
6285a3680546Smrg
6286a3680546Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6287a3680546Smrg    [Whether or not to add -lc for building shared libraries])
6288a3680546Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6289a3680546Smrg    [enable_shared_with_static_runtimes], [0],
6290a3680546Smrg    [Whether or not to disallow shared libs when runtime libs are static])
6291a3680546Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6292a3680546Smrg    [Compiler flag to allow reflexive dlopens])
6293a3680546Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
6294a3680546Smrg    [Compiler flag to generate shared objects directly from archives])
6295a3680546Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
6296a3680546Smrg    [Whether the compiler copes with passing no objects directly])
6297a3680546Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6298a3680546Smrg    [Create an old-style archive from a shared archive])
6299a3680546Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6300a3680546Smrg    [Create a temporary old-style archive to link instead of a shared archive])
6301a3680546Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6302a3680546Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
6303a3680546Smrg_LT_TAGDECL([], [module_cmds], [2],
6304a3680546Smrg    [Commands used to build a loadable module if different from building
6305a3680546Smrg    a shared archive.])
6306a3680546Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
6307a3680546Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
6308a3680546Smrg    [Whether we are building with GNU ld or not])
6309a3680546Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
6310a3680546Smrg    [Flag that allows shared libraries with undefined symbols to be built])
6311a3680546Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
6312a3680546Smrg    [Flag that enforces no undefined symbols])
6313a3680546Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6314a3680546Smrg    [Flag to hardcode $libdir into a binary during linking.
6315a3680546Smrg    This must work even if $libdir does not exist])
6316a3680546Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
6317a3680546Smrg    [Whether we need a single "-rpath" flag with a separated argument])
6318a3680546Smrg_LT_TAGDECL([], [hardcode_direct], [0],
6319a3680546Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6320a3680546Smrg    DIR into the resulting binary])
6321a3680546Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6322a3680546Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6323a3680546Smrg    DIR into the resulting binary and the resulting library dependency is
6324a3680546Smrg    "absolute", i.e. impossible to change by setting $shlibpath_var if the
6325a3680546Smrg    library is relocated])
6326a3680546Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
6327a3680546Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6328a3680546Smrg    into the resulting binary])
6329a3680546Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6330a3680546Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6331a3680546Smrg    into the resulting binary])
6332a3680546Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
6333a3680546Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
6334a3680546Smrg    into the library and all subsequent libraries and executables linked
6335a3680546Smrg    against it])
6336a3680546Smrg_LT_TAGDECL([], [inherit_rpath], [0],
6337a3680546Smrg    [Set to yes if linker adds runtime paths of dependent libraries
6338a3680546Smrg    to runtime path list])
6339a3680546Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
6340a3680546Smrg    [Whether libtool must link a program against all its dependency libraries])
6341a3680546Smrg_LT_TAGDECL([], [always_export_symbols], [0],
6342a3680546Smrg    [Set to "yes" if exported symbols are required])
6343a3680546Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
6344a3680546Smrg    [The commands to list exported symbols])
6345a3680546Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
6346a3680546Smrg    [Symbols that should not be listed in the preloaded symbols])
6347a3680546Smrg_LT_TAGDECL([], [include_expsyms], [1],
6348a3680546Smrg    [Symbols that must always be exported])
6349a3680546Smrg_LT_TAGDECL([], [prelink_cmds], [2],
6350a3680546Smrg    [Commands necessary for linking programs (against libraries) with templates])
6351a3680546Smrg_LT_TAGDECL([], [postlink_cmds], [2],
6352a3680546Smrg    [Commands necessary for finishing linking programs])
6353a3680546Smrg_LT_TAGDECL([], [file_list_spec], [1],
6354a3680546Smrg    [Specify filename containing input files])
6355a3680546Smrgdnl FIXME: Not yet implemented
6356a3680546Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6357a3680546Smrgdnl    [Compiler flag to generate thread safe objects])
6358a3680546Smrg])# _LT_LINKER_SHLIBS
6359a3680546Smrg
6360a3680546Smrg
6361a3680546Smrg# _LT_LANG_C_CONFIG([TAG])
6362a3680546Smrg# ------------------------
6363a3680546Smrg# Ensure that the configuration variables for a C compiler are suitably
6364a3680546Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6365a3680546Smrg# the compiler configuration to 'libtool'.
6366a3680546Smrgm4_defun([_LT_LANG_C_CONFIG],
6367a3680546Smrg[m4_require([_LT_DECL_EGREP])dnl
6368a3680546Smrglt_save_CC=$CC
6369a3680546SmrgAC_LANG_PUSH(C)
6370a3680546Smrg
6371a3680546Smrg# Source file extension for C test sources.
6372a3680546Smrgac_ext=c
6373a3680546Smrg
6374a3680546Smrg# Object file extension for compiled C test sources.
6375a3680546Smrgobjext=o
6376a3680546Smrg_LT_TAGVAR(objext, $1)=$objext
6377a3680546Smrg
6378a3680546Smrg# Code to be used in simple compile tests
6379a3680546Smrglt_simple_compile_test_code="int some_variable = 0;"
6380a3680546Smrg
6381a3680546Smrg# Code to be used in simple link tests
6382a3680546Smrglt_simple_link_test_code='int main(void){return(0);}'
6383a3680546Smrg
6384a3680546Smrg_LT_TAG_COMPILER
6385a3680546Smrg# Save the default compiler, since it gets overwritten when the other
6386a3680546Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6387a3680546Smrgcompiler_DEFAULT=$CC
6388a3680546Smrg
6389a3680546Smrg# save warnings/boilerplate of simple test code
6390a3680546Smrg_LT_COMPILER_BOILERPLATE
6391a3680546Smrg_LT_LINKER_BOILERPLATE
6392a3680546Smrg
6393a3680546Smrg## CAVEAT EMPTOR:
6394a3680546Smrg## There is no encapsulation within the following macros, do not change
6395a3680546Smrg## the running order or otherwise move them around unless you know exactly
6396a3680546Smrg## what you are doing...
6397a3680546Smrgif test -n "$compiler"; then
6398a3680546Smrg  _LT_COMPILER_NO_RTTI($1)
6399a3680546Smrg  _LT_COMPILER_PIC($1)
6400a3680546Smrg  _LT_COMPILER_C_O($1)
6401a3680546Smrg  _LT_COMPILER_FILE_LOCKS($1)
6402a3680546Smrg  _LT_LINKER_SHLIBS($1)
6403a3680546Smrg  _LT_SYS_DYNAMIC_LINKER($1)
6404a3680546Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
6405a3680546Smrg  LT_SYS_DLOPEN_SELF
6406a3680546Smrg  _LT_CMD_STRIPLIB
6407a3680546Smrg
6408a3680546Smrg  # Report what library types will actually be built
6409a3680546Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
6410a3680546Smrg  AC_MSG_RESULT([$can_build_shared])
6411a3680546Smrg
6412a3680546Smrg  AC_MSG_CHECKING([whether to build shared libraries])
6413a3680546Smrg  test no = "$can_build_shared" && enable_shared=no
6414a3680546Smrg
6415a3680546Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
6416a3680546Smrg  # are all built from PIC.
6417a3680546Smrg  case $host_os in
6418a3680546Smrg  aix3*)
6419a3680546Smrg    test yes = "$enable_shared" && enable_static=no
6420a3680546Smrg    if test -n "$RANLIB"; then
6421a3680546Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6422a3680546Smrg      postinstall_cmds='$RANLIB $lib'
6423a3680546Smrg    fi
6424a3680546Smrg    ;;
6425a3680546Smrg
6426a3680546Smrg  aix[[4-9]]*)
6427a3680546Smrg    if test ia64 != "$host_cpu"; then
6428a3680546Smrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
6429a3680546Smrg      yes,aix,yes) ;;			# shared object as lib.so file only
6430a3680546Smrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
6431a3680546Smrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
6432a3680546Smrg      esac
6433a3680546Smrg    fi
6434a3680546Smrg    ;;
6435a3680546Smrg  esac
6436a3680546Smrg  AC_MSG_RESULT([$enable_shared])
6437a3680546Smrg
6438a3680546Smrg  AC_MSG_CHECKING([whether to build static libraries])
6439a3680546Smrg  # Make sure either enable_shared or enable_static is yes.
6440a3680546Smrg  test yes = "$enable_shared" || enable_static=yes
6441a3680546Smrg  AC_MSG_RESULT([$enable_static])
6442a3680546Smrg
6443a3680546Smrg  _LT_CONFIG($1)
6444a3680546Smrgfi
6445a3680546SmrgAC_LANG_POP
6446a3680546SmrgCC=$lt_save_CC
6447a3680546Smrg])# _LT_LANG_C_CONFIG
6448a3680546Smrg
6449a3680546Smrg
6450a3680546Smrg# _LT_LANG_CXX_CONFIG([TAG])
6451a3680546Smrg# --------------------------
6452a3680546Smrg# Ensure that the configuration variables for a C++ compiler are suitably
6453a3680546Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6454a3680546Smrg# the compiler configuration to 'libtool'.
6455a3680546Smrgm4_defun([_LT_LANG_CXX_CONFIG],
6456a3680546Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6457a3680546Smrgm4_require([_LT_DECL_EGREP])dnl
6458a3680546Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
6459a3680546Smrgif test -n "$CXX" && ( test no != "$CXX" &&
6460a3680546Smrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
6461a3680546Smrg    (test g++ != "$CXX"))); then
6462a3680546Smrg  AC_PROG_CXXCPP
6463a3680546Smrgelse
6464a3680546Smrg  _lt_caught_CXX_error=yes
6465a3680546Smrgfi
6466a3680546Smrg
6467a3680546SmrgAC_LANG_PUSH(C++)
6468a3680546Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6469a3680546Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
6470a3680546Smrg_LT_TAGVAR(always_export_symbols, $1)=no
6471a3680546Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6472a3680546Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
6473a3680546Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6474a3680546Smrg_LT_TAGVAR(hardcode_direct, $1)=no
6475a3680546Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6476a3680546Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6477a3680546Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6478a3680546Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6479a3680546Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6480a3680546Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
6481a3680546Smrg_LT_TAGVAR(inherit_rpath, $1)=no
6482a3680546Smrg_LT_TAGVAR(module_cmds, $1)=
6483a3680546Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
6484a3680546Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6485a3680546Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6486a3680546Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
6487a3680546Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6488a3680546Smrg_LT_TAGVAR(no_undefined_flag, $1)=
6489a3680546Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6490a3680546Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6491a3680546Smrg
6492a3680546Smrg# Source file extension for C++ test sources.
6493a3680546Smrgac_ext=cpp
6494a3680546Smrg
6495a3680546Smrg# Object file extension for compiled C++ test sources.
6496a3680546Smrgobjext=o
6497a3680546Smrg_LT_TAGVAR(objext, $1)=$objext
6498a3680546Smrg
6499a3680546Smrg# No sense in running all these tests if we already determined that
6500a3680546Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
6501a3680546Smrg# are currently assumed to apply to all compilers on this platform,
6502a3680546Smrg# and will be corrupted by setting them based on a non-working compiler.
6503a3680546Smrgif test yes != "$_lt_caught_CXX_error"; then
6504a3680546Smrg  # Code to be used in simple compile tests
6505a3680546Smrg  lt_simple_compile_test_code="int some_variable = 0;"
6506a3680546Smrg
6507a3680546Smrg  # Code to be used in simple link tests
6508a3680546Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6509a3680546Smrg
6510a3680546Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6511a3680546Smrg  _LT_TAG_COMPILER
6512a3680546Smrg
6513a3680546Smrg  # save warnings/boilerplate of simple test code
6514a3680546Smrg  _LT_COMPILER_BOILERPLATE
6515a3680546Smrg  _LT_LINKER_BOILERPLATE
6516a3680546Smrg
6517a3680546Smrg  # Allow CC to be a program name with arguments.
6518a3680546Smrg  lt_save_CC=$CC
6519a3680546Smrg  lt_save_CFLAGS=$CFLAGS
6520a3680546Smrg  lt_save_LD=$LD
6521a3680546Smrg  lt_save_GCC=$GCC
6522a3680546Smrg  GCC=$GXX
6523a3680546Smrg  lt_save_with_gnu_ld=$with_gnu_ld
6524a3680546Smrg  lt_save_path_LD=$lt_cv_path_LD
6525a3680546Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6526a3680546Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6527a3680546Smrg  else
6528a3680546Smrg    $as_unset lt_cv_prog_gnu_ld
6529a3680546Smrg  fi
6530a3680546Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
6531a3680546Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
6532a3680546Smrg  else
6533a3680546Smrg    $as_unset lt_cv_path_LD
6534a3680546Smrg  fi
6535a3680546Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
6536a3680546Smrg  CC=${CXX-"c++"}
6537a3680546Smrg  CFLAGS=$CXXFLAGS
6538a3680546Smrg  compiler=$CC
6539a3680546Smrg  _LT_TAGVAR(compiler, $1)=$CC
6540a3680546Smrg  _LT_CC_BASENAME([$compiler])
6541a3680546Smrg
6542a3680546Smrg  if test -n "$compiler"; then
6543a3680546Smrg    # We don't want -fno-exception when compiling C++ code, so set the
6544a3680546Smrg    # no_builtin_flag separately
6545a3680546Smrg    if test yes = "$GXX"; then
6546a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6547a3680546Smrg    else
6548a3680546Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6549a3680546Smrg    fi
6550a3680546Smrg
6551a3680546Smrg    if test yes = "$GXX"; then
6552a3680546Smrg      # Set up default GNU C++ configuration
6553a3680546Smrg
6554a3680546Smrg      LT_PATH_LD
6555a3680546Smrg
6556a3680546Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
6557a3680546Smrg      # archiving commands below assume that GNU ld is being used.
6558a3680546Smrg      if test yes = "$with_gnu_ld"; then
6559a3680546Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6560a3680546Smrg        _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'
6561a3680546Smrg
6562a3680546Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6563a3680546Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6564a3680546Smrg
6565a3680546Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
6566a3680546Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6567a3680546Smrg        #     investigate it a little bit more. (MM)
6568a3680546Smrg        wlarc='$wl'
6569a3680546Smrg
6570a3680546Smrg        # ancient GNU ld didn't support --whole-archive et. al.
6571a3680546Smrg        if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
6572a3680546Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
6573a3680546Smrg        else
6574a3680546Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
6575a3680546Smrg        fi
6576a3680546Smrg      else
6577a3680546Smrg        with_gnu_ld=no
6578a3680546Smrg        wlarc=
6579a3680546Smrg
6580a3680546Smrg        # A generic and very simple default shared library creation
6581a3680546Smrg        # command for GNU C++ for the case where it uses the native
6582a3680546Smrg        # linker, instead of GNU ld.  If possible, this setting should
6583a3680546Smrg        # overridden to take advantage of the native linker features on
6584a3680546Smrg        # the platform it is being used on.
6585a3680546Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6586a3680546Smrg      fi
6587a3680546Smrg
6588a3680546Smrg      # Commands to make compiler produce verbose output that lists
6589a3680546Smrg      # what "hidden" libraries, object files and flags are used when
6590a3680546Smrg      # linking a shared library.
6591a3680546Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"'
6592a3680546Smrg
6593a3680546Smrg    else
6594a3680546Smrg      GXX=no
6595a3680546Smrg      with_gnu_ld=no
6596a3680546Smrg      wlarc=
6597a3680546Smrg    fi
6598a3680546Smrg
6599a3680546Smrg    # PORTME: fill in a description of your system's C++ link characteristics
6600a3680546Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6601a3680546Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
6602a3680546Smrg    case $host_os in
6603a3680546Smrg      aix3*)
6604a3680546Smrg        # FIXME: insert proper C++ library support
6605a3680546Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6606a3680546Smrg        ;;
6607a3680546Smrg      aix[[4-9]]*)
6608a3680546Smrg        if test ia64 = "$host_cpu"; then
6609a3680546Smrg          # On IA64, the linker does run time linking by default, so we don't
6610a3680546Smrg          # have to do anything special.
6611a3680546Smrg          aix_use_runtimelinking=no
6612a3680546Smrg          exp_sym_flag='-Bexport'
6613a3680546Smrg          no_entry_flag=
6614a3680546Smrg        else
6615a3680546Smrg          aix_use_runtimelinking=no
6616a3680546Smrg
6617a3680546Smrg          # Test if we are trying to use run time linking or normal
6618a3680546Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6619a3680546Smrg          # have runtime linking enabled, and use it for executables.
6620a3680546Smrg          # For shared libraries, we enable/disable runtime linking
6621a3680546Smrg          # depending on the kind of the shared library created -
6622a3680546Smrg          # when "with_aix_soname,aix_use_runtimelinking" is:
6623a3680546Smrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
6624a3680546Smrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
6625a3680546Smrg          #            lib.a           static archive
6626a3680546Smrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
6627a3680546Smrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
6628a3680546Smrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
6629a3680546Smrg          #            lib.a(lib.so.V) shared, rtl:no
6630a3680546Smrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
6631a3680546Smrg          #            lib.a           static archive
6632a3680546Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6633a3680546Smrg	    for ld_flag in $LDFLAGS; do
6634a3680546Smrg	      case $ld_flag in
6635a3680546Smrg	      *-brtl*)
6636a3680546Smrg	        aix_use_runtimelinking=yes
6637a3680546Smrg	        break
6638a3680546Smrg	        ;;
6639a3680546Smrg	      esac
6640a3680546Smrg	    done
6641a3680546Smrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
6642a3680546Smrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
6643a3680546Smrg	      # so we don't have lib.a shared libs to link our executables.
6644a3680546Smrg	      # We have to force runtime linking in this case.
6645a3680546Smrg	      aix_use_runtimelinking=yes
6646a3680546Smrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
6647a3680546Smrg	    fi
6648a3680546Smrg	    ;;
6649a3680546Smrg          esac
6650a3680546Smrg
6651a3680546Smrg          exp_sym_flag='-bexport'
6652a3680546Smrg          no_entry_flag='-bnoentry'
6653a3680546Smrg        fi
6654a3680546Smrg
6655a3680546Smrg        # When large executables or shared objects are built, AIX ld can
6656a3680546Smrg        # have problems creating the table of contents.  If linking a library
6657a3680546Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
6658a3680546Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6659a3680546Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6660a3680546Smrg
6661a3680546Smrg        _LT_TAGVAR(archive_cmds, $1)=''
6662a3680546Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6663a3680546Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6664a3680546Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6665a3680546Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6666a3680546Smrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
6667a3680546Smrg        case $with_aix_soname,$aix_use_runtimelinking in
6668a3680546Smrg        aix,*) ;;	# no import file
6669a3680546Smrg        svr4,* | *,yes) # use import file
6670a3680546Smrg          # The Import File defines what to hardcode.
6671a3680546Smrg          _LT_TAGVAR(hardcode_direct, $1)=no
6672a3680546Smrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6673a3680546Smrg          ;;
6674a3680546Smrg        esac
6675a3680546Smrg
6676a3680546Smrg        if test yes = "$GXX"; then
6677a3680546Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
6678a3680546Smrg          # We only want to do this on AIX 4.2 and lower, the check
6679a3680546Smrg          # below for broken collect2 doesn't work under 4.3+
6680a3680546Smrg	  collect2name=`$CC -print-prog-name=collect2`
6681a3680546Smrg	  if test -f "$collect2name" &&
6682a3680546Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6683a3680546Smrg	  then
6684a3680546Smrg	    # We have reworked collect2
6685a3680546Smrg	    :
6686a3680546Smrg	  else
6687a3680546Smrg	    # We have old collect2
6688a3680546Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
6689a3680546Smrg	    # It fails to find uninstalled libraries when the uninstalled
6690a3680546Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
6691a3680546Smrg	    # to unsupported forces relinking
6692a3680546Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
6693a3680546Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6694a3680546Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
6695a3680546Smrg	  fi
6696a3680546Smrg          esac
6697a3680546Smrg          shared_flag='-shared'
6698a3680546Smrg	  if test yes = "$aix_use_runtimelinking"; then
6699a3680546Smrg	    shared_flag=$shared_flag' $wl-G'
6700a3680546Smrg	  fi
6701a3680546Smrg	  # Need to ensure runtime linking is disabled for the traditional
6702a3680546Smrg	  # shared library, or the linker may eventually find shared libraries
6703a3680546Smrg	  # /with/ Import File - we do not want to mix them.
6704a3680546Smrg	  shared_flag_aix='-shared'
6705a3680546Smrg	  shared_flag_svr4='-shared $wl-G'
6706a3680546Smrg        else
6707a3680546Smrg          # not using gcc
6708a3680546Smrg          if test ia64 = "$host_cpu"; then
6709a3680546Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6710a3680546Smrg	  # chokes on -Wl,-G. The following line is correct:
6711a3680546Smrg	  shared_flag='-G'
6712a3680546Smrg          else
6713a3680546Smrg	    if test yes = "$aix_use_runtimelinking"; then
6714a3680546Smrg	      shared_flag='$wl-G'
6715a3680546Smrg	    else
6716a3680546Smrg	      shared_flag='$wl-bM:SRE'
6717a3680546Smrg	    fi
6718a3680546Smrg	    shared_flag_aix='$wl-bM:SRE'
6719a3680546Smrg	    shared_flag_svr4='$wl-G'
6720a3680546Smrg          fi
6721a3680546Smrg        fi
6722a3680546Smrg
6723a3680546Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
6724a3680546Smrg        # It seems that -bexpall does not export symbols beginning with
6725a3680546Smrg        # underscore (_), so it is better to generate a list of symbols to
6726a3680546Smrg	# export.
6727a3680546Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
6728a3680546Smrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
6729a3680546Smrg          # Warning - without using the other runtime loading flags (-brtl),
6730a3680546Smrg          # -berok will link without error, but may produce a broken library.
6731a3680546Smrg          # The "-G" linker flag allows undefined symbols.
6732a3680546Smrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
6733a3680546Smrg          # Determine the default libpath from the value encoded in an empty
6734a3680546Smrg          # executable.
6735a3680546Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
6736a3680546Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6737a3680546Smrg
6738a3680546Smrg          _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
6739a3680546Smrg        else
6740a3680546Smrg          if test ia64 = "$host_cpu"; then
6741a3680546Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
6742a3680546Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6743a3680546Smrg	    _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"
6744a3680546Smrg          else
6745a3680546Smrg	    # Determine the default libpath from the value encoded in an
6746a3680546Smrg	    # empty executable.
6747a3680546Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
6748a3680546Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6749a3680546Smrg	    # Warning - without using the other run time loading flags,
6750a3680546Smrg	    # -berok will link without error, but may produce a broken library.
6751a3680546Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
6752a3680546Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
6753a3680546Smrg	    if test yes = "$with_gnu_ld"; then
6754a3680546Smrg	      # We only use this code for GNU lds that support --whole-archive.
6755a3680546Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6756a3680546Smrg	    else
6757a3680546Smrg	      # Exported symbols can be pulled into shared objects from archives
6758a3680546Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6759a3680546Smrg	    fi
6760a3680546Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6761a3680546Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
6762a3680546Smrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
6763a3680546Smrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
6764a3680546Smrg	    if test svr4 != "$with_aix_soname"; then
6765a3680546Smrg	      # This is similar to how AIX traditionally builds its shared
6766a3680546Smrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
6767a3680546Smrg	      _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'
6768a3680546Smrg	    fi
6769a3680546Smrg	    if test aix != "$with_aix_soname"; then
6770a3680546Smrg	      _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'
6771a3680546Smrg	    else
6772a3680546Smrg	      # used by -dlpreopen to get the symbols
6773a3680546Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
6774a3680546Smrg	    fi
6775a3680546Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
6776a3680546Smrg          fi
6777a3680546Smrg        fi
6778a3680546Smrg        ;;
6779a3680546Smrg
6780a3680546Smrg      beos*)
6781a3680546Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6782a3680546Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6783a3680546Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6784a3680546Smrg	  # support --undefined.  This deserves some investigation.  FIXME
6785a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6786a3680546Smrg	else
6787a3680546Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6788a3680546Smrg	fi
6789a3680546Smrg	;;
6790a3680546Smrg
6791a3680546Smrg      chorus*)
6792a3680546Smrg        case $cc_basename in
6793a3680546Smrg          *)
6794a3680546Smrg	  # FIXME: insert proper C++ library support
6795a3680546Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6796a3680546Smrg	  ;;
6797a3680546Smrg        esac
6798a3680546Smrg        ;;
6799a3680546Smrg
6800a3680546Smrg      cygwin* | mingw* | windows* | pw32* | cegcc*)
6801a3680546Smrg	case $GXX,$cc_basename in
6802a3680546Smrg	,cl* | no,cl* | ,icl* | no,icl*)
6803a3680546Smrg	  # Native MSVC or ICC
6804a3680546Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
6805a3680546Smrg	  # no search path for DLLs.
6806a3680546Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6807a3680546Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6808a3680546Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
6809a3680546Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
6810a3680546Smrg	  # Tell ltmain to make .lib files, not .a files.
6811a3680546Smrg	  libext=lib
6812a3680546Smrg	  # Tell ltmain to make .dll files, not .so files.
6813a3680546Smrg	  shrext_cmds=.dll
6814a3680546Smrg	  # FIXME: Setting linknames here is a bad hack.
6815a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
6816a3680546Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6817a3680546Smrg              cp "$export_symbols" "$output_objdir/$soname.def";
6818a3680546Smrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
6819a3680546Smrg            else
6820a3680546Smrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
6821a3680546Smrg            fi~
6822a3680546Smrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6823a3680546Smrg            linknames='
6824a3680546Smrg	  # The linker will not automatically build a static lib if we build a DLL.
6825a3680546Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6826a3680546Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6827a3680546Smrg	  # Don't use ranlib
6828a3680546Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6829a3680546Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6830a3680546Smrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
6831a3680546Smrg            case $lt_outputfile in
6832a3680546Smrg              *.exe|*.EXE) ;;
6833a3680546Smrg              *)
6834a3680546Smrg                lt_outputfile=$lt_outputfile.exe
6835a3680546Smrg                lt_tool_outputfile=$lt_tool_outputfile.exe
6836a3680546Smrg                ;;
6837a3680546Smrg            esac~
6838a3680546Smrg            func_to_tool_file "$lt_outputfile"~
6839a3680546Smrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
6840a3680546Smrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6841a3680546Smrg              $RM "$lt_outputfile.manifest";
6842a3680546Smrg            fi'
6843a3680546Smrg	  ;;
6844a3680546Smrg	*)
6845a3680546Smrg	  # g++
6846a3680546Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6847a3680546Smrg	  # as there is no search path for DLLs.
6848a3680546Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6849a3680546Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
6850a3680546Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6851a3680546Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
6852a3680546Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6853a3680546Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
6854a3680546Smrg
6855a3680546Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6856a3680546Smrg	    _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'
6857a3680546Smrg	    # If the export-symbols file already is a .def file, use it as
6858a3680546Smrg	    # is; otherwise, prepend EXPORTS...
6859a3680546Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6860a3680546Smrg              cp $export_symbols $output_objdir/$soname.def;
6861a3680546Smrg            else
6862a3680546Smrg              echo EXPORTS > $output_objdir/$soname.def;
6863a3680546Smrg              cat $export_symbols >> $output_objdir/$soname.def;
6864a3680546Smrg            fi~
6865a3680546Smrg            $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'
6866a3680546Smrg	  else
6867a3680546Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6868a3680546Smrg	  fi
6869a3680546Smrg	  ;;
6870a3680546Smrg	esac
6871a3680546Smrg	;;
6872a3680546Smrg      darwin* | rhapsody*)
6873a3680546Smrg        _LT_DARWIN_LINKER_FEATURES($1)
6874a3680546Smrg	;;
6875a3680546Smrg
6876a3680546Smrg      os2*)
6877a3680546Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6878a3680546Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6879a3680546Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6880a3680546Smrg	shrext_cmds=.dll
6881a3680546Smrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6882a3680546Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6883a3680546Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6884a3680546Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6885a3680546Smrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
6886a3680546Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6887a3680546Smrg	  emximp -o $lib $output_objdir/$libname.def'
6888a3680546Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6889a3680546Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6890a3680546Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6891a3680546Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6892a3680546Smrg	  prefix_cmds="$SED"~
6893a3680546Smrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
6894a3680546Smrg	    prefix_cmds="$prefix_cmds -e 1d";
6895a3680546Smrg	  fi~
6896a3680546Smrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
6897a3680546Smrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
6898a3680546Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6899a3680546Smrg	  emximp -o $lib $output_objdir/$libname.def'
6900a3680546Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
6901a3680546Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6902a3680546Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
6903a3680546Smrg	;;
6904a3680546Smrg
6905a3680546Smrg      dgux*)
6906a3680546Smrg        case $cc_basename in
6907a3680546Smrg          ec++*)
6908a3680546Smrg	    # FIXME: insert proper C++ library support
6909a3680546Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6910a3680546Smrg	    ;;
6911a3680546Smrg          ghcx*)
6912a3680546Smrg	    # Green Hills C++ Compiler
6913a3680546Smrg	    # FIXME: insert proper C++ library support
6914a3680546Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6915a3680546Smrg	    ;;
6916a3680546Smrg          *)
6917a3680546Smrg	    # FIXME: insert proper C++ library support
6918a3680546Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6919a3680546Smrg	    ;;
6920a3680546Smrg        esac
6921a3680546Smrg        ;;
6922a3680546Smrg
6923a3680546Smrg      freebsd2.*)
6924a3680546Smrg        # C++ shared libraries reported to be fairly broken before
6925a3680546Smrg	# switch to ELF
6926a3680546Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6927a3680546Smrg        ;;
6928a3680546Smrg
6929a3680546Smrg      freebsd-elf*)
6930a3680546Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6931a3680546Smrg        ;;
6932a3680546Smrg
6933a3680546Smrg      freebsd* | dragonfly* | midnightbsd*)
6934a3680546Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6935a3680546Smrg        # conventions
6936a3680546Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6937a3680546Smrg        ;;
6938a3680546Smrg
6939a3680546Smrg      haiku*)
6940a3680546Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6941a3680546Smrg        _LT_TAGVAR(link_all_deplibs, $1)=no
6942a3680546Smrg        ;;
6943a3680546Smrg
6944a3680546Smrg      hpux9*)
6945a3680546Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6946a3680546Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6947a3680546Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6948a3680546Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6949a3680546Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6950a3680546Smrg				             # but as the default
6951a3680546Smrg				             # location of the library.
6952a3680546Smrg
6953a3680546Smrg        case $cc_basename in
6954a3680546Smrg          CC*)
6955a3680546Smrg            # FIXME: insert proper C++ library support
6956a3680546Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
6957a3680546Smrg            ;;
6958a3680546Smrg          aCC*)
6959a3680546Smrg            _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'
6960a3680546Smrg            # Commands to make compiler produce verbose output that lists
6961a3680546Smrg            # what "hidden" libraries, object files and flags are used when
6962a3680546Smrg            # linking a shared library.
6963a3680546Smrg            #
6964a3680546Smrg            # There doesn't appear to be a way to prevent this compiler from
6965a3680546Smrg            # explicitly linking system object files so we need to strip them
6966a3680546Smrg            # from the output so that they don't get included in the library
6967a3680546Smrg            # dependencies.
6968a3680546Smrg            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"'
6969a3680546Smrg            ;;
6970a3680546Smrg          *)
6971a3680546Smrg            if test yes = "$GXX"; then
6972a3680546Smrg              _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'
6973a3680546Smrg            else
6974a3680546Smrg              # FIXME: insert proper C++ library support
6975a3680546Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
6976a3680546Smrg            fi
6977a3680546Smrg            ;;
6978a3680546Smrg        esac
6979a3680546Smrg        ;;
6980a3680546Smrg
6981a3680546Smrg      hpux10*|hpux11*)
6982a3680546Smrg        if test no = "$with_gnu_ld"; then
6983a3680546Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6984a3680546Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6985a3680546Smrg
6986a3680546Smrg          case $host_cpu in
6987a3680546Smrg            hppa*64*|ia64*)
6988a3680546Smrg              ;;
6989a3680546Smrg            *)
6990a3680546Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6991a3680546Smrg              ;;
6992a3680546Smrg          esac
6993a3680546Smrg        fi
6994a3680546Smrg        case $host_cpu in
6995a3680546Smrg          hppa*64*|ia64*)
6996a3680546Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
6997a3680546Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6998a3680546Smrg            ;;
6999a3680546Smrg          *)
7000a3680546Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
7001a3680546Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7002a3680546Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7003a3680546Smrg					         # but as the default
7004a3680546Smrg					         # location of the library.
7005a3680546Smrg            ;;
7006a3680546Smrg        esac
7007a3680546Smrg
7008a3680546Smrg        case $cc_basename in
7009a3680546Smrg          CC*)
7010a3680546Smrg	    # FIXME: insert proper C++ library support
7011a3680546Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7012a3680546Smrg	    ;;
7013a3680546Smrg          aCC*)
7014a3680546Smrg	    case $host_cpu in
7015a3680546Smrg	      hppa*64*)
7016a3680546Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7017a3680546Smrg	        ;;
7018a3680546Smrg	      ia64*)
7019a3680546Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7020a3680546Smrg	        ;;
7021a3680546Smrg	      *)
7022a3680546Smrg	        _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'
7023a3680546Smrg	        ;;
7024a3680546Smrg	    esac
7025a3680546Smrg	    # Commands to make compiler produce verbose output that lists
7026a3680546Smrg	    # what "hidden" libraries, object files and flags are used when
7027a3680546Smrg	    # linking a shared library.
7028a3680546Smrg	    #
7029a3680546Smrg	    # There doesn't appear to be a way to prevent this compiler from
7030a3680546Smrg	    # explicitly linking system object files so we need to strip them
7031a3680546Smrg	    # from the output so that they don't get included in the library
7032a3680546Smrg	    # dependencies.
7033a3680546Smrg	    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"'
7034a3680546Smrg	    ;;
7035a3680546Smrg          *)
7036a3680546Smrg	    if test yes = "$GXX"; then
7037a3680546Smrg	      if test no = "$with_gnu_ld"; then
7038a3680546Smrg	        case $host_cpu in
7039a3680546Smrg	          hppa*64*)
7040a3680546Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7041a3680546Smrg	            ;;
7042a3680546Smrg	          ia64*)
7043a3680546Smrg	            _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'
7044a3680546Smrg	            ;;
7045a3680546Smrg	          *)
7046a3680546Smrg	            _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'
7047a3680546Smrg	            ;;
7048a3680546Smrg	        esac
7049a3680546Smrg	      fi
7050a3680546Smrg	    else
7051a3680546Smrg	      # FIXME: insert proper C++ library support
7052a3680546Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
7053a3680546Smrg	    fi
7054a3680546Smrg	    ;;
7055a3680546Smrg        esac
7056a3680546Smrg        ;;
7057a3680546Smrg
7058a3680546Smrg      interix[[3-9]]*)
7059a3680546Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
7060a3680546Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7061a3680546Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7062a3680546Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
7063a3680546Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
7064a3680546Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
7065a3680546Smrg	# default) and relocated if they conflict, which is a slow very memory
7066a3680546Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
7067a3680546Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
7068a3680546Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
7069a3680546Smrg	_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'
7070a3680546Smrg	_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'
7071a3680546Smrg	;;
7072a3680546Smrg      irix5* | irix6*)
7073a3680546Smrg        case $cc_basename in
7074a3680546Smrg          CC*)
7075a3680546Smrg	    # SGI C++
7076a3680546Smrg	    _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'
7077a3680546Smrg
7078a3680546Smrg	    # Archives containing C++ object files must be created using
7079a3680546Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
7080a3680546Smrg	    # necessary to make sure instantiated templates are included
7081a3680546Smrg	    # in the archive.
7082a3680546Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
7083a3680546Smrg	    ;;
7084a3680546Smrg          *)
7085a3680546Smrg	    if test yes = "$GXX"; then
7086a3680546Smrg	      if test no = "$with_gnu_ld"; then
7087a3680546Smrg	        _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'
7088a3680546Smrg	      else
7089a3680546Smrg	        _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'
7090a3680546Smrg	      fi
7091a3680546Smrg	    fi
7092a3680546Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7093a3680546Smrg	    ;;
7094a3680546Smrg        esac
7095a3680546Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7096a3680546Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7097a3680546Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
7098a3680546Smrg        ;;
7099a3680546Smrg
7100a3680546Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
7101a3680546Smrg        case $cc_basename in
7102a3680546Smrg          KCC*)
7103a3680546Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7104a3680546Smrg
7105a3680546Smrg	    # KCC will only create a shared library if the output file
7106a3680546Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7107a3680546Smrg	    # to its proper name (with version) after linking.
7108a3680546Smrg	    _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'
7109a3680546Smrg	    _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'
7110a3680546Smrg	    # Commands to make compiler produce verbose output that lists
7111a3680546Smrg	    # what "hidden" libraries, object files and flags are used when
7112a3680546Smrg	    # linking a shared library.
7113a3680546Smrg	    #
7114a3680546Smrg	    # There doesn't appear to be a way to prevent this compiler from
7115a3680546Smrg	    # explicitly linking system object files so we need to strip them
7116a3680546Smrg	    # from the output so that they don't get included in the library
7117a3680546Smrg	    # dependencies.
7118a3680546Smrg	    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"'
7119a3680546Smrg
7120a3680546Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7121a3680546Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7122a3680546Smrg
7123a3680546Smrg	    # Archives containing C++ object files must be created using
7124a3680546Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
7125a3680546Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
7126a3680546Smrg	    ;;
7127a3680546Smrg	  icpc* | ecpc* )
7128a3680546Smrg	    # Intel C++
7129a3680546Smrg	    with_gnu_ld=yes
7130a3680546Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
7131a3680546Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
7132a3680546Smrg	    # earlier do not add the objects themselves.
7133a3680546Smrg	    case `$CC -V 2>&1` in
7134a3680546Smrg	      *"Version 7."*)
7135a3680546Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7136a3680546Smrg		_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'
7137a3680546Smrg		;;
7138a3680546Smrg	      *)  # Version 8.0 or newer
7139a3680546Smrg	        tmp_idyn=
7140a3680546Smrg	        case $host_cpu in
7141a3680546Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
7142a3680546Smrg		esac
7143a3680546Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7144a3680546Smrg		_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'
7145a3680546Smrg		;;
7146a3680546Smrg	    esac
7147a3680546Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7148a3680546Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7149a3680546Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7150a3680546Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
7151a3680546Smrg	    ;;
7152a3680546Smrg          pgCC* | pgcpp*)
7153a3680546Smrg            # Portland Group C++ compiler
7154a3680546Smrg	    case `$CC -V` in
7155a3680546Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
7156a3680546Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7157a3680546Smrg               rm -rf $tpldir~
7158a3680546Smrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7159a3680546Smrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7160a3680546Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7161a3680546Smrg                rm -rf $tpldir~
7162a3680546Smrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7163a3680546Smrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7164a3680546Smrg                $RANLIB $oldlib'
7165a3680546Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7166a3680546Smrg                rm -rf $tpldir~
7167a3680546Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7168a3680546Smrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7169a3680546Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7170a3680546Smrg                rm -rf $tpldir~
7171a3680546Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7172a3680546Smrg                $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'
7173a3680546Smrg	      ;;
7174a3680546Smrg	    *) # Version 6 and above use weak symbols
7175a3680546Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7176a3680546Smrg	      _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'
7177a3680546Smrg	      ;;
7178a3680546Smrg	    esac
7179a3680546Smrg
7180a3680546Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
7181a3680546Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7182a3680546Smrg	    _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'
7183a3680546Smrg            ;;
7184a3680546Smrg	  cxx*)
7185a3680546Smrg	    # Compaq C++
7186a3680546Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7187a3680546Smrg	    _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'
7188a3680546Smrg
7189a3680546Smrg	    runpath_var=LD_RUN_PATH
7190a3680546Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7191a3680546Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7192a3680546Smrg
7193a3680546Smrg	    # Commands to make compiler produce verbose output that lists
7194a3680546Smrg	    # what "hidden" libraries, object files and flags are used when
7195a3680546Smrg	    # linking a shared library.
7196a3680546Smrg	    #
7197a3680546Smrg	    # There doesn't appear to be a way to prevent this compiler from
7198a3680546Smrg	    # explicitly linking system object files so we need to strip them
7199a3680546Smrg	    # from the output so that they don't get included in the library
7200a3680546Smrg	    # dependencies.
7201a3680546Smrg	    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'
7202a3680546Smrg	    ;;
7203a3680546Smrg	  xl* | mpixl* | bgxl*)
7204a3680546Smrg	    # IBM XL 8.0 on PPC, with GNU ld
7205a3680546Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7206a3680546Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7207a3680546Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7208a3680546Smrg	    if test yes = "$supports_anon_versioning"; then
7209a3680546Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7210a3680546Smrg                cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7211a3680546Smrg                echo "local: *; };" >> $output_objdir/$libname.ver~
7212a3680546Smrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
7213a3680546Smrg	    fi
7214a3680546Smrg	    ;;
7215a3680546Smrg	  *)
7216a3680546Smrg	    case `$CC -V 2>&1 | $SED 5q` in
7217a3680546Smrg	    *Sun\ C*)
7218a3680546Smrg	      # Sun C++ 5.9
7219a3680546Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7220a3680546Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7221a3680546Smrg	      _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'
7222a3680546Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7223a3680546Smrg	      _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'
7224a3680546Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7225a3680546Smrg
7226a3680546Smrg	      # Not sure whether something based on
7227a3680546Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7228a3680546Smrg	      # would be better.
7229a3680546Smrg	      output_verbose_link_cmd='func_echo_all'
7230a3680546Smrg
7231a3680546Smrg	      # Archives containing C++ object files must be created using
7232a3680546Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7233a3680546Smrg	      # necessary to make sure instantiated templates are included
7234a3680546Smrg	      # in the archive.
7235a3680546Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7236a3680546Smrg	      ;;
7237a3680546Smrg	    esac
7238a3680546Smrg	    ;;
7239a3680546Smrg	esac
7240a3680546Smrg	;;
7241a3680546Smrg
7242a3680546Smrg      lynxos*)
7243a3680546Smrg        # FIXME: insert proper C++ library support
7244a3680546Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
7245a3680546Smrg	;;
7246a3680546Smrg
7247a3680546Smrg      m88k*)
7248a3680546Smrg        # FIXME: insert proper C++ library support
7249a3680546Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
7250a3680546Smrg	;;
7251a3680546Smrg
7252a3680546Smrg      mvs*)
7253a3680546Smrg        case $cc_basename in
7254a3680546Smrg          cxx*)
7255a3680546Smrg	    # FIXME: insert proper C++ library support
7256a3680546Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7257a3680546Smrg	    ;;
7258a3680546Smrg	  *)
7259a3680546Smrg	    # FIXME: insert proper C++ library support
7260a3680546Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7261a3680546Smrg	    ;;
7262a3680546Smrg	esac
7263a3680546Smrg	;;
7264a3680546Smrg
7265a3680546Smrg      *-mlibc)
7266a3680546Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
7267a3680546Smrg	;;
7268a3680546Smrg
7269a3680546Smrg      netbsd*)
7270a3680546Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7271a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7272a3680546Smrg	  wlarc=
7273a3680546Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7274a3680546Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7275a3680546Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7276a3680546Smrg	fi
7277a3680546Smrg	# Workaround some broken pre-1.5 toolchains
7278a3680546Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7279a3680546Smrg	;;
7280a3680546Smrg
7281a3680546Smrg      *nto* | *qnx*)
7282a3680546Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
7283a3680546Smrg	;;
7284a3680546Smrg
7285a3680546Smrg      openbsd*)
7286a3680546Smrg	if test -f /usr/libexec/ld.so; then
7287a3680546Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7288a3680546Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7289a3680546Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7290a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7291a3680546Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7292a3680546Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
7293a3680546Smrg	    _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'
7294a3680546Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
7295a3680546Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
7296a3680546Smrg	  fi
7297a3680546Smrg	  output_verbose_link_cmd=func_echo_all
7298a3680546Smrg	else
7299a3680546Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
7300a3680546Smrg	fi
7301a3680546Smrg	;;
7302a3680546Smrg
7303a3680546Smrg      osf3* | osf4* | osf5*)
7304a3680546Smrg        case $cc_basename in
7305a3680546Smrg          KCC*)
7306a3680546Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7307a3680546Smrg
7308a3680546Smrg	    # KCC will only create a shared library if the output file
7309a3680546Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7310a3680546Smrg	    # to its proper name (with version) after linking.
7311a3680546Smrg	    _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'
7312a3680546Smrg
7313a3680546Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7314a3680546Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7315a3680546Smrg
7316a3680546Smrg	    # Archives containing C++ object files must be created using
7317a3680546Smrg	    # the KAI C++ compiler.
7318a3680546Smrg	    case $host in
7319a3680546Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7320a3680546Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7321a3680546Smrg	    esac
7322a3680546Smrg	    ;;
7323a3680546Smrg          RCC*)
7324a3680546Smrg	    # Rational C++ 2.4.1
7325a3680546Smrg	    # FIXME: insert proper C++ library support
7326a3680546Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7327a3680546Smrg	    ;;
7328a3680546Smrg          cxx*)
7329a3680546Smrg	    case $host in
7330a3680546Smrg	      osf3*)
7331a3680546Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7332a3680546Smrg	        _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'
7333a3680546Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7334a3680546Smrg		;;
7335a3680546Smrg	      *)
7336a3680546Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7337a3680546Smrg	        _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'
7338a3680546Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7339a3680546Smrg                  echo "-hidden">> $lib.exp~
7340a3680546Smrg                  $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~
7341a3680546Smrg                  $RM $lib.exp'
7342a3680546Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7343a3680546Smrg		;;
7344a3680546Smrg	    esac
7345a3680546Smrg
7346a3680546Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7347a3680546Smrg
7348a3680546Smrg	    # Commands to make compiler produce verbose output that lists
7349a3680546Smrg	    # what "hidden" libraries, object files and flags are used when
7350a3680546Smrg	    # linking a shared library.
7351a3680546Smrg	    #
7352a3680546Smrg	    # There doesn't appear to be a way to prevent this compiler from
7353a3680546Smrg	    # explicitly linking system object files so we need to strip them
7354a3680546Smrg	    # from the output so that they don't get included in the library
7355a3680546Smrg	    # dependencies.
7356a3680546Smrg	    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"'
7357a3680546Smrg	    ;;
7358a3680546Smrg	  *)
7359a3680546Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
7360a3680546Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7361a3680546Smrg	      case $host in
7362a3680546Smrg	        osf3*)
7363a3680546Smrg	          _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'
7364a3680546Smrg		  ;;
7365a3680546Smrg	        *)
7366a3680546Smrg	          _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'
7367a3680546Smrg		  ;;
7368a3680546Smrg	      esac
7369a3680546Smrg
7370a3680546Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7371a3680546Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7372a3680546Smrg
7373a3680546Smrg	      # Commands to make compiler produce verbose output that lists
7374a3680546Smrg	      # what "hidden" libraries, object files and flags are used when
7375a3680546Smrg	      # linking a shared library.
7376a3680546Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"'
7377a3680546Smrg
7378a3680546Smrg	    else
7379a3680546Smrg	      # FIXME: insert proper C++ library support
7380a3680546Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
7381a3680546Smrg	    fi
7382a3680546Smrg	    ;;
7383a3680546Smrg        esac
7384a3680546Smrg        ;;
7385a3680546Smrg
7386a3680546Smrg      psos*)
7387a3680546Smrg        # FIXME: insert proper C++ library support
7388a3680546Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
7389a3680546Smrg        ;;
7390a3680546Smrg
7391a3680546Smrg      serenity*)
7392a3680546Smrg        ;;
7393a3680546Smrg
7394a3680546Smrg      sunos4*)
7395a3680546Smrg        case $cc_basename in
7396a3680546Smrg          CC*)
7397a3680546Smrg	    # Sun C++ 4.x
7398a3680546Smrg	    # FIXME: insert proper C++ library support
7399a3680546Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7400a3680546Smrg	    ;;
7401a3680546Smrg          lcc*)
7402a3680546Smrg	    # Lucid
7403a3680546Smrg	    # FIXME: insert proper C++ library support
7404a3680546Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7405a3680546Smrg	    ;;
7406a3680546Smrg          *)
7407a3680546Smrg	    # FIXME: insert proper C++ library support
7408a3680546Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7409a3680546Smrg	    ;;
7410a3680546Smrg        esac
7411a3680546Smrg        ;;
7412a3680546Smrg
7413a3680546Smrg      solaris*)
7414a3680546Smrg        case $cc_basename in
7415a3680546Smrg          CC* | sunCC*)
7416a3680546Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
7417a3680546Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7418a3680546Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7419a3680546Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7420a3680546Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7421a3680546Smrg              $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'
7422a3680546Smrg
7423a3680546Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7424a3680546Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7425a3680546Smrg	    case $host_os in
7426a3680546Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7427a3680546Smrg	      *)
7428a3680546Smrg		# The compiler driver will combine and reorder linker options,
7429a3680546Smrg		# but understands '-z linker_flag'.
7430a3680546Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7431a3680546Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7432a3680546Smrg	        ;;
7433a3680546Smrg	    esac
7434a3680546Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7435a3680546Smrg
7436a3680546Smrg	    output_verbose_link_cmd='func_echo_all'
7437a3680546Smrg
7438a3680546Smrg	    # Archives containing C++ object files must be created using
7439a3680546Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7440a3680546Smrg	    # necessary to make sure instantiated templates are included
7441a3680546Smrg	    # in the archive.
7442a3680546Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7443a3680546Smrg	    ;;
7444a3680546Smrg          gcx*)
7445a3680546Smrg	    # Green Hills C++ Compiler
7446a3680546Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7447a3680546Smrg
7448a3680546Smrg	    # The C++ compiler must be used to create the archive.
7449a3680546Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7450a3680546Smrg	    ;;
7451a3680546Smrg          *)
7452a3680546Smrg	    # GNU C++ compiler with Solaris linker
7453a3680546Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
7454a3680546Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
7455a3680546Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7456a3680546Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7457a3680546Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7458a3680546Smrg                  $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'
7459a3680546Smrg
7460a3680546Smrg	        # Commands to make compiler produce verbose output that lists
7461a3680546Smrg	        # what "hidden" libraries, object files and flags are used when
7462a3680546Smrg	        # linking a shared library.
7463a3680546Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"'
7464a3680546Smrg	      else
7465a3680546Smrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
7466a3680546Smrg	        # platform.
7467a3680546Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7468a3680546Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7469a3680546Smrg                  $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'
7470a3680546Smrg
7471a3680546Smrg	        # Commands to make compiler produce verbose output that lists
7472a3680546Smrg	        # what "hidden" libraries, object files and flags are used when
7473a3680546Smrg	        # linking a shared library.
7474a3680546Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"'
7475a3680546Smrg	      fi
7476a3680546Smrg
7477a3680546Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
7478a3680546Smrg	      case $host_os in
7479a3680546Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7480a3680546Smrg		*)
7481a3680546Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
7482a3680546Smrg		  ;;
7483a3680546Smrg	      esac
7484a3680546Smrg	    fi
7485a3680546Smrg	    ;;
7486a3680546Smrg        esac
7487a3680546Smrg        ;;
7488a3680546Smrg
7489a3680546Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7490a3680546Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7491a3680546Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7492a3680546Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7493a3680546Smrg      runpath_var='LD_RUN_PATH'
7494a3680546Smrg
7495a3680546Smrg      case $cc_basename in
7496a3680546Smrg        CC*)
7497a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7498a3680546Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7499a3680546Smrg	  ;;
7500a3680546Smrg	*)
7501a3680546Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7502a3680546Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7503a3680546Smrg	  ;;
7504a3680546Smrg      esac
7505a3680546Smrg      ;;
7506a3680546Smrg
7507a3680546Smrg      sysv5* | sco3.2v5* | sco5v6*)
7508a3680546Smrg	# Note: We CANNOT use -z defs as we might desire, because we do not
7509a3680546Smrg	# link with -lc, and that would cause any symbols used from libc to
7510a3680546Smrg	# always be unresolved, which means just about no library would
7511a3680546Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
7512a3680546Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
7513a3680546Smrg	# as -z defs.
7514a3680546Smrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7515a3680546Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
7516a3680546Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7517a3680546Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7518a3680546Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
7519a3680546Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7520a3680546Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
7521a3680546Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
7522a3680546Smrg	runpath_var='LD_RUN_PATH'
7523a3680546Smrg
7524a3680546Smrg	case $cc_basename in
7525a3680546Smrg          CC*)
7526a3680546Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7527a3680546Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7528a3680546Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7529a3680546Smrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
7530a3680546Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7531a3680546Smrg              '"$_LT_TAGVAR(reload_cmds, $1)"
7532a3680546Smrg	    ;;
7533a3680546Smrg	  *)
7534a3680546Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7535a3680546Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7536a3680546Smrg	    ;;
7537a3680546Smrg	esac
7538a3680546Smrg      ;;
7539a3680546Smrg
7540a3680546Smrg      tandem*)
7541a3680546Smrg        case $cc_basename in
7542a3680546Smrg          NCC*)
7543a3680546Smrg	    # NonStop-UX NCC 3.20
7544a3680546Smrg	    # FIXME: insert proper C++ library support
7545a3680546Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7546a3680546Smrg	    ;;
7547a3680546Smrg          *)
7548a3680546Smrg	    # FIXME: insert proper C++ library support
7549a3680546Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7550a3680546Smrg	    ;;
7551a3680546Smrg        esac
7552a3680546Smrg        ;;
7553a3680546Smrg
7554a3680546Smrg      vxworks*)
7555a3680546Smrg        # FIXME: insert proper C++ library support
7556a3680546Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
7557a3680546Smrg        ;;
7558a3680546Smrg
7559a3680546Smrg      *)
7560a3680546Smrg        # FIXME: insert proper C++ library support
7561a3680546Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
7562a3680546Smrg        ;;
7563a3680546Smrg    esac
7564a3680546Smrg
7565a3680546Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7566a3680546Smrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
7567a3680546Smrg
7568a3680546Smrg    _LT_TAGVAR(GCC, $1)=$GXX
7569a3680546Smrg    _LT_TAGVAR(LD, $1)=$LD
7570a3680546Smrg
7571a3680546Smrg    ## CAVEAT EMPTOR:
7572a3680546Smrg    ## There is no encapsulation within the following macros, do not change
7573a3680546Smrg    ## the running order or otherwise move them around unless you know exactly
7574a3680546Smrg    ## what you are doing...
7575a3680546Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7576a3680546Smrg    _LT_COMPILER_PIC($1)
7577a3680546Smrg    _LT_COMPILER_C_O($1)
7578a3680546Smrg    _LT_COMPILER_FILE_LOCKS($1)
7579a3680546Smrg    _LT_LINKER_SHLIBS($1)
7580a3680546Smrg    _LT_SYS_DYNAMIC_LINKER($1)
7581a3680546Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7582a3680546Smrg
7583a3680546Smrg    _LT_CONFIG($1)
7584a3680546Smrg  fi # test -n "$compiler"
7585a3680546Smrg
7586a3680546Smrg  CC=$lt_save_CC
7587a3680546Smrg  CFLAGS=$lt_save_CFLAGS
7588a3680546Smrg  LDCXX=$LD
7589a3680546Smrg  LD=$lt_save_LD
7590a3680546Smrg  GCC=$lt_save_GCC
7591a3680546Smrg  with_gnu_ld=$lt_save_with_gnu_ld
7592a3680546Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
7593a3680546Smrg  lt_cv_path_LD=$lt_save_path_LD
7594a3680546Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7595a3680546Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7596a3680546Smrgfi # test yes != "$_lt_caught_CXX_error"
7597a3680546Smrg
7598a3680546SmrgAC_LANG_POP
7599a3680546Smrg])# _LT_LANG_CXX_CONFIG
7600a3680546Smrg
7601a3680546Smrg
7602a3680546Smrg# _LT_FUNC_STRIPNAME_CNF
7603a3680546Smrg# ----------------------
7604a3680546Smrg# func_stripname_cnf prefix suffix name
7605a3680546Smrg# strip PREFIX and SUFFIX off of NAME.
7606a3680546Smrg# PREFIX and SUFFIX must not contain globbing or regex special
7607a3680546Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7608a3680546Smrg# dot (in which case that matches only a dot).
7609a3680546Smrg#
7610a3680546Smrg# This function is identical to the (non-XSI) version of func_stripname,
7611a3680546Smrg# except this one can be used by m4 code that may be executed by configure,
7612a3680546Smrg# rather than the libtool script.
7613a3680546Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7614a3680546SmrgAC_REQUIRE([_LT_DECL_SED])
7615a3680546SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7616a3680546Smrgfunc_stripname_cnf ()
7617a3680546Smrg{
7618a3680546Smrg  case @S|@2 in
7619a3680546Smrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
7620a3680546Smrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
7621a3680546Smrg  esac
7622a3680546Smrg} # func_stripname_cnf
7623a3680546Smrg])# _LT_FUNC_STRIPNAME_CNF
7624a3680546Smrg
7625a3680546Smrg
7626a3680546Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7627a3680546Smrg# ---------------------------------
7628a3680546Smrg# Figure out "hidden" library dependencies from verbose
7629a3680546Smrg# compiler output when linking a shared library.
7630a3680546Smrg# Parse the compiler output and extract the necessary
7631a3680546Smrg# objects, libraries and library flags.
7632a3680546Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7633a3680546Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7634a3680546SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7635a3680546Smrg# Dependencies to place before and after the object being linked:
7636a3680546Smrg_LT_TAGVAR(predep_objects, $1)=
7637a3680546Smrg_LT_TAGVAR(postdep_objects, $1)=
7638a3680546Smrg_LT_TAGVAR(predeps, $1)=
7639a3680546Smrg_LT_TAGVAR(postdeps, $1)=
7640a3680546Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
7641a3680546Smrg
7642a3680546Smrgdnl we can't use the lt_simple_compile_test_code here,
7643a3680546Smrgdnl because it contains code intended for an executable,
7644a3680546Smrgdnl not a library.  It's possible we should let each
7645a3680546Smrgdnl tag define a new lt_????_link_test_code variable,
7646a3680546Smrgdnl but it's only used here...
7647a3680546Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7648a3680546Smrgint a;
7649a3680546Smrgvoid foo (void) { a = 0; }
7650a3680546Smrg_LT_EOF
7651a3680546Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7652a3680546Smrgclass Foo
7653a3680546Smrg{
7654a3680546Smrgpublic:
7655a3680546Smrg  Foo (void) { a = 0; }
7656a3680546Smrgprivate:
7657a3680546Smrg  int a;
7658a3680546Smrg};
7659a3680546Smrg_LT_EOF
7660a3680546Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7661a3680546Smrg      subroutine foo
7662a3680546Smrg      implicit none
7663a3680546Smrg      integer*4 a
7664a3680546Smrg      a=0
7665a3680546Smrg      return
7666a3680546Smrg      end
7667a3680546Smrg_LT_EOF
7668a3680546Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7669a3680546Smrg      subroutine foo
7670a3680546Smrg      implicit none
7671a3680546Smrg      integer a
7672a3680546Smrg      a=0
7673a3680546Smrg      return
7674a3680546Smrg      end
7675a3680546Smrg_LT_EOF
7676a3680546Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7677a3680546Smrgpublic class foo {
7678a3680546Smrg  private int a;
7679a3680546Smrg  public void bar (void) {
7680a3680546Smrg    a = 0;
7681a3680546Smrg  }
7682a3680546Smrg};
7683a3680546Smrg_LT_EOF
7684a3680546Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7685a3680546Smrgpackage foo
7686a3680546Smrgfunc foo() {
7687a3680546Smrg}
7688a3680546Smrg_LT_EOF
7689a3680546Smrg])
7690a3680546Smrg
7691a3680546Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
7692a3680546Smrgcase "$CC $CFLAGS " in #(
7693a3680546Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
7694a3680546Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7695a3680546Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
7696a3680546Smrgesac
7697a3680546Smrg
7698a3680546Smrgdnl Parse the compiler output and extract the necessary
7699a3680546Smrgdnl objects, libraries and library flags.
7700a3680546Smrgif AC_TRY_EVAL(ac_compile); then
7701a3680546Smrg  # Parse the compiler output and extract the necessary
7702a3680546Smrg  # objects, libraries and library flags.
7703a3680546Smrg
7704a3680546Smrg  # Sentinel used to keep track of whether or not we are before
7705a3680546Smrg  # the conftest object file.
7706a3680546Smrg  pre_test_object_deps_done=no
7707a3680546Smrg
7708a3680546Smrg  for p in `eval "$output_verbose_link_cmd"`; do
7709a3680546Smrg    case $prev$p in
7710a3680546Smrg
7711a3680546Smrg    -L* | -R* | -l*)
7712a3680546Smrg       # Some compilers place space between "-{L,R,l}" and the path.
7713a3680546Smrg       # Remove the space.
7714a3680546Smrg       if test x-L = x"$p" ||
7715a3680546Smrg          test x-R = x"$p" ||
7716a3680546Smrg          test x-l = x"$p"; then
7717a3680546Smrg	 prev=$p
7718a3680546Smrg	 continue
7719a3680546Smrg       fi
7720a3680546Smrg
7721a3680546Smrg       # Expand the sysroot to ease extracting the directories later.
7722a3680546Smrg       if test -z "$prev"; then
7723a3680546Smrg         case $p in
7724a3680546Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7725a3680546Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7726a3680546Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7727a3680546Smrg         esac
7728a3680546Smrg       fi
7729a3680546Smrg       case $p in
7730a3680546Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7731a3680546Smrg       esac
7732a3680546Smrg       if test no = "$pre_test_object_deps_done"; then
7733a3680546Smrg	 case $prev in
7734a3680546Smrg	 -L | -R)
7735a3680546Smrg	   # Internal compiler library paths should come after those
7736a3680546Smrg	   # provided the user.  The postdeps already come after the
7737a3680546Smrg	   # user supplied libs so there is no need to process them.
7738a3680546Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7739a3680546Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
7740a3680546Smrg	   else
7741a3680546Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
7742a3680546Smrg	   fi
7743a3680546Smrg	   ;;
7744a3680546Smrg	 # The "-l" case would never come before the object being
7745a3680546Smrg	 # linked, so don't bother handling this case.
7746a3680546Smrg	 esac
7747a3680546Smrg       else
7748a3680546Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7749a3680546Smrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
7750a3680546Smrg	 else
7751a3680546Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
7752a3680546Smrg	 fi
7753a3680546Smrg       fi
7754a3680546Smrg       prev=
7755a3680546Smrg       ;;
7756a3680546Smrg
7757a3680546Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
7758a3680546Smrg    *.$objext)
7759a3680546Smrg       # This assumes that the test object file only shows up
7760a3680546Smrg       # once in the compiler output.
7761a3680546Smrg       if test "$p" = "conftest.$objext"; then
7762a3680546Smrg	 pre_test_object_deps_done=yes
7763a3680546Smrg	 continue
7764a3680546Smrg       fi
7765a3680546Smrg
7766a3680546Smrg       if test no = "$pre_test_object_deps_done"; then
7767a3680546Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7768a3680546Smrg	   _LT_TAGVAR(predep_objects, $1)=$p
7769a3680546Smrg	 else
7770a3680546Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7771a3680546Smrg	 fi
7772a3680546Smrg       else
7773a3680546Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7774a3680546Smrg	   _LT_TAGVAR(postdep_objects, $1)=$p
7775a3680546Smrg	 else
7776a3680546Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7777a3680546Smrg	 fi
7778a3680546Smrg       fi
7779a3680546Smrg       ;;
7780a3680546Smrg
7781a3680546Smrg    *) ;; # Ignore the rest.
7782a3680546Smrg
7783a3680546Smrg    esac
7784a3680546Smrg  done
7785a3680546Smrg
7786a3680546Smrg  # Clean up.
7787a3680546Smrg  rm -f a.out a.exe
7788a3680546Smrgelse
7789a3680546Smrg  echo "libtool.m4: error: problem compiling $1 test program"
7790a3680546Smrgfi
7791a3680546Smrg
7792a3680546Smrg$RM -f confest.$objext
7793a3680546SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
7794a3680546Smrg
7795a3680546Smrg# PORTME: override above test on systems where it is broken
7796a3680546Smrgm4_if([$1], [CXX],
7797a3680546Smrg[case $host_os in
7798a3680546Smrginterix[[3-9]]*)
7799a3680546Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7800a3680546Smrg  # hack all around it, let's just trust "g++" to DTRT.
7801a3680546Smrg  _LT_TAGVAR(predep_objects,$1)=
7802a3680546Smrg  _LT_TAGVAR(postdep_objects,$1)=
7803a3680546Smrg  _LT_TAGVAR(postdeps,$1)=
7804a3680546Smrg  ;;
7805a3680546Smrgesac
7806a3680546Smrg])
7807a3680546Smrg
7808a3680546Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
7809a3680546Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7810a3680546Smrgesac
7811a3680546Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7812a3680546Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7813a3680546Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
7814a3680546Smrgfi
7815a3680546Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7816a3680546Smrg    [The directories searched by this compiler when creating a shared library])
7817a3680546Smrg_LT_TAGDECL([], [predep_objects], [1],
7818a3680546Smrg    [Dependencies to place before and after the objects being linked to
7819a3680546Smrg    create a shared library])
7820a3680546Smrg_LT_TAGDECL([], [postdep_objects], [1])
7821a3680546Smrg_LT_TAGDECL([], [predeps], [1])
7822a3680546Smrg_LT_TAGDECL([], [postdeps], [1])
7823a3680546Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
7824a3680546Smrg    [The library search path used internally by the compiler when linking
7825a3680546Smrg    a shared library])
7826a3680546Smrg])# _LT_SYS_HIDDEN_LIBDEPS
7827a3680546Smrg
7828a3680546Smrg
7829a3680546Smrg# _LT_LANG_F77_CONFIG([TAG])
7830a3680546Smrg# --------------------------
7831a3680546Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
7832a3680546Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7833a3680546Smrg# to write the compiler configuration to 'libtool'.
7834a3680546Smrgm4_defun([_LT_LANG_F77_CONFIG],
7835a3680546Smrg[AC_LANG_PUSH(Fortran 77)
7836a3680546Smrgif test -z "$F77" || test no = "$F77"; then
7837a3680546Smrg  _lt_disable_F77=yes
7838a3680546Smrgfi
7839a3680546Smrg
7840a3680546Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7841a3680546Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
7842a3680546Smrg_LT_TAGVAR(always_export_symbols, $1)=no
7843a3680546Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7844a3680546Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7845a3680546Smrg_LT_TAGVAR(hardcode_direct, $1)=no
7846a3680546Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7847a3680546Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7848a3680546Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7849a3680546Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7850a3680546Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
7851a3680546Smrg_LT_TAGVAR(inherit_rpath, $1)=no
7852a3680546Smrg_LT_TAGVAR(module_cmds, $1)=
7853a3680546Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
7854a3680546Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7855a3680546Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7856a3680546Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7857a3680546Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7858a3680546Smrg_LT_TAGVAR(no_undefined_flag, $1)=
7859a3680546Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7860a3680546Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7861a3680546Smrg
7862a3680546Smrg# Source file extension for f77 test sources.
7863a3680546Smrgac_ext=f
7864a3680546Smrg
7865a3680546Smrg# Object file extension for compiled f77 test sources.
7866a3680546Smrgobjext=o
7867a3680546Smrg_LT_TAGVAR(objext, $1)=$objext
7868a3680546Smrg
7869a3680546Smrg# No sense in running all these tests if we already determined that
7870a3680546Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
7871a3680546Smrg# are currently assumed to apply to all compilers on this platform,
7872a3680546Smrg# and will be corrupted by setting them based on a non-working compiler.
7873a3680546Smrgif test yes != "$_lt_disable_F77"; then
7874a3680546Smrg  # Code to be used in simple compile tests
7875a3680546Smrg  lt_simple_compile_test_code="\
7876a3680546Smrg      subroutine t
7877a3680546Smrg      return
7878a3680546Smrg      end
7879a3680546Smrg"
7880a3680546Smrg
7881a3680546Smrg  # Code to be used in simple link tests
7882a3680546Smrg  lt_simple_link_test_code="\
7883a3680546Smrg      program t
7884a3680546Smrg      end
7885a3680546Smrg"
7886a3680546Smrg
7887a3680546Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7888a3680546Smrg  _LT_TAG_COMPILER
7889a3680546Smrg
7890a3680546Smrg  # save warnings/boilerplate of simple test code
7891a3680546Smrg  _LT_COMPILER_BOILERPLATE
7892a3680546Smrg  _LT_LINKER_BOILERPLATE
7893a3680546Smrg
7894a3680546Smrg  # Allow CC to be a program name with arguments.
7895a3680546Smrg  lt_save_CC=$CC
7896a3680546Smrg  lt_save_GCC=$GCC
7897a3680546Smrg  lt_save_CFLAGS=$CFLAGS
7898a3680546Smrg  CC=${F77-"f77"}
7899a3680546Smrg  CFLAGS=$FFLAGS
7900a3680546Smrg  compiler=$CC
7901a3680546Smrg  _LT_TAGVAR(compiler, $1)=$CC
7902a3680546Smrg  _LT_CC_BASENAME([$compiler])
7903a3680546Smrg  GCC=$G77
7904a3680546Smrg  if test -n "$compiler"; then
7905a3680546Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7906a3680546Smrg    AC_MSG_RESULT([$can_build_shared])
7907a3680546Smrg
7908a3680546Smrg    AC_MSG_CHECKING([whether to build shared libraries])
7909a3680546Smrg    test no = "$can_build_shared" && enable_shared=no
7910a3680546Smrg
7911a3680546Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
7912a3680546Smrg    # are all built from PIC.
7913a3680546Smrg    case $host_os in
7914a3680546Smrg      aix3*)
7915a3680546Smrg        test yes = "$enable_shared" && enable_static=no
7916a3680546Smrg        if test -n "$RANLIB"; then
7917a3680546Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7918a3680546Smrg          postinstall_cmds='$RANLIB $lib'
7919a3680546Smrg        fi
7920a3680546Smrg        ;;
7921a3680546Smrg      aix[[4-9]]*)
7922a3680546Smrg	if test ia64 != "$host_cpu"; then
7923a3680546Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7924a3680546Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
7925a3680546Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7926a3680546Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7927a3680546Smrg	  esac
7928a3680546Smrg	fi
7929a3680546Smrg        ;;
7930a3680546Smrg    esac
7931a3680546Smrg    AC_MSG_RESULT([$enable_shared])
7932a3680546Smrg
7933a3680546Smrg    AC_MSG_CHECKING([whether to build static libraries])
7934a3680546Smrg    # Make sure either enable_shared or enable_static is yes.
7935a3680546Smrg    test yes = "$enable_shared" || enable_static=yes
7936a3680546Smrg    AC_MSG_RESULT([$enable_static])
7937a3680546Smrg
7938a3680546Smrg    _LT_TAGVAR(GCC, $1)=$G77
7939a3680546Smrg    _LT_TAGVAR(LD, $1)=$LD
7940a3680546Smrg
7941a3680546Smrg    ## CAVEAT EMPTOR:
7942a3680546Smrg    ## There is no encapsulation within the following macros, do not change
7943a3680546Smrg    ## the running order or otherwise move them around unless you know exactly
7944a3680546Smrg    ## what you are doing...
7945a3680546Smrg    _LT_COMPILER_PIC($1)
7946a3680546Smrg    _LT_COMPILER_C_O($1)
7947a3680546Smrg    _LT_COMPILER_FILE_LOCKS($1)
7948a3680546Smrg    _LT_LINKER_SHLIBS($1)
7949a3680546Smrg    _LT_SYS_DYNAMIC_LINKER($1)
7950a3680546Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7951a3680546Smrg
7952a3680546Smrg    _LT_CONFIG($1)
7953a3680546Smrg  fi # test -n "$compiler"
7954a3680546Smrg
7955a3680546Smrg  GCC=$lt_save_GCC
7956a3680546Smrg  CC=$lt_save_CC
7957a3680546Smrg  CFLAGS=$lt_save_CFLAGS
7958a3680546Smrgfi # test yes != "$_lt_disable_F77"
7959a3680546Smrg
7960a3680546SmrgAC_LANG_POP
7961a3680546Smrg])# _LT_LANG_F77_CONFIG
7962a3680546Smrg
7963a3680546Smrg
7964a3680546Smrg# _LT_LANG_FC_CONFIG([TAG])
7965a3680546Smrg# -------------------------
7966a3680546Smrg# Ensure that the configuration variables for a Fortran compiler are
7967a3680546Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7968a3680546Smrg# to write the compiler configuration to 'libtool'.
7969a3680546Smrgm4_defun([_LT_LANG_FC_CONFIG],
7970a3680546Smrg[AC_LANG_PUSH(Fortran)
7971a3680546Smrg
7972a3680546Smrgif test -z "$FC" || test no = "$FC"; then
7973a3680546Smrg  _lt_disable_FC=yes
7974a3680546Smrgfi
7975a3680546Smrg
7976a3680546Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7977a3680546Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
7978a3680546Smrg_LT_TAGVAR(always_export_symbols, $1)=no
7979a3680546Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7980a3680546Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7981a3680546Smrg_LT_TAGVAR(hardcode_direct, $1)=no
7982a3680546Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7983a3680546Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7984a3680546Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7985a3680546Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7986a3680546Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
7987a3680546Smrg_LT_TAGVAR(inherit_rpath, $1)=no
7988a3680546Smrg_LT_TAGVAR(module_cmds, $1)=
7989a3680546Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
7990a3680546Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7991a3680546Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7992a3680546Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7993a3680546Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7994a3680546Smrg_LT_TAGVAR(no_undefined_flag, $1)=
7995a3680546Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7996a3680546Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7997a3680546Smrg
7998a3680546Smrg# Source file extension for fc test sources.
7999a3680546Smrgac_ext=${ac_fc_srcext-f}
8000a3680546Smrg
8001a3680546Smrg# Object file extension for compiled fc test sources.
8002a3680546Smrgobjext=o
8003a3680546Smrg_LT_TAGVAR(objext, $1)=$objext
8004a3680546Smrg
8005a3680546Smrg# No sense in running all these tests if we already determined that
8006a3680546Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
8007a3680546Smrg# are currently assumed to apply to all compilers on this platform,
8008a3680546Smrg# and will be corrupted by setting them based on a non-working compiler.
8009a3680546Smrgif test yes != "$_lt_disable_FC"; then
8010a3680546Smrg  # Code to be used in simple compile tests
8011a3680546Smrg  lt_simple_compile_test_code="\
8012a3680546Smrg      subroutine t
8013a3680546Smrg      return
8014a3680546Smrg      end
8015a3680546Smrg"
8016a3680546Smrg
8017a3680546Smrg  # Code to be used in simple link tests
8018a3680546Smrg  lt_simple_link_test_code="\
8019a3680546Smrg      program t
8020a3680546Smrg      end
8021a3680546Smrg"
8022a3680546Smrg
8023a3680546Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8024a3680546Smrg  _LT_TAG_COMPILER
8025a3680546Smrg
8026a3680546Smrg  # save warnings/boilerplate of simple test code
8027a3680546Smrg  _LT_COMPILER_BOILERPLATE
8028a3680546Smrg  _LT_LINKER_BOILERPLATE
8029a3680546Smrg
8030a3680546Smrg  # Allow CC to be a program name with arguments.
8031a3680546Smrg  lt_save_CC=$CC
8032a3680546Smrg  lt_save_GCC=$GCC
8033a3680546Smrg  lt_save_CFLAGS=$CFLAGS
8034a3680546Smrg  CC=${FC-"f95"}
8035a3680546Smrg  CFLAGS=$FCFLAGS
8036a3680546Smrg  compiler=$CC
8037a3680546Smrg  GCC=$ac_cv_fc_compiler_gnu
8038a3680546Smrg
8039a3680546Smrg  _LT_TAGVAR(compiler, $1)=$CC
8040a3680546Smrg  _LT_CC_BASENAME([$compiler])
8041a3680546Smrg
8042a3680546Smrg  if test -n "$compiler"; then
8043a3680546Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
8044a3680546Smrg    AC_MSG_RESULT([$can_build_shared])
8045a3680546Smrg
8046a3680546Smrg    AC_MSG_CHECKING([whether to build shared libraries])
8047a3680546Smrg    test no = "$can_build_shared" && enable_shared=no
8048a3680546Smrg
8049a3680546Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
8050a3680546Smrg    # are all built from PIC.
8051a3680546Smrg    case $host_os in
8052a3680546Smrg      aix3*)
8053a3680546Smrg        test yes = "$enable_shared" && enable_static=no
8054a3680546Smrg        if test -n "$RANLIB"; then
8055a3680546Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8056a3680546Smrg          postinstall_cmds='$RANLIB $lib'
8057a3680546Smrg        fi
8058a3680546Smrg        ;;
8059a3680546Smrg      aix[[4-9]]*)
8060a3680546Smrg	if test ia64 != "$host_cpu"; then
8061a3680546Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
8062a3680546Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
8063a3680546Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
8064a3680546Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
8065a3680546Smrg	  esac
8066a3680546Smrg	fi
8067a3680546Smrg        ;;
8068a3680546Smrg    esac
8069a3680546Smrg    AC_MSG_RESULT([$enable_shared])
8070a3680546Smrg
8071a3680546Smrg    AC_MSG_CHECKING([whether to build static libraries])
8072a3680546Smrg    # Make sure either enable_shared or enable_static is yes.
8073a3680546Smrg    test yes = "$enable_shared" || enable_static=yes
8074a3680546Smrg    AC_MSG_RESULT([$enable_static])
8075a3680546Smrg
8076a3680546Smrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
8077a3680546Smrg    _LT_TAGVAR(LD, $1)=$LD
8078a3680546Smrg
8079a3680546Smrg    ## CAVEAT EMPTOR:
8080a3680546Smrg    ## There is no encapsulation within the following macros, do not change
8081a3680546Smrg    ## the running order or otherwise move them around unless you know exactly
8082a3680546Smrg    ## what you are doing...
8083a3680546Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
8084a3680546Smrg    _LT_COMPILER_PIC($1)
8085a3680546Smrg    _LT_COMPILER_C_O($1)
8086a3680546Smrg    _LT_COMPILER_FILE_LOCKS($1)
8087a3680546Smrg    _LT_LINKER_SHLIBS($1)
8088a3680546Smrg    _LT_SYS_DYNAMIC_LINKER($1)
8089a3680546Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
8090a3680546Smrg
8091a3680546Smrg    _LT_CONFIG($1)
8092a3680546Smrg  fi # test -n "$compiler"
8093a3680546Smrg
8094a3680546Smrg  GCC=$lt_save_GCC
8095a3680546Smrg  CC=$lt_save_CC
8096a3680546Smrg  CFLAGS=$lt_save_CFLAGS
8097a3680546Smrgfi # test yes != "$_lt_disable_FC"
8098a3680546Smrg
8099a3680546SmrgAC_LANG_POP
8100a3680546Smrg])# _LT_LANG_FC_CONFIG
8101a3680546Smrg
8102a3680546Smrg
8103a3680546Smrg# _LT_LANG_GCJ_CONFIG([TAG])
8104a3680546Smrg# --------------------------
8105a3680546Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
8106a3680546Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8107a3680546Smrg# to write the compiler configuration to 'libtool'.
8108a3680546Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
8109a3680546Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
8110a3680546SmrgAC_LANG_SAVE
8111a3680546Smrg
8112a3680546Smrg# Source file extension for Java test sources.
8113a3680546Smrgac_ext=java
8114a3680546Smrg
8115a3680546Smrg# Object file extension for compiled Java test sources.
8116a3680546Smrgobjext=o
8117a3680546Smrg_LT_TAGVAR(objext, $1)=$objext
8118a3680546Smrg
8119a3680546Smrg# Code to be used in simple compile tests
8120a3680546Smrglt_simple_compile_test_code="class foo {}"
8121a3680546Smrg
8122a3680546Smrg# Code to be used in simple link tests
8123a3680546Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
8124a3680546Smrg
8125a3680546Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8126a3680546Smrg_LT_TAG_COMPILER
8127a3680546Smrg
8128a3680546Smrg# save warnings/boilerplate of simple test code
8129a3680546Smrg_LT_COMPILER_BOILERPLATE
8130a3680546Smrg_LT_LINKER_BOILERPLATE
8131a3680546Smrg
8132a3680546Smrg# Allow CC to be a program name with arguments.
8133a3680546Smrglt_save_CC=$CC
8134a3680546Smrglt_save_CFLAGS=$CFLAGS
8135a3680546Smrglt_save_GCC=$GCC
8136a3680546SmrgGCC=yes
8137a3680546SmrgCC=${GCJ-"gcj"}
8138a3680546SmrgCFLAGS=$GCJFLAGS
8139a3680546Smrgcompiler=$CC
8140a3680546Smrg_LT_TAGVAR(compiler, $1)=$CC
8141a3680546Smrg_LT_TAGVAR(LD, $1)=$LD
8142a3680546Smrg_LT_CC_BASENAME([$compiler])
8143a3680546Smrg
8144a3680546Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
8145a3680546Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8146a3680546Smrg
8147a3680546Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8148a3680546Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8149a3680546Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8150a3680546Smrg
8151a3680546Smrg## CAVEAT EMPTOR:
8152a3680546Smrg## There is no encapsulation within the following macros, do not change
8153a3680546Smrg## the running order or otherwise move them around unless you know exactly
8154a3680546Smrg## what you are doing...
8155a3680546Smrgif test -n "$compiler"; then
8156a3680546Smrg  _LT_COMPILER_NO_RTTI($1)
8157a3680546Smrg  _LT_COMPILER_PIC($1)
8158a3680546Smrg  _LT_COMPILER_C_O($1)
8159a3680546Smrg  _LT_COMPILER_FILE_LOCKS($1)
8160a3680546Smrg  _LT_LINKER_SHLIBS($1)
8161a3680546Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8162a3680546Smrg
8163a3680546Smrg  _LT_CONFIG($1)
8164a3680546Smrgfi
8165a3680546Smrg
8166a3680546SmrgAC_LANG_RESTORE
8167a3680546Smrg
8168a3680546SmrgGCC=$lt_save_GCC
8169a3680546SmrgCC=$lt_save_CC
8170a3680546SmrgCFLAGS=$lt_save_CFLAGS
8171a3680546Smrg])# _LT_LANG_GCJ_CONFIG
8172a3680546Smrg
8173a3680546Smrg
8174a3680546Smrg# _LT_LANG_GO_CONFIG([TAG])
8175a3680546Smrg# --------------------------
8176a3680546Smrg# Ensure that the configuration variables for the GNU Go compiler
8177a3680546Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8178a3680546Smrg# to write the compiler configuration to 'libtool'.
8179a3680546Smrgm4_defun([_LT_LANG_GO_CONFIG],
8180a3680546Smrg[AC_REQUIRE([LT_PROG_GO])dnl
8181a3680546SmrgAC_LANG_SAVE
8182a3680546Smrg
8183a3680546Smrg# Source file extension for Go test sources.
8184a3680546Smrgac_ext=go
8185a3680546Smrg
8186a3680546Smrg# Object file extension for compiled Go test sources.
8187a3680546Smrgobjext=o
8188a3680546Smrg_LT_TAGVAR(objext, $1)=$objext
8189a3680546Smrg
8190a3680546Smrg# Code to be used in simple compile tests
8191a3680546Smrglt_simple_compile_test_code="package main; func main() { }"
8192a3680546Smrg
8193a3680546Smrg# Code to be used in simple link tests
8194a3680546Smrglt_simple_link_test_code='package main; func main() { }'
8195a3680546Smrg
8196a3680546Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8197a3680546Smrg_LT_TAG_COMPILER
8198a3680546Smrg
8199a3680546Smrg# save warnings/boilerplate of simple test code
8200a3680546Smrg_LT_COMPILER_BOILERPLATE
8201a3680546Smrg_LT_LINKER_BOILERPLATE
8202a3680546Smrg
8203a3680546Smrg# Allow CC to be a program name with arguments.
8204a3680546Smrglt_save_CC=$CC
8205a3680546Smrglt_save_CFLAGS=$CFLAGS
8206a3680546Smrglt_save_GCC=$GCC
8207a3680546SmrgGCC=yes
8208a3680546SmrgCC=${GOC-"gccgo"}
8209a3680546SmrgCFLAGS=$GOFLAGS
8210a3680546Smrgcompiler=$CC
8211a3680546Smrg_LT_TAGVAR(compiler, $1)=$CC
8212a3680546Smrg_LT_TAGVAR(LD, $1)=$LD
8213a3680546Smrg_LT_CC_BASENAME([$compiler])
8214a3680546Smrg
8215a3680546Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
8216a3680546Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8217a3680546Smrg
8218a3680546Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8219a3680546Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8220a3680546Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8221a3680546Smrg
8222a3680546Smrg## CAVEAT EMPTOR:
8223a3680546Smrg## There is no encapsulation within the following macros, do not change
8224a3680546Smrg## the running order or otherwise move them around unless you know exactly
8225a3680546Smrg## what you are doing...
8226a3680546Smrgif test -n "$compiler"; then
8227a3680546Smrg  _LT_COMPILER_NO_RTTI($1)
8228a3680546Smrg  _LT_COMPILER_PIC($1)
8229a3680546Smrg  _LT_COMPILER_C_O($1)
8230a3680546Smrg  _LT_COMPILER_FILE_LOCKS($1)
8231a3680546Smrg  _LT_LINKER_SHLIBS($1)
8232a3680546Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8233a3680546Smrg
8234a3680546Smrg  _LT_CONFIG($1)
8235a3680546Smrgfi
8236a3680546Smrg
8237a3680546SmrgAC_LANG_RESTORE
8238a3680546Smrg
8239a3680546SmrgGCC=$lt_save_GCC
8240a3680546SmrgCC=$lt_save_CC
8241a3680546SmrgCFLAGS=$lt_save_CFLAGS
8242a3680546Smrg])# _LT_LANG_GO_CONFIG
8243a3680546Smrg
8244a3680546Smrg
8245a3680546Smrg# _LT_LANG_RC_CONFIG([TAG])
8246a3680546Smrg# -------------------------
8247a3680546Smrg# Ensure that the configuration variables for the Windows resource compiler
8248a3680546Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8249a3680546Smrg# to write the compiler configuration to 'libtool'.
8250a3680546Smrgm4_defun([_LT_LANG_RC_CONFIG],
8251a3680546Smrg[AC_REQUIRE([LT_PROG_RC])dnl
8252a3680546SmrgAC_LANG_SAVE
8253a3680546Smrg
8254a3680546Smrg# Source file extension for RC test sources.
8255a3680546Smrgac_ext=rc
8256a3680546Smrg
8257a3680546Smrg# Object file extension for compiled RC test sources.
8258a3680546Smrgobjext=o
8259a3680546Smrg_LT_TAGVAR(objext, $1)=$objext
8260a3680546Smrg
8261a3680546Smrg# Code to be used in simple compile tests
8262a3680546Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8263a3680546Smrg
8264a3680546Smrg# Code to be used in simple link tests
8265a3680546Smrglt_simple_link_test_code=$lt_simple_compile_test_code
8266a3680546Smrg
8267a3680546Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8268a3680546Smrg_LT_TAG_COMPILER
8269a3680546Smrg
8270a3680546Smrg# save warnings/boilerplate of simple test code
8271a3680546Smrg_LT_COMPILER_BOILERPLATE
8272a3680546Smrg_LT_LINKER_BOILERPLATE
8273a3680546Smrg
8274a3680546Smrg# Allow CC to be a program name with arguments.
8275a3680546Smrglt_save_CC=$CC
8276a3680546Smrglt_save_CFLAGS=$CFLAGS
8277a3680546Smrglt_save_GCC=$GCC
8278a3680546SmrgGCC=
8279a3680546SmrgCC=${RC-"windres"}
8280a3680546SmrgCFLAGS=
8281a3680546Smrgcompiler=$CC
8282a3680546Smrg_LT_TAGVAR(compiler, $1)=$CC
8283a3680546Smrg_LT_CC_BASENAME([$compiler])
8284a3680546Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8285a3680546Smrg
8286a3680546Smrgif test -n "$compiler"; then
8287a3680546Smrg  :
8288a3680546Smrg  _LT_CONFIG($1)
8289a3680546Smrgfi
8290a3680546Smrg
8291a3680546SmrgGCC=$lt_save_GCC
8292a3680546SmrgAC_LANG_RESTORE
8293a3680546SmrgCC=$lt_save_CC
8294a3680546SmrgCFLAGS=$lt_save_CFLAGS
8295a3680546Smrg])# _LT_LANG_RC_CONFIG
8296a3680546Smrg
8297a3680546Smrg
8298a3680546Smrg# LT_PROG_GCJ
8299a3680546Smrg# -----------
8300a3680546SmrgAC_DEFUN([LT_PROG_GCJ],
8301a3680546Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8302a3680546Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8303a3680546Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
8304a3680546Smrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
8305a3680546Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
8306a3680546Smrg])
8307a3680546Smrg
8308a3680546Smrg# Old name:
8309a3680546SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8310a3680546Smrgdnl aclocal-1.4 backwards compatibility:
8311a3680546Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8312a3680546Smrg
8313a3680546Smrg
8314a3680546Smrg# LT_PROG_GO
8315a3680546Smrg# ----------
8316a3680546SmrgAC_DEFUN([LT_PROG_GO],
8317a3680546Smrg[AC_CHECK_TOOL(GOC, gccgo,)
8318a3680546Smrg])
8319a3680546Smrg
8320a3680546Smrg
8321a3680546Smrg# LT_PROG_RC
8322a3680546Smrg# ----------
8323a3680546SmrgAC_DEFUN([LT_PROG_RC],
8324a3680546Smrg[AC_CHECK_TOOL(RC, windres,)
8325a3680546Smrg])
8326a3680546Smrg
8327a3680546Smrg# Old name:
8328a3680546SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8329a3680546Smrgdnl aclocal-1.4 backwards compatibility:
8330a3680546Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8331a3680546Smrg
8332a3680546Smrg
8333a3680546Smrg# _LT_DECL_EGREP
8334a3680546Smrg# --------------
8335a3680546Smrg# If we don't have a new enough Autoconf to choose the best grep
8336a3680546Smrg# available, choose the one first in the user's PATH.
8337a3680546Smrgm4_defun([_LT_DECL_EGREP],
8338a3680546Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
8339a3680546SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
8340a3680546Smrgtest -z "$GREP" && GREP=grep
8341a3680546Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8342a3680546Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
8343a3680546Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
8344a3680546Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8345a3680546SmrgAC_SUBST([GREP])
8346a3680546Smrg])
8347a3680546Smrg
8348a3680546Smrg
8349a3680546Smrg# _LT_DECL_OBJDUMP
8350a3680546Smrg# --------------
8351a3680546Smrg# If we don't have a new enough Autoconf to choose the best objdump
8352a3680546Smrg# available, choose the one first in the user's PATH.
8353a3680546Smrgm4_defun([_LT_DECL_OBJDUMP],
8354a3680546Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8355a3680546Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8356a3680546Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8357a3680546SmrgAC_SUBST([OBJDUMP])
8358a3680546Smrg])
8359a3680546Smrg
8360a3680546Smrg# _LT_DECL_DLLTOOL
8361a3680546Smrg# ----------------
8362a3680546Smrg# Ensure DLLTOOL variable is set.
8363a3680546Smrgm4_defun([_LT_DECL_DLLTOOL],
8364a3680546Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8365a3680546Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8366a3680546Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8367a3680546SmrgAC_SUBST([DLLTOOL])
8368a3680546Smrg])
8369a3680546Smrg
8370a3680546Smrg# _LT_DECL_FILECMD
8371a3680546Smrg# ----------------
8372a3680546Smrg# Check for a file(cmd) program that can be used to detect file type and magic
8373a3680546Smrgm4_defun([_LT_DECL_FILECMD],
8374a3680546Smrg[AC_CHECK_PROG([FILECMD], [file], [file], [:])
8375a3680546Smrg_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
8376a3680546Smrg])# _LD_DECL_FILECMD
8377a3680546Smrg
8378a3680546Smrg# _LT_DECL_SED
8379a3680546Smrg# ------------
8380a3680546Smrg# Check for a fully-functional sed program, that truncates
8381a3680546Smrg# as few characters as possible.  Prefer GNU sed if found.
8382a3680546Smrgm4_defun([_LT_DECL_SED],
8383a3680546Smrg[AC_PROG_SED
8384a3680546Smrgtest -z "$SED" && SED=sed
8385a3680546SmrgXsed="$SED -e 1s/^X//"
8386a3680546Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8387a3680546Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8388a3680546Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8389a3680546Smrg])# _LT_DECL_SED
8390a3680546Smrgdnl aclocal-1.4 backwards compatibility:
8391a3680546Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
8392a3680546Smrg
8393a3680546Smrg
8394a3680546Smrg# _LT_CHECK_SHELL_FEATURES
8395a3680546Smrg# ------------------------
8396a3680546Smrg# Find out whether the shell is Bourne or XSI compatible,
8397a3680546Smrg# or has some other useful features.
8398a3680546Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
8399a3680546Smrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8400a3680546Smrg  lt_unset=unset
8401a3680546Smrgelse
8402a3680546Smrg  lt_unset=false
8403a3680546Smrgfi
8404a3680546Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8405a3680546Smrg
8406a3680546Smrg# test EBCDIC or ASCII
8407a3680546Smrgcase `echo X|tr X '\101'` in
8408a3680546Smrg A) # ASCII based system
8409a3680546Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8410a3680546Smrg  lt_SP2NL='tr \040 \012'
8411a3680546Smrg  lt_NL2SP='tr \015\012 \040\040'
8412a3680546Smrg  ;;
8413a3680546Smrg *) # EBCDIC based system
8414a3680546Smrg  lt_SP2NL='tr \100 \n'
8415a3680546Smrg  lt_NL2SP='tr \r\n \100\100'
8416a3680546Smrg  ;;
8417a3680546Smrgesac
8418a3680546Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8419a3680546Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8420a3680546Smrg])# _LT_CHECK_SHELL_FEATURES
8421a3680546Smrg
8422a3680546Smrg
8423a3680546Smrg# _LT_PATH_CONVERSION_FUNCTIONS
8424a3680546Smrg# -----------------------------
8425a3680546Smrg# Determine what file name conversion functions should be used by
8426a3680546Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8427a3680546Smrg# for certain cross-compile configurations and native mingw.
8428a3680546Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8429a3680546Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8430a3680546SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
8431a3680546SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
8432a3680546SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
8433a3680546Smrg[case $host in
8434a3680546Smrg  *-*-mingw* )
8435a3680546Smrg    case $build in
8436a3680546Smrg      *-*-mingw* | *-*-windows* ) # actually msys
8437a3680546Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8438a3680546Smrg        ;;
8439a3680546Smrg      *-*-cygwin* )
8440a3680546Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8441a3680546Smrg        ;;
8442a3680546Smrg      * ) # otherwise, assume *nix
8443a3680546Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8444a3680546Smrg        ;;
8445a3680546Smrg    esac
8446a3680546Smrg    ;;
8447a3680546Smrg  *-*-cygwin* )
8448a3680546Smrg    case $build in
8449a3680546Smrg      *-*-mingw* | *-*-windows* ) # actually msys
8450a3680546Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8451a3680546Smrg        ;;
8452a3680546Smrg      *-*-cygwin* )
8453a3680546Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
8454a3680546Smrg        ;;
8455a3680546Smrg      * ) # otherwise, assume *nix
8456a3680546Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8457a3680546Smrg        ;;
8458a3680546Smrg    esac
8459a3680546Smrg    ;;
8460a3680546Smrg  * ) # unhandled hosts (and "normal" native builds)
8461a3680546Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
8462a3680546Smrg    ;;
8463a3680546Smrgesac
8464a3680546Smrg])
8465a3680546Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
8466a3680546SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8467a3680546Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8468a3680546Smrg         [0], [convert $build file names to $host format])dnl
8469a3680546Smrg
8470a3680546SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
8471a3680546SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8472a3680546Smrg[#assume ordinary cross tools, or native build.
8473a3680546Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
8474a3680546Smrgcase $host in
8475a3680546Smrg  *-*-mingw* | *-*-windows* )
8476a3680546Smrg    case $build in
8477a3680546Smrg      *-*-mingw* | *-*-windows* ) # actually msys
8478a3680546Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8479a3680546Smrg        ;;
8480a3680546Smrg    esac
8481a3680546Smrg    ;;
8482a3680546Smrgesac
8483a3680546Smrg])
8484a3680546Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
8485a3680546SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8486a3680546Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8487a3680546Smrg         [0], [convert $build files to toolchain format])dnl
8488a3680546Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
8489