xref: /iperf/aclocal.m4 (revision 85b25c2e)
176bd67f6SSarah Larsen# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
2e34c20c8SJon Dugan
376bd67f6SSarah Larsen# Copyright (C) 1996-2021 Free Software Foundation, Inc.
46edfd8d6SBruce A. Mah
5e34c20c8SJon Dugan# This file is free software; the Free Software Foundation
6e34c20c8SJon Dugan# gives unlimited permission to copy and/or distribute it,
7e34c20c8SJon Dugan# with or without modifications, as long as this notice is preserved.
8e34c20c8SJon Dugan
9e34c20c8SJon Dugan# This program is distributed in the hope that it will be useful,
10e34c20c8SJon Dugan# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11e34c20c8SJon Dugan# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12e34c20c8SJon Dugan# PARTICULAR PURPOSE.
13e34c20c8SJon Dugan
146edfd8d6SBruce A. Mahm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
1560bd98a5SBruce A. Mahm4_ifndef([AC_AUTOCONF_VERSION],
1660bd98a5SBruce A. Mah  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17e479d607SBruce A. Mahm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
18e479d607SBruce A. Mah[m4_warning([this file was generated for autoconf 2.71.
1960bd98a5SBruce A. MahYou have another version of autoconf.  It may work, but is not guaranteed to.
2060bd98a5SBruce A. MahIf you have problems, you may need to regenerate the build system entirely.
216edfd8d6SBruce A. MahTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22ba7b91d2SJef Poskanzer
23e34c20c8SJon Dugan# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24ba7b91d2SJef Poskanzer#
25*85b25c2eSBruce A. Mah#   Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software
26*85b25c2eSBruce A. Mah#   Foundation, Inc.
27ba7b91d2SJef Poskanzer#   Written by Gordon Matzigkeit, 1996
28ba7b91d2SJef Poskanzer#
29ba7b91d2SJef Poskanzer# This file is free software; the Free Software Foundation gives
30ba7b91d2SJef Poskanzer# unlimited permission to copy and/or distribute it, with or without
31ba7b91d2SJef Poskanzer# modifications, as long as this notice is preserved.
32e34c20c8SJon Dugan
33ba7b91d2SJef Poskanzerm4_define([_LT_COPYING], [dnl
344874c4a8SBruce A. Mah# Copyright (C) 2014 Free Software Foundation, Inc.
354874c4a8SBruce A. Mah# This is free software; see the source for copying conditions.  There is NO
364874c4a8SBruce A. Mah# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
374874c4a8SBruce A. Mah
384874c4a8SBruce A. Mah# GNU Libtool is free software; you can redistribute it and/or modify
394874c4a8SBruce A. Mah# it under the terms of the GNU General Public License as published by
404874c4a8SBruce A. Mah# the Free Software Foundation; either version 2 of of the License, or
414874c4a8SBruce A. Mah# (at your option) any later version.
42ba7b91d2SJef Poskanzer#
434874c4a8SBruce A. Mah# As a special exception to the GNU General Public License, if you
444874c4a8SBruce A. Mah# distribute this file as part of a program or library that is built
454874c4a8SBruce A. Mah# using GNU Libtool, you may include this file under the  same
464874c4a8SBruce A. Mah# distribution terms that you use for the rest of that program.
47ba7b91d2SJef Poskanzer#
484874c4a8SBruce A. Mah# GNU Libtool is distributed in the hope that it will be useful, but
494874c4a8SBruce A. Mah# WITHOUT ANY WARRANTY; without even the implied warranty of
50ba7b91d2SJef Poskanzer# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
51ba7b91d2SJef Poskanzer# GNU General Public License for more details.
52ba7b91d2SJef Poskanzer#
53ba7b91d2SJef Poskanzer# You should have received a copy of the GNU General Public License
544874c4a8SBruce A. Mah# along with this program.  If not, see <http://www.gnu.org/licenses/>.
55ba7b91d2SJef Poskanzer])
56ba7b91d2SJef Poskanzer
57*85b25c2eSBruce A. Mah# serial 59 LT_INIT
58e34c20c8SJon Dugan
59e34c20c8SJon Dugan
60ba7b91d2SJef Poskanzer# LT_PREREQ(VERSION)
61ba7b91d2SJef Poskanzer# ------------------
62ba7b91d2SJef Poskanzer# Complain and exit if this libtool version is less that VERSION.
63ba7b91d2SJef Poskanzerm4_defun([LT_PREREQ],
64ba7b91d2SJef Poskanzer[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
65ba7b91d2SJef Poskanzer       [m4_default([$3],
66ba7b91d2SJef Poskanzer		   [m4_fatal([Libtool version $1 or higher is required],
67ba7b91d2SJef Poskanzer		             63)])],
68ba7b91d2SJef Poskanzer       [$2])])
69e34c20c8SJon Dugan
70e34c20c8SJon Dugan
71ba7b91d2SJef Poskanzer# _LT_CHECK_BUILDDIR
72ba7b91d2SJef Poskanzer# ------------------
73ba7b91d2SJef Poskanzer# Complain if the absolute build directory name contains unusual characters
74ba7b91d2SJef Poskanzerm4_defun([_LT_CHECK_BUILDDIR],
75ba7b91d2SJef Poskanzer[case `pwd` in
76ba7b91d2SJef Poskanzer  *\ * | *\	*)
77ba7b91d2SJef Poskanzer    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
78ba7b91d2SJef Poskanzeresac
79ba7b91d2SJef Poskanzer])
80e34c20c8SJon Dugan
81e34c20c8SJon Dugan
82ba7b91d2SJef Poskanzer# LT_INIT([OPTIONS])
83ba7b91d2SJef Poskanzer# ------------------
84ba7b91d2SJef PoskanzerAC_DEFUN([LT_INIT],
854874c4a8SBruce A. Mah[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
866edfd8d6SBruce A. MahAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
87ba7b91d2SJef PoskanzerAC_BEFORE([$0], [LT_LANG])dnl
88ba7b91d2SJef PoskanzerAC_BEFORE([$0], [LT_OUTPUT])dnl
89ba7b91d2SJef PoskanzerAC_BEFORE([$0], [LTDL_INIT])dnl
90ba7b91d2SJef Poskanzerm4_require([_LT_CHECK_BUILDDIR])dnl
91ba7b91d2SJef Poskanzer
92ba7b91d2SJef Poskanzerdnl Autoconf doesn't catch unexpanded LT_ macros by default:
93ba7b91d2SJef Poskanzerm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
94ba7b91d2SJef Poskanzerm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
95ba7b91d2SJef Poskanzerdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
96ba7b91d2SJef Poskanzerdnl unless we require an AC_DEFUNed macro:
97ba7b91d2SJef PoskanzerAC_REQUIRE([LTOPTIONS_VERSION])dnl
98ba7b91d2SJef PoskanzerAC_REQUIRE([LTSUGAR_VERSION])dnl
99ba7b91d2SJef PoskanzerAC_REQUIRE([LTVERSION_VERSION])dnl
100ba7b91d2SJef PoskanzerAC_REQUIRE([LTOBSOLETE_VERSION])dnl
101ba7b91d2SJef Poskanzerm4_require([_LT_PROG_LTMAIN])dnl
102ba7b91d2SJef Poskanzer
1036edfd8d6SBruce A. Mah_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1046edfd8d6SBruce A. Mah
105ba7b91d2SJef Poskanzerdnl Parse OPTIONS
106ba7b91d2SJef Poskanzer_LT_SET_OPTIONS([$0], [$1])
107e34c20c8SJon Dugan
108e34c20c8SJon Dugan# This can be used to rebuild libtool when needed
1094874c4a8SBruce A. MahLIBTOOL_DEPS=$ltmain
110e34c20c8SJon Dugan
111e34c20c8SJon Dugan# Always use our own libtool.
112e34c20c8SJon DuganLIBTOOL='$(SHELL) $(top_builddir)/libtool'
113e34c20c8SJon DuganAC_SUBST(LIBTOOL)dnl
114e34c20c8SJon Dugan
115ba7b91d2SJef Poskanzer_LT_SETUP
116ba7b91d2SJef Poskanzer
117ba7b91d2SJef Poskanzer# Only expand once:
118ba7b91d2SJef Poskanzerm4_define([LT_INIT])
119ba7b91d2SJef Poskanzer])# LT_INIT
120ba7b91d2SJef Poskanzer
121ba7b91d2SJef Poskanzer# Old names:
122ba7b91d2SJef PoskanzerAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
123ba7b91d2SJef PoskanzerAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
124ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
125ba7b91d2SJef Poskanzerdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
126ba7b91d2SJef Poskanzerdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
127e34c20c8SJon Dugan
128e34c20c8SJon Dugan
1295461579dSBruce A. Mah# _LT_PREPARE_CC_BASENAME
1305461579dSBruce A. Mah# -----------------------
1315461579dSBruce A. Mahm4_defun([_LT_PREPARE_CC_BASENAME], [
132ba7b91d2SJef Poskanzer# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1335461579dSBruce A. Mahfunc_cc_basename ()
1345461579dSBruce A. Mah{
1355461579dSBruce A. Mah    for cc_temp in @S|@*""; do
136ba7b91d2SJef Poskanzer      case $cc_temp in
137ba7b91d2SJef Poskanzer        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
138ba7b91d2SJef Poskanzer        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
139ba7b91d2SJef Poskanzer        \-*) ;;
140ba7b91d2SJef Poskanzer        *) break;;
141ba7b91d2SJef Poskanzer      esac
142ba7b91d2SJef Poskanzer    done
1435461579dSBruce A. Mah    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
1445461579dSBruce A. Mah}
1455461579dSBruce A. Mah])# _LT_PREPARE_CC_BASENAME
1465461579dSBruce A. Mah
1475461579dSBruce A. Mah
1485461579dSBruce A. Mah# _LT_CC_BASENAME(CC)
1495461579dSBruce A. Mah# -------------------
1505461579dSBruce A. Mah# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
1515461579dSBruce A. Mah# but that macro is also expanded into generated libtool script, which
1525461579dSBruce A. Mah# arranges for $SED and $ECHO to be set by different means.
1535461579dSBruce A. Mahm4_defun([_LT_CC_BASENAME],
1545461579dSBruce A. Mah[m4_require([_LT_PREPARE_CC_BASENAME])dnl
1555461579dSBruce A. MahAC_REQUIRE([_LT_DECL_SED])dnl
1565461579dSBruce A. MahAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1575461579dSBruce A. Mahfunc_cc_basename $1
1585461579dSBruce A. Mahcc_basename=$func_cc_basename_result
159ba7b91d2SJef Poskanzer])
160ba7b91d2SJef Poskanzer
161ba7b91d2SJef Poskanzer
162ba7b91d2SJef Poskanzer# _LT_FILEUTILS_DEFAULTS
163ba7b91d2SJef Poskanzer# ----------------------
164ba7b91d2SJef Poskanzer# It is okay to use these file commands and assume they have been set
1654874c4a8SBruce A. Mah# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
166ba7b91d2SJef Poskanzerm4_defun([_LT_FILEUTILS_DEFAULTS],
167ba7b91d2SJef Poskanzer[: ${CP="cp -f"}
168ba7b91d2SJef Poskanzer: ${MV="mv -f"}
169ba7b91d2SJef Poskanzer: ${RM="rm -f"}
170ba7b91d2SJef Poskanzer])# _LT_FILEUTILS_DEFAULTS
171ba7b91d2SJef Poskanzer
172ba7b91d2SJef Poskanzer
173ba7b91d2SJef Poskanzer# _LT_SETUP
174ba7b91d2SJef Poskanzer# ---------
175ba7b91d2SJef Poskanzerm4_defun([_LT_SETUP],
176ba7b91d2SJef Poskanzer[AC_REQUIRE([AC_CANONICAL_HOST])dnl
177e34c20c8SJon DuganAC_REQUIRE([AC_CANONICAL_BUILD])dnl
1786edfd8d6SBruce A. MahAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1796edfd8d6SBruce A. MahAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1806edfd8d6SBruce A. Mah
1816edfd8d6SBruce A. Mah_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
1826edfd8d6SBruce A. Mahdnl
183ba7b91d2SJef Poskanzer_LT_DECL([], [host_alias], [0], [The host system])dnl
184ba7b91d2SJef Poskanzer_LT_DECL([], [host], [0])dnl
185ba7b91d2SJef Poskanzer_LT_DECL([], [host_os], [0])dnl
186e34c20c8SJon Dugandnl
187ba7b91d2SJef Poskanzer_LT_DECL([], [build_alias], [0], [The build system])dnl
188ba7b91d2SJef Poskanzer_LT_DECL([], [build], [0])dnl
189ba7b91d2SJef Poskanzer_LT_DECL([], [build_os], [0])dnl
190ba7b91d2SJef Poskanzerdnl
191ba7b91d2SJef PoskanzerAC_REQUIRE([AC_PROG_CC])dnl
192ba7b91d2SJef PoskanzerAC_REQUIRE([LT_PATH_LD])dnl
193ba7b91d2SJef PoskanzerAC_REQUIRE([LT_PATH_NM])dnl
194ba7b91d2SJef Poskanzerdnl
195ba7b91d2SJef PoskanzerAC_REQUIRE([AC_PROG_LN_S])dnl
196ba7b91d2SJef Poskanzertest -z "$LN_S" && LN_S="ln -s"
197ba7b91d2SJef Poskanzer_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
198ba7b91d2SJef Poskanzerdnl
199ba7b91d2SJef PoskanzerAC_REQUIRE([LT_CMD_MAX_LEN])dnl
200ba7b91d2SJef Poskanzer_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
201ba7b91d2SJef Poskanzer_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
202ba7b91d2SJef Poskanzerdnl
203ba7b91d2SJef Poskanzerm4_require([_LT_FILEUTILS_DEFAULTS])dnl
204ba7b91d2SJef Poskanzerm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2056edfd8d6SBruce A. Mahm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
206ba7b91d2SJef Poskanzerm4_require([_LT_CMD_RELOAD])dnl
207*85b25c2eSBruce A. Mahm4_require([_LT_DECL_FILECMD])dnl
208ba7b91d2SJef Poskanzerm4_require([_LT_CHECK_MAGIC_METHOD])dnl
2096edfd8d6SBruce A. Mahm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
210ba7b91d2SJef Poskanzerm4_require([_LT_CMD_OLD_ARCHIVE])dnl
211ba7b91d2SJef Poskanzerm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
2126edfd8d6SBruce A. Mahm4_require([_LT_WITH_SYSROOT])dnl
2134874c4a8SBruce A. Mahm4_require([_LT_CMD_TRUNCATE])dnl
214e34c20c8SJon Dugan
215ba7b91d2SJef Poskanzer_LT_CONFIG_LIBTOOL_INIT([
2164874c4a8SBruce A. Mah# See if we are running on zsh, and set the options that allow our
217ba7b91d2SJef Poskanzer# commands through without removal of \ escapes INIT.
218ba7b91d2SJef Poskanzerif test -n "\${ZSH_VERSION+set}"; then
219ba7b91d2SJef Poskanzer   setopt NO_GLOB_SUBST
220ba7b91d2SJef Poskanzerfi
221ba7b91d2SJef Poskanzer])
222ba7b91d2SJef Poskanzerif test -n "${ZSH_VERSION+set}"; then
223ba7b91d2SJef Poskanzer   setopt NO_GLOB_SUBST
224ba7b91d2SJef Poskanzerfi
225e34c20c8SJon Dugan
226ba7b91d2SJef Poskanzer_LT_CHECK_OBJDIR
227ba7b91d2SJef Poskanzer
228ba7b91d2SJef Poskanzerm4_require([_LT_TAG_COMPILER])dnl
229e34c20c8SJon Dugan
230e34c20c8SJon Dugancase $host_os in
231e34c20c8SJon Duganaix3*)
232e34c20c8SJon Dugan  # AIX sometimes has problems with the GCC collect2 program.  For some
233e34c20c8SJon Dugan  # reason, if we set the COLLECT_NAMES environment variable, the problems
234e34c20c8SJon Dugan  # vanish in a puff of smoke.
2354874c4a8SBruce A. Mah  if test set != "${COLLECT_NAMES+set}"; then
236e34c20c8SJon Dugan    COLLECT_NAMES=
237e34c20c8SJon Dugan    export COLLECT_NAMES
238e34c20c8SJon Dugan  fi
239e34c20c8SJon Dugan  ;;
240e34c20c8SJon Duganesac
241e34c20c8SJon Dugan
24256a97f93Sjef# Global variables:
243ba7b91d2SJef Poskanzerofile=libtool
24456a97f93Sjefcan_build_shared=yes
24556a97f93Sjef
246*85b25c2eSBruce A. Mah# All known linkers require a '.a' archive for static linking (except MSVC and
247*85b25c2eSBruce A. Mah# ICC, which need '.lib').
24856a97f93Sjeflibext=a
249e34c20c8SJon Dugan
2504874c4a8SBruce A. Mahwith_gnu_ld=$lt_cv_prog_gnu_ld
251e34c20c8SJon Dugan
2524874c4a8SBruce A. Mahold_CC=$CC
2534874c4a8SBruce A. Mahold_CFLAGS=$CFLAGS
254e34c20c8SJon Dugan
25556a97f93Sjef# Set sane defaults for various variables
25656a97f93Sjeftest -z "$CC" && CC=cc
25756a97f93Sjeftest -z "$LTCC" && LTCC=$CC
25856a97f93Sjeftest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
25956a97f93Sjeftest -z "$LD" && LD=ld
26056a97f93Sjeftest -z "$ac_objext" && ac_objext=o
261e34c20c8SJon Dugan
26256a97f93Sjef_LT_CC_BASENAME([$compiler])
26356a97f93Sjef
26456a97f93Sjef# Only perform the check for file, if the check method requires it
265ba7b91d2SJef Poskanzertest -z "$MAGIC_CMD" && MAGIC_CMD=file
26656a97f93Sjefcase $deplibs_check_method in
26756a97f93Sjeffile_magic*)
26856a97f93Sjef  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
269ba7b91d2SJef Poskanzer    _LT_PATH_MAGIC
27056a97f93Sjef  fi
271e34c20c8SJon Dugan  ;;
272e34c20c8SJon Duganesac
273e34c20c8SJon Dugan
27456a97f93Sjef# Use C for the default configuration in the libtool script
275ba7b91d2SJef PoskanzerLT_SUPPORTED_TAG([CC])
276ba7b91d2SJef Poskanzer_LT_LANG_C_CONFIG
277ba7b91d2SJef Poskanzer_LT_LANG_DEFAULT_CONFIG
278ba7b91d2SJef Poskanzer_LT_CONFIG_COMMANDS
279ba7b91d2SJef Poskanzer])# _LT_SETUP
280e34c20c8SJon Dugan
281e34c20c8SJon Dugan
2826edfd8d6SBruce A. Mah# _LT_PREPARE_SED_QUOTE_VARS
2836edfd8d6SBruce A. Mah# --------------------------
2846edfd8d6SBruce A. Mah# Define a few sed substitution that help us do robust quoting.
2856edfd8d6SBruce A. Mahm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
2866edfd8d6SBruce A. Mah[# Backslashify metacharacters that are still active within
2876edfd8d6SBruce A. Mah# double-quoted strings.
2886edfd8d6SBruce A. Mahsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
2896edfd8d6SBruce A. Mah
2906edfd8d6SBruce A. Mah# Same as above, but do not quote variable references.
2916edfd8d6SBruce A. Mahdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
2926edfd8d6SBruce A. Mah
2936edfd8d6SBruce A. Mah# Sed substitution to delay expansion of an escaped shell variable in a
2946edfd8d6SBruce A. Mah# double_quote_subst'ed string.
2956edfd8d6SBruce A. Mahdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
2966edfd8d6SBruce A. Mah
2976edfd8d6SBruce A. Mah# Sed substitution to delay expansion of an escaped single quote.
2986edfd8d6SBruce A. Mahdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
2996edfd8d6SBruce A. Mah
3006edfd8d6SBruce A. Mah# Sed substitution to avoid accidental globbing in evaled expressions
3016edfd8d6SBruce A. Mahno_glob_subst='s/\*/\\\*/g'
3026edfd8d6SBruce A. Mah])
3036edfd8d6SBruce A. Mah
304ba7b91d2SJef Poskanzer# _LT_PROG_LTMAIN
305ba7b91d2SJef Poskanzer# ---------------
3064874c4a8SBruce A. Mah# Note that this code is called both from 'configure', and 'config.status'
307ba7b91d2SJef Poskanzer# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
3084874c4a8SBruce A. Mah# 'config.status' has no value for ac_aux_dir unless we are using Automake,
309ba7b91d2SJef Poskanzer# so we pass a copy along to make sure it has a sensible value anyway.
310ba7b91d2SJef Poskanzerm4_defun([_LT_PROG_LTMAIN],
311ba7b91d2SJef Poskanzer[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
312ba7b91d2SJef Poskanzer_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
3134874c4a8SBruce A. Mahltmain=$ac_aux_dir/ltmain.sh
314ba7b91d2SJef Poskanzer])# _LT_PROG_LTMAIN
315ba7b91d2SJef Poskanzer
316ba7b91d2SJef Poskanzer
317ba7b91d2SJef Poskanzer
318ba7b91d2SJef Poskanzer# So that we can recreate a full libtool script including additional
319ba7b91d2SJef Poskanzer# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
3204874c4a8SBruce A. Mah# in macros and then make a single call at the end using the 'libtool'
321ba7b91d2SJef Poskanzer# label.
322ba7b91d2SJef Poskanzer
323ba7b91d2SJef Poskanzer
324ba7b91d2SJef Poskanzer# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
325ba7b91d2SJef Poskanzer# ----------------------------------------
326ba7b91d2SJef Poskanzer# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
327ba7b91d2SJef Poskanzerm4_define([_LT_CONFIG_LIBTOOL_INIT],
328ba7b91d2SJef Poskanzer[m4_ifval([$1],
329ba7b91d2SJef Poskanzer          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
330ba7b91d2SJef Poskanzer                     [$1
331ba7b91d2SJef Poskanzer])])])
332ba7b91d2SJef Poskanzer
333ba7b91d2SJef Poskanzer# Initialize.
334ba7b91d2SJef Poskanzerm4_define([_LT_OUTPUT_LIBTOOL_INIT])
335ba7b91d2SJef Poskanzer
336ba7b91d2SJef Poskanzer
337ba7b91d2SJef Poskanzer# _LT_CONFIG_LIBTOOL([COMMANDS])
338ba7b91d2SJef Poskanzer# ------------------------------
339ba7b91d2SJef Poskanzer# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
340ba7b91d2SJef Poskanzerm4_define([_LT_CONFIG_LIBTOOL],
341ba7b91d2SJef Poskanzer[m4_ifval([$1],
342ba7b91d2SJef Poskanzer          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
343ba7b91d2SJef Poskanzer                     [$1
344ba7b91d2SJef Poskanzer])])])
345ba7b91d2SJef Poskanzer
346ba7b91d2SJef Poskanzer# Initialize.
347ba7b91d2SJef Poskanzerm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
348ba7b91d2SJef Poskanzer
349ba7b91d2SJef Poskanzer
350ba7b91d2SJef Poskanzer# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
351ba7b91d2SJef Poskanzer# -----------------------------------------------------
352ba7b91d2SJef Poskanzerm4_defun([_LT_CONFIG_SAVE_COMMANDS],
353ba7b91d2SJef Poskanzer[_LT_CONFIG_LIBTOOL([$1])
354ba7b91d2SJef Poskanzer_LT_CONFIG_LIBTOOL_INIT([$2])
355ba7b91d2SJef Poskanzer])
356ba7b91d2SJef Poskanzer
357ba7b91d2SJef Poskanzer
358ba7b91d2SJef Poskanzer# _LT_FORMAT_COMMENT([COMMENT])
359ba7b91d2SJef Poskanzer# -----------------------------
360ba7b91d2SJef Poskanzer# Add leading comment marks to the start of each line, and a trailing
361ba7b91d2SJef Poskanzer# full-stop to the whole comment if one is not present already.
362ba7b91d2SJef Poskanzerm4_define([_LT_FORMAT_COMMENT],
363ba7b91d2SJef Poskanzer[m4_ifval([$1], [
364ba7b91d2SJef Poskanzerm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
365ba7b91d2SJef Poskanzer              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
366ba7b91d2SJef Poskanzer)])
367ba7b91d2SJef Poskanzer
368ba7b91d2SJef Poskanzer
369ba7b91d2SJef Poskanzer
370ba7b91d2SJef Poskanzer
371ba7b91d2SJef Poskanzer
372ba7b91d2SJef Poskanzer# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
373ba7b91d2SJef Poskanzer# -------------------------------------------------------------------
374ba7b91d2SJef Poskanzer# CONFIGNAME is the name given to the value in the libtool script.
375ba7b91d2SJef Poskanzer# VARNAME is the (base) name used in the configure script.
376ba7b91d2SJef Poskanzer# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
377ba7b91d2SJef Poskanzer# VARNAME.  Any other value will be used directly.
378ba7b91d2SJef Poskanzerm4_define([_LT_DECL],
379ba7b91d2SJef Poskanzer[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
380ba7b91d2SJef Poskanzer    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
381ba7b91d2SJef Poskanzer	[m4_ifval([$1], [$1], [$2])])
382ba7b91d2SJef Poskanzer    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
383ba7b91d2SJef Poskanzer    m4_ifval([$4],
384ba7b91d2SJef Poskanzer	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
385ba7b91d2SJef Poskanzer    lt_dict_add_subkey([lt_decl_dict], [$2],
386ba7b91d2SJef Poskanzer	[tagged?], [m4_ifval([$5], [yes], [no])])])
387ba7b91d2SJef Poskanzer])
388ba7b91d2SJef Poskanzer
389ba7b91d2SJef Poskanzer
390ba7b91d2SJef Poskanzer# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
391ba7b91d2SJef Poskanzer# --------------------------------------------------------
392ba7b91d2SJef Poskanzerm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
393ba7b91d2SJef Poskanzer
394ba7b91d2SJef Poskanzer
395ba7b91d2SJef Poskanzer# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
396ba7b91d2SJef Poskanzer# ------------------------------------------------
397ba7b91d2SJef Poskanzerm4_define([lt_decl_tag_varnames],
398ba7b91d2SJef Poskanzer[_lt_decl_filter([tagged?], [yes], $@)])
399ba7b91d2SJef Poskanzer
400ba7b91d2SJef Poskanzer
401ba7b91d2SJef Poskanzer# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
402ba7b91d2SJef Poskanzer# ---------------------------------------------------------
403ba7b91d2SJef Poskanzerm4_define([_lt_decl_filter],
404ba7b91d2SJef Poskanzer[m4_case([$#],
405ba7b91d2SJef Poskanzer  [0], [m4_fatal([$0: too few arguments: $#])],
406ba7b91d2SJef Poskanzer  [1], [m4_fatal([$0: too few arguments: $#: $1])],
407ba7b91d2SJef Poskanzer  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
408ba7b91d2SJef Poskanzer  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
409ba7b91d2SJef Poskanzer  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
410ba7b91d2SJef Poskanzer])
411ba7b91d2SJef Poskanzer
412ba7b91d2SJef Poskanzer
413ba7b91d2SJef Poskanzer# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
414ba7b91d2SJef Poskanzer# --------------------------------------------------
415ba7b91d2SJef Poskanzerm4_define([lt_decl_quote_varnames],
416ba7b91d2SJef Poskanzer[_lt_decl_filter([value], [1], $@)])
417ba7b91d2SJef Poskanzer
418ba7b91d2SJef Poskanzer
419ba7b91d2SJef Poskanzer# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
420ba7b91d2SJef Poskanzer# ---------------------------------------------------
421ba7b91d2SJef Poskanzerm4_define([lt_decl_dquote_varnames],
422ba7b91d2SJef Poskanzer[_lt_decl_filter([value], [2], $@)])
423ba7b91d2SJef Poskanzer
424ba7b91d2SJef Poskanzer
425ba7b91d2SJef Poskanzer# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
426ba7b91d2SJef Poskanzer# ---------------------------------------------------
427ba7b91d2SJef Poskanzerm4_define([lt_decl_varnames_tagged],
42860bd98a5SBruce A. Mah[m4_assert([$# <= 2])dnl
42960bd98a5SBruce A. Mah_$0(m4_quote(m4_default([$1], [[, ]])),
43060bd98a5SBruce A. Mah    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
43160bd98a5SBruce A. Mah    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
43260bd98a5SBruce A. Mahm4_define([_lt_decl_varnames_tagged],
43360bd98a5SBruce A. Mah[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
434ba7b91d2SJef Poskanzer
435ba7b91d2SJef Poskanzer
436ba7b91d2SJef Poskanzer# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
437ba7b91d2SJef Poskanzer# ------------------------------------------------
438ba7b91d2SJef Poskanzerm4_define([lt_decl_all_varnames],
439ba7b91d2SJef Poskanzer[_$0(m4_quote(m4_default([$1], [[, ]])),
440ba7b91d2SJef Poskanzer     m4_if([$2], [],
441ba7b91d2SJef Poskanzer	   m4_quote(lt_decl_varnames),
442ba7b91d2SJef Poskanzer	m4_quote(m4_shift($@))))[]dnl
443ba7b91d2SJef Poskanzer])
444ba7b91d2SJef Poskanzerm4_define([_lt_decl_all_varnames],
445ba7b91d2SJef Poskanzer[lt_join($@, lt_decl_varnames_tagged([$1],
446ba7b91d2SJef Poskanzer			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
447ba7b91d2SJef Poskanzer])
448ba7b91d2SJef Poskanzer
449ba7b91d2SJef Poskanzer
450ba7b91d2SJef Poskanzer# _LT_CONFIG_STATUS_DECLARE([VARNAME])
451ba7b91d2SJef Poskanzer# ------------------------------------
4524874c4a8SBruce A. Mah# Quote a variable value, and forward it to 'config.status' so that its
4534874c4a8SBruce A. Mah# declaration there will have the same value as in 'configure'.  VARNAME
454ba7b91d2SJef Poskanzer# must have a single quote delimited value for this to work.
455ba7b91d2SJef Poskanzerm4_define([_LT_CONFIG_STATUS_DECLARE],
4566edfd8d6SBruce A. Mah[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
457ba7b91d2SJef Poskanzer
458ba7b91d2SJef Poskanzer
459ba7b91d2SJef Poskanzer# _LT_CONFIG_STATUS_DECLARATIONS
460ba7b91d2SJef Poskanzer# ------------------------------
461ba7b91d2SJef Poskanzer# We delimit libtool config variables with single quotes, so when
462ba7b91d2SJef Poskanzer# we write them to config.status, we have to be sure to quote all
463ba7b91d2SJef Poskanzer# embedded single quotes properly.  In configure, this macro expands
464ba7b91d2SJef Poskanzer# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
465ba7b91d2SJef Poskanzer#
4666edfd8d6SBruce A. Mah#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
467ba7b91d2SJef Poskanzerm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
468ba7b91d2SJef Poskanzer[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
469ba7b91d2SJef Poskanzer    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
470ba7b91d2SJef Poskanzer
471ba7b91d2SJef Poskanzer
472ba7b91d2SJef Poskanzer# _LT_LIBTOOL_TAGS
473ba7b91d2SJef Poskanzer# ----------------
474ba7b91d2SJef Poskanzer# Output comment and list of tags supported by the script
475ba7b91d2SJef Poskanzerm4_defun([_LT_LIBTOOL_TAGS],
476ba7b91d2SJef Poskanzer[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
4774874c4a8SBruce A. Mahavailable_tags='_LT_TAGS'dnl
478ba7b91d2SJef Poskanzer])
479ba7b91d2SJef Poskanzer
480ba7b91d2SJef Poskanzer
481ba7b91d2SJef Poskanzer# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
482ba7b91d2SJef Poskanzer# -----------------------------------
483ba7b91d2SJef Poskanzer# Extract the dictionary values for VARNAME (optionally with TAG) and
484ba7b91d2SJef Poskanzer# expand to a commented shell variable setting:
485ba7b91d2SJef Poskanzer#
486ba7b91d2SJef Poskanzer#    # Some comment about what VAR is for.
487ba7b91d2SJef Poskanzer#    visible_name=$lt_internal_name
488ba7b91d2SJef Poskanzerm4_define([_LT_LIBTOOL_DECLARE],
489ba7b91d2SJef Poskanzer[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
490ba7b91d2SJef Poskanzer					   [description])))[]dnl
491ba7b91d2SJef Poskanzerm4_pushdef([_libtool_name],
492ba7b91d2SJef Poskanzer    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
493ba7b91d2SJef Poskanzerm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
494ba7b91d2SJef Poskanzer    [0], [_libtool_name=[$]$1],
495ba7b91d2SJef Poskanzer    [1], [_libtool_name=$lt_[]$1],
496ba7b91d2SJef Poskanzer    [2], [_libtool_name=$lt_[]$1],
497ba7b91d2SJef Poskanzer    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
498ba7b91d2SJef Poskanzerm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
499ba7b91d2SJef Poskanzer])
500ba7b91d2SJef Poskanzer
501ba7b91d2SJef Poskanzer
502ba7b91d2SJef Poskanzer# _LT_LIBTOOL_CONFIG_VARS
503ba7b91d2SJef Poskanzer# -----------------------
504ba7b91d2SJef Poskanzer# Produce commented declarations of non-tagged libtool config variables
5054874c4a8SBruce A. Mah# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
506ba7b91d2SJef Poskanzer# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
507ba7b91d2SJef Poskanzer# section) are produced by _LT_LIBTOOL_TAG_VARS.
508ba7b91d2SJef Poskanzerm4_defun([_LT_LIBTOOL_CONFIG_VARS],
509ba7b91d2SJef Poskanzer[m4_foreach([_lt_var],
510ba7b91d2SJef Poskanzer    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
511ba7b91d2SJef Poskanzer    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
512ba7b91d2SJef Poskanzer
513ba7b91d2SJef Poskanzer
514ba7b91d2SJef Poskanzer# _LT_LIBTOOL_TAG_VARS(TAG)
515ba7b91d2SJef Poskanzer# -------------------------
516ba7b91d2SJef Poskanzerm4_define([_LT_LIBTOOL_TAG_VARS],
517ba7b91d2SJef Poskanzer[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
518ba7b91d2SJef Poskanzer    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
519ba7b91d2SJef Poskanzer
520ba7b91d2SJef Poskanzer
521ba7b91d2SJef Poskanzer# _LT_TAGVAR(VARNAME, [TAGNAME])
522ba7b91d2SJef Poskanzer# ------------------------------
523ba7b91d2SJef Poskanzerm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
524ba7b91d2SJef Poskanzer
525ba7b91d2SJef Poskanzer
526ba7b91d2SJef Poskanzer# _LT_CONFIG_COMMANDS
52756a97f93Sjef# -------------------
528ba7b91d2SJef Poskanzer# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
529ba7b91d2SJef Poskanzer# variables for single and double quote escaping we saved from calls
530ba7b91d2SJef Poskanzer# to _LT_DECL, we can put quote escaped variables declarations
5314874c4a8SBruce A. Mah# into 'config.status', and then the shell code to quote escape them in
5324874c4a8SBruce A. Mah# for loops in 'config.status'.  Finally, any additional code accumulated
533ba7b91d2SJef Poskanzer# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
534ba7b91d2SJef Poskanzerm4_defun([_LT_CONFIG_COMMANDS],
535ba7b91d2SJef Poskanzer[AC_PROVIDE_IFELSE([LT_OUTPUT],
536ba7b91d2SJef Poskanzer	dnl If the libtool generation code has been placed in $CONFIG_LT,
537ba7b91d2SJef Poskanzer	dnl instead of duplicating it all over again into config.status,
538ba7b91d2SJef Poskanzer	dnl then we will have config.status run $CONFIG_LT later, so it
539ba7b91d2SJef Poskanzer	dnl needs to know what name is stored there:
540ba7b91d2SJef Poskanzer        [AC_CONFIG_COMMANDS([libtool],
541ba7b91d2SJef Poskanzer            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
542ba7b91d2SJef Poskanzer    dnl If the libtool generation code is destined for config.status,
543ba7b91d2SJef Poskanzer    dnl expand the accumulated commands and init code now:
544ba7b91d2SJef Poskanzer    [AC_CONFIG_COMMANDS([libtool],
545ba7b91d2SJef Poskanzer        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
546ba7b91d2SJef Poskanzer])#_LT_CONFIG_COMMANDS
547ba7b91d2SJef Poskanzer
548ba7b91d2SJef Poskanzer
549ba7b91d2SJef Poskanzer# Initialize.
550ba7b91d2SJef Poskanzerm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
551ba7b91d2SJef Poskanzer[
552ba7b91d2SJef Poskanzer
553ba7b91d2SJef Poskanzer# The HP-UX ksh and POSIX shell print the target directory to stdout
554ba7b91d2SJef Poskanzer# if CDPATH is set.
555ba7b91d2SJef Poskanzer(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
556ba7b91d2SJef Poskanzer
557ba7b91d2SJef Poskanzersed_quote_subst='$sed_quote_subst'
558ba7b91d2SJef Poskanzerdouble_quote_subst='$double_quote_subst'
559ba7b91d2SJef Poskanzerdelay_variable_subst='$delay_variable_subst'
560ba7b91d2SJef Poskanzer_LT_CONFIG_STATUS_DECLARATIONS
561ba7b91d2SJef PoskanzerLTCC='$LTCC'
562ba7b91d2SJef PoskanzerLTCFLAGS='$LTCFLAGS'
563ba7b91d2SJef Poskanzercompiler='$compiler_DEFAULT'
564ba7b91d2SJef Poskanzer
5656edfd8d6SBruce A. Mah# A function that is used when there is no print builtin or printf.
5666edfd8d6SBruce A. Mahfunc_fallback_echo ()
5676edfd8d6SBruce A. Mah{
5686edfd8d6SBruce A. Mah  eval 'cat <<_LTECHO_EOF
5696edfd8d6SBruce A. Mah\$[]1
5706edfd8d6SBruce A. Mah_LTECHO_EOF'
5716edfd8d6SBruce A. Mah}
5726edfd8d6SBruce A. Mah
573ba7b91d2SJef Poskanzer# Quote evaled strings.
574ba7b91d2SJef Poskanzerfor var in lt_decl_all_varnames([[ \
575ba7b91d2SJef Poskanzer]], lt_decl_quote_varnames); do
5766edfd8d6SBruce A. Mah    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
577ba7b91d2SJef Poskanzer    *[[\\\\\\\`\\"\\\$]]*)
5784874c4a8SBruce A. Mah      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
579ba7b91d2SJef Poskanzer      ;;
580ba7b91d2SJef Poskanzer    *)
581ba7b91d2SJef Poskanzer      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
582ba7b91d2SJef Poskanzer      ;;
583ba7b91d2SJef Poskanzer    esac
584ba7b91d2SJef Poskanzerdone
585ba7b91d2SJef Poskanzer
586ba7b91d2SJef Poskanzer# Double-quote double-evaled strings.
587ba7b91d2SJef Poskanzerfor var in lt_decl_all_varnames([[ \
588ba7b91d2SJef Poskanzer]], lt_decl_dquote_varnames); do
5896edfd8d6SBruce A. Mah    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
590ba7b91d2SJef Poskanzer    *[[\\\\\\\`\\"\\\$]]*)
5914874c4a8SBruce A. Mah      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
592ba7b91d2SJef Poskanzer      ;;
593ba7b91d2SJef Poskanzer    *)
594ba7b91d2SJef Poskanzer      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
595ba7b91d2SJef Poskanzer      ;;
596ba7b91d2SJef Poskanzer    esac
597ba7b91d2SJef Poskanzerdone
598ba7b91d2SJef Poskanzer
599ba7b91d2SJef Poskanzer_LT_OUTPUT_LIBTOOL_INIT
600ba7b91d2SJef Poskanzer])
601ba7b91d2SJef Poskanzer
6026edfd8d6SBruce A. Mah# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
6036edfd8d6SBruce A. Mah# ------------------------------------
6046edfd8d6SBruce A. Mah# Generate a child script FILE with all initialization necessary to
6056edfd8d6SBruce A. Mah# reuse the environment learned by the parent script, and make the
6066edfd8d6SBruce A. Mah# file executable.  If COMMENT is supplied, it is inserted after the
6074874c4a8SBruce A. Mah# '#!' sequence but before initialization text begins.  After this
6086edfd8d6SBruce A. Mah# macro, additional text can be appended to FILE to form the body of
6096edfd8d6SBruce A. Mah# the child script.  The macro ends with non-zero status if the
6106edfd8d6SBruce A. Mah# file could not be fully written (such as if the disk is full).
6116edfd8d6SBruce A. Mahm4_ifdef([AS_INIT_GENERATED],
6126edfd8d6SBruce A. Mah[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
6136edfd8d6SBruce A. Mah[m4_defun([_LT_GENERATED_FILE_INIT],
6146edfd8d6SBruce A. Mah[m4_require([AS_PREPARE])]dnl
6156edfd8d6SBruce A. Mah[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
6166edfd8d6SBruce A. Mah[lt_write_fail=0
6176edfd8d6SBruce A. Mahcat >$1 <<_ASEOF || lt_write_fail=1
6186edfd8d6SBruce A. Mah#! $SHELL
6196edfd8d6SBruce A. Mah# Generated by $as_me.
6206edfd8d6SBruce A. Mah$2
6216edfd8d6SBruce A. MahSHELL=\${CONFIG_SHELL-$SHELL}
6226edfd8d6SBruce A. Mahexport SHELL
6236edfd8d6SBruce A. Mah_ASEOF
6246edfd8d6SBruce A. Mahcat >>$1 <<\_ASEOF || lt_write_fail=1
6256edfd8d6SBruce A. MahAS_SHELL_SANITIZE
6266edfd8d6SBruce A. Mah_AS_PREPARE
6276edfd8d6SBruce A. Mahexec AS_MESSAGE_FD>&1
6286edfd8d6SBruce A. Mah_ASEOF
6294874c4a8SBruce A. Mahtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
6306edfd8d6SBruce A. Mahm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
631ba7b91d2SJef Poskanzer
632ba7b91d2SJef Poskanzer# LT_OUTPUT
633ba7b91d2SJef Poskanzer# ---------
634ba7b91d2SJef Poskanzer# This macro allows early generation of the libtool script (before
635ba7b91d2SJef Poskanzer# AC_OUTPUT is called), incase it is used in configure for compilation
636ba7b91d2SJef Poskanzer# tests.
637ba7b91d2SJef PoskanzerAC_DEFUN([LT_OUTPUT],
638ba7b91d2SJef Poskanzer[: ${CONFIG_LT=./config.lt}
639ba7b91d2SJef PoskanzerAC_MSG_NOTICE([creating $CONFIG_LT])
6406edfd8d6SBruce A. Mah_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
6416edfd8d6SBruce A. Mah[# Run this file to recreate a libtool stub with the current configuration.])
642ba7b91d2SJef Poskanzer
643ba7b91d2SJef Poskanzercat >>"$CONFIG_LT" <<\_LTEOF
6446edfd8d6SBruce A. Mahlt_cl_silent=false
645ba7b91d2SJef Poskanzerexec AS_MESSAGE_LOG_FD>>config.log
646ba7b91d2SJef Poskanzer{
647ba7b91d2SJef Poskanzer  echo
648ba7b91d2SJef Poskanzer  AS_BOX([Running $as_me.])
649ba7b91d2SJef Poskanzer} >&AS_MESSAGE_LOG_FD
650ba7b91d2SJef Poskanzer
651ba7b91d2SJef Poskanzerlt_cl_help="\
6524874c4a8SBruce A. Mah'$as_me' creates a local libtool stub from the current configuration,
653ba7b91d2SJef Poskanzerfor use in further configure time tests before the real libtool is
654ba7b91d2SJef Poskanzergenerated.
655ba7b91d2SJef Poskanzer
656ba7b91d2SJef PoskanzerUsage: $[0] [[OPTIONS]]
657ba7b91d2SJef Poskanzer
658ba7b91d2SJef Poskanzer  -h, --help      print this help, then exit
659ba7b91d2SJef Poskanzer  -V, --version   print version number, then exit
660ba7b91d2SJef Poskanzer  -q, --quiet     do not print progress messages
661ba7b91d2SJef Poskanzer  -d, --debug     don't remove temporary files
662ba7b91d2SJef Poskanzer
663ba7b91d2SJef PoskanzerReport bugs to <[email protected]>."
664ba7b91d2SJef Poskanzer
665ba7b91d2SJef Poskanzerlt_cl_version="\
666ba7b91d2SJef Poskanzerm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
667ba7b91d2SJef Poskanzerm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
668ba7b91d2SJef Poskanzerconfigured by $[0], generated by m4_PACKAGE_STRING.
669ba7b91d2SJef Poskanzer
6706edfd8d6SBruce A. MahCopyright (C) 2011 Free Software Foundation, Inc.
671ba7b91d2SJef PoskanzerThis config.lt script is free software; the Free Software Foundation
672ba7b91d2SJef Poskanzergives unlimited permision to copy, distribute and modify it."
673ba7b91d2SJef Poskanzer
6744874c4a8SBruce A. Mahwhile test 0 != $[#]
675ba7b91d2SJef Poskanzerdo
676ba7b91d2SJef Poskanzer  case $[1] in
677ba7b91d2SJef Poskanzer    --version | --v* | -V )
678ba7b91d2SJef Poskanzer      echo "$lt_cl_version"; exit 0 ;;
679ba7b91d2SJef Poskanzer    --help | --h* | -h )
680ba7b91d2SJef Poskanzer      echo "$lt_cl_help"; exit 0 ;;
681ba7b91d2SJef Poskanzer    --debug | --d* | -d )
682ba7b91d2SJef Poskanzer      debug=: ;;
683ba7b91d2SJef Poskanzer    --quiet | --q* | --silent | --s* | -q )
684ba7b91d2SJef Poskanzer      lt_cl_silent=: ;;
685ba7b91d2SJef Poskanzer
686ba7b91d2SJef Poskanzer    -*) AC_MSG_ERROR([unrecognized option: $[1]
6874874c4a8SBruce A. MahTry '$[0] --help' for more information.]) ;;
688ba7b91d2SJef Poskanzer
689ba7b91d2SJef Poskanzer    *) AC_MSG_ERROR([unrecognized argument: $[1]
6904874c4a8SBruce A. MahTry '$[0] --help' for more information.]) ;;
691ba7b91d2SJef Poskanzer  esac
692ba7b91d2SJef Poskanzer  shift
693ba7b91d2SJef Poskanzerdone
694ba7b91d2SJef Poskanzer
695ba7b91d2SJef Poskanzerif $lt_cl_silent; then
696ba7b91d2SJef Poskanzer  exec AS_MESSAGE_FD>/dev/null
697ba7b91d2SJef Poskanzerfi
698ba7b91d2SJef Poskanzer_LTEOF
699ba7b91d2SJef Poskanzer
700ba7b91d2SJef Poskanzercat >>"$CONFIG_LT" <<_LTEOF
701ba7b91d2SJef Poskanzer_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
702ba7b91d2SJef Poskanzer_LTEOF
703ba7b91d2SJef Poskanzer
704ba7b91d2SJef Poskanzercat >>"$CONFIG_LT" <<\_LTEOF
705ba7b91d2SJef PoskanzerAC_MSG_NOTICE([creating $ofile])
706ba7b91d2SJef Poskanzer_LT_OUTPUT_LIBTOOL_COMMANDS
707ba7b91d2SJef PoskanzerAS_EXIT(0)
708ba7b91d2SJef Poskanzer_LTEOF
709ba7b91d2SJef Poskanzerchmod +x "$CONFIG_LT"
710ba7b91d2SJef Poskanzer
711ba7b91d2SJef Poskanzer# configure is writing to config.log, but config.lt does its own redirection,
712ba7b91d2SJef Poskanzer# appending to config.log, which fails on DOS, as config.log is still kept
713ba7b91d2SJef Poskanzer# open by configure.  Here we exec the FD to /dev/null, effectively closing
714ba7b91d2SJef Poskanzer# config.log, so it can be properly (re)opened and appended to by config.lt.
715ba7b91d2SJef Poskanzerlt_cl_success=:
7164874c4a8SBruce A. Mahtest yes = "$silent" &&
717ba7b91d2SJef Poskanzer  lt_config_lt_args="$lt_config_lt_args --quiet"
718ba7b91d2SJef Poskanzerexec AS_MESSAGE_LOG_FD>/dev/null
719ba7b91d2SJef Poskanzer$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
720ba7b91d2SJef Poskanzerexec AS_MESSAGE_LOG_FD>>config.log
721ba7b91d2SJef Poskanzer$lt_cl_success || AS_EXIT(1)
722ba7b91d2SJef Poskanzer])# LT_OUTPUT
723ba7b91d2SJef Poskanzer
724ba7b91d2SJef Poskanzer
725ba7b91d2SJef Poskanzer# _LT_CONFIG(TAG)
726ba7b91d2SJef Poskanzer# ---------------
727ba7b91d2SJef Poskanzer# If TAG is the built-in tag, create an initial libtool script with a
728ba7b91d2SJef Poskanzer# default configuration from the untagged config vars.  Otherwise add code
729ba7b91d2SJef Poskanzer# to config.status for appending the configuration named by TAG from the
730ba7b91d2SJef Poskanzer# matching tagged config vars.
731ba7b91d2SJef Poskanzerm4_defun([_LT_CONFIG],
732ba7b91d2SJef Poskanzer[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
733ba7b91d2SJef Poskanzer_LT_CONFIG_SAVE_COMMANDS([
734ba7b91d2SJef Poskanzer  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
735ba7b91d2SJef Poskanzer  m4_if(_LT_TAG, [C], [
7364874c4a8SBruce A. Mah    # See if we are running on zsh, and set the options that allow our
737ba7b91d2SJef Poskanzer    # commands through without removal of \ escapes.
738ba7b91d2SJef Poskanzer    if test -n "${ZSH_VERSION+set}"; then
739ba7b91d2SJef Poskanzer      setopt NO_GLOB_SUBST
740ba7b91d2SJef Poskanzer    fi
741ba7b91d2SJef Poskanzer
7424874c4a8SBruce A. Mah    cfgfile=${ofile}T
74360bd98a5SBruce A. Mah    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
74460bd98a5SBruce A. Mah    $RM "$cfgfile"
745ba7b91d2SJef Poskanzer
746ba7b91d2SJef Poskanzer    cat <<_LT_EOF >> "$cfgfile"
747ba7b91d2SJef Poskanzer#! $SHELL
7484874c4a8SBruce A. Mah# Generated automatically by $as_me ($PACKAGE) $VERSION
749ba7b91d2SJef Poskanzer# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
750ba7b91d2SJef Poskanzer# NOTE: Changes made to this file will be lost: look at ltmain.sh.
7514874c4a8SBruce A. Mah
7524874c4a8SBruce A. Mah# Provide generalized library-building support services.
7534874c4a8SBruce A. Mah# Written by Gordon Matzigkeit, 1996
7544874c4a8SBruce A. Mah
755ba7b91d2SJef Poskanzer_LT_COPYING
756ba7b91d2SJef Poskanzer_LT_LIBTOOL_TAGS
757ba7b91d2SJef Poskanzer
7585461579dSBruce A. Mah# Configured defaults for sys_lib_dlsearch_path munging.
7595461579dSBruce A. Mah: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
7605461579dSBruce A. Mah
761ba7b91d2SJef Poskanzer# ### BEGIN LIBTOOL CONFIG
762ba7b91d2SJef Poskanzer_LT_LIBTOOL_CONFIG_VARS
763ba7b91d2SJef Poskanzer_LT_LIBTOOL_TAG_VARS
764ba7b91d2SJef Poskanzer# ### END LIBTOOL CONFIG
765ba7b91d2SJef Poskanzer
766ba7b91d2SJef Poskanzer_LT_EOF
767ba7b91d2SJef Poskanzer
7685461579dSBruce A. Mah    cat <<'_LT_EOF' >> "$cfgfile"
7695461579dSBruce A. Mah
7705461579dSBruce A. Mah# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
7715461579dSBruce A. Mah
7725461579dSBruce A. Mah_LT_PREPARE_MUNGE_PATH_LIST
7735461579dSBruce A. Mah_LT_PREPARE_CC_BASENAME
7745461579dSBruce A. Mah
7755461579dSBruce A. Mah# ### END FUNCTIONS SHARED WITH CONFIGURE
7765461579dSBruce A. Mah
7775461579dSBruce A. Mah_LT_EOF
7785461579dSBruce A. Mah
779ba7b91d2SJef Poskanzer  case $host_os in
780ba7b91d2SJef Poskanzer  aix3*)
781ba7b91d2SJef Poskanzer    cat <<\_LT_EOF >> "$cfgfile"
782ba7b91d2SJef Poskanzer# AIX sometimes has problems with the GCC collect2 program.  For some
783ba7b91d2SJef Poskanzer# reason, if we set the COLLECT_NAMES environment variable, the problems
784ba7b91d2SJef Poskanzer# vanish in a puff of smoke.
7854874c4a8SBruce A. Mahif test set != "${COLLECT_NAMES+set}"; then
786ba7b91d2SJef Poskanzer  COLLECT_NAMES=
787ba7b91d2SJef Poskanzer  export COLLECT_NAMES
788ba7b91d2SJef Poskanzerfi
789ba7b91d2SJef Poskanzer_LT_EOF
790ba7b91d2SJef Poskanzer    ;;
791ba7b91d2SJef Poskanzer  esac
792ba7b91d2SJef Poskanzer
793ba7b91d2SJef Poskanzer  _LT_PROG_LTMAIN
794ba7b91d2SJef Poskanzer
795ba7b91d2SJef Poskanzer  # We use sed instead of cat because bash on DJGPP gets confused if
796ba7b91d2SJef Poskanzer  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
797ba7b91d2SJef Poskanzer  # text mode, it properly converts lines to CR/LF.  This bash problem
798ba7b91d2SJef Poskanzer  # is reportedly fixed, but why not run on old versions too?
799*85b25c2eSBruce A. Mah  $SED '$q' "$ltmain" >> "$cfgfile" \
800ba7b91d2SJef Poskanzer     || (rm -f "$cfgfile"; exit 1)
801ba7b91d2SJef Poskanzer
802ba7b91d2SJef Poskanzer   mv -f "$cfgfile" "$ofile" ||
803ba7b91d2SJef Poskanzer    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
804ba7b91d2SJef Poskanzer  chmod +x "$ofile"
805ba7b91d2SJef Poskanzer],
806ba7b91d2SJef Poskanzer[cat <<_LT_EOF >> "$ofile"
807ba7b91d2SJef Poskanzer
808ba7b91d2SJef Poskanzerdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
809ba7b91d2SJef Poskanzerdnl in a comment (ie after a #).
810ba7b91d2SJef Poskanzer# ### BEGIN LIBTOOL TAG CONFIG: $1
811ba7b91d2SJef Poskanzer_LT_LIBTOOL_TAG_VARS(_LT_TAG)
812ba7b91d2SJef Poskanzer# ### END LIBTOOL TAG CONFIG: $1
813ba7b91d2SJef Poskanzer_LT_EOF
814ba7b91d2SJef Poskanzer])dnl /m4_if
815ba7b91d2SJef Poskanzer],
816ba7b91d2SJef Poskanzer[m4_if([$1], [], [
817ba7b91d2SJef Poskanzer    PACKAGE='$PACKAGE'
818ba7b91d2SJef Poskanzer    VERSION='$VERSION'
819ba7b91d2SJef Poskanzer    RM='$RM'
820ba7b91d2SJef Poskanzer    ofile='$ofile'], [])
821ba7b91d2SJef Poskanzer])dnl /_LT_CONFIG_SAVE_COMMANDS
822ba7b91d2SJef Poskanzer])# _LT_CONFIG
823ba7b91d2SJef Poskanzer
824ba7b91d2SJef Poskanzer
825ba7b91d2SJef Poskanzer# LT_SUPPORTED_TAG(TAG)
826ba7b91d2SJef Poskanzer# ---------------------
827ba7b91d2SJef Poskanzer# Trace this macro to discover what tags are supported by the libtool
828ba7b91d2SJef Poskanzer# --tag option, using:
829ba7b91d2SJef Poskanzer#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
830ba7b91d2SJef PoskanzerAC_DEFUN([LT_SUPPORTED_TAG], [])
831ba7b91d2SJef Poskanzer
832ba7b91d2SJef Poskanzer
833ba7b91d2SJef Poskanzer# C support is built-in for now
834ba7b91d2SJef Poskanzerm4_define([_LT_LANG_C_enabled], [])
835ba7b91d2SJef Poskanzerm4_define([_LT_TAGS], [])
836ba7b91d2SJef Poskanzer
837ba7b91d2SJef Poskanzer
838ba7b91d2SJef Poskanzer# LT_LANG(LANG)
839ba7b91d2SJef Poskanzer# -------------
840ba7b91d2SJef Poskanzer# Enable libtool support for the given language if not already enabled.
841ba7b91d2SJef PoskanzerAC_DEFUN([LT_LANG],
842ba7b91d2SJef Poskanzer[AC_BEFORE([$0], [LT_OUTPUT])dnl
843ba7b91d2SJef Poskanzerm4_case([$1],
844ba7b91d2SJef Poskanzer  [C],			[_LT_LANG(C)],
845ba7b91d2SJef Poskanzer  [C++],		[_LT_LANG(CXX)],
8466edfd8d6SBruce A. Mah  [Go],			[_LT_LANG(GO)],
847ba7b91d2SJef Poskanzer  [Java],		[_LT_LANG(GCJ)],
848ba7b91d2SJef Poskanzer  [Fortran 77],		[_LT_LANG(F77)],
849ba7b91d2SJef Poskanzer  [Fortran],		[_LT_LANG(FC)],
850ba7b91d2SJef Poskanzer  [Windows Resource],	[_LT_LANG(RC)],
851ba7b91d2SJef Poskanzer  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
852ba7b91d2SJef Poskanzer    [_LT_LANG($1)],
853ba7b91d2SJef Poskanzer    [m4_fatal([$0: unsupported language: "$1"])])])dnl
854ba7b91d2SJef Poskanzer])# LT_LANG
855ba7b91d2SJef Poskanzer
856ba7b91d2SJef Poskanzer
857ba7b91d2SJef Poskanzer# _LT_LANG(LANGNAME)
858ba7b91d2SJef Poskanzer# ------------------
859ba7b91d2SJef Poskanzerm4_defun([_LT_LANG],
860ba7b91d2SJef Poskanzer[m4_ifdef([_LT_LANG_]$1[_enabled], [],
861ba7b91d2SJef Poskanzer  [LT_SUPPORTED_TAG([$1])dnl
862ba7b91d2SJef Poskanzer  m4_append([_LT_TAGS], [$1 ])dnl
863ba7b91d2SJef Poskanzer  m4_define([_LT_LANG_]$1[_enabled], [])dnl
864ba7b91d2SJef Poskanzer  _LT_LANG_$1_CONFIG($1)])dnl
865ba7b91d2SJef Poskanzer])# _LT_LANG
866ba7b91d2SJef Poskanzer
867ba7b91d2SJef Poskanzer
8686edfd8d6SBruce A. Mahm4_ifndef([AC_PROG_GO], [
8696edfd8d6SBruce A. Mah# NOTE: This macro has been submitted for inclusion into   #
8706edfd8d6SBruce A. Mah#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
8716edfd8d6SBruce A. Mah#  a released version of Autoconf we should remove this    #
8726edfd8d6SBruce A. Mah#  macro and use it instead.                               #
8736edfd8d6SBruce A. Mahm4_defun([AC_PROG_GO],
8746edfd8d6SBruce A. Mah[AC_LANG_PUSH(Go)dnl
8756edfd8d6SBruce A. MahAC_ARG_VAR([GOC],     [Go compiler command])dnl
8766edfd8d6SBruce A. MahAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
8776edfd8d6SBruce A. Mah_AC_ARG_VAR_LDFLAGS()dnl
8786edfd8d6SBruce A. MahAC_CHECK_TOOL(GOC, gccgo)
8796edfd8d6SBruce A. Mahif test -z "$GOC"; then
8806edfd8d6SBruce A. Mah  if test -n "$ac_tool_prefix"; then
8816edfd8d6SBruce A. Mah    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
8826edfd8d6SBruce A. Mah  fi
8836edfd8d6SBruce A. Mahfi
8846edfd8d6SBruce A. Mahif test -z "$GOC"; then
8856edfd8d6SBruce A. Mah  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
8866edfd8d6SBruce A. Mahfi
8876edfd8d6SBruce A. Mah])#m4_defun
8886edfd8d6SBruce A. Mah])#m4_ifndef
8896edfd8d6SBruce A. Mah
8906edfd8d6SBruce A. Mah
891ba7b91d2SJef Poskanzer# _LT_LANG_DEFAULT_CONFIG
892ba7b91d2SJef Poskanzer# -----------------------
893ba7b91d2SJef Poskanzerm4_defun([_LT_LANG_DEFAULT_CONFIG],
894ba7b91d2SJef Poskanzer[AC_PROVIDE_IFELSE([AC_PROG_CXX],
895ba7b91d2SJef Poskanzer  [LT_LANG(CXX)],
896ba7b91d2SJef Poskanzer  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
897ba7b91d2SJef Poskanzer
898ba7b91d2SJef PoskanzerAC_PROVIDE_IFELSE([AC_PROG_F77],
899ba7b91d2SJef Poskanzer  [LT_LANG(F77)],
900ba7b91d2SJef Poskanzer  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
901ba7b91d2SJef Poskanzer
902ba7b91d2SJef PoskanzerAC_PROVIDE_IFELSE([AC_PROG_FC],
903ba7b91d2SJef Poskanzer  [LT_LANG(FC)],
904ba7b91d2SJef Poskanzer  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
905ba7b91d2SJef Poskanzer
906ba7b91d2SJef Poskanzerdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
907ba7b91d2SJef Poskanzerdnl pulling things in needlessly.
908ba7b91d2SJef PoskanzerAC_PROVIDE_IFELSE([AC_PROG_GCJ],
909ba7b91d2SJef Poskanzer  [LT_LANG(GCJ)],
910ba7b91d2SJef Poskanzer  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
911ba7b91d2SJef Poskanzer    [LT_LANG(GCJ)],
912ba7b91d2SJef Poskanzer    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
913ba7b91d2SJef Poskanzer      [LT_LANG(GCJ)],
914ba7b91d2SJef Poskanzer      [m4_ifdef([AC_PROG_GCJ],
915ba7b91d2SJef Poskanzer	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
916ba7b91d2SJef Poskanzer       m4_ifdef([A][M_PROG_GCJ],
917ba7b91d2SJef Poskanzer	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
918ba7b91d2SJef Poskanzer       m4_ifdef([LT_PROG_GCJ],
919ba7b91d2SJef Poskanzer	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
920ba7b91d2SJef Poskanzer
9216edfd8d6SBruce A. MahAC_PROVIDE_IFELSE([AC_PROG_GO],
9226edfd8d6SBruce A. Mah  [LT_LANG(GO)],
9236edfd8d6SBruce A. Mah  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
9246edfd8d6SBruce A. Mah
925ba7b91d2SJef PoskanzerAC_PROVIDE_IFELSE([LT_PROG_RC],
926ba7b91d2SJef Poskanzer  [LT_LANG(RC)],
927ba7b91d2SJef Poskanzer  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
928ba7b91d2SJef Poskanzer])# _LT_LANG_DEFAULT_CONFIG
929ba7b91d2SJef Poskanzer
930ba7b91d2SJef Poskanzer# Obsolete macros:
931ba7b91d2SJef PoskanzerAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
932ba7b91d2SJef PoskanzerAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
933ba7b91d2SJef PoskanzerAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
934ba7b91d2SJef PoskanzerAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
9356edfd8d6SBruce A. MahAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
936ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
937ba7b91d2SJef Poskanzerdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
938ba7b91d2SJef Poskanzerdnl AC_DEFUN([AC_LIBTOOL_F77], [])
939ba7b91d2SJef Poskanzerdnl AC_DEFUN([AC_LIBTOOL_FC], [])
940ba7b91d2SJef Poskanzerdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
9416edfd8d6SBruce A. Mahdnl AC_DEFUN([AC_LIBTOOL_RC], [])
942ba7b91d2SJef Poskanzer
943ba7b91d2SJef Poskanzer
944ba7b91d2SJef Poskanzer# _LT_TAG_COMPILER
945ba7b91d2SJef Poskanzer# ----------------
946ba7b91d2SJef Poskanzerm4_defun([_LT_TAG_COMPILER],
947e34c20c8SJon Dugan[AC_REQUIRE([AC_PROG_CC])dnl
948e34c20c8SJon Dugan
949ba7b91d2SJef Poskanzer_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
950ba7b91d2SJef Poskanzer_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
951ba7b91d2SJef Poskanzer_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
952ba7b91d2SJef Poskanzer_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
953ba7b91d2SJef Poskanzer
954e34c20c8SJon Dugan# If no C compiler was specified, use CC.
955e34c20c8SJon DuganLTCC=${LTCC-"$CC"}
956e34c20c8SJon Dugan
957e34c20c8SJon Dugan# If no C compiler flags were specified, use CFLAGS.
958e34c20c8SJon DuganLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
959e34c20c8SJon Dugan
960e34c20c8SJon Dugan# Allow CC to be a program name with arguments.
961e34c20c8SJon Dugancompiler=$CC
962ba7b91d2SJef Poskanzer])# _LT_TAG_COMPILER
963e34c20c8SJon Dugan
964e34c20c8SJon Dugan
965e34c20c8SJon Dugan# _LT_COMPILER_BOILERPLATE
966e34c20c8SJon Dugan# ------------------------
967e34c20c8SJon Dugan# Check for compiler boilerplate output or warnings with
968e34c20c8SJon Dugan# the simple compiler test code.
969ba7b91d2SJef Poskanzerm4_defun([_LT_COMPILER_BOILERPLATE],
970ba7b91d2SJef Poskanzer[m4_require([_LT_DECL_SED])dnl
971ba7b91d2SJef Poskanzerac_outfile=conftest.$ac_objext
972ba7b91d2SJef Poskanzerecho "$lt_simple_compile_test_code" >conftest.$ac_ext
973e34c20c8SJon Duganeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
974e34c20c8SJon Dugan_lt_compiler_boilerplate=`cat conftest.err`
97560bd98a5SBruce A. Mah$RM conftest*
976e34c20c8SJon Dugan])# _LT_COMPILER_BOILERPLATE
977e34c20c8SJon Dugan
978e34c20c8SJon Dugan
979e34c20c8SJon Dugan# _LT_LINKER_BOILERPLATE
980e34c20c8SJon Dugan# ----------------------
981e34c20c8SJon Dugan# Check for linker boilerplate output or warnings with
982e34c20c8SJon Dugan# the simple link test code.
983ba7b91d2SJef Poskanzerm4_defun([_LT_LINKER_BOILERPLATE],
984ba7b91d2SJef Poskanzer[m4_require([_LT_DECL_SED])dnl
985ba7b91d2SJef Poskanzerac_outfile=conftest.$ac_objext
986ba7b91d2SJef Poskanzerecho "$lt_simple_link_test_code" >conftest.$ac_ext
987e34c20c8SJon Duganeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
988e34c20c8SJon Dugan_lt_linker_boilerplate=`cat conftest.err`
989ba7b91d2SJef Poskanzer$RM -r conftest*
990e34c20c8SJon Dugan])# _LT_LINKER_BOILERPLATE
991e34c20c8SJon Dugan
992ba7b91d2SJef Poskanzer# _LT_REQUIRED_DARWIN_CHECKS
993ba7b91d2SJef Poskanzer# -------------------------
994ba7b91d2SJef Poskanzerm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
995ba7b91d2SJef Poskanzer  case $host_os in
996ba7b91d2SJef Poskanzer    rhapsody* | darwin*)
997ba7b91d2SJef Poskanzer    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
998ba7b91d2SJef Poskanzer    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
999ba7b91d2SJef Poskanzer    AC_CHECK_TOOL([LIPO], [lipo], [:])
1000ba7b91d2SJef Poskanzer    AC_CHECK_TOOL([OTOOL], [otool], [:])
1001ba7b91d2SJef Poskanzer    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
1002ba7b91d2SJef Poskanzer    _LT_DECL([], [DSYMUTIL], [1],
1003ba7b91d2SJef Poskanzer      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
1004ba7b91d2SJef Poskanzer    _LT_DECL([], [NMEDIT], [1],
1005ba7b91d2SJef Poskanzer      [Tool to change global to local symbols on Mac OS X])
1006ba7b91d2SJef Poskanzer    _LT_DECL([], [LIPO], [1],
1007ba7b91d2SJef Poskanzer      [Tool to manipulate fat objects and archives on Mac OS X])
1008ba7b91d2SJef Poskanzer    _LT_DECL([], [OTOOL], [1],
1009ba7b91d2SJef Poskanzer      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
1010ba7b91d2SJef Poskanzer    _LT_DECL([], [OTOOL64], [1],
1011ba7b91d2SJef Poskanzer      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
1012e34c20c8SJon Dugan
1013ba7b91d2SJef Poskanzer    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
1014ba7b91d2SJef Poskanzer      [lt_cv_apple_cc_single_mod=no
10154874c4a8SBruce A. Mah      if test -z "$LT_MULTI_MODULE"; then
1016ba7b91d2SJef Poskanzer	# By default we will add the -single_module flag. You can override
1017ba7b91d2SJef Poskanzer	# by either setting the environment variable LT_MULTI_MODULE
1018ba7b91d2SJef Poskanzer	# non-empty at configure time, or by adding -multi_module to the
1019ba7b91d2SJef Poskanzer	# link flags.
1020ba7b91d2SJef Poskanzer	rm -rf libconftest.dylib*
1021ba7b91d2SJef Poskanzer	echo "int foo(void){return 1;}" > conftest.c
1022ba7b91d2SJef Poskanzer	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1023ba7b91d2SJef Poskanzer-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1024ba7b91d2SJef Poskanzer	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1025ba7b91d2SJef Poskanzer	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1026ba7b91d2SJef Poskanzer        _lt_result=$?
10276edfd8d6SBruce A. Mah	# If there is a non-empty error log, and "single_module"
10286edfd8d6SBruce A. Mah	# appears in it, assume the flag caused a linker warning
10296edfd8d6SBruce A. Mah        if test -s conftest.err && $GREP single_module conftest.err; then
10306edfd8d6SBruce A. Mah	  cat conftest.err >&AS_MESSAGE_LOG_FD
10316edfd8d6SBruce A. Mah	# Otherwise, if the output was created with a 0 exit code from
10326edfd8d6SBruce A. Mah	# the compiler, it worked.
10334874c4a8SBruce A. Mah	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
1034ba7b91d2SJef Poskanzer	  lt_cv_apple_cc_single_mod=yes
1035ba7b91d2SJef Poskanzer	else
1036ba7b91d2SJef Poskanzer	  cat conftest.err >&AS_MESSAGE_LOG_FD
1037ba7b91d2SJef Poskanzer	fi
1038ba7b91d2SJef Poskanzer	rm -rf libconftest.dylib*
1039ba7b91d2SJef Poskanzer	rm -f conftest.*
1040ba7b91d2SJef Poskanzer      fi])
10416edfd8d6SBruce A. Mah
1042ba7b91d2SJef Poskanzer    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1043ba7b91d2SJef Poskanzer      [lt_cv_ld_exported_symbols_list],
1044ba7b91d2SJef Poskanzer      [lt_cv_ld_exported_symbols_list=no
1045ba7b91d2SJef Poskanzer      save_LDFLAGS=$LDFLAGS
1046ba7b91d2SJef Poskanzer      echo "_main" > conftest.sym
1047ba7b91d2SJef Poskanzer      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1048ba7b91d2SJef Poskanzer      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1049ba7b91d2SJef Poskanzer	[lt_cv_ld_exported_symbols_list=yes],
1050ba7b91d2SJef Poskanzer	[lt_cv_ld_exported_symbols_list=no])
10514874c4a8SBruce A. Mah	LDFLAGS=$save_LDFLAGS
1052ba7b91d2SJef Poskanzer    ])
10536edfd8d6SBruce A. Mah
10546edfd8d6SBruce A. Mah    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
10556edfd8d6SBruce A. Mah      [lt_cv_ld_force_load=no
10566edfd8d6SBruce A. Mah      cat > conftest.c << _LT_EOF
10576edfd8d6SBruce A. Mahint forced_loaded() { return 2;}
10586edfd8d6SBruce A. Mah_LT_EOF
10596edfd8d6SBruce A. Mah      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
10606edfd8d6SBruce A. Mah      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1061*85b25c2eSBruce A. Mah      echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1062*85b25c2eSBruce A. Mah      $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
10636edfd8d6SBruce A. Mah      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
10646edfd8d6SBruce A. Mah      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
10656edfd8d6SBruce A. Mah      cat > conftest.c << _LT_EOF
10666edfd8d6SBruce A. Mahint main() { return 0;}
10676edfd8d6SBruce A. Mah_LT_EOF
10686edfd8d6SBruce A. Mah      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
10696edfd8d6SBruce A. Mah      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
10706edfd8d6SBruce A. Mah      _lt_result=$?
10716edfd8d6SBruce A. Mah      if test -s conftest.err && $GREP force_load conftest.err; then
10726edfd8d6SBruce A. Mah	cat conftest.err >&AS_MESSAGE_LOG_FD
10734874c4a8SBruce A. Mah      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
10746edfd8d6SBruce A. Mah	lt_cv_ld_force_load=yes
10756edfd8d6SBruce A. Mah      else
10766edfd8d6SBruce A. Mah	cat conftest.err >&AS_MESSAGE_LOG_FD
10776edfd8d6SBruce A. Mah      fi
10786edfd8d6SBruce A. Mah        rm -f conftest.err libconftest.a conftest conftest.c
10796edfd8d6SBruce A. Mah        rm -rf conftest.dSYM
10806edfd8d6SBruce A. Mah    ])
1081ba7b91d2SJef Poskanzer    case $host_os in
1082ba7b91d2SJef Poskanzer    rhapsody* | darwin1.[[012]])
10834874c4a8SBruce A. Mah      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
1084ba7b91d2SJef Poskanzer    darwin1.*)
10854874c4a8SBruce A. Mah      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1086e479d607SBruce A. Mah    darwin*)
1087*85b25c2eSBruce A. Mah      case $MACOSX_DEPLOYMENT_TARGET,$host in
1088*85b25c2eSBruce A. Mah        10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
10894874c4a8SBruce A. Mah          _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1090e479d607SBruce A. Mah        *)
10914874c4a8SBruce A. Mah          _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1092ba7b91d2SJef Poskanzer      esac
1093ba7b91d2SJef Poskanzer    ;;
1094ba7b91d2SJef Poskanzer  esac
10954874c4a8SBruce A. Mah    if test yes = "$lt_cv_apple_cc_single_mod"; then
1096ba7b91d2SJef Poskanzer      _lt_dar_single_mod='$single_module'
1097ba7b91d2SJef Poskanzer    fi
10984874c4a8SBruce A. Mah    if test yes = "$lt_cv_ld_exported_symbols_list"; then
10994874c4a8SBruce A. Mah      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
1100ba7b91d2SJef Poskanzer    else
11014874c4a8SBruce A. Mah      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
1102ba7b91d2SJef Poskanzer    fi
11034874c4a8SBruce A. Mah    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
1104ba7b91d2SJef Poskanzer      _lt_dsymutil='~$DSYMUTIL $lib || :'
1105ba7b91d2SJef Poskanzer    else
1106ba7b91d2SJef Poskanzer      _lt_dsymutil=
1107ba7b91d2SJef Poskanzer    fi
1108ba7b91d2SJef Poskanzer    ;;
1109ba7b91d2SJef Poskanzer  esac
1110ba7b91d2SJef Poskanzer])
1111ba7b91d2SJef Poskanzer
1112ba7b91d2SJef Poskanzer
11136edfd8d6SBruce A. Mah# _LT_DARWIN_LINKER_FEATURES([TAG])
11146edfd8d6SBruce A. Mah# ---------------------------------
1115ba7b91d2SJef Poskanzer# Checks for linker and compiler features on darwin
1116ba7b91d2SJef Poskanzerm4_defun([_LT_DARWIN_LINKER_FEATURES],
1117ba7b91d2SJef Poskanzer[
1118ba7b91d2SJef Poskanzer  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1119ba7b91d2SJef Poskanzer  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1120ba7b91d2SJef Poskanzer  _LT_TAGVAR(hardcode_direct, $1)=no
1121ba7b91d2SJef Poskanzer  _LT_TAGVAR(hardcode_automatic, $1)=yes
1122ba7b91d2SJef Poskanzer  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
11234874c4a8SBruce A. Mah  if test yes = "$lt_cv_ld_force_load"; then
11244874c4a8SBruce A. Mah    _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\"`'
11256edfd8d6SBruce A. Mah    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
11266edfd8d6SBruce A. Mah                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
11276edfd8d6SBruce A. Mah  else
1128ba7b91d2SJef Poskanzer    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
11296edfd8d6SBruce A. Mah  fi
1130ba7b91d2SJef Poskanzer  _LT_TAGVAR(link_all_deplibs, $1)=yes
11314874c4a8SBruce A. Mah  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
113260bd98a5SBruce A. Mah  case $cc_basename in
11334874c4a8SBruce A. Mah     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
113460bd98a5SBruce A. Mah     *) _lt_dar_can_shared=$GCC ;;
113560bd98a5SBruce A. Mah  esac
11364874c4a8SBruce A. Mah  if test yes = "$_lt_dar_can_shared"; then
11376edfd8d6SBruce A. Mah    output_verbose_link_cmd=func_echo_all
11384874c4a8SBruce A. Mah    _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"
11394874c4a8SBruce A. Mah    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
1140*85b25c2eSBruce A. Mah    _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"
1141*85b25c2eSBruce A. Mah    _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"
1142ba7b91d2SJef Poskanzer    m4_if([$1], [CXX],
11434874c4a8SBruce A. Mah[   if test yes != "$lt_cv_apple_cc_single_mod"; then
11444874c4a8SBruce A. Mah      _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"
1145*85b25c2eSBruce A. Mah      _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"
1146ba7b91d2SJef Poskanzer    fi
1147ba7b91d2SJef Poskanzer],[])
1148ba7b91d2SJef Poskanzer  else
1149ba7b91d2SJef Poskanzer  _LT_TAGVAR(ld_shlibs, $1)=no
1150ba7b91d2SJef Poskanzer  fi
1151ba7b91d2SJef Poskanzer])
1152ba7b91d2SJef Poskanzer
11536edfd8d6SBruce A. Mah# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
11546edfd8d6SBruce A. Mah# ----------------------------------
1155e34c20c8SJon Dugan# Links a minimal program and checks the executable
1156e34c20c8SJon Dugan# for the system default hardcoded library path. In most cases,
1157e34c20c8SJon Dugan# this is /usr/lib:/lib, but when the MPI compilers are used
1158e34c20c8SJon Dugan# the location of the communication and MPI libs are included too.
1159e34c20c8SJon Dugan# If we don't find anything, use the default library path according
1160e34c20c8SJon Dugan# to the aix ld manual.
11616edfd8d6SBruce A. Mah# Store the results from the different compilers for each TAGNAME.
11626edfd8d6SBruce A. Mah# Allow to override them for all tags through lt_cv_aix_libpath.
1163ba7b91d2SJef Poskanzerm4_defun([_LT_SYS_MODULE_PATH_AIX],
1164ba7b91d2SJef Poskanzer[m4_require([_LT_DECL_SED])dnl
11654874c4a8SBruce A. Mahif test set = "${lt_cv_aix_libpath+set}"; then
11666edfd8d6SBruce A. Mah  aix_libpath=$lt_cv_aix_libpath
11676edfd8d6SBruce A. Mahelse
11686edfd8d6SBruce A. Mah  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
11696edfd8d6SBruce A. Mah  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
11706edfd8d6SBruce A. Mah  lt_aix_libpath_sed='[
1171ba7b91d2SJef Poskanzer      /Import File Strings/,/^$/ {
1172ba7b91d2SJef Poskanzer	  /^0/ {
11736edfd8d6SBruce A. Mah	      s/^0  *\([^ ]*\) *$/\1/
1174ba7b91d2SJef Poskanzer	      p
1175ba7b91d2SJef Poskanzer	  }
11766edfd8d6SBruce A. Mah      }]'
11776edfd8d6SBruce A. Mah  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1178e34c20c8SJon Dugan  # Check for a 64-bit object if we didn't find anything.
11796edfd8d6SBruce A. Mah  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
11806edfd8d6SBruce A. Mah    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1181ba7b91d2SJef Poskanzer  fi],[])
11826edfd8d6SBruce A. Mah  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
11834874c4a8SBruce A. Mah    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
11846edfd8d6SBruce A. Mah  fi
11856edfd8d6SBruce A. Mah  ])
11866edfd8d6SBruce A. Mah  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
11876edfd8d6SBruce A. Mahfi
1188ba7b91d2SJef Poskanzer])# _LT_SYS_MODULE_PATH_AIX
1189e34c20c8SJon Dugan
1190e34c20c8SJon Dugan
1191ba7b91d2SJef Poskanzer# _LT_SHELL_INIT(ARG)
1192ba7b91d2SJef Poskanzer# -------------------
1193ba7b91d2SJef Poskanzerm4_define([_LT_SHELL_INIT],
11946edfd8d6SBruce A. Mah[m4_divert_text([M4SH-INIT], [$1
11956edfd8d6SBruce A. Mah])])# _LT_SHELL_INIT
11966edfd8d6SBruce A. Mah
11979286415cSJon Dugan
1198e34c20c8SJon Dugan
1199ba7b91d2SJef Poskanzer# _LT_PROG_ECHO_BACKSLASH
1200ba7b91d2SJef Poskanzer# -----------------------
12016edfd8d6SBruce A. Mah# Find how we can fake an echo command that does not interpret backslash.
12026edfd8d6SBruce A. Mah# In particular, with Autoconf 2.60 or later we add some code to the start
12034874c4a8SBruce A. Mah# of the generated configure script that will find a shell with a builtin
12044874c4a8SBruce A. Mah# printf (that we can use as an echo command).
1205ba7b91d2SJef Poskanzerm4_defun([_LT_PROG_ECHO_BACKSLASH],
12066edfd8d6SBruce A. Mah[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
12076edfd8d6SBruce A. MahECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
12086edfd8d6SBruce A. MahECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1209e34c20c8SJon Dugan
12106edfd8d6SBruce A. MahAC_MSG_CHECKING([how to print strings])
12116edfd8d6SBruce A. Mah# Test print first, because it will be a builtin if present.
12126edfd8d6SBruce A. Mahif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
12136edfd8d6SBruce A. Mah   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
12146edfd8d6SBruce A. Mah  ECHO='print -r --'
12156edfd8d6SBruce A. Mahelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
12166edfd8d6SBruce A. Mah  ECHO='printf %s\n'
12176edfd8d6SBruce A. Mahelse
12186edfd8d6SBruce A. Mah  # Use this function as a fallback that always works.
12196edfd8d6SBruce A. Mah  func_fallback_echo ()
12206edfd8d6SBruce A. Mah  {
12216edfd8d6SBruce A. Mah    eval 'cat <<_LTECHO_EOF
12226edfd8d6SBruce A. Mah$[]1
12236edfd8d6SBruce A. Mah_LTECHO_EOF'
12246edfd8d6SBruce A. Mah  }
12256edfd8d6SBruce A. Mah  ECHO='func_fallback_echo'
12266edfd8d6SBruce A. Mahfi
12276edfd8d6SBruce A. Mah
12286edfd8d6SBruce A. Mah# func_echo_all arg...
12296edfd8d6SBruce A. Mah# Invoke $ECHO with all args, space-separated.
12306edfd8d6SBruce A. Mahfunc_echo_all ()
12316edfd8d6SBruce A. Mah{
12326edfd8d6SBruce A. Mah    $ECHO "$*"
12336edfd8d6SBruce A. Mah}
12346edfd8d6SBruce A. Mah
12354874c4a8SBruce A. Mahcase $ECHO in
12366edfd8d6SBruce A. Mah  printf*) AC_MSG_RESULT([printf]) ;;
12376edfd8d6SBruce A. Mah  print*) AC_MSG_RESULT([print -r]) ;;
12386edfd8d6SBruce A. Mah  *) AC_MSG_RESULT([cat]) ;;
12396edfd8d6SBruce A. Mahesac
12406edfd8d6SBruce A. Mah
12416edfd8d6SBruce A. Mahm4_ifdef([_AS_DETECT_SUGGESTED],
12426edfd8d6SBruce A. Mah[_AS_DETECT_SUGGESTED([
12436edfd8d6SBruce A. Mah  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
12446edfd8d6SBruce A. Mah    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
12456edfd8d6SBruce A. Mah    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
12466edfd8d6SBruce A. Mah    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
12476edfd8d6SBruce A. Mah    PATH=/empty FPATH=/empty; export PATH FPATH
12486edfd8d6SBruce A. Mah    test "X`printf %s $ECHO`" = "X$ECHO" \
12496edfd8d6SBruce A. Mah      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
12506edfd8d6SBruce A. Mah
12516edfd8d6SBruce A. Mah_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
12526edfd8d6SBruce A. Mah_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
12536edfd8d6SBruce A. Mah])# _LT_PROG_ECHO_BACKSLASH
12546edfd8d6SBruce A. Mah
12556edfd8d6SBruce A. Mah
12566edfd8d6SBruce A. Mah# _LT_WITH_SYSROOT
12576edfd8d6SBruce A. Mah# ----------------
12586edfd8d6SBruce A. MahAC_DEFUN([_LT_WITH_SYSROOT],
1259*85b25c2eSBruce A. Mah[m4_require([_LT_DECL_SED])dnl
1260*85b25c2eSBruce A. MahAC_MSG_CHECKING([for sysroot])
12616edfd8d6SBruce A. MahAC_ARG_WITH([sysroot],
12624874c4a8SBruce A. Mah[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
12634874c4a8SBruce A. Mah  [Search for dependent libraries within DIR (or the compiler's sysroot
12644874c4a8SBruce A. Mah   if not specified).])],
12656edfd8d6SBruce A. Mah[], [with_sysroot=no])
12666edfd8d6SBruce A. Mah
12676edfd8d6SBruce A. Mahdnl lt_sysroot will always be passed unquoted.  We quote it here
12686edfd8d6SBruce A. Mahdnl in case the user passed a directory name.
12696edfd8d6SBruce A. Mahlt_sysroot=
12704874c4a8SBruce A. Mahcase $with_sysroot in #(
12716edfd8d6SBruce A. Mah yes)
12724874c4a8SBruce A. Mah   if test yes = "$GCC"; then
12736edfd8d6SBruce A. Mah     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
12746edfd8d6SBruce A. Mah   fi
12756edfd8d6SBruce A. Mah   ;; #(
12766edfd8d6SBruce A. Mah /*)
1277*85b25c2eSBruce A. Mah   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
12786edfd8d6SBruce A. Mah   ;; #(
12796edfd8d6SBruce A. Mah no|'')
12806edfd8d6SBruce A. Mah   ;; #(
12816edfd8d6SBruce A. Mah *)
12824874c4a8SBruce A. Mah   AC_MSG_RESULT([$with_sysroot])
12836edfd8d6SBruce A. Mah   AC_MSG_ERROR([The sysroot must be an absolute path.])
12842ab386bfSjef   ;;
12852ab386bfSjefesac
12862ab386bfSjef
12876edfd8d6SBruce A. Mah AC_MSG_RESULT([${lt_sysroot:-no}])
12886edfd8d6SBruce A. Mah_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
12894874c4a8SBruce A. Mah[dependent libraries, and where our libraries should be installed.])])
129056a97f93Sjef
1291ba7b91d2SJef Poskanzer# _LT_ENABLE_LOCK
1292ba7b91d2SJef Poskanzer# ---------------
1293ba7b91d2SJef Poskanzerm4_defun([_LT_ENABLE_LOCK],
1294e34c20c8SJon Dugan[AC_ARG_ENABLE([libtool-lock],
1295ba7b91d2SJef Poskanzer  [AS_HELP_STRING([--disable-libtool-lock],
1296e34c20c8SJon Dugan    [avoid locking (might break parallel builds)])])
12974874c4a8SBruce A. Mahtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
1298e34c20c8SJon Dugan
1299e34c20c8SJon Dugan# Some flags need to be propagated to the compiler or linker for good
1300e34c20c8SJon Dugan# libtool support.
1301e34c20c8SJon Dugancase $host in
1302e34c20c8SJon Dugania64-*-hpux*)
13034874c4a8SBruce A. Mah  # Find out what ABI is being produced by ac_compile, and set mode
13044874c4a8SBruce A. Mah  # options accordingly.
1305e34c20c8SJon Dugan  echo 'int i;' > conftest.$ac_ext
1306e34c20c8SJon Dugan  if AC_TRY_EVAL(ac_compile); then
1307*85b25c2eSBruce A. Mah    case `$FILECMD conftest.$ac_objext` in
1308e34c20c8SJon Dugan      *ELF-32*)
13094874c4a8SBruce A. Mah	HPUX_IA64_MODE=32
1310e34c20c8SJon Dugan	;;
1311e34c20c8SJon Dugan      *ELF-64*)
13124874c4a8SBruce A. Mah	HPUX_IA64_MODE=64
1313e34c20c8SJon Dugan	;;
1314e34c20c8SJon Dugan    esac
1315e34c20c8SJon Dugan  fi
1316e34c20c8SJon Dugan  rm -rf conftest*
1317e34c20c8SJon Dugan  ;;
1318e34c20c8SJon Dugan*-*-irix6*)
13194874c4a8SBruce A. Mah  # Find out what ABI is being produced by ac_compile, and set linker
13204874c4a8SBruce A. Mah  # options accordingly.
13216edfd8d6SBruce A. Mah  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1322e34c20c8SJon Dugan  if AC_TRY_EVAL(ac_compile); then
13234874c4a8SBruce A. Mah    if test yes = "$lt_cv_prog_gnu_ld"; then
1324*85b25c2eSBruce A. Mah      case `$FILECMD conftest.$ac_objext` in
1325e34c20c8SJon Dugan	*32-bit*)
1326e34c20c8SJon Dugan	  LD="${LD-ld} -melf32bsmip"
1327e34c20c8SJon Dugan	  ;;
1328e34c20c8SJon Dugan	*N32*)
1329e34c20c8SJon Dugan	  LD="${LD-ld} -melf32bmipn32"
1330e34c20c8SJon Dugan	  ;;
1331e34c20c8SJon Dugan	*64-bit*)
1332e34c20c8SJon Dugan	  LD="${LD-ld} -melf64bmip"
1333e34c20c8SJon Dugan	;;
1334e34c20c8SJon Dugan      esac
1335e34c20c8SJon Dugan    else
1336*85b25c2eSBruce A. Mah      case `$FILECMD conftest.$ac_objext` in
1337e34c20c8SJon Dugan	*32-bit*)
1338e34c20c8SJon Dugan	  LD="${LD-ld} -32"
1339e34c20c8SJon Dugan	  ;;
1340e34c20c8SJon Dugan	*N32*)
1341e34c20c8SJon Dugan	  LD="${LD-ld} -n32"
1342e34c20c8SJon Dugan	  ;;
1343e34c20c8SJon Dugan	*64-bit*)
1344e34c20c8SJon Dugan	  LD="${LD-ld} -64"
1345e34c20c8SJon Dugan	  ;;
1346e34c20c8SJon Dugan      esac
1347e34c20c8SJon Dugan    fi
1348e34c20c8SJon Dugan  fi
1349e34c20c8SJon Dugan  rm -rf conftest*
1350e34c20c8SJon Dugan  ;;
1351e34c20c8SJon Dugan
13524874c4a8SBruce A. Mahmips64*-*linux*)
13534874c4a8SBruce A. Mah  # Find out what ABI is being produced by ac_compile, and set linker
13544874c4a8SBruce A. Mah  # options accordingly.
13554874c4a8SBruce A. Mah  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
13564874c4a8SBruce A. Mah  if AC_TRY_EVAL(ac_compile); then
13574874c4a8SBruce A. Mah    emul=elf
1358*85b25c2eSBruce A. Mah    case `$FILECMD conftest.$ac_objext` in
13594874c4a8SBruce A. Mah      *32-bit*)
13604874c4a8SBruce A. Mah	emul="${emul}32"
13614874c4a8SBruce A. Mah	;;
13624874c4a8SBruce A. Mah      *64-bit*)
13634874c4a8SBruce A. Mah	emul="${emul}64"
13644874c4a8SBruce A. Mah	;;
13654874c4a8SBruce A. Mah    esac
1366*85b25c2eSBruce A. Mah    case `$FILECMD conftest.$ac_objext` in
13674874c4a8SBruce A. Mah      *MSB*)
13684874c4a8SBruce A. Mah	emul="${emul}btsmip"
13694874c4a8SBruce A. Mah	;;
13704874c4a8SBruce A. Mah      *LSB*)
13714874c4a8SBruce A. Mah	emul="${emul}ltsmip"
13724874c4a8SBruce A. Mah	;;
13734874c4a8SBruce A. Mah    esac
1374*85b25c2eSBruce A. Mah    case `$FILECMD conftest.$ac_objext` in
13754874c4a8SBruce A. Mah      *N32*)
13764874c4a8SBruce A. Mah	emul="${emul}n32"
13774874c4a8SBruce A. Mah	;;
13784874c4a8SBruce A. Mah    esac
13794874c4a8SBruce A. Mah    LD="${LD-ld} -m $emul"
13804874c4a8SBruce A. Mah  fi
13814874c4a8SBruce A. Mah  rm -rf conftest*
13824874c4a8SBruce A. Mah  ;;
13834874c4a8SBruce A. Mah
13844874c4a8SBruce A. Mahx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
1385ba7b91d2SJef Poskanzers390*-*linux*|s390*-*tpf*|sparc*-*linux*)
13864874c4a8SBruce A. Mah  # Find out what ABI is being produced by ac_compile, and set linker
13874874c4a8SBruce A. Mah  # options accordingly.  Note that the listed cases only cover the
13884874c4a8SBruce A. Mah  # situations where additional linker options are needed (such as when
13894874c4a8SBruce A. Mah  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
13904874c4a8SBruce A. Mah  # vice versa); the common cases where no linker options are needed do
13914874c4a8SBruce A. Mah  # not appear in the list.
1392e34c20c8SJon Dugan  echo 'int i;' > conftest.$ac_ext
1393e34c20c8SJon Dugan  if AC_TRY_EVAL(ac_compile); then
1394*85b25c2eSBruce A. Mah    case `$FILECMD conftest.o` in
1395e34c20c8SJon Dugan      *32-bit*)
1396e34c20c8SJon Dugan	case $host in
1397ba7b91d2SJef Poskanzer	  x86_64-*kfreebsd*-gnu)
1398ba7b91d2SJef Poskanzer	    LD="${LD-ld} -m elf_i386_fbsd"
1399ba7b91d2SJef Poskanzer	    ;;
1400e34c20c8SJon Dugan	  x86_64-*linux*)
1401*85b25c2eSBruce A. Mah	    case `$FILECMD conftest.o` in
14024874c4a8SBruce A. Mah	      *x86-64*)
14034874c4a8SBruce A. Mah		LD="${LD-ld} -m elf32_x86_64"
14044874c4a8SBruce A. Mah		;;
14054874c4a8SBruce A. Mah	      *)
1406e34c20c8SJon Dugan		LD="${LD-ld} -m elf_i386"
1407e34c20c8SJon Dugan		;;
14084874c4a8SBruce A. Mah	    esac
14094874c4a8SBruce A. Mah	    ;;
14104874c4a8SBruce A. Mah	  powerpc64le-*linux*)
14114874c4a8SBruce A. Mah	    LD="${LD-ld} -m elf32lppclinux"
14124874c4a8SBruce A. Mah	    ;;
14134874c4a8SBruce A. Mah	  powerpc64-*linux*)
1414e34c20c8SJon Dugan	    LD="${LD-ld} -m elf32ppclinux"
1415e34c20c8SJon Dugan	    ;;
1416e34c20c8SJon Dugan	  s390x-*linux*)
1417e34c20c8SJon Dugan	    LD="${LD-ld} -m elf_s390"
1418e34c20c8SJon Dugan	    ;;
1419e34c20c8SJon Dugan	  sparc64-*linux*)
1420e34c20c8SJon Dugan	    LD="${LD-ld} -m elf32_sparc"
1421e34c20c8SJon Dugan	    ;;
1422e34c20c8SJon Dugan	esac
1423e34c20c8SJon Dugan	;;
1424e34c20c8SJon Dugan      *64-bit*)
1425e34c20c8SJon Dugan	case $host in
1426ba7b91d2SJef Poskanzer	  x86_64-*kfreebsd*-gnu)
1427ba7b91d2SJef Poskanzer	    LD="${LD-ld} -m elf_x86_64_fbsd"
1428ba7b91d2SJef Poskanzer	    ;;
1429e34c20c8SJon Dugan	  x86_64-*linux*)
1430e34c20c8SJon Dugan	    LD="${LD-ld} -m elf_x86_64"
1431e34c20c8SJon Dugan	    ;;
14324874c4a8SBruce A. Mah	  powerpcle-*linux*)
14334874c4a8SBruce A. Mah	    LD="${LD-ld} -m elf64lppc"
14344874c4a8SBruce A. Mah	    ;;
14354874c4a8SBruce A. Mah	  powerpc-*linux*)
1436e34c20c8SJon Dugan	    LD="${LD-ld} -m elf64ppc"
1437e34c20c8SJon Dugan	    ;;
1438ba7b91d2SJef Poskanzer	  s390*-*linux*|s390*-*tpf*)
1439e34c20c8SJon Dugan	    LD="${LD-ld} -m elf64_s390"
1440e34c20c8SJon Dugan	    ;;
1441e34c20c8SJon Dugan	  sparc*-*linux*)
1442e34c20c8SJon Dugan	    LD="${LD-ld} -m elf64_sparc"
1443e34c20c8SJon Dugan	    ;;
1444e34c20c8SJon Dugan	esac
1445e34c20c8SJon Dugan	;;
1446e34c20c8SJon Dugan    esac
1447e34c20c8SJon Dugan  fi
1448e34c20c8SJon Dugan  rm -rf conftest*
1449e34c20c8SJon Dugan  ;;
1450e34c20c8SJon Dugan
1451e34c20c8SJon Dugan*-*-sco3.2v5*)
1452e34c20c8SJon Dugan  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
14534874c4a8SBruce A. Mah  SAVE_CFLAGS=$CFLAGS
1454e34c20c8SJon Dugan  CFLAGS="$CFLAGS -belf"
1455e34c20c8SJon Dugan  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1456e34c20c8SJon Dugan    [AC_LANG_PUSH(C)
1457ba7b91d2SJef Poskanzer     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1458e34c20c8SJon Dugan     AC_LANG_POP])
14594874c4a8SBruce A. Mah  if test yes != "$lt_cv_cc_needs_belf"; then
1460e34c20c8SJon Dugan    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
14614874c4a8SBruce A. Mah    CFLAGS=$SAVE_CFLAGS
1462e34c20c8SJon Dugan  fi
1463e34c20c8SJon Dugan  ;;
14646edfd8d6SBruce A. Mah*-*solaris*)
14654874c4a8SBruce A. Mah  # Find out what ABI is being produced by ac_compile, and set linker
14664874c4a8SBruce A. Mah  # options accordingly.
1467e34c20c8SJon Dugan  echo 'int i;' > conftest.$ac_ext
1468e34c20c8SJon Dugan  if AC_TRY_EVAL(ac_compile); then
1469*85b25c2eSBruce A. Mah    case `$FILECMD conftest.o` in
1470e34c20c8SJon Dugan    *64-bit*)
1471e34c20c8SJon Dugan      case $lt_cv_prog_gnu_ld in
14726edfd8d6SBruce A. Mah      yes*)
14736edfd8d6SBruce A. Mah        case $host in
14744874c4a8SBruce A. Mah        i?86-*-solaris*|x86_64-*-solaris*)
14756edfd8d6SBruce A. Mah          LD="${LD-ld} -m elf_x86_64"
14766edfd8d6SBruce A. Mah          ;;
14776edfd8d6SBruce A. Mah        sparc*-*-solaris*)
14786edfd8d6SBruce A. Mah          LD="${LD-ld} -m elf64_sparc"
14796edfd8d6SBruce A. Mah          ;;
14806edfd8d6SBruce A. Mah        esac
14816edfd8d6SBruce A. Mah        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
14826edfd8d6SBruce A. Mah        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
14834874c4a8SBruce A. Mah          LD=${LD-ld}_sol2
14846edfd8d6SBruce A. Mah        fi
14856edfd8d6SBruce A. Mah        ;;
1486ba7b91d2SJef Poskanzer      *)
1487ba7b91d2SJef Poskanzer	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1488ba7b91d2SJef Poskanzer	  LD="${LD-ld} -64"
1489ba7b91d2SJef Poskanzer	fi
1490ba7b91d2SJef Poskanzer	;;
1491e34c20c8SJon Dugan      esac
1492e34c20c8SJon Dugan      ;;
1493e34c20c8SJon Dugan    esac
1494e34c20c8SJon Dugan  fi
1495e34c20c8SJon Dugan  rm -rf conftest*
1496e34c20c8SJon Dugan  ;;
1497e34c20c8SJon Duganesac
1498e34c20c8SJon Dugan
14994874c4a8SBruce A. Mahneed_locks=$enable_libtool_lock
1500ba7b91d2SJef Poskanzer])# _LT_ENABLE_LOCK
1501e34c20c8SJon Dugan
1502e34c20c8SJon Dugan
15036edfd8d6SBruce A. Mah# _LT_PROG_AR
15046edfd8d6SBruce A. Mah# -----------
15056edfd8d6SBruce A. Mahm4_defun([_LT_PROG_AR],
15066edfd8d6SBruce A. Mah[AC_CHECK_TOOLS(AR, [ar], false)
15076edfd8d6SBruce A. Mah: ${AR=ar}
15086edfd8d6SBruce A. Mah_LT_DECL([], [AR], [1], [The archiver])
1509*85b25c2eSBruce A. Mah
1510*85b25c2eSBruce A. Mah# Use ARFLAGS variable as AR's operation code to sync the variable naming with
1511*85b25c2eSBruce A. Mah# Automake.  If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
1512*85b25c2eSBruce A. Mah# higher priority because thats what people were doing historically (setting
1513*85b25c2eSBruce A. Mah# ARFLAGS for automake and AR_FLAGS for libtool).  FIXME: Make the AR_FLAGS
1514*85b25c2eSBruce A. Mah# variable obsoleted/removed.
1515*85b25c2eSBruce A. Mah
1516*85b25c2eSBruce A. Mahtest ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
1517*85b25c2eSBruce A. Mahlt_ar_flags=$AR_FLAGS
1518*85b25c2eSBruce A. Mah_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
1519*85b25c2eSBruce A. Mah
1520*85b25c2eSBruce A. Mah# Make AR_FLAGS overridable by 'make ARFLAGS='.  Don't try to run-time override
1521*85b25c2eSBruce A. Mah# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
1522*85b25c2eSBruce A. Mah_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
1523*85b25c2eSBruce A. Mah         [Flags to create an archive])
15246edfd8d6SBruce A. Mah
15256edfd8d6SBruce A. MahAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
15266edfd8d6SBruce A. Mah  [lt_cv_ar_at_file=no
15276edfd8d6SBruce A. Mah   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
15286edfd8d6SBruce A. Mah     [echo conftest.$ac_objext > conftest.lst
15296edfd8d6SBruce A. Mah      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
15306edfd8d6SBruce A. Mah      AC_TRY_EVAL([lt_ar_try])
15314874c4a8SBruce A. Mah      if test 0 -eq "$ac_status"; then
15326edfd8d6SBruce A. Mah	# Ensure the archiver fails upon bogus file names.
15336edfd8d6SBruce A. Mah	rm -f conftest.$ac_objext libconftest.a
15346edfd8d6SBruce A. Mah	AC_TRY_EVAL([lt_ar_try])
15354874c4a8SBruce A. Mah	if test 0 -ne "$ac_status"; then
15366edfd8d6SBruce A. Mah          lt_cv_ar_at_file=@
15376edfd8d6SBruce A. Mah        fi
15386edfd8d6SBruce A. Mah      fi
15396edfd8d6SBruce A. Mah      rm -f conftest.* libconftest.a
15406edfd8d6SBruce A. Mah     ])
15416edfd8d6SBruce A. Mah  ])
15426edfd8d6SBruce A. Mah
15434874c4a8SBruce A. Mahif test no = "$lt_cv_ar_at_file"; then
15446edfd8d6SBruce A. Mah  archiver_list_spec=
15456edfd8d6SBruce A. Mahelse
15466edfd8d6SBruce A. Mah  archiver_list_spec=$lt_cv_ar_at_file
15476edfd8d6SBruce A. Mahfi
15486edfd8d6SBruce A. Mah_LT_DECL([], [archiver_list_spec], [1],
15496edfd8d6SBruce A. Mah  [How to feed a file listing to the archiver])
15506edfd8d6SBruce A. Mah])# _LT_PROG_AR
15516edfd8d6SBruce A. Mah
15526edfd8d6SBruce A. Mah
1553ba7b91d2SJef Poskanzer# _LT_CMD_OLD_ARCHIVE
1554ba7b91d2SJef Poskanzer# -------------------
1555ba7b91d2SJef Poskanzerm4_defun([_LT_CMD_OLD_ARCHIVE],
15566edfd8d6SBruce A. Mah[_LT_PROG_AR
1557ba7b91d2SJef Poskanzer
1558ba7b91d2SJef PoskanzerAC_CHECK_TOOL(STRIP, strip, :)
1559ba7b91d2SJef Poskanzertest -z "$STRIP" && STRIP=:
1560ba7b91d2SJef Poskanzer_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1561ba7b91d2SJef Poskanzer
1562ba7b91d2SJef PoskanzerAC_CHECK_TOOL(RANLIB, ranlib, :)
1563ba7b91d2SJef Poskanzertest -z "$RANLIB" && RANLIB=:
1564ba7b91d2SJef Poskanzer_LT_DECL([], [RANLIB], [1],
1565ba7b91d2SJef Poskanzer    [Commands used to install an old-style archive])
1566ba7b91d2SJef Poskanzer
1567ba7b91d2SJef Poskanzer# Determine commands to create old-style static archives.
1568ba7b91d2SJef Poskanzerold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1569ba7b91d2SJef Poskanzerold_postinstall_cmds='chmod 644 $oldlib'
1570ba7b91d2SJef Poskanzerold_postuninstall_cmds=
1571ba7b91d2SJef Poskanzer
1572ba7b91d2SJef Poskanzerif test -n "$RANLIB"; then
1573ba7b91d2SJef Poskanzer  case $host_os in
15744874c4a8SBruce A. Mah  bitrig* | openbsd*)
15756edfd8d6SBruce A. Mah    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1576ba7b91d2SJef Poskanzer    ;;
1577ba7b91d2SJef Poskanzer  *)
15786edfd8d6SBruce A. Mah    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1579ba7b91d2SJef Poskanzer    ;;
1580ba7b91d2SJef Poskanzer  esac
15816edfd8d6SBruce A. Mah  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1582ba7b91d2SJef Poskanzerfi
15836edfd8d6SBruce A. Mah
15846edfd8d6SBruce A. Mahcase $host_os in
15856edfd8d6SBruce A. Mah  darwin*)
15866edfd8d6SBruce A. Mah    lock_old_archive_extraction=yes ;;
15876edfd8d6SBruce A. Mah  *)
15886edfd8d6SBruce A. Mah    lock_old_archive_extraction=no ;;
15896edfd8d6SBruce A. Mahesac
1590ba7b91d2SJef Poskanzer_LT_DECL([], [old_postinstall_cmds], [2])
1591ba7b91d2SJef Poskanzer_LT_DECL([], [old_postuninstall_cmds], [2])
1592ba7b91d2SJef Poskanzer_LT_TAGDECL([], [old_archive_cmds], [2],
1593ba7b91d2SJef Poskanzer    [Commands used to build an old-style archive])
15946edfd8d6SBruce A. Mah_LT_DECL([], [lock_old_archive_extraction], [0],
15956edfd8d6SBruce A. Mah    [Whether to use a lock for old archive extraction])
1596ba7b91d2SJef Poskanzer])# _LT_CMD_OLD_ARCHIVE
1597ba7b91d2SJef Poskanzer
1598ba7b91d2SJef Poskanzer
1599ba7b91d2SJef Poskanzer# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1600e34c20c8SJon Dugan#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1601e34c20c8SJon Dugan# ----------------------------------------------------------------
1602e34c20c8SJon Dugan# Check whether the given compiler option works
1603ba7b91d2SJef PoskanzerAC_DEFUN([_LT_COMPILER_OPTION],
1604ba7b91d2SJef Poskanzer[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1605ba7b91d2SJef Poskanzerm4_require([_LT_DECL_SED])dnl
1606e34c20c8SJon DuganAC_CACHE_CHECK([$1], [$2],
1607e34c20c8SJon Dugan  [$2=no
1608ba7b91d2SJef Poskanzer   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1609ba7b91d2SJef Poskanzer   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
16104874c4a8SBruce A. Mah   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
1611e34c20c8SJon Dugan   # Insert the option either (1) after the last *FLAGS variable, or
1612e34c20c8SJon Dugan   # (2) before a word containing "conftest.", or (3) at the end.
1613e34c20c8SJon Dugan   # Note that $ac_compile itself does not contain backslashes and begins
1614e34c20c8SJon Dugan   # with a dollar sign (not a hyphen), so the echo should work correctly.
1615e34c20c8SJon Dugan   # The option is referenced via a variable to avoid confusing sed.
1616e34c20c8SJon Dugan   lt_compile=`echo "$ac_compile" | $SED \
1617e34c20c8SJon Dugan   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1618e34c20c8SJon Dugan   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1619e34c20c8SJon Dugan   -e 's:$: $lt_compiler_flag:'`
16206edfd8d6SBruce A. Mah   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1621e34c20c8SJon Dugan   (eval "$lt_compile" 2>conftest.err)
1622e34c20c8SJon Dugan   ac_status=$?
1623e34c20c8SJon Dugan   cat conftest.err >&AS_MESSAGE_LOG_FD
16246edfd8d6SBruce A. Mah   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1625e34c20c8SJon Dugan   if (exit $ac_status) && test -s "$ac_outfile"; then
1626e34c20c8SJon Dugan     # The compiler can only warn and ignore the option if not recognized
1627e34c20c8SJon Dugan     # So say no if there are warnings other than the usual output.
16286edfd8d6SBruce A. Mah     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1629e34c20c8SJon Dugan     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1630e34c20c8SJon Dugan     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1631e34c20c8SJon Dugan       $2=yes
1632e34c20c8SJon Dugan     fi
1633e34c20c8SJon Dugan   fi
163460bd98a5SBruce A. Mah   $RM conftest*
1635e34c20c8SJon Dugan])
1636e34c20c8SJon Dugan
16374874c4a8SBruce A. Mahif test yes = "[$]$2"; then
1638ba7b91d2SJef Poskanzer    m4_if([$5], , :, [$5])
1639e34c20c8SJon Duganelse
1640ba7b91d2SJef Poskanzer    m4_if([$6], , :, [$6])
1641e34c20c8SJon Duganfi
1642ba7b91d2SJef Poskanzer])# _LT_COMPILER_OPTION
1643ba7b91d2SJef Poskanzer
1644ba7b91d2SJef Poskanzer# Old name:
1645ba7b91d2SJef PoskanzerAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1646ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
1647ba7b91d2SJef Poskanzerdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1648e34c20c8SJon Dugan
1649e34c20c8SJon Dugan
1650ba7b91d2SJef Poskanzer# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1651e34c20c8SJon Dugan#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1652ba7b91d2SJef Poskanzer# ----------------------------------------------------
1653ba7b91d2SJef Poskanzer# Check whether the given linker option works
1654ba7b91d2SJef PoskanzerAC_DEFUN([_LT_LINKER_OPTION],
1655ba7b91d2SJef Poskanzer[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1656ba7b91d2SJef Poskanzerm4_require([_LT_DECL_SED])dnl
1657ba7b91d2SJef PoskanzerAC_CACHE_CHECK([$1], [$2],
1658e34c20c8SJon Dugan  [$2=no
16594874c4a8SBruce A. Mah   save_LDFLAGS=$LDFLAGS
1660e34c20c8SJon Dugan   LDFLAGS="$LDFLAGS $3"
1661ba7b91d2SJef Poskanzer   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1662e34c20c8SJon Dugan   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1663e34c20c8SJon Dugan     # The linker can only warn and ignore the option if not recognized
1664e34c20c8SJon Dugan     # So say no if there are warnings
1665e34c20c8SJon Dugan     if test -s conftest.err; then
1666e34c20c8SJon Dugan       # Append any errors to the config.log.
1667e34c20c8SJon Dugan       cat conftest.err 1>&AS_MESSAGE_LOG_FD
16686edfd8d6SBruce A. Mah       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1669e34c20c8SJon Dugan       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1670e34c20c8SJon Dugan       if diff conftest.exp conftest.er2 >/dev/null; then
1671e34c20c8SJon Dugan         $2=yes
1672e34c20c8SJon Dugan       fi
1673e34c20c8SJon Dugan     else
1674e34c20c8SJon Dugan       $2=yes
1675e34c20c8SJon Dugan     fi
1676e34c20c8SJon Dugan   fi
1677ba7b91d2SJef Poskanzer   $RM -r conftest*
16784874c4a8SBruce A. Mah   LDFLAGS=$save_LDFLAGS
1679e34c20c8SJon Dugan])
1680e34c20c8SJon Dugan
16814874c4a8SBruce A. Mahif test yes = "[$]$2"; then
1682ba7b91d2SJef Poskanzer    m4_if([$4], , :, [$4])
1683e34c20c8SJon Duganelse
1684ba7b91d2SJef Poskanzer    m4_if([$5], , :, [$5])
1685e34c20c8SJon Duganfi
1686ba7b91d2SJef Poskanzer])# _LT_LINKER_OPTION
1687ba7b91d2SJef Poskanzer
1688ba7b91d2SJef Poskanzer# Old name:
1689ba7b91d2SJef PoskanzerAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1690ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
1691ba7b91d2SJef Poskanzerdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1692e34c20c8SJon Dugan
1693e34c20c8SJon Dugan
1694ba7b91d2SJef Poskanzer# LT_CMD_MAX_LEN
1695ba7b91d2SJef Poskanzer#---------------
1696ba7b91d2SJef PoskanzerAC_DEFUN([LT_CMD_MAX_LEN],
1697ba7b91d2SJef Poskanzer[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1698ba7b91d2SJef Poskanzer# find the maximum length of command line arguments
1699e34c20c8SJon DuganAC_MSG_CHECKING([the maximum length of command line arguments])
1700e34c20c8SJon DuganAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1701e34c20c8SJon Dugan  i=0
17024874c4a8SBruce A. Mah  teststring=ABCD
1703e34c20c8SJon Dugan
1704e34c20c8SJon Dugan  case $build_os in
1705e34c20c8SJon Dugan  msdosdjgpp*)
1706e34c20c8SJon Dugan    # On DJGPP, this test can blow up pretty badly due to problems in libc
1707e34c20c8SJon Dugan    # (any single argument exceeding 2000 bytes causes a buffer overrun
1708e34c20c8SJon Dugan    # during glob expansion).  Even if it were fixed, the result of this
1709e34c20c8SJon Dugan    # check would be larger than it should be.
1710e34c20c8SJon Dugan    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1711e34c20c8SJon Dugan    ;;
1712e34c20c8SJon Dugan
1713e34c20c8SJon Dugan  gnu*)
1714e34c20c8SJon Dugan    # Under GNU Hurd, this test is not required because there is
1715e34c20c8SJon Dugan    # no limit to the length of command line arguments.
1716e34c20c8SJon Dugan    # Libtool will interpret -1 as no limit whatsoever
1717e34c20c8SJon Dugan    lt_cv_sys_max_cmd_len=-1;
1718e34c20c8SJon Dugan    ;;
1719e34c20c8SJon Dugan
172060bd98a5SBruce A. Mah  cygwin* | mingw* | cegcc*)
1721e34c20c8SJon Dugan    # On Win9x/ME, this test blows up -- it succeeds, but takes
1722e34c20c8SJon Dugan    # about 5 minutes as the teststring grows exponentially.
1723e34c20c8SJon Dugan    # Worse, since 9x/ME are not pre-emptively multitasking,
1724e34c20c8SJon Dugan    # you end up with a "frozen" computer, even though with patience
1725e34c20c8SJon Dugan    # the test eventually succeeds (with a max line length of 256k).
1726e34c20c8SJon Dugan    # Instead, let's just punt: use the minimum linelength reported by
1727e34c20c8SJon Dugan    # all of the supported platforms: 8192 (on NT/2K/XP).
1728e34c20c8SJon Dugan    lt_cv_sys_max_cmd_len=8192;
1729e34c20c8SJon Dugan    ;;
1730e34c20c8SJon Dugan
17316edfd8d6SBruce A. Mah  mint*)
17326edfd8d6SBruce A. Mah    # On MiNT this can take a long time and run out of memory.
17336edfd8d6SBruce A. Mah    lt_cv_sys_max_cmd_len=8192;
17346edfd8d6SBruce A. Mah    ;;
17356edfd8d6SBruce A. Mah
1736e34c20c8SJon Dugan  amigaos*)
1737e34c20c8SJon Dugan    # On AmigaOS with pdksh, this test takes hours, literally.
1738e34c20c8SJon Dugan    # So we just punt and use a minimum line length of 8192.
1739e34c20c8SJon Dugan    lt_cv_sys_max_cmd_len=8192;
1740e34c20c8SJon Dugan    ;;
1741e34c20c8SJon Dugan
1742*85b25c2eSBruce A. Mah  bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
1743e34c20c8SJon Dugan    # This has been around since 386BSD, at least.  Likely further.
1744e34c20c8SJon Dugan    if test -x /sbin/sysctl; then
1745e34c20c8SJon Dugan      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1746e34c20c8SJon Dugan    elif test -x /usr/sbin/sysctl; then
1747e34c20c8SJon Dugan      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1748e34c20c8SJon Dugan    else
1749e34c20c8SJon Dugan      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1750e34c20c8SJon Dugan    fi
1751e34c20c8SJon Dugan    # And add a safety zone
1752e34c20c8SJon Dugan    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1753e34c20c8SJon Dugan    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1754e34c20c8SJon Dugan    ;;
1755e34c20c8SJon Dugan
1756e34c20c8SJon Dugan  interix*)
1757e34c20c8SJon Dugan    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1758e34c20c8SJon Dugan    lt_cv_sys_max_cmd_len=196608
1759e34c20c8SJon Dugan    ;;
1760e34c20c8SJon Dugan
17616edfd8d6SBruce A. Mah  os2*)
17626edfd8d6SBruce A. Mah    # The test takes a long time on OS/2.
17636edfd8d6SBruce A. Mah    lt_cv_sys_max_cmd_len=8192
17646edfd8d6SBruce A. Mah    ;;
17656edfd8d6SBruce A. Mah
1766e34c20c8SJon Dugan  osf*)
1767e34c20c8SJon Dugan    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1768e34c20c8SJon Dugan    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1769e34c20c8SJon Dugan    # nice to cause kernel panics so lets avoid the loop below.
1770e34c20c8SJon Dugan    # First set a reasonable default.
1771e34c20c8SJon Dugan    lt_cv_sys_max_cmd_len=16384
1772e34c20c8SJon Dugan    #
1773e34c20c8SJon Dugan    if test -x /sbin/sysconfig; then
1774e34c20c8SJon Dugan      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1775e34c20c8SJon Dugan        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1776e34c20c8SJon Dugan      esac
1777e34c20c8SJon Dugan    fi
1778e34c20c8SJon Dugan    ;;
1779e34c20c8SJon Dugan  sco3.2v5*)
1780e34c20c8SJon Dugan    lt_cv_sys_max_cmd_len=102400
1781e34c20c8SJon Dugan    ;;
1782e34c20c8SJon Dugan  sysv5* | sco5v6* | sysv4.2uw2*)
1783e34c20c8SJon Dugan    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1784e34c20c8SJon Dugan    if test -n "$kargmax"; then
1785*85b25c2eSBruce A. Mah      lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[	 ]]//'`
1786e34c20c8SJon Dugan    else
1787e34c20c8SJon Dugan      lt_cv_sys_max_cmd_len=32768
1788e34c20c8SJon Dugan    fi
1789e34c20c8SJon Dugan    ;;
1790e34c20c8SJon Dugan  *)
1791ba7b91d2SJef Poskanzer    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
17924874c4a8SBruce A. Mah    if test -n "$lt_cv_sys_max_cmd_len" && \
17934874c4a8SBruce A. Mah       test undefined != "$lt_cv_sys_max_cmd_len"; then
1794ba7b91d2SJef Poskanzer      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1795ba7b91d2SJef Poskanzer      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1796ba7b91d2SJef Poskanzer    else
1797ba7b91d2SJef Poskanzer      # Make teststring a little bigger before we do anything with it.
1798ba7b91d2SJef Poskanzer      # a 1K string should be a reasonable start.
1799ba7b91d2SJef Poskanzer      for i in 1 2 3 4 5 6 7 8; do
1800ba7b91d2SJef Poskanzer        teststring=$teststring$teststring
1801ba7b91d2SJef Poskanzer      done
1802ba7b91d2SJef Poskanzer      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1803e34c20c8SJon Dugan      # If test is not a shell built-in, we'll probably end up computing a
1804e34c20c8SJon Dugan      # maximum length that is only half of the actual maximum length, but
1805e34c20c8SJon Dugan      # we can't tell.
18064874c4a8SBruce A. Mah      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
18076edfd8d6SBruce A. Mah	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
18084874c4a8SBruce A. Mah	      test 17 != "$i" # 1/2 MB should be enough
1809e34c20c8SJon Dugan      do
1810e34c20c8SJon Dugan        i=`expr $i + 1`
1811e34c20c8SJon Dugan        teststring=$teststring$teststring
1812e34c20c8SJon Dugan      done
1813ba7b91d2SJef Poskanzer      # Only check the string length outside the loop.
1814ba7b91d2SJef Poskanzer      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1815e34c20c8SJon Dugan      teststring=
1816ba7b91d2SJef Poskanzer      # Add a significant safety factor because C++ compilers can tack on
1817ba7b91d2SJef Poskanzer      # massive amounts of additional arguments before passing them to the
1818ba7b91d2SJef Poskanzer      # linker.  It appears as though 1/2 is a usable value.
1819e34c20c8SJon Dugan      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1820ba7b91d2SJef Poskanzer    fi
1821e34c20c8SJon Dugan    ;;
1822e34c20c8SJon Dugan  esac
1823e34c20c8SJon Dugan])
18244874c4a8SBruce A. Mahif test -n "$lt_cv_sys_max_cmd_len"; then
1825e34c20c8SJon Dugan  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1826e34c20c8SJon Duganelse
1827e34c20c8SJon Dugan  AC_MSG_RESULT(none)
1828e34c20c8SJon Duganfi
1829ba7b91d2SJef Poskanzermax_cmd_len=$lt_cv_sys_max_cmd_len
1830ba7b91d2SJef Poskanzer_LT_DECL([], [max_cmd_len], [0],
1831ba7b91d2SJef Poskanzer    [What is the maximum length of a command?])
1832ba7b91d2SJef Poskanzer])# LT_CMD_MAX_LEN
1833ba7b91d2SJef Poskanzer
1834ba7b91d2SJef Poskanzer# Old name:
1835ba7b91d2SJef PoskanzerAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1836ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
1837ba7b91d2SJef Poskanzerdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1838e34c20c8SJon Dugan
1839e34c20c8SJon Dugan
1840ba7b91d2SJef Poskanzer# _LT_HEADER_DLFCN
1841ba7b91d2SJef Poskanzer# ----------------
1842ba7b91d2SJef Poskanzerm4_defun([_LT_HEADER_DLFCN],
1843ba7b91d2SJef Poskanzer[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1844ba7b91d2SJef Poskanzer])# _LT_HEADER_DLFCN
1845e34c20c8SJon Dugan
1846e34c20c8SJon Dugan
1847ba7b91d2SJef Poskanzer# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1848e34c20c8SJon Dugan#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1849ba7b91d2SJef Poskanzer# ----------------------------------------------------------------
1850ba7b91d2SJef Poskanzerm4_defun([_LT_TRY_DLOPEN_SELF],
1851ba7b91d2SJef Poskanzer[m4_require([_LT_HEADER_DLFCN])dnl
18524874c4a8SBruce A. Mahif test yes = "$cross_compiling"; then :
1853e34c20c8SJon Dugan  [$4]
1854e34c20c8SJon Duganelse
1855e34c20c8SJon Dugan  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1856e34c20c8SJon Dugan  lt_status=$lt_dlunknown
1857ba7b91d2SJef Poskanzer  cat > conftest.$ac_ext <<_LT_EOF
18586edfd8d6SBruce A. Mah[#line $LINENO "configure"
1859e34c20c8SJon Dugan#include "confdefs.h"
1860e34c20c8SJon Dugan
1861e34c20c8SJon Dugan#if HAVE_DLFCN_H
1862e34c20c8SJon Dugan#include <dlfcn.h>
1863e34c20c8SJon Dugan#endif
1864e34c20c8SJon Dugan
1865e34c20c8SJon Dugan#include <stdio.h>
1866e34c20c8SJon Dugan
1867e34c20c8SJon Dugan#ifdef RTLD_GLOBAL
1868e34c20c8SJon Dugan#  define LT_DLGLOBAL		RTLD_GLOBAL
1869e34c20c8SJon Dugan#else
1870e34c20c8SJon Dugan#  ifdef DL_GLOBAL
1871e34c20c8SJon Dugan#    define LT_DLGLOBAL		DL_GLOBAL
1872e34c20c8SJon Dugan#  else
1873e34c20c8SJon Dugan#    define LT_DLGLOBAL		0
1874e34c20c8SJon Dugan#  endif
1875e34c20c8SJon Dugan#endif
1876e34c20c8SJon Dugan
1877e34c20c8SJon Dugan/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1878e34c20c8SJon Dugan   find out it does not work in some platform. */
1879e34c20c8SJon Dugan#ifndef LT_DLLAZY_OR_NOW
1880e34c20c8SJon Dugan#  ifdef RTLD_LAZY
1881e34c20c8SJon Dugan#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1882e34c20c8SJon Dugan#  else
1883e34c20c8SJon Dugan#    ifdef DL_LAZY
1884e34c20c8SJon Dugan#      define LT_DLLAZY_OR_NOW		DL_LAZY
1885e34c20c8SJon Dugan#    else
1886e34c20c8SJon Dugan#      ifdef RTLD_NOW
1887e34c20c8SJon Dugan#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1888e34c20c8SJon Dugan#      else
1889e34c20c8SJon Dugan#        ifdef DL_NOW
1890e34c20c8SJon Dugan#          define LT_DLLAZY_OR_NOW	DL_NOW
1891e34c20c8SJon Dugan#        else
1892e34c20c8SJon Dugan#          define LT_DLLAZY_OR_NOW	0
1893e34c20c8SJon Dugan#        endif
1894e34c20c8SJon Dugan#      endif
1895e34c20c8SJon Dugan#    endif
1896e34c20c8SJon Dugan#  endif
1897e34c20c8SJon Dugan#endif
1898e34c20c8SJon Dugan
18994874c4a8SBruce A. Mah/* When -fvisibility=hidden is used, assume the code has been annotated
19006edfd8d6SBruce A. Mah   correspondingly for the symbols needed.  */
19014874c4a8SBruce A. Mah#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
19026edfd8d6SBruce A. Mahint fnord () __attribute__((visibility("default")));
19036edfd8d6SBruce A. Mah#endif
19046edfd8d6SBruce A. Mah
19056edfd8d6SBruce A. Mahint fnord () { return 42; }
1906e34c20c8SJon Duganint main ()
1907e34c20c8SJon Dugan{
1908e34c20c8SJon Dugan  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1909e34c20c8SJon Dugan  int status = $lt_dlunknown;
1910e34c20c8SJon Dugan
1911e34c20c8SJon Dugan  if (self)
1912e34c20c8SJon Dugan    {
1913e34c20c8SJon Dugan      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
19146edfd8d6SBruce A. Mah      else
19156edfd8d6SBruce A. Mah        {
19166edfd8d6SBruce A. Mah	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
19176edfd8d6SBruce A. Mah          else puts (dlerror ());
19186edfd8d6SBruce A. Mah	}
1919e34c20c8SJon Dugan      /* dlclose (self); */
1920e34c20c8SJon Dugan    }
1921e34c20c8SJon Dugan  else
1922e34c20c8SJon Dugan    puts (dlerror ());
1923e34c20c8SJon Dugan
192460bd98a5SBruce A. Mah  return status;
1925e34c20c8SJon Dugan}]
1926ba7b91d2SJef Poskanzer_LT_EOF
19274874c4a8SBruce A. Mah  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
1928e34c20c8SJon Dugan    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1929e34c20c8SJon Dugan    lt_status=$?
1930e34c20c8SJon Dugan    case x$lt_status in
1931e34c20c8SJon Dugan      x$lt_dlno_uscore) $1 ;;
1932e34c20c8SJon Dugan      x$lt_dlneed_uscore) $2 ;;
1933e34c20c8SJon Dugan      x$lt_dlunknown|x*) $3 ;;
1934e34c20c8SJon Dugan    esac
1935e34c20c8SJon Dugan  else :
1936e34c20c8SJon Dugan    # compilation failed
1937e34c20c8SJon Dugan    $3
1938e34c20c8SJon Dugan  fi
1939e34c20c8SJon Duganfi
1940e34c20c8SJon Duganrm -fr conftest*
1941ba7b91d2SJef Poskanzer])# _LT_TRY_DLOPEN_SELF
1942e34c20c8SJon Dugan
1943e34c20c8SJon Dugan
1944ba7b91d2SJef Poskanzer# LT_SYS_DLOPEN_SELF
1945ba7b91d2SJef Poskanzer# ------------------
1946ba7b91d2SJef PoskanzerAC_DEFUN([LT_SYS_DLOPEN_SELF],
1947ba7b91d2SJef Poskanzer[m4_require([_LT_HEADER_DLFCN])dnl
19484874c4a8SBruce A. Mahif test yes != "$enable_dlopen"; then
1949e34c20c8SJon Dugan  enable_dlopen=unknown
1950e34c20c8SJon Dugan  enable_dlopen_self=unknown
1951e34c20c8SJon Dugan  enable_dlopen_self_static=unknown
1952e34c20c8SJon Duganelse
1953e34c20c8SJon Dugan  lt_cv_dlopen=no
1954e34c20c8SJon Dugan  lt_cv_dlopen_libs=
1955e34c20c8SJon Dugan
1956e34c20c8SJon Dugan  case $host_os in
1957e34c20c8SJon Dugan  beos*)
19584874c4a8SBruce A. Mah    lt_cv_dlopen=load_add_on
1959e34c20c8SJon Dugan    lt_cv_dlopen_libs=
1960e34c20c8SJon Dugan    lt_cv_dlopen_self=yes
1961e34c20c8SJon Dugan    ;;
1962e34c20c8SJon Dugan
196360bd98a5SBruce A. Mah  mingw* | pw32* | cegcc*)
19644874c4a8SBruce A. Mah    lt_cv_dlopen=LoadLibrary
1965e34c20c8SJon Dugan    lt_cv_dlopen_libs=
1966e34c20c8SJon Dugan    ;;
1967e34c20c8SJon Dugan
1968e34c20c8SJon Dugan  cygwin*)
19694874c4a8SBruce A. Mah    lt_cv_dlopen=dlopen
1970e34c20c8SJon Dugan    lt_cv_dlopen_libs=
1971e34c20c8SJon Dugan    ;;
1972e34c20c8SJon Dugan
1973e34c20c8SJon Dugan  darwin*)
1974e34c20c8SJon Dugan    # if libdl is installed we need to link against it
1975e34c20c8SJon Dugan    AC_CHECK_LIB([dl], [dlopen],
19764874c4a8SBruce A. Mah		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
19774874c4a8SBruce A. Mah    lt_cv_dlopen=dyld
1978e34c20c8SJon Dugan    lt_cv_dlopen_libs=
1979e34c20c8SJon Dugan    lt_cv_dlopen_self=yes
1980e34c20c8SJon Dugan    ])
1981e34c20c8SJon Dugan    ;;
1982e34c20c8SJon Dugan
19834874c4a8SBruce A. Mah  tpf*)
19844874c4a8SBruce A. Mah    # Don't try to run any link tests for TPF.  We know it's impossible
19854874c4a8SBruce A. Mah    # because TPF is a cross-compiler, and we know how we open DSOs.
19864874c4a8SBruce A. Mah    lt_cv_dlopen=dlopen
19874874c4a8SBruce A. Mah    lt_cv_dlopen_libs=
19884874c4a8SBruce A. Mah    lt_cv_dlopen_self=no
19894874c4a8SBruce A. Mah    ;;
19904874c4a8SBruce A. Mah
1991e34c20c8SJon Dugan  *)
1992e34c20c8SJon Dugan    AC_CHECK_FUNC([shl_load],
19934874c4a8SBruce A. Mah	  [lt_cv_dlopen=shl_load],
1994e34c20c8SJon Dugan      [AC_CHECK_LIB([dld], [shl_load],
19954874c4a8SBruce A. Mah	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
1996e34c20c8SJon Dugan	[AC_CHECK_FUNC([dlopen],
19974874c4a8SBruce A. Mah	      [lt_cv_dlopen=dlopen],
1998e34c20c8SJon Dugan	  [AC_CHECK_LIB([dl], [dlopen],
19994874c4a8SBruce A. Mah		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
2000e34c20c8SJon Dugan	    [AC_CHECK_LIB([svld], [dlopen],
20014874c4a8SBruce A. Mah		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
2002e34c20c8SJon Dugan	      [AC_CHECK_LIB([dld], [dld_link],
20034874c4a8SBruce A. Mah		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
2004e34c20c8SJon Dugan	      ])
2005e34c20c8SJon Dugan	    ])
2006e34c20c8SJon Dugan	  ])
2007e34c20c8SJon Dugan	])
2008e34c20c8SJon Dugan      ])
2009e34c20c8SJon Dugan    ;;
2010e34c20c8SJon Dugan  esac
2011e34c20c8SJon Dugan
20124874c4a8SBruce A. Mah  if test no = "$lt_cv_dlopen"; then
2013e34c20c8SJon Dugan    enable_dlopen=no
20144874c4a8SBruce A. Mah  else
20154874c4a8SBruce A. Mah    enable_dlopen=yes
2016e34c20c8SJon Dugan  fi
2017e34c20c8SJon Dugan
2018e34c20c8SJon Dugan  case $lt_cv_dlopen in
2019e34c20c8SJon Dugan  dlopen)
20204874c4a8SBruce A. Mah    save_CPPFLAGS=$CPPFLAGS
20214874c4a8SBruce A. Mah    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2022e34c20c8SJon Dugan
20234874c4a8SBruce A. Mah    save_LDFLAGS=$LDFLAGS
2024e34c20c8SJon Dugan    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2025e34c20c8SJon Dugan
20264874c4a8SBruce A. Mah    save_LIBS=$LIBS
2027e34c20c8SJon Dugan    LIBS="$lt_cv_dlopen_libs $LIBS"
2028e34c20c8SJon Dugan
2029e34c20c8SJon Dugan    AC_CACHE_CHECK([whether a program can dlopen itself],
2030e34c20c8SJon Dugan	  lt_cv_dlopen_self, [dnl
2031ba7b91d2SJef Poskanzer	  _LT_TRY_DLOPEN_SELF(
2032e34c20c8SJon Dugan	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2033e34c20c8SJon Dugan	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2034e34c20c8SJon Dugan    ])
2035e34c20c8SJon Dugan
20364874c4a8SBruce A. Mah    if test yes = "$lt_cv_dlopen_self"; then
2037e34c20c8SJon Dugan      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2038e34c20c8SJon Dugan      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2039e34c20c8SJon Dugan	  lt_cv_dlopen_self_static, [dnl
2040ba7b91d2SJef Poskanzer	  _LT_TRY_DLOPEN_SELF(
2041e34c20c8SJon Dugan	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2042e34c20c8SJon Dugan	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2043e34c20c8SJon Dugan      ])
2044e34c20c8SJon Dugan    fi
2045e34c20c8SJon Dugan
20464874c4a8SBruce A. Mah    CPPFLAGS=$save_CPPFLAGS
20474874c4a8SBruce A. Mah    LDFLAGS=$save_LDFLAGS
20484874c4a8SBruce A. Mah    LIBS=$save_LIBS
2049e34c20c8SJon Dugan    ;;
2050e34c20c8SJon Dugan  esac
2051e34c20c8SJon Dugan
2052e34c20c8SJon Dugan  case $lt_cv_dlopen_self in
2053e34c20c8SJon Dugan  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2054e34c20c8SJon Dugan  *) enable_dlopen_self=unknown ;;
2055e34c20c8SJon Dugan  esac
2056e34c20c8SJon Dugan
2057e34c20c8SJon Dugan  case $lt_cv_dlopen_self_static in
2058e34c20c8SJon Dugan  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2059e34c20c8SJon Dugan  *) enable_dlopen_self_static=unknown ;;
2060e34c20c8SJon Dugan  esac
2061e34c20c8SJon Duganfi
2062ba7b91d2SJef Poskanzer_LT_DECL([dlopen_support], [enable_dlopen], [0],
2063ba7b91d2SJef Poskanzer	 [Whether dlopen is supported])
2064ba7b91d2SJef Poskanzer_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2065ba7b91d2SJef Poskanzer	 [Whether dlopen of programs is supported])
2066ba7b91d2SJef Poskanzer_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2067ba7b91d2SJef Poskanzer	 [Whether dlopen of statically linked programs is supported])
2068ba7b91d2SJef Poskanzer])# LT_SYS_DLOPEN_SELF
2069ba7b91d2SJef Poskanzer
2070ba7b91d2SJef Poskanzer# Old name:
2071ba7b91d2SJef PoskanzerAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2072ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
2073ba7b91d2SJef Poskanzerdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2074e34c20c8SJon Dugan
2075e34c20c8SJon Dugan
2076ba7b91d2SJef Poskanzer# _LT_COMPILER_C_O([TAGNAME])
2077ba7b91d2SJef Poskanzer# ---------------------------
2078ba7b91d2SJef Poskanzer# Check to see if options -c and -o are simultaneously supported by compiler.
2079ba7b91d2SJef Poskanzer# This macro does not hard code the compiler like AC_PROG_CC_C_O.
2080ba7b91d2SJef Poskanzerm4_defun([_LT_COMPILER_C_O],
2081ba7b91d2SJef Poskanzer[m4_require([_LT_DECL_SED])dnl
2082ba7b91d2SJef Poskanzerm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2083ba7b91d2SJef Poskanzerm4_require([_LT_TAG_COMPILER])dnl
2084e34c20c8SJon DuganAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2085ba7b91d2SJef Poskanzer  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2086ba7b91d2SJef Poskanzer  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2087ba7b91d2SJef Poskanzer   $RM -r conftest 2>/dev/null
2088e34c20c8SJon Dugan   mkdir conftest
2089e34c20c8SJon Dugan   cd conftest
2090e34c20c8SJon Dugan   mkdir out
2091ba7b91d2SJef Poskanzer   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2092e34c20c8SJon Dugan
2093e34c20c8SJon Dugan   lt_compiler_flag="-o out/conftest2.$ac_objext"
2094e34c20c8SJon Dugan   # Insert the option either (1) after the last *FLAGS variable, or
2095e34c20c8SJon Dugan   # (2) before a word containing "conftest.", or (3) at the end.
2096e34c20c8SJon Dugan   # Note that $ac_compile itself does not contain backslashes and begins
2097e34c20c8SJon Dugan   # with a dollar sign (not a hyphen), so the echo should work correctly.
2098e34c20c8SJon Dugan   lt_compile=`echo "$ac_compile" | $SED \
2099e34c20c8SJon Dugan   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2100e34c20c8SJon Dugan   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2101e34c20c8SJon Dugan   -e 's:$: $lt_compiler_flag:'`
21026edfd8d6SBruce A. Mah   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2103e34c20c8SJon Dugan   (eval "$lt_compile" 2>out/conftest.err)
2104e34c20c8SJon Dugan   ac_status=$?
2105e34c20c8SJon Dugan   cat out/conftest.err >&AS_MESSAGE_LOG_FD
21066edfd8d6SBruce A. Mah   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2107e34c20c8SJon Dugan   if (exit $ac_status) && test -s out/conftest2.$ac_objext
2108e34c20c8SJon Dugan   then
2109e34c20c8SJon Dugan     # The compiler can only warn and ignore the option if not recognized
2110e34c20c8SJon Dugan     # So say no if there are warnings
21116edfd8d6SBruce A. Mah     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2112e34c20c8SJon Dugan     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2113e34c20c8SJon Dugan     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2114ba7b91d2SJef Poskanzer       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2115e34c20c8SJon Dugan     fi
2116e34c20c8SJon Dugan   fi
2117e34c20c8SJon Dugan   chmod u+w . 2>&AS_MESSAGE_LOG_FD
211860bd98a5SBruce A. Mah   $RM conftest*
2119e34c20c8SJon Dugan   # SGI C++ compiler will create directory out/ii_files/ for
2120e34c20c8SJon Dugan   # template instantiation
2121ba7b91d2SJef Poskanzer   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2122ba7b91d2SJef Poskanzer   $RM out/* && rmdir out
2123e34c20c8SJon Dugan   cd ..
2124ba7b91d2SJef Poskanzer   $RM -r conftest
212560bd98a5SBruce A. Mah   $RM conftest*
2126e34c20c8SJon Dugan])
2127ba7b91d2SJef Poskanzer_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2128ba7b91d2SJef Poskanzer	[Does compiler simultaneously support -c and -o options?])
2129ba7b91d2SJef Poskanzer])# _LT_COMPILER_C_O
2130e34c20c8SJon Dugan
2131e34c20c8SJon Dugan
2132ba7b91d2SJef Poskanzer# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2133ba7b91d2SJef Poskanzer# ----------------------------------
2134e34c20c8SJon Dugan# Check to see if we can do hard links to lock some files if needed
2135ba7b91d2SJef Poskanzerm4_defun([_LT_COMPILER_FILE_LOCKS],
2136ba7b91d2SJef Poskanzer[m4_require([_LT_ENABLE_LOCK])dnl
2137ba7b91d2SJef Poskanzerm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2138ba7b91d2SJef Poskanzer_LT_COMPILER_C_O([$1])
2139e34c20c8SJon Dugan
21404874c4a8SBruce A. Mahhard_links=nottested
21414874c4a8SBruce A. Mahif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
2142e34c20c8SJon Dugan  # do not overwrite the value of need_locks provided by the user
2143e34c20c8SJon Dugan  AC_MSG_CHECKING([if we can lock with hard links])
2144e34c20c8SJon Dugan  hard_links=yes
214560bd98a5SBruce A. Mah  $RM conftest*
2146e34c20c8SJon Dugan  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2147e34c20c8SJon Dugan  touch conftest.a
2148e34c20c8SJon Dugan  ln conftest.a conftest.b 2>&5 || hard_links=no
2149e34c20c8SJon Dugan  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2150e34c20c8SJon Dugan  AC_MSG_RESULT([$hard_links])
21514874c4a8SBruce A. Mah  if test no = "$hard_links"; then
21524874c4a8SBruce A. Mah    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
2153e34c20c8SJon Dugan    need_locks=warn
2154e34c20c8SJon Dugan  fi
2155e34c20c8SJon Duganelse
2156e34c20c8SJon Dugan  need_locks=no
2157e34c20c8SJon Duganfi
2158ba7b91d2SJef Poskanzer_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2159ba7b91d2SJef Poskanzer])# _LT_COMPILER_FILE_LOCKS
2160e34c20c8SJon Dugan
2161e34c20c8SJon Dugan
2162ba7b91d2SJef Poskanzer# _LT_CHECK_OBJDIR
2163ba7b91d2SJef Poskanzer# ----------------
2164ba7b91d2SJef Poskanzerm4_defun([_LT_CHECK_OBJDIR],
2165e34c20c8SJon Dugan[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2166e34c20c8SJon Dugan[rm -f .libs 2>/dev/null
2167e34c20c8SJon Duganmkdir .libs 2>/dev/null
2168e34c20c8SJon Duganif test -d .libs; then
2169e34c20c8SJon Dugan  lt_cv_objdir=.libs
2170e34c20c8SJon Duganelse
2171e34c20c8SJon Dugan  # MS-DOS does not allow filenames that begin with a dot.
2172e34c20c8SJon Dugan  lt_cv_objdir=_libs
2173e34c20c8SJon Duganfi
2174e34c20c8SJon Duganrmdir .libs 2>/dev/null])
2175e34c20c8SJon Duganobjdir=$lt_cv_objdir
2176ba7b91d2SJef Poskanzer_LT_DECL([], [objdir], [0],
2177ba7b91d2SJef Poskanzer         [The name of the directory that contains temporary libtool files])dnl
2178ba7b91d2SJef Poskanzerm4_pattern_allow([LT_OBJDIR])dnl
21794874c4a8SBruce A. MahAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
21804874c4a8SBruce A. Mah  [Define to the sub-directory where libtool stores uninstalled libraries.])
2181ba7b91d2SJef Poskanzer])# _LT_CHECK_OBJDIR
2182e34c20c8SJon Dugan
2183e34c20c8SJon Dugan
2184ba7b91d2SJef Poskanzer# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2185ba7b91d2SJef Poskanzer# --------------------------------------
2186e34c20c8SJon Dugan# Check hardcoding attributes.
2187ba7b91d2SJef Poskanzerm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2188e34c20c8SJon Dugan[AC_MSG_CHECKING([how to hardcode library paths into programs])
2189ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_action, $1)=
2190ba7b91d2SJef Poskanzerif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2191ba7b91d2SJef Poskanzer   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
21924874c4a8SBruce A. Mah   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
2193e34c20c8SJon Dugan
2194ba7b91d2SJef Poskanzer  # We can hardcode non-existent directories.
21954874c4a8SBruce A. Mah  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
2196e34c20c8SJon Dugan     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2197e34c20c8SJon Dugan     # have to relink, otherwise we might link with an installed library
2198e34c20c8SJon Dugan     # when we should be linking with a yet-to-be-installed one
21994874c4a8SBruce A. Mah     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
22004874c4a8SBruce A. Mah     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
2201e34c20c8SJon Dugan    # Linking always hardcodes the temporary library directory.
2202ba7b91d2SJef Poskanzer    _LT_TAGVAR(hardcode_action, $1)=relink
2203e34c20c8SJon Dugan  else
2204e34c20c8SJon Dugan    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2205ba7b91d2SJef Poskanzer    _LT_TAGVAR(hardcode_action, $1)=immediate
2206e34c20c8SJon Dugan  fi
2207e34c20c8SJon Duganelse
2208e34c20c8SJon Dugan  # We cannot hardcode anything, or else we can only hardcode existing
2209e34c20c8SJon Dugan  # directories.
2210ba7b91d2SJef Poskanzer  _LT_TAGVAR(hardcode_action, $1)=unsupported
2211e34c20c8SJon Duganfi
2212ba7b91d2SJef PoskanzerAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2213e34c20c8SJon Dugan
22144874c4a8SBruce A. Mahif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
22154874c4a8SBruce A. Mah   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
2216e34c20c8SJon Dugan  # Fast installation is not supported
2217e34c20c8SJon Dugan  enable_fast_install=no
22184874c4a8SBruce A. Mahelif test yes = "$shlibpath_overrides_runpath" ||
22194874c4a8SBruce A. Mah     test no = "$enable_shared"; then
2220e34c20c8SJon Dugan  # Fast installation is not necessary
2221e34c20c8SJon Dugan  enable_fast_install=needless
2222e34c20c8SJon Duganfi
2223ba7b91d2SJef Poskanzer_LT_TAGDECL([], [hardcode_action], [0],
2224ba7b91d2SJef Poskanzer    [How to hardcode a shared library path into an executable])
2225ba7b91d2SJef Poskanzer])# _LT_LINKER_HARDCODE_LIBPATH
2226e34c20c8SJon Dugan
2227e34c20c8SJon Dugan
2228ba7b91d2SJef Poskanzer# _LT_CMD_STRIPLIB
2229ba7b91d2SJef Poskanzer# ----------------
2230ba7b91d2SJef Poskanzerm4_defun([_LT_CMD_STRIPLIB],
2231ba7b91d2SJef Poskanzer[m4_require([_LT_DECL_EGREP])
2232ba7b91d2SJef Poskanzerstriplib=
2233e34c20c8SJon Duganold_striplib=
2234e34c20c8SJon DuganAC_MSG_CHECKING([whether stripping libraries is possible])
2235*85b25c2eSBruce A. Mahif test -z "$STRIP"; then
2236*85b25c2eSBruce A. Mah  AC_MSG_RESULT([no])
2237*85b25c2eSBruce A. Mahelse
2238*85b25c2eSBruce A. Mah  if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2239*85b25c2eSBruce A. Mah    old_striplib="$STRIP --strip-debug"
2240*85b25c2eSBruce A. Mah    striplib="$STRIP --strip-unneeded"
2241e34c20c8SJon Dugan    AC_MSG_RESULT([yes])
2242e34c20c8SJon Dugan  else
2243e34c20c8SJon Dugan    case $host_os in
2244e34c20c8SJon Dugan    darwin*)
2245*85b25c2eSBruce A. Mah      # FIXME - insert some real tests, host_os isn't really good enough
2246e34c20c8SJon Dugan      striplib="$STRIP -x"
2247ba7b91d2SJef Poskanzer      old_striplib="$STRIP -S"
2248e34c20c8SJon Dugan      AC_MSG_RESULT([yes])
2249*85b25c2eSBruce A. Mah      ;;
2250*85b25c2eSBruce A. Mah    freebsd*)
2251*85b25c2eSBruce A. Mah      if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
2252*85b25c2eSBruce A. Mah        old_striplib="$STRIP --strip-debug"
2253*85b25c2eSBruce A. Mah        striplib="$STRIP --strip-unneeded"
2254*85b25c2eSBruce A. Mah        AC_MSG_RESULT([yes])
2255e34c20c8SJon Dugan      else
2256e34c20c8SJon Dugan        AC_MSG_RESULT([no])
2257e34c20c8SJon Dugan      fi
2258e34c20c8SJon Dugan      ;;
2259e34c20c8SJon Dugan    *)
2260e34c20c8SJon Dugan      AC_MSG_RESULT([no])
2261e34c20c8SJon Dugan      ;;
2262e34c20c8SJon Dugan    esac
2263e34c20c8SJon Dugan  fi
2264*85b25c2eSBruce A. Mahfi
2265ba7b91d2SJef Poskanzer_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2266ba7b91d2SJef Poskanzer_LT_DECL([], [striplib], [1])
2267ba7b91d2SJef Poskanzer])# _LT_CMD_STRIPLIB
2268e34c20c8SJon Dugan
2269e34c20c8SJon Dugan
22705461579dSBruce A. Mah# _LT_PREPARE_MUNGE_PATH_LIST
22715461579dSBruce A. Mah# ---------------------------
22725461579dSBruce A. Mah# Make sure func_munge_path_list() is defined correctly.
22735461579dSBruce A. Mahm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
22745461579dSBruce A. Mah[[# func_munge_path_list VARIABLE PATH
22755461579dSBruce A. Mah# -----------------------------------
22765461579dSBruce A. Mah# VARIABLE is name of variable containing _space_ separated list of
22775461579dSBruce A. Mah# directories to be munged by the contents of PATH, which is string
22785461579dSBruce A. Mah# having a format:
22795461579dSBruce A. Mah# "DIR[:DIR]:"
22805461579dSBruce A. Mah#       string "DIR[ DIR]" will be prepended to VARIABLE
22815461579dSBruce A. Mah# ":DIR[:DIR]"
22825461579dSBruce A. Mah#       string "DIR[ DIR]" will be appended to VARIABLE
22835461579dSBruce A. Mah# "DIRP[:DIRP]::[DIRA:]DIRA"
22845461579dSBruce A. Mah#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
22855461579dSBruce A. Mah#       "DIRA[ DIRA]" will be appended to VARIABLE
22865461579dSBruce A. Mah# "DIR[:DIR]"
22875461579dSBruce A. Mah#       VARIABLE will be replaced by "DIR[ DIR]"
22885461579dSBruce A. Mahfunc_munge_path_list ()
22895461579dSBruce A. Mah{
22905461579dSBruce A. Mah    case x@S|@2 in
22915461579dSBruce A. Mah    x)
22925461579dSBruce A. Mah        ;;
22935461579dSBruce A. Mah    *:)
22945461579dSBruce A. Mah        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
22955461579dSBruce A. Mah        ;;
22965461579dSBruce A. Mah    x:*)
22975461579dSBruce A. Mah        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
22985461579dSBruce A. Mah        ;;
22995461579dSBruce A. Mah    *::*)
23005461579dSBruce A. Mah        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
23015461579dSBruce A. Mah        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
23025461579dSBruce A. Mah        ;;
23035461579dSBruce A. Mah    *)
23045461579dSBruce A. Mah        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
23055461579dSBruce A. Mah        ;;
23065461579dSBruce A. Mah    esac
23075461579dSBruce A. Mah}
23085461579dSBruce A. Mah]])# _LT_PREPARE_PATH_LIST
23095461579dSBruce A. Mah
23105461579dSBruce A. Mah
2311ba7b91d2SJef Poskanzer# _LT_SYS_DYNAMIC_LINKER([TAG])
2312e34c20c8SJon Dugan# -----------------------------
2313e34c20c8SJon Dugan# PORTME Fill in your ld.so characteristics
2314ba7b91d2SJef Poskanzerm4_defun([_LT_SYS_DYNAMIC_LINKER],
2315ba7b91d2SJef Poskanzer[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2316ba7b91d2SJef Poskanzerm4_require([_LT_DECL_EGREP])dnl
2317ba7b91d2SJef Poskanzerm4_require([_LT_FILEUTILS_DEFAULTS])dnl
231860bd98a5SBruce A. Mahm4_require([_LT_DECL_OBJDUMP])dnl
2319ba7b91d2SJef Poskanzerm4_require([_LT_DECL_SED])dnl
23206edfd8d6SBruce A. Mahm4_require([_LT_CHECK_SHELL_FEATURES])dnl
23215461579dSBruce A. Mahm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
2322ba7b91d2SJef PoskanzerAC_MSG_CHECKING([dynamic linker characteristics])
2323ba7b91d2SJef Poskanzerm4_if([$1],
2324ba7b91d2SJef Poskanzer	[], [
23254874c4a8SBruce A. Mahif test yes = "$GCC"; then
2326ba7b91d2SJef Poskanzer  case $host_os in
23274874c4a8SBruce A. Mah    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
23284874c4a8SBruce A. Mah    *) lt_awk_arg='/^libraries:/' ;;
2329ba7b91d2SJef Poskanzer  esac
23306edfd8d6SBruce A. Mah  case $host_os in
23314874c4a8SBruce A. Mah    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
23324874c4a8SBruce A. Mah    *) lt_sed_strip_eq='s|=/|/|g' ;;
23336edfd8d6SBruce A. Mah  esac
23346edfd8d6SBruce A. Mah  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
23356edfd8d6SBruce A. Mah  case $lt_search_path_spec in
23366edfd8d6SBruce A. Mah  *\;*)
2337ba7b91d2SJef Poskanzer    # if the path contains ";" then we assume it to be the separator
2338ba7b91d2SJef Poskanzer    # otherwise default to the standard path separator (i.e. ":") - it is
2339ba7b91d2SJef Poskanzer    # assumed that no part of a normal pathname contains ";" but that should
2340ba7b91d2SJef Poskanzer    # okay in the real world where ";" in dirpaths is itself problematic.
23416edfd8d6SBruce A. Mah    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
23426edfd8d6SBruce A. Mah    ;;
23436edfd8d6SBruce A. Mah  *)
23446edfd8d6SBruce A. Mah    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
23456edfd8d6SBruce A. Mah    ;;
23466edfd8d6SBruce A. Mah  esac
2347ba7b91d2SJef Poskanzer  # Ok, now we have the path, separated by spaces, we can step through it
23484874c4a8SBruce A. Mah  # and add multilib dir if necessary...
2349ba7b91d2SJef Poskanzer  lt_tmp_lt_search_path_spec=
23504874c4a8SBruce A. Mah  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
23514874c4a8SBruce A. Mah  # ...but if some path component already ends with the multilib dir we assume
23524874c4a8SBruce A. Mah  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
23534874c4a8SBruce A. Mah  case "$lt_multi_os_dir; $lt_search_path_spec " in
23544874c4a8SBruce A. Mah  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
23554874c4a8SBruce A. Mah    lt_multi_os_dir=
23564874c4a8SBruce A. Mah    ;;
23574874c4a8SBruce A. Mah  esac
2358ba7b91d2SJef Poskanzer  for lt_sys_path in $lt_search_path_spec; do
23594874c4a8SBruce A. Mah    if test -d "$lt_sys_path$lt_multi_os_dir"; then
23604874c4a8SBruce A. Mah      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
23614874c4a8SBruce A. Mah    elif test -n "$lt_multi_os_dir"; then
2362ba7b91d2SJef Poskanzer      test -d "$lt_sys_path" && \
2363ba7b91d2SJef Poskanzer	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2364ba7b91d2SJef Poskanzer    fi
2365ba7b91d2SJef Poskanzer  done
23666edfd8d6SBruce A. Mah  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2367ba7b91d2SJef PoskanzerBEGIN {RS = " "; FS = "/|\n";} {
2368ba7b91d2SJef Poskanzer  lt_foo = "";
2369ba7b91d2SJef Poskanzer  lt_count = 0;
2370ba7b91d2SJef Poskanzer  for (lt_i = NF; lt_i > 0; lt_i--) {
2371ba7b91d2SJef Poskanzer    if ($lt_i != "" && $lt_i != ".") {
2372ba7b91d2SJef Poskanzer      if ($lt_i == "..") {
2373ba7b91d2SJef Poskanzer        lt_count++;
2374ba7b91d2SJef Poskanzer      } else {
2375ba7b91d2SJef Poskanzer        if (lt_count == 0) {
2376ba7b91d2SJef Poskanzer          lt_foo = "/" $lt_i lt_foo;
2377ba7b91d2SJef Poskanzer        } else {
2378ba7b91d2SJef Poskanzer          lt_count--;
2379ba7b91d2SJef Poskanzer        }
2380ba7b91d2SJef Poskanzer      }
2381ba7b91d2SJef Poskanzer    }
2382ba7b91d2SJef Poskanzer  }
2383ba7b91d2SJef Poskanzer  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2384ba7b91d2SJef Poskanzer  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2385ba7b91d2SJef Poskanzer}'`
23866edfd8d6SBruce A. Mah  # AWK program above erroneously prepends '/' to C:/dos/paths
23876edfd8d6SBruce A. Mah  # for these hosts.
23886edfd8d6SBruce A. Mah  case $host_os in
23896edfd8d6SBruce A. Mah    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
23904874c4a8SBruce A. Mah      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
23916edfd8d6SBruce A. Mah  esac
23926edfd8d6SBruce A. Mah  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2393ba7b91d2SJef Poskanzerelse
2394ba7b91d2SJef Poskanzer  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2395ba7b91d2SJef Poskanzerfi])
2396e34c20c8SJon Duganlibrary_names_spec=
2397e34c20c8SJon Duganlibname_spec='lib$name'
2398e34c20c8SJon Dugansoname_spec=
23994874c4a8SBruce A. Mahshrext_cmds=.so
2400e34c20c8SJon Duganpostinstall_cmds=
2401e34c20c8SJon Duganpostuninstall_cmds=
2402e34c20c8SJon Duganfinish_cmds=
2403e34c20c8SJon Duganfinish_eval=
2404e34c20c8SJon Duganshlibpath_var=
2405e34c20c8SJon Duganshlibpath_overrides_runpath=unknown
2406e34c20c8SJon Duganversion_type=none
2407e34c20c8SJon Dugandynamic_linker="$host_os ld.so"
2408e34c20c8SJon Dugansys_lib_dlsearch_path_spec="/lib /usr/lib"
2409e34c20c8SJon Duganneed_lib_prefix=unknown
2410e34c20c8SJon Duganhardcode_into_libs=no
2411e34c20c8SJon Dugan
2412e34c20c8SJon Dugan# when you set need_version to no, make sure it does not cause -set_version
2413e34c20c8SJon Dugan# flags to be left without arguments
2414e34c20c8SJon Duganneed_version=unknown
2415e34c20c8SJon Dugan
24165461579dSBruce A. MahAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
24175461579dSBruce A. Mah[User-defined run-time library search path.])
24185461579dSBruce A. Mah
2419e34c20c8SJon Dugancase $host_os in
2420e34c20c8SJon Duganaix3*)
24216edfd8d6SBruce A. Mah  version_type=linux # correct to gnu/linux during the next big refactor
24224874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
2423e34c20c8SJon Dugan  shlibpath_var=LIBPATH
2424e34c20c8SJon Dugan
2425e34c20c8SJon Dugan  # AIX 3 has no versioning support, so we append a major version to the name.
24264874c4a8SBruce A. Mah  soname_spec='$libname$release$shared_ext$major'
2427e34c20c8SJon Dugan  ;;
2428e34c20c8SJon Dugan
2429ba7b91d2SJef Poskanzeraix[[4-9]]*)
24306edfd8d6SBruce A. Mah  version_type=linux # correct to gnu/linux during the next big refactor
2431e34c20c8SJon Dugan  need_lib_prefix=no
2432e34c20c8SJon Dugan  need_version=no
2433e34c20c8SJon Dugan  hardcode_into_libs=yes
24344874c4a8SBruce A. Mah  if test ia64 = "$host_cpu"; then
2435e34c20c8SJon Dugan    # AIX 5 supports IA64
24364874c4a8SBruce A. Mah    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
2437e34c20c8SJon Dugan    shlibpath_var=LD_LIBRARY_PATH
2438e34c20c8SJon Dugan  else
2439e34c20c8SJon Dugan    # With GCC up to 2.95.x, collect2 would create an import file
2440e34c20c8SJon Dugan    # for dependence libraries.  The import file would start with
24414874c4a8SBruce A. Mah    # the line '#! .'.  This would cause the generated library to
24424874c4a8SBruce A. Mah    # depend on '.', always an invalid library.  This was fixed in
2443e34c20c8SJon Dugan    # development snapshots of GCC prior to 3.0.
2444e34c20c8SJon Dugan    case $host_os in
2445e34c20c8SJon Dugan      aix4 | aix4.[[01]] | aix4.[[01]].*)
2446e34c20c8SJon Dugan      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2447e34c20c8SJon Dugan	   echo ' yes '
24484874c4a8SBruce A. Mah	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
2449e34c20c8SJon Dugan	:
2450e34c20c8SJon Dugan      else
2451e34c20c8SJon Dugan	can_build_shared=no
2452e34c20c8SJon Dugan      fi
2453e34c20c8SJon Dugan      ;;
2454e34c20c8SJon Dugan    esac
24554874c4a8SBruce A. Mah    # Using Import Files as archive members, it is possible to support
24564874c4a8SBruce A. Mah    # filename-based versioning of shared library archives on AIX. While
24574874c4a8SBruce A. Mah    # this would work for both with and without runtime linking, it will
24584874c4a8SBruce A. Mah    # prevent static linking of such archives. So we do filename-based
24594874c4a8SBruce A. Mah    # shared library versioning with .so extension only, which is used
24604874c4a8SBruce A. Mah    # when both runtime linking and shared linking is enabled.
24614874c4a8SBruce A. Mah    # Unfortunately, runtime linking may impact performance, so we do
24624874c4a8SBruce A. Mah    # not want this to be the default eventually. Also, we use the
24634874c4a8SBruce A. Mah    # versioned .so libs for executables only if there is the -brtl
24644874c4a8SBruce A. Mah    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
24654874c4a8SBruce A. Mah    # To allow for filename-based versioning support, we need to create
24664874c4a8SBruce A. Mah    # libNAME.so.V as an archive file, containing:
24674874c4a8SBruce A. Mah    # *) an Import File, referring to the versioned filename of the
24684874c4a8SBruce A. Mah    #    archive as well as the shared archive member, telling the
24694874c4a8SBruce A. Mah    #    bitwidth (32 or 64) of that shared object, and providing the
24704874c4a8SBruce A. Mah    #    list of exported symbols of that shared object, eventually
24714874c4a8SBruce A. Mah    #    decorated with the 'weak' keyword
24724874c4a8SBruce A. Mah    # *) the shared object with the F_LOADONLY flag set, to really avoid
24734874c4a8SBruce A. Mah    #    it being seen by the linker.
24744874c4a8SBruce A. Mah    # At run time we better use the real file rather than another symlink,
24754874c4a8SBruce A. Mah    # but for link time we create the symlink libNAME.so -> libNAME.so.V
24764874c4a8SBruce A. Mah
24774874c4a8SBruce A. Mah    case $with_aix_soname,$aix_use_runtimelinking in
2478e34c20c8SJon Dugan    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
2479e34c20c8SJon Dugan    # soname into executable. Probably we can add versioning support to
2480e34c20c8SJon Dugan    # collect2, so additional links can be useful in future.
24814874c4a8SBruce A. Mah    aix,yes) # traditional libtool
24824874c4a8SBruce A. Mah      dynamic_linker='AIX unversionable lib.so'
2483e34c20c8SJon Dugan      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2484e34c20c8SJon Dugan      # instead of lib<name>.a to let people know that these are not
2485e34c20c8SJon Dugan      # typical AIX shared libraries.
24864874c4a8SBruce A. Mah      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
24874874c4a8SBruce A. Mah      ;;
24884874c4a8SBruce A. Mah    aix,no) # traditional AIX only
24894874c4a8SBruce A. Mah      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
2490e34c20c8SJon Dugan      # We preserve .a as extension for shared libraries through AIX4.2
2491e34c20c8SJon Dugan      # and later when we are not doing run time linking.
24924874c4a8SBruce A. Mah      library_names_spec='$libname$release.a $libname.a'
24934874c4a8SBruce A. Mah      soname_spec='$libname$release$shared_ext$major'
24944874c4a8SBruce A. Mah      ;;
24954874c4a8SBruce A. Mah    svr4,*) # full svr4 only
24964874c4a8SBruce A. Mah      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
24974874c4a8SBruce A. Mah      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
24984874c4a8SBruce A. Mah      # We do not specify a path in Import Files, so LIBPATH fires.
24994874c4a8SBruce A. Mah      shlibpath_overrides_runpath=yes
25004874c4a8SBruce A. Mah      ;;
25014874c4a8SBruce A. Mah    *,yes) # both, prefer svr4
25024874c4a8SBruce A. Mah      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
25034874c4a8SBruce A. Mah      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
25044874c4a8SBruce A. Mah      # unpreferred sharedlib libNAME.a needs extra handling
25054874c4a8SBruce A. Mah      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
25064874c4a8SBruce A. Mah      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
25074874c4a8SBruce A. Mah      # We do not specify a path in Import Files, so LIBPATH fires.
25084874c4a8SBruce A. Mah      shlibpath_overrides_runpath=yes
25094874c4a8SBruce A. Mah      ;;
25104874c4a8SBruce A. Mah    *,no) # both, prefer aix
25114874c4a8SBruce A. Mah      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
25124874c4a8SBruce A. Mah      library_names_spec='$libname$release.a $libname.a'
25134874c4a8SBruce A. Mah      soname_spec='$libname$release$shared_ext$major'
25144874c4a8SBruce A. Mah      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
25154874c4a8SBruce A. Mah      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
25164874c4a8SBruce A. Mah      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
25174874c4a8SBruce A. Mah      ;;
25184874c4a8SBruce A. Mah    esac
2519e34c20c8SJon Dugan    shlibpath_var=LIBPATH
2520e34c20c8SJon Dugan  fi
2521e34c20c8SJon Dugan  ;;
2522e34c20c8SJon Dugan
2523e34c20c8SJon Duganamigaos*)
2524ba7b91d2SJef Poskanzer  case $host_cpu in
2525ba7b91d2SJef Poskanzer  powerpc)
2526ba7b91d2SJef Poskanzer    # Since July 2007 AmigaOS4 officially supports .so libraries.
2527ba7b91d2SJef Poskanzer    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
25284874c4a8SBruce A. Mah    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2529ba7b91d2SJef Poskanzer    ;;
2530ba7b91d2SJef Poskanzer  m68k)
2531e34c20c8SJon Dugan    library_names_spec='$libname.ixlibrary $libname.a'
2532e34c20c8SJon Dugan    # Create ${libname}_ixlibrary.a entries in /sys/libs.
25334874c4a8SBruce A. Mah    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2534ba7b91d2SJef Poskanzer    ;;
2535ba7b91d2SJef Poskanzer  esac
2536e34c20c8SJon Dugan  ;;
2537e34c20c8SJon Dugan
2538e34c20c8SJon Duganbeos*)
25394874c4a8SBruce A. Mah  library_names_spec='$libname$shared_ext'
2540e34c20c8SJon Dugan  dynamic_linker="$host_os ld.so"
2541e34c20c8SJon Dugan  shlibpath_var=LIBRARY_PATH
2542e34c20c8SJon Dugan  ;;
2543e34c20c8SJon Dugan
2544e34c20c8SJon Duganbsdi[[45]]*)
25456edfd8d6SBruce A. Mah  version_type=linux # correct to gnu/linux during the next big refactor
2546e34c20c8SJon Dugan  need_version=no
25474874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
25484874c4a8SBruce A. Mah  soname_spec='$libname$release$shared_ext$major'
2549e34c20c8SJon Dugan  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2550e34c20c8SJon Dugan  shlibpath_var=LD_LIBRARY_PATH
2551e34c20c8SJon Dugan  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2552e34c20c8SJon Dugan  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2553e34c20c8SJon Dugan  # the default ld.so.conf also contains /usr/contrib/lib and
2554e34c20c8SJon Dugan  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2555e34c20c8SJon Dugan  # libtool to hard-code these into programs
2556e34c20c8SJon Dugan  ;;
2557e34c20c8SJon Dugan
255860bd98a5SBruce A. Mahcygwin* | mingw* | pw32* | cegcc*)
2559e34c20c8SJon Dugan  version_type=windows
25604874c4a8SBruce A. Mah  shrext_cmds=.dll
2561e34c20c8SJon Dugan  need_version=no
2562e34c20c8SJon Dugan  need_lib_prefix=no
2563e34c20c8SJon Dugan
25646edfd8d6SBruce A. Mah  case $GCC,$cc_basename in
25656edfd8d6SBruce A. Mah  yes,*)
25666edfd8d6SBruce A. Mah    # gcc
2567e34c20c8SJon Dugan    library_names_spec='$libname.dll.a'
2568e34c20c8SJon Dugan    # DLL is installed to $(libdir)/../bin by postinstall_cmds
25694874c4a8SBruce A. Mah    postinstall_cmds='base_file=`basename \$file`~
25704874c4a8SBruce A. Mah      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2571e34c20c8SJon Dugan      dldir=$destdir/`dirname \$dlpath`~
2572e34c20c8SJon Dugan      test -d \$dldir || mkdir -p \$dldir~
2573e34c20c8SJon Dugan      $install_prog $dir/$dlname \$dldir/$dlname~
2574ba7b91d2SJef Poskanzer      chmod a+x \$dldir/$dlname~
2575ba7b91d2SJef Poskanzer      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2576ba7b91d2SJef Poskanzer        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2577ba7b91d2SJef Poskanzer      fi'
2578e34c20c8SJon Dugan    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2579e34c20c8SJon Dugan      dlpath=$dir/\$dldll~
2580ba7b91d2SJef Poskanzer       $RM \$dlpath'
2581e34c20c8SJon Dugan    shlibpath_overrides_runpath=yes
2582e34c20c8SJon Dugan
2583e34c20c8SJon Dugan    case $host_os in
2584e34c20c8SJon Dugan    cygwin*)
2585e34c20c8SJon Dugan      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2586*85b25c2eSBruce A. Mah      soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
25876edfd8d6SBruce A. Mahm4_if([$1], [],[
25886edfd8d6SBruce A. Mah      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2589e34c20c8SJon Dugan      ;;
259060bd98a5SBruce A. Mah    mingw* | cegcc*)
2591e34c20c8SJon Dugan      # MinGW DLLs use traditional 'lib' prefix
25924874c4a8SBruce A. Mah      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2593e34c20c8SJon Dugan      ;;
2594e34c20c8SJon Dugan    pw32*)
2595e34c20c8SJon Dugan      # pw32 DLLs use 'pw' prefix rather than 'lib'
2596*85b25c2eSBruce A. Mah      library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2597e34c20c8SJon Dugan      ;;
2598e34c20c8SJon Dugan    esac
25996edfd8d6SBruce A. Mah    dynamic_linker='Win32 ld.exe'
26006edfd8d6SBruce A. Mah    ;;
26016edfd8d6SBruce A. Mah
2602*85b25c2eSBruce A. Mah  *,cl* | *,icl*)
2603*85b25c2eSBruce A. Mah    # Native MSVC or ICC
26046edfd8d6SBruce A. Mah    libname_spec='$name'
26054874c4a8SBruce A. Mah    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
26064874c4a8SBruce A. Mah    library_names_spec='$libname.dll.lib'
26076edfd8d6SBruce A. Mah
26086edfd8d6SBruce A. Mah    case $build_os in
26096edfd8d6SBruce A. Mah    mingw*)
26106edfd8d6SBruce A. Mah      sys_lib_search_path_spec=
26116edfd8d6SBruce A. Mah      lt_save_ifs=$IFS
26126edfd8d6SBruce A. Mah      IFS=';'
26136edfd8d6SBruce A. Mah      for lt_path in $LIB
26146edfd8d6SBruce A. Mah      do
26156edfd8d6SBruce A. Mah        IFS=$lt_save_ifs
26166edfd8d6SBruce A. Mah        # Let DOS variable expansion print the short 8.3 style file name.
26176edfd8d6SBruce A. Mah        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
26186edfd8d6SBruce A. Mah        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
26196edfd8d6SBruce A. Mah      done
26206edfd8d6SBruce A. Mah      IFS=$lt_save_ifs
26216edfd8d6SBruce A. Mah      # Convert to MSYS style.
2622*85b25c2eSBruce A. Mah      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
26236edfd8d6SBruce A. Mah      ;;
26246edfd8d6SBruce A. Mah    cygwin*)
26256edfd8d6SBruce A. Mah      # Convert to unix form, then to dos form, then back to unix form
26266edfd8d6SBruce A. Mah      # but this time dos style (no spaces!) so that the unix form looks
26276edfd8d6SBruce A. Mah      # like /cygdrive/c/PROGRA~1:/cygdr...
26286edfd8d6SBruce A. Mah      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
26296edfd8d6SBruce A. Mah      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
26306edfd8d6SBruce A. Mah      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
26316edfd8d6SBruce A. Mah      ;;
26326edfd8d6SBruce A. Mah    *)
26334874c4a8SBruce A. Mah      sys_lib_search_path_spec=$LIB
26346edfd8d6SBruce A. Mah      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
26356edfd8d6SBruce A. Mah        # It is most probably a Windows format PATH.
26366edfd8d6SBruce A. Mah        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
26376edfd8d6SBruce A. Mah      else
26386edfd8d6SBruce A. Mah        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
26396edfd8d6SBruce A. Mah      fi
26406edfd8d6SBruce A. Mah      # FIXME: find the short name or the path components, as spaces are
26416edfd8d6SBruce A. Mah      # common. (e.g. "Program Files" -> "PROGRA~1")
26426edfd8d6SBruce A. Mah      ;;
26436edfd8d6SBruce A. Mah    esac
26446edfd8d6SBruce A. Mah
26456edfd8d6SBruce A. Mah    # DLL is installed to $(libdir)/../bin by postinstall_cmds
26464874c4a8SBruce A. Mah    postinstall_cmds='base_file=`basename \$file`~
26474874c4a8SBruce A. Mah      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
26486edfd8d6SBruce A. Mah      dldir=$destdir/`dirname \$dlpath`~
26496edfd8d6SBruce A. Mah      test -d \$dldir || mkdir -p \$dldir~
26506edfd8d6SBruce A. Mah      $install_prog $dir/$dlname \$dldir/$dlname'
26516edfd8d6SBruce A. Mah    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
26526edfd8d6SBruce A. Mah      dlpath=$dir/\$dldll~
26536edfd8d6SBruce A. Mah       $RM \$dlpath'
26546edfd8d6SBruce A. Mah    shlibpath_overrides_runpath=yes
26556edfd8d6SBruce A. Mah    dynamic_linker='Win32 link.exe'
2656e34c20c8SJon Dugan    ;;
2657e34c20c8SJon Dugan
2658e34c20c8SJon Dugan  *)
2659*85b25c2eSBruce A. Mah    # Assume MSVC and ICC wrapper
26604874c4a8SBruce A. Mah    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
26616edfd8d6SBruce A. Mah    dynamic_linker='Win32 ld.exe'
2662e34c20c8SJon Dugan    ;;
2663e34c20c8SJon Dugan  esac
2664e34c20c8SJon Dugan  # FIXME: first we should search . and the directory the executable is in
2665e34c20c8SJon Dugan  shlibpath_var=PATH
2666e34c20c8SJon Dugan  ;;
2667e34c20c8SJon Dugan
2668e34c20c8SJon Dugandarwin* | rhapsody*)
2669e34c20c8SJon Dugan  dynamic_linker="$host_os dyld"
2670e34c20c8SJon Dugan  version_type=darwin
2671e34c20c8SJon Dugan  need_lib_prefix=no
2672e34c20c8SJon Dugan  need_version=no
26734874c4a8SBruce A. Mah  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
26744874c4a8SBruce A. Mah  soname_spec='$libname$release$major$shared_ext'
2675e34c20c8SJon Dugan  shlibpath_overrides_runpath=yes
2676e34c20c8SJon Dugan  shlibpath_var=DYLD_LIBRARY_PATH
2677e34c20c8SJon Dugan  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2678ba7b91d2SJef Poskanzerm4_if([$1], [],[
2679ba7b91d2SJef Poskanzer  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2680e34c20c8SJon Dugan  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2681e34c20c8SJon Dugan  ;;
2682e34c20c8SJon Dugan
2683e34c20c8SJon Dugandgux*)
26846edfd8d6SBruce A. Mah  version_type=linux # correct to gnu/linux during the next big refactor
2685e34c20c8SJon Dugan  need_lib_prefix=no
2686e34c20c8SJon Dugan  need_version=no
26874874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
26884874c4a8SBruce A. Mah  soname_spec='$libname$release$shared_ext$major'
2689e34c20c8SJon Dugan  shlibpath_var=LD_LIBRARY_PATH
2690e34c20c8SJon Dugan  ;;
2691e34c20c8SJon Dugan
2692*85b25c2eSBruce A. Mahfreebsd* | dragonfly* | midnightbsd*)
2693e34c20c8SJon Dugan  # DragonFly does not have aout.  When/if they implement a new
2694e34c20c8SJon Dugan  # versioning mechanism, adjust this.
2695e34c20c8SJon Dugan  if test -x /usr/bin/objformat; then
2696e34c20c8SJon Dugan    objformat=`/usr/bin/objformat`
2697e34c20c8SJon Dugan  else
2698e34c20c8SJon Dugan    case $host_os in
26996edfd8d6SBruce A. Mah    freebsd[[23]].*) objformat=aout ;;
2700e34c20c8SJon Dugan    *) objformat=elf ;;
2701e34c20c8SJon Dugan    esac
2702e34c20c8SJon Dugan  fi
2703e34c20c8SJon Dugan  version_type=freebsd-$objformat
2704e34c20c8SJon Dugan  case $version_type in
2705e34c20c8SJon Dugan    freebsd-elf*)
27064874c4a8SBruce A. Mah      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27075461579dSBruce A. Mah      soname_spec='$libname$release$shared_ext$major'
2708e34c20c8SJon Dugan      need_version=no
2709e34c20c8SJon Dugan      need_lib_prefix=no
2710e34c20c8SJon Dugan      ;;
2711e34c20c8SJon Dugan    freebsd-*)
27124874c4a8SBruce A. Mah      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2713e34c20c8SJon Dugan      need_version=yes
2714e34c20c8SJon Dugan      ;;
2715e34c20c8SJon Dugan  esac
2716e34c20c8SJon Dugan  shlibpath_var=LD_LIBRARY_PATH
2717e34c20c8SJon Dugan  case $host_os in
27186edfd8d6SBruce A. Mah  freebsd2.*)
2719e34c20c8SJon Dugan    shlibpath_overrides_runpath=yes
2720e34c20c8SJon Dugan    ;;
2721e34c20c8SJon Dugan  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2722e34c20c8SJon Dugan    shlibpath_overrides_runpath=yes
2723e34c20c8SJon Dugan    hardcode_into_libs=yes
2724e34c20c8SJon Dugan    ;;
2725e34c20c8SJon Dugan  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2726e34c20c8SJon Dugan  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2727e34c20c8SJon Dugan    shlibpath_overrides_runpath=no
2728e34c20c8SJon Dugan    hardcode_into_libs=yes
2729e34c20c8SJon Dugan    ;;
2730ba7b91d2SJef Poskanzer  *) # from 4.6 on, and DragonFly
2731e34c20c8SJon Dugan    shlibpath_overrides_runpath=yes
2732e34c20c8SJon Dugan    hardcode_into_libs=yes
2733e34c20c8SJon Dugan    ;;
2734e34c20c8SJon Dugan  esac
2735e34c20c8SJon Dugan  ;;
2736e34c20c8SJon Dugan
27376edfd8d6SBruce A. Mahhaiku*)
27386edfd8d6SBruce A. Mah  version_type=linux # correct to gnu/linux during the next big refactor
27396edfd8d6SBruce A. Mah  need_lib_prefix=no
27406edfd8d6SBruce A. Mah  need_version=no
27416edfd8d6SBruce A. Mah  dynamic_linker="$host_os runtime_loader"
27424874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27434874c4a8SBruce A. Mah  soname_spec='$libname$release$shared_ext$major'
27446edfd8d6SBruce A. Mah  shlibpath_var=LIBRARY_PATH
27454874c4a8SBruce A. Mah  shlibpath_overrides_runpath=no
27466edfd8d6SBruce A. Mah  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2747e34c20c8SJon Dugan  hardcode_into_libs=yes
2748e34c20c8SJon Dugan  ;;
2749e34c20c8SJon Dugan
2750e34c20c8SJon Duganhpux9* | hpux10* | hpux11*)
2751e34c20c8SJon Dugan  # Give a soname corresponding to the major version so that dld.sl refuses to
2752e34c20c8SJon Dugan  # link against other versions.
2753e34c20c8SJon Dugan  version_type=sunos
2754e34c20c8SJon Dugan  need_lib_prefix=no
2755e34c20c8SJon Dugan  need_version=no
2756e34c20c8SJon Dugan  case $host_cpu in
2757e34c20c8SJon Dugan  ia64*)
2758e34c20c8SJon Dugan    shrext_cmds='.so'
2759e34c20c8SJon Dugan    hardcode_into_libs=yes
2760e34c20c8SJon Dugan    dynamic_linker="$host_os dld.so"
2761e34c20c8SJon Dugan    shlibpath_var=LD_LIBRARY_PATH
2762e34c20c8SJon Dugan    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
27634874c4a8SBruce A. Mah    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27644874c4a8SBruce A. Mah    soname_spec='$libname$release$shared_ext$major'
27654874c4a8SBruce A. Mah    if test 32 = "$HPUX_IA64_MODE"; then
2766e34c20c8SJon Dugan      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
27675461579dSBruce A. Mah      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
2768e34c20c8SJon Dugan    else
2769e34c20c8SJon Dugan      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
27705461579dSBruce A. Mah      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
2771e34c20c8SJon Dugan    fi
2772e34c20c8SJon Dugan    ;;
2773e34c20c8SJon Dugan  hppa*64*)
2774e34c20c8SJon Dugan    shrext_cmds='.sl'
2775e34c20c8SJon Dugan    hardcode_into_libs=yes
2776e34c20c8SJon Dugan    dynamic_linker="$host_os dld.sl"
2777e34c20c8SJon Dugan    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2778e34c20c8SJon Dugan    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
27794874c4a8SBruce A. Mah    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27804874c4a8SBruce A. Mah    soname_spec='$libname$release$shared_ext$major'
2781e34c20c8SJon Dugan    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2782e34c20c8SJon Dugan    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2783e34c20c8SJon Dugan    ;;
2784e34c20c8SJon Dugan  *)
2785e34c20c8SJon Dugan    shrext_cmds='.sl'
2786e34c20c8SJon Dugan    dynamic_linker="$host_os dld.sl"
2787e34c20c8SJon Dugan    shlibpath_var=SHLIB_PATH
2788e34c20c8SJon Dugan    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
27894874c4a8SBruce A. Mah    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27904874c4a8SBruce A. Mah    soname_spec='$libname$release$shared_ext$major'
2791e34c20c8SJon Dugan    ;;
2792e34c20c8SJon Dugan  esac
27936edfd8d6SBruce A. Mah  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2794e34c20c8SJon Dugan  postinstall_cmds='chmod 555 $lib'
27956edfd8d6SBruce A. Mah  # or fails outright, so override atomically:
27966edfd8d6SBruce A. Mah  install_override_mode=555
2797e34c20c8SJon Dugan  ;;
2798e34c20c8SJon Dugan
2799ba7b91d2SJef Poskanzerinterix[[3-9]]*)
28006edfd8d6SBruce A. Mah  version_type=linux # correct to gnu/linux during the next big refactor
2801e34c20c8SJon Dugan  need_lib_prefix=no
2802e34c20c8SJon Dugan  need_version=no
28034874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
28044874c4a8SBruce A. Mah  soname_spec='$libname$release$shared_ext$major'
2805e34c20c8SJon Dugan  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2806e34c20c8SJon Dugan  shlibpath_var=LD_LIBRARY_PATH
2807e34c20c8SJon Dugan  shlibpath_overrides_runpath=no
2808e34c20c8SJon Dugan  hardcode_into_libs=yes
2809e34c20c8SJon Dugan  ;;
2810e34c20c8SJon Dugan
2811e34c20c8SJon Duganirix5* | irix6* | nonstopux*)
2812e34c20c8SJon Dugan  case $host_os in
2813e34c20c8SJon Dugan    nonstopux*) version_type=nonstopux ;;
2814e34c20c8SJon Dugan    *)
28154874c4a8SBruce A. Mah	if test yes = "$lt_cv_prog_gnu_ld"; then
28166edfd8d6SBruce A. Mah		version_type=linux # correct to gnu/linux during the next big refactor
2817e34c20c8SJon Dugan	else
2818e34c20c8SJon Dugan		version_type=irix
2819e34c20c8SJon Dugan	fi ;;
2820e34c20c8SJon Dugan  esac
2821e34c20c8SJon Dugan  need_lib_prefix=no
2822e34c20c8SJon Dugan  need_version=no
28234874c4a8SBruce A. Mah  soname_spec='$libname$release$shared_ext$major'
28244874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
2825e34c20c8SJon Dugan  case $host_os in
2826e34c20c8SJon Dugan  irix5* | nonstopux*)
2827e34c20c8SJon Dugan    libsuff= shlibsuff=
2828e34c20c8SJon Dugan    ;;
2829e34c20c8SJon Dugan  *)
2830e34c20c8SJon Dugan    case $LD in # libtool.m4 will add one of these switches to LD
2831e34c20c8SJon Dugan    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2832e34c20c8SJon Dugan      libsuff= shlibsuff= libmagic=32-bit;;
2833e34c20c8SJon Dugan    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2834e34c20c8SJon Dugan      libsuff=32 shlibsuff=N32 libmagic=N32;;
2835e34c20c8SJon Dugan    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2836e34c20c8SJon Dugan      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2837e34c20c8SJon Dugan    *) libsuff= shlibsuff= libmagic=never-match;;
2838e34c20c8SJon Dugan    esac
2839e34c20c8SJon Dugan    ;;
2840e34c20c8SJon Dugan  esac
2841e34c20c8SJon Dugan  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2842e34c20c8SJon Dugan  shlibpath_overrides_runpath=no
28434874c4a8SBruce A. Mah  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
28444874c4a8SBruce A. Mah  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
2845e34c20c8SJon Dugan  hardcode_into_libs=yes
2846e34c20c8SJon Dugan  ;;
2847e34c20c8SJon Dugan
2848e34c20c8SJon Dugan# No shared lib support for Linux oldld, aout, or coff.
2849e34c20c8SJon Duganlinux*oldld* | linux*aout* | linux*coff*)
2850e34c20c8SJon Dugan  dynamic_linker=no
2851e34c20c8SJon Dugan  ;;
2852e34c20c8SJon Dugan
28534874c4a8SBruce A. Mahlinux*android*)
28544874c4a8SBruce A. Mah  version_type=none # Android doesn't support versioned libraries.
28554874c4a8SBruce A. Mah  need_lib_prefix=no
28564874c4a8SBruce A. Mah  need_version=no
28574874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext'
28584874c4a8SBruce A. Mah  soname_spec='$libname$release$shared_ext'
28594874c4a8SBruce A. Mah  finish_cmds=
28604874c4a8SBruce A. Mah  shlibpath_var=LD_LIBRARY_PATH
28614874c4a8SBruce A. Mah  shlibpath_overrides_runpath=yes
28624874c4a8SBruce A. Mah
28634874c4a8SBruce A. Mah  # This implies no fast_install, which is unacceptable.
28644874c4a8SBruce A. Mah  # Some rework will be needed to allow for fast_install
28654874c4a8SBruce A. Mah  # before this can be enabled.
28664874c4a8SBruce A. Mah  hardcode_into_libs=yes
28674874c4a8SBruce A. Mah
28684874c4a8SBruce A. Mah  dynamic_linker='Android linker'
28694874c4a8SBruce A. Mah  # Don't embed -rpath directories since the linker doesn't support them.
28704874c4a8SBruce A. Mah  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
28714874c4a8SBruce A. Mah  ;;
28724874c4a8SBruce A. Mah
28736edfd8d6SBruce A. Mah# This must be glibc/ELF.
28744874c4a8SBruce A. Mahlinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
28756edfd8d6SBruce A. Mah  version_type=linux # correct to gnu/linux during the next big refactor
2876e34c20c8SJon Dugan  need_lib_prefix=no
2877e34c20c8SJon Dugan  need_version=no
28784874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
28794874c4a8SBruce A. Mah  soname_spec='$libname$release$shared_ext$major'
2880e34c20c8SJon Dugan  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2881e34c20c8SJon Dugan  shlibpath_var=LD_LIBRARY_PATH
2882e34c20c8SJon Dugan  shlibpath_overrides_runpath=no
28836edfd8d6SBruce A. Mah
2884ba7b91d2SJef Poskanzer  # Some binutils ld are patched to set DT_RUNPATH
28856edfd8d6SBruce A. Mah  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
28866edfd8d6SBruce A. Mah    [lt_cv_shlibpath_overrides_runpath=no
2887ba7b91d2SJef Poskanzer    save_LDFLAGS=$LDFLAGS
2888ba7b91d2SJef Poskanzer    save_libdir=$libdir
2889ba7b91d2SJef Poskanzer    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2890ba7b91d2SJef Poskanzer	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2891ba7b91d2SJef Poskanzer    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2892ba7b91d2SJef Poskanzer      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
28936edfd8d6SBruce A. Mah	 [lt_cv_shlibpath_overrides_runpath=yes])])
2894ba7b91d2SJef Poskanzer    LDFLAGS=$save_LDFLAGS
2895ba7b91d2SJef Poskanzer    libdir=$save_libdir
28966edfd8d6SBruce A. Mah    ])
28976edfd8d6SBruce A. Mah  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2898ba7b91d2SJef Poskanzer
2899e34c20c8SJon Dugan  # This implies no fast_install, which is unacceptable.
2900e34c20c8SJon Dugan  # Some rework will be needed to allow for fast_install
2901e34c20c8SJon Dugan  # before this can be enabled.
2902e34c20c8SJon Dugan  hardcode_into_libs=yes
2903e34c20c8SJon Dugan
29045461579dSBruce A. Mah  # Ideally, we could use ldconfig to report *all* directores which are
29055461579dSBruce A. Mah  # searched for libraries, however this is still not possible.  Aside from not
29065461579dSBruce A. Mah  # being certain /sbin/ldconfig is available, command
29075461579dSBruce A. Mah  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
29085461579dSBruce A. Mah  # even though it is searched at run-time.  Try to do the best guess by
29095461579dSBruce A. Mah  # appending ld.so.conf contents (and includes) to the search path.
2910e34c20c8SJon Dugan  if test -f /etc/ld.so.conf; then
29116edfd8d6SBruce A. Mah    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' ' '`
29126edfd8d6SBruce A. Mah    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2913e34c20c8SJon Dugan  fi
2914e34c20c8SJon Dugan
2915e34c20c8SJon Dugan  # We used to test for /lib/ld.so.1 and disable shared libraries on
2916e34c20c8SJon Dugan  # powerpc, because MkLinux only supported shared libraries with the
2917e34c20c8SJon Dugan  # GNU dynamic linker.  Since this was broken with cross compilers,
2918e34c20c8SJon Dugan  # most powerpc-linux boxes support dynamic linking these days and
2919e34c20c8SJon Dugan  # people can always --disable-shared, the test was removed, and we
2920e34c20c8SJon Dugan  # assume the GNU/Linux dynamic linker is in use.
2921e34c20c8SJon Dugan  dynamic_linker='GNU/Linux ld.so'
2922e34c20c8SJon Dugan  ;;
2923e34c20c8SJon Dugan
2924e34c20c8SJon Dugannetbsd*)
2925e34c20c8SJon Dugan  version_type=sunos
2926e34c20c8SJon Dugan  need_lib_prefix=no
2927e34c20c8SJon Dugan  need_version=no
2928ba7b91d2SJef Poskanzer  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
29294874c4a8SBruce A. Mah    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2930e34c20c8SJon Dugan    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2931e34c20c8SJon Dugan    dynamic_linker='NetBSD (a.out) ld.so'
2932e34c20c8SJon Dugan  else
29334874c4a8SBruce A. Mah    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
29344874c4a8SBruce A. Mah    soname_spec='$libname$release$shared_ext$major'
2935e34c20c8SJon Dugan    dynamic_linker='NetBSD ld.elf_so'
2936e34c20c8SJon Dugan  fi
2937e34c20c8SJon Dugan  shlibpath_var=LD_LIBRARY_PATH
2938e34c20c8SJon Dugan  shlibpath_overrides_runpath=yes
2939e34c20c8SJon Dugan  hardcode_into_libs=yes
2940e34c20c8SJon Dugan  ;;
2941e34c20c8SJon Dugan
2942e34c20c8SJon Dugannewsos6)
29436edfd8d6SBruce A. Mah  version_type=linux # correct to gnu/linux during the next big refactor
29444874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2945e34c20c8SJon Dugan  shlibpath_var=LD_LIBRARY_PATH
2946e34c20c8SJon Dugan  shlibpath_overrides_runpath=yes
2947e34c20c8SJon Dugan  ;;
2948e34c20c8SJon Dugan
2949ba7b91d2SJef Poskanzer*nto* | *qnx*)
2950ba7b91d2SJef Poskanzer  version_type=qnx
2951e34c20c8SJon Dugan  need_lib_prefix=no
2952e34c20c8SJon Dugan  need_version=no
29534874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
29544874c4a8SBruce A. Mah  soname_spec='$libname$release$shared_ext$major'
2955e34c20c8SJon Dugan  shlibpath_var=LD_LIBRARY_PATH
2956ba7b91d2SJef Poskanzer  shlibpath_overrides_runpath=no
2957ba7b91d2SJef Poskanzer  hardcode_into_libs=yes
2958ba7b91d2SJef Poskanzer  dynamic_linker='ldqnx.so'
2959e34c20c8SJon Dugan  ;;
2960e34c20c8SJon Dugan
29614874c4a8SBruce A. Mahopenbsd* | bitrig*)
2962e34c20c8SJon Dugan  version_type=sunos
29634874c4a8SBruce A. Mah  sys_lib_dlsearch_path_spec=/usr/lib
2964e34c20c8SJon Dugan  need_lib_prefix=no
29654874c4a8SBruce A. Mah  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
29664874c4a8SBruce A. Mah    need_version=no
29674874c4a8SBruce A. Mah  else
29684874c4a8SBruce A. Mah    need_version=yes
29694874c4a8SBruce A. Mah  fi
29704874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2971e34c20c8SJon Dugan  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2972e34c20c8SJon Dugan  shlibpath_var=LD_LIBRARY_PATH
2973e34c20c8SJon Dugan  shlibpath_overrides_runpath=yes
2974e34c20c8SJon Dugan  ;;
2975e34c20c8SJon Dugan
2976e34c20c8SJon Duganos2*)
2977e34c20c8SJon Dugan  libname_spec='$name'
29784874c4a8SBruce A. Mah  version_type=windows
29794874c4a8SBruce A. Mah  shrext_cmds=.dll
29804874c4a8SBruce A. Mah  need_version=no
2981e34c20c8SJon Dugan  need_lib_prefix=no
29824874c4a8SBruce A. Mah  # OS/2 can only load a DLL with a base name of 8 characters or less.
29834874c4a8SBruce A. Mah  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
29844874c4a8SBruce A. Mah    v=$($ECHO $release$versuffix | tr -d .-);
29854874c4a8SBruce A. Mah    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
29864874c4a8SBruce A. Mah    $ECHO $n$v`$shared_ext'
29874874c4a8SBruce A. Mah  library_names_spec='${libname}_dll.$libext'
2988e34c20c8SJon Dugan  dynamic_linker='OS/2 ld.exe'
29894874c4a8SBruce A. Mah  shlibpath_var=BEGINLIBPATH
29904874c4a8SBruce A. Mah  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
29914874c4a8SBruce A. Mah  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
29924874c4a8SBruce A. Mah  postinstall_cmds='base_file=`basename \$file`~
29934874c4a8SBruce A. Mah    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
29944874c4a8SBruce A. Mah    dldir=$destdir/`dirname \$dlpath`~
29954874c4a8SBruce A. Mah    test -d \$dldir || mkdir -p \$dldir~
29964874c4a8SBruce A. Mah    $install_prog $dir/$dlname \$dldir/$dlname~
29974874c4a8SBruce A. Mah    chmod a+x \$dldir/$dlname~
29984874c4a8SBruce A. Mah    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
29994874c4a8SBruce A. Mah      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
30004874c4a8SBruce A. Mah    fi'
30014874c4a8SBruce A. Mah  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
30024874c4a8SBruce A. Mah    dlpath=$dir/\$dldll~
30034874c4a8SBruce A. Mah    $RM \$dlpath'
3004e34c20c8SJon Dugan  ;;
3005e34c20c8SJon Dugan
3006e34c20c8SJon Duganosf3* | osf4* | osf5*)
3007e34c20c8SJon Dugan  version_type=osf
3008e34c20c8SJon Dugan  need_lib_prefix=no
3009e34c20c8SJon Dugan  need_version=no
30104874c4a8SBruce A. Mah  soname_spec='$libname$release$shared_ext$major'
30114874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3012e34c20c8SJon Dugan  shlibpath_var=LD_LIBRARY_PATH
3013e34c20c8SJon Dugan  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
30144874c4a8SBruce A. Mah  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3015e34c20c8SJon Dugan  ;;
3016e34c20c8SJon Dugan
3017ba7b91d2SJef Poskanzerrdos*)
3018ba7b91d2SJef Poskanzer  dynamic_linker=no
3019ba7b91d2SJef Poskanzer  ;;
3020ba7b91d2SJef Poskanzer
3021e34c20c8SJon Dugansolaris*)
30226edfd8d6SBruce A. Mah  version_type=linux # correct to gnu/linux during the next big refactor
3023e34c20c8SJon Dugan  need_lib_prefix=no
3024e34c20c8SJon Dugan  need_version=no
30254874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
30264874c4a8SBruce A. Mah  soname_spec='$libname$release$shared_ext$major'
3027e34c20c8SJon Dugan  shlibpath_var=LD_LIBRARY_PATH
3028e34c20c8SJon Dugan  shlibpath_overrides_runpath=yes
3029e34c20c8SJon Dugan  hardcode_into_libs=yes
3030e34c20c8SJon Dugan  # ldd complains unless libraries are executable
3031e34c20c8SJon Dugan  postinstall_cmds='chmod +x $lib'
3032e34c20c8SJon Dugan  ;;
3033e34c20c8SJon Dugan
3034e34c20c8SJon Dugansunos4*)
3035e34c20c8SJon Dugan  version_type=sunos
30364874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
3037e34c20c8SJon Dugan  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3038e34c20c8SJon Dugan  shlibpath_var=LD_LIBRARY_PATH
3039e34c20c8SJon Dugan  shlibpath_overrides_runpath=yes
30404874c4a8SBruce A. Mah  if test yes = "$with_gnu_ld"; then
3041e34c20c8SJon Dugan    need_lib_prefix=no
3042e34c20c8SJon Dugan  fi
3043e34c20c8SJon Dugan  need_version=yes
3044e34c20c8SJon Dugan  ;;
3045e34c20c8SJon Dugan
3046e34c20c8SJon Dugansysv4 | sysv4.3*)
30476edfd8d6SBruce A. Mah  version_type=linux # correct to gnu/linux during the next big refactor
30484874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
30494874c4a8SBruce A. Mah  soname_spec='$libname$release$shared_ext$major'
3050e34c20c8SJon Dugan  shlibpath_var=LD_LIBRARY_PATH
3051e34c20c8SJon Dugan  case $host_vendor in
3052e34c20c8SJon Dugan    sni)
3053e34c20c8SJon Dugan      shlibpath_overrides_runpath=no
3054e34c20c8SJon Dugan      need_lib_prefix=no
3055e34c20c8SJon Dugan      runpath_var=LD_RUN_PATH
3056e34c20c8SJon Dugan      ;;
3057e34c20c8SJon Dugan    siemens)
3058e34c20c8SJon Dugan      need_lib_prefix=no
3059e34c20c8SJon Dugan      ;;
3060e34c20c8SJon Dugan    motorola)
3061e34c20c8SJon Dugan      need_lib_prefix=no
3062e34c20c8SJon Dugan      need_version=no
3063e34c20c8SJon Dugan      shlibpath_overrides_runpath=no
3064e34c20c8SJon Dugan      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3065e34c20c8SJon Dugan      ;;
3066e34c20c8SJon Dugan  esac
3067e34c20c8SJon Dugan  ;;
3068e34c20c8SJon Dugan
3069e34c20c8SJon Dugansysv4*MP*)
3070e34c20c8SJon Dugan  if test -d /usr/nec; then
30716edfd8d6SBruce A. Mah    version_type=linux # correct to gnu/linux during the next big refactor
30724874c4a8SBruce A. Mah    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
30734874c4a8SBruce A. Mah    soname_spec='$libname$shared_ext.$major'
3074e34c20c8SJon Dugan    shlibpath_var=LD_LIBRARY_PATH
3075e34c20c8SJon Dugan  fi
3076e34c20c8SJon Dugan  ;;
3077e34c20c8SJon Dugan
3078e34c20c8SJon Dugansysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
30794874c4a8SBruce A. Mah  version_type=sco
3080e34c20c8SJon Dugan  need_lib_prefix=no
3081e34c20c8SJon Dugan  need_version=no
30824874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
30834874c4a8SBruce A. Mah  soname_spec='$libname$release$shared_ext$major'
3084e34c20c8SJon Dugan  shlibpath_var=LD_LIBRARY_PATH
3085ba7b91d2SJef Poskanzer  shlibpath_overrides_runpath=yes
3086e34c20c8SJon Dugan  hardcode_into_libs=yes
30874874c4a8SBruce A. Mah  if test yes = "$with_gnu_ld"; then
3088e34c20c8SJon Dugan    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3089e34c20c8SJon Dugan  else
3090e34c20c8SJon Dugan    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3091e34c20c8SJon Dugan    case $host_os in
3092e34c20c8SJon Dugan      sco3.2v5*)
3093e34c20c8SJon Dugan        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3094e34c20c8SJon Dugan	;;
3095e34c20c8SJon Dugan    esac
3096e34c20c8SJon Dugan  fi
3097e34c20c8SJon Dugan  sys_lib_dlsearch_path_spec='/usr/lib'
3098e34c20c8SJon Dugan  ;;
3099e34c20c8SJon Dugan
3100ba7b91d2SJef Poskanzertpf*)
3101ba7b91d2SJef Poskanzer  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
31026edfd8d6SBruce A. Mah  version_type=linux # correct to gnu/linux during the next big refactor
3103ba7b91d2SJef Poskanzer  need_lib_prefix=no
3104ba7b91d2SJef Poskanzer  need_version=no
31054874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3106ba7b91d2SJef Poskanzer  shlibpath_var=LD_LIBRARY_PATH
3107ba7b91d2SJef Poskanzer  shlibpath_overrides_runpath=no
3108ba7b91d2SJef Poskanzer  hardcode_into_libs=yes
3109ba7b91d2SJef Poskanzer  ;;
3110ba7b91d2SJef Poskanzer
3111e34c20c8SJon Duganuts4*)
31126edfd8d6SBruce A. Mah  version_type=linux # correct to gnu/linux during the next big refactor
31134874c4a8SBruce A. Mah  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
31144874c4a8SBruce A. Mah  soname_spec='$libname$release$shared_ext$major'
3115e34c20c8SJon Dugan  shlibpath_var=LD_LIBRARY_PATH
3116e34c20c8SJon Dugan  ;;
3117e34c20c8SJon Dugan
3118e34c20c8SJon Dugan*)
3119e34c20c8SJon Dugan  dynamic_linker=no
3120e34c20c8SJon Dugan  ;;
3121e34c20c8SJon Duganesac
3122e34c20c8SJon DuganAC_MSG_RESULT([$dynamic_linker])
31234874c4a8SBruce A. Mahtest no = "$dynamic_linker" && can_build_shared=no
3124e34c20c8SJon Dugan
3125e34c20c8SJon Duganvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
31264874c4a8SBruce A. Mahif test yes = "$GCC"; then
3127e34c20c8SJon Dugan  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3128e34c20c8SJon Duganfi
3129e34c20c8SJon Dugan
31304874c4a8SBruce A. Mahif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
31314874c4a8SBruce A. Mah  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
3132ba7b91d2SJef Poskanzerfi
31335461579dSBruce A. Mah
31344874c4a8SBruce A. Mahif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
31354874c4a8SBruce A. Mah  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
3136e34c20c8SJon Duganfi
3137e34c20c8SJon Dugan
31385461579dSBruce A. Mah# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
31395461579dSBruce A. Mahconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
31405461579dSBruce A. Mah
31415461579dSBruce A. Mah# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
31425461579dSBruce A. Mahfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
31435461579dSBruce A. Mah
31445461579dSBruce A. Mah# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
31455461579dSBruce A. Mahconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
31465461579dSBruce A. Mah
3147ba7b91d2SJef Poskanzer_LT_DECL([], [variables_saved_for_relink], [1],
3148ba7b91d2SJef Poskanzer    [Variables whose values should be saved in libtool wrapper scripts and
3149ba7b91d2SJef Poskanzer    restored at link time])
3150ba7b91d2SJef Poskanzer_LT_DECL([], [need_lib_prefix], [0],
3151ba7b91d2SJef Poskanzer    [Do we need the "lib" prefix for modules?])
3152ba7b91d2SJef Poskanzer_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3153ba7b91d2SJef Poskanzer_LT_DECL([], [version_type], [0], [Library versioning type])
3154ba7b91d2SJef Poskanzer_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3155ba7b91d2SJef Poskanzer_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3156ba7b91d2SJef Poskanzer_LT_DECL([], [shlibpath_overrides_runpath], [0],
3157ba7b91d2SJef Poskanzer    [Is shlibpath searched before the hard-coded library search path?])
3158ba7b91d2SJef Poskanzer_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3159ba7b91d2SJef Poskanzer_LT_DECL([], [library_names_spec], [1],
3160ba7b91d2SJef Poskanzer    [[List of archive names.  First name is the real one, the rest are links.
3161ba7b91d2SJef Poskanzer    The last name is the one that the linker finds with -lNAME]])
3162ba7b91d2SJef Poskanzer_LT_DECL([], [soname_spec], [1],
3163ba7b91d2SJef Poskanzer    [[The coded name of the library, if different from the real name]])
31646edfd8d6SBruce A. Mah_LT_DECL([], [install_override_mode], [1],
31656edfd8d6SBruce A. Mah    [Permission mode override for installation of shared libraries])
3166ba7b91d2SJef Poskanzer_LT_DECL([], [postinstall_cmds], [2],
3167ba7b91d2SJef Poskanzer    [Command to use after installation of a shared archive])
3168ba7b91d2SJef Poskanzer_LT_DECL([], [postuninstall_cmds], [2],
3169ba7b91d2SJef Poskanzer    [Command to use after uninstallation of a shared archive])
3170ba7b91d2SJef Poskanzer_LT_DECL([], [finish_cmds], [2],
3171ba7b91d2SJef Poskanzer    [Commands used to finish a libtool library installation in a directory])
3172ba7b91d2SJef Poskanzer_LT_DECL([], [finish_eval], [1],
3173ba7b91d2SJef Poskanzer    [[As "finish_cmds", except a single script fragment to be evaled but
3174ba7b91d2SJef Poskanzer    not shown]])
3175ba7b91d2SJef Poskanzer_LT_DECL([], [hardcode_into_libs], [0],
3176ba7b91d2SJef Poskanzer    [Whether we should hardcode library paths into libraries])
3177ba7b91d2SJef Poskanzer_LT_DECL([], [sys_lib_search_path_spec], [2],
3178ba7b91d2SJef Poskanzer    [Compile-time system search path for libraries])
31795461579dSBruce A. Mah_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
31805461579dSBruce A. Mah    [Detected run-time system search path for libraries])
31815461579dSBruce A. Mah_LT_DECL([], [configure_time_lt_sys_library_path], [2],
31825461579dSBruce A. Mah    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
3183ba7b91d2SJef Poskanzer])# _LT_SYS_DYNAMIC_LINKER
3184e34c20c8SJon Dugan
3185e34c20c8SJon Dugan
3186ba7b91d2SJef Poskanzer# _LT_PATH_TOOL_PREFIX(TOOL)
3187e34c20c8SJon Dugan# --------------------------
31884874c4a8SBruce A. Mah# find a file program that can recognize shared library
3189ba7b91d2SJef PoskanzerAC_DEFUN([_LT_PATH_TOOL_PREFIX],
3190ba7b91d2SJef Poskanzer[m4_require([_LT_DECL_EGREP])dnl
3191e34c20c8SJon DuganAC_MSG_CHECKING([for $1])
3192e34c20c8SJon DuganAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3193e34c20c8SJon Dugan[case $MAGIC_CMD in
3194e34c20c8SJon Dugan[[\\/*] |  ?:[\\/]*])
31954874c4a8SBruce A. Mah  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
3196e34c20c8SJon Dugan  ;;
3197e34c20c8SJon Dugan*)
31984874c4a8SBruce A. Mah  lt_save_MAGIC_CMD=$MAGIC_CMD
31994874c4a8SBruce A. Mah  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3200e34c20c8SJon Dugandnl $ac_dummy forces splitting on constant user-supplied paths.
3201e34c20c8SJon Dugandnl POSIX.2 word splitting is done only on the output of word expansions,
3202e34c20c8SJon Dugandnl not every word.  This closes a longstanding sh security hole.
3203ba7b91d2SJef Poskanzer  ac_dummy="m4_if([$2], , $PATH, [$2])"
3204e34c20c8SJon Dugan  for ac_dir in $ac_dummy; do
32054874c4a8SBruce A. Mah    IFS=$lt_save_ifs
3206e34c20c8SJon Dugan    test -z "$ac_dir" && ac_dir=.
32074874c4a8SBruce A. Mah    if test -f "$ac_dir/$1"; then
32084874c4a8SBruce A. Mah      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
3209e34c20c8SJon Dugan      if test -n "$file_magic_test_file"; then
3210e34c20c8SJon Dugan	case $deplibs_check_method in
3211e34c20c8SJon Dugan	"file_magic "*)
3212e34c20c8SJon Dugan	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
32134874c4a8SBruce A. Mah	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
3214e34c20c8SJon Dugan	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3215e34c20c8SJon Dugan	    $EGREP "$file_magic_regex" > /dev/null; then
3216e34c20c8SJon Dugan	    :
3217e34c20c8SJon Dugan	  else
3218ba7b91d2SJef Poskanzer	    cat <<_LT_EOF 1>&2
3219e34c20c8SJon Dugan
3220e34c20c8SJon Dugan*** Warning: the command libtool uses to detect shared libraries,
3221e34c20c8SJon Dugan*** $file_magic_cmd, produces output that libtool cannot recognize.
3222e34c20c8SJon Dugan*** The result is that libtool may fail to recognize shared libraries
3223e34c20c8SJon Dugan*** as such.  This will affect the creation of libtool libraries that
3224e34c20c8SJon Dugan*** depend on shared libraries, but programs linked with such libtool
3225e34c20c8SJon Dugan*** libraries will work regardless of this problem.  Nevertheless, you
3226e34c20c8SJon Dugan*** may want to report the problem to your system manager and/or to
3227e34c20c8SJon Dugan*** [email protected]
3228e34c20c8SJon Dugan
3229ba7b91d2SJef Poskanzer_LT_EOF
3230e34c20c8SJon Dugan	  fi ;;
3231e34c20c8SJon Dugan	esac
3232e34c20c8SJon Dugan      fi
3233e34c20c8SJon Dugan      break
3234e34c20c8SJon Dugan    fi
3235e34c20c8SJon Dugan  done
32364874c4a8SBruce A. Mah  IFS=$lt_save_ifs
32374874c4a8SBruce A. Mah  MAGIC_CMD=$lt_save_MAGIC_CMD
3238e34c20c8SJon Dugan  ;;
3239e34c20c8SJon Duganesac])
32404874c4a8SBruce A. MahMAGIC_CMD=$lt_cv_path_MAGIC_CMD
3241e34c20c8SJon Duganif test -n "$MAGIC_CMD"; then
3242e34c20c8SJon Dugan  AC_MSG_RESULT($MAGIC_CMD)
3243e34c20c8SJon Duganelse
3244e34c20c8SJon Dugan  AC_MSG_RESULT(no)
3245e34c20c8SJon Duganfi
3246ba7b91d2SJef Poskanzer_LT_DECL([], [MAGIC_CMD], [0],
3247ba7b91d2SJef Poskanzer	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3248ba7b91d2SJef Poskanzer])# _LT_PATH_TOOL_PREFIX
3249ba7b91d2SJef Poskanzer
3250ba7b91d2SJef Poskanzer# Old name:
3251ba7b91d2SJef PoskanzerAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3252ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
3253ba7b91d2SJef Poskanzerdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3254e34c20c8SJon Dugan
3255e34c20c8SJon Dugan
3256ba7b91d2SJef Poskanzer# _LT_PATH_MAGIC
3257ba7b91d2SJef Poskanzer# --------------
32584874c4a8SBruce A. Mah# find a file program that can recognize a shared library
3259ba7b91d2SJef Poskanzerm4_defun([_LT_PATH_MAGIC],
3260ba7b91d2SJef Poskanzer[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3261e34c20c8SJon Duganif test -z "$lt_cv_path_MAGIC_CMD"; then
3262e34c20c8SJon Dugan  if test -n "$ac_tool_prefix"; then
3263ba7b91d2SJef Poskanzer    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3264e34c20c8SJon Dugan  else
3265e34c20c8SJon Dugan    MAGIC_CMD=:
3266e34c20c8SJon Dugan  fi
3267e34c20c8SJon Duganfi
3268ba7b91d2SJef Poskanzer])# _LT_PATH_MAGIC
3269e34c20c8SJon Dugan
3270e34c20c8SJon Dugan
3271ba7b91d2SJef Poskanzer# LT_PATH_LD
3272e34c20c8SJon Dugan# ----------
3273e34c20c8SJon Dugan# find the pathname to the GNU or non-GNU linker
3274ba7b91d2SJef PoskanzerAC_DEFUN([LT_PATH_LD],
3275ba7b91d2SJef Poskanzer[AC_REQUIRE([AC_PROG_CC])dnl
327656a97f93SjefAC_REQUIRE([AC_CANONICAL_HOST])dnl
327756a97f93SjefAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3278ba7b91d2SJef Poskanzerm4_require([_LT_DECL_SED])dnl
3279ba7b91d2SJef Poskanzerm4_require([_LT_DECL_EGREP])dnl
32806edfd8d6SBruce A. Mahm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3281ba7b91d2SJef Poskanzer
3282ba7b91d2SJef PoskanzerAC_ARG_WITH([gnu-ld],
3283ba7b91d2SJef Poskanzer    [AS_HELP_STRING([--with-gnu-ld],
3284ba7b91d2SJef Poskanzer	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
32854874c4a8SBruce A. Mah    [test no = "$withval" || with_gnu_ld=yes],
3286ba7b91d2SJef Poskanzer    [with_gnu_ld=no])dnl
3287ba7b91d2SJef Poskanzer
3288e34c20c8SJon Duganac_prog=ld
32894874c4a8SBruce A. Mahif test yes = "$GCC"; then
3290e34c20c8SJon Dugan  # Check if gcc -print-prog-name=ld gives a path.
3291e34c20c8SJon Dugan  AC_MSG_CHECKING([for ld used by $CC])
3292e34c20c8SJon Dugan  case $host in
3293e34c20c8SJon Dugan  *-*-mingw*)
32944874c4a8SBruce A. Mah    # gcc leaves a trailing carriage return, which upsets mingw
3295e34c20c8SJon Dugan    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3296e34c20c8SJon Dugan  *)
3297e34c20c8SJon Dugan    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3298e34c20c8SJon Dugan  esac
3299e34c20c8SJon Dugan  case $ac_prog in
3300e34c20c8SJon Dugan    # Accept absolute paths.
3301e34c20c8SJon Dugan    [[\\/]]* | ?:[[\\/]]*)
3302e34c20c8SJon Dugan      re_direlt='/[[^/]][[^/]]*/\.\./'
3303e34c20c8SJon Dugan      # Canonicalize the pathname of ld
3304ba7b91d2SJef Poskanzer      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3305ba7b91d2SJef Poskanzer      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3306ba7b91d2SJef Poskanzer	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3307e34c20c8SJon Dugan      done
33084874c4a8SBruce A. Mah      test -z "$LD" && LD=$ac_prog
3309e34c20c8SJon Dugan      ;;
3310e34c20c8SJon Dugan  "")
3311e34c20c8SJon Dugan    # If it fails, then pretend we aren't using GCC.
3312e34c20c8SJon Dugan    ac_prog=ld
3313e34c20c8SJon Dugan    ;;
3314e34c20c8SJon Dugan  *)
3315e34c20c8SJon Dugan    # If it is relative, then search for the first ld in PATH.
3316e34c20c8SJon Dugan    with_gnu_ld=unknown
3317e34c20c8SJon Dugan    ;;
3318e34c20c8SJon Dugan  esac
33194874c4a8SBruce A. Mahelif test yes = "$with_gnu_ld"; then
3320e34c20c8SJon Dugan  AC_MSG_CHECKING([for GNU ld])
3321e34c20c8SJon Duganelse
3322e34c20c8SJon Dugan  AC_MSG_CHECKING([for non-GNU ld])
3323e34c20c8SJon Duganfi
3324e34c20c8SJon DuganAC_CACHE_VAL(lt_cv_path_LD,
3325e34c20c8SJon Dugan[if test -z "$LD"; then
33264874c4a8SBruce A. Mah  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3327e34c20c8SJon Dugan  for ac_dir in $PATH; do
33284874c4a8SBruce A. Mah    IFS=$lt_save_ifs
3329e34c20c8SJon Dugan    test -z "$ac_dir" && ac_dir=.
3330e34c20c8SJon Dugan    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
33314874c4a8SBruce A. Mah      lt_cv_path_LD=$ac_dir/$ac_prog
3332e34c20c8SJon Dugan      # Check to see if the program is GNU ld.  I'd rather use --version,
3333e34c20c8SJon Dugan      # but apparently some variants of GNU ld only accept -v.
3334e34c20c8SJon Dugan      # Break only if it was the GNU/non-GNU ld that we prefer.
3335e34c20c8SJon Dugan      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3336e34c20c8SJon Dugan      *GNU* | *'with BFD'*)
33374874c4a8SBruce A. Mah	test no != "$with_gnu_ld" && break
3338e34c20c8SJon Dugan	;;
3339e34c20c8SJon Dugan      *)
33404874c4a8SBruce A. Mah	test yes != "$with_gnu_ld" && break
3341e34c20c8SJon Dugan	;;
3342e34c20c8SJon Dugan      esac
3343e34c20c8SJon Dugan    fi
3344e34c20c8SJon Dugan  done
33454874c4a8SBruce A. Mah  IFS=$lt_save_ifs
3346e34c20c8SJon Duganelse
33474874c4a8SBruce A. Mah  lt_cv_path_LD=$LD # Let the user override the test with a path.
3348e34c20c8SJon Duganfi])
33494874c4a8SBruce A. MahLD=$lt_cv_path_LD
3350e34c20c8SJon Duganif test -n "$LD"; then
3351e34c20c8SJon Dugan  AC_MSG_RESULT($LD)
3352e34c20c8SJon Duganelse
3353e34c20c8SJon Dugan  AC_MSG_RESULT(no)
3354e34c20c8SJon Duganfi
3355e34c20c8SJon Dugantest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3356ba7b91d2SJef Poskanzer_LT_PATH_LD_GNU
3357ba7b91d2SJef PoskanzerAC_SUBST([LD])
3358ba7b91d2SJef Poskanzer
3359ba7b91d2SJef Poskanzer_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3360ba7b91d2SJef Poskanzer])# LT_PATH_LD
3361ba7b91d2SJef Poskanzer
3362ba7b91d2SJef Poskanzer# Old names:
3363ba7b91d2SJef PoskanzerAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3364ba7b91d2SJef PoskanzerAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3365ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
3366ba7b91d2SJef Poskanzerdnl AC_DEFUN([AM_PROG_LD], [])
3367ba7b91d2SJef Poskanzerdnl AC_DEFUN([AC_PROG_LD], [])
3368e34c20c8SJon Dugan
3369e34c20c8SJon Dugan
3370ba7b91d2SJef Poskanzer# _LT_PATH_LD_GNU
3371ba7b91d2SJef Poskanzer#- --------------
3372ba7b91d2SJef Poskanzerm4_defun([_LT_PATH_LD_GNU],
3373ba7b91d2SJef Poskanzer[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3374e34c20c8SJon Dugan[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3375e34c20c8SJon Dugancase `$LD -v 2>&1 </dev/null` in
3376e34c20c8SJon Dugan*GNU* | *'with BFD'*)
3377e34c20c8SJon Dugan  lt_cv_prog_gnu_ld=yes
3378e34c20c8SJon Dugan  ;;
3379e34c20c8SJon Dugan*)
3380e34c20c8SJon Dugan  lt_cv_prog_gnu_ld=no
3381e34c20c8SJon Dugan  ;;
3382e34c20c8SJon Duganesac])
3383e34c20c8SJon Duganwith_gnu_ld=$lt_cv_prog_gnu_ld
3384ba7b91d2SJef Poskanzer])# _LT_PATH_LD_GNU
3385e34c20c8SJon Dugan
3386e34c20c8SJon Dugan
3387ba7b91d2SJef Poskanzer# _LT_CMD_RELOAD
3388ba7b91d2SJef Poskanzer# --------------
3389e34c20c8SJon Dugan# find reload flag for linker
3390e34c20c8SJon Dugan#   -- PORTME Some linkers may need a different reload flag.
3391ba7b91d2SJef Poskanzerm4_defun([_LT_CMD_RELOAD],
3392e34c20c8SJon Dugan[AC_CACHE_CHECK([for $LD option to reload object files],
3393e34c20c8SJon Dugan  lt_cv_ld_reload_flag,
3394e34c20c8SJon Dugan  [lt_cv_ld_reload_flag='-r'])
3395e34c20c8SJon Duganreload_flag=$lt_cv_ld_reload_flag
3396e34c20c8SJon Dugancase $reload_flag in
3397e34c20c8SJon Dugan"" | " "*) ;;
3398e34c20c8SJon Dugan*) reload_flag=" $reload_flag" ;;
3399e34c20c8SJon Duganesac
3400e34c20c8SJon Duganreload_cmds='$LD$reload_flag -o $output$reload_objs'
3401e34c20c8SJon Dugancase $host_os in
34026edfd8d6SBruce A. Mah  cygwin* | mingw* | pw32* | cegcc*)
34034874c4a8SBruce A. Mah    if test yes != "$GCC"; then
34046edfd8d6SBruce A. Mah      reload_cmds=false
34056edfd8d6SBruce A. Mah    fi
34066edfd8d6SBruce A. Mah    ;;
3407e34c20c8SJon Dugan  darwin*)
34084874c4a8SBruce A. Mah    if test yes = "$GCC"; then
34094874c4a8SBruce A. Mah      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
3410e34c20c8SJon Dugan    else
3411e34c20c8SJon Dugan      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3412e34c20c8SJon Dugan    fi
3413e34c20c8SJon Dugan    ;;
3414e34c20c8SJon Duganesac
34156edfd8d6SBruce A. Mah_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
34166edfd8d6SBruce A. Mah_LT_TAGDECL([], [reload_cmds], [2])dnl
3417ba7b91d2SJef Poskanzer])# _LT_CMD_RELOAD
3418e34c20c8SJon Dugan
3419e34c20c8SJon Dugan
34204874c4a8SBruce A. Mah# _LT_PATH_DD
34214874c4a8SBruce A. Mah# -----------
34224874c4a8SBruce A. Mah# find a working dd
34234874c4a8SBruce A. Mahm4_defun([_LT_PATH_DD],
34244874c4a8SBruce A. Mah[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
34254874c4a8SBruce A. Mah[printf 0123456789abcdef0123456789abcdef >conftest.i
34264874c4a8SBruce A. Mahcat conftest.i conftest.i >conftest2.i
34274874c4a8SBruce A. Mah: ${lt_DD:=$DD}
34284874c4a8SBruce A. MahAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
34294874c4a8SBruce A. Mah[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
34304874c4a8SBruce A. Mah  cmp -s conftest.i conftest.out \
34314874c4a8SBruce A. Mah  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
34324874c4a8SBruce A. Mahfi])
34334874c4a8SBruce A. Mahrm -f conftest.i conftest2.i conftest.out])
34344874c4a8SBruce A. Mah])# _LT_PATH_DD
34354874c4a8SBruce A. Mah
34364874c4a8SBruce A. Mah
34374874c4a8SBruce A. Mah# _LT_CMD_TRUNCATE
34384874c4a8SBruce A. Mah# ----------------
34394874c4a8SBruce A. Mah# find command to truncate a binary pipe
34404874c4a8SBruce A. Mahm4_defun([_LT_CMD_TRUNCATE],
34414874c4a8SBruce A. Mah[m4_require([_LT_PATH_DD])
34424874c4a8SBruce A. MahAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
34434874c4a8SBruce A. Mah[printf 0123456789abcdef0123456789abcdef >conftest.i
34444874c4a8SBruce A. Mahcat conftest.i conftest.i >conftest2.i
34454874c4a8SBruce A. Mahlt_cv_truncate_bin=
34464874c4a8SBruce A. Mahif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
34474874c4a8SBruce A. Mah  cmp -s conftest.i conftest.out \
34484874c4a8SBruce A. Mah  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
34494874c4a8SBruce A. Mahfi
34504874c4a8SBruce A. Mahrm -f conftest.i conftest2.i conftest.out
34514874c4a8SBruce A. Mahtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
34524874c4a8SBruce A. Mah_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
34534874c4a8SBruce A. Mah  [Command to truncate a binary pipe])
34544874c4a8SBruce A. Mah])# _LT_CMD_TRUNCATE
34554874c4a8SBruce A. Mah
34564874c4a8SBruce A. Mah
3457ba7b91d2SJef Poskanzer# _LT_CHECK_MAGIC_METHOD
3458ba7b91d2SJef Poskanzer# ----------------------
3459e34c20c8SJon Dugan# how to check for library dependencies
3460e34c20c8SJon Dugan#  -- PORTME fill in with the dynamic library characteristics
3461ba7b91d2SJef Poskanzerm4_defun([_LT_CHECK_MAGIC_METHOD],
3462ba7b91d2SJef Poskanzer[m4_require([_LT_DECL_EGREP])
346360bd98a5SBruce A. Mahm4_require([_LT_DECL_OBJDUMP])
3464ba7b91d2SJef PoskanzerAC_CACHE_CHECK([how to recognize dependent libraries],
3465e34c20c8SJon Duganlt_cv_deplibs_check_method,
3466e34c20c8SJon Dugan[lt_cv_file_magic_cmd='$MAGIC_CMD'
3467e34c20c8SJon Duganlt_cv_file_magic_test_file=
3468e34c20c8SJon Duganlt_cv_deplibs_check_method='unknown'
3469e34c20c8SJon Dugan# Need to set the preceding variable on all platforms that support
3470e34c20c8SJon Dugan# interlibrary dependencies.
3471e34c20c8SJon Dugan# 'none' -- dependencies not supported.
34724874c4a8SBruce A. Mah# 'unknown' -- same as none, but documents that we really don't know.
3473e34c20c8SJon Dugan# 'pass_all' -- all dependencies passed with no checks.
3474e34c20c8SJon Dugan# 'test_compile' -- check by making test program.
3475e34c20c8SJon Dugan# 'file_magic [[regex]]' -- check by looking for files in library path
34764874c4a8SBruce A. Mah# that responds to the $file_magic_cmd with a given extended regex.
34774874c4a8SBruce A. Mah# If you have 'file' or equivalent on your system and you're not sure
34784874c4a8SBruce A. Mah# whether 'pass_all' will *always* work, you probably want this one.
3479e34c20c8SJon Dugan
3480e34c20c8SJon Dugancase $host_os in
3481ba7b91d2SJef Poskanzeraix[[4-9]]*)
3482e34c20c8SJon Dugan  lt_cv_deplibs_check_method=pass_all
3483e34c20c8SJon Dugan  ;;
3484e34c20c8SJon Dugan
3485e34c20c8SJon Duganbeos*)
3486e34c20c8SJon Dugan  lt_cv_deplibs_check_method=pass_all
3487e34c20c8SJon Dugan  ;;
3488e34c20c8SJon Dugan
3489e34c20c8SJon Duganbsdi[[45]]*)
3490e34c20c8SJon Dugan  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3491*85b25c2eSBruce A. Mah  lt_cv_file_magic_cmd='$FILECMD -L'
3492e34c20c8SJon Dugan  lt_cv_file_magic_test_file=/shlib/libc.so
3493e34c20c8SJon Dugan  ;;
3494e34c20c8SJon Dugan
3495e34c20c8SJon Dugancygwin*)
3496e34c20c8SJon Dugan  # func_win32_libid is a shell function defined in ltmain.sh
3497e34c20c8SJon Dugan  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3498e34c20c8SJon Dugan  lt_cv_file_magic_cmd='func_win32_libid'
3499e34c20c8SJon Dugan  ;;
3500e34c20c8SJon Dugan
3501e34c20c8SJon Duganmingw* | pw32*)
3502e34c20c8SJon Dugan  # Base MSYS/MinGW do not provide the 'file' command needed by
3503ba7b91d2SJef Poskanzer  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3504ba7b91d2SJef Poskanzer  # unless we find 'file', for example because we are cross-compiling.
35054874c4a8SBruce A. Mah  if ( file / ) >/dev/null 2>&1; then
3506ba7b91d2SJef Poskanzer    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3507ba7b91d2SJef Poskanzer    lt_cv_file_magic_cmd='func_win32_libid'
3508ba7b91d2SJef Poskanzer  else
35096edfd8d6SBruce A. Mah    # Keep this pattern in sync with the one in func_win32_libid.
35106edfd8d6SBruce A. Mah    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
35119286415cSJon Dugan    lt_cv_file_magic_cmd='$OBJDUMP -f'
3512ba7b91d2SJef Poskanzer  fi
35139286415cSJon Dugan  ;;
35149286415cSJon Dugan
35156edfd8d6SBruce A. Mahcegcc*)
351660bd98a5SBruce A. Mah  # use the weaker test based on 'objdump'. See mingw*.
351760bd98a5SBruce A. Mah  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
351860bd98a5SBruce A. Mah  lt_cv_file_magic_cmd='$OBJDUMP -f'
351960bd98a5SBruce A. Mah  ;;
352060bd98a5SBruce A. Mah
3521e34c20c8SJon Dugandarwin* | rhapsody*)
3522e34c20c8SJon Dugan  lt_cv_deplibs_check_method=pass_all
3523e34c20c8SJon Dugan  ;;
3524e34c20c8SJon Dugan
3525*85b25c2eSBruce A. Mahfreebsd* | dragonfly* | midnightbsd*)
3526ba7b91d2SJef Poskanzer  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3527e34c20c8SJon Dugan    case $host_cpu in
3528e34c20c8SJon Dugan    i*86 )
3529e34c20c8SJon Dugan      # Not sure whether the presence of OpenBSD here was a mistake.
3530e34c20c8SJon Dugan      # Let's accept both of them until this is cleared up.
3531e34c20c8SJon Dugan      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3532*85b25c2eSBruce A. Mah      lt_cv_file_magic_cmd=$FILECMD
3533e34c20c8SJon Dugan      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3534e34c20c8SJon Dugan      ;;
3535e34c20c8SJon Dugan    esac
3536e34c20c8SJon Dugan  else
3537e34c20c8SJon Dugan    lt_cv_deplibs_check_method=pass_all
3538e34c20c8SJon Dugan  fi
3539e34c20c8SJon Dugan  ;;
3540e34c20c8SJon Dugan
35416edfd8d6SBruce A. Mahhaiku*)
35426edfd8d6SBruce A. Mah  lt_cv_deplibs_check_method=pass_all
35436edfd8d6SBruce A. Mah  ;;
35446edfd8d6SBruce A. Mah
3545e34c20c8SJon Duganhpux10.20* | hpux11*)
3546*85b25c2eSBruce A. Mah  lt_cv_file_magic_cmd=$FILECMD
3547e34c20c8SJon Dugan  case $host_cpu in
3548e34c20c8SJon Dugan  ia64*)
3549e34c20c8SJon Dugan    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3550e34c20c8SJon Dugan    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3551e34c20c8SJon Dugan    ;;
3552e34c20c8SJon Dugan  hppa*64*)
35536edfd8d6SBruce A. Mah    [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]']
3554e34c20c8SJon Dugan    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3555e34c20c8SJon Dugan    ;;
3556e34c20c8SJon Dugan  *)
35576edfd8d6SBruce A. Mah    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3558e34c20c8SJon Dugan    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3559e34c20c8SJon Dugan    ;;
3560e34c20c8SJon Dugan  esac
3561e34c20c8SJon Dugan  ;;
3562e34c20c8SJon Dugan
3563ba7b91d2SJef Poskanzerinterix[[3-9]]*)
3564e34c20c8SJon Dugan  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3565e34c20c8SJon Dugan  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3566e34c20c8SJon Dugan  ;;
3567e34c20c8SJon Dugan
3568e34c20c8SJon Duganirix5* | irix6* | nonstopux*)
3569e34c20c8SJon Dugan  case $LD in
3570e34c20c8SJon Dugan  *-32|*"-32 ") libmagic=32-bit;;
3571e34c20c8SJon Dugan  *-n32|*"-n32 ") libmagic=N32;;
3572e34c20c8SJon Dugan  *-64|*"-64 ") libmagic=64-bit;;
3573e34c20c8SJon Dugan  *) libmagic=never-match;;
3574e34c20c8SJon Dugan  esac
3575e34c20c8SJon Dugan  lt_cv_deplibs_check_method=pass_all
3576e34c20c8SJon Dugan  ;;
3577e34c20c8SJon Dugan
35786edfd8d6SBruce A. Mah# This must be glibc/ELF.
35794874c4a8SBruce A. Mahlinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
3580e34c20c8SJon Dugan  lt_cv_deplibs_check_method=pass_all
3581e34c20c8SJon Dugan  ;;
3582e34c20c8SJon Dugan
3583e34c20c8SJon Dugannetbsd*)
3584ba7b91d2SJef Poskanzer  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3585e34c20c8SJon Dugan    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3586e34c20c8SJon Dugan  else
3587e34c20c8SJon Dugan    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3588e34c20c8SJon Dugan  fi
3589e34c20c8SJon Dugan  ;;
3590e34c20c8SJon Dugan
3591e34c20c8SJon Dugannewos6*)
3592e34c20c8SJon Dugan  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3593*85b25c2eSBruce A. Mah  lt_cv_file_magic_cmd=$FILECMD
3594e34c20c8SJon Dugan  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3595e34c20c8SJon Dugan  ;;
3596e34c20c8SJon Dugan
3597ba7b91d2SJef Poskanzer*nto* | *qnx*)
3598ba7b91d2SJef Poskanzer  lt_cv_deplibs_check_method=pass_all
3599e34c20c8SJon Dugan  ;;
3600e34c20c8SJon Dugan
36014874c4a8SBruce A. Mahopenbsd* | bitrig*)
36024874c4a8SBruce A. Mah  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
3603e34c20c8SJon Dugan    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3604e34c20c8SJon Dugan  else
3605e34c20c8SJon Dugan    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3606e34c20c8SJon Dugan  fi
3607e34c20c8SJon Dugan  ;;
3608e34c20c8SJon Dugan
3609e34c20c8SJon Duganosf3* | osf4* | osf5*)
3610e34c20c8SJon Dugan  lt_cv_deplibs_check_method=pass_all
3611e34c20c8SJon Dugan  ;;
3612e34c20c8SJon Dugan
3613ba7b91d2SJef Poskanzerrdos*)
3614ba7b91d2SJef Poskanzer  lt_cv_deplibs_check_method=pass_all
3615ba7b91d2SJef Poskanzer  ;;
3616ba7b91d2SJef Poskanzer
3617e34c20c8SJon Dugansolaris*)
3618e34c20c8SJon Dugan  lt_cv_deplibs_check_method=pass_all
3619e34c20c8SJon Dugan  ;;
3620e34c20c8SJon Dugan
3621ba7b91d2SJef Poskanzersysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3622ba7b91d2SJef Poskanzer  lt_cv_deplibs_check_method=pass_all
3623ba7b91d2SJef Poskanzer  ;;
3624ba7b91d2SJef Poskanzer
3625e34c20c8SJon Dugansysv4 | sysv4.3*)
3626e34c20c8SJon Dugan  case $host_vendor in
3627e34c20c8SJon Dugan  motorola)
3628e34c20c8SJon Dugan    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]]'
3629e34c20c8SJon Dugan    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3630e34c20c8SJon Dugan    ;;
3631e34c20c8SJon Dugan  ncr)
3632e34c20c8SJon Dugan    lt_cv_deplibs_check_method=pass_all
3633e34c20c8SJon Dugan    ;;
3634e34c20c8SJon Dugan  sequent)
3635e34c20c8SJon Dugan    lt_cv_file_magic_cmd='/bin/file'
3636e34c20c8SJon Dugan    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3637e34c20c8SJon Dugan    ;;
3638e34c20c8SJon Dugan  sni)
3639e34c20c8SJon Dugan    lt_cv_file_magic_cmd='/bin/file'
3640e34c20c8SJon Dugan    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3641e34c20c8SJon Dugan    lt_cv_file_magic_test_file=/lib/libc.so
3642e34c20c8SJon Dugan    ;;
3643e34c20c8SJon Dugan  siemens)
3644e34c20c8SJon Dugan    lt_cv_deplibs_check_method=pass_all
3645e34c20c8SJon Dugan    ;;
3646e34c20c8SJon Dugan  pc)
3647e34c20c8SJon Dugan    lt_cv_deplibs_check_method=pass_all
3648e34c20c8SJon Dugan    ;;
3649e34c20c8SJon Dugan  esac
3650e34c20c8SJon Dugan  ;;
3651e34c20c8SJon Dugan
3652ba7b91d2SJef Poskanzertpf*)
3653e34c20c8SJon Dugan  lt_cv_deplibs_check_method=pass_all
3654e34c20c8SJon Dugan  ;;
36554874c4a8SBruce A. Mahos2*)
36564874c4a8SBruce A. Mah  lt_cv_deplibs_check_method=pass_all
36574874c4a8SBruce A. Mah  ;;
3658e34c20c8SJon Duganesac
3659e34c20c8SJon Dugan])
36606edfd8d6SBruce A. Mah
36616edfd8d6SBruce A. Mahfile_magic_glob=
36626edfd8d6SBruce A. Mahwant_nocaseglob=no
36636edfd8d6SBruce A. Mahif test "$build" = "$host"; then
36646edfd8d6SBruce A. Mah  case $host_os in
36656edfd8d6SBruce A. Mah  mingw* | pw32*)
36666edfd8d6SBruce A. Mah    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
36676edfd8d6SBruce A. Mah      want_nocaseglob=yes
36686edfd8d6SBruce A. Mah    else
36696edfd8d6SBruce A. Mah      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
36706edfd8d6SBruce A. Mah    fi
36716edfd8d6SBruce A. Mah    ;;
36726edfd8d6SBruce A. Mah  esac
36736edfd8d6SBruce A. Mahfi
36746edfd8d6SBruce A. Mah
3675e34c20c8SJon Duganfile_magic_cmd=$lt_cv_file_magic_cmd
3676e34c20c8SJon Dugandeplibs_check_method=$lt_cv_deplibs_check_method
3677e34c20c8SJon Dugantest -z "$deplibs_check_method" && deplibs_check_method=unknown
3678ba7b91d2SJef Poskanzer
3679ba7b91d2SJef Poskanzer_LT_DECL([], [deplibs_check_method], [1],
3680ba7b91d2SJef Poskanzer    [Method to check whether dependent libraries are shared objects])
3681ba7b91d2SJef Poskanzer_LT_DECL([], [file_magic_cmd], [1],
36826edfd8d6SBruce A. Mah    [Command to use when deplibs_check_method = "file_magic"])
36836edfd8d6SBruce A. Mah_LT_DECL([], [file_magic_glob], [1],
36846edfd8d6SBruce A. Mah    [How to find potential files when deplibs_check_method = "file_magic"])
36856edfd8d6SBruce A. Mah_LT_DECL([], [want_nocaseglob], [1],
36866edfd8d6SBruce A. Mah    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3687ba7b91d2SJef Poskanzer])# _LT_CHECK_MAGIC_METHOD
3688e34c20c8SJon Dugan
3689e34c20c8SJon Dugan
3690ba7b91d2SJef Poskanzer# LT_PATH_NM
3691e34c20c8SJon Dugan# ----------
3692ba7b91d2SJef Poskanzer# find the pathname to a BSD- or MS-compatible name lister
3693ba7b91d2SJef PoskanzerAC_DEFUN([LT_PATH_NM],
3694ba7b91d2SJef Poskanzer[AC_REQUIRE([AC_PROG_CC])dnl
3695ba7b91d2SJef PoskanzerAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3696e34c20c8SJon Dugan[if test -n "$NM"; then
3697e34c20c8SJon Dugan  # Let the user override the test.
36984874c4a8SBruce A. Mah  lt_cv_path_NM=$NM
3699e34c20c8SJon Duganelse
37004874c4a8SBruce A. Mah  lt_nm_to_check=${ac_tool_prefix}nm
3701e34c20c8SJon Dugan  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3702e34c20c8SJon Dugan    lt_nm_to_check="$lt_nm_to_check nm"
3703e34c20c8SJon Dugan  fi
3704e34c20c8SJon Dugan  for lt_tmp_nm in $lt_nm_to_check; do
37054874c4a8SBruce A. Mah    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3706e34c20c8SJon Dugan    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
37074874c4a8SBruce A. Mah      IFS=$lt_save_ifs
3708e34c20c8SJon Dugan      test -z "$ac_dir" && ac_dir=.
37094874c4a8SBruce A. Mah      tmp_nm=$ac_dir/$lt_tmp_nm
3710e34c20c8SJon Dugan      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
3711e34c20c8SJon Dugan	# Check to see if the nm accepts a BSD-compat flag.
37124874c4a8SBruce A. Mah	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
3713e34c20c8SJon Dugan	#   nm: unknown option "B" ignored
3714e34c20c8SJon Dugan	# Tru64's nm complains that /dev/null is an invalid object file
37154874c4a8SBruce A. Mah	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
37164874c4a8SBruce A. Mah	case $build_os in
37174874c4a8SBruce A. Mah	mingw*) lt_bad_file=conftest.nm/nofile ;;
37184874c4a8SBruce A. Mah	*) lt_bad_file=/dev/null ;;
37194874c4a8SBruce A. Mah	esac
3720*85b25c2eSBruce A. Mah	case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
37214874c4a8SBruce A. Mah	*$lt_bad_file* | *'Invalid file or object type'*)
3722e34c20c8SJon Dugan	  lt_cv_path_NM="$tmp_nm -B"
37234874c4a8SBruce A. Mah	  break 2
3724e34c20c8SJon Dugan	  ;;
3725e34c20c8SJon Dugan	*)
3726*85b25c2eSBruce A. Mah	  case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
3727e34c20c8SJon Dugan	  */dev/null*)
3728e34c20c8SJon Dugan	    lt_cv_path_NM="$tmp_nm -p"
37294874c4a8SBruce A. Mah	    break 2
3730e34c20c8SJon Dugan	    ;;
3731e34c20c8SJon Dugan	  *)
3732e34c20c8SJon Dugan	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3733e34c20c8SJon Dugan	    continue # so that we can try to find one that supports BSD flags
3734e34c20c8SJon Dugan	    ;;
3735e34c20c8SJon Dugan	  esac
3736e34c20c8SJon Dugan	  ;;
3737e34c20c8SJon Dugan	esac
3738e34c20c8SJon Dugan      fi
3739e34c20c8SJon Dugan    done
37404874c4a8SBruce A. Mah    IFS=$lt_save_ifs
3741e34c20c8SJon Dugan  done
3742ba7b91d2SJef Poskanzer  : ${lt_cv_path_NM=no}
3743e34c20c8SJon Duganfi])
37444874c4a8SBruce A. Mahif test no != "$lt_cv_path_NM"; then
37454874c4a8SBruce A. Mah  NM=$lt_cv_path_NM
3746ba7b91d2SJef Poskanzerelse
3747ba7b91d2SJef Poskanzer  # Didn't find any BSD compatible name lister, look for dumpbin.
37486edfd8d6SBruce A. Mah  if test -n "$DUMPBIN"; then :
37496edfd8d6SBruce A. Mah    # Let the user override the test.
37506edfd8d6SBruce A. Mah  else
37516edfd8d6SBruce A. Mah    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3752*85b25c2eSBruce A. Mah    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
37536edfd8d6SBruce A. Mah    *COFF*)
37544874c4a8SBruce A. Mah      DUMPBIN="$DUMPBIN -symbols -headers"
37556edfd8d6SBruce A. Mah      ;;
37566edfd8d6SBruce A. Mah    *)
37576edfd8d6SBruce A. Mah      DUMPBIN=:
37586edfd8d6SBruce A. Mah      ;;
37596edfd8d6SBruce A. Mah    esac
37606edfd8d6SBruce A. Mah  fi
3761ba7b91d2SJef Poskanzer  AC_SUBST([DUMPBIN])
37624874c4a8SBruce A. Mah  if test : != "$DUMPBIN"; then
37634874c4a8SBruce A. Mah    NM=$DUMPBIN
3764ba7b91d2SJef Poskanzer  fi
3765ba7b91d2SJef Poskanzerfi
3766ba7b91d2SJef Poskanzertest -z "$NM" && NM=nm
3767ba7b91d2SJef PoskanzerAC_SUBST([NM])
3768ba7b91d2SJef Poskanzer_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3769ba7b91d2SJef Poskanzer
3770ba7b91d2SJef PoskanzerAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3771ba7b91d2SJef Poskanzer  [lt_cv_nm_interface="BSD nm"
3772ba7b91d2SJef Poskanzer  echo "int some_variable = 0;" > conftest.$ac_ext
37736edfd8d6SBruce A. Mah  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3774ba7b91d2SJef Poskanzer  (eval "$ac_compile" 2>conftest.err)
3775ba7b91d2SJef Poskanzer  cat conftest.err >&AS_MESSAGE_LOG_FD
37766edfd8d6SBruce A. Mah  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3777ba7b91d2SJef Poskanzer  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3778ba7b91d2SJef Poskanzer  cat conftest.err >&AS_MESSAGE_LOG_FD
37796edfd8d6SBruce A. Mah  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3780ba7b91d2SJef Poskanzer  cat conftest.out >&AS_MESSAGE_LOG_FD
3781ba7b91d2SJef Poskanzer  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3782ba7b91d2SJef Poskanzer    lt_cv_nm_interface="MS dumpbin"
3783ba7b91d2SJef Poskanzer  fi
378460bd98a5SBruce A. Mah  rm -f conftest*])
3785ba7b91d2SJef Poskanzer])# LT_PATH_NM
3786ba7b91d2SJef Poskanzer
3787ba7b91d2SJef Poskanzer# Old names:
3788ba7b91d2SJef PoskanzerAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3789ba7b91d2SJef PoskanzerAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3790ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
3791ba7b91d2SJef Poskanzerdnl AC_DEFUN([AM_PROG_NM], [])
3792ba7b91d2SJef Poskanzerdnl AC_DEFUN([AC_PROG_NM], [])
37932ab386bfSjef
37946edfd8d6SBruce A. Mah# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
37956edfd8d6SBruce A. Mah# --------------------------------
37966edfd8d6SBruce A. Mah# how to determine the name of the shared library
37976edfd8d6SBruce A. Mah# associated with a specific link library.
37986edfd8d6SBruce A. Mah#  -- PORTME fill in with the dynamic library characteristics
37996edfd8d6SBruce A. Mahm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
38006edfd8d6SBruce A. Mah[m4_require([_LT_DECL_EGREP])
38016edfd8d6SBruce A. Mahm4_require([_LT_DECL_OBJDUMP])
38026edfd8d6SBruce A. Mahm4_require([_LT_DECL_DLLTOOL])
38036edfd8d6SBruce A. MahAC_CACHE_CHECK([how to associate runtime and link libraries],
38046edfd8d6SBruce A. Mahlt_cv_sharedlib_from_linklib_cmd,
38056edfd8d6SBruce A. Mah[lt_cv_sharedlib_from_linklib_cmd='unknown'
38066edfd8d6SBruce A. Mah
38076edfd8d6SBruce A. Mahcase $host_os in
38086edfd8d6SBruce A. Mahcygwin* | mingw* | pw32* | cegcc*)
38094874c4a8SBruce A. Mah  # two different shell functions defined in ltmain.sh;
38104874c4a8SBruce A. Mah  # decide which one to use based on capabilities of $DLLTOOL
38116edfd8d6SBruce A. Mah  case `$DLLTOOL --help 2>&1` in
38126edfd8d6SBruce A. Mah  *--identify-strict*)
38136edfd8d6SBruce A. Mah    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
38146edfd8d6SBruce A. Mah    ;;
38156edfd8d6SBruce A. Mah  *)
38166edfd8d6SBruce A. Mah    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
38176edfd8d6SBruce A. Mah    ;;
38186edfd8d6SBruce A. Mah  esac
38196edfd8d6SBruce A. Mah  ;;
38206edfd8d6SBruce A. Mah*)
38216edfd8d6SBruce A. Mah  # fallback: assume linklib IS sharedlib
38224874c4a8SBruce A. Mah  lt_cv_sharedlib_from_linklib_cmd=$ECHO
38236edfd8d6SBruce A. Mah  ;;
38246edfd8d6SBruce A. Mahesac
38256edfd8d6SBruce A. Mah])
38266edfd8d6SBruce A. Mahsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
38276edfd8d6SBruce A. Mahtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
38286edfd8d6SBruce A. Mah
38296edfd8d6SBruce A. Mah_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
38306edfd8d6SBruce A. Mah    [Command to associate shared and link libraries])
38316edfd8d6SBruce A. Mah])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
38326edfd8d6SBruce A. Mah
38336edfd8d6SBruce A. Mah
38346edfd8d6SBruce A. Mah# _LT_PATH_MANIFEST_TOOL
38356edfd8d6SBruce A. Mah# ----------------------
38366edfd8d6SBruce A. Mah# locate the manifest tool
38376edfd8d6SBruce A. Mahm4_defun([_LT_PATH_MANIFEST_TOOL],
38386edfd8d6SBruce A. Mah[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
38396edfd8d6SBruce A. Mahtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
38406edfd8d6SBruce A. MahAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
38416edfd8d6SBruce A. Mah  [lt_cv_path_mainfest_tool=no
38426edfd8d6SBruce A. Mah  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
38436edfd8d6SBruce A. Mah  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
38446edfd8d6SBruce A. Mah  cat conftest.err >&AS_MESSAGE_LOG_FD
38456edfd8d6SBruce A. Mah  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
38466edfd8d6SBruce A. Mah    lt_cv_path_mainfest_tool=yes
38476edfd8d6SBruce A. Mah  fi
38486edfd8d6SBruce A. Mah  rm -f conftest*])
38494874c4a8SBruce A. Mahif test yes != "$lt_cv_path_mainfest_tool"; then
38506edfd8d6SBruce A. Mah  MANIFEST_TOOL=:
38516edfd8d6SBruce A. Mahfi
38526edfd8d6SBruce A. Mah_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
38536edfd8d6SBruce A. Mah])# _LT_PATH_MANIFEST_TOOL
38546edfd8d6SBruce A. Mah
38552ab386bfSjef
38564874c4a8SBruce A. Mah# _LT_DLL_DEF_P([FILE])
38574874c4a8SBruce A. Mah# ---------------------
38584874c4a8SBruce A. Mah# True iff FILE is a Windows DLL '.def' file.
38594874c4a8SBruce A. Mah# Keep in sync with func_dll_def_p in the libtool script
38604874c4a8SBruce A. MahAC_DEFUN([_LT_DLL_DEF_P],
38614874c4a8SBruce A. Mah[dnl
38624874c4a8SBruce A. Mah  test DEF = "`$SED -n dnl
38634874c4a8SBruce A. Mah    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
38644874c4a8SBruce A. Mah    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
38654874c4a8SBruce A. Mah    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
38664874c4a8SBruce A. Mah    -e q dnl                          Only consider the first "real" line
38674874c4a8SBruce A. Mah    $1`" dnl
38684874c4a8SBruce A. Mah])# _LT_DLL_DEF_P
38694874c4a8SBruce A. Mah
38704874c4a8SBruce A. Mah
3871ba7b91d2SJef Poskanzer# LT_LIB_M
3872ba7b91d2SJef Poskanzer# --------
3873e34c20c8SJon Dugan# check for math library
3874ba7b91d2SJef PoskanzerAC_DEFUN([LT_LIB_M],
3875e34c20c8SJon Dugan[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3876e34c20c8SJon DuganLIBM=
3877e34c20c8SJon Dugancase $host in
38786edfd8d6SBruce A. Mah*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3879e34c20c8SJon Dugan  # These system don't have libm, or don't need it
3880e34c20c8SJon Dugan  ;;
3881e34c20c8SJon Dugan*-ncr-sysv4.3*)
38824874c4a8SBruce A. Mah  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
3883e34c20c8SJon Dugan  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3884e34c20c8SJon Dugan  ;;
3885e34c20c8SJon Dugan*)
38864874c4a8SBruce A. Mah  AC_CHECK_LIB(m, cos, LIBM=-lm)
3887e34c20c8SJon Dugan  ;;
3888e34c20c8SJon Duganesac
3889ba7b91d2SJef PoskanzerAC_SUBST([LIBM])
3890ba7b91d2SJef Poskanzer])# LT_LIB_M
3891e34c20c8SJon Dugan
3892ba7b91d2SJef Poskanzer# Old name:
3893ba7b91d2SJef PoskanzerAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3894ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
3895ba7b91d2SJef Poskanzerdnl AC_DEFUN([AC_CHECK_LIBM], [])
3896e34c20c8SJon Dugan
3897e34c20c8SJon Dugan
3898ba7b91d2SJef Poskanzer# _LT_COMPILER_NO_RTTI([TAGNAME])
3899ba7b91d2SJef Poskanzer# -------------------------------
3900ba7b91d2SJef Poskanzerm4_defun([_LT_COMPILER_NO_RTTI],
3901ba7b91d2SJef Poskanzer[m4_require([_LT_TAG_COMPILER])dnl
3902e34c20c8SJon Dugan
3903ba7b91d2SJef Poskanzer_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
390456a97f93Sjef
39054874c4a8SBruce A. Mahif test yes = "$GCC"; then
39066edfd8d6SBruce A. Mah  case $cc_basename in
39076edfd8d6SBruce A. Mah  nvcc*)
39086edfd8d6SBruce A. Mah    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
39096edfd8d6SBruce A. Mah  *)
39106edfd8d6SBruce A. Mah    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
39116edfd8d6SBruce A. Mah  esac
391256a97f93Sjef
3913ba7b91d2SJef Poskanzer  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3914e34c20c8SJon Dugan    lt_cv_prog_compiler_rtti_exceptions,
3915e34c20c8SJon Dugan    [-fno-rtti -fno-exceptions], [],
3916ba7b91d2SJef Poskanzer    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3917e34c20c8SJon Duganfi
3918ba7b91d2SJef Poskanzer_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3919ba7b91d2SJef Poskanzer	[Compiler flag to turn off builtin functions])
3920ba7b91d2SJef Poskanzer])# _LT_COMPILER_NO_RTTI
3921e34c20c8SJon Dugan
3922e34c20c8SJon Dugan
3923ba7b91d2SJef Poskanzer# _LT_CMD_GLOBAL_SYMBOLS
3924ba7b91d2SJef Poskanzer# ----------------------
3925ba7b91d2SJef Poskanzerm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3926ba7b91d2SJef Poskanzer[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3927ba7b91d2SJef PoskanzerAC_REQUIRE([AC_PROG_CC])dnl
39286edfd8d6SBruce A. MahAC_REQUIRE([AC_PROG_AWK])dnl
3929ba7b91d2SJef PoskanzerAC_REQUIRE([LT_PATH_NM])dnl
3930ba7b91d2SJef PoskanzerAC_REQUIRE([LT_PATH_LD])dnl
3931ba7b91d2SJef Poskanzerm4_require([_LT_DECL_SED])dnl
3932ba7b91d2SJef Poskanzerm4_require([_LT_DECL_EGREP])dnl
3933ba7b91d2SJef Poskanzerm4_require([_LT_TAG_COMPILER])dnl
3934ba7b91d2SJef Poskanzer
3935e34c20c8SJon Dugan# Check for command to grab the raw symbol name followed by C symbol from nm.
3936e34c20c8SJon DuganAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3937e34c20c8SJon DuganAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3938e34c20c8SJon Dugan[
3939e34c20c8SJon Dugan# These are sane defaults that work on at least a few old systems.
3940e34c20c8SJon Dugan# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3941e34c20c8SJon Dugan
3942e34c20c8SJon Dugan# Character class describing NM global symbol codes.
3943e34c20c8SJon Dugansymcode='[[BCDEGRST]]'
3944e34c20c8SJon Dugan
3945e34c20c8SJon Dugan# Regexp to match symbols that can be accessed directly from C.
3946e34c20c8SJon Dugansympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3947e34c20c8SJon Dugan
3948e34c20c8SJon Dugan# Define system-specific variables.
3949e34c20c8SJon Dugancase $host_os in
3950e34c20c8SJon Duganaix*)
3951e34c20c8SJon Dugan  symcode='[[BCDT]]'
3952e34c20c8SJon Dugan  ;;
395360bd98a5SBruce A. Mahcygwin* | mingw* | pw32* | cegcc*)
3954e34c20c8SJon Dugan  symcode='[[ABCDGISTW]]'
3955e34c20c8SJon Dugan  ;;
3956ba7b91d2SJef Poskanzerhpux*)
39574874c4a8SBruce A. Mah  if test ia64 = "$host_cpu"; then
3958e34c20c8SJon Dugan    symcode='[[ABCDEGRST]]'
3959e34c20c8SJon Dugan  fi
3960e34c20c8SJon Dugan  ;;
3961e34c20c8SJon Duganirix* | nonstopux*)
3962e34c20c8SJon Dugan  symcode='[[BCDEGRST]]'
3963e34c20c8SJon Dugan  ;;
3964e34c20c8SJon Duganosf*)
3965e34c20c8SJon Dugan  symcode='[[BCDEGQRST]]'
3966e34c20c8SJon Dugan  ;;
3967e34c20c8SJon Dugansolaris*)
3968e34c20c8SJon Dugan  symcode='[[BDRT]]'
3969e34c20c8SJon Dugan  ;;
3970e34c20c8SJon Dugansco3.2v5*)
3971e34c20c8SJon Dugan  symcode='[[DT]]'
3972e34c20c8SJon Dugan  ;;
3973e34c20c8SJon Dugansysv4.2uw2*)
3974e34c20c8SJon Dugan  symcode='[[DT]]'
3975e34c20c8SJon Dugan  ;;
3976e34c20c8SJon Dugansysv5* | sco5v6* | unixware* | OpenUNIX*)
3977e34c20c8SJon Dugan  symcode='[[ABDT]]'
3978e34c20c8SJon Dugan  ;;
3979e34c20c8SJon Dugansysv4)
3980e34c20c8SJon Dugan  symcode='[[DFNSTU]]'
3981e34c20c8SJon Dugan  ;;
3982e34c20c8SJon Duganesac
3983e34c20c8SJon Dugan
3984e34c20c8SJon Dugan# If we're using GNU nm, then use its standard symbol codes.
3985e34c20c8SJon Dugancase `$NM -V 2>&1` in
3986e34c20c8SJon Dugan*GNU* | *'with BFD'*)
3987e34c20c8SJon Dugan  symcode='[[ABCDGIRSTW]]' ;;
3988e34c20c8SJon Duganesac
3989e34c20c8SJon Dugan
39904874c4a8SBruce A. Mahif test "$lt_cv_nm_interface" = "MS dumpbin"; then
39914874c4a8SBruce A. Mah  # Gets list of data symbols to import.
3992*85b25c2eSBruce A. Mah  lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
39934874c4a8SBruce A. Mah  # Adjust the below global symbol transforms to fixup imported variables.
39944874c4a8SBruce A. Mah  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
39954874c4a8SBruce A. Mah  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
39964874c4a8SBruce A. Mah  lt_c_name_lib_hook="\
39974874c4a8SBruce A. Mah  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
39984874c4a8SBruce A. Mah  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
39994874c4a8SBruce A. Mahelse
40004874c4a8SBruce A. Mah  # Disable hooks by default.
40014874c4a8SBruce A. Mah  lt_cv_sys_global_symbol_to_import=
40024874c4a8SBruce A. Mah  lt_cdecl_hook=
40034874c4a8SBruce A. Mah  lt_c_name_hook=
40044874c4a8SBruce A. Mah  lt_c_name_lib_hook=
40054874c4a8SBruce A. Mahfi
40064874c4a8SBruce A. Mah
4007ba7b91d2SJef Poskanzer# Transform an extracted symbol line into a proper C declaration.
4008ba7b91d2SJef Poskanzer# Some systems (esp. on ia64) link data and code symbols differently,
4009ba7b91d2SJef Poskanzer# so use this general approach.
4010*85b25c2eSBruce A. Mahlt_cv_sys_global_symbol_to_cdecl="$SED -n"\
40114874c4a8SBruce A. Mah$lt_cdecl_hook\
40124874c4a8SBruce A. Mah" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
40134874c4a8SBruce A. Mah" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
4014ba7b91d2SJef Poskanzer
4015ba7b91d2SJef Poskanzer# Transform an extracted symbol line into symbol name and symbol address
4016*85b25c2eSBruce A. Mahlt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
40174874c4a8SBruce A. Mah$lt_c_name_hook\
40184874c4a8SBruce A. Mah" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
40194874c4a8SBruce A. Mah" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
40204874c4a8SBruce A. Mah
40214874c4a8SBruce A. Mah# Transform an extracted symbol line into symbol name with lib prefix and
40224874c4a8SBruce A. Mah# symbol address.
4023*85b25c2eSBruce A. Mahlt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
40244874c4a8SBruce A. Mah$lt_c_name_lib_hook\
40254874c4a8SBruce A. Mah" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
40264874c4a8SBruce A. Mah" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
40274874c4a8SBruce A. Mah" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
4028ba7b91d2SJef Poskanzer
4029ba7b91d2SJef Poskanzer# Handle CRLF in mingw tool chain
4030ba7b91d2SJef Poskanzeropt_cr=
4031ba7b91d2SJef Poskanzercase $build_os in
4032ba7b91d2SJef Poskanzermingw*)
4033ba7b91d2SJef Poskanzer  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4034ba7b91d2SJef Poskanzer  ;;
4035ba7b91d2SJef Poskanzeresac
4036ba7b91d2SJef Poskanzer
4037ba7b91d2SJef Poskanzer# Try without a prefix underscore, then with it.
4038e34c20c8SJon Duganfor ac_symprfx in "" "_"; do
4039e34c20c8SJon Dugan
4040e34c20c8SJon Dugan  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4041e34c20c8SJon Dugan  symxfrm="\\1 $ac_symprfx\\2 \\2"
4042e34c20c8SJon Dugan
4043e34c20c8SJon Dugan  # Write the raw and C identifiers.
4044ba7b91d2SJef Poskanzer  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
40454874c4a8SBruce A. Mah    # Fake it for dumpbin and say T for any non-static function,
40464874c4a8SBruce A. Mah    # D for any global variable and I for any imported variable.
4047*85b25c2eSBruce A. Mah    # Also find C++ and __fastcall symbols from MSVC++ or ICC,
4048ba7b91d2SJef Poskanzer    # which start with @ or ?.
4049ba7b91d2SJef Poskanzer    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4050ba7b91d2SJef Poskanzer"     {last_section=section; section=\$ 3};"\
40516edfd8d6SBruce A. Mah"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4052ba7b91d2SJef Poskanzer"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
40534874c4a8SBruce A. Mah"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
40544874c4a8SBruce A. Mah"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
40554874c4a8SBruce A. Mah"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
4056ba7b91d2SJef Poskanzer"     \$ 0!~/External *\|/{next};"\
4057ba7b91d2SJef Poskanzer"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4058ba7b91d2SJef Poskanzer"     {if(hide[section]) next};"\
40594874c4a8SBruce A. Mah"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
4060ba7b91d2SJef Poskanzer"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
40614874c4a8SBruce A. Mah"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
40624874c4a8SBruce A. Mah"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
4063ba7b91d2SJef Poskanzer"     ' prfx=^$ac_symprfx]"
4064ba7b91d2SJef Poskanzer  else
4065*85b25c2eSBruce A. Mah    lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4066ba7b91d2SJef Poskanzer  fi
4067*85b25c2eSBruce A. Mah  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
4068e34c20c8SJon Dugan
4069e34c20c8SJon Dugan  # Check to see that the pipe works correctly.
4070e34c20c8SJon Dugan  pipe_works=no
4071e34c20c8SJon Dugan
407260bd98a5SBruce A. Mah  rm -f conftest*
4073ba7b91d2SJef Poskanzer  cat > conftest.$ac_ext <<_LT_EOF
4074e34c20c8SJon Dugan#ifdef __cplusplus
4075e34c20c8SJon Duganextern "C" {
4076e34c20c8SJon Dugan#endif
4077e34c20c8SJon Duganchar nm_test_var;
4078ba7b91d2SJef Poskanzervoid nm_test_func(void);
4079ba7b91d2SJef Poskanzervoid nm_test_func(void){}
4080e34c20c8SJon Dugan#ifdef __cplusplus
4081e34c20c8SJon Dugan}
4082e34c20c8SJon Dugan#endif
4083e34c20c8SJon Duganint main(){nm_test_var='a';nm_test_func();return(0);}
4084ba7b91d2SJef Poskanzer_LT_EOF
4085e34c20c8SJon Dugan
4086e34c20c8SJon Dugan  if AC_TRY_EVAL(ac_compile); then
4087e34c20c8SJon Dugan    # Now try to grab the symbols.
4088e34c20c8SJon Dugan    nlist=conftest.nm
40896edfd8d6SBruce A. Mah    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4090e34c20c8SJon Dugan      # Try sorting and uniquifying the output.
4091e34c20c8SJon Dugan      if sort "$nlist" | uniq > "$nlist"T; then
4092e34c20c8SJon Dugan	mv -f "$nlist"T "$nlist"
4093e34c20c8SJon Dugan      else
4094e34c20c8SJon Dugan	rm -f "$nlist"T
4095e34c20c8SJon Dugan      fi
4096e34c20c8SJon Dugan
4097e34c20c8SJon Dugan      # Make sure that we snagged all the symbols we need.
4098ba7b91d2SJef Poskanzer      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4099ba7b91d2SJef Poskanzer	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4100ba7b91d2SJef Poskanzer	  cat <<_LT_EOF > conftest.$ac_ext
41016edfd8d6SBruce A. Mah/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
41024874c4a8SBruce A. Mah#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
41034874c4a8SBruce A. Mah/* DATA imports from DLLs on WIN32 can't be const, because runtime
41046edfd8d6SBruce A. Mah   relocations are performed -- see ld's documentation on pseudo-relocs.  */
41056edfd8d6SBruce A. Mah# define LT@&t@_DLSYM_CONST
41064874c4a8SBruce A. Mah#elif defined __osf__
41076edfd8d6SBruce A. Mah/* This system does not cope well with relocations in const data.  */
41086edfd8d6SBruce A. Mah# define LT@&t@_DLSYM_CONST
41096edfd8d6SBruce A. Mah#else
41106edfd8d6SBruce A. Mah# define LT@&t@_DLSYM_CONST const
41116edfd8d6SBruce A. Mah#endif
41126edfd8d6SBruce A. Mah
4113e34c20c8SJon Dugan#ifdef __cplusplus
4114e34c20c8SJon Duganextern "C" {
4115e34c20c8SJon Dugan#endif
4116e34c20c8SJon Dugan
4117ba7b91d2SJef Poskanzer_LT_EOF
4118e34c20c8SJon Dugan	  # Now generate the symbol file.
4119ba7b91d2SJef Poskanzer	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4120e34c20c8SJon Dugan
4121ba7b91d2SJef Poskanzer	  cat <<_LT_EOF >> conftest.$ac_ext
4122e34c20c8SJon Dugan
4123e34c20c8SJon Dugan/* The mapping between symbol names and symbols.  */
41246edfd8d6SBruce A. MahLT@&t@_DLSYM_CONST struct {
4125e34c20c8SJon Dugan  const char *name;
4126ba7b91d2SJef Poskanzer  void       *address;
4127e34c20c8SJon Dugan}
4128ba7b91d2SJef Poskanzerlt__PROGRAM__LTX_preloaded_symbols[[]] =
4129e34c20c8SJon Dugan{
4130ba7b91d2SJef Poskanzer  { "@PROGRAM@", (void *) 0 },
4131ba7b91d2SJef Poskanzer_LT_EOF
41324874c4a8SBruce A. Mah	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4133ba7b91d2SJef Poskanzer	  cat <<\_LT_EOF >> conftest.$ac_ext
4134ba7b91d2SJef Poskanzer  {0, (void *) 0}
4135e34c20c8SJon Dugan};
4136e34c20c8SJon Dugan
4137ba7b91d2SJef Poskanzer/* This works around a problem in FreeBSD linker */
4138ba7b91d2SJef Poskanzer#ifdef FREEBSD_WORKAROUND
4139ba7b91d2SJef Poskanzerstatic const void *lt_preloaded_setup() {
4140ba7b91d2SJef Poskanzer  return lt__PROGRAM__LTX_preloaded_symbols;
4141ba7b91d2SJef Poskanzer}
4142ba7b91d2SJef Poskanzer#endif
4143ba7b91d2SJef Poskanzer
4144e34c20c8SJon Dugan#ifdef __cplusplus
4145e34c20c8SJon Dugan}
4146e34c20c8SJon Dugan#endif
4147ba7b91d2SJef Poskanzer_LT_EOF
4148e34c20c8SJon Dugan	  # Now try linking the two files.
4149e34c20c8SJon Dugan	  mv conftest.$ac_objext conftstm.$ac_objext
41506edfd8d6SBruce A. Mah	  lt_globsym_save_LIBS=$LIBS
41516edfd8d6SBruce A. Mah	  lt_globsym_save_CFLAGS=$CFLAGS
41524874c4a8SBruce A. Mah	  LIBS=conftstm.$ac_objext
4153ba7b91d2SJef Poskanzer	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
41544874c4a8SBruce A. Mah	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
4155e34c20c8SJon Dugan	    pipe_works=yes
4156e34c20c8SJon Dugan	  fi
41576edfd8d6SBruce A. Mah	  LIBS=$lt_globsym_save_LIBS
41586edfd8d6SBruce A. Mah	  CFLAGS=$lt_globsym_save_CFLAGS
4159e34c20c8SJon Dugan	else
4160e34c20c8SJon Dugan	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4161e34c20c8SJon Dugan	fi
4162e34c20c8SJon Dugan      else
4163e34c20c8SJon Dugan	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4164e34c20c8SJon Dugan      fi
4165e34c20c8SJon Dugan    else
4166e34c20c8SJon Dugan      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4167e34c20c8SJon Dugan    fi
4168e34c20c8SJon Dugan  else
4169e34c20c8SJon Dugan    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4170e34c20c8SJon Dugan    cat conftest.$ac_ext >&5
4171e34c20c8SJon Dugan  fi
4172ba7b91d2SJef Poskanzer  rm -rf conftest* conftst*
4173e34c20c8SJon Dugan
4174e34c20c8SJon Dugan  # Do not use the global_symbol_pipe unless it works.
41754874c4a8SBruce A. Mah  if test yes = "$pipe_works"; then
4176e34c20c8SJon Dugan    break
4177e34c20c8SJon Dugan  else
4178e34c20c8SJon Dugan    lt_cv_sys_global_symbol_pipe=
4179e34c20c8SJon Dugan  fi
4180e34c20c8SJon Dugandone
4181e34c20c8SJon Dugan])
4182e34c20c8SJon Duganif test -z "$lt_cv_sys_global_symbol_pipe"; then
4183e34c20c8SJon Dugan  lt_cv_sys_global_symbol_to_cdecl=
4184e34c20c8SJon Duganfi
4185e34c20c8SJon Duganif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4186e34c20c8SJon Dugan  AC_MSG_RESULT(failed)
4187e34c20c8SJon Duganelse
4188e34c20c8SJon Dugan  AC_MSG_RESULT(ok)
4189e34c20c8SJon Duganfi
4190ba7b91d2SJef Poskanzer
41916edfd8d6SBruce A. Mah# Response file support.
41926edfd8d6SBruce A. Mahif test "$lt_cv_nm_interface" = "MS dumpbin"; then
41936edfd8d6SBruce A. Mah  nm_file_list_spec='@'
41946edfd8d6SBruce A. Mahelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
41956edfd8d6SBruce A. Mah  nm_file_list_spec='@'
41966edfd8d6SBruce A. Mahfi
41976edfd8d6SBruce A. Mah
4198ba7b91d2SJef Poskanzer_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4199ba7b91d2SJef Poskanzer    [Take the output of nm and produce a listing of raw symbols and C names])
4200ba7b91d2SJef Poskanzer_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4201ba7b91d2SJef Poskanzer    [Transform the output of nm in a proper C declaration])
42024874c4a8SBruce A. Mah_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
42034874c4a8SBruce A. Mah    [Transform the output of nm into a list of symbols to manually relocate])
4204ba7b91d2SJef Poskanzer_LT_DECL([global_symbol_to_c_name_address],
4205ba7b91d2SJef Poskanzer    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4206ba7b91d2SJef Poskanzer    [Transform the output of nm in a C name address pair])
4207ba7b91d2SJef Poskanzer_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4208ba7b91d2SJef Poskanzer    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4209ba7b91d2SJef Poskanzer    [Transform the output of nm in a C name address pair when lib prefix is needed])
42104874c4a8SBruce A. Mah_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
42114874c4a8SBruce A. Mah    [The name lister interface])
42126edfd8d6SBruce A. Mah_LT_DECL([], [nm_file_list_spec], [1],
42136edfd8d6SBruce A. Mah    [Specify filename containing input files for $NM])
4214ba7b91d2SJef Poskanzer]) # _LT_CMD_GLOBAL_SYMBOLS
4215e34c20c8SJon Dugan
4216e34c20c8SJon Dugan
4217ba7b91d2SJef Poskanzer# _LT_COMPILER_PIC([TAGNAME])
4218ba7b91d2SJef Poskanzer# ---------------------------
4219ba7b91d2SJef Poskanzerm4_defun([_LT_COMPILER_PIC],
4220ba7b91d2SJef Poskanzer[m4_require([_LT_TAG_COMPILER])dnl
4221ba7b91d2SJef Poskanzer_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4222ba7b91d2SJef Poskanzer_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4223ba7b91d2SJef Poskanzer_LT_TAGVAR(lt_prog_compiler_static, $1)=
4224e34c20c8SJon Dugan
4225ba7b91d2SJef Poskanzerm4_if([$1], [CXX], [
4226e34c20c8SJon Dugan  # C++ specific cases for pic, static, wl, etc.
42274874c4a8SBruce A. Mah  if test yes = "$GXX"; then
4228ba7b91d2SJef Poskanzer    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4229ba7b91d2SJef Poskanzer    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4230e34c20c8SJon Dugan
4231e34c20c8SJon Dugan    case $host_os in
4232e34c20c8SJon Dugan    aix*)
4233e34c20c8SJon Dugan      # All AIX code is PIC.
42344874c4a8SBruce A. Mah      if test ia64 = "$host_cpu"; then
4235e34c20c8SJon Dugan	# AIX 5 now supports IA64 processor
4236ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4237e34c20c8SJon Dugan      fi
42384874c4a8SBruce A. Mah      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4239e34c20c8SJon Dugan      ;;
4240ba7b91d2SJef Poskanzer
4241e34c20c8SJon Dugan    amigaos*)
4242ba7b91d2SJef Poskanzer      case $host_cpu in
4243ba7b91d2SJef Poskanzer      powerpc)
4244ba7b91d2SJef Poskanzer            # see comment about AmigaOS4 .so support
4245ba7b91d2SJef Poskanzer            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4246ba7b91d2SJef Poskanzer        ;;
4247ba7b91d2SJef Poskanzer      m68k)
4248e34c20c8SJon Dugan            # FIXME: we need at least 68020 code to build shared libraries, but
42494874c4a8SBruce A. Mah            # adding the '-m68020' flag to GCC prevents building anything better,
42504874c4a8SBruce A. Mah            # like '-m68040'.
4251ba7b91d2SJef Poskanzer            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4252e34c20c8SJon Dugan        ;;
4253ba7b91d2SJef Poskanzer      esac
4254ba7b91d2SJef Poskanzer      ;;
4255ba7b91d2SJef Poskanzer
4256ba7b91d2SJef Poskanzer    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4257e34c20c8SJon Dugan      # PIC is the default for these OSes.
4258e34c20c8SJon Dugan      ;;
425960bd98a5SBruce A. Mah    mingw* | cygwin* | os2* | pw32* | cegcc*)
4260e34c20c8SJon Dugan      # This hack is so that the source file can tell whether it is being
4261e34c20c8SJon Dugan      # built for inclusion in a dll (and should export symbols for example).
4262ba7b91d2SJef Poskanzer      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4263ba7b91d2SJef Poskanzer      # (--disable-auto-import) libraries
4264ba7b91d2SJef Poskanzer      m4_if([$1], [GCJ], [],
4265ba7b91d2SJef Poskanzer	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
42664874c4a8SBruce A. Mah      case $host_os in
42674874c4a8SBruce A. Mah      os2*)
42684874c4a8SBruce A. Mah	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
42694874c4a8SBruce A. Mah	;;
42704874c4a8SBruce A. Mah      esac
4271e34c20c8SJon Dugan      ;;
4272e34c20c8SJon Dugan    darwin* | rhapsody*)
4273e34c20c8SJon Dugan      # PIC is the default on this platform
4274e34c20c8SJon Dugan      # Common symbols not allowed in MH_DYLIB files
4275ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4276e34c20c8SJon Dugan      ;;
4277e34c20c8SJon Dugan    *djgpp*)
4278e34c20c8SJon Dugan      # DJGPP does not support shared libraries at all
4279ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4280e34c20c8SJon Dugan      ;;
42816edfd8d6SBruce A. Mah    haiku*)
42826edfd8d6SBruce A. Mah      # PIC is the default for Haiku.
42836edfd8d6SBruce A. Mah      # The "-static" flag exists, but is broken.
42846edfd8d6SBruce A. Mah      _LT_TAGVAR(lt_prog_compiler_static, $1)=
42856edfd8d6SBruce A. Mah      ;;
4286ba7b91d2SJef Poskanzer    interix[[3-9]]*)
4287e34c20c8SJon Dugan      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4288e34c20c8SJon Dugan      # Instead, we relocate shared libraries at runtime.
4289e34c20c8SJon Dugan      ;;
4290e34c20c8SJon Dugan    sysv4*MP*)
4291e34c20c8SJon Dugan      if test -d /usr/nec; then
4292ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4293e34c20c8SJon Dugan      fi
4294e34c20c8SJon Dugan      ;;
4295e34c20c8SJon Dugan    hpux*)
429660bd98a5SBruce A. Mah      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
429760bd98a5SBruce A. Mah      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
429860bd98a5SBruce A. Mah      # sets the default TLS model and affects inlining.
4299e34c20c8SJon Dugan      case $host_cpu in
430060bd98a5SBruce A. Mah      hppa*64*)
4301e34c20c8SJon Dugan	;;
4302e34c20c8SJon Dugan      *)
4303ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4304e34c20c8SJon Dugan	;;
4305e34c20c8SJon Dugan      esac
4306e34c20c8SJon Dugan      ;;
4307ba7b91d2SJef Poskanzer    *qnx* | *nto*)
4308ba7b91d2SJef Poskanzer      # QNX uses GNU C++, but need to define -shared option too, otherwise
4309ba7b91d2SJef Poskanzer      # it will coredump.
4310ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4311ba7b91d2SJef Poskanzer      ;;
4312e34c20c8SJon Dugan    *)
4313ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4314e34c20c8SJon Dugan      ;;
4315e34c20c8SJon Dugan    esac
4316e34c20c8SJon Dugan  else
4317e34c20c8SJon Dugan    case $host_os in
4318ba7b91d2SJef Poskanzer      aix[[4-9]]*)
4319e34c20c8SJon Dugan	# All AIX code is PIC.
43204874c4a8SBruce A. Mah	if test ia64 = "$host_cpu"; then
4321e34c20c8SJon Dugan	  # AIX 5 now supports IA64 processor
4322ba7b91d2SJef Poskanzer	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4323e34c20c8SJon Dugan	else
4324ba7b91d2SJef Poskanzer	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4325e34c20c8SJon Dugan	fi
4326e34c20c8SJon Dugan	;;
4327e34c20c8SJon Dugan      chorus*)
4328e34c20c8SJon Dugan	case $cc_basename in
4329e34c20c8SJon Dugan	cxch68*)
4330e34c20c8SJon Dugan	  # Green Hills C++ Compiler
4331ba7b91d2SJef Poskanzer	  # _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"
433256a97f93Sjef	  ;;
433356a97f93Sjef	esac
43342ab386bfSjef	;;
43356edfd8d6SBruce A. Mah      mingw* | cygwin* | os2* | pw32* | cegcc*)
43366edfd8d6SBruce A. Mah	# This hack is so that the source file can tell whether it is being
43376edfd8d6SBruce A. Mah	# built for inclusion in a dll (and should export symbols for example).
43386edfd8d6SBruce A. Mah	m4_if([$1], [GCJ], [],
43396edfd8d6SBruce A. Mah	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
43406edfd8d6SBruce A. Mah	;;
4341e34c20c8SJon Dugan      dgux*)
4342e34c20c8SJon Dugan	case $cc_basename in
4343e34c20c8SJon Dugan	  ec++*)
4344ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4345e34c20c8SJon Dugan	    ;;
4346e34c20c8SJon Dugan	  ghcx*)
4347e34c20c8SJon Dugan	    # Green Hills C++ Compiler
4348ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4349e34c20c8SJon Dugan	    ;;
4350e34c20c8SJon Dugan	  *)
4351e34c20c8SJon Dugan	    ;;
4352e34c20c8SJon Dugan	esac
4353e34c20c8SJon Dugan	;;
4354*85b25c2eSBruce A. Mah      freebsd* | dragonfly* | midnightbsd*)
4355e34c20c8SJon Dugan	# FreeBSD uses GNU C++
4356e34c20c8SJon Dugan	;;
4357e34c20c8SJon Dugan      hpux9* | hpux10* | hpux11*)
4358e34c20c8SJon Dugan	case $cc_basename in
4359e34c20c8SJon Dugan	  CC*)
4360ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43614874c4a8SBruce A. Mah	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
43624874c4a8SBruce A. Mah	    if test ia64 != "$host_cpu"; then
4363ba7b91d2SJef Poskanzer	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4364e34c20c8SJon Dugan	    fi
4365e34c20c8SJon Dugan	    ;;
4366e34c20c8SJon Dugan	  aCC*)
4367ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43684874c4a8SBruce A. Mah	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4369e34c20c8SJon Dugan	    case $host_cpu in
4370e34c20c8SJon Dugan	    hppa*64*|ia64*)
4371e34c20c8SJon Dugan	      # +Z the default
4372e34c20c8SJon Dugan	      ;;
4373e34c20c8SJon Dugan	    *)
4374ba7b91d2SJef Poskanzer	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4375e34c20c8SJon Dugan	      ;;
4376e34c20c8SJon Dugan	    esac
4377e34c20c8SJon Dugan	    ;;
4378e34c20c8SJon Dugan	  *)
4379e34c20c8SJon Dugan	    ;;
4380e34c20c8SJon Dugan	esac
4381e34c20c8SJon Dugan	;;
4382e34c20c8SJon Dugan      interix*)
4383e34c20c8SJon Dugan	# This is c89, which is MS Visual C++ (no shared libs)
4384e34c20c8SJon Dugan	# Anyone wants to do a port?
4385e34c20c8SJon Dugan	;;
4386e34c20c8SJon Dugan      irix5* | irix6* | nonstopux*)
4387e34c20c8SJon Dugan	case $cc_basename in
4388e34c20c8SJon Dugan	  CC*)
4389ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4390ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4391e34c20c8SJon Dugan	    # CC pic flag -KPIC is the default.
4392e34c20c8SJon Dugan	    ;;
4393e34c20c8SJon Dugan	  *)
4394e34c20c8SJon Dugan	    ;;
4395e34c20c8SJon Dugan	esac
4396e34c20c8SJon Dugan	;;
43974874c4a8SBruce A. Mah      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4398e34c20c8SJon Dugan	case $cc_basename in
4399e34c20c8SJon Dugan	  KCC*)
4400e34c20c8SJon Dugan	    # KAI C++ Compiler
4401ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4402ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4403e34c20c8SJon Dugan	    ;;
440460bd98a5SBruce A. Mah	  ecpc* )
44054874c4a8SBruce A. Mah	    # old Intel C++ for x86_64, which still supported -KPIC.
4406ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4407ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4408ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4409e34c20c8SJon Dugan	    ;;
441060bd98a5SBruce A. Mah	  icpc* )
441160bd98a5SBruce A. Mah	    # Intel C++, used to be incompatible with GCC.
441260bd98a5SBruce A. Mah	    # ICC 10 doesn't accept -KPIC any more.
441360bd98a5SBruce A. Mah	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
441460bd98a5SBruce A. Mah	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
441560bd98a5SBruce A. Mah	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
441660bd98a5SBruce A. Mah	    ;;
4417ba7b91d2SJef Poskanzer	  pgCC* | pgcpp*)
4418ba7b91d2SJef Poskanzer	    # Portland Group C++ compiler
4419ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4420ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4421ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4422e34c20c8SJon Dugan	    ;;
4423e34c20c8SJon Dugan	  cxx*)
4424e34c20c8SJon Dugan	    # Compaq C++
4425e34c20c8SJon Dugan	    # Make sure the PIC flag is empty.  It appears that all Alpha
4426e34c20c8SJon Dugan	    # Linux and Compaq Tru64 Unix objects are PIC.
4427ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4428ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4429ba7b91d2SJef Poskanzer	    ;;
44306edfd8d6SBruce A. Mah	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
44316edfd8d6SBruce A. Mah	    # IBM XL 8.0, 9.0 on PPC and BlueGene
4432ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4433ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4434ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4435e34c20c8SJon Dugan	    ;;
4436e34c20c8SJon Dugan	  *)
4437*85b25c2eSBruce A. Mah	    case `$CC -V 2>&1 | $SED 5q` in
4438ba7b91d2SJef Poskanzer	    *Sun\ C*)
4439ba7b91d2SJef Poskanzer	      # Sun C++ 5.9
4440ba7b91d2SJef Poskanzer	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4441ba7b91d2SJef Poskanzer	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4442ba7b91d2SJef Poskanzer	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4443ba7b91d2SJef Poskanzer	      ;;
4444ba7b91d2SJef Poskanzer	    esac
4445e34c20c8SJon Dugan	    ;;
4446e34c20c8SJon Dugan	esac
4447e34c20c8SJon Dugan	;;
4448e34c20c8SJon Dugan      lynxos*)
4449e34c20c8SJon Dugan	;;
4450e34c20c8SJon Dugan      m88k*)
4451e34c20c8SJon Dugan	;;
4452e34c20c8SJon Dugan      mvs*)
4453e34c20c8SJon Dugan	case $cc_basename in
4454e34c20c8SJon Dugan	  cxx*)
4455ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4456e34c20c8SJon Dugan	    ;;
4457e34c20c8SJon Dugan	  *)
4458e34c20c8SJon Dugan	    ;;
4459e34c20c8SJon Dugan	esac
4460e34c20c8SJon Dugan	;;
4461e34c20c8SJon Dugan      netbsd*)
4462e34c20c8SJon Dugan	;;
4463ba7b91d2SJef Poskanzer      *qnx* | *nto*)
4464ba7b91d2SJef Poskanzer        # QNX uses GNU C++, but need to define -shared option too, otherwise
4465ba7b91d2SJef Poskanzer        # it will coredump.
4466ba7b91d2SJef Poskanzer        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4467ba7b91d2SJef Poskanzer        ;;
4468e34c20c8SJon Dugan      osf3* | osf4* | osf5*)
4469e34c20c8SJon Dugan	case $cc_basename in
4470e34c20c8SJon Dugan	  KCC*)
4471ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4472e34c20c8SJon Dugan	    ;;
4473e34c20c8SJon Dugan	  RCC*)
4474e34c20c8SJon Dugan	    # Rational C++ 2.4.1
4475ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4476e34c20c8SJon Dugan	    ;;
4477e34c20c8SJon Dugan	  cxx*)
4478e34c20c8SJon Dugan	    # Digital/Compaq C++
4479ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4480e34c20c8SJon Dugan	    # Make sure the PIC flag is empty.  It appears that all Alpha
4481e34c20c8SJon Dugan	    # Linux and Compaq Tru64 Unix objects are PIC.
4482ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4483ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4484e34c20c8SJon Dugan	    ;;
4485e34c20c8SJon Dugan	  *)
4486e34c20c8SJon Dugan	    ;;
4487e34c20c8SJon Dugan	esac
4488e34c20c8SJon Dugan	;;
4489e34c20c8SJon Dugan      psos*)
4490e34c20c8SJon Dugan	;;
4491e34c20c8SJon Dugan      solaris*)
4492e34c20c8SJon Dugan	case $cc_basename in
44936edfd8d6SBruce A. Mah	  CC* | sunCC*)
4494e34c20c8SJon Dugan	    # Sun C++ 4.2, 5.x and Centerline C++
4495ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4496ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4497ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4498e34c20c8SJon Dugan	    ;;
4499e34c20c8SJon Dugan	  gcx*)
4500e34c20c8SJon Dugan	    # Green Hills C++ Compiler
4501ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4502e34c20c8SJon Dugan	    ;;
4503e34c20c8SJon Dugan	  *)
4504e34c20c8SJon Dugan	    ;;
4505e34c20c8SJon Dugan	esac
4506e34c20c8SJon Dugan	;;
4507e34c20c8SJon Dugan      sunos4*)
4508e34c20c8SJon Dugan	case $cc_basename in
4509e34c20c8SJon Dugan	  CC*)
4510e34c20c8SJon Dugan	    # Sun C++ 4.x
4511ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4512ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4513e34c20c8SJon Dugan	    ;;
4514e34c20c8SJon Dugan	  lcc*)
4515e34c20c8SJon Dugan	    # Lucid
4516ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4517e34c20c8SJon Dugan	    ;;
4518e34c20c8SJon Dugan	  *)
4519e34c20c8SJon Dugan	    ;;
4520e34c20c8SJon Dugan	esac
4521e34c20c8SJon Dugan	;;
4522e34c20c8SJon Dugan      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4523e34c20c8SJon Dugan	case $cc_basename in
4524e34c20c8SJon Dugan	  CC*)
4525ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4526ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4527ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4528ba7b91d2SJef Poskanzer	    ;;
4529ba7b91d2SJef Poskanzer	esac
4530ba7b91d2SJef Poskanzer	;;
4531ba7b91d2SJef Poskanzer      tandem*)
4532ba7b91d2SJef Poskanzer	case $cc_basename in
4533ba7b91d2SJef Poskanzer	  NCC*)
4534ba7b91d2SJef Poskanzer	    # NonStop-UX NCC 3.20
4535ba7b91d2SJef Poskanzer	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4536ba7b91d2SJef Poskanzer	    ;;
4537ba7b91d2SJef Poskanzer	  *)
4538e34c20c8SJon Dugan	    ;;
4539e34c20c8SJon Dugan	esac
4540e34c20c8SJon Dugan	;;
4541e34c20c8SJon Dugan      vxworks*)
4542e34c20c8SJon Dugan	;;
4543e34c20c8SJon Dugan      *)
4544ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4545e34c20c8SJon Dugan	;;
4546e34c20c8SJon Dugan    esac
4547e34c20c8SJon Dugan  fi
4548e34c20c8SJon Dugan],
4549e34c20c8SJon Dugan[
45504874c4a8SBruce A. Mah  if test yes = "$GCC"; then
4551ba7b91d2SJef Poskanzer    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4552ba7b91d2SJef Poskanzer    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4553e34c20c8SJon Dugan
4554e34c20c8SJon Dugan    case $host_os in
4555e34c20c8SJon Dugan      aix*)
4556e34c20c8SJon Dugan      # All AIX code is PIC.
45574874c4a8SBruce A. Mah      if test ia64 = "$host_cpu"; then
4558e34c20c8SJon Dugan	# AIX 5 now supports IA64 processor
4559ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4560e34c20c8SJon Dugan      fi
45614874c4a8SBruce A. Mah      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4562e34c20c8SJon Dugan      ;;
4563e34c20c8SJon Dugan
4564e34c20c8SJon Dugan    amigaos*)
4565ba7b91d2SJef Poskanzer      case $host_cpu in
4566ba7b91d2SJef Poskanzer      powerpc)
4567ba7b91d2SJef Poskanzer            # see comment about AmigaOS4 .so support
4568ba7b91d2SJef Poskanzer            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4569ba7b91d2SJef Poskanzer        ;;
4570ba7b91d2SJef Poskanzer      m68k)
4571e34c20c8SJon Dugan            # FIXME: we need at least 68020 code to build shared libraries, but
45724874c4a8SBruce A. Mah            # adding the '-m68020' flag to GCC prevents building anything better,
45734874c4a8SBruce A. Mah            # like '-m68040'.
4574ba7b91d2SJef Poskanzer            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4575ba7b91d2SJef Poskanzer        ;;
4576ba7b91d2SJef Poskanzer      esac
4577e34c20c8SJon Dugan      ;;
4578e34c20c8SJon Dugan
4579ba7b91d2SJef Poskanzer    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4580e34c20c8SJon Dugan      # PIC is the default for these OSes.
4581e34c20c8SJon Dugan      ;;
4582e34c20c8SJon Dugan
458360bd98a5SBruce A. Mah    mingw* | cygwin* | pw32* | os2* | cegcc*)
4584e34c20c8SJon Dugan      # This hack is so that the source file can tell whether it is being
4585e34c20c8SJon Dugan      # built for inclusion in a dll (and should export symbols for example).
4586ba7b91d2SJef Poskanzer      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4587ba7b91d2SJef Poskanzer      # (--disable-auto-import) libraries
4588ba7b91d2SJef Poskanzer      m4_if([$1], [GCJ], [],
4589ba7b91d2SJef Poskanzer	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
45904874c4a8SBruce A. Mah      case $host_os in
45914874c4a8SBruce A. Mah      os2*)
45924874c4a8SBruce A. Mah	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
45934874c4a8SBruce A. Mah	;;
45944874c4a8SBruce A. Mah      esac
4595e34c20c8SJon Dugan      ;;
4596e34c20c8SJon Dugan
4597e34c20c8SJon Dugan    darwin* | rhapsody*)
4598e34c20c8SJon Dugan      # PIC is the default on this platform
4599e34c20c8SJon Dugan      # Common symbols not allowed in MH_DYLIB files
4600ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4601e34c20c8SJon Dugan      ;;
4602e34c20c8SJon Dugan
46036edfd8d6SBruce A. Mah    haiku*)
46046edfd8d6SBruce A. Mah      # PIC is the default for Haiku.
46056edfd8d6SBruce A. Mah      # The "-static" flag exists, but is broken.
46066edfd8d6SBruce A. Mah      _LT_TAGVAR(lt_prog_compiler_static, $1)=
46076edfd8d6SBruce A. Mah      ;;
46086edfd8d6SBruce A. Mah
460956a97f93Sjef    hpux*)
461060bd98a5SBruce A. Mah      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
461160bd98a5SBruce A. Mah      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
461260bd98a5SBruce A. Mah      # sets the default TLS model and affects inlining.
4613e34c20c8SJon Dugan      case $host_cpu in
461460bd98a5SBruce A. Mah      hppa*64*)
4615e34c20c8SJon Dugan	# +Z the default
4616e34c20c8SJon Dugan	;;
4617e34c20c8SJon Dugan      *)
4618ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
461956a97f93Sjef	;;
462056a97f93Sjef      esac
462156a97f93Sjef      ;;
462256a97f93Sjef
4623ba7b91d2SJef Poskanzer    interix[[3-9]]*)
4624ba7b91d2SJef Poskanzer      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4625ba7b91d2SJef Poskanzer      # Instead, we relocate shared libraries at runtime.
4626ba7b91d2SJef Poskanzer      ;;
4627ba7b91d2SJef Poskanzer
4628ba7b91d2SJef Poskanzer    msdosdjgpp*)
4629ba7b91d2SJef Poskanzer      # Just because we use GCC doesn't mean we suddenly get shared libraries
4630ba7b91d2SJef Poskanzer      # on systems that don't support them.
4631ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4632ba7b91d2SJef Poskanzer      enable_shared=no
4633ba7b91d2SJef Poskanzer      ;;
4634ba7b91d2SJef Poskanzer
4635ba7b91d2SJef Poskanzer    *nto* | *qnx*)
4636ba7b91d2SJef Poskanzer      # QNX uses GNU C++, but need to define -shared option too, otherwise
4637ba7b91d2SJef Poskanzer      # it will coredump.
4638ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4639ba7b91d2SJef Poskanzer      ;;
4640ba7b91d2SJef Poskanzer
4641ba7b91d2SJef Poskanzer    sysv4*MP*)
4642ba7b91d2SJef Poskanzer      if test -d /usr/nec; then
4643ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4644ba7b91d2SJef Poskanzer      fi
4645ba7b91d2SJef Poskanzer      ;;
4646ba7b91d2SJef Poskanzer
464756a97f93Sjef    *)
4648ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
464956a97f93Sjef      ;;
465056a97f93Sjef    esac
46516edfd8d6SBruce A. Mah
46526edfd8d6SBruce A. Mah    case $cc_basename in
46536edfd8d6SBruce A. Mah    nvcc*) # Cuda Compiler Driver 2.2
46546edfd8d6SBruce A. Mah      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
46556edfd8d6SBruce A. Mah      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
46566edfd8d6SBruce A. Mah        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
46576edfd8d6SBruce A. Mah      fi
46586edfd8d6SBruce A. Mah      ;;
46596edfd8d6SBruce A. Mah    esac
466056a97f93Sjef  else
466156a97f93Sjef    # PORTME Check for flag to pass linker flags through the system compiler.
466256a97f93Sjef    case $host_os in
466356a97f93Sjef    aix*)
4664ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
46654874c4a8SBruce A. Mah      if test ia64 = "$host_cpu"; then
466656a97f93Sjef	# AIX 5 now supports IA64 processor
4667ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
466856a97f93Sjef      else
4669ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
467056a97f93Sjef      fi
467156a97f93Sjef      ;;
467256a97f93Sjef
46734874c4a8SBruce A. Mah    darwin* | rhapsody*)
46744874c4a8SBruce A. Mah      # PIC is the default on this platform
46754874c4a8SBruce A. Mah      # Common symbols not allowed in MH_DYLIB files
46764874c4a8SBruce A. Mah      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
46774874c4a8SBruce A. Mah      case $cc_basename in
46784874c4a8SBruce A. Mah      nagfor*)
46794874c4a8SBruce A. Mah        # NAG Fortran compiler
46804874c4a8SBruce A. Mah        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
46814874c4a8SBruce A. Mah        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
46824874c4a8SBruce A. Mah        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
46834874c4a8SBruce A. Mah        ;;
46844874c4a8SBruce A. Mah      esac
46854874c4a8SBruce A. Mah      ;;
46864874c4a8SBruce A. Mah
468760bd98a5SBruce A. Mah    mingw* | cygwin* | pw32* | os2* | cegcc*)
468856a97f93Sjef      # This hack is so that the source file can tell whether it is being
468956a97f93Sjef      # built for inclusion in a dll (and should export symbols for example).
4690ba7b91d2SJef Poskanzer      m4_if([$1], [GCJ], [],
4691ba7b91d2SJef Poskanzer	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
46924874c4a8SBruce A. Mah      case $host_os in
46934874c4a8SBruce A. Mah      os2*)
46944874c4a8SBruce A. Mah	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
46954874c4a8SBruce A. Mah	;;
46964874c4a8SBruce A. Mah      esac
469756a97f93Sjef      ;;
469856a97f93Sjef
469956a97f93Sjef    hpux9* | hpux10* | hpux11*)
4700ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
470156a97f93Sjef      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
470256a97f93Sjef      # not for PA HP-UX.
470356a97f93Sjef      case $host_cpu in
470456a97f93Sjef      hppa*64*|ia64*)
470556a97f93Sjef	# +Z the default
470656a97f93Sjef	;;
470756a97f93Sjef      *)
4708ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4709e34c20c8SJon Dugan	;;
4710e34c20c8SJon Dugan      esac
4711e34c20c8SJon Dugan      # Is there a better lt_prog_compiler_static that works with the bundled CC?
47124874c4a8SBruce A. Mah      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4713e34c20c8SJon Dugan      ;;
4714e34c20c8SJon Dugan
4715e34c20c8SJon Dugan    irix5* | irix6* | nonstopux*)
4716ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4717e34c20c8SJon Dugan      # PIC (with -KPIC) is the default.
4718ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4719e34c20c8SJon Dugan      ;;
4720e34c20c8SJon Dugan
47214874c4a8SBruce A. Mah    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
472256a97f93Sjef      case $cc_basename in
47234874c4a8SBruce A. Mah      # old Intel for x86_64, which still supported -KPIC.
472460bd98a5SBruce A. Mah      ecc*)
4725ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4726ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4727ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
472856a97f93Sjef        ;;
472960bd98a5SBruce A. Mah      # icc used to be incompatible with GCC.
473060bd98a5SBruce A. Mah      # ICC 10 doesn't accept -KPIC any more.
473160bd98a5SBruce A. Mah      icc* | ifort*)
473260bd98a5SBruce A. Mah	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
473360bd98a5SBruce A. Mah	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
473460bd98a5SBruce A. Mah	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
473560bd98a5SBruce A. Mah        ;;
473660bd98a5SBruce A. Mah      # Lahey Fortran 8.1.
473760bd98a5SBruce A. Mah      lf95*)
473860bd98a5SBruce A. Mah	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
473960bd98a5SBruce A. Mah	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
474060bd98a5SBruce A. Mah	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
474160bd98a5SBruce A. Mah	;;
47426edfd8d6SBruce A. Mah      nagfor*)
47436edfd8d6SBruce A. Mah	# NAG Fortran compiler
47446edfd8d6SBruce A. Mah	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
47456edfd8d6SBruce A. Mah	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
47466edfd8d6SBruce A. Mah	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47476edfd8d6SBruce A. Mah	;;
47484874c4a8SBruce A. Mah      tcc*)
47494874c4a8SBruce A. Mah	# Fabrice Bellard et al's Tiny C Compiler
47504874c4a8SBruce A. Mah	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47514874c4a8SBruce A. Mah	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
47524874c4a8SBruce A. Mah	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
47534874c4a8SBruce A. Mah	;;
47546edfd8d6SBruce A. Mah      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
475556a97f93Sjef        # Portland Group compilers (*not* the Pentium gcc compiler,
475656a97f93Sjef	# which looks to be a dead project)
4757ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4758ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4759ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
476056a97f93Sjef        ;;
476156a97f93Sjef      ccc*)
4762ba7b91d2SJef Poskanzer        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
476356a97f93Sjef        # All Alpha code is PIC.
4764ba7b91d2SJef Poskanzer        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4765ba7b91d2SJef Poskanzer        ;;
47666edfd8d6SBruce A. Mah      xl* | bgxl* | bgf* | mpixl*)
47676edfd8d6SBruce A. Mah	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4768ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4769ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4770ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4771ba7b91d2SJef Poskanzer	;;
4772ba7b91d2SJef Poskanzer      *)
4773*85b25c2eSBruce A. Mah	case `$CC -V 2>&1 | $SED 5q` in
47746edfd8d6SBruce A. Mah	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
47756edfd8d6SBruce A. Mah	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
47766edfd8d6SBruce A. Mah	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47776edfd8d6SBruce A. Mah	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47786edfd8d6SBruce A. Mah	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
47796edfd8d6SBruce A. Mah	  ;;
47806edfd8d6SBruce A. Mah	*Sun\ F* | *Sun*Fortran*)
47816edfd8d6SBruce A. Mah	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47826edfd8d6SBruce A. Mah	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47836edfd8d6SBruce A. Mah	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
47846edfd8d6SBruce A. Mah	  ;;
4785ba7b91d2SJef Poskanzer	*Sun\ C*)
4786ba7b91d2SJef Poskanzer	  # Sun C 5.9
4787ba7b91d2SJef Poskanzer	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4788ba7b91d2SJef Poskanzer	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4789ba7b91d2SJef Poskanzer	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4790ba7b91d2SJef Poskanzer	  ;;
47916edfd8d6SBruce A. Mah        *Intel*\ [[CF]]*Compiler*)
47926edfd8d6SBruce A. Mah	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47936edfd8d6SBruce A. Mah	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
47946edfd8d6SBruce A. Mah	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
47956edfd8d6SBruce A. Mah	  ;;
47966edfd8d6SBruce A. Mah	*Portland\ Group*)
47976edfd8d6SBruce A. Mah	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47986edfd8d6SBruce A. Mah	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4799ba7b91d2SJef Poskanzer	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4800ba7b91d2SJef Poskanzer	  ;;
4801ba7b91d2SJef Poskanzer	esac
480256a97f93Sjef	;;
480356a97f93Sjef      esac
4804e34c20c8SJon Dugan      ;;
4805e34c20c8SJon Dugan
4806ba7b91d2SJef Poskanzer    newsos6)
4807ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4808ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4809ba7b91d2SJef Poskanzer      ;;
4810ba7b91d2SJef Poskanzer
4811ba7b91d2SJef Poskanzer    *nto* | *qnx*)
4812ba7b91d2SJef Poskanzer      # QNX uses GNU C++, but need to define -shared option too, otherwise
4813ba7b91d2SJef Poskanzer      # it will coredump.
4814ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4815ba7b91d2SJef Poskanzer      ;;
4816ba7b91d2SJef Poskanzer
4817e34c20c8SJon Dugan    osf3* | osf4* | osf5*)
4818ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4819e34c20c8SJon Dugan      # All OSF/1 code is PIC.
4820ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4821ba7b91d2SJef Poskanzer      ;;
4822ba7b91d2SJef Poskanzer
4823ba7b91d2SJef Poskanzer    rdos*)
4824ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4825e34c20c8SJon Dugan      ;;
4826e34c20c8SJon Dugan
4827e34c20c8SJon Dugan    solaris*)
4828ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4829ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4830e34c20c8SJon Dugan      case $cc_basename in
48316edfd8d6SBruce A. Mah      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4832ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4833e34c20c8SJon Dugan      *)
4834ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4835e34c20c8SJon Dugan      esac
4836e34c20c8SJon Dugan      ;;
4837e34c20c8SJon Dugan
4838e34c20c8SJon Dugan    sunos4*)
4839ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4840ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4841ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4842e34c20c8SJon Dugan      ;;
4843e34c20c8SJon Dugan
4844e34c20c8SJon Dugan    sysv4 | sysv4.2uw2* | sysv4.3*)
4845ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4846ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4847ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4848e34c20c8SJon Dugan      ;;
4849e34c20c8SJon Dugan
4850e34c20c8SJon Dugan    sysv4*MP*)
4851e34c20c8SJon Dugan      if test -d /usr/nec; then
4852ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4853ba7b91d2SJef Poskanzer	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4854e34c20c8SJon Dugan      fi
4855e34c20c8SJon Dugan      ;;
4856e34c20c8SJon Dugan
4857e34c20c8SJon Dugan    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4858ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4859ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4860ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4861e34c20c8SJon Dugan      ;;
4862e34c20c8SJon Dugan
4863e34c20c8SJon Dugan    unicos*)
4864ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4865ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4866e34c20c8SJon Dugan      ;;
4867e34c20c8SJon Dugan
4868e34c20c8SJon Dugan    uts4*)
4869ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4870ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4871e34c20c8SJon Dugan      ;;
4872e34c20c8SJon Dugan
4873e34c20c8SJon Dugan    *)
4874ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4875e34c20c8SJon Dugan      ;;
4876e34c20c8SJon Dugan    esac
4877e34c20c8SJon Dugan  fi
4878e34c20c8SJon Dugan])
4879ba7b91d2SJef Poskanzercase $host_os in
48804874c4a8SBruce A. Mah  # For platforms that do not support PIC, -DPIC is meaningless:
4881ba7b91d2SJef Poskanzer  *djgpp*)
4882ba7b91d2SJef Poskanzer    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4883ba7b91d2SJef Poskanzer    ;;
4884ba7b91d2SJef Poskanzer  *)
4885ba7b91d2SJef Poskanzer    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4886ba7b91d2SJef Poskanzer    ;;
4887ba7b91d2SJef Poskanzeresac
48886edfd8d6SBruce A. Mah
48896edfd8d6SBruce A. MahAC_CACHE_CHECK([for $compiler option to produce PIC],
48906edfd8d6SBruce A. Mah  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
48916edfd8d6SBruce A. Mah  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
48926edfd8d6SBruce A. Mah_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4893e34c20c8SJon Dugan
4894e34c20c8SJon Dugan#
4895e34c20c8SJon Dugan# Check to make sure the PIC flag actually works.
4896e34c20c8SJon Dugan#
4897ba7b91d2SJef Poskanzerif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4898ba7b91d2SJef Poskanzer  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4899ba7b91d2SJef Poskanzer    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4900ba7b91d2SJef Poskanzer    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4901ba7b91d2SJef Poskanzer    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4902e34c20c8SJon Dugan     "" | " "*) ;;
4903ba7b91d2SJef Poskanzer     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4904e34c20c8SJon Dugan     esac],
4905ba7b91d2SJef Poskanzer    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4906ba7b91d2SJef Poskanzer     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4907e34c20c8SJon Duganfi
4908ba7b91d2SJef Poskanzer_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4909ba7b91d2SJef Poskanzer	[Additional compiler flags for building library objects])
4910e34c20c8SJon Dugan
49116edfd8d6SBruce A. Mah_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
49126edfd8d6SBruce A. Mah	[How to pass a linker flag through the compiler])
4913e34c20c8SJon Dugan#
4914e34c20c8SJon Dugan# Check to make sure the static flag actually works.
4915e34c20c8SJon Dugan#
4916ba7b91d2SJef Poskanzerwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4917ba7b91d2SJef Poskanzer_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4918ba7b91d2SJef Poskanzer  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4919e34c20c8SJon Dugan  $lt_tmp_static_flag,
4920e34c20c8SJon Dugan  [],
4921ba7b91d2SJef Poskanzer  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4922ba7b91d2SJef Poskanzer_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4923ba7b91d2SJef Poskanzer	[Compiler flag to prevent dynamic linking])
4924ba7b91d2SJef Poskanzer])# _LT_COMPILER_PIC
4925e34c20c8SJon Dugan
4926e34c20c8SJon Dugan
4927ba7b91d2SJef Poskanzer# _LT_LINKER_SHLIBS([TAGNAME])
4928ba7b91d2SJef Poskanzer# ----------------------------
4929e34c20c8SJon Dugan# See if the linker supports building shared libraries.
4930ba7b91d2SJef Poskanzerm4_defun([_LT_LINKER_SHLIBS],
4931ba7b91d2SJef Poskanzer[AC_REQUIRE([LT_PATH_LD])dnl
4932ba7b91d2SJef PoskanzerAC_REQUIRE([LT_PATH_NM])dnl
49336edfd8d6SBruce A. Mahm4_require([_LT_PATH_MANIFEST_TOOL])dnl
4934ba7b91d2SJef Poskanzerm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4935ba7b91d2SJef Poskanzerm4_require([_LT_DECL_EGREP])dnl
4936ba7b91d2SJef Poskanzerm4_require([_LT_DECL_SED])dnl
4937ba7b91d2SJef Poskanzerm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4938ba7b91d2SJef Poskanzerm4_require([_LT_TAG_COMPILER])dnl
4939ba7b91d2SJef PoskanzerAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4940ba7b91d2SJef Poskanzerm4_if([$1], [CXX], [
4941ba7b91d2SJef Poskanzer  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
49426edfd8d6SBruce A. Mah  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4943e34c20c8SJon Dugan  case $host_os in
4944ba7b91d2SJef Poskanzer  aix[[4-9]]*)
4945e34c20c8SJon Dugan    # If we're using GNU nm, then we don't want the "-C" option.
49464874c4a8SBruce A. Mah    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
49474874c4a8SBruce A. Mah    # Without the "-l" option, or with the "-B" option, AIX nm treats
49484874c4a8SBruce A. Mah    # weak defined symbols like other global defined symbols, whereas
49494874c4a8SBruce A. Mah    # GNU nm marks them as "W".
49504874c4a8SBruce A. Mah    # While the 'weak' keyword is ignored in the Export File, we need
49514874c4a8SBruce A. Mah    # it in the Import File for the 'aix-soname' feature, so we have
49524874c4a8SBruce A. Mah    # to replace the "-B" option with "-P" for AIX nm.
4953ba7b91d2SJef Poskanzer    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
49544874c4a8SBruce A. Mah      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
4955e34c20c8SJon Dugan    else
4956*85b25c2eSBruce A. Mah      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
4957e34c20c8SJon Dugan    fi
4958e34c20c8SJon Dugan    ;;
4959e34c20c8SJon Dugan  pw32*)
49604874c4a8SBruce A. Mah    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
4961e34c20c8SJon Dugan    ;;
496260bd98a5SBruce A. Mah  cygwin* | mingw* | cegcc*)
49636edfd8d6SBruce A. Mah    case $cc_basename in
4964*85b25c2eSBruce A. Mah    cl* | icl*)
49656edfd8d6SBruce A. Mah      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
49666edfd8d6SBruce A. Mah      ;;
49676edfd8d6SBruce A. Mah    *)
49686edfd8d6SBruce A. Mah      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
49696edfd8d6SBruce A. Mah      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
49706edfd8d6SBruce A. Mah      ;;
49716edfd8d6SBruce A. Mah    esac
4972e34c20c8SJon Dugan    ;;
4973e34c20c8SJon Dugan  *)
4974ba7b91d2SJef Poskanzer    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4975e34c20c8SJon Dugan    ;;
4976e34c20c8SJon Dugan  esac
4977e34c20c8SJon Dugan], [
4978e34c20c8SJon Dugan  runpath_var=
4979ba7b91d2SJef Poskanzer  _LT_TAGVAR(allow_undefined_flag, $1)=
4980ba7b91d2SJef Poskanzer  _LT_TAGVAR(always_export_symbols, $1)=no
4981ba7b91d2SJef Poskanzer  _LT_TAGVAR(archive_cmds, $1)=
4982ba7b91d2SJef Poskanzer  _LT_TAGVAR(archive_expsym_cmds, $1)=
4983ba7b91d2SJef Poskanzer  _LT_TAGVAR(compiler_needs_object, $1)=no
4984ba7b91d2SJef Poskanzer  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4985ba7b91d2SJef Poskanzer  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4986ba7b91d2SJef Poskanzer  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4987ba7b91d2SJef Poskanzer  _LT_TAGVAR(hardcode_automatic, $1)=no
4988ba7b91d2SJef Poskanzer  _LT_TAGVAR(hardcode_direct, $1)=no
4989ba7b91d2SJef Poskanzer  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4990ba7b91d2SJef Poskanzer  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4991ba7b91d2SJef Poskanzer  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4992ba7b91d2SJef Poskanzer  _LT_TAGVAR(hardcode_minus_L, $1)=no
4993ba7b91d2SJef Poskanzer  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4994ba7b91d2SJef Poskanzer  _LT_TAGVAR(inherit_rpath, $1)=no
4995ba7b91d2SJef Poskanzer  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4996ba7b91d2SJef Poskanzer  _LT_TAGVAR(module_cmds, $1)=
4997ba7b91d2SJef Poskanzer  _LT_TAGVAR(module_expsym_cmds, $1)=
4998ba7b91d2SJef Poskanzer  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4999ba7b91d2SJef Poskanzer  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5000ba7b91d2SJef Poskanzer  _LT_TAGVAR(thread_safe_flag_spec, $1)=
5001ba7b91d2SJef Poskanzer  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5002e34c20c8SJon Dugan  # include_expsyms should be a list of space-separated symbols to be *always*
5003e34c20c8SJon Dugan  # included in the symbol list
5004ba7b91d2SJef Poskanzer  _LT_TAGVAR(include_expsyms, $1)=
5005e34c20c8SJon Dugan  # exclude_expsyms can be an extended regexp of symbols to exclude
50064874c4a8SBruce A. Mah  # it will be wrapped by ' (' and ')$', so one must not match beginning or
50074874c4a8SBruce A. Mah  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
50084874c4a8SBruce A. Mah  # as well as any symbol that contains 'd'.
5009ba7b91d2SJef Poskanzer  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5010e34c20c8SJon Dugan  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5011e34c20c8SJon Dugan  # platforms (ab)use it in PIC code, but their linkers get confused if
5012e34c20c8SJon Dugan  # the symbol is explicitly referenced.  Since portable code cannot
5013e34c20c8SJon Dugan  # rely on this symbol name, it's probably fine to never include it in
5014e34c20c8SJon Dugan  # preloaded symbol tables.
5015ba7b91d2SJef Poskanzer  # Exclude shared library initialization/finalization symbols.
5016ba7b91d2SJef Poskanzerdnl Note also adjust exclude_expsyms for C++ above.
5017e34c20c8SJon Dugan  extract_expsyms_cmds=
5018ba7b91d2SJef Poskanzer
5019e34c20c8SJon Dugan  case $host_os in
502060bd98a5SBruce A. Mah  cygwin* | mingw* | pw32* | cegcc*)
5021*85b25c2eSBruce A. Mah    # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
5022e34c20c8SJon Dugan    # When not using gcc, we currently assume that we are using
5023*85b25c2eSBruce A. Mah    # Microsoft Visual C++ or Intel C++ Compiler.
50244874c4a8SBruce A. Mah    if test yes != "$GCC"; then
5025e34c20c8SJon Dugan      with_gnu_ld=no
5026e34c20c8SJon Dugan    fi
5027e34c20c8SJon Dugan    ;;
5028e34c20c8SJon Dugan  interix*)
5029*85b25c2eSBruce A. Mah    # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
5030e34c20c8SJon Dugan    with_gnu_ld=yes
5031e34c20c8SJon Dugan    ;;
50324874c4a8SBruce A. Mah  openbsd* | bitrig*)
5033e34c20c8SJon Dugan    with_gnu_ld=no
5034e34c20c8SJon Dugan    ;;
5035e34c20c8SJon Dugan  esac
5036e34c20c8SJon Dugan
5037ba7b91d2SJef Poskanzer  _LT_TAGVAR(ld_shlibs, $1)=yes
50386edfd8d6SBruce A. Mah
50396edfd8d6SBruce A. Mah  # On some targets, GNU ld is compatible enough with the native linker
50406edfd8d6SBruce A. Mah  # that we're better off using the native interface for both.
50416edfd8d6SBruce A. Mah  lt_use_gnu_ld_interface=no
50424874c4a8SBruce A. Mah  if test yes = "$with_gnu_ld"; then
50436edfd8d6SBruce A. Mah    case $host_os in
50446edfd8d6SBruce A. Mah      aix*)
50456edfd8d6SBruce A. Mah	# The AIX port of GNU ld has always aspired to compatibility
50466edfd8d6SBruce A. Mah	# with the native linker.  However, as the warning in the GNU ld
50476edfd8d6SBruce A. Mah	# block says, versions before 2.19.5* couldn't really create working
50486edfd8d6SBruce A. Mah	# shared libraries, regardless of the interface used.
50496edfd8d6SBruce A. Mah	case `$LD -v 2>&1` in
50506edfd8d6SBruce A. Mah	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
50516edfd8d6SBruce A. Mah	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
50526edfd8d6SBruce A. Mah	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
50536edfd8d6SBruce A. Mah	  *)
50546edfd8d6SBruce A. Mah	    lt_use_gnu_ld_interface=yes
50556edfd8d6SBruce A. Mah	    ;;
50566edfd8d6SBruce A. Mah	esac
50576edfd8d6SBruce A. Mah	;;
50586edfd8d6SBruce A. Mah      *)
50596edfd8d6SBruce A. Mah	lt_use_gnu_ld_interface=yes
50606edfd8d6SBruce A. Mah	;;
50616edfd8d6SBruce A. Mah    esac
50626edfd8d6SBruce A. Mah  fi
50636edfd8d6SBruce A. Mah
50644874c4a8SBruce A. Mah  if test yes = "$lt_use_gnu_ld_interface"; then
5065e34c20c8SJon Dugan    # If archive_cmds runs LD, not CC, wlarc should be empty
50664874c4a8SBruce A. Mah    wlarc='$wl'
5067e34c20c8SJon Dugan
5068e34c20c8SJon Dugan    # Set some defaults for GNU ld with shared library support. These
5069e34c20c8SJon Dugan    # are reset later if shared libraries are not supported. Putting them
5070e34c20c8SJon Dugan    # here allows them to be overridden if necessary.
5071e34c20c8SJon Dugan    runpath_var=LD_RUN_PATH
50724874c4a8SBruce A. Mah    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
50734874c4a8SBruce A. Mah    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
5074e34c20c8SJon Dugan    # ancient GNU ld didn't support --whole-archive et. al.
5075ba7b91d2SJef Poskanzer    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
50764874c4a8SBruce A. Mah      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
5077e34c20c8SJon Dugan    else
5078ba7b91d2SJef Poskanzer      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5079e34c20c8SJon Dugan    fi
5080e34c20c8SJon Dugan    supports_anon_versioning=no
5081*85b25c2eSBruce A. Mah    case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in
50826edfd8d6SBruce A. Mah      *GNU\ gold*) supports_anon_versioning=yes ;;
5083e34c20c8SJon Dugan      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5084e34c20c8SJon Dugan      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5085e34c20c8SJon Dugan      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5086e34c20c8SJon Dugan      *\ 2.11.*) ;; # other 2.11 versions
5087e34c20c8SJon Dugan      *) supports_anon_versioning=yes ;;
5088e34c20c8SJon Dugan    esac
5089e34c20c8SJon Dugan
5090e34c20c8SJon Dugan    # See if GNU ld supports shared libraries.
5091e34c20c8SJon Dugan    case $host_os in
5092ba7b91d2SJef Poskanzer    aix[[3-9]]*)
5093e34c20c8SJon Dugan      # On AIX/PPC, the GNU linker is very broken
50944874c4a8SBruce A. Mah      if test ia64 != "$host_cpu"; then
5095ba7b91d2SJef Poskanzer	_LT_TAGVAR(ld_shlibs, $1)=no
5096ba7b91d2SJef Poskanzer	cat <<_LT_EOF 1>&2
5097e34c20c8SJon Dugan
50986edfd8d6SBruce A. Mah*** Warning: the GNU linker, at least up to release 2.19, is reported
5099e34c20c8SJon Dugan*** to be unable to reliably create shared libraries on AIX.
5100e34c20c8SJon Dugan*** Therefore, libtool is disabling shared libraries support.  If you
51016edfd8d6SBruce A. Mah*** really care for shared libraries, you may want to install binutils
51026edfd8d6SBruce A. Mah*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
51036edfd8d6SBruce A. Mah*** You will then need to restart the configuration process.
5104e34c20c8SJon Dugan
5105ba7b91d2SJef Poskanzer_LT_EOF
5106e34c20c8SJon Dugan      fi
5107e34c20c8SJon Dugan      ;;
5108e34c20c8SJon Dugan
5109e34c20c8SJon Dugan    amigaos*)
5110ba7b91d2SJef Poskanzer      case $host_cpu in
5111ba7b91d2SJef Poskanzer      powerpc)
5112ba7b91d2SJef Poskanzer            # see comment about AmigaOS4 .so support
51134874c4a8SBruce A. Mah            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5114ba7b91d2SJef Poskanzer            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5115ba7b91d2SJef Poskanzer        ;;
5116ba7b91d2SJef Poskanzer      m68k)
5117ba7b91d2SJef Poskanzer            _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)'
5118ba7b91d2SJef Poskanzer            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5119ba7b91d2SJef Poskanzer            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5120ba7b91d2SJef Poskanzer        ;;
5121ba7b91d2SJef Poskanzer      esac
5122e34c20c8SJon Dugan      ;;
5123e34c20c8SJon Dugan
5124e34c20c8SJon Dugan    beos*)
5125ba7b91d2SJef Poskanzer      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5126ba7b91d2SJef Poskanzer	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5127e34c20c8SJon Dugan	# Joseph Beckenbach <[email protected]> says some releases of gcc
5128e34c20c8SJon Dugan	# support --undefined.  This deserves some investigation.  FIXME
51294874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5130e34c20c8SJon Dugan      else
5131ba7b91d2SJef Poskanzer	_LT_TAGVAR(ld_shlibs, $1)=no
5132e34c20c8SJon Dugan      fi
5133e34c20c8SJon Dugan      ;;
5134e34c20c8SJon Dugan
513560bd98a5SBruce A. Mah    cygwin* | mingw* | pw32* | cegcc*)
5136ba7b91d2SJef Poskanzer      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5137e34c20c8SJon Dugan      # as there is no search path for DLLs.
5138ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
51394874c4a8SBruce A. Mah      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
5140ba7b91d2SJef Poskanzer      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5141ba7b91d2SJef Poskanzer      _LT_TAGVAR(always_export_symbols, $1)=no
5142ba7b91d2SJef Poskanzer      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
51436edfd8d6SBruce A. Mah      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
51446edfd8d6SBruce A. Mah      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5145e34c20c8SJon Dugan
5146ba7b91d2SJef Poskanzer      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
51474874c4a8SBruce A. Mah        _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'
51484874c4a8SBruce A. Mah	# If the export-symbols file already is a .def file, use it as
51494874c4a8SBruce A. Mah	# is; otherwise, prepend EXPORTS...
51504874c4a8SBruce A. Mah	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5151e34c20c8SJon Dugan          cp $export_symbols $output_objdir/$soname.def;
5152e34c20c8SJon Dugan        else
5153e34c20c8SJon Dugan          echo EXPORTS > $output_objdir/$soname.def;
5154e34c20c8SJon Dugan          cat $export_symbols >> $output_objdir/$soname.def;
5155e34c20c8SJon Dugan        fi~
51564874c4a8SBruce A. Mah        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5157e34c20c8SJon Dugan      else
5158ba7b91d2SJef Poskanzer	_LT_TAGVAR(ld_shlibs, $1)=no
5159e34c20c8SJon Dugan      fi
5160e34c20c8SJon Dugan      ;;
5161e34c20c8SJon Dugan
51626edfd8d6SBruce A. Mah    haiku*)
51634874c4a8SBruce A. Mah      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
51646edfd8d6SBruce A. Mah      _LT_TAGVAR(link_all_deplibs, $1)=yes
51656edfd8d6SBruce A. Mah      ;;
51666edfd8d6SBruce A. Mah
51674874c4a8SBruce A. Mah    os2*)
51684874c4a8SBruce A. Mah      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
51694874c4a8SBruce A. Mah      _LT_TAGVAR(hardcode_minus_L, $1)=yes
51704874c4a8SBruce A. Mah      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51714874c4a8SBruce A. Mah      shrext_cmds=.dll
51724874c4a8SBruce A. Mah      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
51734874c4a8SBruce A. Mah	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
51744874c4a8SBruce A. Mah	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
51754874c4a8SBruce A. Mah	$ECHO EXPORTS >> $output_objdir/$libname.def~
51764874c4a8SBruce A. Mah	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
51774874c4a8SBruce A. Mah	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
51784874c4a8SBruce A. Mah	emximp -o $lib $output_objdir/$libname.def'
51794874c4a8SBruce A. Mah      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
51804874c4a8SBruce A. Mah	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
51814874c4a8SBruce A. Mah	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
51824874c4a8SBruce A. Mah	$ECHO EXPORTS >> $output_objdir/$libname.def~
51834874c4a8SBruce A. Mah	prefix_cmds="$SED"~
51844874c4a8SBruce A. Mah	if test EXPORTS = "`$SED 1q $export_symbols`"; then
51854874c4a8SBruce A. Mah	  prefix_cmds="$prefix_cmds -e 1d";
51864874c4a8SBruce A. Mah	fi~
51874874c4a8SBruce A. Mah	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
51884874c4a8SBruce A. Mah	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
51894874c4a8SBruce A. Mah	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
51904874c4a8SBruce A. Mah	emximp -o $lib $output_objdir/$libname.def'
51914874c4a8SBruce A. Mah      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
51924874c4a8SBruce A. Mah      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5193*85b25c2eSBruce A. Mah      _LT_TAGVAR(file_list_spec, $1)='@'
51944874c4a8SBruce A. Mah      ;;
51954874c4a8SBruce A. Mah
5196ba7b91d2SJef Poskanzer    interix[[3-9]]*)
5197ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_direct, $1)=no
5198ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
51994874c4a8SBruce A. Mah      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
52004874c4a8SBruce A. Mah      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5201e34c20c8SJon Dugan      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5202e34c20c8SJon Dugan      # Instead, shared libraries are loaded at an image base (0x10000000 by
5203e34c20c8SJon Dugan      # default) and relocated if they conflict, which is a slow very memory
5204e34c20c8SJon Dugan      # consuming and fragmenting process.  To avoid this, we pick a random,
5205e34c20c8SJon Dugan      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5206e34c20c8SJon Dugan      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
52074874c4a8SBruce A. Mah      _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'
5208*85b25c2eSBruce A. Mah      _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'
5209e34c20c8SJon Dugan      ;;
5210e34c20c8SJon Dugan
52116edfd8d6SBruce A. Mah    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5212ba7b91d2SJef Poskanzer      tmp_diet=no
52134874c4a8SBruce A. Mah      if test linux-dietlibc = "$host_os"; then
5214ba7b91d2SJef Poskanzer	case $cc_basename in
5215ba7b91d2SJef Poskanzer	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5216ba7b91d2SJef Poskanzer	esac
5217ba7b91d2SJef Poskanzer      fi
5218ba7b91d2SJef Poskanzer      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
52194874c4a8SBruce A. Mah	 && test no = "$tmp_diet"
5220ba7b91d2SJef Poskanzer      then
52216edfd8d6SBruce A. Mah	tmp_addflag=' $pic_flag'
5222ba7b91d2SJef Poskanzer	tmp_sharedflag='-shared'
5223e34c20c8SJon Dugan	case $cc_basename,$host_cpu in
5224e34c20c8SJon Dugan        pgcc*)				# Portland Group C compiler
52254874c4a8SBruce A. Mah	  _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'
5226e34c20c8SJon Dugan	  tmp_addflag=' $pic_flag'
5227e34c20c8SJon Dugan	  ;;
52286edfd8d6SBruce A. Mah	pgf77* | pgf90* | pgf95* | pgfortran*)
52296edfd8d6SBruce A. Mah					# Portland Group f77 and f90 compilers
52304874c4a8SBruce A. Mah	  _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'
5231e34c20c8SJon Dugan	  tmp_addflag=' $pic_flag -Mnomain' ;;
5232e34c20c8SJon Dugan	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5233e34c20c8SJon Dugan	  tmp_addflag=' -i_dynamic' ;;
5234e34c20c8SJon Dugan	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5235e34c20c8SJon Dugan	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5236e34c20c8SJon Dugan	ifc* | ifort*)			# Intel Fortran compiler
5237e34c20c8SJon Dugan	  tmp_addflag=' -nofor_main' ;;
523860bd98a5SBruce A. Mah	lf95*)				# Lahey Fortran 8.1
523960bd98a5SBruce A. Mah	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
524060bd98a5SBruce A. Mah	  tmp_sharedflag='--shared' ;;
52414874c4a8SBruce A. Mah        nagfor*)                        # NAGFOR 5.3
52424874c4a8SBruce A. Mah          tmp_sharedflag='-Wl,-shared' ;;
52436edfd8d6SBruce A. Mah	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5244ba7b91d2SJef Poskanzer	  tmp_sharedflag='-qmkshrobj'
5245ba7b91d2SJef Poskanzer	  tmp_addflag= ;;
52466edfd8d6SBruce A. Mah	nvcc*)	# Cuda Compiler Driver 2.2
52474874c4a8SBruce A. Mah	  _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'
52486edfd8d6SBruce A. Mah	  _LT_TAGVAR(compiler_needs_object, $1)=yes
52496edfd8d6SBruce A. Mah	  ;;
5250e34c20c8SJon Dugan	esac
5251*85b25c2eSBruce A. Mah	case `$CC -V 2>&1 | $SED 5q` in
5252ba7b91d2SJef Poskanzer	*Sun\ C*)			# Sun C 5.9
52534874c4a8SBruce A. Mah	  _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'
5254ba7b91d2SJef Poskanzer	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5255ba7b91d2SJef Poskanzer	  tmp_sharedflag='-G' ;;
5256ba7b91d2SJef Poskanzer	*Sun\ F*)			# Sun Fortran 8.3
5257ba7b91d2SJef Poskanzer	  tmp_sharedflag='-G' ;;
5258ba7b91d2SJef Poskanzer	esac
52594874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5260e34c20c8SJon Dugan
52614874c4a8SBruce A. Mah        if test yes = "$supports_anon_versioning"; then
5262ba7b91d2SJef Poskanzer          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5263*85b25c2eSBruce A. Mah            cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5264ba7b91d2SJef Poskanzer            echo "local: *; };" >> $output_objdir/$libname.ver~
52654874c4a8SBruce A. Mah            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
5266e34c20c8SJon Dugan        fi
5267ba7b91d2SJef Poskanzer
5268ba7b91d2SJef Poskanzer	case $cc_basename in
52694874c4a8SBruce A. Mah	tcc*)
52704874c4a8SBruce A. Mah	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
52714874c4a8SBruce A. Mah	  ;;
52726edfd8d6SBruce A. Mah	xlf* | bgf* | bgxlf* | mpixlf*)
5273ba7b91d2SJef Poskanzer	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5274ba7b91d2SJef Poskanzer	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
52754874c4a8SBruce A. Mah	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
52766edfd8d6SBruce A. Mah	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
52774874c4a8SBruce A. Mah	  if test yes = "$supports_anon_versioning"; then
5278ba7b91d2SJef Poskanzer	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5279*85b25c2eSBruce A. Mah              cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5280ba7b91d2SJef Poskanzer              echo "local: *; };" >> $output_objdir/$libname.ver~
52816edfd8d6SBruce A. Mah              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5282ba7b91d2SJef Poskanzer	  fi
5283ba7b91d2SJef Poskanzer	  ;;
5284ba7b91d2SJef Poskanzer	esac
5285e34c20c8SJon Dugan      else
5286ba7b91d2SJef Poskanzer        _LT_TAGVAR(ld_shlibs, $1)=no
5287e34c20c8SJon Dugan      fi
5288e34c20c8SJon Dugan      ;;
5289e34c20c8SJon Dugan
5290e34c20c8SJon Dugan    netbsd*)
5291ba7b91d2SJef Poskanzer      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5292ba7b91d2SJef Poskanzer	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5293e34c20c8SJon Dugan	wlarc=
5294e34c20c8SJon Dugan      else
52954874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
52964874c4a8SBruce A. Mah	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
5297e34c20c8SJon Dugan      fi
5298e34c20c8SJon Dugan      ;;
5299e34c20c8SJon Dugan
5300e34c20c8SJon Dugan    solaris*)
5301ba7b91d2SJef Poskanzer      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5302ba7b91d2SJef Poskanzer	_LT_TAGVAR(ld_shlibs, $1)=no
5303ba7b91d2SJef Poskanzer	cat <<_LT_EOF 1>&2
5304e34c20c8SJon Dugan
5305e34c20c8SJon Dugan*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5306e34c20c8SJon Dugan*** create shared libraries on Solaris systems.  Therefore, libtool
5307e34c20c8SJon Dugan*** is disabling shared libraries support.  We urge you to upgrade GNU
5308e34c20c8SJon Dugan*** binutils to release 2.9.1 or newer.  Another option is to modify
5309e34c20c8SJon Dugan*** your PATH or compiler configuration so that the native linker is
5310e34c20c8SJon Dugan*** used, and then restart.
5311e34c20c8SJon Dugan
5312ba7b91d2SJef Poskanzer_LT_EOF
5313ba7b91d2SJef Poskanzer      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
53144874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
53154874c4a8SBruce A. Mah	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
5316e34c20c8SJon Dugan      else
5317ba7b91d2SJef Poskanzer	_LT_TAGVAR(ld_shlibs, $1)=no
5318e34c20c8SJon Dugan      fi
5319e34c20c8SJon Dugan      ;;
5320e34c20c8SJon Dugan
5321e34c20c8SJon Dugan    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5322e34c20c8SJon Dugan      case `$LD -v 2>&1` in
5323e34c20c8SJon Dugan        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5324ba7b91d2SJef Poskanzer	_LT_TAGVAR(ld_shlibs, $1)=no
5325e34c20c8SJon Dugan	cat <<_LT_EOF 1>&2
5326e34c20c8SJon Dugan
5327e34c20c8SJon Dugan*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
5328e34c20c8SJon Dugan*** reliably create shared libraries on SCO systems.  Therefore, libtool
5329e34c20c8SJon Dugan*** is disabling shared libraries support.  We urge you to upgrade GNU
5330e34c20c8SJon Dugan*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5331e34c20c8SJon Dugan*** your PATH or compiler configuration so that the native linker is
5332e34c20c8SJon Dugan*** used, and then restart.
5333e34c20c8SJon Dugan
5334e34c20c8SJon Dugan_LT_EOF
5335e34c20c8SJon Dugan	;;
5336e34c20c8SJon Dugan	*)
5337ba7b91d2SJef Poskanzer	  # For security reasons, it is highly recommended that you always
5338ba7b91d2SJef Poskanzer	  # use absolute paths for naming shared libraries, and exclude the
5339ba7b91d2SJef Poskanzer	  # DT_RUNPATH tag from executables and libraries.  But doing so
5340ba7b91d2SJef Poskanzer	  # requires that you compile everything twice, which is a pain.
5341ba7b91d2SJef Poskanzer	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
53424874c4a8SBruce A. Mah	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
53434874c4a8SBruce A. Mah	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
53444874c4a8SBruce A. Mah	    _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'
5345e34c20c8SJon Dugan	  else
5346ba7b91d2SJef Poskanzer	    _LT_TAGVAR(ld_shlibs, $1)=no
5347e34c20c8SJon Dugan	  fi
5348e34c20c8SJon Dugan	;;
5349e34c20c8SJon Dugan      esac
5350e34c20c8SJon Dugan      ;;
5351e34c20c8SJon Dugan
5352e34c20c8SJon Dugan    sunos4*)
5353ba7b91d2SJef Poskanzer      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5354e34c20c8SJon Dugan      wlarc=
5355ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_direct, $1)=yes
5356ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5357e34c20c8SJon Dugan      ;;
5358e34c20c8SJon Dugan
5359e34c20c8SJon Dugan    *)
5360ba7b91d2SJef Poskanzer      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
53614874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
53624874c4a8SBruce A. Mah	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
5363e34c20c8SJon Dugan      else
5364ba7b91d2SJef Poskanzer	_LT_TAGVAR(ld_shlibs, $1)=no
5365e34c20c8SJon Dugan      fi
5366e34c20c8SJon Dugan      ;;
5367e34c20c8SJon Dugan    esac
5368e34c20c8SJon Dugan
53694874c4a8SBruce A. Mah    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
5370e34c20c8SJon Dugan      runpath_var=
5371ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5372ba7b91d2SJef Poskanzer      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5373ba7b91d2SJef Poskanzer      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5374e34c20c8SJon Dugan    fi
5375e34c20c8SJon Dugan  else
5376e34c20c8SJon Dugan    # PORTME fill in a description of your system's linker (not GNU ld)
5377e34c20c8SJon Dugan    case $host_os in
5378e34c20c8SJon Dugan    aix3*)
5379ba7b91d2SJef Poskanzer      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5380ba7b91d2SJef Poskanzer      _LT_TAGVAR(always_export_symbols, $1)=yes
5381ba7b91d2SJef Poskanzer      _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'
5382e34c20c8SJon Dugan      # Note: this linker hardcodes the directories in LIBPATH if there
5383e34c20c8SJon Dugan      # are no directories specified by -L.
5384ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_minus_L, $1)=yes
53854874c4a8SBruce A. Mah      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
5386e34c20c8SJon Dugan	# Neither direct hardcoding nor static linking is supported with a
5387e34c20c8SJon Dugan	# broken collect2.
5388ba7b91d2SJef Poskanzer	_LT_TAGVAR(hardcode_direct, $1)=unsupported
5389e34c20c8SJon Dugan      fi
5390e34c20c8SJon Dugan      ;;
5391e34c20c8SJon Dugan
5392ba7b91d2SJef Poskanzer    aix[[4-9]]*)
53934874c4a8SBruce A. Mah      if test ia64 = "$host_cpu"; then
5394e34c20c8SJon Dugan	# On IA64, the linker does run time linking by default, so we don't
5395e34c20c8SJon Dugan	# have to do anything special.
5396e34c20c8SJon Dugan	aix_use_runtimelinking=no
5397e34c20c8SJon Dugan	exp_sym_flag='-Bexport'
53984874c4a8SBruce A. Mah	no_entry_flag=
5399e34c20c8SJon Dugan      else
5400e34c20c8SJon Dugan	# If we're using GNU nm, then we don't want the "-C" option.
54014874c4a8SBruce A. Mah	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
54024874c4a8SBruce A. Mah	# Without the "-l" option, or with the "-B" option, AIX nm treats
54034874c4a8SBruce A. Mah	# weak defined symbols like other global defined symbols, whereas
54044874c4a8SBruce A. Mah	# GNU nm marks them as "W".
54054874c4a8SBruce A. Mah	# While the 'weak' keyword is ignored in the Export File, we need
54064874c4a8SBruce A. Mah	# it in the Import File for the 'aix-soname' feature, so we have
54074874c4a8SBruce A. Mah	# to replace the "-B" option with "-P" for AIX nm.
5408ba7b91d2SJef Poskanzer	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
54094874c4a8SBruce A. Mah	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
5410e34c20c8SJon Dugan	else
5411*85b25c2eSBruce A. Mah	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
5412e34c20c8SJon Dugan	fi
5413e34c20c8SJon Dugan	aix_use_runtimelinking=no
5414e34c20c8SJon Dugan
5415e34c20c8SJon Dugan	# Test if we are trying to use run time linking or normal
5416e34c20c8SJon Dugan	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
54174874c4a8SBruce A. Mah	# have runtime linking enabled, and use it for executables.
54184874c4a8SBruce A. Mah	# For shared libraries, we enable/disable runtime linking
54194874c4a8SBruce A. Mah	# depending on the kind of the shared library created -
54204874c4a8SBruce A. Mah	# when "with_aix_soname,aix_use_runtimelinking" is:
54214874c4a8SBruce A. Mah	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
54224874c4a8SBruce A. Mah	# "aix,yes"  lib.so          shared, rtl:yes, for executables
54234874c4a8SBruce A. Mah	#            lib.a           static archive
54244874c4a8SBruce A. Mah	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
54254874c4a8SBruce A. Mah	#            lib.a(lib.so.V) shared, rtl:no,  for executables
54264874c4a8SBruce A. Mah	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
54274874c4a8SBruce A. Mah	#            lib.a(lib.so.V) shared, rtl:no
54284874c4a8SBruce A. Mah	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
54294874c4a8SBruce A. Mah	#            lib.a           static archive
5430ba7b91d2SJef Poskanzer	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5431e34c20c8SJon Dugan	  for ld_flag in $LDFLAGS; do
54324874c4a8SBruce A. Mah	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
5433e34c20c8SJon Dugan	    aix_use_runtimelinking=yes
5434e34c20c8SJon Dugan	    break
5435e34c20c8SJon Dugan	  fi
5436e34c20c8SJon Dugan	  done
54374874c4a8SBruce A. Mah	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
54384874c4a8SBruce A. Mah	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
54394874c4a8SBruce A. Mah	    # so we don't have lib.a shared libs to link our executables.
54404874c4a8SBruce A. Mah	    # We have to force runtime linking in this case.
54414874c4a8SBruce A. Mah	    aix_use_runtimelinking=yes
54424874c4a8SBruce A. Mah	    LDFLAGS="$LDFLAGS -Wl,-brtl"
54434874c4a8SBruce A. Mah	  fi
5444e34c20c8SJon Dugan	  ;;
5445e34c20c8SJon Dugan	esac
5446e34c20c8SJon Dugan
5447e34c20c8SJon Dugan	exp_sym_flag='-bexport'
5448e34c20c8SJon Dugan	no_entry_flag='-bnoentry'
5449e34c20c8SJon Dugan      fi
5450e34c20c8SJon Dugan
5451e34c20c8SJon Dugan      # When large executables or shared objects are built, AIX ld can
5452e34c20c8SJon Dugan      # have problems creating the table of contents.  If linking a library
5453e34c20c8SJon Dugan      # or program results in "error TOC overflow" add -mminimal-toc to
5454e34c20c8SJon Dugan      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5455e34c20c8SJon Dugan      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5456e34c20c8SJon Dugan
5457ba7b91d2SJef Poskanzer      _LT_TAGVAR(archive_cmds, $1)=''
5458ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_direct, $1)=yes
5459ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5460ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5461ba7b91d2SJef Poskanzer      _LT_TAGVAR(link_all_deplibs, $1)=yes
54624874c4a8SBruce A. Mah      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
54634874c4a8SBruce A. Mah      case $with_aix_soname,$aix_use_runtimelinking in
54644874c4a8SBruce A. Mah      aix,*) ;; # traditional, no import file
54654874c4a8SBruce A. Mah      svr4,* | *,yes) # use import file
54664874c4a8SBruce A. Mah	# The Import File defines what to hardcode.
54674874c4a8SBruce A. Mah	_LT_TAGVAR(hardcode_direct, $1)=no
54684874c4a8SBruce A. Mah	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
54694874c4a8SBruce A. Mah	;;
54704874c4a8SBruce A. Mah      esac
5471e34c20c8SJon Dugan
54724874c4a8SBruce A. Mah      if test yes = "$GCC"; then
5473e34c20c8SJon Dugan	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5474e34c20c8SJon Dugan	# We only want to do this on AIX 4.2 and lower, the check
5475e34c20c8SJon Dugan	# below for broken collect2 doesn't work under 4.3+
54764874c4a8SBruce A. Mah	  collect2name=`$CC -print-prog-name=collect2`
5477ba7b91d2SJef Poskanzer	  if test -f "$collect2name" &&
5478ba7b91d2SJef Poskanzer	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5479e34c20c8SJon Dugan	  then
5480e34c20c8SJon Dugan	  # We have reworked collect2
5481ba7b91d2SJef Poskanzer	  :
5482e34c20c8SJon Dugan	  else
5483e34c20c8SJon Dugan	  # We have old collect2
5484ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
5485e34c20c8SJon Dugan	  # It fails to find uninstalled libraries when the uninstalled
5486e34c20c8SJon Dugan	  # path is not listed in the libpath.  Setting hardcode_minus_L
5487e34c20c8SJon Dugan	  # to unsupported forces relinking
5488ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5489ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5490ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5491e34c20c8SJon Dugan	  fi
5492e34c20c8SJon Dugan	  ;;
5493e34c20c8SJon Dugan	esac
5494e34c20c8SJon Dugan	shared_flag='-shared'
54954874c4a8SBruce A. Mah	if test yes = "$aix_use_runtimelinking"; then
54964874c4a8SBruce A. Mah	  shared_flag="$shared_flag "'$wl-G'
5497e34c20c8SJon Dugan	fi
54984874c4a8SBruce A. Mah	# Need to ensure runtime linking is disabled for the traditional
54994874c4a8SBruce A. Mah	# shared library, or the linker may eventually find shared libraries
55004874c4a8SBruce A. Mah	# /with/ Import File - we do not want to mix them.
55014874c4a8SBruce A. Mah	shared_flag_aix='-shared'
55024874c4a8SBruce A. Mah	shared_flag_svr4='-shared $wl-G'
5503e34c20c8SJon Dugan      else
5504e34c20c8SJon Dugan	# not using gcc
55054874c4a8SBruce A. Mah	if test ia64 = "$host_cpu"; then
5506e34c20c8SJon Dugan	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5507e34c20c8SJon Dugan	# chokes on -Wl,-G. The following line is correct:
5508e34c20c8SJon Dugan	  shared_flag='-G'
5509e34c20c8SJon Dugan	else
55104874c4a8SBruce A. Mah	  if test yes = "$aix_use_runtimelinking"; then
55114874c4a8SBruce A. Mah	    shared_flag='$wl-G'
5512e34c20c8SJon Dugan	  else
55134874c4a8SBruce A. Mah	    shared_flag='$wl-bM:SRE'
5514e34c20c8SJon Dugan	  fi
55154874c4a8SBruce A. Mah	  shared_flag_aix='$wl-bM:SRE'
55164874c4a8SBruce A. Mah	  shared_flag_svr4='$wl-G'
5517e34c20c8SJon Dugan	fi
5518e34c20c8SJon Dugan      fi
5519e34c20c8SJon Dugan
55204874c4a8SBruce A. Mah      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
5521e34c20c8SJon Dugan      # It seems that -bexpall does not export symbols beginning with
5522e34c20c8SJon Dugan      # underscore (_), so it is better to generate a list of symbols to export.
5523ba7b91d2SJef Poskanzer      _LT_TAGVAR(always_export_symbols, $1)=yes
55244874c4a8SBruce A. Mah      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
5525e34c20c8SJon Dugan	# Warning - without using the other runtime loading flags (-brtl),
5526e34c20c8SJon Dugan	# -berok will link without error, but may produce a broken library.
5527ba7b91d2SJef Poskanzer	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5528ba7b91d2SJef Poskanzer        # Determine the default libpath from the value encoded in an
5529ba7b91d2SJef Poskanzer        # empty executable.
55306edfd8d6SBruce A. Mah        _LT_SYS_MODULE_PATH_AIX([$1])
55314874c4a8SBruce A. Mah        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
55324874c4a8SBruce A. Mah        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
5533e34c20c8SJon Dugan      else
55344874c4a8SBruce A. Mah	if test ia64 = "$host_cpu"; then
55354874c4a8SBruce A. Mah	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
5536ba7b91d2SJef Poskanzer	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
55374874c4a8SBruce A. Mah	  _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"
5538e34c20c8SJon Dugan	else
5539ba7b91d2SJef Poskanzer	 # Determine the default libpath from the value encoded in an
5540ba7b91d2SJef Poskanzer	 # empty executable.
55416edfd8d6SBruce A. Mah	 _LT_SYS_MODULE_PATH_AIX([$1])
55424874c4a8SBruce A. Mah	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5543e34c20c8SJon Dugan	  # Warning - without using the other run time loading flags,
5544e34c20c8SJon Dugan	  # -berok will link without error, but may produce a broken library.
55454874c4a8SBruce A. Mah	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
55464874c4a8SBruce A. Mah	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
55474874c4a8SBruce A. Mah	  if test yes = "$with_gnu_ld"; then
55486edfd8d6SBruce A. Mah	    # We only use this code for GNU lds that support --whole-archive.
55494874c4a8SBruce A. Mah	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
55506edfd8d6SBruce A. Mah	  else
5551e34c20c8SJon Dugan	    # Exported symbols can be pulled into shared objects from archives
5552ba7b91d2SJef Poskanzer	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
55536edfd8d6SBruce A. Mah	  fi
5554ba7b91d2SJef Poskanzer	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
55554874c4a8SBruce A. Mah	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
55564874c4a8SBruce A. Mah	  # -brtl affects multiple linker settings, -berok does not and is overridden later
55574874c4a8SBruce A. Mah	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
55584874c4a8SBruce A. Mah	  if test svr4 != "$with_aix_soname"; then
5559e34c20c8SJon Dugan	    # This is similar to how AIX traditionally builds its shared libraries.
55604874c4a8SBruce A. Mah	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
55614874c4a8SBruce A. Mah	  fi
55624874c4a8SBruce A. Mah	  if test aix != "$with_aix_soname"; then
55634874c4a8SBruce A. Mah	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
55644874c4a8SBruce A. Mah	  else
55654874c4a8SBruce A. Mah	    # used by -dlpreopen to get the symbols
55664874c4a8SBruce A. Mah	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
55674874c4a8SBruce A. Mah	  fi
55684874c4a8SBruce A. Mah	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
5569e34c20c8SJon Dugan	fi
5570e34c20c8SJon Dugan      fi
5571e34c20c8SJon Dugan      ;;
5572e34c20c8SJon Dugan
5573e34c20c8SJon Dugan    amigaos*)
5574ba7b91d2SJef Poskanzer      case $host_cpu in
5575ba7b91d2SJef Poskanzer      powerpc)
5576ba7b91d2SJef Poskanzer            # see comment about AmigaOS4 .so support
55774874c4a8SBruce A. Mah            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5578ba7b91d2SJef Poskanzer            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5579ba7b91d2SJef Poskanzer        ;;
5580ba7b91d2SJef Poskanzer      m68k)
5581ba7b91d2SJef Poskanzer            _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)'
5582ba7b91d2SJef Poskanzer            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5583ba7b91d2SJef Poskanzer            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5584ba7b91d2SJef Poskanzer        ;;
5585ba7b91d2SJef Poskanzer      esac
5586e34c20c8SJon Dugan      ;;
5587e34c20c8SJon Dugan
5588e34c20c8SJon Dugan    bsdi[[45]]*)
5589ba7b91d2SJef Poskanzer      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5590e34c20c8SJon Dugan      ;;
5591e34c20c8SJon Dugan
559260bd98a5SBruce A. Mah    cygwin* | mingw* | pw32* | cegcc*)
5593e34c20c8SJon Dugan      # When not using gcc, we currently assume that we are using
5594*85b25c2eSBruce A. Mah      # Microsoft Visual C++ or Intel C++ Compiler.
5595e34c20c8SJon Dugan      # hardcode_libdir_flag_spec is actually meaningless, as there is
5596e34c20c8SJon Dugan      # no search path for DLLs.
55976edfd8d6SBruce A. Mah      case $cc_basename in
5598*85b25c2eSBruce A. Mah      cl* | icl*)
5599*85b25c2eSBruce A. Mah	# Native MSVC or ICC
56006edfd8d6SBruce A. Mah	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
56016edfd8d6SBruce A. Mah	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
56026edfd8d6SBruce A. Mah	_LT_TAGVAR(always_export_symbols, $1)=yes
56036edfd8d6SBruce A. Mah	_LT_TAGVAR(file_list_spec, $1)='@'
56046edfd8d6SBruce A. Mah	# Tell ltmain to make .lib files, not .a files.
56056edfd8d6SBruce A. Mah	libext=lib
56066edfd8d6SBruce A. Mah	# Tell ltmain to make .dll files, not .so files.
56074874c4a8SBruce A. Mah	shrext_cmds=.dll
56086edfd8d6SBruce A. Mah	# FIXME: Setting linknames here is a bad hack.
56094874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
56104874c4a8SBruce A. Mah	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
56114874c4a8SBruce A. Mah            cp "$export_symbols" "$output_objdir/$soname.def";
56124874c4a8SBruce A. Mah            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
56136edfd8d6SBruce A. Mah          else
56144874c4a8SBruce A. Mah            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
56156edfd8d6SBruce A. Mah          fi~
56166edfd8d6SBruce A. Mah          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
56176edfd8d6SBruce A. Mah          linknames='
56186edfd8d6SBruce A. Mah	# The linker will not automatically build a static lib if we build a DLL.
56196edfd8d6SBruce A. Mah	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
56206edfd8d6SBruce A. Mah	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
56216edfd8d6SBruce A. Mah	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
56226edfd8d6SBruce A. Mah	_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'
56236edfd8d6SBruce A. Mah	# Don't use ranlib
56246edfd8d6SBruce A. Mah	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
56256edfd8d6SBruce A. Mah	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
56266edfd8d6SBruce A. Mah          lt_tool_outputfile="@TOOL_OUTPUT@"~
56276edfd8d6SBruce A. Mah          case $lt_outputfile in
56286edfd8d6SBruce A. Mah            *.exe|*.EXE) ;;
56296edfd8d6SBruce A. Mah            *)
56304874c4a8SBruce A. Mah              lt_outputfile=$lt_outputfile.exe
56314874c4a8SBruce A. Mah              lt_tool_outputfile=$lt_tool_outputfile.exe
56326edfd8d6SBruce A. Mah              ;;
56336edfd8d6SBruce A. Mah          esac~
56344874c4a8SBruce A. Mah          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
56356edfd8d6SBruce A. Mah            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
56366edfd8d6SBruce A. Mah            $RM "$lt_outputfile.manifest";
56376edfd8d6SBruce A. Mah          fi'
56386edfd8d6SBruce A. Mah	;;
56396edfd8d6SBruce A. Mah      *)
5640*85b25c2eSBruce A. Mah	# Assume MSVC and ICC wrapper
5641ba7b91d2SJef Poskanzer	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5642ba7b91d2SJef Poskanzer	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
56432ab386bfSjef	# Tell ltmain to make .lib files, not .a files.
56442ab386bfSjef	libext=lib
56452ab386bfSjef	# Tell ltmain to make .dll files, not .so files.
56464874c4a8SBruce A. Mah	shrext_cmds=.dll
56472ab386bfSjef	# FIXME: Setting linknames here is a bad hack.
56486edfd8d6SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5649e34c20c8SJon Dugan	# The linker will automatically build a .lib file if we build a DLL.
5650ba7b91d2SJef Poskanzer	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5651e34c20c8SJon Dugan	# FIXME: Should let the user specify the lib program.
5652ba7b91d2SJef Poskanzer	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5653ba7b91d2SJef Poskanzer	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
56542ab386bfSjef	;;
56556edfd8d6SBruce A. Mah      esac
56566edfd8d6SBruce A. Mah      ;;
5657e34c20c8SJon Dugan
5658e34c20c8SJon Dugan    darwin* | rhapsody*)
5659ba7b91d2SJef Poskanzer      _LT_DARWIN_LINKER_FEATURES($1)
5660e34c20c8SJon Dugan      ;;
5661e34c20c8SJon Dugan
5662e34c20c8SJon Dugan    dgux*)
5663ba7b91d2SJef Poskanzer      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5664ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5665ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5666e34c20c8SJon Dugan      ;;
5667e34c20c8SJon Dugan
5668e34c20c8SJon Dugan    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5669e34c20c8SJon Dugan    # support.  Future versions do this automatically, but an explicit c++rt0.o
5670e34c20c8SJon Dugan    # does not break anything, and helps significantly (at the cost of a little
5671e34c20c8SJon Dugan    # extra space).
5672e34c20c8SJon Dugan    freebsd2.2*)
5673ba7b91d2SJef Poskanzer      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5674ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5675ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_direct, $1)=yes
5676ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5677e34c20c8SJon Dugan      ;;
5678e34c20c8SJon Dugan
5679e34c20c8SJon Dugan    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
56806edfd8d6SBruce A. Mah    freebsd2.*)
5681ba7b91d2SJef Poskanzer      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5682ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_direct, $1)=yes
5683ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5684ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5685e34c20c8SJon Dugan      ;;
5686e34c20c8SJon Dugan
5687e34c20c8SJon Dugan    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5688*85b25c2eSBruce A. Mah    freebsd* | dragonfly* | midnightbsd*)
56896edfd8d6SBruce A. Mah      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5690ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5691ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_direct, $1)=yes
5692ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5693e34c20c8SJon Dugan      ;;
5694e34c20c8SJon Dugan
5695e34c20c8SJon Dugan    hpux9*)
56964874c4a8SBruce A. Mah      if test yes = "$GCC"; then
56974874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
5698e34c20c8SJon Dugan      else
56994874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
5700e34c20c8SJon Dugan      fi
57014874c4a8SBruce A. Mah      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5702ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5703ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_direct, $1)=yes
5704e34c20c8SJon Dugan
5705e34c20c8SJon Dugan      # hardcode_minus_L: Not really in the search PATH,
5706e34c20c8SJon Dugan      # but as the default location of the library.
5707ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_minus_L, $1)=yes
57084874c4a8SBruce A. Mah      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5709e34c20c8SJon Dugan      ;;
5710e34c20c8SJon Dugan
5711e34c20c8SJon Dugan    hpux10*)
57124874c4a8SBruce A. Mah      if test yes,no = "$GCC,$with_gnu_ld"; then
57134874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5714e34c20c8SJon Dugan      else
5715ba7b91d2SJef Poskanzer	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5716e34c20c8SJon Dugan      fi
57174874c4a8SBruce A. Mah      if test no = "$with_gnu_ld"; then
57184874c4a8SBruce A. Mah	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5719ba7b91d2SJef Poskanzer	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5720ba7b91d2SJef Poskanzer	_LT_TAGVAR(hardcode_direct, $1)=yes
5721ba7b91d2SJef Poskanzer	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
57224874c4a8SBruce A. Mah	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5723e34c20c8SJon Dugan	# hardcode_minus_L: Not really in the search PATH,
5724e34c20c8SJon Dugan	# but as the default location of the library.
5725ba7b91d2SJef Poskanzer	_LT_TAGVAR(hardcode_minus_L, $1)=yes
5726e34c20c8SJon Dugan      fi
5727e34c20c8SJon Dugan      ;;
5728e34c20c8SJon Dugan
5729e34c20c8SJon Dugan    hpux11*)
57304874c4a8SBruce A. Mah      if test yes,no = "$GCC,$with_gnu_ld"; then
5731e34c20c8SJon Dugan	case $host_cpu in
5732e34c20c8SJon Dugan	hppa*64*)
57334874c4a8SBruce A. Mah	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5734e34c20c8SJon Dugan	  ;;
5735e34c20c8SJon Dugan	ia64*)
57364874c4a8SBruce A. Mah	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5737e34c20c8SJon Dugan	  ;;
5738e34c20c8SJon Dugan	*)
57394874c4a8SBruce A. Mah	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5740e34c20c8SJon Dugan	  ;;
5741e34c20c8SJon Dugan	esac
5742e34c20c8SJon Dugan      else
5743e34c20c8SJon Dugan	case $host_cpu in
5744e34c20c8SJon Dugan	hppa*64*)
57454874c4a8SBruce A. Mah	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5746e34c20c8SJon Dugan	  ;;
5747e34c20c8SJon Dugan	ia64*)
57484874c4a8SBruce A. Mah	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5749e34c20c8SJon Dugan	  ;;
5750e34c20c8SJon Dugan	*)
57516edfd8d6SBruce A. Mah	m4_if($1, [], [
57526edfd8d6SBruce A. Mah	  # Older versions of the 11.00 compiler do not understand -b yet
57536edfd8d6SBruce A. Mah	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
57546edfd8d6SBruce A. Mah	  _LT_LINKER_OPTION([if $CC understands -b],
57556edfd8d6SBruce A. Mah	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
57564874c4a8SBruce A. Mah	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
57576edfd8d6SBruce A. Mah	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
57584874c4a8SBruce A. Mah	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5759e34c20c8SJon Dugan	  ;;
5760e34c20c8SJon Dugan	esac
5761e34c20c8SJon Dugan      fi
57624874c4a8SBruce A. Mah      if test no = "$with_gnu_ld"; then
57634874c4a8SBruce A. Mah	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5764ba7b91d2SJef Poskanzer	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5765e34c20c8SJon Dugan
5766e34c20c8SJon Dugan	case $host_cpu in
5767e34c20c8SJon Dugan	hppa*64*|ia64*)
5768ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_direct, $1)=no
5769ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5770e34c20c8SJon Dugan	  ;;
5771e34c20c8SJon Dugan	*)
5772ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_direct, $1)=yes
5773ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
57744874c4a8SBruce A. Mah	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5775e34c20c8SJon Dugan
5776e34c20c8SJon Dugan	  # hardcode_minus_L: Not really in the search PATH,
5777e34c20c8SJon Dugan	  # but as the default location of the library.
5778ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5779e34c20c8SJon Dugan	  ;;
5780e34c20c8SJon Dugan	esac
5781e34c20c8SJon Dugan      fi
5782e34c20c8SJon Dugan      ;;
5783e34c20c8SJon Dugan
5784e34c20c8SJon Dugan    irix5* | irix6* | nonstopux*)
57854874c4a8SBruce A. Mah      if test yes = "$GCC"; then
57864874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
5787ba7b91d2SJef Poskanzer	# Try to use the -exported_symbol ld option, if it does not
5788ba7b91d2SJef Poskanzer	# work, assume that -exports_file does not work either and
5789ba7b91d2SJef Poskanzer	# implicitly export all symbols.
57906edfd8d6SBruce A. Mah	# This should be the same for all languages, so no per-tag cache variable.
57916edfd8d6SBruce A. Mah	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
57926edfd8d6SBruce A. Mah	  [lt_cv_irix_exported_symbol],
57934874c4a8SBruce A. Mah	  [save_LDFLAGS=$LDFLAGS
57944874c4a8SBruce A. Mah	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
57956edfd8d6SBruce A. Mah	   AC_LINK_IFELSE(
57966edfd8d6SBruce A. Mah	     [AC_LANG_SOURCE(
57976edfd8d6SBruce A. Mah	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
57986edfd8d6SBruce A. Mah			      [C++], [[int foo (void) { return 0; }]],
57996edfd8d6SBruce A. Mah			      [Fortran 77], [[
58006edfd8d6SBruce A. Mah      subroutine foo
58016edfd8d6SBruce A. Mah      end]],
58026edfd8d6SBruce A. Mah			      [Fortran], [[
58036edfd8d6SBruce A. Mah      subroutine foo
58046edfd8d6SBruce A. Mah      end]])])],
58056edfd8d6SBruce A. Mah	      [lt_cv_irix_exported_symbol=yes],
58066edfd8d6SBruce A. Mah	      [lt_cv_irix_exported_symbol=no])
58074874c4a8SBruce A. Mah           LDFLAGS=$save_LDFLAGS])
58084874c4a8SBruce A. Mah	if test yes = "$lt_cv_irix_exported_symbol"; then
58094874c4a8SBruce A. Mah          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
58106edfd8d6SBruce A. Mah	fi
5811e34c20c8SJon Dugan      else
58124874c4a8SBruce A. Mah	_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'
58134874c4a8SBruce A. Mah	_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'
5814e34c20c8SJon Dugan      fi
5815ba7b91d2SJef Poskanzer      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
58164874c4a8SBruce A. Mah      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5817ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5818ba7b91d2SJef Poskanzer      _LT_TAGVAR(inherit_rpath, $1)=yes
5819ba7b91d2SJef Poskanzer      _LT_TAGVAR(link_all_deplibs, $1)=yes
5820e34c20c8SJon Dugan      ;;
5821e34c20c8SJon Dugan
58224874c4a8SBruce A. Mah    linux*)
58234874c4a8SBruce A. Mah      case $cc_basename in
58244874c4a8SBruce A. Mah      tcc*)
58254874c4a8SBruce A. Mah	# Fabrice Bellard et al's Tiny C Compiler
58264874c4a8SBruce A. Mah	_LT_TAGVAR(ld_shlibs, $1)=yes
58274874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
58284874c4a8SBruce A. Mah	;;
58294874c4a8SBruce A. Mah      esac
58304874c4a8SBruce A. Mah      ;;
58314874c4a8SBruce A. Mah
5832e34c20c8SJon Dugan    netbsd*)
5833ba7b91d2SJef Poskanzer      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5834ba7b91d2SJef Poskanzer	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5835e34c20c8SJon Dugan      else
5836ba7b91d2SJef Poskanzer	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5837e34c20c8SJon Dugan      fi
5838ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5839ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_direct, $1)=yes
5840ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5841e34c20c8SJon Dugan      ;;
5842e34c20c8SJon Dugan
5843e34c20c8SJon Dugan    newsos6)
5844ba7b91d2SJef Poskanzer      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5845ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_direct, $1)=yes
58464874c4a8SBruce A. Mah      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5847ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5848ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5849ba7b91d2SJef Poskanzer      ;;
5850ba7b91d2SJef Poskanzer
5851ba7b91d2SJef Poskanzer    *nto* | *qnx*)
5852e34c20c8SJon Dugan      ;;
5853e34c20c8SJon Dugan
58544874c4a8SBruce A. Mah    openbsd* | bitrig*)
5855ba7b91d2SJef Poskanzer      if test -f /usr/libexec/ld.so; then
5856ba7b91d2SJef Poskanzer	_LT_TAGVAR(hardcode_direct, $1)=yes
5857ba7b91d2SJef Poskanzer	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5858ba7b91d2SJef Poskanzer	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
58594874c4a8SBruce A. Mah	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
5860ba7b91d2SJef Poskanzer	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
58614874c4a8SBruce A. Mah	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
58624874c4a8SBruce A. Mah	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
58634874c4a8SBruce A. Mah	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5864e34c20c8SJon Dugan	else
5865ba7b91d2SJef Poskanzer	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
58664874c4a8SBruce A. Mah	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5867e34c20c8SJon Dugan	fi
5868ba7b91d2SJef Poskanzer      else
5869ba7b91d2SJef Poskanzer	_LT_TAGVAR(ld_shlibs, $1)=no
5870ba7b91d2SJef Poskanzer      fi
5871e34c20c8SJon Dugan      ;;
5872e34c20c8SJon Dugan
5873e34c20c8SJon Dugan    os2*)
5874ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5875ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5876ba7b91d2SJef Poskanzer      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
58774874c4a8SBruce A. Mah      shrext_cmds=.dll
58784874c4a8SBruce A. Mah      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
58794874c4a8SBruce A. Mah	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
58804874c4a8SBruce A. Mah	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
58814874c4a8SBruce A. Mah	$ECHO EXPORTS >> $output_objdir/$libname.def~
58824874c4a8SBruce A. Mah	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
58834874c4a8SBruce A. Mah	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
58844874c4a8SBruce A. Mah	emximp -o $lib $output_objdir/$libname.def'
58854874c4a8SBruce A. Mah      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
58864874c4a8SBruce A. Mah	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
58874874c4a8SBruce A. Mah	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
58884874c4a8SBruce A. Mah	$ECHO EXPORTS >> $output_objdir/$libname.def~
58894874c4a8SBruce A. Mah	prefix_cmds="$SED"~
58904874c4a8SBruce A. Mah	if test EXPORTS = "`$SED 1q $export_symbols`"; then
58914874c4a8SBruce A. Mah	  prefix_cmds="$prefix_cmds -e 1d";
58924874c4a8SBruce A. Mah	fi~
58934874c4a8SBruce A. Mah	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
58944874c4a8SBruce A. Mah	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
58954874c4a8SBruce A. Mah	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
58964874c4a8SBruce A. Mah	emximp -o $lib $output_objdir/$libname.def'
58974874c4a8SBruce A. Mah      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
58984874c4a8SBruce A. Mah      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5899*85b25c2eSBruce A. Mah      _LT_TAGVAR(file_list_spec, $1)='@'
5900e34c20c8SJon Dugan      ;;
5901e34c20c8SJon Dugan
5902e34c20c8SJon Dugan    osf3*)
59034874c4a8SBruce A. Mah      if test yes = "$GCC"; then
59044874c4a8SBruce A. Mah	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
59054874c4a8SBruce A. Mah	_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'
5906e34c20c8SJon Dugan      else
5907ba7b91d2SJef Poskanzer	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
59084874c4a8SBruce A. Mah	_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'
5909e34c20c8SJon Dugan      fi
5910ba7b91d2SJef Poskanzer      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
59114874c4a8SBruce A. Mah      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5912ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5913e34c20c8SJon Dugan      ;;
5914e34c20c8SJon Dugan
5915e34c20c8SJon Dugan    osf4* | osf5*)	# as osf3* with the addition of -msym flag
59164874c4a8SBruce A. Mah      if test yes = "$GCC"; then
59174874c4a8SBruce A. Mah	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
59184874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
59194874c4a8SBruce A. Mah	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5920e34c20c8SJon Dugan      else
5921ba7b91d2SJef Poskanzer	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
59224874c4a8SBruce A. Mah	_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'
5923ba7b91d2SJef Poskanzer	_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~
59244874c4a8SBruce A. Mah          $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'
5925e34c20c8SJon Dugan
5926e34c20c8SJon Dugan	# Both c and cxx compiler support -rpath directly
5927ba7b91d2SJef Poskanzer	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5928e34c20c8SJon Dugan      fi
5929ba7b91d2SJef Poskanzer      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5930ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5931e34c20c8SJon Dugan      ;;
5932e34c20c8SJon Dugan
5933e34c20c8SJon Dugan    solaris*)
5934ba7b91d2SJef Poskanzer      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
59354874c4a8SBruce A. Mah      if test yes = "$GCC"; then
59364874c4a8SBruce A. Mah	wlarc='$wl'
59374874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5938ba7b91d2SJef Poskanzer	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
59394874c4a8SBruce A. Mah          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5940e34c20c8SJon Dugan      else
5941ba7b91d2SJef Poskanzer	case `$CC -V 2>&1` in
5942ba7b91d2SJef Poskanzer	*"Compilers 5.0"*)
5943e34c20c8SJon Dugan	  wlarc=''
59444874c4a8SBruce A. Mah	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
5945ba7b91d2SJef Poskanzer	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
59464874c4a8SBruce A. Mah            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5947ba7b91d2SJef Poskanzer	  ;;
5948ba7b91d2SJef Poskanzer	*)
59494874c4a8SBruce A. Mah	  wlarc='$wl'
59504874c4a8SBruce A. Mah	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5951ba7b91d2SJef Poskanzer	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
59524874c4a8SBruce A. Mah            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5953ba7b91d2SJef Poskanzer	  ;;
5954ba7b91d2SJef Poskanzer	esac
5955e34c20c8SJon Dugan      fi
5956ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5957ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5958e34c20c8SJon Dugan      case $host_os in
5959e34c20c8SJon Dugan      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5960e34c20c8SJon Dugan      *)
5961ba7b91d2SJef Poskanzer	# The compiler driver will combine and reorder linker options,
59624874c4a8SBruce A. Mah	# but understands '-z linker_flag'.  GCC discards it without '$wl',
5963ba7b91d2SJef Poskanzer	# but is careful enough not to reorder.
5964e34c20c8SJon Dugan	# Supported since Solaris 2.6 (maybe 2.5.1?)
59654874c4a8SBruce A. Mah	if test yes = "$GCC"; then
59664874c4a8SBruce A. Mah	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
5967ba7b91d2SJef Poskanzer	else
5968ba7b91d2SJef Poskanzer	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5969ba7b91d2SJef Poskanzer	fi
5970ba7b91d2SJef Poskanzer	;;
5971e34c20c8SJon Dugan      esac
5972ba7b91d2SJef Poskanzer      _LT_TAGVAR(link_all_deplibs, $1)=yes
5973e34c20c8SJon Dugan      ;;
5974e34c20c8SJon Dugan
5975e34c20c8SJon Dugan    sunos4*)
59764874c4a8SBruce A. Mah      if test sequent = "$host_vendor"; then
5977e34c20c8SJon Dugan	# Use $CC to link under sequent, because it throws in some extra .o
5978e34c20c8SJon Dugan	# files that make .init and .fini sections work.
59794874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5980e34c20c8SJon Dugan      else
5981ba7b91d2SJef Poskanzer	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5982e34c20c8SJon Dugan      fi
5983ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5984ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_direct, $1)=yes
5985ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5986ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5987e34c20c8SJon Dugan      ;;
5988e34c20c8SJon Dugan
5989e34c20c8SJon Dugan    sysv4)
5990e34c20c8SJon Dugan      case $host_vendor in
5991e34c20c8SJon Dugan	sni)
5992ba7b91d2SJef Poskanzer	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5993ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5994e34c20c8SJon Dugan	;;
5995e34c20c8SJon Dugan	siemens)
5996e34c20c8SJon Dugan	  ## LD is ld it makes a PLAMLIB
5997e34c20c8SJon Dugan	  ## CC just makes a GrossModule.
5998ba7b91d2SJef Poskanzer	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5999ba7b91d2SJef Poskanzer	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6000ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_direct, $1)=no
6001e34c20c8SJon Dugan        ;;
6002e34c20c8SJon Dugan	motorola)
6003ba7b91d2SJef Poskanzer	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6004ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6005e34c20c8SJon Dugan	;;
6006e34c20c8SJon Dugan      esac
6007e34c20c8SJon Dugan      runpath_var='LD_RUN_PATH'
6008ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6009e34c20c8SJon Dugan      ;;
6010e34c20c8SJon Dugan
6011e34c20c8SJon Dugan    sysv4.3*)
6012ba7b91d2SJef Poskanzer      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6013ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6014ba7b91d2SJef Poskanzer      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6015e34c20c8SJon Dugan      ;;
6016e34c20c8SJon Dugan
6017e34c20c8SJon Dugan    sysv4*MP*)
6018e34c20c8SJon Dugan      if test -d /usr/nec; then
6019ba7b91d2SJef Poskanzer	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6020ba7b91d2SJef Poskanzer	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6021e34c20c8SJon Dugan	runpath_var=LD_RUN_PATH
6022e34c20c8SJon Dugan	hardcode_runpath_var=yes
6023ba7b91d2SJef Poskanzer	_LT_TAGVAR(ld_shlibs, $1)=yes
6024e34c20c8SJon Dugan      fi
6025e34c20c8SJon Dugan      ;;
6026e34c20c8SJon Dugan
6027ba7b91d2SJef Poskanzer    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
60284874c4a8SBruce A. Mah      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6029ba7b91d2SJef Poskanzer      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6030ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6031e34c20c8SJon Dugan      runpath_var='LD_RUN_PATH'
6032e34c20c8SJon Dugan
60334874c4a8SBruce A. Mah      if test yes = "$GCC"; then
60344874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60354874c4a8SBruce A. Mah	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6036e34c20c8SJon Dugan      else
60374874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60384874c4a8SBruce A. Mah	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6039e34c20c8SJon Dugan      fi
6040e34c20c8SJon Dugan      ;;
6041e34c20c8SJon Dugan
6042e34c20c8SJon Dugan    sysv5* | sco3.2v5* | sco5v6*)
60434874c4a8SBruce A. Mah      # Note: We CANNOT use -z defs as we might desire, because we do not
6044e34c20c8SJon Dugan      # link with -lc, and that would cause any symbols used from libc to
6045e34c20c8SJon Dugan      # always be unresolved, which means just about no library would
6046e34c20c8SJon Dugan      # ever link correctly.  If we're not using GNU ld we use -z text
6047e34c20c8SJon Dugan      # though, which does catch some bad symbols but isn't as heavy-handed
6048e34c20c8SJon Dugan      # as -z defs.
60494874c4a8SBruce A. Mah      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
60504874c4a8SBruce A. Mah      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
6051ba7b91d2SJef Poskanzer      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6052ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60534874c4a8SBruce A. Mah      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
6054ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6055ba7b91d2SJef Poskanzer      _LT_TAGVAR(link_all_deplibs, $1)=yes
60564874c4a8SBruce A. Mah      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
6057e34c20c8SJon Dugan      runpath_var='LD_RUN_PATH'
6058e34c20c8SJon Dugan
60594874c4a8SBruce A. Mah      if test yes = "$GCC"; then
60604874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60614874c4a8SBruce A. Mah	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6062e34c20c8SJon Dugan      else
60634874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60644874c4a8SBruce A. Mah	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6065e34c20c8SJon Dugan      fi
6066e34c20c8SJon Dugan      ;;
6067e34c20c8SJon Dugan
6068e34c20c8SJon Dugan    uts4*)
6069ba7b91d2SJef Poskanzer      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6070ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6071ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6072e34c20c8SJon Dugan      ;;
6073e34c20c8SJon Dugan
6074e34c20c8SJon Dugan    *)
6075ba7b91d2SJef Poskanzer      _LT_TAGVAR(ld_shlibs, $1)=no
6076ba7b91d2SJef Poskanzer      ;;
6077ba7b91d2SJef Poskanzer    esac
6078ba7b91d2SJef Poskanzer
60794874c4a8SBruce A. Mah    if test sni = "$host_vendor"; then
6080ba7b91d2SJef Poskanzer      case $host in
6081ba7b91d2SJef Poskanzer      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
60824874c4a8SBruce A. Mah	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
6083e34c20c8SJon Dugan	;;
6084e34c20c8SJon Dugan      esac
6085e34c20c8SJon Dugan    fi
6086ba7b91d2SJef Poskanzer  fi
6087e34c20c8SJon Dugan])
6088ba7b91d2SJef PoskanzerAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
60894874c4a8SBruce A. Mahtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
6090ba7b91d2SJef Poskanzer
6091ba7b91d2SJef Poskanzer_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6092ba7b91d2SJef Poskanzer
6093ba7b91d2SJef Poskanzer_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6094ba7b91d2SJef Poskanzer_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6095ba7b91d2SJef Poskanzer_LT_DECL([], [extract_expsyms_cmds], [2],
6096ba7b91d2SJef Poskanzer    [The commands to extract the exported symbol list from a shared archive])
6097e34c20c8SJon Dugan
6098e34c20c8SJon Dugan#
6099e34c20c8SJon Dugan# Do we need to explicitly link libc?
6100e34c20c8SJon Dugan#
6101ba7b91d2SJef Poskanzercase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6102e34c20c8SJon Duganx|xyes)
6103e34c20c8SJon Dugan  # Assume -lc should be added
6104ba7b91d2SJef Poskanzer  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6105e34c20c8SJon Dugan
61064874c4a8SBruce A. Mah  if test yes,yes = "$GCC,$enable_shared"; then
6107ba7b91d2SJef Poskanzer    case $_LT_TAGVAR(archive_cmds, $1) in
6108e34c20c8SJon Dugan    *'~'*)
6109e34c20c8SJon Dugan      # FIXME: we may have to deal with multi-command sequences.
6110e34c20c8SJon Dugan      ;;
6111e34c20c8SJon Dugan    '$CC '*)
6112e34c20c8SJon Dugan      # Test whether the compiler implicitly links with -lc since on some
6113e34c20c8SJon Dugan      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6114e34c20c8SJon Dugan      # to ld, don't add -lc before -lgcc.
61156edfd8d6SBruce A. Mah      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
61166edfd8d6SBruce A. Mah	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
61176edfd8d6SBruce A. Mah	[$RM conftest*
6118ba7b91d2SJef Poskanzer	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6119e34c20c8SJon Dugan
6120e34c20c8SJon Dugan	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6121e34c20c8SJon Dugan	  soname=conftest
6122e34c20c8SJon Dugan	  lib=conftest
6123e34c20c8SJon Dugan	  libobjs=conftest.$ac_objext
6124e34c20c8SJon Dugan	  deplibs=
6125ba7b91d2SJef Poskanzer	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6126ba7b91d2SJef Poskanzer	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6127e34c20c8SJon Dugan	  compiler_flags=-v
6128e34c20c8SJon Dugan	  linker_flags=-v
6129e34c20c8SJon Dugan	  verstring=
6130e34c20c8SJon Dugan	  output_objdir=.
6131e34c20c8SJon Dugan	  libname=conftest
6132ba7b91d2SJef Poskanzer	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6133ba7b91d2SJef Poskanzer	  _LT_TAGVAR(allow_undefined_flag, $1)=
6134ba7b91d2SJef Poskanzer	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6135e34c20c8SJon Dugan	  then
61366edfd8d6SBruce A. Mah	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6137e34c20c8SJon Dugan	  else
61386edfd8d6SBruce A. Mah	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6139e34c20c8SJon Dugan	  fi
6140ba7b91d2SJef Poskanzer	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6141e34c20c8SJon Dugan	else
6142e34c20c8SJon Dugan	  cat conftest.err 1>&5
6143e34c20c8SJon Dugan	fi
614460bd98a5SBruce A. Mah	$RM conftest*
61456edfd8d6SBruce A. Mah	])
61466edfd8d6SBruce A. Mah      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6147e34c20c8SJon Dugan      ;;
6148e34c20c8SJon Dugan    esac
6149e34c20c8SJon Dugan  fi
6150e34c20c8SJon Dugan  ;;
6151e34c20c8SJon Duganesac
6152ba7b91d2SJef Poskanzer
6153ba7b91d2SJef Poskanzer_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6154ba7b91d2SJef Poskanzer    [Whether or not to add -lc for building shared libraries])
6155ba7b91d2SJef Poskanzer_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6156ba7b91d2SJef Poskanzer    [enable_shared_with_static_runtimes], [0],
6157ba7b91d2SJef Poskanzer    [Whether or not to disallow shared libs when runtime libs are static])
6158ba7b91d2SJef Poskanzer_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6159ba7b91d2SJef Poskanzer    [Compiler flag to allow reflexive dlopens])
6160ba7b91d2SJef Poskanzer_LT_TAGDECL([], [whole_archive_flag_spec], [1],
6161ba7b91d2SJef Poskanzer    [Compiler flag to generate shared objects directly from archives])
6162ba7b91d2SJef Poskanzer_LT_TAGDECL([], [compiler_needs_object], [1],
6163ba7b91d2SJef Poskanzer    [Whether the compiler copes with passing no objects directly])
6164ba7b91d2SJef Poskanzer_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6165ba7b91d2SJef Poskanzer    [Create an old-style archive from a shared archive])
6166ba7b91d2SJef Poskanzer_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6167ba7b91d2SJef Poskanzer    [Create a temporary old-style archive to link instead of a shared archive])
6168ba7b91d2SJef Poskanzer_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6169ba7b91d2SJef Poskanzer_LT_TAGDECL([], [archive_expsym_cmds], [2])
6170ba7b91d2SJef Poskanzer_LT_TAGDECL([], [module_cmds], [2],
6171ba7b91d2SJef Poskanzer    [Commands used to build a loadable module if different from building
6172ba7b91d2SJef Poskanzer    a shared archive.])
6173ba7b91d2SJef Poskanzer_LT_TAGDECL([], [module_expsym_cmds], [2])
6174ba7b91d2SJef Poskanzer_LT_TAGDECL([], [with_gnu_ld], [1],
6175ba7b91d2SJef Poskanzer    [Whether we are building with GNU ld or not])
6176ba7b91d2SJef Poskanzer_LT_TAGDECL([], [allow_undefined_flag], [1],
6177ba7b91d2SJef Poskanzer    [Flag that allows shared libraries with undefined symbols to be built])
6178ba7b91d2SJef Poskanzer_LT_TAGDECL([], [no_undefined_flag], [1],
6179ba7b91d2SJef Poskanzer    [Flag that enforces no undefined symbols])
6180ba7b91d2SJef Poskanzer_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6181ba7b91d2SJef Poskanzer    [Flag to hardcode $libdir into a binary during linking.
6182ba7b91d2SJef Poskanzer    This must work even if $libdir does not exist])
6183ba7b91d2SJef Poskanzer_LT_TAGDECL([], [hardcode_libdir_separator], [1],
6184ba7b91d2SJef Poskanzer    [Whether we need a single "-rpath" flag with a separated argument])
6185ba7b91d2SJef Poskanzer_LT_TAGDECL([], [hardcode_direct], [0],
61864874c4a8SBruce A. Mah    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6187ba7b91d2SJef Poskanzer    DIR into the resulting binary])
6188ba7b91d2SJef Poskanzer_LT_TAGDECL([], [hardcode_direct_absolute], [0],
61894874c4a8SBruce A. Mah    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6190ba7b91d2SJef Poskanzer    DIR into the resulting binary and the resulting library dependency is
61914874c4a8SBruce A. Mah    "absolute", i.e impossible to change by setting $shlibpath_var if the
6192ba7b91d2SJef Poskanzer    library is relocated])
6193ba7b91d2SJef Poskanzer_LT_TAGDECL([], [hardcode_minus_L], [0],
6194ba7b91d2SJef Poskanzer    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6195ba7b91d2SJef Poskanzer    into the resulting binary])
6196ba7b91d2SJef Poskanzer_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6197ba7b91d2SJef Poskanzer    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6198ba7b91d2SJef Poskanzer    into the resulting binary])
6199ba7b91d2SJef Poskanzer_LT_TAGDECL([], [hardcode_automatic], [0],
6200ba7b91d2SJef Poskanzer    [Set to "yes" if building a shared library automatically hardcodes DIR
6201ba7b91d2SJef Poskanzer    into the library and all subsequent libraries and executables linked
6202ba7b91d2SJef Poskanzer    against it])
6203ba7b91d2SJef Poskanzer_LT_TAGDECL([], [inherit_rpath], [0],
6204ba7b91d2SJef Poskanzer    [Set to yes if linker adds runtime paths of dependent libraries
6205ba7b91d2SJef Poskanzer    to runtime path list])
6206ba7b91d2SJef Poskanzer_LT_TAGDECL([], [link_all_deplibs], [0],
6207ba7b91d2SJef Poskanzer    [Whether libtool must link a program against all its dependency libraries])
6208ba7b91d2SJef Poskanzer_LT_TAGDECL([], [always_export_symbols], [0],
6209ba7b91d2SJef Poskanzer    [Set to "yes" if exported symbols are required])
6210ba7b91d2SJef Poskanzer_LT_TAGDECL([], [export_symbols_cmds], [2],
6211ba7b91d2SJef Poskanzer    [The commands to list exported symbols])
6212ba7b91d2SJef Poskanzer_LT_TAGDECL([], [exclude_expsyms], [1],
6213ba7b91d2SJef Poskanzer    [Symbols that should not be listed in the preloaded symbols])
6214ba7b91d2SJef Poskanzer_LT_TAGDECL([], [include_expsyms], [1],
6215ba7b91d2SJef Poskanzer    [Symbols that must always be exported])
6216ba7b91d2SJef Poskanzer_LT_TAGDECL([], [prelink_cmds], [2],
6217ba7b91d2SJef Poskanzer    [Commands necessary for linking programs (against libraries) with templates])
62186edfd8d6SBruce A. Mah_LT_TAGDECL([], [postlink_cmds], [2],
62196edfd8d6SBruce A. Mah    [Commands necessary for finishing linking programs])
6220ba7b91d2SJef Poskanzer_LT_TAGDECL([], [file_list_spec], [1],
6221ba7b91d2SJef Poskanzer    [Specify filename containing input files])
6222ba7b91d2SJef Poskanzerdnl FIXME: Not yet implemented
6223ba7b91d2SJef Poskanzerdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6224ba7b91d2SJef Poskanzerdnl    [Compiler flag to generate thread safe objects])
6225ba7b91d2SJef Poskanzer])# _LT_LINKER_SHLIBS
6226e34c20c8SJon Dugan
6227e34c20c8SJon Dugan
6228ba7b91d2SJef Poskanzer# _LT_LANG_C_CONFIG([TAG])
6229ba7b91d2SJef Poskanzer# ------------------------
6230ba7b91d2SJef Poskanzer# Ensure that the configuration variables for a C compiler are suitably
6231ba7b91d2SJef Poskanzer# defined.  These variables are subsequently used by _LT_CONFIG to write
62324874c4a8SBruce A. Mah# the compiler configuration to 'libtool'.
6233ba7b91d2SJef Poskanzerm4_defun([_LT_LANG_C_CONFIG],
6234ba7b91d2SJef Poskanzer[m4_require([_LT_DECL_EGREP])dnl
62354874c4a8SBruce A. Mahlt_save_CC=$CC
6236ba7b91d2SJef PoskanzerAC_LANG_PUSH(C)
6237ba7b91d2SJef Poskanzer
6238ba7b91d2SJef Poskanzer# Source file extension for C test sources.
6239ba7b91d2SJef Poskanzerac_ext=c
6240ba7b91d2SJef Poskanzer
6241ba7b91d2SJef Poskanzer# Object file extension for compiled C test sources.
6242ba7b91d2SJef Poskanzerobjext=o
6243ba7b91d2SJef Poskanzer_LT_TAGVAR(objext, $1)=$objext
6244ba7b91d2SJef Poskanzer
6245ba7b91d2SJef Poskanzer# Code to be used in simple compile tests
6246ba7b91d2SJef Poskanzerlt_simple_compile_test_code="int some_variable = 0;"
6247ba7b91d2SJef Poskanzer
6248ba7b91d2SJef Poskanzer# Code to be used in simple link tests
6249ba7b91d2SJef Poskanzerlt_simple_link_test_code='int main(){return(0);}'
6250ba7b91d2SJef Poskanzer
6251ba7b91d2SJef Poskanzer_LT_TAG_COMPILER
6252ba7b91d2SJef Poskanzer# Save the default compiler, since it gets overwritten when the other
6253ba7b91d2SJef Poskanzer# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6254ba7b91d2SJef Poskanzercompiler_DEFAULT=$CC
6255ba7b91d2SJef Poskanzer
6256ba7b91d2SJef Poskanzer# save warnings/boilerplate of simple test code
6257ba7b91d2SJef Poskanzer_LT_COMPILER_BOILERPLATE
6258ba7b91d2SJef Poskanzer_LT_LINKER_BOILERPLATE
6259ba7b91d2SJef Poskanzer
6260ba7b91d2SJef Poskanzerif test -n "$compiler"; then
6261ba7b91d2SJef Poskanzer  _LT_COMPILER_NO_RTTI($1)
6262ba7b91d2SJef Poskanzer  _LT_COMPILER_PIC($1)
6263ba7b91d2SJef Poskanzer  _LT_COMPILER_C_O($1)
6264ba7b91d2SJef Poskanzer  _LT_COMPILER_FILE_LOCKS($1)
6265ba7b91d2SJef Poskanzer  _LT_LINKER_SHLIBS($1)
6266ba7b91d2SJef Poskanzer  _LT_SYS_DYNAMIC_LINKER($1)
6267ba7b91d2SJef Poskanzer  _LT_LINKER_HARDCODE_LIBPATH($1)
6268ba7b91d2SJef Poskanzer  LT_SYS_DLOPEN_SELF
6269ba7b91d2SJef Poskanzer  _LT_CMD_STRIPLIB
6270ba7b91d2SJef Poskanzer
62714874c4a8SBruce A. Mah  # Report what library types will actually be built
6272ba7b91d2SJef Poskanzer  AC_MSG_CHECKING([if libtool supports shared libraries])
6273ba7b91d2SJef Poskanzer  AC_MSG_RESULT([$can_build_shared])
6274ba7b91d2SJef Poskanzer
6275ba7b91d2SJef Poskanzer  AC_MSG_CHECKING([whether to build shared libraries])
62764874c4a8SBruce A. Mah  test no = "$can_build_shared" && enable_shared=no
6277ba7b91d2SJef Poskanzer
6278ba7b91d2SJef Poskanzer  # On AIX, shared libraries and static libraries use the same namespace, and
6279ba7b91d2SJef Poskanzer  # are all built from PIC.
6280ba7b91d2SJef Poskanzer  case $host_os in
6281ba7b91d2SJef Poskanzer  aix3*)
62824874c4a8SBruce A. Mah    test yes = "$enable_shared" && enable_static=no
6283ba7b91d2SJef Poskanzer    if test -n "$RANLIB"; then
6284ba7b91d2SJef Poskanzer      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6285ba7b91d2SJef Poskanzer      postinstall_cmds='$RANLIB $lib'
6286ba7b91d2SJef Poskanzer    fi
6287ba7b91d2SJef Poskanzer    ;;
6288ba7b91d2SJef Poskanzer
6289ba7b91d2SJef Poskanzer  aix[[4-9]]*)
62904874c4a8SBruce A. Mah    if test ia64 != "$host_cpu"; then
62914874c4a8SBruce A. Mah      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
62924874c4a8SBruce A. Mah      yes,aix,yes) ;;			# shared object as lib.so file only
62934874c4a8SBruce A. Mah      yes,svr4,*) ;;			# shared object as lib.so archive member only
62944874c4a8SBruce A. Mah      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
62954874c4a8SBruce A. Mah      esac
6296ba7b91d2SJef Poskanzer    fi
6297ba7b91d2SJef Poskanzer    ;;
6298ba7b91d2SJef Poskanzer  esac
6299ba7b91d2SJef Poskanzer  AC_MSG_RESULT([$enable_shared])
6300ba7b91d2SJef Poskanzer
6301ba7b91d2SJef Poskanzer  AC_MSG_CHECKING([whether to build static libraries])
6302ba7b91d2SJef Poskanzer  # Make sure either enable_shared or enable_static is yes.
63034874c4a8SBruce A. Mah  test yes = "$enable_shared" || enable_static=yes
6304ba7b91d2SJef Poskanzer  AC_MSG_RESULT([$enable_static])
6305ba7b91d2SJef Poskanzer
6306ba7b91d2SJef Poskanzer  _LT_CONFIG($1)
6307ba7b91d2SJef Poskanzerfi
6308ba7b91d2SJef PoskanzerAC_LANG_POP
63094874c4a8SBruce A. MahCC=$lt_save_CC
6310ba7b91d2SJef Poskanzer])# _LT_LANG_C_CONFIG
6311e34c20c8SJon Dugan
6312e34c20c8SJon Dugan
63136edfd8d6SBruce A. Mah# _LT_LANG_CXX_CONFIG([TAG])
63146edfd8d6SBruce A. Mah# --------------------------
63156edfd8d6SBruce A. Mah# Ensure that the configuration variables for a C++ compiler are suitably
63166edfd8d6SBruce A. Mah# defined.  These variables are subsequently used by _LT_CONFIG to write
63174874c4a8SBruce A. Mah# the compiler configuration to 'libtool'.
63186edfd8d6SBruce A. Mahm4_defun([_LT_LANG_CXX_CONFIG],
63196edfd8d6SBruce A. Mah[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
63206edfd8d6SBruce A. Mahm4_require([_LT_DECL_EGREP])dnl
63216edfd8d6SBruce A. Mahm4_require([_LT_PATH_MANIFEST_TOOL])dnl
63224874c4a8SBruce A. Mahif test -n "$CXX" && ( test no != "$CXX" &&
63234874c4a8SBruce A. Mah    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
63244874c4a8SBruce A. Mah    (test g++ != "$CXX"))); then
6325ba7b91d2SJef Poskanzer  AC_PROG_CXXCPP
6326ba7b91d2SJef Poskanzerelse
6327ba7b91d2SJef Poskanzer  _lt_caught_CXX_error=yes
6328ba7b91d2SJef Poskanzerfi
6329ba7b91d2SJef Poskanzer
6330ba7b91d2SJef PoskanzerAC_LANG_PUSH(C++)
6331ba7b91d2SJef Poskanzer_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6332ba7b91d2SJef Poskanzer_LT_TAGVAR(allow_undefined_flag, $1)=
6333ba7b91d2SJef Poskanzer_LT_TAGVAR(always_export_symbols, $1)=no
6334ba7b91d2SJef Poskanzer_LT_TAGVAR(archive_expsym_cmds, $1)=
6335ba7b91d2SJef Poskanzer_LT_TAGVAR(compiler_needs_object, $1)=no
6336ba7b91d2SJef Poskanzer_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6337ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_direct, $1)=no
6338ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6339ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6340ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_libdir_separator, $1)=
6341ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_minus_L, $1)=no
6342ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6343ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_automatic, $1)=no
6344ba7b91d2SJef Poskanzer_LT_TAGVAR(inherit_rpath, $1)=no
6345ba7b91d2SJef Poskanzer_LT_TAGVAR(module_cmds, $1)=
6346ba7b91d2SJef Poskanzer_LT_TAGVAR(module_expsym_cmds, $1)=
6347ba7b91d2SJef Poskanzer_LT_TAGVAR(link_all_deplibs, $1)=unknown
6348ba7b91d2SJef Poskanzer_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
63496edfd8d6SBruce A. Mah_LT_TAGVAR(reload_flag, $1)=$reload_flag
63506edfd8d6SBruce A. Mah_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6351ba7b91d2SJef Poskanzer_LT_TAGVAR(no_undefined_flag, $1)=
6352ba7b91d2SJef Poskanzer_LT_TAGVAR(whole_archive_flag_spec, $1)=
6353ba7b91d2SJef Poskanzer_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6354ba7b91d2SJef Poskanzer
6355ba7b91d2SJef Poskanzer# Source file extension for C++ test sources.
6356ba7b91d2SJef Poskanzerac_ext=cpp
6357ba7b91d2SJef Poskanzer
6358ba7b91d2SJef Poskanzer# Object file extension for compiled C++ test sources.
6359ba7b91d2SJef Poskanzerobjext=o
6360ba7b91d2SJef Poskanzer_LT_TAGVAR(objext, $1)=$objext
6361ba7b91d2SJef Poskanzer
6362ba7b91d2SJef Poskanzer# No sense in running all these tests if we already determined that
6363ba7b91d2SJef Poskanzer# the CXX compiler isn't working.  Some variables (like enable_shared)
6364ba7b91d2SJef Poskanzer# are currently assumed to apply to all compilers on this platform,
6365ba7b91d2SJef Poskanzer# and will be corrupted by setting them based on a non-working compiler.
63664874c4a8SBruce A. Mahif test yes != "$_lt_caught_CXX_error"; then
6367ba7b91d2SJef Poskanzer  # Code to be used in simple compile tests
6368ba7b91d2SJef Poskanzer  lt_simple_compile_test_code="int some_variable = 0;"
6369ba7b91d2SJef Poskanzer
6370ba7b91d2SJef Poskanzer  # Code to be used in simple link tests
6371ba7b91d2SJef Poskanzer  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6372ba7b91d2SJef Poskanzer
6373ba7b91d2SJef Poskanzer  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6374ba7b91d2SJef Poskanzer  _LT_TAG_COMPILER
6375ba7b91d2SJef Poskanzer
6376ba7b91d2SJef Poskanzer  # save warnings/boilerplate of simple test code
6377ba7b91d2SJef Poskanzer  _LT_COMPILER_BOILERPLATE
6378ba7b91d2SJef Poskanzer  _LT_LINKER_BOILERPLATE
6379ba7b91d2SJef Poskanzer
6380ba7b91d2SJef Poskanzer  # Allow CC to be a program name with arguments.
6381ba7b91d2SJef Poskanzer  lt_save_CC=$CC
63826edfd8d6SBruce A. Mah  lt_save_CFLAGS=$CFLAGS
6383ba7b91d2SJef Poskanzer  lt_save_LD=$LD
6384ba7b91d2SJef Poskanzer  lt_save_GCC=$GCC
6385ba7b91d2SJef Poskanzer  GCC=$GXX
6386ba7b91d2SJef Poskanzer  lt_save_with_gnu_ld=$with_gnu_ld
6387ba7b91d2SJef Poskanzer  lt_save_path_LD=$lt_cv_path_LD
6388ba7b91d2SJef Poskanzer  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6389ba7b91d2SJef Poskanzer    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6390ba7b91d2SJef Poskanzer  else
6391ba7b91d2SJef Poskanzer    $as_unset lt_cv_prog_gnu_ld
6392ba7b91d2SJef Poskanzer  fi
6393ba7b91d2SJef Poskanzer  if test -n "${lt_cv_path_LDCXX+set}"; then
6394ba7b91d2SJef Poskanzer    lt_cv_path_LD=$lt_cv_path_LDCXX
6395ba7b91d2SJef Poskanzer  else
6396ba7b91d2SJef Poskanzer    $as_unset lt_cv_path_LD
6397ba7b91d2SJef Poskanzer  fi
6398ba7b91d2SJef Poskanzer  test -z "${LDCXX+set}" || LD=$LDCXX
6399ba7b91d2SJef Poskanzer  CC=${CXX-"c++"}
64006edfd8d6SBruce A. Mah  CFLAGS=$CXXFLAGS
6401ba7b91d2SJef Poskanzer  compiler=$CC
6402ba7b91d2SJef Poskanzer  _LT_TAGVAR(compiler, $1)=$CC
6403ba7b91d2SJef Poskanzer  _LT_CC_BASENAME([$compiler])
6404ba7b91d2SJef Poskanzer
6405ba7b91d2SJef Poskanzer  if test -n "$compiler"; then
6406ba7b91d2SJef Poskanzer    # We don't want -fno-exception when compiling C++ code, so set the
6407ba7b91d2SJef Poskanzer    # no_builtin_flag separately
64084874c4a8SBruce A. Mah    if test yes = "$GXX"; then
6409ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6410ba7b91d2SJef Poskanzer    else
6411ba7b91d2SJef Poskanzer      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6412ba7b91d2SJef Poskanzer    fi
6413ba7b91d2SJef Poskanzer
64144874c4a8SBruce A. Mah    if test yes = "$GXX"; then
6415ba7b91d2SJef Poskanzer      # Set up default GNU C++ configuration
6416ba7b91d2SJef Poskanzer
6417ba7b91d2SJef Poskanzer      LT_PATH_LD
6418ba7b91d2SJef Poskanzer
6419ba7b91d2SJef Poskanzer      # Check if GNU C++ uses GNU ld as the underlying linker, since the
6420ba7b91d2SJef Poskanzer      # archiving commands below assume that GNU ld is being used.
64214874c4a8SBruce A. Mah      if test yes = "$with_gnu_ld"; then
64224874c4a8SBruce A. Mah        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
64234874c4a8SBruce A. Mah        _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'
6424ba7b91d2SJef Poskanzer
64254874c4a8SBruce A. Mah        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
64264874c4a8SBruce A. Mah        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6427ba7b91d2SJef Poskanzer
6428ba7b91d2SJef Poskanzer        # If archive_cmds runs LD, not CC, wlarc should be empty
6429ba7b91d2SJef Poskanzer        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6430ba7b91d2SJef Poskanzer        #     investigate it a little bit more. (MM)
64314874c4a8SBruce A. Mah        wlarc='$wl'
6432ba7b91d2SJef Poskanzer
6433ba7b91d2SJef Poskanzer        # ancient GNU ld didn't support --whole-archive et. al.
6434ba7b91d2SJef Poskanzer        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
6435ba7b91d2SJef Poskanzer	  $GREP 'no-whole-archive' > /dev/null; then
64364874c4a8SBruce A. Mah          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
6437ba7b91d2SJef Poskanzer        else
6438ba7b91d2SJef Poskanzer          _LT_TAGVAR(whole_archive_flag_spec, $1)=
6439ba7b91d2SJef Poskanzer        fi
6440ba7b91d2SJef Poskanzer      else
6441ba7b91d2SJef Poskanzer        with_gnu_ld=no
6442ba7b91d2SJef Poskanzer        wlarc=
6443ba7b91d2SJef Poskanzer
6444ba7b91d2SJef Poskanzer        # A generic and very simple default shared library creation
6445ba7b91d2SJef Poskanzer        # command for GNU C++ for the case where it uses the native
6446ba7b91d2SJef Poskanzer        # linker, instead of GNU ld.  If possible, this setting should
6447ba7b91d2SJef Poskanzer        # overridden to take advantage of the native linker features on
6448ba7b91d2SJef Poskanzer        # the platform it is being used on.
6449ba7b91d2SJef Poskanzer        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6450ba7b91d2SJef Poskanzer      fi
6451ba7b91d2SJef Poskanzer
6452ba7b91d2SJef Poskanzer      # Commands to make compiler produce verbose output that lists
6453ba7b91d2SJef Poskanzer      # what "hidden" libraries, object files and flags are used when
6454ba7b91d2SJef Poskanzer      # linking a shared library.
64556edfd8d6SBruce A. Mah      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6456ba7b91d2SJef Poskanzer
6457ba7b91d2SJef Poskanzer    else
6458ba7b91d2SJef Poskanzer      GXX=no
6459ba7b91d2SJef Poskanzer      with_gnu_ld=no
6460ba7b91d2SJef Poskanzer      wlarc=
6461ba7b91d2SJef Poskanzer    fi
6462ba7b91d2SJef Poskanzer
6463ba7b91d2SJef Poskanzer    # PORTME: fill in a description of your system's C++ link characteristics
6464ba7b91d2SJef Poskanzer    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6465ba7b91d2SJef Poskanzer    _LT_TAGVAR(ld_shlibs, $1)=yes
6466ba7b91d2SJef Poskanzer    case $host_os in
6467ba7b91d2SJef Poskanzer      aix3*)
6468ba7b91d2SJef Poskanzer        # FIXME: insert proper C++ library support
6469ba7b91d2SJef Poskanzer        _LT_TAGVAR(ld_shlibs, $1)=no
6470ba7b91d2SJef Poskanzer        ;;
6471ba7b91d2SJef Poskanzer      aix[[4-9]]*)
64724874c4a8SBruce A. Mah        if test ia64 = "$host_cpu"; then
6473ba7b91d2SJef Poskanzer          # On IA64, the linker does run time linking by default, so we don't
6474ba7b91d2SJef Poskanzer          # have to do anything special.
6475ba7b91d2SJef Poskanzer          aix_use_runtimelinking=no
6476ba7b91d2SJef Poskanzer          exp_sym_flag='-Bexport'
64774874c4a8SBruce A. Mah          no_entry_flag=
6478ba7b91d2SJef Poskanzer        else
6479ba7b91d2SJef Poskanzer          aix_use_runtimelinking=no
6480ba7b91d2SJef Poskanzer
6481ba7b91d2SJef Poskanzer          # Test if we are trying to use run time linking or normal
6482ba7b91d2SJef Poskanzer          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
64834874c4a8SBruce A. Mah          # have runtime linking enabled, and use it for executables.
64844874c4a8SBruce A. Mah          # For shared libraries, we enable/disable runtime linking
64854874c4a8SBruce A. Mah          # depending on the kind of the shared library created -
64864874c4a8SBruce A. Mah          # when "with_aix_soname,aix_use_runtimelinking" is:
64874874c4a8SBruce A. Mah          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
64884874c4a8SBruce A. Mah          # "aix,yes"  lib.so          shared, rtl:yes, for executables
64894874c4a8SBruce A. Mah          #            lib.a           static archive
64904874c4a8SBruce A. Mah          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
64914874c4a8SBruce A. Mah          #            lib.a(lib.so.V) shared, rtl:no,  for executables
64924874c4a8SBruce A. Mah          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
64934874c4a8SBruce A. Mah          #            lib.a(lib.so.V) shared, rtl:no
64944874c4a8SBruce A. Mah          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
64954874c4a8SBruce A. Mah          #            lib.a           static archive
6496ba7b91d2SJef Poskanzer          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6497ba7b91d2SJef Poskanzer	    for ld_flag in $LDFLAGS; do
6498ba7b91d2SJef Poskanzer	      case $ld_flag in
6499ba7b91d2SJef Poskanzer	      *-brtl*)
6500ba7b91d2SJef Poskanzer	        aix_use_runtimelinking=yes
6501ba7b91d2SJef Poskanzer	        break
6502ba7b91d2SJef Poskanzer	        ;;
6503ba7b91d2SJef Poskanzer	      esac
6504ba7b91d2SJef Poskanzer	    done
65054874c4a8SBruce A. Mah	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
65064874c4a8SBruce A. Mah	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
65074874c4a8SBruce A. Mah	      # so we don't have lib.a shared libs to link our executables.
65084874c4a8SBruce A. Mah	      # We have to force runtime linking in this case.
65094874c4a8SBruce A. Mah	      aix_use_runtimelinking=yes
65104874c4a8SBruce A. Mah	      LDFLAGS="$LDFLAGS -Wl,-brtl"
65114874c4a8SBruce A. Mah	    fi
6512ba7b91d2SJef Poskanzer	    ;;
6513ba7b91d2SJef Poskanzer          esac
6514ba7b91d2SJef Poskanzer
6515ba7b91d2SJef Poskanzer          exp_sym_flag='-bexport'
6516ba7b91d2SJef Poskanzer          no_entry_flag='-bnoentry'
6517ba7b91d2SJef Poskanzer        fi
6518ba7b91d2SJef Poskanzer
6519ba7b91d2SJef Poskanzer        # When large executables or shared objects are built, AIX ld can
6520ba7b91d2SJef Poskanzer        # have problems creating the table of contents.  If linking a library
6521ba7b91d2SJef Poskanzer        # or program results in "error TOC overflow" add -mminimal-toc to
6522ba7b91d2SJef Poskanzer        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6523ba7b91d2SJef Poskanzer        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6524ba7b91d2SJef Poskanzer
6525ba7b91d2SJef Poskanzer        _LT_TAGVAR(archive_cmds, $1)=''
6526ba7b91d2SJef Poskanzer        _LT_TAGVAR(hardcode_direct, $1)=yes
6527ba7b91d2SJef Poskanzer        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6528ba7b91d2SJef Poskanzer        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6529ba7b91d2SJef Poskanzer        _LT_TAGVAR(link_all_deplibs, $1)=yes
65304874c4a8SBruce A. Mah        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
65314874c4a8SBruce A. Mah        case $with_aix_soname,$aix_use_runtimelinking in
65324874c4a8SBruce A. Mah        aix,*) ;;	# no import file
65334874c4a8SBruce A. Mah        svr4,* | *,yes) # use import file
65344874c4a8SBruce A. Mah          # The Import File defines what to hardcode.
65354874c4a8SBruce A. Mah          _LT_TAGVAR(hardcode_direct, $1)=no
65364874c4a8SBruce A. Mah          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
65374874c4a8SBruce A. Mah          ;;
65384874c4a8SBruce A. Mah        esac
6539ba7b91d2SJef Poskanzer
65404874c4a8SBruce A. Mah        if test yes = "$GXX"; then
6541ba7b91d2SJef Poskanzer          case $host_os in aix4.[[012]]|aix4.[[012]].*)
6542ba7b91d2SJef Poskanzer          # We only want to do this on AIX 4.2 and lower, the check
6543ba7b91d2SJef Poskanzer          # below for broken collect2 doesn't work under 4.3+
65444874c4a8SBruce A. Mah	  collect2name=`$CC -print-prog-name=collect2`
6545ba7b91d2SJef Poskanzer	  if test -f "$collect2name" &&
6546ba7b91d2SJef Poskanzer	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6547ba7b91d2SJef Poskanzer	  then
6548ba7b91d2SJef Poskanzer	    # We have reworked collect2
6549ba7b91d2SJef Poskanzer	    :
6550ba7b91d2SJef Poskanzer	  else
6551ba7b91d2SJef Poskanzer	    # We have old collect2
6552ba7b91d2SJef Poskanzer	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
6553ba7b91d2SJef Poskanzer	    # It fails to find uninstalled libraries when the uninstalled
6554ba7b91d2SJef Poskanzer	    # path is not listed in the libpath.  Setting hardcode_minus_L
6555ba7b91d2SJef Poskanzer	    # to unsupported forces relinking
6556ba7b91d2SJef Poskanzer	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
6557ba7b91d2SJef Poskanzer	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6558ba7b91d2SJef Poskanzer	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
6559ba7b91d2SJef Poskanzer	  fi
6560ba7b91d2SJef Poskanzer          esac
6561ba7b91d2SJef Poskanzer          shared_flag='-shared'
65624874c4a8SBruce A. Mah	  if test yes = "$aix_use_runtimelinking"; then
65634874c4a8SBruce A. Mah	    shared_flag=$shared_flag' $wl-G'
6564ba7b91d2SJef Poskanzer	  fi
65654874c4a8SBruce A. Mah	  # Need to ensure runtime linking is disabled for the traditional
65664874c4a8SBruce A. Mah	  # shared library, or the linker may eventually find shared libraries
65674874c4a8SBruce A. Mah	  # /with/ Import File - we do not want to mix them.
65684874c4a8SBruce A. Mah	  shared_flag_aix='-shared'
65694874c4a8SBruce A. Mah	  shared_flag_svr4='-shared $wl-G'
6570ba7b91d2SJef Poskanzer        else
6571ba7b91d2SJef Poskanzer          # not using gcc
65724874c4a8SBruce A. Mah          if test ia64 = "$host_cpu"; then
6573ba7b91d2SJef Poskanzer	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6574ba7b91d2SJef Poskanzer	  # chokes on -Wl,-G. The following line is correct:
6575ba7b91d2SJef Poskanzer	  shared_flag='-G'
6576ba7b91d2SJef Poskanzer          else
65774874c4a8SBruce A. Mah	    if test yes = "$aix_use_runtimelinking"; then
65784874c4a8SBruce A. Mah	      shared_flag='$wl-G'
6579ba7b91d2SJef Poskanzer	    else
65804874c4a8SBruce A. Mah	      shared_flag='$wl-bM:SRE'
6581ba7b91d2SJef Poskanzer	    fi
65824874c4a8SBruce A. Mah	    shared_flag_aix='$wl-bM:SRE'
65834874c4a8SBruce A. Mah	    shared_flag_svr4='$wl-G'
6584ba7b91d2SJef Poskanzer          fi
6585ba7b91d2SJef Poskanzer        fi
6586ba7b91d2SJef Poskanzer
65874874c4a8SBruce A. Mah        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
6588ba7b91d2SJef Poskanzer        # It seems that -bexpall does not export symbols beginning with
6589ba7b91d2SJef Poskanzer        # underscore (_), so it is better to generate a list of symbols to
6590ba7b91d2SJef Poskanzer	# export.
6591ba7b91d2SJef Poskanzer        _LT_TAGVAR(always_export_symbols, $1)=yes
65924874c4a8SBruce A. Mah	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
6593ba7b91d2SJef Poskanzer          # Warning - without using the other runtime loading flags (-brtl),
6594ba7b91d2SJef Poskanzer          # -berok will link without error, but may produce a broken library.
65954874c4a8SBruce A. Mah          # The "-G" linker flag allows undefined symbols.
65964874c4a8SBruce A. Mah          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
6597ba7b91d2SJef Poskanzer          # Determine the default libpath from the value encoded in an empty
6598ba7b91d2SJef Poskanzer          # executable.
65996edfd8d6SBruce A. Mah          _LT_SYS_MODULE_PATH_AIX([$1])
66004874c4a8SBruce A. Mah          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6601ba7b91d2SJef Poskanzer
66024874c4a8SBruce A. Mah          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
6603ba7b91d2SJef Poskanzer        else
66044874c4a8SBruce A. Mah          if test ia64 = "$host_cpu"; then
66054874c4a8SBruce A. Mah	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
6606ba7b91d2SJef Poskanzer	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
66074874c4a8SBruce A. Mah	    _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"
6608ba7b91d2SJef Poskanzer          else
6609ba7b91d2SJef Poskanzer	    # Determine the default libpath from the value encoded in an
6610ba7b91d2SJef Poskanzer	    # empty executable.
66116edfd8d6SBruce A. Mah	    _LT_SYS_MODULE_PATH_AIX([$1])
66124874c4a8SBruce A. Mah	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6613ba7b91d2SJef Poskanzer	    # Warning - without using the other run time loading flags,
6614ba7b91d2SJef Poskanzer	    # -berok will link without error, but may produce a broken library.
66154874c4a8SBruce A. Mah	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
66164874c4a8SBruce A. Mah	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
66174874c4a8SBruce A. Mah	    if test yes = "$with_gnu_ld"; then
66186edfd8d6SBruce A. Mah	      # We only use this code for GNU lds that support --whole-archive.
66194874c4a8SBruce A. Mah	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
66206edfd8d6SBruce A. Mah	    else
6621ba7b91d2SJef Poskanzer	      # Exported symbols can be pulled into shared objects from archives
6622ba7b91d2SJef Poskanzer	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
66236edfd8d6SBruce A. Mah	    fi
6624ba7b91d2SJef Poskanzer	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
66254874c4a8SBruce A. Mah	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
66264874c4a8SBruce A. Mah	    # -brtl affects multiple linker settings, -berok does not and is overridden later
66274874c4a8SBruce A. Mah	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
66284874c4a8SBruce A. Mah	    if test svr4 != "$with_aix_soname"; then
6629ba7b91d2SJef Poskanzer	      # This is similar to how AIX traditionally builds its shared
66304874c4a8SBruce A. Mah	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
66314874c4a8SBruce A. Mah	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
66324874c4a8SBruce A. Mah	    fi
66334874c4a8SBruce A. Mah	    if test aix != "$with_aix_soname"; then
66344874c4a8SBruce A. Mah	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
66354874c4a8SBruce A. Mah	    else
66364874c4a8SBruce A. Mah	      # used by -dlpreopen to get the symbols
66374874c4a8SBruce A. Mah	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
66384874c4a8SBruce A. Mah	    fi
66394874c4a8SBruce A. Mah	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
6640ba7b91d2SJef Poskanzer          fi
6641ba7b91d2SJef Poskanzer        fi
6642ba7b91d2SJef Poskanzer        ;;
6643ba7b91d2SJef Poskanzer
6644ba7b91d2SJef Poskanzer      beos*)
6645ba7b91d2SJef Poskanzer	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6646ba7b91d2SJef Poskanzer	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6647ba7b91d2SJef Poskanzer	  # Joseph Beckenbach <[email protected]> says some releases of gcc
6648ba7b91d2SJef Poskanzer	  # support --undefined.  This deserves some investigation.  FIXME
66494874c4a8SBruce A. Mah	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6650ba7b91d2SJef Poskanzer	else
6651ba7b91d2SJef Poskanzer	  _LT_TAGVAR(ld_shlibs, $1)=no
6652ba7b91d2SJef Poskanzer	fi
6653ba7b91d2SJef Poskanzer	;;
6654ba7b91d2SJef Poskanzer
6655ba7b91d2SJef Poskanzer      chorus*)
6656ba7b91d2SJef Poskanzer        case $cc_basename in
6657ba7b91d2SJef Poskanzer          *)
6658ba7b91d2SJef Poskanzer	  # FIXME: insert proper C++ library support
6659ba7b91d2SJef Poskanzer	  _LT_TAGVAR(ld_shlibs, $1)=no
6660ba7b91d2SJef Poskanzer	  ;;
6661ba7b91d2SJef Poskanzer        esac
6662ba7b91d2SJef Poskanzer        ;;
6663ba7b91d2SJef Poskanzer
666460bd98a5SBruce A. Mah      cygwin* | mingw* | pw32* | cegcc*)
66656edfd8d6SBruce A. Mah	case $GXX,$cc_basename in
6666*85b25c2eSBruce A. Mah	,cl* | no,cl* | ,icl* | no,icl*)
6667*85b25c2eSBruce A. Mah	  # Native MSVC or ICC
66686edfd8d6SBruce A. Mah	  # hardcode_libdir_flag_spec is actually meaningless, as there is
66696edfd8d6SBruce A. Mah	  # no search path for DLLs.
66706edfd8d6SBruce A. Mah	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
66716edfd8d6SBruce A. Mah	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
66726edfd8d6SBruce A. Mah	  _LT_TAGVAR(always_export_symbols, $1)=yes
66736edfd8d6SBruce A. Mah	  _LT_TAGVAR(file_list_spec, $1)='@'
66746edfd8d6SBruce A. Mah	  # Tell ltmain to make .lib files, not .a files.
66756edfd8d6SBruce A. Mah	  libext=lib
66766edfd8d6SBruce A. Mah	  # Tell ltmain to make .dll files, not .so files.
66774874c4a8SBruce A. Mah	  shrext_cmds=.dll
66786edfd8d6SBruce A. Mah	  # FIXME: Setting linknames here is a bad hack.
66794874c4a8SBruce A. Mah	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
66804874c4a8SBruce A. Mah	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
66814874c4a8SBruce A. Mah              cp "$export_symbols" "$output_objdir/$soname.def";
66824874c4a8SBruce A. Mah              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
66836edfd8d6SBruce A. Mah            else
66844874c4a8SBruce A. Mah              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
66856edfd8d6SBruce A. Mah            fi~
66866edfd8d6SBruce A. Mah            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
66876edfd8d6SBruce A. Mah            linknames='
66886edfd8d6SBruce A. Mah	  # The linker will not automatically build a static lib if we build a DLL.
66896edfd8d6SBruce A. Mah	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
66906edfd8d6SBruce A. Mah	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
66916edfd8d6SBruce A. Mah	  # Don't use ranlib
66926edfd8d6SBruce A. Mah	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
66936edfd8d6SBruce A. Mah	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
66946edfd8d6SBruce A. Mah            lt_tool_outputfile="@TOOL_OUTPUT@"~
66956edfd8d6SBruce A. Mah            case $lt_outputfile in
66966edfd8d6SBruce A. Mah              *.exe|*.EXE) ;;
66976edfd8d6SBruce A. Mah              *)
66984874c4a8SBruce A. Mah                lt_outputfile=$lt_outputfile.exe
66994874c4a8SBruce A. Mah                lt_tool_outputfile=$lt_tool_outputfile.exe
67006edfd8d6SBruce A. Mah                ;;
67016edfd8d6SBruce A. Mah            esac~
67026edfd8d6SBruce A. Mah            func_to_tool_file "$lt_outputfile"~
67034874c4a8SBruce A. Mah            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
67046edfd8d6SBruce A. Mah              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
67056edfd8d6SBruce A. Mah              $RM "$lt_outputfile.manifest";
67066edfd8d6SBruce A. Mah            fi'
67076edfd8d6SBruce A. Mah	  ;;
67086edfd8d6SBruce A. Mah	*)
67096edfd8d6SBruce A. Mah	  # g++
6710ba7b91d2SJef Poskanzer	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6711ba7b91d2SJef Poskanzer	  # as there is no search path for DLLs.
6712ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
67134874c4a8SBruce A. Mah	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
6714ba7b91d2SJef Poskanzer	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6715ba7b91d2SJef Poskanzer	  _LT_TAGVAR(always_export_symbols, $1)=no
6716ba7b91d2SJef Poskanzer	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6717ba7b91d2SJef Poskanzer
6718ba7b91d2SJef Poskanzer	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
67194874c4a8SBruce A. Mah	    _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'
67204874c4a8SBruce A. Mah	    # If the export-symbols file already is a .def file, use it as
67214874c4a8SBruce A. Mah	    # is; otherwise, prepend EXPORTS...
67224874c4a8SBruce A. Mah	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6723ba7b91d2SJef Poskanzer              cp $export_symbols $output_objdir/$soname.def;
6724ba7b91d2SJef Poskanzer            else
6725ba7b91d2SJef Poskanzer              echo EXPORTS > $output_objdir/$soname.def;
6726ba7b91d2SJef Poskanzer              cat $export_symbols >> $output_objdir/$soname.def;
6727ba7b91d2SJef Poskanzer            fi~
67284874c4a8SBruce A. Mah            $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'
6729ba7b91d2SJef Poskanzer	  else
6730ba7b91d2SJef Poskanzer	    _LT_TAGVAR(ld_shlibs, $1)=no
6731ba7b91d2SJef Poskanzer	  fi
6732ba7b91d2SJef Poskanzer	  ;;
67336edfd8d6SBruce A. Mah	esac
67346edfd8d6SBruce A. Mah	;;
6735ba7b91d2SJef Poskanzer      darwin* | rhapsody*)
6736ba7b91d2SJef Poskanzer        _LT_DARWIN_LINKER_FEATURES($1)
6737ba7b91d2SJef Poskanzer	;;
6738ba7b91d2SJef Poskanzer
67394874c4a8SBruce A. Mah      os2*)
67404874c4a8SBruce A. Mah	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
67414874c4a8SBruce A. Mah	_LT_TAGVAR(hardcode_minus_L, $1)=yes
67424874c4a8SBruce A. Mah	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
67434874c4a8SBruce A. Mah	shrext_cmds=.dll
67444874c4a8SBruce A. Mah	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
67454874c4a8SBruce A. Mah	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
67464874c4a8SBruce A. Mah	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
67474874c4a8SBruce A. Mah	  $ECHO EXPORTS >> $output_objdir/$libname.def~
67484874c4a8SBruce A. Mah	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
67494874c4a8SBruce A. Mah	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
67504874c4a8SBruce A. Mah	  emximp -o $lib $output_objdir/$libname.def'
67514874c4a8SBruce A. Mah	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
67524874c4a8SBruce A. Mah	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
67534874c4a8SBruce A. Mah	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
67544874c4a8SBruce A. Mah	  $ECHO EXPORTS >> $output_objdir/$libname.def~
67554874c4a8SBruce A. Mah	  prefix_cmds="$SED"~
67564874c4a8SBruce A. Mah	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
67574874c4a8SBruce A. Mah	    prefix_cmds="$prefix_cmds -e 1d";
67584874c4a8SBruce A. Mah	  fi~
67594874c4a8SBruce A. Mah	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
67604874c4a8SBruce A. Mah	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
67614874c4a8SBruce A. Mah	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
67624874c4a8SBruce A. Mah	  emximp -o $lib $output_objdir/$libname.def'
67634874c4a8SBruce A. Mah	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
67644874c4a8SBruce A. Mah	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6765*85b25c2eSBruce A. Mah	_LT_TAGVAR(file_list_spec, $1)='@'
67664874c4a8SBruce A. Mah	;;
67674874c4a8SBruce A. Mah
6768ba7b91d2SJef Poskanzer      dgux*)
6769ba7b91d2SJef Poskanzer        case $cc_basename in
6770ba7b91d2SJef Poskanzer          ec++*)
6771ba7b91d2SJef Poskanzer	    # FIXME: insert proper C++ library support
6772ba7b91d2SJef Poskanzer	    _LT_TAGVAR(ld_shlibs, $1)=no
6773ba7b91d2SJef Poskanzer	    ;;
6774ba7b91d2SJef Poskanzer          ghcx*)
6775ba7b91d2SJef Poskanzer	    # Green Hills C++ Compiler
6776ba7b91d2SJef Poskanzer	    # FIXME: insert proper C++ library support
6777ba7b91d2SJef Poskanzer	    _LT_TAGVAR(ld_shlibs, $1)=no
6778ba7b91d2SJef Poskanzer	    ;;
6779ba7b91d2SJef Poskanzer          *)
6780ba7b91d2SJef Poskanzer	    # FIXME: insert proper C++ library support
6781ba7b91d2SJef Poskanzer	    _LT_TAGVAR(ld_shlibs, $1)=no
6782ba7b91d2SJef Poskanzer	    ;;
6783ba7b91d2SJef Poskanzer        esac
6784ba7b91d2SJef Poskanzer        ;;
6785ba7b91d2SJef Poskanzer
67866edfd8d6SBruce A. Mah      freebsd2.*)
6787ba7b91d2SJef Poskanzer        # C++ shared libraries reported to be fairly broken before
6788ba7b91d2SJef Poskanzer	# switch to ELF
6789ba7b91d2SJef Poskanzer        _LT_TAGVAR(ld_shlibs, $1)=no
6790ba7b91d2SJef Poskanzer        ;;
6791ba7b91d2SJef Poskanzer
6792ba7b91d2SJef Poskanzer      freebsd-elf*)
6793ba7b91d2SJef Poskanzer        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6794ba7b91d2SJef Poskanzer        ;;
6795ba7b91d2SJef Poskanzer
6796*85b25c2eSBruce A. Mah      freebsd* | dragonfly* | midnightbsd*)
6797ba7b91d2SJef Poskanzer        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6798ba7b91d2SJef Poskanzer        # conventions
6799ba7b91d2SJef Poskanzer        _LT_TAGVAR(ld_shlibs, $1)=yes
6800ba7b91d2SJef Poskanzer        ;;
6801ba7b91d2SJef Poskanzer
68026edfd8d6SBruce A. Mah      haiku*)
68034874c4a8SBruce A. Mah        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
68046edfd8d6SBruce A. Mah        _LT_TAGVAR(link_all_deplibs, $1)=yes
68056edfd8d6SBruce A. Mah        ;;
68066edfd8d6SBruce A. Mah
6807ba7b91d2SJef Poskanzer      hpux9*)
68084874c4a8SBruce A. Mah        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6809ba7b91d2SJef Poskanzer        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
68104874c4a8SBruce A. Mah        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6811ba7b91d2SJef Poskanzer        _LT_TAGVAR(hardcode_direct, $1)=yes
6812ba7b91d2SJef Poskanzer        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6813ba7b91d2SJef Poskanzer				             # but as the default
6814ba7b91d2SJef Poskanzer				             # location of the library.
6815ba7b91d2SJef Poskanzer
6816ba7b91d2SJef Poskanzer        case $cc_basename in
6817ba7b91d2SJef Poskanzer          CC*)
6818ba7b91d2SJef Poskanzer            # FIXME: insert proper C++ library support
6819ba7b91d2SJef Poskanzer            _LT_TAGVAR(ld_shlibs, $1)=no
6820ba7b91d2SJef Poskanzer            ;;
6821ba7b91d2SJef Poskanzer          aCC*)
68224874c4a8SBruce A. Mah            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
6823ba7b91d2SJef Poskanzer            # Commands to make compiler produce verbose output that lists
6824ba7b91d2SJef Poskanzer            # what "hidden" libraries, object files and flags are used when
6825ba7b91d2SJef Poskanzer            # linking a shared library.
6826ba7b91d2SJef Poskanzer            #
6827ba7b91d2SJef Poskanzer            # There doesn't appear to be a way to prevent this compiler from
6828ba7b91d2SJef Poskanzer            # explicitly linking system object files so we need to strip them
6829ba7b91d2SJef Poskanzer            # from the output so that they don't get included in the library
6830ba7b91d2SJef Poskanzer            # dependencies.
68314874c4a8SBruce A. Mah            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"'
6832ba7b91d2SJef Poskanzer            ;;
6833ba7b91d2SJef Poskanzer          *)
68344874c4a8SBruce A. Mah            if test yes = "$GXX"; then
68354874c4a8SBruce A. Mah              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
6836ba7b91d2SJef Poskanzer            else
6837ba7b91d2SJef Poskanzer              # FIXME: insert proper C++ library support
6838ba7b91d2SJef Poskanzer              _LT_TAGVAR(ld_shlibs, $1)=no
6839ba7b91d2SJef Poskanzer            fi
6840ba7b91d2SJef Poskanzer            ;;
6841ba7b91d2SJef Poskanzer        esac
6842ba7b91d2SJef Poskanzer        ;;
6843ba7b91d2SJef Poskanzer
6844ba7b91d2SJef Poskanzer      hpux10*|hpux11*)
68454874c4a8SBruce A. Mah        if test no = "$with_gnu_ld"; then
68464874c4a8SBruce A. Mah	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6847ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6848ba7b91d2SJef Poskanzer
6849ba7b91d2SJef Poskanzer          case $host_cpu in
6850ba7b91d2SJef Poskanzer            hppa*64*|ia64*)
6851ba7b91d2SJef Poskanzer              ;;
6852ba7b91d2SJef Poskanzer            *)
68534874c4a8SBruce A. Mah	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6854ba7b91d2SJef Poskanzer              ;;
6855ba7b91d2SJef Poskanzer          esac
6856ba7b91d2SJef Poskanzer        fi
6857ba7b91d2SJef Poskanzer        case $host_cpu in
6858ba7b91d2SJef Poskanzer          hppa*64*|ia64*)
6859ba7b91d2SJef Poskanzer            _LT_TAGVAR(hardcode_direct, $1)=no
6860ba7b91d2SJef Poskanzer            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6861ba7b91d2SJef Poskanzer            ;;
6862ba7b91d2SJef Poskanzer          *)
6863ba7b91d2SJef Poskanzer            _LT_TAGVAR(hardcode_direct, $1)=yes
6864ba7b91d2SJef Poskanzer            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6865ba7b91d2SJef Poskanzer            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6866ba7b91d2SJef Poskanzer					         # but as the default
6867ba7b91d2SJef Poskanzer					         # location of the library.
6868ba7b91d2SJef Poskanzer            ;;
6869ba7b91d2SJef Poskanzer        esac
6870ba7b91d2SJef Poskanzer
6871ba7b91d2SJef Poskanzer        case $cc_basename in
6872ba7b91d2SJef Poskanzer          CC*)
6873ba7b91d2SJef Poskanzer	    # FIXME: insert proper C++ library support
6874ba7b91d2SJef Poskanzer	    _LT_TAGVAR(ld_shlibs, $1)=no
6875ba7b91d2SJef Poskanzer	    ;;
6876ba7b91d2SJef Poskanzer          aCC*)
6877ba7b91d2SJef Poskanzer	    case $host_cpu in
6878ba7b91d2SJef Poskanzer	      hppa*64*)
68794874c4a8SBruce A. Mah	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6880ba7b91d2SJef Poskanzer	        ;;
6881ba7b91d2SJef Poskanzer	      ia64*)
68824874c4a8SBruce A. Mah	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6883ba7b91d2SJef Poskanzer	        ;;
6884ba7b91d2SJef Poskanzer	      *)
68854874c4a8SBruce A. Mah	        _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'
6886ba7b91d2SJef Poskanzer	        ;;
6887ba7b91d2SJef Poskanzer	    esac
6888ba7b91d2SJef Poskanzer	    # Commands to make compiler produce verbose output that lists
6889ba7b91d2SJef Poskanzer	    # what "hidden" libraries, object files and flags are used when
6890ba7b91d2SJef Poskanzer	    # linking a shared library.
6891ba7b91d2SJef Poskanzer	    #
6892ba7b91d2SJef Poskanzer	    # There doesn't appear to be a way to prevent this compiler from
6893ba7b91d2SJef Poskanzer	    # explicitly linking system object files so we need to strip them
6894ba7b91d2SJef Poskanzer	    # from the output so that they don't get included in the library
6895ba7b91d2SJef Poskanzer	    # dependencies.
68964874c4a8SBruce A. Mah	    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"'
6897ba7b91d2SJef Poskanzer	    ;;
6898ba7b91d2SJef Poskanzer          *)
68994874c4a8SBruce A. Mah	    if test yes = "$GXX"; then
69004874c4a8SBruce A. Mah	      if test no = "$with_gnu_ld"; then
6901ba7b91d2SJef Poskanzer	        case $host_cpu in
6902ba7b91d2SJef Poskanzer	          hppa*64*)
69034874c4a8SBruce A. Mah	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6904ba7b91d2SJef Poskanzer	            ;;
6905ba7b91d2SJef Poskanzer	          ia64*)
69064874c4a8SBruce A. Mah	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6907ba7b91d2SJef Poskanzer	            ;;
6908ba7b91d2SJef Poskanzer	          *)
69094874c4a8SBruce A. Mah	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6910ba7b91d2SJef Poskanzer	            ;;
6911ba7b91d2SJef Poskanzer	        esac
6912ba7b91d2SJef Poskanzer	      fi
6913ba7b91d2SJef Poskanzer	    else
6914ba7b91d2SJef Poskanzer	      # FIXME: insert proper C++ library support
6915ba7b91d2SJef Poskanzer	      _LT_TAGVAR(ld_shlibs, $1)=no
6916ba7b91d2SJef Poskanzer	    fi
6917ba7b91d2SJef Poskanzer	    ;;
6918ba7b91d2SJef Poskanzer        esac
6919ba7b91d2SJef Poskanzer        ;;
6920ba7b91d2SJef Poskanzer
6921ba7b91d2SJef Poskanzer      interix[[3-9]]*)
6922ba7b91d2SJef Poskanzer	_LT_TAGVAR(hardcode_direct, $1)=no
6923ba7b91d2SJef Poskanzer	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
69244874c4a8SBruce A. Mah	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
69254874c4a8SBruce A. Mah	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6926ba7b91d2SJef Poskanzer	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6927ba7b91d2SJef Poskanzer	# Instead, shared libraries are loaded at an image base (0x10000000 by
6928ba7b91d2SJef Poskanzer	# default) and relocated if they conflict, which is a slow very memory
6929ba7b91d2SJef Poskanzer	# consuming and fragmenting process.  To avoid this, we pick a random,
6930ba7b91d2SJef Poskanzer	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6931ba7b91d2SJef Poskanzer	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
69324874c4a8SBruce A. Mah	_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'
6933*85b25c2eSBruce A. Mah	_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'
6934ba7b91d2SJef Poskanzer	;;
6935ba7b91d2SJef Poskanzer      irix5* | irix6*)
6936ba7b91d2SJef Poskanzer        case $cc_basename in
6937ba7b91d2SJef Poskanzer          CC*)
6938ba7b91d2SJef Poskanzer	    # SGI C++
69394874c4a8SBruce A. Mah	    _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'
6940ba7b91d2SJef Poskanzer
6941ba7b91d2SJef Poskanzer	    # Archives containing C++ object files must be created using
6942ba7b91d2SJef Poskanzer	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
6943ba7b91d2SJef Poskanzer	    # necessary to make sure instantiated templates are included
6944ba7b91d2SJef Poskanzer	    # in the archive.
6945ba7b91d2SJef Poskanzer	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6946ba7b91d2SJef Poskanzer	    ;;
6947ba7b91d2SJef Poskanzer          *)
69484874c4a8SBruce A. Mah	    if test yes = "$GXX"; then
69494874c4a8SBruce A. Mah	      if test no = "$with_gnu_ld"; then
69504874c4a8SBruce A. Mah	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
6951ba7b91d2SJef Poskanzer	      else
69524874c4a8SBruce A. Mah	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
6953ba7b91d2SJef Poskanzer	      fi
6954ba7b91d2SJef Poskanzer	    fi
6955ba7b91d2SJef Poskanzer	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6956ba7b91d2SJef Poskanzer	    ;;
6957ba7b91d2SJef Poskanzer        esac
69584874c4a8SBruce A. Mah        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6959ba7b91d2SJef Poskanzer        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6960ba7b91d2SJef Poskanzer        _LT_TAGVAR(inherit_rpath, $1)=yes
6961ba7b91d2SJef Poskanzer        ;;
6962ba7b91d2SJef Poskanzer
69634874c4a8SBruce A. Mah      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6964ba7b91d2SJef Poskanzer        case $cc_basename in
6965ba7b91d2SJef Poskanzer          KCC*)
6966ba7b91d2SJef Poskanzer	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6967ba7b91d2SJef Poskanzer
6968ba7b91d2SJef Poskanzer	    # KCC will only create a shared library if the output file
6969ba7b91d2SJef Poskanzer	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6970ba7b91d2SJef Poskanzer	    # to its proper name (with version) after linking.
69714874c4a8SBruce A. Mah	    _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'
69724874c4a8SBruce A. Mah	    _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'
6973ba7b91d2SJef Poskanzer	    # Commands to make compiler produce verbose output that lists
6974ba7b91d2SJef Poskanzer	    # what "hidden" libraries, object files and flags are used when
6975ba7b91d2SJef Poskanzer	    # linking a shared library.
6976ba7b91d2SJef Poskanzer	    #
6977ba7b91d2SJef Poskanzer	    # There doesn't appear to be a way to prevent this compiler from
6978ba7b91d2SJef Poskanzer	    # explicitly linking system object files so we need to strip them
6979ba7b91d2SJef Poskanzer	    # from the output so that they don't get included in the library
6980ba7b91d2SJef Poskanzer	    # dependencies.
69814874c4a8SBruce A. Mah	    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"'
6982ba7b91d2SJef Poskanzer
69834874c4a8SBruce A. Mah	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
69844874c4a8SBruce A. Mah	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6985ba7b91d2SJef Poskanzer
6986ba7b91d2SJef Poskanzer	    # Archives containing C++ object files must be created using
6987ba7b91d2SJef Poskanzer	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6988ba7b91d2SJef Poskanzer	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6989ba7b91d2SJef Poskanzer	    ;;
6990ba7b91d2SJef Poskanzer	  icpc* | ecpc* )
6991ba7b91d2SJef Poskanzer	    # Intel C++
6992ba7b91d2SJef Poskanzer	    with_gnu_ld=yes
6993ba7b91d2SJef Poskanzer	    # version 8.0 and above of icpc choke on multiply defined symbols
6994ba7b91d2SJef Poskanzer	    # if we add $predep_objects and $postdep_objects, however 7.1 and
6995ba7b91d2SJef Poskanzer	    # earlier do not add the objects themselves.
6996ba7b91d2SJef Poskanzer	    case `$CC -V 2>&1` in
6997ba7b91d2SJef Poskanzer	      *"Version 7."*)
69984874c4a8SBruce A. Mah	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
69994874c4a8SBruce A. Mah		_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'
7000ba7b91d2SJef Poskanzer		;;
7001ba7b91d2SJef Poskanzer	      *)  # Version 8.0 or newer
7002ba7b91d2SJef Poskanzer	        tmp_idyn=
7003ba7b91d2SJef Poskanzer	        case $host_cpu in
7004ba7b91d2SJef Poskanzer		  ia64*) tmp_idyn=' -i_dynamic';;
7005ba7b91d2SJef Poskanzer		esac
70064874c4a8SBruce A. Mah	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
70074874c4a8SBruce A. Mah		_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'
7008ba7b91d2SJef Poskanzer		;;
7009ba7b91d2SJef Poskanzer	    esac
7010ba7b91d2SJef Poskanzer	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
70114874c4a8SBruce A. Mah	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
70124874c4a8SBruce A. Mah	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
70134874c4a8SBruce A. Mah	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
7014ba7b91d2SJef Poskanzer	    ;;
7015ba7b91d2SJef Poskanzer          pgCC* | pgcpp*)
7016ba7b91d2SJef Poskanzer            # Portland Group C++ compiler
7017ba7b91d2SJef Poskanzer	    case `$CC -V` in
70186edfd8d6SBruce A. Mah	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
7019ba7b91d2SJef Poskanzer	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7020ba7b91d2SJef Poskanzer               rm -rf $tpldir~
7021ba7b91d2SJef Poskanzer               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
70226edfd8d6SBruce A. Mah               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7023ba7b91d2SJef Poskanzer	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7024ba7b91d2SJef Poskanzer                rm -rf $tpldir~
7025ba7b91d2SJef Poskanzer                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
70266edfd8d6SBruce A. Mah                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7027ba7b91d2SJef Poskanzer                $RANLIB $oldlib'
7028ba7b91d2SJef Poskanzer	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7029ba7b91d2SJef Poskanzer                rm -rf $tpldir~
7030ba7b91d2SJef Poskanzer                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
70314874c4a8SBruce A. Mah                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7032ba7b91d2SJef Poskanzer	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7033ba7b91d2SJef Poskanzer                rm -rf $tpldir~
7034ba7b91d2SJef Poskanzer                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
70354874c4a8SBruce A. Mah                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
7036ba7b91d2SJef Poskanzer	      ;;
70376edfd8d6SBruce A. Mah	    *) # Version 6 and above use weak symbols
70384874c4a8SBruce A. Mah	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
70394874c4a8SBruce A. Mah	      _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'
7040ba7b91d2SJef Poskanzer	      ;;
7041ba7b91d2SJef Poskanzer	    esac
7042ba7b91d2SJef Poskanzer
70434874c4a8SBruce A. Mah	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
70444874c4a8SBruce A. Mah	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
70454874c4a8SBruce A. Mah	    _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'
7046ba7b91d2SJef Poskanzer            ;;
7047ba7b91d2SJef Poskanzer	  cxx*)
7048ba7b91d2SJef Poskanzer	    # Compaq C++
70494874c4a8SBruce A. Mah	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
70504874c4a8SBruce A. Mah	    _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'
7051ba7b91d2SJef Poskanzer
7052ba7b91d2SJef Poskanzer	    runpath_var=LD_RUN_PATH
7053ba7b91d2SJef Poskanzer	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7054ba7b91d2SJef Poskanzer	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7055ba7b91d2SJef Poskanzer
7056ba7b91d2SJef Poskanzer	    # Commands to make compiler produce verbose output that lists
7057ba7b91d2SJef Poskanzer	    # what "hidden" libraries, object files and flags are used when
7058ba7b91d2SJef Poskanzer	    # linking a shared library.
7059ba7b91d2SJef Poskanzer	    #
7060ba7b91d2SJef Poskanzer	    # There doesn't appear to be a way to prevent this compiler from
7061ba7b91d2SJef Poskanzer	    # explicitly linking system object files so we need to strip them
7062ba7b91d2SJef Poskanzer	    # from the output so that they don't get included in the library
7063ba7b91d2SJef Poskanzer	    # dependencies.
70644874c4a8SBruce A. Mah	    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'
7065ba7b91d2SJef Poskanzer	    ;;
70666edfd8d6SBruce A. Mah	  xl* | mpixl* | bgxl*)
7067ba7b91d2SJef Poskanzer	    # IBM XL 8.0 on PPC, with GNU ld
70684874c4a8SBruce A. Mah	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
70694874c4a8SBruce A. Mah	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
70704874c4a8SBruce A. Mah	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
70714874c4a8SBruce A. Mah	    if test yes = "$supports_anon_versioning"; then
7072ba7b91d2SJef Poskanzer	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7073*85b25c2eSBruce A. Mah                cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7074ba7b91d2SJef Poskanzer                echo "local: *; };" >> $output_objdir/$libname.ver~
70754874c4a8SBruce A. Mah                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
7076ba7b91d2SJef Poskanzer	    fi
7077ba7b91d2SJef Poskanzer	    ;;
7078ba7b91d2SJef Poskanzer	  *)
7079*85b25c2eSBruce A. Mah	    case `$CC -V 2>&1 | $SED 5q` in
7080ba7b91d2SJef Poskanzer	    *Sun\ C*)
7081ba7b91d2SJef Poskanzer	      # Sun C++ 5.9
7082ba7b91d2SJef Poskanzer	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
70834874c4a8SBruce A. Mah	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
70844874c4a8SBruce A. Mah	      _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'
7085ba7b91d2SJef Poskanzer	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
70864874c4a8SBruce A. Mah	      _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'
7087ba7b91d2SJef Poskanzer	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7088ba7b91d2SJef Poskanzer
7089ba7b91d2SJef Poskanzer	      # Not sure whether something based on
7090ba7b91d2SJef Poskanzer	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7091ba7b91d2SJef Poskanzer	      # would be better.
70926edfd8d6SBruce A. Mah	      output_verbose_link_cmd='func_echo_all'
7093ba7b91d2SJef Poskanzer
7094ba7b91d2SJef Poskanzer	      # Archives containing C++ object files must be created using
7095ba7b91d2SJef Poskanzer	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7096ba7b91d2SJef Poskanzer	      # necessary to make sure instantiated templates are included
7097ba7b91d2SJef Poskanzer	      # in the archive.
7098ba7b91d2SJef Poskanzer	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7099ba7b91d2SJef Poskanzer	      ;;
7100ba7b91d2SJef Poskanzer	    esac
7101ba7b91d2SJef Poskanzer	    ;;
7102ba7b91d2SJef Poskanzer	esac
7103ba7b91d2SJef Poskanzer	;;
7104ba7b91d2SJef Poskanzer
7105ba7b91d2SJef Poskanzer      lynxos*)
7106ba7b91d2SJef Poskanzer        # FIXME: insert proper C++ library support
7107ba7b91d2SJef Poskanzer	_LT_TAGVAR(ld_shlibs, $1)=no
7108ba7b91d2SJef Poskanzer	;;
7109ba7b91d2SJef Poskanzer
7110ba7b91d2SJef Poskanzer      m88k*)
7111ba7b91d2SJef Poskanzer        # FIXME: insert proper C++ library support
7112ba7b91d2SJef Poskanzer        _LT_TAGVAR(ld_shlibs, $1)=no
7113ba7b91d2SJef Poskanzer	;;
7114ba7b91d2SJef Poskanzer
7115ba7b91d2SJef Poskanzer      mvs*)
7116ba7b91d2SJef Poskanzer        case $cc_basename in
7117ba7b91d2SJef Poskanzer          cxx*)
7118ba7b91d2SJef Poskanzer	    # FIXME: insert proper C++ library support
7119ba7b91d2SJef Poskanzer	    _LT_TAGVAR(ld_shlibs, $1)=no
7120ba7b91d2SJef Poskanzer	    ;;
7121ba7b91d2SJef Poskanzer	  *)
7122ba7b91d2SJef Poskanzer	    # FIXME: insert proper C++ library support
7123ba7b91d2SJef Poskanzer	    _LT_TAGVAR(ld_shlibs, $1)=no
7124ba7b91d2SJef Poskanzer	    ;;
7125ba7b91d2SJef Poskanzer	esac
7126ba7b91d2SJef Poskanzer	;;
7127ba7b91d2SJef Poskanzer
7128ba7b91d2SJef Poskanzer      netbsd*)
7129ba7b91d2SJef Poskanzer        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7130ba7b91d2SJef Poskanzer	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7131ba7b91d2SJef Poskanzer	  wlarc=
7132ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7133ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_direct, $1)=yes
7134ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7135ba7b91d2SJef Poskanzer	fi
7136ba7b91d2SJef Poskanzer	# Workaround some broken pre-1.5 toolchains
7137ba7b91d2SJef Poskanzer	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7138ba7b91d2SJef Poskanzer	;;
7139ba7b91d2SJef Poskanzer
7140ba7b91d2SJef Poskanzer      *nto* | *qnx*)
7141ba7b91d2SJef Poskanzer        _LT_TAGVAR(ld_shlibs, $1)=yes
7142ba7b91d2SJef Poskanzer	;;
7143ba7b91d2SJef Poskanzer
71444874c4a8SBruce A. Mah      openbsd* | bitrig*)
7145ba7b91d2SJef Poskanzer	if test -f /usr/libexec/ld.so; then
7146ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_direct, $1)=yes
7147ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7148ba7b91d2SJef Poskanzer	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7149ba7b91d2SJef Poskanzer	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
71504874c4a8SBruce A. Mah	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
71514874c4a8SBruce A. Mah	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
71524874c4a8SBruce A. Mah	    _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'
71534874c4a8SBruce A. Mah	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
71544874c4a8SBruce A. Mah	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
7155ba7b91d2SJef Poskanzer	  fi
71566edfd8d6SBruce A. Mah	  output_verbose_link_cmd=func_echo_all
7157ba7b91d2SJef Poskanzer	else
7158ba7b91d2SJef Poskanzer	  _LT_TAGVAR(ld_shlibs, $1)=no
7159ba7b91d2SJef Poskanzer	fi
7160ba7b91d2SJef Poskanzer	;;
7161ba7b91d2SJef Poskanzer
7162ba7b91d2SJef Poskanzer      osf3* | osf4* | osf5*)
7163ba7b91d2SJef Poskanzer        case $cc_basename in
7164ba7b91d2SJef Poskanzer          KCC*)
7165ba7b91d2SJef Poskanzer	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7166ba7b91d2SJef Poskanzer
7167ba7b91d2SJef Poskanzer	    # KCC will only create a shared library if the output file
7168ba7b91d2SJef Poskanzer	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7169ba7b91d2SJef Poskanzer	    # to its proper name (with version) after linking.
71704874c4a8SBruce A. Mah	    _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'
7171ba7b91d2SJef Poskanzer
71724874c4a8SBruce A. Mah	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7173ba7b91d2SJef Poskanzer	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7174ba7b91d2SJef Poskanzer
7175ba7b91d2SJef Poskanzer	    # Archives containing C++ object files must be created using
7176ba7b91d2SJef Poskanzer	    # the KAI C++ compiler.
7177ba7b91d2SJef Poskanzer	    case $host in
7178ba7b91d2SJef Poskanzer	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7179ba7b91d2SJef Poskanzer	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7180ba7b91d2SJef Poskanzer	    esac
7181ba7b91d2SJef Poskanzer	    ;;
7182ba7b91d2SJef Poskanzer          RCC*)
7183ba7b91d2SJef Poskanzer	    # Rational C++ 2.4.1
7184ba7b91d2SJef Poskanzer	    # FIXME: insert proper C++ library support
7185ba7b91d2SJef Poskanzer	    _LT_TAGVAR(ld_shlibs, $1)=no
7186ba7b91d2SJef Poskanzer	    ;;
7187ba7b91d2SJef Poskanzer          cxx*)
7188ba7b91d2SJef Poskanzer	    case $host in
7189ba7b91d2SJef Poskanzer	      osf3*)
71904874c4a8SBruce A. Mah	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
71914874c4a8SBruce A. Mah	        _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'
71924874c4a8SBruce A. Mah	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7193ba7b91d2SJef Poskanzer		;;
7194ba7b91d2SJef Poskanzer	      *)
7195ba7b91d2SJef Poskanzer	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
71964874c4a8SBruce A. Mah	        _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'
7197ba7b91d2SJef Poskanzer	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7198ba7b91d2SJef Poskanzer                  echo "-hidden">> $lib.exp~
71994874c4a8SBruce A. Mah                  $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~
7200ba7b91d2SJef Poskanzer                  $RM $lib.exp'
7201ba7b91d2SJef Poskanzer	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7202ba7b91d2SJef Poskanzer		;;
7203ba7b91d2SJef Poskanzer	    esac
7204ba7b91d2SJef Poskanzer
7205ba7b91d2SJef Poskanzer	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7206ba7b91d2SJef Poskanzer
7207ba7b91d2SJef Poskanzer	    # Commands to make compiler produce verbose output that lists
7208ba7b91d2SJef Poskanzer	    # what "hidden" libraries, object files and flags are used when
7209ba7b91d2SJef Poskanzer	    # linking a shared library.
7210ba7b91d2SJef Poskanzer	    #
7211ba7b91d2SJef Poskanzer	    # There doesn't appear to be a way to prevent this compiler from
7212ba7b91d2SJef Poskanzer	    # explicitly linking system object files so we need to strip them
7213ba7b91d2SJef Poskanzer	    # from the output so that they don't get included in the library
7214ba7b91d2SJef Poskanzer	    # dependencies.
72154874c4a8SBruce A. Mah	    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"'
7216ba7b91d2SJef Poskanzer	    ;;
7217ba7b91d2SJef Poskanzer	  *)
72184874c4a8SBruce A. Mah	    if test yes,no = "$GXX,$with_gnu_ld"; then
72194874c4a8SBruce A. Mah	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7220ba7b91d2SJef Poskanzer	      case $host in
7221ba7b91d2SJef Poskanzer	        osf3*)
72224874c4a8SBruce A. Mah	          _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'
7223ba7b91d2SJef Poskanzer		  ;;
7224ba7b91d2SJef Poskanzer	        *)
72254874c4a8SBruce A. Mah	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
7226ba7b91d2SJef Poskanzer		  ;;
7227ba7b91d2SJef Poskanzer	      esac
7228ba7b91d2SJef Poskanzer
72294874c4a8SBruce A. Mah	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7230ba7b91d2SJef Poskanzer	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7231ba7b91d2SJef Poskanzer
7232ba7b91d2SJef Poskanzer	      # Commands to make compiler produce verbose output that lists
7233ba7b91d2SJef Poskanzer	      # what "hidden" libraries, object files and flags are used when
7234ba7b91d2SJef Poskanzer	      # linking a shared library.
72356edfd8d6SBruce A. Mah	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7236ba7b91d2SJef Poskanzer
7237ba7b91d2SJef Poskanzer	    else
7238ba7b91d2SJef Poskanzer	      # FIXME: insert proper C++ library support
7239ba7b91d2SJef Poskanzer	      _LT_TAGVAR(ld_shlibs, $1)=no
7240ba7b91d2SJef Poskanzer	    fi
7241ba7b91d2SJef Poskanzer	    ;;
7242ba7b91d2SJef Poskanzer        esac
7243ba7b91d2SJef Poskanzer        ;;
7244ba7b91d2SJef Poskanzer
7245ba7b91d2SJef Poskanzer      psos*)
7246ba7b91d2SJef Poskanzer        # FIXME: insert proper C++ library support
7247ba7b91d2SJef Poskanzer        _LT_TAGVAR(ld_shlibs, $1)=no
7248ba7b91d2SJef Poskanzer        ;;
7249ba7b91d2SJef Poskanzer
7250ba7b91d2SJef Poskanzer      sunos4*)
7251ba7b91d2SJef Poskanzer        case $cc_basename in
7252ba7b91d2SJef Poskanzer          CC*)
7253ba7b91d2SJef Poskanzer	    # Sun C++ 4.x
7254ba7b91d2SJef Poskanzer	    # FIXME: insert proper C++ library support
7255ba7b91d2SJef Poskanzer	    _LT_TAGVAR(ld_shlibs, $1)=no
7256ba7b91d2SJef Poskanzer	    ;;
7257ba7b91d2SJef Poskanzer          lcc*)
7258ba7b91d2SJef Poskanzer	    # Lucid
7259ba7b91d2SJef Poskanzer	    # FIXME: insert proper C++ library support
7260ba7b91d2SJef Poskanzer	    _LT_TAGVAR(ld_shlibs, $1)=no
7261ba7b91d2SJef Poskanzer	    ;;
7262ba7b91d2SJef Poskanzer          *)
7263ba7b91d2SJef Poskanzer	    # FIXME: insert proper C++ library support
7264ba7b91d2SJef Poskanzer	    _LT_TAGVAR(ld_shlibs, $1)=no
7265ba7b91d2SJef Poskanzer	    ;;
7266ba7b91d2SJef Poskanzer        esac
7267ba7b91d2SJef Poskanzer        ;;
7268ba7b91d2SJef Poskanzer
7269ba7b91d2SJef Poskanzer      solaris*)
7270ba7b91d2SJef Poskanzer        case $cc_basename in
72716edfd8d6SBruce A. Mah          CC* | sunCC*)
7272ba7b91d2SJef Poskanzer	    # Sun C++ 4.2, 5.x and Centerline C++
7273ba7b91d2SJef Poskanzer            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7274ba7b91d2SJef Poskanzer	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
72754874c4a8SBruce A. Mah	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7276ba7b91d2SJef Poskanzer	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
72774874c4a8SBruce A. Mah              $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'
7278ba7b91d2SJef Poskanzer
7279ba7b91d2SJef Poskanzer	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7280ba7b91d2SJef Poskanzer	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7281ba7b91d2SJef Poskanzer	    case $host_os in
7282ba7b91d2SJef Poskanzer	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7283ba7b91d2SJef Poskanzer	      *)
7284ba7b91d2SJef Poskanzer		# The compiler driver will combine and reorder linker options,
72854874c4a8SBruce A. Mah		# but understands '-z linker_flag'.
7286ba7b91d2SJef Poskanzer	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7287ba7b91d2SJef Poskanzer		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7288ba7b91d2SJef Poskanzer	        ;;
7289ba7b91d2SJef Poskanzer	    esac
7290ba7b91d2SJef Poskanzer	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7291ba7b91d2SJef Poskanzer
72926edfd8d6SBruce A. Mah	    output_verbose_link_cmd='func_echo_all'
7293ba7b91d2SJef Poskanzer
7294ba7b91d2SJef Poskanzer	    # Archives containing C++ object files must be created using
7295ba7b91d2SJef Poskanzer	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7296ba7b91d2SJef Poskanzer	    # necessary to make sure instantiated templates are included
7297ba7b91d2SJef Poskanzer	    # in the archive.
7298ba7b91d2SJef Poskanzer	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7299ba7b91d2SJef Poskanzer	    ;;
7300ba7b91d2SJef Poskanzer          gcx*)
7301ba7b91d2SJef Poskanzer	    # Green Hills C++ Compiler
73024874c4a8SBruce A. Mah	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7303ba7b91d2SJef Poskanzer
7304ba7b91d2SJef Poskanzer	    # The C++ compiler must be used to create the archive.
7305ba7b91d2SJef Poskanzer	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7306ba7b91d2SJef Poskanzer	    ;;
7307ba7b91d2SJef Poskanzer          *)
7308ba7b91d2SJef Poskanzer	    # GNU C++ compiler with Solaris linker
73094874c4a8SBruce A. Mah	    if test yes,no = "$GXX,$with_gnu_ld"; then
73104874c4a8SBruce A. Mah	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
7311ba7b91d2SJef Poskanzer	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
73124874c4a8SBruce A. Mah	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7313ba7b91d2SJef Poskanzer	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
73144874c4a8SBruce A. Mah                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7315ba7b91d2SJef Poskanzer
7316ba7b91d2SJef Poskanzer	        # Commands to make compiler produce verbose output that lists
7317ba7b91d2SJef Poskanzer	        # what "hidden" libraries, object files and flags are used when
7318ba7b91d2SJef Poskanzer	        # linking a shared library.
73196edfd8d6SBruce A. Mah	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7320ba7b91d2SJef Poskanzer	      else
73214874c4a8SBruce A. Mah	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
7322ba7b91d2SJef Poskanzer	        # platform.
73234874c4a8SBruce A. Mah	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7324ba7b91d2SJef Poskanzer	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
73254874c4a8SBruce A. Mah                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7326ba7b91d2SJef Poskanzer
7327ba7b91d2SJef Poskanzer	        # Commands to make compiler produce verbose output that lists
7328ba7b91d2SJef Poskanzer	        # what "hidden" libraries, object files and flags are used when
7329ba7b91d2SJef Poskanzer	        # linking a shared library.
73306edfd8d6SBruce A. Mah	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7331ba7b91d2SJef Poskanzer	      fi
7332ba7b91d2SJef Poskanzer
73334874c4a8SBruce A. Mah	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
7334ba7b91d2SJef Poskanzer	      case $host_os in
7335ba7b91d2SJef Poskanzer		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7336ba7b91d2SJef Poskanzer		*)
73374874c4a8SBruce A. Mah		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
7338ba7b91d2SJef Poskanzer		  ;;
7339ba7b91d2SJef Poskanzer	      esac
7340ba7b91d2SJef Poskanzer	    fi
7341ba7b91d2SJef Poskanzer	    ;;
7342ba7b91d2SJef Poskanzer        esac
7343ba7b91d2SJef Poskanzer        ;;
7344ba7b91d2SJef Poskanzer
7345ba7b91d2SJef Poskanzer    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
73464874c4a8SBruce A. Mah      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7347ba7b91d2SJef Poskanzer      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7348ba7b91d2SJef Poskanzer      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7349ba7b91d2SJef Poskanzer      runpath_var='LD_RUN_PATH'
7350ba7b91d2SJef Poskanzer
7351ba7b91d2SJef Poskanzer      case $cc_basename in
7352ba7b91d2SJef Poskanzer        CC*)
73534874c4a8SBruce A. Mah	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73544874c4a8SBruce A. Mah	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7355ba7b91d2SJef Poskanzer	  ;;
7356ba7b91d2SJef Poskanzer	*)
73574874c4a8SBruce A. Mah	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73584874c4a8SBruce A. Mah	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7359ba7b91d2SJef Poskanzer	  ;;
7360ba7b91d2SJef Poskanzer      esac
7361ba7b91d2SJef Poskanzer      ;;
7362ba7b91d2SJef Poskanzer
7363ba7b91d2SJef Poskanzer      sysv5* | sco3.2v5* | sco5v6*)
73644874c4a8SBruce A. Mah	# Note: We CANNOT use -z defs as we might desire, because we do not
7365ba7b91d2SJef Poskanzer	# link with -lc, and that would cause any symbols used from libc to
7366ba7b91d2SJef Poskanzer	# always be unresolved, which means just about no library would
7367ba7b91d2SJef Poskanzer	# ever link correctly.  If we're not using GNU ld we use -z text
7368ba7b91d2SJef Poskanzer	# though, which does catch some bad symbols but isn't as heavy-handed
7369ba7b91d2SJef Poskanzer	# as -z defs.
73704874c4a8SBruce A. Mah	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
73714874c4a8SBruce A. Mah	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
7372ba7b91d2SJef Poskanzer	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7373ba7b91d2SJef Poskanzer	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
73744874c4a8SBruce A. Mah	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
7375ba7b91d2SJef Poskanzer	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7376ba7b91d2SJef Poskanzer	_LT_TAGVAR(link_all_deplibs, $1)=yes
73774874c4a8SBruce A. Mah	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
7378ba7b91d2SJef Poskanzer	runpath_var='LD_RUN_PATH'
7379ba7b91d2SJef Poskanzer
7380ba7b91d2SJef Poskanzer	case $cc_basename in
7381ba7b91d2SJef Poskanzer          CC*)
73824874c4a8SBruce A. Mah	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73834874c4a8SBruce A. Mah	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73846edfd8d6SBruce A. Mah	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
73856edfd8d6SBruce A. Mah              '"$_LT_TAGVAR(old_archive_cmds, $1)"
73866edfd8d6SBruce A. Mah	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
73876edfd8d6SBruce A. Mah              '"$_LT_TAGVAR(reload_cmds, $1)"
7388ba7b91d2SJef Poskanzer	    ;;
7389ba7b91d2SJef Poskanzer	  *)
73904874c4a8SBruce A. Mah	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73914874c4a8SBruce A. Mah	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7392ba7b91d2SJef Poskanzer	    ;;
7393ba7b91d2SJef Poskanzer	esac
7394ba7b91d2SJef Poskanzer      ;;
7395ba7b91d2SJef Poskanzer
7396ba7b91d2SJef Poskanzer      tandem*)
7397ba7b91d2SJef Poskanzer        case $cc_basename in
7398ba7b91d2SJef Poskanzer          NCC*)
7399ba7b91d2SJef Poskanzer	    # NonStop-UX NCC 3.20
7400ba7b91d2SJef Poskanzer	    # FIXME: insert proper C++ library support
7401ba7b91d2SJef Poskanzer	    _LT_TAGVAR(ld_shlibs, $1)=no
7402ba7b91d2SJef Poskanzer	    ;;
7403ba7b91d2SJef Poskanzer          *)
7404ba7b91d2SJef Poskanzer	    # FIXME: insert proper C++ library support
7405ba7b91d2SJef Poskanzer	    _LT_TAGVAR(ld_shlibs, $1)=no
7406ba7b91d2SJef Poskanzer	    ;;
7407ba7b91d2SJef Poskanzer        esac
7408ba7b91d2SJef Poskanzer        ;;
7409ba7b91d2SJef Poskanzer
7410ba7b91d2SJef Poskanzer      vxworks*)
7411ba7b91d2SJef Poskanzer        # FIXME: insert proper C++ library support
7412ba7b91d2SJef Poskanzer        _LT_TAGVAR(ld_shlibs, $1)=no
7413ba7b91d2SJef Poskanzer        ;;
7414ba7b91d2SJef Poskanzer
7415ba7b91d2SJef Poskanzer      *)
7416ba7b91d2SJef Poskanzer        # FIXME: insert proper C++ library support
7417ba7b91d2SJef Poskanzer        _LT_TAGVAR(ld_shlibs, $1)=no
7418ba7b91d2SJef Poskanzer        ;;
7419ba7b91d2SJef Poskanzer    esac
7420ba7b91d2SJef Poskanzer
7421ba7b91d2SJef Poskanzer    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
74224874c4a8SBruce A. Mah    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
7423ba7b91d2SJef Poskanzer
74244874c4a8SBruce A. Mah    _LT_TAGVAR(GCC, $1)=$GXX
74254874c4a8SBruce A. Mah    _LT_TAGVAR(LD, $1)=$LD
7426ba7b91d2SJef Poskanzer
7427ba7b91d2SJef Poskanzer    ## CAVEAT EMPTOR:
7428ba7b91d2SJef Poskanzer    ## There is no encapsulation within the following macros, do not change
7429ba7b91d2SJef Poskanzer    ## the running order or otherwise move them around unless you know exactly
7430ba7b91d2SJef Poskanzer    ## what you are doing...
7431ba7b91d2SJef Poskanzer    _LT_SYS_HIDDEN_LIBDEPS($1)
7432ba7b91d2SJef Poskanzer    _LT_COMPILER_PIC($1)
7433ba7b91d2SJef Poskanzer    _LT_COMPILER_C_O($1)
7434ba7b91d2SJef Poskanzer    _LT_COMPILER_FILE_LOCKS($1)
7435ba7b91d2SJef Poskanzer    _LT_LINKER_SHLIBS($1)
7436ba7b91d2SJef Poskanzer    _LT_SYS_DYNAMIC_LINKER($1)
7437ba7b91d2SJef Poskanzer    _LT_LINKER_HARDCODE_LIBPATH($1)
7438ba7b91d2SJef Poskanzer
7439ba7b91d2SJef Poskanzer    _LT_CONFIG($1)
7440ba7b91d2SJef Poskanzer  fi # test -n "$compiler"
7441ba7b91d2SJef Poskanzer
7442ba7b91d2SJef Poskanzer  CC=$lt_save_CC
74436edfd8d6SBruce A. Mah  CFLAGS=$lt_save_CFLAGS
7444ba7b91d2SJef Poskanzer  LDCXX=$LD
7445ba7b91d2SJef Poskanzer  LD=$lt_save_LD
7446ba7b91d2SJef Poskanzer  GCC=$lt_save_GCC
7447ba7b91d2SJef Poskanzer  with_gnu_ld=$lt_save_with_gnu_ld
7448ba7b91d2SJef Poskanzer  lt_cv_path_LDCXX=$lt_cv_path_LD
7449ba7b91d2SJef Poskanzer  lt_cv_path_LD=$lt_save_path_LD
7450ba7b91d2SJef Poskanzer  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7451ba7b91d2SJef Poskanzer  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
74524874c4a8SBruce A. Mahfi # test yes != "$_lt_caught_CXX_error"
7453ba7b91d2SJef Poskanzer
7454ba7b91d2SJef PoskanzerAC_LANG_POP
7455ba7b91d2SJef Poskanzer])# _LT_LANG_CXX_CONFIG
7456ba7b91d2SJef Poskanzer
7457ba7b91d2SJef Poskanzer
74586edfd8d6SBruce A. Mah# _LT_FUNC_STRIPNAME_CNF
74596edfd8d6SBruce A. Mah# ----------------------
74606edfd8d6SBruce A. Mah# func_stripname_cnf prefix suffix name
74616edfd8d6SBruce A. Mah# strip PREFIX and SUFFIX off of NAME.
74626edfd8d6SBruce A. Mah# PREFIX and SUFFIX must not contain globbing or regex special
74636edfd8d6SBruce A. Mah# characters, hashes, percent signs, but SUFFIX may contain a leading
74646edfd8d6SBruce A. Mah# dot (in which case that matches only a dot).
74656edfd8d6SBruce A. Mah#
74666edfd8d6SBruce A. Mah# This function is identical to the (non-XSI) version of func_stripname,
74676edfd8d6SBruce A. Mah# except this one can be used by m4 code that may be executed by configure,
74686edfd8d6SBruce A. Mah# rather than the libtool script.
74696edfd8d6SBruce A. Mahm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
74706edfd8d6SBruce A. MahAC_REQUIRE([_LT_DECL_SED])
74716edfd8d6SBruce A. MahAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
74726edfd8d6SBruce A. Mahfunc_stripname_cnf ()
74736edfd8d6SBruce A. Mah{
74744874c4a8SBruce A. Mah  case @S|@2 in
74754874c4a8SBruce A. Mah  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
74764874c4a8SBruce A. Mah  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
74776edfd8d6SBruce A. Mah  esac
74786edfd8d6SBruce A. Mah} # func_stripname_cnf
74796edfd8d6SBruce A. Mah])# _LT_FUNC_STRIPNAME_CNF
74806edfd8d6SBruce A. Mah
74815461579dSBruce A. Mah
7482ba7b91d2SJef Poskanzer# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7483e34c20c8SJon Dugan# ---------------------------------
7484ba7b91d2SJef Poskanzer# Figure out "hidden" library dependencies from verbose
7485ba7b91d2SJef Poskanzer# compiler output when linking a shared library.
7486ba7b91d2SJef Poskanzer# Parse the compiler output and extract the necessary
7487ba7b91d2SJef Poskanzer# objects, libraries and library flags.
7488ba7b91d2SJef Poskanzerm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7489ba7b91d2SJef Poskanzer[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
74906edfd8d6SBruce A. MahAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7491ba7b91d2SJef Poskanzer# Dependencies to place before and after the object being linked:
7492ba7b91d2SJef Poskanzer_LT_TAGVAR(predep_objects, $1)=
7493ba7b91d2SJef Poskanzer_LT_TAGVAR(postdep_objects, $1)=
7494ba7b91d2SJef Poskanzer_LT_TAGVAR(predeps, $1)=
7495ba7b91d2SJef Poskanzer_LT_TAGVAR(postdeps, $1)=
7496ba7b91d2SJef Poskanzer_LT_TAGVAR(compiler_lib_search_path, $1)=
7497ba7b91d2SJef Poskanzer
7498ba7b91d2SJef Poskanzerdnl we can't use the lt_simple_compile_test_code here,
7499ba7b91d2SJef Poskanzerdnl because it contains code intended for an executable,
7500ba7b91d2SJef Poskanzerdnl not a library.  It's possible we should let each
7501ba7b91d2SJef Poskanzerdnl tag define a new lt_????_link_test_code variable,
7502ba7b91d2SJef Poskanzerdnl but it's only used here...
7503ba7b91d2SJef Poskanzerm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7504ba7b91d2SJef Poskanzerint a;
7505ba7b91d2SJef Poskanzervoid foo (void) { a = 0; }
7506ba7b91d2SJef Poskanzer_LT_EOF
7507ba7b91d2SJef Poskanzer], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7508ba7b91d2SJef Poskanzerclass Foo
7509ba7b91d2SJef Poskanzer{
7510ba7b91d2SJef Poskanzerpublic:
7511ba7b91d2SJef Poskanzer  Foo (void) { a = 0; }
7512ba7b91d2SJef Poskanzerprivate:
7513ba7b91d2SJef Poskanzer  int a;
7514ba7b91d2SJef Poskanzer};
7515ba7b91d2SJef Poskanzer_LT_EOF
7516ba7b91d2SJef Poskanzer], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7517ba7b91d2SJef Poskanzer      subroutine foo
7518ba7b91d2SJef Poskanzer      implicit none
7519ba7b91d2SJef Poskanzer      integer*4 a
7520ba7b91d2SJef Poskanzer      a=0
7521ba7b91d2SJef Poskanzer      return
7522ba7b91d2SJef Poskanzer      end
7523ba7b91d2SJef Poskanzer_LT_EOF
7524ba7b91d2SJef Poskanzer], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7525ba7b91d2SJef Poskanzer      subroutine foo
7526ba7b91d2SJef Poskanzer      implicit none
7527ba7b91d2SJef Poskanzer      integer a
7528ba7b91d2SJef Poskanzer      a=0
7529ba7b91d2SJef Poskanzer      return
7530ba7b91d2SJef Poskanzer      end
7531ba7b91d2SJef Poskanzer_LT_EOF
7532ba7b91d2SJef Poskanzer], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7533ba7b91d2SJef Poskanzerpublic class foo {
7534ba7b91d2SJef Poskanzer  private int a;
7535ba7b91d2SJef Poskanzer  public void bar (void) {
7536ba7b91d2SJef Poskanzer    a = 0;
7537ba7b91d2SJef Poskanzer  }
7538ba7b91d2SJef Poskanzer};
7539ba7b91d2SJef Poskanzer_LT_EOF
75406edfd8d6SBruce A. Mah], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
75416edfd8d6SBruce A. Mahpackage foo
75426edfd8d6SBruce A. Mahfunc foo() {
75436edfd8d6SBruce A. Mah}
75446edfd8d6SBruce A. Mah_LT_EOF
7545ba7b91d2SJef Poskanzer])
75466edfd8d6SBruce A. Mah
75476edfd8d6SBruce A. Mah_lt_libdeps_save_CFLAGS=$CFLAGS
75486edfd8d6SBruce A. Mahcase "$CC $CFLAGS " in #(
75496edfd8d6SBruce A. Mah*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
75506edfd8d6SBruce A. Mah*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
75516edfd8d6SBruce A. Mah*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
75526edfd8d6SBruce A. Mahesac
75536edfd8d6SBruce A. Mah
7554ba7b91d2SJef Poskanzerdnl Parse the compiler output and extract the necessary
7555ba7b91d2SJef Poskanzerdnl objects, libraries and library flags.
7556ba7b91d2SJef Poskanzerif AC_TRY_EVAL(ac_compile); then
7557ba7b91d2SJef Poskanzer  # Parse the compiler output and extract the necessary
7558ba7b91d2SJef Poskanzer  # objects, libraries and library flags.
7559ba7b91d2SJef Poskanzer
7560ba7b91d2SJef Poskanzer  # Sentinel used to keep track of whether or not we are before
7561ba7b91d2SJef Poskanzer  # the conftest object file.
7562ba7b91d2SJef Poskanzer  pre_test_object_deps_done=no
7563ba7b91d2SJef Poskanzer
7564ba7b91d2SJef Poskanzer  for p in `eval "$output_verbose_link_cmd"`; do
75654874c4a8SBruce A. Mah    case $prev$p in
7566ba7b91d2SJef Poskanzer
7567ba7b91d2SJef Poskanzer    -L* | -R* | -l*)
7568ba7b91d2SJef Poskanzer       # Some compilers place space between "-{L,R}" and the path.
7569ba7b91d2SJef Poskanzer       # Remove the space.
75704874c4a8SBruce A. Mah       if test x-L = "$p" ||
75714874c4a8SBruce A. Mah          test x-R = "$p"; then
7572ba7b91d2SJef Poskanzer	 prev=$p
7573ba7b91d2SJef Poskanzer	 continue
7574ba7b91d2SJef Poskanzer       fi
7575ba7b91d2SJef Poskanzer
75766edfd8d6SBruce A. Mah       # Expand the sysroot to ease extracting the directories later.
75776edfd8d6SBruce A. Mah       if test -z "$prev"; then
75785d2f2cf9SBruce A. Mah         case $p in
75796edfd8d6SBruce A. Mah         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
75806edfd8d6SBruce A. Mah         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
75816edfd8d6SBruce A. Mah         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
75826edfd8d6SBruce A. Mah         esac
75836edfd8d6SBruce A. Mah       fi
75846edfd8d6SBruce A. Mah       case $p in
75856edfd8d6SBruce A. Mah       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
75866edfd8d6SBruce A. Mah       esac
75874874c4a8SBruce A. Mah       if test no = "$pre_test_object_deps_done"; then
75884874c4a8SBruce A. Mah	 case $prev in
75896edfd8d6SBruce A. Mah	 -L | -R)
7590ba7b91d2SJef Poskanzer	   # Internal compiler library paths should come after those
7591ba7b91d2SJef Poskanzer	   # provided the user.  The postdeps already come after the
7592ba7b91d2SJef Poskanzer	   # user supplied libs so there is no need to process them.
7593ba7b91d2SJef Poskanzer	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
75944874c4a8SBruce A. Mah	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
7595ba7b91d2SJef Poskanzer	   else
75964874c4a8SBruce A. Mah	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
7597ba7b91d2SJef Poskanzer	   fi
7598ba7b91d2SJef Poskanzer	   ;;
7599ba7b91d2SJef Poskanzer	 # The "-l" case would never come before the object being
7600ba7b91d2SJef Poskanzer	 # linked, so don't bother handling this case.
7601ba7b91d2SJef Poskanzer	 esac
7602ba7b91d2SJef Poskanzer       else
7603ba7b91d2SJef Poskanzer	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
76044874c4a8SBruce A. Mah	   _LT_TAGVAR(postdeps, $1)=$prev$p
7605ba7b91d2SJef Poskanzer	 else
76064874c4a8SBruce A. Mah	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
7607ba7b91d2SJef Poskanzer	 fi
7608ba7b91d2SJef Poskanzer       fi
76096edfd8d6SBruce A. Mah       prev=
7610ba7b91d2SJef Poskanzer       ;;
7611ba7b91d2SJef Poskanzer
76126edfd8d6SBruce A. Mah    *.lto.$objext) ;; # Ignore GCC LTO objects
7613ba7b91d2SJef Poskanzer    *.$objext)
7614ba7b91d2SJef Poskanzer       # This assumes that the test object file only shows up
7615ba7b91d2SJef Poskanzer       # once in the compiler output.
7616ba7b91d2SJef Poskanzer       if test "$p" = "conftest.$objext"; then
7617ba7b91d2SJef Poskanzer	 pre_test_object_deps_done=yes
7618ba7b91d2SJef Poskanzer	 continue
7619ba7b91d2SJef Poskanzer       fi
7620ba7b91d2SJef Poskanzer
76214874c4a8SBruce A. Mah       if test no = "$pre_test_object_deps_done"; then
7622ba7b91d2SJef Poskanzer	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
76234874c4a8SBruce A. Mah	   _LT_TAGVAR(predep_objects, $1)=$p
7624ba7b91d2SJef Poskanzer	 else
7625ba7b91d2SJef Poskanzer	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7626ba7b91d2SJef Poskanzer	 fi
7627ba7b91d2SJef Poskanzer       else
7628ba7b91d2SJef Poskanzer	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
76294874c4a8SBruce A. Mah	   _LT_TAGVAR(postdep_objects, $1)=$p
7630ba7b91d2SJef Poskanzer	 else
7631ba7b91d2SJef Poskanzer	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7632ba7b91d2SJef Poskanzer	 fi
7633ba7b91d2SJef Poskanzer       fi
7634ba7b91d2SJef Poskanzer       ;;
7635ba7b91d2SJef Poskanzer
7636ba7b91d2SJef Poskanzer    *) ;; # Ignore the rest.
7637ba7b91d2SJef Poskanzer
7638ba7b91d2SJef Poskanzer    esac
7639ba7b91d2SJef Poskanzer  done
7640ba7b91d2SJef Poskanzer
7641ba7b91d2SJef Poskanzer  # Clean up.
7642ba7b91d2SJef Poskanzer  rm -f a.out a.exe
7643ba7b91d2SJef Poskanzerelse
7644ba7b91d2SJef Poskanzer  echo "libtool.m4: error: problem compiling $1 test program"
7645ba7b91d2SJef Poskanzerfi
7646ba7b91d2SJef Poskanzer
7647ba7b91d2SJef Poskanzer$RM -f confest.$objext
76486edfd8d6SBruce A. MahCFLAGS=$_lt_libdeps_save_CFLAGS
7649ba7b91d2SJef Poskanzer
7650ba7b91d2SJef Poskanzer# PORTME: override above test on systems where it is broken
7651ba7b91d2SJef Poskanzerm4_if([$1], [CXX],
7652ba7b91d2SJef Poskanzer[case $host_os in
7653ba7b91d2SJef Poskanzerinterix[[3-9]]*)
7654ba7b91d2SJef Poskanzer  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7655ba7b91d2SJef Poskanzer  # hack all around it, let's just trust "g++" to DTRT.
7656ba7b91d2SJef Poskanzer  _LT_TAGVAR(predep_objects,$1)=
7657ba7b91d2SJef Poskanzer  _LT_TAGVAR(postdep_objects,$1)=
7658ba7b91d2SJef Poskanzer  _LT_TAGVAR(postdeps,$1)=
7659ba7b91d2SJef Poskanzer  ;;
7660ba7b91d2SJef Poskanzeresac
7661ba7b91d2SJef Poskanzer])
7662ba7b91d2SJef Poskanzer
7663ba7b91d2SJef Poskanzercase " $_LT_TAGVAR(postdeps, $1) " in
7664ba7b91d2SJef Poskanzer*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7665ba7b91d2SJef Poskanzeresac
7666ba7b91d2SJef Poskanzer _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7667ba7b91d2SJef Poskanzerif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
76684874c4a8SBruce A. Mah _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
7669ba7b91d2SJef Poskanzerfi
7670ba7b91d2SJef Poskanzer_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7671ba7b91d2SJef Poskanzer    [The directories searched by this compiler when creating a shared library])
7672ba7b91d2SJef Poskanzer_LT_TAGDECL([], [predep_objects], [1],
7673ba7b91d2SJef Poskanzer    [Dependencies to place before and after the objects being linked to
7674ba7b91d2SJef Poskanzer    create a shared library])
7675ba7b91d2SJef Poskanzer_LT_TAGDECL([], [postdep_objects], [1])
7676ba7b91d2SJef Poskanzer_LT_TAGDECL([], [predeps], [1])
7677ba7b91d2SJef Poskanzer_LT_TAGDECL([], [postdeps], [1])
7678ba7b91d2SJef Poskanzer_LT_TAGDECL([], [compiler_lib_search_path], [1],
7679ba7b91d2SJef Poskanzer    [The library search path used internally by the compiler when linking
7680ba7b91d2SJef Poskanzer    a shared library])
7681ba7b91d2SJef Poskanzer])# _LT_SYS_HIDDEN_LIBDEPS
7682e34c20c8SJon Dugan
76832ab386bfSjef
7684ba7b91d2SJef Poskanzer# _LT_LANG_F77_CONFIG([TAG])
7685ba7b91d2SJef Poskanzer# --------------------------
7686ba7b91d2SJef Poskanzer# Ensure that the configuration variables for a Fortran 77 compiler are
7687ba7b91d2SJef Poskanzer# suitably defined.  These variables are subsequently used by _LT_CONFIG
76884874c4a8SBruce A. Mah# to write the compiler configuration to 'libtool'.
7689ba7b91d2SJef Poskanzerm4_defun([_LT_LANG_F77_CONFIG],
76906edfd8d6SBruce A. Mah[AC_LANG_PUSH(Fortran 77)
76914874c4a8SBruce A. Mahif test -z "$F77" || test no = "$F77"; then
76926edfd8d6SBruce A. Mah  _lt_disable_F77=yes
76936edfd8d6SBruce A. Mahfi
7694ba7b91d2SJef Poskanzer
7695ba7b91d2SJef Poskanzer_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7696ba7b91d2SJef Poskanzer_LT_TAGVAR(allow_undefined_flag, $1)=
7697ba7b91d2SJef Poskanzer_LT_TAGVAR(always_export_symbols, $1)=no
7698ba7b91d2SJef Poskanzer_LT_TAGVAR(archive_expsym_cmds, $1)=
7699ba7b91d2SJef Poskanzer_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7700ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_direct, $1)=no
7701ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7702ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7703ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_libdir_separator, $1)=
7704ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_minus_L, $1)=no
7705ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_automatic, $1)=no
7706ba7b91d2SJef Poskanzer_LT_TAGVAR(inherit_rpath, $1)=no
7707ba7b91d2SJef Poskanzer_LT_TAGVAR(module_cmds, $1)=
7708ba7b91d2SJef Poskanzer_LT_TAGVAR(module_expsym_cmds, $1)=
7709ba7b91d2SJef Poskanzer_LT_TAGVAR(link_all_deplibs, $1)=unknown
7710ba7b91d2SJef Poskanzer_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
77116edfd8d6SBruce A. Mah_LT_TAGVAR(reload_flag, $1)=$reload_flag
77126edfd8d6SBruce A. Mah_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7713ba7b91d2SJef Poskanzer_LT_TAGVAR(no_undefined_flag, $1)=
7714ba7b91d2SJef Poskanzer_LT_TAGVAR(whole_archive_flag_spec, $1)=
7715ba7b91d2SJef Poskanzer_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7716ba7b91d2SJef Poskanzer
7717ba7b91d2SJef Poskanzer# Source file extension for f77 test sources.
7718ba7b91d2SJef Poskanzerac_ext=f
7719ba7b91d2SJef Poskanzer
7720ba7b91d2SJef Poskanzer# Object file extension for compiled f77 test sources.
7721ba7b91d2SJef Poskanzerobjext=o
7722ba7b91d2SJef Poskanzer_LT_TAGVAR(objext, $1)=$objext
7723ba7b91d2SJef Poskanzer
7724ba7b91d2SJef Poskanzer# No sense in running all these tests if we already determined that
7725ba7b91d2SJef Poskanzer# the F77 compiler isn't working.  Some variables (like enable_shared)
7726ba7b91d2SJef Poskanzer# are currently assumed to apply to all compilers on this platform,
7727ba7b91d2SJef Poskanzer# and will be corrupted by setting them based on a non-working compiler.
77284874c4a8SBruce A. Mahif test yes != "$_lt_disable_F77"; then
7729ba7b91d2SJef Poskanzer  # Code to be used in simple compile tests
7730ba7b91d2SJef Poskanzer  lt_simple_compile_test_code="\
7731ba7b91d2SJef Poskanzer      subroutine t
7732ba7b91d2SJef Poskanzer      return
7733ba7b91d2SJef Poskanzer      end
7734ba7b91d2SJef Poskanzer"
7735ba7b91d2SJef Poskanzer
7736ba7b91d2SJef Poskanzer  # Code to be used in simple link tests
7737ba7b91d2SJef Poskanzer  lt_simple_link_test_code="\
7738ba7b91d2SJef Poskanzer      program t
7739ba7b91d2SJef Poskanzer      end
7740ba7b91d2SJef Poskanzer"
7741ba7b91d2SJef Poskanzer
7742ba7b91d2SJef Poskanzer  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7743ba7b91d2SJef Poskanzer  _LT_TAG_COMPILER
7744ba7b91d2SJef Poskanzer
7745ba7b91d2SJef Poskanzer  # save warnings/boilerplate of simple test code
7746ba7b91d2SJef Poskanzer  _LT_COMPILER_BOILERPLATE
7747ba7b91d2SJef Poskanzer  _LT_LINKER_BOILERPLATE
7748ba7b91d2SJef Poskanzer
7749ba7b91d2SJef Poskanzer  # Allow CC to be a program name with arguments.
77504874c4a8SBruce A. Mah  lt_save_CC=$CC
7751ba7b91d2SJef Poskanzer  lt_save_GCC=$GCC
77526edfd8d6SBruce A. Mah  lt_save_CFLAGS=$CFLAGS
7753ba7b91d2SJef Poskanzer  CC=${F77-"f77"}
77546edfd8d6SBruce A. Mah  CFLAGS=$FFLAGS
7755ba7b91d2SJef Poskanzer  compiler=$CC
7756ba7b91d2SJef Poskanzer  _LT_TAGVAR(compiler, $1)=$CC
7757ba7b91d2SJef Poskanzer  _LT_CC_BASENAME([$compiler])
7758ba7b91d2SJef Poskanzer  GCC=$G77
7759ba7b91d2SJef Poskanzer  if test -n "$compiler"; then
7760ba7b91d2SJef Poskanzer    AC_MSG_CHECKING([if libtool supports shared libraries])
7761ba7b91d2SJef Poskanzer    AC_MSG_RESULT([$can_build_shared])
7762ba7b91d2SJef Poskanzer
7763ba7b91d2SJef Poskanzer    AC_MSG_CHECKING([whether to build shared libraries])
77644874c4a8SBruce A. Mah    test no = "$can_build_shared" && enable_shared=no
7765ba7b91d2SJef Poskanzer
7766ba7b91d2SJef Poskanzer    # On AIX, shared libraries and static libraries use the same namespace, and
7767ba7b91d2SJef Poskanzer    # are all built from PIC.
7768ba7b91d2SJef Poskanzer    case $host_os in
7769ba7b91d2SJef Poskanzer      aix3*)
77704874c4a8SBruce A. Mah        test yes = "$enable_shared" && enable_static=no
7771ba7b91d2SJef Poskanzer        if test -n "$RANLIB"; then
7772ba7b91d2SJef Poskanzer          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7773ba7b91d2SJef Poskanzer          postinstall_cmds='$RANLIB $lib'
7774ba7b91d2SJef Poskanzer        fi
7775ba7b91d2SJef Poskanzer        ;;
7776ba7b91d2SJef Poskanzer      aix[[4-9]]*)
77774874c4a8SBruce A. Mah	if test ia64 != "$host_cpu"; then
77784874c4a8SBruce A. Mah	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
77794874c4a8SBruce A. Mah	  yes,aix,yes) ;;		# shared object as lib.so file only
77804874c4a8SBruce A. Mah	  yes,svr4,*) ;;		# shared object as lib.so archive member only
77814874c4a8SBruce A. Mah	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
77824874c4a8SBruce A. Mah	  esac
7783ba7b91d2SJef Poskanzer	fi
7784ba7b91d2SJef Poskanzer        ;;
7785ba7b91d2SJef Poskanzer    esac
7786ba7b91d2SJef Poskanzer    AC_MSG_RESULT([$enable_shared])
7787ba7b91d2SJef Poskanzer
7788ba7b91d2SJef Poskanzer    AC_MSG_CHECKING([whether to build static libraries])
7789ba7b91d2SJef Poskanzer    # Make sure either enable_shared or enable_static is yes.
77904874c4a8SBruce A. Mah    test yes = "$enable_shared" || enable_static=yes
7791ba7b91d2SJef Poskanzer    AC_MSG_RESULT([$enable_static])
7792ba7b91d2SJef Poskanzer
77934874c4a8SBruce A. Mah    _LT_TAGVAR(GCC, $1)=$G77
77944874c4a8SBruce A. Mah    _LT_TAGVAR(LD, $1)=$LD
7795ba7b91d2SJef Poskanzer
7796ba7b91d2SJef Poskanzer    ## CAVEAT EMPTOR:
7797ba7b91d2SJef Poskanzer    ## There is no encapsulation within the following macros, do not change
7798ba7b91d2SJef Poskanzer    ## the running order or otherwise move them around unless you know exactly
7799ba7b91d2SJef Poskanzer    ## what you are doing...
7800ba7b91d2SJef Poskanzer    _LT_COMPILER_PIC($1)
7801ba7b91d2SJef Poskanzer    _LT_COMPILER_C_O($1)
7802ba7b91d2SJef Poskanzer    _LT_COMPILER_FILE_LOCKS($1)
7803ba7b91d2SJef Poskanzer    _LT_LINKER_SHLIBS($1)
7804ba7b91d2SJef Poskanzer    _LT_SYS_DYNAMIC_LINKER($1)
7805ba7b91d2SJef Poskanzer    _LT_LINKER_HARDCODE_LIBPATH($1)
7806ba7b91d2SJef Poskanzer
7807ba7b91d2SJef Poskanzer    _LT_CONFIG($1)
7808ba7b91d2SJef Poskanzer  fi # test -n "$compiler"
7809ba7b91d2SJef Poskanzer
7810ba7b91d2SJef Poskanzer  GCC=$lt_save_GCC
78114874c4a8SBruce A. Mah  CC=$lt_save_CC
78124874c4a8SBruce A. Mah  CFLAGS=$lt_save_CFLAGS
78134874c4a8SBruce A. Mahfi # test yes != "$_lt_disable_F77"
7814ba7b91d2SJef Poskanzer
7815ba7b91d2SJef PoskanzerAC_LANG_POP
7816ba7b91d2SJef Poskanzer])# _LT_LANG_F77_CONFIG
7817ba7b91d2SJef Poskanzer
7818ba7b91d2SJef Poskanzer
7819ba7b91d2SJef Poskanzer# _LT_LANG_FC_CONFIG([TAG])
7820ba7b91d2SJef Poskanzer# -------------------------
7821ba7b91d2SJef Poskanzer# Ensure that the configuration variables for a Fortran compiler are
7822ba7b91d2SJef Poskanzer# suitably defined.  These variables are subsequently used by _LT_CONFIG
78234874c4a8SBruce A. Mah# to write the compiler configuration to 'libtool'.
7824ba7b91d2SJef Poskanzerm4_defun([_LT_LANG_FC_CONFIG],
78256edfd8d6SBruce A. Mah[AC_LANG_PUSH(Fortran)
78266edfd8d6SBruce A. Mah
78274874c4a8SBruce A. Mahif test -z "$FC" || test no = "$FC"; then
78286edfd8d6SBruce A. Mah  _lt_disable_FC=yes
78296edfd8d6SBruce A. Mahfi
7830ba7b91d2SJef Poskanzer
7831ba7b91d2SJef Poskanzer_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7832ba7b91d2SJef Poskanzer_LT_TAGVAR(allow_undefined_flag, $1)=
7833ba7b91d2SJef Poskanzer_LT_TAGVAR(always_export_symbols, $1)=no
7834ba7b91d2SJef Poskanzer_LT_TAGVAR(archive_expsym_cmds, $1)=
7835ba7b91d2SJef Poskanzer_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7836ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_direct, $1)=no
7837ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7838ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7839ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_libdir_separator, $1)=
7840ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_minus_L, $1)=no
7841ba7b91d2SJef Poskanzer_LT_TAGVAR(hardcode_automatic, $1)=no
7842ba7b91d2SJef Poskanzer_LT_TAGVAR(inherit_rpath, $1)=no
7843ba7b91d2SJef Poskanzer_LT_TAGVAR(module_cmds, $1)=
7844ba7b91d2SJef Poskanzer_LT_TAGVAR(module_expsym_cmds, $1)=
7845ba7b91d2SJef Poskanzer_LT_TAGVAR(link_all_deplibs, $1)=unknown
7846ba7b91d2SJef Poskanzer_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
78476edfd8d6SBruce A. Mah_LT_TAGVAR(reload_flag, $1)=$reload_flag
78486edfd8d6SBruce A. Mah_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7849ba7b91d2SJef Poskanzer_LT_TAGVAR(no_undefined_flag, $1)=
7850ba7b91d2SJef Poskanzer_LT_TAGVAR(whole_archive_flag_spec, $1)=
7851ba7b91d2SJef Poskanzer_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7852ba7b91d2SJef Poskanzer
7853ba7b91d2SJef Poskanzer# Source file extension for fc test sources.
7854ba7b91d2SJef Poskanzerac_ext=${ac_fc_srcext-f}
7855ba7b91d2SJef Poskanzer
7856ba7b91d2SJef Poskanzer# Object file extension for compiled fc test sources.
7857ba7b91d2SJef Poskanzerobjext=o
7858ba7b91d2SJef Poskanzer_LT_TAGVAR(objext, $1)=$objext
7859ba7b91d2SJef Poskanzer
7860ba7b91d2SJef Poskanzer# No sense in running all these tests if we already determined that
7861ba7b91d2SJef Poskanzer# the FC compiler isn't working.  Some variables (like enable_shared)
7862ba7b91d2SJef Poskanzer# are currently assumed to apply to all compilers on this platform,
7863ba7b91d2SJef Poskanzer# and will be corrupted by setting them based on a non-working compiler.
78644874c4a8SBruce A. Mahif test yes != "$_lt_disable_FC"; then
7865ba7b91d2SJef Poskanzer  # Code to be used in simple compile tests
7866ba7b91d2SJef Poskanzer  lt_simple_compile_test_code="\
7867ba7b91d2SJef Poskanzer      subroutine t
7868ba7b91d2SJef Poskanzer      return
7869ba7b91d2SJef Poskanzer      end
7870ba7b91d2SJef Poskanzer"
7871ba7b91d2SJef Poskanzer
7872ba7b91d2SJef Poskanzer  # Code to be used in simple link tests
7873ba7b91d2SJef Poskanzer  lt_simple_link_test_code="\
7874ba7b91d2SJef Poskanzer      program t
7875ba7b91d2SJef Poskanzer      end
7876ba7b91d2SJef Poskanzer"
7877ba7b91d2SJef Poskanzer
7878ba7b91d2SJef Poskanzer  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7879ba7b91d2SJef Poskanzer  _LT_TAG_COMPILER
7880ba7b91d2SJef Poskanzer
7881ba7b91d2SJef Poskanzer  # save warnings/boilerplate of simple test code
7882ba7b91d2SJef Poskanzer  _LT_COMPILER_BOILERPLATE
7883ba7b91d2SJef Poskanzer  _LT_LINKER_BOILERPLATE
7884ba7b91d2SJef Poskanzer
7885ba7b91d2SJef Poskanzer  # Allow CC to be a program name with arguments.
78864874c4a8SBruce A. Mah  lt_save_CC=$CC
7887ba7b91d2SJef Poskanzer  lt_save_GCC=$GCC
78886edfd8d6SBruce A. Mah  lt_save_CFLAGS=$CFLAGS
7889ba7b91d2SJef Poskanzer  CC=${FC-"f95"}
78906edfd8d6SBruce A. Mah  CFLAGS=$FCFLAGS
7891ba7b91d2SJef Poskanzer  compiler=$CC
7892ba7b91d2SJef Poskanzer  GCC=$ac_cv_fc_compiler_gnu
7893ba7b91d2SJef Poskanzer
7894ba7b91d2SJef Poskanzer  _LT_TAGVAR(compiler, $1)=$CC
7895ba7b91d2SJef Poskanzer  _LT_CC_BASENAME([$compiler])
7896ba7b91d2SJef Poskanzer
7897ba7b91d2SJef Poskanzer  if test -n "$compiler"; then
7898ba7b91d2SJef Poskanzer    AC_MSG_CHECKING([if libtool supports shared libraries])
7899ba7b91d2SJef Poskanzer    AC_MSG_RESULT([$can_build_shared])
7900ba7b91d2SJef Poskanzer
7901ba7b91d2SJef Poskanzer    AC_MSG_CHECKING([whether to build shared libraries])
79024874c4a8SBruce A. Mah    test no = "$can_build_shared" && enable_shared=no
7903ba7b91d2SJef Poskanzer
7904ba7b91d2SJef Poskanzer    # On AIX, shared libraries and static libraries use the same namespace, and
7905ba7b91d2SJef Poskanzer    # are all built from PIC.
7906ba7b91d2SJef Poskanzer    case $host_os in
7907ba7b91d2SJef Poskanzer      aix3*)
79084874c4a8SBruce A. Mah        test yes = "$enable_shared" && enable_static=no
7909ba7b91d2SJef Poskanzer        if test -n "$RANLIB"; then
7910ba7b91d2SJef Poskanzer          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7911ba7b91d2SJef Poskanzer          postinstall_cmds='$RANLIB $lib'
7912ba7b91d2SJef Poskanzer        fi
7913ba7b91d2SJef Poskanzer        ;;
7914ba7b91d2SJef Poskanzer      aix[[4-9]]*)
79154874c4a8SBruce A. Mah	if test ia64 != "$host_cpu"; then
79164874c4a8SBruce A. Mah	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
79174874c4a8SBruce A. Mah	  yes,aix,yes) ;;		# shared object as lib.so file only
79184874c4a8SBruce A. Mah	  yes,svr4,*) ;;		# shared object as lib.so archive member only
79194874c4a8SBruce A. Mah	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
79204874c4a8SBruce A. Mah	  esac
7921ba7b91d2SJef Poskanzer	fi
7922ba7b91d2SJef Poskanzer        ;;
7923ba7b91d2SJef Poskanzer    esac
7924ba7b91d2SJef Poskanzer    AC_MSG_RESULT([$enable_shared])
7925ba7b91d2SJef Poskanzer
7926ba7b91d2SJef Poskanzer    AC_MSG_CHECKING([whether to build static libraries])
7927ba7b91d2SJef Poskanzer    # Make sure either enable_shared or enable_static is yes.
79284874c4a8SBruce A. Mah    test yes = "$enable_shared" || enable_static=yes
7929ba7b91d2SJef Poskanzer    AC_MSG_RESULT([$enable_static])
7930ba7b91d2SJef Poskanzer
79314874c4a8SBruce A. Mah    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
79324874c4a8SBruce A. Mah    _LT_TAGVAR(LD, $1)=$LD
7933ba7b91d2SJef Poskanzer
7934ba7b91d2SJef Poskanzer    ## CAVEAT EMPTOR:
7935ba7b91d2SJef Poskanzer    ## There is no encapsulation within the following macros, do not change
7936ba7b91d2SJef Poskanzer    ## the running order or otherwise move them around unless you know exactly
7937ba7b91d2SJef Poskanzer    ## what you are doing...
7938ba7b91d2SJef Poskanzer    _LT_SYS_HIDDEN_LIBDEPS($1)
7939ba7b91d2SJef Poskanzer    _LT_COMPILER_PIC($1)
7940ba7b91d2SJef Poskanzer    _LT_COMPILER_C_O($1)
7941ba7b91d2SJef Poskanzer    _LT_COMPILER_FILE_LOCKS($1)
7942ba7b91d2SJef Poskanzer    _LT_LINKER_SHLIBS($1)
7943ba7b91d2SJef Poskanzer    _LT_SYS_DYNAMIC_LINKER($1)
7944ba7b91d2SJef Poskanzer    _LT_LINKER_HARDCODE_LIBPATH($1)
7945ba7b91d2SJef Poskanzer
7946ba7b91d2SJef Poskanzer    _LT_CONFIG($1)
7947ba7b91d2SJef Poskanzer  fi # test -n "$compiler"
7948ba7b91d2SJef Poskanzer
7949ba7b91d2SJef Poskanzer  GCC=$lt_save_GCC
79506edfd8d6SBruce A. Mah  CC=$lt_save_CC
79516edfd8d6SBruce A. Mah  CFLAGS=$lt_save_CFLAGS
79524874c4a8SBruce A. Mahfi # test yes != "$_lt_disable_FC"
7953ba7b91d2SJef Poskanzer
7954ba7b91d2SJef PoskanzerAC_LANG_POP
7955ba7b91d2SJef Poskanzer])# _LT_LANG_FC_CONFIG
7956ba7b91d2SJef Poskanzer
7957ba7b91d2SJef Poskanzer
7958ba7b91d2SJef Poskanzer# _LT_LANG_GCJ_CONFIG([TAG])
7959ba7b91d2SJef Poskanzer# --------------------------
7960ba7b91d2SJef Poskanzer# Ensure that the configuration variables for the GNU Java Compiler compiler
7961ba7b91d2SJef Poskanzer# are suitably defined.  These variables are subsequently used by _LT_CONFIG
79624874c4a8SBruce A. Mah# to write the compiler configuration to 'libtool'.
7963ba7b91d2SJef Poskanzerm4_defun([_LT_LANG_GCJ_CONFIG],
7964ba7b91d2SJef Poskanzer[AC_REQUIRE([LT_PROG_GCJ])dnl
7965ba7b91d2SJef PoskanzerAC_LANG_SAVE
7966ba7b91d2SJef Poskanzer
7967ba7b91d2SJef Poskanzer# Source file extension for Java test sources.
7968ba7b91d2SJef Poskanzerac_ext=java
7969ba7b91d2SJef Poskanzer
7970ba7b91d2SJef Poskanzer# Object file extension for compiled Java test sources.
7971ba7b91d2SJef Poskanzerobjext=o
7972ba7b91d2SJef Poskanzer_LT_TAGVAR(objext, $1)=$objext
7973ba7b91d2SJef Poskanzer
7974ba7b91d2SJef Poskanzer# Code to be used in simple compile tests
7975ba7b91d2SJef Poskanzerlt_simple_compile_test_code="class foo {}"
7976ba7b91d2SJef Poskanzer
7977ba7b91d2SJef Poskanzer# Code to be used in simple link tests
7978ba7b91d2SJef Poskanzerlt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7979ba7b91d2SJef Poskanzer
7980ba7b91d2SJef Poskanzer# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7981ba7b91d2SJef Poskanzer_LT_TAG_COMPILER
7982ba7b91d2SJef Poskanzer
7983ba7b91d2SJef Poskanzer# save warnings/boilerplate of simple test code
7984ba7b91d2SJef Poskanzer_LT_COMPILER_BOILERPLATE
7985ba7b91d2SJef Poskanzer_LT_LINKER_BOILERPLATE
7986ba7b91d2SJef Poskanzer
7987ba7b91d2SJef Poskanzer# Allow CC to be a program name with arguments.
79886edfd8d6SBruce A. Mahlt_save_CC=$CC
79896edfd8d6SBruce A. Mahlt_save_CFLAGS=$CFLAGS
7990ba7b91d2SJef Poskanzerlt_save_GCC=$GCC
7991ba7b91d2SJef PoskanzerGCC=yes
7992ba7b91d2SJef PoskanzerCC=${GCJ-"gcj"}
79936edfd8d6SBruce A. MahCFLAGS=$GCJFLAGS
7994ba7b91d2SJef Poskanzercompiler=$CC
7995ba7b91d2SJef Poskanzer_LT_TAGVAR(compiler, $1)=$CC
79964874c4a8SBruce A. Mah_LT_TAGVAR(LD, $1)=$LD
7997ba7b91d2SJef Poskanzer_LT_CC_BASENAME([$compiler])
7998ba7b91d2SJef Poskanzer
7999ba7b91d2SJef Poskanzer# GCJ did not exist at the time GCC didn't implicitly link libc in.
8000ba7b91d2SJef Poskanzer_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8001ba7b91d2SJef Poskanzer
8002ba7b91d2SJef Poskanzer_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
80036edfd8d6SBruce A. Mah_LT_TAGVAR(reload_flag, $1)=$reload_flag
80046edfd8d6SBruce A. Mah_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8005ba7b91d2SJef Poskanzer
8006ba7b91d2SJef Poskanzerif test -n "$compiler"; then
8007ba7b91d2SJef Poskanzer  _LT_COMPILER_NO_RTTI($1)
8008ba7b91d2SJef Poskanzer  _LT_COMPILER_PIC($1)
8009ba7b91d2SJef Poskanzer  _LT_COMPILER_C_O($1)
8010ba7b91d2SJef Poskanzer  _LT_COMPILER_FILE_LOCKS($1)
8011ba7b91d2SJef Poskanzer  _LT_LINKER_SHLIBS($1)
8012ba7b91d2SJef Poskanzer  _LT_LINKER_HARDCODE_LIBPATH($1)
8013ba7b91d2SJef Poskanzer
8014ba7b91d2SJef Poskanzer  _LT_CONFIG($1)
8015ba7b91d2SJef Poskanzerfi
8016ba7b91d2SJef Poskanzer
8017ba7b91d2SJef PoskanzerAC_LANG_RESTORE
8018ba7b91d2SJef Poskanzer
8019ba7b91d2SJef PoskanzerGCC=$lt_save_GCC
80206edfd8d6SBruce A. MahCC=$lt_save_CC
80216edfd8d6SBruce A. MahCFLAGS=$lt_save_CFLAGS
8022ba7b91d2SJef Poskanzer])# _LT_LANG_GCJ_CONFIG
8023ba7b91d2SJef Poskanzer
8024ba7b91d2SJef Poskanzer
80256edfd8d6SBruce A. Mah# _LT_LANG_GO_CONFIG([TAG])
80266edfd8d6SBruce A. Mah# --------------------------
80276edfd8d6SBruce A. Mah# Ensure that the configuration variables for the GNU Go compiler
80286edfd8d6SBruce A. Mah# are suitably defined.  These variables are subsequently used by _LT_CONFIG
80294874c4a8SBruce A. Mah# to write the compiler configuration to 'libtool'.
80306edfd8d6SBruce A. Mahm4_defun([_LT_LANG_GO_CONFIG],
80316edfd8d6SBruce A. Mah[AC_REQUIRE([LT_PROG_GO])dnl
80326edfd8d6SBruce A. MahAC_LANG_SAVE
80336edfd8d6SBruce A. Mah
80346edfd8d6SBruce A. Mah# Source file extension for Go test sources.
80356edfd8d6SBruce A. Mahac_ext=go
80366edfd8d6SBruce A. Mah
80376edfd8d6SBruce A. Mah# Object file extension for compiled Go test sources.
80386edfd8d6SBruce A. Mahobjext=o
80396edfd8d6SBruce A. Mah_LT_TAGVAR(objext, $1)=$objext
80406edfd8d6SBruce A. Mah
80416edfd8d6SBruce A. Mah# Code to be used in simple compile tests
80426edfd8d6SBruce A. Mahlt_simple_compile_test_code="package main; func main() { }"
80436edfd8d6SBruce A. Mah
80446edfd8d6SBruce A. Mah# Code to be used in simple link tests
80456edfd8d6SBruce A. Mahlt_simple_link_test_code='package main; func main() { }'
80466edfd8d6SBruce A. Mah
80476edfd8d6SBruce A. Mah# ltmain only uses $CC for tagged configurations so make sure $CC is set.
80486edfd8d6SBruce A. Mah_LT_TAG_COMPILER
80496edfd8d6SBruce A. Mah
80506edfd8d6SBruce A. Mah# save warnings/boilerplate of simple test code
80516edfd8d6SBruce A. Mah_LT_COMPILER_BOILERPLATE
80526edfd8d6SBruce A. Mah_LT_LINKER_BOILERPLATE
80536edfd8d6SBruce A. Mah
80546edfd8d6SBruce A. Mah# Allow CC to be a program name with arguments.
80556edfd8d6SBruce A. Mahlt_save_CC=$CC
80566edfd8d6SBruce A. Mahlt_save_CFLAGS=$CFLAGS
80576edfd8d6SBruce A. Mahlt_save_GCC=$GCC
80586edfd8d6SBruce A. MahGCC=yes
80596edfd8d6SBruce A. MahCC=${GOC-"gccgo"}
80606edfd8d6SBruce A. MahCFLAGS=$GOFLAGS
80616edfd8d6SBruce A. Mahcompiler=$CC
80626edfd8d6SBruce A. Mah_LT_TAGVAR(compiler, $1)=$CC
80634874c4a8SBruce A. Mah_LT_TAGVAR(LD, $1)=$LD
80646edfd8d6SBruce A. Mah_LT_CC_BASENAME([$compiler])
80656edfd8d6SBruce A. Mah
80666edfd8d6SBruce A. Mah# Go did not exist at the time GCC didn't implicitly link libc in.
80676edfd8d6SBruce A. Mah_LT_TAGVAR(archive_cmds_need_lc, $1)=no
80686edfd8d6SBruce A. Mah
80696edfd8d6SBruce A. Mah_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
80706edfd8d6SBruce A. Mah_LT_TAGVAR(reload_flag, $1)=$reload_flag
80716edfd8d6SBruce A. Mah_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
80726edfd8d6SBruce A. Mah
80736edfd8d6SBruce A. Mahif test -n "$compiler"; then
80746edfd8d6SBruce A. Mah  _LT_COMPILER_NO_RTTI($1)
80756edfd8d6SBruce A. Mah  _LT_COMPILER_PIC($1)
80766edfd8d6SBruce A. Mah  _LT_COMPILER_C_O($1)
80776edfd8d6SBruce A. Mah  _LT_COMPILER_FILE_LOCKS($1)
80786edfd8d6SBruce A. Mah  _LT_LINKER_SHLIBS($1)
80796edfd8d6SBruce A. Mah  _LT_LINKER_HARDCODE_LIBPATH($1)
80806edfd8d6SBruce A. Mah
80816edfd8d6SBruce A. Mah  _LT_CONFIG($1)
80826edfd8d6SBruce A. Mahfi
80836edfd8d6SBruce A. Mah
80846edfd8d6SBruce A. MahAC_LANG_RESTORE
80856edfd8d6SBruce A. Mah
80866edfd8d6SBruce A. MahGCC=$lt_save_GCC
80876edfd8d6SBruce A. MahCC=$lt_save_CC
80886edfd8d6SBruce A. MahCFLAGS=$lt_save_CFLAGS
80896edfd8d6SBruce A. Mah])# _LT_LANG_GO_CONFIG
80906edfd8d6SBruce A. Mah
80916edfd8d6SBruce A. Mah
8092ba7b91d2SJef Poskanzer# _LT_LANG_RC_CONFIG([TAG])
8093ba7b91d2SJef Poskanzer# -------------------------
8094ba7b91d2SJef Poskanzer# Ensure that the configuration variables for the Windows resource compiler
8095ba7b91d2SJef Poskanzer# are suitably defined.  These variables are subsequently used by _LT_CONFIG
80964874c4a8SBruce A. Mah# to write the compiler configuration to 'libtool'.
8097ba7b91d2SJef Poskanzerm4_defun([_LT_LANG_RC_CONFIG],
8098ba7b91d2SJef Poskanzer[AC_REQUIRE([LT_PROG_RC])dnl
8099ba7b91d2SJef PoskanzerAC_LANG_SAVE
8100ba7b91d2SJef Poskanzer
8101ba7b91d2SJef Poskanzer# Source file extension for RC test sources.
8102ba7b91d2SJef Poskanzerac_ext=rc
8103ba7b91d2SJef Poskanzer
8104ba7b91d2SJef Poskanzer# Object file extension for compiled RC test sources.
8105ba7b91d2SJef Poskanzerobjext=o
8106ba7b91d2SJef Poskanzer_LT_TAGVAR(objext, $1)=$objext
8107ba7b91d2SJef Poskanzer
8108ba7b91d2SJef Poskanzer# Code to be used in simple compile tests
8109ba7b91d2SJef Poskanzerlt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8110ba7b91d2SJef Poskanzer
8111ba7b91d2SJef Poskanzer# Code to be used in simple link tests
81124874c4a8SBruce A. Mahlt_simple_link_test_code=$lt_simple_compile_test_code
8113ba7b91d2SJef Poskanzer
8114ba7b91d2SJef Poskanzer# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8115ba7b91d2SJef Poskanzer_LT_TAG_COMPILER
8116ba7b91d2SJef Poskanzer
8117ba7b91d2SJef Poskanzer# save warnings/boilerplate of simple test code
8118ba7b91d2SJef Poskanzer_LT_COMPILER_BOILERPLATE
8119ba7b91d2SJef Poskanzer_LT_LINKER_BOILERPLATE
8120ba7b91d2SJef Poskanzer
8121ba7b91d2SJef Poskanzer# Allow CC to be a program name with arguments.
81224874c4a8SBruce A. Mahlt_save_CC=$CC
81236edfd8d6SBruce A. Mahlt_save_CFLAGS=$CFLAGS
8124ba7b91d2SJef Poskanzerlt_save_GCC=$GCC
8125ba7b91d2SJef PoskanzerGCC=
8126ba7b91d2SJef PoskanzerCC=${RC-"windres"}
81276edfd8d6SBruce A. MahCFLAGS=
8128ba7b91d2SJef Poskanzercompiler=$CC
8129ba7b91d2SJef Poskanzer_LT_TAGVAR(compiler, $1)=$CC
8130ba7b91d2SJef Poskanzer_LT_CC_BASENAME([$compiler])
8131ba7b91d2SJef Poskanzer_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8132ba7b91d2SJef Poskanzer
8133ba7b91d2SJef Poskanzerif test -n "$compiler"; then
8134ba7b91d2SJef Poskanzer  :
8135ba7b91d2SJef Poskanzer  _LT_CONFIG($1)
8136ba7b91d2SJef Poskanzerfi
8137ba7b91d2SJef Poskanzer
8138ba7b91d2SJef PoskanzerGCC=$lt_save_GCC
8139ba7b91d2SJef PoskanzerAC_LANG_RESTORE
81406edfd8d6SBruce A. MahCC=$lt_save_CC
81416edfd8d6SBruce A. MahCFLAGS=$lt_save_CFLAGS
8142ba7b91d2SJef Poskanzer])# _LT_LANG_RC_CONFIG
8143ba7b91d2SJef Poskanzer
8144ba7b91d2SJef Poskanzer
8145ba7b91d2SJef Poskanzer# LT_PROG_GCJ
8146ba7b91d2SJef Poskanzer# -----------
8147ba7b91d2SJef PoskanzerAC_DEFUN([LT_PROG_GCJ],
8148ba7b91d2SJef Poskanzer[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8149ba7b91d2SJef Poskanzer  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8150ba7b91d2SJef Poskanzer    [AC_CHECK_TOOL(GCJ, gcj,)
81514874c4a8SBruce A. Mah      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
8152ba7b91d2SJef Poskanzer      AC_SUBST(GCJFLAGS)])])[]dnl
8153e34c20c8SJon Dugan])
8154e34c20c8SJon Dugan
8155ba7b91d2SJef Poskanzer# Old name:
8156ba7b91d2SJef PoskanzerAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8157ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
8158ba7b91d2SJef Poskanzerdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8159ba7b91d2SJef Poskanzer
8160ba7b91d2SJef Poskanzer
81616edfd8d6SBruce A. Mah# LT_PROG_GO
81626edfd8d6SBruce A. Mah# ----------
81636edfd8d6SBruce A. MahAC_DEFUN([LT_PROG_GO],
81646edfd8d6SBruce A. Mah[AC_CHECK_TOOL(GOC, gccgo,)
81656edfd8d6SBruce A. Mah])
81666edfd8d6SBruce A. Mah
81676edfd8d6SBruce A. Mah
8168ba7b91d2SJef Poskanzer# LT_PROG_RC
8169ba7b91d2SJef Poskanzer# ----------
8170ba7b91d2SJef PoskanzerAC_DEFUN([LT_PROG_RC],
8171ba7b91d2SJef Poskanzer[AC_CHECK_TOOL(RC, windres,)
8172e34c20c8SJon Dugan])
8173e34c20c8SJon Dugan
8174ba7b91d2SJef Poskanzer# Old name:
8175ba7b91d2SJef PoskanzerAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8176ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
8177ba7b91d2SJef Poskanzerdnl AC_DEFUN([LT_AC_PROG_RC], [])
8178ba7b91d2SJef Poskanzer
8179ba7b91d2SJef Poskanzer
8180ba7b91d2SJef Poskanzer# _LT_DECL_EGREP
8181ba7b91d2SJef Poskanzer# --------------
8182ba7b91d2SJef Poskanzer# If we don't have a new enough Autoconf to choose the best grep
8183ba7b91d2SJef Poskanzer# available, choose the one first in the user's PATH.
8184ba7b91d2SJef Poskanzerm4_defun([_LT_DECL_EGREP],
8185ba7b91d2SJef Poskanzer[AC_REQUIRE([AC_PROG_EGREP])dnl
8186ba7b91d2SJef PoskanzerAC_REQUIRE([AC_PROG_FGREP])dnl
8187ba7b91d2SJef Poskanzertest -z "$GREP" && GREP=grep
8188ba7b91d2SJef Poskanzer_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8189ba7b91d2SJef Poskanzer_LT_DECL([], [EGREP], [1], [An ERE matcher])
8190ba7b91d2SJef Poskanzer_LT_DECL([], [FGREP], [1], [A literal string matcher])
8191ba7b91d2SJef Poskanzerdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8192ba7b91d2SJef PoskanzerAC_SUBST([GREP])
8193ba7b91d2SJef Poskanzer])
8194ba7b91d2SJef Poskanzer
8195ba7b91d2SJef Poskanzer
819660bd98a5SBruce A. Mah# _LT_DECL_OBJDUMP
819760bd98a5SBruce A. Mah# --------------
819860bd98a5SBruce A. Mah# If we don't have a new enough Autoconf to choose the best objdump
819960bd98a5SBruce A. Mah# available, choose the one first in the user's PATH.
820060bd98a5SBruce A. Mahm4_defun([_LT_DECL_OBJDUMP],
820160bd98a5SBruce A. Mah[AC_CHECK_TOOL(OBJDUMP, objdump, false)
820260bd98a5SBruce A. Mahtest -z "$OBJDUMP" && OBJDUMP=objdump
820360bd98a5SBruce A. Mah_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
820460bd98a5SBruce A. MahAC_SUBST([OBJDUMP])
820560bd98a5SBruce A. Mah])
820660bd98a5SBruce A. Mah
82076edfd8d6SBruce A. Mah# _LT_DECL_DLLTOOL
82086edfd8d6SBruce A. Mah# ----------------
82096edfd8d6SBruce A. Mah# Ensure DLLTOOL variable is set.
82106edfd8d6SBruce A. Mahm4_defun([_LT_DECL_DLLTOOL],
82116edfd8d6SBruce A. Mah[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
82126edfd8d6SBruce A. Mahtest -z "$DLLTOOL" && DLLTOOL=dlltool
82136edfd8d6SBruce A. Mah_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
82146edfd8d6SBruce A. MahAC_SUBST([DLLTOOL])
82156edfd8d6SBruce A. Mah])
821660bd98a5SBruce A. Mah
8217*85b25c2eSBruce A. Mah# _LT_DECL_FILECMD
8218*85b25c2eSBruce A. Mah# ----------------
8219*85b25c2eSBruce A. Mah# Check for a file(cmd) program that can be used to detect file type and magic
8220*85b25c2eSBruce A. Mahm4_defun([_LT_DECL_FILECMD],
8221*85b25c2eSBruce A. Mah[AC_CHECK_TOOL([FILECMD], [file], [:])
8222*85b25c2eSBruce A. Mah_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
8223*85b25c2eSBruce A. Mah])# _LD_DECL_FILECMD
8224*85b25c2eSBruce A. Mah
8225ba7b91d2SJef Poskanzer# _LT_DECL_SED
8226ba7b91d2SJef Poskanzer# ------------
8227ba7b91d2SJef Poskanzer# Check for a fully-functional sed program, that truncates
8228ba7b91d2SJef Poskanzer# as few characters as possible.  Prefer GNU sed if found.
8229ba7b91d2SJef Poskanzerm4_defun([_LT_DECL_SED],
8230ba7b91d2SJef Poskanzer[AC_PROG_SED
8231ba7b91d2SJef Poskanzertest -z "$SED" && SED=sed
8232ba7b91d2SJef PoskanzerXsed="$SED -e 1s/^X//"
8233ba7b91d2SJef Poskanzer_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8234ba7b91d2SJef Poskanzer_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8235ba7b91d2SJef Poskanzer    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8236ba7b91d2SJef Poskanzer])# _LT_DECL_SED
8237ba7b91d2SJef Poskanzer
8238ba7b91d2SJef Poskanzerm4_ifndef([AC_PROG_SED], [
8239e34c20c8SJon Dugan# NOTE: This macro has been submitted for inclusion into   #
8240e34c20c8SJon Dugan#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8241e34c20c8SJon Dugan#  a released version of Autoconf we should remove this    #
8242e34c20c8SJon Dugan#  macro and use it instead.                               #
8243ba7b91d2SJef Poskanzer
8244ba7b91d2SJef Poskanzerm4_defun([AC_PROG_SED],
8245e34c20c8SJon Dugan[AC_MSG_CHECKING([for a sed that does not truncate output])
8246e34c20c8SJon DuganAC_CACHE_VAL(lt_cv_path_SED,
8247e34c20c8SJon Dugan[# Loop through the user's path and test for sed and gsed.
8248e34c20c8SJon Dugan# Then use that list of sed's as ones to test for truncation.
8249e34c20c8SJon Duganas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8250e34c20c8SJon Duganfor as_dir in $PATH
8251e34c20c8SJon Dugando
8252e34c20c8SJon Dugan  IFS=$as_save_IFS
8253e34c20c8SJon Dugan  test -z "$as_dir" && as_dir=.
8254e34c20c8SJon Dugan  for lt_ac_prog in sed gsed; do
8255e34c20c8SJon Dugan    for ac_exec_ext in '' $ac_executable_extensions; do
8256e34c20c8SJon Dugan      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8257e34c20c8SJon Dugan        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8258e34c20c8SJon Dugan      fi
8259e34c20c8SJon Dugan    done
8260e34c20c8SJon Dugan  done
8261e34c20c8SJon Dugandone
8262e34c20c8SJon DuganIFS=$as_save_IFS
8263e34c20c8SJon Duganlt_ac_max=0
8264e34c20c8SJon Duganlt_ac_count=0
8265e34c20c8SJon Dugan# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8266e34c20c8SJon Dugan# along with /bin/sed that truncates output.
8267e34c20c8SJon Duganfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
82684874c4a8SBruce A. Mah  test ! -f "$lt_ac_sed" && continue
8269e34c20c8SJon Dugan  cat /dev/null > conftest.in
8270e34c20c8SJon Dugan  lt_ac_count=0
8271e34c20c8SJon Dugan  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8272e34c20c8SJon Dugan  # Check for GNU sed and select it if it is found.
8273e34c20c8SJon Dugan  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8274e34c20c8SJon Dugan    lt_cv_path_SED=$lt_ac_sed
8275e34c20c8SJon Dugan    break
8276e34c20c8SJon Dugan  fi
8277e34c20c8SJon Dugan  while true; do
8278e34c20c8SJon Dugan    cat conftest.in conftest.in >conftest.tmp
8279e34c20c8SJon Dugan    mv conftest.tmp conftest.in
8280e34c20c8SJon Dugan    cp conftest.in conftest.nl
8281e34c20c8SJon Dugan    echo >>conftest.nl
8282e34c20c8SJon Dugan    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8283e34c20c8SJon Dugan    cmp -s conftest.out conftest.nl || break
8284e34c20c8SJon Dugan    # 10000 chars as input seems more than enough
82854874c4a8SBruce A. Mah    test 10 -lt "$lt_ac_count" && break
8286e34c20c8SJon Dugan    lt_ac_count=`expr $lt_ac_count + 1`
82874874c4a8SBruce A. Mah    if test "$lt_ac_count" -gt "$lt_ac_max"; then
8288e34c20c8SJon Dugan      lt_ac_max=$lt_ac_count
8289e34c20c8SJon Dugan      lt_cv_path_SED=$lt_ac_sed
8290e34c20c8SJon Dugan    fi
8291e34c20c8SJon Dugan  done
8292e34c20c8SJon Dugandone
8293e34c20c8SJon Dugan])
8294e34c20c8SJon DuganSED=$lt_cv_path_SED
8295e34c20c8SJon DuganAC_SUBST([SED])
8296e34c20c8SJon DuganAC_MSG_RESULT([$SED])
8297ba7b91d2SJef Poskanzer])#AC_PROG_SED
8298ba7b91d2SJef Poskanzer])#m4_ifndef
8299ba7b91d2SJef Poskanzer
8300ba7b91d2SJef Poskanzer# Old name:
8301ba7b91d2SJef PoskanzerAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8302ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
8303ba7b91d2SJef Poskanzerdnl AC_DEFUN([LT_AC_PROG_SED], [])
8304ba7b91d2SJef Poskanzer
8305ba7b91d2SJef Poskanzer
8306ba7b91d2SJef Poskanzer# _LT_CHECK_SHELL_FEATURES
8307ba7b91d2SJef Poskanzer# ------------------------
8308ba7b91d2SJef Poskanzer# Find out whether the shell is Bourne or XSI compatible,
8309ba7b91d2SJef Poskanzer# or has some other useful features.
8310ba7b91d2SJef Poskanzerm4_defun([_LT_CHECK_SHELL_FEATURES],
83114874c4a8SBruce A. Mah[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8312ba7b91d2SJef Poskanzer  lt_unset=unset
8313ba7b91d2SJef Poskanzerelse
8314ba7b91d2SJef Poskanzer  lt_unset=false
8315ba7b91d2SJef Poskanzerfi
8316ba7b91d2SJef Poskanzer_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8317ba7b91d2SJef Poskanzer
8318ba7b91d2SJef Poskanzer# test EBCDIC or ASCII
8319ba7b91d2SJef Poskanzercase `echo X|tr X '\101'` in
8320ba7b91d2SJef Poskanzer A) # ASCII based system
8321ba7b91d2SJef Poskanzer    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8322ba7b91d2SJef Poskanzer  lt_SP2NL='tr \040 \012'
8323ba7b91d2SJef Poskanzer  lt_NL2SP='tr \015\012 \040\040'
8324ba7b91d2SJef Poskanzer  ;;
8325ba7b91d2SJef Poskanzer *) # EBCDIC based system
8326ba7b91d2SJef Poskanzer  lt_SP2NL='tr \100 \n'
8327ba7b91d2SJef Poskanzer  lt_NL2SP='tr \r\n \100\100'
8328ba7b91d2SJef Poskanzer  ;;
8329ba7b91d2SJef Poskanzeresac
8330ba7b91d2SJef Poskanzer_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8331ba7b91d2SJef Poskanzer_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8332ba7b91d2SJef Poskanzer])# _LT_CHECK_SHELL_FEATURES
8333ba7b91d2SJef Poskanzer
8334ba7b91d2SJef Poskanzer
83356edfd8d6SBruce A. Mah# _LT_PATH_CONVERSION_FUNCTIONS
83366edfd8d6SBruce A. Mah# -----------------------------
83374874c4a8SBruce A. Mah# Determine what file name conversion functions should be used by
83386edfd8d6SBruce A. Mah# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
83396edfd8d6SBruce A. Mah# for certain cross-compile configurations and native mingw.
83406edfd8d6SBruce A. Mahm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
83416edfd8d6SBruce A. Mah[AC_REQUIRE([AC_CANONICAL_HOST])dnl
83426edfd8d6SBruce A. MahAC_REQUIRE([AC_CANONICAL_BUILD])dnl
83436edfd8d6SBruce A. MahAC_MSG_CHECKING([how to convert $build file names to $host format])
83446edfd8d6SBruce A. MahAC_CACHE_VAL(lt_cv_to_host_file_cmd,
83456edfd8d6SBruce A. Mah[case $host in
83466edfd8d6SBruce A. Mah  *-*-mingw* )
83476edfd8d6SBruce A. Mah    case $build in
83486edfd8d6SBruce A. Mah      *-*-mingw* ) # actually msys
83496edfd8d6SBruce A. Mah        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8350dc1dd2dcSBruce A. Mah        ;;
83516edfd8d6SBruce A. Mah      *-*-cygwin* )
83526edfd8d6SBruce A. Mah        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
83536edfd8d6SBruce A. Mah        ;;
83546edfd8d6SBruce A. Mah      * ) # otherwise, assume *nix
83556edfd8d6SBruce A. Mah        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
83566edfd8d6SBruce A. Mah        ;;
83576edfd8d6SBruce A. Mah    esac
83586edfd8d6SBruce A. Mah    ;;
83596edfd8d6SBruce A. Mah  *-*-cygwin* )
83606edfd8d6SBruce A. Mah    case $build in
83616edfd8d6SBruce A. Mah      *-*-mingw* ) # actually msys
83626edfd8d6SBruce A. Mah        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
83636edfd8d6SBruce A. Mah        ;;
83646edfd8d6SBruce A. Mah      *-*-cygwin* )
83656edfd8d6SBruce A. Mah        lt_cv_to_host_file_cmd=func_convert_file_noop
83666edfd8d6SBruce A. Mah        ;;
83676edfd8d6SBruce A. Mah      * ) # otherwise, assume *nix
83686edfd8d6SBruce A. Mah        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
83696edfd8d6SBruce A. Mah        ;;
83706edfd8d6SBruce A. Mah    esac
83716edfd8d6SBruce A. Mah    ;;
83726edfd8d6SBruce A. Mah  * ) # unhandled hosts (and "normal" native builds)
83736edfd8d6SBruce A. Mah    lt_cv_to_host_file_cmd=func_convert_file_noop
8374ba7b91d2SJef Poskanzer    ;;
8375ba7b91d2SJef Poskanzeresac
83762ab386bfSjef])
83776edfd8d6SBruce A. Mahto_host_file_cmd=$lt_cv_to_host_file_cmd
83786edfd8d6SBruce A. MahAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
83796edfd8d6SBruce A. Mah_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
83806edfd8d6SBruce A. Mah         [0], [convert $build file names to $host format])dnl
83816edfd8d6SBruce A. Mah
83826edfd8d6SBruce A. MahAC_MSG_CHECKING([how to convert $build file names to toolchain format])
83836edfd8d6SBruce A. MahAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
83846edfd8d6SBruce A. Mah[#assume ordinary cross tools, or native build.
83856edfd8d6SBruce A. Mahlt_cv_to_tool_file_cmd=func_convert_file_noop
83866edfd8d6SBruce A. Mahcase $host in
83876edfd8d6SBruce A. Mah  *-*-mingw* )
83886edfd8d6SBruce A. Mah    case $build in
83896edfd8d6SBruce A. Mah      *-*-mingw* ) # actually msys
83906edfd8d6SBruce A. Mah        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
83916edfd8d6SBruce A. Mah        ;;
83926edfd8d6SBruce A. Mah    esac
83936edfd8d6SBruce A. Mah    ;;
83946edfd8d6SBruce A. Mahesac
83956edfd8d6SBruce A. Mah])
83966edfd8d6SBruce A. Mahto_tool_file_cmd=$lt_cv_to_tool_file_cmd
83976edfd8d6SBruce A. MahAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
83986edfd8d6SBruce A. Mah_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
83996edfd8d6SBruce A. Mah         [0], [convert $build files to toolchain format])dnl
84006edfd8d6SBruce A. Mah])# _LT_PATH_CONVERSION_FUNCTIONS
8401e34c20c8SJon Dugan
8402ba7b91d2SJef Poskanzer# Helper functions for option handling.                    -*- Autoconf -*-
8403ba7b91d2SJef Poskanzer#
8404*85b25c2eSBruce A. Mah#   Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
8405*85b25c2eSBruce A. Mah#   Software Foundation, Inc.
8406ba7b91d2SJef Poskanzer#   Written by Gary V. Vaughan, 2004
8407ba7b91d2SJef Poskanzer#
8408ba7b91d2SJef Poskanzer# This file is free software; the Free Software Foundation gives
8409ba7b91d2SJef Poskanzer# unlimited permission to copy and/or distribute it, with or without
8410ba7b91d2SJef Poskanzer# modifications, as long as this notice is preserved.
8411ba7b91d2SJef Poskanzer
84124874c4a8SBruce A. Mah# serial 8 ltoptions.m4
8413ba7b91d2SJef Poskanzer
8414ba7b91d2SJef Poskanzer# This is to help aclocal find these macros, as it can't see m4_define.
8415ba7b91d2SJef PoskanzerAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8416ba7b91d2SJef Poskanzer
8417ba7b91d2SJef Poskanzer
8418ba7b91d2SJef Poskanzer# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
8419ba7b91d2SJef Poskanzer# ------------------------------------------
8420ba7b91d2SJef Poskanzerm4_define([_LT_MANGLE_OPTION],
8421ba7b91d2SJef Poskanzer[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8422ba7b91d2SJef Poskanzer
8423ba7b91d2SJef Poskanzer
8424ba7b91d2SJef Poskanzer# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
8425ba7b91d2SJef Poskanzer# ---------------------------------------
8426ba7b91d2SJef Poskanzer# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
8427ba7b91d2SJef Poskanzer# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
8428ba7b91d2SJef Poskanzer# saved as a flag.
8429ba7b91d2SJef Poskanzerm4_define([_LT_SET_OPTION],
8430ba7b91d2SJef Poskanzer[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
8431ba7b91d2SJef Poskanzerm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
8432ba7b91d2SJef Poskanzer        _LT_MANGLE_DEFUN([$1], [$2]),
84334874c4a8SBruce A. Mah    [m4_warning([Unknown $1 option '$2'])])[]dnl
8434ba7b91d2SJef Poskanzer])
8435ba7b91d2SJef Poskanzer
8436ba7b91d2SJef Poskanzer
8437ba7b91d2SJef Poskanzer# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
8438ba7b91d2SJef Poskanzer# ------------------------------------------------------------
8439ba7b91d2SJef Poskanzer# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8440ba7b91d2SJef Poskanzerm4_define([_LT_IF_OPTION],
8441ba7b91d2SJef Poskanzer[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8442ba7b91d2SJef Poskanzer
8443ba7b91d2SJef Poskanzer
8444ba7b91d2SJef Poskanzer# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
8445ba7b91d2SJef Poskanzer# -------------------------------------------------------
8446ba7b91d2SJef Poskanzer# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
8447ba7b91d2SJef Poskanzer# are set.
8448ba7b91d2SJef Poskanzerm4_define([_LT_UNLESS_OPTIONS],
8449ba7b91d2SJef Poskanzer[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8450ba7b91d2SJef Poskanzer	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
8451ba7b91d2SJef Poskanzer		      [m4_define([$0_found])])])[]dnl
8452ba7b91d2SJef Poskanzerm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
8453ba7b91d2SJef Poskanzer])[]dnl
8454ba7b91d2SJef Poskanzer])
8455ba7b91d2SJef Poskanzer
8456ba7b91d2SJef Poskanzer
8457ba7b91d2SJef Poskanzer# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
8458ba7b91d2SJef Poskanzer# ----------------------------------------
8459ba7b91d2SJef Poskanzer# OPTION-LIST is a space-separated list of Libtool options associated
8460ba7b91d2SJef Poskanzer# with MACRO-NAME.  If any OPTION has a matching handler declared with
8461ba7b91d2SJef Poskanzer# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
8462ba7b91d2SJef Poskanzer# the unknown option and exit.
8463ba7b91d2SJef Poskanzerm4_defun([_LT_SET_OPTIONS],
8464ba7b91d2SJef Poskanzer[# Set options
8465ba7b91d2SJef Poskanzerm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8466ba7b91d2SJef Poskanzer    [_LT_SET_OPTION([$1], _LT_Option)])
8467ba7b91d2SJef Poskanzer
8468ba7b91d2SJef Poskanzerm4_if([$1],[LT_INIT],[
8469ba7b91d2SJef Poskanzer  dnl
8470ba7b91d2SJef Poskanzer  dnl Simply set some default values (i.e off) if boolean options were not
8471ba7b91d2SJef Poskanzer  dnl specified:
8472ba7b91d2SJef Poskanzer  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
8473ba7b91d2SJef Poskanzer  ])
8474ba7b91d2SJef Poskanzer  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
8475ba7b91d2SJef Poskanzer  ])
8476ba7b91d2SJef Poskanzer  dnl
8477ba7b91d2SJef Poskanzer  dnl If no reference was made to various pairs of opposing options, then
8478ba7b91d2SJef Poskanzer  dnl we run the default mode handler for the pair.  For example, if neither
84794874c4a8SBruce A. Mah  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
8480ba7b91d2SJef Poskanzer  dnl archives by default:
8481ba7b91d2SJef Poskanzer  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
8482ba7b91d2SJef Poskanzer  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
8483ba7b91d2SJef Poskanzer  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
8484ba7b91d2SJef Poskanzer  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
8485ba7b91d2SJef Poskanzer		   [_LT_ENABLE_FAST_INSTALL])
84864874c4a8SBruce A. Mah  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
84874874c4a8SBruce A. Mah		   [_LT_WITH_AIX_SONAME([aix])])
8488ba7b91d2SJef Poskanzer  ])
8489ba7b91d2SJef Poskanzer])# _LT_SET_OPTIONS
8490ba7b91d2SJef Poskanzer
8491ba7b91d2SJef Poskanzer
8492ba7b91d2SJef Poskanzer
8493ba7b91d2SJef Poskanzer# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
8494ba7b91d2SJef Poskanzer# -----------------------------------------
8495ba7b91d2SJef Poskanzerm4_define([_LT_MANGLE_DEFUN],
8496ba7b91d2SJef Poskanzer[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8497ba7b91d2SJef Poskanzer
8498ba7b91d2SJef Poskanzer
8499ba7b91d2SJef Poskanzer# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
8500ba7b91d2SJef Poskanzer# -----------------------------------------------
8501ba7b91d2SJef Poskanzerm4_define([LT_OPTION_DEFINE],
8502ba7b91d2SJef Poskanzer[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
8503ba7b91d2SJef Poskanzer])# LT_OPTION_DEFINE
8504ba7b91d2SJef Poskanzer
8505ba7b91d2SJef Poskanzer
8506ba7b91d2SJef Poskanzer# dlopen
8507ba7b91d2SJef Poskanzer# ------
8508ba7b91d2SJef PoskanzerLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
8509ba7b91d2SJef Poskanzer])
8510ba7b91d2SJef Poskanzer
8511ba7b91d2SJef PoskanzerAU_DEFUN([AC_LIBTOOL_DLOPEN],
8512ba7b91d2SJef Poskanzer[_LT_SET_OPTION([LT_INIT], [dlopen])
8513ba7b91d2SJef PoskanzerAC_DIAGNOSE([obsolete],
8514ba7b91d2SJef Poskanzer[$0: Remove this warning and the call to _LT_SET_OPTION when you
85154874c4a8SBruce A. Mahput the 'dlopen' option into LT_INIT's first parameter.])
8516ba7b91d2SJef Poskanzer])
8517ba7b91d2SJef Poskanzer
8518ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
8519ba7b91d2SJef Poskanzerdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8520ba7b91d2SJef Poskanzer
8521ba7b91d2SJef Poskanzer
8522ba7b91d2SJef Poskanzer# win32-dll
8523ba7b91d2SJef Poskanzer# ---------
8524ba7b91d2SJef Poskanzer# Declare package support for building win32 dll's.
8525ba7b91d2SJef PoskanzerLT_OPTION_DEFINE([LT_INIT], [win32-dll],
8526ba7b91d2SJef Poskanzer[enable_win32_dll=yes
8527ba7b91d2SJef Poskanzer
8528ba7b91d2SJef Poskanzercase $host in
85296edfd8d6SBruce A. Mah*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
8530ba7b91d2SJef Poskanzer  AC_CHECK_TOOL(AS, as, false)
8531ba7b91d2SJef Poskanzer  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8532ba7b91d2SJef Poskanzer  AC_CHECK_TOOL(OBJDUMP, objdump, false)
8533ba7b91d2SJef Poskanzer  ;;
8534ba7b91d2SJef Poskanzeresac
8535ba7b91d2SJef Poskanzer
8536ba7b91d2SJef Poskanzertest -z "$AS" && AS=as
85376edfd8d6SBruce A. Mah_LT_DECL([], [AS],      [1], [Assembler program])dnl
8538ba7b91d2SJef Poskanzer
8539ba7b91d2SJef Poskanzertest -z "$DLLTOOL" && DLLTOOL=dlltool
85406edfd8d6SBruce A. Mah_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
8541ba7b91d2SJef Poskanzer
8542ba7b91d2SJef Poskanzertest -z "$OBJDUMP" && OBJDUMP=objdump
85436edfd8d6SBruce A. Mah_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
8544ba7b91d2SJef Poskanzer])# win32-dll
8545ba7b91d2SJef Poskanzer
8546ba7b91d2SJef PoskanzerAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
8547ba7b91d2SJef Poskanzer[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8548ba7b91d2SJef Poskanzer_LT_SET_OPTION([LT_INIT], [win32-dll])
8549ba7b91d2SJef PoskanzerAC_DIAGNOSE([obsolete],
8550ba7b91d2SJef Poskanzer[$0: Remove this warning and the call to _LT_SET_OPTION when you
85514874c4a8SBruce A. Mahput the 'win32-dll' option into LT_INIT's first parameter.])
8552ba7b91d2SJef Poskanzer])
8553ba7b91d2SJef Poskanzer
8554ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
8555ba7b91d2SJef Poskanzerdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8556ba7b91d2SJef Poskanzer
8557ba7b91d2SJef Poskanzer
8558ba7b91d2SJef Poskanzer# _LT_ENABLE_SHARED([DEFAULT])
8559ba7b91d2SJef Poskanzer# ----------------------------
85604874c4a8SBruce A. Mah# implement the --enable-shared flag, and supports the 'shared' and
85614874c4a8SBruce A. Mah# 'disable-shared' LT_INIT options.
85624874c4a8SBruce A. Mah# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8563ba7b91d2SJef Poskanzerm4_define([_LT_ENABLE_SHARED],
8564ba7b91d2SJef Poskanzer[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
8565ba7b91d2SJef PoskanzerAC_ARG_ENABLE([shared],
8566ba7b91d2SJef Poskanzer    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
8567ba7b91d2SJef Poskanzer	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
8568ba7b91d2SJef Poskanzer    [p=${PACKAGE-default}
8569ba7b91d2SJef Poskanzer    case $enableval in
8570ba7b91d2SJef Poskanzer    yes) enable_shared=yes ;;
8571ba7b91d2SJef Poskanzer    no) enable_shared=no ;;
8572ba7b91d2SJef Poskanzer    *)
8573ba7b91d2SJef Poskanzer      enable_shared=no
8574ba7b91d2SJef Poskanzer      # Look at the argument we got.  We use all the common list separators.
85754874c4a8SBruce A. Mah      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8576ba7b91d2SJef Poskanzer      for pkg in $enableval; do
85774874c4a8SBruce A. Mah	IFS=$lt_save_ifs
8578ba7b91d2SJef Poskanzer	if test "X$pkg" = "X$p"; then
8579ba7b91d2SJef Poskanzer	  enable_shared=yes
8580ba7b91d2SJef Poskanzer	fi
8581ba7b91d2SJef Poskanzer      done
85824874c4a8SBruce A. Mah      IFS=$lt_save_ifs
8583ba7b91d2SJef Poskanzer      ;;
8584ba7b91d2SJef Poskanzer    esac],
8585ba7b91d2SJef Poskanzer    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8586ba7b91d2SJef Poskanzer
8587ba7b91d2SJef Poskanzer    _LT_DECL([build_libtool_libs], [enable_shared], [0],
8588ba7b91d2SJef Poskanzer	[Whether or not to build shared libraries])
8589ba7b91d2SJef Poskanzer])# _LT_ENABLE_SHARED
8590ba7b91d2SJef Poskanzer
8591ba7b91d2SJef PoskanzerLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
8592ba7b91d2SJef PoskanzerLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8593ba7b91d2SJef Poskanzer
8594ba7b91d2SJef Poskanzer# Old names:
8595ba7b91d2SJef PoskanzerAC_DEFUN([AC_ENABLE_SHARED],
8596ba7b91d2SJef Poskanzer[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
8597ba7b91d2SJef Poskanzer])
8598ba7b91d2SJef Poskanzer
8599ba7b91d2SJef PoskanzerAC_DEFUN([AC_DISABLE_SHARED],
8600ba7b91d2SJef Poskanzer[_LT_SET_OPTION([LT_INIT], [disable-shared])
8601ba7b91d2SJef Poskanzer])
8602ba7b91d2SJef Poskanzer
8603ba7b91d2SJef PoskanzerAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
8604ba7b91d2SJef PoskanzerAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8605ba7b91d2SJef Poskanzer
8606ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
8607ba7b91d2SJef Poskanzerdnl AC_DEFUN([AM_ENABLE_SHARED], [])
8608ba7b91d2SJef Poskanzerdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8609ba7b91d2SJef Poskanzer
8610ba7b91d2SJef Poskanzer
8611ba7b91d2SJef Poskanzer
8612ba7b91d2SJef Poskanzer# _LT_ENABLE_STATIC([DEFAULT])
8613ba7b91d2SJef Poskanzer# ----------------------------
86144874c4a8SBruce A. Mah# implement the --enable-static flag, and support the 'static' and
86154874c4a8SBruce A. Mah# 'disable-static' LT_INIT options.
86164874c4a8SBruce A. Mah# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8617ba7b91d2SJef Poskanzerm4_define([_LT_ENABLE_STATIC],
8618ba7b91d2SJef Poskanzer[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
8619ba7b91d2SJef PoskanzerAC_ARG_ENABLE([static],
8620ba7b91d2SJef Poskanzer    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
8621ba7b91d2SJef Poskanzer	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
8622ba7b91d2SJef Poskanzer    [p=${PACKAGE-default}
8623ba7b91d2SJef Poskanzer    case $enableval in
8624ba7b91d2SJef Poskanzer    yes) enable_static=yes ;;
8625ba7b91d2SJef Poskanzer    no) enable_static=no ;;
8626ba7b91d2SJef Poskanzer    *)
8627ba7b91d2SJef Poskanzer     enable_static=no
8628ba7b91d2SJef Poskanzer      # Look at the argument we got.  We use all the common list separators.
86294874c4a8SBruce A. Mah      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8630ba7b91d2SJef Poskanzer      for pkg in $enableval; do
86314874c4a8SBruce A. Mah	IFS=$lt_save_ifs
8632ba7b91d2SJef Poskanzer	if test "X$pkg" = "X$p"; then
8633ba7b91d2SJef Poskanzer	  enable_static=yes
8634ba7b91d2SJef Poskanzer	fi
8635ba7b91d2SJef Poskanzer      done
86364874c4a8SBruce A. Mah      IFS=$lt_save_ifs
8637ba7b91d2SJef Poskanzer      ;;
8638ba7b91d2SJef Poskanzer    esac],
8639ba7b91d2SJef Poskanzer    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8640ba7b91d2SJef Poskanzer
8641ba7b91d2SJef Poskanzer    _LT_DECL([build_old_libs], [enable_static], [0],
8642ba7b91d2SJef Poskanzer	[Whether or not to build static libraries])
8643ba7b91d2SJef Poskanzer])# _LT_ENABLE_STATIC
8644ba7b91d2SJef Poskanzer
8645ba7b91d2SJef PoskanzerLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
8646ba7b91d2SJef PoskanzerLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8647ba7b91d2SJef Poskanzer
8648ba7b91d2SJef Poskanzer# Old names:
8649ba7b91d2SJef PoskanzerAC_DEFUN([AC_ENABLE_STATIC],
8650ba7b91d2SJef Poskanzer[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
8651ba7b91d2SJef Poskanzer])
8652ba7b91d2SJef Poskanzer
8653ba7b91d2SJef PoskanzerAC_DEFUN([AC_DISABLE_STATIC],
8654ba7b91d2SJef Poskanzer[_LT_SET_OPTION([LT_INIT], [disable-static])
8655ba7b91d2SJef Poskanzer])
8656ba7b91d2SJef Poskanzer
8657ba7b91d2SJef PoskanzerAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
8658ba7b91d2SJef PoskanzerAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8659ba7b91d2SJef Poskanzer
8660ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
8661ba7b91d2SJef Poskanzerdnl AC_DEFUN([AM_ENABLE_STATIC], [])
8662ba7b91d2SJef Poskanzerdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8663ba7b91d2SJef Poskanzer
8664ba7b91d2SJef Poskanzer
8665ba7b91d2SJef Poskanzer
8666ba7b91d2SJef Poskanzer# _LT_ENABLE_FAST_INSTALL([DEFAULT])
8667ba7b91d2SJef Poskanzer# ----------------------------------
86684874c4a8SBruce A. Mah# implement the --enable-fast-install flag, and support the 'fast-install'
86694874c4a8SBruce A. Mah# and 'disable-fast-install' LT_INIT options.
86704874c4a8SBruce A. Mah# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8671ba7b91d2SJef Poskanzerm4_define([_LT_ENABLE_FAST_INSTALL],
8672ba7b91d2SJef Poskanzer[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
8673ba7b91d2SJef PoskanzerAC_ARG_ENABLE([fast-install],
8674ba7b91d2SJef Poskanzer    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
8675ba7b91d2SJef Poskanzer    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
8676ba7b91d2SJef Poskanzer    [p=${PACKAGE-default}
8677ba7b91d2SJef Poskanzer    case $enableval in
8678ba7b91d2SJef Poskanzer    yes) enable_fast_install=yes ;;
8679ba7b91d2SJef Poskanzer    no) enable_fast_install=no ;;
8680ba7b91d2SJef Poskanzer    *)
8681ba7b91d2SJef Poskanzer      enable_fast_install=no
8682ba7b91d2SJef Poskanzer      # Look at the argument we got.  We use all the common list separators.
86834874c4a8SBruce A. Mah      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8684ba7b91d2SJef Poskanzer      for pkg in $enableval; do
86854874c4a8SBruce A. Mah	IFS=$lt_save_ifs
8686ba7b91d2SJef Poskanzer	if test "X$pkg" = "X$p"; then
8687ba7b91d2SJef Poskanzer	  enable_fast_install=yes
8688ba7b91d2SJef Poskanzer	fi
8689ba7b91d2SJef Poskanzer      done
86904874c4a8SBruce A. Mah      IFS=$lt_save_ifs
8691ba7b91d2SJef Poskanzer      ;;
8692ba7b91d2SJef Poskanzer    esac],
8693ba7b91d2SJef Poskanzer    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8694ba7b91d2SJef Poskanzer
8695ba7b91d2SJef Poskanzer_LT_DECL([fast_install], [enable_fast_install], [0],
8696ba7b91d2SJef Poskanzer	 [Whether or not to optimize for fast installation])dnl
8697ba7b91d2SJef Poskanzer])# _LT_ENABLE_FAST_INSTALL
8698ba7b91d2SJef Poskanzer
8699ba7b91d2SJef PoskanzerLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
8700ba7b91d2SJef PoskanzerLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8701ba7b91d2SJef Poskanzer
8702ba7b91d2SJef Poskanzer# Old names:
8703ba7b91d2SJef PoskanzerAU_DEFUN([AC_ENABLE_FAST_INSTALL],
8704ba7b91d2SJef Poskanzer[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
8705ba7b91d2SJef PoskanzerAC_DIAGNOSE([obsolete],
8706ba7b91d2SJef Poskanzer[$0: Remove this warning and the call to _LT_SET_OPTION when you put
87074874c4a8SBruce A. Mahthe 'fast-install' option into LT_INIT's first parameter.])
8708ba7b91d2SJef Poskanzer])
8709ba7b91d2SJef Poskanzer
8710ba7b91d2SJef PoskanzerAU_DEFUN([AC_DISABLE_FAST_INSTALL],
8711ba7b91d2SJef Poskanzer[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
8712ba7b91d2SJef PoskanzerAC_DIAGNOSE([obsolete],
8713ba7b91d2SJef Poskanzer[$0: Remove this warning and the call to _LT_SET_OPTION when you put
87144874c4a8SBruce A. Mahthe 'disable-fast-install' option into LT_INIT's first parameter.])
8715ba7b91d2SJef Poskanzer])
8716ba7b91d2SJef Poskanzer
8717ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
8718ba7b91d2SJef Poskanzerdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
8719ba7b91d2SJef Poskanzerdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
8720ba7b91d2SJef Poskanzer
8721ba7b91d2SJef Poskanzer
87224874c4a8SBruce A. Mah# _LT_WITH_AIX_SONAME([DEFAULT])
87234874c4a8SBruce A. Mah# ----------------------------------
87244874c4a8SBruce A. Mah# implement the --with-aix-soname flag, and support the `aix-soname=aix'
87254874c4a8SBruce A. Mah# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
87264874c4a8SBruce A. Mah# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
87274874c4a8SBruce A. Mahm4_define([_LT_WITH_AIX_SONAME],
87284874c4a8SBruce A. Mah[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
87294874c4a8SBruce A. Mahshared_archive_member_spec=
87304874c4a8SBruce A. Mahcase $host,$enable_shared in
87314874c4a8SBruce A. Mahpower*-*-aix[[5-9]]*,yes)
87324874c4a8SBruce A. Mah  AC_MSG_CHECKING([which variant of shared library versioning to provide])
87334874c4a8SBruce A. Mah  AC_ARG_WITH([aix-soname],
87344874c4a8SBruce A. Mah    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
87354874c4a8SBruce A. Mah      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
87364874c4a8SBruce A. Mah    [case $withval in
87374874c4a8SBruce A. Mah    aix|svr4|both)
87384874c4a8SBruce A. Mah      ;;
87394874c4a8SBruce A. Mah    *)
87404874c4a8SBruce A. Mah      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
87414874c4a8SBruce A. Mah      ;;
87424874c4a8SBruce A. Mah    esac
87434874c4a8SBruce A. Mah    lt_cv_with_aix_soname=$with_aix_soname],
87444874c4a8SBruce A. Mah    [AC_CACHE_VAL([lt_cv_with_aix_soname],
87454874c4a8SBruce A. Mah      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
87464874c4a8SBruce A. Mah    with_aix_soname=$lt_cv_with_aix_soname])
87474874c4a8SBruce A. Mah  AC_MSG_RESULT([$with_aix_soname])
87484874c4a8SBruce A. Mah  if test aix != "$with_aix_soname"; then
87494874c4a8SBruce A. Mah    # For the AIX way of multilib, we name the shared archive member
87504874c4a8SBruce A. Mah    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
87514874c4a8SBruce A. Mah    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
87524874c4a8SBruce A. Mah    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
87534874c4a8SBruce A. Mah    # the AIX toolchain works better with OBJECT_MODE set (default 32).
87544874c4a8SBruce A. Mah    if test 64 = "${OBJECT_MODE-32}"; then
87554874c4a8SBruce A. Mah      shared_archive_member_spec=shr_64
87564874c4a8SBruce A. Mah    else
87574874c4a8SBruce A. Mah      shared_archive_member_spec=shr
87584874c4a8SBruce A. Mah    fi
87594874c4a8SBruce A. Mah  fi
87604874c4a8SBruce A. Mah  ;;
87614874c4a8SBruce A. Mah*)
87624874c4a8SBruce A. Mah  with_aix_soname=aix
87634874c4a8SBruce A. Mah  ;;
87644874c4a8SBruce A. Mahesac
87654874c4a8SBruce A. Mah
87664874c4a8SBruce A. Mah_LT_DECL([], [shared_archive_member_spec], [0],
87674874c4a8SBruce A. Mah    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
87684874c4a8SBruce A. Mah])# _LT_WITH_AIX_SONAME
87694874c4a8SBruce A. Mah
87704874c4a8SBruce A. MahLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
87714874c4a8SBruce A. MahLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
87724874c4a8SBruce A. MahLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
87734874c4a8SBruce A. Mah
87744874c4a8SBruce A. Mah
8775ba7b91d2SJef Poskanzer# _LT_WITH_PIC([MODE])
8776ba7b91d2SJef Poskanzer# --------------------
87774874c4a8SBruce A. Mah# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
8778ba7b91d2SJef Poskanzer# LT_INIT options.
87794874c4a8SBruce A. Mah# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
8780ba7b91d2SJef Poskanzerm4_define([_LT_WITH_PIC],
8781ba7b91d2SJef Poskanzer[AC_ARG_WITH([pic],
87826edfd8d6SBruce A. Mah    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
8783ba7b91d2SJef Poskanzer	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
87846edfd8d6SBruce A. Mah    [lt_p=${PACKAGE-default}
87856edfd8d6SBruce A. Mah    case $withval in
87866edfd8d6SBruce A. Mah    yes|no) pic_mode=$withval ;;
87876edfd8d6SBruce A. Mah    *)
87886edfd8d6SBruce A. Mah      pic_mode=default
87896edfd8d6SBruce A. Mah      # Look at the argument we got.  We use all the common list separators.
87904874c4a8SBruce A. Mah      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
87916edfd8d6SBruce A. Mah      for lt_pkg in $withval; do
87924874c4a8SBruce A. Mah	IFS=$lt_save_ifs
87936edfd8d6SBruce A. Mah	if test "X$lt_pkg" = "X$lt_p"; then
87946edfd8d6SBruce A. Mah	  pic_mode=yes
87956edfd8d6SBruce A. Mah	fi
87966edfd8d6SBruce A. Mah      done
87974874c4a8SBruce A. Mah      IFS=$lt_save_ifs
87986edfd8d6SBruce A. Mah      ;;
87996edfd8d6SBruce A. Mah    esac],
88004874c4a8SBruce A. Mah    [pic_mode=m4_default([$1], [default])])
8801ba7b91d2SJef Poskanzer
8802ba7b91d2SJef Poskanzer_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
8803ba7b91d2SJef Poskanzer])# _LT_WITH_PIC
8804ba7b91d2SJef Poskanzer
8805ba7b91d2SJef PoskanzerLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
8806ba7b91d2SJef PoskanzerLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8807ba7b91d2SJef Poskanzer
8808ba7b91d2SJef Poskanzer# Old name:
8809ba7b91d2SJef PoskanzerAU_DEFUN([AC_LIBTOOL_PICMODE],
8810ba7b91d2SJef Poskanzer[_LT_SET_OPTION([LT_INIT], [pic-only])
8811ba7b91d2SJef PoskanzerAC_DIAGNOSE([obsolete],
8812ba7b91d2SJef Poskanzer[$0: Remove this warning and the call to _LT_SET_OPTION when you
88134874c4a8SBruce A. Mahput the 'pic-only' option into LT_INIT's first parameter.])
8814ba7b91d2SJef Poskanzer])
8815ba7b91d2SJef Poskanzer
8816ba7b91d2SJef Poskanzerdnl aclocal-1.4 backwards compatibility:
8817ba7b91d2SJef Poskanzerdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8818ba7b91d2SJef Poskanzer
8819ba7b91d2SJef Poskanzer
8820ba7b91d2SJef Poskanzerm4_define([_LTDL_MODE], [])
8821ba7b91d2SJef PoskanzerLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
8822ba7b91d2SJef Poskanzer		 [m4_define([_LTDL_MODE], [nonrecursive])])
8823ba7b91d2SJef PoskanzerLT_OPTION_DEFINE([LTDL_INIT], [recursive],
8824ba7b91d2SJef Poskanzer		 [m4_define([_LTDL_MODE], [recursive])])
8825ba7b91d2SJef PoskanzerLT_OPTION_DEFINE([LTDL_INIT], [subproject],
8826ba7b91d2SJef Poskanzer		 [m4_define([_LTDL_MODE], [subproject])])
8827ba7b91d2SJef Poskanzer
8828ba7b91d2SJef Poskanzerm4_define([_LTDL_TYPE], [])
8829ba7b91d2SJef PoskanzerLT_OPTION_DEFINE([LTDL_INIT], [installable],
8830ba7b91d2SJef Poskanzer		 [m4_define([_LTDL_TYPE], [installable])])
8831ba7b91d2SJef PoskanzerLT_OPTION_DEFINE([LTDL_INIT], [convenience],
8832ba7b91d2SJef Poskanzer		 [m4_define([_LTDL_TYPE], [convenience])])
8833ba7b91d2SJef Poskanzer
8834ba7b91d2SJef Poskanzer# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
8835ba7b91d2SJef Poskanzer#
8836*85b25c2eSBruce A. Mah# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software
88374874c4a8SBruce A. Mah# Foundation, Inc.
8838ba7b91d2SJef Poskanzer# Written by Gary V. Vaughan, 2004
8839ba7b91d2SJef Poskanzer#
8840ba7b91d2SJef Poskanzer# This file is free software; the Free Software Foundation gives
8841ba7b91d2SJef Poskanzer# unlimited permission to copy and/or distribute it, with or without
8842ba7b91d2SJef Poskanzer# modifications, as long as this notice is preserved.
8843ba7b91d2SJef Poskanzer
884460bd98a5SBruce A. Mah# serial 6 ltsugar.m4
8845ba7b91d2SJef Poskanzer
8846ba7b91d2SJef Poskanzer# This is to help aclocal find these macros, as it can't see m4_define.
8847ba7b91d2SJef PoskanzerAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
8848ba7b91d2SJef Poskanzer
8849ba7b91d2SJef Poskanzer
8850ba7b91d2SJef Poskanzer# lt_join(SEP, ARG1, [ARG2...])
8851ba7b91d2SJef Poskanzer# -----------------------------
8852ba7b91d2SJef Poskanzer# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
8853ba7b91d2SJef Poskanzer# associated separator.
8854ba7b91d2SJef Poskanzer# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
8855ba7b91d2SJef Poskanzer# versions in m4sugar had bugs.
8856ba7b91d2SJef Poskanzerm4_define([lt_join],
8857ba7b91d2SJef Poskanzer[m4_if([$#], [1], [],
8858ba7b91d2SJef Poskanzer       [$#], [2], [[$2]],
8859ba7b91d2SJef Poskanzer       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
8860ba7b91d2SJef Poskanzerm4_define([_lt_join],
8861ba7b91d2SJef Poskanzer[m4_if([$#$2], [2], [],
8862ba7b91d2SJef Poskanzer       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
8863ba7b91d2SJef Poskanzer
8864ba7b91d2SJef Poskanzer
8865ba7b91d2SJef Poskanzer# lt_car(LIST)
8866ba7b91d2SJef Poskanzer# lt_cdr(LIST)
8867ba7b91d2SJef Poskanzer# ------------
8868ba7b91d2SJef Poskanzer# Manipulate m4 lists.
8869ba7b91d2SJef Poskanzer# These macros are necessary as long as will still need to support
88704874c4a8SBruce A. Mah# Autoconf-2.59, which quotes differently.
8871ba7b91d2SJef Poskanzerm4_define([lt_car], [[$1]])
8872ba7b91d2SJef Poskanzerm4_define([lt_cdr],
8873ba7b91d2SJef Poskanzer[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
8874ba7b91d2SJef Poskanzer       [$#], 1, [],
8875ba7b91d2SJef Poskanzer       [m4_dquote(m4_shift($@))])])
8876ba7b91d2SJef Poskanzerm4_define([lt_unquote], $1)
8877ba7b91d2SJef Poskanzer
8878ba7b91d2SJef Poskanzer
8879ba7b91d2SJef Poskanzer# lt_append(MACRO-NAME, STRING, [SEPARATOR])
8880ba7b91d2SJef Poskanzer# ------------------------------------------
88814874c4a8SBruce A. Mah# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
8882ba7b91d2SJef Poskanzer# Note that neither SEPARATOR nor STRING are expanded; they are appended
8883ba7b91d2SJef Poskanzer# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
8884ba7b91d2SJef Poskanzer# No SEPARATOR is output if MACRO-NAME was previously undefined (different
8885ba7b91d2SJef Poskanzer# than defined and empty).
8886ba7b91d2SJef Poskanzer#
8887ba7b91d2SJef Poskanzer# This macro is needed until we can rely on Autoconf 2.62, since earlier
8888ba7b91d2SJef Poskanzer# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
8889ba7b91d2SJef Poskanzerm4_define([lt_append],
8890ba7b91d2SJef Poskanzer[m4_define([$1],
8891ba7b91d2SJef Poskanzer	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8892ba7b91d2SJef Poskanzer
8893ba7b91d2SJef Poskanzer
8894ba7b91d2SJef Poskanzer
8895ba7b91d2SJef Poskanzer# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
8896ba7b91d2SJef Poskanzer# ----------------------------------------------------------
8897ba7b91d2SJef Poskanzer# Produce a SEP delimited list of all paired combinations of elements of
8898ba7b91d2SJef Poskanzer# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
8899ba7b91d2SJef Poskanzer# has the form PREFIXmINFIXSUFFIXn.
890060bd98a5SBruce A. Mah# Needed until we can rely on m4_combine added in Autoconf 2.62.
8901ba7b91d2SJef Poskanzerm4_define([lt_combine],
890260bd98a5SBruce A. Mah[m4_if(m4_eval([$# > 3]), [1],
890360bd98a5SBruce A. Mah       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
890460bd98a5SBruce A. Mah[[m4_foreach([_Lt_prefix], [$2],
890560bd98a5SBruce A. Mah	     [m4_foreach([_Lt_suffix],
890660bd98a5SBruce A. Mah		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
890760bd98a5SBruce A. Mah	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8908ba7b91d2SJef Poskanzer
8909ba7b91d2SJef Poskanzer
8910ba7b91d2SJef Poskanzer# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
8911ba7b91d2SJef Poskanzer# -----------------------------------------------------------------------
8912ba7b91d2SJef Poskanzer# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
8913ba7b91d2SJef Poskanzer# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
8914ba7b91d2SJef Poskanzerm4_define([lt_if_append_uniq],
8915ba7b91d2SJef Poskanzer[m4_ifdef([$1],
8916ba7b91d2SJef Poskanzer	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
8917ba7b91d2SJef Poskanzer		 [lt_append([$1], [$2], [$3])$4],
8918ba7b91d2SJef Poskanzer		 [$5])],
8919ba7b91d2SJef Poskanzer	  [lt_append([$1], [$2], [$3])$4])])
8920ba7b91d2SJef Poskanzer
8921ba7b91d2SJef Poskanzer
8922ba7b91d2SJef Poskanzer# lt_dict_add(DICT, KEY, VALUE)
8923ba7b91d2SJef Poskanzer# -----------------------------
8924ba7b91d2SJef Poskanzerm4_define([lt_dict_add],
8925ba7b91d2SJef Poskanzer[m4_define([$1($2)], [$3])])
8926ba7b91d2SJef Poskanzer
8927ba7b91d2SJef Poskanzer
8928ba7b91d2SJef Poskanzer# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
8929ba7b91d2SJef Poskanzer# --------------------------------------------
8930ba7b91d2SJef Poskanzerm4_define([lt_dict_add_subkey],
8931ba7b91d2SJef Poskanzer[m4_define([$1($2:$3)], [$4])])
8932ba7b91d2SJef Poskanzer
8933ba7b91d2SJef Poskanzer
8934ba7b91d2SJef Poskanzer# lt_dict_fetch(DICT, KEY, [SUBKEY])
8935ba7b91d2SJef Poskanzer# ----------------------------------
8936ba7b91d2SJef Poskanzerm4_define([lt_dict_fetch],
8937ba7b91d2SJef Poskanzer[m4_ifval([$3],
8938ba7b91d2SJef Poskanzer	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
8939ba7b91d2SJef Poskanzer    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8940ba7b91d2SJef Poskanzer
8941ba7b91d2SJef Poskanzer
8942ba7b91d2SJef Poskanzer# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
8943ba7b91d2SJef Poskanzer# -----------------------------------------------------------------
8944ba7b91d2SJef Poskanzerm4_define([lt_if_dict_fetch],
8945ba7b91d2SJef Poskanzer[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
8946ba7b91d2SJef Poskanzer	[$5],
8947ba7b91d2SJef Poskanzer    [$6])])
8948ba7b91d2SJef Poskanzer
8949ba7b91d2SJef Poskanzer
8950ba7b91d2SJef Poskanzer# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
8951ba7b91d2SJef Poskanzer# --------------------------------------------------------------
8952ba7b91d2SJef Poskanzerm4_define([lt_dict_filter],
8953ba7b91d2SJef Poskanzer[m4_if([$5], [], [],
8954ba7b91d2SJef Poskanzer  [lt_join(m4_quote(m4_default([$4], [[, ]])),
8955ba7b91d2SJef Poskanzer           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
8956ba7b91d2SJef Poskanzer		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
8957ba7b91d2SJef Poskanzer])
8958ba7b91d2SJef Poskanzer
8959ba7b91d2SJef Poskanzer# ltversion.m4 -- version numbers			-*- Autoconf -*-
8960ba7b91d2SJef Poskanzer#
8961*85b25c2eSBruce A. Mah#   Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation,
8962*85b25c2eSBruce A. Mah#   Inc.
8963ba7b91d2SJef Poskanzer#   Written by Scott James Remnant, 2004
8964ba7b91d2SJef Poskanzer#
8965ba7b91d2SJef Poskanzer# This file is free software; the Free Software Foundation gives
8966ba7b91d2SJef Poskanzer# unlimited permission to copy and/or distribute it, with or without
8967ba7b91d2SJef Poskanzer# modifications, as long as this notice is preserved.
8968ba7b91d2SJef Poskanzer
89696edfd8d6SBruce A. Mah# @configure_input@
8970ba7b91d2SJef Poskanzer
8971*85b25c2eSBruce A. Mah# serial 4245 ltversion.m4
8972ba7b91d2SJef Poskanzer# This file is part of GNU Libtool
8973ba7b91d2SJef Poskanzer
8974*85b25c2eSBruce A. Mahm4_define([LT_PACKAGE_VERSION], [2.4.7])
8975*85b25c2eSBruce A. Mahm4_define([LT_PACKAGE_REVISION], [2.4.7])
8976ba7b91d2SJef Poskanzer
8977ba7b91d2SJef PoskanzerAC_DEFUN([LTVERSION_VERSION],
8978*85b25c2eSBruce A. Mah[macro_version='2.4.7'
8979*85b25c2eSBruce A. Mahmacro_revision='2.4.7'
8980ba7b91d2SJef Poskanzer_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
8981ba7b91d2SJef Poskanzer_LT_DECL(, macro_revision, 0)
8982ba7b91d2SJef Poskanzer])
8983ba7b91d2SJef Poskanzer
8984ba7b91d2SJef Poskanzer# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
8985ba7b91d2SJef Poskanzer#
8986*85b25c2eSBruce A. Mah#   Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free
8987*85b25c2eSBruce A. Mah#   Software Foundation, Inc.
8988ba7b91d2SJef Poskanzer#   Written by Scott James Remnant, 2004.
8989ba7b91d2SJef Poskanzer#
8990ba7b91d2SJef Poskanzer# This file is free software; the Free Software Foundation gives
8991ba7b91d2SJef Poskanzer# unlimited permission to copy and/or distribute it, with or without
8992ba7b91d2SJef Poskanzer# modifications, as long as this notice is preserved.
8993ba7b91d2SJef Poskanzer
89946edfd8d6SBruce A. Mah# serial 5 lt~obsolete.m4
8995ba7b91d2SJef Poskanzer
8996ba7b91d2SJef Poskanzer# These exist entirely to fool aclocal when bootstrapping libtool.
8997ba7b91d2SJef Poskanzer#
89984874c4a8SBruce A. Mah# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
8999ba7b91d2SJef Poskanzer# which have later been changed to m4_define as they aren't part of the
9000ba7b91d2SJef Poskanzer# exported API, or moved to Autoconf or Automake where they belong.
9001ba7b91d2SJef Poskanzer#
9002ba7b91d2SJef Poskanzer# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
9003ba7b91d2SJef Poskanzer# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
9004ba7b91d2SJef Poskanzer# using a macro with the same name in our local m4/libtool.m4 it'll
9005ba7b91d2SJef Poskanzer# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
9006ba7b91d2SJef Poskanzer# and doesn't know about Autoconf macros at all.)
9007ba7b91d2SJef Poskanzer#
9008ba7b91d2SJef Poskanzer# So we provide this file, which has a silly filename so it's always
9009ba7b91d2SJef Poskanzer# included after everything else.  This provides aclocal with the
9010ba7b91d2SJef Poskanzer# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
9011ba7b91d2SJef Poskanzer# because those macros already exist, or will be overwritten later.
9012ba7b91d2SJef Poskanzer# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
9013ba7b91d2SJef Poskanzer#
9014ba7b91d2SJef Poskanzer# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
9015ba7b91d2SJef Poskanzer# Yes, that means every name once taken will need to remain here until
9016ba7b91d2SJef Poskanzer# we give up compatibility with versions before 1.7, at which point
9017ba7b91d2SJef Poskanzer# we need to keep only those names which we still refer to.
9018ba7b91d2SJef Poskanzer
9019ba7b91d2SJef Poskanzer# This is to help aclocal find these macros, as it can't see m4_define.
9020ba7b91d2SJef PoskanzerAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
9021ba7b91d2SJef Poskanzer
9022ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
9023ba7b91d2SJef Poskanzerm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
9024ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
9025ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
9026ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
9027ba7b91d2SJef Poskanzerm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
9028ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
9029ba7b91d2SJef Poskanzerm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9030ba7b91d2SJef Poskanzerm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
9031ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
9032ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
9033ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9034ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9035ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9036ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9037ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9038ba7b91d2SJef Poskanzerm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
9039ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9040ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9041ba7b91d2SJef Poskanzerm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
9042ba7b91d2SJef Poskanzerm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
9043ba7b91d2SJef Poskanzerm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9044ba7b91d2SJef Poskanzerm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9045ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9046ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9047ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9048ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9049ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9050ba7b91d2SJef Poskanzerm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
9051ba7b91d2SJef Poskanzerm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
9052ba7b91d2SJef Poskanzerm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
9053ba7b91d2SJef Poskanzerm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9054ba7b91d2SJef Poskanzerm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9055ba7b91d2SJef Poskanzerm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
9056ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
9057ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9058ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9059ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
9060ba7b91d2SJef Poskanzerm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9061ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
9062ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
9063ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
9064ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9065ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9066ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9067ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9068ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9069ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9070ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9071ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9072ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9073ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9074ba7b91d2SJef Poskanzerm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9075ba7b91d2SJef Poskanzerm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
90766edfd8d6SBruce A. Mahm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
90776edfd8d6SBruce A. Mahm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
90786edfd8d6SBruce A. Mahm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
90796edfd8d6SBruce A. Mahm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
90806edfd8d6SBruce A. Mahm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
90816edfd8d6SBruce A. Mahm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
90826edfd8d6SBruce A. Mahm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9083ba7b91d2SJef Poskanzer
908476bd67f6SSarah Larsen# Copyright (C) 2002-2021 Free Software Foundation, Inc.
908501ca972bSsethdelliott#
908601ca972bSsethdelliott# This file is free software; the Free Software Foundation
908701ca972bSsethdelliott# gives unlimited permission to copy and/or distribute it,
908801ca972bSsethdelliott# with or without modifications, as long as this notice is preserved.
908901ca972bSsethdelliott
909001ca972bSsethdelliott# AM_AUTOMAKE_VERSION(VERSION)
909101ca972bSsethdelliott# ----------------------------
909201ca972bSsethdelliott# Automake X.Y traces this macro to ensure aclocal.m4 has been
909301ca972bSsethdelliott# generated from the m4 files accompanying Automake X.Y.
9094ba7b91d2SJef Poskanzer# (This private macro should not be called outside this file.)
9095ba7b91d2SJef PoskanzerAC_DEFUN([AM_AUTOMAKE_VERSION],
9096ff1ea4e5SBruce A. Mah[am__api_version='1.16'
9097ba7b91d2SJef Poskanzerdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
9098ba7b91d2SJef Poskanzerdnl require some minimum version.  Point them to the right macro.
909976bd67f6SSarah Larsenm4_if([$1], [1.16.5], [],
9100ba7b91d2SJef Poskanzer      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
9101ba7b91d2SJef Poskanzer])
9102ba7b91d2SJef Poskanzer
9103ba7b91d2SJef Poskanzer# _AM_AUTOCONF_VERSION(VERSION)
9104ba7b91d2SJef Poskanzer# -----------------------------
9105ba7b91d2SJef Poskanzer# aclocal traces this macro to find the Autoconf version.
9106ba7b91d2SJef Poskanzer# This is a private macro too.  Using m4_define simplifies
9107ba7b91d2SJef Poskanzer# the logic in aclocal, which can simply ignore this definition.
9108ba7b91d2SJef Poskanzerm4_define([_AM_AUTOCONF_VERSION], [])
910901ca972bSsethdelliott
911001ca972bSsethdelliott# AM_SET_CURRENT_AUTOMAKE_VERSION
911101ca972bSsethdelliott# -------------------------------
9112ba7b91d2SJef Poskanzer# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
911360bd98a5SBruce A. Mah# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
911401ca972bSsethdelliottAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
911576bd67f6SSarah Larsen[AM_AUTOMAKE_VERSION([1.16.5])dnl
911660bd98a5SBruce A. Mahm4_ifndef([AC_AUTOCONF_VERSION],
911760bd98a5SBruce A. Mah  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
911860bd98a5SBruce A. Mah_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
911901ca972bSsethdelliott
912001ca972bSsethdelliott# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
912101ca972bSsethdelliott
912276bd67f6SSarah Larsen# Copyright (C) 2001-2021 Free Software Foundation, Inc.
912301ca972bSsethdelliott#
912401ca972bSsethdelliott# This file is free software; the Free Software Foundation
912501ca972bSsethdelliott# gives unlimited permission to copy and/or distribute it,
912601ca972bSsethdelliott# with or without modifications, as long as this notice is preserved.
912701ca972bSsethdelliott
912801ca972bSsethdelliott# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
91296edfd8d6SBruce A. Mah# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
91306edfd8d6SBruce A. Mah# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
913101ca972bSsethdelliott#
913201ca972bSsethdelliott# Of course, Automake must honor this variable whenever it calls a
913301ca972bSsethdelliott# tool from the auxiliary directory.  The problem is that $srcdir (and
913401ca972bSsethdelliott# therefore $ac_aux_dir as well) can be either absolute or relative,
913501ca972bSsethdelliott# depending on how configure is run.  This is pretty annoying, since
913601ca972bSsethdelliott# it makes $ac_aux_dir quite unusable in subdirectories: in the top
913701ca972bSsethdelliott# source directory, any form will work fine, but in subdirectories a
913801ca972bSsethdelliott# relative path needs to be adjusted first.
913901ca972bSsethdelliott#
914001ca972bSsethdelliott# $ac_aux_dir/missing
914101ca972bSsethdelliott#    fails when called from a subdirectory if $ac_aux_dir is relative
914201ca972bSsethdelliott# $top_srcdir/$ac_aux_dir/missing
914301ca972bSsethdelliott#    fails if $ac_aux_dir is absolute,
914401ca972bSsethdelliott#    fails when called from a subdirectory in a VPATH build with
914501ca972bSsethdelliott#          a relative $ac_aux_dir
914601ca972bSsethdelliott#
914701ca972bSsethdelliott# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
914801ca972bSsethdelliott# are both prefixed by $srcdir.  In an in-source build this is usually
91496edfd8d6SBruce A. Mah# harmless because $srcdir is '.', but things will broke when you
915001ca972bSsethdelliott# start a VPATH build or use an absolute $srcdir.
915101ca972bSsethdelliott#
915201ca972bSsethdelliott# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
915301ca972bSsethdelliott# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
915401ca972bSsethdelliott#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
915501ca972bSsethdelliott# and then we would define $MISSING as
915601ca972bSsethdelliott#   MISSING="\${SHELL} $am_aux_dir/missing"
915701ca972bSsethdelliott# This will work as long as MISSING is not called from configure, because
915801ca972bSsethdelliott# unfortunately $(top_srcdir) has no meaning in configure.
915901ca972bSsethdelliott# However there are other variables, like CC, which are often used in
916001ca972bSsethdelliott# configure, and could therefore not use this "fixed" $ac_aux_dir.
916101ca972bSsethdelliott#
916201ca972bSsethdelliott# Another solution, used here, is to always expand $ac_aux_dir to an
916301ca972bSsethdelliott# absolute PATH.  The drawback is that using absolute paths prevent a
916401ca972bSsethdelliott# configured tree to be moved without reconfiguration.
916501ca972bSsethdelliott
916601ca972bSsethdelliottAC_DEFUN([AM_AUX_DIR_EXPAND],
91675461579dSBruce A. Mah[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
91685461579dSBruce A. Mah# Expand $ac_aux_dir to an absolute path.
91695461579dSBruce A. Maham_aux_dir=`cd "$ac_aux_dir" && pwd`
917001ca972bSsethdelliott])
917101ca972bSsethdelliott
917201ca972bSsethdelliott# AM_CONDITIONAL                                            -*- Autoconf -*-
917301ca972bSsethdelliott
917476bd67f6SSarah Larsen# Copyright (C) 1997-2021 Free Software Foundation, Inc.
917501ca972bSsethdelliott#
917601ca972bSsethdelliott# This file is free software; the Free Software Foundation
917701ca972bSsethdelliott# gives unlimited permission to copy and/or distribute it,
917801ca972bSsethdelliott# with or without modifications, as long as this notice is preserved.
917901ca972bSsethdelliott
918001ca972bSsethdelliott# AM_CONDITIONAL(NAME, SHELL-CONDITION)
918101ca972bSsethdelliott# -------------------------------------
918201ca972bSsethdelliott# Define a conditional.
918301ca972bSsethdelliottAC_DEFUN([AM_CONDITIONAL],
91846edfd8d6SBruce A. Mah[AC_PREREQ([2.52])dnl
91856edfd8d6SBruce A. Mah m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
918601ca972bSsethdelliott       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
9187ba7b91d2SJef PoskanzerAC_SUBST([$1_TRUE])dnl
9188ba7b91d2SJef PoskanzerAC_SUBST([$1_FALSE])dnl
9189ba7b91d2SJef Poskanzer_AM_SUBST_NOTMAKE([$1_TRUE])dnl
9190ba7b91d2SJef Poskanzer_AM_SUBST_NOTMAKE([$1_FALSE])dnl
919160bd98a5SBruce A. Mahm4_define([_AM_COND_VALUE_$1], [$2])dnl
919201ca972bSsethdelliottif $2; then
919301ca972bSsethdelliott  $1_TRUE=
919401ca972bSsethdelliott  $1_FALSE='#'
919501ca972bSsethdelliottelse
919601ca972bSsethdelliott  $1_TRUE='#'
919701ca972bSsethdelliott  $1_FALSE=
919801ca972bSsethdelliottfi
919901ca972bSsethdelliottAC_CONFIG_COMMANDS_PRE(
920001ca972bSsethdelliott[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
920101ca972bSsethdelliott  AC_MSG_ERROR([[conditional "$1" was never defined.
920201ca972bSsethdelliottUsually this means the macro was only invoked conditionally.]])
920301ca972bSsethdelliottfi])])
920401ca972bSsethdelliott
920576bd67f6SSarah Larsen# Copyright (C) 1999-2021 Free Software Foundation, Inc.
920601ca972bSsethdelliott#
920701ca972bSsethdelliott# This file is free software; the Free Software Foundation
920801ca972bSsethdelliott# gives unlimited permission to copy and/or distribute it,
920901ca972bSsethdelliott# with or without modifications, as long as this notice is preserved.
921001ca972bSsethdelliott
921101ca972bSsethdelliott
92126edfd8d6SBruce A. Mah# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
921301ca972bSsethdelliott# written in clear, in which case automake, when reading aclocal.m4,
921401ca972bSsethdelliott# will think it sees a *use*, and therefore will trigger all it's
921501ca972bSsethdelliott# C support machinery.  Also note that it means that autoscan, seeing
921601ca972bSsethdelliott# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
921701ca972bSsethdelliott
921801ca972bSsethdelliott
921901ca972bSsethdelliott# _AM_DEPENDENCIES(NAME)
922001ca972bSsethdelliott# ----------------------
922101ca972bSsethdelliott# See how the compiler implements dependency checking.
92226edfd8d6SBruce A. Mah# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
922301ca972bSsethdelliott# We try a few techniques and use that to set a single cache variable.
922401ca972bSsethdelliott#
922501ca972bSsethdelliott# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
922601ca972bSsethdelliott# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
922701ca972bSsethdelliott# dependency, and given that the user is not expected to run this macro,
922801ca972bSsethdelliott# just rely on AC_PROG_CC.
922901ca972bSsethdelliottAC_DEFUN([_AM_DEPENDENCIES],
923001ca972bSsethdelliott[AC_REQUIRE([AM_SET_DEPDIR])dnl
923101ca972bSsethdelliottAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
923201ca972bSsethdelliottAC_REQUIRE([AM_MAKE_INCLUDE])dnl
923301ca972bSsethdelliottAC_REQUIRE([AM_DEP_TRACK])dnl
923401ca972bSsethdelliott
92356edfd8d6SBruce A. Mahm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
92366edfd8d6SBruce A. Mah      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
92376edfd8d6SBruce A. Mah      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
92386edfd8d6SBruce A. Mah      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
92396edfd8d6SBruce A. Mah      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
92406edfd8d6SBruce A. Mah      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
924101ca972bSsethdelliott                    [depcc="$$1"   am_compiler_list=])
924201ca972bSsethdelliott
924301ca972bSsethdelliottAC_CACHE_CHECK([dependency style of $depcc],
924401ca972bSsethdelliott               [am_cv_$1_dependencies_compiler_type],
924501ca972bSsethdelliott[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
924601ca972bSsethdelliott  # We make a subdir and do the tests there.  Otherwise we can end up
924701ca972bSsethdelliott  # making bogus files that we don't know about and never remove.  For
924801ca972bSsethdelliott  # instance it was reported that on HP-UX the gcc test will end up
92496edfd8d6SBruce A. Mah  # making a dummy file named 'D' -- because '-MD' means "put the output
92506edfd8d6SBruce A. Mah  # in D".
92516edfd8d6SBruce A. Mah  rm -rf conftest.dir
925201ca972bSsethdelliott  mkdir conftest.dir
925301ca972bSsethdelliott  # Copy depcomp to subdir because otherwise we won't find it if we're
925401ca972bSsethdelliott  # using a relative directory.
925501ca972bSsethdelliott  cp "$am_depcomp" conftest.dir
925601ca972bSsethdelliott  cd conftest.dir
925701ca972bSsethdelliott  # We will build objects and dependencies in a subdirectory because
925801ca972bSsethdelliott  # it helps to detect inapplicable dependency modes.  For instance
925901ca972bSsethdelliott  # both Tru64's cc and ICC support -MD to output dependencies as a
926001ca972bSsethdelliott  # side effect of compilation, but ICC will put the dependencies in
926101ca972bSsethdelliott  # the current directory while Tru64 will put them in the object
926201ca972bSsethdelliott  # directory.
926301ca972bSsethdelliott  mkdir sub
926401ca972bSsethdelliott
926501ca972bSsethdelliott  am_cv_$1_dependencies_compiler_type=none
926601ca972bSsethdelliott  if test "$am_compiler_list" = ""; then
926701ca972bSsethdelliott     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
926801ca972bSsethdelliott  fi
926960bd98a5SBruce A. Mah  am__universal=false
927060bd98a5SBruce A. Mah  m4_case([$1], [CC],
927160bd98a5SBruce A. Mah    [case " $depcc " in #(
927260bd98a5SBruce A. Mah     *\ -arch\ *\ -arch\ *) am__universal=true ;;
927360bd98a5SBruce A. Mah     esac],
927460bd98a5SBruce A. Mah    [CXX],
927560bd98a5SBruce A. Mah    [case " $depcc " in #(
927660bd98a5SBruce A. Mah     *\ -arch\ *\ -arch\ *) am__universal=true ;;
927760bd98a5SBruce A. Mah     esac])
927860bd98a5SBruce A. Mah
927901ca972bSsethdelliott  for depmode in $am_compiler_list; do
928001ca972bSsethdelliott    # Setup a source with many dependencies, because some compilers
928101ca972bSsethdelliott    # like to wrap large dependency lists on column 80 (with \), and
928201ca972bSsethdelliott    # we should not choose a depcomp mode which is confused by this.
928301ca972bSsethdelliott    #
928401ca972bSsethdelliott    # We need to recreate these files for each test, as the compiler may
928501ca972bSsethdelliott    # overwrite some of them when testing with obscure command lines.
928601ca972bSsethdelliott    # This happens at least with the AIX C compiler.
928701ca972bSsethdelliott    : > sub/conftest.c
928801ca972bSsethdelliott    for i in 1 2 3 4 5 6; do
928901ca972bSsethdelliott      echo '#include "conftst'$i'.h"' >> sub/conftest.c
92906edfd8d6SBruce A. Mah      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
92916edfd8d6SBruce A. Mah      # Solaris 10 /bin/sh.
92926edfd8d6SBruce A. Mah      echo '/* dummy */' > sub/conftst$i.h
929301ca972bSsethdelliott    done
929401ca972bSsethdelliott    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
929501ca972bSsethdelliott
92966edfd8d6SBruce A. Mah    # We check with '-c' and '-o' for the sake of the "dashmstdout"
929760bd98a5SBruce A. Mah    # mode.  It turns out that the SunPro C++ compiler does not properly
92986edfd8d6SBruce A. Mah    # handle '-M -o', and we need to detect this.  Also, some Intel
92996edfd8d6SBruce A. Mah    # versions had trouble with output in subdirs.
930060bd98a5SBruce A. Mah    am__obj=sub/conftest.${OBJEXT-o}
930160bd98a5SBruce A. Mah    am__minus_obj="-o $am__obj"
930201ca972bSsethdelliott    case $depmode in
930360bd98a5SBruce A. Mah    gcc)
930460bd98a5SBruce A. Mah      # This depmode causes a compiler race in universal mode.
930560bd98a5SBruce A. Mah      test "$am__universal" = false || continue
930660bd98a5SBruce A. Mah      ;;
930701ca972bSsethdelliott    nosideeffect)
93086edfd8d6SBruce A. Mah      # After this tag, mechanisms are not by side-effect, so they'll
93096edfd8d6SBruce A. Mah      # only be used when explicitly requested.
931001ca972bSsethdelliott      if test "x$enable_dependency_tracking" = xyes; then
931101ca972bSsethdelliott	continue
931201ca972bSsethdelliott      else
931301ca972bSsethdelliott	break
931401ca972bSsethdelliott      fi
931501ca972bSsethdelliott      ;;
93166edfd8d6SBruce A. Mah    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
93176edfd8d6SBruce A. Mah      # This compiler won't grok '-c -o', but also, the minuso test has
931860bd98a5SBruce A. Mah      # not run yet.  These depmodes are late enough in the game, and
931960bd98a5SBruce A. Mah      # so weak that their functioning should not be impacted.
932060bd98a5SBruce A. Mah      am__obj=conftest.${OBJEXT-o}
932160bd98a5SBruce A. Mah      am__minus_obj=
932260bd98a5SBruce A. Mah      ;;
932301ca972bSsethdelliott    none) break ;;
932401ca972bSsethdelliott    esac
932501ca972bSsethdelliott    if depmode=$depmode \
932660bd98a5SBruce A. Mah       source=sub/conftest.c object=$am__obj \
932701ca972bSsethdelliott       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
932860bd98a5SBruce A. Mah       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
932901ca972bSsethdelliott         >/dev/null 2>conftest.err &&
9330ba7b91d2SJef Poskanzer       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
933101ca972bSsethdelliott       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
933260bd98a5SBruce A. Mah       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
933301ca972bSsethdelliott       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
933401ca972bSsethdelliott      # icc doesn't choke on unknown options, it will just issue warnings
933501ca972bSsethdelliott      # or remarks (even with -Werror).  So we grep stderr for any message
933601ca972bSsethdelliott      # that says an option was ignored or not supported.
933701ca972bSsethdelliott      # When given -MP, icc 7.0 and 7.1 complain thusly:
933801ca972bSsethdelliott      #   icc: Command line warning: ignoring option '-M'; no argument required
933901ca972bSsethdelliott      # The diagnosis changed in icc 8.0:
934001ca972bSsethdelliott      #   icc: Command line remark: option '-MP' not supported
934101ca972bSsethdelliott      if (grep 'ignoring option' conftest.err ||
934201ca972bSsethdelliott          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
934301ca972bSsethdelliott        am_cv_$1_dependencies_compiler_type=$depmode
934401ca972bSsethdelliott        break
934501ca972bSsethdelliott      fi
934601ca972bSsethdelliott    fi
934701ca972bSsethdelliott  done
934801ca972bSsethdelliott
934901ca972bSsethdelliott  cd ..
935001ca972bSsethdelliott  rm -rf conftest.dir
935101ca972bSsethdelliottelse
935201ca972bSsethdelliott  am_cv_$1_dependencies_compiler_type=none
935301ca972bSsethdelliottfi
935401ca972bSsethdelliott])
935501ca972bSsethdelliottAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
935601ca972bSsethdelliottAM_CONDITIONAL([am__fastdep$1], [
935701ca972bSsethdelliott  test "x$enable_dependency_tracking" != xno \
935801ca972bSsethdelliott  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
935901ca972bSsethdelliott])
936001ca972bSsethdelliott
936101ca972bSsethdelliott
936201ca972bSsethdelliott# AM_SET_DEPDIR
936301ca972bSsethdelliott# -------------
936401ca972bSsethdelliott# Choose a directory name for dependency files.
93656edfd8d6SBruce A. Mah# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
936601ca972bSsethdelliottAC_DEFUN([AM_SET_DEPDIR],
936701ca972bSsethdelliott[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
936801ca972bSsethdelliottAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
936901ca972bSsethdelliott])
937001ca972bSsethdelliott
937101ca972bSsethdelliott
937201ca972bSsethdelliott# AM_DEP_TRACK
937301ca972bSsethdelliott# ------------
937401ca972bSsethdelliottAC_DEFUN([AM_DEP_TRACK],
93756edfd8d6SBruce A. Mah[AC_ARG_ENABLE([dependency-tracking], [dnl
93766edfd8d6SBruce A. MahAS_HELP_STRING(
93776edfd8d6SBruce A. Mah  [--enable-dependency-tracking],
93786edfd8d6SBruce A. Mah  [do not reject slow dependency extractors])
93796edfd8d6SBruce A. MahAS_HELP_STRING(
93806edfd8d6SBruce A. Mah  [--disable-dependency-tracking],
93816edfd8d6SBruce A. Mah  [speeds up one-time build])])
938201ca972bSsethdelliottif test "x$enable_dependency_tracking" != xno; then
938301ca972bSsethdelliott  am_depcomp="$ac_aux_dir/depcomp"
938401ca972bSsethdelliott  AMDEPBACKSLASH='\'
93856edfd8d6SBruce A. Mah  am__nodep='_no'
938601ca972bSsethdelliottfi
938701ca972bSsethdelliottAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
9388ba7b91d2SJef PoskanzerAC_SUBST([AMDEPBACKSLASH])dnl
9389ba7b91d2SJef Poskanzer_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
93906edfd8d6SBruce A. MahAC_SUBST([am__nodep])dnl
93916edfd8d6SBruce A. Mah_AM_SUBST_NOTMAKE([am__nodep])dnl
939201ca972bSsethdelliott])
939301ca972bSsethdelliott
939401ca972bSsethdelliott# Generate code to set up dependency tracking.              -*- Autoconf -*-
939501ca972bSsethdelliott
939676bd67f6SSarah Larsen# Copyright (C) 1999-2021 Free Software Foundation, Inc.
939701ca972bSsethdelliott#
939801ca972bSsethdelliott# This file is free software; the Free Software Foundation
939901ca972bSsethdelliott# gives unlimited permission to copy and/or distribute it,
940001ca972bSsethdelliott# with or without modifications, as long as this notice is preserved.
940101ca972bSsethdelliott
940201ca972bSsethdelliott# _AM_OUTPUT_DEPENDENCY_COMMANDS
940301ca972bSsethdelliott# ------------------------------
940401ca972bSsethdelliottAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
940560bd98a5SBruce A. Mah[{
94066edfd8d6SBruce A. Mah  # Older Autoconf quotes --file arguments for eval, but not when files
940760bd98a5SBruce A. Mah  # are listed without --file.  Let's play safe and only enable the eval
940860bd98a5SBruce A. Mah  # if we detect the quoting.
9409ff1ea4e5SBruce A. Mah  # TODO: see whether this extra hack can be removed once we start
9410ff1ea4e5SBruce A. Mah  # requiring Autoconf 2.70 or later.
9411ff1ea4e5SBruce A. Mah  AS_CASE([$CONFIG_FILES],
9412ff1ea4e5SBruce A. Mah          [*\'*], [eval set x "$CONFIG_FILES"],
9413ff1ea4e5SBruce A. Mah          [*], [set x $CONFIG_FILES])
941460bd98a5SBruce A. Mah  shift
9415ff1ea4e5SBruce A. Mah  # Used to flag and report bootstrapping failures.
9416ff1ea4e5SBruce A. Mah  am_rc=0
9417ff1ea4e5SBruce A. Mah  for am_mf
941860bd98a5SBruce A. Mah  do
941901ca972bSsethdelliott    # Strip MF so we end up with the name of the file.
9420ff1ea4e5SBruce A. Mah    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
9421ff1ea4e5SBruce A. Mah    # Check whether this is an Automake generated Makefile which includes
9422ff1ea4e5SBruce A. Mah    # dependency-tracking related rules and includes.
9423ff1ea4e5SBruce A. Mah    # Grep'ing the whole file directly is not great: AIX grep has a line
9424ba7b91d2SJef Poskanzer    # limit of 2048, but all sed's we know have understand at least 4000.
9425ff1ea4e5SBruce A. Mah    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
9426ff1ea4e5SBruce A. Mah      || continue
9427ff1ea4e5SBruce A. Mah    am_dirpart=`AS_DIRNAME(["$am_mf"])`
9428ff1ea4e5SBruce A. Mah    am_filepart=`AS_BASENAME(["$am_mf"])`
9429ff1ea4e5SBruce A. Mah    AM_RUN_LOG([cd "$am_dirpart" \
9430ff1ea4e5SBruce A. Mah      && sed -e '/# am--include-marker/d' "$am_filepart" \
9431ff1ea4e5SBruce A. Mah        | $MAKE -f - am--depfiles]) || am_rc=$?
9432ff1ea4e5SBruce A. Mah  done
9433ff1ea4e5SBruce A. Mah  if test $am_rc -ne 0; then
9434ff1ea4e5SBruce A. Mah    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
943506280a6dSBruce A. Mah    for automatic dependency tracking.  If GNU make was not used, consider
943606280a6dSBruce A. Mah    re-running the configure script with MAKE="gmake" (or whatever is
943706280a6dSBruce A. Mah    necessary).  You can also try re-running configure with the
9438ff1ea4e5SBruce A. Mah    '--disable-dependency-tracking' option to at least be able to build
9439ff1ea4e5SBruce A. Mah    the package (albeit without support for automatic dependency tracking).])
944001ca972bSsethdelliott  fi
9441ff1ea4e5SBruce A. Mah  AS_UNSET([am_dirpart])
9442ff1ea4e5SBruce A. Mah  AS_UNSET([am_filepart])
9443ff1ea4e5SBruce A. Mah  AS_UNSET([am_mf])
9444ff1ea4e5SBruce A. Mah  AS_UNSET([am_rc])
9445ff1ea4e5SBruce A. Mah  rm -f conftest-deps.mk
944660bd98a5SBruce A. Mah}
944701ca972bSsethdelliott])# _AM_OUTPUT_DEPENDENCY_COMMANDS
944801ca972bSsethdelliott
944901ca972bSsethdelliott
945001ca972bSsethdelliott# AM_OUTPUT_DEPENDENCY_COMMANDS
945101ca972bSsethdelliott# -----------------------------
945201ca972bSsethdelliott# This macro should only be invoked once -- use via AC_REQUIRE.
945301ca972bSsethdelliott#
9454ff1ea4e5SBruce A. Mah# This code is only required when automatic dependency tracking is enabled.
9455ff1ea4e5SBruce A. Mah# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
9456ff1ea4e5SBruce A. Mah# order to bootstrap the dependency handling code.
945701ca972bSsethdelliottAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
945801ca972bSsethdelliott[AC_CONFIG_COMMANDS([depfiles],
945901ca972bSsethdelliott     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
9460ff1ea4e5SBruce A. Mah     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
946101ca972bSsethdelliott
94625d2f2cf9SBruce A. Mah# Do all the work for Automake.                             -*- Autoconf -*-
94635d2f2cf9SBruce A. Mah
946476bd67f6SSarah Larsen# Copyright (C) 1996-2021 Free Software Foundation, Inc.
94655d2f2cf9SBruce A. Mah#
94665d2f2cf9SBruce A. Mah# This file is free software; the Free Software Foundation
94675d2f2cf9SBruce A. Mah# gives unlimited permission to copy and/or distribute it,
94685d2f2cf9SBruce A. Mah# with or without modifications, as long as this notice is preserved.
94695d2f2cf9SBruce A. Mah
947001ca972bSsethdelliott# This macro actually does too much.  Some checks are only needed if
947101ca972bSsethdelliott# your package does certain things.  But this isn't really a big deal.
947201ca972bSsethdelliott
94736edfd8d6SBruce A. Mahdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
94746edfd8d6SBruce A. Mahm4_define([AC_PROG_CC],
94756edfd8d6SBruce A. Mahm4_defn([AC_PROG_CC])
94766edfd8d6SBruce A. Mah[_AM_PROG_CC_C_O
94776edfd8d6SBruce A. Mah])
94786edfd8d6SBruce A. Mah
947901ca972bSsethdelliott# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
948001ca972bSsethdelliott# AM_INIT_AUTOMAKE([OPTIONS])
948101ca972bSsethdelliott# -----------------------------------------------
948201ca972bSsethdelliott# The call with PACKAGE and VERSION arguments is the old style
948301ca972bSsethdelliott# call (pre autoconf-2.50), which is being phased out.  PACKAGE
948401ca972bSsethdelliott# and VERSION should now be passed to AC_INIT and removed from
948501ca972bSsethdelliott# the call to AM_INIT_AUTOMAKE.
948601ca972bSsethdelliott# We support both call styles for the transition.  After
948701ca972bSsethdelliott# the next Automake release, Autoconf can make the AC_INIT
948801ca972bSsethdelliott# arguments mandatory, and then we can depend on a new Autoconf
948901ca972bSsethdelliott# release and drop the old call support.
949001ca972bSsethdelliottAC_DEFUN([AM_INIT_AUTOMAKE],
94916edfd8d6SBruce A. Mah[AC_PREREQ([2.65])dnl
949276bd67f6SSarah Larsenm4_ifdef([_$0_ALREADY_INIT],
949376bd67f6SSarah Larsen  [m4_fatal([$0 expanded multiple times
949476bd67f6SSarah Larsen]m4_defn([_$0_ALREADY_INIT]))],
949576bd67f6SSarah Larsen  [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
949601ca972bSsethdelliottdnl Autoconf wants to disallow AM_ names.  We explicitly allow
949701ca972bSsethdelliottdnl the ones we care about.
949801ca972bSsethdelliottm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
949901ca972bSsethdelliottAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
950001ca972bSsethdelliottAC_REQUIRE([AC_PROG_INSTALL])dnl
9501ba7b91d2SJef Poskanzerif test "`cd $srcdir && pwd`" != "`pwd`"; then
9502ba7b91d2SJef Poskanzer  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
9503ba7b91d2SJef Poskanzer  # is not polluted with repeated "-I."
9504ba7b91d2SJef Poskanzer  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
950501ca972bSsethdelliott  # test to see if srcdir already configured
9506ba7b91d2SJef Poskanzer  if test -f $srcdir/config.status; then
950701ca972bSsethdelliott    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
950801ca972bSsethdelliott  fi
9509ba7b91d2SJef Poskanzerfi
951001ca972bSsethdelliott
951101ca972bSsethdelliott# test whether we have cygpath
951201ca972bSsethdelliottif test -z "$CYGPATH_W"; then
951301ca972bSsethdelliott  if (cygpath --version) >/dev/null 2>/dev/null; then
951401ca972bSsethdelliott    CYGPATH_W='cygpath -w'
951501ca972bSsethdelliott  else
951601ca972bSsethdelliott    CYGPATH_W=echo
951701ca972bSsethdelliott  fi
951801ca972bSsethdelliottfi
951901ca972bSsethdelliottAC_SUBST([CYGPATH_W])
952001ca972bSsethdelliott
952101ca972bSsethdelliott# Define the identity of the package.
952201ca972bSsethdelliottdnl Distinguish between old-style and new-style calls.
952301ca972bSsethdelliottm4_ifval([$2],
95246edfd8d6SBruce A. Mah[AC_DIAGNOSE([obsolete],
95256edfd8d6SBruce A. Mah             [$0: two- and three-arguments forms are deprecated.])
95266edfd8d6SBruce A. Mahm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
952701ca972bSsethdelliott AC_SUBST([PACKAGE], [$1])dnl
952801ca972bSsethdelliott AC_SUBST([VERSION], [$2])],
952901ca972bSsethdelliott[_AM_SET_OPTIONS([$1])dnl
9530ba7b91d2SJef Poskanzerdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
95316edfd8d6SBruce A. Mahm4_if(
953276bd67f6SSarah Larsen  m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
95336edfd8d6SBruce A. Mah  [ok:ok],,
9534ba7b91d2SJef Poskanzer  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
953501ca972bSsethdelliott AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
953601ca972bSsethdelliott AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
953701ca972bSsethdelliott
953801ca972bSsethdelliott_AM_IF_OPTION([no-define],,
95396edfd8d6SBruce A. Mah[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
95406edfd8d6SBruce A. Mah AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
954101ca972bSsethdelliott
954201ca972bSsethdelliott# Some tools Automake needs.
954301ca972bSsethdelliottAC_REQUIRE([AM_SANITY_CHECK])dnl
954401ca972bSsethdelliottAC_REQUIRE([AC_ARG_PROGRAM])dnl
95456edfd8d6SBruce A. MahAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
95466edfd8d6SBruce A. MahAM_MISSING_PROG([AUTOCONF], [autoconf])
95476edfd8d6SBruce A. MahAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
95486edfd8d6SBruce A. MahAM_MISSING_PROG([AUTOHEADER], [autoheader])
95496edfd8d6SBruce A. MahAM_MISSING_PROG([MAKEINFO], [makeinfo])
955060bd98a5SBruce A. MahAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
955160bd98a5SBruce A. MahAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
95526edfd8d6SBruce A. MahAC_REQUIRE([AC_PROG_MKDIR_P])dnl
95536edfd8d6SBruce A. Mah# For better backward compatibility.  To be removed once Automake 1.9.x
95546edfd8d6SBruce A. Mah# dies out for good.  For more background, see:
9555ff1ea4e5SBruce A. Mah# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
9556ff1ea4e5SBruce A. Mah# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
95576edfd8d6SBruce A. MahAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
95585461579dSBruce A. Mah# We need awk for the "check" target (and possibly the TAP driver).  The
95595461579dSBruce A. Mah# system "awk" is bad on some platforms.
956001ca972bSsethdelliottAC_REQUIRE([AC_PROG_AWK])dnl
956101ca972bSsethdelliottAC_REQUIRE([AC_PROG_MAKE_SET])dnl
956201ca972bSsethdelliottAC_REQUIRE([AM_SET_LEADING_DOT])dnl
956301ca972bSsethdelliott_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
956401ca972bSsethdelliott	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
956501ca972bSsethdelliott			     [_AM_PROG_TAR([v7])])])
956601ca972bSsethdelliott_AM_IF_OPTION([no-dependencies],,
956701ca972bSsethdelliott[AC_PROVIDE_IFELSE([AC_PROG_CC],
95686edfd8d6SBruce A. Mah		  [_AM_DEPENDENCIES([CC])],
95696edfd8d6SBruce A. Mah		  [m4_define([AC_PROG_CC],
95706edfd8d6SBruce A. Mah			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
957101ca972bSsethdelliottAC_PROVIDE_IFELSE([AC_PROG_CXX],
95726edfd8d6SBruce A. Mah		  [_AM_DEPENDENCIES([CXX])],
95736edfd8d6SBruce A. Mah		  [m4_define([AC_PROG_CXX],
95746edfd8d6SBruce A. Mah			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
9575ba7b91d2SJef PoskanzerAC_PROVIDE_IFELSE([AC_PROG_OBJC],
95766edfd8d6SBruce A. Mah		  [_AM_DEPENDENCIES([OBJC])],
95776edfd8d6SBruce A. Mah		  [m4_define([AC_PROG_OBJC],
95786edfd8d6SBruce A. Mah			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
95796edfd8d6SBruce A. MahAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
95806edfd8d6SBruce A. Mah		  [_AM_DEPENDENCIES([OBJCXX])],
95816edfd8d6SBruce A. Mah		  [m4_define([AC_PROG_OBJCXX],
95826edfd8d6SBruce A. Mah			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
958301ca972bSsethdelliott])
958476bd67f6SSarah Larsen# Variables for tags utilities; see am/tags.am
958576bd67f6SSarah Larsenif test -z "$CTAGS"; then
958676bd67f6SSarah Larsen  CTAGS=ctags
958776bd67f6SSarah Larsenfi
958876bd67f6SSarah LarsenAC_SUBST([CTAGS])
958976bd67f6SSarah Larsenif test -z "$ETAGS"; then
959076bd67f6SSarah Larsen  ETAGS=etags
959176bd67f6SSarah Larsenfi
959276bd67f6SSarah LarsenAC_SUBST([ETAGS])
959376bd67f6SSarah Larsenif test -z "$CSCOPE"; then
959476bd67f6SSarah Larsen  CSCOPE=cscope
959576bd67f6SSarah Larsenfi
959676bd67f6SSarah LarsenAC_SUBST([CSCOPE])
959776bd67f6SSarah Larsen
95986edfd8d6SBruce A. MahAC_REQUIRE([AM_SILENT_RULES])dnl
95996edfd8d6SBruce A. Mahdnl The testsuite driver may need to know about EXEEXT, so add the
96006edfd8d6SBruce A. Mahdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
96016edfd8d6SBruce A. Mahdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
960260bd98a5SBruce A. MahAC_CONFIG_COMMANDS_PRE(dnl
960360bd98a5SBruce A. Mah[m4_provide_if([_AM_COMPILER_EXEEXT],
960460bd98a5SBruce A. Mah  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
960501ca972bSsethdelliott
96066edfd8d6SBruce A. Mah# POSIX will say in a future version that running "rm -f" with no argument
96076edfd8d6SBruce A. Mah# is OK; and we want to be able to make that assumption in our Makefile
96086edfd8d6SBruce A. Mah# recipes.  So use an aggressive probe to check that the usage we want is
96096edfd8d6SBruce A. Mah# actually supported "in the wild" to an acceptable degree.
96106edfd8d6SBruce A. Mah# See automake bug#10828.
96116edfd8d6SBruce A. Mah# To make any issue more visible, cause the running configure to be aborted
96126edfd8d6SBruce A. Mah# by default if the 'rm' program in use doesn't match our expectations; the
96136edfd8d6SBruce A. Mah# user can still override this though.
96146edfd8d6SBruce A. Mahif rm -f && rm -fr && rm -rf; then : OK; else
96156edfd8d6SBruce A. Mah  cat >&2 <<'END'
96166edfd8d6SBruce A. MahOops!
96176edfd8d6SBruce A. Mah
96186edfd8d6SBruce A. MahYour 'rm' program seems unable to run without file operands specified
96196edfd8d6SBruce A. Mahon the command line, even when the '-f' option is present.  This is contrary
96206edfd8d6SBruce A. Mahto the behaviour of most rm programs out there, and not conforming with
96216edfd8d6SBruce A. Mahthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
96226edfd8d6SBruce A. Mah
96236edfd8d6SBruce A. MahPlease tell [email protected] about your system, including the value
96246edfd8d6SBruce A. Mahof your $PATH and any error possibly output before this message.  This
96256edfd8d6SBruce A. Mahcan help us improve future automake versions.
96266edfd8d6SBruce A. Mah
96276edfd8d6SBruce A. MahEND
96286edfd8d6SBruce A. Mah  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
96296edfd8d6SBruce A. Mah    echo 'Configuration will proceed anyway, since you have set the' >&2
96306edfd8d6SBruce A. Mah    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
96316edfd8d6SBruce A. Mah    echo >&2
96326edfd8d6SBruce A. Mah  else
96336edfd8d6SBruce A. Mah    cat >&2 <<'END'
96346edfd8d6SBruce A. MahAborting the configuration process, to ensure you take notice of the issue.
96356edfd8d6SBruce A. Mah
96366edfd8d6SBruce A. MahYou can download and install GNU coreutils to get an 'rm' implementation
9637ff1ea4e5SBruce A. Mahthat behaves properly: <https://www.gnu.org/software/coreutils/>.
96386edfd8d6SBruce A. Mah
96396edfd8d6SBruce A. MahIf you want to complete the configuration process using your problematic
96406edfd8d6SBruce A. Mah'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
96416edfd8d6SBruce A. Mahto "yes", and re-run configure.
96426edfd8d6SBruce A. Mah
96436edfd8d6SBruce A. MahEND
96446edfd8d6SBruce A. Mah    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
96456edfd8d6SBruce A. Mah  fi
96465461579dSBruce A. Mahfi
96475461579dSBruce A. Mahdnl The trailing newline in this macro's definition is deliberate, for
96485461579dSBruce A. Mahdnl backward compatibility and to allow trailing 'dnl'-style comments
96495461579dSBruce A. Mahdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
96505461579dSBruce A. Mah])
96516edfd8d6SBruce A. Mah
96526edfd8d6SBruce A. Mahdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
965360bd98a5SBruce A. Mahdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
965460bd98a5SBruce A. Mahdnl mangled by Autoconf and run in a shell conditional statement.
965560bd98a5SBruce A. Mahm4_define([_AC_COMPILER_EXEEXT],
965660bd98a5SBruce A. Mahm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
965701ca972bSsethdelliott
965801ca972bSsethdelliott# When config.status generates a header, we must update the stamp-h file.
965901ca972bSsethdelliott# This file resides in the same directory as the config header
966001ca972bSsethdelliott# that is generated.  The stamp files are numbered to have different names.
966101ca972bSsethdelliott
966201ca972bSsethdelliott# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
966301ca972bSsethdelliott# loop where config.status creates the headers, so we can generate
966401ca972bSsethdelliott# our stamp files there.
966501ca972bSsethdelliottAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
966601ca972bSsethdelliott[# Compute $1's index in $config_headers.
966760bd98a5SBruce A. Mah_am_arg=$1
966801ca972bSsethdelliott_am_stamp_count=1
966901ca972bSsethdelliottfor _am_header in $config_headers :; do
967001ca972bSsethdelliott  case $_am_header in
967160bd98a5SBruce A. Mah    $_am_arg | $_am_arg:* )
967201ca972bSsethdelliott      break ;;
967301ca972bSsethdelliott    * )
967401ca972bSsethdelliott      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
967501ca972bSsethdelliott  esac
967601ca972bSsethdelliottdone
967760bd98a5SBruce A. Mahecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
967801ca972bSsethdelliott
967976bd67f6SSarah Larsen# Copyright (C) 2001-2021 Free Software Foundation, Inc.
968001ca972bSsethdelliott#
968101ca972bSsethdelliott# This file is free software; the Free Software Foundation
968201ca972bSsethdelliott# gives unlimited permission to copy and/or distribute it,
968301ca972bSsethdelliott# with or without modifications, as long as this notice is preserved.
968401ca972bSsethdelliott
968501ca972bSsethdelliott# AM_PROG_INSTALL_SH
968601ca972bSsethdelliott# ------------------
968701ca972bSsethdelliott# Define $install_sh.
968801ca972bSsethdelliottAC_DEFUN([AM_PROG_INSTALL_SH],
968901ca972bSsethdelliott[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
96905461579dSBruce A. Mahif test x"${install_sh+set}" != xset; then
969160bd98a5SBruce A. Mah  case $am_aux_dir in
969260bd98a5SBruce A. Mah  *\ * | *\	*)
969360bd98a5SBruce A. Mah    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
969460bd98a5SBruce A. Mah  *)
969560bd98a5SBruce A. Mah    install_sh="\${SHELL} $am_aux_dir/install-sh"
969660bd98a5SBruce A. Mah  esac
969760bd98a5SBruce A. Mahfi
96986edfd8d6SBruce A. MahAC_SUBST([install_sh])])
969901ca972bSsethdelliott
970076bd67f6SSarah Larsen# Copyright (C) 2003-2021 Free Software Foundation, Inc.
970101ca972bSsethdelliott#
970201ca972bSsethdelliott# This file is free software; the Free Software Foundation
970301ca972bSsethdelliott# gives unlimited permission to copy and/or distribute it,
970401ca972bSsethdelliott# with or without modifications, as long as this notice is preserved.
970501ca972bSsethdelliott
970601ca972bSsethdelliott# Check whether the underlying file-system supports filenames
970701ca972bSsethdelliott# with a leading dot.  For instance MS-DOS doesn't.
970801ca972bSsethdelliottAC_DEFUN([AM_SET_LEADING_DOT],
970901ca972bSsethdelliott[rm -rf .tst 2>/dev/null
971001ca972bSsethdelliottmkdir .tst 2>/dev/null
971101ca972bSsethdelliottif test -d .tst; then
971201ca972bSsethdelliott  am__leading_dot=.
971301ca972bSsethdelliottelse
971401ca972bSsethdelliott  am__leading_dot=_
971501ca972bSsethdelliottfi
971601ca972bSsethdelliottrmdir .tst 2>/dev/null
971701ca972bSsethdelliottAC_SUBST([am__leading_dot])])
971801ca972bSsethdelliott
97196edfd8d6SBruce A. Mah# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
97206edfd8d6SBruce A. Mah# From Jim Meyering
972101ca972bSsethdelliott
972276bd67f6SSarah Larsen# Copyright (C) 1996-2021 Free Software Foundation, Inc.
972301ca972bSsethdelliott#
972401ca972bSsethdelliott# This file is free software; the Free Software Foundation
972501ca972bSsethdelliott# gives unlimited permission to copy and/or distribute it,
972601ca972bSsethdelliott# with or without modifications, as long as this notice is preserved.
972701ca972bSsethdelliott
97286edfd8d6SBruce A. Mah# AM_MAINTAINER_MODE([DEFAULT-MODE])
97296edfd8d6SBruce A. Mah# ----------------------------------
97306edfd8d6SBruce A. Mah# Control maintainer-specific portions of Makefiles.
97316edfd8d6SBruce A. Mah# Default is to disable them, unless 'enable' is passed literally.
97326edfd8d6SBruce A. Mah# For symmetry, 'disable' may be passed as well.  Anyway, the user
97336edfd8d6SBruce A. Mah# can override the default with the --enable/--disable switch.
97346edfd8d6SBruce A. MahAC_DEFUN([AM_MAINTAINER_MODE],
97356edfd8d6SBruce A. Mah[m4_case(m4_default([$1], [disable]),
97366edfd8d6SBruce A. Mah       [enable], [m4_define([am_maintainer_other], [disable])],
97376edfd8d6SBruce A. Mah       [disable], [m4_define([am_maintainer_other], [enable])],
97386edfd8d6SBruce A. Mah       [m4_define([am_maintainer_other], [enable])
97396edfd8d6SBruce A. Mah        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
97406edfd8d6SBruce A. MahAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
97416edfd8d6SBruce A. Mah  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
97426edfd8d6SBruce A. Mah  AC_ARG_ENABLE([maintainer-mode],
97436edfd8d6SBruce A. Mah    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
97446edfd8d6SBruce A. Mah      am_maintainer_other[ make rules and dependencies not useful
97456edfd8d6SBruce A. Mah      (and sometimes confusing) to the casual installer])],
97466edfd8d6SBruce A. Mah    [USE_MAINTAINER_MODE=$enableval],
97476edfd8d6SBruce A. Mah    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
97486edfd8d6SBruce A. Mah  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
97496edfd8d6SBruce A. Mah  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
97506edfd8d6SBruce A. Mah  MAINT=$MAINTAINER_MODE_TRUE
97516edfd8d6SBruce A. Mah  AC_SUBST([MAINT])dnl
97526edfd8d6SBruce A. Mah]
97536edfd8d6SBruce A. Mah)
97546edfd8d6SBruce A. Mah
97556edfd8d6SBruce A. Mah# Check to see how 'make' treats includes.	            -*- Autoconf -*-
97566edfd8d6SBruce A. Mah
975776bd67f6SSarah Larsen# Copyright (C) 2001-2021 Free Software Foundation, Inc.
97586edfd8d6SBruce A. Mah#
97596edfd8d6SBruce A. Mah# This file is free software; the Free Software Foundation
97606edfd8d6SBruce A. Mah# gives unlimited permission to copy and/or distribute it,
97616edfd8d6SBruce A. Mah# with or without modifications, as long as this notice is preserved.
97625d2f2cf9SBruce A. Mah
976301ca972bSsethdelliott# AM_MAKE_INCLUDE()
976401ca972bSsethdelliott# -----------------
9765ff1ea4e5SBruce A. Mah# Check whether make has an 'include' directive that can support all
9766ff1ea4e5SBruce A. Mah# the idioms we need for our automatic dependency tracking code.
976701ca972bSsethdelliottAC_DEFUN([AM_MAKE_INCLUDE],
9768ff1ea4e5SBruce A. Mah[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
9769ff1ea4e5SBruce A. Mahcat > confinc.mk << 'END'
977001ca972bSsethdelliottam__doit:
9771ff1ea4e5SBruce A. Mah	@echo this is the am__doit target >confinc.out
977201ca972bSsethdelliott.PHONY: am__doit
977301ca972bSsethdelliottEND
977401ca972bSsethdelliottam__include="#"
977501ca972bSsethdelliottam__quote=
9776ff1ea4e5SBruce A. Mah# BSD make does it like this.
9777ff1ea4e5SBruce A. Mahecho '.include "confinc.mk" # ignored' > confmf.BSD
9778ff1ea4e5SBruce A. Mah# Other make implementations (GNU, Solaris 10, AIX) do it like this.
9779ff1ea4e5SBruce A. Mahecho 'include confinc.mk # ignored' > confmf.GNU
9780ff1ea4e5SBruce A. Mah_am_result=no
9781ff1ea4e5SBruce A. Mahfor s in GNU BSD; do
9782ff1ea4e5SBruce A. Mah  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
9783ff1ea4e5SBruce A. Mah  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
9784ff1ea4e5SBruce A. Mah      ['0:this is the am__doit target'],
9785ff1ea4e5SBruce A. Mah      [AS_CASE([$s],
9786ff1ea4e5SBruce A. Mah          [BSD], [am__include='.include' am__quote='"'],
9787ff1ea4e5SBruce A. Mah          [am__include='include' am__quote=''])])
9788ff1ea4e5SBruce A. Mah  if test "$am__include" != "#"; then
9789ff1ea4e5SBruce A. Mah    _am_result="yes ($s style)"
9790ff1ea4e5SBruce A. Mah    break
979101ca972bSsethdelliott  fi
9792ff1ea4e5SBruce A. Mahdone
9793ff1ea4e5SBruce A. Mahrm -f confinc.* confmf.*
9794ff1ea4e5SBruce A. MahAC_MSG_RESULT([${_am_result}])
9795ff1ea4e5SBruce A. MahAC_SUBST([am__include])])
9796ff1ea4e5SBruce A. MahAC_SUBST([am__quote])])
979701ca972bSsethdelliott
979801ca972bSsethdelliott# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
979901ca972bSsethdelliott
980076bd67f6SSarah Larsen# Copyright (C) 1997-2021 Free Software Foundation, Inc.
980101ca972bSsethdelliott#
980201ca972bSsethdelliott# This file is free software; the Free Software Foundation
980301ca972bSsethdelliott# gives unlimited permission to copy and/or distribute it,
980401ca972bSsethdelliott# with or without modifications, as long as this notice is preserved.
980501ca972bSsethdelliott
980601ca972bSsethdelliott# AM_MISSING_PROG(NAME, PROGRAM)
980701ca972bSsethdelliott# ------------------------------
980801ca972bSsethdelliottAC_DEFUN([AM_MISSING_PROG],
980901ca972bSsethdelliott[AC_REQUIRE([AM_MISSING_HAS_RUN])
981001ca972bSsethdelliott$1=${$1-"${am_missing_run}$2"}
981101ca972bSsethdelliottAC_SUBST($1)])
981201ca972bSsethdelliott
981301ca972bSsethdelliott# AM_MISSING_HAS_RUN
981401ca972bSsethdelliott# ------------------
98156edfd8d6SBruce A. Mah# Define MISSING if not defined so far and test if it is modern enough.
98166edfd8d6SBruce A. Mah# If it is, set am_missing_run to use it, otherwise, to nothing.
981701ca972bSsethdelliottAC_DEFUN([AM_MISSING_HAS_RUN],
981801ca972bSsethdelliott[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
9819ba7b91d2SJef PoskanzerAC_REQUIRE_AUX_FILE([missing])dnl
982060bd98a5SBruce A. Mahif test x"${MISSING+set}" != xset; then
982121581a72SBruce A. Mah  MISSING="\${SHELL} '$am_aux_dir/missing'"
982260bd98a5SBruce A. Mahfi
982301ca972bSsethdelliott# Use eval to expand $SHELL
98246edfd8d6SBruce A. Mahif eval "$MISSING --is-lightweight"; then
98256edfd8d6SBruce A. Mah  am_missing_run="$MISSING "
982601ca972bSsethdelliottelse
982701ca972bSsethdelliott  am_missing_run=
98286edfd8d6SBruce A. Mah  AC_MSG_WARN(['missing' script is too old or missing])
982901ca972bSsethdelliottfi
983001ca972bSsethdelliott])
983101ca972bSsethdelliott
983201ca972bSsethdelliott# Helper functions for option handling.                     -*- Autoconf -*-
983301ca972bSsethdelliott
983476bd67f6SSarah Larsen# Copyright (C) 2001-2021 Free Software Foundation, Inc.
983501ca972bSsethdelliott#
983601ca972bSsethdelliott# This file is free software; the Free Software Foundation
983701ca972bSsethdelliott# gives unlimited permission to copy and/or distribute it,
983801ca972bSsethdelliott# with or without modifications, as long as this notice is preserved.
983901ca972bSsethdelliott
984001ca972bSsethdelliott# _AM_MANGLE_OPTION(NAME)
984101ca972bSsethdelliott# -----------------------
984201ca972bSsethdelliottAC_DEFUN([_AM_MANGLE_OPTION],
984301ca972bSsethdelliott[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
984401ca972bSsethdelliott
984501ca972bSsethdelliott# _AM_SET_OPTION(NAME)
98466edfd8d6SBruce A. Mah# --------------------
984701ca972bSsethdelliott# Set option NAME.  Presently that only means defining a flag for this option.
984801ca972bSsethdelliottAC_DEFUN([_AM_SET_OPTION],
98496edfd8d6SBruce A. Mah[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
985001ca972bSsethdelliott
985101ca972bSsethdelliott# _AM_SET_OPTIONS(OPTIONS)
98526edfd8d6SBruce A. Mah# ------------------------
985301ca972bSsethdelliott# OPTIONS is a space-separated list of Automake options.
985401ca972bSsethdelliottAC_DEFUN([_AM_SET_OPTIONS],
985560bd98a5SBruce A. Mah[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
985601ca972bSsethdelliott
985701ca972bSsethdelliott# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
985801ca972bSsethdelliott# -------------------------------------------
985901ca972bSsethdelliott# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
986001ca972bSsethdelliottAC_DEFUN([_AM_IF_OPTION],
986101ca972bSsethdelliott[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
986201ca972bSsethdelliott
986376bd67f6SSarah Larsen# Copyright (C) 1999-2021 Free Software Foundation, Inc.
9864dc1dd2dcSBruce A. Mah#
9865dc1dd2dcSBruce A. Mah# This file is free software; the Free Software Foundation
9866dc1dd2dcSBruce A. Mah# gives unlimited permission to copy and/or distribute it,
9867dc1dd2dcSBruce A. Mah# with or without modifications, as long as this notice is preserved.
986810383818SBruce A. Mah
98696edfd8d6SBruce A. Mah# _AM_PROG_CC_C_O
98706edfd8d6SBruce A. Mah# ---------------
98716edfd8d6SBruce A. Mah# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
98726edfd8d6SBruce A. Mah# to automatically call this.
98736edfd8d6SBruce A. MahAC_DEFUN([_AM_PROG_CC_C_O],
98746edfd8d6SBruce A. Mah[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
98756edfd8d6SBruce A. MahAC_REQUIRE_AUX_FILE([compile])dnl
98766edfd8d6SBruce A. MahAC_LANG_PUSH([C])dnl
98776edfd8d6SBruce A. MahAC_CACHE_CHECK(
98786edfd8d6SBruce A. Mah  [whether $CC understands -c and -o together],
98796edfd8d6SBruce A. Mah  [am_cv_prog_cc_c_o],
98806edfd8d6SBruce A. Mah  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
98816edfd8d6SBruce A. Mah  # Make sure it works both with $CC and with simple cc.
98826edfd8d6SBruce A. Mah  # Following AC_PROG_CC_C_O, we do the test twice because some
98836edfd8d6SBruce A. Mah  # compilers refuse to overwrite an existing .o file with -o,
98846edfd8d6SBruce A. Mah  # though they will create one.
98856edfd8d6SBruce A. Mah  am_cv_prog_cc_c_o=yes
98866edfd8d6SBruce A. Mah  for am_i in 1 2; do
98876edfd8d6SBruce A. Mah    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
98886edfd8d6SBruce A. Mah         && test -f conftest2.$ac_objext; then
98896edfd8d6SBruce A. Mah      : OK
98906edfd8d6SBruce A. Mah    else
98916edfd8d6SBruce A. Mah      am_cv_prog_cc_c_o=no
98926edfd8d6SBruce A. Mah      break
98936edfd8d6SBruce A. Mah    fi
98946edfd8d6SBruce A. Mah  done
98956edfd8d6SBruce A. Mah  rm -f core conftest*
98966edfd8d6SBruce A. Mah  unset am_i])
98976edfd8d6SBruce A. Mahif test "$am_cv_prog_cc_c_o" != yes; then
98986edfd8d6SBruce A. Mah   # Losing compiler, so override with the script.
98996edfd8d6SBruce A. Mah   # FIXME: It is wrong to rewrite CC.
99006edfd8d6SBruce A. Mah   # But if we don't then we get into trouble of one sort or another.
99016edfd8d6SBruce A. Mah   # A longer-term fix would be to have automake use am__CC in this case,
99026edfd8d6SBruce A. Mah   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
99036edfd8d6SBruce A. Mah   CC="$am_aux_dir/compile $CC"
99046edfd8d6SBruce A. Mahfi
99056edfd8d6SBruce A. MahAC_LANG_POP([C])])
99066edfd8d6SBruce A. Mah
99076edfd8d6SBruce A. Mah# For backward compatibility.
99086edfd8d6SBruce A. MahAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
99096edfd8d6SBruce A. Mah
991076bd67f6SSarah Larsen# Copyright (C) 2001-2021 Free Software Foundation, Inc.
99116edfd8d6SBruce A. Mah#
99126edfd8d6SBruce A. Mah# This file is free software; the Free Software Foundation
99136edfd8d6SBruce A. Mah# gives unlimited permission to copy and/or distribute it,
99146edfd8d6SBruce A. Mah# with or without modifications, as long as this notice is preserved.
99156edfd8d6SBruce A. Mah
99166edfd8d6SBruce A. Mah# AM_RUN_LOG(COMMAND)
99176edfd8d6SBruce A. Mah# -------------------
99186edfd8d6SBruce A. Mah# Run COMMAND, save the exit status in ac_status, and log it.
99196edfd8d6SBruce A. Mah# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
99206edfd8d6SBruce A. MahAC_DEFUN([AM_RUN_LOG],
99216edfd8d6SBruce A. Mah[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
99226edfd8d6SBruce A. Mah   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
99236edfd8d6SBruce A. Mah   ac_status=$?
99246edfd8d6SBruce A. Mah   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
99256edfd8d6SBruce A. Mah   (exit $ac_status); }])
99266edfd8d6SBruce A. Mah
99276edfd8d6SBruce A. Mah# Check to make sure that the build environment is sane.    -*- Autoconf -*-
99286edfd8d6SBruce A. Mah
992976bd67f6SSarah Larsen# Copyright (C) 1996-2021 Free Software Foundation, Inc.
99306edfd8d6SBruce A. Mah#
99316edfd8d6SBruce A. Mah# This file is free software; the Free Software Foundation
99326edfd8d6SBruce A. Mah# gives unlimited permission to copy and/or distribute it,
99336edfd8d6SBruce A. Mah# with or without modifications, as long as this notice is preserved.
99345d2f2cf9SBruce A. Mah
993501ca972bSsethdelliott# AM_SANITY_CHECK
993601ca972bSsethdelliott# ---------------
993701ca972bSsethdelliottAC_DEFUN([AM_SANITY_CHECK],
993801ca972bSsethdelliott[AC_MSG_CHECKING([whether build environment is sane])
993960bd98a5SBruce A. Mah# Reject unsafe characters in $srcdir or the absolute working directory
994060bd98a5SBruce A. Mah# name.  Accept space and tab only in the latter.
994160bd98a5SBruce A. Maham_lf='
994260bd98a5SBruce A. Mah'
994360bd98a5SBruce A. Mahcase `pwd` in
994460bd98a5SBruce A. Mah  *[[\\\"\#\$\&\'\`$am_lf]]*)
994560bd98a5SBruce A. Mah    AC_MSG_ERROR([unsafe absolute working directory name]);;
994660bd98a5SBruce A. Mahesac
994760bd98a5SBruce A. Mahcase $srcdir in
994860bd98a5SBruce A. Mah  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
99496edfd8d6SBruce A. Mah    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
995060bd98a5SBruce A. Mahesac
995160bd98a5SBruce A. Mah
99526edfd8d6SBruce A. Mah# Do 'set' in a subshell so we don't clobber the current shell's
995301ca972bSsethdelliott# arguments.  Must try -L first in case configure is actually a
995401ca972bSsethdelliott# symlink; some systems play weird games with the mod time of symlinks
995501ca972bSsethdelliott# (eg FreeBSD returns the mod time of the symlink's containing
995601ca972bSsethdelliott# directory).
995701ca972bSsethdelliottif (
99586edfd8d6SBruce A. Mah   am_has_slept=no
99596edfd8d6SBruce A. Mah   for am_try in 1 2; do
99606edfd8d6SBruce A. Mah     echo "timestamp, slept: $am_has_slept" > conftest.file
996160bd98a5SBruce A. Mah     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
996201ca972bSsethdelliott     if test "$[*]" = "X"; then
996301ca972bSsethdelliott	# -L didn't work.
996460bd98a5SBruce A. Mah	set X `ls -t "$srcdir/configure" conftest.file`
996501ca972bSsethdelliott     fi
996601ca972bSsethdelliott     if test "$[*]" != "X $srcdir/configure conftest.file" \
996701ca972bSsethdelliott	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
996801ca972bSsethdelliott
996901ca972bSsethdelliott	# If neither matched, then we have a broken ls.  This can happen
997001ca972bSsethdelliott	# if, for instance, CONFIG_SHELL is bash and it inherits a
997101ca972bSsethdelliott	# broken ls alias from the environment.  This has actually
997201ca972bSsethdelliott	# happened.  Such a system could not be considered "sane".
997301ca972bSsethdelliott	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
997401ca972bSsethdelliott  alias in your environment])
997501ca972bSsethdelliott     fi
99766edfd8d6SBruce A. Mah     if test "$[2]" = conftest.file || test $am_try -eq 2; then
99776edfd8d6SBruce A. Mah       break
99786edfd8d6SBruce A. Mah     fi
99796edfd8d6SBruce A. Mah     # Just in case.
99806edfd8d6SBruce A. Mah     sleep 1
99816edfd8d6SBruce A. Mah     am_has_slept=yes
99826edfd8d6SBruce A. Mah   done
998301ca972bSsethdelliott   test "$[2]" = conftest.file
998401ca972bSsethdelliott   )
998501ca972bSsethdelliottthen
998601ca972bSsethdelliott   # Ok.
998701ca972bSsethdelliott   :
998801ca972bSsethdelliottelse
998901ca972bSsethdelliott   AC_MSG_ERROR([newly created file is older than distributed files!
999001ca972bSsethdelliottCheck your system clock])
999101ca972bSsethdelliottfi
99926edfd8d6SBruce A. MahAC_MSG_RESULT([yes])
99936edfd8d6SBruce A. Mah# If we didn't sleep, we still need to ensure time stamps of config.status and
99946edfd8d6SBruce A. Mah# generated files are strictly newer.
99956edfd8d6SBruce A. Maham_sleep_pid=
99966edfd8d6SBruce A. Mahif grep 'slept: no' conftest.file >/dev/null 2>&1; then
99976edfd8d6SBruce A. Mah  ( sleep 1 ) &
99986edfd8d6SBruce A. Mah  am_sleep_pid=$!
99996edfd8d6SBruce A. Mahfi
100006edfd8d6SBruce A. MahAC_CONFIG_COMMANDS_PRE(
100016edfd8d6SBruce A. Mah  [AC_MSG_CHECKING([that generated files are newer than configure])
100026edfd8d6SBruce A. Mah   if test -n "$am_sleep_pid"; then
100036edfd8d6SBruce A. Mah     # Hide warnings about reused PIDs.
100046edfd8d6SBruce A. Mah     wait $am_sleep_pid 2>/dev/null
100056edfd8d6SBruce A. Mah   fi
100066edfd8d6SBruce A. Mah   AC_MSG_RESULT([done])])
100076edfd8d6SBruce A. Mahrm -f conftest.file
100086edfd8d6SBruce A. Mah])
1000901ca972bSsethdelliott
1001076bd67f6SSarah Larsen# Copyright (C) 2009-2021 Free Software Foundation, Inc.
100116edfd8d6SBruce A. Mah#
100126edfd8d6SBruce A. Mah# This file is free software; the Free Software Foundation
100136edfd8d6SBruce A. Mah# gives unlimited permission to copy and/or distribute it,
100146edfd8d6SBruce A. Mah# with or without modifications, as long as this notice is preserved.
100156edfd8d6SBruce A. Mah
100166edfd8d6SBruce A. Mah# AM_SILENT_RULES([DEFAULT])
100176edfd8d6SBruce A. Mah# --------------------------
100186edfd8d6SBruce A. Mah# Enable less verbose build rules; with the default set to DEFAULT
100196edfd8d6SBruce A. Mah# ("yes" being less verbose, "no" or empty being verbose).
100206edfd8d6SBruce A. MahAC_DEFUN([AM_SILENT_RULES],
100216edfd8d6SBruce A. Mah[AC_ARG_ENABLE([silent-rules], [dnl
100226edfd8d6SBruce A. MahAS_HELP_STRING(
100236edfd8d6SBruce A. Mah  [--enable-silent-rules],
100246edfd8d6SBruce A. Mah  [less verbose build output (undo: "make V=1")])
100256edfd8d6SBruce A. MahAS_HELP_STRING(
100266edfd8d6SBruce A. Mah  [--disable-silent-rules],
100276edfd8d6SBruce A. Mah  [verbose build output (undo: "make V=0")])dnl
100286edfd8d6SBruce A. Mah])
100296edfd8d6SBruce A. Mahcase $enable_silent_rules in @%:@ (((
100306edfd8d6SBruce A. Mah  yes) AM_DEFAULT_VERBOSITY=0;;
100316edfd8d6SBruce A. Mah   no) AM_DEFAULT_VERBOSITY=1;;
100326edfd8d6SBruce A. Mah    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
100336edfd8d6SBruce A. Mahesac
100346edfd8d6SBruce A. Mahdnl
100356edfd8d6SBruce A. Mahdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
100366edfd8d6SBruce A. Mahdnl do not support nested variable expansions.
100376edfd8d6SBruce A. Mahdnl See automake bug#9928 and bug#10237.
100386edfd8d6SBruce A. Maham_make=${MAKE-make}
100396edfd8d6SBruce A. MahAC_CACHE_CHECK([whether $am_make supports nested variables],
100406edfd8d6SBruce A. Mah   [am_cv_make_support_nested_variables],
100416edfd8d6SBruce A. Mah   [if AS_ECHO([['TRUE=$(BAR$(V))
100426edfd8d6SBruce A. MahBAR0=false
100436edfd8d6SBruce A. MahBAR1=true
100446edfd8d6SBruce A. MahV=1
100456edfd8d6SBruce A. Maham__doit:
100466edfd8d6SBruce A. Mah	@$(TRUE)
100476edfd8d6SBruce A. Mah.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
100486edfd8d6SBruce A. Mah  am_cv_make_support_nested_variables=yes
100496edfd8d6SBruce A. Mahelse
100506edfd8d6SBruce A. Mah  am_cv_make_support_nested_variables=no
100516edfd8d6SBruce A. Mahfi])
100526edfd8d6SBruce A. Mahif test $am_cv_make_support_nested_variables = yes; then
100536edfd8d6SBruce A. Mah  dnl Using '$V' instead of '$(V)' breaks IRIX make.
100546edfd8d6SBruce A. Mah  AM_V='$(V)'
100556edfd8d6SBruce A. Mah  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
100566edfd8d6SBruce A. Mahelse
100576edfd8d6SBruce A. Mah  AM_V=$AM_DEFAULT_VERBOSITY
100586edfd8d6SBruce A. Mah  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
100596edfd8d6SBruce A. Mahfi
100606edfd8d6SBruce A. MahAC_SUBST([AM_V])dnl
100616edfd8d6SBruce A. MahAM_SUBST_NOTMAKE([AM_V])dnl
100626edfd8d6SBruce A. MahAC_SUBST([AM_DEFAULT_V])dnl
100636edfd8d6SBruce A. MahAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
100646edfd8d6SBruce A. MahAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
100656edfd8d6SBruce A. MahAM_BACKSLASH='\'
100666edfd8d6SBruce A. MahAC_SUBST([AM_BACKSLASH])dnl
100676edfd8d6SBruce A. Mah_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
100686edfd8d6SBruce A. Mah])
100696edfd8d6SBruce A. Mah
1007076bd67f6SSarah Larsen# Copyright (C) 2001-2021 Free Software Foundation, Inc.
1007101ca972bSsethdelliott#
1007201ca972bSsethdelliott# This file is free software; the Free Software Foundation
1007301ca972bSsethdelliott# gives unlimited permission to copy and/or distribute it,
1007401ca972bSsethdelliott# with or without modifications, as long as this notice is preserved.
1007501ca972bSsethdelliott
1007601ca972bSsethdelliott# AM_PROG_INSTALL_STRIP
1007701ca972bSsethdelliott# ---------------------
100786edfd8d6SBruce A. Mah# One issue with vendor 'install' (even GNU) is that you can't
1007901ca972bSsethdelliott# specify the program used to strip binaries.  This is especially
1008001ca972bSsethdelliott# annoying in cross-compiling environments, where the build's strip
1008101ca972bSsethdelliott# is unlikely to handle the host's binaries.
1008201ca972bSsethdelliott# Fortunately install-sh will honor a STRIPPROG variable, so we
100836edfd8d6SBruce A. Mah# always use install-sh in "make install-strip", and initialize
1008401ca972bSsethdelliott# STRIPPROG with the value of the STRIP variable (set by the user).
1008501ca972bSsethdelliottAC_DEFUN([AM_PROG_INSTALL_STRIP],
1008601ca972bSsethdelliott[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
100876edfd8d6SBruce A. Mah# Installed binaries are usually stripped using 'strip' when the user
100886edfd8d6SBruce A. Mah# run "make install-strip".  However 'strip' might not be the right
1008901ca972bSsethdelliott# tool to use in cross-compilation environments, therefore Automake
100906edfd8d6SBruce A. Mah# will honor the 'STRIP' environment variable to overrule this program.
100916edfd8d6SBruce A. Mahdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
1009201ca972bSsethdelliottif test "$cross_compiling" != no; then
1009301ca972bSsethdelliott  AC_CHECK_TOOL([STRIP], [strip], :)
1009401ca972bSsethdelliottfi
10095ba7b91d2SJef PoskanzerINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1009601ca972bSsethdelliottAC_SUBST([INSTALL_STRIP_PROGRAM])])
1009701ca972bSsethdelliott
1009876bd67f6SSarah Larsen# Copyright (C) 2006-2021 Free Software Foundation, Inc.
10099ba7b91d2SJef Poskanzer#
10100ba7b91d2SJef Poskanzer# This file is free software; the Free Software Foundation
10101ba7b91d2SJef Poskanzer# gives unlimited permission to copy and/or distribute it,
10102ba7b91d2SJef Poskanzer# with or without modifications, as long as this notice is preserved.
10103ba7b91d2SJef Poskanzer
10104ba7b91d2SJef Poskanzer# _AM_SUBST_NOTMAKE(VARIABLE)
10105ba7b91d2SJef Poskanzer# ---------------------------
1010660bd98a5SBruce A. Mah# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
10107ba7b91d2SJef Poskanzer# This macro is traced by Automake.
10108ba7b91d2SJef PoskanzerAC_DEFUN([_AM_SUBST_NOTMAKE])
10109ba7b91d2SJef Poskanzer
1011060bd98a5SBruce A. Mah# AM_SUBST_NOTMAKE(VARIABLE)
101116edfd8d6SBruce A. Mah# --------------------------
1011260bd98a5SBruce A. Mah# Public sister of _AM_SUBST_NOTMAKE.
1011360bd98a5SBruce A. MahAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1011460bd98a5SBruce A. Mah
1011501ca972bSsethdelliott# Check how to create a tarball.                            -*- Autoconf -*-
1011601ca972bSsethdelliott
1011776bd67f6SSarah Larsen# Copyright (C) 2004-2021 Free Software Foundation, Inc.
1011801ca972bSsethdelliott#
1011901ca972bSsethdelliott# This file is free software; the Free Software Foundation
1012001ca972bSsethdelliott# gives unlimited permission to copy and/or distribute it,
1012101ca972bSsethdelliott# with or without modifications, as long as this notice is preserved.
1012201ca972bSsethdelliott
1012301ca972bSsethdelliott# _AM_PROG_TAR(FORMAT)
1012401ca972bSsethdelliott# --------------------
1012501ca972bSsethdelliott# Check how to create a tarball in format FORMAT.
101266edfd8d6SBruce A. Mah# FORMAT should be one of 'v7', 'ustar', or 'pax'.
1012701ca972bSsethdelliott#
1012801ca972bSsethdelliott# Substitute a variable $(am__tar) that is a command
1012901ca972bSsethdelliott# writing to stdout a FORMAT-tarball containing the directory
1013001ca972bSsethdelliott# $tardir.
1013101ca972bSsethdelliott#     tardir=directory && $(am__tar) > result.tar
1013201ca972bSsethdelliott#
1013301ca972bSsethdelliott# Substitute a variable $(am__untar) that extract such
1013401ca972bSsethdelliott# a tarball read from stdin.
1013501ca972bSsethdelliott#     $(am__untar) < result.tar
101366edfd8d6SBruce A. Mah#
1013701ca972bSsethdelliottAC_DEFUN([_AM_PROG_TAR],
101386edfd8d6SBruce A. Mah[# Always define AMTAR for backward compatibility.  Yes, it's still used
101396edfd8d6SBruce A. Mah# in the wild :-(  We should find a proper way to deprecate it ...
101406edfd8d6SBruce A. MahAC_SUBST([AMTAR], ['$${TAR-tar}'])
101416edfd8d6SBruce A. Mah
101426edfd8d6SBruce A. Mah# We'll loop over all known methods to create a tar archive until one works.
101435d2f2cf9SBruce A. Mah_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
101446edfd8d6SBruce A. Mah
101456edfd8d6SBruce A. Mahm4_if([$1], [v7],
101466edfd8d6SBruce A. Mah  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
101476edfd8d6SBruce A. Mah
101486edfd8d6SBruce A. Mah  [m4_case([$1],
101496edfd8d6SBruce A. Mah    [ustar],
101506edfd8d6SBruce A. Mah     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
101516edfd8d6SBruce A. Mah      # There is notably a 21 bits limit for the UID and the GID.  In fact,
101526edfd8d6SBruce A. Mah      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
101536edfd8d6SBruce A. Mah      # and bug#13588).
101546edfd8d6SBruce A. Mah      am_max_uid=2097151 # 2^21 - 1
101556edfd8d6SBruce A. Mah      am_max_gid=$am_max_uid
101566edfd8d6SBruce A. Mah      # The $UID and $GID variables are not portable, so we need to resort
101576edfd8d6SBruce A. Mah      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
101586edfd8d6SBruce A. Mah      # below are definitely unexpected, so allow the users to see them
101596edfd8d6SBruce A. Mah      # (that is, avoid stderr redirection).
101606edfd8d6SBruce A. Mah      am_uid=`id -u || echo unknown`
101616edfd8d6SBruce A. Mah      am_gid=`id -g || echo unknown`
101626edfd8d6SBruce A. Mah      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
101636edfd8d6SBruce A. Mah      if test $am_uid -le $am_max_uid; then
101646edfd8d6SBruce A. Mah         AC_MSG_RESULT([yes])
101656edfd8d6SBruce A. Mah      else
101666edfd8d6SBruce A. Mah         AC_MSG_RESULT([no])
101676edfd8d6SBruce A. Mah         _am_tools=none
101686edfd8d6SBruce A. Mah      fi
101696edfd8d6SBruce A. Mah      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
101706edfd8d6SBruce A. Mah      if test $am_gid -le $am_max_gid; then
101716edfd8d6SBruce A. Mah         AC_MSG_RESULT([yes])
101726edfd8d6SBruce A. Mah      else
101736edfd8d6SBruce A. Mah        AC_MSG_RESULT([no])
101746edfd8d6SBruce A. Mah        _am_tools=none
101756edfd8d6SBruce A. Mah      fi],
101766edfd8d6SBruce A. Mah
101776edfd8d6SBruce A. Mah  [pax],
101786edfd8d6SBruce A. Mah    [],
101796edfd8d6SBruce A. Mah
101806edfd8d6SBruce A. Mah  [m4_fatal([Unknown tar format])])
101816edfd8d6SBruce A. Mah
101826edfd8d6SBruce A. Mah  AC_MSG_CHECKING([how to create a $1 tar archive])
101836edfd8d6SBruce A. Mah
101846edfd8d6SBruce A. Mah  # Go ahead even if we have the value already cached.  We do so because we
101856edfd8d6SBruce A. Mah  # need to set the values for the 'am__tar' and 'am__untar' variables.
1018601ca972bSsethdelliott  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
101876edfd8d6SBruce A. Mah
101886edfd8d6SBruce A. Mah  for _am_tool in $_am_tools; do
1018901ca972bSsethdelliott    case $_am_tool in
1019001ca972bSsethdelliott    gnutar)
101916edfd8d6SBruce A. Mah      for _am_tar in tar gnutar gtar; do
1019201ca972bSsethdelliott        AM_RUN_LOG([$_am_tar --version]) && break
1019301ca972bSsethdelliott      done
1019401ca972bSsethdelliott      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1019501ca972bSsethdelliott      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1019601ca972bSsethdelliott      am__untar="$_am_tar -xf -"
1019701ca972bSsethdelliott      ;;
1019801ca972bSsethdelliott    plaintar)
1019901ca972bSsethdelliott      # Must skip GNU tar: if it does not support --format= it doesn't create
1020001ca972bSsethdelliott      # ustar tarball either.
1020101ca972bSsethdelliott      (tar --version) >/dev/null 2>&1 && continue
1020201ca972bSsethdelliott      am__tar='tar chf - "$$tardir"'
1020301ca972bSsethdelliott      am__tar_='tar chf - "$tardir"'
1020401ca972bSsethdelliott      am__untar='tar xf -'
1020501ca972bSsethdelliott      ;;
1020601ca972bSsethdelliott    pax)
1020701ca972bSsethdelliott      am__tar='pax -L -x $1 -w "$$tardir"'
1020801ca972bSsethdelliott      am__tar_='pax -L -x $1 -w "$tardir"'
1020901ca972bSsethdelliott      am__untar='pax -r'
1021001ca972bSsethdelliott      ;;
1021101ca972bSsethdelliott    cpio)
1021201ca972bSsethdelliott      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1021301ca972bSsethdelliott      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1021401ca972bSsethdelliott      am__untar='cpio -i -H $1 -d'
1021501ca972bSsethdelliott      ;;
1021601ca972bSsethdelliott    none)
1021701ca972bSsethdelliott      am__tar=false
1021801ca972bSsethdelliott      am__tar_=false
1021901ca972bSsethdelliott      am__untar=false
1022001ca972bSsethdelliott      ;;
1022101ca972bSsethdelliott    esac
1022201ca972bSsethdelliott
1022301ca972bSsethdelliott    # If the value was cached, stop now.  We just wanted to have am__tar
1022401ca972bSsethdelliott    # and am__untar set.
1022501ca972bSsethdelliott    test -n "${am_cv_prog_tar_$1}" && break
1022601ca972bSsethdelliott
102276edfd8d6SBruce A. Mah    # tar/untar a dummy directory, and stop if the command works.
1022801ca972bSsethdelliott    rm -rf conftest.dir
1022901ca972bSsethdelliott    mkdir conftest.dir
1023001ca972bSsethdelliott    echo GrepMe > conftest.dir/file
1023101ca972bSsethdelliott    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1023201ca972bSsethdelliott    rm -rf conftest.dir
1023301ca972bSsethdelliott    if test -s conftest.tar; then
1023401ca972bSsethdelliott      AM_RUN_LOG([$am__untar <conftest.tar])
102356edfd8d6SBruce A. Mah      AM_RUN_LOG([cat conftest.dir/file])
1023601ca972bSsethdelliott      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1023701ca972bSsethdelliott    fi
1023801ca972bSsethdelliott  done
1023901ca972bSsethdelliott  rm -rf conftest.dir
1024001ca972bSsethdelliott
1024101ca972bSsethdelliott  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1024201ca972bSsethdelliott  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
102436edfd8d6SBruce A. Mah
1024401ca972bSsethdelliottAC_SUBST([am__tar])
1024501ca972bSsethdelliottAC_SUBST([am__untar])
1024601ca972bSsethdelliott]) # _AM_PROG_TAR
10247e34c20c8SJon Dugan
10248