libtool.m4 revision a773ec55
172af6995Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
272af6995Smrg#
3a773ec55Smrg#   Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software
4a773ec55Smrg#   Foundation, Inc.
572af6995Smrg#   Written by Gordon Matzigkeit, 1996
672af6995Smrg#
772af6995Smrg# This file is free software; the Free Software Foundation gives
872af6995Smrg# unlimited permission to copy and/or distribute it, with or without
972af6995Smrg# modifications, as long as this notice is preserved.
1072af6995Smrg
1172af6995Smrgm4_define([_LT_COPYING], [dnl
1272af6995Smrg# Copyright (C) 2014 Free Software Foundation, Inc.
1372af6995Smrg# This is free software; see the source for copying conditions.  There is NO
1472af6995Smrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1572af6995Smrg
1672af6995Smrg# GNU Libtool is free software; you can redistribute it and/or modify
1772af6995Smrg# it under the terms of the GNU General Public License as published by
1872af6995Smrg# the Free Software Foundation; either version 2 of of the License, or
1972af6995Smrg# (at your option) any later version.
2072af6995Smrg#
2172af6995Smrg# As a special exception to the GNU General Public License, if you
2272af6995Smrg# distribute this file as part of a program or library that is built
2372af6995Smrg# using GNU Libtool, you may include this file under the  same
2472af6995Smrg# distribution terms that you use for the rest of that program.
2572af6995Smrg#
2672af6995Smrg# GNU Libtool is distributed in the hope that it will be useful, but
2772af6995Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
2872af6995Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2972af6995Smrg# GNU General Public License for more details.
3072af6995Smrg#
3172af6995Smrg# You should have received a copy of the GNU General Public License
3272af6995Smrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
3372af6995Smrg])
3472af6995Smrg
35a773ec55Smrg# serial 59 LT_INIT
3672af6995Smrg
3772af6995Smrg
3872af6995Smrg# LT_PREREQ(VERSION)
3972af6995Smrg# ------------------
4072af6995Smrg# Complain and exit if this libtool version is less that VERSION.
4172af6995Smrgm4_defun([LT_PREREQ],
4272af6995Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
4372af6995Smrg       [m4_default([$3],
4472af6995Smrg		   [m4_fatal([Libtool version $1 or higher is required],
4572af6995Smrg		             63)])],
4672af6995Smrg       [$2])])
4772af6995Smrg
4872af6995Smrg
4972af6995Smrg# _LT_CHECK_BUILDDIR
5072af6995Smrg# ------------------
5172af6995Smrg# Complain if the absolute build directory name contains unusual characters
5272af6995Smrgm4_defun([_LT_CHECK_BUILDDIR],
5372af6995Smrg[case `pwd` in
5472af6995Smrg  *\ * | *\	*)
5572af6995Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
5672af6995Smrgesac
5772af6995Smrg])
5872af6995Smrg
5972af6995Smrg
6072af6995Smrg# LT_INIT([OPTIONS])
6172af6995Smrg# ------------------
6272af6995SmrgAC_DEFUN([LT_INIT],
6372af6995Smrg[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
6472af6995SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
6572af6995SmrgAC_BEFORE([$0], [LT_LANG])dnl
6672af6995SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
6772af6995SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
6872af6995Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
6972af6995Smrg
7072af6995Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
7172af6995Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
7272af6995Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
7372af6995Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
7472af6995Smrgdnl unless we require an AC_DEFUNed macro:
7572af6995SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
7672af6995SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
7772af6995SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
7872af6995SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
7972af6995Smrgm4_require([_LT_PROG_LTMAIN])dnl
8072af6995Smrg
8172af6995Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
8272af6995Smrg
8372af6995Smrgdnl Parse OPTIONS
8472af6995Smrg_LT_SET_OPTIONS([$0], [$1])
8572af6995Smrg
8672af6995Smrg# This can be used to rebuild libtool when needed
8772af6995SmrgLIBTOOL_DEPS=$ltmain
8872af6995Smrg
8972af6995Smrg# Always use our own libtool.
9072af6995SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
9172af6995SmrgAC_SUBST(LIBTOOL)dnl
9272af6995Smrg
9372af6995Smrg_LT_SETUP
9472af6995Smrg
9572af6995Smrg# Only expand once:
9672af6995Smrgm4_define([LT_INIT])
9772af6995Smrg])# LT_INIT
9872af6995Smrg
9972af6995Smrg# Old names:
10072af6995SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
10172af6995SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
10272af6995Smrgdnl aclocal-1.4 backwards compatibility:
10372af6995Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
10472af6995Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
10572af6995Smrg
10672af6995Smrg
10772af6995Smrg# _LT_PREPARE_CC_BASENAME
10872af6995Smrg# -----------------------
10972af6995Smrgm4_defun([_LT_PREPARE_CC_BASENAME], [
11072af6995Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
11172af6995Smrgfunc_cc_basename ()
11272af6995Smrg{
11372af6995Smrg    for cc_temp in @S|@*""; do
11472af6995Smrg      case $cc_temp in
11572af6995Smrg        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
11672af6995Smrg        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
11772af6995Smrg        \-*) ;;
11872af6995Smrg        *) break;;
11972af6995Smrg      esac
12072af6995Smrg    done
12172af6995Smrg    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
12272af6995Smrg}
12372af6995Smrg])# _LT_PREPARE_CC_BASENAME
12472af6995Smrg
12572af6995Smrg
12672af6995Smrg# _LT_CC_BASENAME(CC)
12772af6995Smrg# -------------------
12872af6995Smrg# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
12972af6995Smrg# but that macro is also expanded into generated libtool script, which
13072af6995Smrg# arranges for $SED and $ECHO to be set by different means.
13172af6995Smrgm4_defun([_LT_CC_BASENAME],
13272af6995Smrg[m4_require([_LT_PREPARE_CC_BASENAME])dnl
13372af6995SmrgAC_REQUIRE([_LT_DECL_SED])dnl
13472af6995SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
13572af6995Smrgfunc_cc_basename $1
13672af6995Smrgcc_basename=$func_cc_basename_result
13772af6995Smrg])
13872af6995Smrg
13972af6995Smrg
14072af6995Smrg# _LT_FILEUTILS_DEFAULTS
14172af6995Smrg# ----------------------
14272af6995Smrg# It is okay to use these file commands and assume they have been set
14372af6995Smrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
14472af6995Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
14572af6995Smrg[: ${CP="cp -f"}
14672af6995Smrg: ${MV="mv -f"}
14772af6995Smrg: ${RM="rm -f"}
14872af6995Smrg])# _LT_FILEUTILS_DEFAULTS
14972af6995Smrg
15072af6995Smrg
15172af6995Smrg# _LT_SETUP
15272af6995Smrg# ---------
15372af6995Smrgm4_defun([_LT_SETUP],
15472af6995Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
15572af6995SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
15672af6995SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
15772af6995SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
15872af6995Smrg
15972af6995Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
16072af6995Smrgdnl
16172af6995Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
16272af6995Smrg_LT_DECL([], [host], [0])dnl
16372af6995Smrg_LT_DECL([], [host_os], [0])dnl
16472af6995Smrgdnl
16572af6995Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
16672af6995Smrg_LT_DECL([], [build], [0])dnl
16772af6995Smrg_LT_DECL([], [build_os], [0])dnl
16872af6995Smrgdnl
16972af6995SmrgAC_REQUIRE([AC_PROG_CC])dnl
17072af6995SmrgAC_REQUIRE([LT_PATH_LD])dnl
17172af6995SmrgAC_REQUIRE([LT_PATH_NM])dnl
17272af6995Smrgdnl
17372af6995SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
17472af6995Smrgtest -z "$LN_S" && LN_S="ln -s"
17572af6995Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
17672af6995Smrgdnl
17772af6995SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
17872af6995Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
17972af6995Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
18072af6995Smrgdnl
18172af6995Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
18272af6995Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
18372af6995Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
18472af6995Smrgm4_require([_LT_CMD_RELOAD])dnl
185a773ec55Smrgm4_require([_LT_DECL_FILECMD])dnl
18672af6995Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
18772af6995Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
18872af6995Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
18972af6995Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
19072af6995Smrgm4_require([_LT_WITH_SYSROOT])dnl
19172af6995Smrgm4_require([_LT_CMD_TRUNCATE])dnl
19272af6995Smrg
19372af6995Smrg_LT_CONFIG_LIBTOOL_INIT([
19472af6995Smrg# See if we are running on zsh, and set the options that allow our
19572af6995Smrg# commands through without removal of \ escapes INIT.
19672af6995Smrgif test -n "\${ZSH_VERSION+set}"; then
19772af6995Smrg   setopt NO_GLOB_SUBST
19872af6995Smrgfi
19972af6995Smrg])
20072af6995Smrgif test -n "${ZSH_VERSION+set}"; then
20172af6995Smrg   setopt NO_GLOB_SUBST
20272af6995Smrgfi
20372af6995Smrg
20472af6995Smrg_LT_CHECK_OBJDIR
20572af6995Smrg
20672af6995Smrgm4_require([_LT_TAG_COMPILER])dnl
20772af6995Smrg
20872af6995Smrgcase $host_os in
20972af6995Smrgaix3*)
21072af6995Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
21172af6995Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
21272af6995Smrg  # vanish in a puff of smoke.
21372af6995Smrg  if test set != "${COLLECT_NAMES+set}"; then
21472af6995Smrg    COLLECT_NAMES=
21572af6995Smrg    export COLLECT_NAMES
21672af6995Smrg  fi
21772af6995Smrg  ;;
21872af6995Smrgesac
21972af6995Smrg
22072af6995Smrg# Global variables:
22172af6995Smrgofile=libtool
22272af6995Smrgcan_build_shared=yes
22372af6995Smrg
224a773ec55Smrg# All known linkers require a '.a' archive for static linking (except MSVC and
225a773ec55Smrg# ICC, which need '.lib').
22672af6995Smrglibext=a
22772af6995Smrg
22872af6995Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
22972af6995Smrg
23072af6995Smrgold_CC=$CC
23172af6995Smrgold_CFLAGS=$CFLAGS
23272af6995Smrg
23372af6995Smrg# Set sane defaults for various variables
23472af6995Smrgtest -z "$CC" && CC=cc
23572af6995Smrgtest -z "$LTCC" && LTCC=$CC
23672af6995Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
23772af6995Smrgtest -z "$LD" && LD=ld
23872af6995Smrgtest -z "$ac_objext" && ac_objext=o
23972af6995Smrg
24072af6995Smrg_LT_CC_BASENAME([$compiler])
24172af6995Smrg
24272af6995Smrg# Only perform the check for file, if the check method requires it
24372af6995Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
24472af6995Smrgcase $deplibs_check_method in
24572af6995Smrgfile_magic*)
24672af6995Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
24772af6995Smrg    _LT_PATH_MAGIC
24872af6995Smrg  fi
24972af6995Smrg  ;;
25072af6995Smrgesac
25172af6995Smrg
25272af6995Smrg# Use C for the default configuration in the libtool script
25372af6995SmrgLT_SUPPORTED_TAG([CC])
25472af6995Smrg_LT_LANG_C_CONFIG
25572af6995Smrg_LT_LANG_DEFAULT_CONFIG
25672af6995Smrg_LT_CONFIG_COMMANDS
25772af6995Smrg])# _LT_SETUP
25872af6995Smrg
25972af6995Smrg
26072af6995Smrg# _LT_PREPARE_SED_QUOTE_VARS
26172af6995Smrg# --------------------------
26272af6995Smrg# Define a few sed substitution that help us do robust quoting.
26372af6995Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
26472af6995Smrg[# Backslashify metacharacters that are still active within
26572af6995Smrg# double-quoted strings.
26672af6995Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
26772af6995Smrg
26872af6995Smrg# Same as above, but do not quote variable references.
26972af6995Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
27072af6995Smrg
27172af6995Smrg# Sed substitution to delay expansion of an escaped shell variable in a
27272af6995Smrg# double_quote_subst'ed string.
27372af6995Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
27472af6995Smrg
27572af6995Smrg# Sed substitution to delay expansion of an escaped single quote.
27672af6995Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
27772af6995Smrg
27872af6995Smrg# Sed substitution to avoid accidental globbing in evaled expressions
27972af6995Smrgno_glob_subst='s/\*/\\\*/g'
28072af6995Smrg])
28172af6995Smrg
28272af6995Smrg# _LT_PROG_LTMAIN
28372af6995Smrg# ---------------
28472af6995Smrg# Note that this code is called both from 'configure', and 'config.status'
28572af6995Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
28672af6995Smrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
28772af6995Smrg# so we pass a copy along to make sure it has a sensible value anyway.
28872af6995Smrgm4_defun([_LT_PROG_LTMAIN],
28972af6995Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
29072af6995Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
29172af6995Smrgltmain=$ac_aux_dir/ltmain.sh
29272af6995Smrg])# _LT_PROG_LTMAIN
29372af6995Smrg
29472af6995Smrg
29572af6995Smrg## ------------------------------------- ##
29672af6995Smrg## Accumulate code for creating libtool. ##
29772af6995Smrg## ------------------------------------- ##
29872af6995Smrg
29972af6995Smrg# So that we can recreate a full libtool script including additional
30072af6995Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
30172af6995Smrg# in macros and then make a single call at the end using the 'libtool'
30272af6995Smrg# label.
30372af6995Smrg
30472af6995Smrg
30572af6995Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
30672af6995Smrg# ----------------------------------------
30772af6995Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
30872af6995Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
30972af6995Smrg[m4_ifval([$1],
31072af6995Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
31172af6995Smrg                     [$1
31272af6995Smrg])])])
31372af6995Smrg
31472af6995Smrg# Initialize.
31572af6995Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
31672af6995Smrg
31772af6995Smrg
31872af6995Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
31972af6995Smrg# ------------------------------
32072af6995Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
32172af6995Smrgm4_define([_LT_CONFIG_LIBTOOL],
32272af6995Smrg[m4_ifval([$1],
32372af6995Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
32472af6995Smrg                     [$1
32572af6995Smrg])])])
32672af6995Smrg
32772af6995Smrg# Initialize.
32872af6995Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
32972af6995Smrg
33072af6995Smrg
33172af6995Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
33272af6995Smrg# -----------------------------------------------------
33372af6995Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
33472af6995Smrg[_LT_CONFIG_LIBTOOL([$1])
33572af6995Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
33672af6995Smrg])
33772af6995Smrg
33872af6995Smrg
33972af6995Smrg# _LT_FORMAT_COMMENT([COMMENT])
34072af6995Smrg# -----------------------------
34172af6995Smrg# Add leading comment marks to the start of each line, and a trailing
34272af6995Smrg# full-stop to the whole comment if one is not present already.
34372af6995Smrgm4_define([_LT_FORMAT_COMMENT],
34472af6995Smrg[m4_ifval([$1], [
34572af6995Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
34672af6995Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
34772af6995Smrg)])
34872af6995Smrg
34972af6995Smrg
35072af6995Smrg
35172af6995Smrg## ------------------------ ##
35272af6995Smrg## FIXME: Eliminate VARNAME ##
35372af6995Smrg## ------------------------ ##
35472af6995Smrg
35572af6995Smrg
35672af6995Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
35772af6995Smrg# -------------------------------------------------------------------
35872af6995Smrg# CONFIGNAME is the name given to the value in the libtool script.
35972af6995Smrg# VARNAME is the (base) name used in the configure script.
36072af6995Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
36172af6995Smrg# VARNAME.  Any other value will be used directly.
36272af6995Smrgm4_define([_LT_DECL],
36372af6995Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
36472af6995Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
36572af6995Smrg	[m4_ifval([$1], [$1], [$2])])
36672af6995Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
36772af6995Smrg    m4_ifval([$4],
36872af6995Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
36972af6995Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
37072af6995Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
37172af6995Smrg])
37272af6995Smrg
37372af6995Smrg
37472af6995Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
37572af6995Smrg# --------------------------------------------------------
37672af6995Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
37772af6995Smrg
37872af6995Smrg
37972af6995Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
38072af6995Smrg# ------------------------------------------------
38172af6995Smrgm4_define([lt_decl_tag_varnames],
38272af6995Smrg[_lt_decl_filter([tagged?], [yes], $@)])
38372af6995Smrg
38472af6995Smrg
38572af6995Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
38672af6995Smrg# ---------------------------------------------------------
38772af6995Smrgm4_define([_lt_decl_filter],
38872af6995Smrg[m4_case([$#],
38972af6995Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
39072af6995Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
39172af6995Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
39272af6995Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
39372af6995Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
39472af6995Smrg])
39572af6995Smrg
39672af6995Smrg
39772af6995Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
39872af6995Smrg# --------------------------------------------------
39972af6995Smrgm4_define([lt_decl_quote_varnames],
40072af6995Smrg[_lt_decl_filter([value], [1], $@)])
40172af6995Smrg
40272af6995Smrg
40372af6995Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
40472af6995Smrg# ---------------------------------------------------
40572af6995Smrgm4_define([lt_decl_dquote_varnames],
40672af6995Smrg[_lt_decl_filter([value], [2], $@)])
40772af6995Smrg
40872af6995Smrg
40972af6995Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
41072af6995Smrg# ---------------------------------------------------
41172af6995Smrgm4_define([lt_decl_varnames_tagged],
41272af6995Smrg[m4_assert([$# <= 2])dnl
41372af6995Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
41472af6995Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
41572af6995Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
41672af6995Smrgm4_define([_lt_decl_varnames_tagged],
41772af6995Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
41872af6995Smrg
41972af6995Smrg
42072af6995Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
42172af6995Smrg# ------------------------------------------------
42272af6995Smrgm4_define([lt_decl_all_varnames],
42372af6995Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
42472af6995Smrg     m4_if([$2], [],
42572af6995Smrg	   m4_quote(lt_decl_varnames),
42672af6995Smrg	m4_quote(m4_shift($@))))[]dnl
42772af6995Smrg])
42872af6995Smrgm4_define([_lt_decl_all_varnames],
42972af6995Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
43072af6995Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
43172af6995Smrg])
43272af6995Smrg
43372af6995Smrg
43472af6995Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
43572af6995Smrg# ------------------------------------
43672af6995Smrg# Quote a variable value, and forward it to 'config.status' so that its
43772af6995Smrg# declaration there will have the same value as in 'configure'.  VARNAME
43872af6995Smrg# must have a single quote delimited value for this to work.
43972af6995Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
44072af6995Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
44172af6995Smrg
44272af6995Smrg
44372af6995Smrg# _LT_CONFIG_STATUS_DECLARATIONS
44472af6995Smrg# ------------------------------
44572af6995Smrg# We delimit libtool config variables with single quotes, so when
44672af6995Smrg# we write them to config.status, we have to be sure to quote all
44772af6995Smrg# embedded single quotes properly.  In configure, this macro expands
44872af6995Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
44972af6995Smrg#
45072af6995Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
45172af6995Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
45272af6995Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
45372af6995Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
45472af6995Smrg
45572af6995Smrg
45672af6995Smrg# _LT_LIBTOOL_TAGS
45772af6995Smrg# ----------------
45872af6995Smrg# Output comment and list of tags supported by the script
45972af6995Smrgm4_defun([_LT_LIBTOOL_TAGS],
46072af6995Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
46172af6995Smrgavailable_tags='_LT_TAGS'dnl
46272af6995Smrg])
46372af6995Smrg
46472af6995Smrg
46572af6995Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
46672af6995Smrg# -----------------------------------
46772af6995Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
46872af6995Smrg# expand to a commented shell variable setting:
46972af6995Smrg#
47072af6995Smrg#    # Some comment about what VAR is for.
47172af6995Smrg#    visible_name=$lt_internal_name
47272af6995Smrgm4_define([_LT_LIBTOOL_DECLARE],
47372af6995Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
47472af6995Smrg					   [description])))[]dnl
47572af6995Smrgm4_pushdef([_libtool_name],
47672af6995Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
47772af6995Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
47872af6995Smrg    [0], [_libtool_name=[$]$1],
47972af6995Smrg    [1], [_libtool_name=$lt_[]$1],
48072af6995Smrg    [2], [_libtool_name=$lt_[]$1],
48172af6995Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
48272af6995Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
48372af6995Smrg])
48472af6995Smrg
48572af6995Smrg
48672af6995Smrg# _LT_LIBTOOL_CONFIG_VARS
48772af6995Smrg# -----------------------
48872af6995Smrg# Produce commented declarations of non-tagged libtool config variables
48972af6995Smrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
49072af6995Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
49172af6995Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
49272af6995Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
49372af6995Smrg[m4_foreach([_lt_var],
49472af6995Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
49572af6995Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
49672af6995Smrg
49772af6995Smrg
49872af6995Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
49972af6995Smrg# -------------------------
50072af6995Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
50172af6995Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
50272af6995Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
50372af6995Smrg
50472af6995Smrg
50572af6995Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
50672af6995Smrg# ------------------------------
50772af6995Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
50872af6995Smrg
50972af6995Smrg
51072af6995Smrg# _LT_CONFIG_COMMANDS
51172af6995Smrg# -------------------
51272af6995Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
51372af6995Smrg# variables for single and double quote escaping we saved from calls
51472af6995Smrg# to _LT_DECL, we can put quote escaped variables declarations
51572af6995Smrg# into 'config.status', and then the shell code to quote escape them in
51672af6995Smrg# for loops in 'config.status'.  Finally, any additional code accumulated
51772af6995Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
51872af6995Smrgm4_defun([_LT_CONFIG_COMMANDS],
51972af6995Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
52072af6995Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
52172af6995Smrg	dnl instead of duplicating it all over again into config.status,
52272af6995Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
52372af6995Smrg	dnl needs to know what name is stored there:
52472af6995Smrg        [AC_CONFIG_COMMANDS([libtool],
52572af6995Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
52672af6995Smrg    dnl If the libtool generation code is destined for config.status,
52772af6995Smrg    dnl expand the accumulated commands and init code now:
52872af6995Smrg    [AC_CONFIG_COMMANDS([libtool],
52972af6995Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
53072af6995Smrg])#_LT_CONFIG_COMMANDS
53172af6995Smrg
53272af6995Smrg
53372af6995Smrg# Initialize.
53472af6995Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
53572af6995Smrg[
53672af6995Smrg
53772af6995Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
53872af6995Smrg# if CDPATH is set.
53972af6995Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
54072af6995Smrg
54172af6995Smrgsed_quote_subst='$sed_quote_subst'
54272af6995Smrgdouble_quote_subst='$double_quote_subst'
54372af6995Smrgdelay_variable_subst='$delay_variable_subst'
54472af6995Smrg_LT_CONFIG_STATUS_DECLARATIONS
54572af6995SmrgLTCC='$LTCC'
54672af6995SmrgLTCFLAGS='$LTCFLAGS'
54772af6995Smrgcompiler='$compiler_DEFAULT'
54872af6995Smrg
54972af6995Smrg# A function that is used when there is no print builtin or printf.
55072af6995Smrgfunc_fallback_echo ()
55172af6995Smrg{
55272af6995Smrg  eval 'cat <<_LTECHO_EOF
55372af6995Smrg\$[]1
55472af6995Smrg_LTECHO_EOF'
55572af6995Smrg}
55672af6995Smrg
55772af6995Smrg# Quote evaled strings.
55872af6995Smrgfor var in lt_decl_all_varnames([[ \
55972af6995Smrg]], lt_decl_quote_varnames); do
56072af6995Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
56172af6995Smrg    *[[\\\\\\\`\\"\\\$]]*)
56272af6995Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
56372af6995Smrg      ;;
56472af6995Smrg    *)
56572af6995Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
56672af6995Smrg      ;;
56772af6995Smrg    esac
56872af6995Smrgdone
56972af6995Smrg
57072af6995Smrg# Double-quote double-evaled strings.
57172af6995Smrgfor var in lt_decl_all_varnames([[ \
57272af6995Smrg]], lt_decl_dquote_varnames); do
57372af6995Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
57472af6995Smrg    *[[\\\\\\\`\\"\\\$]]*)
57572af6995Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
57672af6995Smrg      ;;
57772af6995Smrg    *)
57872af6995Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
57972af6995Smrg      ;;
58072af6995Smrg    esac
58172af6995Smrgdone
58272af6995Smrg
58372af6995Smrg_LT_OUTPUT_LIBTOOL_INIT
58472af6995Smrg])
58572af6995Smrg
58672af6995Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
58772af6995Smrg# ------------------------------------
58872af6995Smrg# Generate a child script FILE with all initialization necessary to
58972af6995Smrg# reuse the environment learned by the parent script, and make the
59072af6995Smrg# file executable.  If COMMENT is supplied, it is inserted after the
59172af6995Smrg# '#!' sequence but before initialization text begins.  After this
59272af6995Smrg# macro, additional text can be appended to FILE to form the body of
59372af6995Smrg# the child script.  The macro ends with non-zero status if the
59472af6995Smrg# file could not be fully written (such as if the disk is full).
59572af6995Smrgm4_ifdef([AS_INIT_GENERATED],
59672af6995Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
59772af6995Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
59872af6995Smrg[m4_require([AS_PREPARE])]dnl
59972af6995Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
60072af6995Smrg[lt_write_fail=0
60172af6995Smrgcat >$1 <<_ASEOF || lt_write_fail=1
60272af6995Smrg#! $SHELL
60372af6995Smrg# Generated by $as_me.
60472af6995Smrg$2
60572af6995SmrgSHELL=\${CONFIG_SHELL-$SHELL}
60672af6995Smrgexport SHELL
60772af6995Smrg_ASEOF
60872af6995Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
60972af6995SmrgAS_SHELL_SANITIZE
61072af6995Smrg_AS_PREPARE
61172af6995Smrgexec AS_MESSAGE_FD>&1
61272af6995Smrg_ASEOF
61372af6995Smrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
61472af6995Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
61572af6995Smrg
61672af6995Smrg# LT_OUTPUT
61772af6995Smrg# ---------
61872af6995Smrg# This macro allows early generation of the libtool script (before
61972af6995Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
62072af6995Smrg# tests.
62172af6995SmrgAC_DEFUN([LT_OUTPUT],
62272af6995Smrg[: ${CONFIG_LT=./config.lt}
62372af6995SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
62472af6995Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
62572af6995Smrg[# Run this file to recreate a libtool stub with the current configuration.])
62672af6995Smrg
62772af6995Smrgcat >>"$CONFIG_LT" <<\_LTEOF
62872af6995Smrglt_cl_silent=false
62972af6995Smrgexec AS_MESSAGE_LOG_FD>>config.log
63072af6995Smrg{
63172af6995Smrg  echo
63272af6995Smrg  AS_BOX([Running $as_me.])
63372af6995Smrg} >&AS_MESSAGE_LOG_FD
63472af6995Smrg
63572af6995Smrglt_cl_help="\
63672af6995Smrg'$as_me' creates a local libtool stub from the current configuration,
63772af6995Smrgfor use in further configure time tests before the real libtool is
63872af6995Smrggenerated.
63972af6995Smrg
64072af6995SmrgUsage: $[0] [[OPTIONS]]
64172af6995Smrg
64272af6995Smrg  -h, --help      print this help, then exit
64372af6995Smrg  -V, --version   print version number, then exit
64472af6995Smrg  -q, --quiet     do not print progress messages
64572af6995Smrg  -d, --debug     don't remove temporary files
64672af6995Smrg
64772af6995SmrgReport bugs to <bug-libtool@gnu.org>."
64872af6995Smrg
64972af6995Smrglt_cl_version="\
65072af6995Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
65172af6995Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
65272af6995Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
65372af6995Smrg
65472af6995SmrgCopyright (C) 2011 Free Software Foundation, Inc.
65572af6995SmrgThis config.lt script is free software; the Free Software Foundation
65672af6995Smrggives unlimited permision to copy, distribute and modify it."
65772af6995Smrg
65872af6995Smrgwhile test 0 != $[#]
65972af6995Smrgdo
66072af6995Smrg  case $[1] in
66172af6995Smrg    --version | --v* | -V )
66272af6995Smrg      echo "$lt_cl_version"; exit 0 ;;
66372af6995Smrg    --help | --h* | -h )
66472af6995Smrg      echo "$lt_cl_help"; exit 0 ;;
66572af6995Smrg    --debug | --d* | -d )
66672af6995Smrg      debug=: ;;
66772af6995Smrg    --quiet | --q* | --silent | --s* | -q )
66872af6995Smrg      lt_cl_silent=: ;;
66972af6995Smrg
67072af6995Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
67172af6995SmrgTry '$[0] --help' for more information.]) ;;
67272af6995Smrg
67372af6995Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
67472af6995SmrgTry '$[0] --help' for more information.]) ;;
67572af6995Smrg  esac
67672af6995Smrg  shift
67772af6995Smrgdone
67872af6995Smrg
67972af6995Smrgif $lt_cl_silent; then
68072af6995Smrg  exec AS_MESSAGE_FD>/dev/null
68172af6995Smrgfi
68272af6995Smrg_LTEOF
68372af6995Smrg
68472af6995Smrgcat >>"$CONFIG_LT" <<_LTEOF
68572af6995Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
68672af6995Smrg_LTEOF
68772af6995Smrg
68872af6995Smrgcat >>"$CONFIG_LT" <<\_LTEOF
68972af6995SmrgAC_MSG_NOTICE([creating $ofile])
69072af6995Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
69172af6995SmrgAS_EXIT(0)
69272af6995Smrg_LTEOF
69372af6995Smrgchmod +x "$CONFIG_LT"
69472af6995Smrg
69572af6995Smrg# configure is writing to config.log, but config.lt does its own redirection,
69672af6995Smrg# appending to config.log, which fails on DOS, as config.log is still kept
69772af6995Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
69872af6995Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
69972af6995Smrglt_cl_success=:
70072af6995Smrgtest yes = "$silent" &&
70172af6995Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
70272af6995Smrgexec AS_MESSAGE_LOG_FD>/dev/null
70372af6995Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
70472af6995Smrgexec AS_MESSAGE_LOG_FD>>config.log
70572af6995Smrg$lt_cl_success || AS_EXIT(1)
70672af6995Smrg])# LT_OUTPUT
70772af6995Smrg
70872af6995Smrg
70972af6995Smrg# _LT_CONFIG(TAG)
71072af6995Smrg# ---------------
71172af6995Smrg# If TAG is the built-in tag, create an initial libtool script with a
71272af6995Smrg# default configuration from the untagged config vars.  Otherwise add code
71372af6995Smrg# to config.status for appending the configuration named by TAG from the
71472af6995Smrg# matching tagged config vars.
71572af6995Smrgm4_defun([_LT_CONFIG],
71672af6995Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
71772af6995Smrg_LT_CONFIG_SAVE_COMMANDS([
71872af6995Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
71972af6995Smrg  m4_if(_LT_TAG, [C], [
72072af6995Smrg    # See if we are running on zsh, and set the options that allow our
72172af6995Smrg    # commands through without removal of \ escapes.
72272af6995Smrg    if test -n "${ZSH_VERSION+set}"; then
72372af6995Smrg      setopt NO_GLOB_SUBST
72472af6995Smrg    fi
72572af6995Smrg
72672af6995Smrg    cfgfile=${ofile}T
72772af6995Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
72872af6995Smrg    $RM "$cfgfile"
72972af6995Smrg
73072af6995Smrg    cat <<_LT_EOF >> "$cfgfile"
73172af6995Smrg#! $SHELL
73272af6995Smrg# Generated automatically by $as_me ($PACKAGE) $VERSION
733362b94d5Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
73472af6995Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
73572af6995Smrg
73672af6995Smrg# Provide generalized library-building support services.
73772af6995Smrg# Written by Gordon Matzigkeit, 1996
73872af6995Smrg
73972af6995Smrg_LT_COPYING
74072af6995Smrg_LT_LIBTOOL_TAGS
74172af6995Smrg
74272af6995Smrg# Configured defaults for sys_lib_dlsearch_path munging.
74372af6995Smrg: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
74472af6995Smrg
74572af6995Smrg# ### BEGIN LIBTOOL CONFIG
74672af6995Smrg_LT_LIBTOOL_CONFIG_VARS
74772af6995Smrg_LT_LIBTOOL_TAG_VARS
74872af6995Smrg# ### END LIBTOOL CONFIG
74972af6995Smrg
75072af6995Smrg_LT_EOF
75172af6995Smrg
75272af6995Smrg    cat <<'_LT_EOF' >> "$cfgfile"
75372af6995Smrg
75472af6995Smrg# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
75572af6995Smrg
75672af6995Smrg_LT_PREPARE_MUNGE_PATH_LIST
75772af6995Smrg_LT_PREPARE_CC_BASENAME
75872af6995Smrg
75972af6995Smrg# ### END FUNCTIONS SHARED WITH CONFIGURE
76072af6995Smrg
76172af6995Smrg_LT_EOF
76272af6995Smrg
76372af6995Smrg  case $host_os in
76472af6995Smrg  aix3*)
76572af6995Smrg    cat <<\_LT_EOF >> "$cfgfile"
76672af6995Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
76772af6995Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
76872af6995Smrg# vanish in a puff of smoke.
76972af6995Smrgif test set != "${COLLECT_NAMES+set}"; then
77072af6995Smrg  COLLECT_NAMES=
77172af6995Smrg  export COLLECT_NAMES
77272af6995Smrgfi
77372af6995Smrg_LT_EOF
77472af6995Smrg    ;;
77572af6995Smrg  esac
77672af6995Smrg
77772af6995Smrg  _LT_PROG_LTMAIN
77872af6995Smrg
77972af6995Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
78072af6995Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
78172af6995Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
78272af6995Smrg  # is reportedly fixed, but why not run on old versions too?
783a773ec55Smrg  $SED '$q' "$ltmain" >> "$cfgfile" \
78472af6995Smrg     || (rm -f "$cfgfile"; exit 1)
78572af6995Smrg
78672af6995Smrg   mv -f "$cfgfile" "$ofile" ||
78772af6995Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
78872af6995Smrg  chmod +x "$ofile"
78972af6995Smrg],
79072af6995Smrg[cat <<_LT_EOF >> "$ofile"
79172af6995Smrg
79272af6995Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
79372af6995Smrgdnl in a comment (ie after a #).
79472af6995Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
79572af6995Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
79672af6995Smrg# ### END LIBTOOL TAG CONFIG: $1
79772af6995Smrg_LT_EOF
79872af6995Smrg])dnl /m4_if
79972af6995Smrg],
80072af6995Smrg[m4_if([$1], [], [
80172af6995Smrg    PACKAGE='$PACKAGE'
80272af6995Smrg    VERSION='$VERSION'
80372af6995Smrg    RM='$RM'
80472af6995Smrg    ofile='$ofile'], [])
80572af6995Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
80672af6995Smrg])# _LT_CONFIG
80772af6995Smrg
80872af6995Smrg
80972af6995Smrg# LT_SUPPORTED_TAG(TAG)
81072af6995Smrg# ---------------------
81172af6995Smrg# Trace this macro to discover what tags are supported by the libtool
81272af6995Smrg# --tag option, using:
81372af6995Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
81472af6995SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
81572af6995Smrg
81672af6995Smrg
81772af6995Smrg# C support is built-in for now
81872af6995Smrgm4_define([_LT_LANG_C_enabled], [])
81972af6995Smrgm4_define([_LT_TAGS], [])
82072af6995Smrg
82172af6995Smrg
82272af6995Smrg# LT_LANG(LANG)
82372af6995Smrg# -------------
82472af6995Smrg# Enable libtool support for the given language if not already enabled.
82572af6995SmrgAC_DEFUN([LT_LANG],
82672af6995Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
82772af6995Smrgm4_case([$1],
82872af6995Smrg  [C],			[_LT_LANG(C)],
82972af6995Smrg  [C++],		[_LT_LANG(CXX)],
83072af6995Smrg  [Go],			[_LT_LANG(GO)],
83172af6995Smrg  [Java],		[_LT_LANG(GCJ)],
83272af6995Smrg  [Fortran 77],		[_LT_LANG(F77)],
83372af6995Smrg  [Fortran],		[_LT_LANG(FC)],
83472af6995Smrg  [Windows Resource],	[_LT_LANG(RC)],
83572af6995Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
83672af6995Smrg    [_LT_LANG($1)],
83772af6995Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
83872af6995Smrg])# LT_LANG
83972af6995Smrg
84072af6995Smrg
84172af6995Smrg# _LT_LANG(LANGNAME)
84272af6995Smrg# ------------------
84372af6995Smrgm4_defun([_LT_LANG],
84472af6995Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
84572af6995Smrg  [LT_SUPPORTED_TAG([$1])dnl
84672af6995Smrg  m4_append([_LT_TAGS], [$1 ])dnl
84772af6995Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
84872af6995Smrg  _LT_LANG_$1_CONFIG($1)])dnl
84972af6995Smrg])# _LT_LANG
85072af6995Smrg
85172af6995Smrg
85272af6995Smrgm4_ifndef([AC_PROG_GO], [
85372af6995Smrg############################################################
85472af6995Smrg# NOTE: This macro has been submitted for inclusion into   #
85572af6995Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
85672af6995Smrg#  a released version of Autoconf we should remove this    #
85772af6995Smrg#  macro and use it instead.                               #
85872af6995Smrg############################################################
85972af6995Smrgm4_defun([AC_PROG_GO],
86072af6995Smrg[AC_LANG_PUSH(Go)dnl
86172af6995SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
86272af6995SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
86372af6995Smrg_AC_ARG_VAR_LDFLAGS()dnl
86472af6995SmrgAC_CHECK_TOOL(GOC, gccgo)
86572af6995Smrgif test -z "$GOC"; then
86672af6995Smrg  if test -n "$ac_tool_prefix"; then
86772af6995Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
86872af6995Smrg  fi
86972af6995Smrgfi
87072af6995Smrgif test -z "$GOC"; then
87172af6995Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
87272af6995Smrgfi
87372af6995Smrg])#m4_defun
87472af6995Smrg])#m4_ifndef
87572af6995Smrg
87672af6995Smrg
87772af6995Smrg# _LT_LANG_DEFAULT_CONFIG
87872af6995Smrg# -----------------------
87972af6995Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
88072af6995Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
88172af6995Smrg  [LT_LANG(CXX)],
88272af6995Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
88372af6995Smrg
88472af6995SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
88572af6995Smrg  [LT_LANG(F77)],
88672af6995Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
88772af6995Smrg
88872af6995SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
88972af6995Smrg  [LT_LANG(FC)],
89072af6995Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
89172af6995Smrg
89272af6995Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
89372af6995Smrgdnl pulling things in needlessly.
89472af6995SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
89572af6995Smrg  [LT_LANG(GCJ)],
89672af6995Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
89772af6995Smrg    [LT_LANG(GCJ)],
89872af6995Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
89972af6995Smrg      [LT_LANG(GCJ)],
90072af6995Smrg      [m4_ifdef([AC_PROG_GCJ],
90172af6995Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
90272af6995Smrg       m4_ifdef([A][M_PROG_GCJ],
90372af6995Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
90472af6995Smrg       m4_ifdef([LT_PROG_GCJ],
90572af6995Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
90672af6995Smrg
90772af6995SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
90872af6995Smrg  [LT_LANG(GO)],
90972af6995Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
91072af6995Smrg
91172af6995SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
91272af6995Smrg  [LT_LANG(RC)],
91372af6995Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
91472af6995Smrg])# _LT_LANG_DEFAULT_CONFIG
91572af6995Smrg
91672af6995Smrg# Obsolete macros:
91772af6995SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
91872af6995SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
91972af6995SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
92072af6995SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
92172af6995SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
92272af6995Smrgdnl aclocal-1.4 backwards compatibility:
92372af6995Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
92472af6995Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
92572af6995Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
92672af6995Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
92772af6995Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
92872af6995Smrg
92972af6995Smrg
93072af6995Smrg# _LT_TAG_COMPILER
93172af6995Smrg# ----------------
93272af6995Smrgm4_defun([_LT_TAG_COMPILER],
93372af6995Smrg[AC_REQUIRE([AC_PROG_CC])dnl
93472af6995Smrg
93572af6995Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
93672af6995Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
93772af6995Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
93872af6995Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
93972af6995Smrg
94072af6995Smrg# If no C compiler was specified, use CC.
94172af6995SmrgLTCC=${LTCC-"$CC"}
94272af6995Smrg
94372af6995Smrg# If no C compiler flags were specified, use CFLAGS.
94472af6995SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
94572af6995Smrg
94672af6995Smrg# Allow CC to be a program name with arguments.
94772af6995Smrgcompiler=$CC
94872af6995Smrg])# _LT_TAG_COMPILER
94972af6995Smrg
95072af6995Smrg
95172af6995Smrg# _LT_COMPILER_BOILERPLATE
95272af6995Smrg# ------------------------
95372af6995Smrg# Check for compiler boilerplate output or warnings with
95472af6995Smrg# the simple compiler test code.
95572af6995Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
95672af6995Smrg[m4_require([_LT_DECL_SED])dnl
95772af6995Smrgac_outfile=conftest.$ac_objext
95872af6995Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
95972af6995Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
96072af6995Smrg_lt_compiler_boilerplate=`cat conftest.err`
96172af6995Smrg$RM conftest*
96272af6995Smrg])# _LT_COMPILER_BOILERPLATE
96372af6995Smrg
96472af6995Smrg
96572af6995Smrg# _LT_LINKER_BOILERPLATE
96672af6995Smrg# ----------------------
96772af6995Smrg# Check for linker boilerplate output or warnings with
96872af6995Smrg# the simple link test code.
96972af6995Smrgm4_defun([_LT_LINKER_BOILERPLATE],
97072af6995Smrg[m4_require([_LT_DECL_SED])dnl
97172af6995Smrgac_outfile=conftest.$ac_objext
97272af6995Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
97372af6995Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
97472af6995Smrg_lt_linker_boilerplate=`cat conftest.err`
97572af6995Smrg$RM -r conftest*
97672af6995Smrg])# _LT_LINKER_BOILERPLATE
97772af6995Smrg
97872af6995Smrg# _LT_REQUIRED_DARWIN_CHECKS
97972af6995Smrg# -------------------------
98072af6995Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
98172af6995Smrg  case $host_os in
98272af6995Smrg    rhapsody* | darwin*)
98372af6995Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
98472af6995Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
98572af6995Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
98672af6995Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
98772af6995Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
98872af6995Smrg    _LT_DECL([], [DSYMUTIL], [1],
98972af6995Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
99072af6995Smrg    _LT_DECL([], [NMEDIT], [1],
99172af6995Smrg      [Tool to change global to local symbols on Mac OS X])
99272af6995Smrg    _LT_DECL([], [LIPO], [1],
99372af6995Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
99472af6995Smrg    _LT_DECL([], [OTOOL], [1],
99572af6995Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
99672af6995Smrg    _LT_DECL([], [OTOOL64], [1],
99772af6995Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
99872af6995Smrg
99972af6995Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
100072af6995Smrg      [lt_cv_apple_cc_single_mod=no
100172af6995Smrg      if test -z "$LT_MULTI_MODULE"; then
100272af6995Smrg	# By default we will add the -single_module flag. You can override
100372af6995Smrg	# by either setting the environment variable LT_MULTI_MODULE
100472af6995Smrg	# non-empty at configure time, or by adding -multi_module to the
100572af6995Smrg	# link flags.
100672af6995Smrg	rm -rf libconftest.dylib*
100772af6995Smrg	echo "int foo(void){return 1;}" > conftest.c
100872af6995Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
100972af6995Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
101072af6995Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
101172af6995Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
101272af6995Smrg        _lt_result=$?
101372af6995Smrg	# If there is a non-empty error log, and "single_module"
101472af6995Smrg	# appears in it, assume the flag caused a linker warning
101572af6995Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
101672af6995Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
101772af6995Smrg	# Otherwise, if the output was created with a 0 exit code from
101872af6995Smrg	# the compiler, it worked.
101972af6995Smrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
102072af6995Smrg	  lt_cv_apple_cc_single_mod=yes
102172af6995Smrg	else
102272af6995Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
102372af6995Smrg	fi
102472af6995Smrg	rm -rf libconftest.dylib*
102572af6995Smrg	rm -f conftest.*
102672af6995Smrg      fi])
102772af6995Smrg
102872af6995Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
102972af6995Smrg      [lt_cv_ld_exported_symbols_list],
103072af6995Smrg      [lt_cv_ld_exported_symbols_list=no
103172af6995Smrg      save_LDFLAGS=$LDFLAGS
103272af6995Smrg      echo "_main" > conftest.sym
103372af6995Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
103472af6995Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
103572af6995Smrg	[lt_cv_ld_exported_symbols_list=yes],
103672af6995Smrg	[lt_cv_ld_exported_symbols_list=no])
103772af6995Smrg	LDFLAGS=$save_LDFLAGS
103872af6995Smrg    ])
103972af6995Smrg
104072af6995Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
104172af6995Smrg      [lt_cv_ld_force_load=no
104272af6995Smrg      cat > conftest.c << _LT_EOF
104372af6995Smrgint forced_loaded() { return 2;}
104472af6995Smrg_LT_EOF
104572af6995Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
104672af6995Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1047a773ec55Smrg      echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1048a773ec55Smrg      $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
104972af6995Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
105072af6995Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
105172af6995Smrg      cat > conftest.c << _LT_EOF
105272af6995Smrgint main() { return 0;}
105372af6995Smrg_LT_EOF
105472af6995Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
105572af6995Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
105672af6995Smrg      _lt_result=$?
105772af6995Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
105872af6995Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
105972af6995Smrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
106072af6995Smrg	lt_cv_ld_force_load=yes
106172af6995Smrg      else
106272af6995Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
106372af6995Smrg      fi
106472af6995Smrg        rm -f conftest.err libconftest.a conftest conftest.c
106572af6995Smrg        rm -rf conftest.dSYM
106672af6995Smrg    ])
106772af6995Smrg    case $host_os in
106872af6995Smrg    rhapsody* | darwin1.[[012]])
106972af6995Smrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
107072af6995Smrg    darwin1.*)
107172af6995Smrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1072a773ec55Smrg    darwin*)
1073a773ec55Smrg      case $MACOSX_DEPLOYMENT_TARGET,$host in
1074a773ec55Smrg        10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
1075a773ec55Smrg          _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1076a773ec55Smrg        *)
1077a773ec55Smrg          _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
107872af6995Smrg      esac
107972af6995Smrg    ;;
108072af6995Smrg  esac
108172af6995Smrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
108272af6995Smrg      _lt_dar_single_mod='$single_module'
108372af6995Smrg    fi
108472af6995Smrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
108572af6995Smrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
108672af6995Smrg    else
108772af6995Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
108872af6995Smrg    fi
108972af6995Smrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
109072af6995Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
109172af6995Smrg    else
109272af6995Smrg      _lt_dsymutil=
109372af6995Smrg    fi
109472af6995Smrg    ;;
109572af6995Smrg  esac
109672af6995Smrg])
109772af6995Smrg
109872af6995Smrg
109972af6995Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
110072af6995Smrg# ---------------------------------
110172af6995Smrg# Checks for linker and compiler features on darwin
110272af6995Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
110372af6995Smrg[
110472af6995Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
110572af6995Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
110672af6995Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
110772af6995Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
110872af6995Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
110972af6995Smrg  if test yes = "$lt_cv_ld_force_load"; then
111072af6995Smrg    _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\"`'
111172af6995Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
111272af6995Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
111372af6995Smrg  else
111472af6995Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
111572af6995Smrg  fi
111672af6995Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
111772af6995Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
111872af6995Smrg  case $cc_basename in
111972af6995Smrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
112072af6995Smrg     *) _lt_dar_can_shared=$GCC ;;
112172af6995Smrg  esac
112272af6995Smrg  if test yes = "$_lt_dar_can_shared"; then
112372af6995Smrg    output_verbose_link_cmd=func_echo_all
112472af6995Smrg    _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"
112572af6995Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
1126a773ec55Smrg    _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"
1127a773ec55Smrg    _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"
112872af6995Smrg    m4_if([$1], [CXX],
112972af6995Smrg[   if test yes != "$lt_cv_apple_cc_single_mod"; then
113072af6995Smrg      _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"
1131a773ec55Smrg      _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"
113272af6995Smrg    fi
113372af6995Smrg],[])
113472af6995Smrg  else
113572af6995Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
113672af6995Smrg  fi
113772af6995Smrg])
113872af6995Smrg
113972af6995Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
114072af6995Smrg# ----------------------------------
114172af6995Smrg# Links a minimal program and checks the executable
114272af6995Smrg# for the system default hardcoded library path. In most cases,
114372af6995Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
114472af6995Smrg# the location of the communication and MPI libs are included too.
114572af6995Smrg# If we don't find anything, use the default library path according
114672af6995Smrg# to the aix ld manual.
114772af6995Smrg# Store the results from the different compilers for each TAGNAME.
114872af6995Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
114972af6995Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
115072af6995Smrg[m4_require([_LT_DECL_SED])dnl
115172af6995Smrgif test set = "${lt_cv_aix_libpath+set}"; then
115272af6995Smrg  aix_libpath=$lt_cv_aix_libpath
115372af6995Smrgelse
115472af6995Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
115572af6995Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
115672af6995Smrg  lt_aix_libpath_sed='[
115772af6995Smrg      /Import File Strings/,/^$/ {
115872af6995Smrg	  /^0/ {
115972af6995Smrg	      s/^0  *\([^ ]*\) *$/\1/
116072af6995Smrg	      p
116172af6995Smrg	  }
116272af6995Smrg      }]'
116372af6995Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
116472af6995Smrg  # Check for a 64-bit object if we didn't find anything.
116572af6995Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
116672af6995Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
116772af6995Smrg  fi],[])
116872af6995Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
116972af6995Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
117072af6995Smrg  fi
117172af6995Smrg  ])
117272af6995Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
117372af6995Smrgfi
117472af6995Smrg])# _LT_SYS_MODULE_PATH_AIX
117572af6995Smrg
117672af6995Smrg
117772af6995Smrg# _LT_SHELL_INIT(ARG)
117872af6995Smrg# -------------------
117972af6995Smrgm4_define([_LT_SHELL_INIT],
118072af6995Smrg[m4_divert_text([M4SH-INIT], [$1
118172af6995Smrg])])# _LT_SHELL_INIT
118272af6995Smrg
118372af6995Smrg
118472af6995Smrg
118572af6995Smrg# _LT_PROG_ECHO_BACKSLASH
118672af6995Smrg# -----------------------
118772af6995Smrg# Find how we can fake an echo command that does not interpret backslash.
118872af6995Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
118972af6995Smrg# of the generated configure script that will find a shell with a builtin
119072af6995Smrg# printf (that we can use as an echo command).
119172af6995Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
119272af6995Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
119372af6995SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
119472af6995SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
119572af6995Smrg
119672af6995SmrgAC_MSG_CHECKING([how to print strings])
119772af6995Smrg# Test print first, because it will be a builtin if present.
119872af6995Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
119972af6995Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
120072af6995Smrg  ECHO='print -r --'
120172af6995Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
120272af6995Smrg  ECHO='printf %s\n'
120372af6995Smrgelse
120472af6995Smrg  # Use this function as a fallback that always works.
120572af6995Smrg  func_fallback_echo ()
120672af6995Smrg  {
120772af6995Smrg    eval 'cat <<_LTECHO_EOF
120872af6995Smrg$[]1
120972af6995Smrg_LTECHO_EOF'
121072af6995Smrg  }
121172af6995Smrg  ECHO='func_fallback_echo'
121272af6995Smrgfi
121372af6995Smrg
121472af6995Smrg# func_echo_all arg...
121572af6995Smrg# Invoke $ECHO with all args, space-separated.
121672af6995Smrgfunc_echo_all ()
121772af6995Smrg{
121872af6995Smrg    $ECHO "$*"
121972af6995Smrg}
122072af6995Smrg
122172af6995Smrgcase $ECHO in
122272af6995Smrg  printf*) AC_MSG_RESULT([printf]) ;;
122372af6995Smrg  print*) AC_MSG_RESULT([print -r]) ;;
122472af6995Smrg  *) AC_MSG_RESULT([cat]) ;;
122572af6995Smrgesac
122672af6995Smrg
122772af6995Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
122872af6995Smrg[_AS_DETECT_SUGGESTED([
122972af6995Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
123072af6995Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
123172af6995Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
123272af6995Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
123372af6995Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
123472af6995Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
123572af6995Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
123672af6995Smrg
123772af6995Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
123872af6995Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
123972af6995Smrg])# _LT_PROG_ECHO_BACKSLASH
124072af6995Smrg
124172af6995Smrg
124272af6995Smrg# _LT_WITH_SYSROOT
124372af6995Smrg# ----------------
124472af6995SmrgAC_DEFUN([_LT_WITH_SYSROOT],
1245a773ec55Smrg[m4_require([_LT_DECL_SED])dnl
1246a773ec55SmrgAC_MSG_CHECKING([for sysroot])
124772af6995SmrgAC_ARG_WITH([sysroot],
124872af6995Smrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
124972af6995Smrg  [Search for dependent libraries within DIR (or the compiler's sysroot
125072af6995Smrg   if not specified).])],
125172af6995Smrg[], [with_sysroot=no])
125272af6995Smrg
125372af6995Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
125472af6995Smrgdnl in case the user passed a directory name.
125572af6995Smrglt_sysroot=
125672af6995Smrgcase $with_sysroot in #(
125772af6995Smrg yes)
125872af6995Smrg   if test yes = "$GCC"; then
125972af6995Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
126072af6995Smrg   fi
126172af6995Smrg   ;; #(
126272af6995Smrg /*)
1263a773ec55Smrg   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
126472af6995Smrg   ;; #(
126572af6995Smrg no|'')
126672af6995Smrg   ;; #(
126772af6995Smrg *)
126872af6995Smrg   AC_MSG_RESULT([$with_sysroot])
126972af6995Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
127072af6995Smrg   ;;
127172af6995Smrgesac
127272af6995Smrg
127372af6995Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
127472af6995Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
127572af6995Smrg[dependent libraries, and where our libraries should be installed.])])
127672af6995Smrg
127772af6995Smrg# _LT_ENABLE_LOCK
127872af6995Smrg# ---------------
127972af6995Smrgm4_defun([_LT_ENABLE_LOCK],
128072af6995Smrg[AC_ARG_ENABLE([libtool-lock],
128172af6995Smrg  [AS_HELP_STRING([--disable-libtool-lock],
128272af6995Smrg    [avoid locking (might break parallel builds)])])
128372af6995Smrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
128472af6995Smrg
128572af6995Smrg# Some flags need to be propagated to the compiler or linker for good
128672af6995Smrg# libtool support.
128772af6995Smrgcase $host in
128872af6995Smrgia64-*-hpux*)
128972af6995Smrg  # Find out what ABI is being produced by ac_compile, and set mode
129072af6995Smrg  # options accordingly.
129172af6995Smrg  echo 'int i;' > conftest.$ac_ext
129272af6995Smrg  if AC_TRY_EVAL(ac_compile); then
1293a773ec55Smrg    case `$FILECMD conftest.$ac_objext` in
129472af6995Smrg      *ELF-32*)
129572af6995Smrg	HPUX_IA64_MODE=32
129672af6995Smrg	;;
129772af6995Smrg      *ELF-64*)
129872af6995Smrg	HPUX_IA64_MODE=64
129972af6995Smrg	;;
130072af6995Smrg    esac
130172af6995Smrg  fi
130272af6995Smrg  rm -rf conftest*
130372af6995Smrg  ;;
130472af6995Smrg*-*-irix6*)
130572af6995Smrg  # Find out what ABI is being produced by ac_compile, and set linker
130672af6995Smrg  # options accordingly.
130772af6995Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
130872af6995Smrg  if AC_TRY_EVAL(ac_compile); then
130972af6995Smrg    if test yes = "$lt_cv_prog_gnu_ld"; then
1310a773ec55Smrg      case `$FILECMD conftest.$ac_objext` in
131172af6995Smrg	*32-bit*)
131272af6995Smrg	  LD="${LD-ld} -melf32bsmip"
131372af6995Smrg	  ;;
131472af6995Smrg	*N32*)
131572af6995Smrg	  LD="${LD-ld} -melf32bmipn32"
131672af6995Smrg	  ;;
131772af6995Smrg	*64-bit*)
131872af6995Smrg	  LD="${LD-ld} -melf64bmip"
131972af6995Smrg	;;
132072af6995Smrg      esac
132172af6995Smrg    else
1322a773ec55Smrg      case `$FILECMD conftest.$ac_objext` in
132372af6995Smrg	*32-bit*)
132472af6995Smrg	  LD="${LD-ld} -32"
132572af6995Smrg	  ;;
132672af6995Smrg	*N32*)
132772af6995Smrg	  LD="${LD-ld} -n32"
132872af6995Smrg	  ;;
132972af6995Smrg	*64-bit*)
133072af6995Smrg	  LD="${LD-ld} -64"
133172af6995Smrg	  ;;
133272af6995Smrg      esac
133372af6995Smrg    fi
133472af6995Smrg  fi
133572af6995Smrg  rm -rf conftest*
133672af6995Smrg  ;;
133772af6995Smrg
133872af6995Smrgmips64*-*linux*)
133972af6995Smrg  # Find out what ABI is being produced by ac_compile, and set linker
134072af6995Smrg  # options accordingly.
134172af6995Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
134272af6995Smrg  if AC_TRY_EVAL(ac_compile); then
134372af6995Smrg    emul=elf
1344a773ec55Smrg    case `$FILECMD conftest.$ac_objext` in
134572af6995Smrg      *32-bit*)
134672af6995Smrg	emul="${emul}32"
134772af6995Smrg	;;
134872af6995Smrg      *64-bit*)
134972af6995Smrg	emul="${emul}64"
135072af6995Smrg	;;
135172af6995Smrg    esac
1352a773ec55Smrg    case `$FILECMD conftest.$ac_objext` in
135372af6995Smrg      *MSB*)
135472af6995Smrg	emul="${emul}btsmip"
135572af6995Smrg	;;
135672af6995Smrg      *LSB*)
135772af6995Smrg	emul="${emul}ltsmip"
135872af6995Smrg	;;
135972af6995Smrg    esac
1360a773ec55Smrg    case `$FILECMD conftest.$ac_objext` in
136172af6995Smrg      *N32*)
136272af6995Smrg	emul="${emul}n32"
136372af6995Smrg	;;
136472af6995Smrg    esac
136572af6995Smrg    LD="${LD-ld} -m $emul"
136672af6995Smrg  fi
136772af6995Smrg  rm -rf conftest*
136872af6995Smrg  ;;
136972af6995Smrg
137072af6995Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
137172af6995Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
137272af6995Smrg  # Find out what ABI is being produced by ac_compile, and set linker
137372af6995Smrg  # options accordingly.  Note that the listed cases only cover the
137472af6995Smrg  # situations where additional linker options are needed (such as when
137572af6995Smrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
137672af6995Smrg  # vice versa); the common cases where no linker options are needed do
137772af6995Smrg  # not appear in the list.
137872af6995Smrg  echo 'int i;' > conftest.$ac_ext
137972af6995Smrg  if AC_TRY_EVAL(ac_compile); then
1380a773ec55Smrg    case `$FILECMD conftest.o` in
138172af6995Smrg      *32-bit*)
138272af6995Smrg	case $host in
138372af6995Smrg	  x86_64-*kfreebsd*-gnu)
138472af6995Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
138572af6995Smrg	    ;;
138672af6995Smrg	  x86_64-*linux*)
1387a773ec55Smrg	    case `$FILECMD conftest.o` in
138872af6995Smrg	      *x86-64*)
138972af6995Smrg		LD="${LD-ld} -m elf32_x86_64"
139072af6995Smrg		;;
139172af6995Smrg	      *)
139272af6995Smrg		LD="${LD-ld} -m elf_i386"
139372af6995Smrg		;;
139472af6995Smrg	    esac
139572af6995Smrg	    ;;
139672af6995Smrg	  powerpc64le-*linux*)
139772af6995Smrg	    LD="${LD-ld} -m elf32lppclinux"
139872af6995Smrg	    ;;
139972af6995Smrg	  powerpc64-*linux*)
140072af6995Smrg	    LD="${LD-ld} -m elf32ppclinux"
140172af6995Smrg	    ;;
140272af6995Smrg	  s390x-*linux*)
140372af6995Smrg	    LD="${LD-ld} -m elf_s390"
140472af6995Smrg	    ;;
140572af6995Smrg	  sparc64-*linux*)
140672af6995Smrg	    LD="${LD-ld} -m elf32_sparc"
140772af6995Smrg	    ;;
140872af6995Smrg	esac
140972af6995Smrg	;;
141072af6995Smrg      *64-bit*)
141172af6995Smrg	case $host in
141272af6995Smrg	  x86_64-*kfreebsd*-gnu)
141372af6995Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
141472af6995Smrg	    ;;
141572af6995Smrg	  x86_64-*linux*)
141672af6995Smrg	    LD="${LD-ld} -m elf_x86_64"
141772af6995Smrg	    ;;
1418a773ec55Smrg	  powerpcle-*linux*)
141972af6995Smrg	    LD="${LD-ld} -m elf64lppc"
142072af6995Smrg	    ;;
1421a773ec55Smrg	  powerpc-*linux*)
142272af6995Smrg	    LD="${LD-ld} -m elf64ppc"
142372af6995Smrg	    ;;
142472af6995Smrg	  s390*-*linux*|s390*-*tpf*)
142572af6995Smrg	    LD="${LD-ld} -m elf64_s390"
142672af6995Smrg	    ;;
142772af6995Smrg	  sparc*-*linux*)
142872af6995Smrg	    LD="${LD-ld} -m elf64_sparc"
142972af6995Smrg	    ;;
143072af6995Smrg	esac
143172af6995Smrg	;;
143272af6995Smrg    esac
143372af6995Smrg  fi
143472af6995Smrg  rm -rf conftest*
143572af6995Smrg  ;;
143672af6995Smrg
143772af6995Smrg*-*-sco3.2v5*)
143872af6995Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
143972af6995Smrg  SAVE_CFLAGS=$CFLAGS
144072af6995Smrg  CFLAGS="$CFLAGS -belf"
144172af6995Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
144272af6995Smrg    [AC_LANG_PUSH(C)
144372af6995Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
144472af6995Smrg     AC_LANG_POP])
144572af6995Smrg  if test yes != "$lt_cv_cc_needs_belf"; then
144672af6995Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
144772af6995Smrg    CFLAGS=$SAVE_CFLAGS
144872af6995Smrg  fi
144972af6995Smrg  ;;
145072af6995Smrg*-*solaris*)
145172af6995Smrg  # Find out what ABI is being produced by ac_compile, and set linker
145272af6995Smrg  # options accordingly.
145372af6995Smrg  echo 'int i;' > conftest.$ac_ext
145472af6995Smrg  if AC_TRY_EVAL(ac_compile); then
1455a773ec55Smrg    case `$FILECMD conftest.o` in
145672af6995Smrg    *64-bit*)
145772af6995Smrg      case $lt_cv_prog_gnu_ld in
145872af6995Smrg      yes*)
145972af6995Smrg        case $host in
146072af6995Smrg        i?86-*-solaris*|x86_64-*-solaris*)
146172af6995Smrg          LD="${LD-ld} -m elf_x86_64"
146272af6995Smrg          ;;
146372af6995Smrg        sparc*-*-solaris*)
146472af6995Smrg          LD="${LD-ld} -m elf64_sparc"
146572af6995Smrg          ;;
146672af6995Smrg        esac
146772af6995Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
146872af6995Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
146972af6995Smrg          LD=${LD-ld}_sol2
147072af6995Smrg        fi
147172af6995Smrg        ;;
147272af6995Smrg      *)
147372af6995Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
147472af6995Smrg	  LD="${LD-ld} -64"
147572af6995Smrg	fi
147672af6995Smrg	;;
147772af6995Smrg      esac
147872af6995Smrg      ;;
147972af6995Smrg    esac
148072af6995Smrg  fi
148172af6995Smrg  rm -rf conftest*
148272af6995Smrg  ;;
148372af6995Smrgesac
148472af6995Smrg
148572af6995Smrgneed_locks=$enable_libtool_lock
148672af6995Smrg])# _LT_ENABLE_LOCK
148772af6995Smrg
148872af6995Smrg
148972af6995Smrg# _LT_PROG_AR
149072af6995Smrg# -----------
149172af6995Smrgm4_defun([_LT_PROG_AR],
149272af6995Smrg[AC_CHECK_TOOLS(AR, [ar], false)
149372af6995Smrg: ${AR=ar}
149472af6995Smrg_LT_DECL([], [AR], [1], [The archiver])
1495a773ec55Smrg
1496a773ec55Smrg# Use ARFLAGS variable as AR's operation code to sync the variable naming with
1497a773ec55Smrg# Automake.  If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
1498a773ec55Smrg# higher priority because thats what people were doing historically (setting
1499a773ec55Smrg# ARFLAGS for automake and AR_FLAGS for libtool).  FIXME: Make the AR_FLAGS
1500a773ec55Smrg# variable obsoleted/removed.
1501a773ec55Smrg
1502a773ec55Smrgtest ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
1503a773ec55Smrglt_ar_flags=$AR_FLAGS
1504a773ec55Smrg_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
1505a773ec55Smrg
1506a773ec55Smrg# Make AR_FLAGS overridable by 'make ARFLAGS='.  Don't try to run-time override
1507a773ec55Smrg# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
1508a773ec55Smrg_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
1509a773ec55Smrg         [Flags to create an archive])
151072af6995Smrg
151172af6995SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
151272af6995Smrg  [lt_cv_ar_at_file=no
151372af6995Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
151472af6995Smrg     [echo conftest.$ac_objext > conftest.lst
151572af6995Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
151672af6995Smrg      AC_TRY_EVAL([lt_ar_try])
151772af6995Smrg      if test 0 -eq "$ac_status"; then
151872af6995Smrg	# Ensure the archiver fails upon bogus file names.
151972af6995Smrg	rm -f conftest.$ac_objext libconftest.a
152072af6995Smrg	AC_TRY_EVAL([lt_ar_try])
152172af6995Smrg	if test 0 -ne "$ac_status"; then
152272af6995Smrg          lt_cv_ar_at_file=@
152372af6995Smrg        fi
152472af6995Smrg      fi
152572af6995Smrg      rm -f conftest.* libconftest.a
152672af6995Smrg     ])
152772af6995Smrg  ])
152872af6995Smrg
152972af6995Smrgif test no = "$lt_cv_ar_at_file"; then
153072af6995Smrg  archiver_list_spec=
153172af6995Smrgelse
153272af6995Smrg  archiver_list_spec=$lt_cv_ar_at_file
153372af6995Smrgfi
153472af6995Smrg_LT_DECL([], [archiver_list_spec], [1],
153572af6995Smrg  [How to feed a file listing to the archiver])
153672af6995Smrg])# _LT_PROG_AR
153772af6995Smrg
153872af6995Smrg
153972af6995Smrg# _LT_CMD_OLD_ARCHIVE
154072af6995Smrg# -------------------
154172af6995Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
154272af6995Smrg[_LT_PROG_AR
154372af6995Smrg
154472af6995SmrgAC_CHECK_TOOL(STRIP, strip, :)
154572af6995Smrgtest -z "$STRIP" && STRIP=:
154672af6995Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
154772af6995Smrg
154872af6995SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
154972af6995Smrgtest -z "$RANLIB" && RANLIB=:
155072af6995Smrg_LT_DECL([], [RANLIB], [1],
155172af6995Smrg    [Commands used to install an old-style archive])
155272af6995Smrg
155372af6995Smrg# Determine commands to create old-style static archives.
155472af6995Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
155572af6995Smrgold_postinstall_cmds='chmod 644 $oldlib'
155672af6995Smrgold_postuninstall_cmds=
155772af6995Smrg
155872af6995Smrgif test -n "$RANLIB"; then
155972af6995Smrg  case $host_os in
156072af6995Smrg  bitrig* | openbsd*)
156172af6995Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
156272af6995Smrg    ;;
156372af6995Smrg  *)
156472af6995Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
156572af6995Smrg    ;;
156672af6995Smrg  esac
156772af6995Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
156872af6995Smrgfi
156972af6995Smrg
157072af6995Smrgcase $host_os in
157172af6995Smrg  darwin*)
157272af6995Smrg    lock_old_archive_extraction=yes ;;
157372af6995Smrg  *)
157472af6995Smrg    lock_old_archive_extraction=no ;;
157572af6995Smrgesac
157672af6995Smrg_LT_DECL([], [old_postinstall_cmds], [2])
157772af6995Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
157872af6995Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
157972af6995Smrg    [Commands used to build an old-style archive])
158072af6995Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
158172af6995Smrg    [Whether to use a lock for old archive extraction])
158272af6995Smrg])# _LT_CMD_OLD_ARCHIVE
158372af6995Smrg
158472af6995Smrg
158572af6995Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
158672af6995Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
158772af6995Smrg# ----------------------------------------------------------------
158872af6995Smrg# Check whether the given compiler option works
158972af6995SmrgAC_DEFUN([_LT_COMPILER_OPTION],
159072af6995Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
159172af6995Smrgm4_require([_LT_DECL_SED])dnl
159272af6995SmrgAC_CACHE_CHECK([$1], [$2],
159372af6995Smrg  [$2=no
159472af6995Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
159572af6995Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
159672af6995Smrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
159772af6995Smrg   # Insert the option either (1) after the last *FLAGS variable, or
159872af6995Smrg   # (2) before a word containing "conftest.", or (3) at the end.
159972af6995Smrg   # Note that $ac_compile itself does not contain backslashes and begins
160072af6995Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
160172af6995Smrg   # The option is referenced via a variable to avoid confusing sed.
160272af6995Smrg   lt_compile=`echo "$ac_compile" | $SED \
160372af6995Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
160472af6995Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
160572af6995Smrg   -e 's:$: $lt_compiler_flag:'`
160672af6995Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
160772af6995Smrg   (eval "$lt_compile" 2>conftest.err)
160872af6995Smrg   ac_status=$?
160972af6995Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
161072af6995Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
161172af6995Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
161272af6995Smrg     # The compiler can only warn and ignore the option if not recognized
161372af6995Smrg     # So say no if there are warnings other than the usual output.
161472af6995Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
161572af6995Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
161672af6995Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
161772af6995Smrg       $2=yes
161872af6995Smrg     fi
161972af6995Smrg   fi
162072af6995Smrg   $RM conftest*
162172af6995Smrg])
162272af6995Smrg
162372af6995Smrgif test yes = "[$]$2"; then
162472af6995Smrg    m4_if([$5], , :, [$5])
162572af6995Smrgelse
162672af6995Smrg    m4_if([$6], , :, [$6])
162772af6995Smrgfi
162872af6995Smrg])# _LT_COMPILER_OPTION
162972af6995Smrg
163072af6995Smrg# Old name:
163172af6995SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
163272af6995Smrgdnl aclocal-1.4 backwards compatibility:
163372af6995Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
163472af6995Smrg
163572af6995Smrg
163672af6995Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
163772af6995Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
163872af6995Smrg# ----------------------------------------------------
163972af6995Smrg# Check whether the given linker option works
164072af6995SmrgAC_DEFUN([_LT_LINKER_OPTION],
164172af6995Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
164272af6995Smrgm4_require([_LT_DECL_SED])dnl
164372af6995SmrgAC_CACHE_CHECK([$1], [$2],
164472af6995Smrg  [$2=no
164572af6995Smrg   save_LDFLAGS=$LDFLAGS
164672af6995Smrg   LDFLAGS="$LDFLAGS $3"
164772af6995Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
164872af6995Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
164972af6995Smrg     # The linker can only warn and ignore the option if not recognized
165072af6995Smrg     # So say no if there are warnings
165172af6995Smrg     if test -s conftest.err; then
165272af6995Smrg       # Append any errors to the config.log.
165372af6995Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
165472af6995Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
165572af6995Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
165672af6995Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
165772af6995Smrg         $2=yes
165872af6995Smrg       fi
165972af6995Smrg     else
166072af6995Smrg       $2=yes
166172af6995Smrg     fi
166272af6995Smrg   fi
166372af6995Smrg   $RM -r conftest*
166472af6995Smrg   LDFLAGS=$save_LDFLAGS
166572af6995Smrg])
166672af6995Smrg
166772af6995Smrgif test yes = "[$]$2"; then
166872af6995Smrg    m4_if([$4], , :, [$4])
166972af6995Smrgelse
167072af6995Smrg    m4_if([$5], , :, [$5])
167172af6995Smrgfi
167272af6995Smrg])# _LT_LINKER_OPTION
167372af6995Smrg
167472af6995Smrg# Old name:
167572af6995SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
167672af6995Smrgdnl aclocal-1.4 backwards compatibility:
167772af6995Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
167872af6995Smrg
167972af6995Smrg
168072af6995Smrg# LT_CMD_MAX_LEN
168172af6995Smrg#---------------
168272af6995SmrgAC_DEFUN([LT_CMD_MAX_LEN],
168372af6995Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
168472af6995Smrg# find the maximum length of command line arguments
168572af6995SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
168672af6995SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
168772af6995Smrg  i=0
168872af6995Smrg  teststring=ABCD
168972af6995Smrg
169072af6995Smrg  case $build_os in
169172af6995Smrg  msdosdjgpp*)
169272af6995Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
169372af6995Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
169472af6995Smrg    # during glob expansion).  Even if it were fixed, the result of this
169572af6995Smrg    # check would be larger than it should be.
169672af6995Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
169772af6995Smrg    ;;
169872af6995Smrg
169972af6995Smrg  gnu*)
170072af6995Smrg    # Under GNU Hurd, this test is not required because there is
170172af6995Smrg    # no limit to the length of command line arguments.
170272af6995Smrg    # Libtool will interpret -1 as no limit whatsoever
170372af6995Smrg    lt_cv_sys_max_cmd_len=-1;
170472af6995Smrg    ;;
170572af6995Smrg
170672af6995Smrg  cygwin* | mingw* | cegcc*)
170772af6995Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
170872af6995Smrg    # about 5 minutes as the teststring grows exponentially.
170972af6995Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
171072af6995Smrg    # you end up with a "frozen" computer, even though with patience
171172af6995Smrg    # the test eventually succeeds (with a max line length of 256k).
171272af6995Smrg    # Instead, let's just punt: use the minimum linelength reported by
171372af6995Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
171472af6995Smrg    lt_cv_sys_max_cmd_len=8192;
171572af6995Smrg    ;;
171672af6995Smrg
171772af6995Smrg  mint*)
171872af6995Smrg    # On MiNT this can take a long time and run out of memory.
171972af6995Smrg    lt_cv_sys_max_cmd_len=8192;
172072af6995Smrg    ;;
172172af6995Smrg
172272af6995Smrg  amigaos*)
172372af6995Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
172472af6995Smrg    # So we just punt and use a minimum line length of 8192.
172572af6995Smrg    lt_cv_sys_max_cmd_len=8192;
172672af6995Smrg    ;;
172772af6995Smrg
1728a773ec55Smrg  bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
172972af6995Smrg    # This has been around since 386BSD, at least.  Likely further.
173072af6995Smrg    if test -x /sbin/sysctl; then
173172af6995Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
173272af6995Smrg    elif test -x /usr/sbin/sysctl; then
173372af6995Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
173472af6995Smrg    else
173572af6995Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
173672af6995Smrg    fi
173772af6995Smrg    # And add a safety zone
173872af6995Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
173972af6995Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
174072af6995Smrg    ;;
174172af6995Smrg
174272af6995Smrg  interix*)
174372af6995Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
174472af6995Smrg    lt_cv_sys_max_cmd_len=196608
174572af6995Smrg    ;;
174672af6995Smrg
174772af6995Smrg  os2*)
174872af6995Smrg    # The test takes a long time on OS/2.
174972af6995Smrg    lt_cv_sys_max_cmd_len=8192
175072af6995Smrg    ;;
175172af6995Smrg
175272af6995Smrg  osf*)
175372af6995Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
175472af6995Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
175572af6995Smrg    # nice to cause kernel panics so lets avoid the loop below.
175672af6995Smrg    # First set a reasonable default.
175772af6995Smrg    lt_cv_sys_max_cmd_len=16384
175872af6995Smrg    #
175972af6995Smrg    if test -x /sbin/sysconfig; then
176072af6995Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
176172af6995Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
176272af6995Smrg      esac
176372af6995Smrg    fi
176472af6995Smrg    ;;
176572af6995Smrg  sco3.2v5*)
176672af6995Smrg    lt_cv_sys_max_cmd_len=102400
176772af6995Smrg    ;;
176872af6995Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
176972af6995Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
177072af6995Smrg    if test -n "$kargmax"; then
1771a773ec55Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[	 ]]//'`
177272af6995Smrg    else
177372af6995Smrg      lt_cv_sys_max_cmd_len=32768
177472af6995Smrg    fi
177572af6995Smrg    ;;
177672af6995Smrg  *)
177772af6995Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
177872af6995Smrg    if test -n "$lt_cv_sys_max_cmd_len" && \
177972af6995Smrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
178072af6995Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
178172af6995Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
178272af6995Smrg    else
178372af6995Smrg      # Make teststring a little bigger before we do anything with it.
178472af6995Smrg      # a 1K string should be a reasonable start.
178572af6995Smrg      for i in 1 2 3 4 5 6 7 8; do
178672af6995Smrg        teststring=$teststring$teststring
178772af6995Smrg      done
178872af6995Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
178972af6995Smrg      # If test is not a shell built-in, we'll probably end up computing a
179072af6995Smrg      # maximum length that is only half of the actual maximum length, but
179172af6995Smrg      # we can't tell.
179272af6995Smrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
179372af6995Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
179472af6995Smrg	      test 17 != "$i" # 1/2 MB should be enough
179572af6995Smrg      do
179672af6995Smrg        i=`expr $i + 1`
179772af6995Smrg        teststring=$teststring$teststring
179872af6995Smrg      done
179972af6995Smrg      # Only check the string length outside the loop.
180072af6995Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
180172af6995Smrg      teststring=
180272af6995Smrg      # Add a significant safety factor because C++ compilers can tack on
180372af6995Smrg      # massive amounts of additional arguments before passing them to the
180472af6995Smrg      # linker.  It appears as though 1/2 is a usable value.
180572af6995Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
180672af6995Smrg    fi
180772af6995Smrg    ;;
180872af6995Smrg  esac
180972af6995Smrg])
181072af6995Smrgif test -n "$lt_cv_sys_max_cmd_len"; then
181172af6995Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
181272af6995Smrgelse
181372af6995Smrg  AC_MSG_RESULT(none)
181472af6995Smrgfi
181572af6995Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
181672af6995Smrg_LT_DECL([], [max_cmd_len], [0],
181772af6995Smrg    [What is the maximum length of a command?])
181872af6995Smrg])# LT_CMD_MAX_LEN
181972af6995Smrg
182072af6995Smrg# Old name:
182172af6995SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
182272af6995Smrgdnl aclocal-1.4 backwards compatibility:
182372af6995Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
182472af6995Smrg
182572af6995Smrg
182672af6995Smrg# _LT_HEADER_DLFCN
182772af6995Smrg# ----------------
182872af6995Smrgm4_defun([_LT_HEADER_DLFCN],
182972af6995Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
183072af6995Smrg])# _LT_HEADER_DLFCN
183172af6995Smrg
183272af6995Smrg
183372af6995Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
183472af6995Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
183572af6995Smrg# ----------------------------------------------------------------
183672af6995Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
183772af6995Smrg[m4_require([_LT_HEADER_DLFCN])dnl
183872af6995Smrgif test yes = "$cross_compiling"; then :
183972af6995Smrg  [$4]
184072af6995Smrgelse
184172af6995Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
184272af6995Smrg  lt_status=$lt_dlunknown
184372af6995Smrg  cat > conftest.$ac_ext <<_LT_EOF
184472af6995Smrg[#line $LINENO "configure"
184572af6995Smrg#include "confdefs.h"
184672af6995Smrg
184772af6995Smrg#if HAVE_DLFCN_H
184872af6995Smrg#include <dlfcn.h>
184972af6995Smrg#endif
185072af6995Smrg
185172af6995Smrg#include <stdio.h>
185272af6995Smrg
185372af6995Smrg#ifdef RTLD_GLOBAL
185472af6995Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
185572af6995Smrg#else
185672af6995Smrg#  ifdef DL_GLOBAL
185772af6995Smrg#    define LT_DLGLOBAL		DL_GLOBAL
185872af6995Smrg#  else
185972af6995Smrg#    define LT_DLGLOBAL		0
186072af6995Smrg#  endif
186172af6995Smrg#endif
186272af6995Smrg
186372af6995Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
186472af6995Smrg   find out it does not work in some platform. */
186572af6995Smrg#ifndef LT_DLLAZY_OR_NOW
186672af6995Smrg#  ifdef RTLD_LAZY
186772af6995Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
186872af6995Smrg#  else
186972af6995Smrg#    ifdef DL_LAZY
187072af6995Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
187172af6995Smrg#    else
187272af6995Smrg#      ifdef RTLD_NOW
187372af6995Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
187472af6995Smrg#      else
187572af6995Smrg#        ifdef DL_NOW
187672af6995Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
187772af6995Smrg#        else
187872af6995Smrg#          define LT_DLLAZY_OR_NOW	0
187972af6995Smrg#        endif
188072af6995Smrg#      endif
188172af6995Smrg#    endif
188272af6995Smrg#  endif
188372af6995Smrg#endif
188472af6995Smrg
188572af6995Smrg/* When -fvisibility=hidden is used, assume the code has been annotated
188672af6995Smrg   correspondingly for the symbols needed.  */
188772af6995Smrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
188872af6995Smrgint fnord () __attribute__((visibility("default")));
188972af6995Smrg#endif
189072af6995Smrg
189172af6995Smrgint fnord () { return 42; }
189272af6995Smrgint main ()
189372af6995Smrg{
189472af6995Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
189572af6995Smrg  int status = $lt_dlunknown;
189672af6995Smrg
189772af6995Smrg  if (self)
189872af6995Smrg    {
189972af6995Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
190072af6995Smrg      else
190172af6995Smrg        {
190272af6995Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
190372af6995Smrg          else puts (dlerror ());
190472af6995Smrg	}
190572af6995Smrg      /* dlclose (self); */
190672af6995Smrg    }
190772af6995Smrg  else
190872af6995Smrg    puts (dlerror ());
190972af6995Smrg
191072af6995Smrg  return status;
191172af6995Smrg}]
191272af6995Smrg_LT_EOF
191372af6995Smrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
191472af6995Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
191572af6995Smrg    lt_status=$?
191672af6995Smrg    case x$lt_status in
191772af6995Smrg      x$lt_dlno_uscore) $1 ;;
191872af6995Smrg      x$lt_dlneed_uscore) $2 ;;
191972af6995Smrg      x$lt_dlunknown|x*) $3 ;;
192072af6995Smrg    esac
192172af6995Smrg  else :
192272af6995Smrg    # compilation failed
192372af6995Smrg    $3
192472af6995Smrg  fi
192572af6995Smrgfi
192672af6995Smrgrm -fr conftest*
192772af6995Smrg])# _LT_TRY_DLOPEN_SELF
192872af6995Smrg
192972af6995Smrg
193072af6995Smrg# LT_SYS_DLOPEN_SELF
193172af6995Smrg# ------------------
193272af6995SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
193372af6995Smrg[m4_require([_LT_HEADER_DLFCN])dnl
193472af6995Smrgif test yes != "$enable_dlopen"; then
193572af6995Smrg  enable_dlopen=unknown
193672af6995Smrg  enable_dlopen_self=unknown
193772af6995Smrg  enable_dlopen_self_static=unknown
193872af6995Smrgelse
193972af6995Smrg  lt_cv_dlopen=no
194072af6995Smrg  lt_cv_dlopen_libs=
194172af6995Smrg
194272af6995Smrg  case $host_os in
194372af6995Smrg  beos*)
194472af6995Smrg    lt_cv_dlopen=load_add_on
194572af6995Smrg    lt_cv_dlopen_libs=
194672af6995Smrg    lt_cv_dlopen_self=yes
194772af6995Smrg    ;;
194872af6995Smrg
194972af6995Smrg  mingw* | pw32* | cegcc*)
195072af6995Smrg    lt_cv_dlopen=LoadLibrary
195172af6995Smrg    lt_cv_dlopen_libs=
195272af6995Smrg    ;;
195372af6995Smrg
195472af6995Smrg  cygwin*)
195572af6995Smrg    lt_cv_dlopen=dlopen
195672af6995Smrg    lt_cv_dlopen_libs=
195772af6995Smrg    ;;
195872af6995Smrg
195972af6995Smrg  darwin*)
196072af6995Smrg    # if libdl is installed we need to link against it
196172af6995Smrg    AC_CHECK_LIB([dl], [dlopen],
196272af6995Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
196372af6995Smrg    lt_cv_dlopen=dyld
196472af6995Smrg    lt_cv_dlopen_libs=
196572af6995Smrg    lt_cv_dlopen_self=yes
196672af6995Smrg    ])
196772af6995Smrg    ;;
196872af6995Smrg
196972af6995Smrg  tpf*)
197072af6995Smrg    # Don't try to run any link tests for TPF.  We know it's impossible
197172af6995Smrg    # because TPF is a cross-compiler, and we know how we open DSOs.
197272af6995Smrg    lt_cv_dlopen=dlopen
197372af6995Smrg    lt_cv_dlopen_libs=
197472af6995Smrg    lt_cv_dlopen_self=no
197572af6995Smrg    ;;
197672af6995Smrg
197772af6995Smrg  *)
197872af6995Smrg    AC_CHECK_FUNC([shl_load],
197972af6995Smrg	  [lt_cv_dlopen=shl_load],
198072af6995Smrg      [AC_CHECK_LIB([dld], [shl_load],
198172af6995Smrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
198272af6995Smrg	[AC_CHECK_FUNC([dlopen],
198372af6995Smrg	      [lt_cv_dlopen=dlopen],
198472af6995Smrg	  [AC_CHECK_LIB([dl], [dlopen],
198572af6995Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
198672af6995Smrg	    [AC_CHECK_LIB([svld], [dlopen],
198772af6995Smrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
198872af6995Smrg	      [AC_CHECK_LIB([dld], [dld_link],
198972af6995Smrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
199072af6995Smrg	      ])
199172af6995Smrg	    ])
199272af6995Smrg	  ])
199372af6995Smrg	])
199472af6995Smrg      ])
199572af6995Smrg    ;;
199672af6995Smrg  esac
199772af6995Smrg
199872af6995Smrg  if test no = "$lt_cv_dlopen"; then
199972af6995Smrg    enable_dlopen=no
200072af6995Smrg  else
200172af6995Smrg    enable_dlopen=yes
200272af6995Smrg  fi
200372af6995Smrg
200472af6995Smrg  case $lt_cv_dlopen in
200572af6995Smrg  dlopen)
200672af6995Smrg    save_CPPFLAGS=$CPPFLAGS
200772af6995Smrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
200872af6995Smrg
200972af6995Smrg    save_LDFLAGS=$LDFLAGS
201072af6995Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
201172af6995Smrg
201272af6995Smrg    save_LIBS=$LIBS
201372af6995Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
201472af6995Smrg
201572af6995Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
201672af6995Smrg	  lt_cv_dlopen_self, [dnl
201772af6995Smrg	  _LT_TRY_DLOPEN_SELF(
201872af6995Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
201972af6995Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
202072af6995Smrg    ])
202172af6995Smrg
202272af6995Smrg    if test yes = "$lt_cv_dlopen_self"; then
202372af6995Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
202472af6995Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
202572af6995Smrg	  lt_cv_dlopen_self_static, [dnl
202672af6995Smrg	  _LT_TRY_DLOPEN_SELF(
202772af6995Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
202872af6995Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
202972af6995Smrg      ])
203072af6995Smrg    fi
203172af6995Smrg
203272af6995Smrg    CPPFLAGS=$save_CPPFLAGS
203372af6995Smrg    LDFLAGS=$save_LDFLAGS
203472af6995Smrg    LIBS=$save_LIBS
203572af6995Smrg    ;;
203672af6995Smrg  esac
203772af6995Smrg
203872af6995Smrg  case $lt_cv_dlopen_self in
203972af6995Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
204072af6995Smrg  *) enable_dlopen_self=unknown ;;
204172af6995Smrg  esac
204272af6995Smrg
204372af6995Smrg  case $lt_cv_dlopen_self_static in
204472af6995Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
204572af6995Smrg  *) enable_dlopen_self_static=unknown ;;
204672af6995Smrg  esac
204772af6995Smrgfi
204872af6995Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
204972af6995Smrg	 [Whether dlopen is supported])
205072af6995Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
205172af6995Smrg	 [Whether dlopen of programs is supported])
205272af6995Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
205372af6995Smrg	 [Whether dlopen of statically linked programs is supported])
205472af6995Smrg])# LT_SYS_DLOPEN_SELF
205572af6995Smrg
205672af6995Smrg# Old name:
205772af6995SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
205872af6995Smrgdnl aclocal-1.4 backwards compatibility:
205972af6995Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
206072af6995Smrg
206172af6995Smrg
206272af6995Smrg# _LT_COMPILER_C_O([TAGNAME])
206372af6995Smrg# ---------------------------
206472af6995Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
206572af6995Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
206672af6995Smrgm4_defun([_LT_COMPILER_C_O],
206772af6995Smrg[m4_require([_LT_DECL_SED])dnl
206872af6995Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
206972af6995Smrgm4_require([_LT_TAG_COMPILER])dnl
207072af6995SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
207172af6995Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
207272af6995Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
207372af6995Smrg   $RM -r conftest 2>/dev/null
207472af6995Smrg   mkdir conftest
207572af6995Smrg   cd conftest
207672af6995Smrg   mkdir out
207772af6995Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
207872af6995Smrg
207972af6995Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
208072af6995Smrg   # Insert the option either (1) after the last *FLAGS variable, or
208172af6995Smrg   # (2) before a word containing "conftest.", or (3) at the end.
208272af6995Smrg   # Note that $ac_compile itself does not contain backslashes and begins
208372af6995Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
208472af6995Smrg   lt_compile=`echo "$ac_compile" | $SED \
208572af6995Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
208672af6995Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
208772af6995Smrg   -e 's:$: $lt_compiler_flag:'`
208872af6995Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
208972af6995Smrg   (eval "$lt_compile" 2>out/conftest.err)
209072af6995Smrg   ac_status=$?
209172af6995Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
209272af6995Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
209372af6995Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
209472af6995Smrg   then
209572af6995Smrg     # The compiler can only warn and ignore the option if not recognized
209672af6995Smrg     # So say no if there are warnings
209772af6995Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
209872af6995Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
209972af6995Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
210072af6995Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
210172af6995Smrg     fi
210272af6995Smrg   fi
210372af6995Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
210472af6995Smrg   $RM conftest*
210572af6995Smrg   # SGI C++ compiler will create directory out/ii_files/ for
210672af6995Smrg   # template instantiation
210772af6995Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
210872af6995Smrg   $RM out/* && rmdir out
210972af6995Smrg   cd ..
211072af6995Smrg   $RM -r conftest
211172af6995Smrg   $RM conftest*
211272af6995Smrg])
211372af6995Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
211472af6995Smrg	[Does compiler simultaneously support -c and -o options?])
211572af6995Smrg])# _LT_COMPILER_C_O
211672af6995Smrg
211772af6995Smrg
211872af6995Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
211972af6995Smrg# ----------------------------------
212072af6995Smrg# Check to see if we can do hard links to lock some files if needed
212172af6995Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
212272af6995Smrg[m4_require([_LT_ENABLE_LOCK])dnl
212372af6995Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
212472af6995Smrg_LT_COMPILER_C_O([$1])
212572af6995Smrg
212672af6995Smrghard_links=nottested
212772af6995Smrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
212872af6995Smrg  # do not overwrite the value of need_locks provided by the user
212972af6995Smrg  AC_MSG_CHECKING([if we can lock with hard links])
213072af6995Smrg  hard_links=yes
213172af6995Smrg  $RM conftest*
213272af6995Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
213372af6995Smrg  touch conftest.a
213472af6995Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
213572af6995Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
213672af6995Smrg  AC_MSG_RESULT([$hard_links])
213772af6995Smrg  if test no = "$hard_links"; then
213872af6995Smrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
213972af6995Smrg    need_locks=warn
214072af6995Smrg  fi
214172af6995Smrgelse
214272af6995Smrg  need_locks=no
214372af6995Smrgfi
214472af6995Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
214572af6995Smrg])# _LT_COMPILER_FILE_LOCKS
214672af6995Smrg
214772af6995Smrg
214872af6995Smrg# _LT_CHECK_OBJDIR
214972af6995Smrg# ----------------
215072af6995Smrgm4_defun([_LT_CHECK_OBJDIR],
215172af6995Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
215272af6995Smrg[rm -f .libs 2>/dev/null
215372af6995Smrgmkdir .libs 2>/dev/null
215472af6995Smrgif test -d .libs; then
215572af6995Smrg  lt_cv_objdir=.libs
215672af6995Smrgelse
215772af6995Smrg  # MS-DOS does not allow filenames that begin with a dot.
215872af6995Smrg  lt_cv_objdir=_libs
215972af6995Smrgfi
216072af6995Smrgrmdir .libs 2>/dev/null])
216172af6995Smrgobjdir=$lt_cv_objdir
216272af6995Smrg_LT_DECL([], [objdir], [0],
216372af6995Smrg         [The name of the directory that contains temporary libtool files])dnl
216472af6995Smrgm4_pattern_allow([LT_OBJDIR])dnl
216572af6995SmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
216672af6995Smrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
216772af6995Smrg])# _LT_CHECK_OBJDIR
216872af6995Smrg
216972af6995Smrg
217072af6995Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
217172af6995Smrg# --------------------------------------
217272af6995Smrg# Check hardcoding attributes.
217372af6995Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
217472af6995Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
217572af6995Smrg_LT_TAGVAR(hardcode_action, $1)=
217672af6995Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
217772af6995Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
217872af6995Smrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
217972af6995Smrg
218072af6995Smrg  # We can hardcode non-existent directories.
218172af6995Smrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
218272af6995Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
218372af6995Smrg     # have to relink, otherwise we might link with an installed library
218472af6995Smrg     # when we should be linking with a yet-to-be-installed one
218572af6995Smrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
218672af6995Smrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
218772af6995Smrg    # Linking always hardcodes the temporary library directory.
218872af6995Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
218972af6995Smrg  else
219072af6995Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
219172af6995Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
219272af6995Smrg  fi
219372af6995Smrgelse
219472af6995Smrg  # We cannot hardcode anything, or else we can only hardcode existing
219572af6995Smrg  # directories.
219672af6995Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
219772af6995Smrgfi
219872af6995SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
219972af6995Smrg
220072af6995Smrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
220172af6995Smrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
220272af6995Smrg  # Fast installation is not supported
220372af6995Smrg  enable_fast_install=no
220472af6995Smrgelif test yes = "$shlibpath_overrides_runpath" ||
220572af6995Smrg     test no = "$enable_shared"; then
220672af6995Smrg  # Fast installation is not necessary
220772af6995Smrg  enable_fast_install=needless
220872af6995Smrgfi
220972af6995Smrg_LT_TAGDECL([], [hardcode_action], [0],
221072af6995Smrg    [How to hardcode a shared library path into an executable])
221172af6995Smrg])# _LT_LINKER_HARDCODE_LIBPATH
221272af6995Smrg
221372af6995Smrg
221472af6995Smrg# _LT_CMD_STRIPLIB
221572af6995Smrg# ----------------
221672af6995Smrgm4_defun([_LT_CMD_STRIPLIB],
221772af6995Smrg[m4_require([_LT_DECL_EGREP])
221872af6995Smrgstriplib=
221972af6995Smrgold_striplib=
222072af6995SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2221a773ec55Smrgif test -z "$STRIP"; then
2222a773ec55Smrg  AC_MSG_RESULT([no])
222372af6995Smrgelse
2224a773ec55Smrg  if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2225a773ec55Smrg    old_striplib="$STRIP --strip-debug"
2226a773ec55Smrg    striplib="$STRIP --strip-unneeded"
2227a773ec55Smrg    AC_MSG_RESULT([yes])
2228a773ec55Smrg  else
2229a773ec55Smrg    case $host_os in
2230a773ec55Smrg    darwin*)
2231a773ec55Smrg      # FIXME - insert some real tests, host_os isn't really good enough
223272af6995Smrg      striplib="$STRIP -x"
223372af6995Smrg      old_striplib="$STRIP -S"
223472af6995Smrg      AC_MSG_RESULT([yes])
2235a773ec55Smrg      ;;
2236a773ec55Smrg    freebsd*)
2237a773ec55Smrg      if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
2238a773ec55Smrg        old_striplib="$STRIP --strip-debug"
2239a773ec55Smrg        striplib="$STRIP --strip-unneeded"
2240a773ec55Smrg        AC_MSG_RESULT([yes])
2241a773ec55Smrg      else
2242a773ec55Smrg        AC_MSG_RESULT([no])
2243a773ec55Smrg      fi
2244a773ec55Smrg      ;;
2245a773ec55Smrg    *)
224672af6995Smrg      AC_MSG_RESULT([no])
2247a773ec55Smrg      ;;
2248a773ec55Smrg    esac
2249a773ec55Smrg  fi
225072af6995Smrgfi
225172af6995Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
225272af6995Smrg_LT_DECL([], [striplib], [1])
225372af6995Smrg])# _LT_CMD_STRIPLIB
225472af6995Smrg
225572af6995Smrg
225672af6995Smrg# _LT_PREPARE_MUNGE_PATH_LIST
225772af6995Smrg# ---------------------------
225872af6995Smrg# Make sure func_munge_path_list() is defined correctly.
225972af6995Smrgm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
226072af6995Smrg[[# func_munge_path_list VARIABLE PATH
226172af6995Smrg# -----------------------------------
226272af6995Smrg# VARIABLE is name of variable containing _space_ separated list of
226372af6995Smrg# directories to be munged by the contents of PATH, which is string
226472af6995Smrg# having a format:
226572af6995Smrg# "DIR[:DIR]:"
226672af6995Smrg#       string "DIR[ DIR]" will be prepended to VARIABLE
226772af6995Smrg# ":DIR[:DIR]"
226872af6995Smrg#       string "DIR[ DIR]" will be appended to VARIABLE
226972af6995Smrg# "DIRP[:DIRP]::[DIRA:]DIRA"
227072af6995Smrg#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
227172af6995Smrg#       "DIRA[ DIRA]" will be appended to VARIABLE
227272af6995Smrg# "DIR[:DIR]"
227372af6995Smrg#       VARIABLE will be replaced by "DIR[ DIR]"
227472af6995Smrgfunc_munge_path_list ()
227572af6995Smrg{
227672af6995Smrg    case x@S|@2 in
227772af6995Smrg    x)
227872af6995Smrg        ;;
227972af6995Smrg    *:)
228072af6995Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
228172af6995Smrg        ;;
228272af6995Smrg    x:*)
228372af6995Smrg        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
228472af6995Smrg        ;;
228572af6995Smrg    *::*)
228672af6995Smrg        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
228772af6995Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
228872af6995Smrg        ;;
228972af6995Smrg    *)
229072af6995Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
229172af6995Smrg        ;;
229272af6995Smrg    esac
229372af6995Smrg}
229472af6995Smrg]])# _LT_PREPARE_PATH_LIST
229572af6995Smrg
229672af6995Smrg
229772af6995Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
229872af6995Smrg# -----------------------------
229972af6995Smrg# PORTME Fill in your ld.so characteristics
230072af6995Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
230172af6995Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
230272af6995Smrgm4_require([_LT_DECL_EGREP])dnl
230372af6995Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
230472af6995Smrgm4_require([_LT_DECL_OBJDUMP])dnl
230572af6995Smrgm4_require([_LT_DECL_SED])dnl
230672af6995Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
230772af6995Smrgm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
230872af6995SmrgAC_MSG_CHECKING([dynamic linker characteristics])
230972af6995Smrgm4_if([$1],
231072af6995Smrg	[], [
231172af6995Smrgif test yes = "$GCC"; then
231272af6995Smrg  case $host_os in
231372af6995Smrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
231472af6995Smrg    *) lt_awk_arg='/^libraries:/' ;;
231572af6995Smrg  esac
231672af6995Smrg  case $host_os in
231772af6995Smrg    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
231872af6995Smrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
231972af6995Smrg  esac
232072af6995Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
232172af6995Smrg  case $lt_search_path_spec in
232272af6995Smrg  *\;*)
232372af6995Smrg    # if the path contains ";" then we assume it to be the separator
232472af6995Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
232572af6995Smrg    # assumed that no part of a normal pathname contains ";" but that should
232672af6995Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
232772af6995Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
232872af6995Smrg    ;;
232972af6995Smrg  *)
233072af6995Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
233172af6995Smrg    ;;
233272af6995Smrg  esac
233372af6995Smrg  # Ok, now we have the path, separated by spaces, we can step through it
233472af6995Smrg  # and add multilib dir if necessary...
233572af6995Smrg  lt_tmp_lt_search_path_spec=
233672af6995Smrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
233772af6995Smrg  # ...but if some path component already ends with the multilib dir we assume
233872af6995Smrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
233972af6995Smrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
234072af6995Smrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
234172af6995Smrg    lt_multi_os_dir=
234272af6995Smrg    ;;
234372af6995Smrg  esac
234472af6995Smrg  for lt_sys_path in $lt_search_path_spec; do
234572af6995Smrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
234672af6995Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
234772af6995Smrg    elif test -n "$lt_multi_os_dir"; then
234872af6995Smrg      test -d "$lt_sys_path" && \
234972af6995Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
235072af6995Smrg    fi
235172af6995Smrg  done
235272af6995Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
235372af6995SmrgBEGIN {RS = " "; FS = "/|\n";} {
235472af6995Smrg  lt_foo = "";
235572af6995Smrg  lt_count = 0;
235672af6995Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
235772af6995Smrg    if ($lt_i != "" && $lt_i != ".") {
235872af6995Smrg      if ($lt_i == "..") {
235972af6995Smrg        lt_count++;
236072af6995Smrg      } else {
236172af6995Smrg        if (lt_count == 0) {
236272af6995Smrg          lt_foo = "/" $lt_i lt_foo;
236372af6995Smrg        } else {
236472af6995Smrg          lt_count--;
236572af6995Smrg        }
236672af6995Smrg      }
236772af6995Smrg    }
236872af6995Smrg  }
236972af6995Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
237072af6995Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
237172af6995Smrg}'`
237272af6995Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
237372af6995Smrg  # for these hosts.
237472af6995Smrg  case $host_os in
237572af6995Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
237672af6995Smrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
237772af6995Smrg  esac
237872af6995Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
237972af6995Smrgelse
238072af6995Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
238172af6995Smrgfi])
238272af6995Smrglibrary_names_spec=
238372af6995Smrglibname_spec='lib$name'
238472af6995Smrgsoname_spec=
238572af6995Smrgshrext_cmds=.so
238672af6995Smrgpostinstall_cmds=
238772af6995Smrgpostuninstall_cmds=
238872af6995Smrgfinish_cmds=
238972af6995Smrgfinish_eval=
239072af6995Smrgshlibpath_var=
239172af6995Smrgshlibpath_overrides_runpath=unknown
239272af6995Smrgversion_type=none
239372af6995Smrgdynamic_linker="$host_os ld.so"
239472af6995Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
239572af6995Smrgneed_lib_prefix=unknown
239672af6995Smrghardcode_into_libs=no
239772af6995Smrg
239872af6995Smrg# when you set need_version to no, make sure it does not cause -set_version
239972af6995Smrg# flags to be left without arguments
240072af6995Smrgneed_version=unknown
240172af6995Smrg
240272af6995SmrgAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
240372af6995Smrg[User-defined run-time library search path.])
240472af6995Smrg
240572af6995Smrgcase $host_os in
240672af6995Smrgaix3*)
240772af6995Smrg  version_type=linux # correct to gnu/linux during the next big refactor
240872af6995Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
240972af6995Smrg  shlibpath_var=LIBPATH
241072af6995Smrg
241172af6995Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
241272af6995Smrg  soname_spec='$libname$release$shared_ext$major'
241372af6995Smrg  ;;
241472af6995Smrg
241572af6995Smrgaix[[4-9]]*)
241672af6995Smrg  version_type=linux # correct to gnu/linux during the next big refactor
241772af6995Smrg  need_lib_prefix=no
241872af6995Smrg  need_version=no
241972af6995Smrg  hardcode_into_libs=yes
242072af6995Smrg  if test ia64 = "$host_cpu"; then
242172af6995Smrg    # AIX 5 supports IA64
242272af6995Smrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
242372af6995Smrg    shlibpath_var=LD_LIBRARY_PATH
242472af6995Smrg  else
242572af6995Smrg    # With GCC up to 2.95.x, collect2 would create an import file
242672af6995Smrg    # for dependence libraries.  The import file would start with
242772af6995Smrg    # the line '#! .'.  This would cause the generated library to
242872af6995Smrg    # depend on '.', always an invalid library.  This was fixed in
242972af6995Smrg    # development snapshots of GCC prior to 3.0.
243072af6995Smrg    case $host_os in
243172af6995Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
243272af6995Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
243372af6995Smrg	   echo ' yes '
243472af6995Smrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
243572af6995Smrg	:
243672af6995Smrg      else
243772af6995Smrg	can_build_shared=no
243872af6995Smrg      fi
243972af6995Smrg      ;;
244072af6995Smrg    esac
244172af6995Smrg    # Using Import Files as archive members, it is possible to support
244272af6995Smrg    # filename-based versioning of shared library archives on AIX. While
244372af6995Smrg    # this would work for both with and without runtime linking, it will
244472af6995Smrg    # prevent static linking of such archives. So we do filename-based
244572af6995Smrg    # shared library versioning with .so extension only, which is used
244672af6995Smrg    # when both runtime linking and shared linking is enabled.
244772af6995Smrg    # Unfortunately, runtime linking may impact performance, so we do
244872af6995Smrg    # not want this to be the default eventually. Also, we use the
244972af6995Smrg    # versioned .so libs for executables only if there is the -brtl
245072af6995Smrg    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
245172af6995Smrg    # To allow for filename-based versioning support, we need to create
245272af6995Smrg    # libNAME.so.V as an archive file, containing:
245372af6995Smrg    # *) an Import File, referring to the versioned filename of the
245472af6995Smrg    #    archive as well as the shared archive member, telling the
245572af6995Smrg    #    bitwidth (32 or 64) of that shared object, and providing the
245672af6995Smrg    #    list of exported symbols of that shared object, eventually
245772af6995Smrg    #    decorated with the 'weak' keyword
245872af6995Smrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
245972af6995Smrg    #    it being seen by the linker.
246072af6995Smrg    # At run time we better use the real file rather than another symlink,
246172af6995Smrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
246272af6995Smrg
246372af6995Smrg    case $with_aix_soname,$aix_use_runtimelinking in
246472af6995Smrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
246572af6995Smrg    # soname into executable. Probably we can add versioning support to
246672af6995Smrg    # collect2, so additional links can be useful in future.
246772af6995Smrg    aix,yes) # traditional libtool
246872af6995Smrg      dynamic_linker='AIX unversionable lib.so'
246972af6995Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
247072af6995Smrg      # instead of lib<name>.a to let people know that these are not
247172af6995Smrg      # typical AIX shared libraries.
247272af6995Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
247372af6995Smrg      ;;
247472af6995Smrg    aix,no) # traditional AIX only
247572af6995Smrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
247672af6995Smrg      # We preserve .a as extension for shared libraries through AIX4.2
247772af6995Smrg      # and later when we are not doing run time linking.
247872af6995Smrg      library_names_spec='$libname$release.a $libname.a'
247972af6995Smrg      soname_spec='$libname$release$shared_ext$major'
248072af6995Smrg      ;;
248172af6995Smrg    svr4,*) # full svr4 only
248272af6995Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
248372af6995Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
248472af6995Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
248572af6995Smrg      shlibpath_overrides_runpath=yes
248672af6995Smrg      ;;
248772af6995Smrg    *,yes) # both, prefer svr4
248872af6995Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
248972af6995Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
249072af6995Smrg      # unpreferred sharedlib libNAME.a needs extra handling
249172af6995Smrg      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
249272af6995Smrg      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
249372af6995Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
249472af6995Smrg      shlibpath_overrides_runpath=yes
249572af6995Smrg      ;;
249672af6995Smrg    *,no) # both, prefer aix
249772af6995Smrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
249872af6995Smrg      library_names_spec='$libname$release.a $libname.a'
249972af6995Smrg      soname_spec='$libname$release$shared_ext$major'
250072af6995Smrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
250172af6995Smrg      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
250272af6995Smrg      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
250372af6995Smrg      ;;
250472af6995Smrg    esac
250572af6995Smrg    shlibpath_var=LIBPATH
250672af6995Smrg  fi
250772af6995Smrg  ;;
250872af6995Smrg
250972af6995Smrgamigaos*)
251072af6995Smrg  case $host_cpu in
251172af6995Smrg  powerpc)
251272af6995Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
251372af6995Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
251472af6995Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
251572af6995Smrg    ;;
251672af6995Smrg  m68k)
251772af6995Smrg    library_names_spec='$libname.ixlibrary $libname.a'
251872af6995Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
251972af6995Smrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
252072af6995Smrg    ;;
252172af6995Smrg  esac
252272af6995Smrg  ;;
252372af6995Smrg
252472af6995Smrgbeos*)
252572af6995Smrg  library_names_spec='$libname$shared_ext'
252672af6995Smrg  dynamic_linker="$host_os ld.so"
252772af6995Smrg  shlibpath_var=LIBRARY_PATH
252872af6995Smrg  ;;
252972af6995Smrg
253072af6995Smrgbsdi[[45]]*)
253172af6995Smrg  version_type=linux # correct to gnu/linux during the next big refactor
253272af6995Smrg  need_version=no
253372af6995Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
253472af6995Smrg  soname_spec='$libname$release$shared_ext$major'
253572af6995Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
253672af6995Smrg  shlibpath_var=LD_LIBRARY_PATH
253772af6995Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
253872af6995Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
253972af6995Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
254072af6995Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
254172af6995Smrg  # libtool to hard-code these into programs
254272af6995Smrg  ;;
254372af6995Smrg
254472af6995Smrgcygwin* | mingw* | pw32* | cegcc*)
254572af6995Smrg  version_type=windows
254672af6995Smrg  shrext_cmds=.dll
254772af6995Smrg  need_version=no
254872af6995Smrg  need_lib_prefix=no
254972af6995Smrg
255072af6995Smrg  case $GCC,$cc_basename in
255172af6995Smrg  yes,*)
255272af6995Smrg    # gcc
255372af6995Smrg    library_names_spec='$libname.dll.a'
255472af6995Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
255572af6995Smrg    postinstall_cmds='base_file=`basename \$file`~
255672af6995Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
255772af6995Smrg      dldir=$destdir/`dirname \$dlpath`~
255872af6995Smrg      test -d \$dldir || mkdir -p \$dldir~
255972af6995Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
256072af6995Smrg      chmod a+x \$dldir/$dlname~
256172af6995Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
256272af6995Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
256372af6995Smrg      fi'
256472af6995Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
256572af6995Smrg      dlpath=$dir/\$dldll~
256672af6995Smrg       $RM \$dlpath'
256772af6995Smrg    shlibpath_overrides_runpath=yes
256872af6995Smrg
256972af6995Smrg    case $host_os in
257072af6995Smrg    cygwin*)
257172af6995Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2572a773ec55Smrg      soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
257372af6995Smrgm4_if([$1], [],[
257472af6995Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
257572af6995Smrg      ;;
257672af6995Smrg    mingw* | cegcc*)
257772af6995Smrg      # MinGW DLLs use traditional 'lib' prefix
257872af6995Smrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
257972af6995Smrg      ;;
258072af6995Smrg    pw32*)
258172af6995Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2582a773ec55Smrg      library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
258372af6995Smrg      ;;
258472af6995Smrg    esac
258572af6995Smrg    dynamic_linker='Win32 ld.exe'
258672af6995Smrg    ;;
258772af6995Smrg
2588a773ec55Smrg  *,cl* | *,icl*)
2589a773ec55Smrg    # Native MSVC or ICC
259072af6995Smrg    libname_spec='$name'
259172af6995Smrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
259272af6995Smrg    library_names_spec='$libname.dll.lib'
259372af6995Smrg
259472af6995Smrg    case $build_os in
259572af6995Smrg    mingw*)
259672af6995Smrg      sys_lib_search_path_spec=
259772af6995Smrg      lt_save_ifs=$IFS
259872af6995Smrg      IFS=';'
259972af6995Smrg      for lt_path in $LIB
260072af6995Smrg      do
260172af6995Smrg        IFS=$lt_save_ifs
260272af6995Smrg        # Let DOS variable expansion print the short 8.3 style file name.
260372af6995Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
260472af6995Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
260572af6995Smrg      done
260672af6995Smrg      IFS=$lt_save_ifs
260772af6995Smrg      # Convert to MSYS style.
2608a773ec55Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
260972af6995Smrg      ;;
261072af6995Smrg    cygwin*)
261172af6995Smrg      # Convert to unix form, then to dos form, then back to unix form
261272af6995Smrg      # but this time dos style (no spaces!) so that the unix form looks
261372af6995Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
261472af6995Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
261572af6995Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
261672af6995Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
261772af6995Smrg      ;;
261872af6995Smrg    *)
261972af6995Smrg      sys_lib_search_path_spec=$LIB
262072af6995Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
262172af6995Smrg        # It is most probably a Windows format PATH.
262272af6995Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
262372af6995Smrg      else
262472af6995Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
262572af6995Smrg      fi
262672af6995Smrg      # FIXME: find the short name or the path components, as spaces are
262772af6995Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
262872af6995Smrg      ;;
262972af6995Smrg    esac
263072af6995Smrg
263172af6995Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
263272af6995Smrg    postinstall_cmds='base_file=`basename \$file`~
263372af6995Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
263472af6995Smrg      dldir=$destdir/`dirname \$dlpath`~
263572af6995Smrg      test -d \$dldir || mkdir -p \$dldir~
263672af6995Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
263772af6995Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
263872af6995Smrg      dlpath=$dir/\$dldll~
263972af6995Smrg       $RM \$dlpath'
264072af6995Smrg    shlibpath_overrides_runpath=yes
264172af6995Smrg    dynamic_linker='Win32 link.exe'
264272af6995Smrg    ;;
264372af6995Smrg
264472af6995Smrg  *)
2645a773ec55Smrg    # Assume MSVC and ICC wrapper
264672af6995Smrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
264772af6995Smrg    dynamic_linker='Win32 ld.exe'
264872af6995Smrg    ;;
264972af6995Smrg  esac
265072af6995Smrg  # FIXME: first we should search . and the directory the executable is in
265172af6995Smrg  shlibpath_var=PATH
265272af6995Smrg  ;;
265372af6995Smrg
265472af6995Smrgdarwin* | rhapsody*)
265572af6995Smrg  dynamic_linker="$host_os dyld"
265672af6995Smrg  version_type=darwin
265772af6995Smrg  need_lib_prefix=no
265872af6995Smrg  need_version=no
2659a773ec55Smrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
266072af6995Smrg  soname_spec='$libname$release$major$shared_ext'
266172af6995Smrg  shlibpath_overrides_runpath=yes
266272af6995Smrg  shlibpath_var=DYLD_LIBRARY_PATH
2663a773ec55Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
266472af6995Smrgm4_if([$1], [],[
266572af6995Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
266672af6995Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
266772af6995Smrg  ;;
266872af6995Smrg
266972af6995Smrgdgux*)
267072af6995Smrg  version_type=linux # correct to gnu/linux during the next big refactor
267172af6995Smrg  need_lib_prefix=no
267272af6995Smrg  need_version=no
267372af6995Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
267472af6995Smrg  soname_spec='$libname$release$shared_ext$major'
267572af6995Smrg  shlibpath_var=LD_LIBRARY_PATH
267672af6995Smrg  ;;
267772af6995Smrg
2678a773ec55Smrgfreebsd* | dragonfly* | midnightbsd*)
267972af6995Smrg  # DragonFly does not have aout.  When/if they implement a new
268072af6995Smrg  # versioning mechanism, adjust this.
268172af6995Smrg  if test -x /usr/bin/objformat; then
268272af6995Smrg    objformat=`/usr/bin/objformat`
268372af6995Smrg  else
268472af6995Smrg    case $host_os in
268572af6995Smrg    freebsd[[23]].*) objformat=aout ;;
268672af6995Smrg    *) objformat=elf ;;
268772af6995Smrg    esac
268872af6995Smrg  fi
2689a773ec55Smrg  version_type=freebsd-$objformat
269072af6995Smrg  case $version_type in
269172af6995Smrg    freebsd-elf*)
269272af6995Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
269372af6995Smrg      soname_spec='$libname$release$shared_ext$major'
269472af6995Smrg      need_version=no
269572af6995Smrg      need_lib_prefix=no
269672af6995Smrg      ;;
269772af6995Smrg    freebsd-*)
269872af6995Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
269972af6995Smrg      need_version=yes
270072af6995Smrg      ;;
270172af6995Smrg  esac
270272af6995Smrg  shlibpath_var=LD_LIBRARY_PATH
270372af6995Smrg  case $host_os in
270472af6995Smrg  freebsd2.*)
270572af6995Smrg    shlibpath_overrides_runpath=yes
270672af6995Smrg    ;;
270772af6995Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
270872af6995Smrg    shlibpath_overrides_runpath=yes
270972af6995Smrg    hardcode_into_libs=yes
271072af6995Smrg    ;;
271172af6995Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
271272af6995Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
271372af6995Smrg    shlibpath_overrides_runpath=no
271472af6995Smrg    hardcode_into_libs=yes
271572af6995Smrg    ;;
271672af6995Smrg  *) # from 4.6 on, and DragonFly
271772af6995Smrg    shlibpath_overrides_runpath=yes
271872af6995Smrg    hardcode_into_libs=yes
271972af6995Smrg    ;;
272072af6995Smrg  esac
272172af6995Smrg  ;;
272272af6995Smrg
272372af6995Smrghaiku*)
272472af6995Smrg  version_type=linux # correct to gnu/linux during the next big refactor
272572af6995Smrg  need_lib_prefix=no
272672af6995Smrg  need_version=no
272772af6995Smrg  dynamic_linker="$host_os runtime_loader"
272872af6995Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
272972af6995Smrg  soname_spec='$libname$release$shared_ext$major'
273072af6995Smrg  shlibpath_var=LIBRARY_PATH
273172af6995Smrg  shlibpath_overrides_runpath=no
273272af6995Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
273372af6995Smrg  hardcode_into_libs=yes
273472af6995Smrg  ;;
273572af6995Smrg
273672af6995Smrghpux9* | hpux10* | hpux11*)
273772af6995Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
273872af6995Smrg  # link against other versions.
273972af6995Smrg  version_type=sunos
274072af6995Smrg  need_lib_prefix=no
274172af6995Smrg  need_version=no
274272af6995Smrg  case $host_cpu in
274372af6995Smrg  ia64*)
274472af6995Smrg    shrext_cmds='.so'
274572af6995Smrg    hardcode_into_libs=yes
274672af6995Smrg    dynamic_linker="$host_os dld.so"
274772af6995Smrg    shlibpath_var=LD_LIBRARY_PATH
274872af6995Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
274972af6995Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
275072af6995Smrg    soname_spec='$libname$release$shared_ext$major'
275172af6995Smrg    if test 32 = "$HPUX_IA64_MODE"; then
275272af6995Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
275372af6995Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
275472af6995Smrg    else
275572af6995Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
275672af6995Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
275772af6995Smrg    fi
275872af6995Smrg    ;;
275972af6995Smrg  hppa*64*)
276072af6995Smrg    shrext_cmds='.sl'
276172af6995Smrg    hardcode_into_libs=yes
276272af6995Smrg    dynamic_linker="$host_os dld.sl"
276372af6995Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
276472af6995Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
276572af6995Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
276672af6995Smrg    soname_spec='$libname$release$shared_ext$major'
276772af6995Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
276872af6995Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
276972af6995Smrg    ;;
277072af6995Smrg  *)
277172af6995Smrg    shrext_cmds='.sl'
277272af6995Smrg    dynamic_linker="$host_os dld.sl"
277372af6995Smrg    shlibpath_var=SHLIB_PATH
277472af6995Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
277572af6995Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
277672af6995Smrg    soname_spec='$libname$release$shared_ext$major'
277772af6995Smrg    ;;
277872af6995Smrg  esac
277972af6995Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
278072af6995Smrg  postinstall_cmds='chmod 555 $lib'
278172af6995Smrg  # or fails outright, so override atomically:
278272af6995Smrg  install_override_mode=555
278372af6995Smrg  ;;
278472af6995Smrg
278572af6995Smrginterix[[3-9]]*)
278672af6995Smrg  version_type=linux # correct to gnu/linux during the next big refactor
278772af6995Smrg  need_lib_prefix=no
278872af6995Smrg  need_version=no
278972af6995Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
279072af6995Smrg  soname_spec='$libname$release$shared_ext$major'
279172af6995Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
279272af6995Smrg  shlibpath_var=LD_LIBRARY_PATH
279372af6995Smrg  shlibpath_overrides_runpath=no
279472af6995Smrg  hardcode_into_libs=yes
279572af6995Smrg  ;;
279672af6995Smrg
279772af6995Smrgirix5* | irix6* | nonstopux*)
279872af6995Smrg  case $host_os in
279972af6995Smrg    nonstopux*) version_type=nonstopux ;;
280072af6995Smrg    *)
280172af6995Smrg	if test yes = "$lt_cv_prog_gnu_ld"; then
280272af6995Smrg		version_type=linux # correct to gnu/linux during the next big refactor
280372af6995Smrg	else
280472af6995Smrg		version_type=irix
280572af6995Smrg	fi ;;
280672af6995Smrg  esac
280772af6995Smrg  need_lib_prefix=no
280872af6995Smrg  need_version=no
280972af6995Smrg  soname_spec='$libname$release$shared_ext$major'
281072af6995Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
281172af6995Smrg  case $host_os in
281272af6995Smrg  irix5* | nonstopux*)
281372af6995Smrg    libsuff= shlibsuff=
281472af6995Smrg    ;;
281572af6995Smrg  *)
281672af6995Smrg    case $LD in # libtool.m4 will add one of these switches to LD
281772af6995Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
281872af6995Smrg      libsuff= shlibsuff= libmagic=32-bit;;
281972af6995Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
282072af6995Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
282172af6995Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
282272af6995Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
282372af6995Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
282472af6995Smrg    esac
282572af6995Smrg    ;;
282672af6995Smrg  esac
282772af6995Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
282872af6995Smrg  shlibpath_overrides_runpath=no
282972af6995Smrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
283072af6995Smrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
283172af6995Smrg  hardcode_into_libs=yes
283272af6995Smrg  ;;
283372af6995Smrg
283472af6995Smrg# No shared lib support for Linux oldld, aout, or coff.
283572af6995Smrglinux*oldld* | linux*aout* | linux*coff*)
283672af6995Smrg  dynamic_linker=no
283772af6995Smrg  ;;
283872af6995Smrg
283972af6995Smrglinux*android*)
284072af6995Smrg  version_type=none # Android doesn't support versioned libraries.
284172af6995Smrg  need_lib_prefix=no
284272af6995Smrg  need_version=no
284372af6995Smrg  library_names_spec='$libname$release$shared_ext'
284472af6995Smrg  soname_spec='$libname$release$shared_ext'
284572af6995Smrg  finish_cmds=
284672af6995Smrg  shlibpath_var=LD_LIBRARY_PATH
284772af6995Smrg  shlibpath_overrides_runpath=yes
284872af6995Smrg
284972af6995Smrg  # This implies no fast_install, which is unacceptable.
285072af6995Smrg  # Some rework will be needed to allow for fast_install
285172af6995Smrg  # before this can be enabled.
285272af6995Smrg  hardcode_into_libs=yes
285372af6995Smrg
285472af6995Smrg  dynamic_linker='Android linker'
285572af6995Smrg  # Don't embed -rpath directories since the linker doesn't support them.
285672af6995Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
285772af6995Smrg  ;;
285872af6995Smrg
285972af6995Smrg# This must be glibc/ELF.
286072af6995Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
286172af6995Smrg  version_type=linux # correct to gnu/linux during the next big refactor
286272af6995Smrg  need_lib_prefix=no
286372af6995Smrg  need_version=no
286472af6995Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
286572af6995Smrg  soname_spec='$libname$release$shared_ext$major'
286672af6995Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
286772af6995Smrg  shlibpath_var=LD_LIBRARY_PATH
286872af6995Smrg  shlibpath_overrides_runpath=no
286972af6995Smrg
287072af6995Smrg  # Some binutils ld are patched to set DT_RUNPATH
287172af6995Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
287272af6995Smrg    [lt_cv_shlibpath_overrides_runpath=no
287372af6995Smrg    save_LDFLAGS=$LDFLAGS
287472af6995Smrg    save_libdir=$libdir
287572af6995Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
287672af6995Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
287772af6995Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
287872af6995Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
287972af6995Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
288072af6995Smrg    LDFLAGS=$save_LDFLAGS
288172af6995Smrg    libdir=$save_libdir
288272af6995Smrg    ])
288372af6995Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
288472af6995Smrg
288572af6995Smrg  # This implies no fast_install, which is unacceptable.
288672af6995Smrg  # Some rework will be needed to allow for fast_install
288772af6995Smrg  # before this can be enabled.
288872af6995Smrg  hardcode_into_libs=yes
288972af6995Smrg
289072af6995Smrg  # Ideally, we could use ldconfig to report *all* directores which are
289172af6995Smrg  # searched for libraries, however this is still not possible.  Aside from not
289272af6995Smrg  # being certain /sbin/ldconfig is available, command
289372af6995Smrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
289472af6995Smrg  # even though it is searched at run-time.  Try to do the best guess by
289572af6995Smrg  # appending ld.so.conf contents (and includes) to the search path.
289672af6995Smrg  if test -f /etc/ld.so.conf; then
289772af6995Smrg    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' ' '`
289872af6995Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
289972af6995Smrg  fi
290072af6995Smrg
290172af6995Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
290272af6995Smrg  # powerpc, because MkLinux only supported shared libraries with the
290372af6995Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
290472af6995Smrg  # most powerpc-linux boxes support dynamic linking these days and
290572af6995Smrg  # people can always --disable-shared, the test was removed, and we
290672af6995Smrg  # assume the GNU/Linux dynamic linker is in use.
290772af6995Smrg  dynamic_linker='GNU/Linux ld.so'
290872af6995Smrg  ;;
290972af6995Smrg
291072af6995Smrgnetbsd*)
291172af6995Smrg  version_type=sunos
291272af6995Smrg  need_lib_prefix=no
291372af6995Smrg  need_version=no
291472af6995Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
291572af6995Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
291672af6995Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
291772af6995Smrg    dynamic_linker='NetBSD (a.out) ld.so'
291872af6995Smrg  else
291972af6995Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
292072af6995Smrg    soname_spec='$libname$release$shared_ext$major'
292172af6995Smrg    dynamic_linker='NetBSD ld.elf_so'
292272af6995Smrg  fi
292372af6995Smrg  shlibpath_var=LD_LIBRARY_PATH
292472af6995Smrg  shlibpath_overrides_runpath=yes
292572af6995Smrg  hardcode_into_libs=yes
292672af6995Smrg  ;;
292772af6995Smrg
292872af6995Smrgnewsos6)
292972af6995Smrg  version_type=linux # correct to gnu/linux during the next big refactor
293072af6995Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
293172af6995Smrg  shlibpath_var=LD_LIBRARY_PATH
293272af6995Smrg  shlibpath_overrides_runpath=yes
293372af6995Smrg  ;;
293472af6995Smrg
293572af6995Smrg*nto* | *qnx*)
293672af6995Smrg  version_type=qnx
293772af6995Smrg  need_lib_prefix=no
293872af6995Smrg  need_version=no
293972af6995Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
294072af6995Smrg  soname_spec='$libname$release$shared_ext$major'
294172af6995Smrg  shlibpath_var=LD_LIBRARY_PATH
294272af6995Smrg  shlibpath_overrides_runpath=no
294372af6995Smrg  hardcode_into_libs=yes
294472af6995Smrg  dynamic_linker='ldqnx.so'
294572af6995Smrg  ;;
294672af6995Smrg
294772af6995Smrgopenbsd* | bitrig*)
294872af6995Smrg  version_type=sunos
294972af6995Smrg  sys_lib_dlsearch_path_spec=/usr/lib
295072af6995Smrg  need_lib_prefix=no
295172af6995Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
295272af6995Smrg    need_version=no
295372af6995Smrg  else
295472af6995Smrg    need_version=yes
295572af6995Smrg  fi
295672af6995Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
295772af6995Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
295872af6995Smrg  shlibpath_var=LD_LIBRARY_PATH
295972af6995Smrg  shlibpath_overrides_runpath=yes
296072af6995Smrg  ;;
296172af6995Smrg
296272af6995Smrgos2*)
296372af6995Smrg  libname_spec='$name'
296472af6995Smrg  version_type=windows
296572af6995Smrg  shrext_cmds=.dll
296672af6995Smrg  need_version=no
296772af6995Smrg  need_lib_prefix=no
296872af6995Smrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
296972af6995Smrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
297072af6995Smrg    v=$($ECHO $release$versuffix | tr -d .-);
297172af6995Smrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
297272af6995Smrg    $ECHO $n$v`$shared_ext'
297372af6995Smrg  library_names_spec='${libname}_dll.$libext'
297472af6995Smrg  dynamic_linker='OS/2 ld.exe'
297572af6995Smrg  shlibpath_var=BEGINLIBPATH
297672af6995Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
297772af6995Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
297872af6995Smrg  postinstall_cmds='base_file=`basename \$file`~
297972af6995Smrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
298072af6995Smrg    dldir=$destdir/`dirname \$dlpath`~
298172af6995Smrg    test -d \$dldir || mkdir -p \$dldir~
298272af6995Smrg    $install_prog $dir/$dlname \$dldir/$dlname~
298372af6995Smrg    chmod a+x \$dldir/$dlname~
298472af6995Smrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
298572af6995Smrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
298672af6995Smrg    fi'
298772af6995Smrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
298872af6995Smrg    dlpath=$dir/\$dldll~
298972af6995Smrg    $RM \$dlpath'
299072af6995Smrg  ;;
299172af6995Smrg
299272af6995Smrgosf3* | osf4* | osf5*)
299372af6995Smrg  version_type=osf
299472af6995Smrg  need_lib_prefix=no
299572af6995Smrg  need_version=no
299672af6995Smrg  soname_spec='$libname$release$shared_ext$major'
299772af6995Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
299872af6995Smrg  shlibpath_var=LD_LIBRARY_PATH
299972af6995Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
300072af6995Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
300172af6995Smrg  ;;
300272af6995Smrg
300372af6995Smrgrdos*)
300472af6995Smrg  dynamic_linker=no
300572af6995Smrg  ;;
300672af6995Smrg
300772af6995Smrgsolaris*)
300872af6995Smrg  version_type=linux # correct to gnu/linux during the next big refactor
300972af6995Smrg  need_lib_prefix=no
301072af6995Smrg  need_version=no
301172af6995Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
301272af6995Smrg  soname_spec='$libname$release$shared_ext$major'
301372af6995Smrg  shlibpath_var=LD_LIBRARY_PATH
301472af6995Smrg  shlibpath_overrides_runpath=yes
301572af6995Smrg  hardcode_into_libs=yes
301672af6995Smrg  # ldd complains unless libraries are executable
301772af6995Smrg  postinstall_cmds='chmod +x $lib'
301872af6995Smrg  ;;
301972af6995Smrg
302072af6995Smrgsunos4*)
302172af6995Smrg  version_type=sunos
302272af6995Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
302372af6995Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
302472af6995Smrg  shlibpath_var=LD_LIBRARY_PATH
302572af6995Smrg  shlibpath_overrides_runpath=yes
302672af6995Smrg  if test yes = "$with_gnu_ld"; then
302772af6995Smrg    need_lib_prefix=no
302872af6995Smrg  fi
302972af6995Smrg  need_version=yes
303072af6995Smrg  ;;
303172af6995Smrg
303272af6995Smrgsysv4 | sysv4.3*)
303372af6995Smrg  version_type=linux # correct to gnu/linux during the next big refactor
303472af6995Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
303572af6995Smrg  soname_spec='$libname$release$shared_ext$major'
303672af6995Smrg  shlibpath_var=LD_LIBRARY_PATH
303772af6995Smrg  case $host_vendor in
303872af6995Smrg    sni)
303972af6995Smrg      shlibpath_overrides_runpath=no
304072af6995Smrg      need_lib_prefix=no
304172af6995Smrg      runpath_var=LD_RUN_PATH
304272af6995Smrg      ;;
304372af6995Smrg    siemens)
304472af6995Smrg      need_lib_prefix=no
304572af6995Smrg      ;;
304672af6995Smrg    motorola)
304772af6995Smrg      need_lib_prefix=no
304872af6995Smrg      need_version=no
304972af6995Smrg      shlibpath_overrides_runpath=no
305072af6995Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
305172af6995Smrg      ;;
305272af6995Smrg  esac
305372af6995Smrg  ;;
305472af6995Smrg
305572af6995Smrgsysv4*MP*)
305672af6995Smrg  if test -d /usr/nec; then
305772af6995Smrg    version_type=linux # correct to gnu/linux during the next big refactor
305872af6995Smrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
305972af6995Smrg    soname_spec='$libname$shared_ext.$major'
306072af6995Smrg    shlibpath_var=LD_LIBRARY_PATH
306172af6995Smrg  fi
306272af6995Smrg  ;;
306372af6995Smrg
306472af6995Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
306572af6995Smrg  version_type=sco
306672af6995Smrg  need_lib_prefix=no
306772af6995Smrg  need_version=no
306872af6995Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
306972af6995Smrg  soname_spec='$libname$release$shared_ext$major'
307072af6995Smrg  shlibpath_var=LD_LIBRARY_PATH
307172af6995Smrg  shlibpath_overrides_runpath=yes
307272af6995Smrg  hardcode_into_libs=yes
307372af6995Smrg  if test yes = "$with_gnu_ld"; then
307472af6995Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
307572af6995Smrg  else
307672af6995Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
307772af6995Smrg    case $host_os in
307872af6995Smrg      sco3.2v5*)
307972af6995Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
308072af6995Smrg	;;
308172af6995Smrg    esac
308272af6995Smrg  fi
308372af6995Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
308472af6995Smrg  ;;
308572af6995Smrg
308672af6995Smrgtpf*)
308772af6995Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
308872af6995Smrg  version_type=linux # correct to gnu/linux during the next big refactor
308972af6995Smrg  need_lib_prefix=no
309072af6995Smrg  need_version=no
309172af6995Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
309272af6995Smrg  shlibpath_var=LD_LIBRARY_PATH
309372af6995Smrg  shlibpath_overrides_runpath=no
309472af6995Smrg  hardcode_into_libs=yes
309572af6995Smrg  ;;
309672af6995Smrg
309772af6995Smrguts4*)
309872af6995Smrg  version_type=linux # correct to gnu/linux during the next big refactor
309972af6995Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
310072af6995Smrg  soname_spec='$libname$release$shared_ext$major'
310172af6995Smrg  shlibpath_var=LD_LIBRARY_PATH
310272af6995Smrg  ;;
310372af6995Smrg
310472af6995Smrg*)
310572af6995Smrg  dynamic_linker=no
310672af6995Smrg  ;;
310772af6995Smrgesac
310872af6995SmrgAC_MSG_RESULT([$dynamic_linker])
310972af6995Smrgtest no = "$dynamic_linker" && can_build_shared=no
311072af6995Smrg
311172af6995Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
311272af6995Smrgif test yes = "$GCC"; then
311372af6995Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
311472af6995Smrgfi
311572af6995Smrg
311672af6995Smrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
311772af6995Smrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
311872af6995Smrgfi
311972af6995Smrg
312072af6995Smrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
312172af6995Smrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
312272af6995Smrgfi
312372af6995Smrg
312472af6995Smrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
312572af6995Smrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
312672af6995Smrg
312772af6995Smrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
312872af6995Smrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
312972af6995Smrg
313072af6995Smrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
313172af6995Smrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
313272af6995Smrg
313372af6995Smrg_LT_DECL([], [variables_saved_for_relink], [1],
313472af6995Smrg    [Variables whose values should be saved in libtool wrapper scripts and
313572af6995Smrg    restored at link time])
313672af6995Smrg_LT_DECL([], [need_lib_prefix], [0],
313772af6995Smrg    [Do we need the "lib" prefix for modules?])
313872af6995Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
313972af6995Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
314072af6995Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
314172af6995Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
314272af6995Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
314372af6995Smrg    [Is shlibpath searched before the hard-coded library search path?])
314472af6995Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
314572af6995Smrg_LT_DECL([], [library_names_spec], [1],
314672af6995Smrg    [[List of archive names.  First name is the real one, the rest are links.
314772af6995Smrg    The last name is the one that the linker finds with -lNAME]])
314872af6995Smrg_LT_DECL([], [soname_spec], [1],
314972af6995Smrg    [[The coded name of the library, if different from the real name]])
315072af6995Smrg_LT_DECL([], [install_override_mode], [1],
315172af6995Smrg    [Permission mode override for installation of shared libraries])
315272af6995Smrg_LT_DECL([], [postinstall_cmds], [2],
315372af6995Smrg    [Command to use after installation of a shared archive])
315472af6995Smrg_LT_DECL([], [postuninstall_cmds], [2],
315572af6995Smrg    [Command to use after uninstallation of a shared archive])
315672af6995Smrg_LT_DECL([], [finish_cmds], [2],
315772af6995Smrg    [Commands used to finish a libtool library installation in a directory])
315872af6995Smrg_LT_DECL([], [finish_eval], [1],
315972af6995Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
316072af6995Smrg    not shown]])
316172af6995Smrg_LT_DECL([], [hardcode_into_libs], [0],
316272af6995Smrg    [Whether we should hardcode library paths into libraries])
316372af6995Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
316472af6995Smrg    [Compile-time system search path for libraries])
316572af6995Smrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
316672af6995Smrg    [Detected run-time system search path for libraries])
316772af6995Smrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
316872af6995Smrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
316972af6995Smrg])# _LT_SYS_DYNAMIC_LINKER
317072af6995Smrg
317172af6995Smrg
317272af6995Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
317372af6995Smrg# --------------------------
317472af6995Smrg# find a file program that can recognize shared library
317572af6995SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
317672af6995Smrg[m4_require([_LT_DECL_EGREP])dnl
317772af6995SmrgAC_MSG_CHECKING([for $1])
317872af6995SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
317972af6995Smrg[case $MAGIC_CMD in
318072af6995Smrg[[\\/*] |  ?:[\\/]*])
318172af6995Smrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
318272af6995Smrg  ;;
318372af6995Smrg*)
318472af6995Smrg  lt_save_MAGIC_CMD=$MAGIC_CMD
318572af6995Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
318672af6995Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
318772af6995Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
318872af6995Smrgdnl not every word.  This closes a longstanding sh security hole.
318972af6995Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
319072af6995Smrg  for ac_dir in $ac_dummy; do
319172af6995Smrg    IFS=$lt_save_ifs
319272af6995Smrg    test -z "$ac_dir" && ac_dir=.
319372af6995Smrg    if test -f "$ac_dir/$1"; then
319472af6995Smrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
319572af6995Smrg      if test -n "$file_magic_test_file"; then
319672af6995Smrg	case $deplibs_check_method in
319772af6995Smrg	"file_magic "*)
319872af6995Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
319972af6995Smrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
320072af6995Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
320172af6995Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
320272af6995Smrg	    :
320372af6995Smrg	  else
320472af6995Smrg	    cat <<_LT_EOF 1>&2
320572af6995Smrg
320672af6995Smrg*** Warning: the command libtool uses to detect shared libraries,
320772af6995Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
320872af6995Smrg*** The result is that libtool may fail to recognize shared libraries
320972af6995Smrg*** as such.  This will affect the creation of libtool libraries that
321072af6995Smrg*** depend on shared libraries, but programs linked with such libtool
321172af6995Smrg*** libraries will work regardless of this problem.  Nevertheless, you
321272af6995Smrg*** may want to report the problem to your system manager and/or to
321372af6995Smrg*** bug-libtool@gnu.org
321472af6995Smrg
321572af6995Smrg_LT_EOF
321672af6995Smrg	  fi ;;
321772af6995Smrg	esac
321872af6995Smrg      fi
321972af6995Smrg      break
322072af6995Smrg    fi
322172af6995Smrg  done
322272af6995Smrg  IFS=$lt_save_ifs
322372af6995Smrg  MAGIC_CMD=$lt_save_MAGIC_CMD
322472af6995Smrg  ;;
322572af6995Smrgesac])
322672af6995SmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
322772af6995Smrgif test -n "$MAGIC_CMD"; then
322872af6995Smrg  AC_MSG_RESULT($MAGIC_CMD)
322972af6995Smrgelse
323072af6995Smrg  AC_MSG_RESULT(no)
323172af6995Smrgfi
323272af6995Smrg_LT_DECL([], [MAGIC_CMD], [0],
323372af6995Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
323472af6995Smrg])# _LT_PATH_TOOL_PREFIX
323572af6995Smrg
323672af6995Smrg# Old name:
323772af6995SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
323872af6995Smrgdnl aclocal-1.4 backwards compatibility:
323972af6995Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
324072af6995Smrg
324172af6995Smrg
324272af6995Smrg# _LT_PATH_MAGIC
324372af6995Smrg# --------------
324472af6995Smrg# find a file program that can recognize a shared library
324572af6995Smrgm4_defun([_LT_PATH_MAGIC],
324672af6995Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
324772af6995Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
324872af6995Smrg  if test -n "$ac_tool_prefix"; then
324972af6995Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
325072af6995Smrg  else
325172af6995Smrg    MAGIC_CMD=:
325272af6995Smrg  fi
325372af6995Smrgfi
325472af6995Smrg])# _LT_PATH_MAGIC
325572af6995Smrg
325672af6995Smrg
325772af6995Smrg# LT_PATH_LD
325872af6995Smrg# ----------
325972af6995Smrg# find the pathname to the GNU or non-GNU linker
326072af6995SmrgAC_DEFUN([LT_PATH_LD],
326172af6995Smrg[AC_REQUIRE([AC_PROG_CC])dnl
326272af6995SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
326372af6995SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
326472af6995Smrgm4_require([_LT_DECL_SED])dnl
326572af6995Smrgm4_require([_LT_DECL_EGREP])dnl
326672af6995Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
326772af6995Smrg
326872af6995SmrgAC_ARG_WITH([gnu-ld],
326972af6995Smrg    [AS_HELP_STRING([--with-gnu-ld],
327072af6995Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
327172af6995Smrg    [test no = "$withval" || with_gnu_ld=yes],
327272af6995Smrg    [with_gnu_ld=no])dnl
327372af6995Smrg
327472af6995Smrgac_prog=ld
327572af6995Smrgif test yes = "$GCC"; then
327672af6995Smrg  # Check if gcc -print-prog-name=ld gives a path.
327772af6995Smrg  AC_MSG_CHECKING([for ld used by $CC])
327872af6995Smrg  case $host in
327972af6995Smrg  *-*-mingw*)
328072af6995Smrg    # gcc leaves a trailing carriage return, which upsets mingw
328172af6995Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
328272af6995Smrg  *)
328372af6995Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
328472af6995Smrg  esac
328572af6995Smrg  case $ac_prog in
328672af6995Smrg    # Accept absolute paths.
328772af6995Smrg    [[\\/]]* | ?:[[\\/]]*)
328872af6995Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
328972af6995Smrg      # Canonicalize the pathname of ld
329072af6995Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
329172af6995Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
329272af6995Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
329372af6995Smrg      done
329472af6995Smrg      test -z "$LD" && LD=$ac_prog
329572af6995Smrg      ;;
329672af6995Smrg  "")
329772af6995Smrg    # If it fails, then pretend we aren't using GCC.
329872af6995Smrg    ac_prog=ld
329972af6995Smrg    ;;
330072af6995Smrg  *)
330172af6995Smrg    # If it is relative, then search for the first ld in PATH.
330272af6995Smrg    with_gnu_ld=unknown
330372af6995Smrg    ;;
330472af6995Smrg  esac
330572af6995Smrgelif test yes = "$with_gnu_ld"; then
330672af6995Smrg  AC_MSG_CHECKING([for GNU ld])
330772af6995Smrgelse
330872af6995Smrg  AC_MSG_CHECKING([for non-GNU ld])
330972af6995Smrgfi
331072af6995SmrgAC_CACHE_VAL(lt_cv_path_LD,
331172af6995Smrg[if test -z "$LD"; then
331272af6995Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
331372af6995Smrg  for ac_dir in $PATH; do
331472af6995Smrg    IFS=$lt_save_ifs
331572af6995Smrg    test -z "$ac_dir" && ac_dir=.
331672af6995Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
331772af6995Smrg      lt_cv_path_LD=$ac_dir/$ac_prog
331872af6995Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
331972af6995Smrg      # but apparently some variants of GNU ld only accept -v.
332072af6995Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
332172af6995Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
332272af6995Smrg      *GNU* | *'with BFD'*)
332372af6995Smrg	test no != "$with_gnu_ld" && break
332472af6995Smrg	;;
332572af6995Smrg      *)
332672af6995Smrg	test yes != "$with_gnu_ld" && break
332772af6995Smrg	;;
332872af6995Smrg      esac
332972af6995Smrg    fi
333072af6995Smrg  done
333172af6995Smrg  IFS=$lt_save_ifs
333272af6995Smrgelse
333372af6995Smrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
333472af6995Smrgfi])
333572af6995SmrgLD=$lt_cv_path_LD
333672af6995Smrgif test -n "$LD"; then
333772af6995Smrg  AC_MSG_RESULT($LD)
333872af6995Smrgelse
333972af6995Smrg  AC_MSG_RESULT(no)
334072af6995Smrgfi
334172af6995Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
334272af6995Smrg_LT_PATH_LD_GNU
334372af6995SmrgAC_SUBST([LD])
334472af6995Smrg
334572af6995Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
334672af6995Smrg])# LT_PATH_LD
334772af6995Smrg
334872af6995Smrg# Old names:
334972af6995SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
335072af6995SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
335172af6995Smrgdnl aclocal-1.4 backwards compatibility:
335272af6995Smrgdnl AC_DEFUN([AM_PROG_LD], [])
335372af6995Smrgdnl AC_DEFUN([AC_PROG_LD], [])
335472af6995Smrg
335572af6995Smrg
335672af6995Smrg# _LT_PATH_LD_GNU
335772af6995Smrg#- --------------
335872af6995Smrgm4_defun([_LT_PATH_LD_GNU],
335972af6995Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
336072af6995Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
336172af6995Smrgcase `$LD -v 2>&1 </dev/null` in
336272af6995Smrg*GNU* | *'with BFD'*)
336372af6995Smrg  lt_cv_prog_gnu_ld=yes
336472af6995Smrg  ;;
336572af6995Smrg*)
336672af6995Smrg  lt_cv_prog_gnu_ld=no
336772af6995Smrg  ;;
336872af6995Smrgesac])
336972af6995Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
337072af6995Smrg])# _LT_PATH_LD_GNU
337172af6995Smrg
337272af6995Smrg
337372af6995Smrg# _LT_CMD_RELOAD
337472af6995Smrg# --------------
337572af6995Smrg# find reload flag for linker
337672af6995Smrg#   -- PORTME Some linkers may need a different reload flag.
337772af6995Smrgm4_defun([_LT_CMD_RELOAD],
337872af6995Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
337972af6995Smrg  lt_cv_ld_reload_flag,
338072af6995Smrg  [lt_cv_ld_reload_flag='-r'])
338172af6995Smrgreload_flag=$lt_cv_ld_reload_flag
338272af6995Smrgcase $reload_flag in
338372af6995Smrg"" | " "*) ;;
338472af6995Smrg*) reload_flag=" $reload_flag" ;;
338572af6995Smrgesac
338672af6995Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
338772af6995Smrgcase $host_os in
338872af6995Smrg  cygwin* | mingw* | pw32* | cegcc*)
338972af6995Smrg    if test yes != "$GCC"; then
339072af6995Smrg      reload_cmds=false
339172af6995Smrg    fi
339272af6995Smrg    ;;
339372af6995Smrg  darwin*)
339472af6995Smrg    if test yes = "$GCC"; then
339572af6995Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
339672af6995Smrg    else
339772af6995Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
339872af6995Smrg    fi
339972af6995Smrg    ;;
340072af6995Smrgesac
340172af6995Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
340272af6995Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
340372af6995Smrg])# _LT_CMD_RELOAD
340472af6995Smrg
340572af6995Smrg
340672af6995Smrg# _LT_PATH_DD
340772af6995Smrg# -----------
340872af6995Smrg# find a working dd
340972af6995Smrgm4_defun([_LT_PATH_DD],
341072af6995Smrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
341172af6995Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
341272af6995Smrgcat conftest.i conftest.i >conftest2.i
341372af6995Smrg: ${lt_DD:=$DD}
341472af6995SmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
341572af6995Smrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
341672af6995Smrg  cmp -s conftest.i conftest.out \
341772af6995Smrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
341872af6995Smrgfi])
341972af6995Smrgrm -f conftest.i conftest2.i conftest.out])
342072af6995Smrg])# _LT_PATH_DD
342172af6995Smrg
342272af6995Smrg
342372af6995Smrg# _LT_CMD_TRUNCATE
342472af6995Smrg# ----------------
342572af6995Smrg# find command to truncate a binary pipe
342672af6995Smrgm4_defun([_LT_CMD_TRUNCATE],
342772af6995Smrg[m4_require([_LT_PATH_DD])
342872af6995SmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
342972af6995Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
343072af6995Smrgcat conftest.i conftest.i >conftest2.i
343172af6995Smrglt_cv_truncate_bin=
343272af6995Smrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
343372af6995Smrg  cmp -s conftest.i conftest.out \
343472af6995Smrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
343572af6995Smrgfi
343672af6995Smrgrm -f conftest.i conftest2.i conftest.out
343772af6995Smrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
343872af6995Smrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
343972af6995Smrg  [Command to truncate a binary pipe])
344072af6995Smrg])# _LT_CMD_TRUNCATE
344172af6995Smrg
344272af6995Smrg
344372af6995Smrg# _LT_CHECK_MAGIC_METHOD
344472af6995Smrg# ----------------------
344572af6995Smrg# how to check for library dependencies
344672af6995Smrg#  -- PORTME fill in with the dynamic library characteristics
344772af6995Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
344872af6995Smrg[m4_require([_LT_DECL_EGREP])
344972af6995Smrgm4_require([_LT_DECL_OBJDUMP])
345072af6995SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
345172af6995Smrglt_cv_deplibs_check_method,
345272af6995Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
345372af6995Smrglt_cv_file_magic_test_file=
345472af6995Smrglt_cv_deplibs_check_method='unknown'
345572af6995Smrg# Need to set the preceding variable on all platforms that support
345672af6995Smrg# interlibrary dependencies.
345772af6995Smrg# 'none' -- dependencies not supported.
345872af6995Smrg# 'unknown' -- same as none, but documents that we really don't know.
345972af6995Smrg# 'pass_all' -- all dependencies passed with no checks.
346072af6995Smrg# 'test_compile' -- check by making test program.
346172af6995Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
346272af6995Smrg# that responds to the $file_magic_cmd with a given extended regex.
346372af6995Smrg# If you have 'file' or equivalent on your system and you're not sure
346472af6995Smrg# whether 'pass_all' will *always* work, you probably want this one.
346572af6995Smrg
346672af6995Smrgcase $host_os in
346772af6995Smrgaix[[4-9]]*)
346872af6995Smrg  lt_cv_deplibs_check_method=pass_all
346972af6995Smrg  ;;
347072af6995Smrg
347172af6995Smrgbeos*)
347272af6995Smrg  lt_cv_deplibs_check_method=pass_all
347372af6995Smrg  ;;
347472af6995Smrg
347572af6995Smrgbsdi[[45]]*)
347672af6995Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3477a773ec55Smrg  lt_cv_file_magic_cmd='$FILECMD -L'
347872af6995Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
347972af6995Smrg  ;;
348072af6995Smrg
348172af6995Smrgcygwin*)
348272af6995Smrg  # func_win32_libid is a shell function defined in ltmain.sh
348372af6995Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
348472af6995Smrg  lt_cv_file_magic_cmd='func_win32_libid'
348572af6995Smrg  ;;
348672af6995Smrg
348772af6995Smrgmingw* | pw32*)
348872af6995Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
348972af6995Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
349072af6995Smrg  # unless we find 'file', for example because we are cross-compiling.
349172af6995Smrg  if ( file / ) >/dev/null 2>&1; then
349272af6995Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
349372af6995Smrg    lt_cv_file_magic_cmd='func_win32_libid'
349472af6995Smrg  else
349572af6995Smrg    # Keep this pattern in sync with the one in func_win32_libid.
349672af6995Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
349772af6995Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
349872af6995Smrg  fi
349972af6995Smrg  ;;
350072af6995Smrg
350172af6995Smrgcegcc*)
350272af6995Smrg  # use the weaker test based on 'objdump'. See mingw*.
350372af6995Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
350472af6995Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
350572af6995Smrg  ;;
350672af6995Smrg
350772af6995Smrgdarwin* | rhapsody*)
350872af6995Smrg  lt_cv_deplibs_check_method=pass_all
350972af6995Smrg  ;;
351072af6995Smrg
3511a773ec55Smrgfreebsd* | dragonfly* | midnightbsd*)
351272af6995Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
351372af6995Smrg    case $host_cpu in
351472af6995Smrg    i*86 )
351572af6995Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
351672af6995Smrg      # Let's accept both of them until this is cleared up.
351772af6995Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3518a773ec55Smrg      lt_cv_file_magic_cmd=$FILECMD
351972af6995Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
352072af6995Smrg      ;;
352172af6995Smrg    esac
352272af6995Smrg  else
352372af6995Smrg    lt_cv_deplibs_check_method=pass_all
352472af6995Smrg  fi
352572af6995Smrg  ;;
352672af6995Smrg
352772af6995Smrghaiku*)
352872af6995Smrg  lt_cv_deplibs_check_method=pass_all
352972af6995Smrg  ;;
353072af6995Smrg
353172af6995Smrghpux10.20* | hpux11*)
3532a773ec55Smrg  lt_cv_file_magic_cmd=$FILECMD
353372af6995Smrg  case $host_cpu in
353472af6995Smrg  ia64*)
353572af6995Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
353672af6995Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
353772af6995Smrg    ;;
353872af6995Smrg  hppa*64*)
353972af6995Smrg    [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]']
354072af6995Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
354172af6995Smrg    ;;
354272af6995Smrg  *)
354372af6995Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
354472af6995Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
354572af6995Smrg    ;;
354672af6995Smrg  esac
354772af6995Smrg  ;;
354872af6995Smrg
354972af6995Smrginterix[[3-9]]*)
355072af6995Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
355172af6995Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
355272af6995Smrg  ;;
355372af6995Smrg
355472af6995Smrgirix5* | irix6* | nonstopux*)
355572af6995Smrg  case $LD in
355672af6995Smrg  *-32|*"-32 ") libmagic=32-bit;;
355772af6995Smrg  *-n32|*"-n32 ") libmagic=N32;;
355872af6995Smrg  *-64|*"-64 ") libmagic=64-bit;;
355972af6995Smrg  *) libmagic=never-match;;
356072af6995Smrg  esac
356172af6995Smrg  lt_cv_deplibs_check_method=pass_all
356272af6995Smrg  ;;
356372af6995Smrg
356472af6995Smrg# This must be glibc/ELF.
356572af6995Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
356672af6995Smrg  lt_cv_deplibs_check_method=pass_all
356772af6995Smrg  ;;
356872af6995Smrg
3569362b94d5Smrgnetbsd*)
357072af6995Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
357172af6995Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
357272af6995Smrg  else
357372af6995Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
357472af6995Smrg  fi
357572af6995Smrg  ;;
357672af6995Smrg
357772af6995Smrgnewos6*)
357872af6995Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3579a773ec55Smrg  lt_cv_file_magic_cmd=$FILECMD
358072af6995Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
358172af6995Smrg  ;;
358272af6995Smrg
358372af6995Smrg*nto* | *qnx*)
358472af6995Smrg  lt_cv_deplibs_check_method=pass_all
358572af6995Smrg  ;;
358672af6995Smrg
358772af6995Smrgopenbsd* | bitrig*)
358872af6995Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
358972af6995Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
359072af6995Smrg  else
359172af6995Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
359272af6995Smrg  fi
359372af6995Smrg  ;;
359472af6995Smrg
359572af6995Smrgosf3* | osf4* | osf5*)
359672af6995Smrg  lt_cv_deplibs_check_method=pass_all
359772af6995Smrg  ;;
359872af6995Smrg
359972af6995Smrgrdos*)
360072af6995Smrg  lt_cv_deplibs_check_method=pass_all
360172af6995Smrg  ;;
360272af6995Smrg
360372af6995Smrgsolaris*)
360472af6995Smrg  lt_cv_deplibs_check_method=pass_all
360572af6995Smrg  ;;
360672af6995Smrg
360772af6995Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
360872af6995Smrg  lt_cv_deplibs_check_method=pass_all
360972af6995Smrg  ;;
361072af6995Smrg
361172af6995Smrgsysv4 | sysv4.3*)
361272af6995Smrg  case $host_vendor in
361372af6995Smrg  motorola)
361472af6995Smrg    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]]'
361572af6995Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
361672af6995Smrg    ;;
361772af6995Smrg  ncr)
361872af6995Smrg    lt_cv_deplibs_check_method=pass_all
361972af6995Smrg    ;;
362072af6995Smrg  sequent)
362172af6995Smrg    lt_cv_file_magic_cmd='/bin/file'
362272af6995Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
362372af6995Smrg    ;;
362472af6995Smrg  sni)
362572af6995Smrg    lt_cv_file_magic_cmd='/bin/file'
362672af6995Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
362772af6995Smrg    lt_cv_file_magic_test_file=/lib/libc.so
362872af6995Smrg    ;;
362972af6995Smrg  siemens)
363072af6995Smrg    lt_cv_deplibs_check_method=pass_all
363172af6995Smrg    ;;
363272af6995Smrg  pc)
363372af6995Smrg    lt_cv_deplibs_check_method=pass_all
363472af6995Smrg    ;;
363572af6995Smrg  esac
363672af6995Smrg  ;;
363772af6995Smrg
363872af6995Smrgtpf*)
363972af6995Smrg  lt_cv_deplibs_check_method=pass_all
364072af6995Smrg  ;;
364172af6995Smrgos2*)
364272af6995Smrg  lt_cv_deplibs_check_method=pass_all
364372af6995Smrg  ;;
364472af6995Smrgesac
364572af6995Smrg])
364672af6995Smrg
364772af6995Smrgfile_magic_glob=
364872af6995Smrgwant_nocaseglob=no
364972af6995Smrgif test "$build" = "$host"; then
365072af6995Smrg  case $host_os in
365172af6995Smrg  mingw* | pw32*)
365272af6995Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
365372af6995Smrg      want_nocaseglob=yes
365472af6995Smrg    else
365572af6995Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
365672af6995Smrg    fi
365772af6995Smrg    ;;
365872af6995Smrg  esac
365972af6995Smrgfi
366072af6995Smrg
366172af6995Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
366272af6995Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
366372af6995Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
366472af6995Smrg
366572af6995Smrg_LT_DECL([], [deplibs_check_method], [1],
366672af6995Smrg    [Method to check whether dependent libraries are shared objects])
366772af6995Smrg_LT_DECL([], [file_magic_cmd], [1],
366872af6995Smrg    [Command to use when deplibs_check_method = "file_magic"])
366972af6995Smrg_LT_DECL([], [file_magic_glob], [1],
367072af6995Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
367172af6995Smrg_LT_DECL([], [want_nocaseglob], [1],
367272af6995Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
367372af6995Smrg])# _LT_CHECK_MAGIC_METHOD
367472af6995Smrg
367572af6995Smrg
367672af6995Smrg# LT_PATH_NM
367772af6995Smrg# ----------
367872af6995Smrg# find the pathname to a BSD- or MS-compatible name lister
367972af6995SmrgAC_DEFUN([LT_PATH_NM],
368072af6995Smrg[AC_REQUIRE([AC_PROG_CC])dnl
368172af6995SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
368272af6995Smrg[if test -n "$NM"; then
368372af6995Smrg  # Let the user override the test.
368472af6995Smrg  lt_cv_path_NM=$NM
368572af6995Smrgelse
368672af6995Smrg  lt_nm_to_check=${ac_tool_prefix}nm
368772af6995Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
368872af6995Smrg    lt_nm_to_check="$lt_nm_to_check nm"
368972af6995Smrg  fi
369072af6995Smrg  for lt_tmp_nm in $lt_nm_to_check; do
369172af6995Smrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
369272af6995Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
369372af6995Smrg      IFS=$lt_save_ifs
369472af6995Smrg      test -z "$ac_dir" && ac_dir=.
369572af6995Smrg      tmp_nm=$ac_dir/$lt_tmp_nm
369672af6995Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
369772af6995Smrg	# Check to see if the nm accepts a BSD-compat flag.
369872af6995Smrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
369972af6995Smrg	#   nm: unknown option "B" ignored
370072af6995Smrg	# Tru64's nm complains that /dev/null is an invalid object file
370172af6995Smrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
370272af6995Smrg	case $build_os in
370372af6995Smrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
370472af6995Smrg	*) lt_bad_file=/dev/null ;;
370572af6995Smrg	esac
3706a773ec55Smrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
370772af6995Smrg	*$lt_bad_file* | *'Invalid file or object type'*)
370872af6995Smrg	  lt_cv_path_NM="$tmp_nm -B"
370972af6995Smrg	  break 2
371072af6995Smrg	  ;;
371172af6995Smrg	*)
3712a773ec55Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
371372af6995Smrg	  */dev/null*)
371472af6995Smrg	    lt_cv_path_NM="$tmp_nm -p"
371572af6995Smrg	    break 2
371672af6995Smrg	    ;;
371772af6995Smrg	  *)
371872af6995Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
371972af6995Smrg	    continue # so that we can try to find one that supports BSD flags
372072af6995Smrg	    ;;
372172af6995Smrg	  esac
372272af6995Smrg	  ;;
372372af6995Smrg	esac
372472af6995Smrg      fi
372572af6995Smrg    done
372672af6995Smrg    IFS=$lt_save_ifs
372772af6995Smrg  done
372872af6995Smrg  : ${lt_cv_path_NM=no}
372972af6995Smrgfi])
373072af6995Smrgif test no != "$lt_cv_path_NM"; then
373172af6995Smrg  NM=$lt_cv_path_NM
373272af6995Smrgelse
373372af6995Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
373472af6995Smrg  if test -n "$DUMPBIN"; then :
373572af6995Smrg    # Let the user override the test.
373672af6995Smrg  else
373772af6995Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3738a773ec55Smrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
373972af6995Smrg    *COFF*)
374072af6995Smrg      DUMPBIN="$DUMPBIN -symbols -headers"
374172af6995Smrg      ;;
374272af6995Smrg    *)
374372af6995Smrg      DUMPBIN=:
374472af6995Smrg      ;;
374572af6995Smrg    esac
374672af6995Smrg  fi
374772af6995Smrg  AC_SUBST([DUMPBIN])
374872af6995Smrg  if test : != "$DUMPBIN"; then
374972af6995Smrg    NM=$DUMPBIN
375072af6995Smrg  fi
375172af6995Smrgfi
375272af6995Smrgtest -z "$NM" && NM=nm
375372af6995SmrgAC_SUBST([NM])
375472af6995Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
375572af6995Smrg
375672af6995SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
375772af6995Smrg  [lt_cv_nm_interface="BSD nm"
375872af6995Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
375972af6995Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
376072af6995Smrg  (eval "$ac_compile" 2>conftest.err)
376172af6995Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
376272af6995Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
376372af6995Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
376472af6995Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
376572af6995Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
376672af6995Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
376772af6995Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
376872af6995Smrg    lt_cv_nm_interface="MS dumpbin"
376972af6995Smrg  fi
377072af6995Smrg  rm -f conftest*])
377172af6995Smrg])# LT_PATH_NM
377272af6995Smrg
377372af6995Smrg# Old names:
377472af6995SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
377572af6995SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
377672af6995Smrgdnl aclocal-1.4 backwards compatibility:
377772af6995Smrgdnl AC_DEFUN([AM_PROG_NM], [])
377872af6995Smrgdnl AC_DEFUN([AC_PROG_NM], [])
377972af6995Smrg
378072af6995Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
378172af6995Smrg# --------------------------------
378272af6995Smrg# how to determine the name of the shared library
378372af6995Smrg# associated with a specific link library.
378472af6995Smrg#  -- PORTME fill in with the dynamic library characteristics
378572af6995Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
378672af6995Smrg[m4_require([_LT_DECL_EGREP])
378772af6995Smrgm4_require([_LT_DECL_OBJDUMP])
378872af6995Smrgm4_require([_LT_DECL_DLLTOOL])
378972af6995SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
379072af6995Smrglt_cv_sharedlib_from_linklib_cmd,
379172af6995Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
379272af6995Smrg
379372af6995Smrgcase $host_os in
379472af6995Smrgcygwin* | mingw* | pw32* | cegcc*)
379572af6995Smrg  # two different shell functions defined in ltmain.sh;
379672af6995Smrg  # decide which one to use based on capabilities of $DLLTOOL
379772af6995Smrg  case `$DLLTOOL --help 2>&1` in
379872af6995Smrg  *--identify-strict*)
379972af6995Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
380072af6995Smrg    ;;
380172af6995Smrg  *)
380272af6995Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
380372af6995Smrg    ;;
380472af6995Smrg  esac
380572af6995Smrg  ;;
380672af6995Smrg*)
380772af6995Smrg  # fallback: assume linklib IS sharedlib
380872af6995Smrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
380972af6995Smrg  ;;
381072af6995Smrgesac
381172af6995Smrg])
381272af6995Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
381372af6995Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
381472af6995Smrg
381572af6995Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
381672af6995Smrg    [Command to associate shared and link libraries])
381772af6995Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
381872af6995Smrg
381972af6995Smrg
382072af6995Smrg# _LT_PATH_MANIFEST_TOOL
382172af6995Smrg# ----------------------
382272af6995Smrg# locate the manifest tool
382372af6995Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
382472af6995Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
382572af6995Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
382672af6995SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
382772af6995Smrg  [lt_cv_path_mainfest_tool=no
382872af6995Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
382972af6995Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
383072af6995Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
383172af6995Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
383272af6995Smrg    lt_cv_path_mainfest_tool=yes
383372af6995Smrg  fi
383472af6995Smrg  rm -f conftest*])
383572af6995Smrgif test yes != "$lt_cv_path_mainfest_tool"; then
383672af6995Smrg  MANIFEST_TOOL=:
383772af6995Smrgfi
383872af6995Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
383972af6995Smrg])# _LT_PATH_MANIFEST_TOOL
384072af6995Smrg
384172af6995Smrg
384272af6995Smrg# _LT_DLL_DEF_P([FILE])
384372af6995Smrg# ---------------------
384472af6995Smrg# True iff FILE is a Windows DLL '.def' file.
384572af6995Smrg# Keep in sync with func_dll_def_p in the libtool script
384672af6995SmrgAC_DEFUN([_LT_DLL_DEF_P],
384772af6995Smrg[dnl
384872af6995Smrg  test DEF = "`$SED -n dnl
384972af6995Smrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
385072af6995Smrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
385172af6995Smrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
385272af6995Smrg    -e q dnl                          Only consider the first "real" line
385372af6995Smrg    $1`" dnl
385472af6995Smrg])# _LT_DLL_DEF_P
385572af6995Smrg
385672af6995Smrg
385772af6995Smrg# LT_LIB_M
385872af6995Smrg# --------
385972af6995Smrg# check for math library
386072af6995SmrgAC_DEFUN([LT_LIB_M],
386172af6995Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
386272af6995SmrgLIBM=
386372af6995Smrgcase $host in
386472af6995Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
386572af6995Smrg  # These system don't have libm, or don't need it
386672af6995Smrg  ;;
386772af6995Smrg*-ncr-sysv4.3*)
386872af6995Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
386972af6995Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
387072af6995Smrg  ;;
387172af6995Smrg*)
387272af6995Smrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
387372af6995Smrg  ;;
387472af6995Smrgesac
387572af6995SmrgAC_SUBST([LIBM])
387672af6995Smrg])# LT_LIB_M
387772af6995Smrg
387872af6995Smrg# Old name:
387972af6995SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
388072af6995Smrgdnl aclocal-1.4 backwards compatibility:
388172af6995Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
388272af6995Smrg
388372af6995Smrg
388472af6995Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
388572af6995Smrg# -------------------------------
388672af6995Smrgm4_defun([_LT_COMPILER_NO_RTTI],
388772af6995Smrg[m4_require([_LT_TAG_COMPILER])dnl
388872af6995Smrg
388972af6995Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
389072af6995Smrg
389172af6995Smrgif test yes = "$GCC"; then
389272af6995Smrg  case $cc_basename in
389372af6995Smrg  nvcc*)
389472af6995Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
389572af6995Smrg  *)
389672af6995Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
389772af6995Smrg  esac
389872af6995Smrg
389972af6995Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
390072af6995Smrg    lt_cv_prog_compiler_rtti_exceptions,
390172af6995Smrg    [-fno-rtti -fno-exceptions], [],
390272af6995Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
390372af6995Smrgfi
390472af6995Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
390572af6995Smrg	[Compiler flag to turn off builtin functions])
390672af6995Smrg])# _LT_COMPILER_NO_RTTI
390772af6995Smrg
390872af6995Smrg
390972af6995Smrg# _LT_CMD_GLOBAL_SYMBOLS
391072af6995Smrg# ----------------------
391172af6995Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
391272af6995Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
391372af6995SmrgAC_REQUIRE([AC_PROG_CC])dnl
391472af6995SmrgAC_REQUIRE([AC_PROG_AWK])dnl
391572af6995SmrgAC_REQUIRE([LT_PATH_NM])dnl
391672af6995SmrgAC_REQUIRE([LT_PATH_LD])dnl
391772af6995Smrgm4_require([_LT_DECL_SED])dnl
391872af6995Smrgm4_require([_LT_DECL_EGREP])dnl
391972af6995Smrgm4_require([_LT_TAG_COMPILER])dnl
392072af6995Smrg
392172af6995Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
392272af6995SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
392372af6995SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
392472af6995Smrg[
392572af6995Smrg# These are sane defaults that work on at least a few old systems.
392672af6995Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
392772af6995Smrg
392872af6995Smrg# Character class describing NM global symbol codes.
392972af6995Smrgsymcode='[[BCDEGRST]]'
393072af6995Smrg
393172af6995Smrg# Regexp to match symbols that can be accessed directly from C.
393272af6995Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
393372af6995Smrg
393472af6995Smrg# Define system-specific variables.
393572af6995Smrgcase $host_os in
393672af6995Smrgaix*)
393772af6995Smrg  symcode='[[BCDT]]'
393872af6995Smrg  ;;
393972af6995Smrgcygwin* | mingw* | pw32* | cegcc*)
394072af6995Smrg  symcode='[[ABCDGISTW]]'
394172af6995Smrg  ;;
394272af6995Smrghpux*)
394372af6995Smrg  if test ia64 = "$host_cpu"; then
394472af6995Smrg    symcode='[[ABCDEGRST]]'
394572af6995Smrg  fi
394672af6995Smrg  ;;
394772af6995Smrgirix* | nonstopux*)
394872af6995Smrg  symcode='[[BCDEGRST]]'
394972af6995Smrg  ;;
395072af6995Smrgosf*)
395172af6995Smrg  symcode='[[BCDEGQRST]]'
395272af6995Smrg  ;;
395372af6995Smrgsolaris*)
395472af6995Smrg  symcode='[[BDRT]]'
395572af6995Smrg  ;;
395672af6995Smrgsco3.2v5*)
395772af6995Smrg  symcode='[[DT]]'
395872af6995Smrg  ;;
395972af6995Smrgsysv4.2uw2*)
396072af6995Smrg  symcode='[[DT]]'
396172af6995Smrg  ;;
396272af6995Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
396372af6995Smrg  symcode='[[ABDT]]'
396472af6995Smrg  ;;
396572af6995Smrgsysv4)
396672af6995Smrg  symcode='[[DFNSTU]]'
396772af6995Smrg  ;;
396872af6995Smrgesac
396972af6995Smrg
397072af6995Smrg# If we're using GNU nm, then use its standard symbol codes.
397172af6995Smrgcase `$NM -V 2>&1` in
397272af6995Smrg*GNU* | *'with BFD'*)
397372af6995Smrg  symcode='[[ABCDGIRSTW]]' ;;
397472af6995Smrgesac
397572af6995Smrg
397672af6995Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
397772af6995Smrg  # Gets list of data symbols to import.
3978a773ec55Smrg  lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
397972af6995Smrg  # Adjust the below global symbol transforms to fixup imported variables.
398072af6995Smrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
398172af6995Smrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
398272af6995Smrg  lt_c_name_lib_hook="\
398372af6995Smrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
398472af6995Smrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
398572af6995Smrgelse
398672af6995Smrg  # Disable hooks by default.
398772af6995Smrg  lt_cv_sys_global_symbol_to_import=
398872af6995Smrg  lt_cdecl_hook=
398972af6995Smrg  lt_c_name_hook=
399072af6995Smrg  lt_c_name_lib_hook=
399172af6995Smrgfi
399272af6995Smrg
399372af6995Smrg# Transform an extracted symbol line into a proper C declaration.
399472af6995Smrg# Some systems (esp. on ia64) link data and code symbols differently,
399572af6995Smrg# so use this general approach.
3996a773ec55Smrglt_cv_sys_global_symbol_to_cdecl="$SED -n"\
399772af6995Smrg$lt_cdecl_hook\
399872af6995Smrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
399972af6995Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
400072af6995Smrg
400172af6995Smrg# Transform an extracted symbol line into symbol name and symbol address
4002a773ec55Smrglt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
400372af6995Smrg$lt_c_name_hook\
400472af6995Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
400572af6995Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
400672af6995Smrg
400772af6995Smrg# Transform an extracted symbol line into symbol name with lib prefix and
400872af6995Smrg# symbol address.
4009a773ec55Smrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
401072af6995Smrg$lt_c_name_lib_hook\
401172af6995Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
401272af6995Smrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
401372af6995Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
401472af6995Smrg
401572af6995Smrg# Handle CRLF in mingw tool chain
401672af6995Smrgopt_cr=
401772af6995Smrgcase $build_os in
401872af6995Smrgmingw*)
401972af6995Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
402072af6995Smrg  ;;
402172af6995Smrgesac
402272af6995Smrg
402372af6995Smrg# Try without a prefix underscore, then with it.
402472af6995Smrgfor ac_symprfx in "" "_"; do
402572af6995Smrg
402672af6995Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
402772af6995Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
402872af6995Smrg
402972af6995Smrg  # Write the raw and C identifiers.
403072af6995Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
403172af6995Smrg    # Fake it for dumpbin and say T for any non-static function,
403272af6995Smrg    # D for any global variable and I for any imported variable.
4033a773ec55Smrg    # Also find C++ and __fastcall symbols from MSVC++ or ICC,
403472af6995Smrg    # which start with @ or ?.
403572af6995Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
403672af6995Smrg"     {last_section=section; section=\$ 3};"\
403772af6995Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
403872af6995Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
403972af6995Smrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
404072af6995Smrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
404172af6995Smrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
404272af6995Smrg"     \$ 0!~/External *\|/{next};"\
404372af6995Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
404472af6995Smrg"     {if(hide[section]) next};"\
404572af6995Smrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
404672af6995Smrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
404772af6995Smrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
404872af6995Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
404972af6995Smrg"     ' prfx=^$ac_symprfx]"
405072af6995Smrg  else
4051a773ec55Smrg    lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
405272af6995Smrg  fi
4053a773ec55Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
405472af6995Smrg
405572af6995Smrg  # Check to see that the pipe works correctly.
405672af6995Smrg  pipe_works=no
405772af6995Smrg
405872af6995Smrg  rm -f conftest*
405972af6995Smrg  cat > conftest.$ac_ext <<_LT_EOF
406072af6995Smrg#ifdef __cplusplus
406172af6995Smrgextern "C" {
406272af6995Smrg#endif
406372af6995Smrgchar nm_test_var;
406472af6995Smrgvoid nm_test_func(void);
406572af6995Smrgvoid nm_test_func(void){}
406672af6995Smrg#ifdef __cplusplus
406772af6995Smrg}
406872af6995Smrg#endif
406972af6995Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
407072af6995Smrg_LT_EOF
407172af6995Smrg
407272af6995Smrg  if AC_TRY_EVAL(ac_compile); then
407372af6995Smrg    # Now try to grab the symbols.
407472af6995Smrg    nlist=conftest.nm
4075362b94d5Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
407672af6995Smrg      # Try sorting and uniquifying the output.
407772af6995Smrg      if sort "$nlist" | uniq > "$nlist"T; then
407872af6995Smrg	mv -f "$nlist"T "$nlist"
407972af6995Smrg      else
408072af6995Smrg	rm -f "$nlist"T
408172af6995Smrg      fi
408272af6995Smrg
408372af6995Smrg      # Make sure that we snagged all the symbols we need.
408472af6995Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
408572af6995Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
408672af6995Smrg	  cat <<_LT_EOF > conftest.$ac_ext
408772af6995Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
408872af6995Smrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
408972af6995Smrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
409072af6995Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
409172af6995Smrg# define LT@&t@_DLSYM_CONST
409272af6995Smrg#elif defined __osf__
409372af6995Smrg/* This system does not cope well with relocations in const data.  */
409472af6995Smrg# define LT@&t@_DLSYM_CONST
409572af6995Smrg#else
409672af6995Smrg# define LT@&t@_DLSYM_CONST const
409772af6995Smrg#endif
409872af6995Smrg
409972af6995Smrg#ifdef __cplusplus
410072af6995Smrgextern "C" {
410172af6995Smrg#endif
410272af6995Smrg
410372af6995Smrg_LT_EOF
410472af6995Smrg	  # Now generate the symbol file.
410572af6995Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
410672af6995Smrg
410772af6995Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
410872af6995Smrg
410972af6995Smrg/* The mapping between symbol names and symbols.  */
411072af6995SmrgLT@&t@_DLSYM_CONST struct {
411172af6995Smrg  const char *name;
411272af6995Smrg  void       *address;
411372af6995Smrg}
411472af6995Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
411572af6995Smrg{
411672af6995Smrg  { "@PROGRAM@", (void *) 0 },
411772af6995Smrg_LT_EOF
411872af6995Smrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
411972af6995Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
412072af6995Smrg  {0, (void *) 0}
412172af6995Smrg};
412272af6995Smrg
412372af6995Smrg/* This works around a problem in FreeBSD linker */
412472af6995Smrg#ifdef FREEBSD_WORKAROUND
412572af6995Smrgstatic const void *lt_preloaded_setup() {
412672af6995Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
412772af6995Smrg}
412872af6995Smrg#endif
412972af6995Smrg
413072af6995Smrg#ifdef __cplusplus
413172af6995Smrg}
413272af6995Smrg#endif
413372af6995Smrg_LT_EOF
413472af6995Smrg	  # Now try linking the two files.
413572af6995Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
413672af6995Smrg	  lt_globsym_save_LIBS=$LIBS
413772af6995Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
413872af6995Smrg	  LIBS=conftstm.$ac_objext
413972af6995Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
414072af6995Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
414172af6995Smrg	    pipe_works=yes
414272af6995Smrg	  fi
414372af6995Smrg	  LIBS=$lt_globsym_save_LIBS
414472af6995Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
414572af6995Smrg	else
414672af6995Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
414772af6995Smrg	fi
414872af6995Smrg      else
414972af6995Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
415072af6995Smrg      fi
415172af6995Smrg    else
415272af6995Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
415372af6995Smrg    fi
415472af6995Smrg  else
415572af6995Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
415672af6995Smrg    cat conftest.$ac_ext >&5
415772af6995Smrg  fi
415872af6995Smrg  rm -rf conftest* conftst*
415972af6995Smrg
416072af6995Smrg  # Do not use the global_symbol_pipe unless it works.
416172af6995Smrg  if test yes = "$pipe_works"; then
416272af6995Smrg    break
416372af6995Smrg  else
416472af6995Smrg    lt_cv_sys_global_symbol_pipe=
416572af6995Smrg  fi
416672af6995Smrgdone
416772af6995Smrg])
416872af6995Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
416972af6995Smrg  lt_cv_sys_global_symbol_to_cdecl=
417072af6995Smrgfi
417172af6995Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
417272af6995Smrg  AC_MSG_RESULT(failed)
417372af6995Smrgelse
417472af6995Smrg  AC_MSG_RESULT(ok)
417572af6995Smrgfi
417672af6995Smrg
417772af6995Smrg# Response file support.
417872af6995Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
417972af6995Smrg  nm_file_list_spec='@'
418072af6995Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
418172af6995Smrg  nm_file_list_spec='@'
418272af6995Smrgfi
418372af6995Smrg
418472af6995Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
418572af6995Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
418672af6995Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
418772af6995Smrg    [Transform the output of nm in a proper C declaration])
418872af6995Smrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
418972af6995Smrg    [Transform the output of nm into a list of symbols to manually relocate])
419072af6995Smrg_LT_DECL([global_symbol_to_c_name_address],
419172af6995Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
419272af6995Smrg    [Transform the output of nm in a C name address pair])
419372af6995Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
419472af6995Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
419572af6995Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
419672af6995Smrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
419772af6995Smrg    [The name lister interface])
419872af6995Smrg_LT_DECL([], [nm_file_list_spec], [1],
419972af6995Smrg    [Specify filename containing input files for $NM])
420072af6995Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
420172af6995Smrg
420272af6995Smrg
420372af6995Smrg# _LT_COMPILER_PIC([TAGNAME])
420472af6995Smrg# ---------------------------
420572af6995Smrgm4_defun([_LT_COMPILER_PIC],
420672af6995Smrg[m4_require([_LT_TAG_COMPILER])dnl
420772af6995Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
420872af6995Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
420972af6995Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
421072af6995Smrg
421172af6995Smrgm4_if([$1], [CXX], [
421272af6995Smrg  # C++ specific cases for pic, static, wl, etc.
421372af6995Smrg  if test yes = "$GXX"; then
421472af6995Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
421572af6995Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
421672af6995Smrg
421772af6995Smrg    case $host_os in
421872af6995Smrg    aix*)
421972af6995Smrg      # All AIX code is PIC.
422072af6995Smrg      if test ia64 = "$host_cpu"; then
422172af6995Smrg	# AIX 5 now supports IA64 processor
422272af6995Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
422372af6995Smrg      fi
422472af6995Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
422572af6995Smrg      ;;
422672af6995Smrg
422772af6995Smrg    amigaos*)
422872af6995Smrg      case $host_cpu in
422972af6995Smrg      powerpc)
423072af6995Smrg            # see comment about AmigaOS4 .so support
423172af6995Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
423272af6995Smrg        ;;
423372af6995Smrg      m68k)
423472af6995Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
423572af6995Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
423672af6995Smrg            # like '-m68040'.
423772af6995Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
423872af6995Smrg        ;;
423972af6995Smrg      esac
424072af6995Smrg      ;;
424172af6995Smrg
424272af6995Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
424372af6995Smrg      # PIC is the default for these OSes.
424472af6995Smrg      ;;
424572af6995Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
424672af6995Smrg      # This hack is so that the source file can tell whether it is being
424772af6995Smrg      # built for inclusion in a dll (and should export symbols for example).
424872af6995Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
424972af6995Smrg      # (--disable-auto-import) libraries
425072af6995Smrg      m4_if([$1], [GCJ], [],
425172af6995Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
425272af6995Smrg      case $host_os in
425372af6995Smrg      os2*)
425472af6995Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
425572af6995Smrg	;;
425672af6995Smrg      esac
425772af6995Smrg      ;;
425872af6995Smrg    darwin* | rhapsody*)
425972af6995Smrg      # PIC is the default on this platform
426072af6995Smrg      # Common symbols not allowed in MH_DYLIB files
426172af6995Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
426272af6995Smrg      ;;
426372af6995Smrg    *djgpp*)
426472af6995Smrg      # DJGPP does not support shared libraries at all
426572af6995Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
426672af6995Smrg      ;;
426772af6995Smrg    haiku*)
426872af6995Smrg      # PIC is the default for Haiku.
426972af6995Smrg      # The "-static" flag exists, but is broken.
427072af6995Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
427172af6995Smrg      ;;
427272af6995Smrg    interix[[3-9]]*)
427372af6995Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
427472af6995Smrg      # Instead, we relocate shared libraries at runtime.
427572af6995Smrg      ;;
427672af6995Smrg    sysv4*MP*)
427772af6995Smrg      if test -d /usr/nec; then
427872af6995Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
427972af6995Smrg      fi
428072af6995Smrg      ;;
428172af6995Smrg    hpux*)
428272af6995Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
428372af6995Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
428472af6995Smrg      # sets the default TLS model and affects inlining.
428572af6995Smrg      case $host_cpu in
428672af6995Smrg      hppa*64*)
428772af6995Smrg	;;
428872af6995Smrg      *)
428972af6995Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
429072af6995Smrg	;;
429172af6995Smrg      esac
429272af6995Smrg      ;;
429372af6995Smrg    *qnx* | *nto*)
429472af6995Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
429572af6995Smrg      # it will coredump.
429672af6995Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
429772af6995Smrg      ;;
429872af6995Smrg    *)
429972af6995Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
430072af6995Smrg      ;;
430172af6995Smrg    esac
430272af6995Smrg  else
430372af6995Smrg    case $host_os in
430472af6995Smrg      aix[[4-9]]*)
430572af6995Smrg	# All AIX code is PIC.
430672af6995Smrg	if test ia64 = "$host_cpu"; then
430772af6995Smrg	  # AIX 5 now supports IA64 processor
430872af6995Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
430972af6995Smrg	else
431072af6995Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
431172af6995Smrg	fi
431272af6995Smrg	;;
431372af6995Smrg      chorus*)
431472af6995Smrg	case $cc_basename in
431572af6995Smrg	cxch68*)
431672af6995Smrg	  # Green Hills C++ Compiler
431772af6995Smrg	  # _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"
431872af6995Smrg	  ;;
431972af6995Smrg	esac
432072af6995Smrg	;;
432172af6995Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
432272af6995Smrg	# This hack is so that the source file can tell whether it is being
432372af6995Smrg	# built for inclusion in a dll (and should export symbols for example).
432472af6995Smrg	m4_if([$1], [GCJ], [],
432572af6995Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
432672af6995Smrg	;;
432772af6995Smrg      dgux*)
432872af6995Smrg	case $cc_basename in
432972af6995Smrg	  ec++*)
433072af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
433172af6995Smrg	    ;;
433272af6995Smrg	  ghcx*)
433372af6995Smrg	    # Green Hills C++ Compiler
433472af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
433572af6995Smrg	    ;;
433672af6995Smrg	  *)
433772af6995Smrg	    ;;
433872af6995Smrg	esac
433972af6995Smrg	;;
4340a773ec55Smrg      freebsd* | dragonfly* | midnightbsd*)
434172af6995Smrg	# FreeBSD uses GNU C++
434272af6995Smrg	;;
434372af6995Smrg      hpux9* | hpux10* | hpux11*)
434472af6995Smrg	case $cc_basename in
434572af6995Smrg	  CC*)
434672af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
434772af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
434872af6995Smrg	    if test ia64 != "$host_cpu"; then
434972af6995Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
435072af6995Smrg	    fi
435172af6995Smrg	    ;;
435272af6995Smrg	  aCC*)
435372af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
435472af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
435572af6995Smrg	    case $host_cpu in
435672af6995Smrg	    hppa*64*|ia64*)
435772af6995Smrg	      # +Z the default
435872af6995Smrg	      ;;
435972af6995Smrg	    *)
436072af6995Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
436172af6995Smrg	      ;;
436272af6995Smrg	    esac
436372af6995Smrg	    ;;
436472af6995Smrg	  *)
436572af6995Smrg	    ;;
436672af6995Smrg	esac
436772af6995Smrg	;;
436872af6995Smrg      interix*)
436972af6995Smrg	# This is c89, which is MS Visual C++ (no shared libs)
437072af6995Smrg	# Anyone wants to do a port?
437172af6995Smrg	;;
437272af6995Smrg      irix5* | irix6* | nonstopux*)
437372af6995Smrg	case $cc_basename in
437472af6995Smrg	  CC*)
437572af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
437672af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
437772af6995Smrg	    # CC pic flag -KPIC is the default.
437872af6995Smrg	    ;;
437972af6995Smrg	  *)
438072af6995Smrg	    ;;
438172af6995Smrg	esac
438272af6995Smrg	;;
438372af6995Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
438472af6995Smrg	case $cc_basename in
438572af6995Smrg	  KCC*)
438672af6995Smrg	    # KAI C++ Compiler
438772af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
438872af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
438972af6995Smrg	    ;;
439072af6995Smrg	  ecpc* )
439172af6995Smrg	    # old Intel C++ for x86_64, which still supported -KPIC.
439272af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
439372af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
439472af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
439572af6995Smrg	    ;;
439672af6995Smrg	  icpc* )
439772af6995Smrg	    # Intel C++, used to be incompatible with GCC.
439872af6995Smrg	    # ICC 10 doesn't accept -KPIC any more.
439972af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
440072af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
440172af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
440272af6995Smrg	    ;;
440372af6995Smrg	  pgCC* | pgcpp*)
440472af6995Smrg	    # Portland Group C++ compiler
440572af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
440672af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
440772af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
440872af6995Smrg	    ;;
440972af6995Smrg	  cxx*)
441072af6995Smrg	    # Compaq C++
441172af6995Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
441272af6995Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
441372af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
441472af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
441572af6995Smrg	    ;;
441672af6995Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
441772af6995Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
441872af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
441972af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
442072af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
442172af6995Smrg	    ;;
442272af6995Smrg	  *)
4423a773ec55Smrg	    case `$CC -V 2>&1 | $SED 5q` in
442472af6995Smrg	    *Sun\ C*)
442572af6995Smrg	      # Sun C++ 5.9
442672af6995Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
442772af6995Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
442872af6995Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
442972af6995Smrg	      ;;
443072af6995Smrg	    esac
443172af6995Smrg	    ;;
443272af6995Smrg	esac
443372af6995Smrg	;;
443472af6995Smrg      lynxos*)
443572af6995Smrg	;;
443672af6995Smrg      m88k*)
443772af6995Smrg	;;
443872af6995Smrg      mvs*)
443972af6995Smrg	case $cc_basename in
444072af6995Smrg	  cxx*)
444172af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
444272af6995Smrg	    ;;
444372af6995Smrg	  *)
444472af6995Smrg	    ;;
444572af6995Smrg	esac
444672af6995Smrg	;;
4447362b94d5Smrg      netbsd*)
444872af6995Smrg	;;
444972af6995Smrg      *qnx* | *nto*)
445072af6995Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
445172af6995Smrg        # it will coredump.
445272af6995Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
445372af6995Smrg        ;;
445472af6995Smrg      osf3* | osf4* | osf5*)
445572af6995Smrg	case $cc_basename in
445672af6995Smrg	  KCC*)
445772af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
445872af6995Smrg	    ;;
445972af6995Smrg	  RCC*)
446072af6995Smrg	    # Rational C++ 2.4.1
446172af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
446272af6995Smrg	    ;;
446372af6995Smrg	  cxx*)
446472af6995Smrg	    # Digital/Compaq C++
446572af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
446672af6995Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
446772af6995Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
446872af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
446972af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
447072af6995Smrg	    ;;
447172af6995Smrg	  *)
447272af6995Smrg	    ;;
447372af6995Smrg	esac
447472af6995Smrg	;;
447572af6995Smrg      psos*)
447672af6995Smrg	;;
447772af6995Smrg      solaris*)
447872af6995Smrg	case $cc_basename in
447972af6995Smrg	  CC* | sunCC*)
448072af6995Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
448172af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
448272af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
448372af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
448472af6995Smrg	    ;;
448572af6995Smrg	  gcx*)
448672af6995Smrg	    # Green Hills C++ Compiler
448772af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
448872af6995Smrg	    ;;
448972af6995Smrg	  *)
449072af6995Smrg	    ;;
449172af6995Smrg	esac
449272af6995Smrg	;;
449372af6995Smrg      sunos4*)
449472af6995Smrg	case $cc_basename in
449572af6995Smrg	  CC*)
449672af6995Smrg	    # Sun C++ 4.x
449772af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
449872af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
449972af6995Smrg	    ;;
450072af6995Smrg	  lcc*)
450172af6995Smrg	    # Lucid
450272af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
450372af6995Smrg	    ;;
450472af6995Smrg	  *)
450572af6995Smrg	    ;;
450672af6995Smrg	esac
450772af6995Smrg	;;
450872af6995Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
450972af6995Smrg	case $cc_basename in
451072af6995Smrg	  CC*)
451172af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
451272af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
451372af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
451472af6995Smrg	    ;;
451572af6995Smrg	esac
451672af6995Smrg	;;
451772af6995Smrg      tandem*)
451872af6995Smrg	case $cc_basename in
451972af6995Smrg	  NCC*)
452072af6995Smrg	    # NonStop-UX NCC 3.20
452172af6995Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
452272af6995Smrg	    ;;
452372af6995Smrg	  *)
452472af6995Smrg	    ;;
452572af6995Smrg	esac
452672af6995Smrg	;;
452772af6995Smrg      vxworks*)
452872af6995Smrg	;;
452972af6995Smrg      *)
453072af6995Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
453172af6995Smrg	;;
453272af6995Smrg    esac
453372af6995Smrg  fi
453472af6995Smrg],
453572af6995Smrg[
453672af6995Smrg  if test yes = "$GCC"; then
453772af6995Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
453872af6995Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
453972af6995Smrg
454072af6995Smrg    case $host_os in
454172af6995Smrg      aix*)
454272af6995Smrg      # All AIX code is PIC.
454372af6995Smrg      if test ia64 = "$host_cpu"; then
454472af6995Smrg	# AIX 5 now supports IA64 processor
454572af6995Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
454672af6995Smrg      fi
454772af6995Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
454872af6995Smrg      ;;
454972af6995Smrg
455072af6995Smrg    amigaos*)
455172af6995Smrg      case $host_cpu in
455272af6995Smrg      powerpc)
455372af6995Smrg            # see comment about AmigaOS4 .so support
455472af6995Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
455572af6995Smrg        ;;
455672af6995Smrg      m68k)
455772af6995Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
455872af6995Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
455972af6995Smrg            # like '-m68040'.
456072af6995Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
456172af6995Smrg        ;;
456272af6995Smrg      esac
456372af6995Smrg      ;;
456472af6995Smrg
456572af6995Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
456672af6995Smrg      # PIC is the default for these OSes.
456772af6995Smrg      ;;
456872af6995Smrg
456972af6995Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
457072af6995Smrg      # This hack is so that the source file can tell whether it is being
457172af6995Smrg      # built for inclusion in a dll (and should export symbols for example).
457272af6995Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
457372af6995Smrg      # (--disable-auto-import) libraries
457472af6995Smrg      m4_if([$1], [GCJ], [],
457572af6995Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
457672af6995Smrg      case $host_os in
457772af6995Smrg      os2*)
457872af6995Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
457972af6995Smrg	;;
458072af6995Smrg      esac
458172af6995Smrg      ;;
458272af6995Smrg
458372af6995Smrg    darwin* | rhapsody*)
458472af6995Smrg      # PIC is the default on this platform
458572af6995Smrg      # Common symbols not allowed in MH_DYLIB files
458672af6995Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
458772af6995Smrg      ;;
458872af6995Smrg
458972af6995Smrg    haiku*)
459072af6995Smrg      # PIC is the default for Haiku.
459172af6995Smrg      # The "-static" flag exists, but is broken.
459272af6995Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
459372af6995Smrg      ;;
459472af6995Smrg
459572af6995Smrg    hpux*)
459672af6995Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
459772af6995Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
459872af6995Smrg      # sets the default TLS model and affects inlining.
459972af6995Smrg      case $host_cpu in
460072af6995Smrg      hppa*64*)
460172af6995Smrg	# +Z the default
460272af6995Smrg	;;
460372af6995Smrg      *)
460472af6995Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
460572af6995Smrg	;;
460672af6995Smrg      esac
460772af6995Smrg      ;;
460872af6995Smrg
460972af6995Smrg    interix[[3-9]]*)
461072af6995Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
461172af6995Smrg      # Instead, we relocate shared libraries at runtime.
461272af6995Smrg      ;;
461372af6995Smrg
461472af6995Smrg    msdosdjgpp*)
461572af6995Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
461672af6995Smrg      # on systems that don't support them.
461772af6995Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
461872af6995Smrg      enable_shared=no
461972af6995Smrg      ;;
462072af6995Smrg
462172af6995Smrg    *nto* | *qnx*)
462272af6995Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
462372af6995Smrg      # it will coredump.
462472af6995Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
462572af6995Smrg      ;;
462672af6995Smrg
462772af6995Smrg    sysv4*MP*)
462872af6995Smrg      if test -d /usr/nec; then
462972af6995Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
463072af6995Smrg      fi
463172af6995Smrg      ;;
463272af6995Smrg
463372af6995Smrg    *)
463472af6995Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
463572af6995Smrg      ;;
463672af6995Smrg    esac
463772af6995Smrg
463872af6995Smrg    case $cc_basename in
463972af6995Smrg    nvcc*) # Cuda Compiler Driver 2.2
464072af6995Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
464172af6995Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
464272af6995Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
464372af6995Smrg      fi
464472af6995Smrg      ;;
464572af6995Smrg    esac
464672af6995Smrg  else
464772af6995Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
464872af6995Smrg    case $host_os in
464972af6995Smrg    aix*)
465072af6995Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
465172af6995Smrg      if test ia64 = "$host_cpu"; then
465272af6995Smrg	# AIX 5 now supports IA64 processor
465372af6995Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
465472af6995Smrg      else
465572af6995Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
465672af6995Smrg      fi
465772af6995Smrg      ;;
465872af6995Smrg
465972af6995Smrg    darwin* | rhapsody*)
466072af6995Smrg      # PIC is the default on this platform
466172af6995Smrg      # Common symbols not allowed in MH_DYLIB files
466272af6995Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
466372af6995Smrg      case $cc_basename in
466472af6995Smrg      nagfor*)
466572af6995Smrg        # NAG Fortran compiler
466672af6995Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
466772af6995Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
466872af6995Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
466972af6995Smrg        ;;
467072af6995Smrg      esac
467172af6995Smrg      ;;
467272af6995Smrg
467372af6995Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
467472af6995Smrg      # This hack is so that the source file can tell whether it is being
467572af6995Smrg      # built for inclusion in a dll (and should export symbols for example).
467672af6995Smrg      m4_if([$1], [GCJ], [],
467772af6995Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
467872af6995Smrg      case $host_os in
467972af6995Smrg      os2*)
468072af6995Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
468172af6995Smrg	;;
468272af6995Smrg      esac
468372af6995Smrg      ;;
468472af6995Smrg
468572af6995Smrg    hpux9* | hpux10* | hpux11*)
468672af6995Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
468772af6995Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
468872af6995Smrg      # not for PA HP-UX.
468972af6995Smrg      case $host_cpu in
469072af6995Smrg      hppa*64*|ia64*)
469172af6995Smrg	# +Z the default
469272af6995Smrg	;;
469372af6995Smrg      *)
469472af6995Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
469572af6995Smrg	;;
469672af6995Smrg      esac
469772af6995Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
469872af6995Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
469972af6995Smrg      ;;
470072af6995Smrg
470172af6995Smrg    irix5* | irix6* | nonstopux*)
470272af6995Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
470372af6995Smrg      # PIC (with -KPIC) is the default.
470472af6995Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
470572af6995Smrg      ;;
470672af6995Smrg
470772af6995Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
470872af6995Smrg      case $cc_basename in
470972af6995Smrg      # old Intel for x86_64, which still supported -KPIC.
471072af6995Smrg      ecc*)
471172af6995Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
471272af6995Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
471372af6995Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
471472af6995Smrg        ;;
471572af6995Smrg      # icc used to be incompatible with GCC.
471672af6995Smrg      # ICC 10 doesn't accept -KPIC any more.
471772af6995Smrg      icc* | ifort*)
471872af6995Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
471972af6995Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
472072af6995Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
472172af6995Smrg        ;;
472272af6995Smrg      # Lahey Fortran 8.1.
472372af6995Smrg      lf95*)
472472af6995Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
472572af6995Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
472672af6995Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
472772af6995Smrg	;;
472872af6995Smrg      nagfor*)
472972af6995Smrg	# NAG Fortran compiler
473072af6995Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
473172af6995Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
473272af6995Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
473372af6995Smrg	;;
473472af6995Smrg      tcc*)
473572af6995Smrg	# Fabrice Bellard et al's Tiny C Compiler
473672af6995Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
473772af6995Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
473872af6995Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
473972af6995Smrg	;;
474072af6995Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
474172af6995Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
474272af6995Smrg	# which looks to be a dead project)
474372af6995Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
474472af6995Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
474572af6995Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
474672af6995Smrg        ;;
474772af6995Smrg      ccc*)
474872af6995Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
474972af6995Smrg        # All Alpha code is PIC.
475072af6995Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
475172af6995Smrg        ;;
475272af6995Smrg      xl* | bgxl* | bgf* | mpixl*)
475372af6995Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
475472af6995Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
475572af6995Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
475672af6995Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
475772af6995Smrg	;;
475872af6995Smrg      *)
4759a773ec55Smrg	case `$CC -V 2>&1 | $SED 5q` in
476072af6995Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
476172af6995Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
476272af6995Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
476372af6995Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
476472af6995Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
476572af6995Smrg	  ;;
476672af6995Smrg	*Sun\ F* | *Sun*Fortran*)
476772af6995Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
476872af6995Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
476972af6995Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
477072af6995Smrg	  ;;
477172af6995Smrg	*Sun\ C*)
477272af6995Smrg	  # Sun C 5.9
477372af6995Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
477472af6995Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
477572af6995Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
477672af6995Smrg	  ;;
477772af6995Smrg        *Intel*\ [[CF]]*Compiler*)
477872af6995Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
477972af6995Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
478072af6995Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
478172af6995Smrg	  ;;
478272af6995Smrg	*Portland\ Group*)
478372af6995Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
478472af6995Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
478572af6995Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
478672af6995Smrg	  ;;
478772af6995Smrg	esac
478872af6995Smrg	;;
478972af6995Smrg      esac
479072af6995Smrg      ;;
479172af6995Smrg
479272af6995Smrg    newsos6)
479372af6995Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
479472af6995Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
479572af6995Smrg      ;;
479672af6995Smrg
479772af6995Smrg    *nto* | *qnx*)
479872af6995Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
479972af6995Smrg      # it will coredump.
480072af6995Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
480172af6995Smrg      ;;
480272af6995Smrg
480372af6995Smrg    osf3* | osf4* | osf5*)
480472af6995Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
480572af6995Smrg      # All OSF/1 code is PIC.
480672af6995Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
480772af6995Smrg      ;;
480872af6995Smrg
480972af6995Smrg    rdos*)
481072af6995Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
481172af6995Smrg      ;;
481272af6995Smrg
481372af6995Smrg    solaris*)
481472af6995Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
481572af6995Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
481672af6995Smrg      case $cc_basename in
481772af6995Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
481872af6995Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
481972af6995Smrg      *)
482072af6995Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
482172af6995Smrg      esac
482272af6995Smrg      ;;
482372af6995Smrg
482472af6995Smrg    sunos4*)
482572af6995Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
482672af6995Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
482772af6995Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
482872af6995Smrg      ;;
482972af6995Smrg
483072af6995Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
483172af6995Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
483272af6995Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
483372af6995Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
483472af6995Smrg      ;;
483572af6995Smrg
483672af6995Smrg    sysv4*MP*)
483772af6995Smrg      if test -d /usr/nec; then
483872af6995Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
483972af6995Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
484072af6995Smrg      fi
484172af6995Smrg      ;;
484272af6995Smrg
484372af6995Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
484472af6995Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
484572af6995Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
484672af6995Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
484772af6995Smrg      ;;
484872af6995Smrg
484972af6995Smrg    unicos*)
485072af6995Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
485172af6995Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
485272af6995Smrg      ;;
485372af6995Smrg
485472af6995Smrg    uts4*)
485572af6995Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
485672af6995Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
485772af6995Smrg      ;;
485872af6995Smrg
485972af6995Smrg    *)
486072af6995Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
486172af6995Smrg      ;;
486272af6995Smrg    esac
486372af6995Smrg  fi
486472af6995Smrg])
486572af6995Smrgcase $host_os in
486672af6995Smrg  # For platforms that do not support PIC, -DPIC is meaningless:
486772af6995Smrg  *djgpp*)
486872af6995Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
486972af6995Smrg    ;;
487072af6995Smrg  *)
487172af6995Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
487272af6995Smrg    ;;
487372af6995Smrgesac
487472af6995Smrg
487572af6995SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
487672af6995Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
487772af6995Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
487872af6995Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
487972af6995Smrg
488072af6995Smrg#
488172af6995Smrg# Check to make sure the PIC flag actually works.
488272af6995Smrg#
488372af6995Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
488472af6995Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
488572af6995Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
488672af6995Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
488772af6995Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
488872af6995Smrg     "" | " "*) ;;
488972af6995Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
489072af6995Smrg     esac],
489172af6995Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
489272af6995Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
489372af6995Smrgfi
489472af6995Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
489572af6995Smrg	[Additional compiler flags for building library objects])
489672af6995Smrg
489772af6995Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
489872af6995Smrg	[How to pass a linker flag through the compiler])
489972af6995Smrg#
490072af6995Smrg# Check to make sure the static flag actually works.
490172af6995Smrg#
490272af6995Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
490372af6995Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
490472af6995Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
490572af6995Smrg  $lt_tmp_static_flag,
490672af6995Smrg  [],
490772af6995Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
490872af6995Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
490972af6995Smrg	[Compiler flag to prevent dynamic linking])
491072af6995Smrg])# _LT_COMPILER_PIC
491172af6995Smrg
491272af6995Smrg
491372af6995Smrg# _LT_LINKER_SHLIBS([TAGNAME])
491472af6995Smrg# ----------------------------
491572af6995Smrg# See if the linker supports building shared libraries.
491672af6995Smrgm4_defun([_LT_LINKER_SHLIBS],
491772af6995Smrg[AC_REQUIRE([LT_PATH_LD])dnl
491872af6995SmrgAC_REQUIRE([LT_PATH_NM])dnl
491972af6995Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
492072af6995Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
492172af6995Smrgm4_require([_LT_DECL_EGREP])dnl
492272af6995Smrgm4_require([_LT_DECL_SED])dnl
492372af6995Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
492472af6995Smrgm4_require([_LT_TAG_COMPILER])dnl
492572af6995SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
492672af6995Smrgm4_if([$1], [CXX], [
492772af6995Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
492872af6995Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
492972af6995Smrg  case $host_os in
493072af6995Smrg  aix[[4-9]]*)
493172af6995Smrg    # If we're using GNU nm, then we don't want the "-C" option.
493272af6995Smrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
493372af6995Smrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
493472af6995Smrg    # weak defined symbols like other global defined symbols, whereas
493572af6995Smrg    # GNU nm marks them as "W".
493672af6995Smrg    # While the 'weak' keyword is ignored in the Export File, we need
493772af6995Smrg    # it in the Import File for the 'aix-soname' feature, so we have
493872af6995Smrg    # to replace the "-B" option with "-P" for AIX nm.
493972af6995Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
494072af6995Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
494172af6995Smrg    else
4942a773ec55Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
494372af6995Smrg    fi
494472af6995Smrg    ;;
494572af6995Smrg  pw32*)
494672af6995Smrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
494772af6995Smrg    ;;
494872af6995Smrg  cygwin* | mingw* | cegcc*)
494972af6995Smrg    case $cc_basename in
4950a773ec55Smrg    cl* | icl*)
495172af6995Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
495272af6995Smrg      ;;
495372af6995Smrg    *)
495472af6995Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
495572af6995Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
495672af6995Smrg      ;;
495772af6995Smrg    esac
495872af6995Smrg    ;;
495972af6995Smrg  *)
496072af6995Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
496172af6995Smrg    ;;
496272af6995Smrg  esac
496372af6995Smrg], [
496472af6995Smrg  runpath_var=
496572af6995Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
496672af6995Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
496772af6995Smrg  _LT_TAGVAR(archive_cmds, $1)=
496872af6995Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
496972af6995Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
497072af6995Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
497172af6995Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
497272af6995Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
497372af6995Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
497472af6995Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
497572af6995Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
497672af6995Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
497772af6995Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
497872af6995Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
497972af6995Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
498072af6995Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
498172af6995Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
498272af6995Smrg  _LT_TAGVAR(module_cmds, $1)=
498372af6995Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
498472af6995Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
498572af6995Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
498672af6995Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
498772af6995Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
498872af6995Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
498972af6995Smrg  # included in the symbol list
499072af6995Smrg  _LT_TAGVAR(include_expsyms, $1)=
499172af6995Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
499272af6995Smrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
499372af6995Smrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
499472af6995Smrg  # as well as any symbol that contains 'd'.
499572af6995Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
499672af6995Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
499772af6995Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
499872af6995Smrg  # the symbol is explicitly referenced.  Since portable code cannot
499972af6995Smrg  # rely on this symbol name, it's probably fine to never include it in
500072af6995Smrg  # preloaded symbol tables.
500172af6995Smrg  # Exclude shared library initialization/finalization symbols.
500272af6995Smrgdnl Note also adjust exclude_expsyms for C++ above.
500372af6995Smrg  extract_expsyms_cmds=
500472af6995Smrg
500572af6995Smrg  case $host_os in
500672af6995Smrg  cygwin* | mingw* | pw32* | cegcc*)
5007a773ec55Smrg    # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
500872af6995Smrg    # When not using gcc, we currently assume that we are using
5009a773ec55Smrg    # Microsoft Visual C++ or Intel C++ Compiler.
501072af6995Smrg    if test yes != "$GCC"; then
501172af6995Smrg      with_gnu_ld=no
501272af6995Smrg    fi
501372af6995Smrg    ;;
501472af6995Smrg  interix*)
5015a773ec55Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
501672af6995Smrg    with_gnu_ld=yes
501772af6995Smrg    ;;
501872af6995Smrg  openbsd* | bitrig*)
501972af6995Smrg    with_gnu_ld=no
502072af6995Smrg    ;;
502172af6995Smrg  esac
502272af6995Smrg
502372af6995Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
502472af6995Smrg
502572af6995Smrg  # On some targets, GNU ld is compatible enough with the native linker
502672af6995Smrg  # that we're better off using the native interface for both.
502772af6995Smrg  lt_use_gnu_ld_interface=no
502872af6995Smrg  if test yes = "$with_gnu_ld"; then
502972af6995Smrg    case $host_os in
503072af6995Smrg      aix*)
503172af6995Smrg	# The AIX port of GNU ld has always aspired to compatibility
503272af6995Smrg	# with the native linker.  However, as the warning in the GNU ld
503372af6995Smrg	# block says, versions before 2.19.5* couldn't really create working
503472af6995Smrg	# shared libraries, regardless of the interface used.
503572af6995Smrg	case `$LD -v 2>&1` in
503672af6995Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
503772af6995Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
503872af6995Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
503972af6995Smrg	  *)
504072af6995Smrg	    lt_use_gnu_ld_interface=yes
504172af6995Smrg	    ;;
504272af6995Smrg	esac
504372af6995Smrg	;;
504472af6995Smrg      *)
504572af6995Smrg	lt_use_gnu_ld_interface=yes
504672af6995Smrg	;;
504772af6995Smrg    esac
504872af6995Smrg  fi
504972af6995Smrg
505072af6995Smrg  if test yes = "$lt_use_gnu_ld_interface"; then
505172af6995Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
505272af6995Smrg    wlarc='$wl'
505372af6995Smrg
505472af6995Smrg    # Set some defaults for GNU ld with shared library support. These
505572af6995Smrg    # are reset later if shared libraries are not supported. Putting them
505672af6995Smrg    # here allows them to be overridden if necessary.
505772af6995Smrg    runpath_var=LD_RUN_PATH
505872af6995Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
505972af6995Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
506072af6995Smrg    # ancient GNU ld didn't support --whole-archive et. al.
506172af6995Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
506272af6995Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
506372af6995Smrg    else
506472af6995Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
506572af6995Smrg    fi
506672af6995Smrg    supports_anon_versioning=no
5067a773ec55Smrg    case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in
506872af6995Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
506972af6995Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
507072af6995Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
507172af6995Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
507272af6995Smrg      *\ 2.11.*) ;; # other 2.11 versions
507372af6995Smrg      *) supports_anon_versioning=yes ;;
507472af6995Smrg    esac
507572af6995Smrg
507672af6995Smrg    # See if GNU ld supports shared libraries.
507772af6995Smrg    case $host_os in
507872af6995Smrg    aix[[3-9]]*)
507972af6995Smrg      # On AIX/PPC, the GNU linker is very broken
508072af6995Smrg      if test ia64 != "$host_cpu"; then
508172af6995Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
508272af6995Smrg	cat <<_LT_EOF 1>&2
508372af6995Smrg
508472af6995Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
508572af6995Smrg*** to be unable to reliably create shared libraries on AIX.
508672af6995Smrg*** Therefore, libtool is disabling shared libraries support.  If you
508772af6995Smrg*** really care for shared libraries, you may want to install binutils
508872af6995Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
508972af6995Smrg*** You will then need to restart the configuration process.
509072af6995Smrg
509172af6995Smrg_LT_EOF
509272af6995Smrg      fi
509372af6995Smrg      ;;
509472af6995Smrg
509572af6995Smrg    amigaos*)
509672af6995Smrg      case $host_cpu in
509772af6995Smrg      powerpc)
509872af6995Smrg            # see comment about AmigaOS4 .so support
509972af6995Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
510072af6995Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
510172af6995Smrg        ;;
510272af6995Smrg      m68k)
510372af6995Smrg            _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)'
510472af6995Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
510572af6995Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
510672af6995Smrg        ;;
510772af6995Smrg      esac
510872af6995Smrg      ;;
510972af6995Smrg
511072af6995Smrg    beos*)
511172af6995Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
511272af6995Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
511372af6995Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
511472af6995Smrg	# support --undefined.  This deserves some investigation.  FIXME
511572af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
511672af6995Smrg      else
511772af6995Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
511872af6995Smrg      fi
511972af6995Smrg      ;;
512072af6995Smrg
512172af6995Smrg    cygwin* | mingw* | pw32* | cegcc*)
512272af6995Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
512372af6995Smrg      # as there is no search path for DLLs.
512472af6995Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
512572af6995Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
512672af6995Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
512772af6995Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
512872af6995Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
512972af6995Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
513072af6995Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
513172af6995Smrg
513272af6995Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
513372af6995Smrg        _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'
513472af6995Smrg	# If the export-symbols file already is a .def file, use it as
513572af6995Smrg	# is; otherwise, prepend EXPORTS...
513672af6995Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
513772af6995Smrg          cp $export_symbols $output_objdir/$soname.def;
513872af6995Smrg        else
513972af6995Smrg          echo EXPORTS > $output_objdir/$soname.def;
514072af6995Smrg          cat $export_symbols >> $output_objdir/$soname.def;
514172af6995Smrg        fi~
514272af6995Smrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
514372af6995Smrg      else
514472af6995Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
514572af6995Smrg      fi
514672af6995Smrg      ;;
514772af6995Smrg
514872af6995Smrg    haiku*)
514972af6995Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
515072af6995Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
515172af6995Smrg      ;;
515272af6995Smrg
515372af6995Smrg    os2*)
515472af6995Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
515572af6995Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
515672af6995Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
515772af6995Smrg      shrext_cmds=.dll
515872af6995Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
515972af6995Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
516072af6995Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
516172af6995Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
516272af6995Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
516372af6995Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
516472af6995Smrg	emximp -o $lib $output_objdir/$libname.def'
516572af6995Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
516672af6995Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
516772af6995Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
516872af6995Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
516972af6995Smrg	prefix_cmds="$SED"~
517072af6995Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
517172af6995Smrg	  prefix_cmds="$prefix_cmds -e 1d";
517272af6995Smrg	fi~
517372af6995Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
517472af6995Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
517572af6995Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
517672af6995Smrg	emximp -o $lib $output_objdir/$libname.def'
517772af6995Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
517872af6995Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5179a773ec55Smrg      _LT_TAGVAR(file_list_spec, $1)='@'
518072af6995Smrg      ;;
518172af6995Smrg
518272af6995Smrg    interix[[3-9]]*)
518372af6995Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
518472af6995Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
518572af6995Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
518672af6995Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
518772af6995Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
518872af6995Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
518972af6995Smrg      # default) and relocated if they conflict, which is a slow very memory
519072af6995Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
519172af6995Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
519272af6995Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
519372af6995Smrg      _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'
5194a773ec55Smrg      _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'
519572af6995Smrg      ;;
519672af6995Smrg
519772af6995Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
519872af6995Smrg      tmp_diet=no
519972af6995Smrg      if test linux-dietlibc = "$host_os"; then
520072af6995Smrg	case $cc_basename in
520172af6995Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
520272af6995Smrg	esac
520372af6995Smrg      fi
520472af6995Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
520572af6995Smrg	 && test no = "$tmp_diet"
520672af6995Smrg      then
520772af6995Smrg	tmp_addflag=' $pic_flag'
520872af6995Smrg	tmp_sharedflag='-shared'
520972af6995Smrg	case $cc_basename,$host_cpu in
521072af6995Smrg        pgcc*)				# Portland Group C compiler
521172af6995Smrg	  _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'
521272af6995Smrg	  tmp_addflag=' $pic_flag'
521372af6995Smrg	  ;;
521472af6995Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
521572af6995Smrg					# Portland Group f77 and f90 compilers
521672af6995Smrg	  _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'
521772af6995Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
521872af6995Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
521972af6995Smrg	  tmp_addflag=' -i_dynamic' ;;
522072af6995Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
522172af6995Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
522272af6995Smrg	ifc* | ifort*)			# Intel Fortran compiler
522372af6995Smrg	  tmp_addflag=' -nofor_main' ;;
522472af6995Smrg	lf95*)				# Lahey Fortran 8.1
522572af6995Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
522672af6995Smrg	  tmp_sharedflag='--shared' ;;
522772af6995Smrg        nagfor*)                        # NAGFOR 5.3
522872af6995Smrg          tmp_sharedflag='-Wl,-shared' ;;
522972af6995Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
523072af6995Smrg	  tmp_sharedflag='-qmkshrobj'
523172af6995Smrg	  tmp_addflag= ;;
523272af6995Smrg	nvcc*)	# Cuda Compiler Driver 2.2
523372af6995Smrg	  _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'
523472af6995Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
523572af6995Smrg	  ;;
523672af6995Smrg	esac
5237a773ec55Smrg	case `$CC -V 2>&1 | $SED 5q` in
523872af6995Smrg	*Sun\ C*)			# Sun C 5.9
523972af6995Smrg	  _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'
524072af6995Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
524172af6995Smrg	  tmp_sharedflag='-G' ;;
524272af6995Smrg	*Sun\ F*)			# Sun Fortran 8.3
524372af6995Smrg	  tmp_sharedflag='-G' ;;
524472af6995Smrg	esac
524572af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
524672af6995Smrg
524772af6995Smrg        if test yes = "$supports_anon_versioning"; then
524872af6995Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5249a773ec55Smrg            cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
525072af6995Smrg            echo "local: *; };" >> $output_objdir/$libname.ver~
525172af6995Smrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
525272af6995Smrg        fi
525372af6995Smrg
525472af6995Smrg	case $cc_basename in
525572af6995Smrg	tcc*)
525672af6995Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
525772af6995Smrg	  ;;
525872af6995Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
525972af6995Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
526072af6995Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
526172af6995Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
526272af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
526372af6995Smrg	  if test yes = "$supports_anon_versioning"; then
526472af6995Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5265a773ec55Smrg              cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
526672af6995Smrg              echo "local: *; };" >> $output_objdir/$libname.ver~
526772af6995Smrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
526872af6995Smrg	  fi
526972af6995Smrg	  ;;
527072af6995Smrg	esac
527172af6995Smrg      else
527272af6995Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
527372af6995Smrg      fi
527472af6995Smrg      ;;
527572af6995Smrg
5276362b94d5Smrg    netbsd*)
527772af6995Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
527872af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
527972af6995Smrg	wlarc=
528072af6995Smrg      else
528172af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
528272af6995Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
528372af6995Smrg      fi
528472af6995Smrg      ;;
528572af6995Smrg
528672af6995Smrg    solaris*)
528772af6995Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
528872af6995Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
528972af6995Smrg	cat <<_LT_EOF 1>&2
529072af6995Smrg
529172af6995Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
529272af6995Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
529372af6995Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
529472af6995Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
529572af6995Smrg*** your PATH or compiler configuration so that the native linker is
529672af6995Smrg*** used, and then restart.
529772af6995Smrg
529872af6995Smrg_LT_EOF
529972af6995Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
530072af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
530172af6995Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
530272af6995Smrg      else
530372af6995Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
530472af6995Smrg      fi
530572af6995Smrg      ;;
530672af6995Smrg
530772af6995Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
530872af6995Smrg      case `$LD -v 2>&1` in
530972af6995Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
531072af6995Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
531172af6995Smrg	cat <<_LT_EOF 1>&2
531272af6995Smrg
531372af6995Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
531472af6995Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
531572af6995Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
531672af6995Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
531772af6995Smrg*** your PATH or compiler configuration so that the native linker is
531872af6995Smrg*** used, and then restart.
531972af6995Smrg
532072af6995Smrg_LT_EOF
532172af6995Smrg	;;
532272af6995Smrg	*)
532372af6995Smrg	  # For security reasons, it is highly recommended that you always
532472af6995Smrg	  # use absolute paths for naming shared libraries, and exclude the
532572af6995Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
532672af6995Smrg	  # requires that you compile everything twice, which is a pain.
532772af6995Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
532872af6995Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
532972af6995Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
533072af6995Smrg	    _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'
533172af6995Smrg	  else
533272af6995Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
533372af6995Smrg	  fi
533472af6995Smrg	;;
533572af6995Smrg      esac
533672af6995Smrg      ;;
533772af6995Smrg
533872af6995Smrg    sunos4*)
533972af6995Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
534072af6995Smrg      wlarc=
534172af6995Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
534272af6995Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
534372af6995Smrg      ;;
534472af6995Smrg
534572af6995Smrg    *)
534672af6995Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
534772af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
534872af6995Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
534972af6995Smrg      else
535072af6995Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
535172af6995Smrg      fi
535272af6995Smrg      ;;
535372af6995Smrg    esac
535472af6995Smrg
535572af6995Smrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
535672af6995Smrg      runpath_var=
535772af6995Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
535872af6995Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
535972af6995Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
536072af6995Smrg    fi
536172af6995Smrg  else
536272af6995Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
536372af6995Smrg    case $host_os in
536472af6995Smrg    aix3*)
536572af6995Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
536672af6995Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
536772af6995Smrg      _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'
536872af6995Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
536972af6995Smrg      # are no directories specified by -L.
537072af6995Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
537172af6995Smrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
537272af6995Smrg	# Neither direct hardcoding nor static linking is supported with a
537372af6995Smrg	# broken collect2.
537472af6995Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
537572af6995Smrg      fi
537672af6995Smrg      ;;
537772af6995Smrg
537872af6995Smrg    aix[[4-9]]*)
537972af6995Smrg      if test ia64 = "$host_cpu"; then
538072af6995Smrg	# On IA64, the linker does run time linking by default, so we don't
538172af6995Smrg	# have to do anything special.
538272af6995Smrg	aix_use_runtimelinking=no
538372af6995Smrg	exp_sym_flag='-Bexport'
538472af6995Smrg	no_entry_flag=
538572af6995Smrg      else
538672af6995Smrg	# If we're using GNU nm, then we don't want the "-C" option.
538772af6995Smrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
538872af6995Smrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
538972af6995Smrg	# weak defined symbols like other global defined symbols, whereas
539072af6995Smrg	# GNU nm marks them as "W".
539172af6995Smrg	# While the 'weak' keyword is ignored in the Export File, we need
539272af6995Smrg	# it in the Import File for the 'aix-soname' feature, so we have
539372af6995Smrg	# to replace the "-B" option with "-P" for AIX nm.
539472af6995Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
539572af6995Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
539672af6995Smrg	else
5397a773ec55Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
539872af6995Smrg	fi
539972af6995Smrg	aix_use_runtimelinking=no
540072af6995Smrg
540172af6995Smrg	# Test if we are trying to use run time linking or normal
540272af6995Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
540372af6995Smrg	# have runtime linking enabled, and use it for executables.
540472af6995Smrg	# For shared libraries, we enable/disable runtime linking
540572af6995Smrg	# depending on the kind of the shared library created -
540672af6995Smrg	# when "with_aix_soname,aix_use_runtimelinking" is:
540772af6995Smrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
540872af6995Smrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
540972af6995Smrg	#            lib.a           static archive
541072af6995Smrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
541172af6995Smrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
541272af6995Smrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
541372af6995Smrg	#            lib.a(lib.so.V) shared, rtl:no
541472af6995Smrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
541572af6995Smrg	#            lib.a           static archive
541672af6995Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
541772af6995Smrg	  for ld_flag in $LDFLAGS; do
541872af6995Smrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
541972af6995Smrg	    aix_use_runtimelinking=yes
542072af6995Smrg	    break
542172af6995Smrg	  fi
542272af6995Smrg	  done
542372af6995Smrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
542472af6995Smrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
542572af6995Smrg	    # so we don't have lib.a shared libs to link our executables.
542672af6995Smrg	    # We have to force runtime linking in this case.
542772af6995Smrg	    aix_use_runtimelinking=yes
542872af6995Smrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
542972af6995Smrg	  fi
543072af6995Smrg	  ;;
543172af6995Smrg	esac
543272af6995Smrg
543372af6995Smrg	exp_sym_flag='-bexport'
543472af6995Smrg	no_entry_flag='-bnoentry'
543572af6995Smrg      fi
543672af6995Smrg
543772af6995Smrg      # When large executables or shared objects are built, AIX ld can
543872af6995Smrg      # have problems creating the table of contents.  If linking a library
543972af6995Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
544072af6995Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
544172af6995Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
544272af6995Smrg
544372af6995Smrg      _LT_TAGVAR(archive_cmds, $1)=''
544472af6995Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
544572af6995Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
544672af6995Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
544772af6995Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
544872af6995Smrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
544972af6995Smrg      case $with_aix_soname,$aix_use_runtimelinking in
545072af6995Smrg      aix,*) ;; # traditional, no import file
545172af6995Smrg      svr4,* | *,yes) # use import file
545272af6995Smrg	# The Import File defines what to hardcode.
545372af6995Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
545472af6995Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
545572af6995Smrg	;;
545672af6995Smrg      esac
545772af6995Smrg
545872af6995Smrg      if test yes = "$GCC"; then
545972af6995Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
546072af6995Smrg	# We only want to do this on AIX 4.2 and lower, the check
546172af6995Smrg	# below for broken collect2 doesn't work under 4.3+
546272af6995Smrg	  collect2name=`$CC -print-prog-name=collect2`
546372af6995Smrg	  if test -f "$collect2name" &&
546472af6995Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
546572af6995Smrg	  then
546672af6995Smrg	  # We have reworked collect2
546772af6995Smrg	  :
546872af6995Smrg	  else
546972af6995Smrg	  # We have old collect2
547072af6995Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
547172af6995Smrg	  # It fails to find uninstalled libraries when the uninstalled
547272af6995Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
547372af6995Smrg	  # to unsupported forces relinking
547472af6995Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
547572af6995Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
547672af6995Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
547772af6995Smrg	  fi
547872af6995Smrg	  ;;
547972af6995Smrg	esac
548072af6995Smrg	shared_flag='-shared'
548172af6995Smrg	if test yes = "$aix_use_runtimelinking"; then
548272af6995Smrg	  shared_flag="$shared_flag "'$wl-G'
548372af6995Smrg	fi
548472af6995Smrg	# Need to ensure runtime linking is disabled for the traditional
548572af6995Smrg	# shared library, or the linker may eventually find shared libraries
548672af6995Smrg	# /with/ Import File - we do not want to mix them.
548772af6995Smrg	shared_flag_aix='-shared'
548872af6995Smrg	shared_flag_svr4='-shared $wl-G'
548972af6995Smrg      else
549072af6995Smrg	# not using gcc
549172af6995Smrg	if test ia64 = "$host_cpu"; then
549272af6995Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
549372af6995Smrg	# chokes on -Wl,-G. The following line is correct:
549472af6995Smrg	  shared_flag='-G'
549572af6995Smrg	else
549672af6995Smrg	  if test yes = "$aix_use_runtimelinking"; then
549772af6995Smrg	    shared_flag='$wl-G'
549872af6995Smrg	  else
549972af6995Smrg	    shared_flag='$wl-bM:SRE'
550072af6995Smrg	  fi
550172af6995Smrg	  shared_flag_aix='$wl-bM:SRE'
550272af6995Smrg	  shared_flag_svr4='$wl-G'
550372af6995Smrg	fi
550472af6995Smrg      fi
550572af6995Smrg
550672af6995Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
550772af6995Smrg      # It seems that -bexpall does not export symbols beginning with
550872af6995Smrg      # underscore (_), so it is better to generate a list of symbols to export.
550972af6995Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
551072af6995Smrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
551172af6995Smrg	# Warning - without using the other runtime loading flags (-brtl),
551272af6995Smrg	# -berok will link without error, but may produce a broken library.
551372af6995Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
551472af6995Smrg        # Determine the default libpath from the value encoded in an
551572af6995Smrg        # empty executable.
551672af6995Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
551772af6995Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
551872af6995Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
551972af6995Smrg      else
552072af6995Smrg	if test ia64 = "$host_cpu"; then
552172af6995Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
552272af6995Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
552372af6995Smrg	  _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"
552472af6995Smrg	else
552572af6995Smrg	 # Determine the default libpath from the value encoded in an
552672af6995Smrg	 # empty executable.
552772af6995Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
552872af6995Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
552972af6995Smrg	  # Warning - without using the other run time loading flags,
553072af6995Smrg	  # -berok will link without error, but may produce a broken library.
553172af6995Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
553272af6995Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
553372af6995Smrg	  if test yes = "$with_gnu_ld"; then
553472af6995Smrg	    # We only use this code for GNU lds that support --whole-archive.
553572af6995Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
553672af6995Smrg	  else
553772af6995Smrg	    # Exported symbols can be pulled into shared objects from archives
553872af6995Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
553972af6995Smrg	  fi
554072af6995Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
554172af6995Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
554272af6995Smrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
554372af6995Smrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
554472af6995Smrg	  if test svr4 != "$with_aix_soname"; then
554572af6995Smrg	    # This is similar to how AIX traditionally builds its shared libraries.
554672af6995Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
554772af6995Smrg	  fi
554872af6995Smrg	  if test aix != "$with_aix_soname"; then
554972af6995Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
555072af6995Smrg	  else
555172af6995Smrg	    # used by -dlpreopen to get the symbols
555272af6995Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
555372af6995Smrg	  fi
555472af6995Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
555572af6995Smrg	fi
555672af6995Smrg      fi
555772af6995Smrg      ;;
555872af6995Smrg
555972af6995Smrg    amigaos*)
556072af6995Smrg      case $host_cpu in
556172af6995Smrg      powerpc)
556272af6995Smrg            # see comment about AmigaOS4 .so support
556372af6995Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
556472af6995Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
556572af6995Smrg        ;;
556672af6995Smrg      m68k)
556772af6995Smrg            _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)'
556872af6995Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
556972af6995Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
557072af6995Smrg        ;;
557172af6995Smrg      esac
557272af6995Smrg      ;;
557372af6995Smrg
557472af6995Smrg    bsdi[[45]]*)
557572af6995Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
557672af6995Smrg      ;;
557772af6995Smrg
557872af6995Smrg    cygwin* | mingw* | pw32* | cegcc*)
557972af6995Smrg      # When not using gcc, we currently assume that we are using
5580a773ec55Smrg      # Microsoft Visual C++ or Intel C++ Compiler.
558172af6995Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
558272af6995Smrg      # no search path for DLLs.
558372af6995Smrg      case $cc_basename in
5584a773ec55Smrg      cl* | icl*)
5585a773ec55Smrg	# Native MSVC or ICC
558672af6995Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
558772af6995Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
558872af6995Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
558972af6995Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
559072af6995Smrg	# Tell ltmain to make .lib files, not .a files.
559172af6995Smrg	libext=lib
559272af6995Smrg	# Tell ltmain to make .dll files, not .so files.
559372af6995Smrg	shrext_cmds=.dll
559472af6995Smrg	# FIXME: Setting linknames here is a bad hack.
559572af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
559672af6995Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
559772af6995Smrg            cp "$export_symbols" "$output_objdir/$soname.def";
559872af6995Smrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
559972af6995Smrg          else
560072af6995Smrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
560172af6995Smrg          fi~
560272af6995Smrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
560372af6995Smrg          linknames='
560472af6995Smrg	# The linker will not automatically build a static lib if we build a DLL.
560572af6995Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
560672af6995Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
560772af6995Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
560872af6995Smrg	_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'
560972af6995Smrg	# Don't use ranlib
561072af6995Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
561172af6995Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
561272af6995Smrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
561372af6995Smrg          case $lt_outputfile in
561472af6995Smrg            *.exe|*.EXE) ;;
561572af6995Smrg            *)
561672af6995Smrg              lt_outputfile=$lt_outputfile.exe
561772af6995Smrg              lt_tool_outputfile=$lt_tool_outputfile.exe
561872af6995Smrg              ;;
561972af6995Smrg          esac~
562072af6995Smrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
562172af6995Smrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
562272af6995Smrg            $RM "$lt_outputfile.manifest";
562372af6995Smrg          fi'
562472af6995Smrg	;;
562572af6995Smrg      *)
5626a773ec55Smrg	# Assume MSVC and ICC wrapper
562772af6995Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
562872af6995Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
562972af6995Smrg	# Tell ltmain to make .lib files, not .a files.
563072af6995Smrg	libext=lib
563172af6995Smrg	# Tell ltmain to make .dll files, not .so files.
563272af6995Smrg	shrext_cmds=.dll
563372af6995Smrg	# FIXME: Setting linknames here is a bad hack.
563472af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
563572af6995Smrg	# The linker will automatically build a .lib file if we build a DLL.
563672af6995Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
563772af6995Smrg	# FIXME: Should let the user specify the lib program.
563872af6995Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
563972af6995Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
564072af6995Smrg	;;
564172af6995Smrg      esac
564272af6995Smrg      ;;
564372af6995Smrg
564472af6995Smrg    darwin* | rhapsody*)
564572af6995Smrg      _LT_DARWIN_LINKER_FEATURES($1)
564672af6995Smrg      ;;
564772af6995Smrg
564872af6995Smrg    dgux*)
564972af6995Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
565072af6995Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
565172af6995Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
565272af6995Smrg      ;;
565372af6995Smrg
565472af6995Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
565572af6995Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
565672af6995Smrg    # does not break anything, and helps significantly (at the cost of a little
565772af6995Smrg    # extra space).
565872af6995Smrg    freebsd2.2*)
565972af6995Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
566072af6995Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
566172af6995Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
566272af6995Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
566372af6995Smrg      ;;
566472af6995Smrg
566572af6995Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
566672af6995Smrg    freebsd2.*)
566772af6995Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
566872af6995Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
566972af6995Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
567072af6995Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
567172af6995Smrg      ;;
567272af6995Smrg
567372af6995Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5674a773ec55Smrg    freebsd* | dragonfly* | midnightbsd*)
567572af6995Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
567672af6995Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
567772af6995Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
567872af6995Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
567972af6995Smrg      ;;
568072af6995Smrg
568172af6995Smrg    hpux9*)
568272af6995Smrg      if test yes = "$GCC"; then
568372af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
568472af6995Smrg      else
568572af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
568672af6995Smrg      fi
568772af6995Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
568872af6995Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
568972af6995Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
569072af6995Smrg
569172af6995Smrg      # hardcode_minus_L: Not really in the search PATH,
569272af6995Smrg      # but as the default location of the library.
569372af6995Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
569472af6995Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
569572af6995Smrg      ;;
569672af6995Smrg
569772af6995Smrg    hpux10*)
569872af6995Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
569972af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
570072af6995Smrg      else
570172af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
570272af6995Smrg      fi
570372af6995Smrg      if test no = "$with_gnu_ld"; then
570472af6995Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
570572af6995Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
570672af6995Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
570772af6995Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
570872af6995Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
570972af6995Smrg	# hardcode_minus_L: Not really in the search PATH,
571072af6995Smrg	# but as the default location of the library.
571172af6995Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
571272af6995Smrg      fi
571372af6995Smrg      ;;
571472af6995Smrg
571572af6995Smrg    hpux11*)
571672af6995Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
571772af6995Smrg	case $host_cpu in
571872af6995Smrg	hppa*64*)
571972af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
572072af6995Smrg	  ;;
572172af6995Smrg	ia64*)
572272af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
572372af6995Smrg	  ;;
572472af6995Smrg	*)
572572af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
572672af6995Smrg	  ;;
572772af6995Smrg	esac
572872af6995Smrg      else
572972af6995Smrg	case $host_cpu in
573072af6995Smrg	hppa*64*)
573172af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
573272af6995Smrg	  ;;
573372af6995Smrg	ia64*)
573472af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
573572af6995Smrg	  ;;
573672af6995Smrg	*)
573772af6995Smrg	m4_if($1, [], [
573872af6995Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
573972af6995Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
574072af6995Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
574172af6995Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
574272af6995Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
574372af6995Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
574472af6995Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
574572af6995Smrg	  ;;
574672af6995Smrg	esac
574772af6995Smrg      fi
574872af6995Smrg      if test no = "$with_gnu_ld"; then
574972af6995Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
575072af6995Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
575172af6995Smrg
575272af6995Smrg	case $host_cpu in
575372af6995Smrg	hppa*64*|ia64*)
575472af6995Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
575572af6995Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
575672af6995Smrg	  ;;
575772af6995Smrg	*)
575872af6995Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
575972af6995Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
576072af6995Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
576172af6995Smrg
576272af6995Smrg	  # hardcode_minus_L: Not really in the search PATH,
576372af6995Smrg	  # but as the default location of the library.
576472af6995Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
576572af6995Smrg	  ;;
576672af6995Smrg	esac
576772af6995Smrg      fi
576872af6995Smrg      ;;
576972af6995Smrg
577072af6995Smrg    irix5* | irix6* | nonstopux*)
577172af6995Smrg      if test yes = "$GCC"; then
577272af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
577372af6995Smrg	# Try to use the -exported_symbol ld option, if it does not
577472af6995Smrg	# work, assume that -exports_file does not work either and
577572af6995Smrg	# implicitly export all symbols.
577672af6995Smrg	# This should be the same for all languages, so no per-tag cache variable.
577772af6995Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
577872af6995Smrg	  [lt_cv_irix_exported_symbol],
577972af6995Smrg	  [save_LDFLAGS=$LDFLAGS
578072af6995Smrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
578172af6995Smrg	   AC_LINK_IFELSE(
578272af6995Smrg	     [AC_LANG_SOURCE(
578372af6995Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
578472af6995Smrg			      [C++], [[int foo (void) { return 0; }]],
578572af6995Smrg			      [Fortran 77], [[
578672af6995Smrg      subroutine foo
578772af6995Smrg      end]],
578872af6995Smrg			      [Fortran], [[
578972af6995Smrg      subroutine foo
579072af6995Smrg      end]])])],
579172af6995Smrg	      [lt_cv_irix_exported_symbol=yes],
579272af6995Smrg	      [lt_cv_irix_exported_symbol=no])
579372af6995Smrg           LDFLAGS=$save_LDFLAGS])
579472af6995Smrg	if test yes = "$lt_cv_irix_exported_symbol"; then
579572af6995Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
579672af6995Smrg	fi
579772af6995Smrg      else
579872af6995Smrg	_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'
579972af6995Smrg	_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'
580072af6995Smrg      fi
580172af6995Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
580272af6995Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
580372af6995Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
580472af6995Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
580572af6995Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
580672af6995Smrg      ;;
580772af6995Smrg
580872af6995Smrg    linux*)
580972af6995Smrg      case $cc_basename in
581072af6995Smrg      tcc*)
581172af6995Smrg	# Fabrice Bellard et al's Tiny C Compiler
581272af6995Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
581372af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
581472af6995Smrg	;;
581572af6995Smrg      esac
581672af6995Smrg      ;;
581772af6995Smrg
5818362b94d5Smrg    netbsd*)
581972af6995Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
582072af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
582172af6995Smrg      else
582272af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
582372af6995Smrg      fi
582472af6995Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
582572af6995Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
582672af6995Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
582772af6995Smrg      ;;
582872af6995Smrg
582972af6995Smrg    newsos6)
583072af6995Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
583172af6995Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
583272af6995Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
583372af6995Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
583472af6995Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
583572af6995Smrg      ;;
583672af6995Smrg
583772af6995Smrg    *nto* | *qnx*)
583872af6995Smrg      ;;
583972af6995Smrg
584072af6995Smrg    openbsd* | bitrig*)
584172af6995Smrg      if test -f /usr/libexec/ld.so; then
584272af6995Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
584372af6995Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
584472af6995Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
584572af6995Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
584672af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
584772af6995Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
584872af6995Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
584972af6995Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
585072af6995Smrg	else
585172af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
585272af6995Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
585372af6995Smrg	fi
585472af6995Smrg      else
585572af6995Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
585672af6995Smrg      fi
585772af6995Smrg      ;;
585872af6995Smrg
585972af6995Smrg    os2*)
586072af6995Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
586172af6995Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
586272af6995Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
586372af6995Smrg      shrext_cmds=.dll
586472af6995Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
586572af6995Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
586672af6995Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
586772af6995Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
586872af6995Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
586972af6995Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
587072af6995Smrg	emximp -o $lib $output_objdir/$libname.def'
587172af6995Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
587272af6995Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
587372af6995Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
587472af6995Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
587572af6995Smrg	prefix_cmds="$SED"~
587672af6995Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
587772af6995Smrg	  prefix_cmds="$prefix_cmds -e 1d";
587872af6995Smrg	fi~
587972af6995Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
588072af6995Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
588172af6995Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
588272af6995Smrg	emximp -o $lib $output_objdir/$libname.def'
588372af6995Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
588472af6995Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5885a773ec55Smrg      _LT_TAGVAR(file_list_spec, $1)='@'
588672af6995Smrg      ;;
588772af6995Smrg
588872af6995Smrg    osf3*)
588972af6995Smrg      if test yes = "$GCC"; then
589072af6995Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
589172af6995Smrg	_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'
589272af6995Smrg      else
589372af6995Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
589472af6995Smrg	_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'
589572af6995Smrg      fi
589672af6995Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
589772af6995Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
589872af6995Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
589972af6995Smrg      ;;
590072af6995Smrg
590172af6995Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
590272af6995Smrg      if test yes = "$GCC"; then
590372af6995Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
590472af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
590572af6995Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
590672af6995Smrg      else
590772af6995Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
590872af6995Smrg	_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'
590972af6995Smrg	_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~
591072af6995Smrg          $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'
591172af6995Smrg
591272af6995Smrg	# Both c and cxx compiler support -rpath directly
591372af6995Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
591472af6995Smrg      fi
591572af6995Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
591672af6995Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
591772af6995Smrg      ;;
591872af6995Smrg
591972af6995Smrg    solaris*)
592072af6995Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
592172af6995Smrg      if test yes = "$GCC"; then
592272af6995Smrg	wlarc='$wl'
592372af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
592472af6995Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
592572af6995Smrg          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
592672af6995Smrg      else
592772af6995Smrg	case `$CC -V 2>&1` in
592872af6995Smrg	*"Compilers 5.0"*)
592972af6995Smrg	  wlarc=''
593072af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
593172af6995Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
593272af6995Smrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
593372af6995Smrg	  ;;
593472af6995Smrg	*)
593572af6995Smrg	  wlarc='$wl'
593672af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
593772af6995Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
593872af6995Smrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
593972af6995Smrg	  ;;
594072af6995Smrg	esac
594172af6995Smrg      fi
594272af6995Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
594372af6995Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
594472af6995Smrg      case $host_os in
594572af6995Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
594672af6995Smrg      *)
594772af6995Smrg	# The compiler driver will combine and reorder linker options,
594872af6995Smrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
594972af6995Smrg	# but is careful enough not to reorder.
595072af6995Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
595172af6995Smrg	if test yes = "$GCC"; then
595272af6995Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
595372af6995Smrg	else
595472af6995Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
595572af6995Smrg	fi
595672af6995Smrg	;;
595772af6995Smrg      esac
595872af6995Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
595972af6995Smrg      ;;
596072af6995Smrg
596172af6995Smrg    sunos4*)
596272af6995Smrg      if test sequent = "$host_vendor"; then
596372af6995Smrg	# Use $CC to link under sequent, because it throws in some extra .o
596472af6995Smrg	# files that make .init and .fini sections work.
596572af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
596672af6995Smrg      else
596772af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
596872af6995Smrg      fi
596972af6995Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
597072af6995Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
597172af6995Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
597272af6995Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
597372af6995Smrg      ;;
597472af6995Smrg
597572af6995Smrg    sysv4)
597672af6995Smrg      case $host_vendor in
597772af6995Smrg	sni)
597872af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
597972af6995Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
598072af6995Smrg	;;
598172af6995Smrg	siemens)
598272af6995Smrg	  ## LD is ld it makes a PLAMLIB
598372af6995Smrg	  ## CC just makes a GrossModule.
598472af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
598572af6995Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
598672af6995Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
598772af6995Smrg        ;;
598872af6995Smrg	motorola)
598972af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
599072af6995Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
599172af6995Smrg	;;
599272af6995Smrg      esac
599372af6995Smrg      runpath_var='LD_RUN_PATH'
599472af6995Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
599572af6995Smrg      ;;
599672af6995Smrg
599772af6995Smrg    sysv4.3*)
599872af6995Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
599972af6995Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
600072af6995Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
600172af6995Smrg      ;;
600272af6995Smrg
600372af6995Smrg    sysv4*MP*)
600472af6995Smrg      if test -d /usr/nec; then
600572af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
600672af6995Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
600772af6995Smrg	runpath_var=LD_RUN_PATH
600872af6995Smrg	hardcode_runpath_var=yes
600972af6995Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
601072af6995Smrg      fi
601172af6995Smrg      ;;
601272af6995Smrg
601372af6995Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
601472af6995Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
601572af6995Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
601672af6995Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
601772af6995Smrg      runpath_var='LD_RUN_PATH'
601872af6995Smrg
601972af6995Smrg      if test yes = "$GCC"; then
602072af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
602172af6995Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
602272af6995Smrg      else
602372af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
602472af6995Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
602572af6995Smrg      fi
602672af6995Smrg      ;;
602772af6995Smrg
602872af6995Smrg    sysv5* | sco3.2v5* | sco5v6*)
602972af6995Smrg      # Note: We CANNOT use -z defs as we might desire, because we do not
603072af6995Smrg      # link with -lc, and that would cause any symbols used from libc to
603172af6995Smrg      # always be unresolved, which means just about no library would
603272af6995Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
603372af6995Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
603472af6995Smrg      # as -z defs.
603572af6995Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
603672af6995Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
603772af6995Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
603872af6995Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
603972af6995Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
604072af6995Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
604172af6995Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
604272af6995Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
604372af6995Smrg      runpath_var='LD_RUN_PATH'
604472af6995Smrg
604572af6995Smrg      if test yes = "$GCC"; then
604672af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
604772af6995Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
604872af6995Smrg      else
604972af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
605072af6995Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
605172af6995Smrg      fi
605272af6995Smrg      ;;
605372af6995Smrg
605472af6995Smrg    uts4*)
605572af6995Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
605672af6995Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
605772af6995Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
605872af6995Smrg      ;;
605972af6995Smrg
606072af6995Smrg    *)
606172af6995Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
606272af6995Smrg      ;;
606372af6995Smrg    esac
606472af6995Smrg
606572af6995Smrg    if test sni = "$host_vendor"; then
606672af6995Smrg      case $host in
606772af6995Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
606872af6995Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
606972af6995Smrg	;;
607072af6995Smrg      esac
607172af6995Smrg    fi
607272af6995Smrg  fi
607372af6995Smrg])
607472af6995SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
607572af6995Smrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
607672af6995Smrg
607772af6995Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
607872af6995Smrg
607972af6995Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
608072af6995Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
608172af6995Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
608272af6995Smrg    [The commands to extract the exported symbol list from a shared archive])
608372af6995Smrg
608472af6995Smrg#
608572af6995Smrg# Do we need to explicitly link libc?
608672af6995Smrg#
608772af6995Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
608872af6995Smrgx|xyes)
608972af6995Smrg  # Assume -lc should be added
609072af6995Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
609172af6995Smrg
609272af6995Smrg  if test yes,yes = "$GCC,$enable_shared"; then
609372af6995Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
609472af6995Smrg    *'~'*)
609572af6995Smrg      # FIXME: we may have to deal with multi-command sequences.
609672af6995Smrg      ;;
609772af6995Smrg    '$CC '*)
609872af6995Smrg      # Test whether the compiler implicitly links with -lc since on some
609972af6995Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
610072af6995Smrg      # to ld, don't add -lc before -lgcc.
610172af6995Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
610272af6995Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
610372af6995Smrg	[$RM conftest*
610472af6995Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
610572af6995Smrg
610672af6995Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
610772af6995Smrg	  soname=conftest
610872af6995Smrg	  lib=conftest
610972af6995Smrg	  libobjs=conftest.$ac_objext
611072af6995Smrg	  deplibs=
611172af6995Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
611272af6995Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
611372af6995Smrg	  compiler_flags=-v
611472af6995Smrg	  linker_flags=-v
611572af6995Smrg	  verstring=
611672af6995Smrg	  output_objdir=.
611772af6995Smrg	  libname=conftest
611872af6995Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
611972af6995Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
612072af6995Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
612172af6995Smrg	  then
612272af6995Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
612372af6995Smrg	  else
612472af6995Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
612572af6995Smrg	  fi
612672af6995Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
612772af6995Smrg	else
612872af6995Smrg	  cat conftest.err 1>&5
612972af6995Smrg	fi
613072af6995Smrg	$RM conftest*
613172af6995Smrg	])
613272af6995Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
613372af6995Smrg      ;;
613472af6995Smrg    esac
613572af6995Smrg  fi
613672af6995Smrg  ;;
613772af6995Smrgesac
613872af6995Smrg
613972af6995Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
614072af6995Smrg    [Whether or not to add -lc for building shared libraries])
614172af6995Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
614272af6995Smrg    [enable_shared_with_static_runtimes], [0],
614372af6995Smrg    [Whether or not to disallow shared libs when runtime libs are static])
614472af6995Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
614572af6995Smrg    [Compiler flag to allow reflexive dlopens])
614672af6995Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
614772af6995Smrg    [Compiler flag to generate shared objects directly from archives])
614872af6995Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
614972af6995Smrg    [Whether the compiler copes with passing no objects directly])
615072af6995Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
615172af6995Smrg    [Create an old-style archive from a shared archive])
615272af6995Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
615372af6995Smrg    [Create a temporary old-style archive to link instead of a shared archive])
615472af6995Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
615572af6995Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
615672af6995Smrg_LT_TAGDECL([], [module_cmds], [2],
615772af6995Smrg    [Commands used to build a loadable module if different from building
615872af6995Smrg    a shared archive.])
615972af6995Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
616072af6995Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
616172af6995Smrg    [Whether we are building with GNU ld or not])
616272af6995Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
616372af6995Smrg    [Flag that allows shared libraries with undefined symbols to be built])
616472af6995Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
616572af6995Smrg    [Flag that enforces no undefined symbols])
616672af6995Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
616772af6995Smrg    [Flag to hardcode $libdir into a binary during linking.
616872af6995Smrg    This must work even if $libdir does not exist])
616972af6995Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
617072af6995Smrg    [Whether we need a single "-rpath" flag with a separated argument])
617172af6995Smrg_LT_TAGDECL([], [hardcode_direct], [0],
617272af6995Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
617372af6995Smrg    DIR into the resulting binary])
617472af6995Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
617572af6995Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
617672af6995Smrg    DIR into the resulting binary and the resulting library dependency is
617772af6995Smrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
617872af6995Smrg    library is relocated])
617972af6995Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
618072af6995Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
618172af6995Smrg    into the resulting binary])
618272af6995Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
618372af6995Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
618472af6995Smrg    into the resulting binary])
618572af6995Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
618672af6995Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
618772af6995Smrg    into the library and all subsequent libraries and executables linked
618872af6995Smrg    against it])
618972af6995Smrg_LT_TAGDECL([], [inherit_rpath], [0],
619072af6995Smrg    [Set to yes if linker adds runtime paths of dependent libraries
619172af6995Smrg    to runtime path list])
619272af6995Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
619372af6995Smrg    [Whether libtool must link a program against all its dependency libraries])
619472af6995Smrg_LT_TAGDECL([], [always_export_symbols], [0],
619572af6995Smrg    [Set to "yes" if exported symbols are required])
619672af6995Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
619772af6995Smrg    [The commands to list exported symbols])
619872af6995Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
619972af6995Smrg    [Symbols that should not be listed in the preloaded symbols])
620072af6995Smrg_LT_TAGDECL([], [include_expsyms], [1],
620172af6995Smrg    [Symbols that must always be exported])
620272af6995Smrg_LT_TAGDECL([], [prelink_cmds], [2],
620372af6995Smrg    [Commands necessary for linking programs (against libraries) with templates])
620472af6995Smrg_LT_TAGDECL([], [postlink_cmds], [2],
620572af6995Smrg    [Commands necessary for finishing linking programs])
620672af6995Smrg_LT_TAGDECL([], [file_list_spec], [1],
620772af6995Smrg    [Specify filename containing input files])
620872af6995Smrgdnl FIXME: Not yet implemented
620972af6995Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
621072af6995Smrgdnl    [Compiler flag to generate thread safe objects])
621172af6995Smrg])# _LT_LINKER_SHLIBS
621272af6995Smrg
621372af6995Smrg
621472af6995Smrg# _LT_LANG_C_CONFIG([TAG])
621572af6995Smrg# ------------------------
621672af6995Smrg# Ensure that the configuration variables for a C compiler are suitably
621772af6995Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
621872af6995Smrg# the compiler configuration to 'libtool'.
621972af6995Smrgm4_defun([_LT_LANG_C_CONFIG],
622072af6995Smrg[m4_require([_LT_DECL_EGREP])dnl
622172af6995Smrglt_save_CC=$CC
622272af6995SmrgAC_LANG_PUSH(C)
622372af6995Smrg
622472af6995Smrg# Source file extension for C test sources.
622572af6995Smrgac_ext=c
622672af6995Smrg
622772af6995Smrg# Object file extension for compiled C test sources.
622872af6995Smrgobjext=o
622972af6995Smrg_LT_TAGVAR(objext, $1)=$objext
623072af6995Smrg
623172af6995Smrg# Code to be used in simple compile tests
623272af6995Smrglt_simple_compile_test_code="int some_variable = 0;"
623372af6995Smrg
623472af6995Smrg# Code to be used in simple link tests
623572af6995Smrglt_simple_link_test_code='int main(){return(0);}'
623672af6995Smrg
623772af6995Smrg_LT_TAG_COMPILER
623872af6995Smrg# Save the default compiler, since it gets overwritten when the other
623972af6995Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
624072af6995Smrgcompiler_DEFAULT=$CC
624172af6995Smrg
624272af6995Smrg# save warnings/boilerplate of simple test code
624372af6995Smrg_LT_COMPILER_BOILERPLATE
624472af6995Smrg_LT_LINKER_BOILERPLATE
624572af6995Smrg
624672af6995Smrg## CAVEAT EMPTOR:
624772af6995Smrg## There is no encapsulation within the following macros, do not change
624872af6995Smrg## the running order or otherwise move them around unless you know exactly
624972af6995Smrg## what you are doing...
625072af6995Smrgif test -n "$compiler"; then
625172af6995Smrg  _LT_COMPILER_NO_RTTI($1)
625272af6995Smrg  _LT_COMPILER_PIC($1)
625372af6995Smrg  _LT_COMPILER_C_O($1)
625472af6995Smrg  _LT_COMPILER_FILE_LOCKS($1)
625572af6995Smrg  _LT_LINKER_SHLIBS($1)
625672af6995Smrg  _LT_SYS_DYNAMIC_LINKER($1)
625772af6995Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
625872af6995Smrg  LT_SYS_DLOPEN_SELF
625972af6995Smrg  _LT_CMD_STRIPLIB
626072af6995Smrg
626172af6995Smrg  # Report what library types will actually be built
626272af6995Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
626372af6995Smrg  AC_MSG_RESULT([$can_build_shared])
626472af6995Smrg
626572af6995Smrg  AC_MSG_CHECKING([whether to build shared libraries])
626672af6995Smrg  test no = "$can_build_shared" && enable_shared=no
626772af6995Smrg
626872af6995Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
626972af6995Smrg  # are all built from PIC.
627072af6995Smrg  case $host_os in
627172af6995Smrg  aix3*)
627272af6995Smrg    test yes = "$enable_shared" && enable_static=no
627372af6995Smrg    if test -n "$RANLIB"; then
627472af6995Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
627572af6995Smrg      postinstall_cmds='$RANLIB $lib'
627672af6995Smrg    fi
627772af6995Smrg    ;;
627872af6995Smrg
627972af6995Smrg  aix[[4-9]]*)
628072af6995Smrg    if test ia64 != "$host_cpu"; then
628172af6995Smrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
628272af6995Smrg      yes,aix,yes) ;;			# shared object as lib.so file only
628372af6995Smrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
628472af6995Smrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
628572af6995Smrg      esac
628672af6995Smrg    fi
628772af6995Smrg    ;;
628872af6995Smrg  esac
628972af6995Smrg  AC_MSG_RESULT([$enable_shared])
629072af6995Smrg
629172af6995Smrg  AC_MSG_CHECKING([whether to build static libraries])
629272af6995Smrg  # Make sure either enable_shared or enable_static is yes.
629372af6995Smrg  test yes = "$enable_shared" || enable_static=yes
629472af6995Smrg  AC_MSG_RESULT([$enable_static])
629572af6995Smrg
629672af6995Smrg  _LT_CONFIG($1)
629772af6995Smrgfi
629872af6995SmrgAC_LANG_POP
629972af6995SmrgCC=$lt_save_CC
630072af6995Smrg])# _LT_LANG_C_CONFIG
630172af6995Smrg
630272af6995Smrg
630372af6995Smrg# _LT_LANG_CXX_CONFIG([TAG])
630472af6995Smrg# --------------------------
630572af6995Smrg# Ensure that the configuration variables for a C++ compiler are suitably
630672af6995Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
630772af6995Smrg# the compiler configuration to 'libtool'.
630872af6995Smrgm4_defun([_LT_LANG_CXX_CONFIG],
630972af6995Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
631072af6995Smrgm4_require([_LT_DECL_EGREP])dnl
631172af6995Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
631272af6995Smrgif test -n "$CXX" && ( test no != "$CXX" &&
631372af6995Smrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
631472af6995Smrg    (test g++ != "$CXX"))); then
631572af6995Smrg  AC_PROG_CXXCPP
631672af6995Smrgelse
631772af6995Smrg  _lt_caught_CXX_error=yes
631872af6995Smrgfi
631972af6995Smrg
632072af6995SmrgAC_LANG_PUSH(C++)
632172af6995Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
632272af6995Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
632372af6995Smrg_LT_TAGVAR(always_export_symbols, $1)=no
632472af6995Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
632572af6995Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
632672af6995Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
632772af6995Smrg_LT_TAGVAR(hardcode_direct, $1)=no
632872af6995Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
632972af6995Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
633072af6995Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
633172af6995Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
633272af6995Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
633372af6995Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
633472af6995Smrg_LT_TAGVAR(inherit_rpath, $1)=no
633572af6995Smrg_LT_TAGVAR(module_cmds, $1)=
633672af6995Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
633772af6995Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
633872af6995Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
633972af6995Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
634072af6995Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
634172af6995Smrg_LT_TAGVAR(no_undefined_flag, $1)=
634272af6995Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
634372af6995Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
634472af6995Smrg
634572af6995Smrg# Source file extension for C++ test sources.
634672af6995Smrgac_ext=cpp
634772af6995Smrg
634872af6995Smrg# Object file extension for compiled C++ test sources.
634972af6995Smrgobjext=o
635072af6995Smrg_LT_TAGVAR(objext, $1)=$objext
635172af6995Smrg
635272af6995Smrg# No sense in running all these tests if we already determined that
635372af6995Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
635472af6995Smrg# are currently assumed to apply to all compilers on this platform,
635572af6995Smrg# and will be corrupted by setting them based on a non-working compiler.
635672af6995Smrgif test yes != "$_lt_caught_CXX_error"; then
635772af6995Smrg  # Code to be used in simple compile tests
635872af6995Smrg  lt_simple_compile_test_code="int some_variable = 0;"
635972af6995Smrg
636072af6995Smrg  # Code to be used in simple link tests
636172af6995Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
636272af6995Smrg
636372af6995Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
636472af6995Smrg  _LT_TAG_COMPILER
636572af6995Smrg
636672af6995Smrg  # save warnings/boilerplate of simple test code
636772af6995Smrg  _LT_COMPILER_BOILERPLATE
636872af6995Smrg  _LT_LINKER_BOILERPLATE
636972af6995Smrg
637072af6995Smrg  # Allow CC to be a program name with arguments.
637172af6995Smrg  lt_save_CC=$CC
637272af6995Smrg  lt_save_CFLAGS=$CFLAGS
637372af6995Smrg  lt_save_LD=$LD
637472af6995Smrg  lt_save_GCC=$GCC
637572af6995Smrg  GCC=$GXX
637672af6995Smrg  lt_save_with_gnu_ld=$with_gnu_ld
637772af6995Smrg  lt_save_path_LD=$lt_cv_path_LD
637872af6995Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
637972af6995Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
638072af6995Smrg  else
638172af6995Smrg    $as_unset lt_cv_prog_gnu_ld
638272af6995Smrg  fi
638372af6995Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
638472af6995Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
638572af6995Smrg  else
638672af6995Smrg    $as_unset lt_cv_path_LD
638772af6995Smrg  fi
638872af6995Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
638972af6995Smrg  CC=${CXX-"c++"}
639072af6995Smrg  CFLAGS=$CXXFLAGS
639172af6995Smrg  compiler=$CC
639272af6995Smrg  _LT_TAGVAR(compiler, $1)=$CC
639372af6995Smrg  _LT_CC_BASENAME([$compiler])
639472af6995Smrg
639572af6995Smrg  if test -n "$compiler"; then
639672af6995Smrg    # We don't want -fno-exception when compiling C++ code, so set the
639772af6995Smrg    # no_builtin_flag separately
639872af6995Smrg    if test yes = "$GXX"; then
639972af6995Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
640072af6995Smrg    else
640172af6995Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
640272af6995Smrg    fi
640372af6995Smrg
640472af6995Smrg    if test yes = "$GXX"; then
640572af6995Smrg      # Set up default GNU C++ configuration
640672af6995Smrg
640772af6995Smrg      LT_PATH_LD
640872af6995Smrg
640972af6995Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
641072af6995Smrg      # archiving commands below assume that GNU ld is being used.
641172af6995Smrg      if test yes = "$with_gnu_ld"; then
641272af6995Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
641372af6995Smrg        _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'
641472af6995Smrg
641572af6995Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
641672af6995Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
641772af6995Smrg
641872af6995Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
641972af6995Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
642072af6995Smrg        #     investigate it a little bit more. (MM)
642172af6995Smrg        wlarc='$wl'
642272af6995Smrg
642372af6995Smrg        # ancient GNU ld didn't support --whole-archive et. al.
642472af6995Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
642572af6995Smrg	  $GREP 'no-whole-archive' > /dev/null; then
642672af6995Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
642772af6995Smrg        else
642872af6995Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
642972af6995Smrg        fi
643072af6995Smrg      else
643172af6995Smrg        with_gnu_ld=no
643272af6995Smrg        wlarc=
643372af6995Smrg
643472af6995Smrg        # A generic and very simple default shared library creation
643572af6995Smrg        # command for GNU C++ for the case where it uses the native
643672af6995Smrg        # linker, instead of GNU ld.  If possible, this setting should
643772af6995Smrg        # overridden to take advantage of the native linker features on
643872af6995Smrg        # the platform it is being used on.
643972af6995Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
644072af6995Smrg      fi
644172af6995Smrg
644272af6995Smrg      # Commands to make compiler produce verbose output that lists
644372af6995Smrg      # what "hidden" libraries, object files and flags are used when
644472af6995Smrg      # linking a shared library.
6445362b94d5Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
644672af6995Smrg
644772af6995Smrg    else
644872af6995Smrg      GXX=no
644972af6995Smrg      with_gnu_ld=no
645072af6995Smrg      wlarc=
645172af6995Smrg    fi
645272af6995Smrg
645372af6995Smrg    # PORTME: fill in a description of your system's C++ link characteristics
645472af6995Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
645572af6995Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
645672af6995Smrg    case $host_os in
645772af6995Smrg      aix3*)
645872af6995Smrg        # FIXME: insert proper C++ library support
645972af6995Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
646072af6995Smrg        ;;
646172af6995Smrg      aix[[4-9]]*)
646272af6995Smrg        if test ia64 = "$host_cpu"; then
646372af6995Smrg          # On IA64, the linker does run time linking by default, so we don't
646472af6995Smrg          # have to do anything special.
646572af6995Smrg          aix_use_runtimelinking=no
646672af6995Smrg          exp_sym_flag='-Bexport'
646772af6995Smrg          no_entry_flag=
646872af6995Smrg        else
646972af6995Smrg          aix_use_runtimelinking=no
647072af6995Smrg
647172af6995Smrg          # Test if we are trying to use run time linking or normal
647272af6995Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
647372af6995Smrg          # have runtime linking enabled, and use it for executables.
647472af6995Smrg          # For shared libraries, we enable/disable runtime linking
647572af6995Smrg          # depending on the kind of the shared library created -
647672af6995Smrg          # when "with_aix_soname,aix_use_runtimelinking" is:
647772af6995Smrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
647872af6995Smrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
647972af6995Smrg          #            lib.a           static archive
648072af6995Smrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
648172af6995Smrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
648272af6995Smrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
648372af6995Smrg          #            lib.a(lib.so.V) shared, rtl:no
648472af6995Smrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
648572af6995Smrg          #            lib.a           static archive
648672af6995Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
648772af6995Smrg	    for ld_flag in $LDFLAGS; do
648872af6995Smrg	      case $ld_flag in
648972af6995Smrg	      *-brtl*)
649072af6995Smrg	        aix_use_runtimelinking=yes
649172af6995Smrg	        break
649272af6995Smrg	        ;;
649372af6995Smrg	      esac
649472af6995Smrg	    done
649572af6995Smrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
649672af6995Smrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
649772af6995Smrg	      # so we don't have lib.a shared libs to link our executables.
649872af6995Smrg	      # We have to force runtime linking in this case.
649972af6995Smrg	      aix_use_runtimelinking=yes
650072af6995Smrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
650172af6995Smrg	    fi
650272af6995Smrg	    ;;
650372af6995Smrg          esac
650472af6995Smrg
650572af6995Smrg          exp_sym_flag='-bexport'
650672af6995Smrg          no_entry_flag='-bnoentry'
650772af6995Smrg        fi
650872af6995Smrg
650972af6995Smrg        # When large executables or shared objects are built, AIX ld can
651072af6995Smrg        # have problems creating the table of contents.  If linking a library
651172af6995Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
651272af6995Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
651372af6995Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
651472af6995Smrg
651572af6995Smrg        _LT_TAGVAR(archive_cmds, $1)=''
651672af6995Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
651772af6995Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
651872af6995Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
651972af6995Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
652072af6995Smrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
652172af6995Smrg        case $with_aix_soname,$aix_use_runtimelinking in
652272af6995Smrg        aix,*) ;;	# no import file
652372af6995Smrg        svr4,* | *,yes) # use import file
652472af6995Smrg          # The Import File defines what to hardcode.
652572af6995Smrg          _LT_TAGVAR(hardcode_direct, $1)=no
652672af6995Smrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
652772af6995Smrg          ;;
652872af6995Smrg        esac
652972af6995Smrg
653072af6995Smrg        if test yes = "$GXX"; then
653172af6995Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
653272af6995Smrg          # We only want to do this on AIX 4.2 and lower, the check
653372af6995Smrg          # below for broken collect2 doesn't work under 4.3+
653472af6995Smrg	  collect2name=`$CC -print-prog-name=collect2`
653572af6995Smrg	  if test -f "$collect2name" &&
653672af6995Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
653772af6995Smrg	  then
653872af6995Smrg	    # We have reworked collect2
653972af6995Smrg	    :
654072af6995Smrg	  else
654172af6995Smrg	    # We have old collect2
654272af6995Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
654372af6995Smrg	    # It fails to find uninstalled libraries when the uninstalled
654472af6995Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
654572af6995Smrg	    # to unsupported forces relinking
654672af6995Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
654772af6995Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
654872af6995Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
654972af6995Smrg	  fi
655072af6995Smrg          esac
655172af6995Smrg          shared_flag='-shared'
655272af6995Smrg	  if test yes = "$aix_use_runtimelinking"; then
655372af6995Smrg	    shared_flag=$shared_flag' $wl-G'
655472af6995Smrg	  fi
655572af6995Smrg	  # Need to ensure runtime linking is disabled for the traditional
655672af6995Smrg	  # shared library, or the linker may eventually find shared libraries
655772af6995Smrg	  # /with/ Import File - we do not want to mix them.
655872af6995Smrg	  shared_flag_aix='-shared'
655972af6995Smrg	  shared_flag_svr4='-shared $wl-G'
656072af6995Smrg        else
656172af6995Smrg          # not using gcc
656272af6995Smrg          if test ia64 = "$host_cpu"; then
656372af6995Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
656472af6995Smrg	  # chokes on -Wl,-G. The following line is correct:
656572af6995Smrg	  shared_flag='-G'
656672af6995Smrg          else
656772af6995Smrg	    if test yes = "$aix_use_runtimelinking"; then
656872af6995Smrg	      shared_flag='$wl-G'
656972af6995Smrg	    else
657072af6995Smrg	      shared_flag='$wl-bM:SRE'
657172af6995Smrg	    fi
657272af6995Smrg	    shared_flag_aix='$wl-bM:SRE'
657372af6995Smrg	    shared_flag_svr4='$wl-G'
657472af6995Smrg          fi
657572af6995Smrg        fi
657672af6995Smrg
657772af6995Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
657872af6995Smrg        # It seems that -bexpall does not export symbols beginning with
657972af6995Smrg        # underscore (_), so it is better to generate a list of symbols to
658072af6995Smrg	# export.
658172af6995Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
658272af6995Smrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
658372af6995Smrg          # Warning - without using the other runtime loading flags (-brtl),
658472af6995Smrg          # -berok will link without error, but may produce a broken library.
658572af6995Smrg          # The "-G" linker flag allows undefined symbols.
658672af6995Smrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
658772af6995Smrg          # Determine the default libpath from the value encoded in an empty
658872af6995Smrg          # executable.
658972af6995Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
659072af6995Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
659172af6995Smrg
659272af6995Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
659372af6995Smrg        else
659472af6995Smrg          if test ia64 = "$host_cpu"; then
659572af6995Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
659672af6995Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
659772af6995Smrg	    _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"
659872af6995Smrg          else
659972af6995Smrg	    # Determine the default libpath from the value encoded in an
660072af6995Smrg	    # empty executable.
660172af6995Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
660272af6995Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
660372af6995Smrg	    # Warning - without using the other run time loading flags,
660472af6995Smrg	    # -berok will link without error, but may produce a broken library.
660572af6995Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
660672af6995Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
660772af6995Smrg	    if test yes = "$with_gnu_ld"; then
660872af6995Smrg	      # We only use this code for GNU lds that support --whole-archive.
660972af6995Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
661072af6995Smrg	    else
661172af6995Smrg	      # Exported symbols can be pulled into shared objects from archives
661272af6995Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
661372af6995Smrg	    fi
661472af6995Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
661572af6995Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
661672af6995Smrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
661772af6995Smrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
661872af6995Smrg	    if test svr4 != "$with_aix_soname"; then
661972af6995Smrg	      # This is similar to how AIX traditionally builds its shared
662072af6995Smrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
662172af6995Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
662272af6995Smrg	    fi
662372af6995Smrg	    if test aix != "$with_aix_soname"; then
662472af6995Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
662572af6995Smrg	    else
662672af6995Smrg	      # used by -dlpreopen to get the symbols
662772af6995Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
662872af6995Smrg	    fi
662972af6995Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
663072af6995Smrg          fi
663172af6995Smrg        fi
663272af6995Smrg        ;;
663372af6995Smrg
663472af6995Smrg      beos*)
663572af6995Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
663672af6995Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
663772af6995Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
663872af6995Smrg	  # support --undefined.  This deserves some investigation.  FIXME
663972af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
664072af6995Smrg	else
664172af6995Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
664272af6995Smrg	fi
664372af6995Smrg	;;
664472af6995Smrg
664572af6995Smrg      chorus*)
664672af6995Smrg        case $cc_basename in
664772af6995Smrg          *)
664872af6995Smrg	  # FIXME: insert proper C++ library support
664972af6995Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
665072af6995Smrg	  ;;
665172af6995Smrg        esac
665272af6995Smrg        ;;
665372af6995Smrg
665472af6995Smrg      cygwin* | mingw* | pw32* | cegcc*)
665572af6995Smrg	case $GXX,$cc_basename in
6656a773ec55Smrg	,cl* | no,cl* | ,icl* | no,icl*)
6657a773ec55Smrg	  # Native MSVC or ICC
665872af6995Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
665972af6995Smrg	  # no search path for DLLs.
666072af6995Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
666172af6995Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
666272af6995Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
666372af6995Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
666472af6995Smrg	  # Tell ltmain to make .lib files, not .a files.
666572af6995Smrg	  libext=lib
666672af6995Smrg	  # Tell ltmain to make .dll files, not .so files.
666772af6995Smrg	  shrext_cmds=.dll
666872af6995Smrg	  # FIXME: Setting linknames here is a bad hack.
666972af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
667072af6995Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
667172af6995Smrg              cp "$export_symbols" "$output_objdir/$soname.def";
667272af6995Smrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
667372af6995Smrg            else
667472af6995Smrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
667572af6995Smrg            fi~
667672af6995Smrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
667772af6995Smrg            linknames='
667872af6995Smrg	  # The linker will not automatically build a static lib if we build a DLL.
667972af6995Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
668072af6995Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
668172af6995Smrg	  # Don't use ranlib
668272af6995Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
668372af6995Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
668472af6995Smrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
668572af6995Smrg            case $lt_outputfile in
668672af6995Smrg              *.exe|*.EXE) ;;
668772af6995Smrg              *)
668872af6995Smrg                lt_outputfile=$lt_outputfile.exe
668972af6995Smrg                lt_tool_outputfile=$lt_tool_outputfile.exe
669072af6995Smrg                ;;
669172af6995Smrg            esac~
669272af6995Smrg            func_to_tool_file "$lt_outputfile"~
669372af6995Smrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
669472af6995Smrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
669572af6995Smrg              $RM "$lt_outputfile.manifest";
669672af6995Smrg            fi'
669772af6995Smrg	  ;;
669872af6995Smrg	*)
669972af6995Smrg	  # g++
670072af6995Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
670172af6995Smrg	  # as there is no search path for DLLs.
670272af6995Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
670372af6995Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
670472af6995Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
670572af6995Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
670672af6995Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
670772af6995Smrg
670872af6995Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
670972af6995Smrg	    _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'
671072af6995Smrg	    # If the export-symbols file already is a .def file, use it as
671172af6995Smrg	    # is; otherwise, prepend EXPORTS...
671272af6995Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
671372af6995Smrg              cp $export_symbols $output_objdir/$soname.def;
671472af6995Smrg            else
671572af6995Smrg              echo EXPORTS > $output_objdir/$soname.def;
671672af6995Smrg              cat $export_symbols >> $output_objdir/$soname.def;
671772af6995Smrg            fi~
671872af6995Smrg            $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'
671972af6995Smrg	  else
672072af6995Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
672172af6995Smrg	  fi
672272af6995Smrg	  ;;
672372af6995Smrg	esac
672472af6995Smrg	;;
672572af6995Smrg      darwin* | rhapsody*)
672672af6995Smrg        _LT_DARWIN_LINKER_FEATURES($1)
672772af6995Smrg	;;
672872af6995Smrg
672972af6995Smrg      os2*)
673072af6995Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
673172af6995Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
673272af6995Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
673372af6995Smrg	shrext_cmds=.dll
673472af6995Smrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
673572af6995Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
673672af6995Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
673772af6995Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
673872af6995Smrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
673972af6995Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
674072af6995Smrg	  emximp -o $lib $output_objdir/$libname.def'
674172af6995Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
674272af6995Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
674372af6995Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
674472af6995Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
674572af6995Smrg	  prefix_cmds="$SED"~
674672af6995Smrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
674772af6995Smrg	    prefix_cmds="$prefix_cmds -e 1d";
674872af6995Smrg	  fi~
674972af6995Smrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
675072af6995Smrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
675172af6995Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
675272af6995Smrg	  emximp -o $lib $output_objdir/$libname.def'
675372af6995Smrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
675472af6995Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6755a773ec55Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
675672af6995Smrg	;;
675772af6995Smrg
675872af6995Smrg      dgux*)
675972af6995Smrg        case $cc_basename in
676072af6995Smrg          ec++*)
676172af6995Smrg	    # FIXME: insert proper C++ library support
676272af6995Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
676372af6995Smrg	    ;;
676472af6995Smrg          ghcx*)
676572af6995Smrg	    # Green Hills C++ Compiler
676672af6995Smrg	    # FIXME: insert proper C++ library support
676772af6995Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
676872af6995Smrg	    ;;
676972af6995Smrg          *)
677072af6995Smrg	    # FIXME: insert proper C++ library support
677172af6995Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
677272af6995Smrg	    ;;
677372af6995Smrg        esac
677472af6995Smrg        ;;
677572af6995Smrg
677672af6995Smrg      freebsd2.*)
677772af6995Smrg        # C++ shared libraries reported to be fairly broken before
677872af6995Smrg	# switch to ELF
677972af6995Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
678072af6995Smrg        ;;
678172af6995Smrg
678272af6995Smrg      freebsd-elf*)
678372af6995Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
678472af6995Smrg        ;;
678572af6995Smrg
6786a773ec55Smrg      freebsd* | dragonfly* | midnightbsd*)
678772af6995Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
678872af6995Smrg        # conventions
678972af6995Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
679072af6995Smrg        ;;
679172af6995Smrg
679272af6995Smrg      haiku*)
679372af6995Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
679472af6995Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
679572af6995Smrg        ;;
679672af6995Smrg
679772af6995Smrg      hpux9*)
679872af6995Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
679972af6995Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
680072af6995Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
680172af6995Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
680272af6995Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
680372af6995Smrg				             # but as the default
680472af6995Smrg				             # location of the library.
680572af6995Smrg
680672af6995Smrg        case $cc_basename in
680772af6995Smrg          CC*)
680872af6995Smrg            # FIXME: insert proper C++ library support
680972af6995Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
681072af6995Smrg            ;;
681172af6995Smrg          aCC*)
681272af6995Smrg            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
681372af6995Smrg            # Commands to make compiler produce verbose output that lists
681472af6995Smrg            # what "hidden" libraries, object files and flags are used when
681572af6995Smrg            # linking a shared library.
681672af6995Smrg            #
681772af6995Smrg            # There doesn't appear to be a way to prevent this compiler from
681872af6995Smrg            # explicitly linking system object files so we need to strip them
681972af6995Smrg            # from the output so that they don't get included in the library
682072af6995Smrg            # dependencies.
6821362b94d5Smrg            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"'
682272af6995Smrg            ;;
682372af6995Smrg          *)
682472af6995Smrg            if test yes = "$GXX"; then
682572af6995Smrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
682672af6995Smrg            else
682772af6995Smrg              # FIXME: insert proper C++ library support
682872af6995Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
682972af6995Smrg            fi
683072af6995Smrg            ;;
683172af6995Smrg        esac
683272af6995Smrg        ;;
683372af6995Smrg
683472af6995Smrg      hpux10*|hpux11*)
683572af6995Smrg        if test no = "$with_gnu_ld"; then
683672af6995Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
683772af6995Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
683872af6995Smrg
683972af6995Smrg          case $host_cpu in
684072af6995Smrg            hppa*64*|ia64*)
684172af6995Smrg              ;;
684272af6995Smrg            *)
684372af6995Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
684472af6995Smrg              ;;
684572af6995Smrg          esac
684672af6995Smrg        fi
684772af6995Smrg        case $host_cpu in
684872af6995Smrg          hppa*64*|ia64*)
684972af6995Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
685072af6995Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
685172af6995Smrg            ;;
685272af6995Smrg          *)
685372af6995Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
685472af6995Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
685572af6995Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
685672af6995Smrg					         # but as the default
685772af6995Smrg					         # location of the library.
685872af6995Smrg            ;;
685972af6995Smrg        esac
686072af6995Smrg
686172af6995Smrg        case $cc_basename in
686272af6995Smrg          CC*)
686372af6995Smrg	    # FIXME: insert proper C++ library support
686472af6995Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
686572af6995Smrg	    ;;
686672af6995Smrg          aCC*)
686772af6995Smrg	    case $host_cpu in
686872af6995Smrg	      hppa*64*)
686972af6995Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
687072af6995Smrg	        ;;
687172af6995Smrg	      ia64*)
687272af6995Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
687372af6995Smrg	        ;;
687472af6995Smrg	      *)
687572af6995Smrg	        _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'
687672af6995Smrg	        ;;
687772af6995Smrg	    esac
687872af6995Smrg	    # Commands to make compiler produce verbose output that lists
687972af6995Smrg	    # what "hidden" libraries, object files and flags are used when
688072af6995Smrg	    # linking a shared library.
688172af6995Smrg	    #
688272af6995Smrg	    # There doesn't appear to be a way to prevent this compiler from
688372af6995Smrg	    # explicitly linking system object files so we need to strip them
688472af6995Smrg	    # from the output so that they don't get included in the library
688572af6995Smrg	    # dependencies.
6886362b94d5Smrg	    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"'
688772af6995Smrg	    ;;
688872af6995Smrg          *)
688972af6995Smrg	    if test yes = "$GXX"; then
689072af6995Smrg	      if test no = "$with_gnu_ld"; then
689172af6995Smrg	        case $host_cpu in
689272af6995Smrg	          hppa*64*)
689372af6995Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
689472af6995Smrg	            ;;
689572af6995Smrg	          ia64*)
689672af6995Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
689772af6995Smrg	            ;;
689872af6995Smrg	          *)
689972af6995Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
690072af6995Smrg	            ;;
690172af6995Smrg	        esac
690272af6995Smrg	      fi
690372af6995Smrg	    else
690472af6995Smrg	      # FIXME: insert proper C++ library support
690572af6995Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
690672af6995Smrg	    fi
690772af6995Smrg	    ;;
690872af6995Smrg        esac
690972af6995Smrg        ;;
691072af6995Smrg
691172af6995Smrg      interix[[3-9]]*)
691272af6995Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
691372af6995Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
691472af6995Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
691572af6995Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
691672af6995Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
691772af6995Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
691872af6995Smrg	# default) and relocated if they conflict, which is a slow very memory
691972af6995Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
692072af6995Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
692172af6995Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
692272af6995Smrg	_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'
6923a773ec55Smrg	_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'
692472af6995Smrg	;;
692572af6995Smrg      irix5* | irix6*)
692672af6995Smrg        case $cc_basename in
692772af6995Smrg          CC*)
692872af6995Smrg	    # SGI C++
692972af6995Smrg	    _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'
693072af6995Smrg
693172af6995Smrg	    # Archives containing C++ object files must be created using
693272af6995Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
693372af6995Smrg	    # necessary to make sure instantiated templates are included
693472af6995Smrg	    # in the archive.
693572af6995Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
693672af6995Smrg	    ;;
693772af6995Smrg          *)
693872af6995Smrg	    if test yes = "$GXX"; then
693972af6995Smrg	      if test no = "$with_gnu_ld"; then
694072af6995Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
694172af6995Smrg	      else
694272af6995Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
694372af6995Smrg	      fi
694472af6995Smrg	    fi
694572af6995Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
694672af6995Smrg	    ;;
694772af6995Smrg        esac
694872af6995Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
694972af6995Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
695072af6995Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
695172af6995Smrg        ;;
695272af6995Smrg
695372af6995Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
695472af6995Smrg        case $cc_basename in
695572af6995Smrg          KCC*)
695672af6995Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
695772af6995Smrg
695872af6995Smrg	    # KCC will only create a shared library if the output file
695972af6995Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
696072af6995Smrg	    # to its proper name (with version) after linking.
696172af6995Smrg	    _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'
696272af6995Smrg	    _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'
696372af6995Smrg	    # Commands to make compiler produce verbose output that lists
696472af6995Smrg	    # what "hidden" libraries, object files and flags are used when
696572af6995Smrg	    # linking a shared library.
696672af6995Smrg	    #
696772af6995Smrg	    # There doesn't appear to be a way to prevent this compiler from
696872af6995Smrg	    # explicitly linking system object files so we need to strip them
696972af6995Smrg	    # from the output so that they don't get included in the library
697072af6995Smrg	    # dependencies.
697172af6995Smrg	    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"'
697272af6995Smrg
697372af6995Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
697472af6995Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
697572af6995Smrg
697672af6995Smrg	    # Archives containing C++ object files must be created using
697772af6995Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
697872af6995Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
697972af6995Smrg	    ;;
698072af6995Smrg	  icpc* | ecpc* )
698172af6995Smrg	    # Intel C++
698272af6995Smrg	    with_gnu_ld=yes
698372af6995Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
698472af6995Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
698572af6995Smrg	    # earlier do not add the objects themselves.
698672af6995Smrg	    case `$CC -V 2>&1` in
698772af6995Smrg	      *"Version 7."*)
698872af6995Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
698972af6995Smrg		_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'
699072af6995Smrg		;;
699172af6995Smrg	      *)  # Version 8.0 or newer
699272af6995Smrg	        tmp_idyn=
699372af6995Smrg	        case $host_cpu in
699472af6995Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
699572af6995Smrg		esac
699672af6995Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
699772af6995Smrg		_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'
699872af6995Smrg		;;
699972af6995Smrg	    esac
700072af6995Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
700172af6995Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
700272af6995Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
700372af6995Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
700472af6995Smrg	    ;;
700572af6995Smrg          pgCC* | pgcpp*)
700672af6995Smrg            # Portland Group C++ compiler
700772af6995Smrg	    case `$CC -V` in
700872af6995Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
700972af6995Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
701072af6995Smrg               rm -rf $tpldir~
701172af6995Smrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
701272af6995Smrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
701372af6995Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
701472af6995Smrg                rm -rf $tpldir~
701572af6995Smrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
701672af6995Smrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
701772af6995Smrg                $RANLIB $oldlib'
701872af6995Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
701972af6995Smrg                rm -rf $tpldir~
702072af6995Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
702172af6995Smrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
702272af6995Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
702372af6995Smrg                rm -rf $tpldir~
702472af6995Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
702572af6995Smrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
702672af6995Smrg	      ;;
702772af6995Smrg	    *) # Version 6 and above use weak symbols
702872af6995Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
702972af6995Smrg	      _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'
703072af6995Smrg	      ;;
703172af6995Smrg	    esac
703272af6995Smrg
703372af6995Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
703472af6995Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
703572af6995Smrg	    _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'
703672af6995Smrg            ;;
703772af6995Smrg	  cxx*)
703872af6995Smrg	    # Compaq C++
703972af6995Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
704072af6995Smrg	    _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'
704172af6995Smrg
704272af6995Smrg	    runpath_var=LD_RUN_PATH
704372af6995Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
704472af6995Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
704572af6995Smrg
704672af6995Smrg	    # Commands to make compiler produce verbose output that lists
704772af6995Smrg	    # what "hidden" libraries, object files and flags are used when
704872af6995Smrg	    # linking a shared library.
704972af6995Smrg	    #
705072af6995Smrg	    # There doesn't appear to be a way to prevent this compiler from
705172af6995Smrg	    # explicitly linking system object files so we need to strip them
705272af6995Smrg	    # from the output so that they don't get included in the library
705372af6995Smrg	    # dependencies.
705472af6995Smrg	    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'
705572af6995Smrg	    ;;
705672af6995Smrg	  xl* | mpixl* | bgxl*)
705772af6995Smrg	    # IBM XL 8.0 on PPC, with GNU ld
705872af6995Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
705972af6995Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
706072af6995Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
706172af6995Smrg	    if test yes = "$supports_anon_versioning"; then
706272af6995Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7063a773ec55Smrg                cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
706472af6995Smrg                echo "local: *; };" >> $output_objdir/$libname.ver~
706572af6995Smrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
706672af6995Smrg	    fi
706772af6995Smrg	    ;;
706872af6995Smrg	  *)
7069a773ec55Smrg	    case `$CC -V 2>&1 | $SED 5q` in
707072af6995Smrg	    *Sun\ C*)
707172af6995Smrg	      # Sun C++ 5.9
707272af6995Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
707372af6995Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
707472af6995Smrg	      _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'
707572af6995Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
707672af6995Smrg	      _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'
707772af6995Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
707872af6995Smrg
707972af6995Smrg	      # Not sure whether something based on
708072af6995Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
708172af6995Smrg	      # would be better.
708272af6995Smrg	      output_verbose_link_cmd='func_echo_all'
708372af6995Smrg
708472af6995Smrg	      # Archives containing C++ object files must be created using
708572af6995Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
708672af6995Smrg	      # necessary to make sure instantiated templates are included
708772af6995Smrg	      # in the archive.
708872af6995Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
708972af6995Smrg	      ;;
709072af6995Smrg	    esac
709172af6995Smrg	    ;;
709272af6995Smrg	esac
709372af6995Smrg	;;
709472af6995Smrg
709572af6995Smrg      lynxos*)
709672af6995Smrg        # FIXME: insert proper C++ library support
709772af6995Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
709872af6995Smrg	;;
709972af6995Smrg
710072af6995Smrg      m88k*)
710172af6995Smrg        # FIXME: insert proper C++ library support
710272af6995Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
710372af6995Smrg	;;
710472af6995Smrg
710572af6995Smrg      mvs*)
710672af6995Smrg        case $cc_basename in
710772af6995Smrg          cxx*)
710872af6995Smrg	    # FIXME: insert proper C++ library support
710972af6995Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
711072af6995Smrg	    ;;
711172af6995Smrg	  *)
711272af6995Smrg	    # FIXME: insert proper C++ library support
711372af6995Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
711472af6995Smrg	    ;;
711572af6995Smrg	esac
711672af6995Smrg	;;
711772af6995Smrg
711872af6995Smrg      netbsd*)
711972af6995Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
712072af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
712172af6995Smrg	  wlarc=
712272af6995Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
712372af6995Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
712472af6995Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
712572af6995Smrg	fi
712672af6995Smrg	# Workaround some broken pre-1.5 toolchains
712772af6995Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
712872af6995Smrg	;;
712972af6995Smrg
713072af6995Smrg      *nto* | *qnx*)
713172af6995Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
713272af6995Smrg	;;
713372af6995Smrg
713472af6995Smrg      openbsd* | bitrig*)
713572af6995Smrg	if test -f /usr/libexec/ld.so; then
713672af6995Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
713772af6995Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
713872af6995Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
713972af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
714072af6995Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
714172af6995Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
714272af6995Smrg	    _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'
714372af6995Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
714472af6995Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
714572af6995Smrg	  fi
714672af6995Smrg	  output_verbose_link_cmd=func_echo_all
714772af6995Smrg	else
714872af6995Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
714972af6995Smrg	fi
715072af6995Smrg	;;
715172af6995Smrg
715272af6995Smrg      osf3* | osf4* | osf5*)
715372af6995Smrg        case $cc_basename in
715472af6995Smrg          KCC*)
715572af6995Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
715672af6995Smrg
715772af6995Smrg	    # KCC will only create a shared library if the output file
715872af6995Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
715972af6995Smrg	    # to its proper name (with version) after linking.
716072af6995Smrg	    _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'
716172af6995Smrg
716272af6995Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
716372af6995Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
716472af6995Smrg
716572af6995Smrg	    # Archives containing C++ object files must be created using
716672af6995Smrg	    # the KAI C++ compiler.
716772af6995Smrg	    case $host in
716872af6995Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
716972af6995Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
717072af6995Smrg	    esac
717172af6995Smrg	    ;;
717272af6995Smrg          RCC*)
717372af6995Smrg	    # Rational C++ 2.4.1
717472af6995Smrg	    # FIXME: insert proper C++ library support
717572af6995Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
717672af6995Smrg	    ;;
717772af6995Smrg          cxx*)
717872af6995Smrg	    case $host in
717972af6995Smrg	      osf3*)
718072af6995Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
718172af6995Smrg	        _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'
718272af6995Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
718372af6995Smrg		;;
718472af6995Smrg	      *)
718572af6995Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
718672af6995Smrg	        _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'
718772af6995Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
718872af6995Smrg                  echo "-hidden">> $lib.exp~
718972af6995Smrg                  $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~
719072af6995Smrg                  $RM $lib.exp'
719172af6995Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
719272af6995Smrg		;;
719372af6995Smrg	    esac
719472af6995Smrg
719572af6995Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
719672af6995Smrg
719772af6995Smrg	    # Commands to make compiler produce verbose output that lists
719872af6995Smrg	    # what "hidden" libraries, object files and flags are used when
719972af6995Smrg	    # linking a shared library.
720072af6995Smrg	    #
720172af6995Smrg	    # There doesn't appear to be a way to prevent this compiler from
720272af6995Smrg	    # explicitly linking system object files so we need to strip them
720372af6995Smrg	    # from the output so that they don't get included in the library
720472af6995Smrg	    # dependencies.
720572af6995Smrg	    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"'
720672af6995Smrg	    ;;
720772af6995Smrg	  *)
720872af6995Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
720972af6995Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
721072af6995Smrg	      case $host in
721172af6995Smrg	        osf3*)
721272af6995Smrg	          _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'
721372af6995Smrg		  ;;
721472af6995Smrg	        *)
721572af6995Smrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
721672af6995Smrg		  ;;
721772af6995Smrg	      esac
721872af6995Smrg
721972af6995Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
722072af6995Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
722172af6995Smrg
722272af6995Smrg	      # Commands to make compiler produce verbose output that lists
722372af6995Smrg	      # what "hidden" libraries, object files and flags are used when
722472af6995Smrg	      # linking a shared library.
7225362b94d5Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
722672af6995Smrg
722772af6995Smrg	    else
722872af6995Smrg	      # FIXME: insert proper C++ library support
722972af6995Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
723072af6995Smrg	    fi
723172af6995Smrg	    ;;
723272af6995Smrg        esac
723372af6995Smrg        ;;
723472af6995Smrg
723572af6995Smrg      psos*)
723672af6995Smrg        # FIXME: insert proper C++ library support
723772af6995Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
723872af6995Smrg        ;;
723972af6995Smrg
724072af6995Smrg      sunos4*)
724172af6995Smrg        case $cc_basename in
724272af6995Smrg          CC*)
724372af6995Smrg	    # Sun C++ 4.x
724472af6995Smrg	    # FIXME: insert proper C++ library support
724572af6995Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
724672af6995Smrg	    ;;
724772af6995Smrg          lcc*)
724872af6995Smrg	    # Lucid
724972af6995Smrg	    # FIXME: insert proper C++ library support
725072af6995Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
725172af6995Smrg	    ;;
725272af6995Smrg          *)
725372af6995Smrg	    # FIXME: insert proper C++ library support
725472af6995Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
725572af6995Smrg	    ;;
725672af6995Smrg        esac
725772af6995Smrg        ;;
725872af6995Smrg
725972af6995Smrg      solaris*)
726072af6995Smrg        case $cc_basename in
726172af6995Smrg          CC* | sunCC*)
726272af6995Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
726372af6995Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
726472af6995Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
726572af6995Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
726672af6995Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
726772af6995Smrg              $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'
726872af6995Smrg
726972af6995Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
727072af6995Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
727172af6995Smrg	    case $host_os in
727272af6995Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
727372af6995Smrg	      *)
727472af6995Smrg		# The compiler driver will combine and reorder linker options,
727572af6995Smrg		# but understands '-z linker_flag'.
727672af6995Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
727772af6995Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
727872af6995Smrg	        ;;
727972af6995Smrg	    esac
728072af6995Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
728172af6995Smrg
728272af6995Smrg	    output_verbose_link_cmd='func_echo_all'
728372af6995Smrg
728472af6995Smrg	    # Archives containing C++ object files must be created using
728572af6995Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
728672af6995Smrg	    # necessary to make sure instantiated templates are included
728772af6995Smrg	    # in the archive.
728872af6995Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
728972af6995Smrg	    ;;
729072af6995Smrg          gcx*)
729172af6995Smrg	    # Green Hills C++ Compiler
729272af6995Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
729372af6995Smrg
729472af6995Smrg	    # The C++ compiler must be used to create the archive.
729572af6995Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
729672af6995Smrg	    ;;
729772af6995Smrg          *)
729872af6995Smrg	    # GNU C++ compiler with Solaris linker
729972af6995Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
730072af6995Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
730172af6995Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
730272af6995Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
730372af6995Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
730472af6995Smrg                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
730572af6995Smrg
730672af6995Smrg	        # Commands to make compiler produce verbose output that lists
730772af6995Smrg	        # what "hidden" libraries, object files and flags are used when
730872af6995Smrg	        # linking a shared library.
7309362b94d5Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
731072af6995Smrg	      else
731172af6995Smrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
731272af6995Smrg	        # platform.
731372af6995Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
731472af6995Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
731572af6995Smrg                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
731672af6995Smrg
731772af6995Smrg	        # Commands to make compiler produce verbose output that lists
731872af6995Smrg	        # what "hidden" libraries, object files and flags are used when
731972af6995Smrg	        # linking a shared library.
7320362b94d5Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
732172af6995Smrg	      fi
732272af6995Smrg
732372af6995Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
732472af6995Smrg	      case $host_os in
732572af6995Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
732672af6995Smrg		*)
732772af6995Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
732872af6995Smrg		  ;;
732972af6995Smrg	      esac
733072af6995Smrg	    fi
733172af6995Smrg	    ;;
733272af6995Smrg        esac
733372af6995Smrg        ;;
733472af6995Smrg
733572af6995Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
733672af6995Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
733772af6995Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
733872af6995Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
733972af6995Smrg      runpath_var='LD_RUN_PATH'
734072af6995Smrg
734172af6995Smrg      case $cc_basename in
734272af6995Smrg        CC*)
734372af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
734472af6995Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
734572af6995Smrg	  ;;
734672af6995Smrg	*)
734772af6995Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
734872af6995Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
734972af6995Smrg	  ;;
735072af6995Smrg      esac
735172af6995Smrg      ;;
735272af6995Smrg
735372af6995Smrg      sysv5* | sco3.2v5* | sco5v6*)
735472af6995Smrg	# Note: We CANNOT use -z defs as we might desire, because we do not
735572af6995Smrg	# link with -lc, and that would cause any symbols used from libc to
735672af6995Smrg	# always be unresolved, which means just about no library would
735772af6995Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
735872af6995Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
735972af6995Smrg	# as -z defs.
736072af6995Smrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
736172af6995Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
736272af6995Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
736372af6995Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
736472af6995Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
736572af6995Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
736672af6995Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
736772af6995Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
736872af6995Smrg	runpath_var='LD_RUN_PATH'
736972af6995Smrg
737072af6995Smrg	case $cc_basename in
737172af6995Smrg          CC*)
737272af6995Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
737372af6995Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
737472af6995Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
737572af6995Smrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
737672af6995Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
737772af6995Smrg              '"$_LT_TAGVAR(reload_cmds, $1)"
737872af6995Smrg	    ;;
737972af6995Smrg	  *)
738072af6995Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
738172af6995Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
738272af6995Smrg	    ;;
738372af6995Smrg	esac
738472af6995Smrg      ;;
738572af6995Smrg
738672af6995Smrg      tandem*)
738772af6995Smrg        case $cc_basename in
738872af6995Smrg          NCC*)
738972af6995Smrg	    # NonStop-UX NCC 3.20
739072af6995Smrg	    # FIXME: insert proper C++ library support
739172af6995Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
739272af6995Smrg	    ;;
739372af6995Smrg          *)
739472af6995Smrg	    # FIXME: insert proper C++ library support
739572af6995Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
739672af6995Smrg	    ;;
739772af6995Smrg        esac
739872af6995Smrg        ;;
739972af6995Smrg
740072af6995Smrg      vxworks*)
740172af6995Smrg        # FIXME: insert proper C++ library support
740272af6995Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
740372af6995Smrg        ;;
740472af6995Smrg
740572af6995Smrg      *)
740672af6995Smrg        # FIXME: insert proper C++ library support
740772af6995Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
740872af6995Smrg        ;;
740972af6995Smrg    esac
741072af6995Smrg
741172af6995Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
741272af6995Smrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
741372af6995Smrg
741472af6995Smrg    _LT_TAGVAR(GCC, $1)=$GXX
741572af6995Smrg    _LT_TAGVAR(LD, $1)=$LD
741672af6995Smrg
741772af6995Smrg    ## CAVEAT EMPTOR:
741872af6995Smrg    ## There is no encapsulation within the following macros, do not change
741972af6995Smrg    ## the running order or otherwise move them around unless you know exactly
742072af6995Smrg    ## what you are doing...
742172af6995Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
742272af6995Smrg    _LT_COMPILER_PIC($1)
742372af6995Smrg    _LT_COMPILER_C_O($1)
742472af6995Smrg    _LT_COMPILER_FILE_LOCKS($1)
742572af6995Smrg    _LT_LINKER_SHLIBS($1)
742672af6995Smrg    _LT_SYS_DYNAMIC_LINKER($1)
742772af6995Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
742872af6995Smrg
742972af6995Smrg    _LT_CONFIG($1)
743072af6995Smrg  fi # test -n "$compiler"
743172af6995Smrg
743272af6995Smrg  CC=$lt_save_CC
743372af6995Smrg  CFLAGS=$lt_save_CFLAGS
743472af6995Smrg  LDCXX=$LD
743572af6995Smrg  LD=$lt_save_LD
743672af6995Smrg  GCC=$lt_save_GCC
743772af6995Smrg  with_gnu_ld=$lt_save_with_gnu_ld
743872af6995Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
743972af6995Smrg  lt_cv_path_LD=$lt_save_path_LD
744072af6995Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
744172af6995Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
744272af6995Smrgfi # test yes != "$_lt_caught_CXX_error"
744372af6995Smrg
744472af6995SmrgAC_LANG_POP
744572af6995Smrg])# _LT_LANG_CXX_CONFIG
744672af6995Smrg
744772af6995Smrg
744872af6995Smrg# _LT_FUNC_STRIPNAME_CNF
744972af6995Smrg# ----------------------
745072af6995Smrg# func_stripname_cnf prefix suffix name
745172af6995Smrg# strip PREFIX and SUFFIX off of NAME.
745272af6995Smrg# PREFIX and SUFFIX must not contain globbing or regex special
745372af6995Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
745472af6995Smrg# dot (in which case that matches only a dot).
745572af6995Smrg#
745672af6995Smrg# This function is identical to the (non-XSI) version of func_stripname,
745772af6995Smrg# except this one can be used by m4 code that may be executed by configure,
745872af6995Smrg# rather than the libtool script.
745972af6995Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
746072af6995SmrgAC_REQUIRE([_LT_DECL_SED])
746172af6995SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
746272af6995Smrgfunc_stripname_cnf ()
746372af6995Smrg{
746472af6995Smrg  case @S|@2 in
746572af6995Smrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
746672af6995Smrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
746772af6995Smrg  esac
746872af6995Smrg} # func_stripname_cnf
746972af6995Smrg])# _LT_FUNC_STRIPNAME_CNF
747072af6995Smrg
747172af6995Smrg
747272af6995Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
747372af6995Smrg# ---------------------------------
747472af6995Smrg# Figure out "hidden" library dependencies from verbose
747572af6995Smrg# compiler output when linking a shared library.
747672af6995Smrg# Parse the compiler output and extract the necessary
747772af6995Smrg# objects, libraries and library flags.
747872af6995Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
747972af6995Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
748072af6995SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
748172af6995Smrg# Dependencies to place before and after the object being linked:
748272af6995Smrg_LT_TAGVAR(predep_objects, $1)=
748372af6995Smrg_LT_TAGVAR(postdep_objects, $1)=
748472af6995Smrg_LT_TAGVAR(predeps, $1)=
748572af6995Smrg_LT_TAGVAR(postdeps, $1)=
748672af6995Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
748772af6995Smrg
748872af6995Smrgdnl we can't use the lt_simple_compile_test_code here,
748972af6995Smrgdnl because it contains code intended for an executable,
749072af6995Smrgdnl not a library.  It's possible we should let each
749172af6995Smrgdnl tag define a new lt_????_link_test_code variable,
749272af6995Smrgdnl but it's only used here...
749372af6995Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
749472af6995Smrgint a;
749572af6995Smrgvoid foo (void) { a = 0; }
749672af6995Smrg_LT_EOF
749772af6995Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
749872af6995Smrgclass Foo
749972af6995Smrg{
750072af6995Smrgpublic:
750172af6995Smrg  Foo (void) { a = 0; }
750272af6995Smrgprivate:
750372af6995Smrg  int a;
750472af6995Smrg};
750572af6995Smrg_LT_EOF
750672af6995Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
750772af6995Smrg      subroutine foo
750872af6995Smrg      implicit none
750972af6995Smrg      integer*4 a
751072af6995Smrg      a=0
751172af6995Smrg      return
751272af6995Smrg      end
751372af6995Smrg_LT_EOF
751472af6995Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
751572af6995Smrg      subroutine foo
751672af6995Smrg      implicit none
751772af6995Smrg      integer a
751872af6995Smrg      a=0
751972af6995Smrg      return
752072af6995Smrg      end
752172af6995Smrg_LT_EOF
752272af6995Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
752372af6995Smrgpublic class foo {
752472af6995Smrg  private int a;
752572af6995Smrg  public void bar (void) {
752672af6995Smrg    a = 0;
752772af6995Smrg  }
752872af6995Smrg};
752972af6995Smrg_LT_EOF
753072af6995Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
753172af6995Smrgpackage foo
753272af6995Smrgfunc foo() {
753372af6995Smrg}
753472af6995Smrg_LT_EOF
753572af6995Smrg])
753672af6995Smrg
753772af6995Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
753872af6995Smrgcase "$CC $CFLAGS " in #(
753972af6995Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
754072af6995Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
754172af6995Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
754272af6995Smrgesac
754372af6995Smrg
754472af6995Smrgdnl Parse the compiler output and extract the necessary
754572af6995Smrgdnl objects, libraries and library flags.
754672af6995Smrgif AC_TRY_EVAL(ac_compile); then
754772af6995Smrg  # Parse the compiler output and extract the necessary
754872af6995Smrg  # objects, libraries and library flags.
754972af6995Smrg
755072af6995Smrg  # Sentinel used to keep track of whether or not we are before
755172af6995Smrg  # the conftest object file.
755272af6995Smrg  pre_test_object_deps_done=no
755372af6995Smrg
755472af6995Smrg  for p in `eval "$output_verbose_link_cmd"`; do
755572af6995Smrg    case $prev$p in
755672af6995Smrg
755772af6995Smrg    -L* | -R* | -l*)
755872af6995Smrg       # Some compilers place space between "-{L,R}" and the path.
755972af6995Smrg       # Remove the space.
756072af6995Smrg       if test x-L = "$p" ||
756172af6995Smrg          test x-R = "$p"; then
756272af6995Smrg	 prev=$p
756372af6995Smrg	 continue
756472af6995Smrg       fi
756572af6995Smrg
756672af6995Smrg       # Expand the sysroot to ease extracting the directories later.
756772af6995Smrg       if test -z "$prev"; then
756872af6995Smrg         case $p in
756972af6995Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
757072af6995Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
757172af6995Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
757272af6995Smrg         esac
757372af6995Smrg       fi
757472af6995Smrg       case $p in
757572af6995Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
757672af6995Smrg       esac
757772af6995Smrg       if test no = "$pre_test_object_deps_done"; then
757872af6995Smrg	 case $prev in
757972af6995Smrg	 -L | -R)
758072af6995Smrg	   # Internal compiler library paths should come after those
758172af6995Smrg	   # provided the user.  The postdeps already come after the
758272af6995Smrg	   # user supplied libs so there is no need to process them.
758372af6995Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
758472af6995Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
758572af6995Smrg	   else
758672af6995Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
758772af6995Smrg	   fi
758872af6995Smrg	   ;;
758972af6995Smrg	 # The "-l" case would never come before the object being
759072af6995Smrg	 # linked, so don't bother handling this case.
759172af6995Smrg	 esac
759272af6995Smrg       else
759372af6995Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
759472af6995Smrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
759572af6995Smrg	 else
759672af6995Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
759772af6995Smrg	 fi
759872af6995Smrg       fi
759972af6995Smrg       prev=
760072af6995Smrg       ;;
760172af6995Smrg
760272af6995Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
760372af6995Smrg    *.$objext)
760472af6995Smrg       # This assumes that the test object file only shows up
760572af6995Smrg       # once in the compiler output.
760672af6995Smrg       if test "$p" = "conftest.$objext"; then
760772af6995Smrg	 pre_test_object_deps_done=yes
760872af6995Smrg	 continue
760972af6995Smrg       fi
761072af6995Smrg
761172af6995Smrg       if test no = "$pre_test_object_deps_done"; then
761272af6995Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
761372af6995Smrg	   _LT_TAGVAR(predep_objects, $1)=$p
761472af6995Smrg	 else
761572af6995Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
761672af6995Smrg	 fi
761772af6995Smrg       else
761872af6995Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
761972af6995Smrg	   _LT_TAGVAR(postdep_objects, $1)=$p
762072af6995Smrg	 else
762172af6995Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
762272af6995Smrg	 fi
762372af6995Smrg       fi
762472af6995Smrg       ;;
762572af6995Smrg
762672af6995Smrg    *) ;; # Ignore the rest.
762772af6995Smrg
762872af6995Smrg    esac
762972af6995Smrg  done
763072af6995Smrg
763172af6995Smrg  # Clean up.
763272af6995Smrg  rm -f a.out a.exe
763372af6995Smrgelse
763472af6995Smrg  echo "libtool.m4: error: problem compiling $1 test program"
763572af6995Smrgfi
763672af6995Smrg
763772af6995Smrg$RM -f confest.$objext
763872af6995SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
763972af6995Smrg
764072af6995Smrg# PORTME: override above test on systems where it is broken
764172af6995Smrgm4_if([$1], [CXX],
764272af6995Smrg[case $host_os in
764372af6995Smrginterix[[3-9]]*)
764472af6995Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
764572af6995Smrg  # hack all around it, let's just trust "g++" to DTRT.
764672af6995Smrg  _LT_TAGVAR(predep_objects,$1)=
764772af6995Smrg  _LT_TAGVAR(postdep_objects,$1)=
764872af6995Smrg  _LT_TAGVAR(postdeps,$1)=
764972af6995Smrg  ;;
765072af6995Smrgesac
765172af6995Smrg])
765272af6995Smrg
765372af6995Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
765472af6995Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
765572af6995Smrgesac
765672af6995Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
765772af6995Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
765872af6995Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
765972af6995Smrgfi
766072af6995Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
766172af6995Smrg    [The directories searched by this compiler when creating a shared library])
766272af6995Smrg_LT_TAGDECL([], [predep_objects], [1],
766372af6995Smrg    [Dependencies to place before and after the objects being linked to
766472af6995Smrg    create a shared library])
766572af6995Smrg_LT_TAGDECL([], [postdep_objects], [1])
766672af6995Smrg_LT_TAGDECL([], [predeps], [1])
766772af6995Smrg_LT_TAGDECL([], [postdeps], [1])
766872af6995Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
766972af6995Smrg    [The library search path used internally by the compiler when linking
767072af6995Smrg    a shared library])
767172af6995Smrg])# _LT_SYS_HIDDEN_LIBDEPS
767272af6995Smrg
767372af6995Smrg
767472af6995Smrg# _LT_LANG_F77_CONFIG([TAG])
767572af6995Smrg# --------------------------
767672af6995Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
767772af6995Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
767872af6995Smrg# to write the compiler configuration to 'libtool'.
767972af6995Smrgm4_defun([_LT_LANG_F77_CONFIG],
768072af6995Smrg[AC_LANG_PUSH(Fortran 77)
768172af6995Smrgif test -z "$F77" || test no = "$F77"; then
768272af6995Smrg  _lt_disable_F77=yes
768372af6995Smrgfi
768472af6995Smrg
768572af6995Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
768672af6995Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
768772af6995Smrg_LT_TAGVAR(always_export_symbols, $1)=no
768872af6995Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
768972af6995Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
769072af6995Smrg_LT_TAGVAR(hardcode_direct, $1)=no
769172af6995Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
769272af6995Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
769372af6995Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
769472af6995Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
769572af6995Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
769672af6995Smrg_LT_TAGVAR(inherit_rpath, $1)=no
769772af6995Smrg_LT_TAGVAR(module_cmds, $1)=
769872af6995Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
769972af6995Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
770072af6995Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
770172af6995Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
770272af6995Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
770372af6995Smrg_LT_TAGVAR(no_undefined_flag, $1)=
770472af6995Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
770572af6995Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
770672af6995Smrg
770772af6995Smrg# Source file extension for f77 test sources.
770872af6995Smrgac_ext=f
770972af6995Smrg
771072af6995Smrg# Object file extension for compiled f77 test sources.
771172af6995Smrgobjext=o
771272af6995Smrg_LT_TAGVAR(objext, $1)=$objext
771372af6995Smrg
771472af6995Smrg# No sense in running all these tests if we already determined that
771572af6995Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
771672af6995Smrg# are currently assumed to apply to all compilers on this platform,
771772af6995Smrg# and will be corrupted by setting them based on a non-working compiler.
771872af6995Smrgif test yes != "$_lt_disable_F77"; then
771972af6995Smrg  # Code to be used in simple compile tests
772072af6995Smrg  lt_simple_compile_test_code="\
772172af6995Smrg      subroutine t
772272af6995Smrg      return
772372af6995Smrg      end
772472af6995Smrg"
772572af6995Smrg
772672af6995Smrg  # Code to be used in simple link tests
772772af6995Smrg  lt_simple_link_test_code="\
772872af6995Smrg      program t
772972af6995Smrg      end
773072af6995Smrg"
773172af6995Smrg
773272af6995Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
773372af6995Smrg  _LT_TAG_COMPILER
773472af6995Smrg
773572af6995Smrg  # save warnings/boilerplate of simple test code
773672af6995Smrg  _LT_COMPILER_BOILERPLATE
773772af6995Smrg  _LT_LINKER_BOILERPLATE
773872af6995Smrg
773972af6995Smrg  # Allow CC to be a program name with arguments.
774072af6995Smrg  lt_save_CC=$CC
774172af6995Smrg  lt_save_GCC=$GCC
774272af6995Smrg  lt_save_CFLAGS=$CFLAGS
774372af6995Smrg  CC=${F77-"f77"}
774472af6995Smrg  CFLAGS=$FFLAGS
774572af6995Smrg  compiler=$CC
774672af6995Smrg  _LT_TAGVAR(compiler, $1)=$CC
774772af6995Smrg  _LT_CC_BASENAME([$compiler])
774872af6995Smrg  GCC=$G77
774972af6995Smrg  if test -n "$compiler"; then
775072af6995Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
775172af6995Smrg    AC_MSG_RESULT([$can_build_shared])
775272af6995Smrg
775372af6995Smrg    AC_MSG_CHECKING([whether to build shared libraries])
775472af6995Smrg    test no = "$can_build_shared" && enable_shared=no
775572af6995Smrg
775672af6995Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
775772af6995Smrg    # are all built from PIC.
775872af6995Smrg    case $host_os in
775972af6995Smrg      aix3*)
776072af6995Smrg        test yes = "$enable_shared" && enable_static=no
776172af6995Smrg        if test -n "$RANLIB"; then
776272af6995Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
776372af6995Smrg          postinstall_cmds='$RANLIB $lib'
776472af6995Smrg        fi
776572af6995Smrg        ;;
776672af6995Smrg      aix[[4-9]]*)
776772af6995Smrg	if test ia64 != "$host_cpu"; then
776872af6995Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
776972af6995Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
777072af6995Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
777172af6995Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
777272af6995Smrg	  esac
777372af6995Smrg	fi
777472af6995Smrg        ;;
777572af6995Smrg    esac
777672af6995Smrg    AC_MSG_RESULT([$enable_shared])
777772af6995Smrg
777872af6995Smrg    AC_MSG_CHECKING([whether to build static libraries])
777972af6995Smrg    # Make sure either enable_shared or enable_static is yes.
778072af6995Smrg    test yes = "$enable_shared" || enable_static=yes
778172af6995Smrg    AC_MSG_RESULT([$enable_static])
778272af6995Smrg
778372af6995Smrg    _LT_TAGVAR(GCC, $1)=$G77
778472af6995Smrg    _LT_TAGVAR(LD, $1)=$LD
778572af6995Smrg
778672af6995Smrg    ## CAVEAT EMPTOR:
778772af6995Smrg    ## There is no encapsulation within the following macros, do not change
778872af6995Smrg    ## the running order or otherwise move them around unless you know exactly
778972af6995Smrg    ## what you are doing...
779072af6995Smrg    _LT_COMPILER_PIC($1)
779172af6995Smrg    _LT_COMPILER_C_O($1)
779272af6995Smrg    _LT_COMPILER_FILE_LOCKS($1)
779372af6995Smrg    _LT_LINKER_SHLIBS($1)
779472af6995Smrg    _LT_SYS_DYNAMIC_LINKER($1)
779572af6995Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
779672af6995Smrg
779772af6995Smrg    _LT_CONFIG($1)
779872af6995Smrg  fi # test -n "$compiler"
779972af6995Smrg
780072af6995Smrg  GCC=$lt_save_GCC
780172af6995Smrg  CC=$lt_save_CC
780272af6995Smrg  CFLAGS=$lt_save_CFLAGS
780372af6995Smrgfi # test yes != "$_lt_disable_F77"
780472af6995Smrg
780572af6995SmrgAC_LANG_POP
780672af6995Smrg])# _LT_LANG_F77_CONFIG
780772af6995Smrg
780872af6995Smrg
780972af6995Smrg# _LT_LANG_FC_CONFIG([TAG])
781072af6995Smrg# -------------------------
781172af6995Smrg# Ensure that the configuration variables for a Fortran compiler are
781272af6995Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
781372af6995Smrg# to write the compiler configuration to 'libtool'.
781472af6995Smrgm4_defun([_LT_LANG_FC_CONFIG],
781572af6995Smrg[AC_LANG_PUSH(Fortran)
781672af6995Smrg
781772af6995Smrgif test -z "$FC" || test no = "$FC"; then
781872af6995Smrg  _lt_disable_FC=yes
781972af6995Smrgfi
782072af6995Smrg
782172af6995Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
782272af6995Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
782372af6995Smrg_LT_TAGVAR(always_export_symbols, $1)=no
782472af6995Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
782572af6995Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
782672af6995Smrg_LT_TAGVAR(hardcode_direct, $1)=no
782772af6995Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
782872af6995Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
782972af6995Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
783072af6995Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
783172af6995Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
783272af6995Smrg_LT_TAGVAR(inherit_rpath, $1)=no
783372af6995Smrg_LT_TAGVAR(module_cmds, $1)=
783472af6995Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
783572af6995Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
783672af6995Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
783772af6995Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
783872af6995Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
783972af6995Smrg_LT_TAGVAR(no_undefined_flag, $1)=
784072af6995Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
784172af6995Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
784272af6995Smrg
784372af6995Smrg# Source file extension for fc test sources.
784472af6995Smrgac_ext=${ac_fc_srcext-f}
784572af6995Smrg
784672af6995Smrg# Object file extension for compiled fc test sources.
784772af6995Smrgobjext=o
784872af6995Smrg_LT_TAGVAR(objext, $1)=$objext
784972af6995Smrg
785072af6995Smrg# No sense in running all these tests if we already determined that
785172af6995Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
785272af6995Smrg# are currently assumed to apply to all compilers on this platform,
785372af6995Smrg# and will be corrupted by setting them based on a non-working compiler.
785472af6995Smrgif test yes != "$_lt_disable_FC"; then
785572af6995Smrg  # Code to be used in simple compile tests
785672af6995Smrg  lt_simple_compile_test_code="\
785772af6995Smrg      subroutine t
785872af6995Smrg      return
785972af6995Smrg      end
786072af6995Smrg"
786172af6995Smrg
786272af6995Smrg  # Code to be used in simple link tests
786372af6995Smrg  lt_simple_link_test_code="\
786472af6995Smrg      program t
786572af6995Smrg      end
786672af6995Smrg"
786772af6995Smrg
786872af6995Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
786972af6995Smrg  _LT_TAG_COMPILER
787072af6995Smrg
787172af6995Smrg  # save warnings/boilerplate of simple test code
787272af6995Smrg  _LT_COMPILER_BOILERPLATE
787372af6995Smrg  _LT_LINKER_BOILERPLATE
787472af6995Smrg
787572af6995Smrg  # Allow CC to be a program name with arguments.
787672af6995Smrg  lt_save_CC=$CC
787772af6995Smrg  lt_save_GCC=$GCC
787872af6995Smrg  lt_save_CFLAGS=$CFLAGS
787972af6995Smrg  CC=${FC-"f95"}
788072af6995Smrg  CFLAGS=$FCFLAGS
788172af6995Smrg  compiler=$CC
788272af6995Smrg  GCC=$ac_cv_fc_compiler_gnu
788372af6995Smrg
788472af6995Smrg  _LT_TAGVAR(compiler, $1)=$CC
788572af6995Smrg  _LT_CC_BASENAME([$compiler])
788672af6995Smrg
788772af6995Smrg  if test -n "$compiler"; then
788872af6995Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
788972af6995Smrg    AC_MSG_RESULT([$can_build_shared])
789072af6995Smrg
789172af6995Smrg    AC_MSG_CHECKING([whether to build shared libraries])
789272af6995Smrg    test no = "$can_build_shared" && enable_shared=no
789372af6995Smrg
789472af6995Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
789572af6995Smrg    # are all built from PIC.
789672af6995Smrg    case $host_os in
789772af6995Smrg      aix3*)
789872af6995Smrg        test yes = "$enable_shared" && enable_static=no
789972af6995Smrg        if test -n "$RANLIB"; then
790072af6995Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
790172af6995Smrg          postinstall_cmds='$RANLIB $lib'
790272af6995Smrg        fi
790372af6995Smrg        ;;
790472af6995Smrg      aix[[4-9]]*)
790572af6995Smrg	if test ia64 != "$host_cpu"; then
790672af6995Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
790772af6995Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
790872af6995Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
790972af6995Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
791072af6995Smrg	  esac
791172af6995Smrg	fi
791272af6995Smrg        ;;
791372af6995Smrg    esac
791472af6995Smrg    AC_MSG_RESULT([$enable_shared])
791572af6995Smrg
791672af6995Smrg    AC_MSG_CHECKING([whether to build static libraries])
791772af6995Smrg    # Make sure either enable_shared or enable_static is yes.
791872af6995Smrg    test yes = "$enable_shared" || enable_static=yes
791972af6995Smrg    AC_MSG_RESULT([$enable_static])
792072af6995Smrg
792172af6995Smrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
792272af6995Smrg    _LT_TAGVAR(LD, $1)=$LD
792372af6995Smrg
792472af6995Smrg    ## CAVEAT EMPTOR:
792572af6995Smrg    ## There is no encapsulation within the following macros, do not change
792672af6995Smrg    ## the running order or otherwise move them around unless you know exactly
792772af6995Smrg    ## what you are doing...
792872af6995Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
792972af6995Smrg    _LT_COMPILER_PIC($1)
793072af6995Smrg    _LT_COMPILER_C_O($1)
793172af6995Smrg    _LT_COMPILER_FILE_LOCKS($1)
793272af6995Smrg    _LT_LINKER_SHLIBS($1)
793372af6995Smrg    _LT_SYS_DYNAMIC_LINKER($1)
793472af6995Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
793572af6995Smrg
793672af6995Smrg    _LT_CONFIG($1)
793772af6995Smrg  fi # test -n "$compiler"
793872af6995Smrg
793972af6995Smrg  GCC=$lt_save_GCC
794072af6995Smrg  CC=$lt_save_CC
794172af6995Smrg  CFLAGS=$lt_save_CFLAGS
794272af6995Smrgfi # test yes != "$_lt_disable_FC"
794372af6995Smrg
794472af6995SmrgAC_LANG_POP
794572af6995Smrg])# _LT_LANG_FC_CONFIG
794672af6995Smrg
794772af6995Smrg
794872af6995Smrg# _LT_LANG_GCJ_CONFIG([TAG])
794972af6995Smrg# --------------------------
795072af6995Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
795172af6995Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
795272af6995Smrg# to write the compiler configuration to 'libtool'.
795372af6995Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
795472af6995Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
795572af6995SmrgAC_LANG_SAVE
795672af6995Smrg
795772af6995Smrg# Source file extension for Java test sources.
795872af6995Smrgac_ext=java
795972af6995Smrg
796072af6995Smrg# Object file extension for compiled Java test sources.
796172af6995Smrgobjext=o
796272af6995Smrg_LT_TAGVAR(objext, $1)=$objext
796372af6995Smrg
796472af6995Smrg# Code to be used in simple compile tests
796572af6995Smrglt_simple_compile_test_code="class foo {}"
796672af6995Smrg
796772af6995Smrg# Code to be used in simple link tests
796872af6995Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
796972af6995Smrg
797072af6995Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
797172af6995Smrg_LT_TAG_COMPILER
797272af6995Smrg
797372af6995Smrg# save warnings/boilerplate of simple test code
797472af6995Smrg_LT_COMPILER_BOILERPLATE
797572af6995Smrg_LT_LINKER_BOILERPLATE
797672af6995Smrg
797772af6995Smrg# Allow CC to be a program name with arguments.
797872af6995Smrglt_save_CC=$CC
797972af6995Smrglt_save_CFLAGS=$CFLAGS
798072af6995Smrglt_save_GCC=$GCC
798172af6995SmrgGCC=yes
798272af6995SmrgCC=${GCJ-"gcj"}
798372af6995SmrgCFLAGS=$GCJFLAGS
798472af6995Smrgcompiler=$CC
798572af6995Smrg_LT_TAGVAR(compiler, $1)=$CC
798672af6995Smrg_LT_TAGVAR(LD, $1)=$LD
798772af6995Smrg_LT_CC_BASENAME([$compiler])
798872af6995Smrg
798972af6995Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
799072af6995Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
799172af6995Smrg
799272af6995Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
799372af6995Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
799472af6995Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
799572af6995Smrg
799672af6995Smrg## CAVEAT EMPTOR:
799772af6995Smrg## There is no encapsulation within the following macros, do not change
799872af6995Smrg## the running order or otherwise move them around unless you know exactly
799972af6995Smrg## what you are doing...
800072af6995Smrgif test -n "$compiler"; then
800172af6995Smrg  _LT_COMPILER_NO_RTTI($1)
800272af6995Smrg  _LT_COMPILER_PIC($1)
800372af6995Smrg  _LT_COMPILER_C_O($1)
800472af6995Smrg  _LT_COMPILER_FILE_LOCKS($1)
800572af6995Smrg  _LT_LINKER_SHLIBS($1)
800672af6995Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
800772af6995Smrg
800872af6995Smrg  _LT_CONFIG($1)
800972af6995Smrgfi
801072af6995Smrg
801172af6995SmrgAC_LANG_RESTORE
801272af6995Smrg
801372af6995SmrgGCC=$lt_save_GCC
801472af6995SmrgCC=$lt_save_CC
801572af6995SmrgCFLAGS=$lt_save_CFLAGS
801672af6995Smrg])# _LT_LANG_GCJ_CONFIG
801772af6995Smrg
801872af6995Smrg
801972af6995Smrg# _LT_LANG_GO_CONFIG([TAG])
802072af6995Smrg# --------------------------
802172af6995Smrg# Ensure that the configuration variables for the GNU Go compiler
802272af6995Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
802372af6995Smrg# to write the compiler configuration to 'libtool'.
802472af6995Smrgm4_defun([_LT_LANG_GO_CONFIG],
802572af6995Smrg[AC_REQUIRE([LT_PROG_GO])dnl
802672af6995SmrgAC_LANG_SAVE
802772af6995Smrg
802872af6995Smrg# Source file extension for Go test sources.
802972af6995Smrgac_ext=go
803072af6995Smrg
803172af6995Smrg# Object file extension for compiled Go test sources.
803272af6995Smrgobjext=o
803372af6995Smrg_LT_TAGVAR(objext, $1)=$objext
803472af6995Smrg
803572af6995Smrg# Code to be used in simple compile tests
803672af6995Smrglt_simple_compile_test_code="package main; func main() { }"
803772af6995Smrg
803872af6995Smrg# Code to be used in simple link tests
803972af6995Smrglt_simple_link_test_code='package main; func main() { }'
804072af6995Smrg
804172af6995Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
804272af6995Smrg_LT_TAG_COMPILER
804372af6995Smrg
804472af6995Smrg# save warnings/boilerplate of simple test code
804572af6995Smrg_LT_COMPILER_BOILERPLATE
804672af6995Smrg_LT_LINKER_BOILERPLATE
804772af6995Smrg
804872af6995Smrg# Allow CC to be a program name with arguments.
804972af6995Smrglt_save_CC=$CC
805072af6995Smrglt_save_CFLAGS=$CFLAGS
805172af6995Smrglt_save_GCC=$GCC
805272af6995SmrgGCC=yes
805372af6995SmrgCC=${GOC-"gccgo"}
805472af6995SmrgCFLAGS=$GOFLAGS
805572af6995Smrgcompiler=$CC
805672af6995Smrg_LT_TAGVAR(compiler, $1)=$CC
805772af6995Smrg_LT_TAGVAR(LD, $1)=$LD
805872af6995Smrg_LT_CC_BASENAME([$compiler])
805972af6995Smrg
806072af6995Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
806172af6995Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
806272af6995Smrg
806372af6995Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
806472af6995Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
806572af6995Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
806672af6995Smrg
806772af6995Smrg## CAVEAT EMPTOR:
806872af6995Smrg## There is no encapsulation within the following macros, do not change
806972af6995Smrg## the running order or otherwise move them around unless you know exactly
807072af6995Smrg## what you are doing...
807172af6995Smrgif test -n "$compiler"; then
807272af6995Smrg  _LT_COMPILER_NO_RTTI($1)
807372af6995Smrg  _LT_COMPILER_PIC($1)
807472af6995Smrg  _LT_COMPILER_C_O($1)
807572af6995Smrg  _LT_COMPILER_FILE_LOCKS($1)
807672af6995Smrg  _LT_LINKER_SHLIBS($1)
807772af6995Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
807872af6995Smrg
807972af6995Smrg  _LT_CONFIG($1)
808072af6995Smrgfi
808172af6995Smrg
808272af6995SmrgAC_LANG_RESTORE
808372af6995Smrg
808472af6995SmrgGCC=$lt_save_GCC
808572af6995SmrgCC=$lt_save_CC
808672af6995SmrgCFLAGS=$lt_save_CFLAGS
808772af6995Smrg])# _LT_LANG_GO_CONFIG
808872af6995Smrg
808972af6995Smrg
809072af6995Smrg# _LT_LANG_RC_CONFIG([TAG])
809172af6995Smrg# -------------------------
809272af6995Smrg# Ensure that the configuration variables for the Windows resource compiler
809372af6995Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
809472af6995Smrg# to write the compiler configuration to 'libtool'.
809572af6995Smrgm4_defun([_LT_LANG_RC_CONFIG],
809672af6995Smrg[AC_REQUIRE([LT_PROG_RC])dnl
809772af6995SmrgAC_LANG_SAVE
809872af6995Smrg
809972af6995Smrg# Source file extension for RC test sources.
810072af6995Smrgac_ext=rc
810172af6995Smrg
810272af6995Smrg# Object file extension for compiled RC test sources.
810372af6995Smrgobjext=o
810472af6995Smrg_LT_TAGVAR(objext, $1)=$objext
810572af6995Smrg
810672af6995Smrg# Code to be used in simple compile tests
810772af6995Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
810872af6995Smrg
810972af6995Smrg# Code to be used in simple link tests
811072af6995Smrglt_simple_link_test_code=$lt_simple_compile_test_code
811172af6995Smrg
811272af6995Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
811372af6995Smrg_LT_TAG_COMPILER
811472af6995Smrg
811572af6995Smrg# save warnings/boilerplate of simple test code
811672af6995Smrg_LT_COMPILER_BOILERPLATE
811772af6995Smrg_LT_LINKER_BOILERPLATE
811872af6995Smrg
811972af6995Smrg# Allow CC to be a program name with arguments.
812072af6995Smrglt_save_CC=$CC
812172af6995Smrglt_save_CFLAGS=$CFLAGS
812272af6995Smrglt_save_GCC=$GCC
812372af6995SmrgGCC=
812472af6995SmrgCC=${RC-"windres"}
812572af6995SmrgCFLAGS=
812672af6995Smrgcompiler=$CC
812772af6995Smrg_LT_TAGVAR(compiler, $1)=$CC
812872af6995Smrg_LT_CC_BASENAME([$compiler])
812972af6995Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
813072af6995Smrg
813172af6995Smrgif test -n "$compiler"; then
813272af6995Smrg  :
813372af6995Smrg  _LT_CONFIG($1)
813472af6995Smrgfi
813572af6995Smrg
813672af6995SmrgGCC=$lt_save_GCC
813772af6995SmrgAC_LANG_RESTORE
813872af6995SmrgCC=$lt_save_CC
813972af6995SmrgCFLAGS=$lt_save_CFLAGS
814072af6995Smrg])# _LT_LANG_RC_CONFIG
814172af6995Smrg
814272af6995Smrg
814372af6995Smrg# LT_PROG_GCJ
814472af6995Smrg# -----------
814572af6995SmrgAC_DEFUN([LT_PROG_GCJ],
814672af6995Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
814772af6995Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
814872af6995Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
814972af6995Smrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
815072af6995Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
815172af6995Smrg])
815272af6995Smrg
815372af6995Smrg# Old name:
815472af6995SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
815572af6995Smrgdnl aclocal-1.4 backwards compatibility:
815672af6995Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
815772af6995Smrg
815872af6995Smrg
815972af6995Smrg# LT_PROG_GO
816072af6995Smrg# ----------
816172af6995SmrgAC_DEFUN([LT_PROG_GO],
816272af6995Smrg[AC_CHECK_TOOL(GOC, gccgo,)
816372af6995Smrg])
816472af6995Smrg
816572af6995Smrg
816672af6995Smrg# LT_PROG_RC
816772af6995Smrg# ----------
816872af6995SmrgAC_DEFUN([LT_PROG_RC],
816972af6995Smrg[AC_CHECK_TOOL(RC, windres,)
817072af6995Smrg])
817172af6995Smrg
817272af6995Smrg# Old name:
817372af6995SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
817472af6995Smrgdnl aclocal-1.4 backwards compatibility:
817572af6995Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
817672af6995Smrg
817772af6995Smrg
817872af6995Smrg# _LT_DECL_EGREP
817972af6995Smrg# --------------
818072af6995Smrg# If we don't have a new enough Autoconf to choose the best grep
818172af6995Smrg# available, choose the one first in the user's PATH.
818272af6995Smrgm4_defun([_LT_DECL_EGREP],
818372af6995Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
818472af6995SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
818572af6995Smrgtest -z "$GREP" && GREP=grep
818672af6995Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
818772af6995Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
818872af6995Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
818972af6995Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
819072af6995SmrgAC_SUBST([GREP])
819172af6995Smrg])
819272af6995Smrg
819372af6995Smrg
819472af6995Smrg# _LT_DECL_OBJDUMP
819572af6995Smrg# --------------
819672af6995Smrg# If we don't have a new enough Autoconf to choose the best objdump
819772af6995Smrg# available, choose the one first in the user's PATH.
819872af6995Smrgm4_defun([_LT_DECL_OBJDUMP],
819972af6995Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
820072af6995Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
820172af6995Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
820272af6995SmrgAC_SUBST([OBJDUMP])
820372af6995Smrg])
820472af6995Smrg
820572af6995Smrg# _LT_DECL_DLLTOOL
820672af6995Smrg# ----------------
820772af6995Smrg# Ensure DLLTOOL variable is set.
820872af6995Smrgm4_defun([_LT_DECL_DLLTOOL],
820972af6995Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
821072af6995Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
821172af6995Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
821272af6995SmrgAC_SUBST([DLLTOOL])
821372af6995Smrg])
821472af6995Smrg
8215a773ec55Smrg# _LT_DECL_FILECMD
8216a773ec55Smrg# ----------------
8217a773ec55Smrg# Check for a file(cmd) program that can be used to detect file type and magic
8218a773ec55Smrgm4_defun([_LT_DECL_FILECMD],
8219a773ec55Smrg[AC_CHECK_TOOL([FILECMD], [file], [:])
8220a773ec55Smrg_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
8221a773ec55Smrg])# _LD_DECL_FILECMD
8222a773ec55Smrg
822372af6995Smrg# _LT_DECL_SED
822472af6995Smrg# ------------
822572af6995Smrg# Check for a fully-functional sed program, that truncates
822672af6995Smrg# as few characters as possible.  Prefer GNU sed if found.
822772af6995Smrgm4_defun([_LT_DECL_SED],
822872af6995Smrg[AC_PROG_SED
822972af6995Smrgtest -z "$SED" && SED=sed
823072af6995SmrgXsed="$SED -e 1s/^X//"
823172af6995Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
823272af6995Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
823372af6995Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
823472af6995Smrg])# _LT_DECL_SED
823572af6995Smrg
823672af6995Smrgm4_ifndef([AC_PROG_SED], [
823772af6995Smrg############################################################
823872af6995Smrg# NOTE: This macro has been submitted for inclusion into   #
823972af6995Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
824072af6995Smrg#  a released version of Autoconf we should remove this    #
824172af6995Smrg#  macro and use it instead.                               #
824272af6995Smrg############################################################
824372af6995Smrg
824472af6995Smrgm4_defun([AC_PROG_SED],
824572af6995Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
824672af6995SmrgAC_CACHE_VAL(lt_cv_path_SED,
824772af6995Smrg[# Loop through the user's path and test for sed and gsed.
824872af6995Smrg# Then use that list of sed's as ones to test for truncation.
824972af6995Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
825072af6995Smrgfor as_dir in $PATH
825172af6995Smrgdo
825272af6995Smrg  IFS=$as_save_IFS
825372af6995Smrg  test -z "$as_dir" && as_dir=.
825472af6995Smrg  for lt_ac_prog in sed gsed; do
825572af6995Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
825672af6995Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
825772af6995Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
825872af6995Smrg      fi
825972af6995Smrg    done
826072af6995Smrg  done
826172af6995Smrgdone
826272af6995SmrgIFS=$as_save_IFS
826372af6995Smrglt_ac_max=0
826472af6995Smrglt_ac_count=0
826572af6995Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
826672af6995Smrg# along with /bin/sed that truncates output.
826772af6995Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
826872af6995Smrg  test ! -f "$lt_ac_sed" && continue
826972af6995Smrg  cat /dev/null > conftest.in
827072af6995Smrg  lt_ac_count=0
827172af6995Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
827272af6995Smrg  # Check for GNU sed and select it if it is found.
827372af6995Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
827472af6995Smrg    lt_cv_path_SED=$lt_ac_sed
827572af6995Smrg    break
827672af6995Smrg  fi
827772af6995Smrg  while true; do
827872af6995Smrg    cat conftest.in conftest.in >conftest.tmp
827972af6995Smrg    mv conftest.tmp conftest.in
828072af6995Smrg    cp conftest.in conftest.nl
828172af6995Smrg    echo >>conftest.nl
828272af6995Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
828372af6995Smrg    cmp -s conftest.out conftest.nl || break
828472af6995Smrg    # 10000 chars as input seems more than enough
828572af6995Smrg    test 10 -lt "$lt_ac_count" && break
828672af6995Smrg    lt_ac_count=`expr $lt_ac_count + 1`
828772af6995Smrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
828872af6995Smrg      lt_ac_max=$lt_ac_count
828972af6995Smrg      lt_cv_path_SED=$lt_ac_sed
829072af6995Smrg    fi
829172af6995Smrg  done
829272af6995Smrgdone
829372af6995Smrg])
829472af6995SmrgSED=$lt_cv_path_SED
829572af6995SmrgAC_SUBST([SED])
829672af6995SmrgAC_MSG_RESULT([$SED])
829772af6995Smrg])#AC_PROG_SED
829872af6995Smrg])#m4_ifndef
829972af6995Smrg
830072af6995Smrg# Old name:
830172af6995SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
830272af6995Smrgdnl aclocal-1.4 backwards compatibility:
830372af6995Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
830472af6995Smrg
830572af6995Smrg
830672af6995Smrg# _LT_CHECK_SHELL_FEATURES
830772af6995Smrg# ------------------------
830872af6995Smrg# Find out whether the shell is Bourne or XSI compatible,
830972af6995Smrg# or has some other useful features.
831072af6995Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
831172af6995Smrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
831272af6995Smrg  lt_unset=unset
831372af6995Smrgelse
831472af6995Smrg  lt_unset=false
831572af6995Smrgfi
831672af6995Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
831772af6995Smrg
831872af6995Smrg# test EBCDIC or ASCII
831972af6995Smrgcase `echo X|tr X '\101'` in
832072af6995Smrg A) # ASCII based system
832172af6995Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
832272af6995Smrg  lt_SP2NL='tr \040 \012'
832372af6995Smrg  lt_NL2SP='tr \015\012 \040\040'
832472af6995Smrg  ;;
832572af6995Smrg *) # EBCDIC based system
832672af6995Smrg  lt_SP2NL='tr \100 \n'
832772af6995Smrg  lt_NL2SP='tr \r\n \100\100'
832872af6995Smrg  ;;
832972af6995Smrgesac
833072af6995Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
833172af6995Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
833272af6995Smrg])# _LT_CHECK_SHELL_FEATURES
833372af6995Smrg
833472af6995Smrg
833572af6995Smrg# _LT_PATH_CONVERSION_FUNCTIONS
833672af6995Smrg# -----------------------------
833772af6995Smrg# Determine what file name conversion functions should be used by
833872af6995Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
833972af6995Smrg# for certain cross-compile configurations and native mingw.
834072af6995Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
834172af6995Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
834272af6995SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
834372af6995SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
834472af6995SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
834572af6995Smrg[case $host in
834672af6995Smrg  *-*-mingw* )
834772af6995Smrg    case $build in
834872af6995Smrg      *-*-mingw* ) # actually msys
834972af6995Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
835072af6995Smrg        ;;
835172af6995Smrg      *-*-cygwin* )
835272af6995Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
835372af6995Smrg        ;;
835472af6995Smrg      * ) # otherwise, assume *nix
835572af6995Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
835672af6995Smrg        ;;
835772af6995Smrg    esac
835872af6995Smrg    ;;
835972af6995Smrg  *-*-cygwin* )
836072af6995Smrg    case $build in
836172af6995Smrg      *-*-mingw* ) # actually msys
836272af6995Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
836372af6995Smrg        ;;
836472af6995Smrg      *-*-cygwin* )
836572af6995Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
836672af6995Smrg        ;;
836772af6995Smrg      * ) # otherwise, assume *nix
836872af6995Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
836972af6995Smrg        ;;
837072af6995Smrg    esac
837172af6995Smrg    ;;
837272af6995Smrg  * ) # unhandled hosts (and "normal" native builds)
837372af6995Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
837472af6995Smrg    ;;
837572af6995Smrgesac
837672af6995Smrg])
837772af6995Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
837872af6995SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
837972af6995Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
838072af6995Smrg         [0], [convert $build file names to $host format])dnl
838172af6995Smrg
838272af6995SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
838372af6995SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
838472af6995Smrg[#assume ordinary cross tools, or native build.
838572af6995Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
838672af6995Smrgcase $host in
838772af6995Smrg  *-*-mingw* )
838872af6995Smrg    case $build in
838972af6995Smrg      *-*-mingw* ) # actually msys
839072af6995Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
839172af6995Smrg        ;;
839272af6995Smrg    esac
839372af6995Smrg    ;;
839472af6995Smrgesac
839572af6995Smrg])
839672af6995Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
839772af6995SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
839872af6995Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
839972af6995Smrg         [0], [convert $build files to toolchain format])dnl
840072af6995Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
8401