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