1706f2543Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2706f2543Smrg#
3706f2543Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
4706f2543Smrg#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
5706f2543Smrg#                 Inc.
6706f2543Smrg#   Written by Gordon Matzigkeit, 1996
7706f2543Smrg#
8706f2543Smrg# This file is free software; the Free Software Foundation gives
9706f2543Smrg# unlimited permission to copy and/or distribute it, with or without
10706f2543Smrg# modifications, as long as this notice is preserved.
11706f2543Smrg
12706f2543Smrgm4_define([_LT_COPYING], [dnl
13706f2543Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
14706f2543Smrg#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
15706f2543Smrg#                 Inc.
16706f2543Smrg#   Written by Gordon Matzigkeit, 1996
17706f2543Smrg#
18706f2543Smrg#   This file is part of GNU Libtool.
19706f2543Smrg#
20706f2543Smrg# GNU Libtool is free software; you can redistribute it and/or
21706f2543Smrg# modify it under the terms of the GNU General Public License as
22706f2543Smrg# published by the Free Software Foundation; either version 2 of
23706f2543Smrg# the License, or (at your option) any later version.
24706f2543Smrg#
25706f2543Smrg# As a special exception to the GNU General Public License,
26706f2543Smrg# if you distribute this file as part of a program or library that
27706f2543Smrg# is built using GNU Libtool, you may include this file under the
28706f2543Smrg# same distribution terms that you use for the rest of that program.
29706f2543Smrg#
30706f2543Smrg# GNU Libtool is distributed in the hope that it will be useful,
31706f2543Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
32706f2543Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
33706f2543Smrg# GNU General Public License for more details.
34706f2543Smrg#
35706f2543Smrg# You should have received a copy of the GNU General Public License
36706f2543Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
37706f2543Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
38706f2543Smrg# obtained by writing to the Free Software Foundation, Inc.,
39706f2543Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
40706f2543Smrg])
41706f2543Smrg
42706f2543Smrg# serial 57 LT_INIT
43706f2543Smrg
44706f2543Smrg
45706f2543Smrg# LT_PREREQ(VERSION)
46706f2543Smrg# ------------------
47706f2543Smrg# Complain and exit if this libtool version is less that VERSION.
48706f2543Smrgm4_defun([LT_PREREQ],
49706f2543Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
50706f2543Smrg       [m4_default([$3],
51706f2543Smrg		   [m4_fatal([Libtool version $1 or higher is required],
52706f2543Smrg		             63)])],
53706f2543Smrg       [$2])])
54706f2543Smrg
55706f2543Smrg
56706f2543Smrg# _LT_CHECK_BUILDDIR
57706f2543Smrg# ------------------
58706f2543Smrg# Complain if the absolute build directory name contains unusual characters
59706f2543Smrgm4_defun([_LT_CHECK_BUILDDIR],
60706f2543Smrg[case `pwd` in
61706f2543Smrg  *\ * | *\	*)
62706f2543Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
63706f2543Smrgesac
64706f2543Smrg])
65706f2543Smrg
66706f2543Smrg
67706f2543Smrg# LT_INIT([OPTIONS])
68706f2543Smrg# ------------------
69706f2543SmrgAC_DEFUN([LT_INIT],
70706f2543Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
71706f2543SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
72706f2543SmrgAC_BEFORE([$0], [LT_LANG])dnl
73706f2543SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
74706f2543SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
75706f2543Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
76706f2543Smrg
77706f2543Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
78706f2543Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
79706f2543Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
80706f2543Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
81706f2543Smrgdnl unless we require an AC_DEFUNed macro:
82706f2543SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
83706f2543SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
84706f2543SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
85706f2543SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
86706f2543Smrgm4_require([_LT_PROG_LTMAIN])dnl
87706f2543Smrg
88706f2543Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
89706f2543Smrg
90706f2543Smrgdnl Parse OPTIONS
91706f2543Smrg_LT_SET_OPTIONS([$0], [$1])
92706f2543Smrg
93706f2543Smrg# This can be used to rebuild libtool when needed
94706f2543SmrgLIBTOOL_DEPS="$ltmain"
95706f2543Smrg
96706f2543Smrg# Always use our own libtool.
97706f2543SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
98706f2543SmrgAC_SUBST(LIBTOOL)dnl
99706f2543Smrg
100706f2543Smrg_LT_SETUP
101706f2543Smrg
102706f2543Smrg# Only expand once:
103706f2543Smrgm4_define([LT_INIT])
104706f2543Smrg])# LT_INIT
105706f2543Smrg
106706f2543Smrg# Old names:
107706f2543SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
108706f2543SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
109706f2543Smrgdnl aclocal-1.4 backwards compatibility:
110706f2543Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
111706f2543Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
112706f2543Smrg
113706f2543Smrg
114706f2543Smrg# _LT_CC_BASENAME(CC)
115706f2543Smrg# -------------------
116706f2543Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
117706f2543Smrgm4_defun([_LT_CC_BASENAME],
118706f2543Smrg[for cc_temp in $1""; do
119706f2543Smrg  case $cc_temp in
120706f2543Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
121706f2543Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
122706f2543Smrg    \-*) ;;
123706f2543Smrg    *) break;;
124706f2543Smrg  esac
125706f2543Smrgdone
126706f2543Smrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
127706f2543Smrg])
128706f2543Smrg
129706f2543Smrg
130706f2543Smrg# _LT_FILEUTILS_DEFAULTS
131706f2543Smrg# ----------------------
132706f2543Smrg# It is okay to use these file commands and assume they have been set
133706f2543Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
134706f2543Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
135706f2543Smrg[: ${CP="cp -f"}
136706f2543Smrg: ${MV="mv -f"}
137706f2543Smrg: ${RM="rm -f"}
138706f2543Smrg])# _LT_FILEUTILS_DEFAULTS
139706f2543Smrg
140706f2543Smrg
141706f2543Smrg# _LT_SETUP
142706f2543Smrg# ---------
143706f2543Smrgm4_defun([_LT_SETUP],
144706f2543Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
145706f2543SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
146706f2543SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
147706f2543SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
148706f2543Smrg
149706f2543Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
150706f2543Smrg_LT_DECL([], [host], [0])dnl
151706f2543Smrg_LT_DECL([], [host_os], [0])dnl
152706f2543Smrgdnl
153706f2543Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
154706f2543Smrg_LT_DECL([], [build], [0])dnl
155706f2543Smrg_LT_DECL([], [build_os], [0])dnl
156706f2543Smrgdnl
157706f2543SmrgAC_REQUIRE([AC_PROG_CC])dnl
158706f2543SmrgAC_REQUIRE([LT_PATH_LD])dnl
159706f2543SmrgAC_REQUIRE([LT_PATH_NM])dnl
160706f2543Smrgdnl
161706f2543SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
162706f2543Smrgtest -z "$LN_S" && LN_S="ln -s"
163706f2543Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
164706f2543Smrgdnl
165706f2543SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
166706f2543Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
167706f2543Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
168706f2543Smrgdnl
169706f2543Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
170706f2543Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
171706f2543Smrgm4_require([_LT_CMD_RELOAD])dnl
172706f2543Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
173706f2543Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
174706f2543Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
175706f2543Smrg
176706f2543Smrg_LT_CONFIG_LIBTOOL_INIT([
177706f2543Smrg# See if we are running on zsh, and set the options which allow our
178706f2543Smrg# commands through without removal of \ escapes INIT.
179706f2543Smrgif test -n "\${ZSH_VERSION+set}" ; then
180706f2543Smrg   setopt NO_GLOB_SUBST
181706f2543Smrgfi
182706f2543Smrg])
183706f2543Smrgif test -n "${ZSH_VERSION+set}" ; then
184706f2543Smrg   setopt NO_GLOB_SUBST
185706f2543Smrgfi
186706f2543Smrg
187706f2543Smrg_LT_CHECK_OBJDIR
188706f2543Smrg
189706f2543Smrgm4_require([_LT_TAG_COMPILER])dnl
190706f2543Smrg
191706f2543Smrgcase $host_os in
192706f2543Smrgaix3*)
193706f2543Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
194706f2543Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
195706f2543Smrg  # vanish in a puff of smoke.
196706f2543Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
197706f2543Smrg    COLLECT_NAMES=
198706f2543Smrg    export COLLECT_NAMES
199706f2543Smrg  fi
200706f2543Smrg  ;;
201706f2543Smrgesac
202706f2543Smrg
203706f2543Smrg# Global variables:
204706f2543Smrgofile=libtool
205706f2543Smrgcan_build_shared=yes
206706f2543Smrg
207706f2543Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
208706f2543Smrg# which needs '.lib').
209706f2543Smrglibext=a
210706f2543Smrg
211706f2543Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
212706f2543Smrg
213706f2543Smrgold_CC="$CC"
214706f2543Smrgold_CFLAGS="$CFLAGS"
215706f2543Smrg
216706f2543Smrg# Set sane defaults for various variables
217706f2543Smrgtest -z "$CC" && CC=cc
218706f2543Smrgtest -z "$LTCC" && LTCC=$CC
219706f2543Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
220706f2543Smrgtest -z "$LD" && LD=ld
221706f2543Smrgtest -z "$ac_objext" && ac_objext=o
222706f2543Smrg
223706f2543Smrg_LT_CC_BASENAME([$compiler])
224706f2543Smrg
225706f2543Smrg# Only perform the check for file, if the check method requires it
226706f2543Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
227706f2543Smrgcase $deplibs_check_method in
228706f2543Smrgfile_magic*)
229706f2543Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
230706f2543Smrg    _LT_PATH_MAGIC
231706f2543Smrg  fi
232706f2543Smrg  ;;
233706f2543Smrgesac
234706f2543Smrg
235706f2543Smrg# Use C for the default configuration in the libtool script
236706f2543SmrgLT_SUPPORTED_TAG([CC])
237706f2543Smrg_LT_LANG_C_CONFIG
238706f2543Smrg_LT_LANG_DEFAULT_CONFIG
239706f2543Smrg_LT_CONFIG_COMMANDS
240706f2543Smrg])# _LT_SETUP
241706f2543Smrg
242706f2543Smrg
243706f2543Smrg# _LT_PREPARE_SED_QUOTE_VARS
244706f2543Smrg# --------------------------
245706f2543Smrg# Define a few sed substitution that help us do robust quoting.
246706f2543Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
247706f2543Smrg[# Backslashify metacharacters that are still active within
248706f2543Smrg# double-quoted strings.
249706f2543Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
250706f2543Smrg
251706f2543Smrg# Same as above, but do not quote variable references.
252706f2543Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
253706f2543Smrg
254706f2543Smrg# Sed substitution to delay expansion of an escaped shell variable in a
255706f2543Smrg# double_quote_subst'ed string.
256706f2543Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
257706f2543Smrg
258706f2543Smrg# Sed substitution to delay expansion of an escaped single quote.
259706f2543Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
260706f2543Smrg
261706f2543Smrg# Sed substitution to avoid accidental globbing in evaled expressions
262706f2543Smrgno_glob_subst='s/\*/\\\*/g'
263706f2543Smrg])
264706f2543Smrg
265706f2543Smrg# _LT_PROG_LTMAIN
266706f2543Smrg# ---------------
267706f2543Smrg# Note that this code is called both from `configure', and `config.status'
268706f2543Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
269706f2543Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
270706f2543Smrg# so we pass a copy along to make sure it has a sensible value anyway.
271706f2543Smrgm4_defun([_LT_PROG_LTMAIN],
272706f2543Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
273706f2543Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
274706f2543Smrgltmain="$ac_aux_dir/ltmain.sh"
275706f2543Smrg])# _LT_PROG_LTMAIN
276706f2543Smrg
277706f2543Smrg
278706f2543Smrg## ------------------------------------- ##
279706f2543Smrg## Accumulate code for creating libtool. ##
280706f2543Smrg## ------------------------------------- ##
281706f2543Smrg
282706f2543Smrg# So that we can recreate a full libtool script including additional
283706f2543Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
284706f2543Smrg# in macros and then make a single call at the end using the `libtool'
285706f2543Smrg# label.
286706f2543Smrg
287706f2543Smrg
288706f2543Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
289706f2543Smrg# ----------------------------------------
290706f2543Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
291706f2543Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
292706f2543Smrg[m4_ifval([$1],
293706f2543Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
294706f2543Smrg                     [$1
295706f2543Smrg])])])
296706f2543Smrg
297706f2543Smrg# Initialize.
298706f2543Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
299706f2543Smrg
300706f2543Smrg
301706f2543Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
302706f2543Smrg# ------------------------------
303706f2543Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
304706f2543Smrgm4_define([_LT_CONFIG_LIBTOOL],
305706f2543Smrg[m4_ifval([$1],
306706f2543Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
307706f2543Smrg                     [$1
308706f2543Smrg])])])
309706f2543Smrg
310706f2543Smrg# Initialize.
311706f2543Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
312706f2543Smrg
313706f2543Smrg
314706f2543Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
315706f2543Smrg# -----------------------------------------------------
316706f2543Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
317706f2543Smrg[_LT_CONFIG_LIBTOOL([$1])
318706f2543Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
319706f2543Smrg])
320706f2543Smrg
321706f2543Smrg
322706f2543Smrg# _LT_FORMAT_COMMENT([COMMENT])
323706f2543Smrg# -----------------------------
324706f2543Smrg# Add leading comment marks to the start of each line, and a trailing
325706f2543Smrg# full-stop to the whole comment if one is not present already.
326706f2543Smrgm4_define([_LT_FORMAT_COMMENT],
327706f2543Smrg[m4_ifval([$1], [
328706f2543Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
329706f2543Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
330706f2543Smrg)])
331706f2543Smrg
332706f2543Smrg
333706f2543Smrg
334706f2543Smrg## ------------------------ ##
335706f2543Smrg## FIXME: Eliminate VARNAME ##
336706f2543Smrg## ------------------------ ##
337706f2543Smrg
338706f2543Smrg
339706f2543Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
340706f2543Smrg# -------------------------------------------------------------------
341706f2543Smrg# CONFIGNAME is the name given to the value in the libtool script.
342706f2543Smrg# VARNAME is the (base) name used in the configure script.
343706f2543Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
344706f2543Smrg# VARNAME.  Any other value will be used directly.
345706f2543Smrgm4_define([_LT_DECL],
346706f2543Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
347706f2543Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
348706f2543Smrg	[m4_ifval([$1], [$1], [$2])])
349706f2543Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
350706f2543Smrg    m4_ifval([$4],
351706f2543Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
352706f2543Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
353706f2543Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
354706f2543Smrg])
355706f2543Smrg
356706f2543Smrg
357706f2543Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
358706f2543Smrg# --------------------------------------------------------
359706f2543Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
360706f2543Smrg
361706f2543Smrg
362706f2543Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
363706f2543Smrg# ------------------------------------------------
364706f2543Smrgm4_define([lt_decl_tag_varnames],
365706f2543Smrg[_lt_decl_filter([tagged?], [yes], $@)])
366706f2543Smrg
367706f2543Smrg
368706f2543Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
369706f2543Smrg# ---------------------------------------------------------
370706f2543Smrgm4_define([_lt_decl_filter],
371706f2543Smrg[m4_case([$#],
372706f2543Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
373706f2543Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
374706f2543Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
375706f2543Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
376706f2543Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
377706f2543Smrg])
378706f2543Smrg
379706f2543Smrg
380706f2543Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
381706f2543Smrg# --------------------------------------------------
382706f2543Smrgm4_define([lt_decl_quote_varnames],
383706f2543Smrg[_lt_decl_filter([value], [1], $@)])
384706f2543Smrg
385706f2543Smrg
386706f2543Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
387706f2543Smrg# ---------------------------------------------------
388706f2543Smrgm4_define([lt_decl_dquote_varnames],
389706f2543Smrg[_lt_decl_filter([value], [2], $@)])
390706f2543Smrg
391706f2543Smrg
392706f2543Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
393706f2543Smrg# ---------------------------------------------------
394706f2543Smrgm4_define([lt_decl_varnames_tagged],
395706f2543Smrg[m4_assert([$# <= 2])dnl
396706f2543Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
397706f2543Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
398706f2543Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
399706f2543Smrgm4_define([_lt_decl_varnames_tagged],
400706f2543Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
401706f2543Smrg
402706f2543Smrg
403706f2543Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
404706f2543Smrg# ------------------------------------------------
405706f2543Smrgm4_define([lt_decl_all_varnames],
406706f2543Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
407706f2543Smrg     m4_if([$2], [],
408706f2543Smrg	   m4_quote(lt_decl_varnames),
409706f2543Smrg	m4_quote(m4_shift($@))))[]dnl
410706f2543Smrg])
411706f2543Smrgm4_define([_lt_decl_all_varnames],
412706f2543Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
413706f2543Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
414706f2543Smrg])
415706f2543Smrg
416706f2543Smrg
417706f2543Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
418706f2543Smrg# ------------------------------------
419706f2543Smrg# Quote a variable value, and forward it to `config.status' so that its
420706f2543Smrg# declaration there will have the same value as in `configure'.  VARNAME
421706f2543Smrg# must have a single quote delimited value for this to work.
422706f2543Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
423706f2543Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
424706f2543Smrg
425706f2543Smrg
426706f2543Smrg# _LT_CONFIG_STATUS_DECLARATIONS
427706f2543Smrg# ------------------------------
428706f2543Smrg# We delimit libtool config variables with single quotes, so when
429706f2543Smrg# we write them to config.status, we have to be sure to quote all
430706f2543Smrg# embedded single quotes properly.  In configure, this macro expands
431706f2543Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
432706f2543Smrg#
433706f2543Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
434706f2543Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
435706f2543Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
436706f2543Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
437706f2543Smrg
438706f2543Smrg
439706f2543Smrg# _LT_LIBTOOL_TAGS
440706f2543Smrg# ----------------
441706f2543Smrg# Output comment and list of tags supported by the script
442706f2543Smrgm4_defun([_LT_LIBTOOL_TAGS],
443706f2543Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
444706f2543Smrgavailable_tags="_LT_TAGS"dnl
445706f2543Smrg])
446706f2543Smrg
447706f2543Smrg
448706f2543Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
449706f2543Smrg# -----------------------------------
450706f2543Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
451706f2543Smrg# expand to a commented shell variable setting:
452706f2543Smrg#
453706f2543Smrg#    # Some comment about what VAR is for.
454706f2543Smrg#    visible_name=$lt_internal_name
455706f2543Smrgm4_define([_LT_LIBTOOL_DECLARE],
456706f2543Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
457706f2543Smrg					   [description])))[]dnl
458706f2543Smrgm4_pushdef([_libtool_name],
459706f2543Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
460706f2543Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
461706f2543Smrg    [0], [_libtool_name=[$]$1],
462706f2543Smrg    [1], [_libtool_name=$lt_[]$1],
463706f2543Smrg    [2], [_libtool_name=$lt_[]$1],
464706f2543Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
465706f2543Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
466706f2543Smrg])
467706f2543Smrg
468706f2543Smrg
469706f2543Smrg# _LT_LIBTOOL_CONFIG_VARS
470706f2543Smrg# -----------------------
471706f2543Smrg# Produce commented declarations of non-tagged libtool config variables
472706f2543Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
473706f2543Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
474706f2543Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
475706f2543Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
476706f2543Smrg[m4_foreach([_lt_var],
477706f2543Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
478706f2543Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
479706f2543Smrg
480706f2543Smrg
481706f2543Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
482706f2543Smrg# -------------------------
483706f2543Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
484706f2543Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
485706f2543Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
486706f2543Smrg
487706f2543Smrg
488706f2543Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
489706f2543Smrg# ------------------------------
490706f2543Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
491706f2543Smrg
492706f2543Smrg
493706f2543Smrg# _LT_CONFIG_COMMANDS
494706f2543Smrg# -------------------
495706f2543Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
496706f2543Smrg# variables for single and double quote escaping we saved from calls
497706f2543Smrg# to _LT_DECL, we can put quote escaped variables declarations
498706f2543Smrg# into `config.status', and then the shell code to quote escape them in
499706f2543Smrg# for loops in `config.status'.  Finally, any additional code accumulated
500706f2543Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
501706f2543Smrgm4_defun([_LT_CONFIG_COMMANDS],
502706f2543Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
503706f2543Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
504706f2543Smrg	dnl instead of duplicating it all over again into config.status,
505706f2543Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
506706f2543Smrg	dnl needs to know what name is stored there:
507706f2543Smrg        [AC_CONFIG_COMMANDS([libtool],
508706f2543Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
509706f2543Smrg    dnl If the libtool generation code is destined for config.status,
510706f2543Smrg    dnl expand the accumulated commands and init code now:
511706f2543Smrg    [AC_CONFIG_COMMANDS([libtool],
512706f2543Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
513706f2543Smrg])#_LT_CONFIG_COMMANDS
514706f2543Smrg
515706f2543Smrg
516706f2543Smrg# Initialize.
517706f2543Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
518706f2543Smrg[
519706f2543Smrg
520706f2543Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
521706f2543Smrg# if CDPATH is set.
522706f2543Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
523706f2543Smrg
524706f2543Smrgsed_quote_subst='$sed_quote_subst'
525706f2543Smrgdouble_quote_subst='$double_quote_subst'
526706f2543Smrgdelay_variable_subst='$delay_variable_subst'
527706f2543Smrg_LT_CONFIG_STATUS_DECLARATIONS
528706f2543SmrgLTCC='$LTCC'
529706f2543SmrgLTCFLAGS='$LTCFLAGS'
530706f2543Smrgcompiler='$compiler_DEFAULT'
531706f2543Smrg
532706f2543Smrg# A function that is used when there is no print builtin or printf.
533706f2543Smrgfunc_fallback_echo ()
534706f2543Smrg{
535706f2543Smrg  eval 'cat <<_LTECHO_EOF
536706f2543Smrg\$[]1
537706f2543Smrg_LTECHO_EOF'
538706f2543Smrg}
539706f2543Smrg
540706f2543Smrg# Quote evaled strings.
541706f2543Smrgfor var in lt_decl_all_varnames([[ \
542706f2543Smrg]], lt_decl_quote_varnames); do
543706f2543Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
544706f2543Smrg    *[[\\\\\\\`\\"\\\$]]*)
545706f2543Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
546706f2543Smrg      ;;
547706f2543Smrg    *)
548706f2543Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
549706f2543Smrg      ;;
550706f2543Smrg    esac
551706f2543Smrgdone
552706f2543Smrg
553706f2543Smrg# Double-quote double-evaled strings.
554706f2543Smrgfor var in lt_decl_all_varnames([[ \
555706f2543Smrg]], lt_decl_dquote_varnames); do
556706f2543Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
557706f2543Smrg    *[[\\\\\\\`\\"\\\$]]*)
558706f2543Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
559706f2543Smrg      ;;
560706f2543Smrg    *)
561706f2543Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
562706f2543Smrg      ;;
563706f2543Smrg    esac
564706f2543Smrgdone
565706f2543Smrg
566706f2543Smrg_LT_OUTPUT_LIBTOOL_INIT
567706f2543Smrg])
568706f2543Smrg
569706f2543Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
570706f2543Smrg# ------------------------------------
571706f2543Smrg# Generate a child script FILE with all initialization necessary to
572706f2543Smrg# reuse the environment learned by the parent script, and make the
573706f2543Smrg# file executable.  If COMMENT is supplied, it is inserted after the
574706f2543Smrg# `#!' sequence but before initialization text begins.  After this
575706f2543Smrg# macro, additional text can be appended to FILE to form the body of
576706f2543Smrg# the child script.  The macro ends with non-zero status if the
577706f2543Smrg# file could not be fully written (such as if the disk is full).
578706f2543Smrgm4_ifdef([AS_INIT_GENERATED],
579706f2543Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
580706f2543Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
581706f2543Smrg[m4_require([AS_PREPARE])]dnl
582706f2543Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
583706f2543Smrg[lt_write_fail=0
584706f2543Smrgcat >$1 <<_ASEOF || lt_write_fail=1
585706f2543Smrg#! $SHELL
586706f2543Smrg# Generated by $as_me.
587706f2543Smrg$2
588706f2543SmrgSHELL=\${CONFIG_SHELL-$SHELL}
589706f2543Smrgexport SHELL
590706f2543Smrg_ASEOF
591706f2543Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
592706f2543SmrgAS_SHELL_SANITIZE
593706f2543Smrg_AS_PREPARE
594706f2543Smrgexec AS_MESSAGE_FD>&1
595706f2543Smrg_ASEOF
596706f2543Smrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
597706f2543Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
598706f2543Smrg
599706f2543Smrg# LT_OUTPUT
600706f2543Smrg# ---------
601706f2543Smrg# This macro allows early generation of the libtool script (before
602706f2543Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
603706f2543Smrg# tests.
604706f2543SmrgAC_DEFUN([LT_OUTPUT],
605706f2543Smrg[: ${CONFIG_LT=./config.lt}
606706f2543SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
607706f2543Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
608706f2543Smrg[# Run this file to recreate a libtool stub with the current configuration.])
609706f2543Smrg
610706f2543Smrgcat >>"$CONFIG_LT" <<\_LTEOF
611706f2543Smrglt_cl_silent=false
612706f2543Smrgexec AS_MESSAGE_LOG_FD>>config.log
613706f2543Smrg{
614706f2543Smrg  echo
615706f2543Smrg  AS_BOX([Running $as_me.])
616706f2543Smrg} >&AS_MESSAGE_LOG_FD
617706f2543Smrg
618706f2543Smrglt_cl_help="\
619706f2543Smrg\`$as_me' creates a local libtool stub from the current configuration,
620706f2543Smrgfor use in further configure time tests before the real libtool is
621706f2543Smrggenerated.
622706f2543Smrg
623706f2543SmrgUsage: $[0] [[OPTIONS]]
624706f2543Smrg
625706f2543Smrg  -h, --help      print this help, then exit
626706f2543Smrg  -V, --version   print version number, then exit
627706f2543Smrg  -q, --quiet     do not print progress messages
628706f2543Smrg  -d, --debug     don't remove temporary files
629706f2543Smrg
630706f2543SmrgReport bugs to <bug-libtool@gnu.org>."
631706f2543Smrg
632706f2543Smrglt_cl_version="\
633706f2543Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
634706f2543Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
635706f2543Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
636706f2543Smrg
637706f2543SmrgCopyright (C) 2010 Free Software Foundation, Inc.
638706f2543SmrgThis config.lt script is free software; the Free Software Foundation
639706f2543Smrggives unlimited permision to copy, distribute and modify it."
640706f2543Smrg
641706f2543Smrgwhile test $[#] != 0
642706f2543Smrgdo
643706f2543Smrg  case $[1] in
644706f2543Smrg    --version | --v* | -V )
645706f2543Smrg      echo "$lt_cl_version"; exit 0 ;;
646706f2543Smrg    --help | --h* | -h )
647706f2543Smrg      echo "$lt_cl_help"; exit 0 ;;
648706f2543Smrg    --debug | --d* | -d )
649706f2543Smrg      debug=: ;;
650706f2543Smrg    --quiet | --q* | --silent | --s* | -q )
651706f2543Smrg      lt_cl_silent=: ;;
652706f2543Smrg
653706f2543Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
654706f2543SmrgTry \`$[0] --help' for more information.]) ;;
655706f2543Smrg
656706f2543Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
657706f2543SmrgTry \`$[0] --help' for more information.]) ;;
658706f2543Smrg  esac
659706f2543Smrg  shift
660706f2543Smrgdone
661706f2543Smrg
662706f2543Smrgif $lt_cl_silent; then
663706f2543Smrg  exec AS_MESSAGE_FD>/dev/null
664706f2543Smrgfi
665706f2543Smrg_LTEOF
666706f2543Smrg
667706f2543Smrgcat >>"$CONFIG_LT" <<_LTEOF
668706f2543Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
669706f2543Smrg_LTEOF
670706f2543Smrg
671706f2543Smrgcat >>"$CONFIG_LT" <<\_LTEOF
672706f2543SmrgAC_MSG_NOTICE([creating $ofile])
673706f2543Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
674706f2543SmrgAS_EXIT(0)
675706f2543Smrg_LTEOF
676706f2543Smrgchmod +x "$CONFIG_LT"
677706f2543Smrg
678706f2543Smrg# configure is writing to config.log, but config.lt does its own redirection,
679706f2543Smrg# appending to config.log, which fails on DOS, as config.log is still kept
680706f2543Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
681706f2543Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
682706f2543Smrglt_cl_success=:
683706f2543Smrgtest "$silent" = yes &&
684706f2543Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
685706f2543Smrgexec AS_MESSAGE_LOG_FD>/dev/null
686706f2543Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
687706f2543Smrgexec AS_MESSAGE_LOG_FD>>config.log
688706f2543Smrg$lt_cl_success || AS_EXIT(1)
689706f2543Smrg])# LT_OUTPUT
690706f2543Smrg
691706f2543Smrg
692706f2543Smrg# _LT_CONFIG(TAG)
693706f2543Smrg# ---------------
694706f2543Smrg# If TAG is the built-in tag, create an initial libtool script with a
695706f2543Smrg# default configuration from the untagged config vars.  Otherwise add code
696706f2543Smrg# to config.status for appending the configuration named by TAG from the
697706f2543Smrg# matching tagged config vars.
698706f2543Smrgm4_defun([_LT_CONFIG],
699706f2543Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
700706f2543Smrg_LT_CONFIG_SAVE_COMMANDS([
701706f2543Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
702706f2543Smrg  m4_if(_LT_TAG, [C], [
703706f2543Smrg    # See if we are running on zsh, and set the options which allow our
704706f2543Smrg    # commands through without removal of \ escapes.
705706f2543Smrg    if test -n "${ZSH_VERSION+set}" ; then
706706f2543Smrg      setopt NO_GLOB_SUBST
707706f2543Smrg    fi
708706f2543Smrg
709706f2543Smrg    cfgfile="${ofile}T"
710706f2543Smrg    trap "$RM -f \"$cfgfile\"; exit 1" 1 2 15
711706f2543Smrg    $RM -f "$cfgfile"
712706f2543Smrg
713706f2543Smrg    cat <<_LT_EOF >> "$cfgfile"
714706f2543Smrg#! $SHELL
715706f2543Smrg
716706f2543Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
717706f2543Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
718706f2543Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
719706f2543Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
720706f2543Smrg#
721706f2543Smrg_LT_COPYING
722706f2543Smrg_LT_LIBTOOL_TAGS
723706f2543Smrg
724706f2543Smrg# ### BEGIN LIBTOOL CONFIG
725706f2543Smrg_LT_LIBTOOL_CONFIG_VARS
726706f2543Smrg_LT_LIBTOOL_TAG_VARS
727706f2543Smrg# ### END LIBTOOL CONFIG
728706f2543Smrg
729706f2543Smrg_LT_EOF
730706f2543Smrg
731706f2543Smrg  case $host_os in
732706f2543Smrg  aix3*)
733706f2543Smrg    cat <<\_LT_EOF >> "$cfgfile"
734706f2543Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
735706f2543Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
736706f2543Smrg# vanish in a puff of smoke.
737706f2543Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
738706f2543Smrg  COLLECT_NAMES=
739706f2543Smrg  export COLLECT_NAMES
740706f2543Smrgfi
741706f2543Smrg_LT_EOF
742706f2543Smrg    ;;
743706f2543Smrg  esac
744706f2543Smrg
745706f2543Smrg  _LT_PROG_LTMAIN
746706f2543Smrg
747706f2543Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
748706f2543Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
749706f2543Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
750706f2543Smrg  # is reportedly fixed, but why not run on old versions too?
751706f2543Smrg  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
752706f2543Smrg    || (rm -f "$cfgfile"; exit 1)
753706f2543Smrg
754706f2543Smrg  _LT_PROG_XSI_SHELLFNS
755706f2543Smrg
756706f2543Smrg  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
757706f2543Smrg    || (rm -f "$cfgfile"; exit 1)
758706f2543Smrg
759706f2543Smrg  mv -f "$cfgfile" "$ofile" ||
760706f2543Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
761706f2543Smrg  chmod +x "$ofile"
762706f2543Smrg],
763706f2543Smrg[cat <<_LT_EOF >> "$ofile"
764706f2543Smrg
765706f2543Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
766706f2543Smrgdnl in a comment (ie after a #).
767706f2543Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
768706f2543Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
769706f2543Smrg# ### END LIBTOOL TAG CONFIG: $1
770706f2543Smrg_LT_EOF
771706f2543Smrg])dnl /m4_if
772706f2543Smrg],
773706f2543Smrg[m4_if([$1], [], [
774706f2543Smrg    PACKAGE='$PACKAGE'
775706f2543Smrg    VERSION='$VERSION'
776706f2543Smrg    TIMESTAMP='$TIMESTAMP'
777706f2543Smrg    RM='$RM'
778706f2543Smrg    ofile='$ofile'], [])
779706f2543Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
780706f2543Smrg])# _LT_CONFIG
781706f2543Smrg
782706f2543Smrg
783706f2543Smrg# LT_SUPPORTED_TAG(TAG)
784706f2543Smrg# ---------------------
785706f2543Smrg# Trace this macro to discover what tags are supported by the libtool
786706f2543Smrg# --tag option, using:
787706f2543Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
788706f2543SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
789706f2543Smrg
790706f2543Smrg
791706f2543Smrg# C support is built-in for now
792706f2543Smrgm4_define([_LT_LANG_C_enabled], [])
793706f2543Smrgm4_define([_LT_TAGS], [])
794706f2543Smrg
795706f2543Smrg
796706f2543Smrg# LT_LANG(LANG)
797706f2543Smrg# -------------
798706f2543Smrg# Enable libtool support for the given language if not already enabled.
799706f2543SmrgAC_DEFUN([LT_LANG],
800706f2543Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
801706f2543Smrgm4_case([$1],
802706f2543Smrg  [C],			[_LT_LANG(C)],
803706f2543Smrg  [C++],		[_LT_LANG(CXX)],
804706f2543Smrg  [Java],		[_LT_LANG(GCJ)],
805706f2543Smrg  [Fortran 77],		[_LT_LANG(F77)],
806706f2543Smrg  [Fortran],		[_LT_LANG(FC)],
807706f2543Smrg  [Windows Resource],	[_LT_LANG(RC)],
808706f2543Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
809706f2543Smrg    [_LT_LANG($1)],
810706f2543Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
811706f2543Smrg])# LT_LANG
812706f2543Smrg
813706f2543Smrg
814706f2543Smrg# _LT_LANG(LANGNAME)
815706f2543Smrg# ------------------
816706f2543Smrgm4_defun([_LT_LANG],
817706f2543Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
818706f2543Smrg  [LT_SUPPORTED_TAG([$1])dnl
819706f2543Smrg  m4_append([_LT_TAGS], [$1 ])dnl
820706f2543Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
821706f2543Smrg  _LT_LANG_$1_CONFIG($1)])dnl
822706f2543Smrg])# _LT_LANG
823706f2543Smrg
824706f2543Smrg
825706f2543Smrg# _LT_LANG_DEFAULT_CONFIG
826706f2543Smrg# -----------------------
827706f2543Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
828706f2543Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
829706f2543Smrg  [LT_LANG(CXX)],
830706f2543Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
831706f2543Smrg
832706f2543SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
833706f2543Smrg  [LT_LANG(F77)],
834706f2543Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
835706f2543Smrg
836706f2543SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
837706f2543Smrg  [LT_LANG(FC)],
838706f2543Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
839706f2543Smrg
840706f2543Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
841706f2543Smrgdnl pulling things in needlessly.
842706f2543SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
843706f2543Smrg  [LT_LANG(GCJ)],
844706f2543Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
845706f2543Smrg    [LT_LANG(GCJ)],
846706f2543Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
847706f2543Smrg      [LT_LANG(GCJ)],
848706f2543Smrg      [m4_ifdef([AC_PROG_GCJ],
849706f2543Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
850706f2543Smrg       m4_ifdef([A][M_PROG_GCJ],
851706f2543Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
852706f2543Smrg       m4_ifdef([LT_PROG_GCJ],
853706f2543Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
854706f2543Smrg
855706f2543SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
856706f2543Smrg  [LT_LANG(RC)],
857706f2543Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
858706f2543Smrg])# _LT_LANG_DEFAULT_CONFIG
859706f2543Smrg
860706f2543Smrg# Obsolete macros:
861706f2543SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
862706f2543SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
863706f2543SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
864706f2543SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
865706f2543SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
866706f2543Smrgdnl aclocal-1.4 backwards compatibility:
867706f2543Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
868706f2543Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
869706f2543Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
870706f2543Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
871706f2543Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
872706f2543Smrg
873706f2543Smrg
874706f2543Smrg# _LT_TAG_COMPILER
875706f2543Smrg# ----------------
876706f2543Smrgm4_defun([_LT_TAG_COMPILER],
877706f2543Smrg[AC_REQUIRE([AC_PROG_CC])dnl
878706f2543Smrg
879706f2543Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
880706f2543Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
881706f2543Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
882706f2543Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
883706f2543Smrg
884706f2543Smrg# If no C compiler was specified, use CC.
885706f2543SmrgLTCC=${LTCC-"$CC"}
886706f2543Smrg
887706f2543Smrg# If no C compiler flags were specified, use CFLAGS.
888706f2543SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
889706f2543Smrg
890706f2543Smrg# Allow CC to be a program name with arguments.
891706f2543Smrgcompiler=$CC
892706f2543Smrg])# _LT_TAG_COMPILER
893706f2543Smrg
894706f2543Smrg
895706f2543Smrg# _LT_COMPILER_BOILERPLATE
896706f2543Smrg# ------------------------
897706f2543Smrg# Check for compiler boilerplate output or warnings with
898706f2543Smrg# the simple compiler test code.
899706f2543Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
900706f2543Smrg[m4_require([_LT_DECL_SED])dnl
901706f2543Smrgac_outfile=conftest.$ac_objext
902706f2543Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
903706f2543Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
904706f2543Smrg_lt_compiler_boilerplate=`cat conftest.err`
905706f2543Smrg$RM -r conftest*
906706f2543Smrg])# _LT_COMPILER_BOILERPLATE
907706f2543Smrg
908706f2543Smrg
909706f2543Smrg# _LT_LINKER_BOILERPLATE
910706f2543Smrg# ----------------------
911706f2543Smrg# Check for linker boilerplate output or warnings with
912706f2543Smrg# the simple link test code.
913706f2543Smrgm4_defun([_LT_LINKER_BOILERPLATE],
914706f2543Smrg[m4_require([_LT_DECL_SED])dnl
915706f2543Smrgac_outfile=conftest.$ac_objext
916706f2543Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
917706f2543Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
918706f2543Smrg_lt_linker_boilerplate=`cat conftest.err`
919706f2543Smrg$RM -r conftest*
920706f2543Smrg])# _LT_LINKER_BOILERPLATE
921706f2543Smrg
922706f2543Smrg# _LT_REQUIRED_DARWIN_CHECKS
923706f2543Smrg# -------------------------
924706f2543Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
925706f2543Smrg  case $host_os in
926706f2543Smrg    rhapsody* | darwin*)
927706f2543Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
928706f2543Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
929706f2543Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
930706f2543Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
931706f2543Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
932706f2543Smrg    _LT_DECL([], [DSYMUTIL], [1],
933706f2543Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
934706f2543Smrg    _LT_DECL([], [NMEDIT], [1],
935706f2543Smrg      [Tool to change global to local symbols on Mac OS X])
936706f2543Smrg    _LT_DECL([], [LIPO], [1],
937706f2543Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
938706f2543Smrg    _LT_DECL([], [OTOOL], [1],
939706f2543Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
940706f2543Smrg    _LT_DECL([], [OTOOL64], [1],
941706f2543Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
942706f2543Smrg
943706f2543Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
944706f2543Smrg      [lt_cv_apple_cc_single_mod=no
945706f2543Smrg      if test -z "${LT_MULTI_MODULE}"; then
946706f2543Smrg	# By default we will add the -single_module flag. You can override
947706f2543Smrg	# by either setting the environment variable LT_MULTI_MODULE
948706f2543Smrg	# non-empty at configure time, or by adding -multi_module to the
949706f2543Smrg	# link flags.
950706f2543Smrg	rm -rf libconftest.dylib*
951706f2543Smrg	echo "int foo(void){return 1;}" > conftest.c
952706f2543Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
953706f2543Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
954706f2543Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
955706f2543Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
956706f2543Smrg        _lt_result=$?
957706f2543Smrg	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
958706f2543Smrg	  lt_cv_apple_cc_single_mod=yes
959706f2543Smrg	else
960706f2543Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
961706f2543Smrg	fi
962706f2543Smrg	rm -rf libconftest.dylib*
963706f2543Smrg	rm -f conftest.*
964706f2543Smrg      fi])
965706f2543Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
966706f2543Smrg      [lt_cv_ld_exported_symbols_list],
967706f2543Smrg      [lt_cv_ld_exported_symbols_list=no
968706f2543Smrg      save_LDFLAGS=$LDFLAGS
969706f2543Smrg      echo "_main" > conftest.sym
970706f2543Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
971706f2543Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
972706f2543Smrg	[lt_cv_ld_exported_symbols_list=yes],
973706f2543Smrg	[lt_cv_ld_exported_symbols_list=no])
974706f2543Smrg	LDFLAGS="$save_LDFLAGS"
975706f2543Smrg    ])
976706f2543Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
977706f2543Smrg      [lt_cv_ld_force_load=no
978706f2543Smrg      cat > conftest.c << _LT_EOF
979706f2543Smrgint forced_loaded() { return 2;}
980706f2543Smrg_LT_EOF
981706f2543Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
982706f2543Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
983706f2543Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
984706f2543Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
985706f2543Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
986706f2543Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
987706f2543Smrg      cat > conftest.c << _LT_EOF
988706f2543Smrgint main() { return 0;}
989706f2543Smrg_LT_EOF
990706f2543Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
991706f2543Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
992706f2543Smrg      _lt_result=$?
993706f2543Smrg      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
994706f2543Smrg	lt_cv_ld_force_load=yes
995706f2543Smrg      else
996706f2543Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
997706f2543Smrg      fi
998706f2543Smrg        rm -f conftest.err libconftest.a conftest conftest.c
999706f2543Smrg        rm -rf conftest.dSYM
1000706f2543Smrg    ])
1001706f2543Smrg    case $host_os in
1002706f2543Smrg    rhapsody* | darwin1.[[012]])
1003706f2543Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
1004706f2543Smrg    darwin1.*)
1005706f2543Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1006706f2543Smrg    darwin*) # darwin 5.x on
1007706f2543Smrg      # if running on 10.5 or later, the deployment target defaults
1008706f2543Smrg      # to the OS version, if on x86, and 10.4, the deployment
1009706f2543Smrg      # target defaults to 10.4. Don't you love it?
1010706f2543Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1011706f2543Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1012706f2543Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1013706f2543Smrg	10.[[012]]*)
1014706f2543Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1015706f2543Smrg	10.*)
1016706f2543Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1017706f2543Smrg      esac
1018706f2543Smrg    ;;
1019706f2543Smrg  esac
1020706f2543Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
1021706f2543Smrg      _lt_dar_single_mod='$single_module'
1022706f2543Smrg    fi
1023706f2543Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
1024706f2543Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
1025706f2543Smrg    else
1026706f2543Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
1027706f2543Smrg    fi
1028706f2543Smrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
1029706f2543Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
1030706f2543Smrg    else
1031706f2543Smrg      _lt_dsymutil=
1032706f2543Smrg    fi
1033706f2543Smrg    ;;
1034706f2543Smrg  esac
1035706f2543Smrg])
1036706f2543Smrg
1037706f2543Smrg
1038706f2543Smrg# _LT_DARWIN_LINKER_FEATURES
1039706f2543Smrg# --------------------------
1040706f2543Smrg# Checks for linker and compiler features on darwin
1041706f2543Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
1042706f2543Smrg[
1043706f2543Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1044706f2543Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1045706f2543Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
1046706f2543Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1047706f2543Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1048706f2543Smrg  if test "$lt_cv_ld_force_load" = "yes"; then
1049706f2543Smrg    _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\"`'
1050706f2543Smrg  else
1051706f2543Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1052706f2543Smrg  fi
1053706f2543Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1054706f2543Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1055706f2543Smrg  case $cc_basename in
1056706f2543Smrg     ifort*) _lt_dar_can_shared=yes ;;
1057706f2543Smrg     *) _lt_dar_can_shared=$GCC ;;
1058706f2543Smrg  esac
1059706f2543Smrg  if test "$_lt_dar_can_shared" = "yes"; then
1060706f2543Smrg    output_verbose_link_cmd=func_echo_all
1061706f2543Smrg    _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}"
1062706f2543Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1063706f2543Smrg    _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}"
1064706f2543Smrg    _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}"
1065706f2543Smrg    m4_if([$1], [CXX],
1066706f2543Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1067706f2543Smrg      _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}"
1068706f2543Smrg      _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}"
1069706f2543Smrg    fi
1070706f2543Smrg],[])
1071706f2543Smrg  else
1072706f2543Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
1073706f2543Smrg  fi
1074706f2543Smrg])
1075706f2543Smrg
1076706f2543Smrg# _LT_SYS_MODULE_PATH_AIX
1077706f2543Smrg# -----------------------
1078706f2543Smrg# Links a minimal program and checks the executable
1079706f2543Smrg# for the system default hardcoded library path. In most cases,
1080706f2543Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
1081706f2543Smrg# the location of the communication and MPI libs are included too.
1082706f2543Smrg# If we don't find anything, use the default library path according
1083706f2543Smrg# to the aix ld manual.
1084706f2543Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1085706f2543Smrg[m4_require([_LT_DECL_SED])dnl
1086706f2543SmrgAC_LINK_IFELSE(AC_LANG_PROGRAM,[
1087706f2543Smrglt_aix_libpath_sed='
1088706f2543Smrg    /Import File Strings/,/^$/ {
1089706f2543Smrg	/^0/ {
1090706f2543Smrg	    s/^0  *\(.*\)$/\1/
1091706f2543Smrg	    p
1092706f2543Smrg	}
1093706f2543Smrg    }'
1094706f2543Smrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1095706f2543Smrg# Check for a 64-bit object if we didn't find anything.
1096706f2543Smrgif test -z "$aix_libpath"; then
1097706f2543Smrg  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1098706f2543Smrgfi],[])
1099706f2543Smrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1100706f2543Smrg])# _LT_SYS_MODULE_PATH_AIX
1101706f2543Smrg
1102706f2543Smrg
1103706f2543Smrg# _LT_SHELL_INIT(ARG)
1104706f2543Smrg# -------------------
1105706f2543Smrgm4_define([_LT_SHELL_INIT],
1106706f2543Smrg[m4_divert_text([M4SH-INIT], [$1
1107706f2543Smrg])])# _LT_SHELL_INIT
1108706f2543Smrg
1109706f2543Smrg
1110706f2543Smrg
1111706f2543Smrg# _LT_PROG_ECHO_BACKSLASH
1112706f2543Smrg# -----------------------
1113706f2543Smrg# Find how we can fake an echo command that does not interpret backslash.
1114706f2543Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
1115706f2543Smrg# of the generated configure script which will find a shell with a builtin
1116706f2543Smrg# printf (which we can use as an echo command).
1117706f2543Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
1118706f2543Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1119706f2543SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1120706f2543SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1121706f2543Smrg
1122706f2543SmrgAC_MSG_CHECKING([how to print strings])
1123706f2543Smrg# Test print first, because it will be a builtin if present.
1124706f2543Smrgif test "X`print -r -- -n 2>/dev/null`" = X-n && \
1125706f2543Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1126706f2543Smrg  ECHO='print -r --'
1127706f2543Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1128706f2543Smrg  ECHO='printf %s\n'
1129706f2543Smrgelse
1130706f2543Smrg  # Use this function as a fallback that always works.
1131706f2543Smrg  func_fallback_echo ()
1132706f2543Smrg  {
1133706f2543Smrg    eval 'cat <<_LTECHO_EOF
1134706f2543Smrg$[]1
1135706f2543Smrg_LTECHO_EOF'
1136706f2543Smrg  }
1137706f2543Smrg  ECHO='func_fallback_echo'
1138706f2543Smrgfi
1139706f2543Smrg
1140706f2543Smrg# func_echo_all arg...
1141706f2543Smrg# Invoke $ECHO with all args, space-separated.
1142706f2543Smrgfunc_echo_all ()
1143706f2543Smrg{
1144706f2543Smrg    $ECHO "$*" 
1145706f2543Smrg}
1146706f2543Smrg
1147706f2543Smrgcase "$ECHO" in
1148706f2543Smrg  printf*) AC_MSG_RESULT([printf]) ;;
1149706f2543Smrg  print*) AC_MSG_RESULT([print -r]) ;;
1150706f2543Smrg  *) AC_MSG_RESULT([cat]) ;;
1151706f2543Smrgesac
1152706f2543Smrg
1153706f2543Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
1154706f2543Smrg[_AS_DETECT_SUGGESTED([
1155706f2543Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1156706f2543Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1157706f2543Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1158706f2543Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1159706f2543Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
1160706f2543Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
1161706f2543Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1162706f2543Smrg
1163706f2543Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1164706f2543Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1165706f2543Smrg])# _LT_PROG_ECHO_BACKSLASH
1166706f2543Smrg
1167706f2543Smrg
1168706f2543Smrg# _LT_ENABLE_LOCK
1169706f2543Smrg# ---------------
1170706f2543Smrgm4_defun([_LT_ENABLE_LOCK],
1171706f2543Smrg[AC_ARG_ENABLE([libtool-lock],
1172706f2543Smrg  [AS_HELP_STRING([--disable-libtool-lock],
1173706f2543Smrg    [avoid locking (might break parallel builds)])])
1174706f2543Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1175706f2543Smrg
1176706f2543Smrg# Some flags need to be propagated to the compiler or linker for good
1177706f2543Smrg# libtool support.
1178706f2543Smrgcase $host in
1179706f2543Smrgia64-*-hpux*)
1180706f2543Smrg  # Find out which ABI we are using.
1181706f2543Smrg  echo 'int i;' > conftest.$ac_ext
1182706f2543Smrg  if AC_TRY_EVAL(ac_compile); then
1183706f2543Smrg    case `/usr/bin/file conftest.$ac_objext` in
1184706f2543Smrg      *ELF-32*)
1185706f2543Smrg	HPUX_IA64_MODE="32"
1186706f2543Smrg	;;
1187706f2543Smrg      *ELF-64*)
1188706f2543Smrg	HPUX_IA64_MODE="64"
1189706f2543Smrg	;;
1190706f2543Smrg    esac
1191706f2543Smrg  fi
1192706f2543Smrg  rm -rf conftest*
1193706f2543Smrg  ;;
1194706f2543Smrg*-*-irix6*)
1195706f2543Smrg  # Find out which ABI we are using.
1196706f2543Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1197706f2543Smrg  if AC_TRY_EVAL(ac_compile); then
1198706f2543Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
1199706f2543Smrg      case `/usr/bin/file conftest.$ac_objext` in
1200706f2543Smrg	*32-bit*)
1201706f2543Smrg	  LD="${LD-ld} -melf32bsmip"
1202706f2543Smrg	  ;;
1203706f2543Smrg	*N32*)
1204706f2543Smrg	  LD="${LD-ld} -melf32bmipn32"
1205706f2543Smrg	  ;;
1206706f2543Smrg	*64-bit*)
1207706f2543Smrg	  LD="${LD-ld} -melf64bmip"
1208706f2543Smrg	;;
1209706f2543Smrg      esac
1210706f2543Smrg    else
1211706f2543Smrg      case `/usr/bin/file conftest.$ac_objext` in
1212706f2543Smrg	*32-bit*)
1213706f2543Smrg	  LD="${LD-ld} -32"
1214706f2543Smrg	  ;;
1215706f2543Smrg	*N32*)
1216706f2543Smrg	  LD="${LD-ld} -n32"
1217706f2543Smrg	  ;;
1218706f2543Smrg	*64-bit*)
1219706f2543Smrg	  LD="${LD-ld} -64"
1220706f2543Smrg	  ;;
1221706f2543Smrg      esac
1222706f2543Smrg    fi
1223706f2543Smrg  fi
1224706f2543Smrg  rm -rf conftest*
1225706f2543Smrg  ;;
1226706f2543Smrg
1227706f2543Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1228706f2543Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1229706f2543Smrg  # Find out which ABI we are using.
1230706f2543Smrg  echo 'int i;' > conftest.$ac_ext
1231706f2543Smrg  if AC_TRY_EVAL(ac_compile); then
1232706f2543Smrg    case `/usr/bin/file conftest.o` in
1233706f2543Smrg      *32-bit*)
1234706f2543Smrg	case $host in
1235706f2543Smrg	  x86_64-*kfreebsd*-gnu)
1236706f2543Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
1237706f2543Smrg	    ;;
1238706f2543Smrg	  x86_64-*linux*)
1239706f2543Smrg	    LD="${LD-ld} -m elf_i386"
1240706f2543Smrg	    ;;
1241706f2543Smrg	  ppc64-*linux*|powerpc64-*linux*)
1242706f2543Smrg	    LD="${LD-ld} -m elf32ppclinux"
1243706f2543Smrg	    ;;
1244706f2543Smrg	  s390x-*linux*)
1245706f2543Smrg	    LD="${LD-ld} -m elf_s390"
1246706f2543Smrg	    ;;
1247706f2543Smrg	  sparc64-*linux*)
1248706f2543Smrg	    LD="${LD-ld} -m elf32_sparc"
1249706f2543Smrg	    ;;
1250706f2543Smrg	esac
1251706f2543Smrg	;;
1252706f2543Smrg      *64-bit*)
1253706f2543Smrg	case $host in
1254706f2543Smrg	  x86_64-*kfreebsd*-gnu)
1255706f2543Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1256706f2543Smrg	    ;;
1257706f2543Smrg	  x86_64-*linux*)
1258706f2543Smrg	    LD="${LD-ld} -m elf_x86_64"
1259706f2543Smrg	    ;;
1260706f2543Smrg	  ppc*-*linux*|powerpc*-*linux*)
1261706f2543Smrg	    LD="${LD-ld} -m elf64ppc"
1262706f2543Smrg	    ;;
1263706f2543Smrg	  s390*-*linux*|s390*-*tpf*)
1264706f2543Smrg	    LD="${LD-ld} -m elf64_s390"
1265706f2543Smrg	    ;;
1266706f2543Smrg	  sparc*-*linux*)
1267706f2543Smrg	    LD="${LD-ld} -m elf64_sparc"
1268706f2543Smrg	    ;;
1269706f2543Smrg	esac
1270706f2543Smrg	;;
1271706f2543Smrg    esac
1272706f2543Smrg  fi
1273706f2543Smrg  rm -rf conftest*
1274706f2543Smrg  ;;
1275706f2543Smrg
1276706f2543Smrg*-*-sco3.2v5*)
1277706f2543Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1278706f2543Smrg  SAVE_CFLAGS="$CFLAGS"
1279706f2543Smrg  CFLAGS="$CFLAGS -belf"
1280706f2543Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1281706f2543Smrg    [AC_LANG_PUSH(C)
1282706f2543Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1283706f2543Smrg     AC_LANG_POP])
1284706f2543Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1285706f2543Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1286706f2543Smrg    CFLAGS="$SAVE_CFLAGS"
1287706f2543Smrg  fi
1288706f2543Smrg  ;;
1289706f2543Smrgsparc*-*solaris*)
1290706f2543Smrg  # Find out which ABI we are using.
1291706f2543Smrg  echo 'int i;' > conftest.$ac_ext
1292706f2543Smrg  if AC_TRY_EVAL(ac_compile); then
1293706f2543Smrg    case `/usr/bin/file conftest.o` in
1294706f2543Smrg    *64-bit*)
1295706f2543Smrg      case $lt_cv_prog_gnu_ld in
1296706f2543Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
1297706f2543Smrg      *)
1298706f2543Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1299706f2543Smrg	  LD="${LD-ld} -64"
1300706f2543Smrg	fi
1301706f2543Smrg	;;
1302706f2543Smrg      esac
1303706f2543Smrg      ;;
1304706f2543Smrg    esac
1305706f2543Smrg  fi
1306706f2543Smrg  rm -rf conftest*
1307706f2543Smrg  ;;
1308706f2543Smrgesac
1309706f2543Smrg
1310706f2543Smrgneed_locks="$enable_libtool_lock"
1311706f2543Smrg])# _LT_ENABLE_LOCK
1312706f2543Smrg
1313706f2543Smrg
1314706f2543Smrg# _LT_CMD_OLD_ARCHIVE
1315706f2543Smrg# -------------------
1316706f2543Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1317706f2543Smrg[AC_CHECK_TOOL(AR, ar, false)
1318706f2543Smrgtest -z "$AR" && AR=ar
1319706f2543Smrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
1320706f2543Smrg_LT_DECL([], [AR], [1], [The archiver])
1321706f2543Smrg_LT_DECL([], [AR_FLAGS], [1])
1322706f2543Smrg
1323706f2543SmrgAC_CHECK_TOOL(STRIP, strip, :)
1324706f2543Smrgtest -z "$STRIP" && STRIP=:
1325706f2543Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1326706f2543Smrg
1327706f2543SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1328706f2543Smrgtest -z "$RANLIB" && RANLIB=:
1329706f2543Smrg_LT_DECL([], [RANLIB], [1],
1330706f2543Smrg    [Commands used to install an old-style archive])
1331706f2543Smrg
1332706f2543Smrg# Determine commands to create old-style static archives.
1333706f2543Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1334706f2543Smrgold_postinstall_cmds='chmod 644 $oldlib'
1335706f2543Smrgold_postuninstall_cmds=
1336706f2543Smrg
1337706f2543Smrgif test -n "$RANLIB"; then
1338706f2543Smrg  case $host_os in
1339706f2543Smrg  openbsd*)
1340706f2543Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
1341706f2543Smrg    ;;
1342706f2543Smrg  *)
1343706f2543Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
1344706f2543Smrg    ;;
1345706f2543Smrg  esac
1346706f2543Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1347706f2543Smrgfi
1348706f2543Smrg
1349706f2543Smrgcase $host_os in
1350706f2543Smrg  darwin*)
1351706f2543Smrg    lock_old_archive_extraction=yes ;;
1352706f2543Smrg  *)
1353706f2543Smrg    lock_old_archive_extraction=no ;;
1354706f2543Smrgesac
1355706f2543Smrg_LT_DECL([], [old_postinstall_cmds], [2])
1356706f2543Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
1357706f2543Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
1358706f2543Smrg    [Commands used to build an old-style archive])
1359706f2543Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
1360706f2543Smrg    [Whether to use a lock for old archive extraction])
1361706f2543Smrg])# _LT_CMD_OLD_ARCHIVE
1362706f2543Smrg
1363706f2543Smrg
1364706f2543Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1365706f2543Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1366706f2543Smrg# ----------------------------------------------------------------
1367706f2543Smrg# Check whether the given compiler option works
1368706f2543SmrgAC_DEFUN([_LT_COMPILER_OPTION],
1369706f2543Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1370706f2543Smrgm4_require([_LT_DECL_SED])dnl
1371706f2543SmrgAC_CACHE_CHECK([$1], [$2],
1372706f2543Smrg  [$2=no
1373706f2543Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1374706f2543Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1375706f2543Smrg   lt_compiler_flag="$3"
1376706f2543Smrg   # Insert the option either (1) after the last *FLAGS variable, or
1377706f2543Smrg   # (2) before a word containing "conftest.", or (3) at the end.
1378706f2543Smrg   # Note that $ac_compile itself does not contain backslashes and begins
1379706f2543Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1380706f2543Smrg   # The option is referenced via a variable to avoid confusing sed.
1381706f2543Smrg   lt_compile=`echo "$ac_compile" | $SED \
1382706f2543Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1383706f2543Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1384706f2543Smrg   -e 's:$: $lt_compiler_flag:'`
1385706f2543Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1386706f2543Smrg   (eval "$lt_compile" 2>conftest.err)
1387706f2543Smrg   ac_status=$?
1388706f2543Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
1389706f2543Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1390706f2543Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1391706f2543Smrg     # The compiler can only warn and ignore the option if not recognized
1392706f2543Smrg     # So say no if there are warnings other than the usual output.
1393706f2543Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1394706f2543Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1395706f2543Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1396706f2543Smrg       $2=yes
1397706f2543Smrg     fi
1398706f2543Smrg   fi
1399706f2543Smrg   $RM -r conftest*
1400706f2543Smrg])
1401706f2543Smrg
1402706f2543Smrgif test x"[$]$2" = xyes; then
1403706f2543Smrg    m4_if([$5], , :, [$5])
1404706f2543Smrgelse
1405706f2543Smrg    m4_if([$6], , :, [$6])
1406706f2543Smrgfi
1407706f2543Smrg])# _LT_COMPILER_OPTION
1408706f2543Smrg
1409706f2543Smrg# Old name:
1410706f2543SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1411706f2543Smrgdnl aclocal-1.4 backwards compatibility:
1412706f2543Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1413706f2543Smrg
1414706f2543Smrg
1415706f2543Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1416706f2543Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1417706f2543Smrg# ----------------------------------------------------
1418706f2543Smrg# Check whether the given linker option works
1419706f2543SmrgAC_DEFUN([_LT_LINKER_OPTION],
1420706f2543Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1421706f2543Smrgm4_require([_LT_DECL_SED])dnl
1422706f2543SmrgAC_CACHE_CHECK([$1], [$2],
1423706f2543Smrg  [$2=no
1424706f2543Smrg   save_LDFLAGS="$LDFLAGS"
1425706f2543Smrg   LDFLAGS="$LDFLAGS $3"
1426706f2543Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1427706f2543Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1428706f2543Smrg     # The linker can only warn and ignore the option if not recognized
1429706f2543Smrg     # So say no if there are warnings
1430706f2543Smrg     if test -s conftest.err; then
1431706f2543Smrg       # Append any errors to the config.log.
1432706f2543Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1433706f2543Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1434706f2543Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1435706f2543Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
1436706f2543Smrg         $2=yes
1437706f2543Smrg       fi
1438706f2543Smrg     else
1439706f2543Smrg       $2=yes
1440706f2543Smrg     fi
1441706f2543Smrg   fi
1442706f2543Smrg   $RM -r conftest*
1443706f2543Smrg   LDFLAGS="$save_LDFLAGS"
1444706f2543Smrg])
1445706f2543Smrg
1446706f2543Smrgif test x"[$]$2" = xyes; then
1447706f2543Smrg    m4_if([$4], , :, [$4])
1448706f2543Smrgelse
1449706f2543Smrg    m4_if([$5], , :, [$5])
1450706f2543Smrgfi
1451706f2543Smrg])# _LT_LINKER_OPTION
1452706f2543Smrg
1453706f2543Smrg# Old name:
1454706f2543SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1455706f2543Smrgdnl aclocal-1.4 backwards compatibility:
1456706f2543Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1457706f2543Smrg
1458706f2543Smrg
1459706f2543Smrg# LT_CMD_MAX_LEN
1460706f2543Smrg#---------------
1461706f2543SmrgAC_DEFUN([LT_CMD_MAX_LEN],
1462706f2543Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1463706f2543Smrg# find the maximum length of command line arguments
1464706f2543SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
1465706f2543SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1466706f2543Smrg  i=0
1467706f2543Smrg  teststring="ABCD"
1468706f2543Smrg
1469706f2543Smrg  case $build_os in
1470706f2543Smrg  msdosdjgpp*)
1471706f2543Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
1472706f2543Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
1473706f2543Smrg    # during glob expansion).  Even if it were fixed, the result of this
1474706f2543Smrg    # check would be larger than it should be.
1475706f2543Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1476706f2543Smrg    ;;
1477706f2543Smrg
1478706f2543Smrg  gnu*)
1479706f2543Smrg    # Under GNU Hurd, this test is not required because there is
1480706f2543Smrg    # no limit to the length of command line arguments.
1481706f2543Smrg    # Libtool will interpret -1 as no limit whatsoever
1482706f2543Smrg    lt_cv_sys_max_cmd_len=-1;
1483706f2543Smrg    ;;
1484706f2543Smrg
1485706f2543Smrg  cygwin* | mingw* | cegcc*)
1486706f2543Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
1487706f2543Smrg    # about 5 minutes as the teststring grows exponentially.
1488706f2543Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
1489706f2543Smrg    # you end up with a "frozen" computer, even though with patience
1490706f2543Smrg    # the test eventually succeeds (with a max line length of 256k).
1491706f2543Smrg    # Instead, let's just punt: use the minimum linelength reported by
1492706f2543Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
1493706f2543Smrg    lt_cv_sys_max_cmd_len=8192;
1494706f2543Smrg    ;;
1495706f2543Smrg
1496706f2543Smrg  mint*)
1497706f2543Smrg    # On MiNT this can take a long time and run out of memory.
1498706f2543Smrg    lt_cv_sys_max_cmd_len=8192;
1499706f2543Smrg    ;;
1500706f2543Smrg
1501706f2543Smrg  amigaos*)
1502706f2543Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
1503706f2543Smrg    # So we just punt and use a minimum line length of 8192.
1504706f2543Smrg    lt_cv_sys_max_cmd_len=8192;
1505706f2543Smrg    ;;
1506706f2543Smrg
1507706f2543Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1508706f2543Smrg    # This has been around since 386BSD, at least.  Likely further.
1509706f2543Smrg    if test -x /sbin/sysctl; then
1510706f2543Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1511706f2543Smrg    elif test -x /usr/sbin/sysctl; then
1512706f2543Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1513706f2543Smrg    else
1514706f2543Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1515706f2543Smrg    fi
1516706f2543Smrg    # And add a safety zone
1517706f2543Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1518706f2543Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1519706f2543Smrg    ;;
1520706f2543Smrg
1521706f2543Smrg  interix*)
1522706f2543Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1523706f2543Smrg    lt_cv_sys_max_cmd_len=196608
1524706f2543Smrg    ;;
1525706f2543Smrg
1526706f2543Smrg  osf*)
1527706f2543Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1528706f2543Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1529706f2543Smrg    # nice to cause kernel panics so lets avoid the loop below.
1530706f2543Smrg    # First set a reasonable default.
1531706f2543Smrg    lt_cv_sys_max_cmd_len=16384
1532706f2543Smrg    #
1533706f2543Smrg    if test -x /sbin/sysconfig; then
1534706f2543Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1535706f2543Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1536706f2543Smrg      esac
1537706f2543Smrg    fi
1538706f2543Smrg    ;;
1539706f2543Smrg  sco3.2v5*)
1540706f2543Smrg    lt_cv_sys_max_cmd_len=102400
1541706f2543Smrg    ;;
1542706f2543Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
1543706f2543Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1544706f2543Smrg    if test -n "$kargmax"; then
1545706f2543Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1546706f2543Smrg    else
1547706f2543Smrg      lt_cv_sys_max_cmd_len=32768
1548706f2543Smrg    fi
1549706f2543Smrg    ;;
1550706f2543Smrg  *)
1551706f2543Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1552706f2543Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
1553706f2543Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1554706f2543Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1555706f2543Smrg    else
1556706f2543Smrg      # Make teststring a little bigger before we do anything with it.
1557706f2543Smrg      # a 1K string should be a reasonable start.
1558706f2543Smrg      for i in 1 2 3 4 5 6 7 8 ; do
1559706f2543Smrg        teststring=$teststring$teststring
1560706f2543Smrg      done
1561706f2543Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1562706f2543Smrg      # If test is not a shell built-in, we'll probably end up computing a
1563706f2543Smrg      # maximum length that is only half of the actual maximum length, but
1564706f2543Smrg      # we can't tell.
1565706f2543Smrg      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
1566706f2543Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1567706f2543Smrg	      test $i != 17 # 1/2 MB should be enough
1568706f2543Smrg      do
1569706f2543Smrg        i=`expr $i + 1`
1570706f2543Smrg        teststring=$teststring$teststring
1571706f2543Smrg      done
1572706f2543Smrg      # Only check the string length outside the loop.
1573706f2543Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1574706f2543Smrg      teststring=
1575706f2543Smrg      # Add a significant safety factor because C++ compilers can tack on
1576706f2543Smrg      # massive amounts of additional arguments before passing them to the
1577706f2543Smrg      # linker.  It appears as though 1/2 is a usable value.
1578706f2543Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1579706f2543Smrg    fi
1580706f2543Smrg    ;;
1581706f2543Smrg  esac
1582706f2543Smrg])
1583706f2543Smrgif test -n $lt_cv_sys_max_cmd_len ; then
1584706f2543Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1585706f2543Smrgelse
1586706f2543Smrg  AC_MSG_RESULT(none)
1587706f2543Smrgfi
1588706f2543Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1589706f2543Smrg_LT_DECL([], [max_cmd_len], [0],
1590706f2543Smrg    [What is the maximum length of a command?])
1591706f2543Smrg])# LT_CMD_MAX_LEN
1592706f2543Smrg
1593706f2543Smrg# Old name:
1594706f2543SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1595706f2543Smrgdnl aclocal-1.4 backwards compatibility:
1596706f2543Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1597706f2543Smrg
1598706f2543Smrg
1599706f2543Smrg# _LT_HEADER_DLFCN
1600706f2543Smrg# ----------------
1601706f2543Smrgm4_defun([_LT_HEADER_DLFCN],
1602706f2543Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1603706f2543Smrg])# _LT_HEADER_DLFCN
1604706f2543Smrg
1605706f2543Smrg
1606706f2543Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1607706f2543Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1608706f2543Smrg# ----------------------------------------------------------------
1609706f2543Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
1610706f2543Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1611706f2543Smrgif test "$cross_compiling" = yes; then :
1612706f2543Smrg  [$4]
1613706f2543Smrgelse
1614706f2543Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1615706f2543Smrg  lt_status=$lt_dlunknown
1616706f2543Smrg  cat > conftest.$ac_ext <<_LT_EOF
1617706f2543Smrg[#line $LINENO "configure"
1618706f2543Smrg#include "confdefs.h"
1619706f2543Smrg
1620706f2543Smrg#if HAVE_DLFCN_H
1621706f2543Smrg#include <dlfcn.h>
1622706f2543Smrg#endif
1623706f2543Smrg
1624706f2543Smrg#include <stdio.h>
1625706f2543Smrg
1626706f2543Smrg#ifdef RTLD_GLOBAL
1627706f2543Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
1628706f2543Smrg#else
1629706f2543Smrg#  ifdef DL_GLOBAL
1630706f2543Smrg#    define LT_DLGLOBAL		DL_GLOBAL
1631706f2543Smrg#  else
1632706f2543Smrg#    define LT_DLGLOBAL		0
1633706f2543Smrg#  endif
1634706f2543Smrg#endif
1635706f2543Smrg
1636706f2543Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1637706f2543Smrg   find out it does not work in some platform. */
1638706f2543Smrg#ifndef LT_DLLAZY_OR_NOW
1639706f2543Smrg#  ifdef RTLD_LAZY
1640706f2543Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1641706f2543Smrg#  else
1642706f2543Smrg#    ifdef DL_LAZY
1643706f2543Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
1644706f2543Smrg#    else
1645706f2543Smrg#      ifdef RTLD_NOW
1646706f2543Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1647706f2543Smrg#      else
1648706f2543Smrg#        ifdef DL_NOW
1649706f2543Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
1650706f2543Smrg#        else
1651706f2543Smrg#          define LT_DLLAZY_OR_NOW	0
1652706f2543Smrg#        endif
1653706f2543Smrg#      endif
1654706f2543Smrg#    endif
1655706f2543Smrg#  endif
1656706f2543Smrg#endif
1657706f2543Smrg
1658706f2543Smrg/* When -fvisbility=hidden is used, assume the code has been annotated
1659706f2543Smrg   correspondingly for the symbols needed.  */
1660706f2543Smrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1661706f2543Smrgvoid fnord () __attribute__((visibility("default")));
1662706f2543Smrg#endif
1663706f2543Smrg
1664706f2543Smrgvoid fnord () { int i=42; }
1665706f2543Smrgint main ()
1666706f2543Smrg{
1667706f2543Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1668706f2543Smrg  int status = $lt_dlunknown;
1669706f2543Smrg
1670706f2543Smrg  if (self)
1671706f2543Smrg    {
1672706f2543Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1673706f2543Smrg      else
1674706f2543Smrg        {
1675706f2543Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
1676706f2543Smrg          else puts (dlerror ());
1677706f2543Smrg	}
1678706f2543Smrg      /* dlclose (self); */
1679706f2543Smrg    }
1680706f2543Smrg  else
1681706f2543Smrg    puts (dlerror ());
1682706f2543Smrg
1683706f2543Smrg  return status;
1684706f2543Smrg}]
1685706f2543Smrg_LT_EOF
1686706f2543Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1687706f2543Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1688706f2543Smrg    lt_status=$?
1689706f2543Smrg    case x$lt_status in
1690706f2543Smrg      x$lt_dlno_uscore) $1 ;;
1691706f2543Smrg      x$lt_dlneed_uscore) $2 ;;
1692706f2543Smrg      x$lt_dlunknown|x*) $3 ;;
1693706f2543Smrg    esac
1694706f2543Smrg  else :
1695706f2543Smrg    # compilation failed
1696706f2543Smrg    $3
1697706f2543Smrg  fi
1698706f2543Smrgfi
1699706f2543Smrgrm -fr conftest*
1700706f2543Smrg])# _LT_TRY_DLOPEN_SELF
1701706f2543Smrg
1702706f2543Smrg
1703706f2543Smrg# LT_SYS_DLOPEN_SELF
1704706f2543Smrg# ------------------
1705706f2543SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1706706f2543Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1707706f2543Smrgif test "x$enable_dlopen" != xyes; then
1708706f2543Smrg  enable_dlopen=unknown
1709706f2543Smrg  enable_dlopen_self=unknown
1710706f2543Smrg  enable_dlopen_self_static=unknown
1711706f2543Smrgelse
1712706f2543Smrg  lt_cv_dlopen=no
1713706f2543Smrg  lt_cv_dlopen_libs=
1714706f2543Smrg
1715706f2543Smrg  case $host_os in
1716706f2543Smrg  beos*)
1717706f2543Smrg    lt_cv_dlopen="load_add_on"
1718706f2543Smrg    lt_cv_dlopen_libs=
1719706f2543Smrg    lt_cv_dlopen_self=yes
1720706f2543Smrg    ;;
1721706f2543Smrg
1722706f2543Smrg  mingw* | pw32* | cegcc*)
1723706f2543Smrg    lt_cv_dlopen="LoadLibrary"
1724706f2543Smrg    lt_cv_dlopen_libs=
1725706f2543Smrg    ;;
1726706f2543Smrg
1727706f2543Smrg  cygwin*)
1728706f2543Smrg    lt_cv_dlopen="dlopen"
1729706f2543Smrg    lt_cv_dlopen_libs=
1730706f2543Smrg    ;;
1731706f2543Smrg
1732706f2543Smrg  darwin*)
1733706f2543Smrg  # if libdl is installed we need to link against it
1734706f2543Smrg    AC_CHECK_LIB([dl], [dlopen],
1735706f2543Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1736706f2543Smrg    lt_cv_dlopen="dyld"
1737706f2543Smrg    lt_cv_dlopen_libs=
1738706f2543Smrg    lt_cv_dlopen_self=yes
1739706f2543Smrg    ])
1740706f2543Smrg    ;;
1741706f2543Smrg
1742706f2543Smrg  *)
1743706f2543Smrg    AC_CHECK_FUNC([shl_load],
1744706f2543Smrg	  [lt_cv_dlopen="shl_load"],
1745706f2543Smrg      [AC_CHECK_LIB([dld], [shl_load],
1746706f2543Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1747706f2543Smrg	[AC_CHECK_FUNC([dlopen],
1748706f2543Smrg	      [lt_cv_dlopen="dlopen"],
1749706f2543Smrg	  [AC_CHECK_LIB([dl], [dlopen],
1750706f2543Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1751706f2543Smrg	    [AC_CHECK_LIB([svld], [dlopen],
1752706f2543Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1753706f2543Smrg	      [AC_CHECK_LIB([dld], [dld_link],
1754706f2543Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1755706f2543Smrg	      ])
1756706f2543Smrg	    ])
1757706f2543Smrg	  ])
1758706f2543Smrg	])
1759706f2543Smrg      ])
1760706f2543Smrg    ;;
1761706f2543Smrg  esac
1762706f2543Smrg
1763706f2543Smrg  if test "x$lt_cv_dlopen" != xno; then
1764706f2543Smrg    enable_dlopen=yes
1765706f2543Smrg  else
1766706f2543Smrg    enable_dlopen=no
1767706f2543Smrg  fi
1768706f2543Smrg
1769706f2543Smrg  case $lt_cv_dlopen in
1770706f2543Smrg  dlopen)
1771706f2543Smrg    save_CPPFLAGS="$CPPFLAGS"
1772706f2543Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1773706f2543Smrg
1774706f2543Smrg    save_LDFLAGS="$LDFLAGS"
1775706f2543Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1776706f2543Smrg
1777706f2543Smrg    save_LIBS="$LIBS"
1778706f2543Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
1779706f2543Smrg
1780706f2543Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
1781706f2543Smrg	  lt_cv_dlopen_self, [dnl
1782706f2543Smrg	  _LT_TRY_DLOPEN_SELF(
1783706f2543Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1784706f2543Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1785706f2543Smrg    ])
1786706f2543Smrg
1787706f2543Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
1788706f2543Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1789706f2543Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1790706f2543Smrg	  lt_cv_dlopen_self_static, [dnl
1791706f2543Smrg	  _LT_TRY_DLOPEN_SELF(
1792706f2543Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1793706f2543Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1794706f2543Smrg      ])
1795706f2543Smrg    fi
1796706f2543Smrg
1797706f2543Smrg    CPPFLAGS="$save_CPPFLAGS"
1798706f2543Smrg    LDFLAGS="$save_LDFLAGS"
1799706f2543Smrg    LIBS="$save_LIBS"
1800706f2543Smrg    ;;
1801706f2543Smrg  esac
1802706f2543Smrg
1803706f2543Smrg  case $lt_cv_dlopen_self in
1804706f2543Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1805706f2543Smrg  *) enable_dlopen_self=unknown ;;
1806706f2543Smrg  esac
1807706f2543Smrg
1808706f2543Smrg  case $lt_cv_dlopen_self_static in
1809706f2543Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1810706f2543Smrg  *) enable_dlopen_self_static=unknown ;;
1811706f2543Smrg  esac
1812706f2543Smrgfi
1813706f2543Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
1814706f2543Smrg	 [Whether dlopen is supported])
1815706f2543Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1816706f2543Smrg	 [Whether dlopen of programs is supported])
1817706f2543Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1818706f2543Smrg	 [Whether dlopen of statically linked programs is supported])
1819706f2543Smrg])# LT_SYS_DLOPEN_SELF
1820706f2543Smrg
1821706f2543Smrg# Old name:
1822706f2543SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1823706f2543Smrgdnl aclocal-1.4 backwards compatibility:
1824706f2543Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1825706f2543Smrg
1826706f2543Smrg
1827706f2543Smrg# _LT_COMPILER_C_O([TAGNAME])
1828706f2543Smrg# ---------------------------
1829706f2543Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
1830706f2543Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
1831706f2543Smrgm4_defun([_LT_COMPILER_C_O],
1832706f2543Smrg[m4_require([_LT_DECL_SED])dnl
1833706f2543Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1834706f2543Smrgm4_require([_LT_TAG_COMPILER])dnl
1835706f2543SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1836706f2543Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1837706f2543Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1838706f2543Smrg   $RM -r conftest 2>/dev/null
1839706f2543Smrg   mkdir conftest
1840706f2543Smrg   cd conftest
1841706f2543Smrg   mkdir out
1842706f2543Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1843706f2543Smrg
1844706f2543Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
1845706f2543Smrg   # Insert the option either (1) after the last *FLAGS variable, or
1846706f2543Smrg   # (2) before a word containing "conftest.", or (3) at the end.
1847706f2543Smrg   # Note that $ac_compile itself does not contain backslashes and begins
1848706f2543Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1849706f2543Smrg   lt_compile=`echo "$ac_compile" | $SED \
1850706f2543Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1851706f2543Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1852706f2543Smrg   -e 's:$: $lt_compiler_flag:'`
1853706f2543Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1854706f2543Smrg   (eval "$lt_compile" 2>out/conftest.err)
1855706f2543Smrg   ac_status=$?
1856706f2543Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
1857706f2543Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1858706f2543Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
1859706f2543Smrg   then
1860706f2543Smrg     # The compiler can only warn and ignore the option if not recognized
1861706f2543Smrg     # So say no if there are warnings
1862706f2543Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
1863706f2543Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
1864706f2543Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1865706f2543Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
1866706f2543Smrg     fi
1867706f2543Smrg   fi
1868706f2543Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
1869706f2543Smrg   $RM -r conftest*
1870706f2543Smrg   # SGI C++ compiler will create directory out/ii_files/ for
1871706f2543Smrg   # template instantiation
1872706f2543Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
1873706f2543Smrg   $RM out/* && rmdir out
1874706f2543Smrg   cd ..
1875706f2543Smrg   $RM -r conftest
1876706f2543Smrg   $RM -r conftest*
1877706f2543Smrg])
1878706f2543Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
1879706f2543Smrg	[Does compiler simultaneously support -c and -o options?])
1880706f2543Smrg])# _LT_COMPILER_C_O
1881706f2543Smrg
1882706f2543Smrg
1883706f2543Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
1884706f2543Smrg# ----------------------------------
1885706f2543Smrg# Check to see if we can do hard links to lock some files if needed
1886706f2543Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
1887706f2543Smrg[m4_require([_LT_ENABLE_LOCK])dnl
1888706f2543Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1889706f2543Smrg_LT_COMPILER_C_O([$1])
1890706f2543Smrg
1891706f2543Smrghard_links="nottested"
1892706f2543Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
1893706f2543Smrg  # do not overwrite the value of need_locks provided by the user
1894706f2543Smrg  AC_MSG_CHECKING([if we can lock with hard links])
1895706f2543Smrg  hard_links=yes
1896706f2543Smrg  $RM -r conftest*
1897706f2543Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1898706f2543Smrg  touch conftest.a
1899706f2543Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
1900706f2543Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1901706f2543Smrg  AC_MSG_RESULT([$hard_links])
1902706f2543Smrg  if test "$hard_links" = no; then
1903706f2543Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
1904706f2543Smrg    need_locks=warn
1905706f2543Smrg  fi
1906706f2543Smrgelse
1907706f2543Smrg  need_locks=no
1908706f2543Smrgfi
1909706f2543Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
1910706f2543Smrg])# _LT_COMPILER_FILE_LOCKS
1911706f2543Smrg
1912706f2543Smrg
1913706f2543Smrg# _LT_CHECK_OBJDIR
1914706f2543Smrg# ----------------
1915706f2543Smrgm4_defun([_LT_CHECK_OBJDIR],
1916706f2543Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1917706f2543Smrg[rm -f .libs 2>/dev/null
1918706f2543Smrgmkdir .libs 2>/dev/null
1919706f2543Smrgif test -d .libs; then
1920706f2543Smrg  lt_cv_objdir=.libs
1921706f2543Smrgelse
1922706f2543Smrg  # MS-DOS does not allow filenames that begin with a dot.
1923706f2543Smrg  lt_cv_objdir=_libs
1924706f2543Smrgfi
1925706f2543Smrgrmdir .libs 2>/dev/null])
1926706f2543Smrgobjdir=$lt_cv_objdir
1927706f2543Smrg_LT_DECL([], [objdir], [0],
1928706f2543Smrg         [The name of the directory that contains temporary libtool files])dnl
1929706f2543Smrgm4_pattern_allow([LT_OBJDIR])dnl
1930706f2543SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
1931706f2543Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
1932706f2543Smrg])# _LT_CHECK_OBJDIR
1933706f2543Smrg
1934706f2543Smrg
1935706f2543Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
1936706f2543Smrg# --------------------------------------
1937706f2543Smrg# Check hardcoding attributes.
1938706f2543Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
1939706f2543Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
1940706f2543Smrg_LT_TAGVAR(hardcode_action, $1)=
1941706f2543Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
1942706f2543Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
1943706f2543Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
1944706f2543Smrg
1945706f2543Smrg  # We can hardcode non-existent directories.
1946706f2543Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
1947706f2543Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
1948706f2543Smrg     # have to relink, otherwise we might link with an installed library
1949706f2543Smrg     # when we should be linking with a yet-to-be-installed one
1950706f2543Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1951706f2543Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
1952706f2543Smrg    # Linking always hardcodes the temporary library directory.
1953706f2543Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
1954706f2543Smrg  else
1955706f2543Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
1956706f2543Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
1957706f2543Smrg  fi
1958706f2543Smrgelse
1959706f2543Smrg  # We cannot hardcode anything, or else we can only hardcode existing
1960706f2543Smrg  # directories.
1961706f2543Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
1962706f2543Smrgfi
1963706f2543SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
1964706f2543Smrg
1965706f2543Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
1966706f2543Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
1967706f2543Smrg  # Fast installation is not supported
1968706f2543Smrg  enable_fast_install=no
1969706f2543Smrgelif test "$shlibpath_overrides_runpath" = yes ||
1970706f2543Smrg     test "$enable_shared" = no; then
1971706f2543Smrg  # Fast installation is not necessary
1972706f2543Smrg  enable_fast_install=needless
1973706f2543Smrgfi
1974706f2543Smrg_LT_TAGDECL([], [hardcode_action], [0],
1975706f2543Smrg    [How to hardcode a shared library path into an executable])
1976706f2543Smrg])# _LT_LINKER_HARDCODE_LIBPATH
1977706f2543Smrg
1978706f2543Smrg
1979706f2543Smrg# _LT_CMD_STRIPLIB
1980706f2543Smrg# ----------------
1981706f2543Smrgm4_defun([_LT_CMD_STRIPLIB],
1982706f2543Smrg[m4_require([_LT_DECL_EGREP])
1983706f2543Smrgstriplib=
1984706f2543Smrgold_striplib=
1985706f2543SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
1986706f2543Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
1987706f2543Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
1988706f2543Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
1989706f2543Smrg  AC_MSG_RESULT([yes])
1990706f2543Smrgelse
1991706f2543Smrg# FIXME - insert some real tests, host_os isn't really good enough
1992706f2543Smrg  case $host_os in
1993706f2543Smrg  darwin*)
1994706f2543Smrg    if test -n "$STRIP" ; then
1995706f2543Smrg      striplib="$STRIP -x"
1996706f2543Smrg      old_striplib="$STRIP -S"
1997706f2543Smrg      AC_MSG_RESULT([yes])
1998706f2543Smrg    else
1999706f2543Smrg      AC_MSG_RESULT([no])
2000706f2543Smrg    fi
2001706f2543Smrg    ;;
2002706f2543Smrg  *)
2003706f2543Smrg    AC_MSG_RESULT([no])
2004706f2543Smrg    ;;
2005706f2543Smrg  esac
2006706f2543Smrgfi
2007706f2543Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2008706f2543Smrg_LT_DECL([], [striplib], [1])
2009706f2543Smrg])# _LT_CMD_STRIPLIB
2010706f2543Smrg
2011706f2543Smrg
2012706f2543Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
2013706f2543Smrg# -----------------------------
2014706f2543Smrg# PORTME Fill in your ld.so characteristics
2015706f2543Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2016706f2543Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2017706f2543Smrgm4_require([_LT_DECL_EGREP])dnl
2018706f2543Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2019706f2543Smrgm4_require([_LT_DECL_OBJDUMP])dnl
2020706f2543Smrgm4_require([_LT_DECL_SED])dnl
2021706f2543Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2022706f2543SmrgAC_MSG_CHECKING([dynamic linker characteristics])
2023706f2543Smrgm4_if([$1],
2024706f2543Smrg	[], [
2025706f2543Smrgif test "$GCC" = yes; then
2026706f2543Smrg  case $host_os in
2027706f2543Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2028706f2543Smrg    *) lt_awk_arg="/^libraries:/" ;;
2029706f2543Smrg  esac
2030706f2543Smrg  case $host_os in
2031706f2543Smrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
2032706f2543Smrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
2033706f2543Smrg  esac
2034706f2543Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2035706f2543Smrg  case $lt_search_path_spec in
2036706f2543Smrg  *\;*)
2037706f2543Smrg    # if the path contains ";" then we assume it to be the separator
2038706f2543Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
2039706f2543Smrg    # assumed that no part of a normal pathname contains ";" but that should
2040706f2543Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
2041706f2543Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2042706f2543Smrg    ;;
2043706f2543Smrg  *)
2044706f2543Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2045706f2543Smrg    ;;
2046706f2543Smrg  esac
2047706f2543Smrg  # Ok, now we have the path, separated by spaces, we can step through it
2048706f2543Smrg  # and add multilib dir if necessary.
2049706f2543Smrg  lt_tmp_lt_search_path_spec=
2050706f2543Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2051706f2543Smrg  for lt_sys_path in $lt_search_path_spec; do
2052706f2543Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2053706f2543Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2054706f2543Smrg    else
2055706f2543Smrg      test -d "$lt_sys_path" && \
2056706f2543Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2057706f2543Smrg    fi
2058706f2543Smrg  done
2059706f2543Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2060706f2543SmrgBEGIN {RS=" "; FS="/|\n";} {
2061706f2543Smrg  lt_foo="";
2062706f2543Smrg  lt_count=0;
2063706f2543Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
2064706f2543Smrg    if ($lt_i != "" && $lt_i != ".") {
2065706f2543Smrg      if ($lt_i == "..") {
2066706f2543Smrg        lt_count++;
2067706f2543Smrg      } else {
2068706f2543Smrg        if (lt_count == 0) {
2069706f2543Smrg          lt_foo="/" $lt_i lt_foo;
2070706f2543Smrg        } else {
2071706f2543Smrg          lt_count--;
2072706f2543Smrg        }
2073706f2543Smrg      }
2074706f2543Smrg    }
2075706f2543Smrg  }
2076706f2543Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2077706f2543Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2078706f2543Smrg}'`
2079706f2543Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
2080706f2543Smrg  # for these hosts.
2081706f2543Smrg  case $host_os in
2082706f2543Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2083706f2543Smrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
2084706f2543Smrg  esac
2085706f2543Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2086706f2543Smrgelse
2087706f2543Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2088706f2543Smrgfi])
2089706f2543Smrglibrary_names_spec=
2090706f2543Smrglibname_spec='lib$name'
2091706f2543Smrgsoname_spec=
2092706f2543Smrgshrext_cmds=".so"
2093706f2543Smrgpostinstall_cmds=
2094706f2543Smrgpostuninstall_cmds=
2095706f2543Smrgfinish_cmds=
2096706f2543Smrgfinish_eval=
2097706f2543Smrgshlibpath_var=
2098706f2543Smrgshlibpath_overrides_runpath=unknown
2099706f2543Smrgversion_type=none
2100706f2543Smrgdynamic_linker="$host_os ld.so"
2101706f2543Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
2102706f2543Smrgneed_lib_prefix=unknown
2103706f2543Smrghardcode_into_libs=no
2104706f2543Smrg
2105706f2543Smrg# when you set need_version to no, make sure it does not cause -set_version
2106706f2543Smrg# flags to be left without arguments
2107706f2543Smrgneed_version=unknown
2108706f2543Smrg
2109706f2543Smrgcase $host_os in
2110706f2543Smrgaix3*)
2111706f2543Smrg  version_type=linux
2112706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2113706f2543Smrg  shlibpath_var=LIBPATH
2114706f2543Smrg
2115706f2543Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
2116706f2543Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2117706f2543Smrg  ;;
2118706f2543Smrg
2119706f2543Smrgaix[[4-9]]*)
2120706f2543Smrg  version_type=linux
2121706f2543Smrg  need_lib_prefix=no
2122706f2543Smrg  need_version=no
2123706f2543Smrg  hardcode_into_libs=yes
2124706f2543Smrg  if test "$host_cpu" = ia64; then
2125706f2543Smrg    # AIX 5 supports IA64
2126706f2543Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2127706f2543Smrg    shlibpath_var=LD_LIBRARY_PATH
2128706f2543Smrg  else
2129706f2543Smrg    # With GCC up to 2.95.x, collect2 would create an import file
2130706f2543Smrg    # for dependence libraries.  The import file would start with
2131706f2543Smrg    # the line `#! .'.  This would cause the generated library to
2132706f2543Smrg    # depend on `.', always an invalid library.  This was fixed in
2133706f2543Smrg    # development snapshots of GCC prior to 3.0.
2134706f2543Smrg    case $host_os in
2135706f2543Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
2136706f2543Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2137706f2543Smrg	   echo ' yes '
2138706f2543Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2139706f2543Smrg	:
2140706f2543Smrg      else
2141706f2543Smrg	can_build_shared=no
2142706f2543Smrg      fi
2143706f2543Smrg      ;;
2144706f2543Smrg    esac
2145706f2543Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2146706f2543Smrg    # soname into executable. Probably we can add versioning support to
2147706f2543Smrg    # collect2, so additional links can be useful in future.
2148706f2543Smrg    if test "$aix_use_runtimelinking" = yes; then
2149706f2543Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2150706f2543Smrg      # instead of lib<name>.a to let people know that these are not
2151706f2543Smrg      # typical AIX shared libraries.
2152706f2543Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2153706f2543Smrg    else
2154706f2543Smrg      # We preserve .a as extension for shared libraries through AIX4.2
2155706f2543Smrg      # and later when we are not doing run time linking.
2156706f2543Smrg      library_names_spec='${libname}${release}.a $libname.a'
2157706f2543Smrg      soname_spec='${libname}${release}${shared_ext}$major'
2158706f2543Smrg    fi
2159706f2543Smrg    shlibpath_var=LIBPATH
2160706f2543Smrg  fi
2161706f2543Smrg  ;;
2162706f2543Smrg
2163706f2543Smrgamigaos*)
2164706f2543Smrg  case $host_cpu in
2165706f2543Smrg  powerpc)
2166706f2543Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2167706f2543Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2168706f2543Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2169706f2543Smrg    ;;
2170706f2543Smrg  m68k)
2171706f2543Smrg    library_names_spec='$libname.ixlibrary $libname.a'
2172706f2543Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2173706f2543Smrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2174706f2543Smrg    ;;
2175706f2543Smrg  esac
2176706f2543Smrg  ;;
2177706f2543Smrg
2178706f2543Smrgbeos*)
2179706f2543Smrg  library_names_spec='${libname}${shared_ext}'
2180706f2543Smrg  dynamic_linker="$host_os ld.so"
2181706f2543Smrg  shlibpath_var=LIBRARY_PATH
2182706f2543Smrg  ;;
2183706f2543Smrg
2184706f2543Smrgbsdi[[45]]*)
2185706f2543Smrg  version_type=linux
2186706f2543Smrg  need_version=no
2187706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2188706f2543Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2189706f2543Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2190706f2543Smrg  shlibpath_var=LD_LIBRARY_PATH
2191706f2543Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2192706f2543Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2193706f2543Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
2194706f2543Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2195706f2543Smrg  # libtool to hard-code these into programs
2196706f2543Smrg  ;;
2197706f2543Smrg
2198706f2543Smrgcygwin* | mingw* | pw32* | cegcc*)
2199706f2543Smrg  version_type=windows
2200706f2543Smrg  shrext_cmds=".dll"
2201706f2543Smrg  need_version=no
2202706f2543Smrg  need_lib_prefix=no
2203706f2543Smrg
2204706f2543Smrg  case $GCC,$host_os in
2205706f2543Smrg  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
2206706f2543Smrg    library_names_spec='$libname.dll.a'
2207706f2543Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2208706f2543Smrg    postinstall_cmds='base_file=`basename \${file}`~
2209706f2543Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2210706f2543Smrg      dldir=$destdir/`dirname \$dlpath`~
2211706f2543Smrg      test -d \$dldir || mkdir -p \$dldir~
2212706f2543Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
2213706f2543Smrg      chmod a+x \$dldir/$dlname~
2214706f2543Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2215706f2543Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2216706f2543Smrg      fi'
2217706f2543Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2218706f2543Smrg      dlpath=$dir/\$dldll~
2219706f2543Smrg       $RM \$dlpath'
2220706f2543Smrg    shlibpath_overrides_runpath=yes
2221706f2543Smrg
2222706f2543Smrg    case $host_os in
2223706f2543Smrg    cygwin*)
2224706f2543Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2225706f2543Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2226706f2543Smrgm4_if([$1], [],[
2227706f2543Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2228706f2543Smrg      ;;
2229706f2543Smrg    mingw* | cegcc*)
2230706f2543Smrg      # MinGW DLLs use traditional 'lib' prefix
2231706f2543Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2232706f2543Smrg      ;;
2233706f2543Smrg    pw32*)
2234706f2543Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2235706f2543Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2236706f2543Smrg      ;;
2237706f2543Smrg    esac
2238706f2543Smrg    ;;
2239706f2543Smrg
2240706f2543Smrg  *)
2241706f2543Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2242706f2543Smrg    ;;
2243706f2543Smrg  esac
2244706f2543Smrg  dynamic_linker='Win32 ld.exe'
2245706f2543Smrg  # FIXME: first we should search . and the directory the executable is in
2246706f2543Smrg  shlibpath_var=PATH
2247706f2543Smrg  ;;
2248706f2543Smrg
2249706f2543Smrgdarwin* | rhapsody*)
2250706f2543Smrg  dynamic_linker="$host_os dyld"
2251706f2543Smrg  version_type=darwin
2252706f2543Smrg  need_lib_prefix=no
2253706f2543Smrg  need_version=no
2254706f2543Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext'
2255706f2543Smrg  soname_spec='${libname}${release}${major}$shared_ext'
2256706f2543Smrg  shlibpath_overrides_runpath=yes
2257706f2543Smrg  shlibpath_var=DYLD_LIBRARY_PATH
2258706f2543Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2259706f2543Smrgm4_if([$1], [],[
2260706f2543Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2261706f2543Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2262706f2543Smrg  ;;
2263706f2543Smrg
2264706f2543Smrgdgux*)
2265706f2543Smrg  version_type=linux
2266706f2543Smrg  need_lib_prefix=no
2267706f2543Smrg  need_version=no
2268706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2269706f2543Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2270706f2543Smrg  shlibpath_var=LD_LIBRARY_PATH
2271706f2543Smrg  ;;
2272706f2543Smrg
2273706f2543Smrgfreebsd1*)
2274706f2543Smrg  dynamic_linker=no
2275706f2543Smrg  ;;
2276706f2543Smrg
2277706f2543Smrgfreebsd* | dragonfly*)
2278706f2543Smrg  # DragonFly does not have aout.  When/if they implement a new
2279706f2543Smrg  # versioning mechanism, adjust this.
2280706f2543Smrg  if test -x /usr/bin/objformat; then
2281706f2543Smrg    objformat=`/usr/bin/objformat`
2282706f2543Smrg  else
2283706f2543Smrg    case $host_os in
2284706f2543Smrg    freebsd[[123]]*) objformat=aout ;;
2285706f2543Smrg    *) objformat=elf ;;
2286706f2543Smrg    esac
2287706f2543Smrg  fi
2288706f2543Smrg  version_type=freebsd-$objformat
2289706f2543Smrg  case $version_type in
2290706f2543Smrg    freebsd-elf*)
2291706f2543Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2292706f2543Smrg      need_version=no
2293706f2543Smrg      need_lib_prefix=no
2294706f2543Smrg      ;;
2295706f2543Smrg    freebsd-*)
2296706f2543Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2297706f2543Smrg      need_version=yes
2298706f2543Smrg      ;;
2299706f2543Smrg  esac
2300706f2543Smrg  shlibpath_var=LD_LIBRARY_PATH
2301706f2543Smrg  case $host_os in
2302706f2543Smrg  freebsd2*)
2303706f2543Smrg    shlibpath_overrides_runpath=yes
2304706f2543Smrg    ;;
2305706f2543Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2306706f2543Smrg    shlibpath_overrides_runpath=yes
2307706f2543Smrg    hardcode_into_libs=yes
2308706f2543Smrg    ;;
2309706f2543Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2310706f2543Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2311706f2543Smrg    shlibpath_overrides_runpath=no
2312706f2543Smrg    hardcode_into_libs=yes
2313706f2543Smrg    ;;
2314706f2543Smrg  *) # from 4.6 on, and DragonFly
2315706f2543Smrg    shlibpath_overrides_runpath=yes
2316706f2543Smrg    hardcode_into_libs=yes
2317706f2543Smrg    ;;
2318706f2543Smrg  esac
2319706f2543Smrg  ;;
2320706f2543Smrg
2321706f2543Smrggnu*)
2322706f2543Smrg  version_type=linux
2323706f2543Smrg  need_lib_prefix=no
2324706f2543Smrg  need_version=no
2325706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2326706f2543Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2327706f2543Smrg  shlibpath_var=LD_LIBRARY_PATH
2328706f2543Smrg  hardcode_into_libs=yes
2329706f2543Smrg  ;;
2330706f2543Smrg
2331706f2543Smrghaiku*)
2332706f2543Smrg  version_type=linux
2333706f2543Smrg  need_lib_prefix=no
2334706f2543Smrg  need_version=no
2335706f2543Smrg  dynamic_linker="$host_os runtime_loader"
2336706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2337706f2543Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2338706f2543Smrg  shlibpath_var=LIBRARY_PATH
2339706f2543Smrg  shlibpath_overrides_runpath=yes
2340706f2543Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2341706f2543Smrg  hardcode_into_libs=yes
2342706f2543Smrg  ;;
2343706f2543Smrg
2344706f2543Smrghpux9* | hpux10* | hpux11*)
2345706f2543Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
2346706f2543Smrg  # link against other versions.
2347706f2543Smrg  version_type=sunos
2348706f2543Smrg  need_lib_prefix=no
2349706f2543Smrg  need_version=no
2350706f2543Smrg  case $host_cpu in
2351706f2543Smrg  ia64*)
2352706f2543Smrg    shrext_cmds='.so'
2353706f2543Smrg    hardcode_into_libs=yes
2354706f2543Smrg    dynamic_linker="$host_os dld.so"
2355706f2543Smrg    shlibpath_var=LD_LIBRARY_PATH
2356706f2543Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2357706f2543Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2358706f2543Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2359706f2543Smrg    if test "X$HPUX_IA64_MODE" = X32; then
2360706f2543Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2361706f2543Smrg    else
2362706f2543Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2363706f2543Smrg    fi
2364706f2543Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2365706f2543Smrg    ;;
2366706f2543Smrg  hppa*64*)
2367706f2543Smrg    shrext_cmds='.sl'
2368706f2543Smrg    hardcode_into_libs=yes
2369706f2543Smrg    dynamic_linker="$host_os dld.sl"
2370706f2543Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2371706f2543Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2372706f2543Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2373706f2543Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2374706f2543Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2375706f2543Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2376706f2543Smrg    ;;
2377706f2543Smrg  *)
2378706f2543Smrg    shrext_cmds='.sl'
2379706f2543Smrg    dynamic_linker="$host_os dld.sl"
2380706f2543Smrg    shlibpath_var=SHLIB_PATH
2381706f2543Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2382706f2543Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2383706f2543Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2384706f2543Smrg    ;;
2385706f2543Smrg  esac
2386706f2543Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2387706f2543Smrg  postinstall_cmds='chmod 555 $lib'
2388706f2543Smrg  # or fails outright, so override atomically:
2389706f2543Smrg  install_override_mode=555
2390706f2543Smrg  ;;
2391706f2543Smrg
2392706f2543Smrginterix[[3-9]]*)
2393706f2543Smrg  version_type=linux
2394706f2543Smrg  need_lib_prefix=no
2395706f2543Smrg  need_version=no
2396706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2397706f2543Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2398706f2543Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2399706f2543Smrg  shlibpath_var=LD_LIBRARY_PATH
2400706f2543Smrg  shlibpath_overrides_runpath=no
2401706f2543Smrg  hardcode_into_libs=yes
2402706f2543Smrg  ;;
2403706f2543Smrg
2404706f2543Smrgirix5* | irix6* | nonstopux*)
2405706f2543Smrg  case $host_os in
2406706f2543Smrg    nonstopux*) version_type=nonstopux ;;
2407706f2543Smrg    *)
2408706f2543Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
2409706f2543Smrg		version_type=linux
2410706f2543Smrg	else
2411706f2543Smrg		version_type=irix
2412706f2543Smrg	fi ;;
2413706f2543Smrg  esac
2414706f2543Smrg  need_lib_prefix=no
2415706f2543Smrg  need_version=no
2416706f2543Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2417706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2418706f2543Smrg  case $host_os in
2419706f2543Smrg  irix5* | nonstopux*)
2420706f2543Smrg    libsuff= shlibsuff=
2421706f2543Smrg    ;;
2422706f2543Smrg  *)
2423706f2543Smrg    case $LD in # libtool.m4 will add one of these switches to LD
2424706f2543Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2425706f2543Smrg      libsuff= shlibsuff= libmagic=32-bit;;
2426706f2543Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2427706f2543Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
2428706f2543Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2429706f2543Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2430706f2543Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
2431706f2543Smrg    esac
2432706f2543Smrg    ;;
2433706f2543Smrg  esac
2434706f2543Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2435706f2543Smrg  shlibpath_overrides_runpath=no
2436706f2543Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2437706f2543Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2438706f2543Smrg  hardcode_into_libs=yes
2439706f2543Smrg  ;;
2440706f2543Smrg
2441706f2543Smrg# No shared lib support for Linux oldld, aout, or coff.
2442706f2543Smrglinux*oldld* | linux*aout* | linux*coff*)
2443706f2543Smrg  dynamic_linker=no
2444706f2543Smrg  ;;
2445706f2543Smrg
2446706f2543Smrg# This must be Linux ELF.
2447706f2543Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
2448706f2543Smrg  version_type=linux
2449706f2543Smrg  need_lib_prefix=no
2450706f2543Smrg  need_version=no
2451706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2452706f2543Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2453706f2543Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2454706f2543Smrg  shlibpath_var=LD_LIBRARY_PATH
2455706f2543Smrg  shlibpath_overrides_runpath=no
2456706f2543Smrg
2457706f2543Smrg  # Some binutils ld are patched to set DT_RUNPATH
2458706f2543Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2459706f2543Smrg    [lt_cv_shlibpath_overrides_runpath=no
2460706f2543Smrg    save_LDFLAGS=$LDFLAGS
2461706f2543Smrg    save_libdir=$libdir
2462706f2543Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2463706f2543Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2464706f2543Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2465706f2543Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2466706f2543Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
2467706f2543Smrg    LDFLAGS=$save_LDFLAGS
2468706f2543Smrg    libdir=$save_libdir
2469706f2543Smrg    ])
2470706f2543Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2471706f2543Smrg
2472706f2543Smrg  # This implies no fast_install, which is unacceptable.
2473706f2543Smrg  # Some rework will be needed to allow for fast_install
2474706f2543Smrg  # before this can be enabled.
2475706f2543Smrg  hardcode_into_libs=yes
2476706f2543Smrg
2477706f2543Smrg  # Append ld.so.conf contents to the search path
2478706f2543Smrg  if test -f /etc/ld.so.conf; then
2479706f2543Smrg    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' ' '`
2480706f2543Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2481706f2543Smrg  fi
2482706f2543Smrg
2483706f2543Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2484706f2543Smrg  # powerpc, because MkLinux only supported shared libraries with the
2485706f2543Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2486706f2543Smrg  # most powerpc-linux boxes support dynamic linking these days and
2487706f2543Smrg  # people can always --disable-shared, the test was removed, and we
2488706f2543Smrg  # assume the GNU/Linux dynamic linker is in use.
2489706f2543Smrg  dynamic_linker='GNU/Linux ld.so'
2490706f2543Smrg  ;;
2491706f2543Smrg
2492706f2543Smrgnetbsd*)
2493706f2543Smrg  version_type=sunos
2494706f2543Smrg  need_lib_prefix=no
2495706f2543Smrg  need_version=no
2496706f2543Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2497706f2543Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2498706f2543Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2499706f2543Smrg    dynamic_linker='NetBSD (a.out) ld.so'
2500706f2543Smrg  else
2501706f2543Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2502706f2543Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2503706f2543Smrg    dynamic_linker='NetBSD ld.elf_so'
2504706f2543Smrg  fi
2505706f2543Smrg  shlibpath_var=LD_LIBRARY_PATH
2506706f2543Smrg  shlibpath_overrides_runpath=yes
2507706f2543Smrg  hardcode_into_libs=yes
2508706f2543Smrg  ;;
2509706f2543Smrg
2510706f2543Smrgnewsos6)
2511706f2543Smrg  version_type=linux
2512706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2513706f2543Smrg  shlibpath_var=LD_LIBRARY_PATH
2514706f2543Smrg  shlibpath_overrides_runpath=yes
2515706f2543Smrg  ;;
2516706f2543Smrg
2517706f2543Smrg*nto* | *qnx*)
2518706f2543Smrg  version_type=qnx
2519706f2543Smrg  need_lib_prefix=no
2520706f2543Smrg  need_version=no
2521706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2522706f2543Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2523706f2543Smrg  shlibpath_var=LD_LIBRARY_PATH
2524706f2543Smrg  shlibpath_overrides_runpath=no
2525706f2543Smrg  hardcode_into_libs=yes
2526706f2543Smrg  dynamic_linker='ldqnx.so'
2527706f2543Smrg  ;;
2528706f2543Smrg
2529706f2543Smrgopenbsd*)
2530706f2543Smrg  version_type=sunos
2531706f2543Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
2532706f2543Smrg  need_lib_prefix=no
2533706f2543Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2534706f2543Smrg  case $host_os in
2535706f2543Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
2536706f2543Smrg    *)				need_version=no  ;;
2537706f2543Smrg  esac
2538706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2539706f2543Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2540706f2543Smrg  shlibpath_var=LD_LIBRARY_PATH
2541706f2543Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2542706f2543Smrg    case $host_os in
2543706f2543Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
2544706f2543Smrg	shlibpath_overrides_runpath=no
2545706f2543Smrg	;;
2546706f2543Smrg      *)
2547706f2543Smrg	shlibpath_overrides_runpath=yes
2548706f2543Smrg	;;
2549706f2543Smrg      esac
2550706f2543Smrg  else
2551706f2543Smrg    shlibpath_overrides_runpath=yes
2552706f2543Smrg  fi
2553706f2543Smrg  ;;
2554706f2543Smrg
2555706f2543Smrgos2*)
2556706f2543Smrg  libname_spec='$name'
2557706f2543Smrg  shrext_cmds=".dll"
2558706f2543Smrg  need_lib_prefix=no
2559706f2543Smrg  library_names_spec='$libname${shared_ext} $libname.a'
2560706f2543Smrg  dynamic_linker='OS/2 ld.exe'
2561706f2543Smrg  shlibpath_var=LIBPATH
2562706f2543Smrg  ;;
2563706f2543Smrg
2564706f2543Smrgosf3* | osf4* | osf5*)
2565706f2543Smrg  version_type=osf
2566706f2543Smrg  need_lib_prefix=no
2567706f2543Smrg  need_version=no
2568706f2543Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2569706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2570706f2543Smrg  shlibpath_var=LD_LIBRARY_PATH
2571706f2543Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2572706f2543Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2573706f2543Smrg  ;;
2574706f2543Smrg
2575706f2543Smrgrdos*)
2576706f2543Smrg  dynamic_linker=no
2577706f2543Smrg  ;;
2578706f2543Smrg
2579706f2543Smrgsolaris*)
2580706f2543Smrg  version_type=linux
2581706f2543Smrg  need_lib_prefix=no
2582706f2543Smrg  need_version=no
2583706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2584706f2543Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2585706f2543Smrg  shlibpath_var=LD_LIBRARY_PATH
2586706f2543Smrg  shlibpath_overrides_runpath=yes
2587706f2543Smrg  hardcode_into_libs=yes
2588706f2543Smrg  # ldd complains unless libraries are executable
2589706f2543Smrg  postinstall_cmds='chmod +x $lib'
2590706f2543Smrg  ;;
2591706f2543Smrg
2592706f2543Smrgsunos4*)
2593706f2543Smrg  version_type=sunos
2594706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2595706f2543Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2596706f2543Smrg  shlibpath_var=LD_LIBRARY_PATH
2597706f2543Smrg  shlibpath_overrides_runpath=yes
2598706f2543Smrg  if test "$with_gnu_ld" = yes; then
2599706f2543Smrg    need_lib_prefix=no
2600706f2543Smrg  fi
2601706f2543Smrg  need_version=yes
2602706f2543Smrg  ;;
2603706f2543Smrg
2604706f2543Smrgsysv4 | sysv4.3*)
2605706f2543Smrg  version_type=linux
2606706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2607706f2543Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2608706f2543Smrg  shlibpath_var=LD_LIBRARY_PATH
2609706f2543Smrg  case $host_vendor in
2610706f2543Smrg    sni)
2611706f2543Smrg      shlibpath_overrides_runpath=no
2612706f2543Smrg      need_lib_prefix=no
2613706f2543Smrg      runpath_var=LD_RUN_PATH
2614706f2543Smrg      ;;
2615706f2543Smrg    siemens)
2616706f2543Smrg      need_lib_prefix=no
2617706f2543Smrg      ;;
2618706f2543Smrg    motorola)
2619706f2543Smrg      need_lib_prefix=no
2620706f2543Smrg      need_version=no
2621706f2543Smrg      shlibpath_overrides_runpath=no
2622706f2543Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2623706f2543Smrg      ;;
2624706f2543Smrg  esac
2625706f2543Smrg  ;;
2626706f2543Smrg
2627706f2543Smrgsysv4*MP*)
2628706f2543Smrg  if test -d /usr/nec ;then
2629706f2543Smrg    version_type=linux
2630706f2543Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2631706f2543Smrg    soname_spec='$libname${shared_ext}.$major'
2632706f2543Smrg    shlibpath_var=LD_LIBRARY_PATH
2633706f2543Smrg  fi
2634706f2543Smrg  ;;
2635706f2543Smrg
2636706f2543Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2637706f2543Smrg  version_type=freebsd-elf
2638706f2543Smrg  need_lib_prefix=no
2639706f2543Smrg  need_version=no
2640706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2641706f2543Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2642706f2543Smrg  shlibpath_var=LD_LIBRARY_PATH
2643706f2543Smrg  shlibpath_overrides_runpath=yes
2644706f2543Smrg  hardcode_into_libs=yes
2645706f2543Smrg  if test "$with_gnu_ld" = yes; then
2646706f2543Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2647706f2543Smrg  else
2648706f2543Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2649706f2543Smrg    case $host_os in
2650706f2543Smrg      sco3.2v5*)
2651706f2543Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2652706f2543Smrg	;;
2653706f2543Smrg    esac
2654706f2543Smrg  fi
2655706f2543Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
2656706f2543Smrg  ;;
2657706f2543Smrg
2658706f2543Smrgtpf*)
2659706f2543Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
2660706f2543Smrg  version_type=linux
2661706f2543Smrg  need_lib_prefix=no
2662706f2543Smrg  need_version=no
2663706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2664706f2543Smrg  shlibpath_var=LD_LIBRARY_PATH
2665706f2543Smrg  shlibpath_overrides_runpath=no
2666706f2543Smrg  hardcode_into_libs=yes
2667706f2543Smrg  ;;
2668706f2543Smrg
2669706f2543Smrguts4*)
2670706f2543Smrg  version_type=linux
2671706f2543Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2672706f2543Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2673706f2543Smrg  shlibpath_var=LD_LIBRARY_PATH
2674706f2543Smrg  ;;
2675706f2543Smrg
2676706f2543Smrg*)
2677706f2543Smrg  dynamic_linker=no
2678706f2543Smrg  ;;
2679706f2543Smrgesac
2680706f2543SmrgAC_MSG_RESULT([$dynamic_linker])
2681706f2543Smrgtest "$dynamic_linker" = no && can_build_shared=no
2682706f2543Smrg
2683706f2543Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2684706f2543Smrgif test "$GCC" = yes; then
2685706f2543Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2686706f2543Smrgfi
2687706f2543Smrg
2688706f2543Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2689706f2543Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2690706f2543Smrgfi
2691706f2543Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2692706f2543Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2693706f2543Smrgfi
2694706f2543Smrg
2695706f2543Smrg_LT_DECL([], [variables_saved_for_relink], [1],
2696706f2543Smrg    [Variables whose values should be saved in libtool wrapper scripts and
2697706f2543Smrg    restored at link time])
2698706f2543Smrg_LT_DECL([], [need_lib_prefix], [0],
2699706f2543Smrg    [Do we need the "lib" prefix for modules?])
2700706f2543Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2701706f2543Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
2702706f2543Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
2703706f2543Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2704706f2543Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
2705706f2543Smrg    [Is shlibpath searched before the hard-coded library search path?])
2706706f2543Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2707706f2543Smrg_LT_DECL([], [library_names_spec], [1],
2708706f2543Smrg    [[List of archive names.  First name is the real one, the rest are links.
2709706f2543Smrg    The last name is the one that the linker finds with -lNAME]])
2710706f2543Smrg_LT_DECL([], [soname_spec], [1],
2711706f2543Smrg    [[The coded name of the library, if different from the real name]])
2712706f2543Smrg_LT_DECL([], [install_override_mode], [1],
2713706f2543Smrg    [Permission mode override for installation of shared libraries])
2714706f2543Smrg_LT_DECL([], [postinstall_cmds], [2],
2715706f2543Smrg    [Command to use after installation of a shared archive])
2716706f2543Smrg_LT_DECL([], [postuninstall_cmds], [2],
2717706f2543Smrg    [Command to use after uninstallation of a shared archive])
2718706f2543Smrg_LT_DECL([], [finish_cmds], [2],
2719706f2543Smrg    [Commands used to finish a libtool library installation in a directory])
2720706f2543Smrg_LT_DECL([], [finish_eval], [1],
2721706f2543Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
2722706f2543Smrg    not shown]])
2723706f2543Smrg_LT_DECL([], [hardcode_into_libs], [0],
2724706f2543Smrg    [Whether we should hardcode library paths into libraries])
2725706f2543Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
2726706f2543Smrg    [Compile-time system search path for libraries])
2727706f2543Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2728706f2543Smrg    [Run-time system search path for libraries])
2729706f2543Smrg])# _LT_SYS_DYNAMIC_LINKER
2730706f2543Smrg
2731706f2543Smrg
2732706f2543Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
2733706f2543Smrg# --------------------------
2734706f2543Smrg# find a file program which can recognize shared library
2735706f2543SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
2736706f2543Smrg[m4_require([_LT_DECL_EGREP])dnl
2737706f2543SmrgAC_MSG_CHECKING([for $1])
2738706f2543SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2739706f2543Smrg[case $MAGIC_CMD in
2740706f2543Smrg[[\\/*] |  ?:[\\/]*])
2741706f2543Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2742706f2543Smrg  ;;
2743706f2543Smrg*)
2744706f2543Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
2745706f2543Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2746706f2543Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
2747706f2543Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
2748706f2543Smrgdnl not every word.  This closes a longstanding sh security hole.
2749706f2543Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
2750706f2543Smrg  for ac_dir in $ac_dummy; do
2751706f2543Smrg    IFS="$lt_save_ifs"
2752706f2543Smrg    test -z "$ac_dir" && ac_dir=.
2753706f2543Smrg    if test -f $ac_dir/$1; then
2754706f2543Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2755706f2543Smrg      if test -n "$file_magic_test_file"; then
2756706f2543Smrg	case $deplibs_check_method in
2757706f2543Smrg	"file_magic "*)
2758706f2543Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2759706f2543Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2760706f2543Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2761706f2543Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
2762706f2543Smrg	    :
2763706f2543Smrg	  else
2764706f2543Smrg	    cat <<_LT_EOF 1>&2
2765706f2543Smrg
2766706f2543Smrg*** Warning: the command libtool uses to detect shared libraries,
2767706f2543Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
2768706f2543Smrg*** The result is that libtool may fail to recognize shared libraries
2769706f2543Smrg*** as such.  This will affect the creation of libtool libraries that
2770706f2543Smrg*** depend on shared libraries, but programs linked with such libtool
2771706f2543Smrg*** libraries will work regardless of this problem.  Nevertheless, you
2772706f2543Smrg*** may want to report the problem to your system manager and/or to
2773706f2543Smrg*** bug-libtool@gnu.org
2774706f2543Smrg
2775706f2543Smrg_LT_EOF
2776706f2543Smrg	  fi ;;
2777706f2543Smrg	esac
2778706f2543Smrg      fi
2779706f2543Smrg      break
2780706f2543Smrg    fi
2781706f2543Smrg  done
2782706f2543Smrg  IFS="$lt_save_ifs"
2783706f2543Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
2784706f2543Smrg  ;;
2785706f2543Smrgesac])
2786706f2543SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2787706f2543Smrgif test -n "$MAGIC_CMD"; then
2788706f2543Smrg  AC_MSG_RESULT($MAGIC_CMD)
2789706f2543Smrgelse
2790706f2543Smrg  AC_MSG_RESULT(no)
2791706f2543Smrgfi
2792706f2543Smrg_LT_DECL([], [MAGIC_CMD], [0],
2793706f2543Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
2794706f2543Smrg])# _LT_PATH_TOOL_PREFIX
2795706f2543Smrg
2796706f2543Smrg# Old name:
2797706f2543SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
2798706f2543Smrgdnl aclocal-1.4 backwards compatibility:
2799706f2543Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
2800706f2543Smrg
2801706f2543Smrg
2802706f2543Smrg# _LT_PATH_MAGIC
2803706f2543Smrg# --------------
2804706f2543Smrg# find a file program which can recognize a shared library
2805706f2543Smrgm4_defun([_LT_PATH_MAGIC],
2806706f2543Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
2807706f2543Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
2808706f2543Smrg  if test -n "$ac_tool_prefix"; then
2809706f2543Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
2810706f2543Smrg  else
2811706f2543Smrg    MAGIC_CMD=:
2812706f2543Smrg  fi
2813706f2543Smrgfi
2814706f2543Smrg])# _LT_PATH_MAGIC
2815706f2543Smrg
2816706f2543Smrg
2817706f2543Smrg# LT_PATH_LD
2818706f2543Smrg# ----------
2819706f2543Smrg# find the pathname to the GNU or non-GNU linker
2820706f2543SmrgAC_DEFUN([LT_PATH_LD],
2821706f2543Smrg[AC_REQUIRE([AC_PROG_CC])dnl
2822706f2543SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
2823706f2543SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
2824706f2543Smrgm4_require([_LT_DECL_SED])dnl
2825706f2543Smrgm4_require([_LT_DECL_EGREP])dnl
2826706f2543Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
2827706f2543Smrg
2828706f2543SmrgAC_ARG_WITH([gnu-ld],
2829706f2543Smrg    [AS_HELP_STRING([--with-gnu-ld],
2830706f2543Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
2831706f2543Smrg    [test "$withval" = no || with_gnu_ld=yes],
2832706f2543Smrg    [with_gnu_ld=no])dnl
2833706f2543Smrg
2834706f2543Smrgac_prog=ld
2835706f2543Smrgif test "$GCC" = yes; then
2836706f2543Smrg  # Check if gcc -print-prog-name=ld gives a path.
2837706f2543Smrg  AC_MSG_CHECKING([for ld used by $CC])
2838706f2543Smrg  case $host in
2839706f2543Smrg  *-*-mingw*)
2840706f2543Smrg    # gcc leaves a trailing carriage return which upsets mingw
2841706f2543Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2842706f2543Smrg  *)
2843706f2543Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2844706f2543Smrg  esac
2845706f2543Smrg  case $ac_prog in
2846706f2543Smrg    # Accept absolute paths.
2847706f2543Smrg    [[\\/]]* | ?:[[\\/]]*)
2848706f2543Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
2849706f2543Smrg      # Canonicalize the pathname of ld
2850706f2543Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
2851706f2543Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
2852706f2543Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
2853706f2543Smrg      done
2854706f2543Smrg      test -z "$LD" && LD="$ac_prog"
2855706f2543Smrg      ;;
2856706f2543Smrg  "")
2857706f2543Smrg    # If it fails, then pretend we aren't using GCC.
2858706f2543Smrg    ac_prog=ld
2859706f2543Smrg    ;;
2860706f2543Smrg  *)
2861706f2543Smrg    # If it is relative, then search for the first ld in PATH.
2862706f2543Smrg    with_gnu_ld=unknown
2863706f2543Smrg    ;;
2864706f2543Smrg  esac
2865706f2543Smrgelif test "$with_gnu_ld" = yes; then
2866706f2543Smrg  AC_MSG_CHECKING([for GNU ld])
2867706f2543Smrgelse
2868706f2543Smrg  AC_MSG_CHECKING([for non-GNU ld])
2869706f2543Smrgfi
2870706f2543SmrgAC_CACHE_VAL(lt_cv_path_LD,
2871706f2543Smrg[if test -z "$LD"; then
2872706f2543Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2873706f2543Smrg  for ac_dir in $PATH; do
2874706f2543Smrg    IFS="$lt_save_ifs"
2875706f2543Smrg    test -z "$ac_dir" && ac_dir=.
2876706f2543Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2877706f2543Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
2878706f2543Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
2879706f2543Smrg      # but apparently some variants of GNU ld only accept -v.
2880706f2543Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
2881706f2543Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
2882706f2543Smrg      *GNU* | *'with BFD'*)
2883706f2543Smrg	test "$with_gnu_ld" != no && break
2884706f2543Smrg	;;
2885706f2543Smrg      *)
2886706f2543Smrg	test "$with_gnu_ld" != yes && break
2887706f2543Smrg	;;
2888706f2543Smrg      esac
2889706f2543Smrg    fi
2890706f2543Smrg  done
2891706f2543Smrg  IFS="$lt_save_ifs"
2892706f2543Smrgelse
2893706f2543Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
2894706f2543Smrgfi])
2895706f2543SmrgLD="$lt_cv_path_LD"
2896706f2543Smrgif test -n "$LD"; then
2897706f2543Smrg  AC_MSG_RESULT($LD)
2898706f2543Smrgelse
2899706f2543Smrg  AC_MSG_RESULT(no)
2900706f2543Smrgfi
2901706f2543Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2902706f2543Smrg_LT_PATH_LD_GNU
2903706f2543SmrgAC_SUBST([LD])
2904706f2543Smrg
2905706f2543Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
2906706f2543Smrg])# LT_PATH_LD
2907706f2543Smrg
2908706f2543Smrg# Old names:
2909706f2543SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
2910706f2543SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
2911706f2543Smrgdnl aclocal-1.4 backwards compatibility:
2912706f2543Smrgdnl AC_DEFUN([AM_PROG_LD], [])
2913706f2543Smrgdnl AC_DEFUN([AC_PROG_LD], [])
2914706f2543Smrg
2915706f2543Smrg
2916706f2543Smrg# _LT_PATH_LD_GNU
2917706f2543Smrg#- --------------
2918706f2543Smrgm4_defun([_LT_PATH_LD_GNU],
2919706f2543Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
2920706f2543Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
2921706f2543Smrgcase `$LD -v 2>&1 </dev/null` in
2922706f2543Smrg*GNU* | *'with BFD'*)
2923706f2543Smrg  lt_cv_prog_gnu_ld=yes
2924706f2543Smrg  ;;
2925706f2543Smrg*)
2926706f2543Smrg  lt_cv_prog_gnu_ld=no
2927706f2543Smrg  ;;
2928706f2543Smrgesac])
2929706f2543Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
2930706f2543Smrg])# _LT_PATH_LD_GNU
2931706f2543Smrg
2932706f2543Smrg
2933706f2543Smrg# _LT_CMD_RELOAD
2934706f2543Smrg# --------------
2935706f2543Smrg# find reload flag for linker
2936706f2543Smrg#   -- PORTME Some linkers may need a different reload flag.
2937706f2543Smrgm4_defun([_LT_CMD_RELOAD],
2938706f2543Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
2939706f2543Smrg  lt_cv_ld_reload_flag,
2940706f2543Smrg  [lt_cv_ld_reload_flag='-r'])
2941706f2543Smrgreload_flag=$lt_cv_ld_reload_flag
2942706f2543Smrgcase $reload_flag in
2943706f2543Smrg"" | " "*) ;;
2944706f2543Smrg*) reload_flag=" $reload_flag" ;;
2945706f2543Smrgesac
2946706f2543Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
2947706f2543Smrgcase $host_os in
2948706f2543Smrg  darwin*)
2949706f2543Smrg    if test "$GCC" = yes; then
2950706f2543Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
2951706f2543Smrg    else
2952706f2543Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
2953706f2543Smrg    fi
2954706f2543Smrg    ;;
2955706f2543Smrgesac
2956706f2543Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
2957706f2543Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
2958706f2543Smrg])# _LT_CMD_RELOAD
2959706f2543Smrg
2960706f2543Smrg
2961706f2543Smrg# _LT_CHECK_MAGIC_METHOD
2962706f2543Smrg# ----------------------
2963706f2543Smrg# how to check for library dependencies
2964706f2543Smrg#  -- PORTME fill in with the dynamic library characteristics
2965706f2543Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
2966706f2543Smrg[m4_require([_LT_DECL_EGREP])
2967706f2543Smrgm4_require([_LT_DECL_OBJDUMP])
2968706f2543SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
2969706f2543Smrglt_cv_deplibs_check_method,
2970706f2543Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
2971706f2543Smrglt_cv_file_magic_test_file=
2972706f2543Smrglt_cv_deplibs_check_method='unknown'
2973706f2543Smrg# Need to set the preceding variable on all platforms that support
2974706f2543Smrg# interlibrary dependencies.
2975706f2543Smrg# 'none' -- dependencies not supported.
2976706f2543Smrg# `unknown' -- same as none, but documents that we really don't know.
2977706f2543Smrg# 'pass_all' -- all dependencies passed with no checks.
2978706f2543Smrg# 'test_compile' -- check by making test program.
2979706f2543Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
2980706f2543Smrg# which responds to the $file_magic_cmd with a given extended regex.
2981706f2543Smrg# If you have `file' or equivalent on your system and you're not sure
2982706f2543Smrg# whether `pass_all' will *always* work, you probably want this one.
2983706f2543Smrg
2984706f2543Smrgcase $host_os in
2985706f2543Smrgaix[[4-9]]*)
2986706f2543Smrg  lt_cv_deplibs_check_method=pass_all
2987706f2543Smrg  ;;
2988706f2543Smrg
2989706f2543Smrgbeos*)
2990706f2543Smrg  lt_cv_deplibs_check_method=pass_all
2991706f2543Smrg  ;;
2992706f2543Smrg
2993706f2543Smrgbsdi[[45]]*)
2994706f2543Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
2995706f2543Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
2996706f2543Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
2997706f2543Smrg  ;;
2998706f2543Smrg
2999706f2543Smrgcygwin*)
3000706f2543Smrg  # func_win32_libid is a shell function defined in ltmain.sh
3001706f2543Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3002706f2543Smrg  lt_cv_file_magic_cmd='func_win32_libid'
3003706f2543Smrg  ;;
3004706f2543Smrg
3005706f2543Smrgmingw* | pw32*)
3006706f2543Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
3007706f2543Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3008706f2543Smrg  # unless we find 'file', for example because we are cross-compiling.
3009706f2543Smrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
3010706f2543Smrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
3011706f2543Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3012706f2543Smrg    lt_cv_file_magic_cmd='func_win32_libid'
3013706f2543Smrg  else
3014706f2543Smrg    # Keep this pattern in sync with the one in func_win32_libid.
3015706f2543Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3016706f2543Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
3017706f2543Smrg  fi
3018706f2543Smrg  ;;
3019706f2543Smrg
3020706f2543Smrgcegcc*)
3021706f2543Smrg  # use the weaker test based on 'objdump'. See mingw*.
3022706f2543Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3023706f2543Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3024706f2543Smrg  ;;
3025706f2543Smrg
3026706f2543Smrgdarwin* | rhapsody*)
3027706f2543Smrg  lt_cv_deplibs_check_method=pass_all
3028706f2543Smrg  ;;
3029706f2543Smrg
3030706f2543Smrgfreebsd* | dragonfly*)
3031706f2543Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3032706f2543Smrg    case $host_cpu in
3033706f2543Smrg    i*86 )
3034706f2543Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
3035706f2543Smrg      # Let's accept both of them until this is cleared up.
3036706f2543Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3037706f2543Smrg      lt_cv_file_magic_cmd=/usr/bin/file
3038706f2543Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3039706f2543Smrg      ;;
3040706f2543Smrg    esac
3041706f2543Smrg  else
3042706f2543Smrg    lt_cv_deplibs_check_method=pass_all
3043706f2543Smrg  fi
3044706f2543Smrg  ;;
3045706f2543Smrg
3046706f2543Smrggnu*)
3047706f2543Smrg  lt_cv_deplibs_check_method=pass_all
3048706f2543Smrg  ;;
3049706f2543Smrg
3050706f2543Smrghaiku*)
3051706f2543Smrg  lt_cv_deplibs_check_method=pass_all
3052706f2543Smrg  ;;
3053706f2543Smrg
3054706f2543Smrghpux10.20* | hpux11*)
3055706f2543Smrg  lt_cv_file_magic_cmd=/usr/bin/file
3056706f2543Smrg  case $host_cpu in
3057706f2543Smrg  ia64*)
3058706f2543Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3059706f2543Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3060706f2543Smrg    ;;
3061706f2543Smrg  hppa*64*)
3062706f2543Smrg    [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]']
3063706f2543Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3064706f2543Smrg    ;;
3065706f2543Smrg  *)
3066706f2543Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3067706f2543Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3068706f2543Smrg    ;;
3069706f2543Smrg  esac
3070706f2543Smrg  ;;
3071706f2543Smrg
3072706f2543Smrginterix[[3-9]]*)
3073706f2543Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3074706f2543Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3075706f2543Smrg  ;;
3076706f2543Smrg
3077706f2543Smrgirix5* | irix6* | nonstopux*)
3078706f2543Smrg  case $LD in
3079706f2543Smrg  *-32|*"-32 ") libmagic=32-bit;;
3080706f2543Smrg  *-n32|*"-n32 ") libmagic=N32;;
3081706f2543Smrg  *-64|*"-64 ") libmagic=64-bit;;
3082706f2543Smrg  *) libmagic=never-match;;
3083706f2543Smrg  esac
3084706f2543Smrg  lt_cv_deplibs_check_method=pass_all
3085706f2543Smrg  ;;
3086706f2543Smrg
3087706f2543Smrg# This must be Linux ELF.
3088706f2543Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
3089706f2543Smrg  lt_cv_deplibs_check_method=pass_all
3090706f2543Smrg  ;;
3091706f2543Smrg
3092706f2543Smrgnetbsd*)
3093706f2543Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3094706f2543Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3095706f2543Smrg  else
3096706f2543Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3097706f2543Smrg  fi
3098706f2543Smrg  ;;
3099706f2543Smrg
3100706f2543Smrgnewos6*)
3101706f2543Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3102706f2543Smrg  lt_cv_file_magic_cmd=/usr/bin/file
3103706f2543Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3104706f2543Smrg  ;;
3105706f2543Smrg
3106706f2543Smrg*nto* | *qnx*)
3107706f2543Smrg  lt_cv_deplibs_check_method=pass_all
3108706f2543Smrg  ;;
3109706f2543Smrg
3110706f2543Smrgopenbsd*)
3111706f2543Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3112706f2543Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3113706f2543Smrg  else
3114706f2543Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3115706f2543Smrg  fi
3116706f2543Smrg  ;;
3117706f2543Smrg
3118706f2543Smrgosf3* | osf4* | osf5*)
3119706f2543Smrg  lt_cv_deplibs_check_method=pass_all
3120706f2543Smrg  ;;
3121706f2543Smrg
3122706f2543Smrgrdos*)
3123706f2543Smrg  lt_cv_deplibs_check_method=pass_all
3124706f2543Smrg  ;;
3125706f2543Smrg
3126706f2543Smrgsolaris*)
3127706f2543Smrg  lt_cv_deplibs_check_method=pass_all
3128706f2543Smrg  ;;
3129706f2543Smrg
3130706f2543Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3131706f2543Smrg  lt_cv_deplibs_check_method=pass_all
3132706f2543Smrg  ;;
3133706f2543Smrg
3134706f2543Smrgsysv4 | sysv4.3*)
3135706f2543Smrg  case $host_vendor in
3136706f2543Smrg  motorola)
3137706f2543Smrg    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]]'
3138706f2543Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3139706f2543Smrg    ;;
3140706f2543Smrg  ncr)
3141706f2543Smrg    lt_cv_deplibs_check_method=pass_all
3142706f2543Smrg    ;;
3143706f2543Smrg  sequent)
3144706f2543Smrg    lt_cv_file_magic_cmd='/bin/file'
3145706f2543Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3146706f2543Smrg    ;;
3147706f2543Smrg  sni)
3148706f2543Smrg    lt_cv_file_magic_cmd='/bin/file'
3149706f2543Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3150706f2543Smrg    lt_cv_file_magic_test_file=/lib/libc.so
3151706f2543Smrg    ;;
3152706f2543Smrg  siemens)
3153706f2543Smrg    lt_cv_deplibs_check_method=pass_all
3154706f2543Smrg    ;;
3155706f2543Smrg  pc)
3156706f2543Smrg    lt_cv_deplibs_check_method=pass_all
3157706f2543Smrg    ;;
3158706f2543Smrg  esac
3159706f2543Smrg  ;;
3160706f2543Smrg
3161706f2543Smrgtpf*)
3162706f2543Smrg  lt_cv_deplibs_check_method=pass_all
3163706f2543Smrg  ;;
3164706f2543Smrgesac
3165706f2543Smrg])
3166706f2543Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
3167706f2543Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
3168706f2543Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3169706f2543Smrg
3170706f2543Smrg_LT_DECL([], [deplibs_check_method], [1],
3171706f2543Smrg    [Method to check whether dependent libraries are shared objects])
3172706f2543Smrg_LT_DECL([], [file_magic_cmd], [1],
3173706f2543Smrg    [Command to use when deplibs_check_method == "file_magic"])
3174706f2543Smrg])# _LT_CHECK_MAGIC_METHOD
3175706f2543Smrg
3176706f2543Smrg
3177706f2543Smrg# LT_PATH_NM
3178706f2543Smrg# ----------
3179706f2543Smrg# find the pathname to a BSD- or MS-compatible name lister
3180706f2543SmrgAC_DEFUN([LT_PATH_NM],
3181706f2543Smrg[AC_REQUIRE([AC_PROG_CC])dnl
3182706f2543SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3183706f2543Smrg[if test -n "$NM"; then
3184706f2543Smrg  # Let the user override the test.
3185706f2543Smrg  lt_cv_path_NM="$NM"
3186706f2543Smrgelse
3187706f2543Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
3188706f2543Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3189706f2543Smrg    lt_nm_to_check="$lt_nm_to_check nm"
3190706f2543Smrg  fi
3191706f2543Smrg  for lt_tmp_nm in $lt_nm_to_check; do
3192706f2543Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3193706f2543Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3194706f2543Smrg      IFS="$lt_save_ifs"
3195706f2543Smrg      test -z "$ac_dir" && ac_dir=.
3196706f2543Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
3197706f2543Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3198706f2543Smrg	# Check to see if the nm accepts a BSD-compat flag.
3199706f2543Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
3200706f2543Smrg	#   nm: unknown option "B" ignored
3201706f2543Smrg	# Tru64's nm complains that /dev/null is an invalid object file
3202706f2543Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3203706f2543Smrg	*/dev/null* | *'Invalid file or object type'*)
3204706f2543Smrg	  lt_cv_path_NM="$tmp_nm -B"
3205706f2543Smrg	  break
3206706f2543Smrg	  ;;
3207706f2543Smrg	*)
3208706f2543Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3209706f2543Smrg	  */dev/null*)
3210706f2543Smrg	    lt_cv_path_NM="$tmp_nm -p"
3211706f2543Smrg	    break
3212706f2543Smrg	    ;;
3213706f2543Smrg	  *)
3214706f2543Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3215706f2543Smrg	    continue # so that we can try to find one that supports BSD flags
3216706f2543Smrg	    ;;
3217706f2543Smrg	  esac
3218706f2543Smrg	  ;;
3219706f2543Smrg	esac
3220706f2543Smrg      fi
3221706f2543Smrg    done
3222706f2543Smrg    IFS="$lt_save_ifs"
3223706f2543Smrg  done
3224706f2543Smrg  : ${lt_cv_path_NM=no}
3225706f2543Smrgfi])
3226706f2543Smrgif test "$lt_cv_path_NM" != "no"; then
3227706f2543Smrg  NM="$lt_cv_path_NM"
3228706f2543Smrgelse
3229706f2543Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
3230706f2543Smrg  if test -n "$DUMPBIN"; then :
3231706f2543Smrg    # Let the user override the test.
3232706f2543Smrg  else
3233706f2543Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3234706f2543Smrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
3235706f2543Smrg    *COFF*)
3236706f2543Smrg      DUMPBIN="$DUMPBIN -symbols"
3237706f2543Smrg      ;;
3238706f2543Smrg    *)
3239706f2543Smrg      DUMPBIN=:
3240706f2543Smrg      ;;
3241706f2543Smrg    esac
3242706f2543Smrg  fi
3243706f2543Smrg  AC_SUBST([DUMPBIN])
3244706f2543Smrg  if test "$DUMPBIN" != ":"; then
3245706f2543Smrg    NM="$DUMPBIN"
3246706f2543Smrg  fi
3247706f2543Smrgfi
3248706f2543Smrgtest -z "$NM" && NM=nm
3249706f2543SmrgAC_SUBST([NM])
3250706f2543Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3251706f2543Smrg
3252706f2543SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3253706f2543Smrg  [lt_cv_nm_interface="BSD nm"
3254706f2543Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
3255706f2543Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3256706f2543Smrg  (eval "$ac_compile" 2>conftest.err)
3257706f2543Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3258706f2543Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3259706f2543Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3260706f2543Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3261706f2543Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3262706f2543Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
3263706f2543Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3264706f2543Smrg    lt_cv_nm_interface="MS dumpbin"
3265706f2543Smrg  fi
3266706f2543Smrg  rm -r -f conftest*])
3267706f2543Smrg])# LT_PATH_NM
3268706f2543Smrg
3269706f2543Smrg# Old names:
3270706f2543SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3271706f2543SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3272706f2543Smrgdnl aclocal-1.4 backwards compatibility:
3273706f2543Smrgdnl AC_DEFUN([AM_PROG_NM], [])
3274706f2543Smrgdnl AC_DEFUN([AC_PROG_NM], [])
3275706f2543Smrg
3276706f2543Smrg
3277706f2543Smrg# LT_LIB_M
3278706f2543Smrg# --------
3279706f2543Smrg# check for math library
3280706f2543SmrgAC_DEFUN([LT_LIB_M],
3281706f2543Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3282706f2543SmrgLIBM=
3283706f2543Smrgcase $host in
3284706f2543Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3285706f2543Smrg  # These system don't have libm, or don't need it
3286706f2543Smrg  ;;
3287706f2543Smrg*-ncr-sysv4.3*)
3288706f2543Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3289706f2543Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3290706f2543Smrg  ;;
3291706f2543Smrg*)
3292706f2543Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
3293706f2543Smrg  ;;
3294706f2543Smrgesac
3295706f2543SmrgAC_SUBST([LIBM])
3296706f2543Smrg])# LT_LIB_M
3297706f2543Smrg
3298706f2543Smrg# Old name:
3299706f2543SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3300706f2543Smrgdnl aclocal-1.4 backwards compatibility:
3301706f2543Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3302706f2543Smrg
3303706f2543Smrg
3304706f2543Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
3305706f2543Smrg# -------------------------------
3306706f2543Smrgm4_defun([_LT_COMPILER_NO_RTTI],
3307706f2543Smrg[m4_require([_LT_TAG_COMPILER])dnl
3308706f2543Smrg
3309706f2543Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3310706f2543Smrg
3311706f2543Smrgif test "$GCC" = yes; then
3312706f2543Smrg  case $cc_basename in
3313706f2543Smrg  nvcc*)
3314706f2543Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3315706f2543Smrg  *)
3316706f2543Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
3317706f2543Smrg  esac
3318706f2543Smrg
3319706f2543Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3320706f2543Smrg    lt_cv_prog_compiler_rtti_exceptions,
3321706f2543Smrg    [-fno-rtti -fno-exceptions], [],
3322706f2543Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3323706f2543Smrgfi
3324706f2543Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3325706f2543Smrg	[Compiler flag to turn off builtin functions])
3326706f2543Smrg])# _LT_COMPILER_NO_RTTI
3327706f2543Smrg
3328706f2543Smrg
3329706f2543Smrg# _LT_CMD_GLOBAL_SYMBOLS
3330706f2543Smrg# ----------------------
3331706f2543Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3332706f2543Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3333706f2543SmrgAC_REQUIRE([AC_PROG_CC])dnl
3334706f2543SmrgAC_REQUIRE([AC_PROG_AWK])dnl
3335706f2543SmrgAC_REQUIRE([LT_PATH_NM])dnl
3336706f2543SmrgAC_REQUIRE([LT_PATH_LD])dnl
3337706f2543Smrgm4_require([_LT_DECL_SED])dnl
3338706f2543Smrgm4_require([_LT_DECL_EGREP])dnl
3339706f2543Smrgm4_require([_LT_TAG_COMPILER])dnl
3340706f2543Smrg
3341706f2543Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
3342706f2543SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3343706f2543SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3344706f2543Smrg[
3345706f2543Smrg# These are sane defaults that work on at least a few old systems.
3346706f2543Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3347706f2543Smrg
3348706f2543Smrg# Character class describing NM global symbol codes.
3349706f2543Smrgsymcode='[[BCDEGRST]]'
3350706f2543Smrg
3351706f2543Smrg# Regexp to match symbols that can be accessed directly from C.
3352706f2543Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3353706f2543Smrg
3354706f2543Smrg# Define system-specific variables.
3355706f2543Smrgcase $host_os in
3356706f2543Smrgaix*)
3357706f2543Smrg  symcode='[[BCDT]]'
3358706f2543Smrg  ;;
3359706f2543Smrgcygwin* | mingw* | pw32* | cegcc*)
3360706f2543Smrg  symcode='[[ABCDGISTW]]'
3361706f2543Smrg  ;;
3362706f2543Smrghpux*)
3363706f2543Smrg  if test "$host_cpu" = ia64; then
3364706f2543Smrg    symcode='[[ABCDEGRST]]'
3365706f2543Smrg  fi
3366706f2543Smrg  ;;
3367706f2543Smrgirix* | nonstopux*)
3368706f2543Smrg  symcode='[[BCDEGRST]]'
3369706f2543Smrg  ;;
3370706f2543Smrgosf*)
3371706f2543Smrg  symcode='[[BCDEGQRST]]'
3372706f2543Smrg  ;;
3373706f2543Smrgsolaris*)
3374706f2543Smrg  symcode='[[BDRT]]'
3375706f2543Smrg  ;;
3376706f2543Smrgsco3.2v5*)
3377706f2543Smrg  symcode='[[DT]]'
3378706f2543Smrg  ;;
3379706f2543Smrgsysv4.2uw2*)
3380706f2543Smrg  symcode='[[DT]]'
3381706f2543Smrg  ;;
3382706f2543Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
3383706f2543Smrg  symcode='[[ABDT]]'
3384706f2543Smrg  ;;
3385706f2543Smrgsysv4)
3386706f2543Smrg  symcode='[[DFNSTU]]'
3387706f2543Smrg  ;;
3388706f2543Smrgesac
3389706f2543Smrg
3390706f2543Smrg# If we're using GNU nm, then use its standard symbol codes.
3391706f2543Smrgcase `$NM -V 2>&1` in
3392706f2543Smrg*GNU* | *'with BFD'*)
3393706f2543Smrg  symcode='[[ABCDGIRSTW]]' ;;
3394706f2543Smrgesac
3395706f2543Smrg
3396706f2543Smrg# Transform an extracted symbol line into a proper C declaration.
3397706f2543Smrg# Some systems (esp. on ia64) link data and code symbols differently,
3398706f2543Smrg# so use this general approach.
3399706f2543Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3400706f2543Smrg
3401706f2543Smrg# Transform an extracted symbol line into symbol name and symbol address
3402706f2543Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
3403706f2543Smrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
3404706f2543Smrg
3405706f2543Smrg# Handle CRLF in mingw tool chain
3406706f2543Smrgopt_cr=
3407706f2543Smrgcase $build_os in
3408706f2543Smrgmingw*)
3409706f2543Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3410706f2543Smrg  ;;
3411706f2543Smrgesac
3412706f2543Smrg
3413706f2543Smrg# Try without a prefix underscore, then with it.
3414706f2543Smrgfor ac_symprfx in "" "_"; do
3415706f2543Smrg
3416706f2543Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3417706f2543Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
3418706f2543Smrg
3419706f2543Smrg  # Write the raw and C identifiers.
3420706f2543Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3421706f2543Smrg    # Fake it for dumpbin and say T for any non-static function
3422706f2543Smrg    # and D for any global variable.
3423706f2543Smrg    # Also find C++ and __fastcall symbols from MSVC++,
3424706f2543Smrg    # which start with @ or ?.
3425706f2543Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
3426706f2543Smrg"     {last_section=section; section=\$ 3};"\
3427706f2543Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3428706f2543Smrg"     \$ 0!~/External *\|/{next};"\
3429706f2543Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3430706f2543Smrg"     {if(hide[section]) next};"\
3431706f2543Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3432706f2543Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3433706f2543Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
3434706f2543Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3435706f2543Smrg"     ' prfx=^$ac_symprfx]"
3436706f2543Smrg  else
3437706f2543Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
3438706f2543Smrg  fi
3439706f2543Smrg
3440706f2543Smrg  # Check to see that the pipe works correctly.
3441706f2543Smrg  pipe_works=no
3442706f2543Smrg
3443706f2543Smrg  rm -r -f conftest*
3444706f2543Smrg  cat > conftest.$ac_ext <<_LT_EOF
3445706f2543Smrg#ifdef __cplusplus
3446706f2543Smrgextern "C" {
3447706f2543Smrg#endif
3448706f2543Smrgchar nm_test_var;
3449706f2543Smrgvoid nm_test_func(void);
3450706f2543Smrgvoid nm_test_func(void){}
3451706f2543Smrg#ifdef __cplusplus
3452706f2543Smrg}
3453706f2543Smrg#endif
3454706f2543Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
3455706f2543Smrg_LT_EOF
3456706f2543Smrg
3457706f2543Smrg  if AC_TRY_EVAL(ac_compile); then
3458706f2543Smrg    # Now try to grab the symbols.
3459706f2543Smrg    nlist=conftest.nm
3460706f2543Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
3461706f2543Smrg      # Try sorting and uniquifying the output.
3462706f2543Smrg      if sort "$nlist" | uniq > "$nlist"T; then
3463706f2543Smrg	mv -f "$nlist"T "$nlist"
3464706f2543Smrg      else
3465706f2543Smrg	rm -f "$nlist"T
3466706f2543Smrg      fi
3467706f2543Smrg
3468706f2543Smrg      # Make sure that we snagged all the symbols we need.
3469706f2543Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3470706f2543Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3471706f2543Smrg	  cat <<_LT_EOF > conftest.$ac_ext
3472706f2543Smrg#ifdef __cplusplus
3473706f2543Smrgextern "C" {
3474706f2543Smrg#endif
3475706f2543Smrg
3476706f2543Smrg_LT_EOF
3477706f2543Smrg	  # Now generate the symbol file.
3478706f2543Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3479706f2543Smrg
3480706f2543Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
3481706f2543Smrg
3482706f2543Smrg/* The mapping between symbol names and symbols.  */
3483706f2543Smrgconst struct {
3484706f2543Smrg  const char *name;
3485706f2543Smrg  void       *address;
3486706f2543Smrg}
3487706f2543Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
3488706f2543Smrg{
3489706f2543Smrg  { "@PROGRAM@", (void *) 0 },
3490706f2543Smrg_LT_EOF
3491706f2543Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3492706f2543Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
3493706f2543Smrg  {0, (void *) 0}
3494706f2543Smrg};
3495706f2543Smrg
3496706f2543Smrg/* This works around a problem in FreeBSD linker */
3497706f2543Smrg#ifdef FREEBSD_WORKAROUND
3498706f2543Smrgstatic const void *lt_preloaded_setup() {
3499706f2543Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
3500706f2543Smrg}
3501706f2543Smrg#endif
3502706f2543Smrg
3503706f2543Smrg#ifdef __cplusplus
3504706f2543Smrg}
3505706f2543Smrg#endif
3506706f2543Smrg_LT_EOF
3507706f2543Smrg	  # Now try linking the two files.
3508706f2543Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
3509706f2543Smrg	  lt_save_LIBS="$LIBS"
3510706f2543Smrg	  lt_save_CFLAGS="$CFLAGS"
3511706f2543Smrg	  LIBS="conftstm.$ac_objext"
3512706f2543Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3513706f2543Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3514706f2543Smrg	    pipe_works=yes
3515706f2543Smrg	  fi
3516706f2543Smrg	  LIBS="$lt_save_LIBS"
3517706f2543Smrg	  CFLAGS="$lt_save_CFLAGS"
3518706f2543Smrg	else
3519706f2543Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3520706f2543Smrg	fi
3521706f2543Smrg      else
3522706f2543Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3523706f2543Smrg      fi
3524706f2543Smrg    else
3525706f2543Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3526706f2543Smrg    fi
3527706f2543Smrg  else
3528706f2543Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3529706f2543Smrg    cat conftest.$ac_ext >&5
3530706f2543Smrg  fi
3531706f2543Smrg  rm -rf conftest* conftst*
3532706f2543Smrg
3533706f2543Smrg  # Do not use the global_symbol_pipe unless it works.
3534706f2543Smrg  if test "$pipe_works" = yes; then
3535706f2543Smrg    break
3536706f2543Smrg  else
3537706f2543Smrg    lt_cv_sys_global_symbol_pipe=
3538706f2543Smrg  fi
3539706f2543Smrgdone
3540706f2543Smrg])
3541706f2543Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
3542706f2543Smrg  lt_cv_sys_global_symbol_to_cdecl=
3543706f2543Smrgfi
3544706f2543Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3545706f2543Smrg  AC_MSG_RESULT(failed)
3546706f2543Smrgelse
3547706f2543Smrg  AC_MSG_RESULT(ok)
3548706f2543Smrgfi
3549706f2543Smrg
3550706f2543Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3551706f2543Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
3552706f2543Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3553706f2543Smrg    [Transform the output of nm in a proper C declaration])
3554706f2543Smrg_LT_DECL([global_symbol_to_c_name_address],
3555706f2543Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
3556706f2543Smrg    [Transform the output of nm in a C name address pair])
3557706f2543Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3558706f2543Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3559706f2543Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
3560706f2543Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
3561706f2543Smrg
3562706f2543Smrg
3563706f2543Smrg# _LT_COMPILER_PIC([TAGNAME])
3564706f2543Smrg# ---------------------------
3565706f2543Smrgm4_defun([_LT_COMPILER_PIC],
3566706f2543Smrg[m4_require([_LT_TAG_COMPILER])dnl
3567706f2543Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
3568706f2543Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
3569706f2543Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
3570706f2543Smrg
3571706f2543SmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
3572706f2543Smrgm4_if([$1], [CXX], [
3573706f2543Smrg  # C++ specific cases for pic, static, wl, etc.
3574706f2543Smrg  if test "$GXX" = yes; then
3575706f2543Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3576706f2543Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3577706f2543Smrg
3578706f2543Smrg    case $host_os in
3579706f2543Smrg    aix*)
3580706f2543Smrg      # All AIX code is PIC.
3581706f2543Smrg      if test "$host_cpu" = ia64; then
3582706f2543Smrg	# AIX 5 now supports IA64 processor
3583706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3584706f2543Smrg      fi
3585706f2543Smrg      ;;
3586706f2543Smrg
3587706f2543Smrg    amigaos*)
3588706f2543Smrg      case $host_cpu in
3589706f2543Smrg      powerpc)
3590706f2543Smrg            # see comment about AmigaOS4 .so support
3591706f2543Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3592706f2543Smrg        ;;
3593706f2543Smrg      m68k)
3594706f2543Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
3595706f2543Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
3596706f2543Smrg            # like `-m68040'.
3597706f2543Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3598706f2543Smrg        ;;
3599706f2543Smrg      esac
3600706f2543Smrg      ;;
3601706f2543Smrg
3602706f2543Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3603706f2543Smrg      # PIC is the default for these OSes.
3604706f2543Smrg      ;;
3605706f2543Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
3606706f2543Smrg      # This hack is so that the source file can tell whether it is being
3607706f2543Smrg      # built for inclusion in a dll (and should export symbols for example).
3608706f2543Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3609706f2543Smrg      # (--disable-auto-import) libraries
3610706f2543Smrg      m4_if([$1], [GCJ], [],
3611706f2543Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3612706f2543Smrg      ;;
3613706f2543Smrg    darwin* | rhapsody*)
3614706f2543Smrg      # PIC is the default on this platform
3615706f2543Smrg      # Common symbols not allowed in MH_DYLIB files
3616706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3617706f2543Smrg      ;;
3618706f2543Smrg    *djgpp*)
3619706f2543Smrg      # DJGPP does not support shared libraries at all
3620706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3621706f2543Smrg      ;;
3622706f2543Smrg    haiku*)
3623706f2543Smrg      # PIC is the default for Haiku.
3624706f2543Smrg      # The "-static" flag exists, but is broken.
3625706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
3626706f2543Smrg      ;;
3627706f2543Smrg    interix[[3-9]]*)
3628706f2543Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3629706f2543Smrg      # Instead, we relocate shared libraries at runtime.
3630706f2543Smrg      ;;
3631706f2543Smrg    sysv4*MP*)
3632706f2543Smrg      if test -d /usr/nec; then
3633706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3634706f2543Smrg      fi
3635706f2543Smrg      ;;
3636706f2543Smrg    hpux*)
3637706f2543Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3638706f2543Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3639706f2543Smrg      # sets the default TLS model and affects inlining.
3640706f2543Smrg      case $host_cpu in
3641706f2543Smrg      hppa*64*)
3642706f2543Smrg	;;
3643706f2543Smrg      *)
3644706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3645706f2543Smrg	;;
3646706f2543Smrg      esac
3647706f2543Smrg      ;;
3648706f2543Smrg    *qnx* | *nto*)
3649706f2543Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
3650706f2543Smrg      # it will coredump.
3651706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3652706f2543Smrg      ;;
3653706f2543Smrg    *)
3654706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3655706f2543Smrg      ;;
3656706f2543Smrg    esac
3657706f2543Smrg  else
3658706f2543Smrg    case $host_os in
3659706f2543Smrg      aix[[4-9]]*)
3660706f2543Smrg	# All AIX code is PIC.
3661706f2543Smrg	if test "$host_cpu" = ia64; then
3662706f2543Smrg	  # AIX 5 now supports IA64 processor
3663706f2543Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3664706f2543Smrg	else
3665706f2543Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3666706f2543Smrg	fi
3667706f2543Smrg	;;
3668706f2543Smrg      chorus*)
3669706f2543Smrg	case $cc_basename in
3670706f2543Smrg	cxch68*)
3671706f2543Smrg	  # Green Hills C++ Compiler
3672706f2543Smrg	  # _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"
3673706f2543Smrg	  ;;
3674706f2543Smrg	esac
3675706f2543Smrg	;;
3676706f2543Smrg      dgux*)
3677706f2543Smrg	case $cc_basename in
3678706f2543Smrg	  ec++*)
3679706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3680706f2543Smrg	    ;;
3681706f2543Smrg	  ghcx*)
3682706f2543Smrg	    # Green Hills C++ Compiler
3683706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3684706f2543Smrg	    ;;
3685706f2543Smrg	  *)
3686706f2543Smrg	    ;;
3687706f2543Smrg	esac
3688706f2543Smrg	;;
3689706f2543Smrg      freebsd* | dragonfly*)
3690706f2543Smrg	# FreeBSD uses GNU C++
3691706f2543Smrg	;;
3692706f2543Smrg      hpux9* | hpux10* | hpux11*)
3693706f2543Smrg	case $cc_basename in
3694706f2543Smrg	  CC*)
3695706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3696706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3697706f2543Smrg	    if test "$host_cpu" != ia64; then
3698706f2543Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3699706f2543Smrg	    fi
3700706f2543Smrg	    ;;
3701706f2543Smrg	  aCC*)
3702706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3703706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3704706f2543Smrg	    case $host_cpu in
3705706f2543Smrg	    hppa*64*|ia64*)
3706706f2543Smrg	      # +Z the default
3707706f2543Smrg	      ;;
3708706f2543Smrg	    *)
3709706f2543Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3710706f2543Smrg	      ;;
3711706f2543Smrg	    esac
3712706f2543Smrg	    ;;
3713706f2543Smrg	  *)
3714706f2543Smrg	    ;;
3715706f2543Smrg	esac
3716706f2543Smrg	;;
3717706f2543Smrg      interix*)
3718706f2543Smrg	# This is c89, which is MS Visual C++ (no shared libs)
3719706f2543Smrg	# Anyone wants to do a port?
3720706f2543Smrg	;;
3721706f2543Smrg      irix5* | irix6* | nonstopux*)
3722706f2543Smrg	case $cc_basename in
3723706f2543Smrg	  CC*)
3724706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3725706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3726706f2543Smrg	    # CC pic flag -KPIC is the default.
3727706f2543Smrg	    ;;
3728706f2543Smrg	  *)
3729706f2543Smrg	    ;;
3730706f2543Smrg	esac
3731706f2543Smrg	;;
3732706f2543Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
3733706f2543Smrg	case $cc_basename in
3734706f2543Smrg	  KCC*)
3735706f2543Smrg	    # KAI C++ Compiler
3736706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3737706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3738706f2543Smrg	    ;;
3739706f2543Smrg	  ecpc* )
3740706f2543Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
3741706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3742706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3743706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3744706f2543Smrg	    ;;
3745706f2543Smrg	  icpc* )
3746706f2543Smrg	    # Intel C++, used to be incompatible with GCC.
3747706f2543Smrg	    # ICC 10 doesn't accept -KPIC any more.
3748706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3749706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3750706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3751706f2543Smrg	    ;;
3752706f2543Smrg	  pgCC* | pgcpp*)
3753706f2543Smrg	    # Portland Group C++ compiler
3754706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3755706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
3756706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3757706f2543Smrg	    ;;
3758706f2543Smrg	  cxx*)
3759706f2543Smrg	    # Compaq C++
3760706f2543Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
3761706f2543Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
3762706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3763706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3764706f2543Smrg	    ;;
3765706f2543Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
3766706f2543Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
3767706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3768706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
3769706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
3770706f2543Smrg	    ;;
3771706f2543Smrg	  *)
3772706f2543Smrg	    case `$CC -V 2>&1 | sed 5q` in
3773706f2543Smrg	    *Sun\ C*)
3774706f2543Smrg	      # Sun C++ 5.9
3775706f2543Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3776706f2543Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3777706f2543Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3778706f2543Smrg	      ;;
3779706f2543Smrg	    esac
3780706f2543Smrg	    ;;
3781706f2543Smrg	esac
3782706f2543Smrg	;;
3783706f2543Smrg      lynxos*)
3784706f2543Smrg	;;
3785706f2543Smrg      m88k*)
3786706f2543Smrg	;;
3787706f2543Smrg      mvs*)
3788706f2543Smrg	case $cc_basename in
3789706f2543Smrg	  cxx*)
3790706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
3791706f2543Smrg	    ;;
3792706f2543Smrg	  *)
3793706f2543Smrg	    ;;
3794706f2543Smrg	esac
3795706f2543Smrg	;;
3796706f2543Smrg      netbsd*)
3797706f2543Smrg	;;
3798706f2543Smrg      *qnx* | *nto*)
3799706f2543Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
3800706f2543Smrg        # it will coredump.
3801706f2543Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3802706f2543Smrg        ;;
3803706f2543Smrg      osf3* | osf4* | osf5*)
3804706f2543Smrg	case $cc_basename in
3805706f2543Smrg	  KCC*)
3806706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3807706f2543Smrg	    ;;
3808706f2543Smrg	  RCC*)
3809706f2543Smrg	    # Rational C++ 2.4.1
3810706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3811706f2543Smrg	    ;;
3812706f2543Smrg	  cxx*)
3813706f2543Smrg	    # Digital/Compaq C++
3814706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3815706f2543Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
3816706f2543Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
3817706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3818706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3819706f2543Smrg	    ;;
3820706f2543Smrg	  *)
3821706f2543Smrg	    ;;
3822706f2543Smrg	esac
3823706f2543Smrg	;;
3824706f2543Smrg      psos*)
3825706f2543Smrg	;;
3826706f2543Smrg      solaris*)
3827706f2543Smrg	case $cc_basename in
3828706f2543Smrg	  CC* | sunCC*)
3829706f2543Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
3830706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3831706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3832706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3833706f2543Smrg	    ;;
3834706f2543Smrg	  gcx*)
3835706f2543Smrg	    # Green Hills C++ Compiler
3836706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
3837706f2543Smrg	    ;;
3838706f2543Smrg	  *)
3839706f2543Smrg	    ;;
3840706f2543Smrg	esac
3841706f2543Smrg	;;
3842706f2543Smrg      sunos4*)
3843706f2543Smrg	case $cc_basename in
3844706f2543Smrg	  CC*)
3845706f2543Smrg	    # Sun C++ 4.x
3846706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3847706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3848706f2543Smrg	    ;;
3849706f2543Smrg	  lcc*)
3850706f2543Smrg	    # Lucid
3851706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3852706f2543Smrg	    ;;
3853706f2543Smrg	  *)
3854706f2543Smrg	    ;;
3855706f2543Smrg	esac
3856706f2543Smrg	;;
3857706f2543Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
3858706f2543Smrg	case $cc_basename in
3859706f2543Smrg	  CC*)
3860706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3861706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3862706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3863706f2543Smrg	    ;;
3864706f2543Smrg	esac
3865706f2543Smrg	;;
3866706f2543Smrg      tandem*)
3867706f2543Smrg	case $cc_basename in
3868706f2543Smrg	  NCC*)
3869706f2543Smrg	    # NonStop-UX NCC 3.20
3870706f2543Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3871706f2543Smrg	    ;;
3872706f2543Smrg	  *)
3873706f2543Smrg	    ;;
3874706f2543Smrg	esac
3875706f2543Smrg	;;
3876706f2543Smrg      vxworks*)
3877706f2543Smrg	;;
3878706f2543Smrg      *)
3879706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3880706f2543Smrg	;;
3881706f2543Smrg    esac
3882706f2543Smrg  fi
3883706f2543Smrg],
3884706f2543Smrg[
3885706f2543Smrg  if test "$GCC" = yes; then
3886706f2543Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3887706f2543Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3888706f2543Smrg
3889706f2543Smrg    case $host_os in
3890706f2543Smrg      aix*)
3891706f2543Smrg      # All AIX code is PIC.
3892706f2543Smrg      if test "$host_cpu" = ia64; then
3893706f2543Smrg	# AIX 5 now supports IA64 processor
3894706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3895706f2543Smrg      fi
3896706f2543Smrg      ;;
3897706f2543Smrg
3898706f2543Smrg    amigaos*)
3899706f2543Smrg      case $host_cpu in
3900706f2543Smrg      powerpc)
3901706f2543Smrg            # see comment about AmigaOS4 .so support
3902706f2543Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3903706f2543Smrg        ;;
3904706f2543Smrg      m68k)
3905706f2543Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
3906706f2543Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
3907706f2543Smrg            # like `-m68040'.
3908706f2543Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3909706f2543Smrg        ;;
3910706f2543Smrg      esac
3911706f2543Smrg      ;;
3912706f2543Smrg
3913706f2543Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3914706f2543Smrg      # PIC is the default for these OSes.
3915706f2543Smrg      ;;
3916706f2543Smrg
3917706f2543Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
3918706f2543Smrg      # This hack is so that the source file can tell whether it is being
3919706f2543Smrg      # built for inclusion in a dll (and should export symbols for example).
3920706f2543Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3921706f2543Smrg      # (--disable-auto-import) libraries
3922706f2543Smrg      m4_if([$1], [GCJ], [],
3923706f2543Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3924706f2543Smrg      ;;
3925706f2543Smrg
3926706f2543Smrg    darwin* | rhapsody*)
3927706f2543Smrg      # PIC is the default on this platform
3928706f2543Smrg      # Common symbols not allowed in MH_DYLIB files
3929706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3930706f2543Smrg      ;;
3931706f2543Smrg
3932706f2543Smrg    haiku*)
3933706f2543Smrg      # PIC is the default for Haiku.
3934706f2543Smrg      # The "-static" flag exists, but is broken.
3935706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
3936706f2543Smrg      ;;
3937706f2543Smrg
3938706f2543Smrg    hpux*)
3939706f2543Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3940706f2543Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3941706f2543Smrg      # sets the default TLS model and affects inlining.
3942706f2543Smrg      case $host_cpu in
3943706f2543Smrg      hppa*64*)
3944706f2543Smrg	# +Z the default
3945706f2543Smrg	;;
3946706f2543Smrg      *)
3947706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3948706f2543Smrg	;;
3949706f2543Smrg      esac
3950706f2543Smrg      ;;
3951706f2543Smrg
3952706f2543Smrg    interix[[3-9]]*)
3953706f2543Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3954706f2543Smrg      # Instead, we relocate shared libraries at runtime.
3955706f2543Smrg      ;;
3956706f2543Smrg
3957706f2543Smrg    msdosdjgpp*)
3958706f2543Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
3959706f2543Smrg      # on systems that don't support them.
3960706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3961706f2543Smrg      enable_shared=no
3962706f2543Smrg      ;;
3963706f2543Smrg
3964706f2543Smrg    *nto* | *qnx*)
3965706f2543Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
3966706f2543Smrg      # it will coredump.
3967706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3968706f2543Smrg      ;;
3969706f2543Smrg
3970706f2543Smrg    sysv4*MP*)
3971706f2543Smrg      if test -d /usr/nec; then
3972706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3973706f2543Smrg      fi
3974706f2543Smrg      ;;
3975706f2543Smrg
3976706f2543Smrg    *)
3977706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3978706f2543Smrg      ;;
3979706f2543Smrg    esac
3980706f2543Smrg
3981706f2543Smrg    case $cc_basename in
3982706f2543Smrg    nvcc*) # Cuda Compiler Driver 2.2
3983706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
3984706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
3985706f2543Smrg      ;;
3986706f2543Smrg    esac
3987706f2543Smrg  else
3988706f2543Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
3989706f2543Smrg    case $host_os in
3990706f2543Smrg    aix*)
3991706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3992706f2543Smrg      if test "$host_cpu" = ia64; then
3993706f2543Smrg	# AIX 5 now supports IA64 processor
3994706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3995706f2543Smrg      else
3996706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3997706f2543Smrg      fi
3998706f2543Smrg      ;;
3999706f2543Smrg
4000706f2543Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4001706f2543Smrg      # This hack is so that the source file can tell whether it is being
4002706f2543Smrg      # built for inclusion in a dll (and should export symbols for example).
4003706f2543Smrg      m4_if([$1], [GCJ], [],
4004706f2543Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4005706f2543Smrg      ;;
4006706f2543Smrg
4007706f2543Smrg    hpux9* | hpux10* | hpux11*)
4008706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4009706f2543Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4010706f2543Smrg      # not for PA HP-UX.
4011706f2543Smrg      case $host_cpu in
4012706f2543Smrg      hppa*64*|ia64*)
4013706f2543Smrg	# +Z the default
4014706f2543Smrg	;;
4015706f2543Smrg      *)
4016706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4017706f2543Smrg	;;
4018706f2543Smrg      esac
4019706f2543Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4020706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4021706f2543Smrg      ;;
4022706f2543Smrg
4023706f2543Smrg    irix5* | irix6* | nonstopux*)
4024706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4025706f2543Smrg      # PIC (with -KPIC) is the default.
4026706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4027706f2543Smrg      ;;
4028706f2543Smrg
4029706f2543Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
4030706f2543Smrg      case $cc_basename in
4031706f2543Smrg      # old Intel for x86_64 which still supported -KPIC.
4032706f2543Smrg      ecc*)
4033706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4034706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4035706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4036706f2543Smrg        ;;
4037706f2543Smrg      # icc used to be incompatible with GCC.
4038706f2543Smrg      # ICC 10 doesn't accept -KPIC any more.
4039706f2543Smrg      icc* | ifort*)
4040706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4041706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4042706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4043706f2543Smrg        ;;
4044706f2543Smrg      # Lahey Fortran 8.1.
4045706f2543Smrg      lf95*)
4046706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4047706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4048706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4049706f2543Smrg	;;
4050706f2543Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4051706f2543Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
4052706f2543Smrg	# which looks to be a dead project)
4053706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4054706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4055706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4056706f2543Smrg        ;;
4057706f2543Smrg      ccc*)
4058706f2543Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4059706f2543Smrg        # All Alpha code is PIC.
4060706f2543Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4061706f2543Smrg        ;;
4062706f2543Smrg      xl* | bgxl* | bgf* | mpixl*)
4063706f2543Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4064706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4065706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4066706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4067706f2543Smrg	;;
4068706f2543Smrg      *)
4069706f2543Smrg	case `$CC -V 2>&1 | sed 5q` in
4070706f2543Smrg	*Sun\ F* | *Sun*Fortran*)
4071706f2543Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4072706f2543Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4073706f2543Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4074706f2543Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4075706f2543Smrg	  ;;
4076706f2543Smrg	*Sun\ C*)
4077706f2543Smrg	  # Sun C 5.9
4078706f2543Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4079706f2543Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4080706f2543Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4081706f2543Smrg	  ;;
4082706f2543Smrg	esac
4083706f2543Smrg	;;
4084706f2543Smrg      esac
4085706f2543Smrg      ;;
4086706f2543Smrg
4087706f2543Smrg    newsos6)
4088706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4089706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4090706f2543Smrg      ;;
4091706f2543Smrg
4092706f2543Smrg    *nto* | *qnx*)
4093706f2543Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4094706f2543Smrg      # it will coredump.
4095706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4096706f2543Smrg      ;;
4097706f2543Smrg
4098706f2543Smrg    osf3* | osf4* | osf5*)
4099706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4100706f2543Smrg      # All OSF/1 code is PIC.
4101706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4102706f2543Smrg      ;;
4103706f2543Smrg
4104706f2543Smrg    rdos*)
4105706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4106706f2543Smrg      ;;
4107706f2543Smrg
4108706f2543Smrg    solaris*)
4109706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4110706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4111706f2543Smrg      case $cc_basename in
4112706f2543Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4113706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4114706f2543Smrg      *)
4115706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4116706f2543Smrg      esac
4117706f2543Smrg      ;;
4118706f2543Smrg
4119706f2543Smrg    sunos4*)
4120706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4121706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4122706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4123706f2543Smrg      ;;
4124706f2543Smrg
4125706f2543Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
4126706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4127706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4128706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4129706f2543Smrg      ;;
4130706f2543Smrg
4131706f2543Smrg    sysv4*MP*)
4132706f2543Smrg      if test -d /usr/nec ;then
4133706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4134706f2543Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4135706f2543Smrg      fi
4136706f2543Smrg      ;;
4137706f2543Smrg
4138706f2543Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4139706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4140706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4141706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4142706f2543Smrg      ;;
4143706f2543Smrg
4144706f2543Smrg    unicos*)
4145706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4146706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4147706f2543Smrg      ;;
4148706f2543Smrg
4149706f2543Smrg    uts4*)
4150706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4151706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4152706f2543Smrg      ;;
4153706f2543Smrg
4154706f2543Smrg    *)
4155706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4156706f2543Smrg      ;;
4157706f2543Smrg    esac
4158706f2543Smrg  fi
4159706f2543Smrg])
4160706f2543Smrgcase $host_os in
4161706f2543Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
4162706f2543Smrg  *djgpp*)
4163706f2543Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4164706f2543Smrg    ;;
4165706f2543Smrg  *)
4166706f2543Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4167706f2543Smrg    ;;
4168706f2543Smrgesac
4169706f2543SmrgAC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4170706f2543Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4171706f2543Smrg	[How to pass a linker flag through the compiler])
4172706f2543Smrg
4173706f2543Smrg#
4174706f2543Smrg# Check to make sure the PIC flag actually works.
4175706f2543Smrg#
4176706f2543Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4177706f2543Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4178706f2543Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4179706f2543Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4180706f2543Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4181706f2543Smrg     "" | " "*) ;;
4182706f2543Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4183706f2543Smrg     esac],
4184706f2543Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4185706f2543Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4186706f2543Smrgfi
4187706f2543Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4188706f2543Smrg	[Additional compiler flags for building library objects])
4189706f2543Smrg
4190706f2543Smrg#
4191706f2543Smrg# Check to make sure the static flag actually works.
4192706f2543Smrg#
4193706f2543Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4194706f2543Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4195706f2543Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4196706f2543Smrg  $lt_tmp_static_flag,
4197706f2543Smrg  [],
4198706f2543Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4199706f2543Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4200706f2543Smrg	[Compiler flag to prevent dynamic linking])
4201706f2543Smrg])# _LT_COMPILER_PIC
4202706f2543Smrg
4203706f2543Smrg
4204706f2543Smrg# _LT_LINKER_SHLIBS([TAGNAME])
4205706f2543Smrg# ----------------------------
4206706f2543Smrg# See if the linker supports building shared libraries.
4207706f2543Smrgm4_defun([_LT_LINKER_SHLIBS],
4208706f2543Smrg[AC_REQUIRE([LT_PATH_LD])dnl
4209706f2543SmrgAC_REQUIRE([LT_PATH_NM])dnl
4210706f2543Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4211706f2543Smrgm4_require([_LT_DECL_EGREP])dnl
4212706f2543Smrgm4_require([_LT_DECL_SED])dnl
4213706f2543Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4214706f2543Smrgm4_require([_LT_TAG_COMPILER])dnl
4215706f2543SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4216706f2543Smrgm4_if([$1], [CXX], [
4217706f2543Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4218706f2543Smrg  case $host_os in
4219706f2543Smrg  aix[[4-9]]*)
4220706f2543Smrg    # If we're using GNU nm, then we don't want the "-C" option.
4221706f2543Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
4222706f2543Smrg    # Also, AIX nm treats weak defined symbols like other global defined
4223706f2543Smrg    # symbols, whereas GNU nm marks them as "W".
4224706f2543Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4225706f2543Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4226706f2543Smrg    else
4227706f2543Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4228706f2543Smrg    fi
4229706f2543Smrg    ;;
4230706f2543Smrg  pw32*)
4231706f2543Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4232706f2543Smrg  ;;
4233706f2543Smrg  cygwin* | mingw* | cegcc*)
4234706f2543Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4235706f2543Smrg  ;;
4236706f2543Smrg  *)
4237706f2543Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4238706f2543Smrg  ;;
4239706f2543Smrg  esac
4240706f2543Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4241706f2543Smrg], [
4242706f2543Smrg  runpath_var=
4243706f2543Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
4244706f2543Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
4245706f2543Smrg  _LT_TAGVAR(archive_cmds, $1)=
4246706f2543Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
4247706f2543Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
4248706f2543Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4249706f2543Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4250706f2543Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4251706f2543Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
4252706f2543Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
4253706f2543Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4254706f2543Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4255706f2543Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
4256706f2543Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4257706f2543Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
4258706f2543Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4259706f2543Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
4260706f2543Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4261706f2543Smrg  _LT_TAGVAR(module_cmds, $1)=
4262706f2543Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
4263706f2543Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4264706f2543Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4265706f2543Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4266706f2543Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4267706f2543Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
4268706f2543Smrg  # included in the symbol list
4269706f2543Smrg  _LT_TAGVAR(include_expsyms, $1)=
4270706f2543Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
4271706f2543Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
4272706f2543Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4273706f2543Smrg  # as well as any symbol that contains `d'.
4274706f2543Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4275706f2543Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4276706f2543Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
4277706f2543Smrg  # the symbol is explicitly referenced.  Since portable code cannot
4278706f2543Smrg  # rely on this symbol name, it's probably fine to never include it in
4279706f2543Smrg  # preloaded symbol tables.
4280706f2543Smrg  # Exclude shared library initialization/finalization symbols.
4281706f2543Smrgdnl Note also adjust exclude_expsyms for C++ above.
4282706f2543Smrg  extract_expsyms_cmds=
4283706f2543Smrg
4284706f2543Smrg  case $host_os in
4285706f2543Smrg  cygwin* | mingw* | pw32* | cegcc*)
4286706f2543Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
4287706f2543Smrg    # When not using gcc, we currently assume that we are using
4288706f2543Smrg    # Microsoft Visual C++.
4289706f2543Smrg    if test "$GCC" != yes; then
4290706f2543Smrg      with_gnu_ld=no
4291706f2543Smrg    fi
4292706f2543Smrg    ;;
4293706f2543Smrg  interix*)
4294706f2543Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
4295706f2543Smrg    with_gnu_ld=yes
4296706f2543Smrg    ;;
4297706f2543Smrg  openbsd*)
4298706f2543Smrg    with_gnu_ld=no
4299706f2543Smrg    ;;
4300706f2543Smrg  esac
4301706f2543Smrg
4302706f2543Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
4303706f2543Smrg
4304706f2543Smrg  # On some targets, GNU ld is compatible enough with the native linker
4305706f2543Smrg  # that we're better off using the native interface for both.
4306706f2543Smrg  lt_use_gnu_ld_interface=no
4307706f2543Smrg  if test "$with_gnu_ld" = yes; then
4308706f2543Smrg    case $host_os in
4309706f2543Smrg      aix*)
4310706f2543Smrg	# The AIX port of GNU ld has always aspired to compatibility
4311706f2543Smrg	# with the native linker.  However, as the warning in the GNU ld
4312706f2543Smrg	# block says, versions before 2.19.5* couldn't really create working
4313706f2543Smrg	# shared libraries, regardless of the interface used.
4314706f2543Smrg	case `$LD -v 2>&1` in
4315706f2543Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
4316706f2543Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
4317706f2543Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
4318706f2543Smrg	  *)
4319706f2543Smrg	    lt_use_gnu_ld_interface=yes
4320706f2543Smrg	    ;;
4321706f2543Smrg	esac
4322706f2543Smrg	;;
4323706f2543Smrg      *)
4324706f2543Smrg	lt_use_gnu_ld_interface=yes
4325706f2543Smrg	;;
4326706f2543Smrg    esac
4327706f2543Smrg  fi
4328706f2543Smrg
4329706f2543Smrg  if test "$lt_use_gnu_ld_interface" = yes; then
4330706f2543Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
4331706f2543Smrg    wlarc='${wl}'
4332706f2543Smrg
4333706f2543Smrg    # Set some defaults for GNU ld with shared library support. These
4334706f2543Smrg    # are reset later if shared libraries are not supported. Putting them
4335706f2543Smrg    # here allows them to be overridden if necessary.
4336706f2543Smrg    runpath_var=LD_RUN_PATH
4337706f2543Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4338706f2543Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4339706f2543Smrg    # ancient GNU ld didn't support --whole-archive et. al.
4340706f2543Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4341706f2543Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4342706f2543Smrg    else
4343706f2543Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4344706f2543Smrg    fi
4345706f2543Smrg    supports_anon_versioning=no
4346706f2543Smrg    case `$LD -v 2>&1` in
4347706f2543Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
4348706f2543Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4349706f2543Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4350706f2543Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4351706f2543Smrg      *\ 2.11.*) ;; # other 2.11 versions
4352706f2543Smrg      *) supports_anon_versioning=yes ;;
4353706f2543Smrg    esac
4354706f2543Smrg
4355706f2543Smrg    # See if GNU ld supports shared libraries.
4356706f2543Smrg    case $host_os in
4357706f2543Smrg    aix[[3-9]]*)
4358706f2543Smrg      # On AIX/PPC, the GNU linker is very broken
4359706f2543Smrg      if test "$host_cpu" != ia64; then
4360706f2543Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4361706f2543Smrg	cat <<_LT_EOF 1>&2
4362706f2543Smrg
4363706f2543Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
4364706f2543Smrg*** to be unable to reliably create shared libraries on AIX.
4365706f2543Smrg*** Therefore, libtool is disabling shared libraries support.  If you
4366706f2543Smrg*** really care for shared libraries, you may want to install binutils
4367706f2543Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
4368706f2543Smrg*** You will then need to restart the configuration process.
4369706f2543Smrg
4370706f2543Smrg_LT_EOF
4371706f2543Smrg      fi
4372706f2543Smrg      ;;
4373706f2543Smrg
4374706f2543Smrg    amigaos*)
4375706f2543Smrg      case $host_cpu in
4376706f2543Smrg      powerpc)
4377706f2543Smrg            # see comment about AmigaOS4 .so support
4378706f2543Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4379706f2543Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4380706f2543Smrg        ;;
4381706f2543Smrg      m68k)
4382706f2543Smrg            _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)'
4383706f2543Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4384706f2543Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4385706f2543Smrg        ;;
4386706f2543Smrg      esac
4387706f2543Smrg      ;;
4388706f2543Smrg
4389706f2543Smrg    beos*)
4390706f2543Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4391706f2543Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4392706f2543Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4393706f2543Smrg	# support --undefined.  This deserves some investigation.  FIXME
4394706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4395706f2543Smrg      else
4396706f2543Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4397706f2543Smrg      fi
4398706f2543Smrg      ;;
4399706f2543Smrg
4400706f2543Smrg    cygwin* | mingw* | pw32* | cegcc*)
4401706f2543Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4402706f2543Smrg      # as there is no search path for DLLs.
4403706f2543Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4404706f2543Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
4405706f2543Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4406706f2543Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
4407706f2543Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4408706f2543Smrg      _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'
4409706f2543Smrg
4410706f2543Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4411706f2543Smrg        _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'
4412706f2543Smrg	# If the export-symbols file already is a .def file (1st line
4413706f2543Smrg	# is EXPORTS), use it as is; otherwise, prepend...
4414706f2543Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4415706f2543Smrg	  cp $export_symbols $output_objdir/$soname.def;
4416706f2543Smrg	else
4417706f2543Smrg	  echo EXPORTS > $output_objdir/$soname.def;
4418706f2543Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
4419706f2543Smrg	fi~
4420706f2543Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4421706f2543Smrg      else
4422706f2543Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4423706f2543Smrg      fi
4424706f2543Smrg      ;;
4425706f2543Smrg
4426706f2543Smrg    haiku*)
4427706f2543Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4428706f2543Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4429706f2543Smrg      ;;
4430706f2543Smrg
4431706f2543Smrg    interix[[3-9]]*)
4432706f2543Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
4433706f2543Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4434706f2543Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4435706f2543Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4436706f2543Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4437706f2543Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
4438706f2543Smrg      # default) and relocated if they conflict, which is a slow very memory
4439706f2543Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
4440706f2543Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4441706f2543Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
4442706f2543Smrg      _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'
4443706f2543Smrg      _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'
4444706f2543Smrg      ;;
4445706f2543Smrg
4446706f2543Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
4447706f2543Smrg      tmp_diet=no
4448706f2543Smrg      if test "$host_os" = linux-dietlibc; then
4449706f2543Smrg	case $cc_basename in
4450706f2543Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
4451706f2543Smrg	esac
4452706f2543Smrg      fi
4453706f2543Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4454706f2543Smrg	 && test "$tmp_diet" = no
4455706f2543Smrg      then
4456706f2543Smrg	tmp_addflag=
4457706f2543Smrg	tmp_sharedflag='-shared'
4458706f2543Smrg	case $cc_basename,$host_cpu in
4459706f2543Smrg        pgcc*)				# Portland Group C compiler
4460706f2543Smrg	  _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'
4461706f2543Smrg	  tmp_addflag=' $pic_flag'
4462706f2543Smrg	  ;;
4463706f2543Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
4464706f2543Smrg					# Portland Group f77 and f90 compilers
4465706f2543Smrg	  _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'
4466706f2543Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
4467706f2543Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
4468706f2543Smrg	  tmp_addflag=' -i_dynamic' ;;
4469706f2543Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
4470706f2543Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
4471706f2543Smrg	ifc* | ifort*)			# Intel Fortran compiler
4472706f2543Smrg	  tmp_addflag=' -nofor_main' ;;
4473706f2543Smrg	lf95*)				# Lahey Fortran 8.1
4474706f2543Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4475706f2543Smrg	  tmp_sharedflag='--shared' ;;
4476706f2543Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
4477706f2543Smrg	  tmp_sharedflag='-qmkshrobj'
4478706f2543Smrg	  tmp_addflag= ;;
4479706f2543Smrg	nvcc*)	# Cuda Compiler Driver 2.2
4480706f2543Smrg	  _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'
4481706f2543Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4482706f2543Smrg	  ;;
4483706f2543Smrg	esac
4484706f2543Smrg	case `$CC -V 2>&1 | sed 5q` in
4485706f2543Smrg	*Sun\ C*)			# Sun C 5.9
4486706f2543Smrg	  _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'
4487706f2543Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4488706f2543Smrg	  tmp_sharedflag='-G' ;;
4489706f2543Smrg	*Sun\ F*)			# Sun Fortran 8.3
4490706f2543Smrg	  tmp_sharedflag='-G' ;;
4491706f2543Smrg	esac
4492706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4493706f2543Smrg
4494706f2543Smrg        if test "x$supports_anon_versioning" = xyes; then
4495706f2543Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4496706f2543Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4497706f2543Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
4498706f2543Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4499706f2543Smrg        fi
4500706f2543Smrg
4501706f2543Smrg	case $cc_basename in
4502706f2543Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
4503706f2543Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4504706f2543Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4505706f2543Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4506706f2543Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
4507706f2543Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
4508706f2543Smrg	  if test "x$supports_anon_versioning" = xyes; then
4509706f2543Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4510706f2543Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4511706f2543Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
4512706f2543Smrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4513706f2543Smrg	  fi
4514706f2543Smrg	  ;;
4515706f2543Smrg	esac
4516706f2543Smrg      else
4517706f2543Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
4518706f2543Smrg      fi
4519706f2543Smrg      ;;
4520706f2543Smrg
4521706f2543Smrg    netbsd*)
4522706f2543Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4523706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4524706f2543Smrg	wlarc=
4525706f2543Smrg      else
4526706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4527706f2543Smrg	_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'
4528706f2543Smrg      fi
4529706f2543Smrg      ;;
4530706f2543Smrg
4531706f2543Smrg    solaris*)
4532706f2543Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4533706f2543Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4534706f2543Smrg	cat <<_LT_EOF 1>&2
4535706f2543Smrg
4536706f2543Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
4537706f2543Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
4538706f2543Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4539706f2543Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
4540706f2543Smrg*** your PATH or compiler configuration so that the native linker is
4541706f2543Smrg*** used, and then restart.
4542706f2543Smrg
4543706f2543Smrg_LT_EOF
4544706f2543Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4545706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4546706f2543Smrg	_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'
4547706f2543Smrg      else
4548706f2543Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4549706f2543Smrg      fi
4550706f2543Smrg      ;;
4551706f2543Smrg
4552706f2543Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4553706f2543Smrg      case `$LD -v 2>&1` in
4554706f2543Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4555706f2543Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4556706f2543Smrg	cat <<_LT_EOF 1>&2
4557706f2543Smrg
4558706f2543Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4559706f2543Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
4560706f2543Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4561706f2543Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
4562706f2543Smrg*** your PATH or compiler configuration so that the native linker is
4563706f2543Smrg*** used, and then restart.
4564706f2543Smrg
4565706f2543Smrg_LT_EOF
4566706f2543Smrg	;;
4567706f2543Smrg	*)
4568706f2543Smrg	  # For security reasons, it is highly recommended that you always
4569706f2543Smrg	  # use absolute paths for naming shared libraries, and exclude the
4570706f2543Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
4571706f2543Smrg	  # requires that you compile everything twice, which is a pain.
4572706f2543Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4573706f2543Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4574706f2543Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4575706f2543Smrg	    _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'
4576706f2543Smrg	  else
4577706f2543Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
4578706f2543Smrg	  fi
4579706f2543Smrg	;;
4580706f2543Smrg      esac
4581706f2543Smrg      ;;
4582706f2543Smrg
4583706f2543Smrg    sunos4*)
4584706f2543Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4585706f2543Smrg      wlarc=
4586706f2543Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4587706f2543Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4588706f2543Smrg      ;;
4589706f2543Smrg
4590706f2543Smrg    *)
4591706f2543Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4592706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4593706f2543Smrg	_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'
4594706f2543Smrg      else
4595706f2543Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4596706f2543Smrg      fi
4597706f2543Smrg      ;;
4598706f2543Smrg    esac
4599706f2543Smrg
4600706f2543Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4601706f2543Smrg      runpath_var=
4602706f2543Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4603706f2543Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4604706f2543Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4605706f2543Smrg    fi
4606706f2543Smrg  else
4607706f2543Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
4608706f2543Smrg    case $host_os in
4609706f2543Smrg    aix3*)
4610706f2543Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4611706f2543Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
4612706f2543Smrg      _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'
4613706f2543Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
4614706f2543Smrg      # are no directories specified by -L.
4615706f2543Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4616706f2543Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4617706f2543Smrg	# Neither direct hardcoding nor static linking is supported with a
4618706f2543Smrg	# broken collect2.
4619706f2543Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
4620706f2543Smrg      fi
4621706f2543Smrg      ;;
4622706f2543Smrg
4623706f2543Smrg    aix[[4-9]]*)
4624706f2543Smrg      if test "$host_cpu" = ia64; then
4625706f2543Smrg	# On IA64, the linker does run time linking by default, so we don't
4626706f2543Smrg	# have to do anything special.
4627706f2543Smrg	aix_use_runtimelinking=no
4628706f2543Smrg	exp_sym_flag='-Bexport'
4629706f2543Smrg	no_entry_flag=""
4630706f2543Smrg      else
4631706f2543Smrg	# If we're using GNU nm, then we don't want the "-C" option.
4632706f2543Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
4633706f2543Smrg	# Also, AIX nm treats weak defined symbols like other global
4634706f2543Smrg	# defined symbols, whereas GNU nm marks them as "W".
4635706f2543Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4636706f2543Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4637706f2543Smrg	else
4638706f2543Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4639706f2543Smrg	fi
4640706f2543Smrg	aix_use_runtimelinking=no
4641706f2543Smrg
4642706f2543Smrg	# Test if we are trying to use run time linking or normal
4643706f2543Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
4644706f2543Smrg	# need to do runtime linking.
4645706f2543Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
4646706f2543Smrg	  for ld_flag in $LDFLAGS; do
4647706f2543Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
4648706f2543Smrg	    aix_use_runtimelinking=yes
4649706f2543Smrg	    break
4650706f2543Smrg	  fi
4651706f2543Smrg	  done
4652706f2543Smrg	  ;;
4653706f2543Smrg	esac
4654706f2543Smrg
4655706f2543Smrg	exp_sym_flag='-bexport'
4656706f2543Smrg	no_entry_flag='-bnoentry'
4657706f2543Smrg      fi
4658706f2543Smrg
4659706f2543Smrg      # When large executables or shared objects are built, AIX ld can
4660706f2543Smrg      # have problems creating the table of contents.  If linking a library
4661706f2543Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
4662706f2543Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
4663706f2543Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
4664706f2543Smrg
4665706f2543Smrg      _LT_TAGVAR(archive_cmds, $1)=''
4666706f2543Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4667706f2543Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4668706f2543Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
4669706f2543Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4670706f2543Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
4671706f2543Smrg
4672706f2543Smrg      if test "$GCC" = yes; then
4673706f2543Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
4674706f2543Smrg	# We only want to do this on AIX 4.2 and lower, the check
4675706f2543Smrg	# below for broken collect2 doesn't work under 4.3+
4676706f2543Smrg	  collect2name=`${CC} -print-prog-name=collect2`
4677706f2543Smrg	  if test -f "$collect2name" &&
4678706f2543Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
4679706f2543Smrg	  then
4680706f2543Smrg	  # We have reworked collect2
4681706f2543Smrg	  :
4682706f2543Smrg	  else
4683706f2543Smrg	  # We have old collect2
4684706f2543Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
4685706f2543Smrg	  # It fails to find uninstalled libraries when the uninstalled
4686706f2543Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
4687706f2543Smrg	  # to unsupported forces relinking
4688706f2543Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
4689706f2543Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4690706f2543Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4691706f2543Smrg	  fi
4692706f2543Smrg	  ;;
4693706f2543Smrg	esac
4694706f2543Smrg	shared_flag='-shared'
4695706f2543Smrg	if test "$aix_use_runtimelinking" = yes; then
4696706f2543Smrg	  shared_flag="$shared_flag "'${wl}-G'
4697706f2543Smrg	fi
4698706f2543Smrg      else
4699706f2543Smrg	# not using gcc
4700706f2543Smrg	if test "$host_cpu" = ia64; then
4701706f2543Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
4702706f2543Smrg	# chokes on -Wl,-G. The following line is correct:
4703706f2543Smrg	  shared_flag='-G'
4704706f2543Smrg	else
4705706f2543Smrg	  if test "$aix_use_runtimelinking" = yes; then
4706706f2543Smrg	    shared_flag='${wl}-G'
4707706f2543Smrg	  else
4708706f2543Smrg	    shared_flag='${wl}-bM:SRE'
4709706f2543Smrg	  fi
4710706f2543Smrg	fi
4711706f2543Smrg      fi
4712706f2543Smrg
4713706f2543Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
4714706f2543Smrg      # It seems that -bexpall does not export symbols beginning with
4715706f2543Smrg      # underscore (_), so it is better to generate a list of symbols to export.
4716706f2543Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
4717706f2543Smrg      if test "$aix_use_runtimelinking" = yes; then
4718706f2543Smrg	# Warning - without using the other runtime loading flags (-brtl),
4719706f2543Smrg	# -berok will link without error, but may produce a broken library.
4720706f2543Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
4721706f2543Smrg        # Determine the default libpath from the value encoded in an
4722706f2543Smrg        # empty executable.
4723706f2543Smrg        _LT_SYS_MODULE_PATH_AIX
4724706f2543Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4725706f2543Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
4726706f2543Smrg      else
4727706f2543Smrg	if test "$host_cpu" = ia64; then
4728706f2543Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
4729706f2543Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
4730706f2543Smrg	  _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"
4731706f2543Smrg	else
4732706f2543Smrg	 # Determine the default libpath from the value encoded in an
4733706f2543Smrg	 # empty executable.
4734706f2543Smrg	 _LT_SYS_MODULE_PATH_AIX
4735706f2543Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4736706f2543Smrg	  # Warning - without using the other run time loading flags,
4737706f2543Smrg	  # -berok will link without error, but may produce a broken library.
4738706f2543Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
4739706f2543Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
4740706f2543Smrg	  if test "$with_gnu_ld" = yes; then
4741706f2543Smrg	    # We only use this code for GNU lds that support --whole-archive.
4742706f2543Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
4743706f2543Smrg	  else
4744706f2543Smrg	    # Exported symbols can be pulled into shared objects from archives
4745706f2543Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
4746706f2543Smrg	  fi
4747706f2543Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
4748706f2543Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
4749706f2543Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
4750706f2543Smrg	fi
4751706f2543Smrg      fi
4752706f2543Smrg      ;;
4753706f2543Smrg
4754706f2543Smrg    amigaos*)
4755706f2543Smrg      case $host_cpu in
4756706f2543Smrg      powerpc)
4757706f2543Smrg            # see comment about AmigaOS4 .so support
4758706f2543Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4759706f2543Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4760706f2543Smrg        ;;
4761706f2543Smrg      m68k)
4762706f2543Smrg            _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)'
4763706f2543Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4764706f2543Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4765706f2543Smrg        ;;
4766706f2543Smrg      esac
4767706f2543Smrg      ;;
4768706f2543Smrg
4769706f2543Smrg    bsdi[[45]]*)
4770706f2543Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
4771706f2543Smrg      ;;
4772706f2543Smrg
4773706f2543Smrg    cygwin* | mingw* | pw32* | cegcc*)
4774706f2543Smrg      # When not using gcc, we currently assume that we are using
4775706f2543Smrg      # Microsoft Visual C++.
4776706f2543Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
4777706f2543Smrg      # no search path for DLLs.
4778706f2543Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
4779706f2543Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4780706f2543Smrg      # Tell ltmain to make .lib files, not .a files.
4781706f2543Smrg      libext=lib
4782706f2543Smrg      # Tell ltmain to make .dll files, not .so files.
4783706f2543Smrg      shrext_cmds=".dll"
4784706f2543Smrg      # FIXME: Setting linknames here is a bad hack.
4785706f2543Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
4786706f2543Smrg      # The linker will automatically build a .lib file if we build a DLL.
4787706f2543Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
4788706f2543Smrg      # FIXME: Should let the user specify the lib program.
4789706f2543Smrg      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
4790706f2543Smrg      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
4791706f2543Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4792706f2543Smrg      ;;
4793706f2543Smrg
4794706f2543Smrg    darwin* | rhapsody*)
4795706f2543Smrg      _LT_DARWIN_LINKER_FEATURES($1)
4796706f2543Smrg      ;;
4797706f2543Smrg
4798706f2543Smrg    dgux*)
4799706f2543Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4800706f2543Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4801706f2543Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4802706f2543Smrg      ;;
4803706f2543Smrg
4804706f2543Smrg    freebsd1*)
4805706f2543Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
4806706f2543Smrg      ;;
4807706f2543Smrg
4808706f2543Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
4809706f2543Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
4810706f2543Smrg    # does not break anything, and helps significantly (at the cost of a little
4811706f2543Smrg    # extra space).
4812706f2543Smrg    freebsd2.2*)
4813706f2543Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
4814706f2543Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4815706f2543Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4816706f2543Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4817706f2543Smrg      ;;
4818706f2543Smrg
4819706f2543Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
4820706f2543Smrg    freebsd2*)
4821706f2543Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4822706f2543Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4823706f2543Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4824706f2543Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4825706f2543Smrg      ;;
4826706f2543Smrg
4827706f2543Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
4828706f2543Smrg    freebsd* | dragonfly*)
4829706f2543Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
4830706f2543Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4831706f2543Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4832706f2543Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4833706f2543Smrg      ;;
4834706f2543Smrg
4835706f2543Smrg    hpux9*)
4836706f2543Smrg      if test "$GCC" = yes; then
4837706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
4838706f2543Smrg      else
4839706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
4840706f2543Smrg      fi
4841706f2543Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4842706f2543Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4843706f2543Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4844706f2543Smrg
4845706f2543Smrg      # hardcode_minus_L: Not really in the search PATH,
4846706f2543Smrg      # but as the default location of the library.
4847706f2543Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4848706f2543Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4849706f2543Smrg      ;;
4850706f2543Smrg
4851706f2543Smrg    hpux10*)
4852706f2543Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
4853706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4854706f2543Smrg      else
4855706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
4856706f2543Smrg      fi
4857706f2543Smrg      if test "$with_gnu_ld" = no; then
4858706f2543Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4859706f2543Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
4860706f2543Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
4861706f2543Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
4862706f2543Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4863706f2543Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4864706f2543Smrg	# hardcode_minus_L: Not really in the search PATH,
4865706f2543Smrg	# but as the default location of the library.
4866706f2543Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
4867706f2543Smrg      fi
4868706f2543Smrg      ;;
4869706f2543Smrg
4870706f2543Smrg    hpux11*)
4871706f2543Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
4872706f2543Smrg	case $host_cpu in
4873706f2543Smrg	hppa*64*)
4874706f2543Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4875706f2543Smrg	  ;;
4876706f2543Smrg	ia64*)
4877706f2543Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4878706f2543Smrg	  ;;
4879706f2543Smrg	*)
4880706f2543Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4881706f2543Smrg	  ;;
4882706f2543Smrg	esac
4883706f2543Smrg      else
4884706f2543Smrg	case $host_cpu in
4885706f2543Smrg	hppa*64*)
4886706f2543Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4887706f2543Smrg	  ;;
4888706f2543Smrg	ia64*)
4889706f2543Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4890706f2543Smrg	  ;;
4891706f2543Smrg	*)
4892706f2543Smrg	m4_if($1, [], [
4893706f2543Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
4894706f2543Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
4895706f2543Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
4896706f2543Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
4897706f2543Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
4898706f2543Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
4899706f2543Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
4900706f2543Smrg	  ;;
4901706f2543Smrg	esac
4902706f2543Smrg      fi
4903706f2543Smrg      if test "$with_gnu_ld" = no; then
4904706f2543Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4905706f2543Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
4906706f2543Smrg
4907706f2543Smrg	case $host_cpu in
4908706f2543Smrg	hppa*64*|ia64*)
4909706f2543Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
4910706f2543Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4911706f2543Smrg	  ;;
4912706f2543Smrg	*)
4913706f2543Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
4914706f2543Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4915706f2543Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4916706f2543Smrg
4917706f2543Smrg	  # hardcode_minus_L: Not really in the search PATH,
4918706f2543Smrg	  # but as the default location of the library.
4919706f2543Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
4920706f2543Smrg	  ;;
4921706f2543Smrg	esac
4922706f2543Smrg      fi
4923706f2543Smrg      ;;
4924706f2543Smrg
4925706f2543Smrg    irix5* | irix6* | nonstopux*)
4926706f2543Smrg      if test "$GCC" = yes; then
4927706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4928706f2543Smrg	# Try to use the -exported_symbol ld option, if it does not
4929706f2543Smrg	# work, assume that -exports_file does not work either and
4930706f2543Smrg	# implicitly export all symbols.
4931706f2543Smrg        save_LDFLAGS="$LDFLAGS"
4932706f2543Smrg        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
4933706f2543Smrg        AC_LINK_IFELSE(int foo(void) {},
4934706f2543Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
4935706f2543Smrg        )
4936706f2543Smrg        LDFLAGS="$save_LDFLAGS"
4937706f2543Smrg      else
4938706f2543Smrg	_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'
4939706f2543Smrg	_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'
4940706f2543Smrg      fi
4941706f2543Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4942706f2543Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4943706f2543Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4944706f2543Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
4945706f2543Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4946706f2543Smrg      ;;
4947706f2543Smrg
4948706f2543Smrg    netbsd*)
4949706f2543Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4950706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
4951706f2543Smrg      else
4952706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
4953706f2543Smrg      fi
4954706f2543Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4955706f2543Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4956706f2543Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4957706f2543Smrg      ;;
4958706f2543Smrg
4959706f2543Smrg    newsos6)
4960706f2543Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4961706f2543Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4962706f2543Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4963706f2543Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4964706f2543Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4965706f2543Smrg      ;;
4966706f2543Smrg
4967706f2543Smrg    *nto* | *qnx*)
4968706f2543Smrg      ;;
4969706f2543Smrg
4970706f2543Smrg    openbsd*)
4971706f2543Smrg      if test -f /usr/libexec/ld.so; then
4972706f2543Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
4973706f2543Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4974706f2543Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4975706f2543Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4976706f2543Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4977706f2543Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
4978706f2543Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4979706f2543Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4980706f2543Smrg	else
4981706f2543Smrg	  case $host_os in
4982706f2543Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
4983706f2543Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4984706f2543Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4985706f2543Smrg	     ;;
4986706f2543Smrg	   *)
4987706f2543Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4988706f2543Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4989706f2543Smrg	     ;;
4990706f2543Smrg	  esac
4991706f2543Smrg	fi
4992706f2543Smrg      else
4993706f2543Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4994706f2543Smrg      fi
4995706f2543Smrg      ;;
4996706f2543Smrg
4997706f2543Smrg    os2*)
4998706f2543Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4999706f2543Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5000706f2543Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5001706f2543Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
5002706f2543Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5003706f2543Smrg      ;;
5004706f2543Smrg
5005706f2543Smrg    osf3*)
5006706f2543Smrg      if test "$GCC" = yes; then
5007706f2543Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5008706f2543Smrg	_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'
5009706f2543Smrg      else
5010706f2543Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5011706f2543Smrg	_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'
5012706f2543Smrg      fi
5013706f2543Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5014706f2543Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5015706f2543Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5016706f2543Smrg      ;;
5017706f2543Smrg
5018706f2543Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5019706f2543Smrg      if test "$GCC" = yes; then
5020706f2543Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5021706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5022706f2543Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5023706f2543Smrg      else
5024706f2543Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5025706f2543Smrg	_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'
5026706f2543Smrg	_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~
5027706f2543Smrg	$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'
5028706f2543Smrg
5029706f2543Smrg	# Both c and cxx compiler support -rpath directly
5030706f2543Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5031706f2543Smrg      fi
5032706f2543Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5033706f2543Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5034706f2543Smrg      ;;
5035706f2543Smrg
5036706f2543Smrg    solaris*)
5037706f2543Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5038706f2543Smrg      if test "$GCC" = yes; then
5039706f2543Smrg	wlarc='${wl}'
5040706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5041706f2543Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5042706f2543Smrg	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5043706f2543Smrg      else
5044706f2543Smrg	case `$CC -V 2>&1` in
5045706f2543Smrg	*"Compilers 5.0"*)
5046706f2543Smrg	  wlarc=''
5047706f2543Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5048706f2543Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5049706f2543Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5050706f2543Smrg	  ;;
5051706f2543Smrg	*)
5052706f2543Smrg	  wlarc='${wl}'
5053706f2543Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5054706f2543Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5055706f2543Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5056706f2543Smrg	  ;;
5057706f2543Smrg	esac
5058706f2543Smrg      fi
5059706f2543Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5060706f2543Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5061706f2543Smrg      case $host_os in
5062706f2543Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5063706f2543Smrg      *)
5064706f2543Smrg	# The compiler driver will combine and reorder linker options,
5065706f2543Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
5066706f2543Smrg	# but is careful enough not to reorder.
5067706f2543Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
5068706f2543Smrg	if test "$GCC" = yes; then
5069706f2543Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
5070706f2543Smrg	else
5071706f2543Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5072706f2543Smrg	fi
5073706f2543Smrg	;;
5074706f2543Smrg      esac
5075706f2543Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5076706f2543Smrg      ;;
5077706f2543Smrg
5078706f2543Smrg    sunos4*)
5079706f2543Smrg      if test "x$host_vendor" = xsequent; then
5080706f2543Smrg	# Use $CC to link under sequent, because it throws in some extra .o
5081706f2543Smrg	# files that make .init and .fini sections work.
5082706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5083706f2543Smrg      else
5084706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5085706f2543Smrg      fi
5086706f2543Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5087706f2543Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5088706f2543Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5089706f2543Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5090706f2543Smrg      ;;
5091706f2543Smrg
5092706f2543Smrg    sysv4)
5093706f2543Smrg      case $host_vendor in
5094706f2543Smrg	sni)
5095706f2543Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5096706f2543Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5097706f2543Smrg	;;
5098706f2543Smrg	siemens)
5099706f2543Smrg	  ## LD is ld it makes a PLAMLIB
5100706f2543Smrg	  ## CC just makes a GrossModule.
5101706f2543Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5102706f2543Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5103706f2543Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5104706f2543Smrg        ;;
5105706f2543Smrg	motorola)
5106706f2543Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5107706f2543Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5108706f2543Smrg	;;
5109706f2543Smrg      esac
5110706f2543Smrg      runpath_var='LD_RUN_PATH'
5111706f2543Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5112706f2543Smrg      ;;
5113706f2543Smrg
5114706f2543Smrg    sysv4.3*)
5115706f2543Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5116706f2543Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5117706f2543Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5118706f2543Smrg      ;;
5119706f2543Smrg
5120706f2543Smrg    sysv4*MP*)
5121706f2543Smrg      if test -d /usr/nec; then
5122706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5123706f2543Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5124706f2543Smrg	runpath_var=LD_RUN_PATH
5125706f2543Smrg	hardcode_runpath_var=yes
5126706f2543Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5127706f2543Smrg      fi
5128706f2543Smrg      ;;
5129706f2543Smrg
5130706f2543Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5131706f2543Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5132706f2543Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5133706f2543Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5134706f2543Smrg      runpath_var='LD_RUN_PATH'
5135706f2543Smrg
5136706f2543Smrg      if test "$GCC" = yes; then
5137706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5138706f2543Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5139706f2543Smrg      else
5140706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5141706f2543Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5142706f2543Smrg      fi
5143706f2543Smrg      ;;
5144706f2543Smrg
5145706f2543Smrg    sysv5* | sco3.2v5* | sco5v6*)
5146706f2543Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
5147706f2543Smrg      # link with -lc, and that would cause any symbols used from libc to
5148706f2543Smrg      # always be unresolved, which means just about no library would
5149706f2543Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
5150706f2543Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
5151706f2543Smrg      # as -z defs.
5152706f2543Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5153706f2543Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5154706f2543Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5155706f2543Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5156706f2543Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5157706f2543Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5158706f2543Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5159706f2543Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5160706f2543Smrg      runpath_var='LD_RUN_PATH'
5161706f2543Smrg
5162706f2543Smrg      if test "$GCC" = yes; then
5163706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5164706f2543Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5165706f2543Smrg      else
5166706f2543Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5167706f2543Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5168706f2543Smrg      fi
5169706f2543Smrg      ;;
5170706f2543Smrg
5171706f2543Smrg    uts4*)
5172706f2543Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5173706f2543Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5174706f2543Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5175706f2543Smrg      ;;
5176706f2543Smrg
5177706f2543Smrg    *)
5178706f2543Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
5179706f2543Smrg      ;;
5180706f2543Smrg    esac
5181706f2543Smrg
5182706f2543Smrg    if test x$host_vendor = xsni; then
5183706f2543Smrg      case $host in
5184706f2543Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5185706f2543Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5186706f2543Smrg	;;
5187706f2543Smrg      esac
5188706f2543Smrg    fi
5189706f2543Smrg  fi
5190706f2543Smrg])
5191706f2543SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5192706f2543Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5193706f2543Smrg
5194706f2543Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5195706f2543Smrg
5196706f2543Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5197706f2543Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5198706f2543Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
5199706f2543Smrg    [The commands to extract the exported symbol list from a shared archive])
5200706f2543Smrg
5201706f2543Smrg#
5202706f2543Smrg# Do we need to explicitly link libc?
5203706f2543Smrg#
5204706f2543Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5205706f2543Smrgx|xyes)
5206706f2543Smrg  # Assume -lc should be added
5207706f2543Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5208706f2543Smrg
5209706f2543Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
5210706f2543Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
5211706f2543Smrg    *'~'*)
5212706f2543Smrg      # FIXME: we may have to deal with multi-command sequences.
5213706f2543Smrg      ;;
5214706f2543Smrg    '$CC '*)
5215706f2543Smrg      # Test whether the compiler implicitly links with -lc since on some
5216706f2543Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
5217706f2543Smrg      # to ld, don't add -lc before -lgcc.
5218706f2543Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
5219706f2543Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
5220706f2543Smrg	[$RM -r conftest*
5221706f2543Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5222706f2543Smrg
5223706f2543Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
5224706f2543Smrg	  soname=conftest
5225706f2543Smrg	  lib=conftest
5226706f2543Smrg	  libobjs=conftest.$ac_objext
5227706f2543Smrg	  deplibs=
5228706f2543Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
5229706f2543Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
5230706f2543Smrg	  compiler_flags=-v
5231706f2543Smrg	  linker_flags=-v
5232706f2543Smrg	  verstring=
5233706f2543Smrg	  output_objdir=.
5234706f2543Smrg	  libname=conftest
5235706f2543Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
5236706f2543Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
5237706f2543Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
5238706f2543Smrg	  then
5239706f2543Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5240706f2543Smrg	  else
5241706f2543Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5242706f2543Smrg	  fi
5243706f2543Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
5244706f2543Smrg	else
5245706f2543Smrg	  cat conftest.err 1>&5
5246706f2543Smrg	fi
5247706f2543Smrg	$RM -r conftest*
5248706f2543Smrg	])
5249706f2543Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
5250706f2543Smrg      ;;
5251706f2543Smrg    esac
5252706f2543Smrg  fi
5253706f2543Smrg  ;;
5254706f2543Smrgesac
5255706f2543Smrg
5256706f2543Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5257706f2543Smrg    [Whether or not to add -lc for building shared libraries])
5258706f2543Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5259706f2543Smrg    [enable_shared_with_static_runtimes], [0],
5260706f2543Smrg    [Whether or not to disallow shared libs when runtime libs are static])
5261706f2543Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5262706f2543Smrg    [Compiler flag to allow reflexive dlopens])
5263706f2543Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
5264706f2543Smrg    [Compiler flag to generate shared objects directly from archives])
5265706f2543Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
5266706f2543Smrg    [Whether the compiler copes with passing no objects directly])
5267706f2543Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5268706f2543Smrg    [Create an old-style archive from a shared archive])
5269706f2543Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5270706f2543Smrg    [Create a temporary old-style archive to link instead of a shared archive])
5271706f2543Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5272706f2543Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
5273706f2543Smrg_LT_TAGDECL([], [module_cmds], [2],
5274706f2543Smrg    [Commands used to build a loadable module if different from building
5275706f2543Smrg    a shared archive.])
5276706f2543Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
5277706f2543Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
5278706f2543Smrg    [Whether we are building with GNU ld or not])
5279706f2543Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
5280706f2543Smrg    [Flag that allows shared libraries with undefined symbols to be built])
5281706f2543Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
5282706f2543Smrg    [Flag that enforces no undefined symbols])
5283706f2543Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5284706f2543Smrg    [Flag to hardcode $libdir into a binary during linking.
5285706f2543Smrg    This must work even if $libdir does not exist])
5286706f2543Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
5287706f2543Smrg    [[If ld is used when linking, flag to hardcode $libdir into a binary
5288706f2543Smrg    during linking.  This must work even if $libdir does not exist]])
5289706f2543Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
5290706f2543Smrg    [Whether we need a single "-rpath" flag with a separated argument])
5291706f2543Smrg_LT_TAGDECL([], [hardcode_direct], [0],
5292706f2543Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5293706f2543Smrg    DIR into the resulting binary])
5294706f2543Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
5295706f2543Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5296706f2543Smrg    DIR into the resulting binary and the resulting library dependency is
5297706f2543Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5298706f2543Smrg    library is relocated])
5299706f2543Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
5300706f2543Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5301706f2543Smrg    into the resulting binary])
5302706f2543Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5303706f2543Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5304706f2543Smrg    into the resulting binary])
5305706f2543Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
5306706f2543Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
5307706f2543Smrg    into the library and all subsequent libraries and executables linked
5308706f2543Smrg    against it])
5309706f2543Smrg_LT_TAGDECL([], [inherit_rpath], [0],
5310706f2543Smrg    [Set to yes if linker adds runtime paths of dependent libraries
5311706f2543Smrg    to runtime path list])
5312706f2543Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
5313706f2543Smrg    [Whether libtool must link a program against all its dependency libraries])
5314706f2543Smrg_LT_TAGDECL([], [fix_srcfile_path], [1],
5315706f2543Smrg    [Fix the shell variable $srcfile for the compiler])
5316706f2543Smrg_LT_TAGDECL([], [always_export_symbols], [0],
5317706f2543Smrg    [Set to "yes" if exported symbols are required])
5318706f2543Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
5319706f2543Smrg    [The commands to list exported symbols])
5320706f2543Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
5321706f2543Smrg    [Symbols that should not be listed in the preloaded symbols])
5322706f2543Smrg_LT_TAGDECL([], [include_expsyms], [1],
5323706f2543Smrg    [Symbols that must always be exported])
5324706f2543Smrg_LT_TAGDECL([], [prelink_cmds], [2],
5325706f2543Smrg    [Commands necessary for linking programs (against libraries) with templates])
5326706f2543Smrg_LT_TAGDECL([], [file_list_spec], [1],
5327706f2543Smrg    [Specify filename containing input files])
5328706f2543Smrgdnl FIXME: Not yet implemented
5329706f2543Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5330706f2543Smrgdnl    [Compiler flag to generate thread safe objects])
5331706f2543Smrg])# _LT_LINKER_SHLIBS
5332706f2543Smrg
5333706f2543Smrg
5334706f2543Smrg# _LT_LANG_C_CONFIG([TAG])
5335706f2543Smrg# ------------------------
5336706f2543Smrg# Ensure that the configuration variables for a C compiler are suitably
5337706f2543Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5338706f2543Smrg# the compiler configuration to `libtool'.
5339706f2543Smrgm4_defun([_LT_LANG_C_CONFIG],
5340706f2543Smrg[m4_require([_LT_DECL_EGREP])dnl
5341706f2543Smrglt_save_CC="$CC"
5342706f2543SmrgAC_LANG_PUSH(C)
5343706f2543Smrg
5344706f2543Smrg# Source file extension for C test sources.
5345706f2543Smrgac_ext=c
5346706f2543Smrg
5347706f2543Smrg# Object file extension for compiled C test sources.
5348706f2543Smrgobjext=o
5349706f2543Smrg_LT_TAGVAR(objext, $1)=$objext
5350706f2543Smrg
5351706f2543Smrg# Code to be used in simple compile tests
5352706f2543Smrglt_simple_compile_test_code="int some_variable = 0;"
5353706f2543Smrg
5354706f2543Smrg# Code to be used in simple link tests
5355706f2543Smrglt_simple_link_test_code='int main(){return(0);}'
5356706f2543Smrg
5357706f2543Smrg_LT_TAG_COMPILER
5358706f2543Smrg# Save the default compiler, since it gets overwritten when the other
5359706f2543Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5360706f2543Smrgcompiler_DEFAULT=$CC
5361706f2543Smrg
5362706f2543Smrg# save warnings/boilerplate of simple test code
5363706f2543Smrg_LT_COMPILER_BOILERPLATE
5364706f2543Smrg_LT_LINKER_BOILERPLATE
5365706f2543Smrg
5366706f2543Smrg## CAVEAT EMPTOR:
5367706f2543Smrg## There is no encapsulation within the following macros, do not change
5368706f2543Smrg## the running order or otherwise move them around unless you know exactly
5369706f2543Smrg## what you are doing...
5370706f2543Smrgif test -n "$compiler"; then
5371706f2543Smrg  _LT_COMPILER_NO_RTTI($1)
5372706f2543Smrg  _LT_COMPILER_PIC($1)
5373706f2543Smrg  _LT_COMPILER_C_O($1)
5374706f2543Smrg  _LT_COMPILER_FILE_LOCKS($1)
5375706f2543Smrg  _LT_LINKER_SHLIBS($1)
5376706f2543Smrg  _LT_SYS_DYNAMIC_LINKER($1)
5377706f2543Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
5378706f2543Smrg  LT_SYS_DLOPEN_SELF
5379706f2543Smrg  _LT_CMD_STRIPLIB
5380706f2543Smrg
5381706f2543Smrg  # Report which library types will actually be built
5382706f2543Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
5383706f2543Smrg  AC_MSG_RESULT([$can_build_shared])
5384706f2543Smrg
5385706f2543Smrg  AC_MSG_CHECKING([whether to build shared libraries])
5386706f2543Smrg  test "$can_build_shared" = "no" && enable_shared=no
5387706f2543Smrg
5388706f2543Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
5389706f2543Smrg  # are all built from PIC.
5390706f2543Smrg  case $host_os in
5391706f2543Smrg  aix3*)
5392706f2543Smrg    test "$enable_shared" = yes && enable_static=no
5393706f2543Smrg    if test -n "$RANLIB"; then
5394706f2543Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
5395706f2543Smrg      postinstall_cmds='$RANLIB $lib'
5396706f2543Smrg    fi
5397706f2543Smrg    ;;
5398706f2543Smrg
5399706f2543Smrg  aix[[4-9]]*)
5400706f2543Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5401706f2543Smrg      test "$enable_shared" = yes && enable_static=no
5402706f2543Smrg    fi
5403706f2543Smrg    ;;
5404706f2543Smrg  esac
5405706f2543Smrg  AC_MSG_RESULT([$enable_shared])
5406706f2543Smrg
5407706f2543Smrg  AC_MSG_CHECKING([whether to build static libraries])
5408706f2543Smrg  # Make sure either enable_shared or enable_static is yes.
5409706f2543Smrg  test "$enable_shared" = yes || enable_static=yes
5410706f2543Smrg  AC_MSG_RESULT([$enable_static])
5411706f2543Smrg
5412706f2543Smrg  _LT_CONFIG($1)
5413706f2543Smrgfi
5414706f2543SmrgAC_LANG_POP
5415706f2543SmrgCC="$lt_save_CC"
5416706f2543Smrg])# _LT_LANG_C_CONFIG
5417706f2543Smrg
5418706f2543Smrg
5419706f2543Smrg# _LT_LANG_CXX_CONFIG([TAG])
5420706f2543Smrg# --------------------------
5421706f2543Smrg# Ensure that the configuration variables for a C++ compiler are suitably
5422706f2543Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5423706f2543Smrg# the compiler configuration to `libtool'.
5424706f2543Smrgm4_defun([_LT_LANG_CXX_CONFIG],
5425706f2543Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5426706f2543Smrgm4_require([_LT_DECL_EGREP])dnl
5427706f2543Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5428706f2543Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5429706f2543Smrg    (test "X$CXX" != "Xg++"))) ; then
5430706f2543Smrg  AC_PROG_CXXCPP
5431706f2543Smrgelse
5432706f2543Smrg  _lt_caught_CXX_error=yes
5433706f2543Smrgfi
5434706f2543Smrg
5435706f2543SmrgAC_LANG_PUSH(C++)
5436706f2543Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5437706f2543Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
5438706f2543Smrg_LT_TAGVAR(always_export_symbols, $1)=no
5439706f2543Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
5440706f2543Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
5441706f2543Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
5442706f2543Smrg_LT_TAGVAR(hardcode_direct, $1)=no
5443706f2543Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5444706f2543Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5445706f2543Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5446706f2543Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
5447706f2543Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
5448706f2543Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5449706f2543Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
5450706f2543Smrg_LT_TAGVAR(inherit_rpath, $1)=no
5451706f2543Smrg_LT_TAGVAR(module_cmds, $1)=
5452706f2543Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
5453706f2543Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
5454706f2543Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5455706f2543Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
5456706f2543Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
5457706f2543Smrg_LT_TAGVAR(no_undefined_flag, $1)=
5458706f2543Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
5459706f2543Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5460706f2543Smrg
5461706f2543Smrg# Source file extension for C++ test sources.
5462706f2543Smrgac_ext=cpp
5463706f2543Smrg
5464706f2543Smrg# Object file extension for compiled C++ test sources.
5465706f2543Smrgobjext=o
5466706f2543Smrg_LT_TAGVAR(objext, $1)=$objext
5467706f2543Smrg
5468706f2543Smrg# No sense in running all these tests if we already determined that
5469706f2543Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
5470706f2543Smrg# are currently assumed to apply to all compilers on this platform,
5471706f2543Smrg# and will be corrupted by setting them based on a non-working compiler.
5472706f2543Smrgif test "$_lt_caught_CXX_error" != yes; then
5473706f2543Smrg  # Code to be used in simple compile tests
5474706f2543Smrg  lt_simple_compile_test_code="int some_variable = 0;"
5475706f2543Smrg
5476706f2543Smrg  # Code to be used in simple link tests
5477706f2543Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5478706f2543Smrg
5479706f2543Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5480706f2543Smrg  _LT_TAG_COMPILER
5481706f2543Smrg
5482706f2543Smrg  # save warnings/boilerplate of simple test code
5483706f2543Smrg  _LT_COMPILER_BOILERPLATE
5484706f2543Smrg  _LT_LINKER_BOILERPLATE
5485706f2543Smrg
5486706f2543Smrg  # Allow CC to be a program name with arguments.
5487706f2543Smrg  lt_save_CC=$CC
5488706f2543Smrg  lt_save_LD=$LD
5489706f2543Smrg  lt_save_GCC=$GCC
5490706f2543Smrg  GCC=$GXX
5491706f2543Smrg  lt_save_with_gnu_ld=$with_gnu_ld
5492706f2543Smrg  lt_save_path_LD=$lt_cv_path_LD
5493706f2543Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5494706f2543Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5495706f2543Smrg  else
5496706f2543Smrg    $as_unset lt_cv_prog_gnu_ld
5497706f2543Smrg  fi
5498706f2543Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
5499706f2543Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
5500706f2543Smrg  else
5501706f2543Smrg    $as_unset lt_cv_path_LD
5502706f2543Smrg  fi
5503706f2543Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
5504706f2543Smrg  CC=${CXX-"c++"}
5505706f2543Smrg  compiler=$CC
5506706f2543Smrg  _LT_TAGVAR(compiler, $1)=$CC
5507706f2543Smrg  _LT_CC_BASENAME([$compiler])
5508706f2543Smrg
5509706f2543Smrg  if test -n "$compiler"; then
5510706f2543Smrg    # We don't want -fno-exception when compiling C++ code, so set the
5511706f2543Smrg    # no_builtin_flag separately
5512706f2543Smrg    if test "$GXX" = yes; then
5513706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5514706f2543Smrg    else
5515706f2543Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5516706f2543Smrg    fi
5517706f2543Smrg
5518706f2543Smrg    if test "$GXX" = yes; then
5519706f2543Smrg      # Set up default GNU C++ configuration
5520706f2543Smrg
5521706f2543Smrg      LT_PATH_LD
5522706f2543Smrg
5523706f2543Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
5524706f2543Smrg      # archiving commands below assume that GNU ld is being used.
5525706f2543Smrg      if test "$with_gnu_ld" = yes; then
5526706f2543Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5527706f2543Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5528706f2543Smrg
5529706f2543Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5530706f2543Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5531706f2543Smrg
5532706f2543Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
5533706f2543Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5534706f2543Smrg        #     investigate it a little bit more. (MM)
5535706f2543Smrg        wlarc='${wl}'
5536706f2543Smrg
5537706f2543Smrg        # ancient GNU ld didn't support --whole-archive et. al.
5538706f2543Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5539706f2543Smrg	  $GREP 'no-whole-archive' > /dev/null; then
5540706f2543Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5541706f2543Smrg        else
5542706f2543Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
5543706f2543Smrg        fi
5544706f2543Smrg      else
5545706f2543Smrg        with_gnu_ld=no
5546706f2543Smrg        wlarc=
5547706f2543Smrg
5548706f2543Smrg        # A generic and very simple default shared library creation
5549706f2543Smrg        # command for GNU C++ for the case where it uses the native
5550706f2543Smrg        # linker, instead of GNU ld.  If possible, this setting should
5551706f2543Smrg        # overridden to take advantage of the native linker features on
5552706f2543Smrg        # the platform it is being used on.
5553706f2543Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5554706f2543Smrg      fi
5555706f2543Smrg
5556706f2543Smrg      # Commands to make compiler produce verbose output that lists
5557706f2543Smrg      # what "hidden" libraries, object files and flags are used when
5558706f2543Smrg      # linking a shared library.
5559706f2543Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
5560706f2543Smrg
5561706f2543Smrg    else
5562706f2543Smrg      GXX=no
5563706f2543Smrg      with_gnu_ld=no
5564706f2543Smrg      wlarc=
5565706f2543Smrg    fi
5566706f2543Smrg
5567706f2543Smrg    # PORTME: fill in a description of your system's C++ link characteristics
5568706f2543Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5569706f2543Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
5570706f2543Smrg    case $host_os in
5571706f2543Smrg      aix3*)
5572706f2543Smrg        # FIXME: insert proper C++ library support
5573706f2543Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
5574706f2543Smrg        ;;
5575706f2543Smrg      aix[[4-9]]*)
5576706f2543Smrg        if test "$host_cpu" = ia64; then
5577706f2543Smrg          # On IA64, the linker does run time linking by default, so we don't
5578706f2543Smrg          # have to do anything special.
5579706f2543Smrg          aix_use_runtimelinking=no
5580706f2543Smrg          exp_sym_flag='-Bexport'
5581706f2543Smrg          no_entry_flag=""
5582706f2543Smrg        else
5583706f2543Smrg          aix_use_runtimelinking=no
5584706f2543Smrg
5585706f2543Smrg          # Test if we are trying to use run time linking or normal
5586706f2543Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5587706f2543Smrg          # need to do runtime linking.
5588706f2543Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5589706f2543Smrg	    for ld_flag in $LDFLAGS; do
5590706f2543Smrg	      case $ld_flag in
5591706f2543Smrg	      *-brtl*)
5592706f2543Smrg	        aix_use_runtimelinking=yes
5593706f2543Smrg	        break
5594706f2543Smrg	        ;;
5595706f2543Smrg	      esac
5596706f2543Smrg	    done
5597706f2543Smrg	    ;;
5598706f2543Smrg          esac
5599706f2543Smrg
5600706f2543Smrg          exp_sym_flag='-bexport'
5601706f2543Smrg          no_entry_flag='-bnoentry'
5602706f2543Smrg        fi
5603706f2543Smrg
5604706f2543Smrg        # When large executables or shared objects are built, AIX ld can
5605706f2543Smrg        # have problems creating the table of contents.  If linking a library
5606706f2543Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
5607706f2543Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5608706f2543Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5609706f2543Smrg
5610706f2543Smrg        _LT_TAGVAR(archive_cmds, $1)=''
5611706f2543Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
5612706f2543Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5613706f2543Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5614706f2543Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
5615706f2543Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5616706f2543Smrg
5617706f2543Smrg        if test "$GXX" = yes; then
5618706f2543Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
5619706f2543Smrg          # We only want to do this on AIX 4.2 and lower, the check
5620706f2543Smrg          # below for broken collect2 doesn't work under 4.3+
5621706f2543Smrg	  collect2name=`${CC} -print-prog-name=collect2`
5622706f2543Smrg	  if test -f "$collect2name" &&
5623706f2543Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5624706f2543Smrg	  then
5625706f2543Smrg	    # We have reworked collect2
5626706f2543Smrg	    :
5627706f2543Smrg	  else
5628706f2543Smrg	    # We have old collect2
5629706f2543Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
5630706f2543Smrg	    # It fails to find uninstalled libraries when the uninstalled
5631706f2543Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
5632706f2543Smrg	    # to unsupported forces relinking
5633706f2543Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
5634706f2543Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5635706f2543Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
5636706f2543Smrg	  fi
5637706f2543Smrg          esac
5638706f2543Smrg          shared_flag='-shared'
5639706f2543Smrg	  if test "$aix_use_runtimelinking" = yes; then
5640706f2543Smrg	    shared_flag="$shared_flag "'${wl}-G'
5641706f2543Smrg	  fi
5642706f2543Smrg        else
5643706f2543Smrg          # not using gcc
5644706f2543Smrg          if test "$host_cpu" = ia64; then
5645706f2543Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5646706f2543Smrg	  # chokes on -Wl,-G. The following line is correct:
5647706f2543Smrg	  shared_flag='-G'
5648706f2543Smrg          else
5649706f2543Smrg	    if test "$aix_use_runtimelinking" = yes; then
5650706f2543Smrg	      shared_flag='${wl}-G'
5651706f2543Smrg	    else
5652706f2543Smrg	      shared_flag='${wl}-bM:SRE'
5653706f2543Smrg	    fi
5654706f2543Smrg          fi
5655706f2543Smrg        fi
5656706f2543Smrg
5657706f2543Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5658706f2543Smrg        # It seems that -bexpall does not export symbols beginning with
5659706f2543Smrg        # underscore (_), so it is better to generate a list of symbols to
5660706f2543Smrg	# export.
5661706f2543Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
5662706f2543Smrg        if test "$aix_use_runtimelinking" = yes; then
5663706f2543Smrg          # Warning - without using the other runtime loading flags (-brtl),
5664706f2543Smrg          # -berok will link without error, but may produce a broken library.
5665706f2543Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5666706f2543Smrg          # Determine the default libpath from the value encoded in an empty
5667706f2543Smrg          # executable.
5668706f2543Smrg          _LT_SYS_MODULE_PATH_AIX
5669706f2543Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5670706f2543Smrg
5671706f2543Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5672706f2543Smrg        else
5673706f2543Smrg          if test "$host_cpu" = ia64; then
5674706f2543Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5675706f2543Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5676706f2543Smrg	    _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"
5677706f2543Smrg          else
5678706f2543Smrg	    # Determine the default libpath from the value encoded in an
5679706f2543Smrg	    # empty executable.
5680706f2543Smrg	    _LT_SYS_MODULE_PATH_AIX
5681706f2543Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5682706f2543Smrg	    # Warning - without using the other run time loading flags,
5683706f2543Smrg	    # -berok will link without error, but may produce a broken library.
5684706f2543Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5685706f2543Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5686706f2543Smrg	    if test "$with_gnu_ld" = yes; then
5687706f2543Smrg	      # We only use this code for GNU lds that support --whole-archive.
5688706f2543Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5689706f2543Smrg	    else
5690706f2543Smrg	      # Exported symbols can be pulled into shared objects from archives
5691706f2543Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5692706f2543Smrg	    fi
5693706f2543Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5694706f2543Smrg	    # This is similar to how AIX traditionally builds its shared
5695706f2543Smrg	    # libraries.
5696706f2543Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
5697706f2543Smrg          fi
5698706f2543Smrg        fi
5699706f2543Smrg        ;;
5700706f2543Smrg
5701706f2543Smrg      beos*)
5702706f2543Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5703706f2543Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5704706f2543Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5705706f2543Smrg	  # support --undefined.  This deserves some investigation.  FIXME
5706706f2543Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5707706f2543Smrg	else
5708706f2543Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
5709706f2543Smrg	fi
5710706f2543Smrg	;;
5711706f2543Smrg
5712706f2543Smrg      chorus*)
5713706f2543Smrg        case $cc_basename in
5714706f2543Smrg          *)
5715706f2543Smrg	  # FIXME: insert proper C++ library support
5716706f2543Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
5717706f2543Smrg	  ;;
5718706f2543Smrg        esac
5719706f2543Smrg        ;;
5720706f2543Smrg
5721706f2543Smrg      cygwin* | mingw* | pw32* | cegcc*)
5722706f2543Smrg        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5723706f2543Smrg        # as there is no search path for DLLs.
5724706f2543Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5725706f2543Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
5726706f2543Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5727706f2543Smrg        _LT_TAGVAR(always_export_symbols, $1)=no
5728706f2543Smrg        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5729706f2543Smrg
5730706f2543Smrg        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5731706f2543Smrg          _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'
5732706f2543Smrg          # If the export-symbols file already is a .def file (1st line
5733706f2543Smrg          # is EXPORTS), use it as is; otherwise, prepend...
5734706f2543Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5735706f2543Smrg	    cp $export_symbols $output_objdir/$soname.def;
5736706f2543Smrg          else
5737706f2543Smrg	    echo EXPORTS > $output_objdir/$soname.def;
5738706f2543Smrg	    cat $export_symbols >> $output_objdir/$soname.def;
5739706f2543Smrg          fi~
5740706f2543Smrg          $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'
5741706f2543Smrg        else
5742706f2543Smrg          _LT_TAGVAR(ld_shlibs, $1)=no
5743706f2543Smrg        fi
5744706f2543Smrg        ;;
5745706f2543Smrg      darwin* | rhapsody*)
5746706f2543Smrg        _LT_DARWIN_LINKER_FEATURES($1)
5747706f2543Smrg	;;
5748706f2543Smrg
5749706f2543Smrg      dgux*)
5750706f2543Smrg        case $cc_basename in
5751706f2543Smrg          ec++*)
5752706f2543Smrg	    # FIXME: insert proper C++ library support
5753706f2543Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5754706f2543Smrg	    ;;
5755706f2543Smrg          ghcx*)
5756706f2543Smrg	    # Green Hills C++ Compiler
5757706f2543Smrg	    # FIXME: insert proper C++ library support
5758706f2543Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5759706f2543Smrg	    ;;
5760706f2543Smrg          *)
5761706f2543Smrg	    # FIXME: insert proper C++ library support
5762706f2543Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5763706f2543Smrg	    ;;
5764706f2543Smrg        esac
5765706f2543Smrg        ;;
5766706f2543Smrg
5767706f2543Smrg      freebsd[[12]]*)
5768706f2543Smrg        # C++ shared libraries reported to be fairly broken before
5769706f2543Smrg	# switch to ELF
5770706f2543Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
5771706f2543Smrg        ;;
5772706f2543Smrg
5773706f2543Smrg      freebsd-elf*)
5774706f2543Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5775706f2543Smrg        ;;
5776706f2543Smrg
5777706f2543Smrg      freebsd* | dragonfly*)
5778706f2543Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
5779706f2543Smrg        # conventions
5780706f2543Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
5781706f2543Smrg        ;;
5782706f2543Smrg
5783706f2543Smrg      gnu*)
5784706f2543Smrg        ;;
5785706f2543Smrg
5786706f2543Smrg      haiku*)
5787706f2543Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5788706f2543Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
5789706f2543Smrg        ;;
5790706f2543Smrg
5791706f2543Smrg      hpux9*)
5792706f2543Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5793706f2543Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5794706f2543Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5795706f2543Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
5796706f2543Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5797706f2543Smrg				             # but as the default
5798706f2543Smrg				             # location of the library.
5799706f2543Smrg
5800706f2543Smrg        case $cc_basename in
5801706f2543Smrg          CC*)
5802706f2543Smrg            # FIXME: insert proper C++ library support
5803706f2543Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
5804706f2543Smrg            ;;
5805706f2543Smrg          aCC*)
5806706f2543Smrg            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5807706f2543Smrg            # Commands to make compiler produce verbose output that lists
5808706f2543Smrg            # what "hidden" libraries, object files and flags are used when
5809706f2543Smrg            # linking a shared library.
5810706f2543Smrg            #
5811706f2543Smrg            # There doesn't appear to be a way to prevent this compiler from
5812706f2543Smrg            # explicitly linking system object files so we need to strip them
5813706f2543Smrg            # from the output so that they don't get included in the library
5814706f2543Smrg            # dependencies.
5815706f2543Smrg            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"'
5816706f2543Smrg            ;;
5817706f2543Smrg          *)
5818706f2543Smrg            if test "$GXX" = yes; then
5819706f2543Smrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5820706f2543Smrg            else
5821706f2543Smrg              # FIXME: insert proper C++ library support
5822706f2543Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
5823706f2543Smrg            fi
5824706f2543Smrg            ;;
5825706f2543Smrg        esac
5826706f2543Smrg        ;;
5827706f2543Smrg
5828706f2543Smrg      hpux10*|hpux11*)
5829706f2543Smrg        if test $with_gnu_ld = no; then
5830706f2543Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5831706f2543Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5832706f2543Smrg
5833706f2543Smrg          case $host_cpu in
5834706f2543Smrg            hppa*64*|ia64*)
5835706f2543Smrg              ;;
5836706f2543Smrg            *)
5837706f2543Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5838706f2543Smrg              ;;
5839706f2543Smrg          esac
5840706f2543Smrg        fi
5841706f2543Smrg        case $host_cpu in
5842706f2543Smrg          hppa*64*|ia64*)
5843706f2543Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
5844706f2543Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5845706f2543Smrg            ;;
5846706f2543Smrg          *)
5847706f2543Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
5848706f2543Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5849706f2543Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5850706f2543Smrg					         # but as the default
5851706f2543Smrg					         # location of the library.
5852706f2543Smrg            ;;
5853706f2543Smrg        esac
5854706f2543Smrg
5855706f2543Smrg        case $cc_basename in
5856706f2543Smrg          CC*)
5857706f2543Smrg	    # FIXME: insert proper C++ library support
5858706f2543Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5859706f2543Smrg	    ;;
5860706f2543Smrg          aCC*)
5861706f2543Smrg	    case $host_cpu in
5862706f2543Smrg	      hppa*64*)
5863706f2543Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5864706f2543Smrg	        ;;
5865706f2543Smrg	      ia64*)
5866706f2543Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5867706f2543Smrg	        ;;
5868706f2543Smrg	      *)
5869706f2543Smrg	        _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'
5870706f2543Smrg	        ;;
5871706f2543Smrg	    esac
5872706f2543Smrg	    # Commands to make compiler produce verbose output that lists
5873706f2543Smrg	    # what "hidden" libraries, object files and flags are used when
5874706f2543Smrg	    # linking a shared library.
5875706f2543Smrg	    #
5876706f2543Smrg	    # There doesn't appear to be a way to prevent this compiler from
5877706f2543Smrg	    # explicitly linking system object files so we need to strip them
5878706f2543Smrg	    # from the output so that they don't get included in the library
5879706f2543Smrg	    # dependencies.
5880706f2543Smrg	    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"'
5881706f2543Smrg	    ;;
5882706f2543Smrg          *)
5883706f2543Smrg	    if test "$GXX" = yes; then
5884706f2543Smrg	      if test $with_gnu_ld = no; then
5885706f2543Smrg	        case $host_cpu in
5886706f2543Smrg	          hppa*64*)
5887706f2543Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5888706f2543Smrg	            ;;
5889706f2543Smrg	          ia64*)
5890706f2543Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5891706f2543Smrg	            ;;
5892706f2543Smrg	          *)
5893706f2543Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5894706f2543Smrg	            ;;
5895706f2543Smrg	        esac
5896706f2543Smrg	      fi
5897706f2543Smrg	    else
5898706f2543Smrg	      # FIXME: insert proper C++ library support
5899706f2543Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
5900706f2543Smrg	    fi
5901706f2543Smrg	    ;;
5902706f2543Smrg        esac
5903706f2543Smrg        ;;
5904706f2543Smrg
5905706f2543Smrg      interix[[3-9]]*)
5906706f2543Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
5907706f2543Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5908706f2543Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5909706f2543Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5910706f2543Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5911706f2543Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
5912706f2543Smrg	# default) and relocated if they conflict, which is a slow very memory
5913706f2543Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
5914706f2543Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5915706f2543Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5916706f2543Smrg	_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'
5917706f2543Smrg	_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'
5918706f2543Smrg	;;
5919706f2543Smrg      irix5* | irix6*)
5920706f2543Smrg        case $cc_basename in
5921706f2543Smrg          CC*)
5922706f2543Smrg	    # SGI C++
5923706f2543Smrg	    _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'
5924706f2543Smrg
5925706f2543Smrg	    # Archives containing C++ object files must be created using
5926706f2543Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
5927706f2543Smrg	    # necessary to make sure instantiated templates are included
5928706f2543Smrg	    # in the archive.
5929706f2543Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
5930706f2543Smrg	    ;;
5931706f2543Smrg          *)
5932706f2543Smrg	    if test "$GXX" = yes; then
5933706f2543Smrg	      if test "$with_gnu_ld" = no; then
5934706f2543Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5935706f2543Smrg	      else
5936706f2543Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
5937706f2543Smrg	      fi
5938706f2543Smrg	    fi
5939706f2543Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
5940706f2543Smrg	    ;;
5941706f2543Smrg        esac
5942706f2543Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5943706f2543Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5944706f2543Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
5945706f2543Smrg        ;;
5946706f2543Smrg
5947706f2543Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
5948706f2543Smrg        case $cc_basename in
5949706f2543Smrg          KCC*)
5950706f2543Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
5951706f2543Smrg
5952706f2543Smrg	    # KCC will only create a shared library if the output file
5953706f2543Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
5954706f2543Smrg	    # to its proper name (with version) after linking.
5955706f2543Smrg	    _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'
5956706f2543Smrg	    _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'
5957706f2543Smrg	    # Commands to make compiler produce verbose output that lists
5958706f2543Smrg	    # what "hidden" libraries, object files and flags are used when
5959706f2543Smrg	    # linking a shared library.
5960706f2543Smrg	    #
5961706f2543Smrg	    # There doesn't appear to be a way to prevent this compiler from
5962706f2543Smrg	    # explicitly linking system object files so we need to strip them
5963706f2543Smrg	    # from the output so that they don't get included in the library
5964706f2543Smrg	    # dependencies.
5965706f2543Smrg	    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"'
5966706f2543Smrg
5967706f2543Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5968706f2543Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5969706f2543Smrg
5970706f2543Smrg	    # Archives containing C++ object files must be created using
5971706f2543Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
5972706f2543Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
5973706f2543Smrg	    ;;
5974706f2543Smrg	  icpc* | ecpc* )
5975706f2543Smrg	    # Intel C++
5976706f2543Smrg	    with_gnu_ld=yes
5977706f2543Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
5978706f2543Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
5979706f2543Smrg	    # earlier do not add the objects themselves.
5980706f2543Smrg	    case `$CC -V 2>&1` in
5981706f2543Smrg	      *"Version 7."*)
5982706f2543Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5983706f2543Smrg		_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'
5984706f2543Smrg		;;
5985706f2543Smrg	      *)  # Version 8.0 or newer
5986706f2543Smrg	        tmp_idyn=
5987706f2543Smrg	        case $host_cpu in
5988706f2543Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
5989706f2543Smrg		esac
5990706f2543Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5991706f2543Smrg		_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'
5992706f2543Smrg		;;
5993706f2543Smrg	    esac
5994706f2543Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5995706f2543Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5996706f2543Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5997706f2543Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5998706f2543Smrg	    ;;
5999706f2543Smrg          pgCC* | pgcpp*)
6000706f2543Smrg            # Portland Group C++ compiler
6001706f2543Smrg	    case `$CC -V` in
6002706f2543Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
6003706f2543Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
6004706f2543Smrg		rm -rf $tpldir~
6005706f2543Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
6006706f2543Smrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
6007706f2543Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
6008706f2543Smrg		rm -rf $tpldir~
6009706f2543Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
6010706f2543Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
6011706f2543Smrg		$RANLIB $oldlib'
6012706f2543Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
6013706f2543Smrg		rm -rf $tpldir~
6014706f2543Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6015706f2543Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6016706f2543Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
6017706f2543Smrg		rm -rf $tpldir~
6018706f2543Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6019706f2543Smrg		$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'
6020706f2543Smrg	      ;;
6021706f2543Smrg	    *) # Version 6 and above use weak symbols
6022706f2543Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6023706f2543Smrg	      _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'
6024706f2543Smrg	      ;;
6025706f2543Smrg	    esac
6026706f2543Smrg
6027706f2543Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
6028706f2543Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6029706f2543Smrg	    _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'
6030706f2543Smrg            ;;
6031706f2543Smrg	  cxx*)
6032706f2543Smrg	    # Compaq C++
6033706f2543Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6034706f2543Smrg	    _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'
6035706f2543Smrg
6036706f2543Smrg	    runpath_var=LD_RUN_PATH
6037706f2543Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6038706f2543Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6039706f2543Smrg
6040706f2543Smrg	    # Commands to make compiler produce verbose output that lists
6041706f2543Smrg	    # what "hidden" libraries, object files and flags are used when
6042706f2543Smrg	    # linking a shared library.
6043706f2543Smrg	    #
6044706f2543Smrg	    # There doesn't appear to be a way to prevent this compiler from
6045706f2543Smrg	    # explicitly linking system object files so we need to strip them
6046706f2543Smrg	    # from the output so that they don't get included in the library
6047706f2543Smrg	    # dependencies.
6048706f2543Smrg	    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'
6049706f2543Smrg	    ;;
6050706f2543Smrg	  xl* | mpixl* | bgxl*)
6051706f2543Smrg	    # IBM XL 8.0 on PPC, with GNU ld
6052706f2543Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6053706f2543Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6054706f2543Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6055706f2543Smrg	    if test "x$supports_anon_versioning" = xyes; then
6056706f2543Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
6057706f2543Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6058706f2543Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
6059706f2543Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
6060706f2543Smrg	    fi
6061706f2543Smrg	    ;;
6062706f2543Smrg	  *)
6063706f2543Smrg	    case `$CC -V 2>&1 | sed 5q` in
6064706f2543Smrg	    *Sun\ C*)
6065706f2543Smrg	      # Sun C++ 5.9
6066706f2543Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6067706f2543Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6068706f2543Smrg	      _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'
6069706f2543Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6070706f2543Smrg	      _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'
6071706f2543Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
6072706f2543Smrg
6073706f2543Smrg	      # Not sure whether something based on
6074706f2543Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
6075706f2543Smrg	      # would be better.
6076706f2543Smrg	      output_verbose_link_cmd='func_echo_all'
6077706f2543Smrg
6078706f2543Smrg	      # Archives containing C++ object files must be created using
6079706f2543Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6080706f2543Smrg	      # necessary to make sure instantiated templates are included
6081706f2543Smrg	      # in the archive.
6082706f2543Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6083706f2543Smrg	      ;;
6084706f2543Smrg	    esac
6085706f2543Smrg	    ;;
6086706f2543Smrg	esac
6087706f2543Smrg	;;
6088706f2543Smrg
6089706f2543Smrg      lynxos*)
6090706f2543Smrg        # FIXME: insert proper C++ library support
6091706f2543Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6092706f2543Smrg	;;
6093706f2543Smrg
6094706f2543Smrg      m88k*)
6095706f2543Smrg        # FIXME: insert proper C++ library support
6096706f2543Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6097706f2543Smrg	;;
6098706f2543Smrg
6099706f2543Smrg      mvs*)
6100706f2543Smrg        case $cc_basename in
6101706f2543Smrg          cxx*)
6102706f2543Smrg	    # FIXME: insert proper C++ library support
6103706f2543Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6104706f2543Smrg	    ;;
6105706f2543Smrg	  *)
6106706f2543Smrg	    # FIXME: insert proper C++ library support
6107706f2543Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6108706f2543Smrg	    ;;
6109706f2543Smrg	esac
6110706f2543Smrg	;;
6111706f2543Smrg
6112706f2543Smrg      netbsd*)
6113706f2543Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6114706f2543Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6115706f2543Smrg	  wlarc=
6116706f2543Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6117706f2543Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6118706f2543Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6119706f2543Smrg	fi
6120706f2543Smrg	# Workaround some broken pre-1.5 toolchains
6121706f2543Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6122706f2543Smrg	;;
6123706f2543Smrg
6124706f2543Smrg      *nto* | *qnx*)
6125706f2543Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6126706f2543Smrg	;;
6127706f2543Smrg
6128706f2543Smrg      openbsd2*)
6129706f2543Smrg        # C++ shared libraries are fairly broken
6130706f2543Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6131706f2543Smrg	;;
6132706f2543Smrg
6133706f2543Smrg      openbsd*)
6134706f2543Smrg	if test -f /usr/libexec/ld.so; then
6135706f2543Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6136706f2543Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6137706f2543Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6138706f2543Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6139706f2543Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6140706f2543Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6141706f2543Smrg	    _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'
6142706f2543Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6143706f2543Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6144706f2543Smrg	  fi
6145706f2543Smrg	  output_verbose_link_cmd=func_echo_all
6146706f2543Smrg	else
6147706f2543Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6148706f2543Smrg	fi
6149706f2543Smrg	;;
6150706f2543Smrg
6151706f2543Smrg      osf3* | osf4* | osf5*)
6152706f2543Smrg        case $cc_basename in
6153706f2543Smrg          KCC*)
6154706f2543Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6155706f2543Smrg
6156706f2543Smrg	    # KCC will only create a shared library if the output file
6157706f2543Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6158706f2543Smrg	    # to its proper name (with version) after linking.
6159706f2543Smrg	    _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'
6160706f2543Smrg
6161706f2543Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6162706f2543Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6163706f2543Smrg
6164706f2543Smrg	    # Archives containing C++ object files must be created using
6165706f2543Smrg	    # the KAI C++ compiler.
6166706f2543Smrg	    case $host in
6167706f2543Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6168706f2543Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6169706f2543Smrg	    esac
6170706f2543Smrg	    ;;
6171706f2543Smrg          RCC*)
6172706f2543Smrg	    # Rational C++ 2.4.1
6173706f2543Smrg	    # FIXME: insert proper C++ library support
6174706f2543Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6175706f2543Smrg	    ;;
6176706f2543Smrg          cxx*)
6177706f2543Smrg	    case $host in
6178706f2543Smrg	      osf3*)
6179706f2543Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6180706f2543Smrg	        _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'
6181706f2543Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6182706f2543Smrg		;;
6183706f2543Smrg	      *)
6184706f2543Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6185706f2543Smrg	        _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'
6186706f2543Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6187706f2543Smrg	          echo "-hidden">> $lib.exp~
6188706f2543Smrg	          $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~
6189706f2543Smrg	          $RM $lib.exp'
6190706f2543Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6191706f2543Smrg		;;
6192706f2543Smrg	    esac
6193706f2543Smrg
6194706f2543Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6195706f2543Smrg
6196706f2543Smrg	    # Commands to make compiler produce verbose output that lists
6197706f2543Smrg	    # what "hidden" libraries, object files and flags are used when
6198706f2543Smrg	    # linking a shared library.
6199706f2543Smrg	    #
6200706f2543Smrg	    # There doesn't appear to be a way to prevent this compiler from
6201706f2543Smrg	    # explicitly linking system object files so we need to strip them
6202706f2543Smrg	    # from the output so that they don't get included in the library
6203706f2543Smrg	    # dependencies.
6204706f2543Smrg	    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"'
6205706f2543Smrg	    ;;
6206706f2543Smrg	  *)
6207706f2543Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6208706f2543Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6209706f2543Smrg	      case $host in
6210706f2543Smrg	        osf3*)
6211706f2543Smrg	          _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'
6212706f2543Smrg		  ;;
6213706f2543Smrg	        *)
6214706f2543Smrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6215706f2543Smrg		  ;;
6216706f2543Smrg	      esac
6217706f2543Smrg
6218706f2543Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6219706f2543Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6220706f2543Smrg
6221706f2543Smrg	      # Commands to make compiler produce verbose output that lists
6222706f2543Smrg	      # what "hidden" libraries, object files and flags are used when
6223706f2543Smrg	      # linking a shared library.
6224706f2543Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6225706f2543Smrg
6226706f2543Smrg	    else
6227706f2543Smrg	      # FIXME: insert proper C++ library support
6228706f2543Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6229706f2543Smrg	    fi
6230706f2543Smrg	    ;;
6231706f2543Smrg        esac
6232706f2543Smrg        ;;
6233706f2543Smrg
6234706f2543Smrg      psos*)
6235706f2543Smrg        # FIXME: insert proper C++ library support
6236706f2543Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6237706f2543Smrg        ;;
6238706f2543Smrg
6239706f2543Smrg      sunos4*)
6240706f2543Smrg        case $cc_basename in
6241706f2543Smrg          CC*)
6242706f2543Smrg	    # Sun C++ 4.x
6243706f2543Smrg	    # FIXME: insert proper C++ library support
6244706f2543Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6245706f2543Smrg	    ;;
6246706f2543Smrg          lcc*)
6247706f2543Smrg	    # Lucid
6248706f2543Smrg	    # FIXME: insert proper C++ library support
6249706f2543Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6250706f2543Smrg	    ;;
6251706f2543Smrg          *)
6252706f2543Smrg	    # FIXME: insert proper C++ library support
6253706f2543Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6254706f2543Smrg	    ;;
6255706f2543Smrg        esac
6256706f2543Smrg        ;;
6257706f2543Smrg
6258706f2543Smrg      solaris*)
6259706f2543Smrg        case $cc_basename in
6260706f2543Smrg          CC* | sunCC*)
6261706f2543Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
6262706f2543Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6263706f2543Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6264706f2543Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6265706f2543Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6266706f2543Smrg	      $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'
6267706f2543Smrg
6268706f2543Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6269706f2543Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6270706f2543Smrg	    case $host_os in
6271706f2543Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6272706f2543Smrg	      *)
6273706f2543Smrg		# The compiler driver will combine and reorder linker options,
6274706f2543Smrg		# but understands `-z linker_flag'.
6275706f2543Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
6276706f2543Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6277706f2543Smrg	        ;;
6278706f2543Smrg	    esac
6279706f2543Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6280706f2543Smrg
6281706f2543Smrg	    output_verbose_link_cmd='func_echo_all'
6282706f2543Smrg
6283706f2543Smrg	    # Archives containing C++ object files must be created using
6284706f2543Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6285706f2543Smrg	    # necessary to make sure instantiated templates are included
6286706f2543Smrg	    # in the archive.
6287706f2543Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6288706f2543Smrg	    ;;
6289706f2543Smrg          gcx*)
6290706f2543Smrg	    # Green Hills C++ Compiler
6291706f2543Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6292706f2543Smrg
6293706f2543Smrg	    # The C++ compiler must be used to create the archive.
6294706f2543Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6295706f2543Smrg	    ;;
6296706f2543Smrg          *)
6297706f2543Smrg	    # GNU C++ compiler with Solaris linker
6298706f2543Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6299706f2543Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6300706f2543Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6301706f2543Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6302706f2543Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6303706f2543Smrg		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6304706f2543Smrg
6305706f2543Smrg	        # Commands to make compiler produce verbose output that lists
6306706f2543Smrg	        # what "hidden" libraries, object files and flags are used when
6307706f2543Smrg	        # linking a shared library.
6308706f2543Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6309706f2543Smrg	      else
6310706f2543Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
6311706f2543Smrg	        # platform.
6312706f2543Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6313706f2543Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6314706f2543Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6315706f2543Smrg
6316706f2543Smrg	        # Commands to make compiler produce verbose output that lists
6317706f2543Smrg	        # what "hidden" libraries, object files and flags are used when
6318706f2543Smrg	        # linking a shared library.
6319706f2543Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6320706f2543Smrg	      fi
6321706f2543Smrg
6322706f2543Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6323706f2543Smrg	      case $host_os in
6324706f2543Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6325706f2543Smrg		*)
6326706f2543Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6327706f2543Smrg		  ;;
6328706f2543Smrg	      esac
6329706f2543Smrg	    fi
6330706f2543Smrg	    ;;
6331706f2543Smrg        esac
6332706f2543Smrg        ;;
6333706f2543Smrg
6334706f2543Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6335706f2543Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6336706f2543Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6337706f2543Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6338706f2543Smrg      runpath_var='LD_RUN_PATH'
6339706f2543Smrg
6340706f2543Smrg      case $cc_basename in
6341706f2543Smrg        CC*)
6342706f2543Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6343706f2543Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6344706f2543Smrg	  ;;
6345706f2543Smrg	*)
6346706f2543Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6347706f2543Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6348706f2543Smrg	  ;;
6349706f2543Smrg      esac
6350706f2543Smrg      ;;
6351706f2543Smrg
6352706f2543Smrg      sysv5* | sco3.2v5* | sco5v6*)
6353706f2543Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
6354706f2543Smrg	# link with -lc, and that would cause any symbols used from libc to
6355706f2543Smrg	# always be unresolved, which means just about no library would
6356706f2543Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
6357706f2543Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
6358706f2543Smrg	# as -z defs.
6359706f2543Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6360706f2543Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6361706f2543Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6362706f2543Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6363706f2543Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6364706f2543Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6365706f2543Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
6366706f2543Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6367706f2543Smrg	runpath_var='LD_RUN_PATH'
6368706f2543Smrg
6369706f2543Smrg	case $cc_basename in
6370706f2543Smrg          CC*)
6371706f2543Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6372706f2543Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6373706f2543Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
6374706f2543Smrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
6375706f2543Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
6376706f2543Smrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
6377706f2543Smrg	    ;;
6378706f2543Smrg	  *)
6379706f2543Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6380706f2543Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6381706f2543Smrg	    ;;
6382706f2543Smrg	esac
6383706f2543Smrg      ;;
6384706f2543Smrg
6385706f2543Smrg      tandem*)
6386706f2543Smrg        case $cc_basename in
6387706f2543Smrg          NCC*)
6388706f2543Smrg	    # NonStop-UX NCC 3.20
6389706f2543Smrg	    # FIXME: insert proper C++ library support
6390706f2543Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6391706f2543Smrg	    ;;
6392706f2543Smrg          *)
6393706f2543Smrg	    # FIXME: insert proper C++ library support
6394706f2543Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6395706f2543Smrg	    ;;
6396706f2543Smrg        esac
6397706f2543Smrg        ;;
6398706f2543Smrg
6399706f2543Smrg      vxworks*)
6400706f2543Smrg        # FIXME: insert proper C++ library support
6401706f2543Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6402706f2543Smrg        ;;
6403706f2543Smrg
6404706f2543Smrg      *)
6405706f2543Smrg        # FIXME: insert proper C++ library support
6406706f2543Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6407706f2543Smrg        ;;
6408706f2543Smrg    esac
6409706f2543Smrg
6410706f2543Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6411706f2543Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6412706f2543Smrg
6413706f2543Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
6414706f2543Smrg    _LT_TAGVAR(LD, $1)="$LD"
6415706f2543Smrg
6416706f2543Smrg    ## CAVEAT EMPTOR:
6417706f2543Smrg    ## There is no encapsulation within the following macros, do not change
6418706f2543Smrg    ## the running order or otherwise move them around unless you know exactly
6419706f2543Smrg    ## what you are doing...
6420706f2543Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
6421706f2543Smrg    _LT_COMPILER_PIC($1)
6422706f2543Smrg    _LT_COMPILER_C_O($1)
6423706f2543Smrg    _LT_COMPILER_FILE_LOCKS($1)
6424706f2543Smrg    _LT_LINKER_SHLIBS($1)
6425706f2543Smrg    _LT_SYS_DYNAMIC_LINKER($1)
6426706f2543Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6427706f2543Smrg
6428706f2543Smrg    _LT_CONFIG($1)
6429706f2543Smrg  fi # test -n "$compiler"
6430706f2543Smrg
6431706f2543Smrg  CC=$lt_save_CC
6432706f2543Smrg  LDCXX=$LD
6433706f2543Smrg  LD=$lt_save_LD
6434706f2543Smrg  GCC=$lt_save_GCC
6435706f2543Smrg  with_gnu_ld=$lt_save_with_gnu_ld
6436706f2543Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
6437706f2543Smrg  lt_cv_path_LD=$lt_save_path_LD
6438706f2543Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6439706f2543Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6440706f2543Smrgfi # test "$_lt_caught_CXX_error" != yes
6441706f2543Smrg
6442706f2543SmrgAC_LANG_POP
6443706f2543Smrg])# _LT_LANG_CXX_CONFIG
6444706f2543Smrg
6445706f2543Smrg
6446706f2543Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6447706f2543Smrg# ---------------------------------
6448706f2543Smrg# Figure out "hidden" library dependencies from verbose
6449706f2543Smrg# compiler output when linking a shared library.
6450706f2543Smrg# Parse the compiler output and extract the necessary
6451706f2543Smrg# objects, libraries and library flags.
6452706f2543Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6453706f2543Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6454706f2543Smrg# Dependencies to place before and after the object being linked:
6455706f2543Smrg_LT_TAGVAR(predep_objects, $1)=
6456706f2543Smrg_LT_TAGVAR(postdep_objects, $1)=
6457706f2543Smrg_LT_TAGVAR(predeps, $1)=
6458706f2543Smrg_LT_TAGVAR(postdeps, $1)=
6459706f2543Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
6460706f2543Smrg
6461706f2543Smrgdnl we can't use the lt_simple_compile_test_code here,
6462706f2543Smrgdnl because it contains code intended for an executable,
6463706f2543Smrgdnl not a library.  It's possible we should let each
6464706f2543Smrgdnl tag define a new lt_????_link_test_code variable,
6465706f2543Smrgdnl but it's only used here...
6466706f2543Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6467706f2543Smrgint a;
6468706f2543Smrgvoid foo (void) { a = 0; }
6469706f2543Smrg_LT_EOF
6470706f2543Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6471706f2543Smrgclass Foo
6472706f2543Smrg{
6473706f2543Smrgpublic:
6474706f2543Smrg  Foo (void) { a = 0; }
6475706f2543Smrgprivate:
6476706f2543Smrg  int a;
6477706f2543Smrg};
6478706f2543Smrg_LT_EOF
6479706f2543Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6480706f2543Smrg      subroutine foo
6481706f2543Smrg      implicit none
6482706f2543Smrg      integer*4 a
6483706f2543Smrg      a=0
6484706f2543Smrg      return
6485706f2543Smrg      end
6486706f2543Smrg_LT_EOF
6487706f2543Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6488706f2543Smrg      subroutine foo
6489706f2543Smrg      implicit none
6490706f2543Smrg      integer a
6491706f2543Smrg      a=0
6492706f2543Smrg      return
6493706f2543Smrg      end
6494706f2543Smrg_LT_EOF
6495706f2543Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6496706f2543Smrgpublic class foo {
6497706f2543Smrg  private int a;
6498706f2543Smrg  public void bar (void) {
6499706f2543Smrg    a = 0;
6500706f2543Smrg  }
6501706f2543Smrg};
6502706f2543Smrg_LT_EOF
6503706f2543Smrg])
6504706f2543Smrgdnl Parse the compiler output and extract the necessary
6505706f2543Smrgdnl objects, libraries and library flags.
6506706f2543Smrgif AC_TRY_EVAL(ac_compile); then
6507706f2543Smrg  # Parse the compiler output and extract the necessary
6508706f2543Smrg  # objects, libraries and library flags.
6509706f2543Smrg
6510706f2543Smrg  # Sentinel used to keep track of whether or not we are before
6511706f2543Smrg  # the conftest object file.
6512706f2543Smrg  pre_test_object_deps_done=no
6513706f2543Smrg
6514706f2543Smrg  for p in `eval "$output_verbose_link_cmd"`; do
6515706f2543Smrg    case $p in
6516706f2543Smrg
6517706f2543Smrg    -L* | -R* | -l*)
6518706f2543Smrg       # Some compilers place space between "-{L,R}" and the path.
6519706f2543Smrg       # Remove the space.
6520706f2543Smrg       if test $p = "-L" ||
6521706f2543Smrg          test $p = "-R"; then
6522706f2543Smrg	 prev=$p
6523706f2543Smrg	 continue
6524706f2543Smrg       else
6525706f2543Smrg	 prev=
6526706f2543Smrg       fi
6527706f2543Smrg
6528706f2543Smrg       if test "$pre_test_object_deps_done" = no; then
6529706f2543Smrg	 case $p in
6530706f2543Smrg	 -L* | -R*)
6531706f2543Smrg	   # Internal compiler library paths should come after those
6532706f2543Smrg	   # provided the user.  The postdeps already come after the
6533706f2543Smrg	   # user supplied libs so there is no need to process them.
6534706f2543Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
6535706f2543Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
6536706f2543Smrg	   else
6537706f2543Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
6538706f2543Smrg	   fi
6539706f2543Smrg	   ;;
6540706f2543Smrg	 # The "-l" case would never come before the object being
6541706f2543Smrg	 # linked, so don't bother handling this case.
6542706f2543Smrg	 esac
6543706f2543Smrg       else
6544706f2543Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
6545706f2543Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
6546706f2543Smrg	 else
6547706f2543Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
6548706f2543Smrg	 fi
6549706f2543Smrg       fi
6550706f2543Smrg       ;;
6551706f2543Smrg
6552706f2543Smrg    *.$objext)
6553706f2543Smrg       # This assumes that the test object file only shows up
6554706f2543Smrg       # once in the compiler output.
6555706f2543Smrg       if test "$p" = "conftest.$objext"; then
6556706f2543Smrg	 pre_test_object_deps_done=yes
6557706f2543Smrg	 continue
6558706f2543Smrg       fi
6559706f2543Smrg
6560706f2543Smrg       if test "$pre_test_object_deps_done" = no; then
6561706f2543Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
6562706f2543Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
6563706f2543Smrg	 else
6564706f2543Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
6565706f2543Smrg	 fi
6566706f2543Smrg       else
6567706f2543Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
6568706f2543Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
6569706f2543Smrg	 else
6570706f2543Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
6571706f2543Smrg	 fi
6572706f2543Smrg       fi
6573706f2543Smrg       ;;
6574706f2543Smrg
6575706f2543Smrg    *) ;; # Ignore the rest.
6576706f2543Smrg
6577706f2543Smrg    esac
6578706f2543Smrg  done
6579706f2543Smrg
6580706f2543Smrg  # Clean up.
6581706f2543Smrg  rm -f a.out a.exe
6582706f2543Smrgelse
6583706f2543Smrg  echo "libtool.m4: error: problem compiling $1 test program"
6584706f2543Smrgfi
6585706f2543Smrg
6586706f2543Smrg$RM -f confest.$objext
6587706f2543Smrg
6588706f2543Smrg# PORTME: override above test on systems where it is broken
6589706f2543Smrgm4_if([$1], [CXX],
6590706f2543Smrg[case $host_os in
6591706f2543Smrginterix[[3-9]]*)
6592706f2543Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
6593706f2543Smrg  # hack all around it, let's just trust "g++" to DTRT.
6594706f2543Smrg  _LT_TAGVAR(predep_objects,$1)=
6595706f2543Smrg  _LT_TAGVAR(postdep_objects,$1)=
6596706f2543Smrg  _LT_TAGVAR(postdeps,$1)=
6597706f2543Smrg  ;;
6598706f2543Smrg
6599706f2543Smrglinux*)
6600706f2543Smrg  case `$CC -V 2>&1 | sed 5q` in
6601706f2543Smrg  *Sun\ C*)
6602706f2543Smrg    # Sun C++ 5.9
6603706f2543Smrg
6604706f2543Smrg    # The more standards-conforming stlport4 library is
6605706f2543Smrg    # incompatible with the Cstd library. Avoid specifying
6606706f2543Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
6607706f2543Smrg    # -library=stlport4 depends on it.
6608706f2543Smrg    case " $CXX $CXXFLAGS " in
6609706f2543Smrg    *" -library=stlport4 "*)
6610706f2543Smrg      solaris_use_stlport4=yes
6611706f2543Smrg      ;;
6612706f2543Smrg    esac
6613706f2543Smrg
6614706f2543Smrg    if test "$solaris_use_stlport4" != yes; then
6615706f2543Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6616706f2543Smrg    fi
6617706f2543Smrg    ;;
6618706f2543Smrg  esac
6619706f2543Smrg  ;;
6620706f2543Smrg
6621706f2543Smrgsolaris*)
6622706f2543Smrg  case $cc_basename in
6623706f2543Smrg  CC* | sunCC*)
6624706f2543Smrg    # The more standards-conforming stlport4 library is
6625706f2543Smrg    # incompatible with the Cstd library. Avoid specifying
6626706f2543Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
6627706f2543Smrg    # -library=stlport4 depends on it.
6628706f2543Smrg    case " $CXX $CXXFLAGS " in
6629706f2543Smrg    *" -library=stlport4 "*)
6630706f2543Smrg      solaris_use_stlport4=yes
6631706f2543Smrg      ;;
6632706f2543Smrg    esac
6633706f2543Smrg
6634706f2543Smrg    # Adding this requires a known-good setup of shared libraries for
6635706f2543Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
6636706f2543Smrg    # archive will be linked into the output, leading to subtle bugs.
6637706f2543Smrg    if test "$solaris_use_stlport4" != yes; then
6638706f2543Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6639706f2543Smrg    fi
6640706f2543Smrg    ;;
6641706f2543Smrg  esac
6642706f2543Smrg  ;;
6643706f2543Smrgesac
6644706f2543Smrg])
6645706f2543Smrg
6646706f2543Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
6647706f2543Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
6648706f2543Smrgesac
6649706f2543Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
6650706f2543Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
6651706f2543Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
6652706f2543Smrgfi
6653706f2543Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
6654706f2543Smrg    [The directories searched by this compiler when creating a shared library])
6655706f2543Smrg_LT_TAGDECL([], [predep_objects], [1],
6656706f2543Smrg    [Dependencies to place before and after the objects being linked to
6657706f2543Smrg    create a shared library])
6658706f2543Smrg_LT_TAGDECL([], [postdep_objects], [1])
6659706f2543Smrg_LT_TAGDECL([], [predeps], [1])
6660706f2543Smrg_LT_TAGDECL([], [postdeps], [1])
6661706f2543Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
6662706f2543Smrg    [The library search path used internally by the compiler when linking
6663706f2543Smrg    a shared library])
6664706f2543Smrg])# _LT_SYS_HIDDEN_LIBDEPS
6665706f2543Smrg
6666706f2543Smrg
6667706f2543Smrg# _LT_LANG_F77_CONFIG([TAG])
6668706f2543Smrg# --------------------------
6669706f2543Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
6670706f2543Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
6671706f2543Smrg# to write the compiler configuration to `libtool'.
6672706f2543Smrgm4_defun([_LT_LANG_F77_CONFIG],
6673706f2543Smrg[AC_LANG_PUSH(Fortran 77)
6674706f2543Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
6675706f2543Smrg  _lt_disable_F77=yes
6676706f2543Smrgfi
6677706f2543Smrg
6678706f2543Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6679706f2543Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
6680706f2543Smrg_LT_TAGVAR(always_export_symbols, $1)=no
6681706f2543Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6682706f2543Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6683706f2543Smrg_LT_TAGVAR(hardcode_direct, $1)=no
6684706f2543Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6685706f2543Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6686706f2543Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6687706f2543Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6688706f2543Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6689706f2543Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
6690706f2543Smrg_LT_TAGVAR(inherit_rpath, $1)=no
6691706f2543Smrg_LT_TAGVAR(module_cmds, $1)=
6692706f2543Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
6693706f2543Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6694706f2543Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6695706f2543Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
6696706f2543Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6697706f2543Smrg_LT_TAGVAR(no_undefined_flag, $1)=
6698706f2543Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6699706f2543Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6700706f2543Smrg
6701706f2543Smrg# Source file extension for f77 test sources.
6702706f2543Smrgac_ext=f
6703706f2543Smrg
6704706f2543Smrg# Object file extension for compiled f77 test sources.
6705706f2543Smrgobjext=o
6706706f2543Smrg_LT_TAGVAR(objext, $1)=$objext
6707706f2543Smrg
6708706f2543Smrg# No sense in running all these tests if we already determined that
6709706f2543Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
6710706f2543Smrg# are currently assumed to apply to all compilers on this platform,
6711706f2543Smrg# and will be corrupted by setting them based on a non-working compiler.
6712706f2543Smrgif test "$_lt_disable_F77" != yes; then
6713706f2543Smrg  # Code to be used in simple compile tests
6714706f2543Smrg  lt_simple_compile_test_code="\
6715706f2543Smrg      subroutine t
6716706f2543Smrg      return
6717706f2543Smrg      end
6718706f2543Smrg"
6719706f2543Smrg
6720706f2543Smrg  # Code to be used in simple link tests
6721706f2543Smrg  lt_simple_link_test_code="\
6722706f2543Smrg      program t
6723706f2543Smrg      end
6724706f2543Smrg"
6725706f2543Smrg
6726706f2543Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6727706f2543Smrg  _LT_TAG_COMPILER
6728706f2543Smrg
6729706f2543Smrg  # save warnings/boilerplate of simple test code
6730706f2543Smrg  _LT_COMPILER_BOILERPLATE
6731706f2543Smrg  _LT_LINKER_BOILERPLATE
6732706f2543Smrg
6733706f2543Smrg  # Allow CC to be a program name with arguments.
6734706f2543Smrg  lt_save_CC="$CC"
6735706f2543Smrg  lt_save_GCC=$GCC
6736706f2543Smrg  CC=${F77-"f77"}
6737706f2543Smrg  compiler=$CC
6738706f2543Smrg  _LT_TAGVAR(compiler, $1)=$CC
6739706f2543Smrg  _LT_CC_BASENAME([$compiler])
6740706f2543Smrg  GCC=$G77
6741706f2543Smrg  if test -n "$compiler"; then
6742706f2543Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
6743706f2543Smrg    AC_MSG_RESULT([$can_build_shared])
6744706f2543Smrg
6745706f2543Smrg    AC_MSG_CHECKING([whether to build shared libraries])
6746706f2543Smrg    test "$can_build_shared" = "no" && enable_shared=no
6747706f2543Smrg
6748706f2543Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
6749706f2543Smrg    # are all built from PIC.
6750706f2543Smrg    case $host_os in
6751706f2543Smrg      aix3*)
6752706f2543Smrg        test "$enable_shared" = yes && enable_static=no
6753706f2543Smrg        if test -n "$RANLIB"; then
6754706f2543Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
6755706f2543Smrg          postinstall_cmds='$RANLIB $lib'
6756706f2543Smrg        fi
6757706f2543Smrg        ;;
6758706f2543Smrg      aix[[4-9]]*)
6759706f2543Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6760706f2543Smrg	  test "$enable_shared" = yes && enable_static=no
6761706f2543Smrg	fi
6762706f2543Smrg        ;;
6763706f2543Smrg    esac
6764706f2543Smrg    AC_MSG_RESULT([$enable_shared])
6765706f2543Smrg
6766706f2543Smrg    AC_MSG_CHECKING([whether to build static libraries])
6767706f2543Smrg    # Make sure either enable_shared or enable_static is yes.
6768706f2543Smrg    test "$enable_shared" = yes || enable_static=yes
6769706f2543Smrg    AC_MSG_RESULT([$enable_static])
6770706f2543Smrg
6771706f2543Smrg    _LT_TAGVAR(GCC, $1)="$G77"
6772706f2543Smrg    _LT_TAGVAR(LD, $1)="$LD"
6773706f2543Smrg
6774706f2543Smrg    ## CAVEAT EMPTOR:
6775706f2543Smrg    ## There is no encapsulation within the following macros, do not change
6776706f2543Smrg    ## the running order or otherwise move them around unless you know exactly
6777706f2543Smrg    ## what you are doing...
6778706f2543Smrg    _LT_COMPILER_PIC($1)
6779706f2543Smrg    _LT_COMPILER_C_O($1)
6780706f2543Smrg    _LT_COMPILER_FILE_LOCKS($1)
6781706f2543Smrg    _LT_LINKER_SHLIBS($1)
6782706f2543Smrg    _LT_SYS_DYNAMIC_LINKER($1)
6783706f2543Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6784706f2543Smrg
6785706f2543Smrg    _LT_CONFIG($1)
6786706f2543Smrg  fi # test -n "$compiler"
6787706f2543Smrg
6788706f2543Smrg  GCC=$lt_save_GCC
6789706f2543Smrg  CC="$lt_save_CC"
6790706f2543Smrgfi # test "$_lt_disable_F77" != yes
6791706f2543Smrg
6792706f2543SmrgAC_LANG_POP
6793706f2543Smrg])# _LT_LANG_F77_CONFIG
6794706f2543Smrg
6795706f2543Smrg
6796706f2543Smrg# _LT_LANG_FC_CONFIG([TAG])
6797706f2543Smrg# -------------------------
6798706f2543Smrg# Ensure that the configuration variables for a Fortran compiler are
6799706f2543Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
6800706f2543Smrg# to write the compiler configuration to `libtool'.
6801706f2543Smrgm4_defun([_LT_LANG_FC_CONFIG],
6802706f2543Smrg[AC_LANG_PUSH(Fortran)
6803706f2543Smrg
6804706f2543Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
6805706f2543Smrg  _lt_disable_FC=yes
6806706f2543Smrgfi
6807706f2543Smrg
6808706f2543Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6809706f2543Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
6810706f2543Smrg_LT_TAGVAR(always_export_symbols, $1)=no
6811706f2543Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6812706f2543Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6813706f2543Smrg_LT_TAGVAR(hardcode_direct, $1)=no
6814706f2543Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6815706f2543Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6816706f2543Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6817706f2543Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6818706f2543Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6819706f2543Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
6820706f2543Smrg_LT_TAGVAR(inherit_rpath, $1)=no
6821706f2543Smrg_LT_TAGVAR(module_cmds, $1)=
6822706f2543Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
6823706f2543Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6824706f2543Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6825706f2543Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
6826706f2543Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6827706f2543Smrg_LT_TAGVAR(no_undefined_flag, $1)=
6828706f2543Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6829706f2543Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6830706f2543Smrg
6831706f2543Smrg# Source file extension for fc test sources.
6832706f2543Smrgac_ext=${ac_fc_srcext-f}
6833706f2543Smrg
6834706f2543Smrg# Object file extension for compiled fc test sources.
6835706f2543Smrgobjext=o
6836706f2543Smrg_LT_TAGVAR(objext, $1)=$objext
6837706f2543Smrg
6838706f2543Smrg# No sense in running all these tests if we already determined that
6839706f2543Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
6840706f2543Smrg# are currently assumed to apply to all compilers on this platform,
6841706f2543Smrg# and will be corrupted by setting them based on a non-working compiler.
6842706f2543Smrgif test "$_lt_disable_FC" != yes; then
6843706f2543Smrg  # Code to be used in simple compile tests
6844706f2543Smrg  lt_simple_compile_test_code="\
6845706f2543Smrg      subroutine t
6846706f2543Smrg      return
6847706f2543Smrg      end
6848706f2543Smrg"
6849706f2543Smrg
6850706f2543Smrg  # Code to be used in simple link tests
6851706f2543Smrg  lt_simple_link_test_code="\
6852706f2543Smrg      program t
6853706f2543Smrg      end
6854706f2543Smrg"
6855706f2543Smrg
6856706f2543Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6857706f2543Smrg  _LT_TAG_COMPILER
6858706f2543Smrg
6859706f2543Smrg  # save warnings/boilerplate of simple test code
6860706f2543Smrg  _LT_COMPILER_BOILERPLATE
6861706f2543Smrg  _LT_LINKER_BOILERPLATE
6862706f2543Smrg
6863706f2543Smrg  # Allow CC to be a program name with arguments.
6864706f2543Smrg  lt_save_CC="$CC"
6865706f2543Smrg  lt_save_GCC=$GCC
6866706f2543Smrg  CC=${FC-"f95"}
6867706f2543Smrg  compiler=$CC
6868706f2543Smrg  GCC=$ac_cv_fc_compiler_gnu
6869706f2543Smrg
6870706f2543Smrg  _LT_TAGVAR(compiler, $1)=$CC
6871706f2543Smrg  _LT_CC_BASENAME([$compiler])
6872706f2543Smrg
6873706f2543Smrg  if test -n "$compiler"; then
6874706f2543Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
6875706f2543Smrg    AC_MSG_RESULT([$can_build_shared])
6876706f2543Smrg
6877706f2543Smrg    AC_MSG_CHECKING([whether to build shared libraries])
6878706f2543Smrg    test "$can_build_shared" = "no" && enable_shared=no
6879706f2543Smrg
6880706f2543Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
6881706f2543Smrg    # are all built from PIC.
6882706f2543Smrg    case $host_os in
6883706f2543Smrg      aix3*)
6884706f2543Smrg        test "$enable_shared" = yes && enable_static=no
6885706f2543Smrg        if test -n "$RANLIB"; then
6886706f2543Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
6887706f2543Smrg          postinstall_cmds='$RANLIB $lib'
6888706f2543Smrg        fi
6889706f2543Smrg        ;;
6890706f2543Smrg      aix[[4-9]]*)
6891706f2543Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6892706f2543Smrg	  test "$enable_shared" = yes && enable_static=no
6893706f2543Smrg	fi
6894706f2543Smrg        ;;
6895706f2543Smrg    esac
6896706f2543Smrg    AC_MSG_RESULT([$enable_shared])
6897706f2543Smrg
6898706f2543Smrg    AC_MSG_CHECKING([whether to build static libraries])
6899706f2543Smrg    # Make sure either enable_shared or enable_static is yes.
6900706f2543Smrg    test "$enable_shared" = yes || enable_static=yes
6901706f2543Smrg    AC_MSG_RESULT([$enable_static])
6902706f2543Smrg
6903706f2543Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
6904706f2543Smrg    _LT_TAGVAR(LD, $1)="$LD"
6905706f2543Smrg
6906706f2543Smrg    ## CAVEAT EMPTOR:
6907706f2543Smrg    ## There is no encapsulation within the following macros, do not change
6908706f2543Smrg    ## the running order or otherwise move them around unless you know exactly
6909706f2543Smrg    ## what you are doing...
6910706f2543Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
6911706f2543Smrg    _LT_COMPILER_PIC($1)
6912706f2543Smrg    _LT_COMPILER_C_O($1)
6913706f2543Smrg    _LT_COMPILER_FILE_LOCKS($1)
6914706f2543Smrg    _LT_LINKER_SHLIBS($1)
6915706f2543Smrg    _LT_SYS_DYNAMIC_LINKER($1)
6916706f2543Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6917706f2543Smrg
6918706f2543Smrg    _LT_CONFIG($1)
6919706f2543Smrg  fi # test -n "$compiler"
6920706f2543Smrg
6921706f2543Smrg  GCC=$lt_save_GCC
6922706f2543Smrg  CC="$lt_save_CC"
6923706f2543Smrgfi # test "$_lt_disable_FC" != yes
6924706f2543Smrg
6925706f2543SmrgAC_LANG_POP
6926706f2543Smrg])# _LT_LANG_FC_CONFIG
6927706f2543Smrg
6928706f2543Smrg
6929706f2543Smrg# _LT_LANG_GCJ_CONFIG([TAG])
6930706f2543Smrg# --------------------------
6931706f2543Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
6932706f2543Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
6933706f2543Smrg# to write the compiler configuration to `libtool'.
6934706f2543Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
6935706f2543Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
6936706f2543SmrgAC_LANG_SAVE
6937706f2543Smrg
6938706f2543Smrg# Source file extension for Java test sources.
6939706f2543Smrgac_ext=java
6940706f2543Smrg
6941706f2543Smrg# Object file extension for compiled Java test sources.
6942706f2543Smrgobjext=o
6943706f2543Smrg_LT_TAGVAR(objext, $1)=$objext
6944706f2543Smrg
6945706f2543Smrg# Code to be used in simple compile tests
6946706f2543Smrglt_simple_compile_test_code="class foo {}"
6947706f2543Smrg
6948706f2543Smrg# Code to be used in simple link tests
6949706f2543Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
6950706f2543Smrg
6951706f2543Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6952706f2543Smrg_LT_TAG_COMPILER
6953706f2543Smrg
6954706f2543Smrg# save warnings/boilerplate of simple test code
6955706f2543Smrg_LT_COMPILER_BOILERPLATE
6956706f2543Smrg_LT_LINKER_BOILERPLATE
6957706f2543Smrg
6958706f2543Smrg# Allow CC to be a program name with arguments.
6959706f2543Smrglt_save_CC="$CC"
6960706f2543Smrglt_save_GCC=$GCC
6961706f2543SmrgGCC=yes
6962706f2543SmrgCC=${GCJ-"gcj"}
6963706f2543Smrgcompiler=$CC
6964706f2543Smrg_LT_TAGVAR(compiler, $1)=$CC
6965706f2543Smrg_LT_TAGVAR(LD, $1)="$LD"
6966706f2543Smrg_LT_CC_BASENAME([$compiler])
6967706f2543Smrg
6968706f2543Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
6969706f2543Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6970706f2543Smrg
6971706f2543Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6972706f2543Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
6973706f2543Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6974706f2543Smrg
6975706f2543Smrg## CAVEAT EMPTOR:
6976706f2543Smrg## There is no encapsulation within the following macros, do not change
6977706f2543Smrg## the running order or otherwise move them around unless you know exactly
6978706f2543Smrg## what you are doing...
6979706f2543Smrgif test -n "$compiler"; then
6980706f2543Smrg  _LT_COMPILER_NO_RTTI($1)
6981706f2543Smrg  _LT_COMPILER_PIC($1)
6982706f2543Smrg  _LT_COMPILER_C_O($1)
6983706f2543Smrg  _LT_COMPILER_FILE_LOCKS($1)
6984706f2543Smrg  _LT_LINKER_SHLIBS($1)
6985706f2543Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
6986706f2543Smrg
6987706f2543Smrg  _LT_CONFIG($1)
6988706f2543Smrgfi
6989706f2543Smrg
6990706f2543SmrgAC_LANG_RESTORE
6991706f2543Smrg
6992706f2543SmrgGCC=$lt_save_GCC
6993706f2543SmrgCC="$lt_save_CC"
6994706f2543Smrg])# _LT_LANG_GCJ_CONFIG
6995706f2543Smrg
6996706f2543Smrg
6997706f2543Smrg# _LT_LANG_RC_CONFIG([TAG])
6998706f2543Smrg# -------------------------
6999706f2543Smrg# Ensure that the configuration variables for the Windows resource compiler
7000706f2543Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7001706f2543Smrg# to write the compiler configuration to `libtool'.
7002706f2543Smrgm4_defun([_LT_LANG_RC_CONFIG],
7003706f2543Smrg[AC_REQUIRE([LT_PROG_RC])dnl
7004706f2543SmrgAC_LANG_SAVE
7005706f2543Smrg
7006706f2543Smrg# Source file extension for RC test sources.
7007706f2543Smrgac_ext=rc
7008706f2543Smrg
7009706f2543Smrg# Object file extension for compiled RC test sources.
7010706f2543Smrgobjext=o
7011706f2543Smrg_LT_TAGVAR(objext, $1)=$objext
7012706f2543Smrg
7013706f2543Smrg# Code to be used in simple compile tests
7014706f2543Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
7015706f2543Smrg
7016706f2543Smrg# Code to be used in simple link tests
7017706f2543Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
7018706f2543Smrg
7019706f2543Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7020706f2543Smrg_LT_TAG_COMPILER
7021706f2543Smrg
7022706f2543Smrg# save warnings/boilerplate of simple test code
7023706f2543Smrg_LT_COMPILER_BOILERPLATE
7024706f2543Smrg_LT_LINKER_BOILERPLATE
7025706f2543Smrg
7026706f2543Smrg# Allow CC to be a program name with arguments.
7027706f2543Smrglt_save_CC="$CC"
7028706f2543Smrglt_save_GCC=$GCC
7029706f2543SmrgGCC=
7030706f2543SmrgCC=${RC-"windres"}
7031706f2543Smrgcompiler=$CC
7032706f2543Smrg_LT_TAGVAR(compiler, $1)=$CC
7033706f2543Smrg_LT_CC_BASENAME([$compiler])
7034706f2543Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
7035706f2543Smrg
7036706f2543Smrgif test -n "$compiler"; then
7037706f2543Smrg  :
7038706f2543Smrg  _LT_CONFIG($1)
7039706f2543Smrgfi
7040706f2543Smrg
7041706f2543SmrgGCC=$lt_save_GCC
7042706f2543SmrgAC_LANG_RESTORE
7043706f2543SmrgCC="$lt_save_CC"
7044706f2543Smrg])# _LT_LANG_RC_CONFIG
7045706f2543Smrg
7046706f2543Smrg
7047706f2543Smrg# LT_PROG_GCJ
7048706f2543Smrg# -----------
7049706f2543SmrgAC_DEFUN([LT_PROG_GCJ],
7050706f2543Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
7051706f2543Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
7052706f2543Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
7053706f2543Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
7054706f2543Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
7055706f2543Smrg])
7056706f2543Smrg
7057706f2543Smrg# Old name:
7058706f2543SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
7059706f2543Smrgdnl aclocal-1.4 backwards compatibility:
7060706f2543Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
7061706f2543Smrg
7062706f2543Smrg
7063706f2543Smrg# LT_PROG_RC
7064706f2543Smrg# ----------
7065706f2543SmrgAC_DEFUN([LT_PROG_RC],
7066706f2543Smrg[AC_CHECK_TOOL(RC, windres,)
7067706f2543Smrg])
7068706f2543Smrg
7069706f2543Smrg# Old name:
7070706f2543SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
7071706f2543Smrgdnl aclocal-1.4 backwards compatibility:
7072706f2543Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
7073706f2543Smrg
7074706f2543Smrg
7075706f2543Smrg# _LT_DECL_EGREP
7076706f2543Smrg# --------------
7077706f2543Smrg# If we don't have a new enough Autoconf to choose the best grep
7078706f2543Smrg# available, choose the one first in the user's PATH.
7079706f2543Smrgm4_defun([_LT_DECL_EGREP],
7080706f2543Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
7081706f2543SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
7082706f2543Smrgtest -z "$GREP" && GREP=grep
7083706f2543Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7084706f2543Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
7085706f2543Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
7086706f2543Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7087706f2543SmrgAC_SUBST([GREP])
7088706f2543Smrg])
7089706f2543Smrg
7090706f2543Smrg
7091706f2543Smrg# _LT_DECL_OBJDUMP
7092706f2543Smrg# --------------
7093706f2543Smrg# If we don't have a new enough Autoconf to choose the best objdump
7094706f2543Smrg# available, choose the one first in the user's PATH.
7095706f2543Smrgm4_defun([_LT_DECL_OBJDUMP],
7096706f2543Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
7097706f2543Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
7098706f2543Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7099706f2543SmrgAC_SUBST([OBJDUMP])
7100706f2543Smrg])
7101706f2543Smrg
7102706f2543Smrg
7103706f2543Smrg# _LT_DECL_SED
7104706f2543Smrg# ------------
7105706f2543Smrg# Check for a fully-functional sed program, that truncates
7106706f2543Smrg# as few characters as possible.  Prefer GNU sed if found.
7107706f2543Smrgm4_defun([_LT_DECL_SED],
7108706f2543Smrg[AC_PROG_SED
7109706f2543Smrgtest -z "$SED" && SED=sed
7110706f2543SmrgXsed="$SED -e 1s/^X//"
7111706f2543Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7112706f2543Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7113706f2543Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7114706f2543Smrg])# _LT_DECL_SED
7115706f2543Smrg
7116706f2543Smrgm4_ifndef([AC_PROG_SED], [
7117706f2543Smrg############################################################
7118706f2543Smrg# NOTE: This macro has been submitted for inclusion into   #
7119706f2543Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
7120706f2543Smrg#  a released version of Autoconf we should remove this    #
7121706f2543Smrg#  macro and use it instead.                               #
7122706f2543Smrg############################################################
7123706f2543Smrg
7124706f2543Smrgm4_defun([AC_PROG_SED],
7125706f2543Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
7126706f2543SmrgAC_CACHE_VAL(lt_cv_path_SED,
7127706f2543Smrg[# Loop through the user's path and test for sed and gsed.
7128706f2543Smrg# Then use that list of sed's as ones to test for truncation.
7129706f2543Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7130706f2543Smrgfor as_dir in $PATH
7131706f2543Smrgdo
7132706f2543Smrg  IFS=$as_save_IFS
7133706f2543Smrg  test -z "$as_dir" && as_dir=.
7134706f2543Smrg  for lt_ac_prog in sed gsed; do
7135706f2543Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
7136706f2543Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7137706f2543Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7138706f2543Smrg      fi
7139706f2543Smrg    done
7140706f2543Smrg  done
7141706f2543Smrgdone
7142706f2543SmrgIFS=$as_save_IFS
7143706f2543Smrglt_ac_max=0
7144706f2543Smrglt_ac_count=0
7145706f2543Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
7146706f2543Smrg# along with /bin/sed that truncates output.
7147706f2543Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7148706f2543Smrg  test ! -f $lt_ac_sed && continue
7149706f2543Smrg  cat /dev/null > conftest.in
7150706f2543Smrg  lt_ac_count=0
7151706f2543Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7152706f2543Smrg  # Check for GNU sed and select it if it is found.
7153706f2543Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7154706f2543Smrg    lt_cv_path_SED=$lt_ac_sed
7155706f2543Smrg    break
7156706f2543Smrg  fi
7157706f2543Smrg  while true; do
7158706f2543Smrg    cat conftest.in conftest.in >conftest.tmp
7159706f2543Smrg    mv conftest.tmp conftest.in
7160706f2543Smrg    cp conftest.in conftest.nl
7161706f2543Smrg    echo >>conftest.nl
7162706f2543Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7163706f2543Smrg    cmp -s conftest.out conftest.nl || break
7164706f2543Smrg    # 10000 chars as input seems more than enough
7165706f2543Smrg    test $lt_ac_count -gt 10 && break
7166706f2543Smrg    lt_ac_count=`expr $lt_ac_count + 1`
7167706f2543Smrg    if test $lt_ac_count -gt $lt_ac_max; then
7168706f2543Smrg      lt_ac_max=$lt_ac_count
7169706f2543Smrg      lt_cv_path_SED=$lt_ac_sed
7170706f2543Smrg    fi
7171706f2543Smrg  done
7172706f2543Smrgdone
7173706f2543Smrg])
7174706f2543SmrgSED=$lt_cv_path_SED
7175706f2543SmrgAC_SUBST([SED])
7176706f2543SmrgAC_MSG_RESULT([$SED])
7177706f2543Smrg])#AC_PROG_SED
7178706f2543Smrg])#m4_ifndef
7179706f2543Smrg
7180706f2543Smrg# Old name:
7181706f2543SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7182706f2543Smrgdnl aclocal-1.4 backwards compatibility:
7183706f2543Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
7184706f2543Smrg
7185706f2543Smrg
7186706f2543Smrg# _LT_CHECK_SHELL_FEATURES
7187706f2543Smrg# ------------------------
7188706f2543Smrg# Find out whether the shell is Bourne or XSI compatible,
7189706f2543Smrg# or has some other useful features.
7190706f2543Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
7191706f2543Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7192706f2543Smrg# Try some XSI features
7193706f2543Smrgxsi_shell=no
7194706f2543Smrg( _lt_dummy="a/b/c"
7195706f2543Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
7196706f2543Smrg      = c,a/b,, \
7197706f2543Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
7198706f2543Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7199706f2543Smrg  && xsi_shell=yes
7200706f2543SmrgAC_MSG_RESULT([$xsi_shell])
7201706f2543Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7202706f2543Smrg
7203706f2543SmrgAC_MSG_CHECKING([whether the shell understands "+="])
7204706f2543Smrglt_shell_append=no
7205706f2543Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7206706f2543Smrg    >/dev/null 2>&1 \
7207706f2543Smrg  && lt_shell_append=yes
7208706f2543SmrgAC_MSG_RESULT([$lt_shell_append])
7209706f2543Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7210706f2543Smrg
7211706f2543Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7212706f2543Smrg  lt_unset=unset
7213706f2543Smrgelse
7214706f2543Smrg  lt_unset=false
7215706f2543Smrgfi
7216706f2543Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7217706f2543Smrg
7218706f2543Smrg# test EBCDIC or ASCII
7219706f2543Smrgcase `echo X|tr X '\101'` in
7220706f2543Smrg A) # ASCII based system
7221706f2543Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7222706f2543Smrg  lt_SP2NL='tr \040 \012'
7223706f2543Smrg  lt_NL2SP='tr \015\012 \040\040'
7224706f2543Smrg  ;;
7225706f2543Smrg *) # EBCDIC based system
7226706f2543Smrg  lt_SP2NL='tr \100 \n'
7227706f2543Smrg  lt_NL2SP='tr \r\n \100\100'
7228706f2543Smrg  ;;
7229706f2543Smrgesac
7230706f2543Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7231706f2543Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7232706f2543Smrg])# _LT_CHECK_SHELL_FEATURES
7233706f2543Smrg
7234706f2543Smrg
7235706f2543Smrg# _LT_PROG_XSI_SHELLFNS
7236706f2543Smrg# ---------------------
7237706f2543Smrg# Bourne and XSI compatible variants of some useful shell functions.
7238706f2543Smrgm4_defun([_LT_PROG_XSI_SHELLFNS],
7239706f2543Smrg[case $xsi_shell in
7240706f2543Smrg  yes)
7241706f2543Smrg    cat << \_LT_EOF >> "$cfgfile"
7242706f2543Smrg
7243706f2543Smrg# func_dirname file append nondir_replacement
7244706f2543Smrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
7245706f2543Smrg# otherwise set result to NONDIR_REPLACEMENT.
7246706f2543Smrgfunc_dirname ()
7247706f2543Smrg{
7248706f2543Smrg  case ${1} in
7249706f2543Smrg    */*) func_dirname_result="${1%/*}${2}" ;;
7250706f2543Smrg    *  ) func_dirname_result="${3}" ;;
7251706f2543Smrg  esac
7252706f2543Smrg}
7253706f2543Smrg
7254706f2543Smrg# func_basename file
7255706f2543Smrgfunc_basename ()
7256706f2543Smrg{
7257706f2543Smrg  func_basename_result="${1##*/}"
7258706f2543Smrg}
7259706f2543Smrg
7260706f2543Smrg# func_dirname_and_basename file append nondir_replacement
7261706f2543Smrg# perform func_basename and func_dirname in a single function
7262706f2543Smrg# call:
7263706f2543Smrg#   dirname:  Compute the dirname of FILE.  If nonempty,
7264706f2543Smrg#             add APPEND to the result, otherwise set result
7265706f2543Smrg#             to NONDIR_REPLACEMENT.
7266706f2543Smrg#             value returned in "$func_dirname_result"
7267706f2543Smrg#   basename: Compute filename of FILE.
7268706f2543Smrg#             value retuned in "$func_basename_result"
7269706f2543Smrg# Implementation must be kept synchronized with func_dirname
7270706f2543Smrg# and func_basename. For efficiency, we do not delegate to
7271706f2543Smrg# those functions but instead duplicate the functionality here.
7272706f2543Smrgfunc_dirname_and_basename ()
7273706f2543Smrg{
7274706f2543Smrg  case ${1} in
7275706f2543Smrg    */*) func_dirname_result="${1%/*}${2}" ;;
7276706f2543Smrg    *  ) func_dirname_result="${3}" ;;
7277706f2543Smrg  esac
7278706f2543Smrg  func_basename_result="${1##*/}"
7279706f2543Smrg}
7280706f2543Smrg
7281706f2543Smrg# func_stripname prefix suffix name
7282706f2543Smrg# strip PREFIX and SUFFIX off of NAME.
7283706f2543Smrg# PREFIX and SUFFIX must not contain globbing or regex special
7284706f2543Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7285706f2543Smrg# dot (in which case that matches only a dot).
7286706f2543Smrgfunc_stripname ()
7287706f2543Smrg{
7288706f2543Smrg  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7289706f2543Smrg  # positional parameters, so assign one to ordinary parameter first.
7290706f2543Smrg  func_stripname_result=${3}
7291706f2543Smrg  func_stripname_result=${func_stripname_result#"${1}"}
7292706f2543Smrg  func_stripname_result=${func_stripname_result%"${2}"}
7293706f2543Smrg}
7294706f2543Smrg
7295706f2543Smrg# func_opt_split
7296706f2543Smrgfunc_opt_split ()
7297706f2543Smrg{
7298706f2543Smrg  func_opt_split_opt=${1%%=*}
7299706f2543Smrg  func_opt_split_arg=${1#*=}
7300706f2543Smrg}
7301706f2543Smrg
7302706f2543Smrg# func_lo2o object
7303706f2543Smrgfunc_lo2o ()
7304706f2543Smrg{
7305706f2543Smrg  case ${1} in
7306706f2543Smrg    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7307706f2543Smrg    *)    func_lo2o_result=${1} ;;
7308706f2543Smrg  esac
7309706f2543Smrg}
7310706f2543Smrg
7311706f2543Smrg# func_xform libobj-or-source
7312706f2543Smrgfunc_xform ()
7313706f2543Smrg{
7314706f2543Smrg  func_xform_result=${1%.*}.lo
7315706f2543Smrg}
7316706f2543Smrg
7317706f2543Smrg# func_arith arithmetic-term...
7318706f2543Smrgfunc_arith ()
7319706f2543Smrg{
7320706f2543Smrg  func_arith_result=$(( $[*] ))
7321706f2543Smrg}
7322706f2543Smrg
7323706f2543Smrg# func_len string
7324706f2543Smrg# STRING may not start with a hyphen.
7325706f2543Smrgfunc_len ()
7326706f2543Smrg{
7327706f2543Smrg  func_len_result=${#1}
7328706f2543Smrg}
7329706f2543Smrg
7330706f2543Smrg_LT_EOF
7331706f2543Smrg    ;;
7332706f2543Smrg  *) # Bourne compatible functions.
7333706f2543Smrg    cat << \_LT_EOF >> "$cfgfile"
7334706f2543Smrg
7335706f2543Smrg# func_dirname file append nondir_replacement
7336706f2543Smrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
7337706f2543Smrg# otherwise set result to NONDIR_REPLACEMENT.
7338706f2543Smrgfunc_dirname ()
7339706f2543Smrg{
7340706f2543Smrg  # Extract subdirectory from the argument.
7341706f2543Smrg  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
7342706f2543Smrg  if test "X$func_dirname_result" = "X${1}"; then
7343706f2543Smrg    func_dirname_result="${3}"
7344706f2543Smrg  else
7345706f2543Smrg    func_dirname_result="$func_dirname_result${2}"
7346706f2543Smrg  fi
7347706f2543Smrg}
7348706f2543Smrg
7349706f2543Smrg# func_basename file
7350706f2543Smrgfunc_basename ()
7351706f2543Smrg{
7352706f2543Smrg  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
7353706f2543Smrg}
7354706f2543Smrg
7355706f2543Smrgdnl func_dirname_and_basename
7356706f2543Smrgdnl A portable version of this function is already defined in general.m4sh
7357706f2543Smrgdnl so there is no need for it here.
7358706f2543Smrg
7359706f2543Smrg# func_stripname prefix suffix name
7360706f2543Smrg# strip PREFIX and SUFFIX off of NAME.
7361706f2543Smrg# PREFIX and SUFFIX must not contain globbing or regex special
7362706f2543Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7363706f2543Smrg# dot (in which case that matches only a dot).
7364706f2543Smrg# func_strip_suffix prefix name
7365706f2543Smrgfunc_stripname ()
7366706f2543Smrg{
7367706f2543Smrg  case ${2} in
7368706f2543Smrg    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
7369706f2543Smrg    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
7370706f2543Smrg  esac
7371706f2543Smrg}
7372706f2543Smrg
7373706f2543Smrg# sed scripts:
7374706f2543Smrgmy_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
7375706f2543Smrgmy_sed_long_arg='1s/^-[[^=]]*=//'
7376706f2543Smrg
7377706f2543Smrg# func_opt_split
7378706f2543Smrgfunc_opt_split ()
7379706f2543Smrg{
7380706f2543Smrg  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
7381706f2543Smrg  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
7382706f2543Smrg}
7383706f2543Smrg
7384706f2543Smrg# func_lo2o object
7385706f2543Smrgfunc_lo2o ()
7386706f2543Smrg{
7387706f2543Smrg  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
7388706f2543Smrg}
7389706f2543Smrg
7390706f2543Smrg# func_xform libobj-or-source
7391706f2543Smrgfunc_xform ()
7392706f2543Smrg{
7393706f2543Smrg  func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'`
7394706f2543Smrg}
7395706f2543Smrg
7396706f2543Smrg# func_arith arithmetic-term...
7397706f2543Smrgfunc_arith ()
7398706f2543Smrg{
7399706f2543Smrg  func_arith_result=`expr "$[@]"`
7400706f2543Smrg}
7401706f2543Smrg
7402706f2543Smrg# func_len string
7403706f2543Smrg# STRING may not start with a hyphen.
7404706f2543Smrgfunc_len ()
7405706f2543Smrg{
7406706f2543Smrg  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
7407706f2543Smrg}
7408706f2543Smrg
7409706f2543Smrg_LT_EOF
7410706f2543Smrgesac
7411706f2543Smrg
7412706f2543Smrgcase $lt_shell_append in
7413706f2543Smrg  yes)
7414706f2543Smrg    cat << \_LT_EOF >> "$cfgfile"
7415706f2543Smrg
7416706f2543Smrg# func_append var value
7417706f2543Smrg# Append VALUE to the end of shell variable VAR.
7418706f2543Smrgfunc_append ()
7419706f2543Smrg{
7420706f2543Smrg  eval "$[1]+=\$[2]"
7421706f2543Smrg}
7422706f2543Smrg_LT_EOF
7423706f2543Smrg    ;;
7424706f2543Smrg  *)
7425706f2543Smrg    cat << \_LT_EOF >> "$cfgfile"
7426706f2543Smrg
7427706f2543Smrg# func_append var value
7428706f2543Smrg# Append VALUE to the end of shell variable VAR.
7429706f2543Smrgfunc_append ()
7430706f2543Smrg{
7431706f2543Smrg  eval "$[1]=\$$[1]\$[2]"
7432706f2543Smrg}
7433706f2543Smrg
7434706f2543Smrg_LT_EOF
7435706f2543Smrg    ;;
7436706f2543Smrg  esac
7437706f2543Smrg])
7438