1243730Srwatson# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2243730Srwatson#
3243730Srwatson#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
4243730Srwatson#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
5243730Srwatson#                 Foundation, Inc.
6243730Srwatson#   Written by Gordon Matzigkeit, 1996
7243730Srwatson#
8243730Srwatson# This file is free software; the Free Software Foundation gives
9243730Srwatson# unlimited permission to copy and/or distribute it, with or without
10243730Srwatson# modifications, as long as this notice is preserved.
11243730Srwatson
12243730Srwatsonm4_define([_LT_COPYING], [dnl
13243730Srwatson#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
14243730Srwatson#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
15243730Srwatson#                 Foundation, Inc.
16243730Srwatson#   Written by Gordon Matzigkeit, 1996
17243730Srwatson#
18243730Srwatson#   This file is part of GNU Libtool.
19243730Srwatson#
20243730Srwatson# GNU Libtool is free software; you can redistribute it and/or
21243730Srwatson# modify it under the terms of the GNU General Public License as
22243730Srwatson# published by the Free Software Foundation; either version 2 of
23243730Srwatson# the License, or (at your option) any later version.
24243730Srwatson#
25243730Srwatson# As a special exception to the GNU General Public License,
26243730Srwatson# if you distribute this file as part of a program or library that
27243730Srwatson# is built using GNU Libtool, you may include this file under the
28243730Srwatson# same distribution terms that you use for the rest of that program.
29243730Srwatson#
30243730Srwatson# GNU Libtool is distributed in the hope that it will be useful,
31243730Srwatson# but WITHOUT ANY WARRANTY; without even the implied warranty of
32243730Srwatson# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
33243730Srwatson# GNU General Public License for more details.
34243730Srwatson#
35243730Srwatson# You should have received a copy of the GNU General Public License
36243730Srwatson# along with GNU Libtool; see the file COPYING.  If not, a copy
37243730Srwatson# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
38243730Srwatson# obtained by writing to the Free Software Foundation, Inc.,
39243730Srwatson# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
40243730Srwatson])
41243730Srwatson
42243730Srwatson# serial 57 LT_INIT
43243730Srwatson
44243730Srwatson
45243730Srwatson# LT_PREREQ(VERSION)
46243730Srwatson# ------------------
47243730Srwatson# Complain and exit if this libtool version is less that VERSION.
48243730Srwatsonm4_defun([LT_PREREQ],
49243730Srwatson[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
50243730Srwatson       [m4_default([$3],
51243730Srwatson		   [m4_fatal([Libtool version $1 or higher is required],
52243730Srwatson		             63)])],
53243730Srwatson       [$2])])
54243730Srwatson
55243730Srwatson
56243730Srwatson# _LT_CHECK_BUILDDIR
57243730Srwatson# ------------------
58243730Srwatson# Complain if the absolute build directory name contains unusual characters
59243730Srwatsonm4_defun([_LT_CHECK_BUILDDIR],
60243730Srwatson[case `pwd` in
61243730Srwatson  *\ * | *\	*)
62243730Srwatson    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
63243730Srwatsonesac
64243730Srwatson])
65243730Srwatson
66243730Srwatson
67243730Srwatson# LT_INIT([OPTIONS])
68243730Srwatson# ------------------
69243730SrwatsonAC_DEFUN([LT_INIT],
70243730Srwatson[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
71243730SrwatsonAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
72243730SrwatsonAC_BEFORE([$0], [LT_LANG])dnl
73243730SrwatsonAC_BEFORE([$0], [LT_OUTPUT])dnl
74243730SrwatsonAC_BEFORE([$0], [LTDL_INIT])dnl
75243730Srwatsonm4_require([_LT_CHECK_BUILDDIR])dnl
76243730Srwatson
77243730Srwatsondnl Autoconf doesn't catch unexpanded LT_ macros by default:
78243730Srwatsonm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
79243730Srwatsonm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
80243730Srwatsondnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
81243730Srwatsondnl unless we require an AC_DEFUNed macro:
82243730SrwatsonAC_REQUIRE([LTOPTIONS_VERSION])dnl
83243730SrwatsonAC_REQUIRE([LTSUGAR_VERSION])dnl
84243730SrwatsonAC_REQUIRE([LTVERSION_VERSION])dnl
85243730SrwatsonAC_REQUIRE([LTOBSOLETE_VERSION])dnl
86243730Srwatsonm4_require([_LT_PROG_LTMAIN])dnl
87243730Srwatson
88243730Srwatson_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
89243730Srwatson
90243730Srwatsondnl Parse OPTIONS
91243730Srwatson_LT_SET_OPTIONS([$0], [$1])
92243730Srwatson
93243730Srwatson# This can be used to rebuild libtool when needed
94243730SrwatsonLIBTOOL_DEPS="$ltmain"
95243730Srwatson
96243730Srwatson# Always use our own libtool.
97243730SrwatsonLIBTOOL='$(SHELL) $(top_builddir)/libtool'
98243730SrwatsonAC_SUBST(LIBTOOL)dnl
99243730Srwatson
100243730Srwatson_LT_SETUP
101243730Srwatson
102243730Srwatson# Only expand once:
103243730Srwatsonm4_define([LT_INIT])
104243730Srwatson])# LT_INIT
105243730Srwatson
106243730Srwatson# Old names:
107243730SrwatsonAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
108243730SrwatsonAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
109243730Srwatsondnl aclocal-1.4 backwards compatibility:
110243730Srwatsondnl AC_DEFUN([AC_PROG_LIBTOOL], [])
111243730Srwatsondnl AC_DEFUN([AM_PROG_LIBTOOL], [])
112243730Srwatson
113243730Srwatson
114243730Srwatson# _LT_CC_BASENAME(CC)
115243730Srwatson# -------------------
116243730Srwatson# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
117243730Srwatsonm4_defun([_LT_CC_BASENAME],
118243730Srwatson[for cc_temp in $1""; do
119243730Srwatson  case $cc_temp in
120243730Srwatson    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
121243730Srwatson    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
122243730Srwatson    \-*) ;;
123243730Srwatson    *) break;;
124243730Srwatson  esac
125243730Srwatsondone
126243730Srwatsoncc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
127243730Srwatson])
128243730Srwatson
129243730Srwatson
130243730Srwatson# _LT_FILEUTILS_DEFAULTS
131243730Srwatson# ----------------------
132243730Srwatson# It is okay to use these file commands and assume they have been set
133243730Srwatson# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
134243730Srwatsonm4_defun([_LT_FILEUTILS_DEFAULTS],
135243730Srwatson[: ${CP="cp -f"}
136243730Srwatson: ${MV="mv -f"}
137243730Srwatson: ${RM="rm -f"}
138243730Srwatson])# _LT_FILEUTILS_DEFAULTS
139243730Srwatson
140243730Srwatson
141243730Srwatson# _LT_SETUP
142243730Srwatson# ---------
143243730Srwatsonm4_defun([_LT_SETUP],
144243730Srwatson[AC_REQUIRE([AC_CANONICAL_HOST])dnl
145243730SrwatsonAC_REQUIRE([AC_CANONICAL_BUILD])dnl
146243730SrwatsonAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
147243730SrwatsonAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
148243730Srwatson
149243730Srwatson_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
150243730Srwatsondnl
151243730Srwatson_LT_DECL([], [host_alias], [0], [The host system])dnl
152243730Srwatson_LT_DECL([], [host], [0])dnl
153243730Srwatson_LT_DECL([], [host_os], [0])dnl
154243730Srwatsondnl
155243730Srwatson_LT_DECL([], [build_alias], [0], [The build system])dnl
156243730Srwatson_LT_DECL([], [build], [0])dnl
157243730Srwatson_LT_DECL([], [build_os], [0])dnl
158243730Srwatsondnl
159243730SrwatsonAC_REQUIRE([AC_PROG_CC])dnl
160243730SrwatsonAC_REQUIRE([LT_PATH_LD])dnl
161243730SrwatsonAC_REQUIRE([LT_PATH_NM])dnl
162243730Srwatsondnl
163243730SrwatsonAC_REQUIRE([AC_PROG_LN_S])dnl
164243730Srwatsontest -z "$LN_S" && LN_S="ln -s"
165243730Srwatson_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
166243730Srwatsondnl
167243730SrwatsonAC_REQUIRE([LT_CMD_MAX_LEN])dnl
168243730Srwatson_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
169243730Srwatson_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
170243730Srwatsondnl
171243730Srwatsonm4_require([_LT_FILEUTILS_DEFAULTS])dnl
172243730Srwatsonm4_require([_LT_CHECK_SHELL_FEATURES])dnl
173243730Srwatsonm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
174243730Srwatsonm4_require([_LT_CMD_RELOAD])dnl
175243730Srwatsonm4_require([_LT_CHECK_MAGIC_METHOD])dnl
176243730Srwatsonm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
177243730Srwatsonm4_require([_LT_CMD_OLD_ARCHIVE])dnl
178243730Srwatsonm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
179243730Srwatsonm4_require([_LT_WITH_SYSROOT])dnl
180243730Srwatson
181243730Srwatson_LT_CONFIG_LIBTOOL_INIT([
182243730Srwatson# See if we are running on zsh, and set the options which allow our
183243730Srwatson# commands through without removal of \ escapes INIT.
184243730Srwatsonif test -n "\${ZSH_VERSION+set}" ; then
185243730Srwatson   setopt NO_GLOB_SUBST
186243730Srwatsonfi
187243730Srwatson])
188243730Srwatsonif test -n "${ZSH_VERSION+set}" ; then
189243730Srwatson   setopt NO_GLOB_SUBST
190243730Srwatsonfi
191243730Srwatson
192243730Srwatson_LT_CHECK_OBJDIR
193243730Srwatson
194243730Srwatsonm4_require([_LT_TAG_COMPILER])dnl
195243730Srwatson
196243730Srwatsoncase $host_os in
197243730Srwatsonaix3*)
198243730Srwatson  # AIX sometimes has problems with the GCC collect2 program.  For some
199243730Srwatson  # reason, if we set the COLLECT_NAMES environment variable, the problems
200243730Srwatson  # vanish in a puff of smoke.
201243730Srwatson  if test "X${COLLECT_NAMES+set}" != Xset; then
202243730Srwatson    COLLECT_NAMES=
203243730Srwatson    export COLLECT_NAMES
204243730Srwatson  fi
205243730Srwatson  ;;
206243730Srwatsonesac
207243730Srwatson
208243730Srwatson# Global variables:
209243730Srwatsonofile=libtool
210243730Srwatsoncan_build_shared=yes
211243730Srwatson
212243730Srwatson# All known linkers require a `.a' archive for static linking (except MSVC,
213243730Srwatson# which needs '.lib').
214243730Srwatsonlibext=a
215243730Srwatson
216243730Srwatsonwith_gnu_ld="$lt_cv_prog_gnu_ld"
217243730Srwatson
218243730Srwatsonold_CC="$CC"
219243730Srwatsonold_CFLAGS="$CFLAGS"
220243730Srwatson
221243730Srwatson# Set sane defaults for various variables
222243730Srwatsontest -z "$CC" && CC=cc
223243730Srwatsontest -z "$LTCC" && LTCC=$CC
224243730Srwatsontest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
225243730Srwatsontest -z "$LD" && LD=ld
226243730Srwatsontest -z "$ac_objext" && ac_objext=o
227243730Srwatson
228243730Srwatson_LT_CC_BASENAME([$compiler])
229243730Srwatson
230243730Srwatson# Only perform the check for file, if the check method requires it
231243730Srwatsontest -z "$MAGIC_CMD" && MAGIC_CMD=file
232243730Srwatsoncase $deplibs_check_method in
233243730Srwatsonfile_magic*)
234243730Srwatson  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
235243730Srwatson    _LT_PATH_MAGIC
236243730Srwatson  fi
237243730Srwatson  ;;
238243730Srwatsonesac
239243730Srwatson
240243730Srwatson# Use C for the default configuration in the libtool script
241243730SrwatsonLT_SUPPORTED_TAG([CC])
242243730Srwatson_LT_LANG_C_CONFIG
243243730Srwatson_LT_LANG_DEFAULT_CONFIG
244243730Srwatson_LT_CONFIG_COMMANDS
245243730Srwatson])# _LT_SETUP
246243730Srwatson
247243730Srwatson
248243730Srwatson# _LT_PREPARE_SED_QUOTE_VARS
249243730Srwatson# --------------------------
250243730Srwatson# Define a few sed substitution that help us do robust quoting.
251243730Srwatsonm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
252243730Srwatson[# Backslashify metacharacters that are still active within
253243730Srwatson# double-quoted strings.
254243730Srwatsonsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
255243730Srwatson
256243730Srwatson# Same as above, but do not quote variable references.
257243730Srwatsondouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
258243730Srwatson
259243730Srwatson# Sed substitution to delay expansion of an escaped shell variable in a
260243730Srwatson# double_quote_subst'ed string.
261243730Srwatsondelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
262243730Srwatson
263243730Srwatson# Sed substitution to delay expansion of an escaped single quote.
264243730Srwatsondelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
265243730Srwatson
266243730Srwatson# Sed substitution to avoid accidental globbing in evaled expressions
267243730Srwatsonno_glob_subst='s/\*/\\\*/g'
268243730Srwatson])
269243730Srwatson
270243730Srwatson# _LT_PROG_LTMAIN
271243730Srwatson# ---------------
272243730Srwatson# Note that this code is called both from `configure', and `config.status'
273243730Srwatson# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
274243730Srwatson# `config.status' has no value for ac_aux_dir unless we are using Automake,
275243730Srwatson# so we pass a copy along to make sure it has a sensible value anyway.
276243730Srwatsonm4_defun([_LT_PROG_LTMAIN],
277243730Srwatson[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
278243730Srwatson_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
279243730Srwatsonltmain="$ac_aux_dir/ltmain.sh"
280243730Srwatson])# _LT_PROG_LTMAIN
281243730Srwatson
282243730Srwatson
283243730Srwatson## ------------------------------------- ##
284243730Srwatson## Accumulate code for creating libtool. ##
285243730Srwatson## ------------------------------------- ##
286243730Srwatson
287243730Srwatson# So that we can recreate a full libtool script including additional
288243730Srwatson# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
289243730Srwatson# in macros and then make a single call at the end using the `libtool'
290243730Srwatson# label.
291243730Srwatson
292243730Srwatson
293243730Srwatson# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
294243730Srwatson# ----------------------------------------
295243730Srwatson# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
296243730Srwatsonm4_define([_LT_CONFIG_LIBTOOL_INIT],
297243730Srwatson[m4_ifval([$1],
298243730Srwatson          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
299243730Srwatson                     [$1
300243730Srwatson])])])
301243730Srwatson
302243730Srwatson# Initialize.
303243730Srwatsonm4_define([_LT_OUTPUT_LIBTOOL_INIT])
304243730Srwatson
305243730Srwatson
306243730Srwatson# _LT_CONFIG_LIBTOOL([COMMANDS])
307243730Srwatson# ------------------------------
308243730Srwatson# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
309243730Srwatsonm4_define([_LT_CONFIG_LIBTOOL],
310243730Srwatson[m4_ifval([$1],
311243730Srwatson          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
312243730Srwatson                     [$1
313243730Srwatson])])])
314243730Srwatson
315243730Srwatson# Initialize.
316243730Srwatsonm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
317243730Srwatson
318243730Srwatson
319243730Srwatson# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
320243730Srwatson# -----------------------------------------------------
321243730Srwatsonm4_defun([_LT_CONFIG_SAVE_COMMANDS],
322243730Srwatson[_LT_CONFIG_LIBTOOL([$1])
323243730Srwatson_LT_CONFIG_LIBTOOL_INIT([$2])
324243730Srwatson])
325243730Srwatson
326243730Srwatson
327243730Srwatson# _LT_FORMAT_COMMENT([COMMENT])
328243730Srwatson# -----------------------------
329243730Srwatson# Add leading comment marks to the start of each line, and a trailing
330243730Srwatson# full-stop to the whole comment if one is not present already.
331243730Srwatsonm4_define([_LT_FORMAT_COMMENT],
332243730Srwatson[m4_ifval([$1], [
333243730Srwatsonm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
334243730Srwatson              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
335243730Srwatson)])
336243730Srwatson
337243730Srwatson
338243730Srwatson
339243730Srwatson## ------------------------ ##
340243730Srwatson## FIXME: Eliminate VARNAME ##
341243730Srwatson## ------------------------ ##
342243730Srwatson
343243730Srwatson
344243730Srwatson# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
345243730Srwatson# -------------------------------------------------------------------
346243730Srwatson# CONFIGNAME is the name given to the value in the libtool script.
347243730Srwatson# VARNAME is the (base) name used in the configure script.
348243730Srwatson# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
349243730Srwatson# VARNAME.  Any other value will be used directly.
350243730Srwatsonm4_define([_LT_DECL],
351243730Srwatson[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
352243730Srwatson    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
353243730Srwatson	[m4_ifval([$1], [$1], [$2])])
354243730Srwatson    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
355243730Srwatson    m4_ifval([$4],
356243730Srwatson	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
357243730Srwatson    lt_dict_add_subkey([lt_decl_dict], [$2],
358243730Srwatson	[tagged?], [m4_ifval([$5], [yes], [no])])])
359243730Srwatson])
360243730Srwatson
361243730Srwatson
362243730Srwatson# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
363243730Srwatson# --------------------------------------------------------
364243730Srwatsonm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
365243730Srwatson
366243730Srwatson
367243730Srwatson# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
368243730Srwatson# ------------------------------------------------
369243730Srwatsonm4_define([lt_decl_tag_varnames],
370243730Srwatson[_lt_decl_filter([tagged?], [yes], $@)])
371243730Srwatson
372243730Srwatson
373243730Srwatson# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
374243730Srwatson# ---------------------------------------------------------
375243730Srwatsonm4_define([_lt_decl_filter],
376243730Srwatson[m4_case([$#],
377243730Srwatson  [0], [m4_fatal([$0: too few arguments: $#])],
378243730Srwatson  [1], [m4_fatal([$0: too few arguments: $#: $1])],
379243730Srwatson  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
380243730Srwatson  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
381243730Srwatson  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
382243730Srwatson])
383243730Srwatson
384243730Srwatson
385243730Srwatson# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
386243730Srwatson# --------------------------------------------------
387243730Srwatsonm4_define([lt_decl_quote_varnames],
388243730Srwatson[_lt_decl_filter([value], [1], $@)])
389243730Srwatson
390243730Srwatson
391243730Srwatson# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
392243730Srwatson# ---------------------------------------------------
393243730Srwatsonm4_define([lt_decl_dquote_varnames],
394243730Srwatson[_lt_decl_filter([value], [2], $@)])
395243730Srwatson
396243730Srwatson
397243730Srwatson# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
398243730Srwatson# ---------------------------------------------------
399243730Srwatsonm4_define([lt_decl_varnames_tagged],
400243730Srwatson[m4_assert([$# <= 2])dnl
401243730Srwatson_$0(m4_quote(m4_default([$1], [[, ]])),
402243730Srwatson    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
403243730Srwatson    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
404243730Srwatsonm4_define([_lt_decl_varnames_tagged],
405243730Srwatson[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
406243730Srwatson
407243730Srwatson
408243730Srwatson# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
409243730Srwatson# ------------------------------------------------
410243730Srwatsonm4_define([lt_decl_all_varnames],
411243730Srwatson[_$0(m4_quote(m4_default([$1], [[, ]])),
412243730Srwatson     m4_if([$2], [],
413243730Srwatson	   m4_quote(lt_decl_varnames),
414243730Srwatson	m4_quote(m4_shift($@))))[]dnl
415243730Srwatson])
416243730Srwatsonm4_define([_lt_decl_all_varnames],
417243730Srwatson[lt_join($@, lt_decl_varnames_tagged([$1],
418243730Srwatson			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
419243730Srwatson])
420243730Srwatson
421243730Srwatson
422243730Srwatson# _LT_CONFIG_STATUS_DECLARE([VARNAME])
423243730Srwatson# ------------------------------------
424243730Srwatson# Quote a variable value, and forward it to `config.status' so that its
425243730Srwatson# declaration there will have the same value as in `configure'.  VARNAME
426243730Srwatson# must have a single quote delimited value for this to work.
427243730Srwatsonm4_define([_LT_CONFIG_STATUS_DECLARE],
428243730Srwatson[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
429243730Srwatson
430243730Srwatson
431243730Srwatson# _LT_CONFIG_STATUS_DECLARATIONS
432243730Srwatson# ------------------------------
433243730Srwatson# We delimit libtool config variables with single quotes, so when
434243730Srwatson# we write them to config.status, we have to be sure to quote all
435243730Srwatson# embedded single quotes properly.  In configure, this macro expands
436243730Srwatson# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
437243730Srwatson#
438243730Srwatson#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
439243730Srwatsonm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
440243730Srwatson[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
441243730Srwatson    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
442243730Srwatson
443243730Srwatson
444243730Srwatson# _LT_LIBTOOL_TAGS
445243730Srwatson# ----------------
446243730Srwatson# Output comment and list of tags supported by the script
447243730Srwatsonm4_defun([_LT_LIBTOOL_TAGS],
448243730Srwatson[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
449243730Srwatsonavailable_tags="_LT_TAGS"dnl
450243730Srwatson])
451243730Srwatson
452243730Srwatson
453243730Srwatson# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
454243730Srwatson# -----------------------------------
455243730Srwatson# Extract the dictionary values for VARNAME (optionally with TAG) and
456243730Srwatson# expand to a commented shell variable setting:
457243730Srwatson#
458243730Srwatson#    # Some comment about what VAR is for.
459243730Srwatson#    visible_name=$lt_internal_name
460243730Srwatsonm4_define([_LT_LIBTOOL_DECLARE],
461243730Srwatson[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
462243730Srwatson					   [description])))[]dnl
463243730Srwatsonm4_pushdef([_libtool_name],
464243730Srwatson    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
465243730Srwatsonm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
466243730Srwatson    [0], [_libtool_name=[$]$1],
467243730Srwatson    [1], [_libtool_name=$lt_[]$1],
468243730Srwatson    [2], [_libtool_name=$lt_[]$1],
469243730Srwatson    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
470243730Srwatsonm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
471243730Srwatson])
472243730Srwatson
473243730Srwatson
474243730Srwatson# _LT_LIBTOOL_CONFIG_VARS
475243730Srwatson# -----------------------
476243730Srwatson# Produce commented declarations of non-tagged libtool config variables
477243730Srwatson# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
478243730Srwatson# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
479243730Srwatson# section) are produced by _LT_LIBTOOL_TAG_VARS.
480243730Srwatsonm4_defun([_LT_LIBTOOL_CONFIG_VARS],
481243730Srwatson[m4_foreach([_lt_var],
482243730Srwatson    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
483243730Srwatson    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
484243730Srwatson
485243730Srwatson
486243730Srwatson# _LT_LIBTOOL_TAG_VARS(TAG)
487243730Srwatson# -------------------------
488243730Srwatsonm4_define([_LT_LIBTOOL_TAG_VARS],
489243730Srwatson[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
490243730Srwatson    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
491243730Srwatson
492243730Srwatson
493243730Srwatson# _LT_TAGVAR(VARNAME, [TAGNAME])
494243730Srwatson# ------------------------------
495243730Srwatsonm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
496243730Srwatson
497243730Srwatson
498243730Srwatson# _LT_CONFIG_COMMANDS
499243730Srwatson# -------------------
500243730Srwatson# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
501243730Srwatson# variables for single and double quote escaping we saved from calls
502243730Srwatson# to _LT_DECL, we can put quote escaped variables declarations
503243730Srwatson# into `config.status', and then the shell code to quote escape them in
504243730Srwatson# for loops in `config.status'.  Finally, any additional code accumulated
505243730Srwatson# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
506243730Srwatsonm4_defun([_LT_CONFIG_COMMANDS],
507243730Srwatson[AC_PROVIDE_IFELSE([LT_OUTPUT],
508243730Srwatson	dnl If the libtool generation code has been placed in $CONFIG_LT,
509243730Srwatson	dnl instead of duplicating it all over again into config.status,
510243730Srwatson	dnl then we will have config.status run $CONFIG_LT later, so it
511243730Srwatson	dnl needs to know what name is stored there:
512243730Srwatson        [AC_CONFIG_COMMANDS([libtool],
513243730Srwatson            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
514243730Srwatson    dnl If the libtool generation code is destined for config.status,
515243730Srwatson    dnl expand the accumulated commands and init code now:
516243730Srwatson    [AC_CONFIG_COMMANDS([libtool],
517243730Srwatson        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
518243730Srwatson])#_LT_CONFIG_COMMANDS
519243730Srwatson
520243730Srwatson
521243730Srwatson# Initialize.
522243730Srwatsonm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
523243730Srwatson[
524243730Srwatson
525243730Srwatson# The HP-UX ksh and POSIX shell print the target directory to stdout
526243730Srwatson# if CDPATH is set.
527243730Srwatson(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
528243730Srwatson
529243730Srwatsonsed_quote_subst='$sed_quote_subst'
530243730Srwatsondouble_quote_subst='$double_quote_subst'
531243730Srwatsondelay_variable_subst='$delay_variable_subst'
532243730Srwatson_LT_CONFIG_STATUS_DECLARATIONS
533243730SrwatsonLTCC='$LTCC'
534243730SrwatsonLTCFLAGS='$LTCFLAGS'
535243730Srwatsoncompiler='$compiler_DEFAULT'
536243730Srwatson
537243730Srwatson# A function that is used when there is no print builtin or printf.
538243730Srwatsonfunc_fallback_echo ()
539243730Srwatson{
540243730Srwatson  eval 'cat <<_LTECHO_EOF
541243730Srwatson\$[]1
542243730Srwatson_LTECHO_EOF'
543243730Srwatson}
544243730Srwatson
545243730Srwatson# Quote evaled strings.
546243730Srwatsonfor var in lt_decl_all_varnames([[ \
547243730Srwatson]], lt_decl_quote_varnames); do
548243730Srwatson    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
549243730Srwatson    *[[\\\\\\\`\\"\\\$]]*)
550243730Srwatson      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
551243730Srwatson      ;;
552243730Srwatson    *)
553243730Srwatson      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
554243730Srwatson      ;;
555243730Srwatson    esac
556243730Srwatsondone
557243730Srwatson
558243730Srwatson# Double-quote double-evaled strings.
559243730Srwatsonfor var in lt_decl_all_varnames([[ \
560243730Srwatson]], lt_decl_dquote_varnames); do
561243730Srwatson    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
562243730Srwatson    *[[\\\\\\\`\\"\\\$]]*)
563243730Srwatson      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
564243730Srwatson      ;;
565243730Srwatson    *)
566243730Srwatson      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
567243730Srwatson      ;;
568243730Srwatson    esac
569243730Srwatsondone
570243730Srwatson
571243730Srwatson_LT_OUTPUT_LIBTOOL_INIT
572243730Srwatson])
573243730Srwatson
574243730Srwatson# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
575243730Srwatson# ------------------------------------
576243730Srwatson# Generate a child script FILE with all initialization necessary to
577243730Srwatson# reuse the environment learned by the parent script, and make the
578243730Srwatson# file executable.  If COMMENT is supplied, it is inserted after the
579243730Srwatson# `#!' sequence but before initialization text begins.  After this
580243730Srwatson# macro, additional text can be appended to FILE to form the body of
581243730Srwatson# the child script.  The macro ends with non-zero status if the
582243730Srwatson# file could not be fully written (such as if the disk is full).
583243730Srwatsonm4_ifdef([AS_INIT_GENERATED],
584243730Srwatson[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
585243730Srwatson[m4_defun([_LT_GENERATED_FILE_INIT],
586243730Srwatson[m4_require([AS_PREPARE])]dnl
587243730Srwatson[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
588243730Srwatson[lt_write_fail=0
589243730Srwatsoncat >$1 <<_ASEOF || lt_write_fail=1
590243730Srwatson#! $SHELL
591243730Srwatson# Generated by $as_me.
592243730Srwatson$2
593243730SrwatsonSHELL=\${CONFIG_SHELL-$SHELL}
594243730Srwatsonexport SHELL
595243730Srwatson_ASEOF
596243730Srwatsoncat >>$1 <<\_ASEOF || lt_write_fail=1
597243730SrwatsonAS_SHELL_SANITIZE
598243730Srwatson_AS_PREPARE
599243730Srwatsonexec AS_MESSAGE_FD>&1
600243730Srwatson_ASEOF
601243730Srwatsontest $lt_write_fail = 0 && chmod +x $1[]dnl
602243730Srwatsonm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
603243730Srwatson
604243730Srwatson# LT_OUTPUT
605243730Srwatson# ---------
606243730Srwatson# This macro allows early generation of the libtool script (before
607243730Srwatson# AC_OUTPUT is called), incase it is used in configure for compilation
608243730Srwatson# tests.
609243730SrwatsonAC_DEFUN([LT_OUTPUT],
610243730Srwatson[: ${CONFIG_LT=./config.lt}
611243730SrwatsonAC_MSG_NOTICE([creating $CONFIG_LT])
612243730Srwatson_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
613243730Srwatson[# Run this file to recreate a libtool stub with the current configuration.])
614243730Srwatson
615243730Srwatsoncat >>"$CONFIG_LT" <<\_LTEOF
616243730Srwatsonlt_cl_silent=false
617243730Srwatsonexec AS_MESSAGE_LOG_FD>>config.log
618243730Srwatson{
619243730Srwatson  echo
620243730Srwatson  AS_BOX([Running $as_me.])
621243730Srwatson} >&AS_MESSAGE_LOG_FD
622243730Srwatson
623243730Srwatsonlt_cl_help="\
624243730Srwatson\`$as_me' creates a local libtool stub from the current configuration,
625243730Srwatsonfor use in further configure time tests before the real libtool is
626243730Srwatsongenerated.
627243730Srwatson
628243730SrwatsonUsage: $[0] [[OPTIONS]]
629243730Srwatson
630243730Srwatson  -h, --help      print this help, then exit
631243730Srwatson  -V, --version   print version number, then exit
632243730Srwatson  -q, --quiet     do not print progress messages
633243730Srwatson  -d, --debug     don't remove temporary files
634243730Srwatson
635243730SrwatsonReport bugs to <bug-libtool@gnu.org>."
636243730Srwatson
637243730Srwatsonlt_cl_version="\
638243730Srwatsonm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
639243730Srwatsonm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
640243730Srwatsonconfigured by $[0], generated by m4_PACKAGE_STRING.
641243730Srwatson
642243730SrwatsonCopyright (C) 2011 Free Software Foundation, Inc.
643243730SrwatsonThis config.lt script is free software; the Free Software Foundation
644243730Srwatsongives unlimited permision to copy, distribute and modify it."
645243730Srwatson
646243730Srwatsonwhile test $[#] != 0
647243730Srwatsondo
648243730Srwatson  case $[1] in
649243730Srwatson    --version | --v* | -V )
650243730Srwatson      echo "$lt_cl_version"; exit 0 ;;
651243730Srwatson    --help | --h* | -h )
652243730Srwatson      echo "$lt_cl_help"; exit 0 ;;
653243730Srwatson    --debug | --d* | -d )
654243730Srwatson      debug=: ;;
655243730Srwatson    --quiet | --q* | --silent | --s* | -q )
656243730Srwatson      lt_cl_silent=: ;;
657243730Srwatson
658243730Srwatson    -*) AC_MSG_ERROR([unrecognized option: $[1]
659243730SrwatsonTry \`$[0] --help' for more information.]) ;;
660243730Srwatson
661243730Srwatson    *) AC_MSG_ERROR([unrecognized argument: $[1]
662243730SrwatsonTry \`$[0] --help' for more information.]) ;;
663243730Srwatson  esac
664243730Srwatson  shift
665243730Srwatsondone
666243730Srwatson
667243730Srwatsonif $lt_cl_silent; then
668243730Srwatson  exec AS_MESSAGE_FD>/dev/null
669243730Srwatsonfi
670243730Srwatson_LTEOF
671243730Srwatson
672243730Srwatsoncat >>"$CONFIG_LT" <<_LTEOF
673243730Srwatson_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
674243730Srwatson_LTEOF
675243730Srwatson
676243730Srwatsoncat >>"$CONFIG_LT" <<\_LTEOF
677243730SrwatsonAC_MSG_NOTICE([creating $ofile])
678243730Srwatson_LT_OUTPUT_LIBTOOL_COMMANDS
679243730SrwatsonAS_EXIT(0)
680243730Srwatson_LTEOF
681243730Srwatsonchmod +x "$CONFIG_LT"
682243730Srwatson
683243730Srwatson# configure is writing to config.log, but config.lt does its own redirection,
684243730Srwatson# appending to config.log, which fails on DOS, as config.log is still kept
685243730Srwatson# open by configure.  Here we exec the FD to /dev/null, effectively closing
686243730Srwatson# config.log, so it can be properly (re)opened and appended to by config.lt.
687243730Srwatsonlt_cl_success=:
688243730Srwatsontest "$silent" = yes &&
689243730Srwatson  lt_config_lt_args="$lt_config_lt_args --quiet"
690243730Srwatsonexec AS_MESSAGE_LOG_FD>/dev/null
691243730Srwatson$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
692243730Srwatsonexec AS_MESSAGE_LOG_FD>>config.log
693243730Srwatson$lt_cl_success || AS_EXIT(1)
694243730Srwatson])# LT_OUTPUT
695243730Srwatson
696243730Srwatson
697243730Srwatson# _LT_CONFIG(TAG)
698243730Srwatson# ---------------
699243730Srwatson# If TAG is the built-in tag, create an initial libtool script with a
700243730Srwatson# default configuration from the untagged config vars.  Otherwise add code
701243730Srwatson# to config.status for appending the configuration named by TAG from the
702243730Srwatson# matching tagged config vars.
703243730Srwatsonm4_defun([_LT_CONFIG],
704243730Srwatson[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
705243730Srwatson_LT_CONFIG_SAVE_COMMANDS([
706243730Srwatson  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
707243730Srwatson  m4_if(_LT_TAG, [C], [
708243730Srwatson    # See if we are running on zsh, and set the options which allow our
709243730Srwatson    # commands through without removal of \ escapes.
710243730Srwatson    if test -n "${ZSH_VERSION+set}" ; then
711243730Srwatson      setopt NO_GLOB_SUBST
712243730Srwatson    fi
713243730Srwatson
714243730Srwatson    cfgfile="${ofile}T"
715243730Srwatson    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
716243730Srwatson    $RM "$cfgfile"
717243730Srwatson
718243730Srwatson    cat <<_LT_EOF >> "$cfgfile"
719243730Srwatson#! $SHELL
720243730Srwatson
721243730Srwatson# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
722243730Srwatson# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
723243730Srwatson# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
724243730Srwatson# NOTE: Changes made to this file will be lost: look at ltmain.sh.
725243730Srwatson#
726243730Srwatson_LT_COPYING
727243730Srwatson_LT_LIBTOOL_TAGS
728243730Srwatson
729243730Srwatson# ### BEGIN LIBTOOL CONFIG
730243730Srwatson_LT_LIBTOOL_CONFIG_VARS
731243730Srwatson_LT_LIBTOOL_TAG_VARS
732243730Srwatson# ### END LIBTOOL CONFIG
733243730Srwatson
734243730Srwatson_LT_EOF
735243730Srwatson
736243730Srwatson  case $host_os in
737243730Srwatson  aix3*)
738243730Srwatson    cat <<\_LT_EOF >> "$cfgfile"
739243730Srwatson# AIX sometimes has problems with the GCC collect2 program.  For some
740243730Srwatson# reason, if we set the COLLECT_NAMES environment variable, the problems
741243730Srwatson# vanish in a puff of smoke.
742243730Srwatsonif test "X${COLLECT_NAMES+set}" != Xset; then
743243730Srwatson  COLLECT_NAMES=
744243730Srwatson  export COLLECT_NAMES
745243730Srwatsonfi
746243730Srwatson_LT_EOF
747243730Srwatson    ;;
748243730Srwatson  esac
749243730Srwatson
750243730Srwatson  _LT_PROG_LTMAIN
751243730Srwatson
752243730Srwatson  # We use sed instead of cat because bash on DJGPP gets confused if
753243730Srwatson  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
754243730Srwatson  # text mode, it properly converts lines to CR/LF.  This bash problem
755243730Srwatson  # is reportedly fixed, but why not run on old versions too?
756243730Srwatson  sed '$q' "$ltmain" >> "$cfgfile" \
757243730Srwatson     || (rm -f "$cfgfile"; exit 1)
758243730Srwatson
759243730Srwatson  _LT_PROG_REPLACE_SHELLFNS
760243730Srwatson
761243730Srwatson   mv -f "$cfgfile" "$ofile" ||
762243730Srwatson    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
763243730Srwatson  chmod +x "$ofile"
764243730Srwatson],
765243730Srwatson[cat <<_LT_EOF >> "$ofile"
766243730Srwatson
767243730Srwatsondnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
768243730Srwatsondnl in a comment (ie after a #).
769243730Srwatson# ### BEGIN LIBTOOL TAG CONFIG: $1
770243730Srwatson_LT_LIBTOOL_TAG_VARS(_LT_TAG)
771243730Srwatson# ### END LIBTOOL TAG CONFIG: $1
772243730Srwatson_LT_EOF
773243730Srwatson])dnl /m4_if
774243730Srwatson],
775243730Srwatson[m4_if([$1], [], [
776243730Srwatson    PACKAGE='$PACKAGE'
777243730Srwatson    VERSION='$VERSION'
778243730Srwatson    TIMESTAMP='$TIMESTAMP'
779243730Srwatson    RM='$RM'
780243730Srwatson    ofile='$ofile'], [])
781243730Srwatson])dnl /_LT_CONFIG_SAVE_COMMANDS
782243730Srwatson])# _LT_CONFIG
783243730Srwatson
784243730Srwatson
785243730Srwatson# LT_SUPPORTED_TAG(TAG)
786243730Srwatson# ---------------------
787243730Srwatson# Trace this macro to discover what tags are supported by the libtool
788243730Srwatson# --tag option, using:
789243730Srwatson#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
790243730SrwatsonAC_DEFUN([LT_SUPPORTED_TAG], [])
791243730Srwatson
792243730Srwatson
793243730Srwatson# C support is built-in for now
794243730Srwatsonm4_define([_LT_LANG_C_enabled], [])
795243730Srwatsonm4_define([_LT_TAGS], [])
796243730Srwatson
797243730Srwatson
798243730Srwatson# LT_LANG(LANG)
799243730Srwatson# -------------
800243730Srwatson# Enable libtool support for the given language if not already enabled.
801243730SrwatsonAC_DEFUN([LT_LANG],
802243730Srwatson[AC_BEFORE([$0], [LT_OUTPUT])dnl
803243730Srwatsonm4_case([$1],
804243730Srwatson  [C],			[_LT_LANG(C)],
805243730Srwatson  [C++],		[_LT_LANG(CXX)],
806243730Srwatson  [Go],			[_LT_LANG(GO)],
807243730Srwatson  [Java],		[_LT_LANG(GCJ)],
808243730Srwatson  [Fortran 77],		[_LT_LANG(F77)],
809243730Srwatson  [Fortran],		[_LT_LANG(FC)],
810243730Srwatson  [Windows Resource],	[_LT_LANG(RC)],
811243730Srwatson  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
812243730Srwatson    [_LT_LANG($1)],
813243730Srwatson    [m4_fatal([$0: unsupported language: "$1"])])])dnl
814243730Srwatson])# LT_LANG
815243730Srwatson
816243730Srwatson
817243730Srwatson# _LT_LANG(LANGNAME)
818243730Srwatson# ------------------
819243730Srwatsonm4_defun([_LT_LANG],
820243730Srwatson[m4_ifdef([_LT_LANG_]$1[_enabled], [],
821243730Srwatson  [LT_SUPPORTED_TAG([$1])dnl
822243730Srwatson  m4_append([_LT_TAGS], [$1 ])dnl
823243730Srwatson  m4_define([_LT_LANG_]$1[_enabled], [])dnl
824243730Srwatson  _LT_LANG_$1_CONFIG($1)])dnl
825243730Srwatson])# _LT_LANG
826243730Srwatson
827243730Srwatson
828243730Srwatsonm4_ifndef([AC_PROG_GO], [
829243730Srwatson############################################################
830243730Srwatson# NOTE: This macro has been submitted for inclusion into   #
831243730Srwatson#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
832243730Srwatson#  a released version of Autoconf we should remove this    #
833243730Srwatson#  macro and use it instead.                               #
834243730Srwatson############################################################
835243730Srwatsonm4_defun([AC_PROG_GO],
836243730Srwatson[AC_LANG_PUSH(Go)dnl
837243730SrwatsonAC_ARG_VAR([GOC],     [Go compiler command])dnl
838243730SrwatsonAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
839243730Srwatson_AC_ARG_VAR_LDFLAGS()dnl
840243730SrwatsonAC_CHECK_TOOL(GOC, gccgo)
841243730Srwatsonif test -z "$GOC"; then
842243730Srwatson  if test -n "$ac_tool_prefix"; then
843243730Srwatson    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
844243730Srwatson  fi
845243730Srwatsonfi
846243730Srwatsonif test -z "$GOC"; then
847243730Srwatson  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
848243730Srwatsonfi
849243730Srwatson])#m4_defun
850243730Srwatson])#m4_ifndef
851243730Srwatson
852243730Srwatson
853243730Srwatson# _LT_LANG_DEFAULT_CONFIG
854243730Srwatson# -----------------------
855243730Srwatsonm4_defun([_LT_LANG_DEFAULT_CONFIG],
856243730Srwatson[AC_PROVIDE_IFELSE([AC_PROG_CXX],
857243730Srwatson  [LT_LANG(CXX)],
858243730Srwatson  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
859243730Srwatson
860243730SrwatsonAC_PROVIDE_IFELSE([AC_PROG_F77],
861243730Srwatson  [LT_LANG(F77)],
862243730Srwatson  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
863243730Srwatson
864243730SrwatsonAC_PROVIDE_IFELSE([AC_PROG_FC],
865243730Srwatson  [LT_LANG(FC)],
866243730Srwatson  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
867243730Srwatson
868243730Srwatsondnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
869243730Srwatsondnl pulling things in needlessly.
870243730SrwatsonAC_PROVIDE_IFELSE([AC_PROG_GCJ],
871243730Srwatson  [LT_LANG(GCJ)],
872243730Srwatson  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
873243730Srwatson    [LT_LANG(GCJ)],
874243730Srwatson    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
875243730Srwatson      [LT_LANG(GCJ)],
876243730Srwatson      [m4_ifdef([AC_PROG_GCJ],
877243730Srwatson	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
878243730Srwatson       m4_ifdef([A][M_PROG_GCJ],
879243730Srwatson	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
880243730Srwatson       m4_ifdef([LT_PROG_GCJ],
881243730Srwatson	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
882243730Srwatson
883243730SrwatsonAC_PROVIDE_IFELSE([AC_PROG_GO],
884243730Srwatson  [LT_LANG(GO)],
885243730Srwatson  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
886243730Srwatson
887243730SrwatsonAC_PROVIDE_IFELSE([LT_PROG_RC],
888243730Srwatson  [LT_LANG(RC)],
889243730Srwatson  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
890243730Srwatson])# _LT_LANG_DEFAULT_CONFIG
891243730Srwatson
892243730Srwatson# Obsolete macros:
893243730SrwatsonAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
894243730SrwatsonAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
895243730SrwatsonAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
896243730SrwatsonAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
897243730SrwatsonAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
898243730Srwatsondnl aclocal-1.4 backwards compatibility:
899243730Srwatsondnl AC_DEFUN([AC_LIBTOOL_CXX], [])
900243730Srwatsondnl AC_DEFUN([AC_LIBTOOL_F77], [])
901243730Srwatsondnl AC_DEFUN([AC_LIBTOOL_FC], [])
902243730Srwatsondnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
903243730Srwatsondnl AC_DEFUN([AC_LIBTOOL_RC], [])
904243730Srwatson
905243730Srwatson
906243730Srwatson# _LT_TAG_COMPILER
907243730Srwatson# ----------------
908243730Srwatsonm4_defun([_LT_TAG_COMPILER],
909243730Srwatson[AC_REQUIRE([AC_PROG_CC])dnl
910243730Srwatson
911243730Srwatson_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
912243730Srwatson_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
913243730Srwatson_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
914243730Srwatson_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
915243730Srwatson
916243730Srwatson# If no C compiler was specified, use CC.
917243730SrwatsonLTCC=${LTCC-"$CC"}
918243730Srwatson
919243730Srwatson# If no C compiler flags were specified, use CFLAGS.
920243730SrwatsonLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
921243730Srwatson
922243730Srwatson# Allow CC to be a program name with arguments.
923243730Srwatsoncompiler=$CC
924243730Srwatson])# _LT_TAG_COMPILER
925243730Srwatson
926243730Srwatson
927243730Srwatson# _LT_COMPILER_BOILERPLATE
928243730Srwatson# ------------------------
929243730Srwatson# Check for compiler boilerplate output or warnings with
930243730Srwatson# the simple compiler test code.
931243730Srwatsonm4_defun([_LT_COMPILER_BOILERPLATE],
932243730Srwatson[m4_require([_LT_DECL_SED])dnl
933243730Srwatsonac_outfile=conftest.$ac_objext
934243730Srwatsonecho "$lt_simple_compile_test_code" >conftest.$ac_ext
935243730Srwatsoneval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
936243730Srwatson_lt_compiler_boilerplate=`cat conftest.err`
937243730Srwatson$RM conftest*
938243730Srwatson])# _LT_COMPILER_BOILERPLATE
939243730Srwatson
940243730Srwatson
941243730Srwatson# _LT_LINKER_BOILERPLATE
942243730Srwatson# ----------------------
943243730Srwatson# Check for linker boilerplate output or warnings with
944243730Srwatson# the simple link test code.
945243730Srwatsonm4_defun([_LT_LINKER_BOILERPLATE],
946243730Srwatson[m4_require([_LT_DECL_SED])dnl
947243730Srwatsonac_outfile=conftest.$ac_objext
948243730Srwatsonecho "$lt_simple_link_test_code" >conftest.$ac_ext
949243730Srwatsoneval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
950243730Srwatson_lt_linker_boilerplate=`cat conftest.err`
951243730Srwatson$RM -r conftest*
952243730Srwatson])# _LT_LINKER_BOILERPLATE
953243730Srwatson
954243730Srwatson# _LT_REQUIRED_DARWIN_CHECKS
955243730Srwatson# -------------------------
956243730Srwatsonm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
957243730Srwatson  case $host_os in
958243730Srwatson    rhapsody* | darwin*)
959243730Srwatson    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
960243730Srwatson    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
961243730Srwatson    AC_CHECK_TOOL([LIPO], [lipo], [:])
962243730Srwatson    AC_CHECK_TOOL([OTOOL], [otool], [:])
963243730Srwatson    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
964243730Srwatson    _LT_DECL([], [DSYMUTIL], [1],
965243730Srwatson      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
966243730Srwatson    _LT_DECL([], [NMEDIT], [1],
967243730Srwatson      [Tool to change global to local symbols on Mac OS X])
968243730Srwatson    _LT_DECL([], [LIPO], [1],
969243730Srwatson      [Tool to manipulate fat objects and archives on Mac OS X])
970243730Srwatson    _LT_DECL([], [OTOOL], [1],
971243730Srwatson      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
972243730Srwatson    _LT_DECL([], [OTOOL64], [1],
973243730Srwatson      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
974243730Srwatson
975243730Srwatson    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
976243730Srwatson      [lt_cv_apple_cc_single_mod=no
977243730Srwatson      if test -z "${LT_MULTI_MODULE}"; then
978243730Srwatson	# By default we will add the -single_module flag. You can override
979243730Srwatson	# by either setting the environment variable LT_MULTI_MODULE
980243730Srwatson	# non-empty at configure time, or by adding -multi_module to the
981243730Srwatson	# link flags.
982243730Srwatson	rm -rf libconftest.dylib*
983243730Srwatson	echo "int foo(void){return 1;}" > conftest.c
984243730Srwatson	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
985243730Srwatson-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
986243730Srwatson	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
987243730Srwatson	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
988243730Srwatson        _lt_result=$?
989243730Srwatson	# If there is a non-empty error log, and "single_module"
990243730Srwatson	# appears in it, assume the flag caused a linker warning
991243730Srwatson        if test -s conftest.err && $GREP single_module conftest.err; then
992243730Srwatson	  cat conftest.err >&AS_MESSAGE_LOG_FD
993243730Srwatson	# Otherwise, if the output was created with a 0 exit code from
994243730Srwatson	# the compiler, it worked.
995243730Srwatson	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
996243730Srwatson	  lt_cv_apple_cc_single_mod=yes
997243730Srwatson	else
998243730Srwatson	  cat conftest.err >&AS_MESSAGE_LOG_FD
999243730Srwatson	fi
1000243730Srwatson	rm -rf libconftest.dylib*
1001243730Srwatson	rm -f conftest.*
1002243730Srwatson      fi])
1003243730Srwatson
1004243730Srwatson    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1005243730Srwatson      [lt_cv_ld_exported_symbols_list],
1006243730Srwatson      [lt_cv_ld_exported_symbols_list=no
1007243730Srwatson      save_LDFLAGS=$LDFLAGS
1008243730Srwatson      echo "_main" > conftest.sym
1009243730Srwatson      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1010243730Srwatson      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1011243730Srwatson	[lt_cv_ld_exported_symbols_list=yes],
1012243730Srwatson	[lt_cv_ld_exported_symbols_list=no])
1013243730Srwatson	LDFLAGS="$save_LDFLAGS"
1014243730Srwatson    ])
1015243730Srwatson
1016243730Srwatson    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1017243730Srwatson      [lt_cv_ld_force_load=no
1018243730Srwatson      cat > conftest.c << _LT_EOF
1019243730Srwatsonint forced_loaded() { return 2;}
1020243730Srwatson_LT_EOF
1021243730Srwatson      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1022243730Srwatson      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1023243730Srwatson      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1024243730Srwatson      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1025243730Srwatson      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1026243730Srwatson      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1027243730Srwatson      cat > conftest.c << _LT_EOF
1028243730Srwatsonint main() { return 0;}
1029243730Srwatson_LT_EOF
1030243730Srwatson      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1031243730Srwatson      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1032243730Srwatson      _lt_result=$?
1033243730Srwatson      if test -s conftest.err && $GREP force_load conftest.err; then
1034243730Srwatson	cat conftest.err >&AS_MESSAGE_LOG_FD
1035243730Srwatson      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
1036243730Srwatson	lt_cv_ld_force_load=yes
1037243730Srwatson      else
1038243730Srwatson	cat conftest.err >&AS_MESSAGE_LOG_FD
1039243730Srwatson      fi
1040243730Srwatson        rm -f conftest.err libconftest.a conftest conftest.c
1041243730Srwatson        rm -rf conftest.dSYM
1042243730Srwatson    ])
1043243730Srwatson    case $host_os in
1044243730Srwatson    rhapsody* | darwin1.[[012]])
1045243730Srwatson      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
1046243730Srwatson    darwin1.*)
1047243730Srwatson      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1048243730Srwatson    darwin*) # darwin 5.x on
1049243730Srwatson      # if running on 10.5 or later, the deployment target defaults
1050243730Srwatson      # to the OS version, if on x86, and 10.4, the deployment
1051243730Srwatson      # target defaults to 10.4. Don't you love it?
1052243730Srwatson      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1053243730Srwatson	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1054243730Srwatson	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1055243730Srwatson	10.[[012]]*)
1056243730Srwatson	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1057243730Srwatson	10.*)
1058243730Srwatson	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1059243730Srwatson      esac
1060243730Srwatson    ;;
1061243730Srwatson  esac
1062243730Srwatson    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
1063243730Srwatson      _lt_dar_single_mod='$single_module'
1064243730Srwatson    fi
1065243730Srwatson    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
1066243730Srwatson      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
1067243730Srwatson    else
1068243730Srwatson      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
1069243730Srwatson    fi
1070243730Srwatson    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
1071243730Srwatson      _lt_dsymutil='~$DSYMUTIL $lib || :'
1072243730Srwatson    else
1073243730Srwatson      _lt_dsymutil=
1074243730Srwatson    fi
1075243730Srwatson    ;;
1076243730Srwatson  esac
1077243730Srwatson])
1078243730Srwatson
1079243730Srwatson
1080243730Srwatson# _LT_DARWIN_LINKER_FEATURES([TAG])
1081243730Srwatson# ---------------------------------
1082243730Srwatson# Checks for linker and compiler features on darwin
1083243730Srwatsonm4_defun([_LT_DARWIN_LINKER_FEATURES],
1084243730Srwatson[
1085243730Srwatson  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1086243730Srwatson  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1087243730Srwatson  _LT_TAGVAR(hardcode_direct, $1)=no
1088243730Srwatson  _LT_TAGVAR(hardcode_automatic, $1)=yes
1089243730Srwatson  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1090243730Srwatson  if test "$lt_cv_ld_force_load" = "yes"; then
1091243730Srwatson    _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\"`'
1092243730Srwatson    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1093243730Srwatson                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1094243730Srwatson  else
1095243730Srwatson    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1096243730Srwatson  fi
1097243730Srwatson  _LT_TAGVAR(link_all_deplibs, $1)=yes
1098243730Srwatson  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1099243730Srwatson  case $cc_basename in
1100243730Srwatson     ifort*) _lt_dar_can_shared=yes ;;
1101243730Srwatson     *) _lt_dar_can_shared=$GCC ;;
1102243730Srwatson  esac
1103243730Srwatson  if test "$_lt_dar_can_shared" = "yes"; then
1104243730Srwatson    output_verbose_link_cmd=func_echo_all
1105243730Srwatson    _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}"
1106243730Srwatson    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1107243730Srwatson    _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}"
1108243730Srwatson    _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}"
1109243730Srwatson    m4_if([$1], [CXX],
1110243730Srwatson[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1111243730Srwatson      _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}"
1112243730Srwatson      _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}"
1113243730Srwatson    fi
1114243730Srwatson],[])
1115243730Srwatson  else
1116243730Srwatson  _LT_TAGVAR(ld_shlibs, $1)=no
1117243730Srwatson  fi
1118243730Srwatson])
1119243730Srwatson
1120243730Srwatson# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1121243730Srwatson# ----------------------------------
1122243730Srwatson# Links a minimal program and checks the executable
1123243730Srwatson# for the system default hardcoded library path. In most cases,
1124243730Srwatson# this is /usr/lib:/lib, but when the MPI compilers are used
1125243730Srwatson# the location of the communication and MPI libs are included too.
1126243730Srwatson# If we don't find anything, use the default library path according
1127243730Srwatson# to the aix ld manual.
1128243730Srwatson# Store the results from the different compilers for each TAGNAME.
1129243730Srwatson# Allow to override them for all tags through lt_cv_aix_libpath.
1130243730Srwatsonm4_defun([_LT_SYS_MODULE_PATH_AIX],
1131243730Srwatson[m4_require([_LT_DECL_SED])dnl
1132243730Srwatsonif test "${lt_cv_aix_libpath+set}" = set; then
1133243730Srwatson  aix_libpath=$lt_cv_aix_libpath
1134243730Srwatsonelse
1135243730Srwatson  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1136243730Srwatson  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1137243730Srwatson  lt_aix_libpath_sed='[
1138243730Srwatson      /Import File Strings/,/^$/ {
1139243730Srwatson	  /^0/ {
1140243730Srwatson	      s/^0  *\([^ ]*\) *$/\1/
1141243730Srwatson	      p
1142243730Srwatson	  }
1143243730Srwatson      }]'
1144243730Srwatson  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1145243730Srwatson  # Check for a 64-bit object if we didn't find anything.
1146243730Srwatson  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1147243730Srwatson    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1148243730Srwatson  fi],[])
1149243730Srwatson  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1150243730Srwatson    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
1151243730Srwatson  fi
1152243730Srwatson  ])
1153243730Srwatson  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1154243730Srwatsonfi
1155243730Srwatson])# _LT_SYS_MODULE_PATH_AIX
1156243730Srwatson
1157243730Srwatson
1158243730Srwatson# _LT_SHELL_INIT(ARG)
1159243730Srwatson# -------------------
1160243730Srwatsonm4_define([_LT_SHELL_INIT],
1161243730Srwatson[m4_divert_text([M4SH-INIT], [$1
1162243730Srwatson])])# _LT_SHELL_INIT
1163243730Srwatson
1164243730Srwatson
1165243730Srwatson
1166243730Srwatson# _LT_PROG_ECHO_BACKSLASH
1167243730Srwatson# -----------------------
1168243730Srwatson# Find how we can fake an echo command that does not interpret backslash.
1169243730Srwatson# In particular, with Autoconf 2.60 or later we add some code to the start
1170243730Srwatson# of the generated configure script which will find a shell with a builtin
1171243730Srwatson# printf (which we can use as an echo command).
1172243730Srwatsonm4_defun([_LT_PROG_ECHO_BACKSLASH],
1173243730Srwatson[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1174243730SrwatsonECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1175243730SrwatsonECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1176243730Srwatson
1177243730SrwatsonAC_MSG_CHECKING([how to print strings])
1178243730Srwatson# Test print first, because it will be a builtin if present.
1179243730Srwatsonif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1180243730Srwatson   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1181243730Srwatson  ECHO='print -r --'
1182243730Srwatsonelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1183243730Srwatson  ECHO='printf %s\n'
1184243730Srwatsonelse
1185243730Srwatson  # Use this function as a fallback that always works.
1186243730Srwatson  func_fallback_echo ()
1187243730Srwatson  {
1188243730Srwatson    eval 'cat <<_LTECHO_EOF
1189243730Srwatson$[]1
1190243730Srwatson_LTECHO_EOF'
1191243730Srwatson  }
1192243730Srwatson  ECHO='func_fallback_echo'
1193243730Srwatsonfi
1194243730Srwatson
1195243730Srwatson# func_echo_all arg...
1196243730Srwatson# Invoke $ECHO with all args, space-separated.
1197243730Srwatsonfunc_echo_all ()
1198243730Srwatson{
1199243730Srwatson    $ECHO "$*" 
1200243730Srwatson}
1201243730Srwatson
1202243730Srwatsoncase "$ECHO" in
1203243730Srwatson  printf*) AC_MSG_RESULT([printf]) ;;
1204243730Srwatson  print*) AC_MSG_RESULT([print -r]) ;;
1205243730Srwatson  *) AC_MSG_RESULT([cat]) ;;
1206243730Srwatsonesac
1207243730Srwatson
1208243730Srwatsonm4_ifdef([_AS_DETECT_SUGGESTED],
1209243730Srwatson[_AS_DETECT_SUGGESTED([
1210243730Srwatson  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1211243730Srwatson    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1212243730Srwatson    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1213243730Srwatson    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1214243730Srwatson    PATH=/empty FPATH=/empty; export PATH FPATH
1215243730Srwatson    test "X`printf %s $ECHO`" = "X$ECHO" \
1216243730Srwatson      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1217243730Srwatson
1218243730Srwatson_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1219243730Srwatson_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1220243730Srwatson])# _LT_PROG_ECHO_BACKSLASH
1221243730Srwatson
1222243730Srwatson
1223243730Srwatson# _LT_WITH_SYSROOT
1224243730Srwatson# ----------------
1225243730SrwatsonAC_DEFUN([_LT_WITH_SYSROOT],
1226243730Srwatson[AC_MSG_CHECKING([for sysroot])
1227243730SrwatsonAC_ARG_WITH([sysroot],
1228243730Srwatson[  --with-sysroot[=DIR] Search for dependent libraries within DIR
1229243730Srwatson                        (or the compiler's sysroot if not specified).],
1230243730Srwatson[], [with_sysroot=no])
1231243730Srwatson
1232243730Srwatsondnl lt_sysroot will always be passed unquoted.  We quote it here
1233243730Srwatsondnl in case the user passed a directory name.
1234243730Srwatsonlt_sysroot=
1235243730Srwatsoncase ${with_sysroot} in #(
1236243730Srwatson yes)
1237243730Srwatson   if test "$GCC" = yes; then
1238243730Srwatson     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1239243730Srwatson   fi
1240243730Srwatson   ;; #(
1241243730Srwatson /*)
1242243730Srwatson   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1243243730Srwatson   ;; #(
1244243730Srwatson no|'')
1245243730Srwatson   ;; #(
1246243730Srwatson *)
1247243730Srwatson   AC_MSG_RESULT([${with_sysroot}])
1248243730Srwatson   AC_MSG_ERROR([The sysroot must be an absolute path.])
1249243730Srwatson   ;;
1250243730Srwatsonesac
1251243730Srwatson
1252243730Srwatson AC_MSG_RESULT([${lt_sysroot:-no}])
1253243730Srwatson_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1254243730Srwatson[dependent libraries, and in which our libraries should be installed.])])
1255243730Srwatson
1256243730Srwatson# _LT_ENABLE_LOCK
1257243730Srwatson# ---------------
1258243730Srwatsonm4_defun([_LT_ENABLE_LOCK],
1259243730Srwatson[AC_ARG_ENABLE([libtool-lock],
1260243730Srwatson  [AS_HELP_STRING([--disable-libtool-lock],
1261243730Srwatson    [avoid locking (might break parallel builds)])])
1262243730Srwatsontest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1263243730Srwatson
1264243730Srwatson# Some flags need to be propagated to the compiler or linker for good
1265243730Srwatson# libtool support.
1266243730Srwatsoncase $host in
1267243730Srwatsonia64-*-hpux*)
1268243730Srwatson  # Find out which ABI we are using.
1269243730Srwatson  echo 'int i;' > conftest.$ac_ext
1270243730Srwatson  if AC_TRY_EVAL(ac_compile); then
1271243730Srwatson    case `/usr/bin/file conftest.$ac_objext` in
1272243730Srwatson      *ELF-32*)
1273243730Srwatson	HPUX_IA64_MODE="32"
1274243730Srwatson	;;
1275243730Srwatson      *ELF-64*)
1276243730Srwatson	HPUX_IA64_MODE="64"
1277243730Srwatson	;;
1278243730Srwatson    esac
1279243730Srwatson  fi
1280243730Srwatson  rm -rf conftest*
1281243730Srwatson  ;;
1282243730Srwatson*-*-irix6*)
1283243730Srwatson  # Find out which ABI we are using.
1284243730Srwatson  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1285243730Srwatson  if AC_TRY_EVAL(ac_compile); then
1286243730Srwatson    if test "$lt_cv_prog_gnu_ld" = yes; then
1287243730Srwatson      case `/usr/bin/file conftest.$ac_objext` in
1288243730Srwatson	*32-bit*)
1289243730Srwatson	  LD="${LD-ld} -melf32bsmip"
1290243730Srwatson	  ;;
1291243730Srwatson	*N32*)
1292243730Srwatson	  LD="${LD-ld} -melf32bmipn32"
1293243730Srwatson	  ;;
1294243730Srwatson	*64-bit*)
1295243730Srwatson	  LD="${LD-ld} -melf64bmip"
1296243730Srwatson	;;
1297243730Srwatson      esac
1298243730Srwatson    else
1299243730Srwatson      case `/usr/bin/file conftest.$ac_objext` in
1300243730Srwatson	*32-bit*)
1301243730Srwatson	  LD="${LD-ld} -32"
1302243730Srwatson	  ;;
1303243730Srwatson	*N32*)
1304243730Srwatson	  LD="${LD-ld} -n32"
1305243730Srwatson	  ;;
1306243730Srwatson	*64-bit*)
1307243730Srwatson	  LD="${LD-ld} -64"
1308243730Srwatson	  ;;
1309243730Srwatson      esac
1310243730Srwatson    fi
1311243730Srwatson  fi
1312243730Srwatson  rm -rf conftest*
1313243730Srwatson  ;;
1314243730Srwatson
1315243730Srwatsonx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1316243730Srwatsons390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1317243730Srwatson  # Find out which ABI we are using.
1318243730Srwatson  echo 'int i;' > conftest.$ac_ext
1319243730Srwatson  if AC_TRY_EVAL(ac_compile); then
1320243730Srwatson    case `/usr/bin/file conftest.o` in
1321243730Srwatson      *32-bit*)
1322243730Srwatson	case $host in
1323243730Srwatson	  x86_64-*kfreebsd*-gnu)
1324243730Srwatson	    LD="${LD-ld} -m elf_i386_fbsd"
1325243730Srwatson	    ;;
1326243730Srwatson	  x86_64-*linux*)
1327243730Srwatson	    LD="${LD-ld} -m elf_i386"
1328243730Srwatson	    ;;
1329243730Srwatson	  ppc64-*linux*|powerpc64-*linux*)
1330243730Srwatson	    LD="${LD-ld} -m elf32ppclinux"
1331243730Srwatson	    ;;
1332243730Srwatson	  s390x-*linux*)
1333243730Srwatson	    LD="${LD-ld} -m elf_s390"
1334243730Srwatson	    ;;
1335243730Srwatson	  sparc64-*linux*)
1336243730Srwatson	    LD="${LD-ld} -m elf32_sparc"
1337243730Srwatson	    ;;
1338243730Srwatson	esac
1339243730Srwatson	;;
1340243730Srwatson      *64-bit*)
1341243730Srwatson	case $host in
1342243730Srwatson	  x86_64-*kfreebsd*-gnu)
1343243730Srwatson	    LD="${LD-ld} -m elf_x86_64_fbsd"
1344243730Srwatson	    ;;
1345243730Srwatson	  x86_64-*linux*)
1346243730Srwatson	    LD="${LD-ld} -m elf_x86_64"
1347243730Srwatson	    ;;
1348243730Srwatson	  ppc*-*linux*|powerpc*-*linux*)
1349243730Srwatson	    LD="${LD-ld} -m elf64ppc"
1350243730Srwatson	    ;;
1351243730Srwatson	  s390*-*linux*|s390*-*tpf*)
1352243730Srwatson	    LD="${LD-ld} -m elf64_s390"
1353243730Srwatson	    ;;
1354243730Srwatson	  sparc*-*linux*)
1355243730Srwatson	    LD="${LD-ld} -m elf64_sparc"
1356243730Srwatson	    ;;
1357243730Srwatson	esac
1358243730Srwatson	;;
1359243730Srwatson    esac
1360243730Srwatson  fi
1361243730Srwatson  rm -rf conftest*
1362243730Srwatson  ;;
1363243730Srwatson
1364243730Srwatson*-*-sco3.2v5*)
1365243730Srwatson  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1366243730Srwatson  SAVE_CFLAGS="$CFLAGS"
1367243730Srwatson  CFLAGS="$CFLAGS -belf"
1368243730Srwatson  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1369243730Srwatson    [AC_LANG_PUSH(C)
1370243730Srwatson     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1371243730Srwatson     AC_LANG_POP])
1372243730Srwatson  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1373243730Srwatson    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1374243730Srwatson    CFLAGS="$SAVE_CFLAGS"
1375243730Srwatson  fi
1376243730Srwatson  ;;
1377243730Srwatson*-*solaris*)
1378243730Srwatson  # Find out which ABI we are using.
1379243730Srwatson  echo 'int i;' > conftest.$ac_ext
1380243730Srwatson  if AC_TRY_EVAL(ac_compile); then
1381243730Srwatson    case `/usr/bin/file conftest.o` in
1382243730Srwatson    *64-bit*)
1383243730Srwatson      case $lt_cv_prog_gnu_ld in
1384243730Srwatson      yes*)
1385243730Srwatson        case $host in
1386243730Srwatson        i?86-*-solaris*)
1387243730Srwatson          LD="${LD-ld} -m elf_x86_64"
1388243730Srwatson          ;;
1389243730Srwatson        sparc*-*-solaris*)
1390243730Srwatson          LD="${LD-ld} -m elf64_sparc"
1391243730Srwatson          ;;
1392243730Srwatson        esac
1393243730Srwatson        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
1394243730Srwatson        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1395243730Srwatson          LD="${LD-ld}_sol2"
1396243730Srwatson        fi
1397243730Srwatson        ;;
1398243730Srwatson      *)
1399243730Srwatson	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1400243730Srwatson	  LD="${LD-ld} -64"
1401243730Srwatson	fi
1402243730Srwatson	;;
1403243730Srwatson      esac
1404243730Srwatson      ;;
1405243730Srwatson    esac
1406243730Srwatson  fi
1407243730Srwatson  rm -rf conftest*
1408243730Srwatson  ;;
1409243730Srwatsonesac
1410243730Srwatson
1411243730Srwatsonneed_locks="$enable_libtool_lock"
1412243730Srwatson])# _LT_ENABLE_LOCK
1413243730Srwatson
1414243730Srwatson
1415243730Srwatson# _LT_PROG_AR
1416243730Srwatson# -----------
1417243730Srwatsonm4_defun([_LT_PROG_AR],
1418243730Srwatson[AC_CHECK_TOOLS(AR, [ar], false)
1419243730Srwatson: ${AR=ar}
1420243730Srwatson: ${AR_FLAGS=cru}
1421243730Srwatson_LT_DECL([], [AR], [1], [The archiver])
1422243730Srwatson_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1423243730Srwatson
1424243730SrwatsonAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1425243730Srwatson  [lt_cv_ar_at_file=no
1426243730Srwatson   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1427243730Srwatson     [echo conftest.$ac_objext > conftest.lst
1428243730Srwatson      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1429243730Srwatson      AC_TRY_EVAL([lt_ar_try])
1430243730Srwatson      if test "$ac_status" -eq 0; then
1431243730Srwatson	# Ensure the archiver fails upon bogus file names.
1432243730Srwatson	rm -f conftest.$ac_objext libconftest.a
1433243730Srwatson	AC_TRY_EVAL([lt_ar_try])
1434243730Srwatson	if test "$ac_status" -ne 0; then
1435243730Srwatson          lt_cv_ar_at_file=@
1436243730Srwatson        fi
1437243730Srwatson      fi
1438243730Srwatson      rm -f conftest.* libconftest.a
1439243730Srwatson     ])
1440243730Srwatson  ])
1441243730Srwatson
1442243730Srwatsonif test "x$lt_cv_ar_at_file" = xno; then
1443243730Srwatson  archiver_list_spec=
1444243730Srwatsonelse
1445243730Srwatson  archiver_list_spec=$lt_cv_ar_at_file
1446243730Srwatsonfi
1447243730Srwatson_LT_DECL([], [archiver_list_spec], [1],
1448243730Srwatson  [How to feed a file listing to the archiver])
1449243730Srwatson])# _LT_PROG_AR
1450243730Srwatson
1451243730Srwatson
1452243730Srwatson# _LT_CMD_OLD_ARCHIVE
1453243730Srwatson# -------------------
1454243730Srwatsonm4_defun([_LT_CMD_OLD_ARCHIVE],
1455243730Srwatson[_LT_PROG_AR
1456243730Srwatson
1457243730SrwatsonAC_CHECK_TOOL(STRIP, strip, :)
1458243730Srwatsontest -z "$STRIP" && STRIP=:
1459243730Srwatson_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1460243730Srwatson
1461243730SrwatsonAC_CHECK_TOOL(RANLIB, ranlib, :)
1462243730Srwatsontest -z "$RANLIB" && RANLIB=:
1463243730Srwatson_LT_DECL([], [RANLIB], [1],
1464243730Srwatson    [Commands used to install an old-style archive])
1465243730Srwatson
1466243730Srwatson# Determine commands to create old-style static archives.
1467243730Srwatsonold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1468243730Srwatsonold_postinstall_cmds='chmod 644 $oldlib'
1469243730Srwatsonold_postuninstall_cmds=
1470243730Srwatson
1471243730Srwatsonif test -n "$RANLIB"; then
1472243730Srwatson  case $host_os in
1473243730Srwatson  openbsd*)
1474243730Srwatson    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1475243730Srwatson    ;;
1476243730Srwatson  *)
1477243730Srwatson    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1478243730Srwatson    ;;
1479243730Srwatson  esac
1480243730Srwatson  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1481243730Srwatsonfi
1482243730Srwatson
1483243730Srwatsoncase $host_os in
1484243730Srwatson  darwin*)
1485243730Srwatson    lock_old_archive_extraction=yes ;;
1486243730Srwatson  *)
1487243730Srwatson    lock_old_archive_extraction=no ;;
1488243730Srwatsonesac
1489243730Srwatson_LT_DECL([], [old_postinstall_cmds], [2])
1490243730Srwatson_LT_DECL([], [old_postuninstall_cmds], [2])
1491243730Srwatson_LT_TAGDECL([], [old_archive_cmds], [2],
1492243730Srwatson    [Commands used to build an old-style archive])
1493243730Srwatson_LT_DECL([], [lock_old_archive_extraction], [0],
1494243730Srwatson    [Whether to use a lock for old archive extraction])
1495243730Srwatson])# _LT_CMD_OLD_ARCHIVE
1496243730Srwatson
1497243730Srwatson
1498243730Srwatson# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1499243730Srwatson#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1500243730Srwatson# ----------------------------------------------------------------
1501243730Srwatson# Check whether the given compiler option works
1502243730SrwatsonAC_DEFUN([_LT_COMPILER_OPTION],
1503243730Srwatson[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1504243730Srwatsonm4_require([_LT_DECL_SED])dnl
1505243730SrwatsonAC_CACHE_CHECK([$1], [$2],
1506243730Srwatson  [$2=no
1507243730Srwatson   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1508243730Srwatson   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1509243730Srwatson   lt_compiler_flag="$3"
1510243730Srwatson   # Insert the option either (1) after the last *FLAGS variable, or
1511243730Srwatson   # (2) before a word containing "conftest.", or (3) at the end.
1512243730Srwatson   # Note that $ac_compile itself does not contain backslashes and begins
1513243730Srwatson   # with a dollar sign (not a hyphen), so the echo should work correctly.
1514243730Srwatson   # The option is referenced via a variable to avoid confusing sed.
1515243730Srwatson   lt_compile=`echo "$ac_compile" | $SED \
1516243730Srwatson   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1517243730Srwatson   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1518243730Srwatson   -e 's:$: $lt_compiler_flag:'`
1519243730Srwatson   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1520243730Srwatson   (eval "$lt_compile" 2>conftest.err)
1521243730Srwatson   ac_status=$?
1522243730Srwatson   cat conftest.err >&AS_MESSAGE_LOG_FD
1523243730Srwatson   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1524243730Srwatson   if (exit $ac_status) && test -s "$ac_outfile"; then
1525243730Srwatson     # The compiler can only warn and ignore the option if not recognized
1526243730Srwatson     # So say no if there are warnings other than the usual output.
1527243730Srwatson     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1528243730Srwatson     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1529243730Srwatson     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1530243730Srwatson       $2=yes
1531243730Srwatson     fi
1532243730Srwatson   fi
1533243730Srwatson   $RM conftest*
1534243730Srwatson])
1535243730Srwatson
1536243730Srwatsonif test x"[$]$2" = xyes; then
1537243730Srwatson    m4_if([$5], , :, [$5])
1538243730Srwatsonelse
1539243730Srwatson    m4_if([$6], , :, [$6])
1540243730Srwatsonfi
1541243730Srwatson])# _LT_COMPILER_OPTION
1542243730Srwatson
1543243730Srwatson# Old name:
1544243730SrwatsonAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1545243730Srwatsondnl aclocal-1.4 backwards compatibility:
1546243730Srwatsondnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1547243730Srwatson
1548243730Srwatson
1549243730Srwatson# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1550243730Srwatson#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1551243730Srwatson# ----------------------------------------------------
1552243730Srwatson# Check whether the given linker option works
1553243730SrwatsonAC_DEFUN([_LT_LINKER_OPTION],
1554243730Srwatson[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1555243730Srwatsonm4_require([_LT_DECL_SED])dnl
1556243730SrwatsonAC_CACHE_CHECK([$1], [$2],
1557243730Srwatson  [$2=no
1558243730Srwatson   save_LDFLAGS="$LDFLAGS"
1559243730Srwatson   LDFLAGS="$LDFLAGS $3"
1560243730Srwatson   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1561243730Srwatson   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1562243730Srwatson     # The linker can only warn and ignore the option if not recognized
1563243730Srwatson     # So say no if there are warnings
1564243730Srwatson     if test -s conftest.err; then
1565243730Srwatson       # Append any errors to the config.log.
1566243730Srwatson       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1567243730Srwatson       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1568243730Srwatson       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1569243730Srwatson       if diff conftest.exp conftest.er2 >/dev/null; then
1570243730Srwatson         $2=yes
1571243730Srwatson       fi
1572243730Srwatson     else
1573243730Srwatson       $2=yes
1574243730Srwatson     fi
1575243730Srwatson   fi
1576243730Srwatson   $RM -r conftest*
1577243730Srwatson   LDFLAGS="$save_LDFLAGS"
1578243730Srwatson])
1579243730Srwatson
1580243730Srwatsonif test x"[$]$2" = xyes; then
1581243730Srwatson    m4_if([$4], , :, [$4])
1582243730Srwatsonelse
1583243730Srwatson    m4_if([$5], , :, [$5])
1584243730Srwatsonfi
1585243730Srwatson])# _LT_LINKER_OPTION
1586243730Srwatson
1587243730Srwatson# Old name:
1588243730SrwatsonAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1589243730Srwatsondnl aclocal-1.4 backwards compatibility:
1590243730Srwatsondnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1591243730Srwatson
1592243730Srwatson
1593243730Srwatson# LT_CMD_MAX_LEN
1594243730Srwatson#---------------
1595243730SrwatsonAC_DEFUN([LT_CMD_MAX_LEN],
1596243730Srwatson[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1597243730Srwatson# find the maximum length of command line arguments
1598243730SrwatsonAC_MSG_CHECKING([the maximum length of command line arguments])
1599243730SrwatsonAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1600243730Srwatson  i=0
1601243730Srwatson  teststring="ABCD"
1602243730Srwatson
1603243730Srwatson  case $build_os in
1604243730Srwatson  msdosdjgpp*)
1605243730Srwatson    # On DJGPP, this test can blow up pretty badly due to problems in libc
1606243730Srwatson    # (any single argument exceeding 2000 bytes causes a buffer overrun
1607243730Srwatson    # during glob expansion).  Even if it were fixed, the result of this
1608243730Srwatson    # check would be larger than it should be.
1609243730Srwatson    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1610243730Srwatson    ;;
1611243730Srwatson
1612243730Srwatson  gnu*)
1613243730Srwatson    # Under GNU Hurd, this test is not required because there is
1614243730Srwatson    # no limit to the length of command line arguments.
1615243730Srwatson    # Libtool will interpret -1 as no limit whatsoever
1616243730Srwatson    lt_cv_sys_max_cmd_len=-1;
1617243730Srwatson    ;;
1618243730Srwatson
1619243730Srwatson  cygwin* | mingw* | cegcc*)
1620243730Srwatson    # On Win9x/ME, this test blows up -- it succeeds, but takes
1621243730Srwatson    # about 5 minutes as the teststring grows exponentially.
1622243730Srwatson    # Worse, since 9x/ME are not pre-emptively multitasking,
1623243730Srwatson    # you end up with a "frozen" computer, even though with patience
1624243730Srwatson    # the test eventually succeeds (with a max line length of 256k).
1625243730Srwatson    # Instead, let's just punt: use the minimum linelength reported by
1626243730Srwatson    # all of the supported platforms: 8192 (on NT/2K/XP).
1627243730Srwatson    lt_cv_sys_max_cmd_len=8192;
1628243730Srwatson    ;;
1629243730Srwatson
1630243730Srwatson  mint*)
1631243730Srwatson    # On MiNT this can take a long time and run out of memory.
1632243730Srwatson    lt_cv_sys_max_cmd_len=8192;
1633243730Srwatson    ;;
1634243730Srwatson
1635243730Srwatson  amigaos*)
1636243730Srwatson    # On AmigaOS with pdksh, this test takes hours, literally.
1637243730Srwatson    # So we just punt and use a minimum line length of 8192.
1638243730Srwatson    lt_cv_sys_max_cmd_len=8192;
1639243730Srwatson    ;;
1640243730Srwatson
1641243730Srwatson  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1642243730Srwatson    # This has been around since 386BSD, at least.  Likely further.
1643243730Srwatson    if test -x /sbin/sysctl; then
1644243730Srwatson      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1645243730Srwatson    elif test -x /usr/sbin/sysctl; then
1646243730Srwatson      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1647243730Srwatson    else
1648243730Srwatson      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1649243730Srwatson    fi
1650243730Srwatson    # And add a safety zone
1651243730Srwatson    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1652243730Srwatson    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1653243730Srwatson    ;;
1654243730Srwatson
1655243730Srwatson  interix*)
1656243730Srwatson    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1657243730Srwatson    lt_cv_sys_max_cmd_len=196608
1658243730Srwatson    ;;
1659243730Srwatson
1660243730Srwatson  os2*)
1661243730Srwatson    # The test takes a long time on OS/2.
1662243730Srwatson    lt_cv_sys_max_cmd_len=8192
1663243730Srwatson    ;;
1664243730Srwatson
1665243730Srwatson  osf*)
1666243730Srwatson    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1667243730Srwatson    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1668243730Srwatson    # nice to cause kernel panics so lets avoid the loop below.
1669243730Srwatson    # First set a reasonable default.
1670243730Srwatson    lt_cv_sys_max_cmd_len=16384
1671243730Srwatson    #
1672243730Srwatson    if test -x /sbin/sysconfig; then
1673243730Srwatson      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1674243730Srwatson        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1675243730Srwatson      esac
1676243730Srwatson    fi
1677243730Srwatson    ;;
1678243730Srwatson  sco3.2v5*)
1679243730Srwatson    lt_cv_sys_max_cmd_len=102400
1680243730Srwatson    ;;
1681243730Srwatson  sysv5* | sco5v6* | sysv4.2uw2*)
1682243730Srwatson    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1683243730Srwatson    if test -n "$kargmax"; then
1684243730Srwatson      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1685243730Srwatson    else
1686243730Srwatson      lt_cv_sys_max_cmd_len=32768
1687243730Srwatson    fi
1688243730Srwatson    ;;
1689243730Srwatson  *)
1690243730Srwatson    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1691243730Srwatson    if test -n "$lt_cv_sys_max_cmd_len"; then
1692243730Srwatson      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1693243730Srwatson      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1694243730Srwatson    else
1695243730Srwatson      # Make teststring a little bigger before we do anything with it.
1696243730Srwatson      # a 1K string should be a reasonable start.
1697243730Srwatson      for i in 1 2 3 4 5 6 7 8 ; do
1698243730Srwatson        teststring=$teststring$teststring
1699243730Srwatson      done
1700243730Srwatson      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1701243730Srwatson      # If test is not a shell built-in, we'll probably end up computing a
1702243730Srwatson      # maximum length that is only half of the actual maximum length, but
1703243730Srwatson      # we can't tell.
1704243730Srwatson      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
1705243730Srwatson	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1706243730Srwatson	      test $i != 17 # 1/2 MB should be enough
1707243730Srwatson      do
1708243730Srwatson        i=`expr $i + 1`
1709243730Srwatson        teststring=$teststring$teststring
1710243730Srwatson      done
1711243730Srwatson      # Only check the string length outside the loop.
1712243730Srwatson      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1713243730Srwatson      teststring=
1714243730Srwatson      # Add a significant safety factor because C++ compilers can tack on
1715243730Srwatson      # massive amounts of additional arguments before passing them to the
1716243730Srwatson      # linker.  It appears as though 1/2 is a usable value.
1717243730Srwatson      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1718243730Srwatson    fi
1719243730Srwatson    ;;
1720243730Srwatson  esac
1721243730Srwatson])
1722243730Srwatsonif test -n $lt_cv_sys_max_cmd_len ; then
1723243730Srwatson  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1724243730Srwatsonelse
1725243730Srwatson  AC_MSG_RESULT(none)
1726243730Srwatsonfi
1727243730Srwatsonmax_cmd_len=$lt_cv_sys_max_cmd_len
1728243730Srwatson_LT_DECL([], [max_cmd_len], [0],
1729243730Srwatson    [What is the maximum length of a command?])
1730243730Srwatson])# LT_CMD_MAX_LEN
1731243730Srwatson
1732243730Srwatson# Old name:
1733243730SrwatsonAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1734243730Srwatsondnl aclocal-1.4 backwards compatibility:
1735243730Srwatsondnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1736243730Srwatson
1737243730Srwatson
1738243730Srwatson# _LT_HEADER_DLFCN
1739243730Srwatson# ----------------
1740243730Srwatsonm4_defun([_LT_HEADER_DLFCN],
1741243730Srwatson[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1742243730Srwatson])# _LT_HEADER_DLFCN
1743243730Srwatson
1744243730Srwatson
1745243730Srwatson# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1746243730Srwatson#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1747243730Srwatson# ----------------------------------------------------------------
1748243730Srwatsonm4_defun([_LT_TRY_DLOPEN_SELF],
1749243730Srwatson[m4_require([_LT_HEADER_DLFCN])dnl
1750243730Srwatsonif test "$cross_compiling" = yes; then :
1751243730Srwatson  [$4]
1752243730Srwatsonelse
1753243730Srwatson  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1754243730Srwatson  lt_status=$lt_dlunknown
1755243730Srwatson  cat > conftest.$ac_ext <<_LT_EOF
1756243730Srwatson[#line $LINENO "configure"
1757243730Srwatson#include "confdefs.h"
1758243730Srwatson
1759243730Srwatson#if HAVE_DLFCN_H
1760243730Srwatson#include <dlfcn.h>
1761243730Srwatson#endif
1762243730Srwatson
1763243730Srwatson#include <stdio.h>
1764243730Srwatson
1765243730Srwatson#ifdef RTLD_GLOBAL
1766243730Srwatson#  define LT_DLGLOBAL		RTLD_GLOBAL
1767243730Srwatson#else
1768243730Srwatson#  ifdef DL_GLOBAL
1769243730Srwatson#    define LT_DLGLOBAL		DL_GLOBAL
1770243730Srwatson#  else
1771243730Srwatson#    define LT_DLGLOBAL		0
1772243730Srwatson#  endif
1773243730Srwatson#endif
1774243730Srwatson
1775243730Srwatson/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1776243730Srwatson   find out it does not work in some platform. */
1777243730Srwatson#ifndef LT_DLLAZY_OR_NOW
1778243730Srwatson#  ifdef RTLD_LAZY
1779243730Srwatson#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1780243730Srwatson#  else
1781243730Srwatson#    ifdef DL_LAZY
1782243730Srwatson#      define LT_DLLAZY_OR_NOW		DL_LAZY
1783243730Srwatson#    else
1784243730Srwatson#      ifdef RTLD_NOW
1785243730Srwatson#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1786243730Srwatson#      else
1787243730Srwatson#        ifdef DL_NOW
1788243730Srwatson#          define LT_DLLAZY_OR_NOW	DL_NOW
1789243730Srwatson#        else
1790243730Srwatson#          define LT_DLLAZY_OR_NOW	0
1791243730Srwatson#        endif
1792243730Srwatson#      endif
1793243730Srwatson#    endif
1794243730Srwatson#  endif
1795243730Srwatson#endif
1796243730Srwatson
1797243730Srwatson/* When -fvisbility=hidden is used, assume the code has been annotated
1798243730Srwatson   correspondingly for the symbols needed.  */
1799243730Srwatson#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1800243730Srwatsonint fnord () __attribute__((visibility("default")));
1801243730Srwatson#endif
1802243730Srwatson
1803243730Srwatsonint fnord () { return 42; }
1804243730Srwatsonint main ()
1805243730Srwatson{
1806243730Srwatson  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1807243730Srwatson  int status = $lt_dlunknown;
1808243730Srwatson
1809243730Srwatson  if (self)
1810243730Srwatson    {
1811243730Srwatson      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1812243730Srwatson      else
1813243730Srwatson        {
1814243730Srwatson	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
1815243730Srwatson          else puts (dlerror ());
1816243730Srwatson	}
1817243730Srwatson      /* dlclose (self); */
1818243730Srwatson    }
1819243730Srwatson  else
1820243730Srwatson    puts (dlerror ());
1821243730Srwatson
1822243730Srwatson  return status;
1823243730Srwatson}]
1824243730Srwatson_LT_EOF
1825243730Srwatson  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1826243730Srwatson    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1827243730Srwatson    lt_status=$?
1828243730Srwatson    case x$lt_status in
1829243730Srwatson      x$lt_dlno_uscore) $1 ;;
1830243730Srwatson      x$lt_dlneed_uscore) $2 ;;
1831243730Srwatson      x$lt_dlunknown|x*) $3 ;;
1832243730Srwatson    esac
1833243730Srwatson  else :
1834243730Srwatson    # compilation failed
1835243730Srwatson    $3
1836243730Srwatson  fi
1837243730Srwatsonfi
1838243730Srwatsonrm -fr conftest*
1839243730Srwatson])# _LT_TRY_DLOPEN_SELF
1840243730Srwatson
1841243730Srwatson
1842243730Srwatson# LT_SYS_DLOPEN_SELF
1843243730Srwatson# ------------------
1844243730SrwatsonAC_DEFUN([LT_SYS_DLOPEN_SELF],
1845243730Srwatson[m4_require([_LT_HEADER_DLFCN])dnl
1846243730Srwatsonif test "x$enable_dlopen" != xyes; then
1847243730Srwatson  enable_dlopen=unknown
1848243730Srwatson  enable_dlopen_self=unknown
1849243730Srwatson  enable_dlopen_self_static=unknown
1850243730Srwatsonelse
1851243730Srwatson  lt_cv_dlopen=no
1852243730Srwatson  lt_cv_dlopen_libs=
1853243730Srwatson
1854243730Srwatson  case $host_os in
1855243730Srwatson  beos*)
1856243730Srwatson    lt_cv_dlopen="load_add_on"
1857243730Srwatson    lt_cv_dlopen_libs=
1858243730Srwatson    lt_cv_dlopen_self=yes
1859243730Srwatson    ;;
1860243730Srwatson
1861243730Srwatson  mingw* | pw32* | cegcc*)
1862243730Srwatson    lt_cv_dlopen="LoadLibrary"
1863243730Srwatson    lt_cv_dlopen_libs=
1864243730Srwatson    ;;
1865243730Srwatson
1866243730Srwatson  cygwin*)
1867243730Srwatson    lt_cv_dlopen="dlopen"
1868243730Srwatson    lt_cv_dlopen_libs=
1869243730Srwatson    ;;
1870243730Srwatson
1871243730Srwatson  darwin*)
1872243730Srwatson  # if libdl is installed we need to link against it
1873243730Srwatson    AC_CHECK_LIB([dl], [dlopen],
1874243730Srwatson		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1875243730Srwatson    lt_cv_dlopen="dyld"
1876243730Srwatson    lt_cv_dlopen_libs=
1877243730Srwatson    lt_cv_dlopen_self=yes
1878243730Srwatson    ])
1879243730Srwatson    ;;
1880243730Srwatson
1881243730Srwatson  *)
1882243730Srwatson    AC_CHECK_FUNC([shl_load],
1883243730Srwatson	  [lt_cv_dlopen="shl_load"],
1884243730Srwatson      [AC_CHECK_LIB([dld], [shl_load],
1885243730Srwatson	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1886243730Srwatson	[AC_CHECK_FUNC([dlopen],
1887243730Srwatson	      [lt_cv_dlopen="dlopen"],
1888243730Srwatson	  [AC_CHECK_LIB([dl], [dlopen],
1889243730Srwatson		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1890243730Srwatson	    [AC_CHECK_LIB([svld], [dlopen],
1891243730Srwatson		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1892243730Srwatson	      [AC_CHECK_LIB([dld], [dld_link],
1893243730Srwatson		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1894243730Srwatson	      ])
1895243730Srwatson	    ])
1896243730Srwatson	  ])
1897243730Srwatson	])
1898243730Srwatson      ])
1899243730Srwatson    ;;
1900243730Srwatson  esac
1901243730Srwatson
1902243730Srwatson  if test "x$lt_cv_dlopen" != xno; then
1903243730Srwatson    enable_dlopen=yes
1904243730Srwatson  else
1905243730Srwatson    enable_dlopen=no
1906243730Srwatson  fi
1907243730Srwatson
1908243730Srwatson  case $lt_cv_dlopen in
1909243730Srwatson  dlopen)
1910243730Srwatson    save_CPPFLAGS="$CPPFLAGS"
1911243730Srwatson    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1912243730Srwatson
1913243730Srwatson    save_LDFLAGS="$LDFLAGS"
1914243730Srwatson    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1915243730Srwatson
1916243730Srwatson    save_LIBS="$LIBS"
1917243730Srwatson    LIBS="$lt_cv_dlopen_libs $LIBS"
1918243730Srwatson
1919243730Srwatson    AC_CACHE_CHECK([whether a program can dlopen itself],
1920243730Srwatson	  lt_cv_dlopen_self, [dnl
1921243730Srwatson	  _LT_TRY_DLOPEN_SELF(
1922243730Srwatson	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1923243730Srwatson	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1924243730Srwatson    ])
1925243730Srwatson
1926243730Srwatson    if test "x$lt_cv_dlopen_self" = xyes; then
1927243730Srwatson      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1928243730Srwatson      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1929243730Srwatson	  lt_cv_dlopen_self_static, [dnl
1930243730Srwatson	  _LT_TRY_DLOPEN_SELF(
1931243730Srwatson	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1932243730Srwatson	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1933243730Srwatson      ])
1934243730Srwatson    fi
1935243730Srwatson
1936243730Srwatson    CPPFLAGS="$save_CPPFLAGS"
1937243730Srwatson    LDFLAGS="$save_LDFLAGS"
1938243730Srwatson    LIBS="$save_LIBS"
1939243730Srwatson    ;;
1940243730Srwatson  esac
1941243730Srwatson
1942243730Srwatson  case $lt_cv_dlopen_self in
1943243730Srwatson  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1944243730Srwatson  *) enable_dlopen_self=unknown ;;
1945243730Srwatson  esac
1946243730Srwatson
1947243730Srwatson  case $lt_cv_dlopen_self_static in
1948243730Srwatson  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1949243730Srwatson  *) enable_dlopen_self_static=unknown ;;
1950243730Srwatson  esac
1951243730Srwatsonfi
1952243730Srwatson_LT_DECL([dlopen_support], [enable_dlopen], [0],
1953243730Srwatson	 [Whether dlopen is supported])
1954243730Srwatson_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1955243730Srwatson	 [Whether dlopen of programs is supported])
1956243730Srwatson_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1957243730Srwatson	 [Whether dlopen of statically linked programs is supported])
1958243730Srwatson])# LT_SYS_DLOPEN_SELF
1959243730Srwatson
1960243730Srwatson# Old name:
1961243730SrwatsonAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1962243730Srwatsondnl aclocal-1.4 backwards compatibility:
1963243730Srwatsondnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1964243730Srwatson
1965243730Srwatson
1966243730Srwatson# _LT_COMPILER_C_O([TAGNAME])
1967243730Srwatson# ---------------------------
1968243730Srwatson# Check to see if options -c and -o are simultaneously supported by compiler.
1969243730Srwatson# This macro does not hard code the compiler like AC_PROG_CC_C_O.
1970243730Srwatsonm4_defun([_LT_COMPILER_C_O],
1971243730Srwatson[m4_require([_LT_DECL_SED])dnl
1972243730Srwatsonm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1973243730Srwatsonm4_require([_LT_TAG_COMPILER])dnl
1974243730SrwatsonAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1975243730Srwatson  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1976243730Srwatson  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1977243730Srwatson   $RM -r conftest 2>/dev/null
1978243730Srwatson   mkdir conftest
1979243730Srwatson   cd conftest
1980243730Srwatson   mkdir out
1981243730Srwatson   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1982243730Srwatson
1983243730Srwatson   lt_compiler_flag="-o out/conftest2.$ac_objext"
1984243730Srwatson   # Insert the option either (1) after the last *FLAGS variable, or
1985243730Srwatson   # (2) before a word containing "conftest.", or (3) at the end.
1986243730Srwatson   # Note that $ac_compile itself does not contain backslashes and begins
1987243730Srwatson   # with a dollar sign (not a hyphen), so the echo should work correctly.
1988243730Srwatson   lt_compile=`echo "$ac_compile" | $SED \
1989243730Srwatson   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1990243730Srwatson   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1991243730Srwatson   -e 's:$: $lt_compiler_flag:'`
1992243730Srwatson   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1993243730Srwatson   (eval "$lt_compile" 2>out/conftest.err)
1994243730Srwatson   ac_status=$?
1995243730Srwatson   cat out/conftest.err >&AS_MESSAGE_LOG_FD
1996243730Srwatson   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1997243730Srwatson   if (exit $ac_status) && test -s out/conftest2.$ac_objext
1998243730Srwatson   then
1999243730Srwatson     # The compiler can only warn and ignore the option if not recognized
2000243730Srwatson     # So say no if there are warnings
2001243730Srwatson     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2002243730Srwatson     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2003243730Srwatson     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2004243730Srwatson       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2005243730Srwatson     fi
2006243730Srwatson   fi
2007243730Srwatson   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2008243730Srwatson   $RM conftest*
2009243730Srwatson   # SGI C++ compiler will create directory out/ii_files/ for
2010243730Srwatson   # template instantiation
2011243730Srwatson   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2012243730Srwatson   $RM out/* && rmdir out
2013243730Srwatson   cd ..
2014243730Srwatson   $RM -r conftest
2015243730Srwatson   $RM conftest*
2016243730Srwatson])
2017243730Srwatson_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2018243730Srwatson	[Does compiler simultaneously support -c and -o options?])
2019243730Srwatson])# _LT_COMPILER_C_O
2020243730Srwatson
2021243730Srwatson
2022243730Srwatson# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2023243730Srwatson# ----------------------------------
2024243730Srwatson# Check to see if we can do hard links to lock some files if needed
2025243730Srwatsonm4_defun([_LT_COMPILER_FILE_LOCKS],
2026243730Srwatson[m4_require([_LT_ENABLE_LOCK])dnl
2027243730Srwatsonm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2028243730Srwatson_LT_COMPILER_C_O([$1])
2029243730Srwatson
2030243730Srwatsonhard_links="nottested"
2031243730Srwatsonif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
2032243730Srwatson  # do not overwrite the value of need_locks provided by the user
2033243730Srwatson  AC_MSG_CHECKING([if we can lock with hard links])
2034243730Srwatson  hard_links=yes
2035243730Srwatson  $RM conftest*
2036243730Srwatson  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2037243730Srwatson  touch conftest.a
2038243730Srwatson  ln conftest.a conftest.b 2>&5 || hard_links=no
2039243730Srwatson  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2040243730Srwatson  AC_MSG_RESULT([$hard_links])
2041243730Srwatson  if test "$hard_links" = no; then
2042243730Srwatson    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
2043243730Srwatson    need_locks=warn
2044243730Srwatson  fi
2045243730Srwatsonelse
2046243730Srwatson  need_locks=no
2047243730Srwatsonfi
2048243730Srwatson_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2049243730Srwatson])# _LT_COMPILER_FILE_LOCKS
2050243730Srwatson
2051243730Srwatson
2052243730Srwatson# _LT_CHECK_OBJDIR
2053243730Srwatson# ----------------
2054243730Srwatsonm4_defun([_LT_CHECK_OBJDIR],
2055243730Srwatson[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2056243730Srwatson[rm -f .libs 2>/dev/null
2057243730Srwatsonmkdir .libs 2>/dev/null
2058243730Srwatsonif test -d .libs; then
2059243730Srwatson  lt_cv_objdir=.libs
2060243730Srwatsonelse
2061243730Srwatson  # MS-DOS does not allow filenames that begin with a dot.
2062243730Srwatson  lt_cv_objdir=_libs
2063243730Srwatsonfi
2064243730Srwatsonrmdir .libs 2>/dev/null])
2065243730Srwatsonobjdir=$lt_cv_objdir
2066243730Srwatson_LT_DECL([], [objdir], [0],
2067243730Srwatson         [The name of the directory that contains temporary libtool files])dnl
2068243730Srwatsonm4_pattern_allow([LT_OBJDIR])dnl
2069243730SrwatsonAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
2070243730Srwatson  [Define to the sub-directory in which libtool stores uninstalled libraries.])
2071243730Srwatson])# _LT_CHECK_OBJDIR
2072243730Srwatson
2073243730Srwatson
2074243730Srwatson# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2075243730Srwatson# --------------------------------------
2076243730Srwatson# Check hardcoding attributes.
2077243730Srwatsonm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2078243730Srwatson[AC_MSG_CHECKING([how to hardcode library paths into programs])
2079243730Srwatson_LT_TAGVAR(hardcode_action, $1)=
2080243730Srwatsonif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2081243730Srwatson   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2082243730Srwatson   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
2083243730Srwatson
2084243730Srwatson  # We can hardcode non-existent directories.
2085243730Srwatson  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
2086243730Srwatson     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2087243730Srwatson     # have to relink, otherwise we might link with an installed library
2088243730Srwatson     # when we should be linking with a yet-to-be-installed one
2089243730Srwatson     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
2090243730Srwatson     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
2091243730Srwatson    # Linking always hardcodes the temporary library directory.
2092243730Srwatson    _LT_TAGVAR(hardcode_action, $1)=relink
2093243730Srwatson  else
2094243730Srwatson    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2095243730Srwatson    _LT_TAGVAR(hardcode_action, $1)=immediate
2096243730Srwatson  fi
2097243730Srwatsonelse
2098243730Srwatson  # We cannot hardcode anything, or else we can only hardcode existing
2099243730Srwatson  # directories.
2100243730Srwatson  _LT_TAGVAR(hardcode_action, $1)=unsupported
2101243730Srwatsonfi
2102243730SrwatsonAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2103243730Srwatson
2104243730Srwatsonif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
2105243730Srwatson   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
2106243730Srwatson  # Fast installation is not supported
2107243730Srwatson  enable_fast_install=no
2108243730Srwatsonelif test "$shlibpath_overrides_runpath" = yes ||
2109243730Srwatson     test "$enable_shared" = no; then
2110243730Srwatson  # Fast installation is not necessary
2111243730Srwatson  enable_fast_install=needless
2112243730Srwatsonfi
2113243730Srwatson_LT_TAGDECL([], [hardcode_action], [0],
2114243730Srwatson    [How to hardcode a shared library path into an executable])
2115243730Srwatson])# _LT_LINKER_HARDCODE_LIBPATH
2116243730Srwatson
2117243730Srwatson
2118243730Srwatson# _LT_CMD_STRIPLIB
2119243730Srwatson# ----------------
2120243730Srwatsonm4_defun([_LT_CMD_STRIPLIB],
2121243730Srwatson[m4_require([_LT_DECL_EGREP])
2122243730Srwatsonstriplib=
2123243730Srwatsonold_striplib=
2124243730SrwatsonAC_MSG_CHECKING([whether stripping libraries is possible])
2125243730Srwatsonif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2126243730Srwatson  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2127243730Srwatson  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2128243730Srwatson  AC_MSG_RESULT([yes])
2129243730Srwatsonelse
2130243730Srwatson# FIXME - insert some real tests, host_os isn't really good enough
2131243730Srwatson  case $host_os in
2132243730Srwatson  darwin*)
2133243730Srwatson    if test -n "$STRIP" ; then
2134243730Srwatson      striplib="$STRIP -x"
2135243730Srwatson      old_striplib="$STRIP -S"
2136243730Srwatson      AC_MSG_RESULT([yes])
2137243730Srwatson    else
2138243730Srwatson      AC_MSG_RESULT([no])
2139243730Srwatson    fi
2140243730Srwatson    ;;
2141243730Srwatson  *)
2142243730Srwatson    AC_MSG_RESULT([no])
2143243730Srwatson    ;;
2144243730Srwatson  esac
2145243730Srwatsonfi
2146243730Srwatson_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2147243730Srwatson_LT_DECL([], [striplib], [1])
2148243730Srwatson])# _LT_CMD_STRIPLIB
2149243730Srwatson
2150243730Srwatson
2151243730Srwatson# _LT_SYS_DYNAMIC_LINKER([TAG])
2152243730Srwatson# -----------------------------
2153243730Srwatson# PORTME Fill in your ld.so characteristics
2154243730Srwatsonm4_defun([_LT_SYS_DYNAMIC_LINKER],
2155243730Srwatson[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2156243730Srwatsonm4_require([_LT_DECL_EGREP])dnl
2157243730Srwatsonm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2158243730Srwatsonm4_require([_LT_DECL_OBJDUMP])dnl
2159243730Srwatsonm4_require([_LT_DECL_SED])dnl
2160243730Srwatsonm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2161243730SrwatsonAC_MSG_CHECKING([dynamic linker characteristics])
2162243730Srwatsonm4_if([$1],
2163243730Srwatson	[], [
2164243730Srwatsonif test "$GCC" = yes; then
2165243730Srwatson  case $host_os in
2166243730Srwatson    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2167243730Srwatson    *) lt_awk_arg="/^libraries:/" ;;
2168243730Srwatson  esac
2169243730Srwatson  case $host_os in
2170243730Srwatson    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
2171243730Srwatson    *) lt_sed_strip_eq="s,=/,/,g" ;;
2172243730Srwatson  esac
2173243730Srwatson  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2174243730Srwatson  case $lt_search_path_spec in
2175243730Srwatson  *\;*)
2176243730Srwatson    # if the path contains ";" then we assume it to be the separator
2177243730Srwatson    # otherwise default to the standard path separator (i.e. ":") - it is
2178243730Srwatson    # assumed that no part of a normal pathname contains ";" but that should
2179243730Srwatson    # okay in the real world where ";" in dirpaths is itself problematic.
2180243730Srwatson    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2181243730Srwatson    ;;
2182243730Srwatson  *)
2183243730Srwatson    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2184243730Srwatson    ;;
2185243730Srwatson  esac
2186243730Srwatson  # Ok, now we have the path, separated by spaces, we can step through it
2187243730Srwatson  # and add multilib dir if necessary.
2188243730Srwatson  lt_tmp_lt_search_path_spec=
2189243730Srwatson  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2190243730Srwatson  for lt_sys_path in $lt_search_path_spec; do
2191243730Srwatson    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2192243730Srwatson      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2193243730Srwatson    else
2194243730Srwatson      test -d "$lt_sys_path" && \
2195243730Srwatson	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2196243730Srwatson    fi
2197243730Srwatson  done
2198243730Srwatson  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2199243730SrwatsonBEGIN {RS=" "; FS="/|\n";} {
2200243730Srwatson  lt_foo="";
2201243730Srwatson  lt_count=0;
2202243730Srwatson  for (lt_i = NF; lt_i > 0; lt_i--) {
2203243730Srwatson    if ($lt_i != "" && $lt_i != ".") {
2204243730Srwatson      if ($lt_i == "..") {
2205243730Srwatson        lt_count++;
2206243730Srwatson      } else {
2207243730Srwatson        if (lt_count == 0) {
2208243730Srwatson          lt_foo="/" $lt_i lt_foo;
2209243730Srwatson        } else {
2210243730Srwatson          lt_count--;
2211243730Srwatson        }
2212243730Srwatson      }
2213243730Srwatson    }
2214243730Srwatson  }
2215243730Srwatson  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2216243730Srwatson  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2217243730Srwatson}'`
2218243730Srwatson  # AWK program above erroneously prepends '/' to C:/dos/paths
2219243730Srwatson  # for these hosts.
2220243730Srwatson  case $host_os in
2221243730Srwatson    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2222243730Srwatson      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
2223243730Srwatson  esac
2224243730Srwatson  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2225243730Srwatsonelse
2226243730Srwatson  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2227243730Srwatsonfi])
2228243730Srwatsonlibrary_names_spec=
2229243730Srwatsonlibname_spec='lib$name'
2230243730Srwatsonsoname_spec=
2231243730Srwatsonshrext_cmds=".so"
2232243730Srwatsonpostinstall_cmds=
2233243730Srwatsonpostuninstall_cmds=
2234243730Srwatsonfinish_cmds=
2235243730Srwatsonfinish_eval=
2236243730Srwatsonshlibpath_var=
2237243730Srwatsonshlibpath_overrides_runpath=unknown
2238243730Srwatsonversion_type=none
2239243730Srwatsondynamic_linker="$host_os ld.so"
2240243730Srwatsonsys_lib_dlsearch_path_spec="/lib /usr/lib"
2241243730Srwatsonneed_lib_prefix=unknown
2242243730Srwatsonhardcode_into_libs=no
2243243730Srwatson
2244243730Srwatson# when you set need_version to no, make sure it does not cause -set_version
2245243730Srwatson# flags to be left without arguments
2246243730Srwatsonneed_version=unknown
2247243730Srwatson
2248243730Srwatsoncase $host_os in
2249243730Srwatsonaix3*)
2250243730Srwatson  version_type=linux # correct to gnu/linux during the next big refactor
2251243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2252243730Srwatson  shlibpath_var=LIBPATH
2253243730Srwatson
2254243730Srwatson  # AIX 3 has no versioning support, so we append a major version to the name.
2255243730Srwatson  soname_spec='${libname}${release}${shared_ext}$major'
2256243730Srwatson  ;;
2257243730Srwatson
2258243730Srwatsonaix[[4-9]]*)
2259243730Srwatson  version_type=linux # correct to gnu/linux during the next big refactor
2260243730Srwatson  need_lib_prefix=no
2261243730Srwatson  need_version=no
2262243730Srwatson  hardcode_into_libs=yes
2263243730Srwatson  if test "$host_cpu" = ia64; then
2264243730Srwatson    # AIX 5 supports IA64
2265243730Srwatson    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2266243730Srwatson    shlibpath_var=LD_LIBRARY_PATH
2267243730Srwatson  else
2268243730Srwatson    # With GCC up to 2.95.x, collect2 would create an import file
2269243730Srwatson    # for dependence libraries.  The import file would start with
2270243730Srwatson    # the line `#! .'.  This would cause the generated library to
2271243730Srwatson    # depend on `.', always an invalid library.  This was fixed in
2272243730Srwatson    # development snapshots of GCC prior to 3.0.
2273243730Srwatson    case $host_os in
2274243730Srwatson      aix4 | aix4.[[01]] | aix4.[[01]].*)
2275243730Srwatson      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2276243730Srwatson	   echo ' yes '
2277243730Srwatson	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2278243730Srwatson	:
2279243730Srwatson      else
2280243730Srwatson	can_build_shared=no
2281243730Srwatson      fi
2282243730Srwatson      ;;
2283243730Srwatson    esac
2284243730Srwatson    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2285243730Srwatson    # soname into executable. Probably we can add versioning support to
2286243730Srwatson    # collect2, so additional links can be useful in future.
2287243730Srwatson    if test "$aix_use_runtimelinking" = yes; then
2288243730Srwatson      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2289243730Srwatson      # instead of lib<name>.a to let people know that these are not
2290243730Srwatson      # typical AIX shared libraries.
2291243730Srwatson      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2292243730Srwatson    else
2293243730Srwatson      # We preserve .a as extension for shared libraries through AIX4.2
2294243730Srwatson      # and later when we are not doing run time linking.
2295243730Srwatson      library_names_spec='${libname}${release}.a $libname.a'
2296243730Srwatson      soname_spec='${libname}${release}${shared_ext}$major'
2297243730Srwatson    fi
2298243730Srwatson    shlibpath_var=LIBPATH
2299243730Srwatson  fi
2300243730Srwatson  ;;
2301243730Srwatson
2302243730Srwatsonamigaos*)
2303243730Srwatson  case $host_cpu in
2304243730Srwatson  powerpc)
2305243730Srwatson    # Since July 2007 AmigaOS4 officially supports .so libraries.
2306243730Srwatson    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2307243730Srwatson    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2308243730Srwatson    ;;
2309243730Srwatson  m68k)
2310243730Srwatson    library_names_spec='$libname.ixlibrary $libname.a'
2311243730Srwatson    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2312243730Srwatson    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'
2313243730Srwatson    ;;
2314243730Srwatson  esac
2315243730Srwatson  ;;
2316243730Srwatson
2317243730Srwatsonbeos*)
2318243730Srwatson  library_names_spec='${libname}${shared_ext}'
2319243730Srwatson  dynamic_linker="$host_os ld.so"
2320243730Srwatson  shlibpath_var=LIBRARY_PATH
2321243730Srwatson  ;;
2322243730Srwatson
2323243730Srwatsonbsdi[[45]]*)
2324243730Srwatson  version_type=linux # correct to gnu/linux during the next big refactor
2325243730Srwatson  need_version=no
2326243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2327243730Srwatson  soname_spec='${libname}${release}${shared_ext}$major'
2328243730Srwatson  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2329243730Srwatson  shlibpath_var=LD_LIBRARY_PATH
2330243730Srwatson  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2331243730Srwatson  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2332243730Srwatson  # the default ld.so.conf also contains /usr/contrib/lib and
2333243730Srwatson  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2334243730Srwatson  # libtool to hard-code these into programs
2335243730Srwatson  ;;
2336243730Srwatson
2337243730Srwatsoncygwin* | mingw* | pw32* | cegcc*)
2338243730Srwatson  version_type=windows
2339243730Srwatson  shrext_cmds=".dll"
2340243730Srwatson  need_version=no
2341243730Srwatson  need_lib_prefix=no
2342243730Srwatson
2343243730Srwatson  case $GCC,$cc_basename in
2344243730Srwatson  yes,*)
2345243730Srwatson    # gcc
2346243730Srwatson    library_names_spec='$libname.dll.a'
2347243730Srwatson    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2348243730Srwatson    postinstall_cmds='base_file=`basename \${file}`~
2349243730Srwatson      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2350243730Srwatson      dldir=$destdir/`dirname \$dlpath`~
2351243730Srwatson      test -d \$dldir || mkdir -p \$dldir~
2352243730Srwatson      $install_prog $dir/$dlname \$dldir/$dlname~
2353243730Srwatson      chmod a+x \$dldir/$dlname~
2354243730Srwatson      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2355243730Srwatson        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2356243730Srwatson      fi'
2357243730Srwatson    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2358243730Srwatson      dlpath=$dir/\$dldll~
2359243730Srwatson       $RM \$dlpath'
2360243730Srwatson    shlibpath_overrides_runpath=yes
2361243730Srwatson
2362243730Srwatson    case $host_os in
2363243730Srwatson    cygwin*)
2364243730Srwatson      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2365243730Srwatson      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2366243730Srwatsonm4_if([$1], [],[
2367243730Srwatson      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2368243730Srwatson      ;;
2369243730Srwatson    mingw* | cegcc*)
2370243730Srwatson      # MinGW DLLs use traditional 'lib' prefix
2371243730Srwatson      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2372243730Srwatson      ;;
2373243730Srwatson    pw32*)
2374243730Srwatson      # pw32 DLLs use 'pw' prefix rather than 'lib'
2375243730Srwatson      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2376243730Srwatson      ;;
2377243730Srwatson    esac
2378243730Srwatson    dynamic_linker='Win32 ld.exe'
2379243730Srwatson    ;;
2380243730Srwatson
2381243730Srwatson  *,cl*)
2382243730Srwatson    # Native MSVC
2383243730Srwatson    libname_spec='$name'
2384243730Srwatson    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2385243730Srwatson    library_names_spec='${libname}.dll.lib'
2386243730Srwatson
2387243730Srwatson    case $build_os in
2388243730Srwatson    mingw*)
2389243730Srwatson      sys_lib_search_path_spec=
2390243730Srwatson      lt_save_ifs=$IFS
2391243730Srwatson      IFS=';'
2392243730Srwatson      for lt_path in $LIB
2393243730Srwatson      do
2394243730Srwatson        IFS=$lt_save_ifs
2395243730Srwatson        # Let DOS variable expansion print the short 8.3 style file name.
2396243730Srwatson        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2397243730Srwatson        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2398243730Srwatson      done
2399243730Srwatson      IFS=$lt_save_ifs
2400243730Srwatson      # Convert to MSYS style.
2401243730Srwatson      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2402243730Srwatson      ;;
2403243730Srwatson    cygwin*)
2404243730Srwatson      # Convert to unix form, then to dos form, then back to unix form
2405243730Srwatson      # but this time dos style (no spaces!) so that the unix form looks
2406243730Srwatson      # like /cygdrive/c/PROGRA~1:/cygdr...
2407243730Srwatson      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2408243730Srwatson      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2409243730Srwatson      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2410243730Srwatson      ;;
2411243730Srwatson    *)
2412243730Srwatson      sys_lib_search_path_spec="$LIB"
2413243730Srwatson      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2414243730Srwatson        # It is most probably a Windows format PATH.
2415243730Srwatson        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2416243730Srwatson      else
2417243730Srwatson        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2418243730Srwatson      fi
2419243730Srwatson      # FIXME: find the short name or the path components, as spaces are
2420243730Srwatson      # common. (e.g. "Program Files" -> "PROGRA~1")
2421243730Srwatson      ;;
2422243730Srwatson    esac
2423243730Srwatson
2424243730Srwatson    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2425243730Srwatson    postinstall_cmds='base_file=`basename \${file}`~
2426243730Srwatson      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2427243730Srwatson      dldir=$destdir/`dirname \$dlpath`~
2428243730Srwatson      test -d \$dldir || mkdir -p \$dldir~
2429243730Srwatson      $install_prog $dir/$dlname \$dldir/$dlname'
2430243730Srwatson    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2431243730Srwatson      dlpath=$dir/\$dldll~
2432243730Srwatson       $RM \$dlpath'
2433243730Srwatson    shlibpath_overrides_runpath=yes
2434243730Srwatson    dynamic_linker='Win32 link.exe'
2435243730Srwatson    ;;
2436243730Srwatson
2437243730Srwatson  *)
2438243730Srwatson    # Assume MSVC wrapper
2439243730Srwatson    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2440243730Srwatson    dynamic_linker='Win32 ld.exe'
2441243730Srwatson    ;;
2442243730Srwatson  esac
2443243730Srwatson  # FIXME: first we should search . and the directory the executable is in
2444243730Srwatson  shlibpath_var=PATH
2445243730Srwatson  ;;
2446243730Srwatson
2447243730Srwatsondarwin* | rhapsody*)
2448243730Srwatson  dynamic_linker="$host_os dyld"
2449243730Srwatson  version_type=darwin
2450243730Srwatson  need_lib_prefix=no
2451243730Srwatson  need_version=no
2452243730Srwatson  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2453243730Srwatson  soname_spec='${libname}${release}${major}$shared_ext'
2454243730Srwatson  shlibpath_overrides_runpath=yes
2455243730Srwatson  shlibpath_var=DYLD_LIBRARY_PATH
2456243730Srwatson  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2457243730Srwatsonm4_if([$1], [],[
2458243730Srwatson  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2459243730Srwatson  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2460243730Srwatson  ;;
2461243730Srwatson
2462243730Srwatsondgux*)
2463243730Srwatson  version_type=linux # correct to gnu/linux during the next big refactor
2464243730Srwatson  need_lib_prefix=no
2465243730Srwatson  need_version=no
2466243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2467243730Srwatson  soname_spec='${libname}${release}${shared_ext}$major'
2468243730Srwatson  shlibpath_var=LD_LIBRARY_PATH
2469243730Srwatson  ;;
2470243730Srwatson
2471243730Srwatsonfreebsd* | dragonfly*)
2472243730Srwatson  # DragonFly does not have aout.  When/if they implement a new
2473243730Srwatson  # versioning mechanism, adjust this.
2474243730Srwatson  if test -x /usr/bin/objformat; then
2475243730Srwatson    objformat=`/usr/bin/objformat`
2476243730Srwatson  else
2477243730Srwatson    case $host_os in
2478243730Srwatson    freebsd[[23]].*) objformat=aout ;;
2479243730Srwatson    *) objformat=elf ;;
2480243730Srwatson    esac
2481243730Srwatson  fi
2482243730Srwatson  version_type=freebsd-$objformat
2483243730Srwatson  case $version_type in
2484243730Srwatson    freebsd-elf*)
2485243730Srwatson      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2486243730Srwatson      need_version=no
2487243730Srwatson      need_lib_prefix=no
2488243730Srwatson      ;;
2489243730Srwatson    freebsd-*)
2490243730Srwatson      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2491243730Srwatson      need_version=yes
2492243730Srwatson      ;;
2493243730Srwatson  esac
2494243730Srwatson  shlibpath_var=LD_LIBRARY_PATH
2495243730Srwatson  case $host_os in
2496243730Srwatson  freebsd2.*)
2497243730Srwatson    shlibpath_overrides_runpath=yes
2498243730Srwatson    ;;
2499243730Srwatson  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2500243730Srwatson    shlibpath_overrides_runpath=yes
2501243730Srwatson    hardcode_into_libs=yes
2502243730Srwatson    ;;
2503243730Srwatson  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2504243730Srwatson  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2505243730Srwatson    shlibpath_overrides_runpath=no
2506243730Srwatson    hardcode_into_libs=yes
2507243730Srwatson    ;;
2508243730Srwatson  *) # from 4.6 on, and DragonFly
2509243730Srwatson    shlibpath_overrides_runpath=yes
2510243730Srwatson    hardcode_into_libs=yes
2511243730Srwatson    ;;
2512243730Srwatson  esac
2513243730Srwatson  ;;
2514243730Srwatson
2515243730Srwatsongnu*)
2516243730Srwatson  version_type=linux # correct to gnu/linux during the next big refactor
2517243730Srwatson  need_lib_prefix=no
2518243730Srwatson  need_version=no
2519243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2520243730Srwatson  soname_spec='${libname}${release}${shared_ext}$major'
2521243730Srwatson  shlibpath_var=LD_LIBRARY_PATH
2522243730Srwatson  shlibpath_overrides_runpath=no
2523243730Srwatson  hardcode_into_libs=yes
2524243730Srwatson  ;;
2525243730Srwatson
2526243730Srwatsonhaiku*)
2527243730Srwatson  version_type=linux # correct to gnu/linux during the next big refactor
2528243730Srwatson  need_lib_prefix=no
2529243730Srwatson  need_version=no
2530243730Srwatson  dynamic_linker="$host_os runtime_loader"
2531243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2532243730Srwatson  soname_spec='${libname}${release}${shared_ext}$major'
2533243730Srwatson  shlibpath_var=LIBRARY_PATH
2534243730Srwatson  shlibpath_overrides_runpath=yes
2535243730Srwatson  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2536243730Srwatson  hardcode_into_libs=yes
2537243730Srwatson  ;;
2538243730Srwatson
2539243730Srwatsonhpux9* | hpux10* | hpux11*)
2540243730Srwatson  # Give a soname corresponding to the major version so that dld.sl refuses to
2541243730Srwatson  # link against other versions.
2542243730Srwatson  version_type=sunos
2543243730Srwatson  need_lib_prefix=no
2544243730Srwatson  need_version=no
2545243730Srwatson  case $host_cpu in
2546243730Srwatson  ia64*)
2547243730Srwatson    shrext_cmds='.so'
2548243730Srwatson    hardcode_into_libs=yes
2549243730Srwatson    dynamic_linker="$host_os dld.so"
2550243730Srwatson    shlibpath_var=LD_LIBRARY_PATH
2551243730Srwatson    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2552243730Srwatson    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2553243730Srwatson    soname_spec='${libname}${release}${shared_ext}$major'
2554243730Srwatson    if test "X$HPUX_IA64_MODE" = X32; then
2555243730Srwatson      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2556243730Srwatson    else
2557243730Srwatson      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2558243730Srwatson    fi
2559243730Srwatson    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2560243730Srwatson    ;;
2561243730Srwatson  hppa*64*)
2562243730Srwatson    shrext_cmds='.sl'
2563243730Srwatson    hardcode_into_libs=yes
2564243730Srwatson    dynamic_linker="$host_os dld.sl"
2565243730Srwatson    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2566243730Srwatson    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2567243730Srwatson    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2568243730Srwatson    soname_spec='${libname}${release}${shared_ext}$major'
2569243730Srwatson    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2570243730Srwatson    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2571243730Srwatson    ;;
2572243730Srwatson  *)
2573243730Srwatson    shrext_cmds='.sl'
2574243730Srwatson    dynamic_linker="$host_os dld.sl"
2575243730Srwatson    shlibpath_var=SHLIB_PATH
2576243730Srwatson    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2577243730Srwatson    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2578243730Srwatson    soname_spec='${libname}${release}${shared_ext}$major'
2579243730Srwatson    ;;
2580243730Srwatson  esac
2581243730Srwatson  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2582243730Srwatson  postinstall_cmds='chmod 555 $lib'
2583243730Srwatson  # or fails outright, so override atomically:
2584243730Srwatson  install_override_mode=555
2585243730Srwatson  ;;
2586243730Srwatson
2587243730Srwatsoninterix[[3-9]]*)
2588243730Srwatson  version_type=linux # correct to gnu/linux during the next big refactor
2589243730Srwatson  need_lib_prefix=no
2590243730Srwatson  need_version=no
2591243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2592243730Srwatson  soname_spec='${libname}${release}${shared_ext}$major'
2593243730Srwatson  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2594243730Srwatson  shlibpath_var=LD_LIBRARY_PATH
2595243730Srwatson  shlibpath_overrides_runpath=no
2596243730Srwatson  hardcode_into_libs=yes
2597243730Srwatson  ;;
2598243730Srwatson
2599243730Srwatsonirix5* | irix6* | nonstopux*)
2600243730Srwatson  case $host_os in
2601243730Srwatson    nonstopux*) version_type=nonstopux ;;
2602243730Srwatson    *)
2603243730Srwatson	if test "$lt_cv_prog_gnu_ld" = yes; then
2604243730Srwatson		version_type=linux # correct to gnu/linux during the next big refactor
2605243730Srwatson	else
2606243730Srwatson		version_type=irix
2607243730Srwatson	fi ;;
2608243730Srwatson  esac
2609243730Srwatson  need_lib_prefix=no
2610243730Srwatson  need_version=no
2611243730Srwatson  soname_spec='${libname}${release}${shared_ext}$major'
2612243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2613243730Srwatson  case $host_os in
2614243730Srwatson  irix5* | nonstopux*)
2615243730Srwatson    libsuff= shlibsuff=
2616243730Srwatson    ;;
2617243730Srwatson  *)
2618243730Srwatson    case $LD in # libtool.m4 will add one of these switches to LD
2619243730Srwatson    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2620243730Srwatson      libsuff= shlibsuff= libmagic=32-bit;;
2621243730Srwatson    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2622243730Srwatson      libsuff=32 shlibsuff=N32 libmagic=N32;;
2623243730Srwatson    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2624243730Srwatson      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2625243730Srwatson    *) libsuff= shlibsuff= libmagic=never-match;;
2626243730Srwatson    esac
2627243730Srwatson    ;;
2628243730Srwatson  esac
2629243730Srwatson  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2630243730Srwatson  shlibpath_overrides_runpath=no
2631243730Srwatson  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2632243730Srwatson  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2633243730Srwatson  hardcode_into_libs=yes
2634243730Srwatson  ;;
2635243730Srwatson
2636243730Srwatson# No shared lib support for Linux oldld, aout, or coff.
2637243730Srwatsonlinux*oldld* | linux*aout* | linux*coff*)
2638243730Srwatson  dynamic_linker=no
2639243730Srwatson  ;;
2640243730Srwatson
2641243730Srwatson# This must be glibc/ELF.
2642243730Srwatsonlinux* | k*bsd*-gnu | kopensolaris*-gnu)
2643243730Srwatson  version_type=linux # correct to gnu/linux during the next big refactor
2644243730Srwatson  need_lib_prefix=no
2645243730Srwatson  need_version=no
2646243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2647243730Srwatson  soname_spec='${libname}${release}${shared_ext}$major'
2648243730Srwatson  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2649243730Srwatson  shlibpath_var=LD_LIBRARY_PATH
2650243730Srwatson  shlibpath_overrides_runpath=no
2651243730Srwatson
2652243730Srwatson  # Some binutils ld are patched to set DT_RUNPATH
2653243730Srwatson  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2654243730Srwatson    [lt_cv_shlibpath_overrides_runpath=no
2655243730Srwatson    save_LDFLAGS=$LDFLAGS
2656243730Srwatson    save_libdir=$libdir
2657243730Srwatson    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2658243730Srwatson	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2659243730Srwatson    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2660243730Srwatson      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2661243730Srwatson	 [lt_cv_shlibpath_overrides_runpath=yes])])
2662243730Srwatson    LDFLAGS=$save_LDFLAGS
2663243730Srwatson    libdir=$save_libdir
2664243730Srwatson    ])
2665243730Srwatson  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2666243730Srwatson
2667243730Srwatson  # This implies no fast_install, which is unacceptable.
2668243730Srwatson  # Some rework will be needed to allow for fast_install
2669243730Srwatson  # before this can be enabled.
2670243730Srwatson  hardcode_into_libs=yes
2671243730Srwatson
2672243730Srwatson  # Append ld.so.conf contents to the search path
2673243730Srwatson  if test -f /etc/ld.so.conf; then
2674243730Srwatson    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' ' '`
2675243730Srwatson    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2676243730Srwatson  fi
2677243730Srwatson
2678243730Srwatson  # We used to test for /lib/ld.so.1 and disable shared libraries on
2679243730Srwatson  # powerpc, because MkLinux only supported shared libraries with the
2680243730Srwatson  # GNU dynamic linker.  Since this was broken with cross compilers,
2681243730Srwatson  # most powerpc-linux boxes support dynamic linking these days and
2682243730Srwatson  # people can always --disable-shared, the test was removed, and we
2683243730Srwatson  # assume the GNU/Linux dynamic linker is in use.
2684243730Srwatson  dynamic_linker='GNU/Linux ld.so'
2685243730Srwatson  ;;
2686243730Srwatson
2687243730Srwatsonnetbsd*)
2688243730Srwatson  version_type=sunos
2689243730Srwatson  need_lib_prefix=no
2690243730Srwatson  need_version=no
2691243730Srwatson  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2692243730Srwatson    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2693243730Srwatson    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2694243730Srwatson    dynamic_linker='NetBSD (a.out) ld.so'
2695243730Srwatson  else
2696243730Srwatson    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2697243730Srwatson    soname_spec='${libname}${release}${shared_ext}$major'
2698243730Srwatson    dynamic_linker='NetBSD ld.elf_so'
2699243730Srwatson  fi
2700243730Srwatson  shlibpath_var=LD_LIBRARY_PATH
2701243730Srwatson  shlibpath_overrides_runpath=yes
2702243730Srwatson  hardcode_into_libs=yes
2703243730Srwatson  ;;
2704243730Srwatson
2705243730Srwatsonnewsos6)
2706243730Srwatson  version_type=linux # correct to gnu/linux during the next big refactor
2707243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2708243730Srwatson  shlibpath_var=LD_LIBRARY_PATH
2709243730Srwatson  shlibpath_overrides_runpath=yes
2710243730Srwatson  ;;
2711243730Srwatson
2712243730Srwatson*nto* | *qnx*)
2713243730Srwatson  version_type=qnx
2714243730Srwatson  need_lib_prefix=no
2715243730Srwatson  need_version=no
2716243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2717243730Srwatson  soname_spec='${libname}${release}${shared_ext}$major'
2718243730Srwatson  shlibpath_var=LD_LIBRARY_PATH
2719243730Srwatson  shlibpath_overrides_runpath=no
2720243730Srwatson  hardcode_into_libs=yes
2721243730Srwatson  dynamic_linker='ldqnx.so'
2722243730Srwatson  ;;
2723243730Srwatson
2724243730Srwatsonopenbsd*)
2725243730Srwatson  version_type=sunos
2726243730Srwatson  sys_lib_dlsearch_path_spec="/usr/lib"
2727243730Srwatson  need_lib_prefix=no
2728243730Srwatson  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2729243730Srwatson  case $host_os in
2730243730Srwatson    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
2731243730Srwatson    *)				need_version=no  ;;
2732243730Srwatson  esac
2733243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2734243730Srwatson  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2735243730Srwatson  shlibpath_var=LD_LIBRARY_PATH
2736243730Srwatson  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2737243730Srwatson    case $host_os in
2738243730Srwatson      openbsd2.[[89]] | openbsd2.[[89]].*)
2739243730Srwatson	shlibpath_overrides_runpath=no
2740243730Srwatson	;;
2741243730Srwatson      *)
2742243730Srwatson	shlibpath_overrides_runpath=yes
2743243730Srwatson	;;
2744243730Srwatson      esac
2745243730Srwatson  else
2746243730Srwatson    shlibpath_overrides_runpath=yes
2747243730Srwatson  fi
2748243730Srwatson  ;;
2749243730Srwatson
2750243730Srwatsonos2*)
2751243730Srwatson  libname_spec='$name'
2752243730Srwatson  shrext_cmds=".dll"
2753243730Srwatson  need_lib_prefix=no
2754243730Srwatson  library_names_spec='$libname${shared_ext} $libname.a'
2755243730Srwatson  dynamic_linker='OS/2 ld.exe'
2756243730Srwatson  shlibpath_var=LIBPATH
2757243730Srwatson  ;;
2758243730Srwatson
2759243730Srwatsonosf3* | osf4* | osf5*)
2760243730Srwatson  version_type=osf
2761243730Srwatson  need_lib_prefix=no
2762243730Srwatson  need_version=no
2763243730Srwatson  soname_spec='${libname}${release}${shared_ext}$major'
2764243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2765243730Srwatson  shlibpath_var=LD_LIBRARY_PATH
2766243730Srwatson  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2767243730Srwatson  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2768243730Srwatson  ;;
2769243730Srwatson
2770243730Srwatsonrdos*)
2771243730Srwatson  dynamic_linker=no
2772243730Srwatson  ;;
2773243730Srwatson
2774243730Srwatsonsolaris*)
2775243730Srwatson  version_type=linux # correct to gnu/linux during the next big refactor
2776243730Srwatson  need_lib_prefix=no
2777243730Srwatson  need_version=no
2778243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2779243730Srwatson  soname_spec='${libname}${release}${shared_ext}$major'
2780243730Srwatson  shlibpath_var=LD_LIBRARY_PATH
2781243730Srwatson  shlibpath_overrides_runpath=yes
2782243730Srwatson  hardcode_into_libs=yes
2783243730Srwatson  # ldd complains unless libraries are executable
2784243730Srwatson  postinstall_cmds='chmod +x $lib'
2785243730Srwatson  ;;
2786243730Srwatson
2787243730Srwatsonsunos4*)
2788243730Srwatson  version_type=sunos
2789243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2790243730Srwatson  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2791243730Srwatson  shlibpath_var=LD_LIBRARY_PATH
2792243730Srwatson  shlibpath_overrides_runpath=yes
2793243730Srwatson  if test "$with_gnu_ld" = yes; then
2794243730Srwatson    need_lib_prefix=no
2795243730Srwatson  fi
2796243730Srwatson  need_version=yes
2797243730Srwatson  ;;
2798243730Srwatson
2799243730Srwatsonsysv4 | sysv4.3*)
2800243730Srwatson  version_type=linux # correct to gnu/linux during the next big refactor
2801243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2802243730Srwatson  soname_spec='${libname}${release}${shared_ext}$major'
2803243730Srwatson  shlibpath_var=LD_LIBRARY_PATH
2804243730Srwatson  case $host_vendor in
2805243730Srwatson    sni)
2806243730Srwatson      shlibpath_overrides_runpath=no
2807243730Srwatson      need_lib_prefix=no
2808243730Srwatson      runpath_var=LD_RUN_PATH
2809243730Srwatson      ;;
2810243730Srwatson    siemens)
2811243730Srwatson      need_lib_prefix=no
2812243730Srwatson      ;;
2813243730Srwatson    motorola)
2814243730Srwatson      need_lib_prefix=no
2815243730Srwatson      need_version=no
2816243730Srwatson      shlibpath_overrides_runpath=no
2817243730Srwatson      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2818243730Srwatson      ;;
2819243730Srwatson  esac
2820243730Srwatson  ;;
2821243730Srwatson
2822243730Srwatsonsysv4*MP*)
2823243730Srwatson  if test -d /usr/nec ;then
2824243730Srwatson    version_type=linux # correct to gnu/linux during the next big refactor
2825243730Srwatson    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2826243730Srwatson    soname_spec='$libname${shared_ext}.$major'
2827243730Srwatson    shlibpath_var=LD_LIBRARY_PATH
2828243730Srwatson  fi
2829243730Srwatson  ;;
2830243730Srwatson
2831243730Srwatsonsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2832243730Srwatson  version_type=freebsd-elf
2833243730Srwatson  need_lib_prefix=no
2834243730Srwatson  need_version=no
2835243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2836243730Srwatson  soname_spec='${libname}${release}${shared_ext}$major'
2837243730Srwatson  shlibpath_var=LD_LIBRARY_PATH
2838243730Srwatson  shlibpath_overrides_runpath=yes
2839243730Srwatson  hardcode_into_libs=yes
2840243730Srwatson  if test "$with_gnu_ld" = yes; then
2841243730Srwatson    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2842243730Srwatson  else
2843243730Srwatson    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2844243730Srwatson    case $host_os in
2845243730Srwatson      sco3.2v5*)
2846243730Srwatson        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2847243730Srwatson	;;
2848243730Srwatson    esac
2849243730Srwatson  fi
2850243730Srwatson  sys_lib_dlsearch_path_spec='/usr/lib'
2851243730Srwatson  ;;
2852243730Srwatson
2853243730Srwatsontpf*)
2854243730Srwatson  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
2855243730Srwatson  version_type=linux # correct to gnu/linux during the next big refactor
2856243730Srwatson  need_lib_prefix=no
2857243730Srwatson  need_version=no
2858243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2859243730Srwatson  shlibpath_var=LD_LIBRARY_PATH
2860243730Srwatson  shlibpath_overrides_runpath=no
2861243730Srwatson  hardcode_into_libs=yes
2862243730Srwatson  ;;
2863243730Srwatson
2864243730Srwatsonuts4*)
2865243730Srwatson  version_type=linux # correct to gnu/linux during the next big refactor
2866243730Srwatson  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2867243730Srwatson  soname_spec='${libname}${release}${shared_ext}$major'
2868243730Srwatson  shlibpath_var=LD_LIBRARY_PATH
2869243730Srwatson  ;;
2870243730Srwatson
2871243730Srwatson*)
2872243730Srwatson  dynamic_linker=no
2873243730Srwatson  ;;
2874243730Srwatsonesac
2875243730SrwatsonAC_MSG_RESULT([$dynamic_linker])
2876243730Srwatsontest "$dynamic_linker" = no && can_build_shared=no
2877243730Srwatson
2878243730Srwatsonvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2879243730Srwatsonif test "$GCC" = yes; then
2880243730Srwatson  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2881243730Srwatsonfi
2882243730Srwatson
2883243730Srwatsonif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2884243730Srwatson  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2885243730Srwatsonfi
2886243730Srwatsonif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2887243730Srwatson  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2888243730Srwatsonfi
2889243730Srwatson
2890243730Srwatson_LT_DECL([], [variables_saved_for_relink], [1],
2891243730Srwatson    [Variables whose values should be saved in libtool wrapper scripts and
2892243730Srwatson    restored at link time])
2893243730Srwatson_LT_DECL([], [need_lib_prefix], [0],
2894243730Srwatson    [Do we need the "lib" prefix for modules?])
2895243730Srwatson_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2896243730Srwatson_LT_DECL([], [version_type], [0], [Library versioning type])
2897243730Srwatson_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
2898243730Srwatson_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2899243730Srwatson_LT_DECL([], [shlibpath_overrides_runpath], [0],
2900243730Srwatson    [Is shlibpath searched before the hard-coded library search path?])
2901243730Srwatson_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2902243730Srwatson_LT_DECL([], [library_names_spec], [1],
2903243730Srwatson    [[List of archive names.  First name is the real one, the rest are links.
2904243730Srwatson    The last name is the one that the linker finds with -lNAME]])
2905243730Srwatson_LT_DECL([], [soname_spec], [1],
2906243730Srwatson    [[The coded name of the library, if different from the real name]])
2907243730Srwatson_LT_DECL([], [install_override_mode], [1],
2908243730Srwatson    [Permission mode override for installation of shared libraries])
2909243730Srwatson_LT_DECL([], [postinstall_cmds], [2],
2910243730Srwatson    [Command to use after installation of a shared archive])
2911243730Srwatson_LT_DECL([], [postuninstall_cmds], [2],
2912243730Srwatson    [Command to use after uninstallation of a shared archive])
2913243730Srwatson_LT_DECL([], [finish_cmds], [2],
2914243730Srwatson    [Commands used to finish a libtool library installation in a directory])
2915243730Srwatson_LT_DECL([], [finish_eval], [1],
2916243730Srwatson    [[As "finish_cmds", except a single script fragment to be evaled but
2917243730Srwatson    not shown]])
2918243730Srwatson_LT_DECL([], [hardcode_into_libs], [0],
2919243730Srwatson    [Whether we should hardcode library paths into libraries])
2920243730Srwatson_LT_DECL([], [sys_lib_search_path_spec], [2],
2921243730Srwatson    [Compile-time system search path for libraries])
2922243730Srwatson_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2923243730Srwatson    [Run-time system search path for libraries])
2924243730Srwatson])# _LT_SYS_DYNAMIC_LINKER
2925243730Srwatson
2926243730Srwatson
2927243730Srwatson# _LT_PATH_TOOL_PREFIX(TOOL)
2928243730Srwatson# --------------------------
2929243730Srwatson# find a file program which can recognize shared library
2930243730SrwatsonAC_DEFUN([_LT_PATH_TOOL_PREFIX],
2931243730Srwatson[m4_require([_LT_DECL_EGREP])dnl
2932243730SrwatsonAC_MSG_CHECKING([for $1])
2933243730SrwatsonAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2934243730Srwatson[case $MAGIC_CMD in
2935243730Srwatson[[\\/*] |  ?:[\\/]*])
2936243730Srwatson  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2937243730Srwatson  ;;
2938243730Srwatson*)
2939243730Srwatson  lt_save_MAGIC_CMD="$MAGIC_CMD"
2940243730Srwatson  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2941243730Srwatsondnl $ac_dummy forces splitting on constant user-supplied paths.
2942243730Srwatsondnl POSIX.2 word splitting is done only on the output of word expansions,
2943243730Srwatsondnl not every word.  This closes a longstanding sh security hole.
2944243730Srwatson  ac_dummy="m4_if([$2], , $PATH, [$2])"
2945243730Srwatson  for ac_dir in $ac_dummy; do
2946243730Srwatson    IFS="$lt_save_ifs"
2947243730Srwatson    test -z "$ac_dir" && ac_dir=.
2948243730Srwatson    if test -f $ac_dir/$1; then
2949243730Srwatson      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2950243730Srwatson      if test -n "$file_magic_test_file"; then
2951243730Srwatson	case $deplibs_check_method in
2952243730Srwatson	"file_magic "*)
2953243730Srwatson	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2954243730Srwatson	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2955243730Srwatson	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2956243730Srwatson	    $EGREP "$file_magic_regex" > /dev/null; then
2957243730Srwatson	    :
2958243730Srwatson	  else
2959243730Srwatson	    cat <<_LT_EOF 1>&2
2960243730Srwatson
2961243730Srwatson*** Warning: the command libtool uses to detect shared libraries,
2962243730Srwatson*** $file_magic_cmd, produces output that libtool cannot recognize.
2963243730Srwatson*** The result is that libtool may fail to recognize shared libraries
2964243730Srwatson*** as such.  This will affect the creation of libtool libraries that
2965243730Srwatson*** depend on shared libraries, but programs linked with such libtool
2966243730Srwatson*** libraries will work regardless of this problem.  Nevertheless, you
2967243730Srwatson*** may want to report the problem to your system manager and/or to
2968243730Srwatson*** bug-libtool@gnu.org
2969243730Srwatson
2970243730Srwatson_LT_EOF
2971243730Srwatson	  fi ;;
2972243730Srwatson	esac
2973243730Srwatson      fi
2974243730Srwatson      break
2975243730Srwatson    fi
2976243730Srwatson  done
2977243730Srwatson  IFS="$lt_save_ifs"
2978243730Srwatson  MAGIC_CMD="$lt_save_MAGIC_CMD"
2979243730Srwatson  ;;
2980243730Srwatsonesac])
2981243730SrwatsonMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2982243730Srwatsonif test -n "$MAGIC_CMD"; then
2983243730Srwatson  AC_MSG_RESULT($MAGIC_CMD)
2984243730Srwatsonelse
2985243730Srwatson  AC_MSG_RESULT(no)
2986243730Srwatsonfi
2987243730Srwatson_LT_DECL([], [MAGIC_CMD], [0],
2988243730Srwatson	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
2989243730Srwatson])# _LT_PATH_TOOL_PREFIX
2990243730Srwatson
2991243730Srwatson# Old name:
2992243730SrwatsonAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
2993243730Srwatsondnl aclocal-1.4 backwards compatibility:
2994243730Srwatsondnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
2995243730Srwatson
2996243730Srwatson
2997243730Srwatson# _LT_PATH_MAGIC
2998243730Srwatson# --------------
2999243730Srwatson# find a file program which can recognize a shared library
3000243730Srwatsonm4_defun([_LT_PATH_MAGIC],
3001243730Srwatson[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3002243730Srwatsonif test -z "$lt_cv_path_MAGIC_CMD"; then
3003243730Srwatson  if test -n "$ac_tool_prefix"; then
3004243730Srwatson    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3005243730Srwatson  else
3006243730Srwatson    MAGIC_CMD=:
3007243730Srwatson  fi
3008243730Srwatsonfi
3009243730Srwatson])# _LT_PATH_MAGIC
3010243730Srwatson
3011243730Srwatson
3012243730Srwatson# LT_PATH_LD
3013243730Srwatson# ----------
3014243730Srwatson# find the pathname to the GNU or non-GNU linker
3015243730SrwatsonAC_DEFUN([LT_PATH_LD],
3016243730Srwatson[AC_REQUIRE([AC_PROG_CC])dnl
3017243730SrwatsonAC_REQUIRE([AC_CANONICAL_HOST])dnl
3018243730SrwatsonAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3019243730Srwatsonm4_require([_LT_DECL_SED])dnl
3020243730Srwatsonm4_require([_LT_DECL_EGREP])dnl
3021243730Srwatsonm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3022243730Srwatson
3023243730SrwatsonAC_ARG_WITH([gnu-ld],
3024243730Srwatson    [AS_HELP_STRING([--with-gnu-ld],
3025243730Srwatson	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3026243730Srwatson    [test "$withval" = no || with_gnu_ld=yes],
3027243730Srwatson    [with_gnu_ld=no])dnl
3028243730Srwatson
3029243730Srwatsonac_prog=ld
3030243730Srwatsonif test "$GCC" = yes; then
3031243730Srwatson  # Check if gcc -print-prog-name=ld gives a path.
3032243730Srwatson  AC_MSG_CHECKING([for ld used by $CC])
3033243730Srwatson  case $host in
3034243730Srwatson  *-*-mingw*)
3035243730Srwatson    # gcc leaves a trailing carriage return which upsets mingw
3036243730Srwatson    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3037243730Srwatson  *)
3038243730Srwatson    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3039243730Srwatson  esac
3040243730Srwatson  case $ac_prog in
3041243730Srwatson    # Accept absolute paths.
3042243730Srwatson    [[\\/]]* | ?:[[\\/]]*)
3043243730Srwatson      re_direlt='/[[^/]][[^/]]*/\.\./'
3044243730Srwatson      # Canonicalize the pathname of ld
3045243730Srwatson      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3046243730Srwatson      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3047243730Srwatson	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3048243730Srwatson      done
3049243730Srwatson      test -z "$LD" && LD="$ac_prog"
3050243730Srwatson      ;;
3051243730Srwatson  "")
3052243730Srwatson    # If it fails, then pretend we aren't using GCC.
3053243730Srwatson    ac_prog=ld
3054243730Srwatson    ;;
3055243730Srwatson  *)
3056243730Srwatson    # If it is relative, then search for the first ld in PATH.
3057243730Srwatson    with_gnu_ld=unknown
3058243730Srwatson    ;;
3059243730Srwatson  esac
3060243730Srwatsonelif test "$with_gnu_ld" = yes; then
3061243730Srwatson  AC_MSG_CHECKING([for GNU ld])
3062243730Srwatsonelse
3063243730Srwatson  AC_MSG_CHECKING([for non-GNU ld])
3064243730Srwatsonfi
3065243730SrwatsonAC_CACHE_VAL(lt_cv_path_LD,
3066243730Srwatson[if test -z "$LD"; then
3067243730Srwatson  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3068243730Srwatson  for ac_dir in $PATH; do
3069243730Srwatson    IFS="$lt_save_ifs"
3070243730Srwatson    test -z "$ac_dir" && ac_dir=.
3071243730Srwatson    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3072243730Srwatson      lt_cv_path_LD="$ac_dir/$ac_prog"
3073243730Srwatson      # Check to see if the program is GNU ld.  I'd rather use --version,
3074243730Srwatson      # but apparently some variants of GNU ld only accept -v.
3075243730Srwatson      # Break only if it was the GNU/non-GNU ld that we prefer.
3076243730Srwatson      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3077243730Srwatson      *GNU* | *'with BFD'*)
3078243730Srwatson	test "$with_gnu_ld" != no && break
3079243730Srwatson	;;
3080243730Srwatson      *)
3081243730Srwatson	test "$with_gnu_ld" != yes && break
3082243730Srwatson	;;
3083243730Srwatson      esac
3084243730Srwatson    fi
3085243730Srwatson  done
3086243730Srwatson  IFS="$lt_save_ifs"
3087243730Srwatsonelse
3088243730Srwatson  lt_cv_path_LD="$LD" # Let the user override the test with a path.
3089243730Srwatsonfi])
3090243730SrwatsonLD="$lt_cv_path_LD"
3091243730Srwatsonif test -n "$LD"; then
3092243730Srwatson  AC_MSG_RESULT($LD)
3093243730Srwatsonelse
3094243730Srwatson  AC_MSG_RESULT(no)
3095243730Srwatsonfi
3096243730Srwatsontest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3097243730Srwatson_LT_PATH_LD_GNU
3098243730SrwatsonAC_SUBST([LD])
3099243730Srwatson
3100243730Srwatson_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3101243730Srwatson])# LT_PATH_LD
3102243730Srwatson
3103243730Srwatson# Old names:
3104243730SrwatsonAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3105243730SrwatsonAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3106243730Srwatsondnl aclocal-1.4 backwards compatibility:
3107243730Srwatsondnl AC_DEFUN([AM_PROG_LD], [])
3108243730Srwatsondnl AC_DEFUN([AC_PROG_LD], [])
3109243730Srwatson
3110243730Srwatson
3111243730Srwatson# _LT_PATH_LD_GNU
3112243730Srwatson#- --------------
3113243730Srwatsonm4_defun([_LT_PATH_LD_GNU],
3114243730Srwatson[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3115243730Srwatson[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3116243730Srwatsoncase `$LD -v 2>&1 </dev/null` in
3117243730Srwatson*GNU* | *'with BFD'*)
3118243730Srwatson  lt_cv_prog_gnu_ld=yes
3119243730Srwatson  ;;
3120243730Srwatson*)
3121243730Srwatson  lt_cv_prog_gnu_ld=no
3122243730Srwatson  ;;
3123243730Srwatsonesac])
3124243730Srwatsonwith_gnu_ld=$lt_cv_prog_gnu_ld
3125243730Srwatson])# _LT_PATH_LD_GNU
3126243730Srwatson
3127243730Srwatson
3128243730Srwatson# _LT_CMD_RELOAD
3129243730Srwatson# --------------
3130243730Srwatson# find reload flag for linker
3131243730Srwatson#   -- PORTME Some linkers may need a different reload flag.
3132243730Srwatsonm4_defun([_LT_CMD_RELOAD],
3133243730Srwatson[AC_CACHE_CHECK([for $LD option to reload object files],
3134243730Srwatson  lt_cv_ld_reload_flag,
3135243730Srwatson  [lt_cv_ld_reload_flag='-r'])
3136243730Srwatsonreload_flag=$lt_cv_ld_reload_flag
3137243730Srwatsoncase $reload_flag in
3138243730Srwatson"" | " "*) ;;
3139243730Srwatson*) reload_flag=" $reload_flag" ;;
3140243730Srwatsonesac
3141243730Srwatsonreload_cmds='$LD$reload_flag -o $output$reload_objs'
3142243730Srwatsoncase $host_os in
3143243730Srwatson  cygwin* | mingw* | pw32* | cegcc*)
3144243730Srwatson    if test "$GCC" != yes; then
3145243730Srwatson      reload_cmds=false
3146243730Srwatson    fi
3147243730Srwatson    ;;
3148243730Srwatson  darwin*)
3149243730Srwatson    if test "$GCC" = yes; then
3150243730Srwatson      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
3151243730Srwatson    else
3152243730Srwatson      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3153243730Srwatson    fi
3154243730Srwatson    ;;
3155243730Srwatsonesac
3156243730Srwatson_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3157243730Srwatson_LT_TAGDECL([], [reload_cmds], [2])dnl
3158243730Srwatson])# _LT_CMD_RELOAD
3159243730Srwatson
3160243730Srwatson
3161243730Srwatson# _LT_CHECK_MAGIC_METHOD
3162243730Srwatson# ----------------------
3163243730Srwatson# how to check for library dependencies
3164243730Srwatson#  -- PORTME fill in with the dynamic library characteristics
3165243730Srwatsonm4_defun([_LT_CHECK_MAGIC_METHOD],
3166243730Srwatson[m4_require([_LT_DECL_EGREP])
3167243730Srwatsonm4_require([_LT_DECL_OBJDUMP])
3168243730SrwatsonAC_CACHE_CHECK([how to recognize dependent libraries],
3169243730Srwatsonlt_cv_deplibs_check_method,
3170243730Srwatson[lt_cv_file_magic_cmd='$MAGIC_CMD'
3171243730Srwatsonlt_cv_file_magic_test_file=
3172243730Srwatsonlt_cv_deplibs_check_method='unknown'
3173243730Srwatson# Need to set the preceding variable on all platforms that support
3174243730Srwatson# interlibrary dependencies.
3175243730Srwatson# 'none' -- dependencies not supported.
3176243730Srwatson# `unknown' -- same as none, but documents that we really don't know.
3177243730Srwatson# 'pass_all' -- all dependencies passed with no checks.
3178243730Srwatson# 'test_compile' -- check by making test program.
3179243730Srwatson# 'file_magic [[regex]]' -- check by looking for files in library path
3180243730Srwatson# which responds to the $file_magic_cmd with a given extended regex.
3181243730Srwatson# If you have `file' or equivalent on your system and you're not sure
3182243730Srwatson# whether `pass_all' will *always* work, you probably want this one.
3183243730Srwatson
3184243730Srwatsoncase $host_os in
3185243730Srwatsonaix[[4-9]]*)
3186243730Srwatson  lt_cv_deplibs_check_method=pass_all
3187243730Srwatson  ;;
3188243730Srwatson
3189243730Srwatsonbeos*)
3190243730Srwatson  lt_cv_deplibs_check_method=pass_all
3191243730Srwatson  ;;
3192243730Srwatson
3193243730Srwatsonbsdi[[45]]*)
3194243730Srwatson  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3195243730Srwatson  lt_cv_file_magic_cmd='/usr/bin/file -L'
3196243730Srwatson  lt_cv_file_magic_test_file=/shlib/libc.so
3197243730Srwatson  ;;
3198243730Srwatson
3199243730Srwatsoncygwin*)
3200243730Srwatson  # func_win32_libid is a shell function defined in ltmain.sh
3201243730Srwatson  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3202243730Srwatson  lt_cv_file_magic_cmd='func_win32_libid'
3203243730Srwatson  ;;
3204243730Srwatson
3205243730Srwatsonmingw* | pw32*)
3206243730Srwatson  # Base MSYS/MinGW do not provide the 'file' command needed by
3207243730Srwatson  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3208243730Srwatson  # unless we find 'file', for example because we are cross-compiling.
3209243730Srwatson  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
3210243730Srwatson  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
3211243730Srwatson    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3212243730Srwatson    lt_cv_file_magic_cmd='func_win32_libid'
3213243730Srwatson  else
3214243730Srwatson    # Keep this pattern in sync with the one in func_win32_libid.
3215243730Srwatson    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3216243730Srwatson    lt_cv_file_magic_cmd='$OBJDUMP -f'
3217243730Srwatson  fi
3218243730Srwatson  ;;
3219243730Srwatson
3220243730Srwatsoncegcc*)
3221243730Srwatson  # use the weaker test based on 'objdump'. See mingw*.
3222243730Srwatson  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3223243730Srwatson  lt_cv_file_magic_cmd='$OBJDUMP -f'
3224243730Srwatson  ;;
3225243730Srwatson
3226243730Srwatsondarwin* | rhapsody*)
3227243730Srwatson  lt_cv_deplibs_check_method=pass_all
3228243730Srwatson  ;;
3229243730Srwatson
3230243730Srwatsonfreebsd* | dragonfly*)
3231243730Srwatson  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3232243730Srwatson    case $host_cpu in
3233243730Srwatson    i*86 )
3234243730Srwatson      # Not sure whether the presence of OpenBSD here was a mistake.
3235243730Srwatson      # Let's accept both of them until this is cleared up.
3236243730Srwatson      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3237243730Srwatson      lt_cv_file_magic_cmd=/usr/bin/file
3238243730Srwatson      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3239243730Srwatson      ;;
3240243730Srwatson    esac
3241243730Srwatson  else
3242243730Srwatson    lt_cv_deplibs_check_method=pass_all
3243243730Srwatson  fi
3244243730Srwatson  ;;
3245243730Srwatson
3246243730Srwatsongnu*)
3247243730Srwatson  lt_cv_deplibs_check_method=pass_all
3248243730Srwatson  ;;
3249243730Srwatson
3250243730Srwatsonhaiku*)
3251243730Srwatson  lt_cv_deplibs_check_method=pass_all
3252243730Srwatson  ;;
3253243730Srwatson
3254243730Srwatsonhpux10.20* | hpux11*)
3255243730Srwatson  lt_cv_file_magic_cmd=/usr/bin/file
3256243730Srwatson  case $host_cpu in
3257243730Srwatson  ia64*)
3258243730Srwatson    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3259243730Srwatson    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3260243730Srwatson    ;;
3261243730Srwatson  hppa*64*)
3262243730Srwatson    [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]']
3263243730Srwatson    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3264243730Srwatson    ;;
3265243730Srwatson  *)
3266243730Srwatson    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3267243730Srwatson    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3268243730Srwatson    ;;
3269243730Srwatson  esac
3270243730Srwatson  ;;
3271243730Srwatson
3272243730Srwatsoninterix[[3-9]]*)
3273243730Srwatson  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3274243730Srwatson  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3275243730Srwatson  ;;
3276243730Srwatson
3277243730Srwatsonirix5* | irix6* | nonstopux*)
3278243730Srwatson  case $LD in
3279243730Srwatson  *-32|*"-32 ") libmagic=32-bit;;
3280243730Srwatson  *-n32|*"-n32 ") libmagic=N32;;
3281243730Srwatson  *-64|*"-64 ") libmagic=64-bit;;
3282243730Srwatson  *) libmagic=never-match;;
3283243730Srwatson  esac
3284243730Srwatson  lt_cv_deplibs_check_method=pass_all
3285243730Srwatson  ;;
3286243730Srwatson
3287243730Srwatson# This must be glibc/ELF.
3288243730Srwatsonlinux* | k*bsd*-gnu | kopensolaris*-gnu)
3289243730Srwatson  lt_cv_deplibs_check_method=pass_all
3290243730Srwatson  ;;
3291243730Srwatson
3292243730Srwatsonnetbsd*)
3293243730Srwatson  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3294243730Srwatson    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3295243730Srwatson  else
3296243730Srwatson    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3297243730Srwatson  fi
3298243730Srwatson  ;;
3299243730Srwatson
3300243730Srwatsonnewos6*)
3301243730Srwatson  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3302243730Srwatson  lt_cv_file_magic_cmd=/usr/bin/file
3303243730Srwatson  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3304243730Srwatson  ;;
3305243730Srwatson
3306243730Srwatson*nto* | *qnx*)
3307243730Srwatson  lt_cv_deplibs_check_method=pass_all
3308243730Srwatson  ;;
3309243730Srwatson
3310243730Srwatsonopenbsd*)
3311243730Srwatson  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3312243730Srwatson    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3313243730Srwatson  else
3314243730Srwatson    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3315243730Srwatson  fi
3316243730Srwatson  ;;
3317243730Srwatson
3318243730Srwatsonosf3* | osf4* | osf5*)
3319243730Srwatson  lt_cv_deplibs_check_method=pass_all
3320243730Srwatson  ;;
3321243730Srwatson
3322243730Srwatsonrdos*)
3323243730Srwatson  lt_cv_deplibs_check_method=pass_all
3324243730Srwatson  ;;
3325243730Srwatson
3326243730Srwatsonsolaris*)
3327243730Srwatson  lt_cv_deplibs_check_method=pass_all
3328243730Srwatson  ;;
3329243730Srwatson
3330243730Srwatsonsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3331243730Srwatson  lt_cv_deplibs_check_method=pass_all
3332243730Srwatson  ;;
3333243730Srwatson
3334243730Srwatsonsysv4 | sysv4.3*)
3335243730Srwatson  case $host_vendor in
3336243730Srwatson  motorola)
3337243730Srwatson    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]]'
3338243730Srwatson    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3339243730Srwatson    ;;
3340243730Srwatson  ncr)
3341243730Srwatson    lt_cv_deplibs_check_method=pass_all
3342243730Srwatson    ;;
3343243730Srwatson  sequent)
3344243730Srwatson    lt_cv_file_magic_cmd='/bin/file'
3345243730Srwatson    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3346243730Srwatson    ;;
3347243730Srwatson  sni)
3348243730Srwatson    lt_cv_file_magic_cmd='/bin/file'
3349243730Srwatson    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3350243730Srwatson    lt_cv_file_magic_test_file=/lib/libc.so
3351243730Srwatson    ;;
3352243730Srwatson  siemens)
3353243730Srwatson    lt_cv_deplibs_check_method=pass_all
3354243730Srwatson    ;;
3355243730Srwatson  pc)
3356243730Srwatson    lt_cv_deplibs_check_method=pass_all
3357243730Srwatson    ;;
3358243730Srwatson  esac
3359243730Srwatson  ;;
3360243730Srwatson
3361243730Srwatsontpf*)
3362243730Srwatson  lt_cv_deplibs_check_method=pass_all
3363243730Srwatson  ;;
3364243730Srwatsonesac
3365243730Srwatson])
3366243730Srwatson
3367243730Srwatsonfile_magic_glob=
3368243730Srwatsonwant_nocaseglob=no
3369243730Srwatsonif test "$build" = "$host"; then
3370243730Srwatson  case $host_os in
3371243730Srwatson  mingw* | pw32*)
3372243730Srwatson    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3373243730Srwatson      want_nocaseglob=yes
3374243730Srwatson    else
3375243730Srwatson      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3376243730Srwatson    fi
3377243730Srwatson    ;;
3378243730Srwatson  esac
3379243730Srwatsonfi
3380243730Srwatson
3381243730Srwatsonfile_magic_cmd=$lt_cv_file_magic_cmd
3382243730Srwatsondeplibs_check_method=$lt_cv_deplibs_check_method
3383243730Srwatsontest -z "$deplibs_check_method" && deplibs_check_method=unknown
3384243730Srwatson
3385243730Srwatson_LT_DECL([], [deplibs_check_method], [1],
3386243730Srwatson    [Method to check whether dependent libraries are shared objects])
3387243730Srwatson_LT_DECL([], [file_magic_cmd], [1],
3388243730Srwatson    [Command to use when deplibs_check_method = "file_magic"])
3389243730Srwatson_LT_DECL([], [file_magic_glob], [1],
3390243730Srwatson    [How to find potential files when deplibs_check_method = "file_magic"])
3391243730Srwatson_LT_DECL([], [want_nocaseglob], [1],
3392243730Srwatson    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3393243730Srwatson])# _LT_CHECK_MAGIC_METHOD
3394243730Srwatson
3395243730Srwatson
3396243730Srwatson# LT_PATH_NM
3397243730Srwatson# ----------
3398243730Srwatson# find the pathname to a BSD- or MS-compatible name lister
3399243730SrwatsonAC_DEFUN([LT_PATH_NM],
3400243730Srwatson[AC_REQUIRE([AC_PROG_CC])dnl
3401243730SrwatsonAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3402243730Srwatson[if test -n "$NM"; then
3403243730Srwatson  # Let the user override the test.
3404243730Srwatson  lt_cv_path_NM="$NM"
3405243730Srwatsonelse
3406243730Srwatson  lt_nm_to_check="${ac_tool_prefix}nm"
3407243730Srwatson  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3408243730Srwatson    lt_nm_to_check="$lt_nm_to_check nm"
3409243730Srwatson  fi
3410243730Srwatson  for lt_tmp_nm in $lt_nm_to_check; do
3411243730Srwatson    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3412243730Srwatson    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3413243730Srwatson      IFS="$lt_save_ifs"
3414243730Srwatson      test -z "$ac_dir" && ac_dir=.
3415243730Srwatson      tmp_nm="$ac_dir/$lt_tmp_nm"
3416243730Srwatson      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3417243730Srwatson	# Check to see if the nm accepts a BSD-compat flag.
3418243730Srwatson	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
3419243730Srwatson	#   nm: unknown option "B" ignored
3420243730Srwatson	# Tru64's nm complains that /dev/null is an invalid object file
3421243730Srwatson	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3422243730Srwatson	*/dev/null* | *'Invalid file or object type'*)
3423243730Srwatson	  lt_cv_path_NM="$tmp_nm -B"
3424243730Srwatson	  break
3425243730Srwatson	  ;;
3426243730Srwatson	*)
3427243730Srwatson	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3428243730Srwatson	  */dev/null*)
3429243730Srwatson	    lt_cv_path_NM="$tmp_nm -p"
3430243730Srwatson	    break
3431243730Srwatson	    ;;
3432243730Srwatson	  *)
3433243730Srwatson	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3434243730Srwatson	    continue # so that we can try to find one that supports BSD flags
3435243730Srwatson	    ;;
3436243730Srwatson	  esac
3437243730Srwatson	  ;;
3438243730Srwatson	esac
3439243730Srwatson      fi
3440243730Srwatson    done
3441243730Srwatson    IFS="$lt_save_ifs"
3442243730Srwatson  done
3443243730Srwatson  : ${lt_cv_path_NM=no}
3444243730Srwatsonfi])
3445243730Srwatsonif test "$lt_cv_path_NM" != "no"; then
3446243730Srwatson  NM="$lt_cv_path_NM"
3447243730Srwatsonelse
3448243730Srwatson  # Didn't find any BSD compatible name lister, look for dumpbin.
3449243730Srwatson  if test -n "$DUMPBIN"; then :
3450243730Srwatson    # Let the user override the test.
3451243730Srwatson  else
3452243730Srwatson    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3453243730Srwatson    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
3454243730Srwatson    *COFF*)
3455243730Srwatson      DUMPBIN="$DUMPBIN -symbols"
3456243730Srwatson      ;;
3457243730Srwatson    *)
3458243730Srwatson      DUMPBIN=:
3459243730Srwatson      ;;
3460243730Srwatson    esac
3461243730Srwatson  fi
3462243730Srwatson  AC_SUBST([DUMPBIN])
3463243730Srwatson  if test "$DUMPBIN" != ":"; then
3464243730Srwatson    NM="$DUMPBIN"
3465243730Srwatson  fi
3466243730Srwatsonfi
3467243730Srwatsontest -z "$NM" && NM=nm
3468243730SrwatsonAC_SUBST([NM])
3469243730Srwatson_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3470243730Srwatson
3471243730SrwatsonAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3472243730Srwatson  [lt_cv_nm_interface="BSD nm"
3473243730Srwatson  echo "int some_variable = 0;" > conftest.$ac_ext
3474243730Srwatson  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3475243730Srwatson  (eval "$ac_compile" 2>conftest.err)
3476243730Srwatson  cat conftest.err >&AS_MESSAGE_LOG_FD
3477243730Srwatson  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3478243730Srwatson  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3479243730Srwatson  cat conftest.err >&AS_MESSAGE_LOG_FD
3480243730Srwatson  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3481243730Srwatson  cat conftest.out >&AS_MESSAGE_LOG_FD
3482243730Srwatson  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3483243730Srwatson    lt_cv_nm_interface="MS dumpbin"
3484243730Srwatson  fi
3485243730Srwatson  rm -f conftest*])
3486243730Srwatson])# LT_PATH_NM
3487243730Srwatson
3488243730Srwatson# Old names:
3489243730SrwatsonAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3490243730SrwatsonAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3491243730Srwatsondnl aclocal-1.4 backwards compatibility:
3492243730Srwatsondnl AC_DEFUN([AM_PROG_NM], [])
3493243730Srwatsondnl AC_DEFUN([AC_PROG_NM], [])
3494243730Srwatson
3495243730Srwatson# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3496243730Srwatson# --------------------------------
3497243730Srwatson# how to determine the name of the shared library
3498243730Srwatson# associated with a specific link library.
3499243730Srwatson#  -- PORTME fill in with the dynamic library characteristics
3500243730Srwatsonm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3501243730Srwatson[m4_require([_LT_DECL_EGREP])
3502243730Srwatsonm4_require([_LT_DECL_OBJDUMP])
3503243730Srwatsonm4_require([_LT_DECL_DLLTOOL])
3504243730SrwatsonAC_CACHE_CHECK([how to associate runtime and link libraries],
3505243730Srwatsonlt_cv_sharedlib_from_linklib_cmd,
3506243730Srwatson[lt_cv_sharedlib_from_linklib_cmd='unknown'
3507243730Srwatson
3508243730Srwatsoncase $host_os in
3509243730Srwatsoncygwin* | mingw* | pw32* | cegcc*)
3510243730Srwatson  # two different shell functions defined in ltmain.sh
3511243730Srwatson  # decide which to use based on capabilities of $DLLTOOL
3512243730Srwatson  case `$DLLTOOL --help 2>&1` in
3513243730Srwatson  *--identify-strict*)
3514243730Srwatson    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3515243730Srwatson    ;;
3516243730Srwatson  *)
3517243730Srwatson    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3518243730Srwatson    ;;
3519243730Srwatson  esac
3520243730Srwatson  ;;
3521243730Srwatson*)
3522243730Srwatson  # fallback: assume linklib IS sharedlib
3523243730Srwatson  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
3524243730Srwatson  ;;
3525243730Srwatsonesac
3526243730Srwatson])
3527243730Srwatsonsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3528243730Srwatsontest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3529243730Srwatson
3530243730Srwatson_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3531243730Srwatson    [Command to associate shared and link libraries])
3532243730Srwatson])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3533243730Srwatson
3534243730Srwatson
3535243730Srwatson# _LT_PATH_MANIFEST_TOOL
3536243730Srwatson# ----------------------
3537243730Srwatson# locate the manifest tool
3538243730Srwatsonm4_defun([_LT_PATH_MANIFEST_TOOL],
3539243730Srwatson[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3540243730Srwatsontest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3541243730SrwatsonAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3542243730Srwatson  [lt_cv_path_mainfest_tool=no
3543243730Srwatson  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3544243730Srwatson  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3545243730Srwatson  cat conftest.err >&AS_MESSAGE_LOG_FD
3546243730Srwatson  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3547243730Srwatson    lt_cv_path_mainfest_tool=yes
3548243730Srwatson  fi
3549243730Srwatson  rm -f conftest*])
3550243730Srwatsonif test "x$lt_cv_path_mainfest_tool" != xyes; then
3551243730Srwatson  MANIFEST_TOOL=:
3552243730Srwatsonfi
3553243730Srwatson_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3554243730Srwatson])# _LT_PATH_MANIFEST_TOOL
3555243730Srwatson
3556243730Srwatson
3557243730Srwatson# LT_LIB_M
3558243730Srwatson# --------
3559243730Srwatson# check for math library
3560243730SrwatsonAC_DEFUN([LT_LIB_M],
3561243730Srwatson[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3562243730SrwatsonLIBM=
3563243730Srwatsoncase $host in
3564243730Srwatson*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3565243730Srwatson  # These system don't have libm, or don't need it
3566243730Srwatson  ;;
3567243730Srwatson*-ncr-sysv4.3*)
3568243730Srwatson  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3569243730Srwatson  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3570243730Srwatson  ;;
3571243730Srwatson*)
3572243730Srwatson  AC_CHECK_LIB(m, cos, LIBM="-lm")
3573243730Srwatson  ;;
3574243730Srwatsonesac
3575243730SrwatsonAC_SUBST([LIBM])
3576243730Srwatson])# LT_LIB_M
3577243730Srwatson
3578243730Srwatson# Old name:
3579243730SrwatsonAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3580243730Srwatsondnl aclocal-1.4 backwards compatibility:
3581243730Srwatsondnl AC_DEFUN([AC_CHECK_LIBM], [])
3582243730Srwatson
3583243730Srwatson
3584243730Srwatson# _LT_COMPILER_NO_RTTI([TAGNAME])
3585243730Srwatson# -------------------------------
3586243730Srwatsonm4_defun([_LT_COMPILER_NO_RTTI],
3587243730Srwatson[m4_require([_LT_TAG_COMPILER])dnl
3588243730Srwatson
3589243730Srwatson_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3590243730Srwatson
3591243730Srwatsonif test "$GCC" = yes; then
3592243730Srwatson  case $cc_basename in
3593243730Srwatson  nvcc*)
3594243730Srwatson    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3595243730Srwatson  *)
3596243730Srwatson    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
3597243730Srwatson  esac
3598243730Srwatson
3599243730Srwatson  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3600243730Srwatson    lt_cv_prog_compiler_rtti_exceptions,
3601243730Srwatson    [-fno-rtti -fno-exceptions], [],
3602243730Srwatson    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3603243730Srwatsonfi
3604243730Srwatson_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3605243730Srwatson	[Compiler flag to turn off builtin functions])
3606243730Srwatson])# _LT_COMPILER_NO_RTTI
3607243730Srwatson
3608243730Srwatson
3609243730Srwatson# _LT_CMD_GLOBAL_SYMBOLS
3610243730Srwatson# ----------------------
3611243730Srwatsonm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3612243730Srwatson[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3613243730SrwatsonAC_REQUIRE([AC_PROG_CC])dnl
3614243730SrwatsonAC_REQUIRE([AC_PROG_AWK])dnl
3615243730SrwatsonAC_REQUIRE([LT_PATH_NM])dnl
3616243730SrwatsonAC_REQUIRE([LT_PATH_LD])dnl
3617243730Srwatsonm4_require([_LT_DECL_SED])dnl
3618243730Srwatsonm4_require([_LT_DECL_EGREP])dnl
3619243730Srwatsonm4_require([_LT_TAG_COMPILER])dnl
3620243730Srwatson
3621243730Srwatson# Check for command to grab the raw symbol name followed by C symbol from nm.
3622243730SrwatsonAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3623243730SrwatsonAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3624243730Srwatson[
3625243730Srwatson# These are sane defaults that work on at least a few old systems.
3626243730Srwatson# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3627243730Srwatson
3628243730Srwatson# Character class describing NM global symbol codes.
3629243730Srwatsonsymcode='[[BCDEGRST]]'
3630243730Srwatson
3631243730Srwatson# Regexp to match symbols that can be accessed directly from C.
3632243730Srwatsonsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3633243730Srwatson
3634243730Srwatson# Define system-specific variables.
3635243730Srwatsoncase $host_os in
3636243730Srwatsonaix*)
3637243730Srwatson  symcode='[[BCDT]]'
3638243730Srwatson  ;;
3639243730Srwatsoncygwin* | mingw* | pw32* | cegcc*)
3640243730Srwatson  symcode='[[ABCDGISTW]]'
3641243730Srwatson  ;;
3642243730Srwatsonhpux*)
3643243730Srwatson  if test "$host_cpu" = ia64; then
3644243730Srwatson    symcode='[[ABCDEGRST]]'
3645243730Srwatson  fi
3646243730Srwatson  ;;
3647243730Srwatsonirix* | nonstopux*)
3648243730Srwatson  symcode='[[BCDEGRST]]'
3649243730Srwatson  ;;
3650243730Srwatsonosf*)
3651243730Srwatson  symcode='[[BCDEGQRST]]'
3652243730Srwatson  ;;
3653243730Srwatsonsolaris*)
3654243730Srwatson  symcode='[[BDRT]]'
3655243730Srwatson  ;;
3656243730Srwatsonsco3.2v5*)
3657243730Srwatson  symcode='[[DT]]'
3658243730Srwatson  ;;
3659243730Srwatsonsysv4.2uw2*)
3660243730Srwatson  symcode='[[DT]]'
3661243730Srwatson  ;;
3662243730Srwatsonsysv5* | sco5v6* | unixware* | OpenUNIX*)
3663243730Srwatson  symcode='[[ABDT]]'
3664243730Srwatson  ;;
3665243730Srwatsonsysv4)
3666243730Srwatson  symcode='[[DFNSTU]]'
3667243730Srwatson  ;;
3668243730Srwatsonesac
3669243730Srwatson
3670243730Srwatson# If we're using GNU nm, then use its standard symbol codes.
3671243730Srwatsoncase `$NM -V 2>&1` in
3672243730Srwatson*GNU* | *'with BFD'*)
3673243730Srwatson  symcode='[[ABCDGIRSTW]]' ;;
3674243730Srwatsonesac
3675243730Srwatson
3676243730Srwatson# Transform an extracted symbol line into a proper C declaration.
3677243730Srwatson# Some systems (esp. on ia64) link data and code symbols differently,
3678243730Srwatson# so use this general approach.
3679243730Srwatsonlt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3680243730Srwatson
3681243730Srwatson# Transform an extracted symbol line into symbol name and symbol address
3682243730Srwatsonlt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
3683243730Srwatsonlt_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'"
3684243730Srwatson
3685243730Srwatson# Handle CRLF in mingw tool chain
3686243730Srwatsonopt_cr=
3687243730Srwatsoncase $build_os in
3688243730Srwatsonmingw*)
3689243730Srwatson  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3690243730Srwatson  ;;
3691243730Srwatsonesac
3692243730Srwatson
3693243730Srwatson# Try without a prefix underscore, then with it.
3694243730Srwatsonfor ac_symprfx in "" "_"; do
3695243730Srwatson
3696243730Srwatson  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3697243730Srwatson  symxfrm="\\1 $ac_symprfx\\2 \\2"
3698243730Srwatson
3699243730Srwatson  # Write the raw and C identifiers.
3700243730Srwatson  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3701243730Srwatson    # Fake it for dumpbin and say T for any non-static function
3702243730Srwatson    # and D for any global variable.
3703243730Srwatson    # Also find C++ and __fastcall symbols from MSVC++,
3704243730Srwatson    # which start with @ or ?.
3705243730Srwatson    lt_cv_sys_global_symbol_pipe="$AWK ['"\
3706243730Srwatson"     {last_section=section; section=\$ 3};"\
3707243730Srwatson"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
3708243730Srwatson"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3709243730Srwatson"     \$ 0!~/External *\|/{next};"\
3710243730Srwatson"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3711243730Srwatson"     {if(hide[section]) next};"\
3712243730Srwatson"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3713243730Srwatson"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3714243730Srwatson"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
3715243730Srwatson"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3716243730Srwatson"     ' prfx=^$ac_symprfx]"
3717243730Srwatson  else
3718243730Srwatson    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
3719243730Srwatson  fi
3720243730Srwatson  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
3721243730Srwatson
3722243730Srwatson  # Check to see that the pipe works correctly.
3723243730Srwatson  pipe_works=no
3724243730Srwatson
3725243730Srwatson  rm -f conftest*
3726243730Srwatson  cat > conftest.$ac_ext <<_LT_EOF
3727243730Srwatson#ifdef __cplusplus
3728243730Srwatsonextern "C" {
3729243730Srwatson#endif
3730243730Srwatsonchar nm_test_var;
3731243730Srwatsonvoid nm_test_func(void);
3732243730Srwatsonvoid nm_test_func(void){}
3733243730Srwatson#ifdef __cplusplus
3734243730Srwatson}
3735243730Srwatson#endif
3736243730Srwatsonint main(){nm_test_var='a';nm_test_func();return(0);}
3737243730Srwatson_LT_EOF
3738243730Srwatson
3739243730Srwatson  if AC_TRY_EVAL(ac_compile); then
3740243730Srwatson    # Now try to grab the symbols.
3741243730Srwatson    nlist=conftest.nm
3742243730Srwatson    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
3743243730Srwatson      # Try sorting and uniquifying the output.
3744243730Srwatson      if sort "$nlist" | uniq > "$nlist"T; then
3745243730Srwatson	mv -f "$nlist"T "$nlist"
3746243730Srwatson      else
3747243730Srwatson	rm -f "$nlist"T
3748243730Srwatson      fi
3749243730Srwatson
3750243730Srwatson      # Make sure that we snagged all the symbols we need.
3751243730Srwatson      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3752243730Srwatson	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3753243730Srwatson	  cat <<_LT_EOF > conftest.$ac_ext
3754243730Srwatson/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
3755243730Srwatson#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3756243730Srwatson/* DATA imports from DLLs on WIN32 con't be const, because runtime
3757243730Srwatson   relocations are performed -- see ld's documentation on pseudo-relocs.  */
3758243730Srwatson# define LT@&t@_DLSYM_CONST
3759243730Srwatson#elif defined(__osf__)
3760243730Srwatson/* This system does not cope well with relocations in const data.  */
3761243730Srwatson# define LT@&t@_DLSYM_CONST
3762243730Srwatson#else
3763243730Srwatson# define LT@&t@_DLSYM_CONST const
3764243730Srwatson#endif
3765243730Srwatson
3766243730Srwatson#ifdef __cplusplus
3767243730Srwatsonextern "C" {
3768243730Srwatson#endif
3769243730Srwatson
3770243730Srwatson_LT_EOF
3771243730Srwatson	  # Now generate the symbol file.
3772243730Srwatson	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3773243730Srwatson
3774243730Srwatson	  cat <<_LT_EOF >> conftest.$ac_ext
3775243730Srwatson
3776243730Srwatson/* The mapping between symbol names and symbols.  */
3777243730SrwatsonLT@&t@_DLSYM_CONST struct {
3778243730Srwatson  const char *name;
3779243730Srwatson  void       *address;
3780243730Srwatson}
3781243730Srwatsonlt__PROGRAM__LTX_preloaded_symbols[[]] =
3782243730Srwatson{
3783243730Srwatson  { "@PROGRAM@", (void *) 0 },
3784243730Srwatson_LT_EOF
3785243730Srwatson	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3786243730Srwatson	  cat <<\_LT_EOF >> conftest.$ac_ext
3787243730Srwatson  {0, (void *) 0}
3788243730Srwatson};
3789243730Srwatson
3790243730Srwatson/* This works around a problem in FreeBSD linker */
3791243730Srwatson#ifdef FREEBSD_WORKAROUND
3792243730Srwatsonstatic const void *lt_preloaded_setup() {
3793243730Srwatson  return lt__PROGRAM__LTX_preloaded_symbols;
3794243730Srwatson}
3795243730Srwatson#endif
3796243730Srwatson
3797243730Srwatson#ifdef __cplusplus
3798243730Srwatson}
3799243730Srwatson#endif
3800243730Srwatson_LT_EOF
3801243730Srwatson	  # Now try linking the two files.
3802243730Srwatson	  mv conftest.$ac_objext conftstm.$ac_objext
3803243730Srwatson	  lt_globsym_save_LIBS=$LIBS
3804243730Srwatson	  lt_globsym_save_CFLAGS=$CFLAGS
3805243730Srwatson	  LIBS="conftstm.$ac_objext"
3806243730Srwatson	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3807243730Srwatson	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3808243730Srwatson	    pipe_works=yes
3809243730Srwatson	  fi
3810243730Srwatson	  LIBS=$lt_globsym_save_LIBS
3811243730Srwatson	  CFLAGS=$lt_globsym_save_CFLAGS
3812243730Srwatson	else
3813243730Srwatson	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3814243730Srwatson	fi
3815243730Srwatson      else
3816243730Srwatson	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3817243730Srwatson      fi
3818243730Srwatson    else
3819243730Srwatson      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3820243730Srwatson    fi
3821243730Srwatson  else
3822243730Srwatson    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3823243730Srwatson    cat conftest.$ac_ext >&5
3824243730Srwatson  fi
3825243730Srwatson  rm -rf conftest* conftst*
3826243730Srwatson
3827243730Srwatson  # Do not use the global_symbol_pipe unless it works.
3828243730Srwatson  if test "$pipe_works" = yes; then
3829243730Srwatson    break
3830243730Srwatson  else
3831243730Srwatson    lt_cv_sys_global_symbol_pipe=
3832243730Srwatson  fi
3833243730Srwatsondone
3834243730Srwatson])
3835243730Srwatsonif test -z "$lt_cv_sys_global_symbol_pipe"; then
3836243730Srwatson  lt_cv_sys_global_symbol_to_cdecl=
3837243730Srwatsonfi
3838243730Srwatsonif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3839243730Srwatson  AC_MSG_RESULT(failed)
3840243730Srwatsonelse
3841243730Srwatson  AC_MSG_RESULT(ok)
3842243730Srwatsonfi
3843243730Srwatson
3844243730Srwatson# Response file support.
3845243730Srwatsonif test "$lt_cv_nm_interface" = "MS dumpbin"; then
3846243730Srwatson  nm_file_list_spec='@'
3847243730Srwatsonelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
3848243730Srwatson  nm_file_list_spec='@'
3849243730Srwatsonfi
3850243730Srwatson
3851243730Srwatson_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3852243730Srwatson    [Take the output of nm and produce a listing of raw symbols and C names])
3853243730Srwatson_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3854243730Srwatson    [Transform the output of nm in a proper C declaration])
3855243730Srwatson_LT_DECL([global_symbol_to_c_name_address],
3856243730Srwatson    [lt_cv_sys_global_symbol_to_c_name_address], [1],
3857243730Srwatson    [Transform the output of nm in a C name address pair])
3858243730Srwatson_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3859243730Srwatson    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3860243730Srwatson    [Transform the output of nm in a C name address pair when lib prefix is needed])
3861243730Srwatson_LT_DECL([], [nm_file_list_spec], [1],
3862243730Srwatson    [Specify filename containing input files for $NM])
3863243730Srwatson]) # _LT_CMD_GLOBAL_SYMBOLS
3864243730Srwatson
3865243730Srwatson
3866243730Srwatson# _LT_COMPILER_PIC([TAGNAME])
3867243730Srwatson# ---------------------------
3868243730Srwatsonm4_defun([_LT_COMPILER_PIC],
3869243730Srwatson[m4_require([_LT_TAG_COMPILER])dnl
3870243730Srwatson_LT_TAGVAR(lt_prog_compiler_wl, $1)=
3871243730Srwatson_LT_TAGVAR(lt_prog_compiler_pic, $1)=
3872243730Srwatson_LT_TAGVAR(lt_prog_compiler_static, $1)=
3873243730Srwatson
3874243730Srwatsonm4_if([$1], [CXX], [
3875243730Srwatson  # C++ specific cases for pic, static, wl, etc.
3876243730Srwatson  if test "$GXX" = yes; then
3877243730Srwatson    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3878243730Srwatson    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3879243730Srwatson
3880243730Srwatson    case $host_os in
3881243730Srwatson    aix*)
3882243730Srwatson      # All AIX code is PIC.
3883243730Srwatson      if test "$host_cpu" = ia64; then
3884243730Srwatson	# AIX 5 now supports IA64 processor
3885243730Srwatson	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3886243730Srwatson      fi
3887243730Srwatson      ;;
3888243730Srwatson
3889243730Srwatson    amigaos*)
3890243730Srwatson      case $host_cpu in
3891243730Srwatson      powerpc)
3892243730Srwatson            # see comment about AmigaOS4 .so support
3893243730Srwatson            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3894243730Srwatson        ;;
3895243730Srwatson      m68k)
3896243730Srwatson            # FIXME: we need at least 68020 code to build shared libraries, but
3897243730Srwatson            # adding the `-m68020' flag to GCC prevents building anything better,
3898243730Srwatson            # like `-m68040'.
3899243730Srwatson            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3900243730Srwatson        ;;
3901243730Srwatson      esac
3902243730Srwatson      ;;
3903243730Srwatson
3904243730Srwatson    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3905243730Srwatson      # PIC is the default for these OSes.
3906243730Srwatson      ;;
3907243730Srwatson    mingw* | cygwin* | os2* | pw32* | cegcc*)
3908243730Srwatson      # This hack is so that the source file can tell whether it is being
3909243730Srwatson      # built for inclusion in a dll (and should export symbols for example).
3910243730Srwatson      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3911243730Srwatson      # (--disable-auto-import) libraries
3912243730Srwatson      m4_if([$1], [GCJ], [],
3913243730Srwatson	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3914243730Srwatson      ;;
3915243730Srwatson    darwin* | rhapsody*)
3916243730Srwatson      # PIC is the default on this platform
3917243730Srwatson      # Common symbols not allowed in MH_DYLIB files
3918243730Srwatson      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3919243730Srwatson      ;;
3920243730Srwatson    *djgpp*)
3921243730Srwatson      # DJGPP does not support shared libraries at all
3922243730Srwatson      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3923243730Srwatson      ;;
3924243730Srwatson    haiku*)
3925243730Srwatson      # PIC is the default for Haiku.
3926243730Srwatson      # The "-static" flag exists, but is broken.
3927243730Srwatson      _LT_TAGVAR(lt_prog_compiler_static, $1)=
3928243730Srwatson      ;;
3929243730Srwatson    interix[[3-9]]*)
3930243730Srwatson      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3931243730Srwatson      # Instead, we relocate shared libraries at runtime.
3932243730Srwatson      ;;
3933243730Srwatson    sysv4*MP*)
3934243730Srwatson      if test -d /usr/nec; then
3935243730Srwatson	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3936243730Srwatson      fi
3937243730Srwatson      ;;
3938243730Srwatson    hpux*)
3939243730Srwatson      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3940243730Srwatson      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3941243730Srwatson      # sets the default TLS model and affects inlining.
3942243730Srwatson      case $host_cpu in
3943243730Srwatson      hppa*64*)
3944243730Srwatson	;;
3945243730Srwatson      *)
3946243730Srwatson	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3947243730Srwatson	;;
3948243730Srwatson      esac
3949243730Srwatson      ;;
3950243730Srwatson    *qnx* | *nto*)
3951243730Srwatson      # QNX uses GNU C++, but need to define -shared option too, otherwise
3952243730Srwatson      # it will coredump.
3953243730Srwatson      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3954243730Srwatson      ;;
3955243730Srwatson    *)
3956243730Srwatson      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3957243730Srwatson      ;;
3958243730Srwatson    esac
3959243730Srwatson  else
3960243730Srwatson    case $host_os in
3961243730Srwatson      aix[[4-9]]*)
3962243730Srwatson	# All AIX code is PIC.
3963243730Srwatson	if test "$host_cpu" = ia64; then
3964243730Srwatson	  # AIX 5 now supports IA64 processor
3965243730Srwatson	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3966243730Srwatson	else
3967243730Srwatson	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3968243730Srwatson	fi
3969243730Srwatson	;;
3970243730Srwatson      chorus*)
3971243730Srwatson	case $cc_basename in
3972243730Srwatson	cxch68*)
3973243730Srwatson	  # Green Hills C++ Compiler
3974243730Srwatson	  # _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"
3975243730Srwatson	  ;;
3976243730Srwatson	esac
3977243730Srwatson	;;
3978243730Srwatson      mingw* | cygwin* | os2* | pw32* | cegcc*)
3979243730Srwatson	# This hack is so that the source file can tell whether it is being
3980243730Srwatson	# built for inclusion in a dll (and should export symbols for example).
3981243730Srwatson	m4_if([$1], [GCJ], [],
3982243730Srwatson	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3983243730Srwatson	;;
3984243730Srwatson      dgux*)
3985243730Srwatson	case $cc_basename in
3986243730Srwatson	  ec++*)
3987243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3988243730Srwatson	    ;;
3989243730Srwatson	  ghcx*)
3990243730Srwatson	    # Green Hills C++ Compiler
3991243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3992243730Srwatson	    ;;
3993243730Srwatson	  *)
3994243730Srwatson	    ;;
3995243730Srwatson	esac
3996243730Srwatson	;;
3997243730Srwatson      freebsd* | dragonfly*)
3998243730Srwatson	# FreeBSD uses GNU C++
3999243730Srwatson	;;
4000243730Srwatson      hpux9* | hpux10* | hpux11*)
4001243730Srwatson	case $cc_basename in
4002243730Srwatson	  CC*)
4003243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4004243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4005243730Srwatson	    if test "$host_cpu" != ia64; then
4006243730Srwatson	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4007243730Srwatson	    fi
4008243730Srwatson	    ;;
4009243730Srwatson	  aCC*)
4010243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4011243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4012243730Srwatson	    case $host_cpu in
4013243730Srwatson	    hppa*64*|ia64*)
4014243730Srwatson	      # +Z the default
4015243730Srwatson	      ;;
4016243730Srwatson	    *)
4017243730Srwatson	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4018243730Srwatson	      ;;
4019243730Srwatson	    esac
4020243730Srwatson	    ;;
4021243730Srwatson	  *)
4022243730Srwatson	    ;;
4023243730Srwatson	esac
4024243730Srwatson	;;
4025243730Srwatson      interix*)
4026243730Srwatson	# This is c89, which is MS Visual C++ (no shared libs)
4027243730Srwatson	# Anyone wants to do a port?
4028243730Srwatson	;;
4029243730Srwatson      irix5* | irix6* | nonstopux*)
4030243730Srwatson	case $cc_basename in
4031243730Srwatson	  CC*)
4032243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4033243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4034243730Srwatson	    # CC pic flag -KPIC is the default.
4035243730Srwatson	    ;;
4036243730Srwatson	  *)
4037243730Srwatson	    ;;
4038243730Srwatson	esac
4039243730Srwatson	;;
4040243730Srwatson      linux* | k*bsd*-gnu | kopensolaris*-gnu)
4041243730Srwatson	case $cc_basename in
4042243730Srwatson	  KCC*)
4043243730Srwatson	    # KAI C++ Compiler
4044243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4045243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4046243730Srwatson	    ;;
4047243730Srwatson	  ecpc* )
4048243730Srwatson	    # old Intel C++ for x86_64 which still supported -KPIC.
4049243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4050243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4051243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4052243730Srwatson	    ;;
4053243730Srwatson	  icpc* )
4054243730Srwatson	    # Intel C++, used to be incompatible with GCC.
4055243730Srwatson	    # ICC 10 doesn't accept -KPIC any more.
4056243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4057243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4058243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4059243730Srwatson	    ;;
4060243730Srwatson	  pgCC* | pgcpp*)
4061243730Srwatson	    # Portland Group C++ compiler
4062243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4063243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4064243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4065243730Srwatson	    ;;
4066243730Srwatson	  cxx*)
4067243730Srwatson	    # Compaq C++
4068243730Srwatson	    # Make sure the PIC flag is empty.  It appears that all Alpha
4069243730Srwatson	    # Linux and Compaq Tru64 Unix objects are PIC.
4070243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4071243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4072243730Srwatson	    ;;
4073243730Srwatson	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
4074243730Srwatson	    # IBM XL 8.0, 9.0 on PPC and BlueGene
4075243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4076243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4077243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4078243730Srwatson	    ;;
4079243730Srwatson	  *)
4080243730Srwatson	    case `$CC -V 2>&1 | sed 5q` in
4081243730Srwatson	    *Sun\ C*)
4082243730Srwatson	      # Sun C++ 5.9
4083243730Srwatson	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4084243730Srwatson	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4085243730Srwatson	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4086243730Srwatson	      ;;
4087243730Srwatson	    esac
4088243730Srwatson	    ;;
4089243730Srwatson	esac
4090243730Srwatson	;;
4091243730Srwatson      lynxos*)
4092243730Srwatson	;;
4093243730Srwatson      m88k*)
4094243730Srwatson	;;
4095243730Srwatson      mvs*)
4096243730Srwatson	case $cc_basename in
4097243730Srwatson	  cxx*)
4098243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4099243730Srwatson	    ;;
4100243730Srwatson	  *)
4101243730Srwatson	    ;;
4102243730Srwatson	esac
4103243730Srwatson	;;
4104243730Srwatson      netbsd*)
4105243730Srwatson	;;
4106243730Srwatson      *qnx* | *nto*)
4107243730Srwatson        # QNX uses GNU C++, but need to define -shared option too, otherwise
4108243730Srwatson        # it will coredump.
4109243730Srwatson        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4110243730Srwatson        ;;
4111243730Srwatson      osf3* | osf4* | osf5*)
4112243730Srwatson	case $cc_basename in
4113243730Srwatson	  KCC*)
4114243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4115243730Srwatson	    ;;
4116243730Srwatson	  RCC*)
4117243730Srwatson	    # Rational C++ 2.4.1
4118243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4119243730Srwatson	    ;;
4120243730Srwatson	  cxx*)
4121243730Srwatson	    # Digital/Compaq C++
4122243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4123243730Srwatson	    # Make sure the PIC flag is empty.  It appears that all Alpha
4124243730Srwatson	    # Linux and Compaq Tru64 Unix objects are PIC.
4125243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4126243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4127243730Srwatson	    ;;
4128243730Srwatson	  *)
4129243730Srwatson	    ;;
4130243730Srwatson	esac
4131243730Srwatson	;;
4132243730Srwatson      psos*)
4133243730Srwatson	;;
4134243730Srwatson      solaris*)
4135243730Srwatson	case $cc_basename in
4136243730Srwatson	  CC* | sunCC*)
4137243730Srwatson	    # Sun C++ 4.2, 5.x and Centerline C++
4138243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4139243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4140243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4141243730Srwatson	    ;;
4142243730Srwatson	  gcx*)
4143243730Srwatson	    # Green Hills C++ Compiler
4144243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4145243730Srwatson	    ;;
4146243730Srwatson	  *)
4147243730Srwatson	    ;;
4148243730Srwatson	esac
4149243730Srwatson	;;
4150243730Srwatson      sunos4*)
4151243730Srwatson	case $cc_basename in
4152243730Srwatson	  CC*)
4153243730Srwatson	    # Sun C++ 4.x
4154243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4155243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4156243730Srwatson	    ;;
4157243730Srwatson	  lcc*)
4158243730Srwatson	    # Lucid
4159243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4160243730Srwatson	    ;;
4161243730Srwatson	  *)
4162243730Srwatson	    ;;
4163243730Srwatson	esac
4164243730Srwatson	;;
4165243730Srwatson      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4166243730Srwatson	case $cc_basename in
4167243730Srwatson	  CC*)
4168243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4169243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4170243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4171243730Srwatson	    ;;
4172243730Srwatson	esac
4173243730Srwatson	;;
4174243730Srwatson      tandem*)
4175243730Srwatson	case $cc_basename in
4176243730Srwatson	  NCC*)
4177243730Srwatson	    # NonStop-UX NCC 3.20
4178243730Srwatson	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4179243730Srwatson	    ;;
4180243730Srwatson	  *)
4181243730Srwatson	    ;;
4182243730Srwatson	esac
4183243730Srwatson	;;
4184243730Srwatson      vxworks*)
4185243730Srwatson	;;
4186243730Srwatson      *)
4187243730Srwatson	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4188243730Srwatson	;;
4189243730Srwatson    esac
4190243730Srwatson  fi
4191243730Srwatson],
4192243730Srwatson[
4193243730Srwatson  if test "$GCC" = yes; then
4194243730Srwatson    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4195243730Srwatson    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4196243730Srwatson
4197243730Srwatson    case $host_os in
4198243730Srwatson      aix*)
4199243730Srwatson      # All AIX code is PIC.
4200243730Srwatson      if test "$host_cpu" = ia64; then
4201243730Srwatson	# AIX 5 now supports IA64 processor
4202243730Srwatson	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4203243730Srwatson      fi
4204243730Srwatson      ;;
4205243730Srwatson
4206243730Srwatson    amigaos*)
4207243730Srwatson      case $host_cpu in
4208243730Srwatson      powerpc)
4209243730Srwatson            # see comment about AmigaOS4 .so support
4210243730Srwatson            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4211243730Srwatson        ;;
4212243730Srwatson      m68k)
4213243730Srwatson            # FIXME: we need at least 68020 code to build shared libraries, but
4214243730Srwatson            # adding the `-m68020' flag to GCC prevents building anything better,
4215243730Srwatson            # like `-m68040'.
4216243730Srwatson            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4217243730Srwatson        ;;
4218243730Srwatson      esac
4219243730Srwatson      ;;
4220243730Srwatson
4221243730Srwatson    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4222243730Srwatson      # PIC is the default for these OSes.
4223243730Srwatson      ;;
4224243730Srwatson
4225243730Srwatson    mingw* | cygwin* | pw32* | os2* | cegcc*)
4226243730Srwatson      # This hack is so that the source file can tell whether it is being
4227243730Srwatson      # built for inclusion in a dll (and should export symbols for example).
4228243730Srwatson      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4229243730Srwatson      # (--disable-auto-import) libraries
4230243730Srwatson      m4_if([$1], [GCJ], [],
4231243730Srwatson	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4232243730Srwatson      ;;
4233243730Srwatson
4234243730Srwatson    darwin* | rhapsody*)
4235243730Srwatson      # PIC is the default on this platform
4236243730Srwatson      # Common symbols not allowed in MH_DYLIB files
4237243730Srwatson      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4238243730Srwatson      ;;
4239243730Srwatson
4240243730Srwatson    haiku*)
4241243730Srwatson      # PIC is the default for Haiku.
4242243730Srwatson      # The "-static" flag exists, but is broken.
4243243730Srwatson      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4244243730Srwatson      ;;
4245243730Srwatson
4246243730Srwatson    hpux*)
4247243730Srwatson      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4248243730Srwatson      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4249243730Srwatson      # sets the default TLS model and affects inlining.
4250243730Srwatson      case $host_cpu in
4251243730Srwatson      hppa*64*)
4252243730Srwatson	# +Z the default
4253243730Srwatson	;;
4254243730Srwatson      *)
4255243730Srwatson	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4256243730Srwatson	;;
4257243730Srwatson      esac
4258243730Srwatson      ;;
4259243730Srwatson
4260243730Srwatson    interix[[3-9]]*)
4261243730Srwatson      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4262243730Srwatson      # Instead, we relocate shared libraries at runtime.
4263243730Srwatson      ;;
4264243730Srwatson
4265243730Srwatson    msdosdjgpp*)
4266243730Srwatson      # Just because we use GCC doesn't mean we suddenly get shared libraries
4267243730Srwatson      # on systems that don't support them.
4268243730Srwatson      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4269243730Srwatson      enable_shared=no
4270243730Srwatson      ;;
4271243730Srwatson
4272243730Srwatson    *nto* | *qnx*)
4273243730Srwatson      # QNX uses GNU C++, but need to define -shared option too, otherwise
4274243730Srwatson      # it will coredump.
4275243730Srwatson      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4276243730Srwatson      ;;
4277243730Srwatson
4278243730Srwatson    sysv4*MP*)
4279243730Srwatson      if test -d /usr/nec; then
4280243730Srwatson	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4281243730Srwatson      fi
4282243730Srwatson      ;;
4283243730Srwatson
4284243730Srwatson    *)
4285243730Srwatson      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4286243730Srwatson      ;;
4287243730Srwatson    esac
4288243730Srwatson
4289243730Srwatson    case $cc_basename in
4290243730Srwatson    nvcc*) # Cuda Compiler Driver 2.2
4291243730Srwatson      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4292243730Srwatson      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4293243730Srwatson        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4294243730Srwatson      fi
4295243730Srwatson      ;;
4296243730Srwatson    esac
4297243730Srwatson  else
4298243730Srwatson    # PORTME Check for flag to pass linker flags through the system compiler.
4299243730Srwatson    case $host_os in
4300243730Srwatson    aix*)
4301243730Srwatson      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4302243730Srwatson      if test "$host_cpu" = ia64; then
4303243730Srwatson	# AIX 5 now supports IA64 processor
4304243730Srwatson	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4305243730Srwatson      else
4306243730Srwatson	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4307243730Srwatson      fi
4308243730Srwatson      ;;
4309243730Srwatson
4310243730Srwatson    mingw* | cygwin* | pw32* | os2* | cegcc*)
4311243730Srwatson      # This hack is so that the source file can tell whether it is being
4312243730Srwatson      # built for inclusion in a dll (and should export symbols for example).
4313243730Srwatson      m4_if([$1], [GCJ], [],
4314243730Srwatson	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4315243730Srwatson      ;;
4316243730Srwatson
4317243730Srwatson    hpux9* | hpux10* | hpux11*)
4318243730Srwatson      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4319243730Srwatson      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4320243730Srwatson      # not for PA HP-UX.
4321243730Srwatson      case $host_cpu in
4322243730Srwatson      hppa*64*|ia64*)
4323243730Srwatson	# +Z the default
4324243730Srwatson	;;
4325243730Srwatson      *)
4326243730Srwatson	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4327243730Srwatson	;;
4328243730Srwatson      esac
4329243730Srwatson      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4330243730Srwatson      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4331243730Srwatson      ;;
4332243730Srwatson
4333243730Srwatson    irix5* | irix6* | nonstopux*)
4334243730Srwatson      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4335243730Srwatson      # PIC (with -KPIC) is the default.
4336243730Srwatson      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4337243730Srwatson      ;;
4338243730Srwatson
4339243730Srwatson    linux* | k*bsd*-gnu | kopensolaris*-gnu)
4340243730Srwatson      case $cc_basename in
4341243730Srwatson      # old Intel for x86_64 which still supported -KPIC.
4342243730Srwatson      ecc*)
4343243730Srwatson	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4344243730Srwatson	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4345243730Srwatson	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4346243730Srwatson        ;;
4347243730Srwatson      # icc used to be incompatible with GCC.
4348243730Srwatson      # ICC 10 doesn't accept -KPIC any more.
4349243730Srwatson      icc* | ifort*)
4350243730Srwatson	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4351243730Srwatson	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4352243730Srwatson	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4353243730Srwatson        ;;
4354243730Srwatson      # Lahey Fortran 8.1.
4355243730Srwatson      lf95*)
4356243730Srwatson	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4357243730Srwatson	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4358243730Srwatson	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4359243730Srwatson	;;
4360243730Srwatson      nagfor*)
4361243730Srwatson	# NAG Fortran compiler
4362243730Srwatson	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4363243730Srwatson	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4364243730Srwatson	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4365243730Srwatson	;;
4366243730Srwatson      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4367243730Srwatson        # Portland Group compilers (*not* the Pentium gcc compiler,
4368243730Srwatson	# which looks to be a dead project)
4369243730Srwatson	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4370243730Srwatson	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4371243730Srwatson	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4372243730Srwatson        ;;
4373243730Srwatson      ccc*)
4374243730Srwatson        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4375243730Srwatson        # All Alpha code is PIC.
4376243730Srwatson        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4377243730Srwatson        ;;
4378243730Srwatson      xl* | bgxl* | bgf* | mpixl*)
4379243730Srwatson	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4380243730Srwatson	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4381243730Srwatson	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4382243730Srwatson	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4383243730Srwatson	;;
4384243730Srwatson      *)
4385243730Srwatson	case `$CC -V 2>&1 | sed 5q` in
4386243730Srwatson	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
4387243730Srwatson	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4388243730Srwatson	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4389243730Srwatson	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4390243730Srwatson	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4391243730Srwatson	  ;;
4392243730Srwatson	*Sun\ F* | *Sun*Fortran*)
4393243730Srwatson	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4394243730Srwatson	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4395243730Srwatson	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4396243730Srwatson	  ;;
4397243730Srwatson	*Sun\ C*)
4398243730Srwatson	  # Sun C 5.9
4399243730Srwatson	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4400243730Srwatson	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4401243730Srwatson	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4402243730Srwatson	  ;;
4403243730Srwatson        *Intel*\ [[CF]]*Compiler*)
4404243730Srwatson	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4405243730Srwatson	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4406243730Srwatson	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4407243730Srwatson	  ;;
4408243730Srwatson	*Portland\ Group*)
4409243730Srwatson	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4410243730Srwatson	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4411243730Srwatson	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4412243730Srwatson	  ;;
4413243730Srwatson	esac
4414243730Srwatson	;;
4415243730Srwatson      esac
4416243730Srwatson      ;;
4417243730Srwatson
4418243730Srwatson    newsos6)
4419243730Srwatson      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4420243730Srwatson      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4421243730Srwatson      ;;
4422243730Srwatson
4423243730Srwatson    *nto* | *qnx*)
4424243730Srwatson      # QNX uses GNU C++, but need to define -shared option too, otherwise
4425243730Srwatson      # it will coredump.
4426243730Srwatson      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4427243730Srwatson      ;;
4428243730Srwatson
4429243730Srwatson    osf3* | osf4* | osf5*)
4430243730Srwatson      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4431243730Srwatson      # All OSF/1 code is PIC.
4432243730Srwatson      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4433243730Srwatson      ;;
4434243730Srwatson
4435243730Srwatson    rdos*)
4436243730Srwatson      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4437243730Srwatson      ;;
4438243730Srwatson
4439243730Srwatson    solaris*)
4440243730Srwatson      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4441243730Srwatson      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4442243730Srwatson      case $cc_basename in
4443243730Srwatson      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4444243730Srwatson	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4445243730Srwatson      *)
4446243730Srwatson	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4447243730Srwatson      esac
4448243730Srwatson      ;;
4449243730Srwatson
4450243730Srwatson    sunos4*)
4451243730Srwatson      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4452243730Srwatson      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4453243730Srwatson      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4454243730Srwatson      ;;
4455243730Srwatson
4456243730Srwatson    sysv4 | sysv4.2uw2* | sysv4.3*)
4457243730Srwatson      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4458243730Srwatson      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4459243730Srwatson      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4460243730Srwatson      ;;
4461243730Srwatson
4462243730Srwatson    sysv4*MP*)
4463243730Srwatson      if test -d /usr/nec ;then
4464243730Srwatson	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4465243730Srwatson	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4466243730Srwatson      fi
4467243730Srwatson      ;;
4468243730Srwatson
4469243730Srwatson    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4470243730Srwatson      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4471243730Srwatson      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4472243730Srwatson      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4473243730Srwatson      ;;
4474243730Srwatson
4475243730Srwatson    unicos*)
4476243730Srwatson      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4477243730Srwatson      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4478243730Srwatson      ;;
4479243730Srwatson
4480243730Srwatson    uts4*)
4481243730Srwatson      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4482243730Srwatson      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4483243730Srwatson      ;;
4484243730Srwatson
4485243730Srwatson    *)
4486243730Srwatson      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4487243730Srwatson      ;;
4488243730Srwatson    esac
4489243730Srwatson  fi
4490243730Srwatson])
4491243730Srwatsoncase $host_os in
4492243730Srwatson  # For platforms which do not support PIC, -DPIC is meaningless:
4493243730Srwatson  *djgpp*)
4494243730Srwatson    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4495243730Srwatson    ;;
4496243730Srwatson  *)
4497243730Srwatson    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4498243730Srwatson    ;;
4499243730Srwatsonesac
4500243730Srwatson
4501243730SrwatsonAC_CACHE_CHECK([for $compiler option to produce PIC],
4502243730Srwatson  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4503243730Srwatson  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4504243730Srwatson_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4505243730Srwatson
4506243730Srwatson#
4507243730Srwatson# Check to make sure the PIC flag actually works.
4508243730Srwatson#
4509243730Srwatsonif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4510243730Srwatson  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4511243730Srwatson    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4512243730Srwatson    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4513243730Srwatson    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4514243730Srwatson     "" | " "*) ;;
4515243730Srwatson     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4516243730Srwatson     esac],
4517243730Srwatson    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4518243730Srwatson     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4519243730Srwatsonfi
4520243730Srwatson_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4521243730Srwatson	[Additional compiler flags for building library objects])
4522243730Srwatson
4523243730Srwatson_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4524243730Srwatson	[How to pass a linker flag through the compiler])
4525243730Srwatson#
4526243730Srwatson# Check to make sure the static flag actually works.
4527243730Srwatson#
4528243730Srwatsonwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4529243730Srwatson_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4530243730Srwatson  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4531243730Srwatson  $lt_tmp_static_flag,
4532243730Srwatson  [],
4533243730Srwatson  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4534243730Srwatson_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4535243730Srwatson	[Compiler flag to prevent dynamic linking])
4536243730Srwatson])# _LT_COMPILER_PIC
4537243730Srwatson
4538243730Srwatson
4539243730Srwatson# _LT_LINKER_SHLIBS([TAGNAME])
4540243730Srwatson# ----------------------------
4541243730Srwatson# See if the linker supports building shared libraries.
4542243730Srwatsonm4_defun([_LT_LINKER_SHLIBS],
4543243730Srwatson[AC_REQUIRE([LT_PATH_LD])dnl
4544243730SrwatsonAC_REQUIRE([LT_PATH_NM])dnl
4545243730Srwatsonm4_require([_LT_PATH_MANIFEST_TOOL])dnl
4546243730Srwatsonm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4547243730Srwatsonm4_require([_LT_DECL_EGREP])dnl
4548243730Srwatsonm4_require([_LT_DECL_SED])dnl
4549243730Srwatsonm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4550243730Srwatsonm4_require([_LT_TAG_COMPILER])dnl
4551243730SrwatsonAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4552243730Srwatsonm4_if([$1], [CXX], [
4553243730Srwatson  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4554243730Srwatson  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4555243730Srwatson  case $host_os in
4556243730Srwatson  aix[[4-9]]*)
4557243730Srwatson    # If we're using GNU nm, then we don't want the "-C" option.
4558243730Srwatson    # -C means demangle to AIX nm, but means don't demangle with GNU nm
4559243730Srwatson    # Also, AIX nm treats weak defined symbols like other global defined
4560243730Srwatson    # symbols, whereas GNU nm marks them as "W".
4561243730Srwatson    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4562243730Srwatson      _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'
4563243730Srwatson    else
4564243730Srwatson      _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'
4565243730Srwatson    fi
4566243730Srwatson    ;;
4567243730Srwatson  pw32*)
4568243730Srwatson    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4569243730Srwatson    ;;
4570243730Srwatson  cygwin* | mingw* | cegcc*)
4571243730Srwatson    case $cc_basename in
4572243730Srwatson    cl*)
4573243730Srwatson      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4574243730Srwatson      ;;
4575243730Srwatson    *)
4576243730Srwatson      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4577243730Srwatson      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4578243730Srwatson      ;;
4579243730Srwatson    esac
4580243730Srwatson    ;;
4581243730Srwatson  *)
4582243730Srwatson    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4583243730Srwatson    ;;
4584243730Srwatson  esac
4585243730Srwatson], [
4586243730Srwatson  runpath_var=
4587243730Srwatson  _LT_TAGVAR(allow_undefined_flag, $1)=
4588243730Srwatson  _LT_TAGVAR(always_export_symbols, $1)=no
4589243730Srwatson  _LT_TAGVAR(archive_cmds, $1)=
4590243730Srwatson  _LT_TAGVAR(archive_expsym_cmds, $1)=
4591243730Srwatson  _LT_TAGVAR(compiler_needs_object, $1)=no
4592243730Srwatson  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4593243730Srwatson  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4594243730Srwatson  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4595243730Srwatson  _LT_TAGVAR(hardcode_automatic, $1)=no
4596243730Srwatson  _LT_TAGVAR(hardcode_direct, $1)=no
4597243730Srwatson  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4598243730Srwatson  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4599243730Srwatson  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4600243730Srwatson  _LT_TAGVAR(hardcode_minus_L, $1)=no
4601243730Srwatson  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4602243730Srwatson  _LT_TAGVAR(inherit_rpath, $1)=no
4603243730Srwatson  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4604243730Srwatson  _LT_TAGVAR(module_cmds, $1)=
4605243730Srwatson  _LT_TAGVAR(module_expsym_cmds, $1)=
4606243730Srwatson  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4607243730Srwatson  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4608243730Srwatson  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4609243730Srwatson  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4610243730Srwatson  # include_expsyms should be a list of space-separated symbols to be *always*
4611243730Srwatson  # included in the symbol list
4612243730Srwatson  _LT_TAGVAR(include_expsyms, $1)=
4613243730Srwatson  # exclude_expsyms can be an extended regexp of symbols to exclude
4614243730Srwatson  # it will be wrapped by ` (' and `)$', so one must not match beginning or
4615243730Srwatson  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4616243730Srwatson  # as well as any symbol that contains `d'.
4617243730Srwatson  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4618243730Srwatson  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4619243730Srwatson  # platforms (ab)use it in PIC code, but their linkers get confused if
4620243730Srwatson  # the symbol is explicitly referenced.  Since portable code cannot
4621243730Srwatson  # rely on this symbol name, it's probably fine to never include it in
4622243730Srwatson  # preloaded symbol tables.
4623243730Srwatson  # Exclude shared library initialization/finalization symbols.
4624243730Srwatsondnl Note also adjust exclude_expsyms for C++ above.
4625243730Srwatson  extract_expsyms_cmds=
4626243730Srwatson
4627243730Srwatson  case $host_os in
4628243730Srwatson  cygwin* | mingw* | pw32* | cegcc*)
4629243730Srwatson    # FIXME: the MSVC++ port hasn't been tested in a loooong time
4630243730Srwatson    # When not using gcc, we currently assume that we are using
4631243730Srwatson    # Microsoft Visual C++.
4632243730Srwatson    if test "$GCC" != yes; then
4633243730Srwatson      with_gnu_ld=no
4634243730Srwatson    fi
4635243730Srwatson    ;;
4636243730Srwatson  interix*)
4637243730Srwatson    # we just hope/assume this is gcc and not c89 (= MSVC++)
4638243730Srwatson    with_gnu_ld=yes
4639243730Srwatson    ;;
4640243730Srwatson  openbsd*)
4641243730Srwatson    with_gnu_ld=no
4642243730Srwatson    ;;
4643243730Srwatson  esac
4644243730Srwatson
4645243730Srwatson  _LT_TAGVAR(ld_shlibs, $1)=yes
4646243730Srwatson
4647243730Srwatson  # On some targets, GNU ld is compatible enough with the native linker
4648243730Srwatson  # that we're better off using the native interface for both.
4649243730Srwatson  lt_use_gnu_ld_interface=no
4650243730Srwatson  if test "$with_gnu_ld" = yes; then
4651243730Srwatson    case $host_os in
4652243730Srwatson      aix*)
4653243730Srwatson	# The AIX port of GNU ld has always aspired to compatibility
4654243730Srwatson	# with the native linker.  However, as the warning in the GNU ld
4655243730Srwatson	# block says, versions before 2.19.5* couldn't really create working
4656243730Srwatson	# shared libraries, regardless of the interface used.
4657243730Srwatson	case `$LD -v 2>&1` in
4658243730Srwatson	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
4659243730Srwatson	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
4660243730Srwatson	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
4661243730Srwatson	  *)
4662243730Srwatson	    lt_use_gnu_ld_interface=yes
4663243730Srwatson	    ;;
4664243730Srwatson	esac
4665243730Srwatson	;;
4666243730Srwatson      *)
4667243730Srwatson	lt_use_gnu_ld_interface=yes
4668243730Srwatson	;;
4669243730Srwatson    esac
4670243730Srwatson  fi
4671243730Srwatson
4672243730Srwatson  if test "$lt_use_gnu_ld_interface" = yes; then
4673243730Srwatson    # If archive_cmds runs LD, not CC, wlarc should be empty
4674243730Srwatson    wlarc='${wl}'
4675243730Srwatson
4676243730Srwatson    # Set some defaults for GNU ld with shared library support. These
4677243730Srwatson    # are reset later if shared libraries are not supported. Putting them
4678243730Srwatson    # here allows them to be overridden if necessary.
4679243730Srwatson    runpath_var=LD_RUN_PATH
4680243730Srwatson    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4681243730Srwatson    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4682243730Srwatson    # ancient GNU ld didn't support --whole-archive et. al.
4683243730Srwatson    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4684243730Srwatson      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4685243730Srwatson    else
4686243730Srwatson      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4687243730Srwatson    fi
4688243730Srwatson    supports_anon_versioning=no
4689243730Srwatson    case `$LD -v 2>&1` in
4690243730Srwatson      *GNU\ gold*) supports_anon_versioning=yes ;;
4691243730Srwatson      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4692243730Srwatson      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4693243730Srwatson      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4694243730Srwatson      *\ 2.11.*) ;; # other 2.11 versions
4695243730Srwatson      *) supports_anon_versioning=yes ;;
4696243730Srwatson    esac
4697243730Srwatson
4698243730Srwatson    # See if GNU ld supports shared libraries.
4699243730Srwatson    case $host_os in
4700243730Srwatson    aix[[3-9]]*)
4701243730Srwatson      # On AIX/PPC, the GNU linker is very broken
4702243730Srwatson      if test "$host_cpu" != ia64; then
4703243730Srwatson	_LT_TAGVAR(ld_shlibs, $1)=no
4704243730Srwatson	cat <<_LT_EOF 1>&2
4705243730Srwatson
4706243730Srwatson*** Warning: the GNU linker, at least up to release 2.19, is reported
4707243730Srwatson*** to be unable to reliably create shared libraries on AIX.
4708243730Srwatson*** Therefore, libtool is disabling shared libraries support.  If you
4709243730Srwatson*** really care for shared libraries, you may want to install binutils
4710243730Srwatson*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
4711243730Srwatson*** You will then need to restart the configuration process.
4712243730Srwatson
4713243730Srwatson_LT_EOF
4714243730Srwatson      fi
4715243730Srwatson      ;;
4716243730Srwatson
4717243730Srwatson    amigaos*)
4718243730Srwatson      case $host_cpu in
4719243730Srwatson      powerpc)
4720243730Srwatson            # see comment about AmigaOS4 .so support
4721243730Srwatson            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4722243730Srwatson            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4723243730Srwatson        ;;
4724243730Srwatson      m68k)
4725243730Srwatson            _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)'
4726243730Srwatson            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4727243730Srwatson            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4728243730Srwatson        ;;
4729243730Srwatson      esac
4730243730Srwatson      ;;
4731243730Srwatson
4732243730Srwatson    beos*)
4733243730Srwatson      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4734243730Srwatson	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4735243730Srwatson	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4736243730Srwatson	# support --undefined.  This deserves some investigation.  FIXME
4737243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4738243730Srwatson      else
4739243730Srwatson	_LT_TAGVAR(ld_shlibs, $1)=no
4740243730Srwatson      fi
4741243730Srwatson      ;;
4742243730Srwatson
4743243730Srwatson    cygwin* | mingw* | pw32* | cegcc*)
4744243730Srwatson      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4745243730Srwatson      # as there is no search path for DLLs.
4746243730Srwatson      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4747243730Srwatson      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
4748243730Srwatson      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4749243730Srwatson      _LT_TAGVAR(always_export_symbols, $1)=no
4750243730Srwatson      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4751243730Srwatson      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4752243730Srwatson      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4753243730Srwatson
4754243730Srwatson      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4755243730Srwatson        _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'
4756243730Srwatson	# If the export-symbols file already is a .def file (1st line
4757243730Srwatson	# is EXPORTS), use it as is; otherwise, prepend...
4758243730Srwatson	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4759243730Srwatson	  cp $export_symbols $output_objdir/$soname.def;
4760243730Srwatson	else
4761243730Srwatson	  echo EXPORTS > $output_objdir/$soname.def;
4762243730Srwatson	  cat $export_symbols >> $output_objdir/$soname.def;
4763243730Srwatson	fi~
4764243730Srwatson	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4765243730Srwatson      else
4766243730Srwatson	_LT_TAGVAR(ld_shlibs, $1)=no
4767243730Srwatson      fi
4768243730Srwatson      ;;
4769243730Srwatson
4770243730Srwatson    haiku*)
4771243730Srwatson      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4772243730Srwatson      _LT_TAGVAR(link_all_deplibs, $1)=yes
4773243730Srwatson      ;;
4774243730Srwatson
4775243730Srwatson    interix[[3-9]]*)
4776243730Srwatson      _LT_TAGVAR(hardcode_direct, $1)=no
4777243730Srwatson      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4778243730Srwatson      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4779243730Srwatson      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4780243730Srwatson      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4781243730Srwatson      # Instead, shared libraries are loaded at an image base (0x10000000 by
4782243730Srwatson      # default) and relocated if they conflict, which is a slow very memory
4783243730Srwatson      # consuming and fragmenting process.  To avoid this, we pick a random,
4784243730Srwatson      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4785243730Srwatson      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
4786243730Srwatson      _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'
4787243730Srwatson      _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'
4788243730Srwatson      ;;
4789243730Srwatson
4790243730Srwatson    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
4791243730Srwatson      tmp_diet=no
4792243730Srwatson      if test "$host_os" = linux-dietlibc; then
4793243730Srwatson	case $cc_basename in
4794243730Srwatson	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
4795243730Srwatson	esac
4796243730Srwatson      fi
4797243730Srwatson      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4798243730Srwatson	 && test "$tmp_diet" = no
4799243730Srwatson      then
4800243730Srwatson	tmp_addflag=' $pic_flag'
4801243730Srwatson	tmp_sharedflag='-shared'
4802243730Srwatson	case $cc_basename,$host_cpu in
4803243730Srwatson        pgcc*)				# Portland Group C compiler
4804243730Srwatson	  _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'
4805243730Srwatson	  tmp_addflag=' $pic_flag'
4806243730Srwatson	  ;;
4807243730Srwatson	pgf77* | pgf90* | pgf95* | pgfortran*)
4808243730Srwatson					# Portland Group f77 and f90 compilers
4809243730Srwatson	  _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'
4810243730Srwatson	  tmp_addflag=' $pic_flag -Mnomain' ;;
4811243730Srwatson	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
4812243730Srwatson	  tmp_addflag=' -i_dynamic' ;;
4813243730Srwatson	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
4814243730Srwatson	  tmp_addflag=' -i_dynamic -nofor_main' ;;
4815243730Srwatson	ifc* | ifort*)			# Intel Fortran compiler
4816243730Srwatson	  tmp_addflag=' -nofor_main' ;;
4817243730Srwatson	lf95*)				# Lahey Fortran 8.1
4818243730Srwatson	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4819243730Srwatson	  tmp_sharedflag='--shared' ;;
4820243730Srwatson	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
4821243730Srwatson	  tmp_sharedflag='-qmkshrobj'
4822243730Srwatson	  tmp_addflag= ;;
4823243730Srwatson	nvcc*)	# Cuda Compiler Driver 2.2
4824243730Srwatson	  _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'
4825243730Srwatson	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4826243730Srwatson	  ;;
4827243730Srwatson	esac
4828243730Srwatson	case `$CC -V 2>&1 | sed 5q` in
4829243730Srwatson	*Sun\ C*)			# Sun C 5.9
4830243730Srwatson	  _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'
4831243730Srwatson	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4832243730Srwatson	  tmp_sharedflag='-G' ;;
4833243730Srwatson	*Sun\ F*)			# Sun Fortran 8.3
4834243730Srwatson	  tmp_sharedflag='-G' ;;
4835243730Srwatson	esac
4836243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4837243730Srwatson
4838243730Srwatson        if test "x$supports_anon_versioning" = xyes; then
4839243730Srwatson          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4840243730Srwatson	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4841243730Srwatson	    echo "local: *; };" >> $output_objdir/$libname.ver~
4842243730Srwatson	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4843243730Srwatson        fi
4844243730Srwatson
4845243730Srwatson	case $cc_basename in
4846243730Srwatson	xlf* | bgf* | bgxlf* | mpixlf*)
4847243730Srwatson	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4848243730Srwatson	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4849243730Srwatson	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4850243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
4851243730Srwatson	  if test "x$supports_anon_versioning" = xyes; then
4852243730Srwatson	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4853243730Srwatson	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4854243730Srwatson	      echo "local: *; };" >> $output_objdir/$libname.ver~
4855243730Srwatson	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4856243730Srwatson	  fi
4857243730Srwatson	  ;;
4858243730Srwatson	esac
4859243730Srwatson      else
4860243730Srwatson        _LT_TAGVAR(ld_shlibs, $1)=no
4861243730Srwatson      fi
4862243730Srwatson      ;;
4863243730Srwatson
4864243730Srwatson    netbsd*)
4865243730Srwatson      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4866243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4867243730Srwatson	wlarc=
4868243730Srwatson      else
4869243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4870243730Srwatson	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4871243730Srwatson      fi
4872243730Srwatson      ;;
4873243730Srwatson
4874243730Srwatson    solaris*)
4875243730Srwatson      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4876243730Srwatson	_LT_TAGVAR(ld_shlibs, $1)=no
4877243730Srwatson	cat <<_LT_EOF 1>&2
4878243730Srwatson
4879243730Srwatson*** Warning: The releases 2.8.* of the GNU linker cannot reliably
4880243730Srwatson*** create shared libraries on Solaris systems.  Therefore, libtool
4881243730Srwatson*** is disabling shared libraries support.  We urge you to upgrade GNU
4882243730Srwatson*** binutils to release 2.9.1 or newer.  Another option is to modify
4883243730Srwatson*** your PATH or compiler configuration so that the native linker is
4884243730Srwatson*** used, and then restart.
4885243730Srwatson
4886243730Srwatson_LT_EOF
4887243730Srwatson      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4888243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4889243730Srwatson	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4890243730Srwatson      else
4891243730Srwatson	_LT_TAGVAR(ld_shlibs, $1)=no
4892243730Srwatson      fi
4893243730Srwatson      ;;
4894243730Srwatson
4895243730Srwatson    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4896243730Srwatson      case `$LD -v 2>&1` in
4897243730Srwatson        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4898243730Srwatson	_LT_TAGVAR(ld_shlibs, $1)=no
4899243730Srwatson	cat <<_LT_EOF 1>&2
4900243730Srwatson
4901243730Srwatson*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4902243730Srwatson*** reliably create shared libraries on SCO systems.  Therefore, libtool
4903243730Srwatson*** is disabling shared libraries support.  We urge you to upgrade GNU
4904243730Srwatson*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
4905243730Srwatson*** your PATH or compiler configuration so that the native linker is
4906243730Srwatson*** used, and then restart.
4907243730Srwatson
4908243730Srwatson_LT_EOF
4909243730Srwatson	;;
4910243730Srwatson	*)
4911243730Srwatson	  # For security reasons, it is highly recommended that you always
4912243730Srwatson	  # use absolute paths for naming shared libraries, and exclude the
4913243730Srwatson	  # DT_RUNPATH tag from executables and libraries.  But doing so
4914243730Srwatson	  # requires that you compile everything twice, which is a pain.
4915243730Srwatson	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4916243730Srwatson	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4917243730Srwatson	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4918243730Srwatson	    _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'
4919243730Srwatson	  else
4920243730Srwatson	    _LT_TAGVAR(ld_shlibs, $1)=no
4921243730Srwatson	  fi
4922243730Srwatson	;;
4923243730Srwatson      esac
4924243730Srwatson      ;;
4925243730Srwatson
4926243730Srwatson    sunos4*)
4927243730Srwatson      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4928243730Srwatson      wlarc=
4929243730Srwatson      _LT_TAGVAR(hardcode_direct, $1)=yes
4930243730Srwatson      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4931243730Srwatson      ;;
4932243730Srwatson
4933243730Srwatson    *)
4934243730Srwatson      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4935243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4936243730Srwatson	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4937243730Srwatson      else
4938243730Srwatson	_LT_TAGVAR(ld_shlibs, $1)=no
4939243730Srwatson      fi
4940243730Srwatson      ;;
4941243730Srwatson    esac
4942243730Srwatson
4943243730Srwatson    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4944243730Srwatson      runpath_var=
4945243730Srwatson      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4946243730Srwatson      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4947243730Srwatson      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4948243730Srwatson    fi
4949243730Srwatson  else
4950243730Srwatson    # PORTME fill in a description of your system's linker (not GNU ld)
4951243730Srwatson    case $host_os in
4952243730Srwatson    aix3*)
4953243730Srwatson      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4954243730Srwatson      _LT_TAGVAR(always_export_symbols, $1)=yes
4955243730Srwatson      _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'
4956243730Srwatson      # Note: this linker hardcodes the directories in LIBPATH if there
4957243730Srwatson      # are no directories specified by -L.
4958243730Srwatson      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4959243730Srwatson      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4960243730Srwatson	# Neither direct hardcoding nor static linking is supported with a
4961243730Srwatson	# broken collect2.
4962243730Srwatson	_LT_TAGVAR(hardcode_direct, $1)=unsupported
4963243730Srwatson      fi
4964243730Srwatson      ;;
4965243730Srwatson
4966243730Srwatson    aix[[4-9]]*)
4967243730Srwatson      if test "$host_cpu" = ia64; then
4968243730Srwatson	# On IA64, the linker does run time linking by default, so we don't
4969243730Srwatson	# have to do anything special.
4970243730Srwatson	aix_use_runtimelinking=no
4971243730Srwatson	exp_sym_flag='-Bexport'
4972243730Srwatson	no_entry_flag=""
4973243730Srwatson      else
4974243730Srwatson	# If we're using GNU nm, then we don't want the "-C" option.
4975243730Srwatson	# -C means demangle to AIX nm, but means don't demangle with GNU nm
4976243730Srwatson	# Also, AIX nm treats weak defined symbols like other global
4977243730Srwatson	# defined symbols, whereas GNU nm marks them as "W".
4978243730Srwatson	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4979243730Srwatson	  _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'
4980243730Srwatson	else
4981243730Srwatson	  _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'
4982243730Srwatson	fi
4983243730Srwatson	aix_use_runtimelinking=no
4984243730Srwatson
4985243730Srwatson	# Test if we are trying to use run time linking or normal
4986243730Srwatson	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
4987243730Srwatson	# need to do runtime linking.
4988243730Srwatson	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
4989243730Srwatson	  for ld_flag in $LDFLAGS; do
4990243730Srwatson	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
4991243730Srwatson	    aix_use_runtimelinking=yes
4992243730Srwatson	    break
4993243730Srwatson	  fi
4994243730Srwatson	  done
4995243730Srwatson	  ;;
4996243730Srwatson	esac
4997243730Srwatson
4998243730Srwatson	exp_sym_flag='-bexport'
4999243730Srwatson	no_entry_flag='-bnoentry'
5000243730Srwatson      fi
5001243730Srwatson
5002243730Srwatson      # When large executables or shared objects are built, AIX ld can
5003243730Srwatson      # have problems creating the table of contents.  If linking a library
5004243730Srwatson      # or program results in "error TOC overflow" add -mminimal-toc to
5005243730Srwatson      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5006243730Srwatson      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5007243730Srwatson
5008243730Srwatson      _LT_TAGVAR(archive_cmds, $1)=''
5009243730Srwatson      _LT_TAGVAR(hardcode_direct, $1)=yes
5010243730Srwatson      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5011243730Srwatson      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5012243730Srwatson      _LT_TAGVAR(link_all_deplibs, $1)=yes
5013243730Srwatson      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5014243730Srwatson
5015243730Srwatson      if test "$GCC" = yes; then
5016243730Srwatson	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5017243730Srwatson	# We only want to do this on AIX 4.2 and lower, the check
5018243730Srwatson	# below for broken collect2 doesn't work under 4.3+
5019243730Srwatson	  collect2name=`${CC} -print-prog-name=collect2`
5020243730Srwatson	  if test -f "$collect2name" &&
5021243730Srwatson	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5022243730Srwatson	  then
5023243730Srwatson	  # We have reworked collect2
5024243730Srwatson	  :
5025243730Srwatson	  else
5026243730Srwatson	  # We have old collect2
5027243730Srwatson	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
5028243730Srwatson	  # It fails to find uninstalled libraries when the uninstalled
5029243730Srwatson	  # path is not listed in the libpath.  Setting hardcode_minus_L
5030243730Srwatson	  # to unsupported forces relinking
5031243730Srwatson	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5032243730Srwatson	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5033243730Srwatson	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5034243730Srwatson	  fi
5035243730Srwatson	  ;;
5036243730Srwatson	esac
5037243730Srwatson	shared_flag='-shared'
5038243730Srwatson	if test "$aix_use_runtimelinking" = yes; then
5039243730Srwatson	  shared_flag="$shared_flag "'${wl}-G'
5040243730Srwatson	fi
5041243730Srwatson      else
5042243730Srwatson	# not using gcc
5043243730Srwatson	if test "$host_cpu" = ia64; then
5044243730Srwatson	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5045243730Srwatson	# chokes on -Wl,-G. The following line is correct:
5046243730Srwatson	  shared_flag='-G'
5047243730Srwatson	else
5048243730Srwatson	  if test "$aix_use_runtimelinking" = yes; then
5049243730Srwatson	    shared_flag='${wl}-G'
5050243730Srwatson	  else
5051243730Srwatson	    shared_flag='${wl}-bM:SRE'
5052243730Srwatson	  fi
5053243730Srwatson	fi
5054243730Srwatson      fi
5055243730Srwatson
5056243730Srwatson      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5057243730Srwatson      # It seems that -bexpall does not export symbols beginning with
5058243730Srwatson      # underscore (_), so it is better to generate a list of symbols to export.
5059243730Srwatson      _LT_TAGVAR(always_export_symbols, $1)=yes
5060243730Srwatson      if test "$aix_use_runtimelinking" = yes; then
5061243730Srwatson	# Warning - without using the other runtime loading flags (-brtl),
5062243730Srwatson	# -berok will link without error, but may produce a broken library.
5063243730Srwatson	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5064243730Srwatson        # Determine the default libpath from the value encoded in an
5065243730Srwatson        # empty executable.
5066243730Srwatson        _LT_SYS_MODULE_PATH_AIX([$1])
5067243730Srwatson        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5068243730Srwatson        _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"
5069243730Srwatson      else
5070243730Srwatson	if test "$host_cpu" = ia64; then
5071243730Srwatson	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5072243730Srwatson	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5073243730Srwatson	  _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"
5074243730Srwatson	else
5075243730Srwatson	 # Determine the default libpath from the value encoded in an
5076243730Srwatson	 # empty executable.
5077243730Srwatson	 _LT_SYS_MODULE_PATH_AIX([$1])
5078243730Srwatson	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5079243730Srwatson	  # Warning - without using the other run time loading flags,
5080243730Srwatson	  # -berok will link without error, but may produce a broken library.
5081243730Srwatson	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5082243730Srwatson	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5083243730Srwatson	  if test "$with_gnu_ld" = yes; then
5084243730Srwatson	    # We only use this code for GNU lds that support --whole-archive.
5085243730Srwatson	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5086243730Srwatson	  else
5087243730Srwatson	    # Exported symbols can be pulled into shared objects from archives
5088243730Srwatson	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5089243730Srwatson	  fi
5090243730Srwatson	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5091243730Srwatson	  # This is similar to how AIX traditionally builds its shared libraries.
5092243730Srwatson	  _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'
5093243730Srwatson	fi
5094243730Srwatson      fi
5095243730Srwatson      ;;
5096243730Srwatson
5097243730Srwatson    amigaos*)
5098243730Srwatson      case $host_cpu in
5099243730Srwatson      powerpc)
5100243730Srwatson            # see comment about AmigaOS4 .so support
5101243730Srwatson            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5102243730Srwatson            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5103243730Srwatson        ;;
5104243730Srwatson      m68k)
5105243730Srwatson            _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)'
5106243730Srwatson            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5107243730Srwatson            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5108243730Srwatson        ;;
5109243730Srwatson      esac
5110243730Srwatson      ;;
5111243730Srwatson
5112243730Srwatson    bsdi[[45]]*)
5113243730Srwatson      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5114243730Srwatson      ;;
5115243730Srwatson
5116243730Srwatson    cygwin* | mingw* | pw32* | cegcc*)
5117243730Srwatson      # When not using gcc, we currently assume that we are using
5118243730Srwatson      # Microsoft Visual C++.
5119243730Srwatson      # hardcode_libdir_flag_spec is actually meaningless, as there is
5120243730Srwatson      # no search path for DLLs.
5121243730Srwatson      case $cc_basename in
5122243730Srwatson      cl*)
5123243730Srwatson	# Native MSVC
5124243730Srwatson	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5125243730Srwatson	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5126243730Srwatson	_LT_TAGVAR(always_export_symbols, $1)=yes
5127243730Srwatson	_LT_TAGVAR(file_list_spec, $1)='@'
5128243730Srwatson	# Tell ltmain to make .lib files, not .a files.
5129243730Srwatson	libext=lib
5130243730Srwatson	# Tell ltmain to make .dll files, not .so files.
5131243730Srwatson	shrext_cmds=".dll"
5132243730Srwatson	# FIXME: Setting linknames here is a bad hack.
5133243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
5134243730Srwatson	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5135243730Srwatson	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
5136243730Srwatson	  else
5137243730Srwatson	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
5138243730Srwatson	  fi~
5139243730Srwatson	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5140243730Srwatson	  linknames='
5141243730Srwatson	# The linker will not automatically build a static lib if we build a DLL.
5142243730Srwatson	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5143243730Srwatson	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5144243730Srwatson	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5145243730Srwatson	_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'
5146243730Srwatson	# Don't use ranlib
5147243730Srwatson	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5148243730Srwatson	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5149243730Srwatson	  lt_tool_outputfile="@TOOL_OUTPUT@"~
5150243730Srwatson	  case $lt_outputfile in
5151243730Srwatson	    *.exe|*.EXE) ;;
5152243730Srwatson	    *)
5153243730Srwatson	      lt_outputfile="$lt_outputfile.exe"
5154243730Srwatson	      lt_tool_outputfile="$lt_tool_outputfile.exe"
5155243730Srwatson	      ;;
5156243730Srwatson	  esac~
5157243730Srwatson	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
5158243730Srwatson	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5159243730Srwatson	    $RM "$lt_outputfile.manifest";
5160243730Srwatson	  fi'
5161243730Srwatson	;;
5162243730Srwatson      *)
5163243730Srwatson	# Assume MSVC wrapper
5164243730Srwatson	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5165243730Srwatson	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5166243730Srwatson	# Tell ltmain to make .lib files, not .a files.
5167243730Srwatson	libext=lib
5168243730Srwatson	# Tell ltmain to make .dll files, not .so files.
5169243730Srwatson	shrext_cmds=".dll"
5170243730Srwatson	# FIXME: Setting linknames here is a bad hack.
5171243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5172243730Srwatson	# The linker will automatically build a .lib file if we build a DLL.
5173243730Srwatson	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5174243730Srwatson	# FIXME: Should let the user specify the lib program.
5175243730Srwatson	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5176243730Srwatson	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5177243730Srwatson	;;
5178243730Srwatson      esac
5179243730Srwatson      ;;
5180243730Srwatson
5181243730Srwatson    darwin* | rhapsody*)
5182243730Srwatson      _LT_DARWIN_LINKER_FEATURES($1)
5183243730Srwatson      ;;
5184243730Srwatson
5185243730Srwatson    dgux*)
5186243730Srwatson      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5187243730Srwatson      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5188243730Srwatson      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5189243730Srwatson      ;;
5190243730Srwatson
5191243730Srwatson    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5192243730Srwatson    # support.  Future versions do this automatically, but an explicit c++rt0.o
5193243730Srwatson    # does not break anything, and helps significantly (at the cost of a little
5194243730Srwatson    # extra space).
5195243730Srwatson    freebsd2.2*)
5196243730Srwatson      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5197243730Srwatson      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5198243730Srwatson      _LT_TAGVAR(hardcode_direct, $1)=yes
5199243730Srwatson      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5200243730Srwatson      ;;
5201243730Srwatson
5202243730Srwatson    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5203243730Srwatson    freebsd2.*)
5204243730Srwatson      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5205243730Srwatson      _LT_TAGVAR(hardcode_direct, $1)=yes
5206243730Srwatson      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5207243730Srwatson      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5208243730Srwatson      ;;
5209243730Srwatson
5210243730Srwatson    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5211243730Srwatson    freebsd* | dragonfly*)
5212243730Srwatson      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5213243730Srwatson      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5214243730Srwatson      _LT_TAGVAR(hardcode_direct, $1)=yes
5215243730Srwatson      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5216243730Srwatson      ;;
5217243730Srwatson
5218243730Srwatson    hpux9*)
5219243730Srwatson      if test "$GCC" = yes; then
5220243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5221243730Srwatson      else
5222243730Srwatson	_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'
5223243730Srwatson      fi
5224243730Srwatson      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5225243730Srwatson      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5226243730Srwatson      _LT_TAGVAR(hardcode_direct, $1)=yes
5227243730Srwatson
5228243730Srwatson      # hardcode_minus_L: Not really in the search PATH,
5229243730Srwatson      # but as the default location of the library.
5230243730Srwatson      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5231243730Srwatson      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5232243730Srwatson      ;;
5233243730Srwatson
5234243730Srwatson    hpux10*)
5235243730Srwatson      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5236243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5237243730Srwatson      else
5238243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5239243730Srwatson      fi
5240243730Srwatson      if test "$with_gnu_ld" = no; then
5241243730Srwatson	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5242243730Srwatson	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5243243730Srwatson	_LT_TAGVAR(hardcode_direct, $1)=yes
5244243730Srwatson	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5245243730Srwatson	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5246243730Srwatson	# hardcode_minus_L: Not really in the search PATH,
5247243730Srwatson	# but as the default location of the library.
5248243730Srwatson	_LT_TAGVAR(hardcode_minus_L, $1)=yes
5249243730Srwatson      fi
5250243730Srwatson      ;;
5251243730Srwatson
5252243730Srwatson    hpux11*)
5253243730Srwatson      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5254243730Srwatson	case $host_cpu in
5255243730Srwatson	hppa*64*)
5256243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5257243730Srwatson	  ;;
5258243730Srwatson	ia64*)
5259243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5260243730Srwatson	  ;;
5261243730Srwatson	*)
5262243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5263243730Srwatson	  ;;
5264243730Srwatson	esac
5265243730Srwatson      else
5266243730Srwatson	case $host_cpu in
5267243730Srwatson	hppa*64*)
5268243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5269243730Srwatson	  ;;
5270243730Srwatson	ia64*)
5271243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5272243730Srwatson	  ;;
5273243730Srwatson	*)
5274243730Srwatson	m4_if($1, [], [
5275243730Srwatson	  # Older versions of the 11.00 compiler do not understand -b yet
5276243730Srwatson	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
5277243730Srwatson	  _LT_LINKER_OPTION([if $CC understands -b],
5278243730Srwatson	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5279243730Srwatson	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
5280243730Srwatson	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5281243730Srwatson	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5282243730Srwatson	  ;;
5283243730Srwatson	esac
5284243730Srwatson      fi
5285243730Srwatson      if test "$with_gnu_ld" = no; then
5286243730Srwatson	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5287243730Srwatson	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5288243730Srwatson
5289243730Srwatson	case $host_cpu in
5290243730Srwatson	hppa*64*|ia64*)
5291243730Srwatson	  _LT_TAGVAR(hardcode_direct, $1)=no
5292243730Srwatson	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5293243730Srwatson	  ;;
5294243730Srwatson	*)
5295243730Srwatson	  _LT_TAGVAR(hardcode_direct, $1)=yes
5296243730Srwatson	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5297243730Srwatson	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5298243730Srwatson
5299243730Srwatson	  # hardcode_minus_L: Not really in the search PATH,
5300243730Srwatson	  # but as the default location of the library.
5301243730Srwatson	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5302243730Srwatson	  ;;
5303243730Srwatson	esac
5304243730Srwatson      fi
5305243730Srwatson      ;;
5306243730Srwatson
5307243730Srwatson    irix5* | irix6* | nonstopux*)
5308243730Srwatson      if test "$GCC" = yes; then
5309243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5310243730Srwatson	# Try to use the -exported_symbol ld option, if it does not
5311243730Srwatson	# work, assume that -exports_file does not work either and
5312243730Srwatson	# implicitly export all symbols.
5313243730Srwatson	# This should be the same for all languages, so no per-tag cache variable.
5314243730Srwatson	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5315243730Srwatson	  [lt_cv_irix_exported_symbol],
5316243730Srwatson	  [save_LDFLAGS="$LDFLAGS"
5317243730Srwatson	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
5318243730Srwatson	   AC_LINK_IFELSE(
5319243730Srwatson	     [AC_LANG_SOURCE(
5320243730Srwatson	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5321243730Srwatson			      [C++], [[int foo (void) { return 0; }]],
5322243730Srwatson			      [Fortran 77], [[
5323243730Srwatson      subroutine foo
5324243730Srwatson      end]],
5325243730Srwatson			      [Fortran], [[
5326243730Srwatson      subroutine foo
5327243730Srwatson      end]])])],
5328243730Srwatson	      [lt_cv_irix_exported_symbol=yes],
5329243730Srwatson	      [lt_cv_irix_exported_symbol=no])
5330243730Srwatson           LDFLAGS="$save_LDFLAGS"])
5331243730Srwatson	if test "$lt_cv_irix_exported_symbol" = yes; then
5332243730Srwatson          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
5333243730Srwatson	fi
5334243730Srwatson      else
5335243730Srwatson	_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'
5336243730Srwatson	_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'
5337243730Srwatson      fi
5338243730Srwatson      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5339243730Srwatson      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5340243730Srwatson      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5341243730Srwatson      _LT_TAGVAR(inherit_rpath, $1)=yes
5342243730Srwatson      _LT_TAGVAR(link_all_deplibs, $1)=yes
5343243730Srwatson      ;;
5344243730Srwatson
5345243730Srwatson    netbsd*)
5346243730Srwatson      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5347243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5348243730Srwatson      else
5349243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5350243730Srwatson      fi
5351243730Srwatson      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5352243730Srwatson      _LT_TAGVAR(hardcode_direct, $1)=yes
5353243730Srwatson      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5354243730Srwatson      ;;
5355243730Srwatson
5356243730Srwatson    newsos6)
5357243730Srwatson      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5358243730Srwatson      _LT_TAGVAR(hardcode_direct, $1)=yes
5359243730Srwatson      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5360243730Srwatson      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5361243730Srwatson      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5362243730Srwatson      ;;
5363243730Srwatson
5364243730Srwatson    *nto* | *qnx*)
5365243730Srwatson      ;;
5366243730Srwatson
5367243730Srwatson    openbsd*)
5368243730Srwatson      if test -f /usr/libexec/ld.so; then
5369243730Srwatson	_LT_TAGVAR(hardcode_direct, $1)=yes
5370243730Srwatson	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5371243730Srwatson	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5372243730Srwatson	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5373243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5374243730Srwatson	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
5375243730Srwatson	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5376243730Srwatson	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5377243730Srwatson	else
5378243730Srwatson	  case $host_os in
5379243730Srwatson	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
5380243730Srwatson	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5381243730Srwatson	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5382243730Srwatson	     ;;
5383243730Srwatson	   *)
5384243730Srwatson	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5385243730Srwatson	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5386243730Srwatson	     ;;
5387243730Srwatson	  esac
5388243730Srwatson	fi
5389243730Srwatson      else
5390243730Srwatson	_LT_TAGVAR(ld_shlibs, $1)=no
5391243730Srwatson      fi
5392243730Srwatson      ;;
5393243730Srwatson
5394243730Srwatson    os2*)
5395243730Srwatson      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5396243730Srwatson      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5397243730Srwatson      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5398243730Srwatson      _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'
5399243730Srwatson      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5400243730Srwatson      ;;
5401243730Srwatson
5402243730Srwatson    osf3*)
5403243730Srwatson      if test "$GCC" = yes; then
5404243730Srwatson	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5405243730Srwatson	_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'
5406243730Srwatson      else
5407243730Srwatson	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5408243730Srwatson	_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'
5409243730Srwatson      fi
5410243730Srwatson      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5411243730Srwatson      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5412243730Srwatson      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5413243730Srwatson      ;;
5414243730Srwatson
5415243730Srwatson    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5416243730Srwatson      if test "$GCC" = yes; then
5417243730Srwatson	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5418243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5419243730Srwatson	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5420243730Srwatson      else
5421243730Srwatson	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5422243730Srwatson	_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'
5423243730Srwatson	_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~
5424243730Srwatson	$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'
5425243730Srwatson
5426243730Srwatson	# Both c and cxx compiler support -rpath directly
5427243730Srwatson	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5428243730Srwatson      fi
5429243730Srwatson      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5430243730Srwatson      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5431243730Srwatson      ;;
5432243730Srwatson
5433243730Srwatson    solaris*)
5434243730Srwatson      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5435243730Srwatson      if test "$GCC" = yes; then
5436243730Srwatson	wlarc='${wl}'
5437243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5438243730Srwatson	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5439243730Srwatson	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5440243730Srwatson      else
5441243730Srwatson	case `$CC -V 2>&1` in
5442243730Srwatson	*"Compilers 5.0"*)
5443243730Srwatson	  wlarc=''
5444243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5445243730Srwatson	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5446243730Srwatson	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5447243730Srwatson	  ;;
5448243730Srwatson	*)
5449243730Srwatson	  wlarc='${wl}'
5450243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5451243730Srwatson	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5452243730Srwatson	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5453243730Srwatson	  ;;
5454243730Srwatson	esac
5455243730Srwatson      fi
5456243730Srwatson      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5457243730Srwatson      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5458243730Srwatson      case $host_os in
5459243730Srwatson      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5460243730Srwatson      *)
5461243730Srwatson	# The compiler driver will combine and reorder linker options,
5462243730Srwatson	# but understands `-z linker_flag'.  GCC discards it without `$wl',
5463243730Srwatson	# but is careful enough not to reorder.
5464243730Srwatson	# Supported since Solaris 2.6 (maybe 2.5.1?)
5465243730Srwatson	if test "$GCC" = yes; then
5466243730Srwatson	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
5467243730Srwatson	else
5468243730Srwatson	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5469243730Srwatson	fi
5470243730Srwatson	;;
5471243730Srwatson      esac
5472243730Srwatson      _LT_TAGVAR(link_all_deplibs, $1)=yes
5473243730Srwatson      ;;
5474243730Srwatson
5475243730Srwatson    sunos4*)
5476243730Srwatson      if test "x$host_vendor" = xsequent; then
5477243730Srwatson	# Use $CC to link under sequent, because it throws in some extra .o
5478243730Srwatson	# files that make .init and .fini sections work.
5479243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5480243730Srwatson      else
5481243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5482243730Srwatson      fi
5483243730Srwatson      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5484243730Srwatson      _LT_TAGVAR(hardcode_direct, $1)=yes
5485243730Srwatson      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5486243730Srwatson      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5487243730Srwatson      ;;
5488243730Srwatson
5489243730Srwatson    sysv4)
5490243730Srwatson      case $host_vendor in
5491243730Srwatson	sni)
5492243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5493243730Srwatson	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5494243730Srwatson	;;
5495243730Srwatson	siemens)
5496243730Srwatson	  ## LD is ld it makes a PLAMLIB
5497243730Srwatson	  ## CC just makes a GrossModule.
5498243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5499243730Srwatson	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5500243730Srwatson	  _LT_TAGVAR(hardcode_direct, $1)=no
5501243730Srwatson        ;;
5502243730Srwatson	motorola)
5503243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5504243730Srwatson	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5505243730Srwatson	;;
5506243730Srwatson      esac
5507243730Srwatson      runpath_var='LD_RUN_PATH'
5508243730Srwatson      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5509243730Srwatson      ;;
5510243730Srwatson
5511243730Srwatson    sysv4.3*)
5512243730Srwatson      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5513243730Srwatson      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5514243730Srwatson      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5515243730Srwatson      ;;
5516243730Srwatson
5517243730Srwatson    sysv4*MP*)
5518243730Srwatson      if test -d /usr/nec; then
5519243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5520243730Srwatson	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5521243730Srwatson	runpath_var=LD_RUN_PATH
5522243730Srwatson	hardcode_runpath_var=yes
5523243730Srwatson	_LT_TAGVAR(ld_shlibs, $1)=yes
5524243730Srwatson      fi
5525243730Srwatson      ;;
5526243730Srwatson
5527243730Srwatson    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5528243730Srwatson      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5529243730Srwatson      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5530243730Srwatson      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5531243730Srwatson      runpath_var='LD_RUN_PATH'
5532243730Srwatson
5533243730Srwatson      if test "$GCC" = yes; then
5534243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5535243730Srwatson	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5536243730Srwatson      else
5537243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5538243730Srwatson	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5539243730Srwatson      fi
5540243730Srwatson      ;;
5541243730Srwatson
5542243730Srwatson    sysv5* | sco3.2v5* | sco5v6*)
5543243730Srwatson      # Note: We can NOT use -z defs as we might desire, because we do not
5544243730Srwatson      # link with -lc, and that would cause any symbols used from libc to
5545243730Srwatson      # always be unresolved, which means just about no library would
5546243730Srwatson      # ever link correctly.  If we're not using GNU ld we use -z text
5547243730Srwatson      # though, which does catch some bad symbols but isn't as heavy-handed
5548243730Srwatson      # as -z defs.
5549243730Srwatson      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5550243730Srwatson      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5551243730Srwatson      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5552243730Srwatson      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5553243730Srwatson      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5554243730Srwatson      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5555243730Srwatson      _LT_TAGVAR(link_all_deplibs, $1)=yes
5556243730Srwatson      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5557243730Srwatson      runpath_var='LD_RUN_PATH'
5558243730Srwatson
5559243730Srwatson      if test "$GCC" = yes; then
5560243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5561243730Srwatson	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5562243730Srwatson      else
5563243730Srwatson	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5564243730Srwatson	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5565243730Srwatson      fi
5566243730Srwatson      ;;
5567243730Srwatson
5568243730Srwatson    uts4*)
5569243730Srwatson      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5570243730Srwatson      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5571243730Srwatson      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5572243730Srwatson      ;;
5573243730Srwatson
5574243730Srwatson    *)
5575243730Srwatson      _LT_TAGVAR(ld_shlibs, $1)=no
5576243730Srwatson      ;;
5577243730Srwatson    esac
5578243730Srwatson
5579243730Srwatson    if test x$host_vendor = xsni; then
5580243730Srwatson      case $host in
5581243730Srwatson      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5582243730Srwatson	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5583243730Srwatson	;;
5584243730Srwatson      esac
5585243730Srwatson    fi
5586243730Srwatson  fi
5587243730Srwatson])
5588243730SrwatsonAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5589243730Srwatsontest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5590243730Srwatson
5591243730Srwatson_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5592243730Srwatson
5593243730Srwatson_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5594243730Srwatson_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5595243730Srwatson_LT_DECL([], [extract_expsyms_cmds], [2],
5596243730Srwatson    [The commands to extract the exported symbol list from a shared archive])
5597243730Srwatson
5598243730Srwatson#
5599243730Srwatson# Do we need to explicitly link libc?
5600243730Srwatson#
5601243730Srwatsoncase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5602243730Srwatsonx|xyes)
5603243730Srwatson  # Assume -lc should be added
5604243730Srwatson  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5605243730Srwatson
5606243730Srwatson  if test "$enable_shared" = yes && test "$GCC" = yes; then
5607243730Srwatson    case $_LT_TAGVAR(archive_cmds, $1) in
5608243730Srwatson    *'~'*)
5609243730Srwatson      # FIXME: we may have to deal with multi-command sequences.
5610243730Srwatson      ;;
5611243730Srwatson    '$CC '*)
5612243730Srwatson      # Test whether the compiler implicitly links with -lc since on some
5613243730Srwatson      # systems, -lgcc has to come before -lc. If gcc already passes -lc
5614243730Srwatson      # to ld, don't add -lc before -lgcc.
5615243730Srwatson      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
5616243730Srwatson	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
5617243730Srwatson	[$RM conftest*
5618243730Srwatson	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5619243730Srwatson
5620243730Srwatson	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
5621243730Srwatson	  soname=conftest
5622243730Srwatson	  lib=conftest
5623243730Srwatson	  libobjs=conftest.$ac_objext
5624243730Srwatson	  deplibs=
5625243730Srwatson	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
5626243730Srwatson	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
5627243730Srwatson	  compiler_flags=-v
5628243730Srwatson	  linker_flags=-v
5629243730Srwatson	  verstring=
5630243730Srwatson	  output_objdir=.
5631243730Srwatson	  libname=conftest
5632243730Srwatson	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
5633243730Srwatson	  _LT_TAGVAR(allow_undefined_flag, $1)=
5634243730Srwatson	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
5635243730Srwatson	  then
5636243730Srwatson	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5637243730Srwatson	  else
5638243730Srwatson	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5639243730Srwatson	  fi
5640243730Srwatson	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
5641243730Srwatson	else
5642243730Srwatson	  cat conftest.err 1>&5
5643243730Srwatson	fi
5644243730Srwatson	$RM conftest*
5645243730Srwatson	])
5646243730Srwatson      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
5647243730Srwatson      ;;
5648243730Srwatson    esac
5649243730Srwatson  fi
5650243730Srwatson  ;;
5651243730Srwatsonesac
5652243730Srwatson
5653243730Srwatson_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5654243730Srwatson    [Whether or not to add -lc for building shared libraries])
5655243730Srwatson_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5656243730Srwatson    [enable_shared_with_static_runtimes], [0],
5657243730Srwatson    [Whether or not to disallow shared libs when runtime libs are static])
5658243730Srwatson_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5659243730Srwatson    [Compiler flag to allow reflexive dlopens])
5660243730Srwatson_LT_TAGDECL([], [whole_archive_flag_spec], [1],
5661243730Srwatson    [Compiler flag to generate shared objects directly from archives])
5662243730Srwatson_LT_TAGDECL([], [compiler_needs_object], [1],
5663243730Srwatson    [Whether the compiler copes with passing no objects directly])
5664243730Srwatson_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5665243730Srwatson    [Create an old-style archive from a shared archive])
5666243730Srwatson_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5667243730Srwatson    [Create a temporary old-style archive to link instead of a shared archive])
5668243730Srwatson_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5669243730Srwatson_LT_TAGDECL([], [archive_expsym_cmds], [2])
5670243730Srwatson_LT_TAGDECL([], [module_cmds], [2],
5671243730Srwatson    [Commands used to build a loadable module if different from building
5672243730Srwatson    a shared archive.])
5673243730Srwatson_LT_TAGDECL([], [module_expsym_cmds], [2])
5674243730Srwatson_LT_TAGDECL([], [with_gnu_ld], [1],
5675243730Srwatson    [Whether we are building with GNU ld or not])
5676243730Srwatson_LT_TAGDECL([], [allow_undefined_flag], [1],
5677243730Srwatson    [Flag that allows shared libraries with undefined symbols to be built])
5678243730Srwatson_LT_TAGDECL([], [no_undefined_flag], [1],
5679243730Srwatson    [Flag that enforces no undefined symbols])
5680243730Srwatson_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5681243730Srwatson    [Flag to hardcode $libdir into a binary during linking.
5682243730Srwatson    This must work even if $libdir does not exist])
5683243730Srwatson_LT_TAGDECL([], [hardcode_libdir_separator], [1],
5684243730Srwatson    [Whether we need a single "-rpath" flag with a separated argument])
5685243730Srwatson_LT_TAGDECL([], [hardcode_direct], [0],
5686243730Srwatson    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5687243730Srwatson    DIR into the resulting binary])
5688243730Srwatson_LT_TAGDECL([], [hardcode_direct_absolute], [0],
5689243730Srwatson    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5690243730Srwatson    DIR into the resulting binary and the resulting library dependency is
5691243730Srwatson    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5692243730Srwatson    library is relocated])
5693243730Srwatson_LT_TAGDECL([], [hardcode_minus_L], [0],
5694243730Srwatson    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5695243730Srwatson    into the resulting binary])
5696243730Srwatson_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5697243730Srwatson    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5698243730Srwatson    into the resulting binary])
5699243730Srwatson_LT_TAGDECL([], [hardcode_automatic], [0],
5700243730Srwatson    [Set to "yes" if building a shared library automatically hardcodes DIR
5701243730Srwatson    into the library and all subsequent libraries and executables linked
5702243730Srwatson    against it])
5703243730Srwatson_LT_TAGDECL([], [inherit_rpath], [0],
5704243730Srwatson    [Set to yes if linker adds runtime paths of dependent libraries
5705243730Srwatson    to runtime path list])
5706243730Srwatson_LT_TAGDECL([], [link_all_deplibs], [0],
5707243730Srwatson    [Whether libtool must link a program against all its dependency libraries])
5708243730Srwatson_LT_TAGDECL([], [always_export_symbols], [0],
5709243730Srwatson    [Set to "yes" if exported symbols are required])
5710243730Srwatson_LT_TAGDECL([], [export_symbols_cmds], [2],
5711243730Srwatson    [The commands to list exported symbols])
5712243730Srwatson_LT_TAGDECL([], [exclude_expsyms], [1],
5713243730Srwatson    [Symbols that should not be listed in the preloaded symbols])
5714243730Srwatson_LT_TAGDECL([], [include_expsyms], [1],
5715243730Srwatson    [Symbols that must always be exported])
5716243730Srwatson_LT_TAGDECL([], [prelink_cmds], [2],
5717243730Srwatson    [Commands necessary for linking programs (against libraries) with templates])
5718243730Srwatson_LT_TAGDECL([], [postlink_cmds], [2],
5719243730Srwatson    [Commands necessary for finishing linking programs])
5720243730Srwatson_LT_TAGDECL([], [file_list_spec], [1],
5721243730Srwatson    [Specify filename containing input files])
5722243730Srwatsondnl FIXME: Not yet implemented
5723243730Srwatsondnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5724243730Srwatsondnl    [Compiler flag to generate thread safe objects])
5725243730Srwatson])# _LT_LINKER_SHLIBS
5726243730Srwatson
5727243730Srwatson
5728243730Srwatson# _LT_LANG_C_CONFIG([TAG])
5729243730Srwatson# ------------------------
5730243730Srwatson# Ensure that the configuration variables for a C compiler are suitably
5731243730Srwatson# defined.  These variables are subsequently used by _LT_CONFIG to write
5732243730Srwatson# the compiler configuration to `libtool'.
5733243730Srwatsonm4_defun([_LT_LANG_C_CONFIG],
5734243730Srwatson[m4_require([_LT_DECL_EGREP])dnl
5735243730Srwatsonlt_save_CC="$CC"
5736243730SrwatsonAC_LANG_PUSH(C)
5737243730Srwatson
5738243730Srwatson# Source file extension for C test sources.
5739243730Srwatsonac_ext=c
5740243730Srwatson
5741243730Srwatson# Object file extension for compiled C test sources.
5742243730Srwatsonobjext=o
5743243730Srwatson_LT_TAGVAR(objext, $1)=$objext
5744243730Srwatson
5745243730Srwatson# Code to be used in simple compile tests
5746243730Srwatsonlt_simple_compile_test_code="int some_variable = 0;"
5747243730Srwatson
5748243730Srwatson# Code to be used in simple link tests
5749243730Srwatsonlt_simple_link_test_code='int main(){return(0);}'
5750243730Srwatson
5751243730Srwatson_LT_TAG_COMPILER
5752243730Srwatson# Save the default compiler, since it gets overwritten when the other
5753243730Srwatson# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5754243730Srwatsoncompiler_DEFAULT=$CC
5755243730Srwatson
5756243730Srwatson# save warnings/boilerplate of simple test code
5757243730Srwatson_LT_COMPILER_BOILERPLATE
5758243730Srwatson_LT_LINKER_BOILERPLATE
5759243730Srwatson
5760243730Srwatson## CAVEAT EMPTOR:
5761243730Srwatson## There is no encapsulation within the following macros, do not change
5762243730Srwatson## the running order or otherwise move them around unless you know exactly
5763243730Srwatson## what you are doing...
5764243730Srwatsonif test -n "$compiler"; then
5765243730Srwatson  _LT_COMPILER_NO_RTTI($1)
5766243730Srwatson  _LT_COMPILER_PIC($1)
5767243730Srwatson  _LT_COMPILER_C_O($1)
5768243730Srwatson  _LT_COMPILER_FILE_LOCKS($1)
5769243730Srwatson  _LT_LINKER_SHLIBS($1)
5770243730Srwatson  _LT_SYS_DYNAMIC_LINKER($1)
5771243730Srwatson  _LT_LINKER_HARDCODE_LIBPATH($1)
5772243730Srwatson  LT_SYS_DLOPEN_SELF
5773243730Srwatson  _LT_CMD_STRIPLIB
5774243730Srwatson
5775243730Srwatson  # Report which library types will actually be built
5776243730Srwatson  AC_MSG_CHECKING([if libtool supports shared libraries])
5777243730Srwatson  AC_MSG_RESULT([$can_build_shared])
5778243730Srwatson
5779243730Srwatson  AC_MSG_CHECKING([whether to build shared libraries])
5780243730Srwatson  test "$can_build_shared" = "no" && enable_shared=no
5781243730Srwatson
5782243730Srwatson  # On AIX, shared libraries and static libraries use the same namespace, and
5783243730Srwatson  # are all built from PIC.
5784243730Srwatson  case $host_os in
5785243730Srwatson  aix3*)
5786243730Srwatson    test "$enable_shared" = yes && enable_static=no
5787243730Srwatson    if test -n "$RANLIB"; then
5788243730Srwatson      archive_cmds="$archive_cmds~\$RANLIB \$lib"
5789243730Srwatson      postinstall_cmds='$RANLIB $lib'
5790243730Srwatson    fi
5791243730Srwatson    ;;
5792243730Srwatson
5793243730Srwatson  aix[[4-9]]*)
5794243730Srwatson    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5795243730Srwatson      test "$enable_shared" = yes && enable_static=no
5796243730Srwatson    fi
5797243730Srwatson    ;;
5798243730Srwatson  esac
5799243730Srwatson  AC_MSG_RESULT([$enable_shared])
5800243730Srwatson
5801243730Srwatson  AC_MSG_CHECKING([whether to build static libraries])
5802243730Srwatson  # Make sure either enable_shared or enable_static is yes.
5803243730Srwatson  test "$enable_shared" = yes || enable_static=yes
5804243730Srwatson  AC_MSG_RESULT([$enable_static])
5805243730Srwatson
5806243730Srwatson  _LT_CONFIG($1)
5807243730Srwatsonfi
5808243730SrwatsonAC_LANG_POP
5809243730SrwatsonCC="$lt_save_CC"
5810243730Srwatson])# _LT_LANG_C_CONFIG
5811243730Srwatson
5812243730Srwatson
5813243730Srwatson# _LT_LANG_CXX_CONFIG([TAG])
5814243730Srwatson# --------------------------
5815243730Srwatson# Ensure that the configuration variables for a C++ compiler are suitably
5816243730Srwatson# defined.  These variables are subsequently used by _LT_CONFIG to write
5817243730Srwatson# the compiler configuration to `libtool'.
5818243730Srwatsonm4_defun([_LT_LANG_CXX_CONFIG],
5819243730Srwatson[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5820243730Srwatsonm4_require([_LT_DECL_EGREP])dnl
5821243730Srwatsonm4_require([_LT_PATH_MANIFEST_TOOL])dnl
5822243730Srwatsonif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5823243730Srwatson    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5824243730Srwatson    (test "X$CXX" != "Xg++"))) ; then
5825243730Srwatson  AC_PROG_CXXCPP
5826243730Srwatsonelse
5827243730Srwatson  _lt_caught_CXX_error=yes
5828243730Srwatsonfi
5829243730Srwatson
5830243730SrwatsonAC_LANG_PUSH(C++)
5831243730Srwatson_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5832243730Srwatson_LT_TAGVAR(allow_undefined_flag, $1)=
5833243730Srwatson_LT_TAGVAR(always_export_symbols, $1)=no
5834243730Srwatson_LT_TAGVAR(archive_expsym_cmds, $1)=
5835243730Srwatson_LT_TAGVAR(compiler_needs_object, $1)=no
5836243730Srwatson_LT_TAGVAR(export_dynamic_flag_spec, $1)=
5837243730Srwatson_LT_TAGVAR(hardcode_direct, $1)=no
5838243730Srwatson_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5839243730Srwatson_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5840243730Srwatson_LT_TAGVAR(hardcode_libdir_separator, $1)=
5841243730Srwatson_LT_TAGVAR(hardcode_minus_L, $1)=no
5842243730Srwatson_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5843243730Srwatson_LT_TAGVAR(hardcode_automatic, $1)=no
5844243730Srwatson_LT_TAGVAR(inherit_rpath, $1)=no
5845243730Srwatson_LT_TAGVAR(module_cmds, $1)=
5846243730Srwatson_LT_TAGVAR(module_expsym_cmds, $1)=
5847243730Srwatson_LT_TAGVAR(link_all_deplibs, $1)=unknown
5848243730Srwatson_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5849243730Srwatson_LT_TAGVAR(reload_flag, $1)=$reload_flag
5850243730Srwatson_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
5851243730Srwatson_LT_TAGVAR(no_undefined_flag, $1)=
5852243730Srwatson_LT_TAGVAR(whole_archive_flag_spec, $1)=
5853243730Srwatson_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5854243730Srwatson
5855243730Srwatson# Source file extension for C++ test sources.
5856243730Srwatsonac_ext=cpp
5857243730Srwatson
5858243730Srwatson# Object file extension for compiled C++ test sources.
5859243730Srwatsonobjext=o
5860243730Srwatson_LT_TAGVAR(objext, $1)=$objext
5861243730Srwatson
5862243730Srwatson# No sense in running all these tests if we already determined that
5863243730Srwatson# the CXX compiler isn't working.  Some variables (like enable_shared)
5864243730Srwatson# are currently assumed to apply to all compilers on this platform,
5865243730Srwatson# and will be corrupted by setting them based on a non-working compiler.
5866243730Srwatsonif test "$_lt_caught_CXX_error" != yes; then
5867243730Srwatson  # Code to be used in simple compile tests
5868243730Srwatson  lt_simple_compile_test_code="int some_variable = 0;"
5869243730Srwatson
5870243730Srwatson  # Code to be used in simple link tests
5871243730Srwatson  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5872243730Srwatson
5873243730Srwatson  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5874243730Srwatson  _LT_TAG_COMPILER
5875243730Srwatson
5876243730Srwatson  # save warnings/boilerplate of simple test code
5877243730Srwatson  _LT_COMPILER_BOILERPLATE
5878243730Srwatson  _LT_LINKER_BOILERPLATE
5879243730Srwatson
5880243730Srwatson  # Allow CC to be a program name with arguments.
5881243730Srwatson  lt_save_CC=$CC
5882243730Srwatson  lt_save_CFLAGS=$CFLAGS
5883243730Srwatson  lt_save_LD=$LD
5884243730Srwatson  lt_save_GCC=$GCC
5885243730Srwatson  GCC=$GXX
5886243730Srwatson  lt_save_with_gnu_ld=$with_gnu_ld
5887243730Srwatson  lt_save_path_LD=$lt_cv_path_LD
5888243730Srwatson  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5889243730Srwatson    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5890243730Srwatson  else
5891243730Srwatson    $as_unset lt_cv_prog_gnu_ld
5892243730Srwatson  fi
5893243730Srwatson  if test -n "${lt_cv_path_LDCXX+set}"; then
5894243730Srwatson    lt_cv_path_LD=$lt_cv_path_LDCXX
5895243730Srwatson  else
5896243730Srwatson    $as_unset lt_cv_path_LD
5897243730Srwatson  fi
5898243730Srwatson  test -z "${LDCXX+set}" || LD=$LDCXX
5899243730Srwatson  CC=${CXX-"c++"}
5900243730Srwatson  CFLAGS=$CXXFLAGS
5901243730Srwatson  compiler=$CC
5902243730Srwatson  _LT_TAGVAR(compiler, $1)=$CC
5903243730Srwatson  _LT_CC_BASENAME([$compiler])
5904243730Srwatson
5905243730Srwatson  if test -n "$compiler"; then
5906243730Srwatson    # We don't want -fno-exception when compiling C++ code, so set the
5907243730Srwatson    # no_builtin_flag separately
5908243730Srwatson    if test "$GXX" = yes; then
5909243730Srwatson      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5910243730Srwatson    else
5911243730Srwatson      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5912243730Srwatson    fi
5913243730Srwatson
5914243730Srwatson    if test "$GXX" = yes; then
5915243730Srwatson      # Set up default GNU C++ configuration
5916243730Srwatson
5917243730Srwatson      LT_PATH_LD
5918243730Srwatson
5919243730Srwatson      # Check if GNU C++ uses GNU ld as the underlying linker, since the
5920243730Srwatson      # archiving commands below assume that GNU ld is being used.
5921243730Srwatson      if test "$with_gnu_ld" = yes; then
5922243730Srwatson        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5923243730Srwatson        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5924243730Srwatson
5925243730Srwatson        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5926243730Srwatson        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5927243730Srwatson
5928243730Srwatson        # If archive_cmds runs LD, not CC, wlarc should be empty
5929243730Srwatson        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5930243730Srwatson        #     investigate it a little bit more. (MM)
5931243730Srwatson        wlarc='${wl}'
5932243730Srwatson
5933243730Srwatson        # ancient GNU ld didn't support --whole-archive et. al.
5934243730Srwatson        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5935243730Srwatson	  $GREP 'no-whole-archive' > /dev/null; then
5936243730Srwatson          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5937243730Srwatson        else
5938243730Srwatson          _LT_TAGVAR(whole_archive_flag_spec, $1)=
5939243730Srwatson        fi
5940243730Srwatson      else
5941243730Srwatson        with_gnu_ld=no
5942243730Srwatson        wlarc=
5943243730Srwatson
5944243730Srwatson        # A generic and very simple default shared library creation
5945243730Srwatson        # command for GNU C++ for the case where it uses the native
5946243730Srwatson        # linker, instead of GNU ld.  If possible, this setting should
5947243730Srwatson        # overridden to take advantage of the native linker features on
5948243730Srwatson        # the platform it is being used on.
5949243730Srwatson        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5950243730Srwatson      fi
5951243730Srwatson
5952243730Srwatson      # Commands to make compiler produce verbose output that lists
5953243730Srwatson      # what "hidden" libraries, object files and flags are used when
5954243730Srwatson      # linking a shared library.
5955243730Srwatson      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
5956243730Srwatson
5957243730Srwatson    else
5958243730Srwatson      GXX=no
5959243730Srwatson      with_gnu_ld=no
5960243730Srwatson      wlarc=
5961243730Srwatson    fi
5962243730Srwatson
5963243730Srwatson    # PORTME: fill in a description of your system's C++ link characteristics
5964243730Srwatson    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5965243730Srwatson    _LT_TAGVAR(ld_shlibs, $1)=yes
5966243730Srwatson    case $host_os in
5967243730Srwatson      aix3*)
5968243730Srwatson        # FIXME: insert proper C++ library support
5969243730Srwatson        _LT_TAGVAR(ld_shlibs, $1)=no
5970243730Srwatson        ;;
5971243730Srwatson      aix[[4-9]]*)
5972243730Srwatson        if test "$host_cpu" = ia64; then
5973243730Srwatson          # On IA64, the linker does run time linking by default, so we don't
5974243730Srwatson          # have to do anything special.
5975243730Srwatson          aix_use_runtimelinking=no
5976243730Srwatson          exp_sym_flag='-Bexport'
5977243730Srwatson          no_entry_flag=""
5978243730Srwatson        else
5979243730Srwatson          aix_use_runtimelinking=no
5980243730Srwatson
5981243730Srwatson          # Test if we are trying to use run time linking or normal
5982243730Srwatson          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5983243730Srwatson          # need to do runtime linking.
5984243730Srwatson          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5985243730Srwatson	    for ld_flag in $LDFLAGS; do
5986243730Srwatson	      case $ld_flag in
5987243730Srwatson	      *-brtl*)
5988243730Srwatson	        aix_use_runtimelinking=yes
5989243730Srwatson	        break
5990243730Srwatson	        ;;
5991243730Srwatson	      esac
5992243730Srwatson	    done
5993243730Srwatson	    ;;
5994243730Srwatson          esac
5995243730Srwatson
5996243730Srwatson          exp_sym_flag='-bexport'
5997243730Srwatson          no_entry_flag='-bnoentry'
5998243730Srwatson        fi
5999243730Srwatson
6000243730Srwatson        # When large executables or shared objects are built, AIX ld can
6001243730Srwatson        # have problems creating the table of contents.  If linking a library
6002243730Srwatson        # or program results in "error TOC overflow" add -mminimal-toc to
6003243730Srwatson        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6004243730Srwatson        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6005243730Srwatson
6006243730Srwatson        _LT_TAGVAR(archive_cmds, $1)=''
6007243730Srwatson        _LT_TAGVAR(hardcode_direct, $1)=yes
6008243730Srwatson        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6009243730Srwatson        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6010243730Srwatson        _LT_TAGVAR(link_all_deplibs, $1)=yes
6011243730Srwatson        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6012243730Srwatson
6013243730Srwatson        if test "$GXX" = yes; then
6014243730Srwatson          case $host_os in aix4.[[012]]|aix4.[[012]].*)
6015243730Srwatson          # We only want to do this on AIX 4.2 and lower, the check
6016243730Srwatson          # below for broken collect2 doesn't work under 4.3+
6017243730Srwatson	  collect2name=`${CC} -print-prog-name=collect2`
6018243730Srwatson	  if test -f "$collect2name" &&
6019243730Srwatson	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6020243730Srwatson	  then
6021243730Srwatson	    # We have reworked collect2
6022243730Srwatson	    :
6023243730Srwatson	  else
6024243730Srwatson	    # We have old collect2
6025243730Srwatson	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
6026243730Srwatson	    # It fails to find uninstalled libraries when the uninstalled
6027243730Srwatson	    # path is not listed in the libpath.  Setting hardcode_minus_L
6028243730Srwatson	    # to unsupported forces relinking
6029243730Srwatson	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
6030243730Srwatson	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6031243730Srwatson	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
6032243730Srwatson	  fi
6033243730Srwatson          esac
6034243730Srwatson          shared_flag='-shared'
6035243730Srwatson	  if test "$aix_use_runtimelinking" = yes; then
6036243730Srwatson	    shared_flag="$shared_flag "'${wl}-G'
6037243730Srwatson	  fi
6038243730Srwatson        else
6039243730Srwatson          # not using gcc
6040243730Srwatson          if test "$host_cpu" = ia64; then
6041243730Srwatson	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6042243730Srwatson	  # chokes on -Wl,-G. The following line is correct:
6043243730Srwatson	  shared_flag='-G'
6044243730Srwatson          else
6045243730Srwatson	    if test "$aix_use_runtimelinking" = yes; then
6046243730Srwatson	      shared_flag='${wl}-G'
6047243730Srwatson	    else
6048243730Srwatson	      shared_flag='${wl}-bM:SRE'
6049243730Srwatson	    fi
6050243730Srwatson          fi
6051243730Srwatson        fi
6052243730Srwatson
6053243730Srwatson        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6054243730Srwatson        # It seems that -bexpall does not export symbols beginning with
6055243730Srwatson        # underscore (_), so it is better to generate a list of symbols to
6056243730Srwatson	# export.
6057243730Srwatson        _LT_TAGVAR(always_export_symbols, $1)=yes
6058243730Srwatson        if test "$aix_use_runtimelinking" = yes; then
6059243730Srwatson          # Warning - without using the other runtime loading flags (-brtl),
6060243730Srwatson          # -berok will link without error, but may produce a broken library.
6061243730Srwatson          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6062243730Srwatson          # Determine the default libpath from the value encoded in an empty
6063243730Srwatson          # executable.
6064243730Srwatson          _LT_SYS_MODULE_PATH_AIX([$1])
6065243730Srwatson          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6066243730Srwatson
6067243730Srwatson          _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"
6068243730Srwatson        else
6069243730Srwatson          if test "$host_cpu" = ia64; then
6070243730Srwatson	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6071243730Srwatson	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6072243730Srwatson	    _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"
6073243730Srwatson          else
6074243730Srwatson	    # Determine the default libpath from the value encoded in an
6075243730Srwatson	    # empty executable.
6076243730Srwatson	    _LT_SYS_MODULE_PATH_AIX([$1])
6077243730Srwatson	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6078243730Srwatson	    # Warning - without using the other run time loading flags,
6079243730Srwatson	    # -berok will link without error, but may produce a broken library.
6080243730Srwatson	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6081243730Srwatson	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6082243730Srwatson	    if test "$with_gnu_ld" = yes; then
6083243730Srwatson	      # We only use this code for GNU lds that support --whole-archive.
6084243730Srwatson	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6085243730Srwatson	    else
6086243730Srwatson	      # Exported symbols can be pulled into shared objects from archives
6087243730Srwatson	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6088243730Srwatson	    fi
6089243730Srwatson	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6090243730Srwatson	    # This is similar to how AIX traditionally builds its shared
6091243730Srwatson	    # libraries.
6092243730Srwatson	    _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'
6093243730Srwatson          fi
6094243730Srwatson        fi
6095243730Srwatson        ;;
6096243730Srwatson
6097243730Srwatson      beos*)
6098243730Srwatson	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6099243730Srwatson	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6100243730Srwatson	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6101243730Srwatson	  # support --undefined.  This deserves some investigation.  FIXME
6102243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6103243730Srwatson	else
6104243730Srwatson	  _LT_TAGVAR(ld_shlibs, $1)=no
6105243730Srwatson	fi
6106243730Srwatson	;;
6107243730Srwatson
6108243730Srwatson      chorus*)
6109243730Srwatson        case $cc_basename in
6110243730Srwatson          *)
6111243730Srwatson	  # FIXME: insert proper C++ library support
6112243730Srwatson	  _LT_TAGVAR(ld_shlibs, $1)=no
6113243730Srwatson	  ;;
6114243730Srwatson        esac
6115243730Srwatson        ;;
6116243730Srwatson
6117243730Srwatson      cygwin* | mingw* | pw32* | cegcc*)
6118243730Srwatson	case $GXX,$cc_basename in
6119243730Srwatson	,cl* | no,cl*)
6120243730Srwatson	  # Native MSVC
6121243730Srwatson	  # hardcode_libdir_flag_spec is actually meaningless, as there is
6122243730Srwatson	  # no search path for DLLs.
6123243730Srwatson	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6124243730Srwatson	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6125243730Srwatson	  _LT_TAGVAR(always_export_symbols, $1)=yes
6126243730Srwatson	  _LT_TAGVAR(file_list_spec, $1)='@'
6127243730Srwatson	  # Tell ltmain to make .lib files, not .a files.
6128243730Srwatson	  libext=lib
6129243730Srwatson	  # Tell ltmain to make .dll files, not .so files.
6130243730Srwatson	  shrext_cmds=".dll"
6131243730Srwatson	  # FIXME: Setting linknames here is a bad hack.
6132243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6133243730Srwatson	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6134243730Srwatson	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6135243730Srwatson	    else
6136243730Srwatson	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6137243730Srwatson	    fi~
6138243730Srwatson	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6139243730Srwatson	    linknames='
6140243730Srwatson	  # The linker will not automatically build a static lib if we build a DLL.
6141243730Srwatson	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6142243730Srwatson	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6143243730Srwatson	  # Don't use ranlib
6144243730Srwatson	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6145243730Srwatson	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6146243730Srwatson	    lt_tool_outputfile="@TOOL_OUTPUT@"~
6147243730Srwatson	    case $lt_outputfile in
6148243730Srwatson	      *.exe|*.EXE) ;;
6149243730Srwatson	      *)
6150243730Srwatson		lt_outputfile="$lt_outputfile.exe"
6151243730Srwatson		lt_tool_outputfile="$lt_tool_outputfile.exe"
6152243730Srwatson		;;
6153243730Srwatson	    esac~
6154243730Srwatson	    func_to_tool_file "$lt_outputfile"~
6155243730Srwatson	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6156243730Srwatson	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6157243730Srwatson	      $RM "$lt_outputfile.manifest";
6158243730Srwatson	    fi'
6159243730Srwatson	  ;;
6160243730Srwatson	*)
6161243730Srwatson	  # g++
6162243730Srwatson	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6163243730Srwatson	  # as there is no search path for DLLs.
6164243730Srwatson	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6165243730Srwatson	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
6166243730Srwatson	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6167243730Srwatson	  _LT_TAGVAR(always_export_symbols, $1)=no
6168243730Srwatson	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6169243730Srwatson
6170243730Srwatson	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6171243730Srwatson	    _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'
6172243730Srwatson	    # If the export-symbols file already is a .def file (1st line
6173243730Srwatson	    # is EXPORTS), use it as is; otherwise, prepend...
6174243730Srwatson	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6175243730Srwatson	      cp $export_symbols $output_objdir/$soname.def;
6176243730Srwatson	    else
6177243730Srwatson	      echo EXPORTS > $output_objdir/$soname.def;
6178243730Srwatson	      cat $export_symbols >> $output_objdir/$soname.def;
6179243730Srwatson	    fi~
6180243730Srwatson	    $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'
6181243730Srwatson	  else
6182243730Srwatson	    _LT_TAGVAR(ld_shlibs, $1)=no
6183243730Srwatson	  fi
6184243730Srwatson	  ;;
6185243730Srwatson	esac
6186243730Srwatson	;;
6187243730Srwatson      darwin* | rhapsody*)
6188243730Srwatson        _LT_DARWIN_LINKER_FEATURES($1)
6189243730Srwatson	;;
6190243730Srwatson
6191243730Srwatson      dgux*)
6192243730Srwatson        case $cc_basename in
6193243730Srwatson          ec++*)
6194243730Srwatson	    # FIXME: insert proper C++ library support
6195243730Srwatson	    _LT_TAGVAR(ld_shlibs, $1)=no
6196243730Srwatson	    ;;
6197243730Srwatson          ghcx*)
6198243730Srwatson	    # Green Hills C++ Compiler
6199243730Srwatson	    # FIXME: insert proper C++ library support
6200243730Srwatson	    _LT_TAGVAR(ld_shlibs, $1)=no
6201243730Srwatson	    ;;
6202243730Srwatson          *)
6203243730Srwatson	    # FIXME: insert proper C++ library support
6204243730Srwatson	    _LT_TAGVAR(ld_shlibs, $1)=no
6205243730Srwatson	    ;;
6206243730Srwatson        esac
6207243730Srwatson        ;;
6208243730Srwatson
6209243730Srwatson      freebsd2.*)
6210243730Srwatson        # C++ shared libraries reported to be fairly broken before
6211243730Srwatson	# switch to ELF
6212243730Srwatson        _LT_TAGVAR(ld_shlibs, $1)=no
6213243730Srwatson        ;;
6214243730Srwatson
6215243730Srwatson      freebsd-elf*)
6216243730Srwatson        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6217243730Srwatson        ;;
6218243730Srwatson
6219243730Srwatson      freebsd* | dragonfly*)
6220243730Srwatson        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6221243730Srwatson        # conventions
6222243730Srwatson        _LT_TAGVAR(ld_shlibs, $1)=yes
6223243730Srwatson        ;;
6224243730Srwatson
6225243730Srwatson      gnu*)
6226243730Srwatson        ;;
6227243730Srwatson
6228243730Srwatson      haiku*)
6229243730Srwatson        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6230243730Srwatson        _LT_TAGVAR(link_all_deplibs, $1)=yes
6231243730Srwatson        ;;
6232243730Srwatson
6233243730Srwatson      hpux9*)
6234243730Srwatson        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6235243730Srwatson        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6236243730Srwatson        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6237243730Srwatson        _LT_TAGVAR(hardcode_direct, $1)=yes
6238243730Srwatson        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6239243730Srwatson				             # but as the default
6240243730Srwatson				             # location of the library.
6241243730Srwatson
6242243730Srwatson        case $cc_basename in
6243243730Srwatson          CC*)
6244243730Srwatson            # FIXME: insert proper C++ library support
6245243730Srwatson            _LT_TAGVAR(ld_shlibs, $1)=no
6246243730Srwatson            ;;
6247243730Srwatson          aCC*)
6248243730Srwatson            _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'
6249243730Srwatson            # Commands to make compiler produce verbose output that lists
6250243730Srwatson            # what "hidden" libraries, object files and flags are used when
6251243730Srwatson            # linking a shared library.
6252243730Srwatson            #
6253243730Srwatson            # There doesn't appear to be a way to prevent this compiler from
6254243730Srwatson            # explicitly linking system object files so we need to strip them
6255243730Srwatson            # from the output so that they don't get included in the library
6256243730Srwatson            # dependencies.
6257243730Srwatson            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"'
6258243730Srwatson            ;;
6259243730Srwatson          *)
6260243730Srwatson            if test "$GXX" = yes; then
6261243730Srwatson              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6262243730Srwatson            else
6263243730Srwatson              # FIXME: insert proper C++ library support
6264243730Srwatson              _LT_TAGVAR(ld_shlibs, $1)=no
6265243730Srwatson            fi
6266243730Srwatson            ;;
6267243730Srwatson        esac
6268243730Srwatson        ;;
6269243730Srwatson
6270243730Srwatson      hpux10*|hpux11*)
6271243730Srwatson        if test $with_gnu_ld = no; then
6272243730Srwatson	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6273243730Srwatson	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6274243730Srwatson
6275243730Srwatson          case $host_cpu in
6276243730Srwatson            hppa*64*|ia64*)
6277243730Srwatson              ;;
6278243730Srwatson            *)
6279243730Srwatson	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6280243730Srwatson              ;;
6281243730Srwatson          esac
6282243730Srwatson        fi
6283243730Srwatson        case $host_cpu in
6284243730Srwatson          hppa*64*|ia64*)
6285243730Srwatson            _LT_TAGVAR(hardcode_direct, $1)=no
6286243730Srwatson            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6287243730Srwatson            ;;
6288243730Srwatson          *)
6289243730Srwatson            _LT_TAGVAR(hardcode_direct, $1)=yes
6290243730Srwatson            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6291243730Srwatson            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6292243730Srwatson					         # but as the default
6293243730Srwatson					         # location of the library.
6294243730Srwatson            ;;
6295243730Srwatson        esac
6296243730Srwatson
6297243730Srwatson        case $cc_basename in
6298243730Srwatson          CC*)
6299243730Srwatson	    # FIXME: insert proper C++ library support
6300243730Srwatson	    _LT_TAGVAR(ld_shlibs, $1)=no
6301243730Srwatson	    ;;
6302243730Srwatson          aCC*)
6303243730Srwatson	    case $host_cpu in
6304243730Srwatson	      hppa*64*)
6305243730Srwatson	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6306243730Srwatson	        ;;
6307243730Srwatson	      ia64*)
6308243730Srwatson	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6309243730Srwatson	        ;;
6310243730Srwatson	      *)
6311243730Srwatson	        _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'
6312243730Srwatson	        ;;
6313243730Srwatson	    esac
6314243730Srwatson	    # Commands to make compiler produce verbose output that lists
6315243730Srwatson	    # what "hidden" libraries, object files and flags are used when
6316243730Srwatson	    # linking a shared library.
6317243730Srwatson	    #
6318243730Srwatson	    # There doesn't appear to be a way to prevent this compiler from
6319243730Srwatson	    # explicitly linking system object files so we need to strip them
6320243730Srwatson	    # from the output so that they don't get included in the library
6321243730Srwatson	    # dependencies.
6322243730Srwatson	    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"'
6323243730Srwatson	    ;;
6324243730Srwatson          *)
6325243730Srwatson	    if test "$GXX" = yes; then
6326243730Srwatson	      if test $with_gnu_ld = no; then
6327243730Srwatson	        case $host_cpu in
6328243730Srwatson	          hppa*64*)
6329243730Srwatson	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6330243730Srwatson	            ;;
6331243730Srwatson	          ia64*)
6332243730Srwatson	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6333243730Srwatson	            ;;
6334243730Srwatson	          *)
6335243730Srwatson	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6336243730Srwatson	            ;;
6337243730Srwatson	        esac
6338243730Srwatson	      fi
6339243730Srwatson	    else
6340243730Srwatson	      # FIXME: insert proper C++ library support
6341243730Srwatson	      _LT_TAGVAR(ld_shlibs, $1)=no
6342243730Srwatson	    fi
6343243730Srwatson	    ;;
6344243730Srwatson        esac
6345243730Srwatson        ;;
6346243730Srwatson
6347243730Srwatson      interix[[3-9]]*)
6348243730Srwatson	_LT_TAGVAR(hardcode_direct, $1)=no
6349243730Srwatson	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6350243730Srwatson	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6351243730Srwatson	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6352243730Srwatson	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6353243730Srwatson	# Instead, shared libraries are loaded at an image base (0x10000000 by
6354243730Srwatson	# default) and relocated if they conflict, which is a slow very memory
6355243730Srwatson	# consuming and fragmenting process.  To avoid this, we pick a random,
6356243730Srwatson	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6357243730Srwatson	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6358243730Srwatson	_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'
6359243730Srwatson	_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'
6360243730Srwatson	;;
6361243730Srwatson      irix5* | irix6*)
6362243730Srwatson        case $cc_basename in
6363243730Srwatson          CC*)
6364243730Srwatson	    # SGI C++
6365243730Srwatson	    _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'
6366243730Srwatson
6367243730Srwatson	    # Archives containing C++ object files must be created using
6368243730Srwatson	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
6369243730Srwatson	    # necessary to make sure instantiated templates are included
6370243730Srwatson	    # in the archive.
6371243730Srwatson	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6372243730Srwatson	    ;;
6373243730Srwatson          *)
6374243730Srwatson	    if test "$GXX" = yes; then
6375243730Srwatson	      if test "$with_gnu_ld" = no; then
6376243730Srwatson	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6377243730Srwatson	      else
6378243730Srwatson	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
6379243730Srwatson	      fi
6380243730Srwatson	    fi
6381243730Srwatson	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6382243730Srwatson	    ;;
6383243730Srwatson        esac
6384243730Srwatson        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6385243730Srwatson        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6386243730Srwatson        _LT_TAGVAR(inherit_rpath, $1)=yes
6387243730Srwatson        ;;
6388243730Srwatson
6389243730Srwatson      linux* | k*bsd*-gnu | kopensolaris*-gnu)
6390243730Srwatson        case $cc_basename in
6391243730Srwatson          KCC*)
6392243730Srwatson	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6393243730Srwatson
6394243730Srwatson	    # KCC will only create a shared library if the output file
6395243730Srwatson	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6396243730Srwatson	    # to its proper name (with version) after linking.
6397243730Srwatson	    _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'
6398243730Srwatson	    _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'
6399243730Srwatson	    # Commands to make compiler produce verbose output that lists
6400243730Srwatson	    # what "hidden" libraries, object files and flags are used when
6401243730Srwatson	    # linking a shared library.
6402243730Srwatson	    #
6403243730Srwatson	    # There doesn't appear to be a way to prevent this compiler from
6404243730Srwatson	    # explicitly linking system object files so we need to strip them
6405243730Srwatson	    # from the output so that they don't get included in the library
6406243730Srwatson	    # dependencies.
6407243730Srwatson	    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"'
6408243730Srwatson
6409243730Srwatson	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6410243730Srwatson	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6411243730Srwatson
6412243730Srwatson	    # Archives containing C++ object files must be created using
6413243730Srwatson	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6414243730Srwatson	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6415243730Srwatson	    ;;
6416243730Srwatson	  icpc* | ecpc* )
6417243730Srwatson	    # Intel C++
6418243730Srwatson	    with_gnu_ld=yes
6419243730Srwatson	    # version 8.0 and above of icpc choke on multiply defined symbols
6420243730Srwatson	    # if we add $predep_objects and $postdep_objects, however 7.1 and
6421243730Srwatson	    # earlier do not add the objects themselves.
6422243730Srwatson	    case `$CC -V 2>&1` in
6423243730Srwatson	      *"Version 7."*)
6424243730Srwatson	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6425243730Srwatson		_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'
6426243730Srwatson		;;
6427243730Srwatson	      *)  # Version 8.0 or newer
6428243730Srwatson	        tmp_idyn=
6429243730Srwatson	        case $host_cpu in
6430243730Srwatson		  ia64*) tmp_idyn=' -i_dynamic';;
6431243730Srwatson		esac
6432243730Srwatson	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6433243730Srwatson		_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'
6434243730Srwatson		;;
6435243730Srwatson	    esac
6436243730Srwatson	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6437243730Srwatson	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6438243730Srwatson	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6439243730Srwatson	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6440243730Srwatson	    ;;
6441243730Srwatson          pgCC* | pgcpp*)
6442243730Srwatson            # Portland Group C++ compiler
6443243730Srwatson	    case `$CC -V` in
6444243730Srwatson	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
6445243730Srwatson	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
6446243730Srwatson		rm -rf $tpldir~
6447243730Srwatson		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
6448243730Srwatson		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
6449243730Srwatson	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
6450243730Srwatson		rm -rf $tpldir~
6451243730Srwatson		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
6452243730Srwatson		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
6453243730Srwatson		$RANLIB $oldlib'
6454243730Srwatson	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
6455243730Srwatson		rm -rf $tpldir~
6456243730Srwatson		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6457243730Srwatson		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6458243730Srwatson	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
6459243730Srwatson		rm -rf $tpldir~
6460243730Srwatson		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6461243730Srwatson		$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'
6462243730Srwatson	      ;;
6463243730Srwatson	    *) # Version 6 and above use weak symbols
6464243730Srwatson	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6465243730Srwatson	      _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'
6466243730Srwatson	      ;;
6467243730Srwatson	    esac
6468243730Srwatson
6469243730Srwatson	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
6470243730Srwatson	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6471243730Srwatson	    _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'
6472243730Srwatson            ;;
6473243730Srwatson	  cxx*)
6474243730Srwatson	    # Compaq C++
6475243730Srwatson	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6476243730Srwatson	    _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'
6477243730Srwatson
6478243730Srwatson	    runpath_var=LD_RUN_PATH
6479243730Srwatson	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6480243730Srwatson	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6481243730Srwatson
6482243730Srwatson	    # Commands to make compiler produce verbose output that lists
6483243730Srwatson	    # what "hidden" libraries, object files and flags are used when
6484243730Srwatson	    # linking a shared library.
6485243730Srwatson	    #
6486243730Srwatson	    # There doesn't appear to be a way to prevent this compiler from
6487243730Srwatson	    # explicitly linking system object files so we need to strip them
6488243730Srwatson	    # from the output so that they don't get included in the library
6489243730Srwatson	    # dependencies.
6490243730Srwatson	    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'
6491243730Srwatson	    ;;
6492243730Srwatson	  xl* | mpixl* | bgxl*)
6493243730Srwatson	    # IBM XL 8.0 on PPC, with GNU ld
6494243730Srwatson	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6495243730Srwatson	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6496243730Srwatson	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6497243730Srwatson	    if test "x$supports_anon_versioning" = xyes; then
6498243730Srwatson	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
6499243730Srwatson		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6500243730Srwatson		echo "local: *; };" >> $output_objdir/$libname.ver~
6501243730Srwatson		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
6502243730Srwatson	    fi
6503243730Srwatson	    ;;
6504243730Srwatson	  *)
6505243730Srwatson	    case `$CC -V 2>&1 | sed 5q` in
6506243730Srwatson	    *Sun\ C*)
6507243730Srwatson	      # Sun C++ 5.9
6508243730Srwatson	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6509243730Srwatson	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6510243730Srwatson	      _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'
6511243730Srwatson	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6512243730Srwatson	      _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'
6513243730Srwatson	      _LT_TAGVAR(compiler_needs_object, $1)=yes
6514243730Srwatson
6515243730Srwatson	      # Not sure whether something based on
6516243730Srwatson	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
6517243730Srwatson	      # would be better.
6518243730Srwatson	      output_verbose_link_cmd='func_echo_all'
6519243730Srwatson
6520243730Srwatson	      # Archives containing C++ object files must be created using
6521243730Srwatson	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6522243730Srwatson	      # necessary to make sure instantiated templates are included
6523243730Srwatson	      # in the archive.
6524243730Srwatson	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6525243730Srwatson	      ;;
6526243730Srwatson	    esac
6527243730Srwatson	    ;;
6528243730Srwatson	esac
6529243730Srwatson	;;
6530243730Srwatson
6531243730Srwatson      lynxos*)
6532243730Srwatson        # FIXME: insert proper C++ library support
6533243730Srwatson	_LT_TAGVAR(ld_shlibs, $1)=no
6534243730Srwatson	;;
6535243730Srwatson
6536243730Srwatson      m88k*)
6537243730Srwatson        # FIXME: insert proper C++ library support
6538243730Srwatson        _LT_TAGVAR(ld_shlibs, $1)=no
6539243730Srwatson	;;
6540243730Srwatson
6541243730Srwatson      mvs*)
6542243730Srwatson        case $cc_basename in
6543243730Srwatson          cxx*)
6544243730Srwatson	    # FIXME: insert proper C++ library support
6545243730Srwatson	    _LT_TAGVAR(ld_shlibs, $1)=no
6546243730Srwatson	    ;;
6547243730Srwatson	  *)
6548243730Srwatson	    # FIXME: insert proper C++ library support
6549243730Srwatson	    _LT_TAGVAR(ld_shlibs, $1)=no
6550243730Srwatson	    ;;
6551243730Srwatson	esac
6552243730Srwatson	;;
6553243730Srwatson
6554243730Srwatson      netbsd*)
6555243730Srwatson        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6556243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6557243730Srwatson	  wlarc=
6558243730Srwatson	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6559243730Srwatson	  _LT_TAGVAR(hardcode_direct, $1)=yes
6560243730Srwatson	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6561243730Srwatson	fi
6562243730Srwatson	# Workaround some broken pre-1.5 toolchains
6563243730Srwatson	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6564243730Srwatson	;;
6565243730Srwatson
6566243730Srwatson      *nto* | *qnx*)
6567243730Srwatson        _LT_TAGVAR(ld_shlibs, $1)=yes
6568243730Srwatson	;;
6569243730Srwatson
6570243730Srwatson      openbsd2*)
6571243730Srwatson        # C++ shared libraries are fairly broken
6572243730Srwatson	_LT_TAGVAR(ld_shlibs, $1)=no
6573243730Srwatson	;;
6574243730Srwatson
6575243730Srwatson      openbsd*)
6576243730Srwatson	if test -f /usr/libexec/ld.so; then
6577243730Srwatson	  _LT_TAGVAR(hardcode_direct, $1)=yes
6578243730Srwatson	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6579243730Srwatson	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6580243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6581243730Srwatson	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6582243730Srwatson	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6583243730Srwatson	    _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'
6584243730Srwatson	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6585243730Srwatson	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6586243730Srwatson	  fi
6587243730Srwatson	  output_verbose_link_cmd=func_echo_all
6588243730Srwatson	else
6589243730Srwatson	  _LT_TAGVAR(ld_shlibs, $1)=no
6590243730Srwatson	fi
6591243730Srwatson	;;
6592243730Srwatson
6593243730Srwatson      osf3* | osf4* | osf5*)
6594243730Srwatson        case $cc_basename in
6595243730Srwatson          KCC*)
6596243730Srwatson	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6597243730Srwatson
6598243730Srwatson	    # KCC will only create a shared library if the output file
6599243730Srwatson	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6600243730Srwatson	    # to its proper name (with version) after linking.
6601243730Srwatson	    _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'
6602243730Srwatson
6603243730Srwatson	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6604243730Srwatson	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6605243730Srwatson
6606243730Srwatson	    # Archives containing C++ object files must be created using
6607243730Srwatson	    # the KAI C++ compiler.
6608243730Srwatson	    case $host in
6609243730Srwatson	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6610243730Srwatson	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6611243730Srwatson	    esac
6612243730Srwatson	    ;;
6613243730Srwatson          RCC*)
6614243730Srwatson	    # Rational C++ 2.4.1
6615243730Srwatson	    # FIXME: insert proper C++ library support
6616243730Srwatson	    _LT_TAGVAR(ld_shlibs, $1)=no
6617243730Srwatson	    ;;
6618243730Srwatson          cxx*)
6619243730Srwatson	    case $host in
6620243730Srwatson	      osf3*)
6621243730Srwatson	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6622243730Srwatson	        _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'
6623243730Srwatson	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6624243730Srwatson		;;
6625243730Srwatson	      *)
6626243730Srwatson	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6627243730Srwatson	        _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'
6628243730Srwatson	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6629243730Srwatson	          echo "-hidden">> $lib.exp~
6630243730Srwatson	          $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~
6631243730Srwatson	          $RM $lib.exp'
6632243730Srwatson	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6633243730Srwatson		;;
6634243730Srwatson	    esac
6635243730Srwatson
6636243730Srwatson	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6637243730Srwatson
6638243730Srwatson	    # Commands to make compiler produce verbose output that lists
6639243730Srwatson	    # what "hidden" libraries, object files and flags are used when
6640243730Srwatson	    # linking a shared library.
6641243730Srwatson	    #
6642243730Srwatson	    # There doesn't appear to be a way to prevent this compiler from
6643243730Srwatson	    # explicitly linking system object files so we need to strip them
6644243730Srwatson	    # from the output so that they don't get included in the library
6645243730Srwatson	    # dependencies.
6646243730Srwatson	    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"'
6647243730Srwatson	    ;;
6648243730Srwatson	  *)
6649243730Srwatson	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6650243730Srwatson	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6651243730Srwatson	      case $host in
6652243730Srwatson	        osf3*)
6653243730Srwatson	          _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'
6654243730Srwatson		  ;;
6655243730Srwatson	        *)
6656243730Srwatson	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6657243730Srwatson		  ;;
6658243730Srwatson	      esac
6659243730Srwatson
6660243730Srwatson	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6661243730Srwatson	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6662243730Srwatson
6663243730Srwatson	      # Commands to make compiler produce verbose output that lists
6664243730Srwatson	      # what "hidden" libraries, object files and flags are used when
6665243730Srwatson	      # linking a shared library.
6666243730Srwatson	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6667243730Srwatson
6668243730Srwatson	    else
6669243730Srwatson	      # FIXME: insert proper C++ library support
6670243730Srwatson	      _LT_TAGVAR(ld_shlibs, $1)=no
6671243730Srwatson	    fi
6672243730Srwatson	    ;;
6673243730Srwatson        esac
6674243730Srwatson        ;;
6675243730Srwatson
6676243730Srwatson      psos*)
6677243730Srwatson        # FIXME: insert proper C++ library support
6678243730Srwatson        _LT_TAGVAR(ld_shlibs, $1)=no
6679243730Srwatson        ;;
6680243730Srwatson
6681243730Srwatson      sunos4*)
6682243730Srwatson        case $cc_basename in
6683243730Srwatson          CC*)
6684243730Srwatson	    # Sun C++ 4.x
6685243730Srwatson	    # FIXME: insert proper C++ library support
6686243730Srwatson	    _LT_TAGVAR(ld_shlibs, $1)=no
6687243730Srwatson	    ;;
6688243730Srwatson          lcc*)
6689243730Srwatson	    # Lucid
6690243730Srwatson	    # FIXME: insert proper C++ library support
6691243730Srwatson	    _LT_TAGVAR(ld_shlibs, $1)=no
6692243730Srwatson	    ;;
6693243730Srwatson          *)
6694243730Srwatson	    # FIXME: insert proper C++ library support
6695243730Srwatson	    _LT_TAGVAR(ld_shlibs, $1)=no
6696243730Srwatson	    ;;
6697243730Srwatson        esac
6698243730Srwatson        ;;
6699243730Srwatson
6700243730Srwatson      solaris*)
6701243730Srwatson        case $cc_basename in
6702243730Srwatson          CC* | sunCC*)
6703243730Srwatson	    # Sun C++ 4.2, 5.x and Centerline C++
6704243730Srwatson            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6705243730Srwatson	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6706243730Srwatson	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6707243730Srwatson	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6708243730Srwatson	      $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'
6709243730Srwatson
6710243730Srwatson	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6711243730Srwatson	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6712243730Srwatson	    case $host_os in
6713243730Srwatson	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6714243730Srwatson	      *)
6715243730Srwatson		# The compiler driver will combine and reorder linker options,
6716243730Srwatson		# but understands `-z linker_flag'.
6717243730Srwatson	        # Supported since Solaris 2.6 (maybe 2.5.1?)
6718243730Srwatson		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6719243730Srwatson	        ;;
6720243730Srwatson	    esac
6721243730Srwatson	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6722243730Srwatson
6723243730Srwatson	    output_verbose_link_cmd='func_echo_all'
6724243730Srwatson
6725243730Srwatson	    # Archives containing C++ object files must be created using
6726243730Srwatson	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6727243730Srwatson	    # necessary to make sure instantiated templates are included
6728243730Srwatson	    # in the archive.
6729243730Srwatson	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6730243730Srwatson	    ;;
6731243730Srwatson          gcx*)
6732243730Srwatson	    # Green Hills C++ Compiler
6733243730Srwatson	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6734243730Srwatson
6735243730Srwatson	    # The C++ compiler must be used to create the archive.
6736243730Srwatson	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6737243730Srwatson	    ;;
6738243730Srwatson          *)
6739243730Srwatson	    # GNU C++ compiler with Solaris linker
6740243730Srwatson	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6741243730Srwatson	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6742243730Srwatson	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6743243730Srwatson	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6744243730Srwatson	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6745243730Srwatson		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6746243730Srwatson
6747243730Srwatson	        # Commands to make compiler produce verbose output that lists
6748243730Srwatson	        # what "hidden" libraries, object files and flags are used when
6749243730Srwatson	        # linking a shared library.
6750243730Srwatson	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6751243730Srwatson	      else
6752243730Srwatson	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
6753243730Srwatson	        # platform.
6754243730Srwatson	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6755243730Srwatson	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6756243730Srwatson		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6757243730Srwatson
6758243730Srwatson	        # Commands to make compiler produce verbose output that lists
6759243730Srwatson	        # what "hidden" libraries, object files and flags are used when
6760243730Srwatson	        # linking a shared library.
6761243730Srwatson	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6762243730Srwatson	      fi
6763243730Srwatson
6764243730Srwatson	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6765243730Srwatson	      case $host_os in
6766243730Srwatson		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6767243730Srwatson		*)
6768243730Srwatson		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6769243730Srwatson		  ;;
6770243730Srwatson	      esac
6771243730Srwatson	    fi
6772243730Srwatson	    ;;
6773243730Srwatson        esac
6774243730Srwatson        ;;
6775243730Srwatson
6776243730Srwatson    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6777243730Srwatson      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6778243730Srwatson      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6779243730Srwatson      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6780243730Srwatson      runpath_var='LD_RUN_PATH'
6781243730Srwatson
6782243730Srwatson      case $cc_basename in
6783243730Srwatson        CC*)
6784243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6785243730Srwatson	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6786243730Srwatson	  ;;
6787243730Srwatson	*)
6788243730Srwatson	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6789243730Srwatson	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6790243730Srwatson	  ;;
6791243730Srwatson      esac
6792243730Srwatson      ;;
6793243730Srwatson
6794243730Srwatson      sysv5* | sco3.2v5* | sco5v6*)
6795243730Srwatson	# Note: We can NOT use -z defs as we might desire, because we do not
6796243730Srwatson	# link with -lc, and that would cause any symbols used from libc to
6797243730Srwatson	# always be unresolved, which means just about no library would
6798243730Srwatson	# ever link correctly.  If we're not using GNU ld we use -z text
6799243730Srwatson	# though, which does catch some bad symbols but isn't as heavy-handed
6800243730Srwatson	# as -z defs.
6801243730Srwatson	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6802243730Srwatson	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6803243730Srwatson	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6804243730Srwatson	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6805243730Srwatson	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6806243730Srwatson	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6807243730Srwatson	_LT_TAGVAR(link_all_deplibs, $1)=yes
6808243730Srwatson	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6809243730Srwatson	runpath_var='LD_RUN_PATH'
6810243730Srwatson
6811243730Srwatson	case $cc_basename in
6812243730Srwatson          CC*)
6813243730Srwatson	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6814243730Srwatson	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6815243730Srwatson	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
6816243730Srwatson	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
6817243730Srwatson	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
6818243730Srwatson	      '"$_LT_TAGVAR(reload_cmds, $1)"
6819243730Srwatson	    ;;
6820243730Srwatson	  *)
6821243730Srwatson	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6822243730Srwatson	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6823243730Srwatson	    ;;
6824243730Srwatson	esac
6825243730Srwatson      ;;
6826243730Srwatson
6827243730Srwatson      tandem*)
6828243730Srwatson        case $cc_basename in
6829243730Srwatson          NCC*)
6830243730Srwatson	    # NonStop-UX NCC 3.20
6831243730Srwatson	    # FIXME: insert proper C++ library support
6832243730Srwatson	    _LT_TAGVAR(ld_shlibs, $1)=no
6833243730Srwatson	    ;;
6834243730Srwatson          *)
6835243730Srwatson	    # FIXME: insert proper C++ library support
6836243730Srwatson	    _LT_TAGVAR(ld_shlibs, $1)=no
6837243730Srwatson	    ;;
6838243730Srwatson        esac
6839243730Srwatson        ;;
6840243730Srwatson
6841243730Srwatson      vxworks*)
6842243730Srwatson        # FIXME: insert proper C++ library support
6843243730Srwatson        _LT_TAGVAR(ld_shlibs, $1)=no
6844243730Srwatson        ;;
6845243730Srwatson
6846243730Srwatson      *)
6847243730Srwatson        # FIXME: insert proper C++ library support
6848243730Srwatson        _LT_TAGVAR(ld_shlibs, $1)=no
6849243730Srwatson        ;;
6850243730Srwatson    esac
6851243730Srwatson
6852243730Srwatson    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6853243730Srwatson    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6854243730Srwatson
6855243730Srwatson    _LT_TAGVAR(GCC, $1)="$GXX"
6856243730Srwatson    _LT_TAGVAR(LD, $1)="$LD"
6857243730Srwatson
6858243730Srwatson    ## CAVEAT EMPTOR:
6859243730Srwatson    ## There is no encapsulation within the following macros, do not change
6860243730Srwatson    ## the running order or otherwise move them around unless you know exactly
6861243730Srwatson    ## what you are doing...
6862243730Srwatson    _LT_SYS_HIDDEN_LIBDEPS($1)
6863243730Srwatson    _LT_COMPILER_PIC($1)
6864243730Srwatson    _LT_COMPILER_C_O($1)
6865243730Srwatson    _LT_COMPILER_FILE_LOCKS($1)
6866243730Srwatson    _LT_LINKER_SHLIBS($1)
6867243730Srwatson    _LT_SYS_DYNAMIC_LINKER($1)
6868243730Srwatson    _LT_LINKER_HARDCODE_LIBPATH($1)
6869243730Srwatson
6870243730Srwatson    _LT_CONFIG($1)
6871243730Srwatson  fi # test -n "$compiler"
6872243730Srwatson
6873243730Srwatson  CC=$lt_save_CC
6874243730Srwatson  CFLAGS=$lt_save_CFLAGS
6875243730Srwatson  LDCXX=$LD
6876243730Srwatson  LD=$lt_save_LD
6877243730Srwatson  GCC=$lt_save_GCC
6878243730Srwatson  with_gnu_ld=$lt_save_with_gnu_ld
6879243730Srwatson  lt_cv_path_LDCXX=$lt_cv_path_LD
6880243730Srwatson  lt_cv_path_LD=$lt_save_path_LD
6881243730Srwatson  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6882243730Srwatson  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6883243730Srwatsonfi # test "$_lt_caught_CXX_error" != yes
6884243730Srwatson
6885243730SrwatsonAC_LANG_POP
6886243730Srwatson])# _LT_LANG_CXX_CONFIG
6887243730Srwatson
6888243730Srwatson
6889243730Srwatson# _LT_FUNC_STRIPNAME_CNF
6890243730Srwatson# ----------------------
6891243730Srwatson# func_stripname_cnf prefix suffix name
6892243730Srwatson# strip PREFIX and SUFFIX off of NAME.
6893243730Srwatson# PREFIX and SUFFIX must not contain globbing or regex special
6894243730Srwatson# characters, hashes, percent signs, but SUFFIX may contain a leading
6895243730Srwatson# dot (in which case that matches only a dot).
6896243730Srwatson#
6897243730Srwatson# This function is identical to the (non-XSI) version of func_stripname,
6898243730Srwatson# except this one can be used by m4 code that may be executed by configure,
6899243730Srwatson# rather than the libtool script.
6900243730Srwatsonm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
6901243730SrwatsonAC_REQUIRE([_LT_DECL_SED])
6902243730SrwatsonAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
6903243730Srwatsonfunc_stripname_cnf ()
6904243730Srwatson{
6905243730Srwatson  case ${2} in
6906243730Srwatson  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
6907243730Srwatson  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
6908243730Srwatson  esac
6909243730Srwatson} # func_stripname_cnf
6910243730Srwatson])# _LT_FUNC_STRIPNAME_CNF
6911243730Srwatson
6912243730Srwatson# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6913243730Srwatson# ---------------------------------
6914243730Srwatson# Figure out "hidden" library dependencies from verbose
6915243730Srwatson# compiler output when linking a shared library.
6916243730Srwatson# Parse the compiler output and extract the necessary
6917243730Srwatson# objects, libraries and library flags.
6918243730Srwatsonm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6919243730Srwatson[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6920243730SrwatsonAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
6921243730Srwatson# Dependencies to place before and after the object being linked:
6922243730Srwatson_LT_TAGVAR(predep_objects, $1)=
6923243730Srwatson_LT_TAGVAR(postdep_objects, $1)=
6924243730Srwatson_LT_TAGVAR(predeps, $1)=
6925243730Srwatson_LT_TAGVAR(postdeps, $1)=
6926243730Srwatson_LT_TAGVAR(compiler_lib_search_path, $1)=
6927243730Srwatson
6928243730Srwatsondnl we can't use the lt_simple_compile_test_code here,
6929243730Srwatsondnl because it contains code intended for an executable,
6930243730Srwatsondnl not a library.  It's possible we should let each
6931243730Srwatsondnl tag define a new lt_????_link_test_code variable,
6932243730Srwatsondnl but it's only used here...
6933243730Srwatsonm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6934243730Srwatsonint a;
6935243730Srwatsonvoid foo (void) { a = 0; }
6936243730Srwatson_LT_EOF
6937243730Srwatson], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6938243730Srwatsonclass Foo
6939243730Srwatson{
6940243730Srwatsonpublic:
6941243730Srwatson  Foo (void) { a = 0; }
6942243730Srwatsonprivate:
6943243730Srwatson  int a;
6944243730Srwatson};
6945243730Srwatson_LT_EOF
6946243730Srwatson], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6947243730Srwatson      subroutine foo
6948243730Srwatson      implicit none
6949243730Srwatson      integer*4 a
6950243730Srwatson      a=0
6951243730Srwatson      return
6952243730Srwatson      end
6953243730Srwatson_LT_EOF
6954243730Srwatson], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6955243730Srwatson      subroutine foo
6956243730Srwatson      implicit none
6957243730Srwatson      integer a
6958243730Srwatson      a=0
6959243730Srwatson      return
6960243730Srwatson      end
6961243730Srwatson_LT_EOF
6962243730Srwatson], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6963243730Srwatsonpublic class foo {
6964243730Srwatson  private int a;
6965243730Srwatson  public void bar (void) {
6966243730Srwatson    a = 0;
6967243730Srwatson  }
6968243730Srwatson};
6969243730Srwatson_LT_EOF
6970243730Srwatson], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
6971243730Srwatsonpackage foo
6972243730Srwatsonfunc foo() {
6973243730Srwatson}
6974243730Srwatson_LT_EOF
6975243730Srwatson])
6976243730Srwatson
6977243730Srwatson_lt_libdeps_save_CFLAGS=$CFLAGS
6978243730Srwatsoncase "$CC $CFLAGS " in #(
6979243730Srwatson*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
6980243730Srwatson*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
6981243730Srwatson*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
6982243730Srwatsonesac
6983243730Srwatson
6984243730Srwatsondnl Parse the compiler output and extract the necessary
6985243730Srwatsondnl objects, libraries and library flags.
6986243730Srwatsonif AC_TRY_EVAL(ac_compile); then
6987243730Srwatson  # Parse the compiler output and extract the necessary
6988243730Srwatson  # objects, libraries and library flags.
6989243730Srwatson
6990243730Srwatson  # Sentinel used to keep track of whether or not we are before
6991243730Srwatson  # the conftest object file.
6992243730Srwatson  pre_test_object_deps_done=no
6993243730Srwatson
6994243730Srwatson  for p in `eval "$output_verbose_link_cmd"`; do
6995243730Srwatson    case ${prev}${p} in
6996243730Srwatson
6997243730Srwatson    -L* | -R* | -l*)
6998243730Srwatson       # Some compilers place space between "-{L,R}" and the path.
6999243730Srwatson       # Remove the space.
7000243730Srwatson       if test $p = "-L" ||
7001243730Srwatson          test $p = "-R"; then
7002243730Srwatson	 prev=$p
7003243730Srwatson	 continue
7004243730Srwatson       fi
7005243730Srwatson
7006243730Srwatson       # Expand the sysroot to ease extracting the directories later.
7007243730Srwatson       if test -z "$prev"; then
7008243730Srwatson         case $p in
7009243730Srwatson         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7010243730Srwatson         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7011243730Srwatson         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7012243730Srwatson         esac
7013243730Srwatson       fi
7014243730Srwatson       case $p in
7015243730Srwatson       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7016243730Srwatson       esac
7017243730Srwatson       if test "$pre_test_object_deps_done" = no; then
7018243730Srwatson	 case ${prev} in
7019243730Srwatson	 -L | -R)
7020243730Srwatson	   # Internal compiler library paths should come after those
7021243730Srwatson	   # provided the user.  The postdeps already come after the
7022243730Srwatson	   # user supplied libs so there is no need to process them.
7023243730Srwatson	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7024243730Srwatson	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
7025243730Srwatson	   else
7026243730Srwatson	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
7027243730Srwatson	   fi
7028243730Srwatson	   ;;
7029243730Srwatson	 # The "-l" case would never come before the object being
7030243730Srwatson	 # linked, so don't bother handling this case.
7031243730Srwatson	 esac
7032243730Srwatson       else
7033243730Srwatson	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7034243730Srwatson	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
7035243730Srwatson	 else
7036243730Srwatson	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
7037243730Srwatson	 fi
7038243730Srwatson       fi
7039243730Srwatson       prev=
7040243730Srwatson       ;;
7041243730Srwatson
7042243730Srwatson    *.lto.$objext) ;; # Ignore GCC LTO objects
7043243730Srwatson    *.$objext)
7044243730Srwatson       # This assumes that the test object file only shows up
7045243730Srwatson       # once in the compiler output.
7046243730Srwatson       if test "$p" = "conftest.$objext"; then
7047243730Srwatson	 pre_test_object_deps_done=yes
7048243730Srwatson	 continue
7049243730Srwatson       fi
7050243730Srwatson
7051243730Srwatson       if test "$pre_test_object_deps_done" = no; then
7052243730Srwatson	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7053243730Srwatson	   _LT_TAGVAR(predep_objects, $1)="$p"
7054243730Srwatson	 else
7055243730Srwatson	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7056243730Srwatson	 fi
7057243730Srwatson       else
7058243730Srwatson	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7059243730Srwatson	   _LT_TAGVAR(postdep_objects, $1)="$p"
7060243730Srwatson	 else
7061243730Srwatson	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7062243730Srwatson	 fi
7063243730Srwatson       fi
7064243730Srwatson       ;;
7065243730Srwatson
7066243730Srwatson    *) ;; # Ignore the rest.
7067243730Srwatson
7068243730Srwatson    esac
7069243730Srwatson  done
7070243730Srwatson
7071243730Srwatson  # Clean up.
7072243730Srwatson  rm -f a.out a.exe
7073243730Srwatsonelse
7074243730Srwatson  echo "libtool.m4: error: problem compiling $1 test program"
7075243730Srwatsonfi
7076243730Srwatson
7077243730Srwatson$RM -f confest.$objext
7078243730SrwatsonCFLAGS=$_lt_libdeps_save_CFLAGS
7079243730Srwatson
7080243730Srwatson# PORTME: override above test on systems where it is broken
7081243730Srwatsonm4_if([$1], [CXX],
7082243730Srwatson[case $host_os in
7083243730Srwatsoninterix[[3-9]]*)
7084243730Srwatson  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7085243730Srwatson  # hack all around it, let's just trust "g++" to DTRT.
7086243730Srwatson  _LT_TAGVAR(predep_objects,$1)=
7087243730Srwatson  _LT_TAGVAR(postdep_objects,$1)=
7088243730Srwatson  _LT_TAGVAR(postdeps,$1)=
7089243730Srwatson  ;;
7090243730Srwatson
7091243730Srwatsonlinux*)
7092243730Srwatson  case `$CC -V 2>&1 | sed 5q` in
7093243730Srwatson  *Sun\ C*)
7094243730Srwatson    # Sun C++ 5.9
7095243730Srwatson
7096243730Srwatson    # The more standards-conforming stlport4 library is
7097243730Srwatson    # incompatible with the Cstd library. Avoid specifying
7098243730Srwatson    # it if it's in CXXFLAGS. Ignore libCrun as
7099243730Srwatson    # -library=stlport4 depends on it.
7100243730Srwatson    case " $CXX $CXXFLAGS " in
7101243730Srwatson    *" -library=stlport4 "*)
7102243730Srwatson      solaris_use_stlport4=yes
7103243730Srwatson      ;;
7104243730Srwatson    esac
7105243730Srwatson
7106243730Srwatson    if test "$solaris_use_stlport4" != yes; then
7107243730Srwatson      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7108243730Srwatson    fi
7109243730Srwatson    ;;
7110243730Srwatson  esac
7111243730Srwatson  ;;
7112243730Srwatson
7113243730Srwatsonsolaris*)
7114243730Srwatson  case $cc_basename in
7115243730Srwatson  CC* | sunCC*)
7116243730Srwatson    # The more standards-conforming stlport4 library is
7117243730Srwatson    # incompatible with the Cstd library. Avoid specifying
7118243730Srwatson    # it if it's in CXXFLAGS. Ignore libCrun as
7119243730Srwatson    # -library=stlport4 depends on it.
7120243730Srwatson    case " $CXX $CXXFLAGS " in
7121243730Srwatson    *" -library=stlport4 "*)
7122243730Srwatson      solaris_use_stlport4=yes
7123243730Srwatson      ;;
7124243730Srwatson    esac
7125243730Srwatson
7126243730Srwatson    # Adding this requires a known-good setup of shared libraries for
7127243730Srwatson    # Sun compiler versions before 5.6, else PIC objects from an old
7128243730Srwatson    # archive will be linked into the output, leading to subtle bugs.
7129243730Srwatson    if test "$solaris_use_stlport4" != yes; then
7130243730Srwatson      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7131243730Srwatson    fi
7132243730Srwatson    ;;
7133243730Srwatson  esac
7134243730Srwatson  ;;
7135243730Srwatsonesac
7136243730Srwatson])
7137243730Srwatson
7138243730Srwatsoncase " $_LT_TAGVAR(postdeps, $1) " in
7139243730Srwatson*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7140243730Srwatsonesac
7141243730Srwatson _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7142243730Srwatsonif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7143243730Srwatson _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
7144243730Srwatsonfi
7145243730Srwatson_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7146243730Srwatson    [The directories searched by this compiler when creating a shared library])
7147243730Srwatson_LT_TAGDECL([], [predep_objects], [1],
7148243730Srwatson    [Dependencies to place before and after the objects being linked to
7149243730Srwatson    create a shared library])
7150243730Srwatson_LT_TAGDECL([], [postdep_objects], [1])
7151243730Srwatson_LT_TAGDECL([], [predeps], [1])
7152243730Srwatson_LT_TAGDECL([], [postdeps], [1])
7153243730Srwatson_LT_TAGDECL([], [compiler_lib_search_path], [1],
7154243730Srwatson    [The library search path used internally by the compiler when linking
7155243730Srwatson    a shared library])
7156243730Srwatson])# _LT_SYS_HIDDEN_LIBDEPS
7157243730Srwatson
7158243730Srwatson
7159243730Srwatson# _LT_LANG_F77_CONFIG([TAG])
7160243730Srwatson# --------------------------
7161243730Srwatson# Ensure that the configuration variables for a Fortran 77 compiler are
7162243730Srwatson# suitably defined.  These variables are subsequently used by _LT_CONFIG
7163243730Srwatson# to write the compiler configuration to `libtool'.
7164243730Srwatsonm4_defun([_LT_LANG_F77_CONFIG],
7165243730Srwatson[AC_LANG_PUSH(Fortran 77)
7166243730Srwatsonif test -z "$F77" || test "X$F77" = "Xno"; then
7167243730Srwatson  _lt_disable_F77=yes
7168243730Srwatsonfi
7169243730Srwatson
7170243730Srwatson_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7171243730Srwatson_LT_TAGVAR(allow_undefined_flag, $1)=
7172243730Srwatson_LT_TAGVAR(always_export_symbols, $1)=no
7173243730Srwatson_LT_TAGVAR(archive_expsym_cmds, $1)=
7174243730Srwatson_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7175243730Srwatson_LT_TAGVAR(hardcode_direct, $1)=no
7176243730Srwatson_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7177243730Srwatson_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7178243730Srwatson_LT_TAGVAR(hardcode_libdir_separator, $1)=
7179243730Srwatson_LT_TAGVAR(hardcode_minus_L, $1)=no
7180243730Srwatson_LT_TAGVAR(hardcode_automatic, $1)=no
7181243730Srwatson_LT_TAGVAR(inherit_rpath, $1)=no
7182243730Srwatson_LT_TAGVAR(module_cmds, $1)=
7183243730Srwatson_LT_TAGVAR(module_expsym_cmds, $1)=
7184243730Srwatson_LT_TAGVAR(link_all_deplibs, $1)=unknown
7185243730Srwatson_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7186243730Srwatson_LT_TAGVAR(reload_flag, $1)=$reload_flag
7187243730Srwatson_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7188243730Srwatson_LT_TAGVAR(no_undefined_flag, $1)=
7189243730Srwatson_LT_TAGVAR(whole_archive_flag_spec, $1)=
7190243730Srwatson_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7191243730Srwatson
7192243730Srwatson# Source file extension for f77 test sources.
7193243730Srwatsonac_ext=f
7194243730Srwatson
7195243730Srwatson# Object file extension for compiled f77 test sources.
7196243730Srwatsonobjext=o
7197243730Srwatson_LT_TAGVAR(objext, $1)=$objext
7198243730Srwatson
7199243730Srwatson# No sense in running all these tests if we already determined that
7200243730Srwatson# the F77 compiler isn't working.  Some variables (like enable_shared)
7201243730Srwatson# are currently assumed to apply to all compilers on this platform,
7202243730Srwatson# and will be corrupted by setting them based on a non-working compiler.
7203243730Srwatsonif test "$_lt_disable_F77" != yes; then
7204243730Srwatson  # Code to be used in simple compile tests
7205243730Srwatson  lt_simple_compile_test_code="\
7206243730Srwatson      subroutine t
7207243730Srwatson      return
7208243730Srwatson      end
7209243730Srwatson"
7210243730Srwatson
7211243730Srwatson  # Code to be used in simple link tests
7212243730Srwatson  lt_simple_link_test_code="\
7213243730Srwatson      program t
7214243730Srwatson      end
7215243730Srwatson"
7216243730Srwatson
7217243730Srwatson  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7218243730Srwatson  _LT_TAG_COMPILER
7219243730Srwatson
7220243730Srwatson  # save warnings/boilerplate of simple test code
7221243730Srwatson  _LT_COMPILER_BOILERPLATE
7222243730Srwatson  _LT_LINKER_BOILERPLATE
7223243730Srwatson
7224243730Srwatson  # Allow CC to be a program name with arguments.
7225243730Srwatson  lt_save_CC="$CC"
7226243730Srwatson  lt_save_GCC=$GCC
7227243730Srwatson  lt_save_CFLAGS=$CFLAGS
7228243730Srwatson  CC=${F77-"f77"}
7229243730Srwatson  CFLAGS=$FFLAGS
7230243730Srwatson  compiler=$CC
7231243730Srwatson  _LT_TAGVAR(compiler, $1)=$CC
7232243730Srwatson  _LT_CC_BASENAME([$compiler])
7233243730Srwatson  GCC=$G77
7234243730Srwatson  if test -n "$compiler"; then
7235243730Srwatson    AC_MSG_CHECKING([if libtool supports shared libraries])
7236243730Srwatson    AC_MSG_RESULT([$can_build_shared])
7237243730Srwatson
7238243730Srwatson    AC_MSG_CHECKING([whether to build shared libraries])
7239243730Srwatson    test "$can_build_shared" = "no" && enable_shared=no
7240243730Srwatson
7241243730Srwatson    # On AIX, shared libraries and static libraries use the same namespace, and
7242243730Srwatson    # are all built from PIC.
7243243730Srwatson    case $host_os in
7244243730Srwatson      aix3*)
7245243730Srwatson        test "$enable_shared" = yes && enable_static=no
7246243730Srwatson        if test -n "$RANLIB"; then
7247243730Srwatson          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7248243730Srwatson          postinstall_cmds='$RANLIB $lib'
7249243730Srwatson        fi
7250243730Srwatson        ;;
7251243730Srwatson      aix[[4-9]]*)
7252243730Srwatson	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7253243730Srwatson	  test "$enable_shared" = yes && enable_static=no
7254243730Srwatson	fi
7255243730Srwatson        ;;
7256243730Srwatson    esac
7257243730Srwatson    AC_MSG_RESULT([$enable_shared])
7258243730Srwatson
7259243730Srwatson    AC_MSG_CHECKING([whether to build static libraries])
7260243730Srwatson    # Make sure either enable_shared or enable_static is yes.
7261243730Srwatson    test "$enable_shared" = yes || enable_static=yes
7262243730Srwatson    AC_MSG_RESULT([$enable_static])
7263243730Srwatson
7264243730Srwatson    _LT_TAGVAR(GCC, $1)="$G77"
7265243730Srwatson    _LT_TAGVAR(LD, $1)="$LD"
7266243730Srwatson
7267243730Srwatson    ## CAVEAT EMPTOR:
7268243730Srwatson    ## There is no encapsulation within the following macros, do not change
7269243730Srwatson    ## the running order or otherwise move them around unless you know exactly
7270243730Srwatson    ## what you are doing...
7271243730Srwatson    _LT_COMPILER_PIC($1)
7272243730Srwatson    _LT_COMPILER_C_O($1)
7273243730Srwatson    _LT_COMPILER_FILE_LOCKS($1)
7274243730Srwatson    _LT_LINKER_SHLIBS($1)
7275243730Srwatson    _LT_SYS_DYNAMIC_LINKER($1)
7276243730Srwatson    _LT_LINKER_HARDCODE_LIBPATH($1)
7277243730Srwatson
7278243730Srwatson    _LT_CONFIG($1)
7279243730Srwatson  fi # test -n "$compiler"
7280243730Srwatson
7281243730Srwatson  GCC=$lt_save_GCC
7282243730Srwatson  CC="$lt_save_CC"
7283243730Srwatson  CFLAGS="$lt_save_CFLAGS"
7284243730Srwatsonfi # test "$_lt_disable_F77" != yes
7285243730Srwatson
7286243730SrwatsonAC_LANG_POP
7287243730Srwatson])# _LT_LANG_F77_CONFIG
7288243730Srwatson
7289243730Srwatson
7290243730Srwatson# _LT_LANG_FC_CONFIG([TAG])
7291243730Srwatson# -------------------------
7292243730Srwatson# Ensure that the configuration variables for a Fortran compiler are
7293243730Srwatson# suitably defined.  These variables are subsequently used by _LT_CONFIG
7294243730Srwatson# to write the compiler configuration to `libtool'.
7295243730Srwatsonm4_defun([_LT_LANG_FC_CONFIG],
7296243730Srwatson[AC_LANG_PUSH(Fortran)
7297243730Srwatson
7298243730Srwatsonif test -z "$FC" || test "X$FC" = "Xno"; then
7299243730Srwatson  _lt_disable_FC=yes
7300243730Srwatsonfi
7301243730Srwatson
7302243730Srwatson_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7303243730Srwatson_LT_TAGVAR(allow_undefined_flag, $1)=
7304243730Srwatson_LT_TAGVAR(always_export_symbols, $1)=no
7305243730Srwatson_LT_TAGVAR(archive_expsym_cmds, $1)=
7306243730Srwatson_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7307243730Srwatson_LT_TAGVAR(hardcode_direct, $1)=no
7308243730Srwatson_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7309243730Srwatson_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7310243730Srwatson_LT_TAGVAR(hardcode_libdir_separator, $1)=
7311243730Srwatson_LT_TAGVAR(hardcode_minus_L, $1)=no
7312243730Srwatson_LT_TAGVAR(hardcode_automatic, $1)=no
7313243730Srwatson_LT_TAGVAR(inherit_rpath, $1)=no
7314243730Srwatson_LT_TAGVAR(module_cmds, $1)=
7315243730Srwatson_LT_TAGVAR(module_expsym_cmds, $1)=
7316243730Srwatson_LT_TAGVAR(link_all_deplibs, $1)=unknown
7317243730Srwatson_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7318243730Srwatson_LT_TAGVAR(reload_flag, $1)=$reload_flag
7319243730Srwatson_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7320243730Srwatson_LT_TAGVAR(no_undefined_flag, $1)=
7321243730Srwatson_LT_TAGVAR(whole_archive_flag_spec, $1)=
7322243730Srwatson_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7323243730Srwatson
7324243730Srwatson# Source file extension for fc test sources.
7325243730Srwatsonac_ext=${ac_fc_srcext-f}
7326243730Srwatson
7327243730Srwatson# Object file extension for compiled fc test sources.
7328243730Srwatsonobjext=o
7329243730Srwatson_LT_TAGVAR(objext, $1)=$objext
7330243730Srwatson
7331243730Srwatson# No sense in running all these tests if we already determined that
7332243730Srwatson# the FC compiler isn't working.  Some variables (like enable_shared)
7333243730Srwatson# are currently assumed to apply to all compilers on this platform,
7334243730Srwatson# and will be corrupted by setting them based on a non-working compiler.
7335243730Srwatsonif test "$_lt_disable_FC" != yes; then
7336243730Srwatson  # Code to be used in simple compile tests
7337243730Srwatson  lt_simple_compile_test_code="\
7338243730Srwatson      subroutine t
7339243730Srwatson      return
7340243730Srwatson      end
7341243730Srwatson"
7342243730Srwatson
7343243730Srwatson  # Code to be used in simple link tests
7344243730Srwatson  lt_simple_link_test_code="\
7345243730Srwatson      program t
7346243730Srwatson      end
7347243730Srwatson"
7348243730Srwatson
7349243730Srwatson  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7350243730Srwatson  _LT_TAG_COMPILER
7351243730Srwatson
7352243730Srwatson  # save warnings/boilerplate of simple test code
7353243730Srwatson  _LT_COMPILER_BOILERPLATE
7354243730Srwatson  _LT_LINKER_BOILERPLATE
7355243730Srwatson
7356243730Srwatson  # Allow CC to be a program name with arguments.
7357243730Srwatson  lt_save_CC="$CC"
7358243730Srwatson  lt_save_GCC=$GCC
7359243730Srwatson  lt_save_CFLAGS=$CFLAGS
7360243730Srwatson  CC=${FC-"f95"}
7361243730Srwatson  CFLAGS=$FCFLAGS
7362243730Srwatson  compiler=$CC
7363243730Srwatson  GCC=$ac_cv_fc_compiler_gnu
7364243730Srwatson
7365243730Srwatson  _LT_TAGVAR(compiler, $1)=$CC
7366243730Srwatson  _LT_CC_BASENAME([$compiler])
7367243730Srwatson
7368243730Srwatson  if test -n "$compiler"; then
7369243730Srwatson    AC_MSG_CHECKING([if libtool supports shared libraries])
7370243730Srwatson    AC_MSG_RESULT([$can_build_shared])
7371243730Srwatson
7372243730Srwatson    AC_MSG_CHECKING([whether to build shared libraries])
7373243730Srwatson    test "$can_build_shared" = "no" && enable_shared=no
7374243730Srwatson
7375243730Srwatson    # On AIX, shared libraries and static libraries use the same namespace, and
7376243730Srwatson    # are all built from PIC.
7377243730Srwatson    case $host_os in
7378243730Srwatson      aix3*)
7379243730Srwatson        test "$enable_shared" = yes && enable_static=no
7380243730Srwatson        if test -n "$RANLIB"; then
7381243730Srwatson          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7382243730Srwatson          postinstall_cmds='$RANLIB $lib'
7383243730Srwatson        fi
7384243730Srwatson        ;;
7385243730Srwatson      aix[[4-9]]*)
7386243730Srwatson	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7387243730Srwatson	  test "$enable_shared" = yes && enable_static=no
7388243730Srwatson	fi
7389243730Srwatson        ;;
7390243730Srwatson    esac
7391243730Srwatson    AC_MSG_RESULT([$enable_shared])
7392243730Srwatson
7393243730Srwatson    AC_MSG_CHECKING([whether to build static libraries])
7394243730Srwatson    # Make sure either enable_shared or enable_static is yes.
7395243730Srwatson    test "$enable_shared" = yes || enable_static=yes
7396243730Srwatson    AC_MSG_RESULT([$enable_static])
7397243730Srwatson
7398243730Srwatson    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
7399243730Srwatson    _LT_TAGVAR(LD, $1)="$LD"
7400243730Srwatson
7401243730Srwatson    ## CAVEAT EMPTOR:
7402243730Srwatson    ## There is no encapsulation within the following macros, do not change
7403243730Srwatson    ## the running order or otherwise move them around unless you know exactly
7404243730Srwatson    ## what you are doing...
7405243730Srwatson    _LT_SYS_HIDDEN_LIBDEPS($1)
7406243730Srwatson    _LT_COMPILER_PIC($1)
7407243730Srwatson    _LT_COMPILER_C_O($1)
7408243730Srwatson    _LT_COMPILER_FILE_LOCKS($1)
7409243730Srwatson    _LT_LINKER_SHLIBS($1)
7410243730Srwatson    _LT_SYS_DYNAMIC_LINKER($1)
7411243730Srwatson    _LT_LINKER_HARDCODE_LIBPATH($1)
7412243730Srwatson
7413243730Srwatson    _LT_CONFIG($1)
7414243730Srwatson  fi # test -n "$compiler"
7415243730Srwatson
7416243730Srwatson  GCC=$lt_save_GCC
7417243730Srwatson  CC=$lt_save_CC
7418243730Srwatson  CFLAGS=$lt_save_CFLAGS
7419243730Srwatsonfi # test "$_lt_disable_FC" != yes
7420243730Srwatson
7421243730SrwatsonAC_LANG_POP
7422243730Srwatson])# _LT_LANG_FC_CONFIG
7423243730Srwatson
7424243730Srwatson
7425243730Srwatson# _LT_LANG_GCJ_CONFIG([TAG])
7426243730Srwatson# --------------------------
7427243730Srwatson# Ensure that the configuration variables for the GNU Java Compiler compiler
7428243730Srwatson# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7429243730Srwatson# to write the compiler configuration to `libtool'.
7430243730Srwatsonm4_defun([_LT_LANG_GCJ_CONFIG],
7431243730Srwatson[AC_REQUIRE([LT_PROG_GCJ])dnl
7432243730SrwatsonAC_LANG_SAVE
7433243730Srwatson
7434243730Srwatson# Source file extension for Java test sources.
7435243730Srwatsonac_ext=java
7436243730Srwatson
7437243730Srwatson# Object file extension for compiled Java test sources.
7438243730Srwatsonobjext=o
7439243730Srwatson_LT_TAGVAR(objext, $1)=$objext
7440243730Srwatson
7441243730Srwatson# Code to be used in simple compile tests
7442243730Srwatsonlt_simple_compile_test_code="class foo {}"
7443243730Srwatson
7444243730Srwatson# Code to be used in simple link tests
7445243730Srwatsonlt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7446243730Srwatson
7447243730Srwatson# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7448243730Srwatson_LT_TAG_COMPILER
7449243730Srwatson
7450243730Srwatson# save warnings/boilerplate of simple test code
7451243730Srwatson_LT_COMPILER_BOILERPLATE
7452243730Srwatson_LT_LINKER_BOILERPLATE
7453243730Srwatson
7454243730Srwatson# Allow CC to be a program name with arguments.
7455243730Srwatsonlt_save_CC=$CC
7456243730Srwatsonlt_save_CFLAGS=$CFLAGS
7457243730Srwatsonlt_save_GCC=$GCC
7458243730SrwatsonGCC=yes
7459243730SrwatsonCC=${GCJ-"gcj"}
7460243730SrwatsonCFLAGS=$GCJFLAGS
7461243730Srwatsoncompiler=$CC
7462243730Srwatson_LT_TAGVAR(compiler, $1)=$CC
7463243730Srwatson_LT_TAGVAR(LD, $1)="$LD"
7464243730Srwatson_LT_CC_BASENAME([$compiler])
7465243730Srwatson
7466243730Srwatson# GCJ did not exist at the time GCC didn't implicitly link libc in.
7467243730Srwatson_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7468243730Srwatson
7469243730Srwatson_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7470243730Srwatson_LT_TAGVAR(reload_flag, $1)=$reload_flag
7471243730Srwatson_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7472243730Srwatson
7473243730Srwatson## CAVEAT EMPTOR:
7474243730Srwatson## There is no encapsulation within the following macros, do not change
7475243730Srwatson## the running order or otherwise move them around unless you know exactly
7476243730Srwatson## what you are doing...
7477243730Srwatsonif test -n "$compiler"; then
7478243730Srwatson  _LT_COMPILER_NO_RTTI($1)
7479243730Srwatson  _LT_COMPILER_PIC($1)
7480243730Srwatson  _LT_COMPILER_C_O($1)
7481243730Srwatson  _LT_COMPILER_FILE_LOCKS($1)
7482243730Srwatson  _LT_LINKER_SHLIBS($1)
7483243730Srwatson  _LT_LINKER_HARDCODE_LIBPATH($1)
7484243730Srwatson
7485243730Srwatson  _LT_CONFIG($1)
7486243730Srwatsonfi
7487243730Srwatson
7488243730SrwatsonAC_LANG_RESTORE
7489243730Srwatson
7490243730SrwatsonGCC=$lt_save_GCC
7491243730SrwatsonCC=$lt_save_CC
7492243730SrwatsonCFLAGS=$lt_save_CFLAGS
7493243730Srwatson])# _LT_LANG_GCJ_CONFIG
7494243730Srwatson
7495243730Srwatson
7496243730Srwatson# _LT_LANG_GO_CONFIG([TAG])
7497243730Srwatson# --------------------------
7498243730Srwatson# Ensure that the configuration variables for the GNU Go compiler
7499243730Srwatson# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7500243730Srwatson# to write the compiler configuration to `libtool'.
7501243730Srwatsonm4_defun([_LT_LANG_GO_CONFIG],
7502243730Srwatson[AC_REQUIRE([LT_PROG_GO])dnl
7503243730SrwatsonAC_LANG_SAVE
7504243730Srwatson
7505243730Srwatson# Source file extension for Go test sources.
7506243730Srwatsonac_ext=go
7507243730Srwatson
7508243730Srwatson# Object file extension for compiled Go test sources.
7509243730Srwatsonobjext=o
7510243730Srwatson_LT_TAGVAR(objext, $1)=$objext
7511243730Srwatson
7512243730Srwatson# Code to be used in simple compile tests
7513243730Srwatsonlt_simple_compile_test_code="package main; func main() { }"
7514243730Srwatson
7515243730Srwatson# Code to be used in simple link tests
7516243730Srwatsonlt_simple_link_test_code='package main; func main() { }'
7517243730Srwatson
7518243730Srwatson# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7519243730Srwatson_LT_TAG_COMPILER
7520243730Srwatson
7521243730Srwatson# save warnings/boilerplate of simple test code
7522243730Srwatson_LT_COMPILER_BOILERPLATE
7523243730Srwatson_LT_LINKER_BOILERPLATE
7524243730Srwatson
7525243730Srwatson# Allow CC to be a program name with arguments.
7526243730Srwatsonlt_save_CC=$CC
7527243730Srwatsonlt_save_CFLAGS=$CFLAGS
7528243730Srwatsonlt_save_GCC=$GCC
7529243730SrwatsonGCC=yes
7530243730SrwatsonCC=${GOC-"gccgo"}
7531243730SrwatsonCFLAGS=$GOFLAGS
7532243730Srwatsoncompiler=$CC
7533243730Srwatson_LT_TAGVAR(compiler, $1)=$CC
7534243730Srwatson_LT_TAGVAR(LD, $1)="$LD"
7535243730Srwatson_LT_CC_BASENAME([$compiler])
7536243730Srwatson
7537243730Srwatson# Go did not exist at the time GCC didn't implicitly link libc in.
7538243730Srwatson_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7539243730Srwatson
7540243730Srwatson_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7541243730Srwatson_LT_TAGVAR(reload_flag, $1)=$reload_flag
7542243730Srwatson_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7543243730Srwatson
7544243730Srwatson## CAVEAT EMPTOR:
7545243730Srwatson## There is no encapsulation within the following macros, do not change
7546243730Srwatson## the running order or otherwise move them around unless you know exactly
7547243730Srwatson## what you are doing...
7548243730Srwatsonif test -n "$compiler"; then
7549243730Srwatson  _LT_COMPILER_NO_RTTI($1)
7550243730Srwatson  _LT_COMPILER_PIC($1)
7551243730Srwatson  _LT_COMPILER_C_O($1)
7552243730Srwatson  _LT_COMPILER_FILE_LOCKS($1)
7553243730Srwatson  _LT_LINKER_SHLIBS($1)
7554243730Srwatson  _LT_LINKER_HARDCODE_LIBPATH($1)
7555243730Srwatson
7556243730Srwatson  _LT_CONFIG($1)
7557243730Srwatsonfi
7558243730Srwatson
7559243730SrwatsonAC_LANG_RESTORE
7560243730Srwatson
7561243730SrwatsonGCC=$lt_save_GCC
7562243730SrwatsonCC=$lt_save_CC
7563243730SrwatsonCFLAGS=$lt_save_CFLAGS
7564243730Srwatson])# _LT_LANG_GO_CONFIG
7565243730Srwatson
7566243730Srwatson
7567243730Srwatson# _LT_LANG_RC_CONFIG([TAG])
7568243730Srwatson# -------------------------
7569243730Srwatson# Ensure that the configuration variables for the Windows resource compiler
7570243730Srwatson# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7571243730Srwatson# to write the compiler configuration to `libtool'.
7572243730Srwatsonm4_defun([_LT_LANG_RC_CONFIG],
7573243730Srwatson[AC_REQUIRE([LT_PROG_RC])dnl
7574243730SrwatsonAC_LANG_SAVE
7575243730Srwatson
7576243730Srwatson# Source file extension for RC test sources.
7577243730Srwatsonac_ext=rc
7578243730Srwatson
7579243730Srwatson# Object file extension for compiled RC test sources.
7580243730Srwatsonobjext=o
7581243730Srwatson_LT_TAGVAR(objext, $1)=$objext
7582243730Srwatson
7583243730Srwatson# Code to be used in simple compile tests
7584243730Srwatsonlt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
7585243730Srwatson
7586243730Srwatson# Code to be used in simple link tests
7587243730Srwatsonlt_simple_link_test_code="$lt_simple_compile_test_code"
7588243730Srwatson
7589243730Srwatson# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7590243730Srwatson_LT_TAG_COMPILER
7591243730Srwatson
7592243730Srwatson# save warnings/boilerplate of simple test code
7593243730Srwatson_LT_COMPILER_BOILERPLATE
7594243730Srwatson_LT_LINKER_BOILERPLATE
7595243730Srwatson
7596243730Srwatson# Allow CC to be a program name with arguments.
7597243730Srwatsonlt_save_CC="$CC"
7598243730Srwatsonlt_save_CFLAGS=$CFLAGS
7599243730Srwatsonlt_save_GCC=$GCC
7600243730SrwatsonGCC=
7601243730SrwatsonCC=${RC-"windres"}
7602243730SrwatsonCFLAGS=
7603243730Srwatsoncompiler=$CC
7604243730Srwatson_LT_TAGVAR(compiler, $1)=$CC
7605243730Srwatson_LT_CC_BASENAME([$compiler])
7606243730Srwatson_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
7607243730Srwatson
7608243730Srwatsonif test -n "$compiler"; then
7609243730Srwatson  :
7610243730Srwatson  _LT_CONFIG($1)
7611243730Srwatsonfi
7612243730Srwatson
7613243730SrwatsonGCC=$lt_save_GCC
7614243730SrwatsonAC_LANG_RESTORE
7615243730SrwatsonCC=$lt_save_CC
7616243730SrwatsonCFLAGS=$lt_save_CFLAGS
7617243730Srwatson])# _LT_LANG_RC_CONFIG
7618243730Srwatson
7619243730Srwatson
7620243730Srwatson# LT_PROG_GCJ
7621243730Srwatson# -----------
7622243730SrwatsonAC_DEFUN([LT_PROG_GCJ],
7623243730Srwatson[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
7624243730Srwatson  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
7625243730Srwatson    [AC_CHECK_TOOL(GCJ, gcj,)
7626243730Srwatson      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
7627243730Srwatson      AC_SUBST(GCJFLAGS)])])[]dnl
7628243730Srwatson])
7629243730Srwatson
7630243730Srwatson# Old name:
7631243730SrwatsonAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
7632243730Srwatsondnl aclocal-1.4 backwards compatibility:
7633243730Srwatsondnl AC_DEFUN([LT_AC_PROG_GCJ], [])
7634243730Srwatson
7635243730Srwatson
7636243730Srwatson# LT_PROG_GO
7637243730Srwatson# ----------
7638243730SrwatsonAC_DEFUN([LT_PROG_GO],
7639243730Srwatson[AC_CHECK_TOOL(GOC, gccgo,)
7640243730Srwatson])
7641243730Srwatson
7642243730Srwatson
7643243730Srwatson# LT_PROG_RC
7644243730Srwatson# ----------
7645243730SrwatsonAC_DEFUN([LT_PROG_RC],
7646243730Srwatson[AC_CHECK_TOOL(RC, windres,)
7647243730Srwatson])
7648243730Srwatson
7649243730Srwatson# Old name:
7650243730SrwatsonAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
7651243730Srwatsondnl aclocal-1.4 backwards compatibility:
7652243730Srwatsondnl AC_DEFUN([LT_AC_PROG_RC], [])
7653243730Srwatson
7654243730Srwatson
7655243730Srwatson# _LT_DECL_EGREP
7656243730Srwatson# --------------
7657243730Srwatson# If we don't have a new enough Autoconf to choose the best grep
7658243730Srwatson# available, choose the one first in the user's PATH.
7659243730Srwatsonm4_defun([_LT_DECL_EGREP],
7660243730Srwatson[AC_REQUIRE([AC_PROG_EGREP])dnl
7661243730SrwatsonAC_REQUIRE([AC_PROG_FGREP])dnl
7662243730Srwatsontest -z "$GREP" && GREP=grep
7663243730Srwatson_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7664243730Srwatson_LT_DECL([], [EGREP], [1], [An ERE matcher])
7665243730Srwatson_LT_DECL([], [FGREP], [1], [A literal string matcher])
7666243730Srwatsondnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7667243730SrwatsonAC_SUBST([GREP])
7668243730Srwatson])
7669243730Srwatson
7670243730Srwatson
7671243730Srwatson# _LT_DECL_OBJDUMP
7672243730Srwatson# --------------
7673243730Srwatson# If we don't have a new enough Autoconf to choose the best objdump
7674243730Srwatson# available, choose the one first in the user's PATH.
7675243730Srwatsonm4_defun([_LT_DECL_OBJDUMP],
7676243730Srwatson[AC_CHECK_TOOL(OBJDUMP, objdump, false)
7677243730Srwatsontest -z "$OBJDUMP" && OBJDUMP=objdump
7678243730Srwatson_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7679243730SrwatsonAC_SUBST([OBJDUMP])
7680243730Srwatson])
7681243730Srwatson
7682243730Srwatson# _LT_DECL_DLLTOOL
7683243730Srwatson# ----------------
7684243730Srwatson# Ensure DLLTOOL variable is set.
7685243730Srwatsonm4_defun([_LT_DECL_DLLTOOL],
7686243730Srwatson[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
7687243730Srwatsontest -z "$DLLTOOL" && DLLTOOL=dlltool
7688243730Srwatson_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
7689243730SrwatsonAC_SUBST([DLLTOOL])
7690243730Srwatson])
7691243730Srwatson
7692243730Srwatson# _LT_DECL_SED
7693243730Srwatson# ------------
7694243730Srwatson# Check for a fully-functional sed program, that truncates
7695243730Srwatson# as few characters as possible.  Prefer GNU sed if found.
7696243730Srwatsonm4_defun([_LT_DECL_SED],
7697243730Srwatson[AC_PROG_SED
7698243730Srwatsontest -z "$SED" && SED=sed
7699243730SrwatsonXsed="$SED -e 1s/^X//"
7700243730Srwatson_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7701243730Srwatson_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7702243730Srwatson    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7703243730Srwatson])# _LT_DECL_SED
7704243730Srwatson
7705243730Srwatsonm4_ifndef([AC_PROG_SED], [
7706243730Srwatson############################################################
7707243730Srwatson# NOTE: This macro has been submitted for inclusion into   #
7708243730Srwatson#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
7709243730Srwatson#  a released version of Autoconf we should remove this    #
7710243730Srwatson#  macro and use it instead.                               #
7711243730Srwatson############################################################
7712243730Srwatson
7713243730Srwatsonm4_defun([AC_PROG_SED],
7714243730Srwatson[AC_MSG_CHECKING([for a sed that does not truncate output])
7715243730SrwatsonAC_CACHE_VAL(lt_cv_path_SED,
7716243730Srwatson[# Loop through the user's path and test for sed and gsed.
7717243730Srwatson# Then use that list of sed's as ones to test for truncation.
7718243730Srwatsonas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7719243730Srwatsonfor as_dir in $PATH
7720243730Srwatsondo
7721243730Srwatson  IFS=$as_save_IFS
7722243730Srwatson  test -z "$as_dir" && as_dir=.
7723243730Srwatson  for lt_ac_prog in sed gsed; do
7724243730Srwatson    for ac_exec_ext in '' $ac_executable_extensions; do
7725243730Srwatson      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7726243730Srwatson        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7727243730Srwatson      fi
7728243730Srwatson    done
7729243730Srwatson  done
7730243730Srwatsondone
7731243730SrwatsonIFS=$as_save_IFS
7732243730Srwatsonlt_ac_max=0
7733243730Srwatsonlt_ac_count=0
7734243730Srwatson# Add /usr/xpg4/bin/sed as it is typically found on Solaris
7735243730Srwatson# along with /bin/sed that truncates output.
7736243730Srwatsonfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7737243730Srwatson  test ! -f $lt_ac_sed && continue
7738243730Srwatson  cat /dev/null > conftest.in
7739243730Srwatson  lt_ac_count=0
7740243730Srwatson  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7741243730Srwatson  # Check for GNU sed and select it if it is found.
7742243730Srwatson  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7743243730Srwatson    lt_cv_path_SED=$lt_ac_sed
7744243730Srwatson    break
7745243730Srwatson  fi
7746243730Srwatson  while true; do
7747243730Srwatson    cat conftest.in conftest.in >conftest.tmp
7748243730Srwatson    mv conftest.tmp conftest.in
7749243730Srwatson    cp conftest.in conftest.nl
7750243730Srwatson    echo >>conftest.nl
7751243730Srwatson    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7752243730Srwatson    cmp -s conftest.out conftest.nl || break
7753243730Srwatson    # 10000 chars as input seems more than enough
7754243730Srwatson    test $lt_ac_count -gt 10 && break
7755243730Srwatson    lt_ac_count=`expr $lt_ac_count + 1`
7756243730Srwatson    if test $lt_ac_count -gt $lt_ac_max; then
7757243730Srwatson      lt_ac_max=$lt_ac_count
7758243730Srwatson      lt_cv_path_SED=$lt_ac_sed
7759243730Srwatson    fi
7760243730Srwatson  done
7761243730Srwatsondone
7762243730Srwatson])
7763243730SrwatsonSED=$lt_cv_path_SED
7764243730SrwatsonAC_SUBST([SED])
7765243730SrwatsonAC_MSG_RESULT([$SED])
7766243730Srwatson])#AC_PROG_SED
7767243730Srwatson])#m4_ifndef
7768243730Srwatson
7769243730Srwatson# Old name:
7770243730SrwatsonAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7771243730Srwatsondnl aclocal-1.4 backwards compatibility:
7772243730Srwatsondnl AC_DEFUN([LT_AC_PROG_SED], [])
7773243730Srwatson
7774243730Srwatson
7775243730Srwatson# _LT_CHECK_SHELL_FEATURES
7776243730Srwatson# ------------------------
7777243730Srwatson# Find out whether the shell is Bourne or XSI compatible,
7778243730Srwatson# or has some other useful features.
7779243730Srwatsonm4_defun([_LT_CHECK_SHELL_FEATURES],
7780243730Srwatson[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7781243730Srwatson# Try some XSI features
7782243730Srwatsonxsi_shell=no
7783243730Srwatson( _lt_dummy="a/b/c"
7784243730Srwatson  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
7785243730Srwatson      = c,a/b,b/c, \
7786243730Srwatson    && eval 'test $(( 1 + 1 )) -eq 2 \
7787243730Srwatson    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7788243730Srwatson  && xsi_shell=yes
7789243730SrwatsonAC_MSG_RESULT([$xsi_shell])
7790243730Srwatson_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7791243730Srwatson
7792243730SrwatsonAC_MSG_CHECKING([whether the shell understands "+="])
7793243730Srwatsonlt_shell_append=no
7794243730Srwatson( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7795243730Srwatson    >/dev/null 2>&1 \
7796243730Srwatson  && lt_shell_append=yes
7797243730SrwatsonAC_MSG_RESULT([$lt_shell_append])
7798243730Srwatson_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7799243730Srwatson
7800243730Srwatsonif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7801243730Srwatson  lt_unset=unset
7802243730Srwatsonelse
7803243730Srwatson  lt_unset=false
7804243730Srwatsonfi
7805243730Srwatson_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7806243730Srwatson
7807243730Srwatson# test EBCDIC or ASCII
7808243730Srwatsoncase `echo X|tr X '\101'` in
7809243730Srwatson A) # ASCII based system
7810243730Srwatson    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7811243730Srwatson  lt_SP2NL='tr \040 \012'
7812243730Srwatson  lt_NL2SP='tr \015\012 \040\040'
7813243730Srwatson  ;;
7814243730Srwatson *) # EBCDIC based system
7815243730Srwatson  lt_SP2NL='tr \100 \n'
7816243730Srwatson  lt_NL2SP='tr \r\n \100\100'
7817243730Srwatson  ;;
7818243730Srwatsonesac
7819243730Srwatson_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7820243730Srwatson_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7821243730Srwatson])# _LT_CHECK_SHELL_FEATURES
7822243730Srwatson
7823243730Srwatson
7824243730Srwatson# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
7825243730Srwatson# ------------------------------------------------------
7826243730Srwatson# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
7827243730Srwatson# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
7828243730Srwatsonm4_defun([_LT_PROG_FUNCTION_REPLACE],
7829243730Srwatson[dnl {
7830243730Srwatsonsed -e '/^$1 ()$/,/^} # $1 /c\
7831243730Srwatson$1 ()\
7832243730Srwatson{\
7833243730Srwatsonm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
7834243730Srwatson} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
7835243730Srwatson  && mv -f "$cfgfile.tmp" "$cfgfile" \
7836243730Srwatson    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7837243730Srwatsontest 0 -eq $? || _lt_function_replace_fail=:
7838243730Srwatson])
7839243730Srwatson
7840243730Srwatson
7841243730Srwatson# _LT_PROG_REPLACE_SHELLFNS
7842243730Srwatson# -------------------------
7843243730Srwatson# Replace existing portable implementations of several shell functions with
7844243730Srwatson# equivalent extended shell implementations where those features are available..
7845243730Srwatsonm4_defun([_LT_PROG_REPLACE_SHELLFNS],
7846243730Srwatson[if test x"$xsi_shell" = xyes; then
7847243730Srwatson  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
7848243730Srwatson    case ${1} in
7849243730Srwatson      */*) func_dirname_result="${1%/*}${2}" ;;
7850243730Srwatson      *  ) func_dirname_result="${3}" ;;
7851243730Srwatson    esac])
7852243730Srwatson
7853243730Srwatson  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
7854243730Srwatson    func_basename_result="${1##*/}"])
7855243730Srwatson
7856243730Srwatson  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
7857243730Srwatson    case ${1} in
7858243730Srwatson      */*) func_dirname_result="${1%/*}${2}" ;;
7859243730Srwatson      *  ) func_dirname_result="${3}" ;;
7860243730Srwatson    esac
7861243730Srwatson    func_basename_result="${1##*/}"])
7862243730Srwatson
7863243730Srwatson  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
7864243730Srwatson    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7865243730Srwatson    # positional parameters, so assign one to ordinary parameter first.
7866243730Srwatson    func_stripname_result=${3}
7867243730Srwatson    func_stripname_result=${func_stripname_result#"${1}"}
7868243730Srwatson    func_stripname_result=${func_stripname_result%"${2}"}])
7869243730Srwatson
7870243730Srwatson  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
7871243730Srwatson    func_split_long_opt_name=${1%%=*}
7872243730Srwatson    func_split_long_opt_arg=${1#*=}])
7873243730Srwatson
7874243730Srwatson  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
7875243730Srwatson    func_split_short_opt_arg=${1#??}
7876243730Srwatson    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
7877243730Srwatson
7878243730Srwatson  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
7879243730Srwatson    case ${1} in
7880243730Srwatson      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7881243730Srwatson      *)    func_lo2o_result=${1} ;;
7882243730Srwatson    esac])
7883243730Srwatson
7884243730Srwatson  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
7885243730Srwatson
7886243730Srwatson  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
7887243730Srwatson
7888243730Srwatson  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
7889243730Srwatsonfi
7890243730Srwatson
7891243730Srwatsonif test x"$lt_shell_append" = xyes; then
7892243730Srwatson  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
7893243730Srwatson
7894243730Srwatson  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
7895243730Srwatson    func_quote_for_eval "${2}"
7896243730Srwatsondnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
7897243730Srwatson    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
7898243730Srwatson
7899243730Srwatson  # Save a `func_append' function call where possible by direct use of '+='
7900243730Srwatson  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
7901243730Srwatson    && mv -f "$cfgfile.tmp" "$cfgfile" \
7902243730Srwatson      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7903243730Srwatson  test 0 -eq $? || _lt_function_replace_fail=:
7904243730Srwatsonelse
7905243730Srwatson  # Save a `func_append' function call even when '+=' is not available
7906243730Srwatson  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
7907243730Srwatson    && mv -f "$cfgfile.tmp" "$cfgfile" \
7908243730Srwatson      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7909243730Srwatson  test 0 -eq $? || _lt_function_replace_fail=:
7910243730Srwatsonfi
7911243730Srwatson
7912243730Srwatsonif test x"$_lt_function_replace_fail" = x":"; then
7913243730Srwatson  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
7914243730Srwatsonfi
7915243730Srwatson])
7916243730Srwatson
7917243730Srwatson# _LT_PATH_CONVERSION_FUNCTIONS
7918243730Srwatson# -----------------------------
7919243730Srwatson# Determine which file name conversion functions should be used by
7920243730Srwatson# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
7921243730Srwatson# for certain cross-compile configurations and native mingw.
7922243730Srwatsonm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
7923243730Srwatson[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7924243730SrwatsonAC_REQUIRE([AC_CANONICAL_BUILD])dnl
7925243730SrwatsonAC_MSG_CHECKING([how to convert $build file names to $host format])
7926243730SrwatsonAC_CACHE_VAL(lt_cv_to_host_file_cmd,
7927243730Srwatson[case $host in
7928243730Srwatson  *-*-mingw* )
7929243730Srwatson    case $build in
7930243730Srwatson      *-*-mingw* ) # actually msys
7931243730Srwatson        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
7932243730Srwatson        ;;
7933243730Srwatson      *-*-cygwin* )
7934243730Srwatson        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
7935243730Srwatson        ;;
7936243730Srwatson      * ) # otherwise, assume *nix
7937243730Srwatson        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
7938243730Srwatson        ;;
7939243730Srwatson    esac
7940243730Srwatson    ;;
7941243730Srwatson  *-*-cygwin* )
7942243730Srwatson    case $build in
7943243730Srwatson      *-*-mingw* ) # actually msys
7944243730Srwatson        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
7945243730Srwatson        ;;
7946243730Srwatson      *-*-cygwin* )
7947243730Srwatson        lt_cv_to_host_file_cmd=func_convert_file_noop
7948243730Srwatson        ;;
7949243730Srwatson      * ) # otherwise, assume *nix
7950243730Srwatson        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
7951243730Srwatson        ;;
7952243730Srwatson    esac
7953243730Srwatson    ;;
7954243730Srwatson  * ) # unhandled hosts (and "normal" native builds)
7955243730Srwatson    lt_cv_to_host_file_cmd=func_convert_file_noop
7956243730Srwatson    ;;
7957243730Srwatsonesac
7958243730Srwatson])
7959243730Srwatsonto_host_file_cmd=$lt_cv_to_host_file_cmd
7960243730SrwatsonAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
7961243730Srwatson_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
7962243730Srwatson         [0], [convert $build file names to $host format])dnl
7963243730Srwatson
7964243730SrwatsonAC_MSG_CHECKING([how to convert $build file names to toolchain format])
7965243730SrwatsonAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
7966243730Srwatson[#assume ordinary cross tools, or native build.
7967243730Srwatsonlt_cv_to_tool_file_cmd=func_convert_file_noop
7968243730Srwatsoncase $host in
7969243730Srwatson  *-*-mingw* )
7970243730Srwatson    case $build in
7971243730Srwatson      *-*-mingw* ) # actually msys
7972243730Srwatson        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
7973243730Srwatson        ;;
7974243730Srwatson    esac
7975243730Srwatson    ;;
7976243730Srwatsonesac
7977243730Srwatson])
7978243730Srwatsonto_tool_file_cmd=$lt_cv_to_tool_file_cmd
7979243730SrwatsonAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
7980243730Srwatson_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
7981243730Srwatson         [0], [convert $build files to toolchain format])dnl
7982243730Srwatson])# _LT_PATH_CONVERSION_FUNCTIONS
7983