xref: /netbsd-src/external/gpl3/binutils.old/dist/libtool.m4 (revision e992f068c547fd6e84b3f104dc2340adcc955732)
175fd0b74Schristos# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
275fd0b74Schristos#
375fd0b74Schristos#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
475fd0b74Schristos#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
575fd0b74Schristos#   Written by Gordon Matzigkeit, 1996
675fd0b74Schristos#
775fd0b74Schristos# This file is free software; the Free Software Foundation gives
875fd0b74Schristos# unlimited permission to copy and/or distribute it, with or without
975fd0b74Schristos# modifications, as long as this notice is preserved.
1075fd0b74Schristos
1175fd0b74Schristosm4_define([_LT_COPYING], [dnl
1275fd0b74Schristos#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1375fd0b74Schristos#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
1475fd0b74Schristos#   Written by Gordon Matzigkeit, 1996
1575fd0b74Schristos#
1675fd0b74Schristos#   This file is part of GNU Libtool.
1775fd0b74Schristos#
1875fd0b74Schristos# GNU Libtool is free software; you can redistribute it and/or
1975fd0b74Schristos# modify it under the terms of the GNU General Public License as
2075fd0b74Schristos# published by the Free Software Foundation; either version 2 of
2175fd0b74Schristos# the License, or (at your option) any later version.
2275fd0b74Schristos#
2375fd0b74Schristos# As a special exception to the GNU General Public License,
2475fd0b74Schristos# if you distribute this file as part of a program or library that
2575fd0b74Schristos# is built using GNU Libtool, you may include this file under the
2675fd0b74Schristos# same distribution terms that you use for the rest of that program.
2775fd0b74Schristos#
2875fd0b74Schristos# GNU Libtool is distributed in the hope that it will be useful,
2975fd0b74Schristos# but WITHOUT ANY WARRANTY; without even the implied warranty of
3075fd0b74Schristos# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3175fd0b74Schristos# GNU General Public License for more details.
3275fd0b74Schristos#
3375fd0b74Schristos# You should have received a copy of the GNU General Public License
3475fd0b74Schristos# along with GNU Libtool; see the file COPYING.  If not, a copy
3575fd0b74Schristos# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
3675fd0b74Schristos# obtained by writing to the Free Software Foundation, Inc.,
3775fd0b74Schristos# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
3875fd0b74Schristos])
3975fd0b74Schristos
4075fd0b74Schristos# serial 56 LT_INIT
4175fd0b74Schristos
4275fd0b74Schristos
4375fd0b74Schristos# LT_PREREQ(VERSION)
4475fd0b74Schristos# ------------------
4575fd0b74Schristos# Complain and exit if this libtool version is less that VERSION.
4675fd0b74Schristosm4_defun([LT_PREREQ],
4775fd0b74Schristos[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
4875fd0b74Schristos       [m4_default([$3],
4975fd0b74Schristos		   [m4_fatal([Libtool version $1 or higher is required],
5075fd0b74Schristos		             63)])],
5175fd0b74Schristos       [$2])])
5275fd0b74Schristos
5375fd0b74Schristos
5475fd0b74Schristos# _LT_CHECK_BUILDDIR
5575fd0b74Schristos# ------------------
5675fd0b74Schristos# Complain if the absolute build directory name contains unusual characters
5775fd0b74Schristosm4_defun([_LT_CHECK_BUILDDIR],
5875fd0b74Schristos[case `pwd` in
5975fd0b74Schristos  *\ * | *\	*)
6075fd0b74Schristos    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
6175fd0b74Schristosesac
6275fd0b74Schristos])
6375fd0b74Schristos
6475fd0b74Schristos
6575fd0b74Schristos# LT_INIT([OPTIONS])
6675fd0b74Schristos# ------------------
6775fd0b74SchristosAC_DEFUN([LT_INIT],
6875fd0b74Schristos[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
6975fd0b74SchristosAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
7075fd0b74SchristosAC_BEFORE([$0], [LT_LANG])dnl
7175fd0b74SchristosAC_BEFORE([$0], [LT_OUTPUT])dnl
7275fd0b74SchristosAC_BEFORE([$0], [LTDL_INIT])dnl
7375fd0b74Schristosm4_require([_LT_CHECK_BUILDDIR])dnl
7475fd0b74Schristos
7575fd0b74Schristosdnl Autoconf doesn't catch unexpanded LT_ macros by default:
7675fd0b74Schristosm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
7775fd0b74Schristosm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
7875fd0b74Schristosdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
7975fd0b74Schristosdnl unless we require an AC_DEFUNed macro:
8075fd0b74SchristosAC_REQUIRE([LTOPTIONS_VERSION])dnl
8175fd0b74SchristosAC_REQUIRE([LTSUGAR_VERSION])dnl
8275fd0b74SchristosAC_REQUIRE([LTVERSION_VERSION])dnl
8375fd0b74SchristosAC_REQUIRE([LTOBSOLETE_VERSION])dnl
8475fd0b74Schristosm4_require([_LT_PROG_LTMAIN])dnl
8575fd0b74Schristos
8675fd0b74Schristos_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
8775fd0b74Schristos
8875fd0b74Schristosdnl Parse OPTIONS
8975fd0b74Schristos_LT_SET_OPTIONS([$0], [$1])
9075fd0b74Schristos
9175fd0b74Schristos# This can be used to rebuild libtool when needed
9275fd0b74SchristosLIBTOOL_DEPS="$ltmain"
9375fd0b74Schristos
9475fd0b74Schristos# Always use our own libtool.
9575fd0b74SchristosLIBTOOL='$(SHELL) $(top_builddir)/libtool'
9675fd0b74SchristosAC_SUBST(LIBTOOL)dnl
9775fd0b74Schristos
9875fd0b74Schristos_LT_SETUP
9975fd0b74Schristos
10075fd0b74Schristos# Only expand once:
10175fd0b74Schristosm4_define([LT_INIT])
10275fd0b74Schristos])# LT_INIT
10375fd0b74Schristos
10475fd0b74Schristos# Old names:
10575fd0b74SchristosAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
10675fd0b74SchristosAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
10775fd0b74Schristosdnl aclocal-1.4 backwards compatibility:
10875fd0b74Schristosdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
10975fd0b74Schristosdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
11075fd0b74Schristos
11175fd0b74Schristos
11275fd0b74Schristos# _LT_CC_BASENAME(CC)
11375fd0b74Schristos# -------------------
11475fd0b74Schristos# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
11575fd0b74Schristosm4_defun([_LT_CC_BASENAME],
11675fd0b74Schristos[for cc_temp in $1""; do
11775fd0b74Schristos  case $cc_temp in
11875fd0b74Schristos    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
11975fd0b74Schristos    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
12075fd0b74Schristos    \-*) ;;
12175fd0b74Schristos    *) break;;
12275fd0b74Schristos  esac
12375fd0b74Schristosdone
12475fd0b74Schristoscc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
12575fd0b74Schristos])
12675fd0b74Schristos
12775fd0b74Schristos
12875fd0b74Schristos# _LT_FILEUTILS_DEFAULTS
12975fd0b74Schristos# ----------------------
13075fd0b74Schristos# It is okay to use these file commands and assume they have been set
13175fd0b74Schristos# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
13275fd0b74Schristosm4_defun([_LT_FILEUTILS_DEFAULTS],
13375fd0b74Schristos[: ${CP="cp -f"}
13475fd0b74Schristos: ${MV="mv -f"}
13575fd0b74Schristos: ${RM="rm -f"}
13675fd0b74Schristos])# _LT_FILEUTILS_DEFAULTS
13775fd0b74Schristos
13875fd0b74Schristos
13975fd0b74Schristos# _LT_SETUP
14075fd0b74Schristos# ---------
14175fd0b74Schristosm4_defun([_LT_SETUP],
14275fd0b74Schristos[AC_REQUIRE([AC_CANONICAL_HOST])dnl
14375fd0b74SchristosAC_REQUIRE([AC_CANONICAL_BUILD])dnl
14475fd0b74SchristosAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
14575fd0b74SchristosAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
14675fd0b74Schristos
14775fd0b74Schristos_LT_DECL([], [host_alias], [0], [The host system])dnl
14875fd0b74Schristos_LT_DECL([], [host], [0])dnl
14975fd0b74Schristos_LT_DECL([], [host_os], [0])dnl
15075fd0b74Schristosdnl
15175fd0b74Schristos_LT_DECL([], [build_alias], [0], [The build system])dnl
15275fd0b74Schristos_LT_DECL([], [build], [0])dnl
15375fd0b74Schristos_LT_DECL([], [build_os], [0])dnl
15475fd0b74Schristosdnl
15575fd0b74SchristosAC_REQUIRE([AC_PROG_CC])dnl
15675fd0b74SchristosAC_REQUIRE([LT_PATH_LD])dnl
15775fd0b74SchristosAC_REQUIRE([LT_PATH_NM])dnl
15875fd0b74Schristosdnl
15975fd0b74SchristosAC_REQUIRE([AC_PROG_LN_S])dnl
16075fd0b74Schristostest -z "$LN_S" && LN_S="ln -s"
16175fd0b74Schristos_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
16275fd0b74Schristosdnl
16375fd0b74SchristosAC_REQUIRE([LT_CMD_MAX_LEN])dnl
16475fd0b74Schristos_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
16575fd0b74Schristos_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
16675fd0b74Schristosdnl
16775fd0b74Schristosm4_require([_LT_FILEUTILS_DEFAULTS])dnl
16875fd0b74Schristosm4_require([_LT_CHECK_SHELL_FEATURES])dnl
16975fd0b74Schristosm4_require([_LT_CMD_RELOAD])dnl
17075fd0b74Schristosm4_require([_LT_CHECK_MAGIC_METHOD])dnl
17175fd0b74Schristosm4_require([_LT_CMD_OLD_ARCHIVE])dnl
17275fd0b74Schristosm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
17375fd0b74Schristos
17475fd0b74Schristos_LT_CONFIG_LIBTOOL_INIT([
17575fd0b74Schristos# See if we are running on zsh, and set the options which allow our
17675fd0b74Schristos# commands through without removal of \ escapes INIT.
17775fd0b74Schristosif test -n "\${ZSH_VERSION+set}" ; then
17875fd0b74Schristos   setopt NO_GLOB_SUBST
17975fd0b74Schristosfi
18075fd0b74Schristos])
18175fd0b74Schristosif test -n "${ZSH_VERSION+set}" ; then
18275fd0b74Schristos   setopt NO_GLOB_SUBST
18375fd0b74Schristosfi
18475fd0b74Schristos
18575fd0b74Schristos_LT_CHECK_OBJDIR
18675fd0b74Schristos
18775fd0b74Schristosm4_require([_LT_TAG_COMPILER])dnl
18875fd0b74Schristos
18975fd0b74Schristoscase $host_os in
19075fd0b74Schristosaix3*)
19175fd0b74Schristos  # AIX sometimes has problems with the GCC collect2 program.  For some
19275fd0b74Schristos  # reason, if we set the COLLECT_NAMES environment variable, the problems
19375fd0b74Schristos  # vanish in a puff of smoke.
19475fd0b74Schristos  if test "X${COLLECT_NAMES+set}" != Xset; then
19575fd0b74Schristos    COLLECT_NAMES=
19675fd0b74Schristos    export COLLECT_NAMES
19775fd0b74Schristos  fi
19875fd0b74Schristos  ;;
19975fd0b74Schristosesac
20075fd0b74Schristos
20175fd0b74Schristos# Global variables:
20275fd0b74Schristosofile=libtool
20375fd0b74Schristoscan_build_shared=yes
20475fd0b74Schristos
20575fd0b74Schristos# All known linkers require a `.a' archive for static linking (except MSVC,
20675fd0b74Schristos# which needs '.lib').
20775fd0b74Schristoslibext=a
20875fd0b74Schristos
20975fd0b74Schristoswith_gnu_ld="$lt_cv_prog_gnu_ld"
21075fd0b74Schristos
21175fd0b74Schristosold_CC="$CC"
21275fd0b74Schristosold_CFLAGS="$CFLAGS"
21375fd0b74Schristos
21475fd0b74Schristos# Set sane defaults for various variables
21575fd0b74Schristostest -z "$CC" && CC=cc
21675fd0b74Schristostest -z "$LTCC" && LTCC=$CC
21775fd0b74Schristostest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
21875fd0b74Schristostest -z "$LD" && LD=ld
21975fd0b74Schristostest -z "$ac_objext" && ac_objext=o
22075fd0b74Schristos
22175fd0b74Schristos_LT_CC_BASENAME([$compiler])
22275fd0b74Schristos
22375fd0b74Schristos# Only perform the check for file, if the check method requires it
22475fd0b74Schristostest -z "$MAGIC_CMD" && MAGIC_CMD=file
22575fd0b74Schristoscase $deplibs_check_method in
22675fd0b74Schristosfile_magic*)
22775fd0b74Schristos  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
22875fd0b74Schristos    _LT_PATH_MAGIC
22975fd0b74Schristos  fi
23075fd0b74Schristos  ;;
23175fd0b74Schristosesac
23275fd0b74Schristos
23375fd0b74Schristos# Use C for the default configuration in the libtool script
23475fd0b74SchristosLT_SUPPORTED_TAG([CC])
23575fd0b74Schristos_LT_LANG_C_CONFIG
23675fd0b74Schristos_LT_LANG_DEFAULT_CONFIG
23775fd0b74Schristos_LT_CONFIG_COMMANDS
23875fd0b74Schristos])# _LT_SETUP
23975fd0b74Schristos
24075fd0b74Schristos
24175fd0b74Schristos# _LT_PREPARE_SED_QUOTE_VARS
24275fd0b74Schristos# --------------------------
24375fd0b74Schristos# Define a few sed substitution that help us do robust quoting.
24475fd0b74Schristosm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
24575fd0b74Schristos[# Backslashify metacharacters that are still active within
24675fd0b74Schristos# double-quoted strings.
24775fd0b74Schristossed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
24875fd0b74Schristos
24975fd0b74Schristos# Same as above, but do not quote variable references.
25075fd0b74Schristosdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
25175fd0b74Schristos
25275fd0b74Schristos# Sed substitution to delay expansion of an escaped shell variable in a
25375fd0b74Schristos# double_quote_subst'ed string.
25475fd0b74Schristosdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
25575fd0b74Schristos
25675fd0b74Schristos# Sed substitution to delay expansion of an escaped single quote.
25775fd0b74Schristosdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
25875fd0b74Schristos
25975fd0b74Schristos# Sed substitution to avoid accidental globbing in evaled expressions
26075fd0b74Schristosno_glob_subst='s/\*/\\\*/g'
26175fd0b74Schristos])
26275fd0b74Schristos
26375fd0b74Schristos# _LT_PROG_LTMAIN
26475fd0b74Schristos# ---------------
26575fd0b74Schristos# Note that this code is called both from `configure', and `config.status'
26675fd0b74Schristos# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
26775fd0b74Schristos# `config.status' has no value for ac_aux_dir unless we are using Automake,
26875fd0b74Schristos# so we pass a copy along to make sure it has a sensible value anyway.
26975fd0b74Schristosm4_defun([_LT_PROG_LTMAIN],
27075fd0b74Schristos[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
27175fd0b74Schristos_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
27275fd0b74Schristosltmain="$ac_aux_dir/ltmain.sh"
27375fd0b74Schristos])# _LT_PROG_LTMAIN
27475fd0b74Schristos
27575fd0b74Schristos
27675fd0b74Schristos## ------------------------------------- ##
27775fd0b74Schristos## Accumulate code for creating libtool. ##
27875fd0b74Schristos## ------------------------------------- ##
27975fd0b74Schristos
28075fd0b74Schristos# So that we can recreate a full libtool script including additional
28175fd0b74Schristos# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
28275fd0b74Schristos# in macros and then make a single call at the end using the `libtool'
28375fd0b74Schristos# label.
28475fd0b74Schristos
28575fd0b74Schristos
28675fd0b74Schristos# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
28775fd0b74Schristos# ----------------------------------------
28875fd0b74Schristos# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
28975fd0b74Schristosm4_define([_LT_CONFIG_LIBTOOL_INIT],
29075fd0b74Schristos[m4_ifval([$1],
29175fd0b74Schristos          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
29275fd0b74Schristos                     [$1
29375fd0b74Schristos])])])
29475fd0b74Schristos
29575fd0b74Schristos# Initialize.
29675fd0b74Schristosm4_define([_LT_OUTPUT_LIBTOOL_INIT])
29775fd0b74Schristos
29875fd0b74Schristos
29975fd0b74Schristos# _LT_CONFIG_LIBTOOL([COMMANDS])
30075fd0b74Schristos# ------------------------------
30175fd0b74Schristos# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
30275fd0b74Schristosm4_define([_LT_CONFIG_LIBTOOL],
30375fd0b74Schristos[m4_ifval([$1],
30475fd0b74Schristos          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
30575fd0b74Schristos                     [$1
30675fd0b74Schristos])])])
30775fd0b74Schristos
30875fd0b74Schristos# Initialize.
30975fd0b74Schristosm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
31075fd0b74Schristos
31175fd0b74Schristos
31275fd0b74Schristos# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
31375fd0b74Schristos# -----------------------------------------------------
31475fd0b74Schristosm4_defun([_LT_CONFIG_SAVE_COMMANDS],
31575fd0b74Schristos[_LT_CONFIG_LIBTOOL([$1])
31675fd0b74Schristos_LT_CONFIG_LIBTOOL_INIT([$2])
31775fd0b74Schristos])
31875fd0b74Schristos
31975fd0b74Schristos
32075fd0b74Schristos# _LT_FORMAT_COMMENT([COMMENT])
32175fd0b74Schristos# -----------------------------
32275fd0b74Schristos# Add leading comment marks to the start of each line, and a trailing
32375fd0b74Schristos# full-stop to the whole comment if one is not present already.
32475fd0b74Schristosm4_define([_LT_FORMAT_COMMENT],
32575fd0b74Schristos[m4_ifval([$1], [
32675fd0b74Schristosm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
32775fd0b74Schristos              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
32875fd0b74Schristos)])
32975fd0b74Schristos
33075fd0b74Schristos
33175fd0b74Schristos
33275fd0b74Schristos## ------------------------ ##
33375fd0b74Schristos## FIXME: Eliminate VARNAME ##
33475fd0b74Schristos## ------------------------ ##
33575fd0b74Schristos
33675fd0b74Schristos
33775fd0b74Schristos# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
33875fd0b74Schristos# -------------------------------------------------------------------
33975fd0b74Schristos# CONFIGNAME is the name given to the value in the libtool script.
34075fd0b74Schristos# VARNAME is the (base) name used in the configure script.
34175fd0b74Schristos# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
34275fd0b74Schristos# VARNAME.  Any other value will be used directly.
34375fd0b74Schristosm4_define([_LT_DECL],
34475fd0b74Schristos[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
34575fd0b74Schristos    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
34675fd0b74Schristos	[m4_ifval([$1], [$1], [$2])])
34775fd0b74Schristos    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
34875fd0b74Schristos    m4_ifval([$4],
34975fd0b74Schristos	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
35075fd0b74Schristos    lt_dict_add_subkey([lt_decl_dict], [$2],
35175fd0b74Schristos	[tagged?], [m4_ifval([$5], [yes], [no])])])
35275fd0b74Schristos])
35375fd0b74Schristos
35475fd0b74Schristos
35575fd0b74Schristos# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
35675fd0b74Schristos# --------------------------------------------------------
35775fd0b74Schristosm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
35875fd0b74Schristos
35975fd0b74Schristos
36075fd0b74Schristos# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
36175fd0b74Schristos# ------------------------------------------------
36275fd0b74Schristosm4_define([lt_decl_tag_varnames],
36375fd0b74Schristos[_lt_decl_filter([tagged?], [yes], $@)])
36475fd0b74Schristos
36575fd0b74Schristos
36675fd0b74Schristos# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
36775fd0b74Schristos# ---------------------------------------------------------
36875fd0b74Schristosm4_define([_lt_decl_filter],
36975fd0b74Schristos[m4_case([$#],
37075fd0b74Schristos  [0], [m4_fatal([$0: too few arguments: $#])],
37175fd0b74Schristos  [1], [m4_fatal([$0: too few arguments: $#: $1])],
37275fd0b74Schristos  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
37375fd0b74Schristos  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
37475fd0b74Schristos  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
37575fd0b74Schristos])
37675fd0b74Schristos
37775fd0b74Schristos
37875fd0b74Schristos# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
37975fd0b74Schristos# --------------------------------------------------
38075fd0b74Schristosm4_define([lt_decl_quote_varnames],
38175fd0b74Schristos[_lt_decl_filter([value], [1], $@)])
38275fd0b74Schristos
38375fd0b74Schristos
38475fd0b74Schristos# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
38575fd0b74Schristos# ---------------------------------------------------
38675fd0b74Schristosm4_define([lt_decl_dquote_varnames],
38775fd0b74Schristos[_lt_decl_filter([value], [2], $@)])
38875fd0b74Schristos
38975fd0b74Schristos
39075fd0b74Schristos# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
39175fd0b74Schristos# ---------------------------------------------------
39275fd0b74Schristosm4_define([lt_decl_varnames_tagged],
39375fd0b74Schristos[m4_assert([$# <= 2])dnl
39475fd0b74Schristos_$0(m4_quote(m4_default([$1], [[, ]])),
39575fd0b74Schristos    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
39675fd0b74Schristos    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
39775fd0b74Schristosm4_define([_lt_decl_varnames_tagged],
39875fd0b74Schristos[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
39975fd0b74Schristos
40075fd0b74Schristos
40175fd0b74Schristos# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
40275fd0b74Schristos# ------------------------------------------------
40375fd0b74Schristosm4_define([lt_decl_all_varnames],
40475fd0b74Schristos[_$0(m4_quote(m4_default([$1], [[, ]])),
40575fd0b74Schristos     m4_if([$2], [],
40675fd0b74Schristos	   m4_quote(lt_decl_varnames),
40775fd0b74Schristos	m4_quote(m4_shift($@))))[]dnl
40875fd0b74Schristos])
40975fd0b74Schristosm4_define([_lt_decl_all_varnames],
41075fd0b74Schristos[lt_join($@, lt_decl_varnames_tagged([$1],
41175fd0b74Schristos			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
41275fd0b74Schristos])
41375fd0b74Schristos
41475fd0b74Schristos
41575fd0b74Schristos# _LT_CONFIG_STATUS_DECLARE([VARNAME])
41675fd0b74Schristos# ------------------------------------
41775fd0b74Schristos# Quote a variable value, and forward it to `config.status' so that its
41875fd0b74Schristos# declaration there will have the same value as in `configure'.  VARNAME
41975fd0b74Schristos# must have a single quote delimited value for this to work.
42075fd0b74Schristosm4_define([_LT_CONFIG_STATUS_DECLARE],
42175fd0b74Schristos[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
42275fd0b74Schristos
42375fd0b74Schristos
42475fd0b74Schristos# _LT_CONFIG_STATUS_DECLARATIONS
42575fd0b74Schristos# ------------------------------
42675fd0b74Schristos# We delimit libtool config variables with single quotes, so when
42775fd0b74Schristos# we write them to config.status, we have to be sure to quote all
42875fd0b74Schristos# embedded single quotes properly.  In configure, this macro expands
42975fd0b74Schristos# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
43075fd0b74Schristos#
43175fd0b74Schristos#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
43275fd0b74Schristosm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
43375fd0b74Schristos[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
43475fd0b74Schristos    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
43575fd0b74Schristos
43675fd0b74Schristos
43775fd0b74Schristos# _LT_LIBTOOL_TAGS
43875fd0b74Schristos# ----------------
43975fd0b74Schristos# Output comment and list of tags supported by the script
44075fd0b74Schristosm4_defun([_LT_LIBTOOL_TAGS],
44175fd0b74Schristos[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
44275fd0b74Schristosavailable_tags="_LT_TAGS"dnl
44375fd0b74Schristos])
44475fd0b74Schristos
44575fd0b74Schristos
44675fd0b74Schristos# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
44775fd0b74Schristos# -----------------------------------
44875fd0b74Schristos# Extract the dictionary values for VARNAME (optionally with TAG) and
44975fd0b74Schristos# expand to a commented shell variable setting:
45075fd0b74Schristos#
45175fd0b74Schristos#    # Some comment about what VAR is for.
45275fd0b74Schristos#    visible_name=$lt_internal_name
45375fd0b74Schristosm4_define([_LT_LIBTOOL_DECLARE],
45475fd0b74Schristos[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
45575fd0b74Schristos					   [description])))[]dnl
45675fd0b74Schristosm4_pushdef([_libtool_name],
45775fd0b74Schristos    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
45875fd0b74Schristosm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
45975fd0b74Schristos    [0], [_libtool_name=[$]$1],
46075fd0b74Schristos    [1], [_libtool_name=$lt_[]$1],
46175fd0b74Schristos    [2], [_libtool_name=$lt_[]$1],
46275fd0b74Schristos    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
46375fd0b74Schristosm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
46475fd0b74Schristos])
46575fd0b74Schristos
46675fd0b74Schristos
46775fd0b74Schristos# _LT_LIBTOOL_CONFIG_VARS
46875fd0b74Schristos# -----------------------
46975fd0b74Schristos# Produce commented declarations of non-tagged libtool config variables
47075fd0b74Schristos# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
47175fd0b74Schristos# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
47275fd0b74Schristos# section) are produced by _LT_LIBTOOL_TAG_VARS.
47375fd0b74Schristosm4_defun([_LT_LIBTOOL_CONFIG_VARS],
47475fd0b74Schristos[m4_foreach([_lt_var],
47575fd0b74Schristos    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
47675fd0b74Schristos    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
47775fd0b74Schristos
47875fd0b74Schristos
47975fd0b74Schristos# _LT_LIBTOOL_TAG_VARS(TAG)
48075fd0b74Schristos# -------------------------
48175fd0b74Schristosm4_define([_LT_LIBTOOL_TAG_VARS],
48275fd0b74Schristos[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
48375fd0b74Schristos    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
48475fd0b74Schristos
48575fd0b74Schristos
48675fd0b74Schristos# _LT_TAGVAR(VARNAME, [TAGNAME])
48775fd0b74Schristos# ------------------------------
48875fd0b74Schristosm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
48975fd0b74Schristos
49075fd0b74Schristos
49175fd0b74Schristos# _LT_CONFIG_COMMANDS
49275fd0b74Schristos# -------------------
49375fd0b74Schristos# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
49475fd0b74Schristos# variables for single and double quote escaping we saved from calls
49575fd0b74Schristos# to _LT_DECL, we can put quote escaped variables declarations
49675fd0b74Schristos# into `config.status', and then the shell code to quote escape them in
49775fd0b74Schristos# for loops in `config.status'.  Finally, any additional code accumulated
49875fd0b74Schristos# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
49975fd0b74Schristosm4_defun([_LT_CONFIG_COMMANDS],
50075fd0b74Schristos[AC_PROVIDE_IFELSE([LT_OUTPUT],
50175fd0b74Schristos	dnl If the libtool generation code has been placed in $CONFIG_LT,
50275fd0b74Schristos	dnl instead of duplicating it all over again into config.status,
50375fd0b74Schristos	dnl then we will have config.status run $CONFIG_LT later, so it
50475fd0b74Schristos	dnl needs to know what name is stored there:
50575fd0b74Schristos        [AC_CONFIG_COMMANDS([libtool],
50675fd0b74Schristos            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
50775fd0b74Schristos    dnl If the libtool generation code is destined for config.status,
50875fd0b74Schristos    dnl expand the accumulated commands and init code now:
50975fd0b74Schristos    [AC_CONFIG_COMMANDS([libtool],
51075fd0b74Schristos        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
51175fd0b74Schristos])#_LT_CONFIG_COMMANDS
51275fd0b74Schristos
51375fd0b74Schristos
51475fd0b74Schristos# Initialize.
51575fd0b74Schristosm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
51675fd0b74Schristos[
51775fd0b74Schristos
51875fd0b74Schristos# The HP-UX ksh and POSIX shell print the target directory to stdout
51975fd0b74Schristos# if CDPATH is set.
52075fd0b74Schristos(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
52175fd0b74Schristos
52275fd0b74Schristossed_quote_subst='$sed_quote_subst'
52375fd0b74Schristosdouble_quote_subst='$double_quote_subst'
52475fd0b74Schristosdelay_variable_subst='$delay_variable_subst'
52575fd0b74Schristos_LT_CONFIG_STATUS_DECLARATIONS
52675fd0b74SchristosLTCC='$LTCC'
52775fd0b74SchristosLTCFLAGS='$LTCFLAGS'
52875fd0b74Schristoscompiler='$compiler_DEFAULT'
52975fd0b74Schristos
53075fd0b74Schristos# A function that is used when there is no print builtin or printf.
53175fd0b74Schristosfunc_fallback_echo ()
53275fd0b74Schristos{
53375fd0b74Schristos  eval 'cat <<_LTECHO_EOF
53475fd0b74Schristos\$[]1
53575fd0b74Schristos_LTECHO_EOF'
53675fd0b74Schristos}
53775fd0b74Schristos
53875fd0b74Schristos# Quote evaled strings.
53975fd0b74Schristosfor var in lt_decl_all_varnames([[ \
54075fd0b74Schristos]], lt_decl_quote_varnames); do
54175fd0b74Schristos    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
54275fd0b74Schristos    *[[\\\\\\\`\\"\\\$]]*)
54375fd0b74Schristos      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
54475fd0b74Schristos      ;;
54575fd0b74Schristos    *)
54675fd0b74Schristos      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
54775fd0b74Schristos      ;;
54875fd0b74Schristos    esac
54975fd0b74Schristosdone
55075fd0b74Schristos
55175fd0b74Schristos# Double-quote double-evaled strings.
55275fd0b74Schristosfor var in lt_decl_all_varnames([[ \
55375fd0b74Schristos]], lt_decl_dquote_varnames); do
55475fd0b74Schristos    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
55575fd0b74Schristos    *[[\\\\\\\`\\"\\\$]]*)
55675fd0b74Schristos      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
55775fd0b74Schristos      ;;
55875fd0b74Schristos    *)
55975fd0b74Schristos      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
56075fd0b74Schristos      ;;
56175fd0b74Schristos    esac
56275fd0b74Schristosdone
56375fd0b74Schristos
56475fd0b74Schristos_LT_OUTPUT_LIBTOOL_INIT
56575fd0b74Schristos])
56675fd0b74Schristos
56775fd0b74Schristos# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
56875fd0b74Schristos# ------------------------------------
56975fd0b74Schristos# Generate a child script FILE with all initialization necessary to
57075fd0b74Schristos# reuse the environment learned by the parent script, and make the
57175fd0b74Schristos# file executable.  If COMMENT is supplied, it is inserted after the
57275fd0b74Schristos# `#!' sequence but before initialization text begins.  After this
57375fd0b74Schristos# macro, additional text can be appended to FILE to form the body of
57475fd0b74Schristos# the child script.  The macro ends with non-zero status if the
57575fd0b74Schristos# file could not be fully written (such as if the disk is full).
57675fd0b74Schristosm4_ifdef([AS_INIT_GENERATED],
57775fd0b74Schristos[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
57875fd0b74Schristos[m4_defun([_LT_GENERATED_FILE_INIT],
57975fd0b74Schristos[m4_require([AS_PREPARE])]dnl
58075fd0b74Schristos[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
58175fd0b74Schristos[lt_write_fail=0
58275fd0b74Schristoscat >$1 <<_ASEOF || lt_write_fail=1
58375fd0b74Schristos#! $SHELL
58475fd0b74Schristos# Generated by $as_me.
58575fd0b74Schristos$2
58675fd0b74SchristosSHELL=\${CONFIG_SHELL-$SHELL}
58775fd0b74Schristosexport SHELL
58875fd0b74Schristos_ASEOF
58975fd0b74Schristoscat >>$1 <<\_ASEOF || lt_write_fail=1
59075fd0b74SchristosAS_SHELL_SANITIZE
59175fd0b74Schristos_AS_PREPARE
59275fd0b74Schristosexec AS_MESSAGE_FD>&1
59375fd0b74Schristos_ASEOF
59475fd0b74Schristostest $lt_write_fail = 0 && chmod +x $1[]dnl
59575fd0b74Schristosm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
59675fd0b74Schristos
59775fd0b74Schristos# LT_OUTPUT
59875fd0b74Schristos# ---------
59975fd0b74Schristos# This macro allows early generation of the libtool script (before
60075fd0b74Schristos# AC_OUTPUT is called), incase it is used in configure for compilation
60175fd0b74Schristos# tests.
60275fd0b74SchristosAC_DEFUN([LT_OUTPUT],
60375fd0b74Schristos[: ${CONFIG_LT=./config.lt}
60475fd0b74SchristosAC_MSG_NOTICE([creating $CONFIG_LT])
60575fd0b74Schristos_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
60675fd0b74Schristos[# Run this file to recreate a libtool stub with the current configuration.])
60775fd0b74Schristos
60875fd0b74Schristoscat >>"$CONFIG_LT" <<\_LTEOF
60975fd0b74Schristoslt_cl_silent=false
61075fd0b74Schristosexec AS_MESSAGE_LOG_FD>>config.log
61175fd0b74Schristos{
61275fd0b74Schristos  echo
61375fd0b74Schristos  AS_BOX([Running $as_me.])
61475fd0b74Schristos} >&AS_MESSAGE_LOG_FD
61575fd0b74Schristos
61675fd0b74Schristoslt_cl_help="\
61775fd0b74Schristos\`$as_me' creates a local libtool stub from the current configuration,
61875fd0b74Schristosfor use in further configure time tests before the real libtool is
61975fd0b74Schristosgenerated.
62075fd0b74Schristos
62175fd0b74SchristosUsage: $[0] [[OPTIONS]]
62275fd0b74Schristos
62375fd0b74Schristos  -h, --help      print this help, then exit
62475fd0b74Schristos  -V, --version   print version number, then exit
62575fd0b74Schristos  -q, --quiet     do not print progress messages
62675fd0b74Schristos  -d, --debug     don't remove temporary files
62775fd0b74Schristos
62875fd0b74SchristosReport bugs to <bug-libtool@gnu.org>."
62975fd0b74Schristos
63075fd0b74Schristoslt_cl_version="\
63175fd0b74Schristosm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
63275fd0b74Schristosm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
63375fd0b74Schristosconfigured by $[0], generated by m4_PACKAGE_STRING.
63475fd0b74Schristos
63575fd0b74SchristosCopyright (C) 2009 Free Software Foundation, Inc.
63675fd0b74SchristosThis config.lt script is free software; the Free Software Foundation
63775fd0b74Schristosgives unlimited permision to copy, distribute and modify it."
63875fd0b74Schristos
63975fd0b74Schristoswhile test $[#] != 0
64075fd0b74Schristosdo
64175fd0b74Schristos  case $[1] in
64275fd0b74Schristos    --version | --v* | -V )
64375fd0b74Schristos      echo "$lt_cl_version"; exit 0 ;;
64475fd0b74Schristos    --help | --h* | -h )
64575fd0b74Schristos      echo "$lt_cl_help"; exit 0 ;;
64675fd0b74Schristos    --debug | --d* | -d )
64775fd0b74Schristos      debug=: ;;
64875fd0b74Schristos    --quiet | --q* | --silent | --s* | -q )
64975fd0b74Schristos      lt_cl_silent=: ;;
65075fd0b74Schristos
65175fd0b74Schristos    -*) AC_MSG_ERROR([unrecognized option: $[1]
65275fd0b74SchristosTry \`$[0] --help' for more information.]) ;;
65375fd0b74Schristos
65475fd0b74Schristos    *) AC_MSG_ERROR([unrecognized argument: $[1]
65575fd0b74SchristosTry \`$[0] --help' for more information.]) ;;
65675fd0b74Schristos  esac
65775fd0b74Schristos  shift
65875fd0b74Schristosdone
65975fd0b74Schristos
66075fd0b74Schristosif $lt_cl_silent; then
66175fd0b74Schristos  exec AS_MESSAGE_FD>/dev/null
66275fd0b74Schristosfi
66375fd0b74Schristos_LTEOF
66475fd0b74Schristos
66575fd0b74Schristoscat >>"$CONFIG_LT" <<_LTEOF
66675fd0b74Schristos_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
66775fd0b74Schristos_LTEOF
66875fd0b74Schristos
66975fd0b74Schristoscat >>"$CONFIG_LT" <<\_LTEOF
67075fd0b74SchristosAC_MSG_NOTICE([creating $ofile])
67175fd0b74Schristos_LT_OUTPUT_LIBTOOL_COMMANDS
67275fd0b74SchristosAS_EXIT(0)
67375fd0b74Schristos_LTEOF
67475fd0b74Schristoschmod +x "$CONFIG_LT"
67575fd0b74Schristos
67675fd0b74Schristos# configure is writing to config.log, but config.lt does its own redirection,
67775fd0b74Schristos# appending to config.log, which fails on DOS, as config.log is still kept
67875fd0b74Schristos# open by configure.  Here we exec the FD to /dev/null, effectively closing
67975fd0b74Schristos# config.log, so it can be properly (re)opened and appended to by config.lt.
68075fd0b74Schristoslt_cl_success=:
68175fd0b74Schristostest "$silent" = yes &&
68275fd0b74Schristos  lt_config_lt_args="$lt_config_lt_args --quiet"
68375fd0b74Schristosexec AS_MESSAGE_LOG_FD>/dev/null
68475fd0b74Schristos$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
68575fd0b74Schristosexec AS_MESSAGE_LOG_FD>>config.log
68675fd0b74Schristos$lt_cl_success || AS_EXIT(1)
68775fd0b74Schristos])# LT_OUTPUT
68875fd0b74Schristos
68975fd0b74Schristos
69075fd0b74Schristos# _LT_CONFIG(TAG)
69175fd0b74Schristos# ---------------
69275fd0b74Schristos# If TAG is the built-in tag, create an initial libtool script with a
69375fd0b74Schristos# default configuration from the untagged config vars.  Otherwise add code
69475fd0b74Schristos# to config.status for appending the configuration named by TAG from the
69575fd0b74Schristos# matching tagged config vars.
69675fd0b74Schristosm4_defun([_LT_CONFIG],
69775fd0b74Schristos[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
69875fd0b74Schristos_LT_CONFIG_SAVE_COMMANDS([
69975fd0b74Schristos  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
70075fd0b74Schristos  m4_if(_LT_TAG, [C], [
70175fd0b74Schristos    # See if we are running on zsh, and set the options which allow our
70275fd0b74Schristos    # commands through without removal of \ escapes.
70375fd0b74Schristos    if test -n "${ZSH_VERSION+set}" ; then
70475fd0b74Schristos      setopt NO_GLOB_SUBST
70575fd0b74Schristos    fi
70675fd0b74Schristos
70775fd0b74Schristos    cfgfile="${ofile}T"
70875fd0b74Schristos    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
70975fd0b74Schristos    $RM "$cfgfile"
71075fd0b74Schristos
71175fd0b74Schristos    cat <<_LT_EOF >> "$cfgfile"
71275fd0b74Schristos#! $SHELL
71375fd0b74Schristos
71475fd0b74Schristos# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
71575fd0b74Schristos# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
71675fd0b74Schristos# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
71775fd0b74Schristos# NOTE: Changes made to this file will be lost: look at ltmain.sh.
71875fd0b74Schristos#
71975fd0b74Schristos_LT_COPYING
72075fd0b74Schristos_LT_LIBTOOL_TAGS
72175fd0b74Schristos
72275fd0b74Schristos# ### BEGIN LIBTOOL CONFIG
72375fd0b74Schristos_LT_LIBTOOL_CONFIG_VARS
72475fd0b74Schristos_LT_LIBTOOL_TAG_VARS
72575fd0b74Schristos# ### END LIBTOOL CONFIG
72675fd0b74Schristos
72775fd0b74Schristos_LT_EOF
72875fd0b74Schristos
72975fd0b74Schristos  case $host_os in
73075fd0b74Schristos  aix3*)
73175fd0b74Schristos    cat <<\_LT_EOF >> "$cfgfile"
73275fd0b74Schristos# AIX sometimes has problems with the GCC collect2 program.  For some
73375fd0b74Schristos# reason, if we set the COLLECT_NAMES environment variable, the problems
73475fd0b74Schristos# vanish in a puff of smoke.
73575fd0b74Schristosif test "X${COLLECT_NAMES+set}" != Xset; then
73675fd0b74Schristos  COLLECT_NAMES=
73775fd0b74Schristos  export COLLECT_NAMES
73875fd0b74Schristosfi
73975fd0b74Schristos_LT_EOF
74075fd0b74Schristos    ;;
74175fd0b74Schristos  esac
74275fd0b74Schristos
74375fd0b74Schristos  _LT_PROG_LTMAIN
74475fd0b74Schristos
74575fd0b74Schristos  # We use sed instead of cat because bash on DJGPP gets confused if
74675fd0b74Schristos  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
74775fd0b74Schristos  # text mode, it properly converts lines to CR/LF.  This bash problem
74875fd0b74Schristos  # is reportedly fixed, but why not run on old versions too?
74975fd0b74Schristos  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
75075fd0b74Schristos    || (rm -f "$cfgfile"; exit 1)
75175fd0b74Schristos
75275fd0b74Schristos  _LT_PROG_XSI_SHELLFNS
75375fd0b74Schristos
75475fd0b74Schristos  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
75575fd0b74Schristos    || (rm -f "$cfgfile"; exit 1)
75675fd0b74Schristos
75775fd0b74Schristos  mv -f "$cfgfile" "$ofile" ||
75875fd0b74Schristos    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
75975fd0b74Schristos  chmod +x "$ofile"
76075fd0b74Schristos],
76175fd0b74Schristos[cat <<_LT_EOF >> "$ofile"
76275fd0b74Schristos
76375fd0b74Schristosdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
76475fd0b74Schristosdnl in a comment (ie after a #).
76575fd0b74Schristos# ### BEGIN LIBTOOL TAG CONFIG: $1
76675fd0b74Schristos_LT_LIBTOOL_TAG_VARS(_LT_TAG)
76775fd0b74Schristos# ### END LIBTOOL TAG CONFIG: $1
76875fd0b74Schristos_LT_EOF
76975fd0b74Schristos])dnl /m4_if
77075fd0b74Schristos],
77175fd0b74Schristos[m4_if([$1], [], [
77275fd0b74Schristos    PACKAGE='$PACKAGE'
77375fd0b74Schristos    VERSION='$VERSION'
77475fd0b74Schristos    TIMESTAMP='$TIMESTAMP'
77575fd0b74Schristos    RM='$RM'
77675fd0b74Schristos    ofile='$ofile'], [])
77775fd0b74Schristos])dnl /_LT_CONFIG_SAVE_COMMANDS
77875fd0b74Schristos])# _LT_CONFIG
77975fd0b74Schristos
78075fd0b74Schristos
78175fd0b74Schristos# LT_SUPPORTED_TAG(TAG)
78275fd0b74Schristos# ---------------------
78375fd0b74Schristos# Trace this macro to discover what tags are supported by the libtool
78475fd0b74Schristos# --tag option, using:
78575fd0b74Schristos#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
78675fd0b74SchristosAC_DEFUN([LT_SUPPORTED_TAG], [])
78775fd0b74Schristos
78875fd0b74Schristos
78975fd0b74Schristos# C support is built-in for now
79075fd0b74Schristosm4_define([_LT_LANG_C_enabled], [])
79175fd0b74Schristosm4_define([_LT_TAGS], [])
79275fd0b74Schristos
79375fd0b74Schristos
79475fd0b74Schristos# LT_LANG(LANG)
79575fd0b74Schristos# -------------
79675fd0b74Schristos# Enable libtool support for the given language if not already enabled.
79775fd0b74SchristosAC_DEFUN([LT_LANG],
79875fd0b74Schristos[AC_BEFORE([$0], [LT_OUTPUT])dnl
79975fd0b74Schristosm4_case([$1],
80075fd0b74Schristos  [C],			[_LT_LANG(C)],
80175fd0b74Schristos  [C++],		[_LT_LANG(CXX)],
80275fd0b74Schristos  [Java],		[_LT_LANG(GCJ)],
80375fd0b74Schristos  [Fortran 77],		[_LT_LANG(F77)],
80475fd0b74Schristos  [Fortran],		[_LT_LANG(FC)],
80575fd0b74Schristos  [Windows Resource],	[_LT_LANG(RC)],
80675fd0b74Schristos  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
80775fd0b74Schristos    [_LT_LANG($1)],
80875fd0b74Schristos    [m4_fatal([$0: unsupported language: "$1"])])])dnl
80975fd0b74Schristos])# LT_LANG
81075fd0b74Schristos
81175fd0b74Schristos
81275fd0b74Schristos# _LT_LANG(LANGNAME)
81375fd0b74Schristos# ------------------
81475fd0b74Schristosm4_defun([_LT_LANG],
81575fd0b74Schristos[m4_ifdef([_LT_LANG_]$1[_enabled], [],
81675fd0b74Schristos  [LT_SUPPORTED_TAG([$1])dnl
81775fd0b74Schristos  m4_append([_LT_TAGS], [$1 ])dnl
81875fd0b74Schristos  m4_define([_LT_LANG_]$1[_enabled], [])dnl
81975fd0b74Schristos  _LT_LANG_$1_CONFIG($1)])dnl
82075fd0b74Schristos])# _LT_LANG
82175fd0b74Schristos
82275fd0b74Schristos
82375fd0b74Schristos# _LT_LANG_DEFAULT_CONFIG
82475fd0b74Schristos# -----------------------
82575fd0b74Schristosm4_defun([_LT_LANG_DEFAULT_CONFIG],
82675fd0b74Schristos[AC_PROVIDE_IFELSE([AC_PROG_CXX],
82775fd0b74Schristos  [LT_LANG(CXX)],
82875fd0b74Schristos  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
82975fd0b74Schristos
83075fd0b74SchristosAC_PROVIDE_IFELSE([AC_PROG_F77],
83175fd0b74Schristos  [LT_LANG(F77)],
83275fd0b74Schristos  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
83375fd0b74Schristos
83475fd0b74SchristosAC_PROVIDE_IFELSE([AC_PROG_FC],
83575fd0b74Schristos  [LT_LANG(FC)],
83675fd0b74Schristos  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
83775fd0b74Schristos
83875fd0b74Schristosdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
83975fd0b74Schristosdnl pulling things in needlessly.
84075fd0b74SchristosAC_PROVIDE_IFELSE([AC_PROG_GCJ],
84175fd0b74Schristos  [LT_LANG(GCJ)],
84275fd0b74Schristos  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
84375fd0b74Schristos    [LT_LANG(GCJ)],
84475fd0b74Schristos    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
84575fd0b74Schristos      [LT_LANG(GCJ)],
84675fd0b74Schristos      [m4_ifdef([AC_PROG_GCJ],
84775fd0b74Schristos	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
84875fd0b74Schristos       m4_ifdef([A][M_PROG_GCJ],
84975fd0b74Schristos	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
85075fd0b74Schristos       m4_ifdef([LT_PROG_GCJ],
85175fd0b74Schristos	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
85275fd0b74Schristos
85375fd0b74SchristosAC_PROVIDE_IFELSE([LT_PROG_RC],
85475fd0b74Schristos  [LT_LANG(RC)],
85575fd0b74Schristos  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
85675fd0b74Schristos])# _LT_LANG_DEFAULT_CONFIG
85775fd0b74Schristos
85875fd0b74Schristos# Obsolete macros:
85975fd0b74SchristosAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
86075fd0b74SchristosAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
86175fd0b74SchristosAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
86275fd0b74SchristosAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
86375fd0b74SchristosAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
86475fd0b74Schristosdnl aclocal-1.4 backwards compatibility:
86575fd0b74Schristosdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
86675fd0b74Schristosdnl AC_DEFUN([AC_LIBTOOL_F77], [])
86775fd0b74Schristosdnl AC_DEFUN([AC_LIBTOOL_FC], [])
86875fd0b74Schristosdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
86975fd0b74Schristosdnl AC_DEFUN([AC_LIBTOOL_RC], [])
87075fd0b74Schristos
87175fd0b74Schristos
87275fd0b74Schristos# _LT_TAG_COMPILER
87375fd0b74Schristos# ----------------
87475fd0b74Schristosm4_defun([_LT_TAG_COMPILER],
87575fd0b74Schristos[AC_REQUIRE([AC_PROG_CC])dnl
87675fd0b74Schristos
87775fd0b74Schristos_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
87875fd0b74Schristos_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
87975fd0b74Schristos_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
88075fd0b74Schristos_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
88175fd0b74Schristos
88275fd0b74Schristos# If no C compiler was specified, use CC.
88375fd0b74SchristosLTCC=${LTCC-"$CC"}
88475fd0b74Schristos
88575fd0b74Schristos# If no C compiler flags were specified, use CFLAGS.
88675fd0b74SchristosLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
88775fd0b74Schristos
88875fd0b74Schristos# Allow CC to be a program name with arguments.
88975fd0b74Schristoscompiler=$CC
89075fd0b74Schristos])# _LT_TAG_COMPILER
89175fd0b74Schristos
89275fd0b74Schristos
89375fd0b74Schristos# _LT_COMPILER_BOILERPLATE
89475fd0b74Schristos# ------------------------
89575fd0b74Schristos# Check for compiler boilerplate output or warnings with
89675fd0b74Schristos# the simple compiler test code.
89775fd0b74Schristosm4_defun([_LT_COMPILER_BOILERPLATE],
89875fd0b74Schristos[m4_require([_LT_DECL_SED])dnl
89975fd0b74Schristosac_outfile=conftest.$ac_objext
90075fd0b74Schristosecho "$lt_simple_compile_test_code" >conftest.$ac_ext
90175fd0b74Schristoseval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
90275fd0b74Schristos_lt_compiler_boilerplate=`cat conftest.err`
90375fd0b74Schristos$RM conftest*
90475fd0b74Schristos])# _LT_COMPILER_BOILERPLATE
90575fd0b74Schristos
90675fd0b74Schristos
90775fd0b74Schristos# _LT_LINKER_BOILERPLATE
90875fd0b74Schristos# ----------------------
90975fd0b74Schristos# Check for linker boilerplate output or warnings with
91075fd0b74Schristos# the simple link test code.
91175fd0b74Schristosm4_defun([_LT_LINKER_BOILERPLATE],
91275fd0b74Schristos[m4_require([_LT_DECL_SED])dnl
91375fd0b74Schristosac_outfile=conftest.$ac_objext
91475fd0b74Schristosecho "$lt_simple_link_test_code" >conftest.$ac_ext
91575fd0b74Schristoseval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
91675fd0b74Schristos_lt_linker_boilerplate=`cat conftest.err`
91775fd0b74Schristos$RM -r conftest*
91875fd0b74Schristos])# _LT_LINKER_BOILERPLATE
91975fd0b74Schristos
92075fd0b74Schristos# _LT_REQUIRED_DARWIN_CHECKS
92175fd0b74Schristos# -------------------------
92275fd0b74Schristosm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
92375fd0b74Schristos  case $host_os in
92475fd0b74Schristos    rhapsody* | darwin*)
92575fd0b74Schristos    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
92675fd0b74Schristos    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
92775fd0b74Schristos    AC_CHECK_TOOL([LIPO], [lipo], [:])
92875fd0b74Schristos    AC_CHECK_TOOL([OTOOL], [otool], [:])
92975fd0b74Schristos    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
93075fd0b74Schristos    _LT_DECL([], [DSYMUTIL], [1],
93175fd0b74Schristos      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
93275fd0b74Schristos    _LT_DECL([], [NMEDIT], [1],
93375fd0b74Schristos      [Tool to change global to local symbols on Mac OS X])
93475fd0b74Schristos    _LT_DECL([], [LIPO], [1],
93575fd0b74Schristos      [Tool to manipulate fat objects and archives on Mac OS X])
93675fd0b74Schristos    _LT_DECL([], [OTOOL], [1],
93775fd0b74Schristos      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
93875fd0b74Schristos    _LT_DECL([], [OTOOL64], [1],
93975fd0b74Schristos      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
94075fd0b74Schristos
94175fd0b74Schristos    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
94275fd0b74Schristos      [lt_cv_apple_cc_single_mod=no
94375fd0b74Schristos      if test -z "${LT_MULTI_MODULE}"; then
94475fd0b74Schristos	# By default we will add the -single_module flag. You can override
94575fd0b74Schristos	# by either setting the environment variable LT_MULTI_MODULE
94675fd0b74Schristos	# non-empty at configure time, or by adding -multi_module to the
94775fd0b74Schristos	# link flags.
94875fd0b74Schristos	rm -rf libconftest.dylib*
94975fd0b74Schristos	echo "int foo(void){return 1;}" > conftest.c
95075fd0b74Schristos	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
95175fd0b74Schristos-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
95275fd0b74Schristos	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
95375fd0b74Schristos	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
95475fd0b74Schristos        _lt_result=$?
95575fd0b74Schristos	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
95675fd0b74Schristos	  lt_cv_apple_cc_single_mod=yes
95775fd0b74Schristos	else
95875fd0b74Schristos	  cat conftest.err >&AS_MESSAGE_LOG_FD
95975fd0b74Schristos	fi
96075fd0b74Schristos	rm -rf libconftest.dylib*
96175fd0b74Schristos	rm -f conftest.*
96275fd0b74Schristos      fi])
96375fd0b74Schristos    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
96475fd0b74Schristos      [lt_cv_ld_exported_symbols_list],
96575fd0b74Schristos      [lt_cv_ld_exported_symbols_list=no
96675fd0b74Schristos      save_LDFLAGS=$LDFLAGS
96775fd0b74Schristos      echo "_main" > conftest.sym
96875fd0b74Schristos      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
96975fd0b74Schristos      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
97075fd0b74Schristos	[lt_cv_ld_exported_symbols_list=yes],
97175fd0b74Schristos	[lt_cv_ld_exported_symbols_list=no])
97275fd0b74Schristos	LDFLAGS="$save_LDFLAGS"
97375fd0b74Schristos    ])
97475fd0b74Schristos    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
97575fd0b74Schristos      [lt_cv_ld_force_load=no
97675fd0b74Schristos      cat > conftest.c << _LT_EOF
97775fd0b74Schristosint forced_loaded() { return 2;}
97875fd0b74Schristos_LT_EOF
97975fd0b74Schristos      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
98075fd0b74Schristos      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
98175fd0b74Schristos      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
98275fd0b74Schristos      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
98375fd0b74Schristos      cat > conftest.c << _LT_EOF
98475fd0b74Schristosint main() { return 0;}
98575fd0b74Schristos_LT_EOF
98675fd0b74Schristos      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
98775fd0b74Schristos      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
98875fd0b74Schristos      _lt_result=$?
98975fd0b74Schristos      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
99075fd0b74Schristos	lt_cv_ld_force_load=yes
99175fd0b74Schristos      else
99275fd0b74Schristos	cat conftest.err >&AS_MESSAGE_LOG_FD
99375fd0b74Schristos      fi
99475fd0b74Schristos        rm -f conftest.err libconftest.a conftest conftest.c
99575fd0b74Schristos        rm -rf conftest.dSYM
99675fd0b74Schristos    ])
99775fd0b74Schristos    case $host_os in
99875fd0b74Schristos    rhapsody* | darwin1.[[012]])
99975fd0b74Schristos      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
100075fd0b74Schristos    darwin1.*)
100175fd0b74Schristos      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
100275fd0b74Schristos    darwin*) # darwin 5.x on
100375fd0b74Schristos      # if running on 10.5 or later, the deployment target defaults
100475fd0b74Schristos      # to the OS version, if on x86, and 10.4, the deployment
100575fd0b74Schristos      # target defaults to 10.4. Don't you love it?
100675fd0b74Schristos      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
100775fd0b74Schristos	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
100875fd0b74Schristos	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
100975fd0b74Schristos	10.[[012]][[,.]]*)
101075fd0b74Schristos	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
101175fd0b74Schristos	10.*)
101275fd0b74Schristos	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
101375fd0b74Schristos      esac
101475fd0b74Schristos    ;;
101575fd0b74Schristos  esac
101675fd0b74Schristos    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
101775fd0b74Schristos      _lt_dar_single_mod='$single_module'
101875fd0b74Schristos    fi
101975fd0b74Schristos    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
102075fd0b74Schristos      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
102175fd0b74Schristos    else
102275fd0b74Schristos      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
102375fd0b74Schristos    fi
102475fd0b74Schristos    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
102575fd0b74Schristos      _lt_dsymutil='~$DSYMUTIL $lib || :'
102675fd0b74Schristos    else
102775fd0b74Schristos      _lt_dsymutil=
102875fd0b74Schristos    fi
102975fd0b74Schristos    ;;
103075fd0b74Schristos  esac
103175fd0b74Schristos])
103275fd0b74Schristos
103375fd0b74Schristos
103475fd0b74Schristos# _LT_DARWIN_LINKER_FEATURES
103575fd0b74Schristos# --------------------------
103675fd0b74Schristos# Checks for linker and compiler features on darwin
103775fd0b74Schristosm4_defun([_LT_DARWIN_LINKER_FEATURES],
103875fd0b74Schristos[
103975fd0b74Schristos  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
104075fd0b74Schristos  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
104175fd0b74Schristos  _LT_TAGVAR(hardcode_direct, $1)=no
104275fd0b74Schristos  _LT_TAGVAR(hardcode_automatic, $1)=yes
104375fd0b74Schristos  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
104475fd0b74Schristos  if test "$lt_cv_ld_force_load" = "yes"; then
104575fd0b74Schristos    _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\"`'
104675fd0b74Schristos  else
104775fd0b74Schristos    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
104875fd0b74Schristos  fi
104975fd0b74Schristos  _LT_TAGVAR(link_all_deplibs, $1)=yes
105075fd0b74Schristos  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
105175fd0b74Schristos  case $cc_basename in
105275fd0b74Schristos     ifort*) _lt_dar_can_shared=yes ;;
105375fd0b74Schristos     *) _lt_dar_can_shared=$GCC ;;
105475fd0b74Schristos  esac
105575fd0b74Schristos  if test "$_lt_dar_can_shared" = "yes"; then
105675fd0b74Schristos    output_verbose_link_cmd=func_echo_all
105775fd0b74Schristos    _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}"
105875fd0b74Schristos    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
105975fd0b74Schristos    _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}"
106075fd0b74Schristos    _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}"
106175fd0b74Schristos    m4_if([$1], [CXX],
106275fd0b74Schristos[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
106375fd0b74Schristos      _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}"
106475fd0b74Schristos      _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}"
106575fd0b74Schristos    fi
106675fd0b74Schristos],[])
106775fd0b74Schristos  else
106875fd0b74Schristos  _LT_TAGVAR(ld_shlibs, $1)=no
106975fd0b74Schristos  fi
107075fd0b74Schristos])
107175fd0b74Schristos
107275fd0b74Schristos# _LT_SYS_MODULE_PATH_AIX
107375fd0b74Schristos# -----------------------
107475fd0b74Schristos# Links a minimal program and checks the executable
107575fd0b74Schristos# for the system default hardcoded library path. In most cases,
107675fd0b74Schristos# this is /usr/lib:/lib, but when the MPI compilers are used
107775fd0b74Schristos# the location of the communication and MPI libs are included too.
107875fd0b74Schristos# If we don't find anything, use the default library path according
107975fd0b74Schristos# to the aix ld manual.
108075fd0b74Schristosm4_defun([_LT_SYS_MODULE_PATH_AIX],
108175fd0b74Schristos[m4_require([_LT_DECL_SED])dnl
1082ede78133SchristosAC_LINK_IFELSE([AC_LANG_SOURCE([AC_LANG_PROGRAM])],[
108375fd0b74Schristoslt_aix_libpath_sed='
108475fd0b74Schristos    /Import File Strings/,/^$/ {
108575fd0b74Schristos	/^0/ {
108675fd0b74Schristos	    s/^0  *\(.*\)$/\1/
108775fd0b74Schristos	    p
108875fd0b74Schristos	}
108975fd0b74Schristos    }'
109075fd0b74Schristosaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
109175fd0b74Schristos# Check for a 64-bit object if we didn't find anything.
109275fd0b74Schristosif test -z "$aix_libpath"; then
109375fd0b74Schristos  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
109475fd0b74Schristosfi],[])
109575fd0b74Schristosif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
109675fd0b74Schristos])# _LT_SYS_MODULE_PATH_AIX
109775fd0b74Schristos
109875fd0b74Schristos
109975fd0b74Schristos# _LT_SHELL_INIT(ARG)
110075fd0b74Schristos# -------------------
110175fd0b74Schristosm4_define([_LT_SHELL_INIT],
110275fd0b74Schristos[m4_divert_text([M4SH-INIT], [$1
110375fd0b74Schristos])])# _LT_SHELL_INIT
110475fd0b74Schristos
110575fd0b74Schristos
110675fd0b74Schristos
110775fd0b74Schristos# _LT_PROG_ECHO_BACKSLASH
110875fd0b74Schristos# -----------------------
110975fd0b74Schristos# Find how we can fake an echo command that does not interpret backslash.
111075fd0b74Schristos# In particular, with Autoconf 2.60 or later we add some code to the start
111175fd0b74Schristos# of the generated configure script which will find a shell with a builtin
111275fd0b74Schristos# printf (which we can use as an echo command).
111375fd0b74Schristosm4_defun([_LT_PROG_ECHO_BACKSLASH],
111475fd0b74Schristos[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
111575fd0b74SchristosECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
111675fd0b74SchristosECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
111775fd0b74Schristos
111875fd0b74SchristosAC_MSG_CHECKING([how to print strings])
111975fd0b74Schristos# Test print first, because it will be a builtin if present.
112075fd0b74Schristosif test "X`print -r -- -n 2>/dev/null`" = X-n && \
112175fd0b74Schristos   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
112275fd0b74Schristos  ECHO='print -r --'
112375fd0b74Schristoselif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
112475fd0b74Schristos  ECHO='printf %s\n'
112575fd0b74Schristoselse
112675fd0b74Schristos  # Use this function as a fallback that always works.
112775fd0b74Schristos  func_fallback_echo ()
112875fd0b74Schristos  {
112975fd0b74Schristos    eval 'cat <<_LTECHO_EOF
113075fd0b74Schristos$[]1
113175fd0b74Schristos_LTECHO_EOF'
113275fd0b74Schristos  }
113375fd0b74Schristos  ECHO='func_fallback_echo'
113475fd0b74Schristosfi
113575fd0b74Schristos
113675fd0b74Schristos# func_echo_all arg...
113775fd0b74Schristos# Invoke $ECHO with all args, space-separated.
113875fd0b74Schristosfunc_echo_all ()
113975fd0b74Schristos{
114075fd0b74Schristos    $ECHO "$*"
114175fd0b74Schristos}
114275fd0b74Schristos
114375fd0b74Schristoscase "$ECHO" in
114475fd0b74Schristos  printf*) AC_MSG_RESULT([printf]) ;;
114575fd0b74Schristos  print*) AC_MSG_RESULT([print -r]) ;;
114675fd0b74Schristos  *) AC_MSG_RESULT([cat]) ;;
114775fd0b74Schristosesac
114875fd0b74Schristos
114975fd0b74Schristosm4_ifdef([_AS_DETECT_SUGGESTED],
115075fd0b74Schristos[_AS_DETECT_SUGGESTED([
115175fd0b74Schristos  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
115275fd0b74Schristos    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
115375fd0b74Schristos    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
115475fd0b74Schristos    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
115575fd0b74Schristos    PATH=/empty FPATH=/empty; export PATH FPATH
115675fd0b74Schristos    test "X`printf %s $ECHO`" = "X$ECHO" \
115775fd0b74Schristos      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
115875fd0b74Schristos
115975fd0b74Schristos_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
116075fd0b74Schristos_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
116175fd0b74Schristos])# _LT_PROG_ECHO_BACKSLASH
116275fd0b74Schristos
116375fd0b74Schristos
116475fd0b74Schristos# _LT_ENABLE_LOCK
116575fd0b74Schristos# ---------------
116675fd0b74Schristosm4_defun([_LT_ENABLE_LOCK],
116775fd0b74Schristos[AC_ARG_ENABLE([libtool-lock],
116875fd0b74Schristos  [AS_HELP_STRING([--disable-libtool-lock],
116975fd0b74Schristos    [avoid locking (might break parallel builds)])])
117075fd0b74Schristostest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
117175fd0b74Schristos
117275fd0b74Schristos# Some flags need to be propagated to the compiler or linker for good
117375fd0b74Schristos# libtool support.
117475fd0b74Schristoscase $host in
117575fd0b74Schristosia64-*-hpux*)
117675fd0b74Schristos  # Find out which ABI we are using.
117775fd0b74Schristos  echo 'int i;' > conftest.$ac_ext
117875fd0b74Schristos  if AC_TRY_EVAL(ac_compile); then
117975fd0b74Schristos    case `/usr/bin/file conftest.$ac_objext` in
118075fd0b74Schristos      *ELF-32*)
118175fd0b74Schristos	HPUX_IA64_MODE="32"
118275fd0b74Schristos	;;
118375fd0b74Schristos      *ELF-64*)
118475fd0b74Schristos	HPUX_IA64_MODE="64"
118575fd0b74Schristos	;;
118675fd0b74Schristos    esac
118775fd0b74Schristos  fi
118875fd0b74Schristos  rm -rf conftest*
118975fd0b74Schristos  ;;
119075fd0b74Schristos*-*-irix6*)
119175fd0b74Schristos  # Find out which ABI we are using.
119275fd0b74Schristos  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
119375fd0b74Schristos  if AC_TRY_EVAL(ac_compile); then
119475fd0b74Schristos    if test "$lt_cv_prog_gnu_ld" = yes; then
119575fd0b74Schristos      case `/usr/bin/file conftest.$ac_objext` in
119675fd0b74Schristos	*32-bit*)
119775fd0b74Schristos	  LD="${LD-ld} -melf32bsmip"
119875fd0b74Schristos	  ;;
119975fd0b74Schristos	*N32*)
120075fd0b74Schristos	  LD="${LD-ld} -melf32bmipn32"
120175fd0b74Schristos	  ;;
120275fd0b74Schristos	*64-bit*)
120375fd0b74Schristos	  LD="${LD-ld} -melf64bmip"
120475fd0b74Schristos	;;
120575fd0b74Schristos      esac
120675fd0b74Schristos    else
120775fd0b74Schristos      case `/usr/bin/file conftest.$ac_objext` in
120875fd0b74Schristos	*32-bit*)
120975fd0b74Schristos	  LD="${LD-ld} -32"
121075fd0b74Schristos	  ;;
121175fd0b74Schristos	*N32*)
121275fd0b74Schristos	  LD="${LD-ld} -n32"
121375fd0b74Schristos	  ;;
121475fd0b74Schristos	*64-bit*)
121575fd0b74Schristos	  LD="${LD-ld} -64"
121675fd0b74Schristos	  ;;
121775fd0b74Schristos      esac
121875fd0b74Schristos    fi
121975fd0b74Schristos  fi
122075fd0b74Schristos  rm -rf conftest*
122175fd0b74Schristos  ;;
122275fd0b74Schristos
122375fd0b74Schristosx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
122475fd0b74Schristoss390*-*linux*|s390*-*tpf*|sparc*-*linux*)
122575fd0b74Schristos  # Find out which ABI we are using.
122675fd0b74Schristos  echo 'int i;' > conftest.$ac_ext
122775fd0b74Schristos  if AC_TRY_EVAL(ac_compile); then
122875fd0b74Schristos    case `/usr/bin/file conftest.o` in
122975fd0b74Schristos      *32-bit*)
123075fd0b74Schristos	case $host in
123175fd0b74Schristos	  x86_64-*kfreebsd*-gnu)
123275fd0b74Schristos	    LD="${LD-ld} -m elf_i386_fbsd"
123375fd0b74Schristos	    ;;
123475fd0b74Schristos	  x86_64-*linux*)
123575fd0b74Schristos	    case `/usr/bin/file conftest.o` in
123675fd0b74Schristos	      *x86-64*)
123775fd0b74Schristos		LD="${LD-ld} -m elf32_x86_64"
123875fd0b74Schristos		;;
123975fd0b74Schristos	      *)
124075fd0b74Schristos		LD="${LD-ld} -m elf_i386"
124175fd0b74Schristos		;;
124275fd0b74Schristos	    esac
124375fd0b74Schristos	    ;;
124475fd0b74Schristos	  powerpc64le-*linux*)
124575fd0b74Schristos	    LD="${LD-ld} -m elf32lppclinux"
124675fd0b74Schristos	    ;;
124775fd0b74Schristos	  powerpc64-*linux*)
124875fd0b74Schristos	    LD="${LD-ld} -m elf32ppclinux"
124975fd0b74Schristos	    ;;
125075fd0b74Schristos	  s390x-*linux*)
125175fd0b74Schristos	    LD="${LD-ld} -m elf_s390"
125275fd0b74Schristos	    ;;
125375fd0b74Schristos	  sparc64-*linux*)
125475fd0b74Schristos	    LD="${LD-ld} -m elf32_sparc"
125575fd0b74Schristos	    ;;
125675fd0b74Schristos	esac
125775fd0b74Schristos	;;
125875fd0b74Schristos      *64-bit*)
125975fd0b74Schristos	case $host in
126075fd0b74Schristos	  x86_64-*kfreebsd*-gnu)
126175fd0b74Schristos	    LD="${LD-ld} -m elf_x86_64_fbsd"
126275fd0b74Schristos	    ;;
126375fd0b74Schristos	  x86_64-*linux*)
126475fd0b74Schristos	    LD="${LD-ld} -m elf_x86_64"
126575fd0b74Schristos	    ;;
126675fd0b74Schristos	  powerpcle-*linux*)
126775fd0b74Schristos	    LD="${LD-ld} -m elf64lppc"
126875fd0b74Schristos	    ;;
126975fd0b74Schristos	  powerpc-*linux*)
127075fd0b74Schristos	    LD="${LD-ld} -m elf64ppc"
127175fd0b74Schristos	    ;;
127275fd0b74Schristos	  s390*-*linux*|s390*-*tpf*)
127375fd0b74Schristos	    LD="${LD-ld} -m elf64_s390"
127475fd0b74Schristos	    ;;
127575fd0b74Schristos	  sparc*-*linux*)
127675fd0b74Schristos	    LD="${LD-ld} -m elf64_sparc"
127775fd0b74Schristos	    ;;
127875fd0b74Schristos	esac
127975fd0b74Schristos	;;
128075fd0b74Schristos    esac
128175fd0b74Schristos  fi
128275fd0b74Schristos  rm -rf conftest*
128375fd0b74Schristos  ;;
128475fd0b74Schristos
128575fd0b74Schristos*-*-sco3.2v5*)
128675fd0b74Schristos  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
128775fd0b74Schristos  SAVE_CFLAGS="$CFLAGS"
128875fd0b74Schristos  CFLAGS="$CFLAGS -belf"
128975fd0b74Schristos  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
129075fd0b74Schristos    [AC_LANG_PUSH(C)
129175fd0b74Schristos     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
129275fd0b74Schristos     AC_LANG_POP])
129375fd0b74Schristos  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
129475fd0b74Schristos    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
129575fd0b74Schristos    CFLAGS="$SAVE_CFLAGS"
129675fd0b74Schristos  fi
129775fd0b74Schristos  ;;
129875fd0b74Schristossparc*-*solaris*)
129975fd0b74Schristos  # Find out which ABI we are using.
130075fd0b74Schristos  echo 'int i;' > conftest.$ac_ext
130175fd0b74Schristos  if AC_TRY_EVAL(ac_compile); then
130275fd0b74Schristos    case `/usr/bin/file conftest.o` in
130375fd0b74Schristos    *64-bit*)
130475fd0b74Schristos      case $lt_cv_prog_gnu_ld in
130575fd0b74Schristos      yes*) LD="${LD-ld} -m elf64_sparc" ;;
130675fd0b74Schristos      *)
130775fd0b74Schristos	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
130875fd0b74Schristos	  LD="${LD-ld} -64"
130975fd0b74Schristos	fi
131075fd0b74Schristos	;;
131175fd0b74Schristos      esac
131275fd0b74Schristos      ;;
131375fd0b74Schristos    esac
131475fd0b74Schristos  fi
131575fd0b74Schristos  rm -rf conftest*
131675fd0b74Schristos  ;;
131775fd0b74Schristosesac
131875fd0b74Schristos
131975fd0b74Schristosneed_locks="$enable_libtool_lock"
132075fd0b74Schristos])# _LT_ENABLE_LOCK
132175fd0b74Schristos
132275fd0b74Schristos
132375fd0b74Schristos# _LT_CMD_OLD_ARCHIVE
132475fd0b74Schristos# -------------------
132575fd0b74Schristosm4_defun([_LT_CMD_OLD_ARCHIVE],
1326*e992f068Schristos[plugin_option=
1327*e992f068Schristosplugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
1328*e992f068Schristosfor plugin in $plugin_names; do
1329*e992f068Schristos  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
1330*e992f068Schristos  if test x$plugin_so = x$plugin; then
1331*e992f068Schristos    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
1332*e992f068Schristos  fi
1333*e992f068Schristos  if test x$plugin_so != x$plugin; then
1334*e992f068Schristos    plugin_option="--plugin $plugin_so"
1335*e992f068Schristos    break
1336*e992f068Schristos  fi
1337*e992f068Schristosdone
1338*e992f068Schristos
1339*e992f068SchristosAC_CHECK_TOOL(AR, ar, false)
134075fd0b74Schristostest -z "$AR" && AR=ar
1341*e992f068Schristosif test -n "$plugin_option"; then
1342*e992f068Schristos  if $AR --help 2>&1 | grep -q "\--plugin"; then
1343*e992f068Schristos    touch conftest.c
1344*e992f068Schristos    $AR $plugin_option rc conftest.a conftest.c
1345*e992f068Schristos    if test "$?" != 0; then
1346*e992f068Schristos      AC_MSG_WARN([Failed: $AR $plugin_option rc])
1347*e992f068Schristos    else
1348*e992f068Schristos      AR="$AR $plugin_option"
1349*e992f068Schristos    fi
1350*e992f068Schristos    rm -f conftest.*
1351*e992f068Schristos  fi
1352*e992f068Schristosfi
135375fd0b74Schristostest -z "$AR_FLAGS" && AR_FLAGS=cru
135475fd0b74Schristos_LT_DECL([], [AR], [1], [The archiver])
135575fd0b74Schristos_LT_DECL([], [AR_FLAGS], [1])
135675fd0b74Schristos
135775fd0b74SchristosAC_CHECK_TOOL(STRIP, strip, :)
135875fd0b74Schristostest -z "$STRIP" && STRIP=:
135975fd0b74Schristos_LT_DECL([], [STRIP], [1], [A symbol stripping program])
136075fd0b74Schristos
136175fd0b74SchristosAC_CHECK_TOOL(RANLIB, ranlib, :)
136275fd0b74Schristostest -z "$RANLIB" && RANLIB=:
1363*e992f068Schristosif test -n "$plugin_option" && test "$RANLIB" != ":"; then
1364*e992f068Schristos  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
1365*e992f068Schristos    RANLIB="$RANLIB $plugin_option"
1366*e992f068Schristos  fi
1367*e992f068Schristosfi
136875fd0b74Schristos_LT_DECL([], [RANLIB], [1],
136975fd0b74Schristos    [Commands used to install an old-style archive])
137075fd0b74Schristos
137175fd0b74Schristos# Determine commands to create old-style static archives.
137275fd0b74Schristosold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
137375fd0b74Schristosold_postinstall_cmds='chmod 644 $oldlib'
137475fd0b74Schristosold_postuninstall_cmds=
137575fd0b74Schristos
137675fd0b74Schristosif test -n "$RANLIB"; then
137775fd0b74Schristos  case $host_os in
137875fd0b74Schristos  openbsd*)
137975fd0b74Schristos    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
138075fd0b74Schristos    ;;
138175fd0b74Schristos  *)
138275fd0b74Schristos    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
138375fd0b74Schristos    ;;
138475fd0b74Schristos  esac
138575fd0b74Schristos  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
138675fd0b74Schristosfi
138775fd0b74Schristos
138875fd0b74Schristoscase $host_os in
138975fd0b74Schristos  darwin*)
139075fd0b74Schristos    lock_old_archive_extraction=yes ;;
139175fd0b74Schristos  *)
139275fd0b74Schristos    lock_old_archive_extraction=no ;;
139375fd0b74Schristosesac
139475fd0b74Schristos_LT_DECL([], [old_postinstall_cmds], [2])
139575fd0b74Schristos_LT_DECL([], [old_postuninstall_cmds], [2])
139675fd0b74Schristos_LT_TAGDECL([], [old_archive_cmds], [2],
139775fd0b74Schristos    [Commands used to build an old-style archive])
139875fd0b74Schristos_LT_DECL([], [lock_old_archive_extraction], [0],
139975fd0b74Schristos    [Whether to use a lock for old archive extraction])
140075fd0b74Schristos])# _LT_CMD_OLD_ARCHIVE
140175fd0b74Schristos
140275fd0b74Schristos
140375fd0b74Schristos# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
140475fd0b74Schristos#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
140575fd0b74Schristos# ----------------------------------------------------------------
140675fd0b74Schristos# Check whether the given compiler option works
140775fd0b74SchristosAC_DEFUN([_LT_COMPILER_OPTION],
140875fd0b74Schristos[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
140975fd0b74Schristosm4_require([_LT_DECL_SED])dnl
141075fd0b74SchristosAC_CACHE_CHECK([$1], [$2],
141175fd0b74Schristos  [$2=no
141275fd0b74Schristos   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
141375fd0b74Schristos   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
141475fd0b74Schristos   lt_compiler_flag="$3"
141575fd0b74Schristos   # Insert the option either (1) after the last *FLAGS variable, or
141675fd0b74Schristos   # (2) before a word containing "conftest.", or (3) at the end.
141775fd0b74Schristos   # Note that $ac_compile itself does not contain backslashes and begins
141875fd0b74Schristos   # with a dollar sign (not a hyphen), so the echo should work correctly.
141975fd0b74Schristos   # The option is referenced via a variable to avoid confusing sed.
142075fd0b74Schristos   lt_compile=`echo "$ac_compile" | $SED \
142175fd0b74Schristos   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
142275fd0b74Schristos   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
142375fd0b74Schristos   -e 's:$: $lt_compiler_flag:'`
142475fd0b74Schristos   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
142575fd0b74Schristos   (eval "$lt_compile" 2>conftest.err)
142675fd0b74Schristos   ac_status=$?
142775fd0b74Schristos   cat conftest.err >&AS_MESSAGE_LOG_FD
142875fd0b74Schristos   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
142975fd0b74Schristos   if (exit $ac_status) && test -s "$ac_outfile"; then
143075fd0b74Schristos     # The compiler can only warn and ignore the option if not recognized
143175fd0b74Schristos     # So say no if there are warnings other than the usual output.
143275fd0b74Schristos     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
143375fd0b74Schristos     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
143475fd0b74Schristos     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
143575fd0b74Schristos       $2=yes
143675fd0b74Schristos     fi
143775fd0b74Schristos   fi
143875fd0b74Schristos   $RM conftest*
143975fd0b74Schristos])
144075fd0b74Schristos
144175fd0b74Schristosif test x"[$]$2" = xyes; then
144275fd0b74Schristos    m4_if([$5], , :, [$5])
144375fd0b74Schristoselse
144475fd0b74Schristos    m4_if([$6], , :, [$6])
144575fd0b74Schristosfi
144675fd0b74Schristos])# _LT_COMPILER_OPTION
144775fd0b74Schristos
144875fd0b74Schristos# Old name:
144975fd0b74SchristosAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
145075fd0b74Schristosdnl aclocal-1.4 backwards compatibility:
145175fd0b74Schristosdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
145275fd0b74Schristos
145375fd0b74Schristos
145475fd0b74Schristos# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
145575fd0b74Schristos#                  [ACTION-SUCCESS], [ACTION-FAILURE])
145675fd0b74Schristos# ----------------------------------------------------
145775fd0b74Schristos# Check whether the given linker option works
145875fd0b74SchristosAC_DEFUN([_LT_LINKER_OPTION],
145975fd0b74Schristos[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
146075fd0b74Schristosm4_require([_LT_DECL_SED])dnl
146175fd0b74SchristosAC_CACHE_CHECK([$1], [$2],
146275fd0b74Schristos  [$2=no
146375fd0b74Schristos   save_LDFLAGS="$LDFLAGS"
146475fd0b74Schristos   LDFLAGS="$LDFLAGS $3"
146575fd0b74Schristos   echo "$lt_simple_link_test_code" > conftest.$ac_ext
146675fd0b74Schristos   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
146775fd0b74Schristos     # The linker can only warn and ignore the option if not recognized
146875fd0b74Schristos     # So say no if there are warnings
146975fd0b74Schristos     if test -s conftest.err; then
147075fd0b74Schristos       # Append any errors to the config.log.
147175fd0b74Schristos       cat conftest.err 1>&AS_MESSAGE_LOG_FD
147275fd0b74Schristos       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
147375fd0b74Schristos       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
147475fd0b74Schristos       if diff conftest.exp conftest.er2 >/dev/null; then
147575fd0b74Schristos         $2=yes
147675fd0b74Schristos       fi
147775fd0b74Schristos     else
147875fd0b74Schristos       $2=yes
147975fd0b74Schristos     fi
148075fd0b74Schristos   fi
148175fd0b74Schristos   $RM -r conftest*
148275fd0b74Schristos   LDFLAGS="$save_LDFLAGS"
148375fd0b74Schristos])
148475fd0b74Schristos
148575fd0b74Schristosif test x"[$]$2" = xyes; then
148675fd0b74Schristos    m4_if([$4], , :, [$4])
148775fd0b74Schristoselse
148875fd0b74Schristos    m4_if([$5], , :, [$5])
148975fd0b74Schristosfi
149075fd0b74Schristos])# _LT_LINKER_OPTION
149175fd0b74Schristos
149275fd0b74Schristos# Old name:
149375fd0b74SchristosAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
149475fd0b74Schristosdnl aclocal-1.4 backwards compatibility:
149575fd0b74Schristosdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
149675fd0b74Schristos
149775fd0b74Schristos
149875fd0b74Schristos# LT_CMD_MAX_LEN
149975fd0b74Schristos#---------------
150075fd0b74SchristosAC_DEFUN([LT_CMD_MAX_LEN],
150175fd0b74Schristos[AC_REQUIRE([AC_CANONICAL_HOST])dnl
150275fd0b74Schristos# find the maximum length of command line arguments
150375fd0b74SchristosAC_MSG_CHECKING([the maximum length of command line arguments])
150475fd0b74SchristosAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
150575fd0b74Schristos  i=0
150675fd0b74Schristos  teststring="ABCD"
150775fd0b74Schristos
150875fd0b74Schristos  case $build_os in
150975fd0b74Schristos  msdosdjgpp*)
151075fd0b74Schristos    # On DJGPP, this test can blow up pretty badly due to problems in libc
151175fd0b74Schristos    # (any single argument exceeding 2000 bytes causes a buffer overrun
151275fd0b74Schristos    # during glob expansion).  Even if it were fixed, the result of this
151375fd0b74Schristos    # check would be larger than it should be.
151475fd0b74Schristos    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
151575fd0b74Schristos    ;;
151675fd0b74Schristos
151775fd0b74Schristos  gnu*)
151875fd0b74Schristos    # Under GNU Hurd, this test is not required because there is
151975fd0b74Schristos    # no limit to the length of command line arguments.
152075fd0b74Schristos    # Libtool will interpret -1 as no limit whatsoever
152175fd0b74Schristos    lt_cv_sys_max_cmd_len=-1;
152275fd0b74Schristos    ;;
152375fd0b74Schristos
152475fd0b74Schristos  cygwin* | mingw* | cegcc*)
152575fd0b74Schristos    # On Win9x/ME, this test blows up -- it succeeds, but takes
152675fd0b74Schristos    # about 5 minutes as the teststring grows exponentially.
152775fd0b74Schristos    # Worse, since 9x/ME are not pre-emptively multitasking,
152875fd0b74Schristos    # you end up with a "frozen" computer, even though with patience
152975fd0b74Schristos    # the test eventually succeeds (with a max line length of 256k).
153075fd0b74Schristos    # Instead, let's just punt: use the minimum linelength reported by
153175fd0b74Schristos    # all of the supported platforms: 8192 (on NT/2K/XP).
153275fd0b74Schristos    lt_cv_sys_max_cmd_len=8192;
153375fd0b74Schristos    ;;
153475fd0b74Schristos
153575fd0b74Schristos  mint*)
153675fd0b74Schristos    # On MiNT this can take a long time and run out of memory.
153775fd0b74Schristos    lt_cv_sys_max_cmd_len=8192;
153875fd0b74Schristos    ;;
153975fd0b74Schristos
154075fd0b74Schristos  amigaos*)
154175fd0b74Schristos    # On AmigaOS with pdksh, this test takes hours, literally.
154275fd0b74Schristos    # So we just punt and use a minimum line length of 8192.
154375fd0b74Schristos    lt_cv_sys_max_cmd_len=8192;
154475fd0b74Schristos    ;;
154575fd0b74Schristos
154675fd0b74Schristos  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
154775fd0b74Schristos    # This has been around since 386BSD, at least.  Likely further.
154875fd0b74Schristos    if test -x /sbin/sysctl; then
154975fd0b74Schristos      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
155075fd0b74Schristos    elif test -x /usr/sbin/sysctl; then
155175fd0b74Schristos      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
155275fd0b74Schristos    else
155375fd0b74Schristos      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
155475fd0b74Schristos    fi
155575fd0b74Schristos    # And add a safety zone
155675fd0b74Schristos    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
155775fd0b74Schristos    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
155875fd0b74Schristos    ;;
155975fd0b74Schristos
156075fd0b74Schristos  interix*)
156175fd0b74Schristos    # We know the value 262144 and hardcode it with a safety zone (like BSD)
156275fd0b74Schristos    lt_cv_sys_max_cmd_len=196608
156375fd0b74Schristos    ;;
156475fd0b74Schristos
156575fd0b74Schristos  osf*)
156675fd0b74Schristos    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
156775fd0b74Schristos    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
156875fd0b74Schristos    # nice to cause kernel panics so lets avoid the loop below.
156975fd0b74Schristos    # First set a reasonable default.
157075fd0b74Schristos    lt_cv_sys_max_cmd_len=16384
157175fd0b74Schristos    #
157275fd0b74Schristos    if test -x /sbin/sysconfig; then
157375fd0b74Schristos      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
157475fd0b74Schristos        *1*) lt_cv_sys_max_cmd_len=-1 ;;
157575fd0b74Schristos      esac
157675fd0b74Schristos    fi
157775fd0b74Schristos    ;;
157875fd0b74Schristos  sco3.2v5*)
157975fd0b74Schristos    lt_cv_sys_max_cmd_len=102400
158075fd0b74Schristos    ;;
158175fd0b74Schristos  sysv5* | sco5v6* | sysv4.2uw2*)
158275fd0b74Schristos    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
158375fd0b74Schristos    if test -n "$kargmax"; then
158475fd0b74Schristos      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
158575fd0b74Schristos    else
158675fd0b74Schristos      lt_cv_sys_max_cmd_len=32768
158775fd0b74Schristos    fi
158875fd0b74Schristos    ;;
158975fd0b74Schristos  *)
159075fd0b74Schristos    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
159175fd0b74Schristos    if test -n "$lt_cv_sys_max_cmd_len"; then
159275fd0b74Schristos      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
159375fd0b74Schristos      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
159475fd0b74Schristos    else
159575fd0b74Schristos      # Make teststring a little bigger before we do anything with it.
159675fd0b74Schristos      # a 1K string should be a reasonable start.
159775fd0b74Schristos      for i in 1 2 3 4 5 6 7 8 ; do
159875fd0b74Schristos        teststring=$teststring$teststring
159975fd0b74Schristos      done
160075fd0b74Schristos      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
160175fd0b74Schristos      # If test is not a shell built-in, we'll probably end up computing a
160275fd0b74Schristos      # maximum length that is only half of the actual maximum length, but
160375fd0b74Schristos      # we can't tell.
160475fd0b74Schristos      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
160575fd0b74Schristos	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
160675fd0b74Schristos	      test $i != 17 # 1/2 MB should be enough
160775fd0b74Schristos      do
160875fd0b74Schristos        i=`expr $i + 1`
160975fd0b74Schristos        teststring=$teststring$teststring
161075fd0b74Schristos      done
161175fd0b74Schristos      # Only check the string length outside the loop.
161275fd0b74Schristos      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
161375fd0b74Schristos      teststring=
161475fd0b74Schristos      # Add a significant safety factor because C++ compilers can tack on
161575fd0b74Schristos      # massive amounts of additional arguments before passing them to the
161675fd0b74Schristos      # linker.  It appears as though 1/2 is a usable value.
161775fd0b74Schristos      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
161875fd0b74Schristos    fi
161975fd0b74Schristos    ;;
162075fd0b74Schristos  esac
162175fd0b74Schristos])
162275fd0b74Schristosif test -n $lt_cv_sys_max_cmd_len ; then
162375fd0b74Schristos  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
162475fd0b74Schristoselse
162575fd0b74Schristos  AC_MSG_RESULT(none)
162675fd0b74Schristosfi
162775fd0b74Schristosmax_cmd_len=$lt_cv_sys_max_cmd_len
162875fd0b74Schristos_LT_DECL([], [max_cmd_len], [0],
162975fd0b74Schristos    [What is the maximum length of a command?])
163075fd0b74Schristos])# LT_CMD_MAX_LEN
163175fd0b74Schristos
163275fd0b74Schristos# Old name:
163375fd0b74SchristosAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
163475fd0b74Schristosdnl aclocal-1.4 backwards compatibility:
163575fd0b74Schristosdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
163675fd0b74Schristos
163775fd0b74Schristos
163875fd0b74Schristos# _LT_HEADER_DLFCN
163975fd0b74Schristos# ----------------
164075fd0b74Schristosm4_defun([_LT_HEADER_DLFCN],
164175fd0b74Schristos[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
164275fd0b74Schristos])# _LT_HEADER_DLFCN
164375fd0b74Schristos
164475fd0b74Schristos
164575fd0b74Schristos# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
164675fd0b74Schristos#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
164775fd0b74Schristos# ----------------------------------------------------------------
164875fd0b74Schristosm4_defun([_LT_TRY_DLOPEN_SELF],
164975fd0b74Schristos[m4_require([_LT_HEADER_DLFCN])dnl
165075fd0b74Schristosif test "$cross_compiling" = yes; then :
165175fd0b74Schristos  [$4]
165275fd0b74Schristoselse
165375fd0b74Schristos  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
165475fd0b74Schristos  lt_status=$lt_dlunknown
165575fd0b74Schristos  cat > conftest.$ac_ext <<_LT_EOF
165675fd0b74Schristos[#line __oline__ "configure"
165775fd0b74Schristos#include "confdefs.h"
165875fd0b74Schristos
165975fd0b74Schristos#if HAVE_DLFCN_H
166075fd0b74Schristos#include <dlfcn.h>
166175fd0b74Schristos#endif
166275fd0b74Schristos
166375fd0b74Schristos#include <stdio.h>
166475fd0b74Schristos
166575fd0b74Schristos#ifdef RTLD_GLOBAL
166675fd0b74Schristos#  define LT_DLGLOBAL		RTLD_GLOBAL
166775fd0b74Schristos#else
166875fd0b74Schristos#  ifdef DL_GLOBAL
166975fd0b74Schristos#    define LT_DLGLOBAL		DL_GLOBAL
167075fd0b74Schristos#  else
167175fd0b74Schristos#    define LT_DLGLOBAL		0
167275fd0b74Schristos#  endif
167375fd0b74Schristos#endif
167475fd0b74Schristos
167575fd0b74Schristos/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
167675fd0b74Schristos   find out it does not work in some platform. */
167775fd0b74Schristos#ifndef LT_DLLAZY_OR_NOW
167875fd0b74Schristos#  ifdef RTLD_LAZY
167975fd0b74Schristos#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
168075fd0b74Schristos#  else
168175fd0b74Schristos#    ifdef DL_LAZY
168275fd0b74Schristos#      define LT_DLLAZY_OR_NOW		DL_LAZY
168375fd0b74Schristos#    else
168475fd0b74Schristos#      ifdef RTLD_NOW
168575fd0b74Schristos#        define LT_DLLAZY_OR_NOW	RTLD_NOW
168675fd0b74Schristos#      else
168775fd0b74Schristos#        ifdef DL_NOW
168875fd0b74Schristos#          define LT_DLLAZY_OR_NOW	DL_NOW
168975fd0b74Schristos#        else
169075fd0b74Schristos#          define LT_DLLAZY_OR_NOW	0
169175fd0b74Schristos#        endif
169275fd0b74Schristos#      endif
169375fd0b74Schristos#    endif
169475fd0b74Schristos#  endif
169575fd0b74Schristos#endif
169675fd0b74Schristos
169775fd0b74Schristos/* When -fvisbility=hidden is used, assume the code has been annotated
169875fd0b74Schristos   correspondingly for the symbols needed.  */
169975fd0b74Schristos#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
170075fd0b74Schristosvoid fnord () __attribute__((visibility("default")));
170175fd0b74Schristos#endif
170275fd0b74Schristos
170375fd0b74Schristosvoid fnord () { int i=42; }
170475fd0b74Schristosint main ()
170575fd0b74Schristos{
170675fd0b74Schristos  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
170775fd0b74Schristos  int status = $lt_dlunknown;
170875fd0b74Schristos
170975fd0b74Schristos  if (self)
171075fd0b74Schristos    {
171175fd0b74Schristos      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
171275fd0b74Schristos      else
171375fd0b74Schristos        {
171475fd0b74Schristos	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
171575fd0b74Schristos          else puts (dlerror ());
171675fd0b74Schristos	}
171775fd0b74Schristos      /* dlclose (self); */
171875fd0b74Schristos    }
171975fd0b74Schristos  else
172075fd0b74Schristos    puts (dlerror ());
172175fd0b74Schristos
172275fd0b74Schristos  return status;
172375fd0b74Schristos}]
172475fd0b74Schristos_LT_EOF
172575fd0b74Schristos  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
172675fd0b74Schristos    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
172775fd0b74Schristos    lt_status=$?
172875fd0b74Schristos    case x$lt_status in
172975fd0b74Schristos      x$lt_dlno_uscore) $1 ;;
173075fd0b74Schristos      x$lt_dlneed_uscore) $2 ;;
173175fd0b74Schristos      x$lt_dlunknown|x*) $3 ;;
173275fd0b74Schristos    esac
173375fd0b74Schristos  else :
173475fd0b74Schristos    # compilation failed
173575fd0b74Schristos    $3
173675fd0b74Schristos  fi
173775fd0b74Schristosfi
173875fd0b74Schristosrm -fr conftest*
173975fd0b74Schristos])# _LT_TRY_DLOPEN_SELF
174075fd0b74Schristos
174175fd0b74Schristos
174275fd0b74Schristos# LT_SYS_DLOPEN_SELF
174375fd0b74Schristos# ------------------
174475fd0b74SchristosAC_DEFUN([LT_SYS_DLOPEN_SELF],
174575fd0b74Schristos[m4_require([_LT_HEADER_DLFCN])dnl
174675fd0b74Schristosif test "x$enable_dlopen" != xyes; then
174775fd0b74Schristos  enable_dlopen=unknown
174875fd0b74Schristos  enable_dlopen_self=unknown
174975fd0b74Schristos  enable_dlopen_self_static=unknown
175075fd0b74Schristoselse
175175fd0b74Schristos  lt_cv_dlopen=no
175275fd0b74Schristos  lt_cv_dlopen_libs=
175375fd0b74Schristos
175475fd0b74Schristos  case $host_os in
175575fd0b74Schristos  beos*)
175675fd0b74Schristos    lt_cv_dlopen="load_add_on"
175775fd0b74Schristos    lt_cv_dlopen_libs=
175875fd0b74Schristos    lt_cv_dlopen_self=yes
175975fd0b74Schristos    ;;
176075fd0b74Schristos
176175fd0b74Schristos  mingw* | pw32* | cegcc*)
176275fd0b74Schristos    lt_cv_dlopen="LoadLibrary"
176375fd0b74Schristos    lt_cv_dlopen_libs=
176475fd0b74Schristos    ;;
176575fd0b74Schristos
176675fd0b74Schristos  cygwin*)
176775fd0b74Schristos    lt_cv_dlopen="dlopen"
176875fd0b74Schristos    lt_cv_dlopen_libs=
176975fd0b74Schristos    ;;
177075fd0b74Schristos
177175fd0b74Schristos  darwin*)
177275fd0b74Schristos  # if libdl is installed we need to link against it
177375fd0b74Schristos    AC_CHECK_LIB([dl], [dlopen],
177475fd0b74Schristos		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
177575fd0b74Schristos    lt_cv_dlopen="dyld"
177675fd0b74Schristos    lt_cv_dlopen_libs=
177775fd0b74Schristos    lt_cv_dlopen_self=yes
177875fd0b74Schristos    ])
177975fd0b74Schristos    ;;
178075fd0b74Schristos
178175fd0b74Schristos  *)
178275fd0b74Schristos    AC_CHECK_FUNC([shl_load],
178375fd0b74Schristos	  [lt_cv_dlopen="shl_load"],
178475fd0b74Schristos      [AC_CHECK_LIB([dld], [shl_load],
178575fd0b74Schristos	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
178675fd0b74Schristos	[AC_CHECK_FUNC([dlopen],
178775fd0b74Schristos	      [lt_cv_dlopen="dlopen"],
178875fd0b74Schristos	  [AC_CHECK_LIB([dl], [dlopen],
178975fd0b74Schristos		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
179075fd0b74Schristos	    [AC_CHECK_LIB([svld], [dlopen],
179175fd0b74Schristos		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
179275fd0b74Schristos	      [AC_CHECK_LIB([dld], [dld_link],
179375fd0b74Schristos		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
179475fd0b74Schristos	      ])
179575fd0b74Schristos	    ])
179675fd0b74Schristos	  ])
179775fd0b74Schristos	])
179875fd0b74Schristos      ])
179975fd0b74Schristos    ;;
180075fd0b74Schristos  esac
180175fd0b74Schristos
180275fd0b74Schristos  if test "x$lt_cv_dlopen" != xno; then
180375fd0b74Schristos    enable_dlopen=yes
180475fd0b74Schristos  else
180575fd0b74Schristos    enable_dlopen=no
180675fd0b74Schristos  fi
180775fd0b74Schristos
180875fd0b74Schristos  case $lt_cv_dlopen in
180975fd0b74Schristos  dlopen)
181075fd0b74Schristos    save_CPPFLAGS="$CPPFLAGS"
181175fd0b74Schristos    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
181275fd0b74Schristos
181375fd0b74Schristos    save_LDFLAGS="$LDFLAGS"
181475fd0b74Schristos    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
181575fd0b74Schristos
181675fd0b74Schristos    save_LIBS="$LIBS"
181775fd0b74Schristos    LIBS="$lt_cv_dlopen_libs $LIBS"
181875fd0b74Schristos
181975fd0b74Schristos    AC_CACHE_CHECK([whether a program can dlopen itself],
182075fd0b74Schristos	  lt_cv_dlopen_self, [dnl
182175fd0b74Schristos	  _LT_TRY_DLOPEN_SELF(
182275fd0b74Schristos	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
182375fd0b74Schristos	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
182475fd0b74Schristos    ])
182575fd0b74Schristos
182675fd0b74Schristos    if test "x$lt_cv_dlopen_self" = xyes; then
182775fd0b74Schristos      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
182875fd0b74Schristos      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
182975fd0b74Schristos	  lt_cv_dlopen_self_static, [dnl
183075fd0b74Schristos	  _LT_TRY_DLOPEN_SELF(
183175fd0b74Schristos	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
183275fd0b74Schristos	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
183375fd0b74Schristos      ])
183475fd0b74Schristos    fi
183575fd0b74Schristos
183675fd0b74Schristos    CPPFLAGS="$save_CPPFLAGS"
183775fd0b74Schristos    LDFLAGS="$save_LDFLAGS"
183875fd0b74Schristos    LIBS="$save_LIBS"
183975fd0b74Schristos    ;;
184075fd0b74Schristos  esac
184175fd0b74Schristos
184275fd0b74Schristos  case $lt_cv_dlopen_self in
184375fd0b74Schristos  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
184475fd0b74Schristos  *) enable_dlopen_self=unknown ;;
184575fd0b74Schristos  esac
184675fd0b74Schristos
184775fd0b74Schristos  case $lt_cv_dlopen_self_static in
184875fd0b74Schristos  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
184975fd0b74Schristos  *) enable_dlopen_self_static=unknown ;;
185075fd0b74Schristos  esac
185175fd0b74Schristosfi
185275fd0b74Schristos_LT_DECL([dlopen_support], [enable_dlopen], [0],
185375fd0b74Schristos	 [Whether dlopen is supported])
185475fd0b74Schristos_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
185575fd0b74Schristos	 [Whether dlopen of programs is supported])
185675fd0b74Schristos_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
185775fd0b74Schristos	 [Whether dlopen of statically linked programs is supported])
185875fd0b74Schristos])# LT_SYS_DLOPEN_SELF
185975fd0b74Schristos
186075fd0b74Schristos# Old name:
186175fd0b74SchristosAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
186275fd0b74Schristosdnl aclocal-1.4 backwards compatibility:
186375fd0b74Schristosdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
186475fd0b74Schristos
186575fd0b74Schristos
186675fd0b74Schristos# _LT_COMPILER_C_O([TAGNAME])
186775fd0b74Schristos# ---------------------------
186875fd0b74Schristos# Check to see if options -c and -o are simultaneously supported by compiler.
186975fd0b74Schristos# This macro does not hard code the compiler like AC_PROG_CC_C_O.
187075fd0b74Schristosm4_defun([_LT_COMPILER_C_O],
187175fd0b74Schristos[m4_require([_LT_DECL_SED])dnl
187275fd0b74Schristosm4_require([_LT_FILEUTILS_DEFAULTS])dnl
187375fd0b74Schristosm4_require([_LT_TAG_COMPILER])dnl
187475fd0b74SchristosAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
187575fd0b74Schristos  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
187675fd0b74Schristos  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
187775fd0b74Schristos   $RM -r conftest 2>/dev/null
187875fd0b74Schristos   mkdir conftest
187975fd0b74Schristos   cd conftest
188075fd0b74Schristos   mkdir out
188175fd0b74Schristos   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
188275fd0b74Schristos
188375fd0b74Schristos   lt_compiler_flag="-o out/conftest2.$ac_objext"
188475fd0b74Schristos   # Insert the option either (1) after the last *FLAGS variable, or
188575fd0b74Schristos   # (2) before a word containing "conftest.", or (3) at the end.
188675fd0b74Schristos   # Note that $ac_compile itself does not contain backslashes and begins
188775fd0b74Schristos   # with a dollar sign (not a hyphen), so the echo should work correctly.
188875fd0b74Schristos   lt_compile=`echo "$ac_compile" | $SED \
188975fd0b74Schristos   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
189075fd0b74Schristos   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
189175fd0b74Schristos   -e 's:$: $lt_compiler_flag:'`
189275fd0b74Schristos   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
189375fd0b74Schristos   (eval "$lt_compile" 2>out/conftest.err)
189475fd0b74Schristos   ac_status=$?
189575fd0b74Schristos   cat out/conftest.err >&AS_MESSAGE_LOG_FD
189675fd0b74Schristos   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
189775fd0b74Schristos   if (exit $ac_status) && test -s out/conftest2.$ac_objext
189875fd0b74Schristos   then
189975fd0b74Schristos     # The compiler can only warn and ignore the option if not recognized
190075fd0b74Schristos     # So say no if there are warnings
190175fd0b74Schristos     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
190275fd0b74Schristos     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
190375fd0b74Schristos     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
190475fd0b74Schristos       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
190575fd0b74Schristos     fi
190675fd0b74Schristos   fi
190775fd0b74Schristos   chmod u+w . 2>&AS_MESSAGE_LOG_FD
190875fd0b74Schristos   $RM conftest*
190975fd0b74Schristos   # SGI C++ compiler will create directory out/ii_files/ for
191075fd0b74Schristos   # template instantiation
191175fd0b74Schristos   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
191275fd0b74Schristos   $RM out/* && rmdir out
191375fd0b74Schristos   cd ..
191475fd0b74Schristos   $RM -r conftest
191575fd0b74Schristos   $RM conftest*
191675fd0b74Schristos])
191775fd0b74Schristos_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
191875fd0b74Schristos	[Does compiler simultaneously support -c and -o options?])
191975fd0b74Schristos])# _LT_COMPILER_C_O
192075fd0b74Schristos
192175fd0b74Schristos
192275fd0b74Schristos# _LT_COMPILER_FILE_LOCKS([TAGNAME])
192375fd0b74Schristos# ----------------------------------
192475fd0b74Schristos# Check to see if we can do hard links to lock some files if needed
192575fd0b74Schristosm4_defun([_LT_COMPILER_FILE_LOCKS],
192675fd0b74Schristos[m4_require([_LT_ENABLE_LOCK])dnl
192775fd0b74Schristosm4_require([_LT_FILEUTILS_DEFAULTS])dnl
192875fd0b74Schristos_LT_COMPILER_C_O([$1])
192975fd0b74Schristos
193075fd0b74Schristoshard_links="nottested"
193175fd0b74Schristosif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
193275fd0b74Schristos  # do not overwrite the value of need_locks provided by the user
193375fd0b74Schristos  AC_MSG_CHECKING([if we can lock with hard links])
193475fd0b74Schristos  hard_links=yes
193575fd0b74Schristos  $RM conftest*
193675fd0b74Schristos  ln conftest.a conftest.b 2>/dev/null && hard_links=no
193775fd0b74Schristos  touch conftest.a
193875fd0b74Schristos  ln conftest.a conftest.b 2>&5 || hard_links=no
193975fd0b74Schristos  ln conftest.a conftest.b 2>/dev/null && hard_links=no
194075fd0b74Schristos  AC_MSG_RESULT([$hard_links])
194175fd0b74Schristos  if test "$hard_links" = no; then
194275fd0b74Schristos    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
194375fd0b74Schristos    need_locks=warn
194475fd0b74Schristos  fi
194575fd0b74Schristoselse
194675fd0b74Schristos  need_locks=no
194775fd0b74Schristosfi
194875fd0b74Schristos_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
194975fd0b74Schristos])# _LT_COMPILER_FILE_LOCKS
195075fd0b74Schristos
195175fd0b74Schristos
195275fd0b74Schristos# _LT_CHECK_OBJDIR
195375fd0b74Schristos# ----------------
195475fd0b74Schristosm4_defun([_LT_CHECK_OBJDIR],
195575fd0b74Schristos[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
195675fd0b74Schristos[rm -f .libs 2>/dev/null
195775fd0b74Schristosmkdir .libs 2>/dev/null
195875fd0b74Schristosif test -d .libs; then
195975fd0b74Schristos  lt_cv_objdir=.libs
196075fd0b74Schristoselse
196175fd0b74Schristos  # MS-DOS does not allow filenames that begin with a dot.
196275fd0b74Schristos  lt_cv_objdir=_libs
196375fd0b74Schristosfi
196475fd0b74Schristosrmdir .libs 2>/dev/null])
196575fd0b74Schristosobjdir=$lt_cv_objdir
196675fd0b74Schristos_LT_DECL([], [objdir], [0],
196775fd0b74Schristos         [The name of the directory that contains temporary libtool files])dnl
196875fd0b74Schristosm4_pattern_allow([LT_OBJDIR])dnl
196975fd0b74SchristosAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
197075fd0b74Schristos  [Define to the sub-directory in which libtool stores uninstalled libraries.])
197175fd0b74Schristos])# _LT_CHECK_OBJDIR
197275fd0b74Schristos
197375fd0b74Schristos
197475fd0b74Schristos# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
197575fd0b74Schristos# --------------------------------------
197675fd0b74Schristos# Check hardcoding attributes.
197775fd0b74Schristosm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
197875fd0b74Schristos[AC_MSG_CHECKING([how to hardcode library paths into programs])
197975fd0b74Schristos_LT_TAGVAR(hardcode_action, $1)=
198075fd0b74Schristosif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
198175fd0b74Schristos   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
198275fd0b74Schristos   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
198375fd0b74Schristos
198475fd0b74Schristos  # We can hardcode non-existent directories.
198575fd0b74Schristos  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
198675fd0b74Schristos     # If the only mechanism to avoid hardcoding is shlibpath_var, we
198775fd0b74Schristos     # have to relink, otherwise we might link with an installed library
198875fd0b74Schristos     # when we should be linking with a yet-to-be-installed one
198975fd0b74Schristos     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
199075fd0b74Schristos     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
199175fd0b74Schristos    # Linking always hardcodes the temporary library directory.
199275fd0b74Schristos    _LT_TAGVAR(hardcode_action, $1)=relink
199375fd0b74Schristos  else
199475fd0b74Schristos    # We can link without hardcoding, and we can hardcode nonexisting dirs.
199575fd0b74Schristos    _LT_TAGVAR(hardcode_action, $1)=immediate
199675fd0b74Schristos  fi
199775fd0b74Schristoselse
199875fd0b74Schristos  # We cannot hardcode anything, or else we can only hardcode existing
199975fd0b74Schristos  # directories.
200075fd0b74Schristos  _LT_TAGVAR(hardcode_action, $1)=unsupported
200175fd0b74Schristosfi
200275fd0b74SchristosAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
200375fd0b74Schristos
200475fd0b74Schristosif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
200575fd0b74Schristos   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
200675fd0b74Schristos  # Fast installation is not supported
200775fd0b74Schristos  enable_fast_install=no
200875fd0b74Schristoselif test "$shlibpath_overrides_runpath" = yes ||
200975fd0b74Schristos     test "$enable_shared" = no; then
201075fd0b74Schristos  # Fast installation is not necessary
201175fd0b74Schristos  enable_fast_install=needless
201275fd0b74Schristosfi
201375fd0b74Schristos_LT_TAGDECL([], [hardcode_action], [0],
201475fd0b74Schristos    [How to hardcode a shared library path into an executable])
201575fd0b74Schristos])# _LT_LINKER_HARDCODE_LIBPATH
201675fd0b74Schristos
201775fd0b74Schristos
201875fd0b74Schristos# _LT_CMD_STRIPLIB
201975fd0b74Schristos# ----------------
202075fd0b74Schristosm4_defun([_LT_CMD_STRIPLIB],
202175fd0b74Schristos[m4_require([_LT_DECL_EGREP])
202275fd0b74Schristosstriplib=
202375fd0b74Schristosold_striplib=
202475fd0b74SchristosAC_MSG_CHECKING([whether stripping libraries is possible])
202575fd0b74Schristosif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
202675fd0b74Schristos  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
202775fd0b74Schristos  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
202875fd0b74Schristos  AC_MSG_RESULT([yes])
202975fd0b74Schristoselse
203075fd0b74Schristos# FIXME - insert some real tests, host_os isn't really good enough
203175fd0b74Schristos  case $host_os in
203275fd0b74Schristos  darwin*)
203375fd0b74Schristos    if test -n "$STRIP" ; then
203475fd0b74Schristos      striplib="$STRIP -x"
203575fd0b74Schristos      old_striplib="$STRIP -S"
203675fd0b74Schristos      AC_MSG_RESULT([yes])
203775fd0b74Schristos    else
203875fd0b74Schristos      AC_MSG_RESULT([no])
203975fd0b74Schristos    fi
204075fd0b74Schristos    ;;
204175fd0b74Schristos  *)
204275fd0b74Schristos    AC_MSG_RESULT([no])
204375fd0b74Schristos    ;;
204475fd0b74Schristos  esac
204575fd0b74Schristosfi
204675fd0b74Schristos_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
204775fd0b74Schristos_LT_DECL([], [striplib], [1])
204875fd0b74Schristos])# _LT_CMD_STRIPLIB
204975fd0b74Schristos
205075fd0b74Schristos
205175fd0b74Schristos# _LT_SYS_DYNAMIC_LINKER([TAG])
205275fd0b74Schristos# -----------------------------
205375fd0b74Schristos# PORTME Fill in your ld.so characteristics
205475fd0b74Schristosm4_defun([_LT_SYS_DYNAMIC_LINKER],
205575fd0b74Schristos[AC_REQUIRE([AC_CANONICAL_HOST])dnl
205675fd0b74Schristosm4_require([_LT_DECL_EGREP])dnl
205775fd0b74Schristosm4_require([_LT_FILEUTILS_DEFAULTS])dnl
205875fd0b74Schristosm4_require([_LT_DECL_OBJDUMP])dnl
205975fd0b74Schristosm4_require([_LT_DECL_SED])dnl
206075fd0b74Schristosm4_require([_LT_CHECK_SHELL_FEATURES])dnl
206175fd0b74SchristosAC_MSG_CHECKING([dynamic linker characteristics])
206275fd0b74Schristosm4_if([$1],
206375fd0b74Schristos	[], [
206475fd0b74Schristosif test "$GCC" = yes; then
206575fd0b74Schristos  case $host_os in
206675fd0b74Schristos    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
206775fd0b74Schristos    *) lt_awk_arg="/^libraries:/" ;;
206875fd0b74Schristos  esac
206975fd0b74Schristos  case $host_os in
207075fd0b74Schristos    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
207175fd0b74Schristos    *) lt_sed_strip_eq="s,=/,/,g" ;;
207275fd0b74Schristos  esac
207375fd0b74Schristos  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
207475fd0b74Schristos  case $lt_search_path_spec in
207575fd0b74Schristos  *\;*)
207675fd0b74Schristos    # if the path contains ";" then we assume it to be the separator
207775fd0b74Schristos    # otherwise default to the standard path separator (i.e. ":") - it is
207875fd0b74Schristos    # assumed that no part of a normal pathname contains ";" but that should
207975fd0b74Schristos    # okay in the real world where ";" in dirpaths is itself problematic.
208075fd0b74Schristos    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
208175fd0b74Schristos    ;;
208275fd0b74Schristos  *)
208375fd0b74Schristos    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
208475fd0b74Schristos    ;;
208575fd0b74Schristos  esac
208675fd0b74Schristos  # Ok, now we have the path, separated by spaces, we can step through it
208775fd0b74Schristos  # and add multilib dir if necessary.
208875fd0b74Schristos  lt_tmp_lt_search_path_spec=
208975fd0b74Schristos  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
209075fd0b74Schristos  for lt_sys_path in $lt_search_path_spec; do
209175fd0b74Schristos    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
209275fd0b74Schristos      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
209375fd0b74Schristos    else
209475fd0b74Schristos      test -d "$lt_sys_path" && \
209575fd0b74Schristos	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
209675fd0b74Schristos    fi
209775fd0b74Schristos  done
209875fd0b74Schristos  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
209975fd0b74SchristosBEGIN {RS=" "; FS="/|\n";} {
210075fd0b74Schristos  lt_foo="";
210175fd0b74Schristos  lt_count=0;
210275fd0b74Schristos  for (lt_i = NF; lt_i > 0; lt_i--) {
210375fd0b74Schristos    if ($lt_i != "" && $lt_i != ".") {
210475fd0b74Schristos      if ($lt_i == "..") {
210575fd0b74Schristos        lt_count++;
210675fd0b74Schristos      } else {
210775fd0b74Schristos        if (lt_count == 0) {
210875fd0b74Schristos          lt_foo="/" $lt_i lt_foo;
210975fd0b74Schristos        } else {
211075fd0b74Schristos          lt_count--;
211175fd0b74Schristos        }
211275fd0b74Schristos      }
211375fd0b74Schristos    }
211475fd0b74Schristos  }
211575fd0b74Schristos  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
211675fd0b74Schristos  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
211775fd0b74Schristos}'`
211875fd0b74Schristos  # AWK program above erroneously prepends '/' to C:/dos/paths
211975fd0b74Schristos  # for these hosts.
212075fd0b74Schristos  case $host_os in
212175fd0b74Schristos    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
212275fd0b74Schristos      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
212375fd0b74Schristos  esac
212475fd0b74Schristos  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
212575fd0b74Schristoselse
212675fd0b74Schristos  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
212775fd0b74Schristosfi])
212875fd0b74Schristoslibrary_names_spec=
212975fd0b74Schristoslibname_spec='lib$name'
213075fd0b74Schristossoname_spec=
213175fd0b74Schristosshrext_cmds=".so"
213275fd0b74Schristospostinstall_cmds=
213375fd0b74Schristospostuninstall_cmds=
213475fd0b74Schristosfinish_cmds=
213575fd0b74Schristosfinish_eval=
213675fd0b74Schristosshlibpath_var=
213775fd0b74Schristosshlibpath_overrides_runpath=unknown
213875fd0b74Schristosversion_type=none
213975fd0b74Schristosdynamic_linker="$host_os ld.so"
214075fd0b74Schristossys_lib_dlsearch_path_spec="/lib /usr/lib"
214175fd0b74Schristosneed_lib_prefix=unknown
214275fd0b74Schristoshardcode_into_libs=no
214375fd0b74Schristos
214475fd0b74Schristos# when you set need_version to no, make sure it does not cause -set_version
214575fd0b74Schristos# flags to be left without arguments
214675fd0b74Schristosneed_version=unknown
214775fd0b74Schristos
214875fd0b74Schristoscase $host_os in
214975fd0b74Schristosaix3*)
215075fd0b74Schristos  version_type=linux
215175fd0b74Schristos  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
215275fd0b74Schristos  shlibpath_var=LIBPATH
215375fd0b74Schristos
215475fd0b74Schristos  # AIX 3 has no versioning support, so we append a major version to the name.
215575fd0b74Schristos  soname_spec='${libname}${release}${shared_ext}$major'
215675fd0b74Schristos  ;;
215775fd0b74Schristos
215875fd0b74Schristosaix[[4-9]]*)
215975fd0b74Schristos  version_type=linux
216075fd0b74Schristos  need_lib_prefix=no
216175fd0b74Schristos  need_version=no
216275fd0b74Schristos  hardcode_into_libs=yes
216375fd0b74Schristos  if test "$host_cpu" = ia64; then
216475fd0b74Schristos    # AIX 5 supports IA64
216575fd0b74Schristos    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
216675fd0b74Schristos    shlibpath_var=LD_LIBRARY_PATH
216775fd0b74Schristos  else
216875fd0b74Schristos    # With GCC up to 2.95.x, collect2 would create an import file
216975fd0b74Schristos    # for dependence libraries.  The import file would start with
217075fd0b74Schristos    # the line `#! .'.  This would cause the generated library to
217175fd0b74Schristos    # depend on `.', always an invalid library.  This was fixed in
217275fd0b74Schristos    # development snapshots of GCC prior to 3.0.
217375fd0b74Schristos    case $host_os in
217475fd0b74Schristos      aix4 | aix4.[[01]] | aix4.[[01]].*)
217575fd0b74Schristos      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
217675fd0b74Schristos	   echo ' yes '
217775fd0b74Schristos	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
217875fd0b74Schristos	:
217975fd0b74Schristos      else
218075fd0b74Schristos	can_build_shared=no
218175fd0b74Schristos      fi
218275fd0b74Schristos      ;;
218375fd0b74Schristos    esac
218475fd0b74Schristos    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
218575fd0b74Schristos    # soname into executable. Probably we can add versioning support to
218675fd0b74Schristos    # collect2, so additional links can be useful in future.
218775fd0b74Schristos    if test "$aix_use_runtimelinking" = yes; then
218875fd0b74Schristos      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
218975fd0b74Schristos      # instead of lib<name>.a to let people know that these are not
219075fd0b74Schristos      # typical AIX shared libraries.
219175fd0b74Schristos      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
219275fd0b74Schristos    else
219375fd0b74Schristos      # We preserve .a as extension for shared libraries through AIX4.2
219475fd0b74Schristos      # and later when we are not doing run time linking.
219575fd0b74Schristos      library_names_spec='${libname}${release}.a $libname.a'
219675fd0b74Schristos      soname_spec='${libname}${release}${shared_ext}$major'
219775fd0b74Schristos    fi
219875fd0b74Schristos    shlibpath_var=LIBPATH
219975fd0b74Schristos  fi
220075fd0b74Schristos  ;;
220175fd0b74Schristos
220275fd0b74Schristosamigaos*)
220375fd0b74Schristos  case $host_cpu in
220475fd0b74Schristos  powerpc)
220575fd0b74Schristos    # Since July 2007 AmigaOS4 officially supports .so libraries.
220675fd0b74Schristos    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
220775fd0b74Schristos    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
220875fd0b74Schristos    ;;
220975fd0b74Schristos  m68k)
221075fd0b74Schristos    library_names_spec='$libname.ixlibrary $libname.a'
221175fd0b74Schristos    # Create ${libname}_ixlibrary.a entries in /sys/libs.
221275fd0b74Schristos    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
221375fd0b74Schristos    ;;
221475fd0b74Schristos  esac
221575fd0b74Schristos  ;;
221675fd0b74Schristos
221775fd0b74Schristosbeos*)
221875fd0b74Schristos  library_names_spec='${libname}${shared_ext}'
221975fd0b74Schristos  dynamic_linker="$host_os ld.so"
222075fd0b74Schristos  shlibpath_var=LIBRARY_PATH
222175fd0b74Schristos  ;;
222275fd0b74Schristos
222375fd0b74Schristosbsdi[[45]]*)
222475fd0b74Schristos  version_type=linux
222575fd0b74Schristos  need_version=no
222675fd0b74Schristos  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
222775fd0b74Schristos  soname_spec='${libname}${release}${shared_ext}$major'
222875fd0b74Schristos  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
222975fd0b74Schristos  shlibpath_var=LD_LIBRARY_PATH
223075fd0b74Schristos  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
223175fd0b74Schristos  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
223275fd0b74Schristos  # the default ld.so.conf also contains /usr/contrib/lib and
223375fd0b74Schristos  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
223475fd0b74Schristos  # libtool to hard-code these into programs
223575fd0b74Schristos  ;;
223675fd0b74Schristos
223775fd0b74Schristoscygwin* | mingw* | pw32* | cegcc*)
223875fd0b74Schristos  version_type=windows
223975fd0b74Schristos  shrext_cmds=".dll"
224075fd0b74Schristos  need_version=no
224175fd0b74Schristos  need_lib_prefix=no
224275fd0b74Schristos
224375fd0b74Schristos  case $GCC,$host_os in
224475fd0b74Schristos  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
224575fd0b74Schristos    library_names_spec='$libname.dll.a'
224675fd0b74Schristos    # DLL is installed to $(libdir)/../bin by postinstall_cmds
224775fd0b74Schristos    postinstall_cmds='base_file=`basename \${file}`~
224875fd0b74Schristos      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
224975fd0b74Schristos      dldir=$destdir/`dirname \$dlpath`~
225075fd0b74Schristos      test -d \$dldir || mkdir -p \$dldir~
225175fd0b74Schristos      $install_prog $dir/$dlname \$dldir/$dlname~
225275fd0b74Schristos      chmod a+x \$dldir/$dlname~
225375fd0b74Schristos      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
225475fd0b74Schristos        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
225575fd0b74Schristos      fi'
225675fd0b74Schristos    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
225775fd0b74Schristos      dlpath=$dir/\$dldll~
225875fd0b74Schristos       $RM \$dlpath'
225975fd0b74Schristos    shlibpath_overrides_runpath=yes
226075fd0b74Schristos
226175fd0b74Schristos    case $host_os in
226275fd0b74Schristos    cygwin*)
226375fd0b74Schristos      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
226475fd0b74Schristos      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
226575fd0b74Schristosm4_if([$1], [],[
226675fd0b74Schristos      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
226775fd0b74Schristos      ;;
226875fd0b74Schristos    mingw* | cegcc*)
226975fd0b74Schristos      # MinGW DLLs use traditional 'lib' prefix
227075fd0b74Schristos      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
227175fd0b74Schristos      ;;
227275fd0b74Schristos    pw32*)
227375fd0b74Schristos      # pw32 DLLs use 'pw' prefix rather than 'lib'
227475fd0b74Schristos      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
227575fd0b74Schristos      ;;
227675fd0b74Schristos    esac
227775fd0b74Schristos    ;;
227875fd0b74Schristos
227975fd0b74Schristos  *)
228075fd0b74Schristos    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
228175fd0b74Schristos    ;;
228275fd0b74Schristos  esac
228375fd0b74Schristos  dynamic_linker='Win32 ld.exe'
228475fd0b74Schristos  # FIXME: first we should search . and the directory the executable is in
228575fd0b74Schristos  shlibpath_var=PATH
228675fd0b74Schristos  ;;
228775fd0b74Schristos
228875fd0b74Schristosdarwin* | rhapsody*)
228975fd0b74Schristos  dynamic_linker="$host_os dyld"
229075fd0b74Schristos  version_type=darwin
229175fd0b74Schristos  need_lib_prefix=no
229275fd0b74Schristos  need_version=no
229375fd0b74Schristos  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
229475fd0b74Schristos  soname_spec='${libname}${release}${major}$shared_ext'
229575fd0b74Schristos  shlibpath_overrides_runpath=yes
229675fd0b74Schristos  shlibpath_var=DYLD_LIBRARY_PATH
229775fd0b74Schristos  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
229875fd0b74Schristosm4_if([$1], [],[
229975fd0b74Schristos  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
230075fd0b74Schristos  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
230175fd0b74Schristos  ;;
230275fd0b74Schristos
230375fd0b74Schristosdgux*)
230475fd0b74Schristos  version_type=linux
230575fd0b74Schristos  need_lib_prefix=no
230675fd0b74Schristos  need_version=no
230775fd0b74Schristos  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
230875fd0b74Schristos  soname_spec='${libname}${release}${shared_ext}$major'
230975fd0b74Schristos  shlibpath_var=LD_LIBRARY_PATH
231075fd0b74Schristos  ;;
231175fd0b74Schristos
231275fd0b74Schristosfreebsd* | dragonfly*)
231375fd0b74Schristos  # DragonFly does not have aout.  When/if they implement a new
231475fd0b74Schristos  # versioning mechanism, adjust this.
231575fd0b74Schristos  if test -x /usr/bin/objformat; then
231675fd0b74Schristos    objformat=`/usr/bin/objformat`
231775fd0b74Schristos  else
231875fd0b74Schristos    case $host_os in
231975fd0b74Schristos    freebsd[[23]].*) objformat=aout ;;
232075fd0b74Schristos    *) objformat=elf ;;
232175fd0b74Schristos    esac
232275fd0b74Schristos  fi
232375fd0b74Schristos  version_type=freebsd-$objformat
232475fd0b74Schristos  case $version_type in
232575fd0b74Schristos    freebsd-elf*)
232675fd0b74Schristos      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
232775fd0b74Schristos      need_version=no
232875fd0b74Schristos      need_lib_prefix=no
232975fd0b74Schristos      ;;
233075fd0b74Schristos    freebsd-*)
233175fd0b74Schristos      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
233275fd0b74Schristos      need_version=yes
233375fd0b74Schristos      ;;
233475fd0b74Schristos  esac
233575fd0b74Schristos  shlibpath_var=LD_LIBRARY_PATH
233675fd0b74Schristos  case $host_os in
233775fd0b74Schristos  freebsd2.*)
233875fd0b74Schristos    shlibpath_overrides_runpath=yes
233975fd0b74Schristos    ;;
234075fd0b74Schristos  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
234175fd0b74Schristos    shlibpath_overrides_runpath=yes
234275fd0b74Schristos    hardcode_into_libs=yes
234375fd0b74Schristos    ;;
234475fd0b74Schristos  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
234575fd0b74Schristos  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
234675fd0b74Schristos    shlibpath_overrides_runpath=no
234775fd0b74Schristos    hardcode_into_libs=yes
234875fd0b74Schristos    ;;
234975fd0b74Schristos  *) # from 4.6 on, and DragonFly
235075fd0b74Schristos    shlibpath_overrides_runpath=yes
235175fd0b74Schristos    hardcode_into_libs=yes
235275fd0b74Schristos    ;;
235375fd0b74Schristos  esac
235475fd0b74Schristos  ;;
235575fd0b74Schristos
235675fd0b74Schristoshaiku*)
235775fd0b74Schristos  version_type=linux
235875fd0b74Schristos  need_lib_prefix=no
235975fd0b74Schristos  need_version=no
236075fd0b74Schristos  dynamic_linker="$host_os runtime_loader"
236175fd0b74Schristos  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
236275fd0b74Schristos  soname_spec='${libname}${release}${shared_ext}$major'
236375fd0b74Schristos  shlibpath_var=LIBRARY_PATH
236475fd0b74Schristos  shlibpath_overrides_runpath=yes
2365*e992f068Schristos  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
236675fd0b74Schristos  hardcode_into_libs=yes
236775fd0b74Schristos  ;;
236875fd0b74Schristos
236975fd0b74Schristoshpux9* | hpux10* | hpux11*)
237075fd0b74Schristos  # Give a soname corresponding to the major version so that dld.sl refuses to
237175fd0b74Schristos  # link against other versions.
237275fd0b74Schristos  version_type=sunos
237375fd0b74Schristos  need_lib_prefix=no
237475fd0b74Schristos  need_version=no
237575fd0b74Schristos  case $host_cpu in
237675fd0b74Schristos  ia64*)
237775fd0b74Schristos    shrext_cmds='.so'
237875fd0b74Schristos    hardcode_into_libs=yes
237975fd0b74Schristos    dynamic_linker="$host_os dld.so"
238075fd0b74Schristos    shlibpath_var=LD_LIBRARY_PATH
238175fd0b74Schristos    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
238275fd0b74Schristos    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
238375fd0b74Schristos    soname_spec='${libname}${release}${shared_ext}$major'
238475fd0b74Schristos    if test "X$HPUX_IA64_MODE" = X32; then
238575fd0b74Schristos      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
238675fd0b74Schristos    else
238775fd0b74Schristos      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
238875fd0b74Schristos    fi
238975fd0b74Schristos    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
239075fd0b74Schristos    ;;
239175fd0b74Schristos  hppa*64*)
239275fd0b74Schristos    shrext_cmds='.sl'
239375fd0b74Schristos    hardcode_into_libs=yes
239475fd0b74Schristos    dynamic_linker="$host_os dld.sl"
239575fd0b74Schristos    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
239675fd0b74Schristos    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
239775fd0b74Schristos    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
239875fd0b74Schristos    soname_spec='${libname}${release}${shared_ext}$major'
239975fd0b74Schristos    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
240075fd0b74Schristos    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
240175fd0b74Schristos    ;;
240275fd0b74Schristos  *)
240375fd0b74Schristos    shrext_cmds='.sl'
240475fd0b74Schristos    dynamic_linker="$host_os dld.sl"
240575fd0b74Schristos    shlibpath_var=SHLIB_PATH
240675fd0b74Schristos    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
240775fd0b74Schristos    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
240875fd0b74Schristos    soname_spec='${libname}${release}${shared_ext}$major'
240975fd0b74Schristos    ;;
241075fd0b74Schristos  esac
241175fd0b74Schristos  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
241275fd0b74Schristos  postinstall_cmds='chmod 555 $lib'
241375fd0b74Schristos  # or fails outright, so override atomically:
241475fd0b74Schristos  install_override_mode=555
241575fd0b74Schristos  ;;
241675fd0b74Schristos
241775fd0b74Schristosinterix[[3-9]]*)
241875fd0b74Schristos  version_type=linux
241975fd0b74Schristos  need_lib_prefix=no
242075fd0b74Schristos  need_version=no
242175fd0b74Schristos  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
242275fd0b74Schristos  soname_spec='${libname}${release}${shared_ext}$major'
242375fd0b74Schristos  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
242475fd0b74Schristos  shlibpath_var=LD_LIBRARY_PATH
242575fd0b74Schristos  shlibpath_overrides_runpath=no
242675fd0b74Schristos  hardcode_into_libs=yes
242775fd0b74Schristos  ;;
242875fd0b74Schristos
242975fd0b74Schristosirix5* | irix6* | nonstopux*)
243075fd0b74Schristos  case $host_os in
243175fd0b74Schristos    nonstopux*) version_type=nonstopux ;;
243275fd0b74Schristos    *)
243375fd0b74Schristos	if test "$lt_cv_prog_gnu_ld" = yes; then
243475fd0b74Schristos		version_type=linux
243575fd0b74Schristos	else
243675fd0b74Schristos		version_type=irix
243775fd0b74Schristos	fi ;;
243875fd0b74Schristos  esac
243975fd0b74Schristos  need_lib_prefix=no
244075fd0b74Schristos  need_version=no
244175fd0b74Schristos  soname_spec='${libname}${release}${shared_ext}$major'
244275fd0b74Schristos  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
244375fd0b74Schristos  case $host_os in
244475fd0b74Schristos  irix5* | nonstopux*)
244575fd0b74Schristos    libsuff= shlibsuff=
244675fd0b74Schristos    ;;
244775fd0b74Schristos  *)
244875fd0b74Schristos    case $LD in # libtool.m4 will add one of these switches to LD
244975fd0b74Schristos    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
245075fd0b74Schristos      libsuff= shlibsuff= libmagic=32-bit;;
245175fd0b74Schristos    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
245275fd0b74Schristos      libsuff=32 shlibsuff=N32 libmagic=N32;;
245375fd0b74Schristos    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
245475fd0b74Schristos      libsuff=64 shlibsuff=64 libmagic=64-bit;;
245575fd0b74Schristos    *) libsuff= shlibsuff= libmagic=never-match;;
245675fd0b74Schristos    esac
245775fd0b74Schristos    ;;
245875fd0b74Schristos  esac
245975fd0b74Schristos  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
246075fd0b74Schristos  shlibpath_overrides_runpath=no
246175fd0b74Schristos  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
246275fd0b74Schristos  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
246375fd0b74Schristos  hardcode_into_libs=yes
246475fd0b74Schristos  ;;
246575fd0b74Schristos
246675fd0b74Schristos# No shared lib support for Linux oldld, aout, or coff.
246775fd0b74Schristoslinux*oldld* | linux*aout* | linux*coff*)
246875fd0b74Schristos  dynamic_linker=no
246975fd0b74Schristos  ;;
247075fd0b74Schristos
247175fd0b74Schristos# This must be Linux ELF.
2472*e992f068Schristoslinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
247375fd0b74Schristos  version_type=linux
247475fd0b74Schristos  need_lib_prefix=no
247575fd0b74Schristos  need_version=no
247675fd0b74Schristos  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
247775fd0b74Schristos  soname_spec='${libname}${release}${shared_ext}$major'
247875fd0b74Schristos  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
247975fd0b74Schristos  shlibpath_var=LD_LIBRARY_PATH
248075fd0b74Schristos  shlibpath_overrides_runpath=no
248175fd0b74Schristos
248275fd0b74Schristos  # Some binutils ld are patched to set DT_RUNPATH
248375fd0b74Schristos  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
248475fd0b74Schristos    [lt_cv_shlibpath_overrides_runpath=no
248575fd0b74Schristos    save_LDFLAGS=$LDFLAGS
248675fd0b74Schristos    save_libdir=$libdir
248775fd0b74Schristos    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
248875fd0b74Schristos	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
248975fd0b74Schristos    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
249075fd0b74Schristos      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
249175fd0b74Schristos	 [lt_cv_shlibpath_overrides_runpath=yes])])
249275fd0b74Schristos    LDFLAGS=$save_LDFLAGS
249375fd0b74Schristos    libdir=$save_libdir
249475fd0b74Schristos    ])
249575fd0b74Schristos  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
249675fd0b74Schristos
249775fd0b74Schristos  # This implies no fast_install, which is unacceptable.
249875fd0b74Schristos  # Some rework will be needed to allow for fast_install
249975fd0b74Schristos  # before this can be enabled.
250075fd0b74Schristos  hardcode_into_libs=yes
250175fd0b74Schristos
250275fd0b74Schristos  # Append ld.so.conf contents to the search path
250375fd0b74Schristos  if test -f /etc/ld.so.conf; then
250475fd0b74Schristos    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' ' '`
250575fd0b74Schristos    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
250675fd0b74Schristos  fi
250775fd0b74Schristos
250875fd0b74Schristos  # We used to test for /lib/ld.so.1 and disable shared libraries on
250975fd0b74Schristos  # powerpc, because MkLinux only supported shared libraries with the
251075fd0b74Schristos  # GNU dynamic linker.  Since this was broken with cross compilers,
251175fd0b74Schristos  # most powerpc-linux boxes support dynamic linking these days and
251275fd0b74Schristos  # people can always --disable-shared, the test was removed, and we
251375fd0b74Schristos  # assume the GNU/Linux dynamic linker is in use.
251475fd0b74Schristos  dynamic_linker='GNU/Linux ld.so'
251575fd0b74Schristos  ;;
251675fd0b74Schristos
251775fd0b74Schristosnetbsd*)
251875fd0b74Schristos  version_type=sunos
251975fd0b74Schristos  need_lib_prefix=no
252075fd0b74Schristos  need_version=no
252175fd0b74Schristos  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
252275fd0b74Schristos    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
252375fd0b74Schristos    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
252475fd0b74Schristos    dynamic_linker='NetBSD (a.out) ld.so'
252575fd0b74Schristos  else
252675fd0b74Schristos    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
252775fd0b74Schristos    soname_spec='${libname}${release}${shared_ext}$major'
252875fd0b74Schristos    dynamic_linker='NetBSD ld.elf_so'
252975fd0b74Schristos  fi
253075fd0b74Schristos  shlibpath_var=LD_LIBRARY_PATH
253175fd0b74Schristos  shlibpath_overrides_runpath=yes
253275fd0b74Schristos  hardcode_into_libs=yes
253375fd0b74Schristos  ;;
253475fd0b74Schristos
253575fd0b74Schristosnewsos6)
253675fd0b74Schristos  version_type=linux
253775fd0b74Schristos  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
253875fd0b74Schristos  shlibpath_var=LD_LIBRARY_PATH
253975fd0b74Schristos  shlibpath_overrides_runpath=yes
254075fd0b74Schristos  ;;
254175fd0b74Schristos
254275fd0b74Schristos*nto* | *qnx*)
254375fd0b74Schristos  version_type=qnx
254475fd0b74Schristos  need_lib_prefix=no
254575fd0b74Schristos  need_version=no
254675fd0b74Schristos  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
254775fd0b74Schristos  soname_spec='${libname}${release}${shared_ext}$major'
254875fd0b74Schristos  shlibpath_var=LD_LIBRARY_PATH
254975fd0b74Schristos  shlibpath_overrides_runpath=no
255075fd0b74Schristos  hardcode_into_libs=yes
255175fd0b74Schristos  dynamic_linker='ldqnx.so'
255275fd0b74Schristos  ;;
255375fd0b74Schristos
255475fd0b74Schristosopenbsd*)
255575fd0b74Schristos  version_type=sunos
255675fd0b74Schristos  sys_lib_dlsearch_path_spec="/usr/lib"
255775fd0b74Schristos  need_lib_prefix=no
255875fd0b74Schristos  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
255975fd0b74Schristos  case $host_os in
256075fd0b74Schristos    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
256175fd0b74Schristos    *)				need_version=no  ;;
256275fd0b74Schristos  esac
256375fd0b74Schristos  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
256475fd0b74Schristos  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
256575fd0b74Schristos  shlibpath_var=LD_LIBRARY_PATH
256675fd0b74Schristos  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
256775fd0b74Schristos    case $host_os in
256875fd0b74Schristos      openbsd2.[[89]] | openbsd2.[[89]].*)
256975fd0b74Schristos	shlibpath_overrides_runpath=no
257075fd0b74Schristos	;;
257175fd0b74Schristos      *)
257275fd0b74Schristos	shlibpath_overrides_runpath=yes
257375fd0b74Schristos	;;
257475fd0b74Schristos      esac
257575fd0b74Schristos  else
257675fd0b74Schristos    shlibpath_overrides_runpath=yes
257775fd0b74Schristos  fi
257875fd0b74Schristos  ;;
257975fd0b74Schristos
258075fd0b74Schristosos2*)
258175fd0b74Schristos  libname_spec='$name'
258275fd0b74Schristos  shrext_cmds=".dll"
258375fd0b74Schristos  need_lib_prefix=no
258475fd0b74Schristos  library_names_spec='$libname${shared_ext} $libname.a'
258575fd0b74Schristos  dynamic_linker='OS/2 ld.exe'
258675fd0b74Schristos  shlibpath_var=LIBPATH
258775fd0b74Schristos  ;;
258875fd0b74Schristos
258975fd0b74Schristososf3* | osf4* | osf5*)
259075fd0b74Schristos  version_type=osf
259175fd0b74Schristos  need_lib_prefix=no
259275fd0b74Schristos  need_version=no
259375fd0b74Schristos  soname_spec='${libname}${release}${shared_ext}$major'
259475fd0b74Schristos  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
259575fd0b74Schristos  shlibpath_var=LD_LIBRARY_PATH
259675fd0b74Schristos  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
259775fd0b74Schristos  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
259875fd0b74Schristos  ;;
259975fd0b74Schristos
260075fd0b74Schristosrdos*)
260175fd0b74Schristos  dynamic_linker=no
260275fd0b74Schristos  ;;
260375fd0b74Schristos
260475fd0b74Schristossolaris*)
260575fd0b74Schristos  version_type=linux
260675fd0b74Schristos  need_lib_prefix=no
260775fd0b74Schristos  need_version=no
260875fd0b74Schristos  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
260975fd0b74Schristos  soname_spec='${libname}${release}${shared_ext}$major'
261075fd0b74Schristos  shlibpath_var=LD_LIBRARY_PATH
261175fd0b74Schristos  shlibpath_overrides_runpath=yes
261275fd0b74Schristos  hardcode_into_libs=yes
261375fd0b74Schristos  # ldd complains unless libraries are executable
261475fd0b74Schristos  postinstall_cmds='chmod +x $lib'
261575fd0b74Schristos  ;;
261675fd0b74Schristos
261775fd0b74Schristossunos4*)
261875fd0b74Schristos  version_type=sunos
261975fd0b74Schristos  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
262075fd0b74Schristos  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
262175fd0b74Schristos  shlibpath_var=LD_LIBRARY_PATH
262275fd0b74Schristos  shlibpath_overrides_runpath=yes
262375fd0b74Schristos  if test "$with_gnu_ld" = yes; then
262475fd0b74Schristos    need_lib_prefix=no
262575fd0b74Schristos  fi
262675fd0b74Schristos  need_version=yes
262775fd0b74Schristos  ;;
262875fd0b74Schristos
262975fd0b74Schristossysv4 | sysv4.3*)
263075fd0b74Schristos  version_type=linux
263175fd0b74Schristos  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
263275fd0b74Schristos  soname_spec='${libname}${release}${shared_ext}$major'
263375fd0b74Schristos  shlibpath_var=LD_LIBRARY_PATH
263475fd0b74Schristos  case $host_vendor in
263575fd0b74Schristos    sni)
263675fd0b74Schristos      shlibpath_overrides_runpath=no
263775fd0b74Schristos      need_lib_prefix=no
263875fd0b74Schristos      runpath_var=LD_RUN_PATH
263975fd0b74Schristos      ;;
264075fd0b74Schristos    siemens)
264175fd0b74Schristos      need_lib_prefix=no
264275fd0b74Schristos      ;;
264375fd0b74Schristos    motorola)
264475fd0b74Schristos      need_lib_prefix=no
264575fd0b74Schristos      need_version=no
264675fd0b74Schristos      shlibpath_overrides_runpath=no
264775fd0b74Schristos      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
264875fd0b74Schristos      ;;
264975fd0b74Schristos  esac
265075fd0b74Schristos  ;;
265175fd0b74Schristos
265275fd0b74Schristossysv4*MP*)
265375fd0b74Schristos  if test -d /usr/nec ;then
265475fd0b74Schristos    version_type=linux
265575fd0b74Schristos    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
265675fd0b74Schristos    soname_spec='$libname${shared_ext}.$major'
265775fd0b74Schristos    shlibpath_var=LD_LIBRARY_PATH
265875fd0b74Schristos  fi
265975fd0b74Schristos  ;;
266075fd0b74Schristos
266175fd0b74Schristossysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
266275fd0b74Schristos  version_type=freebsd-elf
266375fd0b74Schristos  need_lib_prefix=no
266475fd0b74Schristos  need_version=no
266575fd0b74Schristos  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
266675fd0b74Schristos  soname_spec='${libname}${release}${shared_ext}$major'
266775fd0b74Schristos  shlibpath_var=LD_LIBRARY_PATH
266875fd0b74Schristos  shlibpath_overrides_runpath=yes
266975fd0b74Schristos  hardcode_into_libs=yes
267075fd0b74Schristos  if test "$with_gnu_ld" = yes; then
267175fd0b74Schristos    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
267275fd0b74Schristos  else
267375fd0b74Schristos    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
267475fd0b74Schristos    case $host_os in
267575fd0b74Schristos      sco3.2v5*)
267675fd0b74Schristos        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
267775fd0b74Schristos	;;
267875fd0b74Schristos    esac
267975fd0b74Schristos  fi
268075fd0b74Schristos  sys_lib_dlsearch_path_spec='/usr/lib'
268175fd0b74Schristos  ;;
268275fd0b74Schristos
268375fd0b74Schristostpf*)
268475fd0b74Schristos  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
268575fd0b74Schristos  version_type=linux
268675fd0b74Schristos  need_lib_prefix=no
268775fd0b74Schristos  need_version=no
268875fd0b74Schristos  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
268975fd0b74Schristos  shlibpath_var=LD_LIBRARY_PATH
269075fd0b74Schristos  shlibpath_overrides_runpath=no
269175fd0b74Schristos  hardcode_into_libs=yes
269275fd0b74Schristos  ;;
269375fd0b74Schristos
269475fd0b74Schristosuts4*)
269575fd0b74Schristos  version_type=linux
269675fd0b74Schristos  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
269775fd0b74Schristos  soname_spec='${libname}${release}${shared_ext}$major'
269875fd0b74Schristos  shlibpath_var=LD_LIBRARY_PATH
269975fd0b74Schristos  ;;
270075fd0b74Schristos
270175fd0b74Schristos*)
270275fd0b74Schristos  dynamic_linker=no
270375fd0b74Schristos  ;;
270475fd0b74Schristosesac
270575fd0b74SchristosAC_MSG_RESULT([$dynamic_linker])
270675fd0b74Schristostest "$dynamic_linker" = no && can_build_shared=no
270775fd0b74Schristos
270875fd0b74Schristosvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
270975fd0b74Schristosif test "$GCC" = yes; then
271075fd0b74Schristos  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
271175fd0b74Schristosfi
271275fd0b74Schristos
271375fd0b74Schristosif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
271475fd0b74Schristos  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
271575fd0b74Schristosfi
271675fd0b74Schristosif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
271775fd0b74Schristos  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
271875fd0b74Schristosfi
271975fd0b74Schristos
272075fd0b74Schristos_LT_DECL([], [variables_saved_for_relink], [1],
272175fd0b74Schristos    [Variables whose values should be saved in libtool wrapper scripts and
272275fd0b74Schristos    restored at link time])
272375fd0b74Schristos_LT_DECL([], [need_lib_prefix], [0],
272475fd0b74Schristos    [Do we need the "lib" prefix for modules?])
272575fd0b74Schristos_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
272675fd0b74Schristos_LT_DECL([], [version_type], [0], [Library versioning type])
272775fd0b74Schristos_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
272875fd0b74Schristos_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
272975fd0b74Schristos_LT_DECL([], [shlibpath_overrides_runpath], [0],
273075fd0b74Schristos    [Is shlibpath searched before the hard-coded library search path?])
273175fd0b74Schristos_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
273275fd0b74Schristos_LT_DECL([], [library_names_spec], [1],
273375fd0b74Schristos    [[List of archive names.  First name is the real one, the rest are links.
273475fd0b74Schristos    The last name is the one that the linker finds with -lNAME]])
273575fd0b74Schristos_LT_DECL([], [soname_spec], [1],
273675fd0b74Schristos    [[The coded name of the library, if different from the real name]])
273775fd0b74Schristos_LT_DECL([], [install_override_mode], [1],
273875fd0b74Schristos    [Permission mode override for installation of shared libraries])
273975fd0b74Schristos_LT_DECL([], [postinstall_cmds], [2],
274075fd0b74Schristos    [Command to use after installation of a shared archive])
274175fd0b74Schristos_LT_DECL([], [postuninstall_cmds], [2],
274275fd0b74Schristos    [Command to use after uninstallation of a shared archive])
274375fd0b74Schristos_LT_DECL([], [finish_cmds], [2],
274475fd0b74Schristos    [Commands used to finish a libtool library installation in a directory])
274575fd0b74Schristos_LT_DECL([], [finish_eval], [1],
274675fd0b74Schristos    [[As "finish_cmds", except a single script fragment to be evaled but
274775fd0b74Schristos    not shown]])
274875fd0b74Schristos_LT_DECL([], [hardcode_into_libs], [0],
274975fd0b74Schristos    [Whether we should hardcode library paths into libraries])
275075fd0b74Schristos_LT_DECL([], [sys_lib_search_path_spec], [2],
275175fd0b74Schristos    [Compile-time system search path for libraries])
275275fd0b74Schristos_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
275375fd0b74Schristos    [Run-time system search path for libraries])
275475fd0b74Schristos])# _LT_SYS_DYNAMIC_LINKER
275575fd0b74Schristos
275675fd0b74Schristos
275775fd0b74Schristos# _LT_PATH_TOOL_PREFIX(TOOL)
275875fd0b74Schristos# --------------------------
275975fd0b74Schristos# find a file program which can recognize shared library
276075fd0b74SchristosAC_DEFUN([_LT_PATH_TOOL_PREFIX],
276175fd0b74Schristos[m4_require([_LT_DECL_EGREP])dnl
276275fd0b74SchristosAC_MSG_CHECKING([for $1])
276375fd0b74SchristosAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
276475fd0b74Schristos[case $MAGIC_CMD in
276575fd0b74Schristos[[\\/*] |  ?:[\\/]*])
276675fd0b74Schristos  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
276775fd0b74Schristos  ;;
276875fd0b74Schristos*)
276975fd0b74Schristos  lt_save_MAGIC_CMD="$MAGIC_CMD"
277075fd0b74Schristos  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
277175fd0b74Schristosdnl $ac_dummy forces splitting on constant user-supplied paths.
277275fd0b74Schristosdnl POSIX.2 word splitting is done only on the output of word expansions,
277375fd0b74Schristosdnl not every word.  This closes a longstanding sh security hole.
277475fd0b74Schristos  ac_dummy="m4_if([$2], , $PATH, [$2])"
277575fd0b74Schristos  for ac_dir in $ac_dummy; do
277675fd0b74Schristos    IFS="$lt_save_ifs"
277775fd0b74Schristos    test -z "$ac_dir" && ac_dir=.
277875fd0b74Schristos    if test -f $ac_dir/$1; then
277975fd0b74Schristos      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
278075fd0b74Schristos      if test -n "$file_magic_test_file"; then
278175fd0b74Schristos	case $deplibs_check_method in
278275fd0b74Schristos	"file_magic "*)
278375fd0b74Schristos	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
278475fd0b74Schristos	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
278575fd0b74Schristos	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
278675fd0b74Schristos	    $EGREP "$file_magic_regex" > /dev/null; then
278775fd0b74Schristos	    :
278875fd0b74Schristos	  else
278975fd0b74Schristos	    cat <<_LT_EOF 1>&2
279075fd0b74Schristos
279175fd0b74Schristos*** Warning: the command libtool uses to detect shared libraries,
279275fd0b74Schristos*** $file_magic_cmd, produces output that libtool cannot recognize.
279375fd0b74Schristos*** The result is that libtool may fail to recognize shared libraries
279475fd0b74Schristos*** as such.  This will affect the creation of libtool libraries that
279575fd0b74Schristos*** depend on shared libraries, but programs linked with such libtool
279675fd0b74Schristos*** libraries will work regardless of this problem.  Nevertheless, you
279775fd0b74Schristos*** may want to report the problem to your system manager and/or to
279875fd0b74Schristos*** bug-libtool@gnu.org
279975fd0b74Schristos
280075fd0b74Schristos_LT_EOF
280175fd0b74Schristos	  fi ;;
280275fd0b74Schristos	esac
280375fd0b74Schristos      fi
280475fd0b74Schristos      break
280575fd0b74Schristos    fi
280675fd0b74Schristos  done
280775fd0b74Schristos  IFS="$lt_save_ifs"
280875fd0b74Schristos  MAGIC_CMD="$lt_save_MAGIC_CMD"
280975fd0b74Schristos  ;;
281075fd0b74Schristosesac])
281175fd0b74SchristosMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
281275fd0b74Schristosif test -n "$MAGIC_CMD"; then
281375fd0b74Schristos  AC_MSG_RESULT($MAGIC_CMD)
281475fd0b74Schristoselse
281575fd0b74Schristos  AC_MSG_RESULT(no)
281675fd0b74Schristosfi
281775fd0b74Schristos_LT_DECL([], [MAGIC_CMD], [0],
281875fd0b74Schristos	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
281975fd0b74Schristos])# _LT_PATH_TOOL_PREFIX
282075fd0b74Schristos
282175fd0b74Schristos# Old name:
282275fd0b74SchristosAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
282375fd0b74Schristosdnl aclocal-1.4 backwards compatibility:
282475fd0b74Schristosdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
282575fd0b74Schristos
282675fd0b74Schristos
282775fd0b74Schristos# _LT_PATH_MAGIC
282875fd0b74Schristos# --------------
282975fd0b74Schristos# find a file program which can recognize a shared library
283075fd0b74Schristosm4_defun([_LT_PATH_MAGIC],
283175fd0b74Schristos[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
283275fd0b74Schristosif test -z "$lt_cv_path_MAGIC_CMD"; then
283375fd0b74Schristos  if test -n "$ac_tool_prefix"; then
283475fd0b74Schristos    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
283575fd0b74Schristos  else
283675fd0b74Schristos    MAGIC_CMD=:
283775fd0b74Schristos  fi
283875fd0b74Schristosfi
283975fd0b74Schristos])# _LT_PATH_MAGIC
284075fd0b74Schristos
284175fd0b74Schristos
284275fd0b74Schristos# LT_PATH_LD
284375fd0b74Schristos# ----------
284475fd0b74Schristos# find the pathname to the GNU or non-GNU linker
284575fd0b74SchristosAC_DEFUN([LT_PATH_LD],
284675fd0b74Schristos[AC_REQUIRE([AC_PROG_CC])dnl
284775fd0b74SchristosAC_REQUIRE([AC_CANONICAL_HOST])dnl
284875fd0b74SchristosAC_REQUIRE([AC_CANONICAL_BUILD])dnl
284975fd0b74Schristosm4_require([_LT_DECL_SED])dnl
285075fd0b74Schristosm4_require([_LT_DECL_EGREP])dnl
285175fd0b74Schristosm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
285275fd0b74Schristos
285375fd0b74SchristosAC_ARG_WITH([gnu-ld],
285475fd0b74Schristos    [AS_HELP_STRING([--with-gnu-ld],
285575fd0b74Schristos	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
285675fd0b74Schristos    [test "$withval" = no || with_gnu_ld=yes],
285775fd0b74Schristos    [with_gnu_ld=no])dnl
285875fd0b74Schristos
285975fd0b74Schristosac_prog=ld
286075fd0b74Schristosif test "$GCC" = yes; then
286175fd0b74Schristos  # Check if gcc -print-prog-name=ld gives a path.
286275fd0b74Schristos  AC_MSG_CHECKING([for ld used by $CC])
286375fd0b74Schristos  case $host in
286475fd0b74Schristos  *-*-mingw*)
286575fd0b74Schristos    # gcc leaves a trailing carriage return which upsets mingw
286675fd0b74Schristos    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
286775fd0b74Schristos  *)
286875fd0b74Schristos    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
286975fd0b74Schristos  esac
287075fd0b74Schristos  case $ac_prog in
287175fd0b74Schristos    # Accept absolute paths.
287275fd0b74Schristos    [[\\/]]* | ?:[[\\/]]*)
287375fd0b74Schristos      re_direlt='/[[^/]][[^/]]*/\.\./'
287475fd0b74Schristos      # Canonicalize the pathname of ld
287575fd0b74Schristos      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
287675fd0b74Schristos      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
287775fd0b74Schristos	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
287875fd0b74Schristos      done
287975fd0b74Schristos      test -z "$LD" && LD="$ac_prog"
288075fd0b74Schristos      ;;
288175fd0b74Schristos  "")
288275fd0b74Schristos    # If it fails, then pretend we aren't using GCC.
288375fd0b74Schristos    ac_prog=ld
288475fd0b74Schristos    ;;
288575fd0b74Schristos  *)
288675fd0b74Schristos    # If it is relative, then search for the first ld in PATH.
288775fd0b74Schristos    with_gnu_ld=unknown
288875fd0b74Schristos    ;;
288975fd0b74Schristos  esac
289075fd0b74Schristoselif test "$with_gnu_ld" = yes; then
289175fd0b74Schristos  AC_MSG_CHECKING([for GNU ld])
289275fd0b74Schristoselse
289375fd0b74Schristos  AC_MSG_CHECKING([for non-GNU ld])
289475fd0b74Schristosfi
289575fd0b74SchristosAC_CACHE_VAL(lt_cv_path_LD,
289675fd0b74Schristos[if test -z "$LD"; then
289775fd0b74Schristos  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
289875fd0b74Schristos  for ac_dir in $PATH; do
289975fd0b74Schristos    IFS="$lt_save_ifs"
290075fd0b74Schristos    test -z "$ac_dir" && ac_dir=.
290175fd0b74Schristos    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
290275fd0b74Schristos      lt_cv_path_LD="$ac_dir/$ac_prog"
290375fd0b74Schristos      # Check to see if the program is GNU ld.  I'd rather use --version,
290475fd0b74Schristos      # but apparently some variants of GNU ld only accept -v.
290575fd0b74Schristos      # Break only if it was the GNU/non-GNU ld that we prefer.
290675fd0b74Schristos      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
290775fd0b74Schristos      *GNU* | *'with BFD'*)
290875fd0b74Schristos	test "$with_gnu_ld" != no && break
290975fd0b74Schristos	;;
291075fd0b74Schristos      *)
291175fd0b74Schristos	test "$with_gnu_ld" != yes && break
291275fd0b74Schristos	;;
291375fd0b74Schristos      esac
291475fd0b74Schristos    fi
291575fd0b74Schristos  done
291675fd0b74Schristos  IFS="$lt_save_ifs"
291775fd0b74Schristoselse
291875fd0b74Schristos  lt_cv_path_LD="$LD" # Let the user override the test with a path.
291975fd0b74Schristosfi])
292075fd0b74SchristosLD="$lt_cv_path_LD"
292175fd0b74Schristosif test -n "$LD"; then
292275fd0b74Schristos  AC_MSG_RESULT($LD)
292375fd0b74Schristoselse
292475fd0b74Schristos  AC_MSG_RESULT(no)
292575fd0b74Schristosfi
292675fd0b74Schristostest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
292775fd0b74Schristos_LT_PATH_LD_GNU
292875fd0b74SchristosAC_SUBST([LD])
292975fd0b74Schristos
293075fd0b74Schristos_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
293175fd0b74Schristos])# LT_PATH_LD
293275fd0b74Schristos
293375fd0b74Schristos# Old names:
293475fd0b74SchristosAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
293575fd0b74SchristosAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
293675fd0b74Schristosdnl aclocal-1.4 backwards compatibility:
293775fd0b74Schristosdnl AC_DEFUN([AM_PROG_LD], [])
293875fd0b74Schristosdnl AC_DEFUN([AC_PROG_LD], [])
293975fd0b74Schristos
294075fd0b74Schristos
294175fd0b74Schristos# _LT_PATH_LD_GNU
294275fd0b74Schristos#- --------------
294375fd0b74Schristosm4_defun([_LT_PATH_LD_GNU],
294475fd0b74Schristos[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
294575fd0b74Schristos[# I'd rather use --version here, but apparently some GNU lds only accept -v.
294675fd0b74Schristoscase `$LD -v 2>&1 </dev/null` in
294775fd0b74Schristos*GNU* | *'with BFD'*)
294875fd0b74Schristos  lt_cv_prog_gnu_ld=yes
294975fd0b74Schristos  ;;
295075fd0b74Schristos*)
295175fd0b74Schristos  lt_cv_prog_gnu_ld=no
295275fd0b74Schristos  ;;
295375fd0b74Schristosesac])
295475fd0b74Schristoswith_gnu_ld=$lt_cv_prog_gnu_ld
295575fd0b74Schristos])# _LT_PATH_LD_GNU
295675fd0b74Schristos
295775fd0b74Schristos
295875fd0b74Schristos# _LT_CMD_RELOAD
295975fd0b74Schristos# --------------
296075fd0b74Schristos# find reload flag for linker
296175fd0b74Schristos#   -- PORTME Some linkers may need a different reload flag.
296275fd0b74Schristosm4_defun([_LT_CMD_RELOAD],
296375fd0b74Schristos[AC_CACHE_CHECK([for $LD option to reload object files],
296475fd0b74Schristos  lt_cv_ld_reload_flag,
296575fd0b74Schristos  [lt_cv_ld_reload_flag='-r'])
296675fd0b74Schristosreload_flag=$lt_cv_ld_reload_flag
296775fd0b74Schristoscase $reload_flag in
296875fd0b74Schristos"" | " "*) ;;
296975fd0b74Schristos*) reload_flag=" $reload_flag" ;;
297075fd0b74Schristosesac
297175fd0b74Schristosreload_cmds='$LD$reload_flag -o $output$reload_objs'
297275fd0b74Schristoscase $host_os in
297375fd0b74Schristos  darwin*)
297475fd0b74Schristos    if test "$GCC" = yes; then
297575fd0b74Schristos      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
297675fd0b74Schristos    else
297775fd0b74Schristos      reload_cmds='$LD$reload_flag -o $output$reload_objs'
297875fd0b74Schristos    fi
297975fd0b74Schristos    ;;
298075fd0b74Schristosesac
298175fd0b74Schristos_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
298275fd0b74Schristos_LT_TAGDECL([], [reload_cmds], [2])dnl
298375fd0b74Schristos])# _LT_CMD_RELOAD
298475fd0b74Schristos
298575fd0b74Schristos
298675fd0b74Schristos# _LT_CHECK_MAGIC_METHOD
298775fd0b74Schristos# ----------------------
298875fd0b74Schristos# how to check for library dependencies
298975fd0b74Schristos#  -- PORTME fill in with the dynamic library characteristics
299075fd0b74Schristosm4_defun([_LT_CHECK_MAGIC_METHOD],
299175fd0b74Schristos[m4_require([_LT_DECL_EGREP])
299275fd0b74Schristosm4_require([_LT_DECL_OBJDUMP])
299375fd0b74SchristosAC_CACHE_CHECK([how to recognize dependent libraries],
299475fd0b74Schristoslt_cv_deplibs_check_method,
299575fd0b74Schristos[lt_cv_file_magic_cmd='$MAGIC_CMD'
299675fd0b74Schristoslt_cv_file_magic_test_file=
299775fd0b74Schristoslt_cv_deplibs_check_method='unknown'
299875fd0b74Schristos# Need to set the preceding variable on all platforms that support
299975fd0b74Schristos# interlibrary dependencies.
300075fd0b74Schristos# 'none' -- dependencies not supported.
300175fd0b74Schristos# `unknown' -- same as none, but documents that we really don't know.
300275fd0b74Schristos# 'pass_all' -- all dependencies passed with no checks.
300375fd0b74Schristos# 'test_compile' -- check by making test program.
300475fd0b74Schristos# 'file_magic [[regex]]' -- check by looking for files in library path
300575fd0b74Schristos# which responds to the $file_magic_cmd with a given extended regex.
300675fd0b74Schristos# If you have `file' or equivalent on your system and you're not sure
300775fd0b74Schristos# whether `pass_all' will *always* work, you probably want this one.
300875fd0b74Schristos
300975fd0b74Schristoscase $host_os in
301075fd0b74Schristosaix[[4-9]]*)
301175fd0b74Schristos  lt_cv_deplibs_check_method=pass_all
301275fd0b74Schristos  ;;
301375fd0b74Schristos
301475fd0b74Schristosbeos*)
301575fd0b74Schristos  lt_cv_deplibs_check_method=pass_all
301675fd0b74Schristos  ;;
301775fd0b74Schristos
301875fd0b74Schristosbsdi[[45]]*)
301975fd0b74Schristos  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
302075fd0b74Schristos  lt_cv_file_magic_cmd='/usr/bin/file -L'
302175fd0b74Schristos  lt_cv_file_magic_test_file=/shlib/libc.so
302275fd0b74Schristos  ;;
302375fd0b74Schristos
302475fd0b74Schristoscygwin*)
302575fd0b74Schristos  # func_win32_libid is a shell function defined in ltmain.sh
302675fd0b74Schristos  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
302775fd0b74Schristos  lt_cv_file_magic_cmd='func_win32_libid'
302875fd0b74Schristos  ;;
302975fd0b74Schristos
303075fd0b74Schristosmingw* | pw32*)
303175fd0b74Schristos  # Base MSYS/MinGW do not provide the 'file' command needed by
303275fd0b74Schristos  # func_win32_libid shell function, so use a weaker test based on 'objdump',
303375fd0b74Schristos  # unless we find 'file', for example because we are cross-compiling.
303475fd0b74Schristos  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
303575fd0b74Schristos  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
303675fd0b74Schristos    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
303775fd0b74Schristos    lt_cv_file_magic_cmd='func_win32_libid'
303875fd0b74Schristos  else
303975fd0b74Schristos    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
304075fd0b74Schristos    lt_cv_file_magic_cmd='$OBJDUMP -f'
304175fd0b74Schristos  fi
304275fd0b74Schristos  ;;
304375fd0b74Schristos
304475fd0b74Schristoscegcc*)
304575fd0b74Schristos  # use the weaker test based on 'objdump'. See mingw*.
304675fd0b74Schristos  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
304775fd0b74Schristos  lt_cv_file_magic_cmd='$OBJDUMP -f'
304875fd0b74Schristos  ;;
304975fd0b74Schristos
305075fd0b74Schristosdarwin* | rhapsody*)
305175fd0b74Schristos  lt_cv_deplibs_check_method=pass_all
305275fd0b74Schristos  ;;
305375fd0b74Schristos
305475fd0b74Schristosfreebsd* | dragonfly*)
305575fd0b74Schristos  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
305675fd0b74Schristos    case $host_cpu in
305775fd0b74Schristos    i*86 )
305875fd0b74Schristos      # Not sure whether the presence of OpenBSD here was a mistake.
305975fd0b74Schristos      # Let's accept both of them until this is cleared up.
306075fd0b74Schristos      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
306175fd0b74Schristos      lt_cv_file_magic_cmd=/usr/bin/file
306275fd0b74Schristos      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
306375fd0b74Schristos      ;;
306475fd0b74Schristos    esac
306575fd0b74Schristos  else
306675fd0b74Schristos    lt_cv_deplibs_check_method=pass_all
306775fd0b74Schristos  fi
306875fd0b74Schristos  ;;
306975fd0b74Schristos
307075fd0b74Schristosgnu*)
307175fd0b74Schristos  lt_cv_deplibs_check_method=pass_all
307275fd0b74Schristos  ;;
307375fd0b74Schristos
307475fd0b74Schristoshaiku*)
307575fd0b74Schristos  lt_cv_deplibs_check_method=pass_all
307675fd0b74Schristos  ;;
307775fd0b74Schristos
307875fd0b74Schristoshpux10.20* | hpux11*)
307975fd0b74Schristos  lt_cv_file_magic_cmd=/usr/bin/file
308075fd0b74Schristos  case $host_cpu in
308175fd0b74Schristos  ia64*)
308275fd0b74Schristos    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
308375fd0b74Schristos    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
308475fd0b74Schristos    ;;
308575fd0b74Schristos  hppa*64*)
308675fd0b74Schristos    [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]']
308775fd0b74Schristos    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
308875fd0b74Schristos    ;;
308975fd0b74Schristos  *)
309075fd0b74Schristos    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
309175fd0b74Schristos    lt_cv_file_magic_test_file=/usr/lib/libc.sl
309275fd0b74Schristos    ;;
309375fd0b74Schristos  esac
309475fd0b74Schristos  ;;
309575fd0b74Schristos
309675fd0b74Schristosinterix[[3-9]]*)
309775fd0b74Schristos  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
309875fd0b74Schristos  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
309975fd0b74Schristos  ;;
310075fd0b74Schristos
310175fd0b74Schristosirix5* | irix6* | nonstopux*)
310275fd0b74Schristos  case $LD in
310375fd0b74Schristos  *-32|*"-32 ") libmagic=32-bit;;
310475fd0b74Schristos  *-n32|*"-n32 ") libmagic=N32;;
310575fd0b74Schristos  *-64|*"-64 ") libmagic=64-bit;;
310675fd0b74Schristos  *) libmagic=never-match;;
310775fd0b74Schristos  esac
310875fd0b74Schristos  lt_cv_deplibs_check_method=pass_all
310975fd0b74Schristos  ;;
311075fd0b74Schristos
311175fd0b74Schristos# This must be Linux ELF.
311275fd0b74Schristoslinux* | k*bsd*-gnu | kopensolaris*-gnu)
311375fd0b74Schristos  lt_cv_deplibs_check_method=pass_all
311475fd0b74Schristos  ;;
311575fd0b74Schristos
311675fd0b74Schristosnetbsd*)
311775fd0b74Schristos  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
311875fd0b74Schristos    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
311975fd0b74Schristos  else
312075fd0b74Schristos    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
312175fd0b74Schristos  fi
312275fd0b74Schristos  ;;
312375fd0b74Schristos
312475fd0b74Schristosnewos6*)
312575fd0b74Schristos  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
312675fd0b74Schristos  lt_cv_file_magic_cmd=/usr/bin/file
312775fd0b74Schristos  lt_cv_file_magic_test_file=/usr/lib/libnls.so
312875fd0b74Schristos  ;;
312975fd0b74Schristos
313075fd0b74Schristos*nto* | *qnx*)
313175fd0b74Schristos  lt_cv_deplibs_check_method=pass_all
313275fd0b74Schristos  ;;
313375fd0b74Schristos
313475fd0b74Schristosopenbsd*)
313575fd0b74Schristos  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
313675fd0b74Schristos    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
313775fd0b74Schristos  else
313875fd0b74Schristos    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
313975fd0b74Schristos  fi
314075fd0b74Schristos  ;;
314175fd0b74Schristos
314275fd0b74Schristososf3* | osf4* | osf5*)
314375fd0b74Schristos  lt_cv_deplibs_check_method=pass_all
314475fd0b74Schristos  ;;
314575fd0b74Schristos
314675fd0b74Schristosrdos*)
314775fd0b74Schristos  lt_cv_deplibs_check_method=pass_all
314875fd0b74Schristos  ;;
314975fd0b74Schristos
315075fd0b74Schristossolaris*)
315175fd0b74Schristos  lt_cv_deplibs_check_method=pass_all
315275fd0b74Schristos  ;;
315375fd0b74Schristos
315475fd0b74Schristossysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
315575fd0b74Schristos  lt_cv_deplibs_check_method=pass_all
315675fd0b74Schristos  ;;
315775fd0b74Schristos
315875fd0b74Schristossysv4 | sysv4.3*)
315975fd0b74Schristos  case $host_vendor in
316075fd0b74Schristos  motorola)
316175fd0b74Schristos    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]]'
316275fd0b74Schristos    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
316375fd0b74Schristos    ;;
316475fd0b74Schristos  ncr)
316575fd0b74Schristos    lt_cv_deplibs_check_method=pass_all
316675fd0b74Schristos    ;;
316775fd0b74Schristos  sequent)
316875fd0b74Schristos    lt_cv_file_magic_cmd='/bin/file'
316975fd0b74Schristos    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
317075fd0b74Schristos    ;;
317175fd0b74Schristos  sni)
317275fd0b74Schristos    lt_cv_file_magic_cmd='/bin/file'
317375fd0b74Schristos    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
317475fd0b74Schristos    lt_cv_file_magic_test_file=/lib/libc.so
317575fd0b74Schristos    ;;
317675fd0b74Schristos  siemens)
317775fd0b74Schristos    lt_cv_deplibs_check_method=pass_all
317875fd0b74Schristos    ;;
317975fd0b74Schristos  pc)
318075fd0b74Schristos    lt_cv_deplibs_check_method=pass_all
318175fd0b74Schristos    ;;
318275fd0b74Schristos  esac
318375fd0b74Schristos  ;;
318475fd0b74Schristos
318575fd0b74Schristostpf*)
318675fd0b74Schristos  lt_cv_deplibs_check_method=pass_all
318775fd0b74Schristos  ;;
318875fd0b74Schristosesac
318975fd0b74Schristos])
319075fd0b74Schristosfile_magic_cmd=$lt_cv_file_magic_cmd
319175fd0b74Schristosdeplibs_check_method=$lt_cv_deplibs_check_method
319275fd0b74Schristostest -z "$deplibs_check_method" && deplibs_check_method=unknown
319375fd0b74Schristos
319475fd0b74Schristos_LT_DECL([], [deplibs_check_method], [1],
319575fd0b74Schristos    [Method to check whether dependent libraries are shared objects])
319675fd0b74Schristos_LT_DECL([], [file_magic_cmd], [1],
319775fd0b74Schristos    [Command to use when deplibs_check_method == "file_magic"])
319875fd0b74Schristos])# _LT_CHECK_MAGIC_METHOD
319975fd0b74Schristos
320075fd0b74Schristos
320175fd0b74Schristos# LT_PATH_NM
320275fd0b74Schristos# ----------
3203*e992f068Schristos# find the pathname to a BSD- or MS-compatible name lister, and any flags
3204*e992f068Schristos# needed to make it compatible
320575fd0b74SchristosAC_DEFUN([LT_PATH_NM],
320675fd0b74Schristos[AC_REQUIRE([AC_PROG_CC])dnl
320775fd0b74SchristosAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
320875fd0b74Schristos[if test -n "$NM"; then
3209*e992f068Schristos   # Let the user override the nm to test.
3210*e992f068Schristos   lt_nm_to_check="$NM"
321175fd0b74Schristos else
321275fd0b74Schristos   lt_nm_to_check="${ac_tool_prefix}nm"
321375fd0b74Schristos   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
321475fd0b74Schristos     lt_nm_to_check="$lt_nm_to_check nm"
321575fd0b74Schristos   fi
3216*e992f068Schristos fi
3217*e992f068Schristos for lt_tmp_nm in "$lt_nm_to_check"; do
321875fd0b74Schristos   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
321975fd0b74Schristos   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
322075fd0b74Schristos     IFS="$lt_save_ifs"
322175fd0b74Schristos     test -z "$ac_dir" && ac_dir=.
3222*e992f068Schristos     # Strip out any user-provided options from the nm to test twice,
3223*e992f068Schristos     # the first time to test to see if nm (rather than its options) has
3224*e992f068Schristos     # an explicit path, the second time to yield a file which can be
3225*e992f068Schristos     # nm'ed itself.
3226*e992f068Schristos     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
3227*e992f068Schristos     case "$tmp_nm_path" in
3228*e992f068Schristos     */*|*\\*) tmp_nm="$lt_tmp_nm";;
3229*e992f068Schristos     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
3230*e992f068Schristos     esac
3231*e992f068Schristos     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
3232*e992f068Schristos     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
323375fd0b74Schristos       # Check to see if the nm accepts a BSD-compat flag.
323475fd0b74Schristos       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
323575fd0b74Schristos       #   nm: unknown option "B" ignored
3236*e992f068Schristos       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
3237*e992f068Schristos       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
323875fd0b74Schristos	 break
323975fd0b74Schristos	 ;;
324075fd0b74Schristos       *)
3241*e992f068Schristos	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
3242*e992f068Schristos	 *$tmp_nm*)
324375fd0b74Schristos	   lt_cv_path_NM="$tmp_nm -p"
324475fd0b74Schristos	   break
324575fd0b74Schristos	   ;;
324675fd0b74Schristos	 *)
324775fd0b74Schristos	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
324875fd0b74Schristos	   continue # so that we can try to find one that supports BSD flags
324975fd0b74Schristos	   ;;
325075fd0b74Schristos	 esac
325175fd0b74Schristos	 ;;
325275fd0b74Schristos       esac
325375fd0b74Schristos     fi
325475fd0b74Schristos   done
325575fd0b74Schristos   IFS="$lt_save_ifs"
325675fd0b74Schristos done
3257*e992f068Schristos : ${lt_cv_path_NM=no}])
325875fd0b74Schristosif test "$lt_cv_path_NM" != "no"; then
325975fd0b74Schristos  NM="$lt_cv_path_NM"
326075fd0b74Schristoselse
326175fd0b74Schristos  # Didn't find any BSD compatible name lister, look for dumpbin.
326275fd0b74Schristos  if test -n "$DUMPBIN"; then :
326375fd0b74Schristos    # Let the user override the test.
326475fd0b74Schristos  else
326575fd0b74Schristos    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
326675fd0b74Schristos    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
326775fd0b74Schristos    *COFF*)
326875fd0b74Schristos      DUMPBIN="$DUMPBIN -symbols"
326975fd0b74Schristos      ;;
327075fd0b74Schristos    *)
327175fd0b74Schristos      DUMPBIN=:
327275fd0b74Schristos      ;;
327375fd0b74Schristos    esac
327475fd0b74Schristos  fi
327575fd0b74Schristos  AC_SUBST([DUMPBIN])
327675fd0b74Schristos  if test "$DUMPBIN" != ":"; then
327775fd0b74Schristos    NM="$DUMPBIN"
327875fd0b74Schristos  fi
327975fd0b74Schristosfi
328075fd0b74Schristostest -z "$NM" && NM=nm
328175fd0b74SchristosAC_SUBST([NM])
328275fd0b74Schristos_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
328375fd0b74Schristos
328475fd0b74SchristosAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
328575fd0b74Schristos  [lt_cv_nm_interface="BSD nm"
328675fd0b74Schristos  echo "int some_variable = 0;" > conftest.$ac_ext
328775fd0b74Schristos  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
328875fd0b74Schristos  (eval "$ac_compile" 2>conftest.err)
328975fd0b74Schristos  cat conftest.err >&AS_MESSAGE_LOG_FD
329075fd0b74Schristos  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
329175fd0b74Schristos  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
329275fd0b74Schristos  cat conftest.err >&AS_MESSAGE_LOG_FD
329375fd0b74Schristos  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
329475fd0b74Schristos  cat conftest.out >&AS_MESSAGE_LOG_FD
329575fd0b74Schristos  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
329675fd0b74Schristos    lt_cv_nm_interface="MS dumpbin"
329775fd0b74Schristos  fi
329875fd0b74Schristos  rm -f conftest*])
329975fd0b74Schristos])# LT_PATH_NM
330075fd0b74Schristos
330175fd0b74Schristos# Old names:
330275fd0b74SchristosAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
330375fd0b74SchristosAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
330475fd0b74Schristosdnl aclocal-1.4 backwards compatibility:
330575fd0b74Schristosdnl AC_DEFUN([AM_PROG_NM], [])
330675fd0b74Schristosdnl AC_DEFUN([AC_PROG_NM], [])
330775fd0b74Schristos
330875fd0b74Schristos
330975fd0b74Schristos# LT_LIB_M
331075fd0b74Schristos# --------
331175fd0b74Schristos# check for math library
331275fd0b74SchristosAC_DEFUN([LT_LIB_M],
331375fd0b74Schristos[AC_REQUIRE([AC_CANONICAL_HOST])dnl
331475fd0b74SchristosLIBM=
331575fd0b74Schristoscase $host in
331675fd0b74Schristos*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
331775fd0b74Schristos  # These system don't have libm, or don't need it
331875fd0b74Schristos  ;;
331975fd0b74Schristos*-ncr-sysv4.3*)
332075fd0b74Schristos  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
332175fd0b74Schristos  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
332275fd0b74Schristos  ;;
332375fd0b74Schristos*)
332475fd0b74Schristos  AC_CHECK_LIB(m, cos, LIBM="-lm")
332575fd0b74Schristos  ;;
332675fd0b74Schristosesac
332775fd0b74SchristosAC_SUBST([LIBM])
332875fd0b74Schristos])# LT_LIB_M
332975fd0b74Schristos
333075fd0b74Schristos# Old name:
333175fd0b74SchristosAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
333275fd0b74Schristosdnl aclocal-1.4 backwards compatibility:
333375fd0b74Schristosdnl AC_DEFUN([AC_CHECK_LIBM], [])
333475fd0b74Schristos
333575fd0b74Schristos
333675fd0b74Schristos# _LT_COMPILER_NO_RTTI([TAGNAME])
333775fd0b74Schristos# -------------------------------
333875fd0b74Schristosm4_defun([_LT_COMPILER_NO_RTTI],
333975fd0b74Schristos[m4_require([_LT_TAG_COMPILER])dnl
334075fd0b74Schristos
334175fd0b74Schristos_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
334275fd0b74Schristos
334375fd0b74Schristosif test "$GCC" = yes; then
334475fd0b74Schristos  case $cc_basename in
334575fd0b74Schristos  nvcc*)
334675fd0b74Schristos    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
334775fd0b74Schristos  *)
334875fd0b74Schristos    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
334975fd0b74Schristos  esac
335075fd0b74Schristos
335175fd0b74Schristos  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
335275fd0b74Schristos    lt_cv_prog_compiler_rtti_exceptions,
335375fd0b74Schristos    [-fno-rtti -fno-exceptions], [],
335475fd0b74Schristos    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
335575fd0b74Schristosfi
335675fd0b74Schristos_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
335775fd0b74Schristos	[Compiler flag to turn off builtin functions])
335875fd0b74Schristos])# _LT_COMPILER_NO_RTTI
335975fd0b74Schristos
336075fd0b74Schristos
336175fd0b74Schristos# _LT_CMD_GLOBAL_SYMBOLS
336275fd0b74Schristos# ----------------------
336375fd0b74Schristosm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
336475fd0b74Schristos[AC_REQUIRE([AC_CANONICAL_HOST])dnl
336575fd0b74SchristosAC_REQUIRE([AC_PROG_CC])dnl
336675fd0b74SchristosAC_REQUIRE([AC_PROG_AWK])dnl
336775fd0b74SchristosAC_REQUIRE([LT_PATH_NM])dnl
336875fd0b74SchristosAC_REQUIRE([LT_PATH_LD])dnl
336975fd0b74Schristosm4_require([_LT_DECL_SED])dnl
337075fd0b74Schristosm4_require([_LT_DECL_EGREP])dnl
337175fd0b74Schristosm4_require([_LT_TAG_COMPILER])dnl
337275fd0b74Schristos
337375fd0b74Schristos# Check for command to grab the raw symbol name followed by C symbol from nm.
337475fd0b74SchristosAC_MSG_CHECKING([command to parse $NM output from $compiler object])
337575fd0b74SchristosAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
337675fd0b74Schristos[
337775fd0b74Schristos# These are sane defaults that work on at least a few old systems.
337875fd0b74Schristos# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
337975fd0b74Schristos
338075fd0b74Schristos# Character class describing NM global symbol codes.
338175fd0b74Schristossymcode='[[BCDEGRST]]'
338275fd0b74Schristos
338375fd0b74Schristos# Regexp to match symbols that can be accessed directly from C.
338475fd0b74Schristossympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
338575fd0b74Schristos
338675fd0b74Schristos# Define system-specific variables.
338775fd0b74Schristoscase $host_os in
338875fd0b74Schristosaix*)
338975fd0b74Schristos  symcode='[[BCDT]]'
339075fd0b74Schristos  ;;
339175fd0b74Schristoscygwin* | mingw* | pw32* | cegcc*)
339275fd0b74Schristos  symcode='[[ABCDGISTW]]'
339375fd0b74Schristos  ;;
339475fd0b74Schristoshpux*)
339575fd0b74Schristos  if test "$host_cpu" = ia64; then
339675fd0b74Schristos    symcode='[[ABCDEGRST]]'
339775fd0b74Schristos  fi
339875fd0b74Schristos  ;;
339975fd0b74Schristosirix* | nonstopux*)
340075fd0b74Schristos  symcode='[[BCDEGRST]]'
340175fd0b74Schristos  ;;
340275fd0b74Schristososf*)
340375fd0b74Schristos  symcode='[[BCDEGQRST]]'
340475fd0b74Schristos  ;;
340575fd0b74Schristossolaris*)
3406*e992f068Schristos  symcode='[[BCDRT]]'
340775fd0b74Schristos  ;;
340875fd0b74Schristossco3.2v5*)
340975fd0b74Schristos  symcode='[[DT]]'
341075fd0b74Schristos  ;;
341175fd0b74Schristossysv4.2uw2*)
341275fd0b74Schristos  symcode='[[DT]]'
341375fd0b74Schristos  ;;
341475fd0b74Schristossysv5* | sco5v6* | unixware* | OpenUNIX*)
341575fd0b74Schristos  symcode='[[ABDT]]'
341675fd0b74Schristos  ;;
341775fd0b74Schristossysv4)
341875fd0b74Schristos  symcode='[[DFNSTU]]'
341975fd0b74Schristos  ;;
342075fd0b74Schristosesac
342175fd0b74Schristos
342275fd0b74Schristos# If we're using GNU nm, then use its standard symbol codes.
342375fd0b74Schristoscase `$NM -V 2>&1` in
342475fd0b74Schristos*GNU* | *'with BFD'*)
342575fd0b74Schristos  symcode='[[ABCDGIRSTW]]' ;;
342675fd0b74Schristosesac
342775fd0b74Schristos
342875fd0b74Schristos# Transform an extracted symbol line into a proper C declaration.
342975fd0b74Schristos# Some systems (esp. on ia64) link data and code symbols differently,
343075fd0b74Schristos# so use this general approach.
343175fd0b74Schristoslt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
343275fd0b74Schristos
343375fd0b74Schristos# Transform an extracted symbol line into symbol name and symbol address
343475fd0b74Schristoslt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
343575fd0b74Schristoslt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
343675fd0b74Schristos
343775fd0b74Schristos# Handle CRLF in mingw tool chain
343875fd0b74Schristosopt_cr=
343975fd0b74Schristoscase $build_os in
344075fd0b74Schristosmingw*)
344175fd0b74Schristos  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
344275fd0b74Schristos  ;;
344375fd0b74Schristosesac
344475fd0b74Schristos
344575fd0b74Schristos# Try without a prefix underscore, then with it.
344675fd0b74Schristosfor ac_symprfx in "" "_"; do
344775fd0b74Schristos
344875fd0b74Schristos  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
344975fd0b74Schristos  symxfrm="\\1 $ac_symprfx\\2 \\2"
345075fd0b74Schristos
345175fd0b74Schristos  # Write the raw and C identifiers.
345275fd0b74Schristos  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
345375fd0b74Schristos    # Fake it for dumpbin and say T for any non-static function
345475fd0b74Schristos    # and D for any global variable.
345575fd0b74Schristos    # Also find C++ and __fastcall symbols from MSVC++,
345675fd0b74Schristos    # which start with @ or ?.
345775fd0b74Schristos    lt_cv_sys_global_symbol_pipe="$AWK ['"\
345875fd0b74Schristos"     {last_section=section; section=\$ 3};"\
345975fd0b74Schristos"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
346075fd0b74Schristos"     \$ 0!~/External *\|/{next};"\
346175fd0b74Schristos"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
346275fd0b74Schristos"     {if(hide[section]) next};"\
346375fd0b74Schristos"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
346475fd0b74Schristos"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
346575fd0b74Schristos"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
346675fd0b74Schristos"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
346775fd0b74Schristos"     ' prfx=^$ac_symprfx]"
346875fd0b74Schristos  else
346975fd0b74Schristos    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
347075fd0b74Schristos  fi
347175fd0b74Schristos
347275fd0b74Schristos  # Check to see that the pipe works correctly.
347375fd0b74Schristos  pipe_works=no
347475fd0b74Schristos
347575fd0b74Schristos  rm -f conftest*
347675fd0b74Schristos  cat > conftest.$ac_ext <<_LT_EOF
347775fd0b74Schristos#ifdef __cplusplus
347875fd0b74Schristosextern "C" {
347975fd0b74Schristos#endif
348075fd0b74Schristoschar nm_test_var;
348175fd0b74Schristosvoid nm_test_func(void);
348275fd0b74Schristosvoid nm_test_func(void){}
348375fd0b74Schristos#ifdef __cplusplus
348475fd0b74Schristos}
348575fd0b74Schristos#endif
348675fd0b74Schristosint main(){nm_test_var='a';nm_test_func();return(0);}
348775fd0b74Schristos_LT_EOF
348875fd0b74Schristos
348975fd0b74Schristos  if AC_TRY_EVAL(ac_compile); then
349075fd0b74Schristos    # Now try to grab the symbols.
349175fd0b74Schristos    nlist=conftest.nm
349275fd0b74Schristos    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
349375fd0b74Schristos      # Try sorting and uniquifying the output.
349475fd0b74Schristos      if sort "$nlist" | uniq > "$nlist"T; then
349575fd0b74Schristos	mv -f "$nlist"T "$nlist"
349675fd0b74Schristos      else
349775fd0b74Schristos	rm -f "$nlist"T
349875fd0b74Schristos      fi
349975fd0b74Schristos
350075fd0b74Schristos      # Make sure that we snagged all the symbols we need.
350175fd0b74Schristos      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
350275fd0b74Schristos	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
350375fd0b74Schristos	  cat <<_LT_EOF > conftest.$ac_ext
350475fd0b74Schristos#ifdef __cplusplus
350575fd0b74Schristosextern "C" {
350675fd0b74Schristos#endif
350775fd0b74Schristos
350875fd0b74Schristos_LT_EOF
350975fd0b74Schristos	  # Now generate the symbol file.
351075fd0b74Schristos	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
351175fd0b74Schristos
351275fd0b74Schristos	  cat <<_LT_EOF >> conftest.$ac_ext
351375fd0b74Schristos
351475fd0b74Schristos/* The mapping between symbol names and symbols.  */
351575fd0b74Schristosconst struct {
351675fd0b74Schristos  const char *name;
351775fd0b74Schristos  void       *address;
351875fd0b74Schristos}
351975fd0b74Schristoslt__PROGRAM__LTX_preloaded_symbols[[]] =
352075fd0b74Schristos{
352175fd0b74Schristos  { "@PROGRAM@", (void *) 0 },
352275fd0b74Schristos_LT_EOF
352375fd0b74Schristos	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
352475fd0b74Schristos	  cat <<\_LT_EOF >> conftest.$ac_ext
352575fd0b74Schristos  {0, (void *) 0}
352675fd0b74Schristos};
352775fd0b74Schristos
352875fd0b74Schristos/* This works around a problem in FreeBSD linker */
352975fd0b74Schristos#ifdef FREEBSD_WORKAROUND
353075fd0b74Schristosstatic const void *lt_preloaded_setup() {
353175fd0b74Schristos  return lt__PROGRAM__LTX_preloaded_symbols;
353275fd0b74Schristos}
353375fd0b74Schristos#endif
353475fd0b74Schristos
353575fd0b74Schristos#ifdef __cplusplus
353675fd0b74Schristos}
353775fd0b74Schristos#endif
353875fd0b74Schristos_LT_EOF
353975fd0b74Schristos	  # Now try linking the two files.
354075fd0b74Schristos	  mv conftest.$ac_objext conftstm.$ac_objext
354175fd0b74Schristos	  lt_save_LIBS="$LIBS"
354275fd0b74Schristos	  lt_save_CFLAGS="$CFLAGS"
354375fd0b74Schristos	  LIBS="conftstm.$ac_objext"
354475fd0b74Schristos	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
354575fd0b74Schristos	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
354675fd0b74Schristos	    pipe_works=yes
354775fd0b74Schristos	  fi
354875fd0b74Schristos	  LIBS="$lt_save_LIBS"
354975fd0b74Schristos	  CFLAGS="$lt_save_CFLAGS"
355075fd0b74Schristos	else
355175fd0b74Schristos	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
355275fd0b74Schristos	fi
355375fd0b74Schristos      else
355475fd0b74Schristos	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
355575fd0b74Schristos      fi
355675fd0b74Schristos    else
355775fd0b74Schristos      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
355875fd0b74Schristos    fi
355975fd0b74Schristos  else
356075fd0b74Schristos    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
356175fd0b74Schristos    cat conftest.$ac_ext >&5
356275fd0b74Schristos  fi
356375fd0b74Schristos  rm -rf conftest* conftst*
356475fd0b74Schristos
356575fd0b74Schristos  # Do not use the global_symbol_pipe unless it works.
356675fd0b74Schristos  if test "$pipe_works" = yes; then
356775fd0b74Schristos    break
356875fd0b74Schristos  else
356975fd0b74Schristos    lt_cv_sys_global_symbol_pipe=
357075fd0b74Schristos  fi
357175fd0b74Schristosdone
357275fd0b74Schristos])
357375fd0b74Schristosif test -z "$lt_cv_sys_global_symbol_pipe"; then
357475fd0b74Schristos  lt_cv_sys_global_symbol_to_cdecl=
357575fd0b74Schristosfi
357675fd0b74Schristosif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
357775fd0b74Schristos  AC_MSG_RESULT(failed)
357875fd0b74Schristoselse
357975fd0b74Schristos  AC_MSG_RESULT(ok)
358075fd0b74Schristosfi
358175fd0b74Schristos
358275fd0b74Schristos_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
358375fd0b74Schristos    [Take the output of nm and produce a listing of raw symbols and C names])
358475fd0b74Schristos_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
358575fd0b74Schristos    [Transform the output of nm in a proper C declaration])
358675fd0b74Schristos_LT_DECL([global_symbol_to_c_name_address],
358775fd0b74Schristos    [lt_cv_sys_global_symbol_to_c_name_address], [1],
358875fd0b74Schristos    [Transform the output of nm in a C name address pair])
358975fd0b74Schristos_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
359075fd0b74Schristos    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
359175fd0b74Schristos    [Transform the output of nm in a C name address pair when lib prefix is needed])
359275fd0b74Schristos]) # _LT_CMD_GLOBAL_SYMBOLS
359375fd0b74Schristos
359475fd0b74Schristos
359575fd0b74Schristos# _LT_COMPILER_PIC([TAGNAME])
359675fd0b74Schristos# ---------------------------
359775fd0b74Schristosm4_defun([_LT_COMPILER_PIC],
359875fd0b74Schristos[m4_require([_LT_TAG_COMPILER])dnl
359975fd0b74Schristos_LT_TAGVAR(lt_prog_compiler_wl, $1)=
360075fd0b74Schristos_LT_TAGVAR(lt_prog_compiler_pic, $1)=
360175fd0b74Schristos_LT_TAGVAR(lt_prog_compiler_static, $1)=
360275fd0b74Schristos
360375fd0b74SchristosAC_MSG_CHECKING([for $compiler option to produce PIC])
360475fd0b74Schristosm4_if([$1], [CXX], [
360575fd0b74Schristos  # C++ specific cases for pic, static, wl, etc.
360675fd0b74Schristos  if test "$GXX" = yes; then
360775fd0b74Schristos    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
360875fd0b74Schristos    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
360975fd0b74Schristos
361075fd0b74Schristos    case $host_os in
361175fd0b74Schristos    aix*)
361275fd0b74Schristos      # All AIX code is PIC.
361375fd0b74Schristos      if test "$host_cpu" = ia64; then
361475fd0b74Schristos	# AIX 5 now supports IA64 processor
361575fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
361675fd0b74Schristos      fi
361775fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
361875fd0b74Schristos      ;;
361975fd0b74Schristos
362075fd0b74Schristos    amigaos*)
362175fd0b74Schristos      case $host_cpu in
362275fd0b74Schristos      powerpc)
362375fd0b74Schristos            # see comment about AmigaOS4 .so support
362475fd0b74Schristos            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
362575fd0b74Schristos        ;;
362675fd0b74Schristos      m68k)
362775fd0b74Schristos            # FIXME: we need at least 68020 code to build shared libraries, but
362875fd0b74Schristos            # adding the `-m68020' flag to GCC prevents building anything better,
362975fd0b74Schristos            # like `-m68040'.
363075fd0b74Schristos            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
363175fd0b74Schristos        ;;
363275fd0b74Schristos      esac
363375fd0b74Schristos      ;;
363475fd0b74Schristos
363575fd0b74Schristos    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
363675fd0b74Schristos      # PIC is the default for these OSes.
363775fd0b74Schristos      ;;
363875fd0b74Schristos    mingw* | cygwin* | os2* | pw32* | cegcc*)
363975fd0b74Schristos      # This hack is so that the source file can tell whether it is being
364075fd0b74Schristos      # built for inclusion in a dll (and should export symbols for example).
364175fd0b74Schristos      # Although the cygwin gcc ignores -fPIC, still need this for old-style
364275fd0b74Schristos      # (--disable-auto-import) libraries
364375fd0b74Schristos      m4_if([$1], [GCJ], [],
364475fd0b74Schristos	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
364575fd0b74Schristos      ;;
364675fd0b74Schristos    darwin* | rhapsody*)
364775fd0b74Schristos      # PIC is the default on this platform
364875fd0b74Schristos      # Common symbols not allowed in MH_DYLIB files
364975fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
365075fd0b74Schristos      ;;
365175fd0b74Schristos    *djgpp*)
365275fd0b74Schristos      # DJGPP does not support shared libraries at all
365375fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
365475fd0b74Schristos      ;;
365575fd0b74Schristos    haiku*)
365675fd0b74Schristos      # PIC is the default for Haiku.
365775fd0b74Schristos      # The "-static" flag exists, but is broken.
365875fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_static, $1)=
365975fd0b74Schristos      ;;
366075fd0b74Schristos    interix[[3-9]]*)
366175fd0b74Schristos      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
366275fd0b74Schristos      # Instead, we relocate shared libraries at runtime.
366375fd0b74Schristos      ;;
366475fd0b74Schristos    sysv4*MP*)
366575fd0b74Schristos      if test -d /usr/nec; then
366675fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
366775fd0b74Schristos      fi
366875fd0b74Schristos      ;;
366975fd0b74Schristos    hpux*)
367075fd0b74Schristos      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
367175fd0b74Schristos      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
367275fd0b74Schristos      # sets the default TLS model and affects inlining.
367375fd0b74Schristos      case $host_cpu in
367475fd0b74Schristos      hppa*64*)
367575fd0b74Schristos	;;
367675fd0b74Schristos      *)
367775fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
367875fd0b74Schristos	;;
367975fd0b74Schristos      esac
368075fd0b74Schristos      ;;
368175fd0b74Schristos    *qnx* | *nto*)
368275fd0b74Schristos      # QNX uses GNU C++, but need to define -shared option too, otherwise
368375fd0b74Schristos      # it will coredump.
368475fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
368575fd0b74Schristos      ;;
368675fd0b74Schristos    *)
368775fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
368875fd0b74Schristos      ;;
368975fd0b74Schristos    esac
369075fd0b74Schristos  else
369175fd0b74Schristos    case $host_os in
369275fd0b74Schristos      aix[[4-9]]*)
369375fd0b74Schristos	# All AIX code is PIC.
369475fd0b74Schristos	if test "$host_cpu" = ia64; then
369575fd0b74Schristos	  # AIX 5 now supports IA64 processor
369675fd0b74Schristos	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
369775fd0b74Schristos	else
369875fd0b74Schristos	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
369975fd0b74Schristos	fi
370075fd0b74Schristos	;;
370175fd0b74Schristos      chorus*)
370275fd0b74Schristos	case $cc_basename in
370375fd0b74Schristos	cxch68*)
370475fd0b74Schristos	  # Green Hills C++ Compiler
370575fd0b74Schristos	  # _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"
370675fd0b74Schristos	  ;;
370775fd0b74Schristos	esac
370875fd0b74Schristos	;;
370975fd0b74Schristos      dgux*)
371075fd0b74Schristos	case $cc_basename in
371175fd0b74Schristos	  ec++*)
371275fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
371375fd0b74Schristos	    ;;
371475fd0b74Schristos	  ghcx*)
371575fd0b74Schristos	    # Green Hills C++ Compiler
371675fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
371775fd0b74Schristos	    ;;
371875fd0b74Schristos	  *)
371975fd0b74Schristos	    ;;
372075fd0b74Schristos	esac
372175fd0b74Schristos	;;
372275fd0b74Schristos      freebsd* | dragonfly*)
372375fd0b74Schristos	# FreeBSD uses GNU C++
372475fd0b74Schristos	;;
372575fd0b74Schristos      hpux9* | hpux10* | hpux11*)
372675fd0b74Schristos	case $cc_basename in
372775fd0b74Schristos	  CC*)
372875fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
372975fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
373075fd0b74Schristos	    if test "$host_cpu" != ia64; then
373175fd0b74Schristos	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
373275fd0b74Schristos	    fi
373375fd0b74Schristos	    ;;
373475fd0b74Schristos	  aCC*)
373575fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
373675fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
373775fd0b74Schristos	    case $host_cpu in
373875fd0b74Schristos	    hppa*64*|ia64*)
373975fd0b74Schristos	      # +Z the default
374075fd0b74Schristos	      ;;
374175fd0b74Schristos	    *)
374275fd0b74Schristos	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
374375fd0b74Schristos	      ;;
374475fd0b74Schristos	    esac
374575fd0b74Schristos	    ;;
374675fd0b74Schristos	  *)
374775fd0b74Schristos	    ;;
374875fd0b74Schristos	esac
374975fd0b74Schristos	;;
375075fd0b74Schristos      interix*)
375175fd0b74Schristos	# This is c89, which is MS Visual C++ (no shared libs)
375275fd0b74Schristos	# Anyone wants to do a port?
375375fd0b74Schristos	;;
375475fd0b74Schristos      irix5* | irix6* | nonstopux*)
375575fd0b74Schristos	case $cc_basename in
375675fd0b74Schristos	  CC*)
375775fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
375875fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
375975fd0b74Schristos	    # CC pic flag -KPIC is the default.
376075fd0b74Schristos	    ;;
376175fd0b74Schristos	  *)
376275fd0b74Schristos	    ;;
376375fd0b74Schristos	esac
376475fd0b74Schristos	;;
376575fd0b74Schristos      linux* | k*bsd*-gnu | kopensolaris*-gnu)
376675fd0b74Schristos	case $cc_basename in
376775fd0b74Schristos	  KCC*)
376875fd0b74Schristos	    # KAI C++ Compiler
376975fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
377075fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
377175fd0b74Schristos	    ;;
377275fd0b74Schristos	  ecpc* )
377375fd0b74Schristos	    # old Intel C++ for x86_64 which still supported -KPIC.
377475fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
377575fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
377675fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
377775fd0b74Schristos	    ;;
377875fd0b74Schristos	  icpc* )
377975fd0b74Schristos	    # Intel C++, used to be incompatible with GCC.
378075fd0b74Schristos	    # ICC 10 doesn't accept -KPIC any more.
378175fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
378275fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
378375fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
378475fd0b74Schristos	    ;;
378575fd0b74Schristos	  pgCC* | pgcpp*)
378675fd0b74Schristos	    # Portland Group C++ compiler
378775fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
378875fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
378975fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
379075fd0b74Schristos	    ;;
379175fd0b74Schristos	  cxx*)
379275fd0b74Schristos	    # Compaq C++
379375fd0b74Schristos	    # Make sure the PIC flag is empty.  It appears that all Alpha
379475fd0b74Schristos	    # Linux and Compaq Tru64 Unix objects are PIC.
379575fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
379675fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
379775fd0b74Schristos	    ;;
379875fd0b74Schristos	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
379975fd0b74Schristos	    # IBM XL 8.0, 9.0 on PPC and BlueGene
380075fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
380175fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
380275fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
380375fd0b74Schristos	    ;;
380475fd0b74Schristos	  *)
380575fd0b74Schristos	    case `$CC -V 2>&1 | sed 5q` in
380675fd0b74Schristos	    *Sun\ C*)
380775fd0b74Schristos	      # Sun C++ 5.9
380875fd0b74Schristos	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
380975fd0b74Schristos	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
381075fd0b74Schristos	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
381175fd0b74Schristos	      ;;
381275fd0b74Schristos	    esac
381375fd0b74Schristos	    ;;
381475fd0b74Schristos	esac
381575fd0b74Schristos	;;
381675fd0b74Schristos      lynxos*)
381775fd0b74Schristos	;;
381875fd0b74Schristos      m88k*)
381975fd0b74Schristos	;;
382075fd0b74Schristos      mvs*)
382175fd0b74Schristos	case $cc_basename in
382275fd0b74Schristos	  cxx*)
382375fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
382475fd0b74Schristos	    ;;
382575fd0b74Schristos	  *)
382675fd0b74Schristos	    ;;
382775fd0b74Schristos	esac
382875fd0b74Schristos	;;
382975fd0b74Schristos      netbsd*)
383075fd0b74Schristos	;;
383175fd0b74Schristos      *qnx* | *nto*)
383275fd0b74Schristos        # QNX uses GNU C++, but need to define -shared option too, otherwise
383375fd0b74Schristos        # it will coredump.
383475fd0b74Schristos        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
383575fd0b74Schristos        ;;
383675fd0b74Schristos      osf3* | osf4* | osf5*)
383775fd0b74Schristos	case $cc_basename in
383875fd0b74Schristos	  KCC*)
383975fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
384075fd0b74Schristos	    ;;
384175fd0b74Schristos	  RCC*)
384275fd0b74Schristos	    # Rational C++ 2.4.1
384375fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
384475fd0b74Schristos	    ;;
384575fd0b74Schristos	  cxx*)
384675fd0b74Schristos	    # Digital/Compaq C++
384775fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
384875fd0b74Schristos	    # Make sure the PIC flag is empty.  It appears that all Alpha
384975fd0b74Schristos	    # Linux and Compaq Tru64 Unix objects are PIC.
385075fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
385175fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
385275fd0b74Schristos	    ;;
385375fd0b74Schristos	  *)
385475fd0b74Schristos	    ;;
385575fd0b74Schristos	esac
385675fd0b74Schristos	;;
385775fd0b74Schristos      psos*)
385875fd0b74Schristos	;;
385975fd0b74Schristos      solaris*)
386075fd0b74Schristos	case $cc_basename in
386175fd0b74Schristos	  CC*)
386275fd0b74Schristos	    # Sun C++ 4.2, 5.x and Centerline C++
386375fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
386475fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
386575fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
386675fd0b74Schristos	    ;;
386775fd0b74Schristos	  gcx*)
386875fd0b74Schristos	    # Green Hills C++ Compiler
386975fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
387075fd0b74Schristos	    ;;
387175fd0b74Schristos	  *)
387275fd0b74Schristos	    ;;
387375fd0b74Schristos	esac
387475fd0b74Schristos	;;
387575fd0b74Schristos      sunos4*)
387675fd0b74Schristos	case $cc_basename in
387775fd0b74Schristos	  CC*)
387875fd0b74Schristos	    # Sun C++ 4.x
387975fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
388075fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
388175fd0b74Schristos	    ;;
388275fd0b74Schristos	  lcc*)
388375fd0b74Schristos	    # Lucid
388475fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
388575fd0b74Schristos	    ;;
388675fd0b74Schristos	  *)
388775fd0b74Schristos	    ;;
388875fd0b74Schristos	esac
388975fd0b74Schristos	;;
389075fd0b74Schristos      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
389175fd0b74Schristos	case $cc_basename in
389275fd0b74Schristos	  CC*)
389375fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
389475fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
389575fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
389675fd0b74Schristos	    ;;
389775fd0b74Schristos	esac
389875fd0b74Schristos	;;
389975fd0b74Schristos      tandem*)
390075fd0b74Schristos	case $cc_basename in
390175fd0b74Schristos	  NCC*)
390275fd0b74Schristos	    # NonStop-UX NCC 3.20
390375fd0b74Schristos	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
390475fd0b74Schristos	    ;;
390575fd0b74Schristos	  *)
390675fd0b74Schristos	    ;;
390775fd0b74Schristos	esac
390875fd0b74Schristos	;;
390975fd0b74Schristos      vxworks*)
391075fd0b74Schristos	;;
391175fd0b74Schristos      *)
391275fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
391375fd0b74Schristos	;;
391475fd0b74Schristos    esac
391575fd0b74Schristos  fi
391675fd0b74Schristos],
391775fd0b74Schristos[
391875fd0b74Schristos  if test "$GCC" = yes; then
391975fd0b74Schristos    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
392075fd0b74Schristos    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
392175fd0b74Schristos
392275fd0b74Schristos    case $host_os in
392375fd0b74Schristos      aix*)
392475fd0b74Schristos      # All AIX code is PIC.
392575fd0b74Schristos      if test "$host_cpu" = ia64; then
392675fd0b74Schristos	# AIX 5 now supports IA64 processor
392775fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
392875fd0b74Schristos      fi
392975fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
393075fd0b74Schristos      ;;
393175fd0b74Schristos
393275fd0b74Schristos    amigaos*)
393375fd0b74Schristos      case $host_cpu in
393475fd0b74Schristos      powerpc)
393575fd0b74Schristos            # see comment about AmigaOS4 .so support
393675fd0b74Schristos            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
393775fd0b74Schristos        ;;
393875fd0b74Schristos      m68k)
393975fd0b74Schristos            # FIXME: we need at least 68020 code to build shared libraries, but
394075fd0b74Schristos            # adding the `-m68020' flag to GCC prevents building anything better,
394175fd0b74Schristos            # like `-m68040'.
394275fd0b74Schristos            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
394375fd0b74Schristos        ;;
394475fd0b74Schristos      esac
394575fd0b74Schristos      ;;
394675fd0b74Schristos
394775fd0b74Schristos    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
394875fd0b74Schristos      # PIC is the default for these OSes.
394975fd0b74Schristos      ;;
395075fd0b74Schristos
395175fd0b74Schristos    mingw* | cygwin* | pw32* | os2* | cegcc*)
395275fd0b74Schristos      # This hack is so that the source file can tell whether it is being
395375fd0b74Schristos      # built for inclusion in a dll (and should export symbols for example).
395475fd0b74Schristos      # Although the cygwin gcc ignores -fPIC, still need this for old-style
395575fd0b74Schristos      # (--disable-auto-import) libraries
395675fd0b74Schristos      m4_if([$1], [GCJ], [],
395775fd0b74Schristos	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
395875fd0b74Schristos      ;;
395975fd0b74Schristos
396075fd0b74Schristos    darwin* | rhapsody*)
396175fd0b74Schristos      # PIC is the default on this platform
396275fd0b74Schristos      # Common symbols not allowed in MH_DYLIB files
396375fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
396475fd0b74Schristos      ;;
396575fd0b74Schristos
396675fd0b74Schristos    haiku*)
396775fd0b74Schristos      # PIC is the default for Haiku.
396875fd0b74Schristos      # The "-static" flag exists, but is broken.
396975fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_static, $1)=
397075fd0b74Schristos      ;;
397175fd0b74Schristos
397275fd0b74Schristos    hpux*)
397375fd0b74Schristos      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
397475fd0b74Schristos      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
397575fd0b74Schristos      # sets the default TLS model and affects inlining.
397675fd0b74Schristos      case $host_cpu in
397775fd0b74Schristos      hppa*64*)
397875fd0b74Schristos	# +Z the default
397975fd0b74Schristos	;;
398075fd0b74Schristos      *)
398175fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
398275fd0b74Schristos	;;
398375fd0b74Schristos      esac
398475fd0b74Schristos      ;;
398575fd0b74Schristos
398675fd0b74Schristos    interix[[3-9]]*)
398775fd0b74Schristos      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
398875fd0b74Schristos      # Instead, we relocate shared libraries at runtime.
398975fd0b74Schristos      ;;
399075fd0b74Schristos
399175fd0b74Schristos    msdosdjgpp*)
399275fd0b74Schristos      # Just because we use GCC doesn't mean we suddenly get shared libraries
399375fd0b74Schristos      # on systems that don't support them.
399475fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
399575fd0b74Schristos      enable_shared=no
399675fd0b74Schristos      ;;
399775fd0b74Schristos
399875fd0b74Schristos    *nto* | *qnx*)
399975fd0b74Schristos      # QNX uses GNU C++, but need to define -shared option too, otherwise
400075fd0b74Schristos      # it will coredump.
400175fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
400275fd0b74Schristos      ;;
400375fd0b74Schristos
400475fd0b74Schristos    sysv4*MP*)
400575fd0b74Schristos      if test -d /usr/nec; then
400675fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
400775fd0b74Schristos      fi
400875fd0b74Schristos      ;;
400975fd0b74Schristos
401075fd0b74Schristos    *)
401175fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
401275fd0b74Schristos      ;;
401375fd0b74Schristos    esac
401475fd0b74Schristos
401575fd0b74Schristos    case $cc_basename in
401675fd0b74Schristos    nvcc*) # Cuda Compiler Driver 2.2
401775fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
401875fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
401975fd0b74Schristos      ;;
402075fd0b74Schristos    esac
402175fd0b74Schristos  else
402275fd0b74Schristos    # PORTME Check for flag to pass linker flags through the system compiler.
402375fd0b74Schristos    case $host_os in
402475fd0b74Schristos    aix*)
402575fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
402675fd0b74Schristos      if test "$host_cpu" = ia64; then
402775fd0b74Schristos	# AIX 5 now supports IA64 processor
402875fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
402975fd0b74Schristos      else
403075fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
403175fd0b74Schristos      fi
403275fd0b74Schristos      ;;
403375fd0b74Schristos
403475fd0b74Schristos    mingw* | cygwin* | pw32* | os2* | cegcc*)
403575fd0b74Schristos      # This hack is so that the source file can tell whether it is being
403675fd0b74Schristos      # built for inclusion in a dll (and should export symbols for example).
403775fd0b74Schristos      m4_if([$1], [GCJ], [],
403875fd0b74Schristos	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
403975fd0b74Schristos      ;;
404075fd0b74Schristos
404175fd0b74Schristos    hpux9* | hpux10* | hpux11*)
404275fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
404375fd0b74Schristos      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
404475fd0b74Schristos      # not for PA HP-UX.
404575fd0b74Schristos      case $host_cpu in
404675fd0b74Schristos      hppa*64*|ia64*)
404775fd0b74Schristos	# +Z the default
404875fd0b74Schristos	;;
404975fd0b74Schristos      *)
405075fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
405175fd0b74Schristos	;;
405275fd0b74Schristos      esac
405375fd0b74Schristos      # Is there a better lt_prog_compiler_static that works with the bundled CC?
405475fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
405575fd0b74Schristos      ;;
405675fd0b74Schristos
405775fd0b74Schristos    irix5* | irix6* | nonstopux*)
405875fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
405975fd0b74Schristos      # PIC (with -KPIC) is the default.
406075fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
406175fd0b74Schristos      ;;
406275fd0b74Schristos
406375fd0b74Schristos    linux* | k*bsd*-gnu | kopensolaris*-gnu)
406475fd0b74Schristos      case $cc_basename in
406575fd0b74Schristos      # old Intel for x86_64 which still supported -KPIC.
406675fd0b74Schristos      ecc*)
406775fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
406875fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
406975fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
407075fd0b74Schristos        ;;
407175fd0b74Schristos      # icc used to be incompatible with GCC.
407275fd0b74Schristos      # ICC 10 doesn't accept -KPIC any more.
407375fd0b74Schristos      icc* | ifort*)
407475fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
407575fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
407675fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
407775fd0b74Schristos        ;;
407875fd0b74Schristos      # Lahey Fortran 8.1.
407975fd0b74Schristos      lf95*)
408075fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
408175fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
408275fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
408375fd0b74Schristos	;;
408475fd0b74Schristos      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
408575fd0b74Schristos        # Portland Group compilers (*not* the Pentium gcc compiler,
408675fd0b74Schristos	# which looks to be a dead project)
408775fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
408875fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
408975fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
409075fd0b74Schristos        ;;
409175fd0b74Schristos      ccc*)
409275fd0b74Schristos        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
409375fd0b74Schristos        # All Alpha code is PIC.
409475fd0b74Schristos        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
409575fd0b74Schristos        ;;
409675fd0b74Schristos      xl* | bgxl* | bgf* | mpixl*)
409775fd0b74Schristos	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
409875fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
409975fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
410075fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
410175fd0b74Schristos	;;
410275fd0b74Schristos      *)
410375fd0b74Schristos	case `$CC -V 2>&1 | sed 5q` in
410475fd0b74Schristos	*Sun\ F* | *Sun*Fortran*)
410575fd0b74Schristos	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
410675fd0b74Schristos	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
410775fd0b74Schristos	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
410875fd0b74Schristos	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
410975fd0b74Schristos	  ;;
411075fd0b74Schristos	*Sun\ C*)
411175fd0b74Schristos	  # Sun C 5.9
411275fd0b74Schristos	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
411375fd0b74Schristos	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
411475fd0b74Schristos	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
411575fd0b74Schristos	  ;;
411675fd0b74Schristos	esac
411775fd0b74Schristos	;;
411875fd0b74Schristos      esac
411975fd0b74Schristos      ;;
412075fd0b74Schristos
412175fd0b74Schristos    newsos6)
412275fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
412375fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
412475fd0b74Schristos      ;;
412575fd0b74Schristos
412675fd0b74Schristos    *nto* | *qnx*)
412775fd0b74Schristos      # QNX uses GNU C++, but need to define -shared option too, otherwise
412875fd0b74Schristos      # it will coredump.
412975fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
413075fd0b74Schristos      ;;
413175fd0b74Schristos
413275fd0b74Schristos    osf3* | osf4* | osf5*)
413375fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
413475fd0b74Schristos      # All OSF/1 code is PIC.
413575fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
413675fd0b74Schristos      ;;
413775fd0b74Schristos
413875fd0b74Schristos    rdos*)
413975fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
414075fd0b74Schristos      ;;
414175fd0b74Schristos
414275fd0b74Schristos    solaris*)
414375fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
414475fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
414575fd0b74Schristos      case $cc_basename in
414675fd0b74Schristos      f77* | f90* | f95*)
414775fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
414875fd0b74Schristos      *)
414975fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
415075fd0b74Schristos      esac
415175fd0b74Schristos      ;;
415275fd0b74Schristos
415375fd0b74Schristos    sunos4*)
415475fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
415575fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
415675fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
415775fd0b74Schristos      ;;
415875fd0b74Schristos
415975fd0b74Schristos    sysv4 | sysv4.2uw2* | sysv4.3*)
416075fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
416175fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
416275fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
416375fd0b74Schristos      ;;
416475fd0b74Schristos
416575fd0b74Schristos    sysv4*MP*)
416675fd0b74Schristos      if test -d /usr/nec ;then
416775fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
416875fd0b74Schristos	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
416975fd0b74Schristos      fi
417075fd0b74Schristos      ;;
417175fd0b74Schristos
417275fd0b74Schristos    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
417375fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
417475fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
417575fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
417675fd0b74Schristos      ;;
417775fd0b74Schristos
417875fd0b74Schristos    unicos*)
417975fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
418075fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
418175fd0b74Schristos      ;;
418275fd0b74Schristos
418375fd0b74Schristos    uts4*)
418475fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
418575fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
418675fd0b74Schristos      ;;
418775fd0b74Schristos
418875fd0b74Schristos    *)
418975fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
419075fd0b74Schristos      ;;
419175fd0b74Schristos    esac
419275fd0b74Schristos  fi
419375fd0b74Schristos])
419475fd0b74Schristoscase $host_os in
419575fd0b74Schristos  # For platforms which do not support PIC, -DPIC is meaningless:
419675fd0b74Schristos  *djgpp*)
419775fd0b74Schristos    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
419875fd0b74Schristos    ;;
419975fd0b74Schristos  *)
420075fd0b74Schristos    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
420175fd0b74Schristos    ;;
420275fd0b74Schristosesac
420375fd0b74SchristosAC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
420475fd0b74Schristos_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
420575fd0b74Schristos	[How to pass a linker flag through the compiler])
420675fd0b74Schristos
420775fd0b74Schristos#
420875fd0b74Schristos# Check to make sure the PIC flag actually works.
420975fd0b74Schristos#
421075fd0b74Schristosif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
421175fd0b74Schristos  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
421275fd0b74Schristos    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
421375fd0b74Schristos    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
421475fd0b74Schristos    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
421575fd0b74Schristos     "" | " "*) ;;
421675fd0b74Schristos     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
421775fd0b74Schristos     esac],
421875fd0b74Schristos    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
421975fd0b74Schristos     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
422075fd0b74Schristosfi
422175fd0b74Schristos_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
422275fd0b74Schristos	[Additional compiler flags for building library objects])
422375fd0b74Schristos
422475fd0b74Schristos#
422575fd0b74Schristos# Check to make sure the static flag actually works.
422675fd0b74Schristos#
422775fd0b74Schristoswl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
422875fd0b74Schristos_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
422975fd0b74Schristos  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
423075fd0b74Schristos  $lt_tmp_static_flag,
423175fd0b74Schristos  [],
423275fd0b74Schristos  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
423375fd0b74Schristos_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
423475fd0b74Schristos	[Compiler flag to prevent dynamic linking])
423575fd0b74Schristos])# _LT_COMPILER_PIC
423675fd0b74Schristos
423775fd0b74Schristos
423875fd0b74Schristos# _LT_LINKER_SHLIBS([TAGNAME])
423975fd0b74Schristos# ----------------------------
424075fd0b74Schristos# See if the linker supports building shared libraries.
424175fd0b74Schristosm4_defun([_LT_LINKER_SHLIBS],
424275fd0b74Schristos[AC_REQUIRE([LT_PATH_LD])dnl
424375fd0b74SchristosAC_REQUIRE([LT_PATH_NM])dnl
424475fd0b74Schristosm4_require([_LT_FILEUTILS_DEFAULTS])dnl
424575fd0b74Schristosm4_require([_LT_DECL_EGREP])dnl
424675fd0b74Schristosm4_require([_LT_DECL_SED])dnl
424775fd0b74Schristosm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
424875fd0b74Schristosm4_require([_LT_TAG_COMPILER])dnl
424975fd0b74SchristosAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
425075fd0b74Schristosm4_if([$1], [CXX], [
425175fd0b74Schristos  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
425275fd0b74Schristos  case $host_os in
425375fd0b74Schristos  aix[[4-9]]*)
425475fd0b74Schristos    # If we're using GNU nm, then we don't want the "-C" option.
425575fd0b74Schristos    # -C means demangle to AIX nm, but means don't demangle with GNU nm
425675fd0b74Schristos    # Also, AIX nm treats weak defined symbols like other global defined
425775fd0b74Schristos    # symbols, whereas GNU nm marks them as "W".
425875fd0b74Schristos    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
425975fd0b74Schristos      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
426075fd0b74Schristos    else
426175fd0b74Schristos      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
426275fd0b74Schristos    fi
426375fd0b74Schristos    ;;
426475fd0b74Schristos  pw32*)
426575fd0b74Schristos    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
426675fd0b74Schristos  ;;
426775fd0b74Schristos  cygwin* | mingw* | cegcc*)
426875fd0b74Schristos    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
426975fd0b74Schristos  ;;
427075fd0b74Schristos  *)
427175fd0b74Schristos    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
427275fd0b74Schristos  ;;
427375fd0b74Schristos  esac
427475fd0b74Schristos  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
427575fd0b74Schristos], [
427675fd0b74Schristos  runpath_var=
427775fd0b74Schristos  _LT_TAGVAR(allow_undefined_flag, $1)=
427875fd0b74Schristos  _LT_TAGVAR(always_export_symbols, $1)=no
427975fd0b74Schristos  _LT_TAGVAR(archive_cmds, $1)=
428075fd0b74Schristos  _LT_TAGVAR(archive_expsym_cmds, $1)=
428175fd0b74Schristos  _LT_TAGVAR(compiler_needs_object, $1)=no
428275fd0b74Schristos  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
428375fd0b74Schristos  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
428475fd0b74Schristos  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
428575fd0b74Schristos  _LT_TAGVAR(hardcode_automatic, $1)=no
428675fd0b74Schristos  _LT_TAGVAR(hardcode_direct, $1)=no
428775fd0b74Schristos  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
428875fd0b74Schristos  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
428975fd0b74Schristos  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
429075fd0b74Schristos  _LT_TAGVAR(hardcode_libdir_separator, $1)=
429175fd0b74Schristos  _LT_TAGVAR(hardcode_minus_L, $1)=no
429275fd0b74Schristos  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
429375fd0b74Schristos  _LT_TAGVAR(inherit_rpath, $1)=no
429475fd0b74Schristos  _LT_TAGVAR(link_all_deplibs, $1)=unknown
429575fd0b74Schristos  _LT_TAGVAR(module_cmds, $1)=
429675fd0b74Schristos  _LT_TAGVAR(module_expsym_cmds, $1)=
429775fd0b74Schristos  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
429875fd0b74Schristos  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
429975fd0b74Schristos  _LT_TAGVAR(thread_safe_flag_spec, $1)=
430075fd0b74Schristos  _LT_TAGVAR(whole_archive_flag_spec, $1)=
430175fd0b74Schristos  # include_expsyms should be a list of space-separated symbols to be *always*
430275fd0b74Schristos  # included in the symbol list
430375fd0b74Schristos  _LT_TAGVAR(include_expsyms, $1)=
430475fd0b74Schristos  # exclude_expsyms can be an extended regexp of symbols to exclude
430575fd0b74Schristos  # it will be wrapped by ` (' and `)$', so one must not match beginning or
430675fd0b74Schristos  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
430775fd0b74Schristos  # as well as any symbol that contains `d'.
430875fd0b74Schristos  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
430975fd0b74Schristos  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
431075fd0b74Schristos  # platforms (ab)use it in PIC code, but their linkers get confused if
431175fd0b74Schristos  # the symbol is explicitly referenced.  Since portable code cannot
431275fd0b74Schristos  # rely on this symbol name, it's probably fine to never include it in
431375fd0b74Schristos  # preloaded symbol tables.
431475fd0b74Schristos  # Exclude shared library initialization/finalization symbols.
431575fd0b74Schristosdnl Note also adjust exclude_expsyms for C++ above.
431675fd0b74Schristos  extract_expsyms_cmds=
431775fd0b74Schristos
431875fd0b74Schristos  case $host_os in
431975fd0b74Schristos  cygwin* | mingw* | pw32* | cegcc*)
432075fd0b74Schristos    # FIXME: the MSVC++ port hasn't been tested in a loooong time
432175fd0b74Schristos    # When not using gcc, we currently assume that we are using
432275fd0b74Schristos    # Microsoft Visual C++.
432375fd0b74Schristos    if test "$GCC" != yes; then
432475fd0b74Schristos      with_gnu_ld=no
432575fd0b74Schristos    fi
432675fd0b74Schristos    ;;
432775fd0b74Schristos  interix*)
432875fd0b74Schristos    # we just hope/assume this is gcc and not c89 (= MSVC++)
432975fd0b74Schristos    with_gnu_ld=yes
433075fd0b74Schristos    ;;
433175fd0b74Schristos  openbsd*)
433275fd0b74Schristos    with_gnu_ld=no
433375fd0b74Schristos    ;;
433475fd0b74Schristos  esac
433575fd0b74Schristos
433675fd0b74Schristos  _LT_TAGVAR(ld_shlibs, $1)=yes
433775fd0b74Schristos
433875fd0b74Schristos  # On some targets, GNU ld is compatible enough with the native linker
433975fd0b74Schristos  # that we're better off using the native interface for both.
434075fd0b74Schristos  lt_use_gnu_ld_interface=no
434175fd0b74Schristos  if test "$with_gnu_ld" = yes; then
434275fd0b74Schristos    case $host_os in
434375fd0b74Schristos      aix*)
434475fd0b74Schristos	# The AIX port of GNU ld has always aspired to compatibility
434575fd0b74Schristos	# with the native linker.  However, as the warning in the GNU ld
434675fd0b74Schristos	# block says, versions before 2.19.5* couldn't really create working
434775fd0b74Schristos	# shared libraries, regardless of the interface used.
434875fd0b74Schristos	case `$LD -v 2>&1` in
434975fd0b74Schristos	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
435075fd0b74Schristos	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
435175fd0b74Schristos	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
435275fd0b74Schristos	  *)
435375fd0b74Schristos	    lt_use_gnu_ld_interface=yes
435475fd0b74Schristos	    ;;
435575fd0b74Schristos	esac
435675fd0b74Schristos	;;
435775fd0b74Schristos      *)
435875fd0b74Schristos	lt_use_gnu_ld_interface=yes
435975fd0b74Schristos	;;
436075fd0b74Schristos    esac
436175fd0b74Schristos  fi
436275fd0b74Schristos
436375fd0b74Schristos  if test "$lt_use_gnu_ld_interface" = yes; then
436475fd0b74Schristos    # If archive_cmds runs LD, not CC, wlarc should be empty
436575fd0b74Schristos    wlarc='${wl}'
436675fd0b74Schristos
436775fd0b74Schristos    # Set some defaults for GNU ld with shared library support. These
436875fd0b74Schristos    # are reset later if shared libraries are not supported. Putting them
436975fd0b74Schristos    # here allows them to be overridden if necessary.
437075fd0b74Schristos    runpath_var=LD_RUN_PATH
437175fd0b74Schristos    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
437275fd0b74Schristos    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
437375fd0b74Schristos    # ancient GNU ld didn't support --whole-archive et. al.
437475fd0b74Schristos    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
437575fd0b74Schristos      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
437675fd0b74Schristos    else
437775fd0b74Schristos      _LT_TAGVAR(whole_archive_flag_spec, $1)=
437875fd0b74Schristos    fi
437975fd0b74Schristos    supports_anon_versioning=no
438075fd0b74Schristos    case `$LD -v 2>&1` in
438175fd0b74Schristos      *GNU\ gold*) supports_anon_versioning=yes ;;
438275fd0b74Schristos      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
438375fd0b74Schristos      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
438475fd0b74Schristos      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
438575fd0b74Schristos      *\ 2.11.*) ;; # other 2.11 versions
438675fd0b74Schristos      *) supports_anon_versioning=yes ;;
438775fd0b74Schristos    esac
438875fd0b74Schristos
438975fd0b74Schristos    # See if GNU ld supports shared libraries.
439075fd0b74Schristos    case $host_os in
439175fd0b74Schristos    aix[[3-9]]*)
439275fd0b74Schristos      # On AIX/PPC, the GNU linker is very broken
439375fd0b74Schristos      if test "$host_cpu" != ia64; then
439475fd0b74Schristos	_LT_TAGVAR(ld_shlibs, $1)=no
439575fd0b74Schristos	cat <<_LT_EOF 1>&2
439675fd0b74Schristos
439775fd0b74Schristos*** Warning: the GNU linker, at least up to release 2.19, is reported
439875fd0b74Schristos*** to be unable to reliably create shared libraries on AIX.
439975fd0b74Schristos*** Therefore, libtool is disabling shared libraries support.  If you
440075fd0b74Schristos*** really care for shared libraries, you may want to install binutils
440175fd0b74Schristos*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
440275fd0b74Schristos*** You will then need to restart the configuration process.
440375fd0b74Schristos
440475fd0b74Schristos_LT_EOF
440575fd0b74Schristos      fi
440675fd0b74Schristos      ;;
440775fd0b74Schristos
440875fd0b74Schristos    amigaos*)
440975fd0b74Schristos      case $host_cpu in
441075fd0b74Schristos      powerpc)
441175fd0b74Schristos            # see comment about AmigaOS4 .so support
441275fd0b74Schristos            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
441375fd0b74Schristos            _LT_TAGVAR(archive_expsym_cmds, $1)=''
441475fd0b74Schristos        ;;
441575fd0b74Schristos      m68k)
441675fd0b74Schristos            _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)'
441775fd0b74Schristos            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
441875fd0b74Schristos            _LT_TAGVAR(hardcode_minus_L, $1)=yes
441975fd0b74Schristos        ;;
442075fd0b74Schristos      esac
442175fd0b74Schristos      ;;
442275fd0b74Schristos
442375fd0b74Schristos    beos*)
442475fd0b74Schristos      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
442575fd0b74Schristos	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
442675fd0b74Schristos	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
442775fd0b74Schristos	# support --undefined.  This deserves some investigation.  FIXME
442875fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
442975fd0b74Schristos      else
443075fd0b74Schristos	_LT_TAGVAR(ld_shlibs, $1)=no
443175fd0b74Schristos      fi
443275fd0b74Schristos      ;;
443375fd0b74Schristos
443475fd0b74Schristos    cygwin* | mingw* | pw32* | cegcc*)
443575fd0b74Schristos      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
443675fd0b74Schristos      # as there is no search path for DLLs.
443775fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
443875fd0b74Schristos      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
443975fd0b74Schristos      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
444075fd0b74Schristos      _LT_TAGVAR(always_export_symbols, $1)=no
444175fd0b74Schristos      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
444275fd0b74Schristos      _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'
444375fd0b74Schristos
444475fd0b74Schristos      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
444575fd0b74Schristos        _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'
444675fd0b74Schristos	# If the export-symbols file already is a .def file (1st line
444775fd0b74Schristos	# is EXPORTS), use it as is; otherwise, prepend...
444875fd0b74Schristos	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
444975fd0b74Schristos	  cp $export_symbols $output_objdir/$soname.def;
445075fd0b74Schristos	else
445175fd0b74Schristos	  echo EXPORTS > $output_objdir/$soname.def;
445275fd0b74Schristos	  cat $export_symbols >> $output_objdir/$soname.def;
445375fd0b74Schristos	fi~
445475fd0b74Schristos	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
445575fd0b74Schristos      else
445675fd0b74Schristos	_LT_TAGVAR(ld_shlibs, $1)=no
445775fd0b74Schristos      fi
445875fd0b74Schristos      ;;
445975fd0b74Schristos
446075fd0b74Schristos    haiku*)
446175fd0b74Schristos      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
446275fd0b74Schristos      _LT_TAGVAR(link_all_deplibs, $1)=yes
446375fd0b74Schristos      ;;
446475fd0b74Schristos
446575fd0b74Schristos    interix[[3-9]]*)
446675fd0b74Schristos      _LT_TAGVAR(hardcode_direct, $1)=no
446775fd0b74Schristos      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
446875fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
446975fd0b74Schristos      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
447075fd0b74Schristos      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
447175fd0b74Schristos      # Instead, shared libraries are loaded at an image base (0x10000000 by
447275fd0b74Schristos      # default) and relocated if they conflict, which is a slow very memory
447375fd0b74Schristos      # consuming and fragmenting process.  To avoid this, we pick a random,
447475fd0b74Schristos      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
447575fd0b74Schristos      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
447675fd0b74Schristos      _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'
447775fd0b74Schristos      _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'
447875fd0b74Schristos      ;;
447975fd0b74Schristos
448075fd0b74Schristos    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
448175fd0b74Schristos      tmp_diet=no
448275fd0b74Schristos      if test "$host_os" = linux-dietlibc; then
448375fd0b74Schristos	case $cc_basename in
448475fd0b74Schristos	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
448575fd0b74Schristos	esac
448675fd0b74Schristos      fi
448775fd0b74Schristos      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
448875fd0b74Schristos	 && test "$tmp_diet" = no
448975fd0b74Schristos      then
449075fd0b74Schristos	tmp_addflag=' $pic_flag'
449175fd0b74Schristos	tmp_sharedflag='-shared'
449275fd0b74Schristos	case $cc_basename,$host_cpu in
449375fd0b74Schristos        pgcc*)				# Portland Group C compiler
449475fd0b74Schristos	  _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'
449575fd0b74Schristos	  tmp_addflag=' $pic_flag'
449675fd0b74Schristos	  ;;
449775fd0b74Schristos	pgf77* | pgf90* | pgf95* | pgfortran*)
449875fd0b74Schristos					# Portland Group f77 and f90 compilers
449975fd0b74Schristos	  _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'
450075fd0b74Schristos	  tmp_addflag=' $pic_flag -Mnomain' ;;
450175fd0b74Schristos	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
450275fd0b74Schristos	  tmp_addflag=' -i_dynamic' ;;
450375fd0b74Schristos	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
450475fd0b74Schristos	  tmp_addflag=' -i_dynamic -nofor_main' ;;
450575fd0b74Schristos	ifc* | ifort*)			# Intel Fortran compiler
450675fd0b74Schristos	  tmp_addflag=' -nofor_main' ;;
450775fd0b74Schristos	lf95*)				# Lahey Fortran 8.1
450875fd0b74Schristos	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
450975fd0b74Schristos	  tmp_sharedflag='--shared' ;;
451075fd0b74Schristos	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
451175fd0b74Schristos	  tmp_sharedflag='-qmkshrobj'
451275fd0b74Schristos	  tmp_addflag= ;;
451375fd0b74Schristos	nvcc*)	# Cuda Compiler Driver 2.2
451475fd0b74Schristos	  _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'
451575fd0b74Schristos	  _LT_TAGVAR(compiler_needs_object, $1)=yes
451675fd0b74Schristos	  ;;
451775fd0b74Schristos	esac
451875fd0b74Schristos	case `$CC -V 2>&1 | sed 5q` in
451975fd0b74Schristos	*Sun\ C*)			# Sun C 5.9
452075fd0b74Schristos	  _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'
452175fd0b74Schristos	  _LT_TAGVAR(compiler_needs_object, $1)=yes
452275fd0b74Schristos	  tmp_sharedflag='-G' ;;
452375fd0b74Schristos	*Sun\ F*)			# Sun Fortran 8.3
452475fd0b74Schristos	  tmp_sharedflag='-G' ;;
452575fd0b74Schristos	esac
452675fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
452775fd0b74Schristos
452875fd0b74Schristos        if test "x$supports_anon_versioning" = xyes; then
452975fd0b74Schristos          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
453075fd0b74Schristos	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
453175fd0b74Schristos	    echo "local: *; };" >> $output_objdir/$libname.ver~
453275fd0b74Schristos	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
453375fd0b74Schristos        fi
453475fd0b74Schristos
453575fd0b74Schristos	case $cc_basename in
453675fd0b74Schristos	xlf* | bgf* | bgxlf* | mpixlf*)
453775fd0b74Schristos	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
453875fd0b74Schristos	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
453975fd0b74Schristos	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
454075fd0b74Schristos	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
454175fd0b74Schristos	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
454275fd0b74Schristos	  if test "x$supports_anon_versioning" = xyes; then
454375fd0b74Schristos	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
454475fd0b74Schristos	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
454575fd0b74Schristos	      echo "local: *; };" >> $output_objdir/$libname.ver~
454675fd0b74Schristos	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
454775fd0b74Schristos	  fi
454875fd0b74Schristos	  ;;
454975fd0b74Schristos	esac
455075fd0b74Schristos      else
455175fd0b74Schristos        _LT_TAGVAR(ld_shlibs, $1)=no
455275fd0b74Schristos      fi
455375fd0b74Schristos      ;;
455475fd0b74Schristos
455575fd0b74Schristos    netbsd*)
455675fd0b74Schristos      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
455775fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
455875fd0b74Schristos	wlarc=
455975fd0b74Schristos      else
456075fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
456175fd0b74Schristos	_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'
456275fd0b74Schristos      fi
456375fd0b74Schristos      ;;
456475fd0b74Schristos
456575fd0b74Schristos    solaris*)
456675fd0b74Schristos      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
456775fd0b74Schristos	_LT_TAGVAR(ld_shlibs, $1)=no
456875fd0b74Schristos	cat <<_LT_EOF 1>&2
456975fd0b74Schristos
457075fd0b74Schristos*** Warning: The releases 2.8.* of the GNU linker cannot reliably
457175fd0b74Schristos*** create shared libraries on Solaris systems.  Therefore, libtool
457275fd0b74Schristos*** is disabling shared libraries support.  We urge you to upgrade GNU
457375fd0b74Schristos*** binutils to release 2.9.1 or newer.  Another option is to modify
457475fd0b74Schristos*** your PATH or compiler configuration so that the native linker is
457575fd0b74Schristos*** used, and then restart.
457675fd0b74Schristos
457775fd0b74Schristos_LT_EOF
457875fd0b74Schristos      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
457975fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
458075fd0b74Schristos	_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'
458175fd0b74Schristos      else
458275fd0b74Schristos	_LT_TAGVAR(ld_shlibs, $1)=no
458375fd0b74Schristos      fi
458475fd0b74Schristos      ;;
458575fd0b74Schristos
458675fd0b74Schristos    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
458775fd0b74Schristos      case `$LD -v 2>&1` in
458875fd0b74Schristos        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
458975fd0b74Schristos	_LT_TAGVAR(ld_shlibs, $1)=no
459075fd0b74Schristos	cat <<_LT_EOF 1>&2
459175fd0b74Schristos
459275fd0b74Schristos*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
459375fd0b74Schristos*** reliably create shared libraries on SCO systems.  Therefore, libtool
459475fd0b74Schristos*** is disabling shared libraries support.  We urge you to upgrade GNU
459575fd0b74Schristos*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
459675fd0b74Schristos*** your PATH or compiler configuration so that the native linker is
459775fd0b74Schristos*** used, and then restart.
459875fd0b74Schristos
459975fd0b74Schristos_LT_EOF
460075fd0b74Schristos	;;
460175fd0b74Schristos	*)
460275fd0b74Schristos	  # For security reasons, it is highly recommended that you always
460375fd0b74Schristos	  # use absolute paths for naming shared libraries, and exclude the
460475fd0b74Schristos	  # DT_RUNPATH tag from executables and libraries.  But doing so
460575fd0b74Schristos	  # requires that you compile everything twice, which is a pain.
460675fd0b74Schristos	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
460775fd0b74Schristos	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
460875fd0b74Schristos	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
460975fd0b74Schristos	    _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'
461075fd0b74Schristos	  else
461175fd0b74Schristos	    _LT_TAGVAR(ld_shlibs, $1)=no
461275fd0b74Schristos	  fi
461375fd0b74Schristos	;;
461475fd0b74Schristos      esac
461575fd0b74Schristos      ;;
461675fd0b74Schristos
461775fd0b74Schristos    sunos4*)
461875fd0b74Schristos      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
461975fd0b74Schristos      wlarc=
462075fd0b74Schristos      _LT_TAGVAR(hardcode_direct, $1)=yes
462175fd0b74Schristos      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
462275fd0b74Schristos      ;;
462375fd0b74Schristos
462475fd0b74Schristos    *)
462575fd0b74Schristos      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
462675fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
462775fd0b74Schristos	_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'
462875fd0b74Schristos      else
462975fd0b74Schristos	_LT_TAGVAR(ld_shlibs, $1)=no
463075fd0b74Schristos      fi
463175fd0b74Schristos      ;;
463275fd0b74Schristos    esac
463375fd0b74Schristos
463475fd0b74Schristos    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
463575fd0b74Schristos      runpath_var=
463675fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
463775fd0b74Schristos      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
463875fd0b74Schristos      _LT_TAGVAR(whole_archive_flag_spec, $1)=
463975fd0b74Schristos    fi
464075fd0b74Schristos  else
464175fd0b74Schristos    # PORTME fill in a description of your system's linker (not GNU ld)
464275fd0b74Schristos    case $host_os in
464375fd0b74Schristos    aix3*)
464475fd0b74Schristos      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
464575fd0b74Schristos      _LT_TAGVAR(always_export_symbols, $1)=yes
464675fd0b74Schristos      _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'
464775fd0b74Schristos      # Note: this linker hardcodes the directories in LIBPATH if there
464875fd0b74Schristos      # are no directories specified by -L.
464975fd0b74Schristos      _LT_TAGVAR(hardcode_minus_L, $1)=yes
465075fd0b74Schristos      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
465175fd0b74Schristos	# Neither direct hardcoding nor static linking is supported with a
465275fd0b74Schristos	# broken collect2.
465375fd0b74Schristos	_LT_TAGVAR(hardcode_direct, $1)=unsupported
465475fd0b74Schristos      fi
465575fd0b74Schristos      ;;
465675fd0b74Schristos
465775fd0b74Schristos    aix[[4-9]]*)
465875fd0b74Schristos      if test "$host_cpu" = ia64; then
465975fd0b74Schristos	# On IA64, the linker does run time linking by default, so we don't
466075fd0b74Schristos	# have to do anything special.
466175fd0b74Schristos	aix_use_runtimelinking=no
466275fd0b74Schristos	exp_sym_flag='-Bexport'
466375fd0b74Schristos	no_entry_flag=""
466475fd0b74Schristos      else
466575fd0b74Schristos	# If we're using GNU nm, then we don't want the "-C" option.
466675fd0b74Schristos	# -C means demangle to AIX nm, but means don't demangle with GNU nm
466775fd0b74Schristos	# Also, AIX nm treats weak defined symbols like other global
466875fd0b74Schristos	# defined symbols, whereas GNU nm marks them as "W".
466975fd0b74Schristos	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
467075fd0b74Schristos	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
467175fd0b74Schristos	else
467275fd0b74Schristos	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
467375fd0b74Schristos	fi
467475fd0b74Schristos	aix_use_runtimelinking=no
467575fd0b74Schristos
467675fd0b74Schristos	# Test if we are trying to use run time linking or normal
467775fd0b74Schristos	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
467875fd0b74Schristos	# need to do runtime linking.
467975fd0b74Schristos	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
468075fd0b74Schristos	  for ld_flag in $LDFLAGS; do
468175fd0b74Schristos	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
468275fd0b74Schristos	    aix_use_runtimelinking=yes
468375fd0b74Schristos	    break
468475fd0b74Schristos	  fi
468575fd0b74Schristos	  done
468675fd0b74Schristos	  ;;
468775fd0b74Schristos	esac
468875fd0b74Schristos
468975fd0b74Schristos	exp_sym_flag='-bexport'
469075fd0b74Schristos	no_entry_flag='-bnoentry'
469175fd0b74Schristos      fi
469275fd0b74Schristos
469375fd0b74Schristos      # When large executables or shared objects are built, AIX ld can
469475fd0b74Schristos      # have problems creating the table of contents.  If linking a library
469575fd0b74Schristos      # or program results in "error TOC overflow" add -mminimal-toc to
469675fd0b74Schristos      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
469775fd0b74Schristos      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
469875fd0b74Schristos
469975fd0b74Schristos      _LT_TAGVAR(archive_cmds, $1)=''
470075fd0b74Schristos      _LT_TAGVAR(hardcode_direct, $1)=yes
470175fd0b74Schristos      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
470275fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
470375fd0b74Schristos      _LT_TAGVAR(link_all_deplibs, $1)=yes
470475fd0b74Schristos      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
470575fd0b74Schristos
470675fd0b74Schristos      if test "$GCC" = yes; then
470775fd0b74Schristos	case $host_os in aix4.[[012]]|aix4.[[012]].*)
470875fd0b74Schristos	# We only want to do this on AIX 4.2 and lower, the check
470975fd0b74Schristos	# below for broken collect2 doesn't work under 4.3+
471075fd0b74Schristos	  collect2name=`${CC} -print-prog-name=collect2`
471175fd0b74Schristos	  if test -f "$collect2name" &&
471275fd0b74Schristos	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
471375fd0b74Schristos	  then
471475fd0b74Schristos	  # We have reworked collect2
471575fd0b74Schristos	  :
471675fd0b74Schristos	  else
471775fd0b74Schristos	  # We have old collect2
471875fd0b74Schristos	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
471975fd0b74Schristos	  # It fails to find uninstalled libraries when the uninstalled
472075fd0b74Schristos	  # path is not listed in the libpath.  Setting hardcode_minus_L
472175fd0b74Schristos	  # to unsupported forces relinking
472275fd0b74Schristos	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
472375fd0b74Schristos	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
472475fd0b74Schristos	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
472575fd0b74Schristos	  fi
472675fd0b74Schristos	  ;;
472775fd0b74Schristos	esac
472875fd0b74Schristos	shared_flag='-shared'
472975fd0b74Schristos	if test "$aix_use_runtimelinking" = yes; then
473075fd0b74Schristos	  shared_flag="$shared_flag "'${wl}-G'
473175fd0b74Schristos	fi
473275fd0b74Schristos      else
473375fd0b74Schristos	# not using gcc
473475fd0b74Schristos	if test "$host_cpu" = ia64; then
473575fd0b74Schristos	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
473675fd0b74Schristos	# chokes on -Wl,-G. The following line is correct:
473775fd0b74Schristos	  shared_flag='-G'
473875fd0b74Schristos	else
473975fd0b74Schristos	  if test "$aix_use_runtimelinking" = yes; then
474075fd0b74Schristos	    shared_flag='${wl}-G'
474175fd0b74Schristos	  else
474275fd0b74Schristos	    shared_flag='${wl}-bM:SRE'
474375fd0b74Schristos	  fi
474475fd0b74Schristos	fi
474575fd0b74Schristos      fi
474675fd0b74Schristos
474775fd0b74Schristos      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
474875fd0b74Schristos      # It seems that -bexpall does not export symbols beginning with
474975fd0b74Schristos      # underscore (_), so it is better to generate a list of symbols to export.
475075fd0b74Schristos      _LT_TAGVAR(always_export_symbols, $1)=yes
475175fd0b74Schristos      if test "$aix_use_runtimelinking" = yes; then
475275fd0b74Schristos	# Warning - without using the other runtime loading flags (-brtl),
475375fd0b74Schristos	# -berok will link without error, but may produce a broken library.
475475fd0b74Schristos	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
475575fd0b74Schristos        # Determine the default libpath from the value encoded in an
475675fd0b74Schristos        # empty executable.
475775fd0b74Schristos        _LT_SYS_MODULE_PATH_AIX
475875fd0b74Schristos        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
475975fd0b74Schristos        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
476075fd0b74Schristos      else
476175fd0b74Schristos	if test "$host_cpu" = ia64; then
476275fd0b74Schristos	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
476375fd0b74Schristos	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
476475fd0b74Schristos	  _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"
476575fd0b74Schristos	else
476675fd0b74Schristos	 # Determine the default libpath from the value encoded in an
476775fd0b74Schristos	 # empty executable.
476875fd0b74Schristos	 _LT_SYS_MODULE_PATH_AIX
476975fd0b74Schristos	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
477075fd0b74Schristos	  # Warning - without using the other run time loading flags,
477175fd0b74Schristos	  # -berok will link without error, but may produce a broken library.
477275fd0b74Schristos	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
477375fd0b74Schristos	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
477475fd0b74Schristos	  if test "$with_gnu_ld" = yes; then
477575fd0b74Schristos	    # We only use this code for GNU lds that support --whole-archive.
477675fd0b74Schristos	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
477775fd0b74Schristos	  else
477875fd0b74Schristos	    # Exported symbols can be pulled into shared objects from archives
477975fd0b74Schristos	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
478075fd0b74Schristos	  fi
478175fd0b74Schristos	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
478275fd0b74Schristos	  # This is similar to how AIX traditionally builds its shared libraries.
478375fd0b74Schristos	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
478475fd0b74Schristos	fi
478575fd0b74Schristos      fi
478675fd0b74Schristos      ;;
478775fd0b74Schristos
478875fd0b74Schristos    amigaos*)
478975fd0b74Schristos      case $host_cpu in
479075fd0b74Schristos      powerpc)
479175fd0b74Schristos            # see comment about AmigaOS4 .so support
479275fd0b74Schristos            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
479375fd0b74Schristos            _LT_TAGVAR(archive_expsym_cmds, $1)=''
479475fd0b74Schristos        ;;
479575fd0b74Schristos      m68k)
479675fd0b74Schristos            _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)'
479775fd0b74Schristos            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
479875fd0b74Schristos            _LT_TAGVAR(hardcode_minus_L, $1)=yes
479975fd0b74Schristos        ;;
480075fd0b74Schristos      esac
480175fd0b74Schristos      ;;
480275fd0b74Schristos
480375fd0b74Schristos    bsdi[[45]]*)
480475fd0b74Schristos      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
480575fd0b74Schristos      ;;
480675fd0b74Schristos
480775fd0b74Schristos    cygwin* | mingw* | pw32* | cegcc*)
480875fd0b74Schristos      # When not using gcc, we currently assume that we are using
480975fd0b74Schristos      # Microsoft Visual C++.
481075fd0b74Schristos      # hardcode_libdir_flag_spec is actually meaningless, as there is
481175fd0b74Schristos      # no search path for DLLs.
481275fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
481375fd0b74Schristos      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
481475fd0b74Schristos      # Tell ltmain to make .lib files, not .a files.
481575fd0b74Schristos      libext=lib
481675fd0b74Schristos      # Tell ltmain to make .dll files, not .so files.
481775fd0b74Schristos      shrext_cmds=".dll"
481875fd0b74Schristos      # FIXME: Setting linknames here is a bad hack.
481975fd0b74Schristos      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
482075fd0b74Schristos      # The linker will automatically build a .lib file if we build a DLL.
482175fd0b74Schristos      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
482275fd0b74Schristos      # FIXME: Should let the user specify the lib program.
482375fd0b74Schristos      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
482475fd0b74Schristos      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
482575fd0b74Schristos      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
482675fd0b74Schristos      ;;
482775fd0b74Schristos
482875fd0b74Schristos    darwin* | rhapsody*)
482975fd0b74Schristos      _LT_DARWIN_LINKER_FEATURES($1)
483075fd0b74Schristos      ;;
483175fd0b74Schristos
483275fd0b74Schristos    dgux*)
483375fd0b74Schristos      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
483475fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
483575fd0b74Schristos      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
483675fd0b74Schristos      ;;
483775fd0b74Schristos
483875fd0b74Schristos    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
483975fd0b74Schristos    # support.  Future versions do this automatically, but an explicit c++rt0.o
484075fd0b74Schristos    # does not break anything, and helps significantly (at the cost of a little
484175fd0b74Schristos    # extra space).
484275fd0b74Schristos    freebsd2.2*)
484375fd0b74Schristos      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
484475fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
484575fd0b74Schristos      _LT_TAGVAR(hardcode_direct, $1)=yes
484675fd0b74Schristos      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
484775fd0b74Schristos      ;;
484875fd0b74Schristos
484975fd0b74Schristos    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
485075fd0b74Schristos    freebsd2.*)
485175fd0b74Schristos      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
485275fd0b74Schristos      _LT_TAGVAR(hardcode_direct, $1)=yes
485375fd0b74Schristos      _LT_TAGVAR(hardcode_minus_L, $1)=yes
485475fd0b74Schristos      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
485575fd0b74Schristos      ;;
485675fd0b74Schristos
485775fd0b74Schristos    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
485875fd0b74Schristos    freebsd* | dragonfly*)
485975fd0b74Schristos      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
486075fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
486175fd0b74Schristos      _LT_TAGVAR(hardcode_direct, $1)=yes
486275fd0b74Schristos      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
486375fd0b74Schristos      ;;
486475fd0b74Schristos
486575fd0b74Schristos    hpux9*)
486675fd0b74Schristos      if test "$GCC" = yes; then
486775fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
486875fd0b74Schristos      else
486975fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
487075fd0b74Schristos      fi
487175fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
487275fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
487375fd0b74Schristos      _LT_TAGVAR(hardcode_direct, $1)=yes
487475fd0b74Schristos
487575fd0b74Schristos      # hardcode_minus_L: Not really in the search PATH,
487675fd0b74Schristos      # but as the default location of the library.
487775fd0b74Schristos      _LT_TAGVAR(hardcode_minus_L, $1)=yes
487875fd0b74Schristos      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
487975fd0b74Schristos      ;;
488075fd0b74Schristos
488175fd0b74Schristos    hpux10*)
488275fd0b74Schristos      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
488375fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
488475fd0b74Schristos      else
488575fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
488675fd0b74Schristos      fi
488775fd0b74Schristos      if test "$with_gnu_ld" = no; then
488875fd0b74Schristos	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
488975fd0b74Schristos	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
489075fd0b74Schristos	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
489175fd0b74Schristos	_LT_TAGVAR(hardcode_direct, $1)=yes
489275fd0b74Schristos	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
489375fd0b74Schristos	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
489475fd0b74Schristos	# hardcode_minus_L: Not really in the search PATH,
489575fd0b74Schristos	# but as the default location of the library.
489675fd0b74Schristos	_LT_TAGVAR(hardcode_minus_L, $1)=yes
489775fd0b74Schristos      fi
489875fd0b74Schristos      ;;
489975fd0b74Schristos
490075fd0b74Schristos    hpux11*)
490175fd0b74Schristos      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
490275fd0b74Schristos	case $host_cpu in
490375fd0b74Schristos	hppa*64*)
490475fd0b74Schristos	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
490575fd0b74Schristos	  ;;
490675fd0b74Schristos	ia64*)
490775fd0b74Schristos	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
490875fd0b74Schristos	  ;;
490975fd0b74Schristos	*)
491075fd0b74Schristos	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
491175fd0b74Schristos	  ;;
491275fd0b74Schristos	esac
491375fd0b74Schristos      else
491475fd0b74Schristos	case $host_cpu in
491575fd0b74Schristos	hppa*64*)
491675fd0b74Schristos	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
491775fd0b74Schristos	  ;;
491875fd0b74Schristos	ia64*)
491975fd0b74Schristos	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
492075fd0b74Schristos	  ;;
492175fd0b74Schristos	*)
492275fd0b74Schristos	m4_if($1, [], [
492375fd0b74Schristos	  # Older versions of the 11.00 compiler do not understand -b yet
492475fd0b74Schristos	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
492575fd0b74Schristos	  _LT_LINKER_OPTION([if $CC understands -b],
492675fd0b74Schristos	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
492775fd0b74Schristos	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
492875fd0b74Schristos	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
492975fd0b74Schristos	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
493075fd0b74Schristos	  ;;
493175fd0b74Schristos	esac
493275fd0b74Schristos      fi
493375fd0b74Schristos      if test "$with_gnu_ld" = no; then
493475fd0b74Schristos	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
493575fd0b74Schristos	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
493675fd0b74Schristos
493775fd0b74Schristos	case $host_cpu in
493875fd0b74Schristos	hppa*64*|ia64*)
493975fd0b74Schristos	  _LT_TAGVAR(hardcode_direct, $1)=no
494075fd0b74Schristos	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
494175fd0b74Schristos	  ;;
494275fd0b74Schristos	*)
494375fd0b74Schristos	  _LT_TAGVAR(hardcode_direct, $1)=yes
494475fd0b74Schristos	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
494575fd0b74Schristos	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
494675fd0b74Schristos
494775fd0b74Schristos	  # hardcode_minus_L: Not really in the search PATH,
494875fd0b74Schristos	  # but as the default location of the library.
494975fd0b74Schristos	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
495075fd0b74Schristos	  ;;
495175fd0b74Schristos	esac
495275fd0b74Schristos      fi
495375fd0b74Schristos      ;;
495475fd0b74Schristos
495575fd0b74Schristos    irix5* | irix6* | nonstopux*)
495675fd0b74Schristos      if test "$GCC" = yes; then
495775fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
495875fd0b74Schristos	# Try to use the -exported_symbol ld option, if it does not
495975fd0b74Schristos	# work, assume that -exports_file does not work either and
496075fd0b74Schristos	# implicitly export all symbols.
496175fd0b74Schristos        save_LDFLAGS="$LDFLAGS"
496275fd0b74Schristos        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
4963ede78133Schristos        AC_LINK_IFELSE([AC_LANG_SOURCE([int foo(void) {}])],
496475fd0b74Schristos          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
496575fd0b74Schristos        )
496675fd0b74Schristos        LDFLAGS="$save_LDFLAGS"
496775fd0b74Schristos      else
496875fd0b74Schristos	_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'
496975fd0b74Schristos	_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'
497075fd0b74Schristos      fi
497175fd0b74Schristos      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
497275fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
497375fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
497475fd0b74Schristos      _LT_TAGVAR(inherit_rpath, $1)=yes
497575fd0b74Schristos      _LT_TAGVAR(link_all_deplibs, $1)=yes
497675fd0b74Schristos      ;;
497775fd0b74Schristos
497875fd0b74Schristos    netbsd*)
497975fd0b74Schristos      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
498075fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
498175fd0b74Schristos      else
498275fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
498375fd0b74Schristos      fi
498475fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
498575fd0b74Schristos      _LT_TAGVAR(hardcode_direct, $1)=yes
498675fd0b74Schristos      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
498775fd0b74Schristos      ;;
498875fd0b74Schristos
498975fd0b74Schristos    newsos6)
499075fd0b74Schristos      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
499175fd0b74Schristos      _LT_TAGVAR(hardcode_direct, $1)=yes
499275fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
499375fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
499475fd0b74Schristos      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
499575fd0b74Schristos      ;;
499675fd0b74Schristos
499775fd0b74Schristos    *nto* | *qnx*)
499875fd0b74Schristos      ;;
499975fd0b74Schristos
500075fd0b74Schristos    openbsd*)
500175fd0b74Schristos      if test -f /usr/libexec/ld.so; then
500275fd0b74Schristos	_LT_TAGVAR(hardcode_direct, $1)=yes
500375fd0b74Schristos	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
500475fd0b74Schristos	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
500575fd0b74Schristos	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
500675fd0b74Schristos	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
500775fd0b74Schristos	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
500875fd0b74Schristos	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
500975fd0b74Schristos	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
501075fd0b74Schristos	else
501175fd0b74Schristos	  case $host_os in
501275fd0b74Schristos	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
501375fd0b74Schristos	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
501475fd0b74Schristos	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
501575fd0b74Schristos	     ;;
501675fd0b74Schristos	   *)
501775fd0b74Schristos	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
501875fd0b74Schristos	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
501975fd0b74Schristos	     ;;
502075fd0b74Schristos	  esac
502175fd0b74Schristos	fi
502275fd0b74Schristos      else
502375fd0b74Schristos	_LT_TAGVAR(ld_shlibs, $1)=no
502475fd0b74Schristos      fi
502575fd0b74Schristos      ;;
502675fd0b74Schristos
502775fd0b74Schristos    os2*)
502875fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
502975fd0b74Schristos      _LT_TAGVAR(hardcode_minus_L, $1)=yes
503075fd0b74Schristos      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
503175fd0b74Schristos      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
503275fd0b74Schristos      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
503375fd0b74Schristos      ;;
503475fd0b74Schristos
503575fd0b74Schristos    osf3*)
503675fd0b74Schristos      if test "$GCC" = yes; then
503775fd0b74Schristos	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
503875fd0b74Schristos	_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'
503975fd0b74Schristos      else
504075fd0b74Schristos	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
504175fd0b74Schristos	_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'
504275fd0b74Schristos      fi
504375fd0b74Schristos      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
504475fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
504575fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
504675fd0b74Schristos      ;;
504775fd0b74Schristos
504875fd0b74Schristos    osf4* | osf5*)	# as osf3* with the addition of -msym flag
504975fd0b74Schristos      if test "$GCC" = yes; then
505075fd0b74Schristos	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
505175fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
505275fd0b74Schristos	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
505375fd0b74Schristos      else
505475fd0b74Schristos	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
505575fd0b74Schristos	_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'
505675fd0b74Schristos	_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~
505775fd0b74Schristos	$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'
505875fd0b74Schristos
505975fd0b74Schristos	# Both c and cxx compiler support -rpath directly
506075fd0b74Schristos	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
506175fd0b74Schristos      fi
506275fd0b74Schristos      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
506375fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
506475fd0b74Schristos      ;;
506575fd0b74Schristos
506675fd0b74Schristos    solaris*)
506775fd0b74Schristos      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
506875fd0b74Schristos      if test "$GCC" = yes; then
506975fd0b74Schristos	wlarc='${wl}'
507075fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
507175fd0b74Schristos	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
507275fd0b74Schristos	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
507375fd0b74Schristos      else
507475fd0b74Schristos	case `$CC -V 2>&1` in
507575fd0b74Schristos	*"Compilers 5.0"*)
507675fd0b74Schristos	  wlarc=''
507775fd0b74Schristos	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
507875fd0b74Schristos	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
507975fd0b74Schristos	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
508075fd0b74Schristos	  ;;
508175fd0b74Schristos	*)
508275fd0b74Schristos	  wlarc='${wl}'
508375fd0b74Schristos	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
508475fd0b74Schristos	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
508575fd0b74Schristos	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
508675fd0b74Schristos	  ;;
508775fd0b74Schristos	esac
508875fd0b74Schristos      fi
508975fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
509075fd0b74Schristos      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
509175fd0b74Schristos      case $host_os in
509275fd0b74Schristos      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
509375fd0b74Schristos      *)
509475fd0b74Schristos	# The compiler driver will combine and reorder linker options,
509575fd0b74Schristos	# but understands `-z linker_flag'.  GCC discards it without `$wl',
509675fd0b74Schristos	# but is careful enough not to reorder.
509775fd0b74Schristos	# Supported since Solaris 2.6 (maybe 2.5.1?)
509875fd0b74Schristos	if test "$GCC" = yes; then
509975fd0b74Schristos	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
510075fd0b74Schristos	else
510175fd0b74Schristos	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
510275fd0b74Schristos	fi
510375fd0b74Schristos	;;
510475fd0b74Schristos      esac
510575fd0b74Schristos      _LT_TAGVAR(link_all_deplibs, $1)=yes
510675fd0b74Schristos      ;;
510775fd0b74Schristos
510875fd0b74Schristos    sunos4*)
510975fd0b74Schristos      if test "x$host_vendor" = xsequent; then
511075fd0b74Schristos	# Use $CC to link under sequent, because it throws in some extra .o
511175fd0b74Schristos	# files that make .init and .fini sections work.
511275fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
511375fd0b74Schristos      else
511475fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
511575fd0b74Schristos      fi
511675fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
511775fd0b74Schristos      _LT_TAGVAR(hardcode_direct, $1)=yes
511875fd0b74Schristos      _LT_TAGVAR(hardcode_minus_L, $1)=yes
511975fd0b74Schristos      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
512075fd0b74Schristos      ;;
512175fd0b74Schristos
512275fd0b74Schristos    sysv4)
512375fd0b74Schristos      case $host_vendor in
512475fd0b74Schristos	sni)
512575fd0b74Schristos	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
512675fd0b74Schristos	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
512775fd0b74Schristos	;;
512875fd0b74Schristos	siemens)
512975fd0b74Schristos	  ## LD is ld it makes a PLAMLIB
513075fd0b74Schristos	  ## CC just makes a GrossModule.
513175fd0b74Schristos	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
513275fd0b74Schristos	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
513375fd0b74Schristos	  _LT_TAGVAR(hardcode_direct, $1)=no
513475fd0b74Schristos        ;;
513575fd0b74Schristos	motorola)
513675fd0b74Schristos	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
513775fd0b74Schristos	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
513875fd0b74Schristos	;;
513975fd0b74Schristos      esac
514075fd0b74Schristos      runpath_var='LD_RUN_PATH'
514175fd0b74Schristos      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
514275fd0b74Schristos      ;;
514375fd0b74Schristos
514475fd0b74Schristos    sysv4.3*)
514575fd0b74Schristos      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
514675fd0b74Schristos      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
514775fd0b74Schristos      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
514875fd0b74Schristos      ;;
514975fd0b74Schristos
515075fd0b74Schristos    sysv4*MP*)
515175fd0b74Schristos      if test -d /usr/nec; then
515275fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
515375fd0b74Schristos	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
515475fd0b74Schristos	runpath_var=LD_RUN_PATH
515575fd0b74Schristos	hardcode_runpath_var=yes
515675fd0b74Schristos	_LT_TAGVAR(ld_shlibs, $1)=yes
515775fd0b74Schristos      fi
515875fd0b74Schristos      ;;
515975fd0b74Schristos
516075fd0b74Schristos    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
516175fd0b74Schristos      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
516275fd0b74Schristos      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
516375fd0b74Schristos      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
516475fd0b74Schristos      runpath_var='LD_RUN_PATH'
516575fd0b74Schristos
516675fd0b74Schristos      if test "$GCC" = yes; then
516775fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
516875fd0b74Schristos	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
516975fd0b74Schristos      else
517075fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
517175fd0b74Schristos	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
517275fd0b74Schristos      fi
517375fd0b74Schristos      ;;
517475fd0b74Schristos
517575fd0b74Schristos    sysv5* | sco3.2v5* | sco5v6*)
517675fd0b74Schristos      # Note: We can NOT use -z defs as we might desire, because we do not
517775fd0b74Schristos      # link with -lc, and that would cause any symbols used from libc to
517875fd0b74Schristos      # always be unresolved, which means just about no library would
517975fd0b74Schristos      # ever link correctly.  If we're not using GNU ld we use -z text
518075fd0b74Schristos      # though, which does catch some bad symbols but isn't as heavy-handed
518175fd0b74Schristos      # as -z defs.
518275fd0b74Schristos      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
518375fd0b74Schristos      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
518475fd0b74Schristos      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
518575fd0b74Schristos      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
518675fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
518775fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
518875fd0b74Schristos      _LT_TAGVAR(link_all_deplibs, $1)=yes
518975fd0b74Schristos      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
519075fd0b74Schristos      runpath_var='LD_RUN_PATH'
519175fd0b74Schristos
519275fd0b74Schristos      if test "$GCC" = yes; then
519375fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
519475fd0b74Schristos	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
519575fd0b74Schristos      else
519675fd0b74Schristos	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
519775fd0b74Schristos	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
519875fd0b74Schristos      fi
519975fd0b74Schristos      ;;
520075fd0b74Schristos
520175fd0b74Schristos    uts4*)
520275fd0b74Schristos      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
520375fd0b74Schristos      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
520475fd0b74Schristos      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
520575fd0b74Schristos      ;;
520675fd0b74Schristos
520775fd0b74Schristos    *)
520875fd0b74Schristos      _LT_TAGVAR(ld_shlibs, $1)=no
520975fd0b74Schristos      ;;
521075fd0b74Schristos    esac
521175fd0b74Schristos
521275fd0b74Schristos    if test x$host_vendor = xsni; then
521375fd0b74Schristos      case $host in
521475fd0b74Schristos      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
521575fd0b74Schristos	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
521675fd0b74Schristos	;;
521775fd0b74Schristos      esac
521875fd0b74Schristos    fi
521975fd0b74Schristos  fi
522075fd0b74Schristos])
522175fd0b74SchristosAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
522275fd0b74Schristostest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
522375fd0b74Schristos
522475fd0b74Schristos_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
522575fd0b74Schristos
522675fd0b74Schristos_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
522775fd0b74Schristos_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
522875fd0b74Schristos_LT_DECL([], [extract_expsyms_cmds], [2],
522975fd0b74Schristos    [The commands to extract the exported symbol list from a shared archive])
523075fd0b74Schristos
523175fd0b74Schristos#
523275fd0b74Schristos# Do we need to explicitly link libc?
523375fd0b74Schristos#
523475fd0b74Schristoscase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
523575fd0b74Schristosx|xyes)
523675fd0b74Schristos  # Assume -lc should be added
523775fd0b74Schristos  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
523875fd0b74Schristos
523975fd0b74Schristos  if test "$enable_shared" = yes && test "$GCC" = yes; then
524075fd0b74Schristos    case $_LT_TAGVAR(archive_cmds, $1) in
524175fd0b74Schristos    *'~'*)
524275fd0b74Schristos      # FIXME: we may have to deal with multi-command sequences.
524375fd0b74Schristos      ;;
524475fd0b74Schristos    '$CC '*)
524575fd0b74Schristos      # Test whether the compiler implicitly links with -lc since on some
524675fd0b74Schristos      # systems, -lgcc has to come before -lc. If gcc already passes -lc
524775fd0b74Schristos      # to ld, don't add -lc before -lgcc.
524875fd0b74Schristos      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
524975fd0b74Schristos	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
525075fd0b74Schristos	[$RM conftest*
525175fd0b74Schristos	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
525275fd0b74Schristos
525375fd0b74Schristos	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
525475fd0b74Schristos	  soname=conftest
525575fd0b74Schristos	  lib=conftest
525675fd0b74Schristos	  libobjs=conftest.$ac_objext
525775fd0b74Schristos	  deplibs=
525875fd0b74Schristos	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
525975fd0b74Schristos	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
526075fd0b74Schristos	  compiler_flags=-v
526175fd0b74Schristos	  linker_flags=-v
526275fd0b74Schristos	  verstring=
526375fd0b74Schristos	  output_objdir=.
526475fd0b74Schristos	  libname=conftest
526575fd0b74Schristos	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
526675fd0b74Schristos	  _LT_TAGVAR(allow_undefined_flag, $1)=
526775fd0b74Schristos	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
526875fd0b74Schristos	  then
526975fd0b74Schristos	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
527075fd0b74Schristos	  else
527175fd0b74Schristos	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
527275fd0b74Schristos	  fi
527375fd0b74Schristos	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
527475fd0b74Schristos	else
527575fd0b74Schristos	  cat conftest.err 1>&5
527675fd0b74Schristos	fi
527775fd0b74Schristos	$RM conftest*
527875fd0b74Schristos	])
527975fd0b74Schristos      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
528075fd0b74Schristos      ;;
528175fd0b74Schristos    esac
528275fd0b74Schristos  fi
528375fd0b74Schristos  ;;
528475fd0b74Schristosesac
528575fd0b74Schristos
528675fd0b74Schristos_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
528775fd0b74Schristos    [Whether or not to add -lc for building shared libraries])
528875fd0b74Schristos_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
528975fd0b74Schristos    [enable_shared_with_static_runtimes], [0],
529075fd0b74Schristos    [Whether or not to disallow shared libs when runtime libs are static])
529175fd0b74Schristos_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
529275fd0b74Schristos    [Compiler flag to allow reflexive dlopens])
529375fd0b74Schristos_LT_TAGDECL([], [whole_archive_flag_spec], [1],
529475fd0b74Schristos    [Compiler flag to generate shared objects directly from archives])
529575fd0b74Schristos_LT_TAGDECL([], [compiler_needs_object], [1],
529675fd0b74Schristos    [Whether the compiler copes with passing no objects directly])
529775fd0b74Schristos_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
529875fd0b74Schristos    [Create an old-style archive from a shared archive])
529975fd0b74Schristos_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
530075fd0b74Schristos    [Create a temporary old-style archive to link instead of a shared archive])
530175fd0b74Schristos_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
530275fd0b74Schristos_LT_TAGDECL([], [archive_expsym_cmds], [2])
530375fd0b74Schristos_LT_TAGDECL([], [module_cmds], [2],
530475fd0b74Schristos    [Commands used to build a loadable module if different from building
530575fd0b74Schristos    a shared archive.])
530675fd0b74Schristos_LT_TAGDECL([], [module_expsym_cmds], [2])
530775fd0b74Schristos_LT_TAGDECL([], [with_gnu_ld], [1],
530875fd0b74Schristos    [Whether we are building with GNU ld or not])
530975fd0b74Schristos_LT_TAGDECL([], [allow_undefined_flag], [1],
531075fd0b74Schristos    [Flag that allows shared libraries with undefined symbols to be built])
531175fd0b74Schristos_LT_TAGDECL([], [no_undefined_flag], [1],
531275fd0b74Schristos    [Flag that enforces no undefined symbols])
531375fd0b74Schristos_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
531475fd0b74Schristos    [Flag to hardcode $libdir into a binary during linking.
531575fd0b74Schristos    This must work even if $libdir does not exist])
531675fd0b74Schristos_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
531775fd0b74Schristos    [[If ld is used when linking, flag to hardcode $libdir into a binary
531875fd0b74Schristos    during linking.  This must work even if $libdir does not exist]])
531975fd0b74Schristos_LT_TAGDECL([], [hardcode_libdir_separator], [1],
532075fd0b74Schristos    [Whether we need a single "-rpath" flag with a separated argument])
532175fd0b74Schristos_LT_TAGDECL([], [hardcode_direct], [0],
532275fd0b74Schristos    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
532375fd0b74Schristos    DIR into the resulting binary])
532475fd0b74Schristos_LT_TAGDECL([], [hardcode_direct_absolute], [0],
532575fd0b74Schristos    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
532675fd0b74Schristos    DIR into the resulting binary and the resulting library dependency is
532775fd0b74Schristos    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
532875fd0b74Schristos    library is relocated])
532975fd0b74Schristos_LT_TAGDECL([], [hardcode_minus_L], [0],
533075fd0b74Schristos    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
533175fd0b74Schristos    into the resulting binary])
533275fd0b74Schristos_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
533375fd0b74Schristos    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
533475fd0b74Schristos    into the resulting binary])
533575fd0b74Schristos_LT_TAGDECL([], [hardcode_automatic], [0],
533675fd0b74Schristos    [Set to "yes" if building a shared library automatically hardcodes DIR
533775fd0b74Schristos    into the library and all subsequent libraries and executables linked
533875fd0b74Schristos    against it])
533975fd0b74Schristos_LT_TAGDECL([], [inherit_rpath], [0],
534075fd0b74Schristos    [Set to yes if linker adds runtime paths of dependent libraries
534175fd0b74Schristos    to runtime path list])
534275fd0b74Schristos_LT_TAGDECL([], [link_all_deplibs], [0],
534375fd0b74Schristos    [Whether libtool must link a program against all its dependency libraries])
534475fd0b74Schristos_LT_TAGDECL([], [fix_srcfile_path], [1],
534575fd0b74Schristos    [Fix the shell variable $srcfile for the compiler])
534675fd0b74Schristos_LT_TAGDECL([], [always_export_symbols], [0],
534775fd0b74Schristos    [Set to "yes" if exported symbols are required])
534875fd0b74Schristos_LT_TAGDECL([], [export_symbols_cmds], [2],
534975fd0b74Schristos    [The commands to list exported symbols])
535075fd0b74Schristos_LT_TAGDECL([], [exclude_expsyms], [1],
535175fd0b74Schristos    [Symbols that should not be listed in the preloaded symbols])
535275fd0b74Schristos_LT_TAGDECL([], [include_expsyms], [1],
535375fd0b74Schristos    [Symbols that must always be exported])
535475fd0b74Schristos_LT_TAGDECL([], [prelink_cmds], [2],
535575fd0b74Schristos    [Commands necessary for linking programs (against libraries) with templates])
535675fd0b74Schristos_LT_TAGDECL([], [file_list_spec], [1],
535775fd0b74Schristos    [Specify filename containing input files])
535875fd0b74Schristosdnl FIXME: Not yet implemented
535975fd0b74Schristosdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
536075fd0b74Schristosdnl    [Compiler flag to generate thread safe objects])
536175fd0b74Schristos])# _LT_LINKER_SHLIBS
536275fd0b74Schristos
536375fd0b74Schristos
536475fd0b74Schristos# _LT_LANG_C_CONFIG([TAG])
536575fd0b74Schristos# ------------------------
536675fd0b74Schristos# Ensure that the configuration variables for a C compiler are suitably
536775fd0b74Schristos# defined.  These variables are subsequently used by _LT_CONFIG to write
536875fd0b74Schristos# the compiler configuration to `libtool'.
536975fd0b74Schristosm4_defun([_LT_LANG_C_CONFIG],
537075fd0b74Schristos[m4_require([_LT_DECL_EGREP])dnl
537175fd0b74Schristoslt_save_CC="$CC"
537275fd0b74SchristosAC_LANG_PUSH(C)
537375fd0b74Schristos
537475fd0b74Schristos# Source file extension for C test sources.
537575fd0b74Schristosac_ext=c
537675fd0b74Schristos
537775fd0b74Schristos# Object file extension for compiled C test sources.
537875fd0b74Schristosobjext=o
537975fd0b74Schristos_LT_TAGVAR(objext, $1)=$objext
538075fd0b74Schristos
538175fd0b74Schristos# Code to be used in simple compile tests
538275fd0b74Schristoslt_simple_compile_test_code="int some_variable = 0;"
538375fd0b74Schristos
538475fd0b74Schristos# Code to be used in simple link tests
538575fd0b74Schristoslt_simple_link_test_code='int main(){return(0);}'
538675fd0b74Schristos
538775fd0b74Schristos_LT_TAG_COMPILER
538875fd0b74Schristos# Save the default compiler, since it gets overwritten when the other
538975fd0b74Schristos# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
539075fd0b74Schristoscompiler_DEFAULT=$CC
539175fd0b74Schristos
539275fd0b74Schristos# save warnings/boilerplate of simple test code
539375fd0b74Schristos_LT_COMPILER_BOILERPLATE
539475fd0b74Schristos_LT_LINKER_BOILERPLATE
539575fd0b74Schristos
539675fd0b74Schristos## CAVEAT EMPTOR:
539775fd0b74Schristos## There is no encapsulation within the following macros, do not change
539875fd0b74Schristos## the running order or otherwise move them around unless you know exactly
539975fd0b74Schristos## what you are doing...
540075fd0b74Schristosif test -n "$compiler"; then
540175fd0b74Schristos  _LT_COMPILER_NO_RTTI($1)
540275fd0b74Schristos  _LT_COMPILER_PIC($1)
540375fd0b74Schristos  _LT_COMPILER_C_O($1)
540475fd0b74Schristos  _LT_COMPILER_FILE_LOCKS($1)
540575fd0b74Schristos  _LT_LINKER_SHLIBS($1)
540675fd0b74Schristos  _LT_SYS_DYNAMIC_LINKER($1)
540775fd0b74Schristos  _LT_LINKER_HARDCODE_LIBPATH($1)
540875fd0b74Schristos  LT_SYS_DLOPEN_SELF
540975fd0b74Schristos  _LT_CMD_STRIPLIB
541075fd0b74Schristos
541175fd0b74Schristos  # Report which library types will actually be built
541275fd0b74Schristos  AC_MSG_CHECKING([if libtool supports shared libraries])
541375fd0b74Schristos  AC_MSG_RESULT([$can_build_shared])
541475fd0b74Schristos
541575fd0b74Schristos  AC_MSG_CHECKING([whether to build shared libraries])
541675fd0b74Schristos  test "$can_build_shared" = "no" && enable_shared=no
541775fd0b74Schristos
541875fd0b74Schristos  # On AIX, shared libraries and static libraries use the same namespace, and
541975fd0b74Schristos  # are all built from PIC.
542075fd0b74Schristos  case $host_os in
542175fd0b74Schristos  aix3*)
542275fd0b74Schristos    test "$enable_shared" = yes && enable_static=no
542375fd0b74Schristos    if test -n "$RANLIB"; then
542475fd0b74Schristos      archive_cmds="$archive_cmds~\$RANLIB \$lib"
542575fd0b74Schristos      postinstall_cmds='$RANLIB $lib'
542675fd0b74Schristos    fi
542775fd0b74Schristos    ;;
542875fd0b74Schristos
542975fd0b74Schristos  aix[[4-9]]*)
543075fd0b74Schristos    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
543175fd0b74Schristos      test "$enable_shared" = yes && enable_static=no
543275fd0b74Schristos    fi
543375fd0b74Schristos    ;;
543475fd0b74Schristos  esac
543575fd0b74Schristos  AC_MSG_RESULT([$enable_shared])
543675fd0b74Schristos
543775fd0b74Schristos  AC_MSG_CHECKING([whether to build static libraries])
543875fd0b74Schristos  # Make sure either enable_shared or enable_static is yes.
543975fd0b74Schristos  test "$enable_shared" = yes || enable_static=yes
544075fd0b74Schristos  AC_MSG_RESULT([$enable_static])
544175fd0b74Schristos
544275fd0b74Schristos  _LT_CONFIG($1)
544375fd0b74Schristosfi
544475fd0b74SchristosAC_LANG_POP
544575fd0b74SchristosCC="$lt_save_CC"
544675fd0b74Schristos])# _LT_LANG_C_CONFIG
544775fd0b74Schristos
544875fd0b74Schristos
544975fd0b74Schristos# _LT_LANG_CXX_CONFIG([TAG])
545075fd0b74Schristos# --------------------------
545175fd0b74Schristos# Ensure that the configuration variables for a C++ compiler are suitably
545275fd0b74Schristos# defined.  These variables are subsequently used by _LT_CONFIG to write
545375fd0b74Schristos# the compiler configuration to `libtool'.
545475fd0b74Schristosm4_defun([_LT_LANG_CXX_CONFIG],
545575fd0b74Schristos[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
545675fd0b74Schristosm4_require([_LT_DECL_EGREP])dnl
545775fd0b74Schristosif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
545875fd0b74Schristos    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
545975fd0b74Schristos    (test "X$CXX" != "Xg++"))) ; then
546075fd0b74Schristos  AC_PROG_CXXCPP
546175fd0b74Schristoselse
546275fd0b74Schristos  _lt_caught_CXX_error=yes
546375fd0b74Schristosfi
546475fd0b74Schristos
546575fd0b74SchristosAC_LANG_PUSH(C++)
546675fd0b74Schristos_LT_TAGVAR(archive_cmds_need_lc, $1)=no
546775fd0b74Schristos_LT_TAGVAR(allow_undefined_flag, $1)=
546875fd0b74Schristos_LT_TAGVAR(always_export_symbols, $1)=no
546975fd0b74Schristos_LT_TAGVAR(archive_expsym_cmds, $1)=
547075fd0b74Schristos_LT_TAGVAR(compiler_needs_object, $1)=no
547175fd0b74Schristos_LT_TAGVAR(export_dynamic_flag_spec, $1)=
547275fd0b74Schristos_LT_TAGVAR(hardcode_direct, $1)=no
547375fd0b74Schristos_LT_TAGVAR(hardcode_direct_absolute, $1)=no
547475fd0b74Schristos_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
547575fd0b74Schristos_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
547675fd0b74Schristos_LT_TAGVAR(hardcode_libdir_separator, $1)=
547775fd0b74Schristos_LT_TAGVAR(hardcode_minus_L, $1)=no
547875fd0b74Schristos_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
547975fd0b74Schristos_LT_TAGVAR(hardcode_automatic, $1)=no
548075fd0b74Schristos_LT_TAGVAR(inherit_rpath, $1)=no
548175fd0b74Schristos_LT_TAGVAR(module_cmds, $1)=
548275fd0b74Schristos_LT_TAGVAR(module_expsym_cmds, $1)=
548375fd0b74Schristos_LT_TAGVAR(link_all_deplibs, $1)=unknown
548475fd0b74Schristos_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
548575fd0b74Schristos_LT_TAGVAR(reload_flag, $1)=$reload_flag
548675fd0b74Schristos_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
548775fd0b74Schristos_LT_TAGVAR(no_undefined_flag, $1)=
548875fd0b74Schristos_LT_TAGVAR(whole_archive_flag_spec, $1)=
548975fd0b74Schristos_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
549075fd0b74Schristos
549175fd0b74Schristos# Source file extension for C++ test sources.
549275fd0b74Schristosac_ext=cpp
549375fd0b74Schristos
549475fd0b74Schristos# Object file extension for compiled C++ test sources.
549575fd0b74Schristosobjext=o
549675fd0b74Schristos_LT_TAGVAR(objext, $1)=$objext
549775fd0b74Schristos
549875fd0b74Schristos# No sense in running all these tests if we already determined that
549975fd0b74Schristos# the CXX compiler isn't working.  Some variables (like enable_shared)
550075fd0b74Schristos# are currently assumed to apply to all compilers on this platform,
550175fd0b74Schristos# and will be corrupted by setting them based on a non-working compiler.
550275fd0b74Schristosif test "$_lt_caught_CXX_error" != yes; then
550375fd0b74Schristos  # Code to be used in simple compile tests
550475fd0b74Schristos  lt_simple_compile_test_code="int some_variable = 0;"
550575fd0b74Schristos
550675fd0b74Schristos  # Code to be used in simple link tests
550775fd0b74Schristos  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
550875fd0b74Schristos
550975fd0b74Schristos  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
551075fd0b74Schristos  _LT_TAG_COMPILER
551175fd0b74Schristos
551275fd0b74Schristos  # save warnings/boilerplate of simple test code
551375fd0b74Schristos  _LT_COMPILER_BOILERPLATE
551475fd0b74Schristos  _LT_LINKER_BOILERPLATE
551575fd0b74Schristos
551675fd0b74Schristos  # Allow CC to be a program name with arguments.
551775fd0b74Schristos  lt_save_CC=$CC
551875fd0b74Schristos  lt_save_LD=$LD
551975fd0b74Schristos  lt_save_GCC=$GCC
552075fd0b74Schristos  GCC=$GXX
552175fd0b74Schristos  lt_save_with_gnu_ld=$with_gnu_ld
552275fd0b74Schristos  lt_save_path_LD=$lt_cv_path_LD
552375fd0b74Schristos  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
552475fd0b74Schristos    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
552575fd0b74Schristos  else
552675fd0b74Schristos    $as_unset lt_cv_prog_gnu_ld
552775fd0b74Schristos  fi
552875fd0b74Schristos  if test -n "${lt_cv_path_LDCXX+set}"; then
552975fd0b74Schristos    lt_cv_path_LD=$lt_cv_path_LDCXX
553075fd0b74Schristos  else
553175fd0b74Schristos    $as_unset lt_cv_path_LD
553275fd0b74Schristos  fi
553375fd0b74Schristos  test -z "${LDCXX+set}" || LD=$LDCXX
553475fd0b74Schristos  CC=${CXX-"c++"}
553575fd0b74Schristos  compiler=$CC
553675fd0b74Schristos  _LT_TAGVAR(compiler, $1)=$CC
553775fd0b74Schristos  _LT_CC_BASENAME([$compiler])
553875fd0b74Schristos
553975fd0b74Schristos  if test -n "$compiler"; then
554075fd0b74Schristos    # We don't want -fno-exception when compiling C++ code, so set the
554175fd0b74Schristos    # no_builtin_flag separately
554275fd0b74Schristos    if test "$GXX" = yes; then
554375fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
554475fd0b74Schristos    else
554575fd0b74Schristos      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
554675fd0b74Schristos    fi
554775fd0b74Schristos
554875fd0b74Schristos    if test "$GXX" = yes; then
554975fd0b74Schristos      # Set up default GNU C++ configuration
555075fd0b74Schristos
555175fd0b74Schristos      LT_PATH_LD
555275fd0b74Schristos
555375fd0b74Schristos      # Check if GNU C++ uses GNU ld as the underlying linker, since the
555475fd0b74Schristos      # archiving commands below assume that GNU ld is being used.
555575fd0b74Schristos      if test "$with_gnu_ld" = yes; then
555675fd0b74Schristos        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
555775fd0b74Schristos        _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'
555875fd0b74Schristos
555975fd0b74Schristos        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
556075fd0b74Schristos        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
556175fd0b74Schristos
556275fd0b74Schristos        # If archive_cmds runs LD, not CC, wlarc should be empty
556375fd0b74Schristos        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
556475fd0b74Schristos        #     investigate it a little bit more. (MM)
556575fd0b74Schristos        wlarc='${wl}'
556675fd0b74Schristos
556775fd0b74Schristos        # ancient GNU ld didn't support --whole-archive et. al.
556875fd0b74Schristos        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
556975fd0b74Schristos	  $GREP 'no-whole-archive' > /dev/null; then
557075fd0b74Schristos          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
557175fd0b74Schristos        else
557275fd0b74Schristos          _LT_TAGVAR(whole_archive_flag_spec, $1)=
557375fd0b74Schristos        fi
557475fd0b74Schristos      else
557575fd0b74Schristos        with_gnu_ld=no
557675fd0b74Schristos        wlarc=
557775fd0b74Schristos
557875fd0b74Schristos        # A generic and very simple default shared library creation
557975fd0b74Schristos        # command for GNU C++ for the case where it uses the native
558075fd0b74Schristos        # linker, instead of GNU ld.  If possible, this setting should
558175fd0b74Schristos        # overridden to take advantage of the native linker features on
558275fd0b74Schristos        # the platform it is being used on.
558375fd0b74Schristos        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
558475fd0b74Schristos      fi
558575fd0b74Schristos
558675fd0b74Schristos      # Commands to make compiler produce verbose output that lists
558775fd0b74Schristos      # what "hidden" libraries, object files and flags are used when
558875fd0b74Schristos      # linking a shared library.
558975fd0b74Schristos      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
559075fd0b74Schristos
559175fd0b74Schristos    else
559275fd0b74Schristos      GXX=no
559375fd0b74Schristos      with_gnu_ld=no
559475fd0b74Schristos      wlarc=
559575fd0b74Schristos    fi
559675fd0b74Schristos
559775fd0b74Schristos    # PORTME: fill in a description of your system's C++ link characteristics
559875fd0b74Schristos    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
559975fd0b74Schristos    _LT_TAGVAR(ld_shlibs, $1)=yes
560075fd0b74Schristos    case $host_os in
560175fd0b74Schristos      aix3*)
560275fd0b74Schristos        # FIXME: insert proper C++ library support
560375fd0b74Schristos        _LT_TAGVAR(ld_shlibs, $1)=no
560475fd0b74Schristos        ;;
560575fd0b74Schristos      aix[[4-9]]*)
560675fd0b74Schristos        if test "$host_cpu" = ia64; then
560775fd0b74Schristos          # On IA64, the linker does run time linking by default, so we don't
560875fd0b74Schristos          # have to do anything special.
560975fd0b74Schristos          aix_use_runtimelinking=no
561075fd0b74Schristos          exp_sym_flag='-Bexport'
561175fd0b74Schristos          no_entry_flag=""
561275fd0b74Schristos        else
561375fd0b74Schristos          aix_use_runtimelinking=no
561475fd0b74Schristos
561575fd0b74Schristos          # Test if we are trying to use run time linking or normal
561675fd0b74Schristos          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
561775fd0b74Schristos          # need to do runtime linking.
561875fd0b74Schristos          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
561975fd0b74Schristos	    for ld_flag in $LDFLAGS; do
562075fd0b74Schristos	      case $ld_flag in
562175fd0b74Schristos	      *-brtl*)
562275fd0b74Schristos	        aix_use_runtimelinking=yes
562375fd0b74Schristos	        break
562475fd0b74Schristos	        ;;
562575fd0b74Schristos	      esac
562675fd0b74Schristos	    done
562775fd0b74Schristos	    ;;
562875fd0b74Schristos          esac
562975fd0b74Schristos
563075fd0b74Schristos          exp_sym_flag='-bexport'
563175fd0b74Schristos          no_entry_flag='-bnoentry'
563275fd0b74Schristos        fi
563375fd0b74Schristos
563475fd0b74Schristos        # When large executables or shared objects are built, AIX ld can
563575fd0b74Schristos        # have problems creating the table of contents.  If linking a library
563675fd0b74Schristos        # or program results in "error TOC overflow" add -mminimal-toc to
563775fd0b74Schristos        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
563875fd0b74Schristos        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
563975fd0b74Schristos
564075fd0b74Schristos        _LT_TAGVAR(archive_cmds, $1)=''
564175fd0b74Schristos        _LT_TAGVAR(hardcode_direct, $1)=yes
564275fd0b74Schristos        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
564375fd0b74Schristos        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
564475fd0b74Schristos        _LT_TAGVAR(link_all_deplibs, $1)=yes
564575fd0b74Schristos        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
564675fd0b74Schristos
564775fd0b74Schristos        if test "$GXX" = yes; then
564875fd0b74Schristos          case $host_os in aix4.[[012]]|aix4.[[012]].*)
564975fd0b74Schristos          # We only want to do this on AIX 4.2 and lower, the check
565075fd0b74Schristos          # below for broken collect2 doesn't work under 4.3+
565175fd0b74Schristos	  collect2name=`${CC} -print-prog-name=collect2`
565275fd0b74Schristos	  if test -f "$collect2name" &&
565375fd0b74Schristos	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
565475fd0b74Schristos	  then
565575fd0b74Schristos	    # We have reworked collect2
565675fd0b74Schristos	    :
565775fd0b74Schristos	  else
565875fd0b74Schristos	    # We have old collect2
565975fd0b74Schristos	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
566075fd0b74Schristos	    # It fails to find uninstalled libraries when the uninstalled
566175fd0b74Schristos	    # path is not listed in the libpath.  Setting hardcode_minus_L
566275fd0b74Schristos	    # to unsupported forces relinking
566375fd0b74Schristos	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
566475fd0b74Schristos	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
566575fd0b74Schristos	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
566675fd0b74Schristos	  fi
566775fd0b74Schristos          esac
566875fd0b74Schristos          shared_flag='-shared'
566975fd0b74Schristos	  if test "$aix_use_runtimelinking" = yes; then
567075fd0b74Schristos	    shared_flag="$shared_flag "'${wl}-G'
567175fd0b74Schristos	  fi
567275fd0b74Schristos        else
567375fd0b74Schristos          # not using gcc
567475fd0b74Schristos          if test "$host_cpu" = ia64; then
567575fd0b74Schristos	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
567675fd0b74Schristos	  # chokes on -Wl,-G. The following line is correct:
567775fd0b74Schristos	  shared_flag='-G'
567875fd0b74Schristos          else
567975fd0b74Schristos	    if test "$aix_use_runtimelinking" = yes; then
568075fd0b74Schristos	      shared_flag='${wl}-G'
568175fd0b74Schristos	    else
568275fd0b74Schristos	      shared_flag='${wl}-bM:SRE'
568375fd0b74Schristos	    fi
568475fd0b74Schristos          fi
568575fd0b74Schristos        fi
568675fd0b74Schristos
568775fd0b74Schristos        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
568875fd0b74Schristos        # It seems that -bexpall does not export symbols beginning with
568975fd0b74Schristos        # underscore (_), so it is better to generate a list of symbols to
569075fd0b74Schristos	# export.
569175fd0b74Schristos        _LT_TAGVAR(always_export_symbols, $1)=yes
569275fd0b74Schristos        if test "$aix_use_runtimelinking" = yes; then
569375fd0b74Schristos          # Warning - without using the other runtime loading flags (-brtl),
569475fd0b74Schristos          # -berok will link without error, but may produce a broken library.
569575fd0b74Schristos          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
569675fd0b74Schristos          # Determine the default libpath from the value encoded in an empty
569775fd0b74Schristos          # executable.
569875fd0b74Schristos          _LT_SYS_MODULE_PATH_AIX
569975fd0b74Schristos          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
570075fd0b74Schristos
570175fd0b74Schristos          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
570275fd0b74Schristos        else
570375fd0b74Schristos          if test "$host_cpu" = ia64; then
570475fd0b74Schristos	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
570575fd0b74Schristos	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
570675fd0b74Schristos	    _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"
570775fd0b74Schristos          else
570875fd0b74Schristos	    # Determine the default libpath from the value encoded in an
570975fd0b74Schristos	    # empty executable.
571075fd0b74Schristos	    _LT_SYS_MODULE_PATH_AIX
571175fd0b74Schristos	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
571275fd0b74Schristos	    # Warning - without using the other run time loading flags,
571375fd0b74Schristos	    # -berok will link without error, but may produce a broken library.
571475fd0b74Schristos	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
571575fd0b74Schristos	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
571675fd0b74Schristos	    if test "$with_gnu_ld" = yes; then
571775fd0b74Schristos	      # We only use this code for GNU lds that support --whole-archive.
571875fd0b74Schristos	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
571975fd0b74Schristos	    else
572075fd0b74Schristos	      # Exported symbols can be pulled into shared objects from archives
572175fd0b74Schristos	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
572275fd0b74Schristos	    fi
572375fd0b74Schristos	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
572475fd0b74Schristos	    # This is similar to how AIX traditionally builds its shared
572575fd0b74Schristos	    # libraries.
572675fd0b74Schristos	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
572775fd0b74Schristos          fi
572875fd0b74Schristos        fi
572975fd0b74Schristos        ;;
573075fd0b74Schristos
573175fd0b74Schristos      beos*)
573275fd0b74Schristos	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
573375fd0b74Schristos	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
573475fd0b74Schristos	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
573575fd0b74Schristos	  # support --undefined.  This deserves some investigation.  FIXME
573675fd0b74Schristos	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
573775fd0b74Schristos	else
573875fd0b74Schristos	  _LT_TAGVAR(ld_shlibs, $1)=no
573975fd0b74Schristos	fi
574075fd0b74Schristos	;;
574175fd0b74Schristos
574275fd0b74Schristos      chorus*)
574375fd0b74Schristos        case $cc_basename in
574475fd0b74Schristos          *)
574575fd0b74Schristos	  # FIXME: insert proper C++ library support
574675fd0b74Schristos	  _LT_TAGVAR(ld_shlibs, $1)=no
574775fd0b74Schristos	  ;;
574875fd0b74Schristos        esac
574975fd0b74Schristos        ;;
575075fd0b74Schristos
575175fd0b74Schristos      cygwin* | mingw* | pw32* | cegcc*)
575275fd0b74Schristos        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
575375fd0b74Schristos        # as there is no search path for DLLs.
575475fd0b74Schristos        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
575575fd0b74Schristos        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
575675fd0b74Schristos        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
575775fd0b74Schristos        _LT_TAGVAR(always_export_symbols, $1)=no
575875fd0b74Schristos        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
575975fd0b74Schristos
576075fd0b74Schristos        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
576175fd0b74Schristos          _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'
576275fd0b74Schristos          # If the export-symbols file already is a .def file (1st line
576375fd0b74Schristos          # is EXPORTS), use it as is; otherwise, prepend...
576475fd0b74Schristos          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
576575fd0b74Schristos	    cp $export_symbols $output_objdir/$soname.def;
576675fd0b74Schristos          else
576775fd0b74Schristos	    echo EXPORTS > $output_objdir/$soname.def;
576875fd0b74Schristos	    cat $export_symbols >> $output_objdir/$soname.def;
576975fd0b74Schristos          fi~
577075fd0b74Schristos          $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'
577175fd0b74Schristos        else
577275fd0b74Schristos          _LT_TAGVAR(ld_shlibs, $1)=no
577375fd0b74Schristos        fi
577475fd0b74Schristos        ;;
577575fd0b74Schristos      darwin* | rhapsody*)
577675fd0b74Schristos        _LT_DARWIN_LINKER_FEATURES($1)
577775fd0b74Schristos	;;
577875fd0b74Schristos
577975fd0b74Schristos      dgux*)
578075fd0b74Schristos        case $cc_basename in
578175fd0b74Schristos          ec++*)
578275fd0b74Schristos	    # FIXME: insert proper C++ library support
578375fd0b74Schristos	    _LT_TAGVAR(ld_shlibs, $1)=no
578475fd0b74Schristos	    ;;
578575fd0b74Schristos          ghcx*)
578675fd0b74Schristos	    # Green Hills C++ Compiler
578775fd0b74Schristos	    # FIXME: insert proper C++ library support
578875fd0b74Schristos	    _LT_TAGVAR(ld_shlibs, $1)=no
578975fd0b74Schristos	    ;;
579075fd0b74Schristos          *)
579175fd0b74Schristos	    # FIXME: insert proper C++ library support
579275fd0b74Schristos	    _LT_TAGVAR(ld_shlibs, $1)=no
579375fd0b74Schristos	    ;;
579475fd0b74Schristos        esac
579575fd0b74Schristos        ;;
579675fd0b74Schristos
579775fd0b74Schristos      freebsd2.*)
579875fd0b74Schristos        # C++ shared libraries reported to be fairly broken before
579975fd0b74Schristos	# switch to ELF
580075fd0b74Schristos        _LT_TAGVAR(ld_shlibs, $1)=no
580175fd0b74Schristos        ;;
580275fd0b74Schristos
580375fd0b74Schristos      freebsd-elf*)
580475fd0b74Schristos        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
580575fd0b74Schristos        ;;
580675fd0b74Schristos
580775fd0b74Schristos      freebsd* | dragonfly*)
580875fd0b74Schristos        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
580975fd0b74Schristos        # conventions
581075fd0b74Schristos        _LT_TAGVAR(ld_shlibs, $1)=yes
581175fd0b74Schristos        ;;
581275fd0b74Schristos
581375fd0b74Schristos      gnu*)
581475fd0b74Schristos        ;;
581575fd0b74Schristos
581675fd0b74Schristos      haiku*)
581775fd0b74Schristos        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
581875fd0b74Schristos        _LT_TAGVAR(link_all_deplibs, $1)=yes
581975fd0b74Schristos        ;;
582075fd0b74Schristos
582175fd0b74Schristos      hpux9*)
582275fd0b74Schristos        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
582375fd0b74Schristos        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
582475fd0b74Schristos        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
582575fd0b74Schristos        _LT_TAGVAR(hardcode_direct, $1)=yes
582675fd0b74Schristos        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
582775fd0b74Schristos				             # but as the default
582875fd0b74Schristos				             # location of the library.
582975fd0b74Schristos
583075fd0b74Schristos        case $cc_basename in
583175fd0b74Schristos          CC*)
583275fd0b74Schristos            # FIXME: insert proper C++ library support
583375fd0b74Schristos            _LT_TAGVAR(ld_shlibs, $1)=no
583475fd0b74Schristos            ;;
583575fd0b74Schristos          aCC*)
583675fd0b74Schristos            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
583775fd0b74Schristos            # Commands to make compiler produce verbose output that lists
583875fd0b74Schristos            # what "hidden" libraries, object files and flags are used when
583975fd0b74Schristos            # linking a shared library.
584075fd0b74Schristos            #
584175fd0b74Schristos            # There doesn't appear to be a way to prevent this compiler from
584275fd0b74Schristos            # explicitly linking system object files so we need to strip them
584375fd0b74Schristos            # from the output so that they don't get included in the library
584475fd0b74Schristos            # dependencies.
584575fd0b74Schristos            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"'
584675fd0b74Schristos            ;;
584775fd0b74Schristos          *)
584875fd0b74Schristos            if test "$GXX" = yes; then
584975fd0b74Schristos              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
585075fd0b74Schristos            else
585175fd0b74Schristos              # FIXME: insert proper C++ library support
585275fd0b74Schristos              _LT_TAGVAR(ld_shlibs, $1)=no
585375fd0b74Schristos            fi
585475fd0b74Schristos            ;;
585575fd0b74Schristos        esac
585675fd0b74Schristos        ;;
585775fd0b74Schristos
585875fd0b74Schristos      hpux10*|hpux11*)
585975fd0b74Schristos        if test $with_gnu_ld = no; then
586075fd0b74Schristos	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
586175fd0b74Schristos	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
586275fd0b74Schristos
586375fd0b74Schristos          case $host_cpu in
586475fd0b74Schristos            hppa*64*|ia64*)
586575fd0b74Schristos              ;;
586675fd0b74Schristos            *)
586775fd0b74Schristos	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
586875fd0b74Schristos              ;;
586975fd0b74Schristos          esac
587075fd0b74Schristos        fi
587175fd0b74Schristos        case $host_cpu in
587275fd0b74Schristos          hppa*64*|ia64*)
587375fd0b74Schristos            _LT_TAGVAR(hardcode_direct, $1)=no
587475fd0b74Schristos            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
587575fd0b74Schristos            ;;
587675fd0b74Schristos          *)
587775fd0b74Schristos            _LT_TAGVAR(hardcode_direct, $1)=yes
587875fd0b74Schristos            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
587975fd0b74Schristos            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
588075fd0b74Schristos					         # but as the default
588175fd0b74Schristos					         # location of the library.
588275fd0b74Schristos            ;;
588375fd0b74Schristos        esac
588475fd0b74Schristos
588575fd0b74Schristos        case $cc_basename in
588675fd0b74Schristos          CC*)
588775fd0b74Schristos	    # FIXME: insert proper C++ library support
588875fd0b74Schristos	    _LT_TAGVAR(ld_shlibs, $1)=no
588975fd0b74Schristos	    ;;
589075fd0b74Schristos          aCC*)
589175fd0b74Schristos	    case $host_cpu in
589275fd0b74Schristos	      hppa*64*)
589375fd0b74Schristos	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
589475fd0b74Schristos	        ;;
589575fd0b74Schristos	      ia64*)
589675fd0b74Schristos	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
589775fd0b74Schristos	        ;;
589875fd0b74Schristos	      *)
589975fd0b74Schristos	        _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'
590075fd0b74Schristos	        ;;
590175fd0b74Schristos	    esac
590275fd0b74Schristos	    # Commands to make compiler produce verbose output that lists
590375fd0b74Schristos	    # what "hidden" libraries, object files and flags are used when
590475fd0b74Schristos	    # linking a shared library.
590575fd0b74Schristos	    #
590675fd0b74Schristos	    # There doesn't appear to be a way to prevent this compiler from
590775fd0b74Schristos	    # explicitly linking system object files so we need to strip them
590875fd0b74Schristos	    # from the output so that they don't get included in the library
590975fd0b74Schristos	    # dependencies.
591075fd0b74Schristos	    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"'
591175fd0b74Schristos	    ;;
591275fd0b74Schristos          *)
591375fd0b74Schristos	    if test "$GXX" = yes; then
591475fd0b74Schristos	      if test $with_gnu_ld = no; then
591575fd0b74Schristos	        case $host_cpu in
591675fd0b74Schristos	          hppa*64*)
591775fd0b74Schristos	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
591875fd0b74Schristos	            ;;
591975fd0b74Schristos	          ia64*)
592075fd0b74Schristos	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
592175fd0b74Schristos	            ;;
592275fd0b74Schristos	          *)
592375fd0b74Schristos	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
592475fd0b74Schristos	            ;;
592575fd0b74Schristos	        esac
592675fd0b74Schristos	      fi
592775fd0b74Schristos	    else
592875fd0b74Schristos	      # FIXME: insert proper C++ library support
592975fd0b74Schristos	      _LT_TAGVAR(ld_shlibs, $1)=no
593075fd0b74Schristos	    fi
593175fd0b74Schristos	    ;;
593275fd0b74Schristos        esac
593375fd0b74Schristos        ;;
593475fd0b74Schristos
593575fd0b74Schristos      interix[[3-9]]*)
593675fd0b74Schristos	_LT_TAGVAR(hardcode_direct, $1)=no
593775fd0b74Schristos	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
593875fd0b74Schristos	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
593975fd0b74Schristos	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
594075fd0b74Schristos	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
594175fd0b74Schristos	# Instead, shared libraries are loaded at an image base (0x10000000 by
594275fd0b74Schristos	# default) and relocated if they conflict, which is a slow very memory
594375fd0b74Schristos	# consuming and fragmenting process.  To avoid this, we pick a random,
594475fd0b74Schristos	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
594575fd0b74Schristos	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
594675fd0b74Schristos	_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'
594775fd0b74Schristos	_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'
594875fd0b74Schristos	;;
594975fd0b74Schristos      irix5* | irix6*)
595075fd0b74Schristos        case $cc_basename in
595175fd0b74Schristos          CC*)
595275fd0b74Schristos	    # SGI C++
595375fd0b74Schristos	    _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'
595475fd0b74Schristos
595575fd0b74Schristos	    # Archives containing C++ object files must be created using
595675fd0b74Schristos	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
595775fd0b74Schristos	    # necessary to make sure instantiated templates are included
595875fd0b74Schristos	    # in the archive.
595975fd0b74Schristos	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
596075fd0b74Schristos	    ;;
596175fd0b74Schristos          *)
596275fd0b74Schristos	    if test "$GXX" = yes; then
596375fd0b74Schristos	      if test "$with_gnu_ld" = no; then
596475fd0b74Schristos	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
596575fd0b74Schristos	      else
596675fd0b74Schristos	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
596775fd0b74Schristos	      fi
596875fd0b74Schristos	    fi
596975fd0b74Schristos	    _LT_TAGVAR(link_all_deplibs, $1)=yes
597075fd0b74Schristos	    ;;
597175fd0b74Schristos        esac
597275fd0b74Schristos        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
597375fd0b74Schristos        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
597475fd0b74Schristos        _LT_TAGVAR(inherit_rpath, $1)=yes
597575fd0b74Schristos        ;;
597675fd0b74Schristos
597775fd0b74Schristos      linux* | k*bsd*-gnu | kopensolaris*-gnu)
597875fd0b74Schristos        case $cc_basename in
597975fd0b74Schristos          KCC*)
598075fd0b74Schristos	    # Kuck and Associates, Inc. (KAI) C++ Compiler
598175fd0b74Schristos
598275fd0b74Schristos	    # KCC will only create a shared library if the output file
598375fd0b74Schristos	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
598475fd0b74Schristos	    # to its proper name (with version) after linking.
598575fd0b74Schristos	    _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'
598675fd0b74Schristos	    _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'
598775fd0b74Schristos	    # Commands to make compiler produce verbose output that lists
598875fd0b74Schristos	    # what "hidden" libraries, object files and flags are used when
598975fd0b74Schristos	    # linking a shared library.
599075fd0b74Schristos	    #
599175fd0b74Schristos	    # There doesn't appear to be a way to prevent this compiler from
599275fd0b74Schristos	    # explicitly linking system object files so we need to strip them
599375fd0b74Schristos	    # from the output so that they don't get included in the library
599475fd0b74Schristos	    # dependencies.
599575fd0b74Schristos	    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"'
599675fd0b74Schristos
599775fd0b74Schristos	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
599875fd0b74Schristos	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
599975fd0b74Schristos
600075fd0b74Schristos	    # Archives containing C++ object files must be created using
600175fd0b74Schristos	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
600275fd0b74Schristos	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
600375fd0b74Schristos	    ;;
600475fd0b74Schristos	  icpc* | ecpc* )
600575fd0b74Schristos	    # Intel C++
600675fd0b74Schristos	    with_gnu_ld=yes
600775fd0b74Schristos	    # version 8.0 and above of icpc choke on multiply defined symbols
600875fd0b74Schristos	    # if we add $predep_objects and $postdep_objects, however 7.1 and
600975fd0b74Schristos	    # earlier do not add the objects themselves.
601075fd0b74Schristos	    case `$CC -V 2>&1` in
601175fd0b74Schristos	      *"Version 7."*)
601275fd0b74Schristos	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
601375fd0b74Schristos		_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'
601475fd0b74Schristos		;;
601575fd0b74Schristos	      *)  # Version 8.0 or newer
601675fd0b74Schristos	        tmp_idyn=
601775fd0b74Schristos	        case $host_cpu in
601875fd0b74Schristos		  ia64*) tmp_idyn=' -i_dynamic';;
601975fd0b74Schristos		esac
602075fd0b74Schristos	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
602175fd0b74Schristos		_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'
602275fd0b74Schristos		;;
602375fd0b74Schristos	    esac
602475fd0b74Schristos	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
602575fd0b74Schristos	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
602675fd0b74Schristos	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
602775fd0b74Schristos	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
602875fd0b74Schristos	    ;;
602975fd0b74Schristos          pgCC* | pgcpp*)
603075fd0b74Schristos            # Portland Group C++ compiler
603175fd0b74Schristos	    case `$CC -V` in
603275fd0b74Schristos	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
603375fd0b74Schristos	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
603475fd0b74Schristos		rm -rf $tpldir~
603575fd0b74Schristos		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
603675fd0b74Schristos		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
603775fd0b74Schristos	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
603875fd0b74Schristos		rm -rf $tpldir~
603975fd0b74Schristos		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
604075fd0b74Schristos		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
604175fd0b74Schristos		$RANLIB $oldlib'
604275fd0b74Schristos	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
604375fd0b74Schristos		rm -rf $tpldir~
604475fd0b74Schristos		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
604575fd0b74Schristos		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
604675fd0b74Schristos	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
604775fd0b74Schristos		rm -rf $tpldir~
604875fd0b74Schristos		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
604975fd0b74Schristos		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
605075fd0b74Schristos	      ;;
605175fd0b74Schristos	    *) # Version 6 and above use weak symbols
605275fd0b74Schristos	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
605375fd0b74Schristos	      _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'
605475fd0b74Schristos	      ;;
605575fd0b74Schristos	    esac
605675fd0b74Schristos
605775fd0b74Schristos	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
605875fd0b74Schristos	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
605975fd0b74Schristos	    _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'
606075fd0b74Schristos            ;;
606175fd0b74Schristos	  cxx*)
606275fd0b74Schristos	    # Compaq C++
606375fd0b74Schristos	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
606475fd0b74Schristos	    _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'
606575fd0b74Schristos
606675fd0b74Schristos	    runpath_var=LD_RUN_PATH
606775fd0b74Schristos	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
606875fd0b74Schristos	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
606975fd0b74Schristos
607075fd0b74Schristos	    # Commands to make compiler produce verbose output that lists
607175fd0b74Schristos	    # what "hidden" libraries, object files and flags are used when
607275fd0b74Schristos	    # linking a shared library.
607375fd0b74Schristos	    #
607475fd0b74Schristos	    # There doesn't appear to be a way to prevent this compiler from
607575fd0b74Schristos	    # explicitly linking system object files so we need to strip them
607675fd0b74Schristos	    # from the output so that they don't get included in the library
607775fd0b74Schristos	    # dependencies.
607875fd0b74Schristos	    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'
607975fd0b74Schristos	    ;;
608075fd0b74Schristos	  xl* | mpixl* | bgxl*)
608175fd0b74Schristos	    # IBM XL 8.0 on PPC, with GNU ld
608275fd0b74Schristos	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
608375fd0b74Schristos	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
608475fd0b74Schristos	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
608575fd0b74Schristos	    if test "x$supports_anon_versioning" = xyes; then
608675fd0b74Schristos	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
608775fd0b74Schristos		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
608875fd0b74Schristos		echo "local: *; };" >> $output_objdir/$libname.ver~
608975fd0b74Schristos		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
609075fd0b74Schristos	    fi
609175fd0b74Schristos	    ;;
609275fd0b74Schristos	  *)
609375fd0b74Schristos	    case `$CC -V 2>&1 | sed 5q` in
609475fd0b74Schristos	    *Sun\ C*)
609575fd0b74Schristos	      # Sun C++ 5.9
609675fd0b74Schristos	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
609775fd0b74Schristos	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
609875fd0b74Schristos	      _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'
609975fd0b74Schristos	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
610075fd0b74Schristos	      _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'
610175fd0b74Schristos	      _LT_TAGVAR(compiler_needs_object, $1)=yes
610275fd0b74Schristos
610375fd0b74Schristos	      # Not sure whether something based on
610475fd0b74Schristos	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
610575fd0b74Schristos	      # would be better.
610675fd0b74Schristos	      output_verbose_link_cmd='func_echo_all'
610775fd0b74Schristos
610875fd0b74Schristos	      # Archives containing C++ object files must be created using
610975fd0b74Schristos	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
611075fd0b74Schristos	      # necessary to make sure instantiated templates are included
611175fd0b74Schristos	      # in the archive.
611275fd0b74Schristos	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
611375fd0b74Schristos	      ;;
611475fd0b74Schristos	    esac
611575fd0b74Schristos	    ;;
611675fd0b74Schristos	esac
611775fd0b74Schristos	;;
611875fd0b74Schristos
611975fd0b74Schristos      lynxos*)
612075fd0b74Schristos        # FIXME: insert proper C++ library support
612175fd0b74Schristos	_LT_TAGVAR(ld_shlibs, $1)=no
612275fd0b74Schristos	;;
612375fd0b74Schristos
612475fd0b74Schristos      m88k*)
612575fd0b74Schristos        # FIXME: insert proper C++ library support
612675fd0b74Schristos        _LT_TAGVAR(ld_shlibs, $1)=no
612775fd0b74Schristos	;;
612875fd0b74Schristos
612975fd0b74Schristos      mvs*)
613075fd0b74Schristos        case $cc_basename in
613175fd0b74Schristos          cxx*)
613275fd0b74Schristos	    # FIXME: insert proper C++ library support
613375fd0b74Schristos	    _LT_TAGVAR(ld_shlibs, $1)=no
613475fd0b74Schristos	    ;;
613575fd0b74Schristos	  *)
613675fd0b74Schristos	    # FIXME: insert proper C++ library support
613775fd0b74Schristos	    _LT_TAGVAR(ld_shlibs, $1)=no
613875fd0b74Schristos	    ;;
613975fd0b74Schristos	esac
614075fd0b74Schristos	;;
614175fd0b74Schristos
614275fd0b74Schristos      netbsd*)
614375fd0b74Schristos        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
614475fd0b74Schristos	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
614575fd0b74Schristos	  wlarc=
614675fd0b74Schristos	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
614775fd0b74Schristos	  _LT_TAGVAR(hardcode_direct, $1)=yes
614875fd0b74Schristos	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
614975fd0b74Schristos	fi
615075fd0b74Schristos	# Workaround some broken pre-1.5 toolchains
615175fd0b74Schristos	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
615275fd0b74Schristos	;;
615375fd0b74Schristos
615475fd0b74Schristos      *nto* | *qnx*)
615575fd0b74Schristos        _LT_TAGVAR(ld_shlibs, $1)=yes
615675fd0b74Schristos	;;
615775fd0b74Schristos
615875fd0b74Schristos      openbsd2*)
615975fd0b74Schristos        # C++ shared libraries are fairly broken
616075fd0b74Schristos	_LT_TAGVAR(ld_shlibs, $1)=no
616175fd0b74Schristos	;;
616275fd0b74Schristos
616375fd0b74Schristos      openbsd*)
616475fd0b74Schristos	if test -f /usr/libexec/ld.so; then
616575fd0b74Schristos	  _LT_TAGVAR(hardcode_direct, $1)=yes
616675fd0b74Schristos	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
616775fd0b74Schristos	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
616875fd0b74Schristos	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
616975fd0b74Schristos	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
617075fd0b74Schristos	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
617175fd0b74Schristos	    _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'
617275fd0b74Schristos	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
617375fd0b74Schristos	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
617475fd0b74Schristos	  fi
617575fd0b74Schristos	  output_verbose_link_cmd=func_echo_all
617675fd0b74Schristos	else
617775fd0b74Schristos	  _LT_TAGVAR(ld_shlibs, $1)=no
617875fd0b74Schristos	fi
617975fd0b74Schristos	;;
618075fd0b74Schristos
618175fd0b74Schristos      osf3* | osf4* | osf5*)
618275fd0b74Schristos        case $cc_basename in
618375fd0b74Schristos          KCC*)
618475fd0b74Schristos	    # Kuck and Associates, Inc. (KAI) C++ Compiler
618575fd0b74Schristos
618675fd0b74Schristos	    # KCC will only create a shared library if the output file
618775fd0b74Schristos	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
618875fd0b74Schristos	    # to its proper name (with version) after linking.
618975fd0b74Schristos	    _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'
619075fd0b74Schristos
619175fd0b74Schristos	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
619275fd0b74Schristos	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
619375fd0b74Schristos
619475fd0b74Schristos	    # Archives containing C++ object files must be created using
619575fd0b74Schristos	    # the KAI C++ compiler.
619675fd0b74Schristos	    case $host in
619775fd0b74Schristos	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
619875fd0b74Schristos	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
619975fd0b74Schristos	    esac
620075fd0b74Schristos	    ;;
620175fd0b74Schristos          RCC*)
620275fd0b74Schristos	    # Rational C++ 2.4.1
620375fd0b74Schristos	    # FIXME: insert proper C++ library support
620475fd0b74Schristos	    _LT_TAGVAR(ld_shlibs, $1)=no
620575fd0b74Schristos	    ;;
620675fd0b74Schristos          cxx*)
620775fd0b74Schristos	    case $host in
620875fd0b74Schristos	      osf3*)
620975fd0b74Schristos	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
621075fd0b74Schristos	        _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'
621175fd0b74Schristos	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
621275fd0b74Schristos		;;
621375fd0b74Schristos	      *)
621475fd0b74Schristos	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
621575fd0b74Schristos	        _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'
621675fd0b74Schristos	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
621775fd0b74Schristos	          echo "-hidden">> $lib.exp~
621875fd0b74Schristos	          $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~
621975fd0b74Schristos	          $RM $lib.exp'
622075fd0b74Schristos	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
622175fd0b74Schristos		;;
622275fd0b74Schristos	    esac
622375fd0b74Schristos
622475fd0b74Schristos	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
622575fd0b74Schristos
622675fd0b74Schristos	    # Commands to make compiler produce verbose output that lists
622775fd0b74Schristos	    # what "hidden" libraries, object files and flags are used when
622875fd0b74Schristos	    # linking a shared library.
622975fd0b74Schristos	    #
623075fd0b74Schristos	    # There doesn't appear to be a way to prevent this compiler from
623175fd0b74Schristos	    # explicitly linking system object files so we need to strip them
623275fd0b74Schristos	    # from the output so that they don't get included in the library
623375fd0b74Schristos	    # dependencies.
623475fd0b74Schristos	    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"'
623575fd0b74Schristos	    ;;
623675fd0b74Schristos	  *)
623775fd0b74Schristos	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
623875fd0b74Schristos	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
623975fd0b74Schristos	      case $host in
624075fd0b74Schristos	        osf3*)
624175fd0b74Schristos	          _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'
624275fd0b74Schristos		  ;;
624375fd0b74Schristos	        *)
624475fd0b74Schristos	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
624575fd0b74Schristos		  ;;
624675fd0b74Schristos	      esac
624775fd0b74Schristos
624875fd0b74Schristos	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
624975fd0b74Schristos	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
625075fd0b74Schristos
625175fd0b74Schristos	      # Commands to make compiler produce verbose output that lists
625275fd0b74Schristos	      # what "hidden" libraries, object files and flags are used when
625375fd0b74Schristos	      # linking a shared library.
625475fd0b74Schristos	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
625575fd0b74Schristos
625675fd0b74Schristos	    else
625775fd0b74Schristos	      # FIXME: insert proper C++ library support
625875fd0b74Schristos	      _LT_TAGVAR(ld_shlibs, $1)=no
625975fd0b74Schristos	    fi
626075fd0b74Schristos	    ;;
626175fd0b74Schristos        esac
626275fd0b74Schristos        ;;
626375fd0b74Schristos
626475fd0b74Schristos      psos*)
626575fd0b74Schristos        # FIXME: insert proper C++ library support
626675fd0b74Schristos        _LT_TAGVAR(ld_shlibs, $1)=no
626775fd0b74Schristos        ;;
626875fd0b74Schristos
626975fd0b74Schristos      sunos4*)
627075fd0b74Schristos        case $cc_basename in
627175fd0b74Schristos          CC*)
627275fd0b74Schristos	    # Sun C++ 4.x
627375fd0b74Schristos	    # FIXME: insert proper C++ library support
627475fd0b74Schristos	    _LT_TAGVAR(ld_shlibs, $1)=no
627575fd0b74Schristos	    ;;
627675fd0b74Schristos          lcc*)
627775fd0b74Schristos	    # Lucid
627875fd0b74Schristos	    # FIXME: insert proper C++ library support
627975fd0b74Schristos	    _LT_TAGVAR(ld_shlibs, $1)=no
628075fd0b74Schristos	    ;;
628175fd0b74Schristos          *)
628275fd0b74Schristos	    # FIXME: insert proper C++ library support
628375fd0b74Schristos	    _LT_TAGVAR(ld_shlibs, $1)=no
628475fd0b74Schristos	    ;;
628575fd0b74Schristos        esac
628675fd0b74Schristos        ;;
628775fd0b74Schristos
628875fd0b74Schristos      solaris*)
628975fd0b74Schristos        case $cc_basename in
629075fd0b74Schristos          CC*)
629175fd0b74Schristos	    # Sun C++ 4.2, 5.x and Centerline C++
629275fd0b74Schristos            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
629375fd0b74Schristos	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
629475fd0b74Schristos	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
629575fd0b74Schristos	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
629675fd0b74Schristos	      $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'
629775fd0b74Schristos
629875fd0b74Schristos	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
629975fd0b74Schristos	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
630075fd0b74Schristos	    case $host_os in
630175fd0b74Schristos	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
630275fd0b74Schristos	      *)
630375fd0b74Schristos		# The compiler driver will combine and reorder linker options,
630475fd0b74Schristos		# but understands `-z linker_flag'.
630575fd0b74Schristos	        # Supported since Solaris 2.6 (maybe 2.5.1?)
630675fd0b74Schristos		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
630775fd0b74Schristos	        ;;
630875fd0b74Schristos	    esac
630975fd0b74Schristos	    _LT_TAGVAR(link_all_deplibs, $1)=yes
631075fd0b74Schristos
631175fd0b74Schristos	    output_verbose_link_cmd='func_echo_all'
631275fd0b74Schristos
631375fd0b74Schristos	    # Archives containing C++ object files must be created using
631475fd0b74Schristos	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
631575fd0b74Schristos	    # necessary to make sure instantiated templates are included
631675fd0b74Schristos	    # in the archive.
631775fd0b74Schristos	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
631875fd0b74Schristos	    ;;
631975fd0b74Schristos          gcx*)
632075fd0b74Schristos	    # Green Hills C++ Compiler
632175fd0b74Schristos	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
632275fd0b74Schristos
632375fd0b74Schristos	    # The C++ compiler must be used to create the archive.
632475fd0b74Schristos	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
632575fd0b74Schristos	    ;;
632675fd0b74Schristos          *)
632775fd0b74Schristos	    # GNU C++ compiler with Solaris linker
632875fd0b74Schristos	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
632975fd0b74Schristos	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
633075fd0b74Schristos	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
633175fd0b74Schristos	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
633275fd0b74Schristos	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
633375fd0b74Schristos		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
633475fd0b74Schristos
633575fd0b74Schristos	        # Commands to make compiler produce verbose output that lists
633675fd0b74Schristos	        # what "hidden" libraries, object files and flags are used when
633775fd0b74Schristos	        # linking a shared library.
633875fd0b74Schristos	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
633975fd0b74Schristos	      else
634075fd0b74Schristos	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
634175fd0b74Schristos	        # platform.
634275fd0b74Schristos	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
634375fd0b74Schristos	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
634475fd0b74Schristos		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
634575fd0b74Schristos
634675fd0b74Schristos	        # Commands to make compiler produce verbose output that lists
634775fd0b74Schristos	        # what "hidden" libraries, object files and flags are used when
634875fd0b74Schristos	        # linking a shared library.
634975fd0b74Schristos	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
635075fd0b74Schristos	      fi
635175fd0b74Schristos
635275fd0b74Schristos	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
635375fd0b74Schristos	      case $host_os in
635475fd0b74Schristos		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
635575fd0b74Schristos		*)
635675fd0b74Schristos		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
635775fd0b74Schristos		  ;;
635875fd0b74Schristos	      esac
635975fd0b74Schristos	    fi
636075fd0b74Schristos	    ;;
636175fd0b74Schristos        esac
636275fd0b74Schristos        ;;
636375fd0b74Schristos
636475fd0b74Schristos    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
636575fd0b74Schristos      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
636675fd0b74Schristos      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
636775fd0b74Schristos      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
636875fd0b74Schristos      runpath_var='LD_RUN_PATH'
636975fd0b74Schristos
637075fd0b74Schristos      case $cc_basename in
637175fd0b74Schristos        CC*)
637275fd0b74Schristos	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
637375fd0b74Schristos	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
637475fd0b74Schristos	  ;;
637575fd0b74Schristos	*)
637675fd0b74Schristos	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
637775fd0b74Schristos	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
637875fd0b74Schristos	  ;;
637975fd0b74Schristos      esac
638075fd0b74Schristos      ;;
638175fd0b74Schristos
638275fd0b74Schristos      sysv5* | sco3.2v5* | sco5v6*)
638375fd0b74Schristos	# Note: We can NOT use -z defs as we might desire, because we do not
638475fd0b74Schristos	# link with -lc, and that would cause any symbols used from libc to
638575fd0b74Schristos	# always be unresolved, which means just about no library would
638675fd0b74Schristos	# ever link correctly.  If we're not using GNU ld we use -z text
638775fd0b74Schristos	# though, which does catch some bad symbols but isn't as heavy-handed
638875fd0b74Schristos	# as -z defs.
638975fd0b74Schristos	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
639075fd0b74Schristos	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
639175fd0b74Schristos	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
639275fd0b74Schristos	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
639375fd0b74Schristos	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
639475fd0b74Schristos	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
639575fd0b74Schristos	_LT_TAGVAR(link_all_deplibs, $1)=yes
639675fd0b74Schristos	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
639775fd0b74Schristos	runpath_var='LD_RUN_PATH'
639875fd0b74Schristos
639975fd0b74Schristos	case $cc_basename in
640075fd0b74Schristos          CC*)
640175fd0b74Schristos	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
640275fd0b74Schristos	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
640375fd0b74Schristos	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
640475fd0b74Schristos	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
640575fd0b74Schristos	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
640675fd0b74Schristos	      '"$_LT_TAGVAR(reload_cmds, $1)"
640775fd0b74Schristos	    ;;
640875fd0b74Schristos	  *)
640975fd0b74Schristos	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
641075fd0b74Schristos	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
641175fd0b74Schristos	    ;;
641275fd0b74Schristos	esac
641375fd0b74Schristos      ;;
641475fd0b74Schristos
641575fd0b74Schristos      tandem*)
641675fd0b74Schristos        case $cc_basename in
641775fd0b74Schristos          NCC*)
641875fd0b74Schristos	    # NonStop-UX NCC 3.20
641975fd0b74Schristos	    # FIXME: insert proper C++ library support
642075fd0b74Schristos	    _LT_TAGVAR(ld_shlibs, $1)=no
642175fd0b74Schristos	    ;;
642275fd0b74Schristos          *)
642375fd0b74Schristos	    # FIXME: insert proper C++ library support
642475fd0b74Schristos	    _LT_TAGVAR(ld_shlibs, $1)=no
642575fd0b74Schristos	    ;;
642675fd0b74Schristos        esac
642775fd0b74Schristos        ;;
642875fd0b74Schristos
642975fd0b74Schristos      vxworks*)
643075fd0b74Schristos        # FIXME: insert proper C++ library support
643175fd0b74Schristos        _LT_TAGVAR(ld_shlibs, $1)=no
643275fd0b74Schristos        ;;
643375fd0b74Schristos
643475fd0b74Schristos      *)
643575fd0b74Schristos        # FIXME: insert proper C++ library support
643675fd0b74Schristos        _LT_TAGVAR(ld_shlibs, $1)=no
643775fd0b74Schristos        ;;
643875fd0b74Schristos    esac
643975fd0b74Schristos
644075fd0b74Schristos    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
644175fd0b74Schristos    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
644275fd0b74Schristos
644375fd0b74Schristos    _LT_TAGVAR(GCC, $1)="$GXX"
644475fd0b74Schristos    _LT_TAGVAR(LD, $1)="$LD"
644575fd0b74Schristos
644675fd0b74Schristos    ## CAVEAT EMPTOR:
644775fd0b74Schristos    ## There is no encapsulation within the following macros, do not change
644875fd0b74Schristos    ## the running order or otherwise move them around unless you know exactly
644975fd0b74Schristos    ## what you are doing...
645075fd0b74Schristos    _LT_SYS_HIDDEN_LIBDEPS($1)
645175fd0b74Schristos    _LT_COMPILER_PIC($1)
645275fd0b74Schristos    _LT_COMPILER_C_O($1)
645375fd0b74Schristos    _LT_COMPILER_FILE_LOCKS($1)
645475fd0b74Schristos    _LT_LINKER_SHLIBS($1)
645575fd0b74Schristos    _LT_SYS_DYNAMIC_LINKER($1)
645675fd0b74Schristos    _LT_LINKER_HARDCODE_LIBPATH($1)
645775fd0b74Schristos
645875fd0b74Schristos    _LT_CONFIG($1)
645975fd0b74Schristos  fi # test -n "$compiler"
646075fd0b74Schristos
646175fd0b74Schristos  CC=$lt_save_CC
646275fd0b74Schristos  LDCXX=$LD
646375fd0b74Schristos  LD=$lt_save_LD
646475fd0b74Schristos  GCC=$lt_save_GCC
646575fd0b74Schristos  with_gnu_ld=$lt_save_with_gnu_ld
646675fd0b74Schristos  lt_cv_path_LDCXX=$lt_cv_path_LD
646775fd0b74Schristos  lt_cv_path_LD=$lt_save_path_LD
646875fd0b74Schristos  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
646975fd0b74Schristos  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
647075fd0b74Schristosfi # test "$_lt_caught_CXX_error" != yes
647175fd0b74Schristos
647275fd0b74SchristosAC_LANG_POP
647375fd0b74Schristos])# _LT_LANG_CXX_CONFIG
647475fd0b74Schristos
647575fd0b74Schristos
647675fd0b74Schristos# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
647775fd0b74Schristos# ---------------------------------
647875fd0b74Schristos# Figure out "hidden" library dependencies from verbose
647975fd0b74Schristos# compiler output when linking a shared library.
648075fd0b74Schristos# Parse the compiler output and extract the necessary
648175fd0b74Schristos# objects, libraries and library flags.
648275fd0b74Schristosm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
648375fd0b74Schristos[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
648475fd0b74Schristos# Dependencies to place before and after the object being linked:
648575fd0b74Schristos_LT_TAGVAR(predep_objects, $1)=
648675fd0b74Schristos_LT_TAGVAR(postdep_objects, $1)=
648775fd0b74Schristos_LT_TAGVAR(predeps, $1)=
648875fd0b74Schristos_LT_TAGVAR(postdeps, $1)=
648975fd0b74Schristos_LT_TAGVAR(compiler_lib_search_path, $1)=
649075fd0b74Schristos
649175fd0b74Schristosdnl we can't use the lt_simple_compile_test_code here,
649275fd0b74Schristosdnl because it contains code intended for an executable,
649375fd0b74Schristosdnl not a library.  It's possible we should let each
649475fd0b74Schristosdnl tag define a new lt_????_link_test_code variable,
649575fd0b74Schristosdnl but it's only used here...
649675fd0b74Schristosm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
649775fd0b74Schristosint a;
649875fd0b74Schristosvoid foo (void) { a = 0; }
649975fd0b74Schristos_LT_EOF
650075fd0b74Schristos], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
650175fd0b74Schristosclass Foo
650275fd0b74Schristos{
650375fd0b74Schristospublic:
650475fd0b74Schristos  Foo (void) { a = 0; }
650575fd0b74Schristosprivate:
650675fd0b74Schristos  int a;
650775fd0b74Schristos};
650875fd0b74Schristos_LT_EOF
650975fd0b74Schristos], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
651075fd0b74Schristos      subroutine foo
651175fd0b74Schristos      implicit none
651275fd0b74Schristos      integer*4 a
651375fd0b74Schristos      a=0
651475fd0b74Schristos      return
651575fd0b74Schristos      end
651675fd0b74Schristos_LT_EOF
651775fd0b74Schristos], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
651875fd0b74Schristos      subroutine foo
651975fd0b74Schristos      implicit none
652075fd0b74Schristos      integer a
652175fd0b74Schristos      a=0
652275fd0b74Schristos      return
652375fd0b74Schristos      end
652475fd0b74Schristos_LT_EOF
652575fd0b74Schristos], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
652675fd0b74Schristospublic class foo {
652775fd0b74Schristos  private int a;
652875fd0b74Schristos  public void bar (void) {
652975fd0b74Schristos    a = 0;
653075fd0b74Schristos  }
653175fd0b74Schristos};
653275fd0b74Schristos_LT_EOF
653375fd0b74Schristos])
653475fd0b74Schristosdnl Parse the compiler output and extract the necessary
653575fd0b74Schristosdnl objects, libraries and library flags.
653675fd0b74Schristosif AC_TRY_EVAL(ac_compile); then
653775fd0b74Schristos  # Parse the compiler output and extract the necessary
653875fd0b74Schristos  # objects, libraries and library flags.
653975fd0b74Schristos
654075fd0b74Schristos  # Sentinel used to keep track of whether or not we are before
654175fd0b74Schristos  # the conftest object file.
654275fd0b74Schristos  pre_test_object_deps_done=no
654375fd0b74Schristos
654475fd0b74Schristos  for p in `eval "$output_verbose_link_cmd"`; do
654575fd0b74Schristos    case $p in
654675fd0b74Schristos
654775fd0b74Schristos    -L* | -R* | -l*)
654875fd0b74Schristos       # Some compilers place space between "-{L,R}" and the path.
654975fd0b74Schristos       # Remove the space.
655075fd0b74Schristos       if test $p = "-L" ||
655175fd0b74Schristos          test $p = "-R"; then
655275fd0b74Schristos	 prev=$p
655375fd0b74Schristos	 continue
655475fd0b74Schristos       else
655575fd0b74Schristos	 prev=
655675fd0b74Schristos       fi
655775fd0b74Schristos
655875fd0b74Schristos       if test "$pre_test_object_deps_done" = no; then
655975fd0b74Schristos	 case $p in
656075fd0b74Schristos	 -L* | -R*)
656175fd0b74Schristos	   # Internal compiler library paths should come after those
656275fd0b74Schristos	   # provided the user.  The postdeps already come after the
656375fd0b74Schristos	   # user supplied libs so there is no need to process them.
656475fd0b74Schristos	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
656575fd0b74Schristos	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
656675fd0b74Schristos	   else
656775fd0b74Schristos	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
656875fd0b74Schristos	   fi
656975fd0b74Schristos	   ;;
657075fd0b74Schristos	 # The "-l" case would never come before the object being
657175fd0b74Schristos	 # linked, so don't bother handling this case.
657275fd0b74Schristos	 esac
657375fd0b74Schristos       else
657475fd0b74Schristos	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
657575fd0b74Schristos	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
657675fd0b74Schristos	 else
657775fd0b74Schristos	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
657875fd0b74Schristos	 fi
657975fd0b74Schristos       fi
658075fd0b74Schristos       ;;
658175fd0b74Schristos
658275fd0b74Schristos    *.$objext)
658375fd0b74Schristos       # This assumes that the test object file only shows up
658475fd0b74Schristos       # once in the compiler output.
658575fd0b74Schristos       if test "$p" = "conftest.$objext"; then
658675fd0b74Schristos	 pre_test_object_deps_done=yes
658775fd0b74Schristos	 continue
658875fd0b74Schristos       fi
658975fd0b74Schristos
659075fd0b74Schristos       if test "$pre_test_object_deps_done" = no; then
659175fd0b74Schristos	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
659275fd0b74Schristos	   _LT_TAGVAR(predep_objects, $1)="$p"
659375fd0b74Schristos	 else
659475fd0b74Schristos	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
659575fd0b74Schristos	 fi
659675fd0b74Schristos       else
659775fd0b74Schristos	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
659875fd0b74Schristos	   _LT_TAGVAR(postdep_objects, $1)="$p"
659975fd0b74Schristos	 else
660075fd0b74Schristos	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
660175fd0b74Schristos	 fi
660275fd0b74Schristos       fi
660375fd0b74Schristos       ;;
660475fd0b74Schristos
660575fd0b74Schristos    *) ;; # Ignore the rest.
660675fd0b74Schristos
660775fd0b74Schristos    esac
660875fd0b74Schristos  done
660975fd0b74Schristos
661075fd0b74Schristos  # Clean up.
661175fd0b74Schristos  rm -f a.out a.exe
661275fd0b74Schristoselse
661375fd0b74Schristos  echo "libtool.m4: error: problem compiling $1 test program"
661475fd0b74Schristosfi
661575fd0b74Schristos
661675fd0b74Schristos$RM -f confest.$objext
661775fd0b74Schristos
661875fd0b74Schristos# PORTME: override above test on systems where it is broken
661975fd0b74Schristosm4_if([$1], [CXX],
662075fd0b74Schristos[case $host_os in
662175fd0b74Schristosinterix[[3-9]]*)
662275fd0b74Schristos  # Interix 3.5 installs completely hosed .la files for C++, so rather than
662375fd0b74Schristos  # hack all around it, let's just trust "g++" to DTRT.
662475fd0b74Schristos  _LT_TAGVAR(predep_objects,$1)=
662575fd0b74Schristos  _LT_TAGVAR(postdep_objects,$1)=
662675fd0b74Schristos  _LT_TAGVAR(postdeps,$1)=
662775fd0b74Schristos  ;;
662875fd0b74Schristos
662975fd0b74Schristoslinux*)
663075fd0b74Schristos  case `$CC -V 2>&1 | sed 5q` in
663175fd0b74Schristos  *Sun\ C*)
663275fd0b74Schristos    # Sun C++ 5.9
663375fd0b74Schristos
663475fd0b74Schristos    # The more standards-conforming stlport4 library is
663575fd0b74Schristos    # incompatible with the Cstd library. Avoid specifying
663675fd0b74Schristos    # it if it's in CXXFLAGS. Ignore libCrun as
663775fd0b74Schristos    # -library=stlport4 depends on it.
663875fd0b74Schristos    case " $CXX $CXXFLAGS " in
663975fd0b74Schristos    *" -library=stlport4 "*)
664075fd0b74Schristos      solaris_use_stlport4=yes
664175fd0b74Schristos      ;;
664275fd0b74Schristos    esac
664375fd0b74Schristos
664475fd0b74Schristos    if test "$solaris_use_stlport4" != yes; then
664575fd0b74Schristos      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
664675fd0b74Schristos    fi
664775fd0b74Schristos    ;;
664875fd0b74Schristos  esac
664975fd0b74Schristos  ;;
665075fd0b74Schristos
665175fd0b74Schristossolaris*)
665275fd0b74Schristos  case $cc_basename in
665375fd0b74Schristos  CC*)
665475fd0b74Schristos    # The more standards-conforming stlport4 library is
665575fd0b74Schristos    # incompatible with the Cstd library. Avoid specifying
665675fd0b74Schristos    # it if it's in CXXFLAGS. Ignore libCrun as
665775fd0b74Schristos    # -library=stlport4 depends on it.
665875fd0b74Schristos    case " $CXX $CXXFLAGS " in
665975fd0b74Schristos    *" -library=stlport4 "*)
666075fd0b74Schristos      solaris_use_stlport4=yes
666175fd0b74Schristos      ;;
666275fd0b74Schristos    esac
666375fd0b74Schristos
666475fd0b74Schristos    # Adding this requires a known-good setup of shared libraries for
666575fd0b74Schristos    # Sun compiler versions before 5.6, else PIC objects from an old
666675fd0b74Schristos    # archive will be linked into the output, leading to subtle bugs.
666775fd0b74Schristos    if test "$solaris_use_stlport4" != yes; then
666875fd0b74Schristos      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
666975fd0b74Schristos    fi
667075fd0b74Schristos    ;;
667175fd0b74Schristos  esac
667275fd0b74Schristos  ;;
667375fd0b74Schristosesac
667475fd0b74Schristos])
667575fd0b74Schristos
667675fd0b74Schristoscase " $_LT_TAGVAR(postdeps, $1) " in
667775fd0b74Schristos*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
667875fd0b74Schristosesac
667975fd0b74Schristos _LT_TAGVAR(compiler_lib_search_dirs, $1)=
668075fd0b74Schristosif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
668175fd0b74Schristos _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
668275fd0b74Schristosfi
668375fd0b74Schristos_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
668475fd0b74Schristos    [The directories searched by this compiler when creating a shared library])
668575fd0b74Schristos_LT_TAGDECL([], [predep_objects], [1],
668675fd0b74Schristos    [Dependencies to place before and after the objects being linked to
668775fd0b74Schristos    create a shared library])
668875fd0b74Schristos_LT_TAGDECL([], [postdep_objects], [1])
668975fd0b74Schristos_LT_TAGDECL([], [predeps], [1])
669075fd0b74Schristos_LT_TAGDECL([], [postdeps], [1])
669175fd0b74Schristos_LT_TAGDECL([], [compiler_lib_search_path], [1],
669275fd0b74Schristos    [The library search path used internally by the compiler when linking
669375fd0b74Schristos    a shared library])
669475fd0b74Schristos])# _LT_SYS_HIDDEN_LIBDEPS
669575fd0b74Schristos
669675fd0b74Schristos
669775fd0b74Schristos# _LT_LANG_F77_CONFIG([TAG])
669875fd0b74Schristos# --------------------------
669975fd0b74Schristos# Ensure that the configuration variables for a Fortran 77 compiler are
670075fd0b74Schristos# suitably defined.  These variables are subsequently used by _LT_CONFIG
670175fd0b74Schristos# to write the compiler configuration to `libtool'.
670275fd0b74Schristosm4_defun([_LT_LANG_F77_CONFIG],
670375fd0b74Schristos[AC_LANG_PUSH(Fortran 77)
670475fd0b74Schristosif test -z "$F77" || test "X$F77" = "Xno"; then
670575fd0b74Schristos  _lt_disable_F77=yes
670675fd0b74Schristosfi
670775fd0b74Schristos
670875fd0b74Schristos_LT_TAGVAR(archive_cmds_need_lc, $1)=no
670975fd0b74Schristos_LT_TAGVAR(allow_undefined_flag, $1)=
671075fd0b74Schristos_LT_TAGVAR(always_export_symbols, $1)=no
671175fd0b74Schristos_LT_TAGVAR(archive_expsym_cmds, $1)=
671275fd0b74Schristos_LT_TAGVAR(export_dynamic_flag_spec, $1)=
671375fd0b74Schristos_LT_TAGVAR(hardcode_direct, $1)=no
671475fd0b74Schristos_LT_TAGVAR(hardcode_direct_absolute, $1)=no
671575fd0b74Schristos_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
671675fd0b74Schristos_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
671775fd0b74Schristos_LT_TAGVAR(hardcode_libdir_separator, $1)=
671875fd0b74Schristos_LT_TAGVAR(hardcode_minus_L, $1)=no
671975fd0b74Schristos_LT_TAGVAR(hardcode_automatic, $1)=no
672075fd0b74Schristos_LT_TAGVAR(inherit_rpath, $1)=no
672175fd0b74Schristos_LT_TAGVAR(module_cmds, $1)=
672275fd0b74Schristos_LT_TAGVAR(module_expsym_cmds, $1)=
672375fd0b74Schristos_LT_TAGVAR(link_all_deplibs, $1)=unknown
672475fd0b74Schristos_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
672575fd0b74Schristos_LT_TAGVAR(reload_flag, $1)=$reload_flag
672675fd0b74Schristos_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
672775fd0b74Schristos_LT_TAGVAR(no_undefined_flag, $1)=
672875fd0b74Schristos_LT_TAGVAR(whole_archive_flag_spec, $1)=
672975fd0b74Schristos_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
673075fd0b74Schristos
673175fd0b74Schristos# Source file extension for f77 test sources.
673275fd0b74Schristosac_ext=f
673375fd0b74Schristos
673475fd0b74Schristos# Object file extension for compiled f77 test sources.
673575fd0b74Schristosobjext=o
673675fd0b74Schristos_LT_TAGVAR(objext, $1)=$objext
673775fd0b74Schristos
673875fd0b74Schristos# No sense in running all these tests if we already determined that
673975fd0b74Schristos# the F77 compiler isn't working.  Some variables (like enable_shared)
674075fd0b74Schristos# are currently assumed to apply to all compilers on this platform,
674175fd0b74Schristos# and will be corrupted by setting them based on a non-working compiler.
674275fd0b74Schristosif test "$_lt_disable_F77" != yes; then
674375fd0b74Schristos  # Code to be used in simple compile tests
674475fd0b74Schristos  lt_simple_compile_test_code="\
674575fd0b74Schristos      subroutine t
674675fd0b74Schristos      return
674775fd0b74Schristos      end
674875fd0b74Schristos"
674975fd0b74Schristos
675075fd0b74Schristos  # Code to be used in simple link tests
675175fd0b74Schristos  lt_simple_link_test_code="\
675275fd0b74Schristos      program t
675375fd0b74Schristos      end
675475fd0b74Schristos"
675575fd0b74Schristos
675675fd0b74Schristos  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
675775fd0b74Schristos  _LT_TAG_COMPILER
675875fd0b74Schristos
675975fd0b74Schristos  # save warnings/boilerplate of simple test code
676075fd0b74Schristos  _LT_COMPILER_BOILERPLATE
676175fd0b74Schristos  _LT_LINKER_BOILERPLATE
676275fd0b74Schristos
676375fd0b74Schristos  # Allow CC to be a program name with arguments.
676475fd0b74Schristos  lt_save_CC="$CC"
676575fd0b74Schristos  lt_save_GCC=$GCC
676675fd0b74Schristos  CC=${F77-"f77"}
676775fd0b74Schristos  compiler=$CC
676875fd0b74Schristos  _LT_TAGVAR(compiler, $1)=$CC
676975fd0b74Schristos  _LT_CC_BASENAME([$compiler])
677075fd0b74Schristos  GCC=$G77
677175fd0b74Schristos  if test -n "$compiler"; then
677275fd0b74Schristos    AC_MSG_CHECKING([if libtool supports shared libraries])
677375fd0b74Schristos    AC_MSG_RESULT([$can_build_shared])
677475fd0b74Schristos
677575fd0b74Schristos    AC_MSG_CHECKING([whether to build shared libraries])
677675fd0b74Schristos    test "$can_build_shared" = "no" && enable_shared=no
677775fd0b74Schristos
677875fd0b74Schristos    # On AIX, shared libraries and static libraries use the same namespace, and
677975fd0b74Schristos    # are all built from PIC.
678075fd0b74Schristos    case $host_os in
678175fd0b74Schristos      aix3*)
678275fd0b74Schristos        test "$enable_shared" = yes && enable_static=no
678375fd0b74Schristos        if test -n "$RANLIB"; then
678475fd0b74Schristos          archive_cmds="$archive_cmds~\$RANLIB \$lib"
678575fd0b74Schristos          postinstall_cmds='$RANLIB $lib'
678675fd0b74Schristos        fi
678775fd0b74Schristos        ;;
678875fd0b74Schristos      aix[[4-9]]*)
678975fd0b74Schristos	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
679075fd0b74Schristos	  test "$enable_shared" = yes && enable_static=no
679175fd0b74Schristos	fi
679275fd0b74Schristos        ;;
679375fd0b74Schristos    esac
679475fd0b74Schristos    AC_MSG_RESULT([$enable_shared])
679575fd0b74Schristos
679675fd0b74Schristos    AC_MSG_CHECKING([whether to build static libraries])
679775fd0b74Schristos    # Make sure either enable_shared or enable_static is yes.
679875fd0b74Schristos    test "$enable_shared" = yes || enable_static=yes
679975fd0b74Schristos    AC_MSG_RESULT([$enable_static])
680075fd0b74Schristos
680175fd0b74Schristos    _LT_TAGVAR(GCC, $1)="$G77"
680275fd0b74Schristos    _LT_TAGVAR(LD, $1)="$LD"
680375fd0b74Schristos
680475fd0b74Schristos    ## CAVEAT EMPTOR:
680575fd0b74Schristos    ## There is no encapsulation within the following macros, do not change
680675fd0b74Schristos    ## the running order or otherwise move them around unless you know exactly
680775fd0b74Schristos    ## what you are doing...
680875fd0b74Schristos    _LT_COMPILER_PIC($1)
680975fd0b74Schristos    _LT_COMPILER_C_O($1)
681075fd0b74Schristos    _LT_COMPILER_FILE_LOCKS($1)
681175fd0b74Schristos    _LT_LINKER_SHLIBS($1)
681275fd0b74Schristos    _LT_SYS_DYNAMIC_LINKER($1)
681375fd0b74Schristos    _LT_LINKER_HARDCODE_LIBPATH($1)
681475fd0b74Schristos
681575fd0b74Schristos    _LT_CONFIG($1)
681675fd0b74Schristos  fi # test -n "$compiler"
681775fd0b74Schristos
681875fd0b74Schristos  GCC=$lt_save_GCC
681975fd0b74Schristos  CC="$lt_save_CC"
682075fd0b74Schristosfi # test "$_lt_disable_F77" != yes
682175fd0b74Schristos
682275fd0b74SchristosAC_LANG_POP
682375fd0b74Schristos])# _LT_LANG_F77_CONFIG
682475fd0b74Schristos
682575fd0b74Schristos
682675fd0b74Schristos# _LT_LANG_FC_CONFIG([TAG])
682775fd0b74Schristos# -------------------------
682875fd0b74Schristos# Ensure that the configuration variables for a Fortran compiler are
682975fd0b74Schristos# suitably defined.  These variables are subsequently used by _LT_CONFIG
683075fd0b74Schristos# to write the compiler configuration to `libtool'.
683175fd0b74Schristosm4_defun([_LT_LANG_FC_CONFIG],
683275fd0b74Schristos[AC_LANG_PUSH(Fortran)
683375fd0b74Schristos
683475fd0b74Schristosif test -z "$FC" || test "X$FC" = "Xno"; then
683575fd0b74Schristos  _lt_disable_FC=yes
683675fd0b74Schristosfi
683775fd0b74Schristos
683875fd0b74Schristos_LT_TAGVAR(archive_cmds_need_lc, $1)=no
683975fd0b74Schristos_LT_TAGVAR(allow_undefined_flag, $1)=
684075fd0b74Schristos_LT_TAGVAR(always_export_symbols, $1)=no
684175fd0b74Schristos_LT_TAGVAR(archive_expsym_cmds, $1)=
684275fd0b74Schristos_LT_TAGVAR(export_dynamic_flag_spec, $1)=
684375fd0b74Schristos_LT_TAGVAR(hardcode_direct, $1)=no
684475fd0b74Schristos_LT_TAGVAR(hardcode_direct_absolute, $1)=no
684575fd0b74Schristos_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
684675fd0b74Schristos_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
684775fd0b74Schristos_LT_TAGVAR(hardcode_libdir_separator, $1)=
684875fd0b74Schristos_LT_TAGVAR(hardcode_minus_L, $1)=no
684975fd0b74Schristos_LT_TAGVAR(hardcode_automatic, $1)=no
685075fd0b74Schristos_LT_TAGVAR(inherit_rpath, $1)=no
685175fd0b74Schristos_LT_TAGVAR(module_cmds, $1)=
685275fd0b74Schristos_LT_TAGVAR(module_expsym_cmds, $1)=
685375fd0b74Schristos_LT_TAGVAR(link_all_deplibs, $1)=unknown
685475fd0b74Schristos_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
685575fd0b74Schristos_LT_TAGVAR(reload_flag, $1)=$reload_flag
685675fd0b74Schristos_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
685775fd0b74Schristos_LT_TAGVAR(no_undefined_flag, $1)=
685875fd0b74Schristos_LT_TAGVAR(whole_archive_flag_spec, $1)=
685975fd0b74Schristos_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
686075fd0b74Schristos
686175fd0b74Schristos# Source file extension for fc test sources.
686275fd0b74Schristosac_ext=${ac_fc_srcext-f}
686375fd0b74Schristos
686475fd0b74Schristos# Object file extension for compiled fc test sources.
686575fd0b74Schristosobjext=o
686675fd0b74Schristos_LT_TAGVAR(objext, $1)=$objext
686775fd0b74Schristos
686875fd0b74Schristos# No sense in running all these tests if we already determined that
686975fd0b74Schristos# the FC compiler isn't working.  Some variables (like enable_shared)
687075fd0b74Schristos# are currently assumed to apply to all compilers on this platform,
687175fd0b74Schristos# and will be corrupted by setting them based on a non-working compiler.
687275fd0b74Schristosif test "$_lt_disable_FC" != yes; then
687375fd0b74Schristos  # Code to be used in simple compile tests
687475fd0b74Schristos  lt_simple_compile_test_code="\
687575fd0b74Schristos      subroutine t
687675fd0b74Schristos      return
687775fd0b74Schristos      end
687875fd0b74Schristos"
687975fd0b74Schristos
688075fd0b74Schristos  # Code to be used in simple link tests
688175fd0b74Schristos  lt_simple_link_test_code="\
688275fd0b74Schristos      program t
688375fd0b74Schristos      end
688475fd0b74Schristos"
688575fd0b74Schristos
688675fd0b74Schristos  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
688775fd0b74Schristos  _LT_TAG_COMPILER
688875fd0b74Schristos
688975fd0b74Schristos  # save warnings/boilerplate of simple test code
689075fd0b74Schristos  _LT_COMPILER_BOILERPLATE
689175fd0b74Schristos  _LT_LINKER_BOILERPLATE
689275fd0b74Schristos
689375fd0b74Schristos  # Allow CC to be a program name with arguments.
689475fd0b74Schristos  lt_save_CC="$CC"
689575fd0b74Schristos  lt_save_GCC=$GCC
689675fd0b74Schristos  CC=${FC-"f95"}
689775fd0b74Schristos  compiler=$CC
689875fd0b74Schristos  GCC=$ac_cv_fc_compiler_gnu
689975fd0b74Schristos
690075fd0b74Schristos  _LT_TAGVAR(compiler, $1)=$CC
690175fd0b74Schristos  _LT_CC_BASENAME([$compiler])
690275fd0b74Schristos
690375fd0b74Schristos  if test -n "$compiler"; then
690475fd0b74Schristos    AC_MSG_CHECKING([if libtool supports shared libraries])
690575fd0b74Schristos    AC_MSG_RESULT([$can_build_shared])
690675fd0b74Schristos
690775fd0b74Schristos    AC_MSG_CHECKING([whether to build shared libraries])
690875fd0b74Schristos    test "$can_build_shared" = "no" && enable_shared=no
690975fd0b74Schristos
691075fd0b74Schristos    # On AIX, shared libraries and static libraries use the same namespace, and
691175fd0b74Schristos    # are all built from PIC.
691275fd0b74Schristos    case $host_os in
691375fd0b74Schristos      aix3*)
691475fd0b74Schristos        test "$enable_shared" = yes && enable_static=no
691575fd0b74Schristos        if test -n "$RANLIB"; then
691675fd0b74Schristos          archive_cmds="$archive_cmds~\$RANLIB \$lib"
691775fd0b74Schristos          postinstall_cmds='$RANLIB $lib'
691875fd0b74Schristos        fi
691975fd0b74Schristos        ;;
692075fd0b74Schristos      aix[[4-9]]*)
692175fd0b74Schristos	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
692275fd0b74Schristos	  test "$enable_shared" = yes && enable_static=no
692375fd0b74Schristos	fi
692475fd0b74Schristos        ;;
692575fd0b74Schristos    esac
692675fd0b74Schristos    AC_MSG_RESULT([$enable_shared])
692775fd0b74Schristos
692875fd0b74Schristos    AC_MSG_CHECKING([whether to build static libraries])
692975fd0b74Schristos    # Make sure either enable_shared or enable_static is yes.
693075fd0b74Schristos    test "$enable_shared" = yes || enable_static=yes
693175fd0b74Schristos    AC_MSG_RESULT([$enable_static])
693275fd0b74Schristos
693375fd0b74Schristos    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
693475fd0b74Schristos    _LT_TAGVAR(LD, $1)="$LD"
693575fd0b74Schristos
693675fd0b74Schristos    ## CAVEAT EMPTOR:
693775fd0b74Schristos    ## There is no encapsulation within the following macros, do not change
693875fd0b74Schristos    ## the running order or otherwise move them around unless you know exactly
693975fd0b74Schristos    ## what you are doing...
694075fd0b74Schristos    _LT_SYS_HIDDEN_LIBDEPS($1)
694175fd0b74Schristos    _LT_COMPILER_PIC($1)
694275fd0b74Schristos    _LT_COMPILER_C_O($1)
694375fd0b74Schristos    _LT_COMPILER_FILE_LOCKS($1)
694475fd0b74Schristos    _LT_LINKER_SHLIBS($1)
694575fd0b74Schristos    _LT_SYS_DYNAMIC_LINKER($1)
694675fd0b74Schristos    _LT_LINKER_HARDCODE_LIBPATH($1)
694775fd0b74Schristos
694875fd0b74Schristos    _LT_CONFIG($1)
694975fd0b74Schristos  fi # test -n "$compiler"
695075fd0b74Schristos
695175fd0b74Schristos  GCC=$lt_save_GCC
695275fd0b74Schristos  CC="$lt_save_CC"
695375fd0b74Schristosfi # test "$_lt_disable_FC" != yes
695475fd0b74Schristos
695575fd0b74SchristosAC_LANG_POP
695675fd0b74Schristos])# _LT_LANG_FC_CONFIG
695775fd0b74Schristos
695875fd0b74Schristos
695975fd0b74Schristos# _LT_LANG_GCJ_CONFIG([TAG])
696075fd0b74Schristos# --------------------------
696175fd0b74Schristos# Ensure that the configuration variables for the GNU Java Compiler compiler
696275fd0b74Schristos# are suitably defined.  These variables are subsequently used by _LT_CONFIG
696375fd0b74Schristos# to write the compiler configuration to `libtool'.
696475fd0b74Schristosm4_defun([_LT_LANG_GCJ_CONFIG],
696575fd0b74Schristos[AC_REQUIRE([LT_PROG_GCJ])dnl
696675fd0b74SchristosAC_LANG_SAVE
696775fd0b74Schristos
696875fd0b74Schristos# Source file extension for Java test sources.
696975fd0b74Schristosac_ext=java
697075fd0b74Schristos
697175fd0b74Schristos# Object file extension for compiled Java test sources.
697275fd0b74Schristosobjext=o
697375fd0b74Schristos_LT_TAGVAR(objext, $1)=$objext
697475fd0b74Schristos
697575fd0b74Schristos# Code to be used in simple compile tests
697675fd0b74Schristoslt_simple_compile_test_code="class foo {}"
697775fd0b74Schristos
697875fd0b74Schristos# Code to be used in simple link tests
697975fd0b74Schristoslt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
698075fd0b74Schristos
698175fd0b74Schristos# ltmain only uses $CC for tagged configurations so make sure $CC is set.
698275fd0b74Schristos_LT_TAG_COMPILER
698375fd0b74Schristos
698475fd0b74Schristos# save warnings/boilerplate of simple test code
698575fd0b74Schristos_LT_COMPILER_BOILERPLATE
698675fd0b74Schristos_LT_LINKER_BOILERPLATE
698775fd0b74Schristos
698875fd0b74Schristos# Allow CC to be a program name with arguments.
698975fd0b74Schristoslt_save_CC="$CC"
699075fd0b74Schristoslt_save_GCC=$GCC
699175fd0b74SchristosGCC=yes
699275fd0b74SchristosCC=${GCJ-"gcj"}
699375fd0b74Schristoscompiler=$CC
699475fd0b74Schristos_LT_TAGVAR(compiler, $1)=$CC
699575fd0b74Schristos_LT_TAGVAR(LD, $1)="$LD"
699675fd0b74Schristos_LT_CC_BASENAME([$compiler])
699775fd0b74Schristos
699875fd0b74Schristos# GCJ did not exist at the time GCC didn't implicitly link libc in.
699975fd0b74Schristos_LT_TAGVAR(archive_cmds_need_lc, $1)=no
700075fd0b74Schristos
700175fd0b74Schristos_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
700275fd0b74Schristos_LT_TAGVAR(reload_flag, $1)=$reload_flag
700375fd0b74Schristos_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
700475fd0b74Schristos
700575fd0b74Schristos## CAVEAT EMPTOR:
700675fd0b74Schristos## There is no encapsulation within the following macros, do not change
700775fd0b74Schristos## the running order or otherwise move them around unless you know exactly
700875fd0b74Schristos## what you are doing...
700975fd0b74Schristosif test -n "$compiler"; then
701075fd0b74Schristos  _LT_COMPILER_NO_RTTI($1)
701175fd0b74Schristos  _LT_COMPILER_PIC($1)
701275fd0b74Schristos  _LT_COMPILER_C_O($1)
701375fd0b74Schristos  _LT_COMPILER_FILE_LOCKS($1)
701475fd0b74Schristos  _LT_LINKER_SHLIBS($1)
701575fd0b74Schristos  _LT_LINKER_HARDCODE_LIBPATH($1)
701675fd0b74Schristos
701775fd0b74Schristos  _LT_CONFIG($1)
701875fd0b74Schristosfi
701975fd0b74Schristos
702075fd0b74SchristosAC_LANG_RESTORE
702175fd0b74Schristos
702275fd0b74SchristosGCC=$lt_save_GCC
702375fd0b74SchristosCC="$lt_save_CC"
702475fd0b74Schristos])# _LT_LANG_GCJ_CONFIG
702575fd0b74Schristos
702675fd0b74Schristos
702775fd0b74Schristos# _LT_LANG_RC_CONFIG([TAG])
702875fd0b74Schristos# -------------------------
702975fd0b74Schristos# Ensure that the configuration variables for the Windows resource compiler
703075fd0b74Schristos# are suitably defined.  These variables are subsequently used by _LT_CONFIG
703175fd0b74Schristos# to write the compiler configuration to `libtool'.
703275fd0b74Schristosm4_defun([_LT_LANG_RC_CONFIG],
703375fd0b74Schristos[AC_REQUIRE([LT_PROG_RC])dnl
703475fd0b74SchristosAC_LANG_SAVE
703575fd0b74Schristos
703675fd0b74Schristos# Source file extension for RC test sources.
703775fd0b74Schristosac_ext=rc
703875fd0b74Schristos
703975fd0b74Schristos# Object file extension for compiled RC test sources.
704075fd0b74Schristosobjext=o
704175fd0b74Schristos_LT_TAGVAR(objext, $1)=$objext
704275fd0b74Schristos
704375fd0b74Schristos# Code to be used in simple compile tests
704475fd0b74Schristoslt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
704575fd0b74Schristos
704675fd0b74Schristos# Code to be used in simple link tests
704775fd0b74Schristoslt_simple_link_test_code="$lt_simple_compile_test_code"
704875fd0b74Schristos
704975fd0b74Schristos# ltmain only uses $CC for tagged configurations so make sure $CC is set.
705075fd0b74Schristos_LT_TAG_COMPILER
705175fd0b74Schristos
705275fd0b74Schristos# save warnings/boilerplate of simple test code
705375fd0b74Schristos_LT_COMPILER_BOILERPLATE
705475fd0b74Schristos_LT_LINKER_BOILERPLATE
705575fd0b74Schristos
705675fd0b74Schristos# Allow CC to be a program name with arguments.
705775fd0b74Schristoslt_save_CC="$CC"
705875fd0b74Schristoslt_save_GCC=$GCC
705975fd0b74SchristosGCC=
706075fd0b74SchristosCC=${RC-"windres"}
706175fd0b74Schristoscompiler=$CC
706275fd0b74Schristos_LT_TAGVAR(compiler, $1)=$CC
706375fd0b74Schristos_LT_CC_BASENAME([$compiler])
706475fd0b74Schristos_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
706575fd0b74Schristos
706675fd0b74Schristosif test -n "$compiler"; then
706775fd0b74Schristos  :
706875fd0b74Schristos  _LT_CONFIG($1)
706975fd0b74Schristosfi
707075fd0b74Schristos
707175fd0b74SchristosGCC=$lt_save_GCC
707275fd0b74SchristosAC_LANG_RESTORE
707375fd0b74SchristosCC="$lt_save_CC"
707475fd0b74Schristos])# _LT_LANG_RC_CONFIG
707575fd0b74Schristos
707675fd0b74Schristos
707775fd0b74Schristos# LT_PROG_GCJ
707875fd0b74Schristos# -----------
707975fd0b74SchristosAC_DEFUN([LT_PROG_GCJ],
708075fd0b74Schristos[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
708175fd0b74Schristos  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
708275fd0b74Schristos    [AC_CHECK_TOOL(GCJ, gcj,)
708375fd0b74Schristos      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
708475fd0b74Schristos      AC_SUBST(GCJFLAGS)])])[]dnl
708575fd0b74Schristos])
708675fd0b74Schristos
708775fd0b74Schristos# Old name:
708875fd0b74SchristosAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
708975fd0b74Schristosdnl aclocal-1.4 backwards compatibility:
709075fd0b74Schristosdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
709175fd0b74Schristos
709275fd0b74Schristos
709375fd0b74Schristos# LT_PROG_RC
709475fd0b74Schristos# ----------
709575fd0b74SchristosAC_DEFUN([LT_PROG_RC],
709675fd0b74Schristos[AC_CHECK_TOOL(RC, windres,)
709775fd0b74Schristos])
709875fd0b74Schristos
709975fd0b74Schristos# Old name:
710075fd0b74SchristosAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
710175fd0b74Schristosdnl aclocal-1.4 backwards compatibility:
710275fd0b74Schristosdnl AC_DEFUN([LT_AC_PROG_RC], [])
710375fd0b74Schristos
710475fd0b74Schristos
710575fd0b74Schristos# _LT_DECL_EGREP
710675fd0b74Schristos# --------------
710775fd0b74Schristos# If we don't have a new enough Autoconf to choose the best grep
710875fd0b74Schristos# available, choose the one first in the user's PATH.
710975fd0b74Schristosm4_defun([_LT_DECL_EGREP],
711075fd0b74Schristos[AC_REQUIRE([AC_PROG_EGREP])dnl
711175fd0b74SchristosAC_REQUIRE([AC_PROG_FGREP])dnl
711275fd0b74Schristostest -z "$GREP" && GREP=grep
711375fd0b74Schristos_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
711475fd0b74Schristos_LT_DECL([], [EGREP], [1], [An ERE matcher])
711575fd0b74Schristos_LT_DECL([], [FGREP], [1], [A literal string matcher])
711675fd0b74Schristosdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
711775fd0b74SchristosAC_SUBST([GREP])
711875fd0b74Schristos])
711975fd0b74Schristos
712075fd0b74Schristos
712175fd0b74Schristos# _LT_DECL_OBJDUMP
712275fd0b74Schristos# --------------
712375fd0b74Schristos# If we don't have a new enough Autoconf to choose the best objdump
712475fd0b74Schristos# available, choose the one first in the user's PATH.
712575fd0b74Schristosm4_defun([_LT_DECL_OBJDUMP],
712675fd0b74Schristos[AC_CHECK_TOOL(OBJDUMP, objdump, false)
712775fd0b74Schristostest -z "$OBJDUMP" && OBJDUMP=objdump
712875fd0b74Schristos_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
712975fd0b74SchristosAC_SUBST([OBJDUMP])
713075fd0b74Schristos])
713175fd0b74Schristos
713275fd0b74Schristos
713375fd0b74Schristos# _LT_DECL_SED
713475fd0b74Schristos# ------------
713575fd0b74Schristos# Check for a fully-functional sed program, that truncates
713675fd0b74Schristos# as few characters as possible.  Prefer GNU sed if found.
713775fd0b74Schristosm4_defun([_LT_DECL_SED],
713875fd0b74Schristos[AC_PROG_SED
713975fd0b74Schristostest -z "$SED" && SED=sed
714075fd0b74SchristosXsed="$SED -e 1s/^X//"
714175fd0b74Schristos_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
714275fd0b74Schristos_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
714375fd0b74Schristos    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
714475fd0b74Schristos])# _LT_DECL_SED
714575fd0b74Schristos
714675fd0b74Schristosm4_ifndef([AC_PROG_SED], [
714775fd0b74Schristos############################################################
714875fd0b74Schristos# NOTE: This macro has been submitted for inclusion into   #
714975fd0b74Schristos#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
715075fd0b74Schristos#  a released version of Autoconf we should remove this    #
715175fd0b74Schristos#  macro and use it instead.                               #
715275fd0b74Schristos############################################################
715375fd0b74Schristos
715475fd0b74Schristosm4_defun([AC_PROG_SED],
715575fd0b74Schristos[AC_MSG_CHECKING([for a sed that does not truncate output])
715675fd0b74SchristosAC_CACHE_VAL(lt_cv_path_SED,
715775fd0b74Schristos[# Loop through the user's path and test for sed and gsed.
715875fd0b74Schristos# Then use that list of sed's as ones to test for truncation.
715975fd0b74Schristosas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
716075fd0b74Schristosfor as_dir in $PATH
716175fd0b74Schristosdo
716275fd0b74Schristos  IFS=$as_save_IFS
716375fd0b74Schristos  test -z "$as_dir" && as_dir=.
716475fd0b74Schristos  for lt_ac_prog in sed gsed; do
716575fd0b74Schristos    for ac_exec_ext in '' $ac_executable_extensions; do
716675fd0b74Schristos      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
716775fd0b74Schristos        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
716875fd0b74Schristos      fi
716975fd0b74Schristos    done
717075fd0b74Schristos  done
717175fd0b74Schristosdone
717275fd0b74SchristosIFS=$as_save_IFS
717375fd0b74Schristoslt_ac_max=0
717475fd0b74Schristoslt_ac_count=0
717575fd0b74Schristos# Add /usr/xpg4/bin/sed as it is typically found on Solaris
717675fd0b74Schristos# along with /bin/sed that truncates output.
717775fd0b74Schristosfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
717875fd0b74Schristos  test ! -f $lt_ac_sed && continue
717975fd0b74Schristos  cat /dev/null > conftest.in
718075fd0b74Schristos  lt_ac_count=0
718175fd0b74Schristos  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
718275fd0b74Schristos  # Check for GNU sed and select it if it is found.
718375fd0b74Schristos  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
718475fd0b74Schristos    lt_cv_path_SED=$lt_ac_sed
718575fd0b74Schristos    break
718675fd0b74Schristos  fi
718775fd0b74Schristos  while true; do
718875fd0b74Schristos    cat conftest.in conftest.in >conftest.tmp
718975fd0b74Schristos    mv conftest.tmp conftest.in
719075fd0b74Schristos    cp conftest.in conftest.nl
719175fd0b74Schristos    echo >>conftest.nl
719275fd0b74Schristos    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
719375fd0b74Schristos    cmp -s conftest.out conftest.nl || break
719475fd0b74Schristos    # 10000 chars as input seems more than enough
719575fd0b74Schristos    test $lt_ac_count -gt 10 && break
719675fd0b74Schristos    lt_ac_count=`expr $lt_ac_count + 1`
719775fd0b74Schristos    if test $lt_ac_count -gt $lt_ac_max; then
719875fd0b74Schristos      lt_ac_max=$lt_ac_count
719975fd0b74Schristos      lt_cv_path_SED=$lt_ac_sed
720075fd0b74Schristos    fi
720175fd0b74Schristos  done
720275fd0b74Schristosdone
720375fd0b74Schristos])
720475fd0b74SchristosSED=$lt_cv_path_SED
720575fd0b74SchristosAC_SUBST([SED])
720675fd0b74SchristosAC_MSG_RESULT([$SED])
720775fd0b74Schristos])#AC_PROG_SED
720875fd0b74Schristos])#m4_ifndef
720975fd0b74Schristos
721075fd0b74Schristos# Old name:
721175fd0b74SchristosAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
721275fd0b74Schristosdnl aclocal-1.4 backwards compatibility:
721375fd0b74Schristosdnl AC_DEFUN([LT_AC_PROG_SED], [])
721475fd0b74Schristos
721575fd0b74Schristos
721675fd0b74Schristos# _LT_CHECK_SHELL_FEATURES
721775fd0b74Schristos# ------------------------
721875fd0b74Schristos# Find out whether the shell is Bourne or XSI compatible,
721975fd0b74Schristos# or has some other useful features.
722075fd0b74Schristosm4_defun([_LT_CHECK_SHELL_FEATURES],
722175fd0b74Schristos[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
722275fd0b74Schristos# Try some XSI features
722375fd0b74Schristosxsi_shell=no
722475fd0b74Schristos( _lt_dummy="a/b/c"
722575fd0b74Schristos  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
722675fd0b74Schristos      = c,a/b,, \
722775fd0b74Schristos    && eval 'test $(( 1 + 1 )) -eq 2 \
722875fd0b74Schristos    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
722975fd0b74Schristos  && xsi_shell=yes
723075fd0b74SchristosAC_MSG_RESULT([$xsi_shell])
723175fd0b74Schristos_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
723275fd0b74Schristos
723375fd0b74SchristosAC_MSG_CHECKING([whether the shell understands "+="])
723475fd0b74Schristoslt_shell_append=no
723575fd0b74Schristos( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
723675fd0b74Schristos    >/dev/null 2>&1 \
723775fd0b74Schristos  && lt_shell_append=yes
723875fd0b74SchristosAC_MSG_RESULT([$lt_shell_append])
723975fd0b74Schristos_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
724075fd0b74Schristos
724175fd0b74Schristosif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
724275fd0b74Schristos  lt_unset=unset
724375fd0b74Schristoselse
724475fd0b74Schristos  lt_unset=false
724575fd0b74Schristosfi
724675fd0b74Schristos_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
724775fd0b74Schristos
724875fd0b74Schristos# test EBCDIC or ASCII
724975fd0b74Schristoscase `echo X|tr X '\101'` in
725075fd0b74Schristos A) # ASCII based system
725175fd0b74Schristos    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
725275fd0b74Schristos  lt_SP2NL='tr \040 \012'
725375fd0b74Schristos  lt_NL2SP='tr \015\012 \040\040'
725475fd0b74Schristos  ;;
725575fd0b74Schristos *) # EBCDIC based system
725675fd0b74Schristos  lt_SP2NL='tr \100 \n'
725775fd0b74Schristos  lt_NL2SP='tr \r\n \100\100'
725875fd0b74Schristos  ;;
725975fd0b74Schristosesac
726075fd0b74Schristos_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
726175fd0b74Schristos_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
726275fd0b74Schristos])# _LT_CHECK_SHELL_FEATURES
726375fd0b74Schristos
726475fd0b74Schristos
726575fd0b74Schristos# _LT_PROG_XSI_SHELLFNS
726675fd0b74Schristos# ---------------------
726775fd0b74Schristos# Bourne and XSI compatible variants of some useful shell functions.
726875fd0b74Schristosm4_defun([_LT_PROG_XSI_SHELLFNS],
726975fd0b74Schristos[case $xsi_shell in
727075fd0b74Schristos  yes)
727175fd0b74Schristos    cat << \_LT_EOF >> "$cfgfile"
727275fd0b74Schristos
727375fd0b74Schristos# func_dirname file append nondir_replacement
727475fd0b74Schristos# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
727575fd0b74Schristos# otherwise set result to NONDIR_REPLACEMENT.
727675fd0b74Schristosfunc_dirname ()
727775fd0b74Schristos{
727875fd0b74Schristos  case ${1} in
727975fd0b74Schristos    */*) func_dirname_result="${1%/*}${2}" ;;
728075fd0b74Schristos    *  ) func_dirname_result="${3}" ;;
728175fd0b74Schristos  esac
728275fd0b74Schristos}
728375fd0b74Schristos
728475fd0b74Schristos# func_basename file
728575fd0b74Schristosfunc_basename ()
728675fd0b74Schristos{
728775fd0b74Schristos  func_basename_result="${1##*/}"
728875fd0b74Schristos}
728975fd0b74Schristos
729075fd0b74Schristos# func_dirname_and_basename file append nondir_replacement
729175fd0b74Schristos# perform func_basename and func_dirname in a single function
729275fd0b74Schristos# call:
729375fd0b74Schristos#   dirname:  Compute the dirname of FILE.  If nonempty,
729475fd0b74Schristos#             add APPEND to the result, otherwise set result
729575fd0b74Schristos#             to NONDIR_REPLACEMENT.
729675fd0b74Schristos#             value returned in "$func_dirname_result"
729775fd0b74Schristos#   basename: Compute filename of FILE.
729875fd0b74Schristos#             value retuned in "$func_basename_result"
729975fd0b74Schristos# Implementation must be kept synchronized with func_dirname
730075fd0b74Schristos# and func_basename. For efficiency, we do not delegate to
730175fd0b74Schristos# those functions but instead duplicate the functionality here.
730275fd0b74Schristosfunc_dirname_and_basename ()
730375fd0b74Schristos{
730475fd0b74Schristos  case ${1} in
730575fd0b74Schristos    */*) func_dirname_result="${1%/*}${2}" ;;
730675fd0b74Schristos    *  ) func_dirname_result="${3}" ;;
730775fd0b74Schristos  esac
730875fd0b74Schristos  func_basename_result="${1##*/}"
730975fd0b74Schristos}
731075fd0b74Schristos
731175fd0b74Schristos# func_stripname prefix suffix name
731275fd0b74Schristos# strip PREFIX and SUFFIX off of NAME.
731375fd0b74Schristos# PREFIX and SUFFIX must not contain globbing or regex special
731475fd0b74Schristos# characters, hashes, percent signs, but SUFFIX may contain a leading
731575fd0b74Schristos# dot (in which case that matches only a dot).
731675fd0b74Schristosfunc_stripname ()
731775fd0b74Schristos{
731875fd0b74Schristos  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
731975fd0b74Schristos  # positional parameters, so assign one to ordinary parameter first.
732075fd0b74Schristos  func_stripname_result=${3}
732175fd0b74Schristos  func_stripname_result=${func_stripname_result#"${1}"}
732275fd0b74Schristos  func_stripname_result=${func_stripname_result%"${2}"}
732375fd0b74Schristos}
732475fd0b74Schristos
732575fd0b74Schristos# func_opt_split
732675fd0b74Schristosfunc_opt_split ()
732775fd0b74Schristos{
732875fd0b74Schristos  func_opt_split_opt=${1%%=*}
732975fd0b74Schristos  func_opt_split_arg=${1#*=}
733075fd0b74Schristos}
733175fd0b74Schristos
733275fd0b74Schristos# func_lo2o object
733375fd0b74Schristosfunc_lo2o ()
733475fd0b74Schristos{
733575fd0b74Schristos  case ${1} in
733675fd0b74Schristos    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
733775fd0b74Schristos    *)    func_lo2o_result=${1} ;;
733875fd0b74Schristos  esac
733975fd0b74Schristos}
734075fd0b74Schristos
734175fd0b74Schristos# func_xform libobj-or-source
734275fd0b74Schristosfunc_xform ()
734375fd0b74Schristos{
734475fd0b74Schristos  func_xform_result=${1%.*}.lo
734575fd0b74Schristos}
734675fd0b74Schristos
734775fd0b74Schristos# func_arith arithmetic-term...
734875fd0b74Schristosfunc_arith ()
734975fd0b74Schristos{
735075fd0b74Schristos  func_arith_result=$(( $[*] ))
735175fd0b74Schristos}
735275fd0b74Schristos
735375fd0b74Schristos# func_len string
735475fd0b74Schristos# STRING may not start with a hyphen.
735575fd0b74Schristosfunc_len ()
735675fd0b74Schristos{
735775fd0b74Schristos  func_len_result=${#1}
735875fd0b74Schristos}
735975fd0b74Schristos
736075fd0b74Schristos_LT_EOF
736175fd0b74Schristos    ;;
736275fd0b74Schristos  *) # Bourne compatible functions.
736375fd0b74Schristos    cat << \_LT_EOF >> "$cfgfile"
736475fd0b74Schristos
736575fd0b74Schristos# func_dirname file append nondir_replacement
736675fd0b74Schristos# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
736775fd0b74Schristos# otherwise set result to NONDIR_REPLACEMENT.
736875fd0b74Schristosfunc_dirname ()
736975fd0b74Schristos{
737075fd0b74Schristos  # Extract subdirectory from the argument.
737175fd0b74Schristos  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
737275fd0b74Schristos  if test "X$func_dirname_result" = "X${1}"; then
737375fd0b74Schristos    func_dirname_result="${3}"
737475fd0b74Schristos  else
737575fd0b74Schristos    func_dirname_result="$func_dirname_result${2}"
737675fd0b74Schristos  fi
737775fd0b74Schristos}
737875fd0b74Schristos
737975fd0b74Schristos# func_basename file
738075fd0b74Schristosfunc_basename ()
738175fd0b74Schristos{
738275fd0b74Schristos  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
738375fd0b74Schristos}
738475fd0b74Schristos
738575fd0b74Schristosdnl func_dirname_and_basename
738675fd0b74Schristosdnl A portable version of this function is already defined in general.m4sh
738775fd0b74Schristosdnl so there is no need for it here.
738875fd0b74Schristos
738975fd0b74Schristos# func_stripname prefix suffix name
739075fd0b74Schristos# strip PREFIX and SUFFIX off of NAME.
739175fd0b74Schristos# PREFIX and SUFFIX must not contain globbing or regex special
739275fd0b74Schristos# characters, hashes, percent signs, but SUFFIX may contain a leading
739375fd0b74Schristos# dot (in which case that matches only a dot).
739475fd0b74Schristos# func_strip_suffix prefix name
739575fd0b74Schristosfunc_stripname ()
739675fd0b74Schristos{
739775fd0b74Schristos  case ${2} in
739875fd0b74Schristos    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
739975fd0b74Schristos    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
740075fd0b74Schristos  esac
740175fd0b74Schristos}
740275fd0b74Schristos
740375fd0b74Schristos# sed scripts:
740475fd0b74Schristosmy_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
740575fd0b74Schristosmy_sed_long_arg='1s/^-[[^=]]*=//'
740675fd0b74Schristos
740775fd0b74Schristos# func_opt_split
740875fd0b74Schristosfunc_opt_split ()
740975fd0b74Schristos{
741075fd0b74Schristos  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
741175fd0b74Schristos  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
741275fd0b74Schristos}
741375fd0b74Schristos
741475fd0b74Schristos# func_lo2o object
741575fd0b74Schristosfunc_lo2o ()
741675fd0b74Schristos{
741775fd0b74Schristos  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
741875fd0b74Schristos}
741975fd0b74Schristos
742075fd0b74Schristos# func_xform libobj-or-source
742175fd0b74Schristosfunc_xform ()
742275fd0b74Schristos{
742375fd0b74Schristos  func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'`
742475fd0b74Schristos}
742575fd0b74Schristos
742675fd0b74Schristos# func_arith arithmetic-term...
742775fd0b74Schristosfunc_arith ()
742875fd0b74Schristos{
742975fd0b74Schristos  func_arith_result=`expr "$[@]"`
743075fd0b74Schristos}
743175fd0b74Schristos
743275fd0b74Schristos# func_len string
743375fd0b74Schristos# STRING may not start with a hyphen.
743475fd0b74Schristosfunc_len ()
743575fd0b74Schristos{
743675fd0b74Schristos  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
743775fd0b74Schristos}
743875fd0b74Schristos
743975fd0b74Schristos_LT_EOF
744075fd0b74Schristosesac
744175fd0b74Schristos
744275fd0b74Schristoscase $lt_shell_append in
744375fd0b74Schristos  yes)
744475fd0b74Schristos    cat << \_LT_EOF >> "$cfgfile"
744575fd0b74Schristos
744675fd0b74Schristos# func_append var value
744775fd0b74Schristos# Append VALUE to the end of shell variable VAR.
744875fd0b74Schristosfunc_append ()
744975fd0b74Schristos{
745075fd0b74Schristos  eval "$[1]+=\$[2]"
745175fd0b74Schristos}
745275fd0b74Schristos_LT_EOF
745375fd0b74Schristos    ;;
745475fd0b74Schristos  *)
745575fd0b74Schristos    cat << \_LT_EOF >> "$cfgfile"
745675fd0b74Schristos
745775fd0b74Schristos# func_append var value
745875fd0b74Schristos# Append VALUE to the end of shell variable VAR.
745975fd0b74Schristosfunc_append ()
746075fd0b74Schristos{
746175fd0b74Schristos  eval "$[1]=\$$[1]\$[2]"
746275fd0b74Schristos}
746375fd0b74Schristos
746475fd0b74Schristos_LT_EOF
746575fd0b74Schristos    ;;
746675fd0b74Schristos  esac
746775fd0b74Schristos])
7468