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