aclocal.m4 revision c27c18e8
1c27c18e8Smrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
2c43cc173Smrg
3c43cc173Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4c27c18e8Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5c43cc173Smrg# This file is free software; the Free Software Foundation
6c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
7c43cc173Smrg# with or without modifications, as long as this notice is preserved.
8c43cc173Smrg
9c43cc173Smrg# This program is distributed in the hope that it will be useful,
10c43cc173Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11c43cc173Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12c43cc173Smrg# PARTICULAR PURPOSE.
13c43cc173Smrg
1421e67964Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1521e67964Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16c27c18e8Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
1721e67964Smrg[m4_warning([this file was generated for autoconf 2.63.
1821e67964SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
1921e67964SmrgIf you have problems, you may need to regenerate the build system entirely.
2021e67964SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21c43cc173Smrg
2221e67964Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
23c27c18e8Smrg#
24c27c18e8Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
25c27c18e8Smrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
26c27c18e8Smrg#   Written by Gordon Matzigkeit, 1996
27c27c18e8Smrg#
28c27c18e8Smrg# This file is free software; the Free Software Foundation gives
29c27c18e8Smrg# unlimited permission to copy and/or distribute it, with or without
30c27c18e8Smrg# modifications, as long as this notice is preserved.
31c27c18e8Smrg
32c27c18e8Smrgm4_define([_LT_COPYING], [dnl
33c27c18e8Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
34c27c18e8Smrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
35c27c18e8Smrg#   Written by Gordon Matzigkeit, 1996
36c27c18e8Smrg#
37c27c18e8Smrg#   This file is part of GNU Libtool.
38c27c18e8Smrg#
39c27c18e8Smrg# GNU Libtool is free software; you can redistribute it and/or
40c27c18e8Smrg# modify it under the terms of the GNU General Public License as
41c27c18e8Smrg# published by the Free Software Foundation; either version 2 of
42c27c18e8Smrg# the License, or (at your option) any later version.
43c27c18e8Smrg#
44c27c18e8Smrg# As a special exception to the GNU General Public License,
45c27c18e8Smrg# if you distribute this file as part of a program or library that
46c27c18e8Smrg# is built using GNU Libtool, you may include this file under the
47c27c18e8Smrg# same distribution terms that you use for the rest of that program.
48c27c18e8Smrg#
49c27c18e8Smrg# GNU Libtool is distributed in the hope that it will be useful,
50c27c18e8Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
51c27c18e8Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
52c27c18e8Smrg# GNU General Public License for more details.
53c27c18e8Smrg#
54c27c18e8Smrg# You should have received a copy of the GNU General Public License
55c27c18e8Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
56c27c18e8Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
57c27c18e8Smrg# obtained by writing to the Free Software Foundation, Inc.,
58c27c18e8Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
59c27c18e8Smrg])
60c43cc173Smrg
61c27c18e8Smrg# serial 56 LT_INIT
62c43cc173Smrg
63c43cc173Smrg
64c27c18e8Smrg# LT_PREREQ(VERSION)
65c27c18e8Smrg# ------------------
66c27c18e8Smrg# Complain and exit if this libtool version is less that VERSION.
67c27c18e8Smrgm4_defun([LT_PREREQ],
68c27c18e8Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
69c27c18e8Smrg       [m4_default([$3],
70c27c18e8Smrg		   [m4_fatal([Libtool version $1 or higher is required],
71c27c18e8Smrg		             63)])],
72c27c18e8Smrg       [$2])])
73c43cc173Smrg
74c43cc173Smrg
75c27c18e8Smrg# _LT_CHECK_BUILDDIR
76c27c18e8Smrg# ------------------
77c27c18e8Smrg# Complain if the absolute build directory name contains unusual characters
78c27c18e8Smrgm4_defun([_LT_CHECK_BUILDDIR],
79c27c18e8Smrg[case `pwd` in
80c27c18e8Smrg  *\ * | *\	*)
81c27c18e8Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
82c27c18e8Smrgesac
83c27c18e8Smrg])
84c27c18e8Smrg
85c27c18e8Smrg
86c27c18e8Smrg# LT_INIT([OPTIONS])
87c27c18e8Smrg# ------------------
88c27c18e8SmrgAC_DEFUN([LT_INIT],
89c27c18e8Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
90c27c18e8SmrgAC_BEFORE([$0], [LT_LANG])dnl
91c27c18e8SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
92c27c18e8SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
93c27c18e8Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
94c27c18e8Smrg
95c27c18e8Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
96c27c18e8Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
97c27c18e8Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
98c27c18e8Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
99c27c18e8Smrgdnl unless we require an AC_DEFUNed macro:
100c27c18e8SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
101c27c18e8SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
102c27c18e8SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
103c27c18e8SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
104c27c18e8Smrgm4_require([_LT_PROG_LTMAIN])dnl
105c27c18e8Smrg
106c27c18e8Smrgdnl Parse OPTIONS
107c27c18e8Smrg_LT_SET_OPTIONS([$0], [$1])
108c43cc173Smrg
10921e67964Smrg# This can be used to rebuild libtool when needed
110c27c18e8SmrgLIBTOOL_DEPS="$ltmain"
111c43cc173Smrg
11221e67964Smrg# Always use our own libtool.
11321e67964SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
11421e67964SmrgAC_SUBST(LIBTOOL)dnl
115c43cc173Smrg
116c27c18e8Smrg_LT_SETUP
117c43cc173Smrg
118c27c18e8Smrg# Only expand once:
119c27c18e8Smrgm4_define([LT_INIT])
120c27c18e8Smrg])# LT_INIT
121c43cc173Smrg
122c27c18e8Smrg# Old names:
123c27c18e8SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
124c27c18e8SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
125c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
126c27c18e8Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
127c27c18e8Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
128c27c18e8Smrg
129c27c18e8Smrg
130c27c18e8Smrg# _LT_CC_BASENAME(CC)
131c27c18e8Smrg# -------------------
132c27c18e8Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
133c27c18e8Smrgm4_defun([_LT_CC_BASENAME],
134c27c18e8Smrg[for cc_temp in $1""; do
135c27c18e8Smrg  case $cc_temp in
136c27c18e8Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
137c27c18e8Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
138c27c18e8Smrg    \-*) ;;
139c27c18e8Smrg    *) break;;
140c27c18e8Smrg  esac
141c27c18e8Smrgdone
142c27c18e8Smrgcc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
143c27c18e8Smrg])
144c27c18e8Smrg
145c27c18e8Smrg
146c27c18e8Smrg# _LT_FILEUTILS_DEFAULTS
147c27c18e8Smrg# ----------------------
148c27c18e8Smrg# It is okay to use these file commands and assume they have been set
149c27c18e8Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
150c27c18e8Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
151c27c18e8Smrg[: ${CP="cp -f"}
152c27c18e8Smrg: ${MV="mv -f"}
153c27c18e8Smrg: ${RM="rm -f"}
154c27c18e8Smrg])# _LT_FILEUTILS_DEFAULTS
155c27c18e8Smrg
156c27c18e8Smrg
157c27c18e8Smrg# _LT_SETUP
158c27c18e8Smrg# ---------
159c27c18e8Smrgm4_defun([_LT_SETUP],
160c27c18e8Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
16121e67964SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
162c27c18e8Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
163c27c18e8Smrg_LT_DECL([], [host], [0])dnl
164c27c18e8Smrg_LT_DECL([], [host_os], [0])dnl
165c27c18e8Smrgdnl
166c27c18e8Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
167c27c18e8Smrg_LT_DECL([], [build], [0])dnl
168c27c18e8Smrg_LT_DECL([], [build_os], [0])dnl
169c27c18e8Smrgdnl
17021e67964SmrgAC_REQUIRE([AC_PROG_CC])dnl
171c27c18e8SmrgAC_REQUIRE([LT_PATH_LD])dnl
172c27c18e8SmrgAC_REQUIRE([LT_PATH_NM])dnl
173c27c18e8Smrgdnl
17421e67964SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
175c27c18e8Smrgtest -z "$LN_S" && LN_S="ln -s"
176c27c18e8Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
177c27c18e8Smrgdnl
178c27c18e8SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
179c27c18e8Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
180c27c18e8Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
18121e67964Smrgdnl
182c27c18e8Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
183c27c18e8Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
184c27c18e8Smrgm4_require([_LT_CMD_RELOAD])dnl
185c27c18e8Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
186c27c18e8Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
187c27c18e8Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
188c27c18e8Smrg
189c27c18e8Smrg_LT_CONFIG_LIBTOOL_INIT([
190c27c18e8Smrg# See if we are running on zsh, and set the options which allow our
191c27c18e8Smrg# commands through without removal of \ escapes INIT.
192c27c18e8Smrgif test -n "\${ZSH_VERSION+set}" ; then
193c27c18e8Smrg   setopt NO_GLOB_SUBST
194c27c18e8Smrgfi
195c27c18e8Smrg])
196c27c18e8Smrgif test -n "${ZSH_VERSION+set}" ; then
197c27c18e8Smrg   setopt NO_GLOB_SUBST
198c27c18e8Smrgfi
199c27c18e8Smrg
200c27c18e8Smrg_LT_CHECK_OBJDIR
201c43cc173Smrg
202c27c18e8Smrgm4_require([_LT_TAG_COMPILER])dnl
203c27c18e8Smrg_LT_PROG_ECHO_BACKSLASH
204c43cc173Smrg
20521e67964Smrgcase $host_os in
20621e67964Smrgaix3*)
20721e67964Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
20821e67964Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
20921e67964Smrg  # vanish in a puff of smoke.
21021e67964Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
21121e67964Smrg    COLLECT_NAMES=
21221e67964Smrg    export COLLECT_NAMES
21321e67964Smrg  fi
21421e67964Smrg  ;;
21521e67964Smrgesac
216c43cc173Smrg
21721e67964Smrg# Sed substitution that helps us do robust quoting.  It backslashifies
21821e67964Smrg# metacharacters that are still active within double-quoted strings.
219c27c18e8Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
220c43cc173Smrg
22121e67964Smrg# Same as above, but do not quote variable references.
222c27c18e8Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
223c43cc173Smrg
22421e67964Smrg# Sed substitution to delay expansion of an escaped shell variable in a
22521e67964Smrg# double_quote_subst'ed string.
22621e67964Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
227c43cc173Smrg
228c27c18e8Smrg# Sed substitution to delay expansion of an escaped single quote.
229c27c18e8Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
230c27c18e8Smrg
23121e67964Smrg# Sed substitution to avoid accidental globbing in evaled expressions
23221e67964Smrgno_glob_subst='s/\*/\\\*/g'
233c43cc173Smrg
23421e67964Smrg# Global variables:
235c27c18e8Smrgofile=libtool
23621e67964Smrgcan_build_shared=yes
237c43cc173Smrg
23821e67964Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
23921e67964Smrg# which needs '.lib').
24021e67964Smrglibext=a
241c43cc173Smrg
242c27c18e8Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
243c43cc173Smrg
24421e67964Smrgold_CC="$CC"
24521e67964Smrgold_CFLAGS="$CFLAGS"
246c43cc173Smrg
24721e67964Smrg# Set sane defaults for various variables
24821e67964Smrgtest -z "$CC" && CC=cc
24921e67964Smrgtest -z "$LTCC" && LTCC=$CC
25021e67964Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
25121e67964Smrgtest -z "$LD" && LD=ld
25221e67964Smrgtest -z "$ac_objext" && ac_objext=o
253c43cc173Smrg
25421e67964Smrg_LT_CC_BASENAME([$compiler])
255c43cc173Smrg
25621e67964Smrg# Only perform the check for file, if the check method requires it
257c27c18e8Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
25821e67964Smrgcase $deplibs_check_method in
25921e67964Smrgfile_magic*)
26021e67964Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
261c27c18e8Smrg    _LT_PATH_MAGIC
26221e67964Smrg  fi
26321e67964Smrg  ;;
26421e67964Smrgesac
265c43cc173Smrg
266c27c18e8Smrg# Use C for the default configuration in the libtool script
267c27c18e8SmrgLT_SUPPORTED_TAG([CC])
268c27c18e8Smrg_LT_LANG_C_CONFIG
269c27c18e8Smrg_LT_LANG_DEFAULT_CONFIG
270c27c18e8Smrg_LT_CONFIG_COMMANDS
271c27c18e8Smrg])# _LT_SETUP
272c43cc173Smrg
273c43cc173Smrg
274c27c18e8Smrg# _LT_PROG_LTMAIN
275c27c18e8Smrg# ---------------
276c27c18e8Smrg# Note that this code is called both from `configure', and `config.status'
277c27c18e8Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
278c27c18e8Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
279c27c18e8Smrg# so we pass a copy along to make sure it has a sensible value anyway.
280c27c18e8Smrgm4_defun([_LT_PROG_LTMAIN],
281c27c18e8Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
282c27c18e8Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
283c27c18e8Smrgltmain="$ac_aux_dir/ltmain.sh"
284c27c18e8Smrg])# _LT_PROG_LTMAIN
285c43cc173Smrg
286c43cc173Smrg
287c27c18e8Smrg
288c27c18e8Smrg# So that we can recreate a full libtool script including additional
289c27c18e8Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
290c27c18e8Smrg# in macros and then make a single call at the end using the `libtool'
291c27c18e8Smrg# label.
292c27c18e8Smrg
293c27c18e8Smrg
294c27c18e8Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
295c27c18e8Smrg# ----------------------------------------
296c27c18e8Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
297c27c18e8Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
298c27c18e8Smrg[m4_ifval([$1],
299c27c18e8Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
300c27c18e8Smrg                     [$1
301c27c18e8Smrg])])])
302c27c18e8Smrg
303c27c18e8Smrg# Initialize.
304c27c18e8Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
305c27c18e8Smrg
306c27c18e8Smrg
307c27c18e8Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
308c27c18e8Smrg# ------------------------------
309c27c18e8Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
310c27c18e8Smrgm4_define([_LT_CONFIG_LIBTOOL],
311c27c18e8Smrg[m4_ifval([$1],
312c27c18e8Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
313c27c18e8Smrg                     [$1
314c27c18e8Smrg])])])
315c27c18e8Smrg
316c27c18e8Smrg# Initialize.
317c27c18e8Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
318c27c18e8Smrg
319c27c18e8Smrg
320c27c18e8Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
321c27c18e8Smrg# -----------------------------------------------------
322c27c18e8Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
323c27c18e8Smrg[_LT_CONFIG_LIBTOOL([$1])
324c27c18e8Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
325c27c18e8Smrg])
326c27c18e8Smrg
327c27c18e8Smrg
328c27c18e8Smrg# _LT_FORMAT_COMMENT([COMMENT])
329c27c18e8Smrg# -----------------------------
330c27c18e8Smrg# Add leading comment marks to the start of each line, and a trailing
331c27c18e8Smrg# full-stop to the whole comment if one is not present already.
332c27c18e8Smrgm4_define([_LT_FORMAT_COMMENT],
333c27c18e8Smrg[m4_ifval([$1], [
334c27c18e8Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
335c27c18e8Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
336c27c18e8Smrg)])
337c27c18e8Smrg
338c27c18e8Smrg
339c27c18e8Smrg
340c27c18e8Smrg
341c27c18e8Smrg
342c27c18e8Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
343c27c18e8Smrg# -------------------------------------------------------------------
344c27c18e8Smrg# CONFIGNAME is the name given to the value in the libtool script.
345c27c18e8Smrg# VARNAME is the (base) name used in the configure script.
346c27c18e8Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
347c27c18e8Smrg# VARNAME.  Any other value will be used directly.
348c27c18e8Smrgm4_define([_LT_DECL],
349c27c18e8Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
350c27c18e8Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
351c27c18e8Smrg	[m4_ifval([$1], [$1], [$2])])
352c27c18e8Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
353c27c18e8Smrg    m4_ifval([$4],
354c27c18e8Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
355c27c18e8Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
356c27c18e8Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
357c27c18e8Smrg])
358c27c18e8Smrg
359c27c18e8Smrg
360c27c18e8Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
361c27c18e8Smrg# --------------------------------------------------------
362c27c18e8Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
363c27c18e8Smrg
364c27c18e8Smrg
365c27c18e8Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
366c27c18e8Smrg# ------------------------------------------------
367c27c18e8Smrgm4_define([lt_decl_tag_varnames],
368c27c18e8Smrg[_lt_decl_filter([tagged?], [yes], $@)])
369c27c18e8Smrg
370c27c18e8Smrg
371c27c18e8Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
372c27c18e8Smrg# ---------------------------------------------------------
373c27c18e8Smrgm4_define([_lt_decl_filter],
374c27c18e8Smrg[m4_case([$#],
375c27c18e8Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
376c27c18e8Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
377c27c18e8Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
378c27c18e8Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
379c27c18e8Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
380c27c18e8Smrg])
381c27c18e8Smrg
382c27c18e8Smrg
383c27c18e8Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
384c27c18e8Smrg# --------------------------------------------------
385c27c18e8Smrgm4_define([lt_decl_quote_varnames],
386c27c18e8Smrg[_lt_decl_filter([value], [1], $@)])
387c27c18e8Smrg
388c27c18e8Smrg
389c27c18e8Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
390c27c18e8Smrg# ---------------------------------------------------
391c27c18e8Smrgm4_define([lt_decl_dquote_varnames],
392c27c18e8Smrg[_lt_decl_filter([value], [2], $@)])
393c27c18e8Smrg
394c27c18e8Smrg
395c27c18e8Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
396c27c18e8Smrg# ---------------------------------------------------
397c27c18e8Smrgm4_define([lt_decl_varnames_tagged],
398c27c18e8Smrg[m4_assert([$# <= 2])dnl
399c27c18e8Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
400c27c18e8Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
401c27c18e8Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
402c27c18e8Smrgm4_define([_lt_decl_varnames_tagged],
403c27c18e8Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
404c27c18e8Smrg
405c27c18e8Smrg
406c27c18e8Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
407c27c18e8Smrg# ------------------------------------------------
408c27c18e8Smrgm4_define([lt_decl_all_varnames],
409c27c18e8Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
410c27c18e8Smrg     m4_if([$2], [],
411c27c18e8Smrg	   m4_quote(lt_decl_varnames),
412c27c18e8Smrg	m4_quote(m4_shift($@))))[]dnl
413c27c18e8Smrg])
414c27c18e8Smrgm4_define([_lt_decl_all_varnames],
415c27c18e8Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
416c27c18e8Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
417c27c18e8Smrg])
418c27c18e8Smrg
419c27c18e8Smrg
420c27c18e8Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
421c27c18e8Smrg# ------------------------------------
422c27c18e8Smrg# Quote a variable value, and forward it to `config.status' so that its
423c27c18e8Smrg# declaration there will have the same value as in `configure'.  VARNAME
424c27c18e8Smrg# must have a single quote delimited value for this to work.
425c27c18e8Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
426c27c18e8Smrg[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
427c27c18e8Smrg
428c27c18e8Smrg
429c27c18e8Smrg# _LT_CONFIG_STATUS_DECLARATIONS
430c27c18e8Smrg# ------------------------------
431c27c18e8Smrg# We delimit libtool config variables with single quotes, so when
432c27c18e8Smrg# we write them to config.status, we have to be sure to quote all
433c27c18e8Smrg# embedded single quotes properly.  In configure, this macro expands
434c27c18e8Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
435c27c18e8Smrg#
436c27c18e8Smrg#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
437c27c18e8Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
438c27c18e8Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
439c27c18e8Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
440c43cc173Smrg
441c43cc173Smrg
442c27c18e8Smrg# _LT_LIBTOOL_TAGS
443c27c18e8Smrg# ----------------
444c27c18e8Smrg# Output comment and list of tags supported by the script
445c27c18e8Smrgm4_defun([_LT_LIBTOOL_TAGS],
446c27c18e8Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
447c27c18e8Smrgavailable_tags="_LT_TAGS"dnl
448c27c18e8Smrg])
449c27c18e8Smrg
450c27c18e8Smrg
451c27c18e8Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
452c27c18e8Smrg# -----------------------------------
453c27c18e8Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
454c27c18e8Smrg# expand to a commented shell variable setting:
455c27c18e8Smrg#
456c27c18e8Smrg#    # Some comment about what VAR is for.
457c27c18e8Smrg#    visible_name=$lt_internal_name
458c27c18e8Smrgm4_define([_LT_LIBTOOL_DECLARE],
459c27c18e8Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
460c27c18e8Smrg					   [description])))[]dnl
461c27c18e8Smrgm4_pushdef([_libtool_name],
462c27c18e8Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
463c27c18e8Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
464c27c18e8Smrg    [0], [_libtool_name=[$]$1],
465c27c18e8Smrg    [1], [_libtool_name=$lt_[]$1],
466c27c18e8Smrg    [2], [_libtool_name=$lt_[]$1],
467c27c18e8Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
468c27c18e8Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
469c27c18e8Smrg])
470c27c18e8Smrg
471c27c18e8Smrg
472c27c18e8Smrg# _LT_LIBTOOL_CONFIG_VARS
473c27c18e8Smrg# -----------------------
474c27c18e8Smrg# Produce commented declarations of non-tagged libtool config variables
475c27c18e8Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
476c27c18e8Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
477c27c18e8Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
478c27c18e8Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
479c27c18e8Smrg[m4_foreach([_lt_var],
480c27c18e8Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
481c27c18e8Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
482c27c18e8Smrg
483c27c18e8Smrg
484c27c18e8Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
485c27c18e8Smrg# -------------------------
486c27c18e8Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
487c27c18e8Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
488c27c18e8Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
489c27c18e8Smrg
490c27c18e8Smrg
491c27c18e8Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
492c27c18e8Smrg# ------------------------------
493c27c18e8Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
494c27c18e8Smrg
495c27c18e8Smrg
496c27c18e8Smrg# _LT_CONFIG_COMMANDS
49721e67964Smrg# -------------------
498c27c18e8Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
499c27c18e8Smrg# variables for single and double quote escaping we saved from calls
500c27c18e8Smrg# to _LT_DECL, we can put quote escaped variables declarations
501c27c18e8Smrg# into `config.status', and then the shell code to quote escape them in
502c27c18e8Smrg# for loops in `config.status'.  Finally, any additional code accumulated
503c27c18e8Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
504c27c18e8Smrgm4_defun([_LT_CONFIG_COMMANDS],
505c27c18e8Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
506c27c18e8Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
507c27c18e8Smrg	dnl instead of duplicating it all over again into config.status,
508c27c18e8Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
509c27c18e8Smrg	dnl needs to know what name is stored there:
510c27c18e8Smrg        [AC_CONFIG_COMMANDS([libtool],
511c27c18e8Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
512c27c18e8Smrg    dnl If the libtool generation code is destined for config.status,
513c27c18e8Smrg    dnl expand the accumulated commands and init code now:
514c27c18e8Smrg    [AC_CONFIG_COMMANDS([libtool],
515c27c18e8Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
516c27c18e8Smrg])#_LT_CONFIG_COMMANDS
517c27c18e8Smrg
518c27c18e8Smrg
519c27c18e8Smrg# Initialize.
520c27c18e8Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
521c27c18e8Smrg[
522c27c18e8Smrg
523c27c18e8Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
524c27c18e8Smrg# if CDPATH is set.
525c27c18e8Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
526c27c18e8Smrg
527c27c18e8Smrgsed_quote_subst='$sed_quote_subst'
528c27c18e8Smrgdouble_quote_subst='$double_quote_subst'
529c27c18e8Smrgdelay_variable_subst='$delay_variable_subst'
530c27c18e8Smrg_LT_CONFIG_STATUS_DECLARATIONS
531c27c18e8SmrgLTCC='$LTCC'
532c27c18e8SmrgLTCFLAGS='$LTCFLAGS'
533c27c18e8Smrgcompiler='$compiler_DEFAULT'
534c27c18e8Smrg
535c27c18e8Smrg# Quote evaled strings.
536c27c18e8Smrgfor var in lt_decl_all_varnames([[ \
537c27c18e8Smrg]], lt_decl_quote_varnames); do
538c27c18e8Smrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
539c27c18e8Smrg    *[[\\\\\\\`\\"\\\$]]*)
540c27c18e8Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
541c27c18e8Smrg      ;;
542c27c18e8Smrg    *)
543c27c18e8Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
544c27c18e8Smrg      ;;
545c27c18e8Smrg    esac
546c27c18e8Smrgdone
547c27c18e8Smrg
548c27c18e8Smrg# Double-quote double-evaled strings.
549c27c18e8Smrgfor var in lt_decl_all_varnames([[ \
550c27c18e8Smrg]], lt_decl_dquote_varnames); do
551c27c18e8Smrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
552c27c18e8Smrg    *[[\\\\\\\`\\"\\\$]]*)
553c27c18e8Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
554c27c18e8Smrg      ;;
555c27c18e8Smrg    *)
556c27c18e8Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
557c27c18e8Smrg      ;;
558c27c18e8Smrg    esac
559c27c18e8Smrgdone
560c27c18e8Smrg
561c27c18e8Smrg# Fix-up fallback echo if it was mangled by the above quoting rules.
562c27c18e8Smrgcase \$lt_ECHO in
563c27c18e8Smrg*'\\\[$]0 --fallback-echo"')dnl "
564c27c18e8Smrg  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
565c27c18e8Smrg  ;;
566c27c18e8Smrgesac
567c27c18e8Smrg
568c27c18e8Smrg_LT_OUTPUT_LIBTOOL_INIT
569c27c18e8Smrg])
570c27c18e8Smrg
571c27c18e8Smrg
572c27c18e8Smrg# LT_OUTPUT
573c27c18e8Smrg# ---------
574c27c18e8Smrg# This macro allows early generation of the libtool script (before
575c27c18e8Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
576c27c18e8Smrg# tests.
577c27c18e8SmrgAC_DEFUN([LT_OUTPUT],
578c27c18e8Smrg[: ${CONFIG_LT=./config.lt}
579c27c18e8SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
580c27c18e8Smrgcat >"$CONFIG_LT" <<_LTEOF
581c27c18e8Smrg#! $SHELL
582c27c18e8Smrg# Generated by $as_me.
583c27c18e8Smrg# Run this file to recreate a libtool stub with the current configuration.
584c27c18e8Smrg
585c27c18e8Smrglt_cl_silent=false
586c27c18e8SmrgSHELL=\${CONFIG_SHELL-$SHELL}
587c27c18e8Smrg_LTEOF
588c27c18e8Smrg
589c27c18e8Smrgcat >>"$CONFIG_LT" <<\_LTEOF
590c27c18e8SmrgAS_SHELL_SANITIZE
591c27c18e8Smrg_AS_PREPARE
592c27c18e8Smrg
593c27c18e8Smrgexec AS_MESSAGE_FD>&1
594c27c18e8Smrgexec AS_MESSAGE_LOG_FD>>config.log
595c27c18e8Smrg{
596c27c18e8Smrg  echo
597c27c18e8Smrg  AS_BOX([Running $as_me.])
598c27c18e8Smrg} >&AS_MESSAGE_LOG_FD
599c27c18e8Smrg
600c27c18e8Smrglt_cl_help="\
601c27c18e8Smrg\`$as_me' creates a local libtool stub from the current configuration,
602c27c18e8Smrgfor use in further configure time tests before the real libtool is
603c27c18e8Smrggenerated.
604c27c18e8Smrg
605c27c18e8SmrgUsage: $[0] [[OPTIONS]]
606c27c18e8Smrg
607c27c18e8Smrg  -h, --help      print this help, then exit
608c27c18e8Smrg  -V, --version   print version number, then exit
609c27c18e8Smrg  -q, --quiet     do not print progress messages
610c27c18e8Smrg  -d, --debug     don't remove temporary files
611c27c18e8Smrg
612c27c18e8SmrgReport bugs to <bug-libtool@gnu.org>."
613c27c18e8Smrg
614c27c18e8Smrglt_cl_version="\
615c27c18e8Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
616c27c18e8Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
617c27c18e8Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
618c27c18e8Smrg
619c27c18e8SmrgCopyright (C) 2008 Free Software Foundation, Inc.
620c27c18e8SmrgThis config.lt script is free software; the Free Software Foundation
621c27c18e8Smrggives unlimited permision to copy, distribute and modify it."
622c27c18e8Smrg
623c27c18e8Smrgwhile test $[#] != 0
624c27c18e8Smrgdo
625c27c18e8Smrg  case $[1] in
626c27c18e8Smrg    --version | --v* | -V )
627c27c18e8Smrg      echo "$lt_cl_version"; exit 0 ;;
628c27c18e8Smrg    --help | --h* | -h )
629c27c18e8Smrg      echo "$lt_cl_help"; exit 0 ;;
630c27c18e8Smrg    --debug | --d* | -d )
631c27c18e8Smrg      debug=: ;;
632c27c18e8Smrg    --quiet | --q* | --silent | --s* | -q )
633c27c18e8Smrg      lt_cl_silent=: ;;
634c27c18e8Smrg
635c27c18e8Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
636c27c18e8SmrgTry \`$[0] --help' for more information.]) ;;
637c27c18e8Smrg
638c27c18e8Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
639c27c18e8SmrgTry \`$[0] --help' for more information.]) ;;
640c27c18e8Smrg  esac
641c27c18e8Smrg  shift
642c27c18e8Smrgdone
643c27c18e8Smrg
644c27c18e8Smrgif $lt_cl_silent; then
645c27c18e8Smrg  exec AS_MESSAGE_FD>/dev/null
646c27c18e8Smrgfi
647c27c18e8Smrg_LTEOF
648c27c18e8Smrg
649c27c18e8Smrgcat >>"$CONFIG_LT" <<_LTEOF
650c27c18e8Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
651c27c18e8Smrg_LTEOF
652c27c18e8Smrg
653c27c18e8Smrgcat >>"$CONFIG_LT" <<\_LTEOF
654c27c18e8SmrgAC_MSG_NOTICE([creating $ofile])
655c27c18e8Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
656c27c18e8SmrgAS_EXIT(0)
657c27c18e8Smrg_LTEOF
658c27c18e8Smrgchmod +x "$CONFIG_LT"
659c27c18e8Smrg
660c27c18e8Smrg# configure is writing to config.log, but config.lt does its own redirection,
661c27c18e8Smrg# appending to config.log, which fails on DOS, as config.log is still kept
662c27c18e8Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
663c27c18e8Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
664c27c18e8Smrgif test "$no_create" != yes; then
665c27c18e8Smrg  lt_cl_success=:
666c27c18e8Smrg  test "$silent" = yes &&
667c27c18e8Smrg    lt_config_lt_args="$lt_config_lt_args --quiet"
668c27c18e8Smrg  exec AS_MESSAGE_LOG_FD>/dev/null
669c27c18e8Smrg  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
670c27c18e8Smrg  exec AS_MESSAGE_LOG_FD>>config.log
671c27c18e8Smrg  $lt_cl_success || AS_EXIT(1)
672c27c18e8Smrgfi
673c27c18e8Smrg])# LT_OUTPUT
674c27c18e8Smrg
675c27c18e8Smrg
676c27c18e8Smrg# _LT_CONFIG(TAG)
677c27c18e8Smrg# ---------------
678c27c18e8Smrg# If TAG is the built-in tag, create an initial libtool script with a
679c27c18e8Smrg# default configuration from the untagged config vars.  Otherwise add code
680c27c18e8Smrg# to config.status for appending the configuration named by TAG from the
681c27c18e8Smrg# matching tagged config vars.
682c27c18e8Smrgm4_defun([_LT_CONFIG],
683c27c18e8Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
684c27c18e8Smrg_LT_CONFIG_SAVE_COMMANDS([
685c27c18e8Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
686c27c18e8Smrg  m4_if(_LT_TAG, [C], [
687c27c18e8Smrg    # See if we are running on zsh, and set the options which allow our
688c27c18e8Smrg    # commands through without removal of \ escapes.
689c27c18e8Smrg    if test -n "${ZSH_VERSION+set}" ; then
690c27c18e8Smrg      setopt NO_GLOB_SUBST
691c27c18e8Smrg    fi
692c27c18e8Smrg
693c27c18e8Smrg    cfgfile="${ofile}T"
694c27c18e8Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
695c27c18e8Smrg    $RM "$cfgfile"
696c27c18e8Smrg
697c27c18e8Smrg    cat <<_LT_EOF >> "$cfgfile"
698c27c18e8Smrg#! $SHELL
699c27c18e8Smrg
700c27c18e8Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
701c27c18e8Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
702c27c18e8Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
703c27c18e8Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
704c27c18e8Smrg#
705c27c18e8Smrg_LT_COPYING
706c27c18e8Smrg_LT_LIBTOOL_TAGS
707c27c18e8Smrg
708c27c18e8Smrg# ### BEGIN LIBTOOL CONFIG
709c27c18e8Smrg_LT_LIBTOOL_CONFIG_VARS
710c27c18e8Smrg_LT_LIBTOOL_TAG_VARS
711c27c18e8Smrg# ### END LIBTOOL CONFIG
712c27c18e8Smrg
713c27c18e8Smrg_LT_EOF
714c27c18e8Smrg
715c27c18e8Smrg  case $host_os in
716c27c18e8Smrg  aix3*)
717c27c18e8Smrg    cat <<\_LT_EOF >> "$cfgfile"
718c27c18e8Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
719c27c18e8Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
720c27c18e8Smrg# vanish in a puff of smoke.
721c27c18e8Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
722c27c18e8Smrg  COLLECT_NAMES=
723c27c18e8Smrg  export COLLECT_NAMES
724c27c18e8Smrgfi
725c27c18e8Smrg_LT_EOF
726c27c18e8Smrg    ;;
727c27c18e8Smrg  esac
728c27c18e8Smrg
729c27c18e8Smrg  _LT_PROG_LTMAIN
730c27c18e8Smrg
731c27c18e8Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
732c27c18e8Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
733c27c18e8Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
734c27c18e8Smrg  # is reportedly fixed, but why not run on old versions too?
735c27c18e8Smrg  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
736c27c18e8Smrg    || (rm -f "$cfgfile"; exit 1)
737c27c18e8Smrg
738c27c18e8Smrg  _LT_PROG_XSI_SHELLFNS
739c27c18e8Smrg
740c27c18e8Smrg  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
741c27c18e8Smrg    || (rm -f "$cfgfile"; exit 1)
742c27c18e8Smrg
743c27c18e8Smrg  mv -f "$cfgfile" "$ofile" ||
744c27c18e8Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
745c27c18e8Smrg  chmod +x "$ofile"
746c27c18e8Smrg],
747c27c18e8Smrg[cat <<_LT_EOF >> "$ofile"
748c27c18e8Smrg
749c27c18e8Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
750c27c18e8Smrgdnl in a comment (ie after a #).
751c27c18e8Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
752c27c18e8Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
753c27c18e8Smrg# ### END LIBTOOL TAG CONFIG: $1
754c27c18e8Smrg_LT_EOF
755c27c18e8Smrg])dnl /m4_if
756c27c18e8Smrg],
757c27c18e8Smrg[m4_if([$1], [], [
758c27c18e8Smrg    PACKAGE='$PACKAGE'
759c27c18e8Smrg    VERSION='$VERSION'
760c27c18e8Smrg    TIMESTAMP='$TIMESTAMP'
761c27c18e8Smrg    RM='$RM'
762c27c18e8Smrg    ofile='$ofile'], [])
763c27c18e8Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
764c27c18e8Smrg])# _LT_CONFIG
765c27c18e8Smrg
766c27c18e8Smrg
767c27c18e8Smrg# LT_SUPPORTED_TAG(TAG)
768c27c18e8Smrg# ---------------------
769c27c18e8Smrg# Trace this macro to discover what tags are supported by the libtool
770c27c18e8Smrg# --tag option, using:
771c27c18e8Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
772c27c18e8SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
773c27c18e8Smrg
774c27c18e8Smrg
775c27c18e8Smrg# C support is built-in for now
776c27c18e8Smrgm4_define([_LT_LANG_C_enabled], [])
777c27c18e8Smrgm4_define([_LT_TAGS], [])
778c27c18e8Smrg
779c27c18e8Smrg
780c27c18e8Smrg# LT_LANG(LANG)
781c27c18e8Smrg# -------------
782c27c18e8Smrg# Enable libtool support for the given language if not already enabled.
783c27c18e8SmrgAC_DEFUN([LT_LANG],
784c27c18e8Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
785c27c18e8Smrgm4_case([$1],
786c27c18e8Smrg  [C],			[_LT_LANG(C)],
787c27c18e8Smrg  [C++],		[_LT_LANG(CXX)],
788c27c18e8Smrg  [Java],		[_LT_LANG(GCJ)],
789c27c18e8Smrg  [Fortran 77],		[_LT_LANG(F77)],
790c27c18e8Smrg  [Fortran],		[_LT_LANG(FC)],
791c27c18e8Smrg  [Windows Resource],	[_LT_LANG(RC)],
792c27c18e8Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
793c27c18e8Smrg    [_LT_LANG($1)],
794c27c18e8Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
795c27c18e8Smrg])# LT_LANG
796c27c18e8Smrg
797c27c18e8Smrg
798c27c18e8Smrg# _LT_LANG(LANGNAME)
799c27c18e8Smrg# ------------------
800c27c18e8Smrgm4_defun([_LT_LANG],
801c27c18e8Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
802c27c18e8Smrg  [LT_SUPPORTED_TAG([$1])dnl
803c27c18e8Smrg  m4_append([_LT_TAGS], [$1 ])dnl
804c27c18e8Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
805c27c18e8Smrg  _LT_LANG_$1_CONFIG($1)])dnl
806c27c18e8Smrg])# _LT_LANG
807c27c18e8Smrg
808c27c18e8Smrg
809c27c18e8Smrg# _LT_LANG_DEFAULT_CONFIG
810c27c18e8Smrg# -----------------------
811c27c18e8Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
812c27c18e8Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
813c27c18e8Smrg  [LT_LANG(CXX)],
814c27c18e8Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
815c27c18e8Smrg
816c27c18e8SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
817c27c18e8Smrg  [LT_LANG(F77)],
818c27c18e8Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
819c27c18e8Smrg
820c27c18e8SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
821c27c18e8Smrg  [LT_LANG(FC)],
822c27c18e8Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
823c27c18e8Smrg
824c27c18e8Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
825c27c18e8Smrgdnl pulling things in needlessly.
826c27c18e8SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
827c27c18e8Smrg  [LT_LANG(GCJ)],
828c27c18e8Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
829c27c18e8Smrg    [LT_LANG(GCJ)],
830c27c18e8Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
831c27c18e8Smrg      [LT_LANG(GCJ)],
832c27c18e8Smrg      [m4_ifdef([AC_PROG_GCJ],
833c27c18e8Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
834c27c18e8Smrg       m4_ifdef([A][M_PROG_GCJ],
835c27c18e8Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
836c27c18e8Smrg       m4_ifdef([LT_PROG_GCJ],
837c27c18e8Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
838c27c18e8Smrg
839c27c18e8SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
840c27c18e8Smrg  [LT_LANG(RC)],
841c27c18e8Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
842c27c18e8Smrg])# _LT_LANG_DEFAULT_CONFIG
843c27c18e8Smrg
844c27c18e8Smrg# Obsolete macros:
845c27c18e8SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
846c27c18e8SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
847c27c18e8SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
848c27c18e8SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
849c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
850c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
851c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
852c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
853c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
854c27c18e8Smrg
855c27c18e8Smrg
856c27c18e8Smrg# _LT_TAG_COMPILER
857c27c18e8Smrg# ----------------
858c27c18e8Smrgm4_defun([_LT_TAG_COMPILER],
85921e67964Smrg[AC_REQUIRE([AC_PROG_CC])dnl
860c43cc173Smrg
861c27c18e8Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
862c27c18e8Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
863c27c18e8Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
864c27c18e8Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
865c27c18e8Smrg
86621e67964Smrg# If no C compiler was specified, use CC.
86721e67964SmrgLTCC=${LTCC-"$CC"}
868c43cc173Smrg
86921e67964Smrg# If no C compiler flags were specified, use CFLAGS.
87021e67964SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
871c43cc173Smrg
87221e67964Smrg# Allow CC to be a program name with arguments.
87321e67964Smrgcompiler=$CC
874c27c18e8Smrg])# _LT_TAG_COMPILER
875c43cc173Smrg
876c43cc173Smrg
87721e67964Smrg# _LT_COMPILER_BOILERPLATE
87821e67964Smrg# ------------------------
87921e67964Smrg# Check for compiler boilerplate output or warnings with
88021e67964Smrg# the simple compiler test code.
881c27c18e8Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
882c27c18e8Smrg[m4_require([_LT_DECL_SED])dnl
88321e67964Smrgac_outfile=conftest.$ac_objext
88421e67964Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
88521e67964Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
88621e67964Smrg_lt_compiler_boilerplate=`cat conftest.err`
887c27c18e8Smrg$RM conftest*
88821e67964Smrg])# _LT_COMPILER_BOILERPLATE
889c43cc173Smrg
890c43cc173Smrg
89121e67964Smrg# _LT_LINKER_BOILERPLATE
89221e67964Smrg# ----------------------
89321e67964Smrg# Check for linker boilerplate output or warnings with
89421e67964Smrg# the simple link test code.
895c27c18e8Smrgm4_defun([_LT_LINKER_BOILERPLATE],
896c27c18e8Smrg[m4_require([_LT_DECL_SED])dnl
89721e67964Smrgac_outfile=conftest.$ac_objext
89821e67964Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
89921e67964Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
90021e67964Smrg_lt_linker_boilerplate=`cat conftest.err`
901c27c18e8Smrg$RM -r conftest*
90221e67964Smrg])# _LT_LINKER_BOILERPLATE
903c43cc173Smrg
90421e67964Smrg# _LT_REQUIRED_DARWIN_CHECKS
905c27c18e8Smrg# -------------------------
906c27c18e8Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
90721e67964Smrg  case $host_os in
90821e67964Smrg    rhapsody* | darwin*)
90921e67964Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
91021e67964Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
911c27c18e8Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
912c27c18e8Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
913c27c18e8Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
914c27c18e8Smrg    _LT_DECL([], [DSYMUTIL], [1],
915c27c18e8Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
916c27c18e8Smrg    _LT_DECL([], [NMEDIT], [1],
917c27c18e8Smrg      [Tool to change global to local symbols on Mac OS X])
918c27c18e8Smrg    _LT_DECL([], [LIPO], [1],
919c27c18e8Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
920c27c18e8Smrg    _LT_DECL([], [OTOOL], [1],
921c27c18e8Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
922c27c18e8Smrg    _LT_DECL([], [OTOOL64], [1],
923c27c18e8Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
92421e67964Smrg
92521e67964Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
92621e67964Smrg      [lt_cv_apple_cc_single_mod=no
92721e67964Smrg      if test -z "${LT_MULTI_MODULE}"; then
928c27c18e8Smrg	# By default we will add the -single_module flag. You can override
929c27c18e8Smrg	# by either setting the environment variable LT_MULTI_MODULE
930c27c18e8Smrg	# non-empty at configure time, or by adding -multi_module to the
931c27c18e8Smrg	# link flags.
932c27c18e8Smrg	rm -rf libconftest.dylib*
933c27c18e8Smrg	echo "int foo(void){return 1;}" > conftest.c
934c27c18e8Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
935c27c18e8Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
936c27c18e8Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
937c27c18e8Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
938c27c18e8Smrg        _lt_result=$?
939c27c18e8Smrg	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
940c27c18e8Smrg	  lt_cv_apple_cc_single_mod=yes
941c27c18e8Smrg	else
942c27c18e8Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
943c27c18e8Smrg	fi
944c27c18e8Smrg	rm -rf libconftest.dylib*
945c27c18e8Smrg	rm -f conftest.*
94621e67964Smrg      fi])
94721e67964Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
94821e67964Smrg      [lt_cv_ld_exported_symbols_list],
94921e67964Smrg      [lt_cv_ld_exported_symbols_list=no
95021e67964Smrg      save_LDFLAGS=$LDFLAGS
95121e67964Smrg      echo "_main" > conftest.sym
95221e67964Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
95321e67964Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
954c27c18e8Smrg	[lt_cv_ld_exported_symbols_list=yes],
955c27c18e8Smrg	[lt_cv_ld_exported_symbols_list=no])
956c27c18e8Smrg	LDFLAGS="$save_LDFLAGS"
95721e67964Smrg    ])
95821e67964Smrg    case $host_os in
959c27c18e8Smrg    rhapsody* | darwin1.[[012]])
96021e67964Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
96121e67964Smrg    darwin1.*)
962c27c18e8Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
963c27c18e8Smrg    darwin*) # darwin 5.x on
96421e67964Smrg      # if running on 10.5 or later, the deployment target defaults
96521e67964Smrg      # to the OS version, if on x86, and 10.4, the deployment
96621e67964Smrg      # target defaults to 10.4. Don't you love it?
96721e67964Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
968c27c18e8Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
969c27c18e8Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
970c27c18e8Smrg	10.[[012]]*)
971c27c18e8Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
972c27c18e8Smrg	10.*)
973c27c18e8Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
97421e67964Smrg      esac
97521e67964Smrg    ;;
97621e67964Smrg  esac
97721e67964Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
97821e67964Smrg      _lt_dar_single_mod='$single_module'
97921e67964Smrg    fi
98021e67964Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
98121e67964Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
98221e67964Smrg    else
983c27c18e8Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
98421e67964Smrg    fi
98521e67964Smrg    if test "$DSYMUTIL" != ":"; then
986c27c18e8Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
98721e67964Smrg    else
98821e67964Smrg      _lt_dsymutil=
98921e67964Smrg    fi
99021e67964Smrg    ;;
99121e67964Smrg  esac
99221e67964Smrg])
993c43cc173Smrg
994c27c18e8Smrg
995c27c18e8Smrg# _LT_DARWIN_LINKER_FEATURES
996c27c18e8Smrg# --------------------------
997c27c18e8Smrg# Checks for linker and compiler features on darwin
998c27c18e8Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
999c27c18e8Smrg[
1000c27c18e8Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1001c27c18e8Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1002c27c18e8Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
1003c27c18e8Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1004c27c18e8Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1005c27c18e8Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1006c27c18e8Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1007c27c18e8Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1008c27c18e8Smrg  case $cc_basename in
1009c27c18e8Smrg     ifort*) _lt_dar_can_shared=yes ;;
1010c27c18e8Smrg     *) _lt_dar_can_shared=$GCC ;;
1011c27c18e8Smrg  esac
1012c27c18e8Smrg  if test "$_lt_dar_can_shared" = "yes"; then
1013c27c18e8Smrg    output_verbose_link_cmd=echo
1014c27c18e8Smrg    _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}"
1015c27c18e8Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1016c27c18e8Smrg    _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}"
1017c27c18e8Smrg    _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}"
1018c27c18e8Smrg    m4_if([$1], [CXX],
1019c27c18e8Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1020c27c18e8Smrg      _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}"
1021c27c18e8Smrg      _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}"
1022c27c18e8Smrg    fi
1023c27c18e8Smrg],[])
1024c27c18e8Smrg  else
1025c27c18e8Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
1026c27c18e8Smrg  fi
1027c27c18e8Smrg])
1028c27c18e8Smrg
1029c27c18e8Smrg# _LT_SYS_MODULE_PATH_AIX
1030c27c18e8Smrg# -----------------------
103121e67964Smrg# Links a minimal program and checks the executable
103221e67964Smrg# for the system default hardcoded library path. In most cases,
103321e67964Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
103421e67964Smrg# the location of the communication and MPI libs are included too.
103521e67964Smrg# If we don't find anything, use the default library path according
103621e67964Smrg# to the aix ld manual.
1037c27c18e8Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1038c27c18e8Smrg[m4_require([_LT_DECL_SED])dnl
103921e67964SmrgAC_LINK_IFELSE(AC_LANG_PROGRAM,[
104021e67964Smrglt_aix_libpath_sed='
104121e67964Smrg    /Import File Strings/,/^$/ {
104221e67964Smrg	/^0/ {
104321e67964Smrg	    s/^0  *\(.*\)$/\1/
104421e67964Smrg	    p
104521e67964Smrg	}
104621e67964Smrg    }'
104721e67964Smrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
104821e67964Smrg# Check for a 64-bit object if we didn't find anything.
104921e67964Smrgif test -z "$aix_libpath"; then
105021e67964Smrg  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
105121e67964Smrgfi],[])
105221e67964Smrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1053c27c18e8Smrg])# _LT_SYS_MODULE_PATH_AIX
1054c43cc173Smrg
1055c43cc173Smrg
1056c27c18e8Smrg# _LT_SHELL_INIT(ARG)
1057c27c18e8Smrg# -------------------
1058c27c18e8Smrgm4_define([_LT_SHELL_INIT],
105921e67964Smrg[ifdef([AC_DIVERSION_NOTICE],
106021e67964Smrg	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
106121e67964Smrg	 [AC_DIVERT_PUSH(NOTICE)])
106221e67964Smrg$1
106321e67964SmrgAC_DIVERT_POP
1064c27c18e8Smrg])# _LT_SHELL_INIT
1065c43cc173Smrg
1066c43cc173Smrg
1067c27c18e8Smrg# _LT_PROG_ECHO_BACKSLASH
1068c27c18e8Smrg# -----------------------
106921e67964Smrg# Add some code to the start of the generated configure script which
107021e67964Smrg# will find an echo command which doesn't interpret backslashes.
1071c27c18e8Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
1072c27c18e8Smrg[_LT_SHELL_INIT([
107321e67964Smrg# Check that we are running under the correct shell.
107421e67964SmrgSHELL=${CONFIG_SHELL-/bin/sh}
1075c43cc173Smrg
1076c27c18e8Smrgcase X$lt_ECHO in
107721e67964SmrgX*--fallback-echo)
107821e67964Smrg  # Remove one level of quotation (which was required for Make).
1079c27c18e8Smrg  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
108021e67964Smrg  ;;
108121e67964Smrgesac
1082c43cc173Smrg
1083c27c18e8SmrgECHO=${lt_ECHO-echo}
108421e67964Smrgif test "X[$]1" = X--no-reexec; then
108521e67964Smrg  # Discard the --no-reexec flag, and continue.
108621e67964Smrg  shift
108721e67964Smrgelif test "X[$]1" = X--fallback-echo; then
108821e67964Smrg  # Avoid inline document here, it may be left over
108921e67964Smrg  :
1090c27c18e8Smrgelif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
1091c27c18e8Smrg  # Yippee, $ECHO works!
109221e67964Smrg  :
1093c43cc173Smrgelse
109421e67964Smrg  # Restart under the correct shell.
109521e67964Smrg  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
1096c43cc173Smrgfi
1097c43cc173Smrg
109821e67964Smrgif test "X[$]1" = X--fallback-echo; then
109921e67964Smrg  # used as fallback echo
110021e67964Smrg  shift
1101c27c18e8Smrg  cat <<_LT_EOF
110221e67964Smrg[$]*
1103c27c18e8Smrg_LT_EOF
110421e67964Smrg  exit 0
110521e67964Smrgfi
1106c43cc173Smrg
110721e67964Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
110821e67964Smrg# if CDPATH is set.
110921e67964Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1110c43cc173Smrg
1111c27c18e8Smrgif test -z "$lt_ECHO"; then
1112c27c18e8Smrg  if test "X${echo_test_string+set}" != Xset; then
1113c27c18e8Smrg    # find a string as large as possible, as long as the shell can cope with it
1114c27c18e8Smrg    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
1115c27c18e8Smrg      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1116c27c18e8Smrg      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
1117c27c18e8Smrg	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
1118c27c18e8Smrg      then
1119c27c18e8Smrg        break
1120c27c18e8Smrg      fi
1121c27c18e8Smrg    done
1122c27c18e8Smrg  fi
1123c43cc173Smrg
1124c27c18e8Smrg  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1125c27c18e8Smrg     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1126c27c18e8Smrg     test "X$echo_testing_string" = "X$echo_test_string"; then
1127c27c18e8Smrg    :
1128c27c18e8Smrg  else
1129c27c18e8Smrg    # The Solaris, AIX, and Digital Unix default echo programs unquote
1130c27c18e8Smrg    # backslashes.  This makes it impossible to quote backslashes using
1131c27c18e8Smrg    #   echo "$something" | sed 's/\\/\\\\/g'
1132c27c18e8Smrg    #
1133c27c18e8Smrg    # So, first we look for a working echo in the user's PATH.
1134c43cc173Smrg
1135c27c18e8Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1136c27c18e8Smrg    for dir in $PATH /usr/ucb; do
1137c27c18e8Smrg      IFS="$lt_save_ifs"
1138c27c18e8Smrg      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
1139c27c18e8Smrg         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
1140c27c18e8Smrg         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
1141c27c18e8Smrg         test "X$echo_testing_string" = "X$echo_test_string"; then
1142c27c18e8Smrg        ECHO="$dir/echo"
1143c27c18e8Smrg        break
1144c27c18e8Smrg      fi
1145c27c18e8Smrg    done
114621e67964Smrg    IFS="$lt_save_ifs"
1147c43cc173Smrg
1148c27c18e8Smrg    if test "X$ECHO" = Xecho; then
1149c27c18e8Smrg      # We didn't find a better echo, so look for alternatives.
1150c27c18e8Smrg      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
1151c27c18e8Smrg         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
1152c27c18e8Smrg         test "X$echo_testing_string" = "X$echo_test_string"; then
1153c27c18e8Smrg        # This shell has a builtin print -r that does the trick.
1154c27c18e8Smrg        ECHO='print -r'
1155c27c18e8Smrg      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
1156c27c18e8Smrg	   test "X$CONFIG_SHELL" != X/bin/ksh; then
1157c27c18e8Smrg        # If we have ksh, try running configure again with it.
1158c27c18e8Smrg        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1159c27c18e8Smrg        export ORIGINAL_CONFIG_SHELL
1160c27c18e8Smrg        CONFIG_SHELL=/bin/ksh
1161c27c18e8Smrg        export CONFIG_SHELL
1162c27c18e8Smrg        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
116321e67964Smrg      else
1164c27c18e8Smrg        # Try using printf.
1165c27c18e8Smrg        ECHO='printf %s\n'
1166c27c18e8Smrg        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1167c27c18e8Smrg	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1168c27c18e8Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
1169c27c18e8Smrg	  # Cool, printf works
1170c27c18e8Smrg	  :
1171c27c18e8Smrg        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1172c27c18e8Smrg	     test "X$echo_testing_string" = 'X\t' &&
1173c27c18e8Smrg	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1174c27c18e8Smrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
1175c27c18e8Smrg	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1176c27c18e8Smrg	  export CONFIG_SHELL
1177c27c18e8Smrg	  SHELL="$CONFIG_SHELL"
1178c27c18e8Smrg	  export SHELL
1179c27c18e8Smrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1180c27c18e8Smrg        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1181c27c18e8Smrg	     test "X$echo_testing_string" = 'X\t' &&
1182c27c18e8Smrg	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1183c27c18e8Smrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
1184c27c18e8Smrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1185c27c18e8Smrg        else
1186c27c18e8Smrg	  # maybe with a smaller string...
1187c27c18e8Smrg	  prev=:
1188c43cc173Smrg
1189c27c18e8Smrg	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1190c27c18e8Smrg	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
1191c27c18e8Smrg	    then
1192c27c18e8Smrg	      break
1193c27c18e8Smrg	    fi
1194c27c18e8Smrg	    prev="$cmd"
1195c27c18e8Smrg	  done
1196c43cc173Smrg
1197c27c18e8Smrg	  if test "$prev" != 'sed 50q "[$]0"'; then
1198c27c18e8Smrg	    echo_test_string=`eval $prev`
1199c27c18e8Smrg	    export echo_test_string
1200c27c18e8Smrg	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1201c27c18e8Smrg	  else
1202c27c18e8Smrg	    # Oops.  We lost completely, so just stick with echo.
1203c27c18e8Smrg	    ECHO=echo
1204c27c18e8Smrg	  fi
1205c27c18e8Smrg        fi
120621e67964Smrg      fi
120721e67964Smrg    fi
120821e67964Smrg  fi
120921e67964Smrgfi
1210c43cc173Smrg
121121e67964Smrg# Copy echo and quote the copy suitably for passing to libtool from
121221e67964Smrg# the Makefile, instead of quoting the original, which is used later.
1213c27c18e8Smrglt_ECHO=$ECHO
1214c27c18e8Smrgif test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1215c27c18e8Smrg   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
121621e67964Smrgfi
1217c43cc173Smrg
1218c27c18e8SmrgAC_SUBST(lt_ECHO)
1219c27c18e8Smrg])
1220c27c18e8Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1221c27c18e8Smrg_LT_DECL([], [ECHO], [1],
1222c27c18e8Smrg    [An echo program that does not interpret backslashes])
1223c27c18e8Smrg])# _LT_PROG_ECHO_BACKSLASH
1224c43cc173Smrg
1225c43cc173Smrg
1226c27c18e8Smrg# _LT_ENABLE_LOCK
1227c27c18e8Smrg# ---------------
1228c27c18e8Smrgm4_defun([_LT_ENABLE_LOCK],
122921e67964Smrg[AC_ARG_ENABLE([libtool-lock],
1230c27c18e8Smrg  [AS_HELP_STRING([--disable-libtool-lock],
1231c27c18e8Smrg    [avoid locking (might break parallel builds)])])
123221e67964Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1233c43cc173Smrg
123421e67964Smrg# Some flags need to be propagated to the compiler or linker for good
123521e67964Smrg# libtool support.
123621e67964Smrgcase $host in
123721e67964Smrgia64-*-hpux*)
123821e67964Smrg  # Find out which ABI we are using.
123921e67964Smrg  echo 'int i;' > conftest.$ac_ext
124021e67964Smrg  if AC_TRY_EVAL(ac_compile); then
124121e67964Smrg    case `/usr/bin/file conftest.$ac_objext` in
1242c27c18e8Smrg      *ELF-32*)
1243c27c18e8Smrg	HPUX_IA64_MODE="32"
1244c27c18e8Smrg	;;
1245c27c18e8Smrg      *ELF-64*)
1246c27c18e8Smrg	HPUX_IA64_MODE="64"
1247c27c18e8Smrg	;;
124821e67964Smrg    esac
124921e67964Smrg  fi
125021e67964Smrg  rm -rf conftest*
125121e67964Smrg  ;;
125221e67964Smrg*-*-irix6*)
125321e67964Smrg  # Find out which ABI we are using.
125421e67964Smrg  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
125521e67964Smrg  if AC_TRY_EVAL(ac_compile); then
1256c27c18e8Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
1257c27c18e8Smrg      case `/usr/bin/file conftest.$ac_objext` in
1258c27c18e8Smrg	*32-bit*)
1259c27c18e8Smrg	  LD="${LD-ld} -melf32bsmip"
1260c27c18e8Smrg	  ;;
1261c27c18e8Smrg	*N32*)
1262c27c18e8Smrg	  LD="${LD-ld} -melf32bmipn32"
1263c27c18e8Smrg	  ;;
1264c27c18e8Smrg	*64-bit*)
1265c27c18e8Smrg	  LD="${LD-ld} -melf64bmip"
1266c27c18e8Smrg	;;
1267c27c18e8Smrg      esac
1268c27c18e8Smrg    else
1269c27c18e8Smrg      case `/usr/bin/file conftest.$ac_objext` in
1270c27c18e8Smrg	*32-bit*)
1271c27c18e8Smrg	  LD="${LD-ld} -32"
1272c27c18e8Smrg	  ;;
1273c27c18e8Smrg	*N32*)
1274c27c18e8Smrg	  LD="${LD-ld} -n32"
1275c27c18e8Smrg	  ;;
1276c27c18e8Smrg	*64-bit*)
1277c27c18e8Smrg	  LD="${LD-ld} -64"
1278c27c18e8Smrg	  ;;
1279c27c18e8Smrg      esac
1280c27c18e8Smrg    fi
128121e67964Smrg  fi
128221e67964Smrg  rm -rf conftest*
128321e67964Smrg  ;;
1284c43cc173Smrg
128521e67964Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1286c27c18e8Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
128721e67964Smrg  # Find out which ABI we are using.
128821e67964Smrg  echo 'int i;' > conftest.$ac_ext
128921e67964Smrg  if AC_TRY_EVAL(ac_compile); then
129021e67964Smrg    case `/usr/bin/file conftest.o` in
1291c27c18e8Smrg      *32-bit*)
1292c27c18e8Smrg	case $host in
1293c27c18e8Smrg	  x86_64-*kfreebsd*-gnu)
1294c27c18e8Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
1295c27c18e8Smrg	    ;;
1296c27c18e8Smrg	  x86_64-*linux*)
1297c27c18e8Smrg	    LD="${LD-ld} -m elf_i386"
1298c27c18e8Smrg	    ;;
1299c27c18e8Smrg	  ppc64-*linux*|powerpc64-*linux*)
1300c27c18e8Smrg	    LD="${LD-ld} -m elf32ppclinux"
1301c27c18e8Smrg	    ;;
1302c27c18e8Smrg	  s390x-*linux*)
1303c27c18e8Smrg	    LD="${LD-ld} -m elf_s390"
1304c27c18e8Smrg	    ;;
1305c27c18e8Smrg	  sparc64-*linux*)
1306c27c18e8Smrg	    LD="${LD-ld} -m elf32_sparc"
1307c27c18e8Smrg	    ;;
1308c27c18e8Smrg	esac
1309c27c18e8Smrg	;;
1310c27c18e8Smrg      *64-bit*)
1311c27c18e8Smrg	case $host in
1312c27c18e8Smrg	  x86_64-*kfreebsd*-gnu)
1313c27c18e8Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1314c27c18e8Smrg	    ;;
1315c27c18e8Smrg	  x86_64-*linux*)
1316c27c18e8Smrg	    LD="${LD-ld} -m elf_x86_64"
1317c27c18e8Smrg	    ;;
1318c27c18e8Smrg	  ppc*-*linux*|powerpc*-*linux*)
1319c27c18e8Smrg	    LD="${LD-ld} -m elf64ppc"
1320c27c18e8Smrg	    ;;
1321c27c18e8Smrg	  s390*-*linux*|s390*-*tpf*)
1322c27c18e8Smrg	    LD="${LD-ld} -m elf64_s390"
1323c27c18e8Smrg	    ;;
1324c27c18e8Smrg	  sparc*-*linux*)
1325c27c18e8Smrg	    LD="${LD-ld} -m elf64_sparc"
1326c27c18e8Smrg	    ;;
1327c27c18e8Smrg	esac
1328c27c18e8Smrg	;;
132921e67964Smrg    esac
133021e67964Smrg  fi
133121e67964Smrg  rm -rf conftest*
133221e67964Smrg  ;;
1333c43cc173Smrg
133421e67964Smrg*-*-sco3.2v5*)
133521e67964Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
133621e67964Smrg  SAVE_CFLAGS="$CFLAGS"
133721e67964Smrg  CFLAGS="$CFLAGS -belf"
133821e67964Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
133921e67964Smrg    [AC_LANG_PUSH(C)
1340c27c18e8Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
134121e67964Smrg     AC_LANG_POP])
134221e67964Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
134321e67964Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
134421e67964Smrg    CFLAGS="$SAVE_CFLAGS"
134521e67964Smrg  fi
134621e67964Smrg  ;;
134721e67964Smrgsparc*-*solaris*)
134821e67964Smrg  # Find out which ABI we are using.
134921e67964Smrg  echo 'int i;' > conftest.$ac_ext
135021e67964Smrg  if AC_TRY_EVAL(ac_compile); then
135121e67964Smrg    case `/usr/bin/file conftest.o` in
135221e67964Smrg    *64-bit*)
135321e67964Smrg      case $lt_cv_prog_gnu_ld in
135421e67964Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
135521e67964Smrg      *)
1356c27c18e8Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
135721e67964Smrg	  LD="${LD-ld} -64"
135821e67964Smrg	fi
135921e67964Smrg	;;
136021e67964Smrg      esac
136121e67964Smrg      ;;
136221e67964Smrg    esac
136321e67964Smrg  fi
136421e67964Smrg  rm -rf conftest*
136521e67964Smrg  ;;
136621e67964Smrgesac
1367c43cc173Smrg
136821e67964Smrgneed_locks="$enable_libtool_lock"
1369c27c18e8Smrg])# _LT_ENABLE_LOCK
1370c27c18e8Smrg
1371c27c18e8Smrg
1372c27c18e8Smrg# _LT_CMD_OLD_ARCHIVE
1373c27c18e8Smrg# -------------------
1374c27c18e8Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1375c27c18e8Smrg[AC_CHECK_TOOL(AR, ar, false)
1376c27c18e8Smrgtest -z "$AR" && AR=ar
1377c27c18e8Smrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
1378c27c18e8Smrg_LT_DECL([], [AR], [1], [The archiver])
1379c27c18e8Smrg_LT_DECL([], [AR_FLAGS], [1])
1380c27c18e8Smrg
1381c27c18e8SmrgAC_CHECK_TOOL(STRIP, strip, :)
1382c27c18e8Smrgtest -z "$STRIP" && STRIP=:
1383c27c18e8Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1384c27c18e8Smrg
1385c27c18e8SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1386c27c18e8Smrgtest -z "$RANLIB" && RANLIB=:
1387c27c18e8Smrg_LT_DECL([], [RANLIB], [1],
1388c27c18e8Smrg    [Commands used to install an old-style archive])
1389c27c18e8Smrg
1390c27c18e8Smrg# Determine commands to create old-style static archives.
1391c27c18e8Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1392c27c18e8Smrgold_postinstall_cmds='chmod 644 $oldlib'
1393c27c18e8Smrgold_postuninstall_cmds=
1394c43cc173Smrg
1395c27c18e8Smrgif test -n "$RANLIB"; then
1396c27c18e8Smrg  case $host_os in
1397c27c18e8Smrg  openbsd*)
1398c27c18e8Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
1399c27c18e8Smrg    ;;
1400c27c18e8Smrg  *)
1401c27c18e8Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
1402c27c18e8Smrg    ;;
1403c27c18e8Smrg  esac
1404c27c18e8Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1405c27c18e8Smrgfi
1406c27c18e8Smrg_LT_DECL([], [old_postinstall_cmds], [2])
1407c27c18e8Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
1408c27c18e8Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
1409c27c18e8Smrg    [Commands used to build an old-style archive])
1410c27c18e8Smrg])# _LT_CMD_OLD_ARCHIVE
1411c43cc173Smrg
1412c43cc173Smrg
1413c27c18e8Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
141421e67964Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
141521e67964Smrg# ----------------------------------------------------------------
141621e67964Smrg# Check whether the given compiler option works
1417c27c18e8SmrgAC_DEFUN([_LT_COMPILER_OPTION],
1418c27c18e8Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1419c27c18e8Smrgm4_require([_LT_DECL_SED])dnl
142021e67964SmrgAC_CACHE_CHECK([$1], [$2],
142121e67964Smrg  [$2=no
1422c27c18e8Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
142321e67964Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
142421e67964Smrg   lt_compiler_flag="$3"
142521e67964Smrg   # Insert the option either (1) after the last *FLAGS variable, or
142621e67964Smrg   # (2) before a word containing "conftest.", or (3) at the end.
142721e67964Smrg   # Note that $ac_compile itself does not contain backslashes and begins
142821e67964Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
142921e67964Smrg   # The option is referenced via a variable to avoid confusing sed.
143021e67964Smrg   lt_compile=`echo "$ac_compile" | $SED \
143121e67964Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
143221e67964Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
143321e67964Smrg   -e 's:$: $lt_compiler_flag:'`
143421e67964Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
143521e67964Smrg   (eval "$lt_compile" 2>conftest.err)
143621e67964Smrg   ac_status=$?
143721e67964Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
143821e67964Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
143921e67964Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
144021e67964Smrg     # The compiler can only warn and ignore the option if not recognized
144121e67964Smrg     # So say no if there are warnings other than the usual output.
1442c27c18e8Smrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
144321e67964Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
144421e67964Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
144521e67964Smrg       $2=yes
144621e67964Smrg     fi
144721e67964Smrg   fi
1448c27c18e8Smrg   $RM conftest*
144921e67964Smrg])
1450c43cc173Smrg
145121e67964Smrgif test x"[$]$2" = xyes; then
1452c27c18e8Smrg    m4_if([$5], , :, [$5])
145321e67964Smrgelse
1454c27c18e8Smrg    m4_if([$6], , :, [$6])
145521e67964Smrgfi
1456c27c18e8Smrg])# _LT_COMPILER_OPTION
1457c43cc173Smrg
1458c27c18e8Smrg# Old name:
1459c27c18e8SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1460c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
1461c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1462c43cc173Smrg
1463c27c18e8Smrg
1464c27c18e8Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1465c27c18e8Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1466c27c18e8Smrg# ----------------------------------------------------
1467c27c18e8Smrg# Check whether the given linker option works
1468c27c18e8SmrgAC_DEFUN([_LT_LINKER_OPTION],
1469c27c18e8Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1470c27c18e8Smrgm4_require([_LT_DECL_SED])dnl
147121e67964SmrgAC_CACHE_CHECK([$1], [$2],
147221e67964Smrg  [$2=no
147321e67964Smrg   save_LDFLAGS="$LDFLAGS"
147421e67964Smrg   LDFLAGS="$LDFLAGS $3"
147521e67964Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
147621e67964Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
147721e67964Smrg     # The linker can only warn and ignore the option if not recognized
147821e67964Smrg     # So say no if there are warnings
147921e67964Smrg     if test -s conftest.err; then
148021e67964Smrg       # Append any errors to the config.log.
148121e67964Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1482c27c18e8Smrg       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
148321e67964Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
148421e67964Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
148521e67964Smrg         $2=yes
148621e67964Smrg       fi
148721e67964Smrg     else
148821e67964Smrg       $2=yes
148921e67964Smrg     fi
149021e67964Smrg   fi
1491c27c18e8Smrg   $RM -r conftest*
149221e67964Smrg   LDFLAGS="$save_LDFLAGS"
149321e67964Smrg])
1494c43cc173Smrg
149521e67964Smrgif test x"[$]$2" = xyes; then
1496c27c18e8Smrg    m4_if([$4], , :, [$4])
1497c43cc173Smrgelse
1498c27c18e8Smrg    m4_if([$5], , :, [$5])
1499c43cc173Smrgfi
1500c27c18e8Smrg])# _LT_LINKER_OPTION
1501c43cc173Smrg
1502c27c18e8Smrg# Old name:
1503c27c18e8SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1504c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
1505c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1506c43cc173Smrg
1507c27c18e8Smrg
1508c27c18e8Smrg# LT_CMD_MAX_LEN
1509c27c18e8Smrg#---------------
1510c27c18e8SmrgAC_DEFUN([LT_CMD_MAX_LEN],
1511c27c18e8Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1512c27c18e8Smrg# find the maximum length of command line arguments
151321e67964SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
151421e67964SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
151521e67964Smrg  i=0
151621e67964Smrg  teststring="ABCD"
1517c43cc173Smrg
151821e67964Smrg  case $build_os in
151921e67964Smrg  msdosdjgpp*)
152021e67964Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
152121e67964Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
152221e67964Smrg    # during glob expansion).  Even if it were fixed, the result of this
152321e67964Smrg    # check would be larger than it should be.
152421e67964Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
152521e67964Smrg    ;;
1526c43cc173Smrg
152721e67964Smrg  gnu*)
152821e67964Smrg    # Under GNU Hurd, this test is not required because there is
152921e67964Smrg    # no limit to the length of command line arguments.
153021e67964Smrg    # Libtool will interpret -1 as no limit whatsoever
153121e67964Smrg    lt_cv_sys_max_cmd_len=-1;
153221e67964Smrg    ;;
1533c43cc173Smrg
1534c27c18e8Smrg  cygwin* | mingw* | cegcc*)
153521e67964Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
153621e67964Smrg    # about 5 minutes as the teststring grows exponentially.
153721e67964Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
153821e67964Smrg    # you end up with a "frozen" computer, even though with patience
153921e67964Smrg    # the test eventually succeeds (with a max line length of 256k).
154021e67964Smrg    # Instead, let's just punt: use the minimum linelength reported by
154121e67964Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
154221e67964Smrg    lt_cv_sys_max_cmd_len=8192;
154321e67964Smrg    ;;
1544c43cc173Smrg
154521e67964Smrg  amigaos*)
154621e67964Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
154721e67964Smrg    # So we just punt and use a minimum line length of 8192.
154821e67964Smrg    lt_cv_sys_max_cmd_len=8192;
154921e67964Smrg    ;;
1550c43cc173Smrg
155121e67964Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
155221e67964Smrg    # This has been around since 386BSD, at least.  Likely further.
155321e67964Smrg    if test -x /sbin/sysctl; then
155421e67964Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
155521e67964Smrg    elif test -x /usr/sbin/sysctl; then
155621e67964Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
155721e67964Smrg    else
155821e67964Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
155921e67964Smrg    fi
156021e67964Smrg    # And add a safety zone
156121e67964Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
156221e67964Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
156321e67964Smrg    ;;
1564c43cc173Smrg
156521e67964Smrg  interix*)
156621e67964Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
156721e67964Smrg    lt_cv_sys_max_cmd_len=196608
156821e67964Smrg    ;;
1569c43cc173Smrg
157021e67964Smrg  osf*)
157121e67964Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
157221e67964Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
157321e67964Smrg    # nice to cause kernel panics so lets avoid the loop below.
157421e67964Smrg    # First set a reasonable default.
157521e67964Smrg    lt_cv_sys_max_cmd_len=16384
157621e67964Smrg    #
157721e67964Smrg    if test -x /sbin/sysconfig; then
157821e67964Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
157921e67964Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
158021e67964Smrg      esac
158121e67964Smrg    fi
158221e67964Smrg    ;;
158321e67964Smrg  sco3.2v5*)
158421e67964Smrg    lt_cv_sys_max_cmd_len=102400
158521e67964Smrg    ;;
158621e67964Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
158721e67964Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
158821e67964Smrg    if test -n "$kargmax"; then
1589c27c18e8Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
159021e67964Smrg    else
159121e67964Smrg      lt_cv_sys_max_cmd_len=32768
159221e67964Smrg    fi
159321e67964Smrg    ;;
159421e67964Smrg  *)
159521e67964Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
159621e67964Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
159721e67964Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
159821e67964Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
159921e67964Smrg    else
1600c27c18e8Smrg      # Make teststring a little bigger before we do anything with it.
1601c27c18e8Smrg      # a 1K string should be a reasonable start.
1602c27c18e8Smrg      for i in 1 2 3 4 5 6 7 8 ; do
1603c27c18e8Smrg        teststring=$teststring$teststring
1604c27c18e8Smrg      done
160521e67964Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1606c27c18e8Smrg      # If test is not a shell built-in, we'll probably end up computing a
1607c27c18e8Smrg      # maximum length that is only half of the actual maximum length, but
1608c27c18e8Smrg      # we can't tell.
1609c27c18e8Smrg      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
1610c27c18e8Smrg	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
161121e67964Smrg	      test $i != 17 # 1/2 MB should be enough
161221e67964Smrg      do
161321e67964Smrg        i=`expr $i + 1`
161421e67964Smrg        teststring=$teststring$teststring
161521e67964Smrg      done
1616c27c18e8Smrg      # Only check the string length outside the loop.
1617c27c18e8Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
161821e67964Smrg      teststring=
1619c27c18e8Smrg      # Add a significant safety factor because C++ compilers can tack on
1620c27c18e8Smrg      # massive amounts of additional arguments before passing them to the
1621c27c18e8Smrg      # linker.  It appears as though 1/2 is a usable value.
162221e67964Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
162321e67964Smrg    fi
162421e67964Smrg    ;;
162521e67964Smrg  esac
162621e67964Smrg])
162721e67964Smrgif test -n $lt_cv_sys_max_cmd_len ; then
162821e67964Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
162921e67964Smrgelse
163021e67964Smrg  AC_MSG_RESULT(none)
163121e67964Smrgfi
1632c27c18e8Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1633c27c18e8Smrg_LT_DECL([], [max_cmd_len], [0],
1634c27c18e8Smrg    [What is the maximum length of a command?])
1635c27c18e8Smrg])# LT_CMD_MAX_LEN
1636c43cc173Smrg
1637c27c18e8Smrg# Old name:
1638c27c18e8SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1639c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
1640c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1641c43cc173Smrg
1642c27c18e8Smrg
1643c27c18e8Smrg# _LT_HEADER_DLFCN
1644c27c18e8Smrg# ----------------
1645c27c18e8Smrgm4_defun([_LT_HEADER_DLFCN],
1646c27c18e8Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1647c27c18e8Smrg])# _LT_HEADER_DLFCN
1648c43cc173Smrg
1649c43cc173Smrg
1650c27c18e8Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1651c27c18e8Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1652c27c18e8Smrg# ----------------------------------------------------------------
1653c27c18e8Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
1654c27c18e8Smrg[m4_require([_LT_HEADER_DLFCN])dnl
165521e67964Smrgif test "$cross_compiling" = yes; then :
165621e67964Smrg  [$4]
165721e67964Smrgelse
165821e67964Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
165921e67964Smrg  lt_status=$lt_dlunknown
1660c27c18e8Smrg  cat > conftest.$ac_ext <<_LT_EOF
166121e67964Smrg[#line __oline__ "configure"
166221e67964Smrg#include "confdefs.h"
1663c43cc173Smrg
166421e67964Smrg#if HAVE_DLFCN_H
166521e67964Smrg#include <dlfcn.h>
166621e67964Smrg#endif
1667c43cc173Smrg
166821e67964Smrg#include <stdio.h>
1669c43cc173Smrg
167021e67964Smrg#ifdef RTLD_GLOBAL
167121e67964Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
167221e67964Smrg#else
167321e67964Smrg#  ifdef DL_GLOBAL
167421e67964Smrg#    define LT_DLGLOBAL		DL_GLOBAL
167521e67964Smrg#  else
167621e67964Smrg#    define LT_DLGLOBAL		0
167721e67964Smrg#  endif
167821e67964Smrg#endif
1679c43cc173Smrg
168021e67964Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
168121e67964Smrg   find out it does not work in some platform. */
168221e67964Smrg#ifndef LT_DLLAZY_OR_NOW
168321e67964Smrg#  ifdef RTLD_LAZY
168421e67964Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
168521e67964Smrg#  else
168621e67964Smrg#    ifdef DL_LAZY
168721e67964Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
168821e67964Smrg#    else
168921e67964Smrg#      ifdef RTLD_NOW
169021e67964Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
169121e67964Smrg#      else
169221e67964Smrg#        ifdef DL_NOW
169321e67964Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
169421e67964Smrg#        else
169521e67964Smrg#          define LT_DLLAZY_OR_NOW	0
169621e67964Smrg#        endif
169721e67964Smrg#      endif
169821e67964Smrg#    endif
169921e67964Smrg#  endif
170021e67964Smrg#endif
170121e67964Smrg
170221e67964Smrgvoid fnord() { int i=42;}
170321e67964Smrgint main ()
170421e67964Smrg{
170521e67964Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
170621e67964Smrg  int status = $lt_dlunknown;
170721e67964Smrg
170821e67964Smrg  if (self)
170921e67964Smrg    {
171021e67964Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
171121e67964Smrg      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
171221e67964Smrg      /* dlclose (self); */
171321e67964Smrg    }
1714c43cc173Smrg  else
171521e67964Smrg    puts (dlerror ());
171621e67964Smrg
1717c27c18e8Smrg  return status;
171821e67964Smrg}]
1719c27c18e8Smrg_LT_EOF
172021e67964Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
172121e67964Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
172221e67964Smrg    lt_status=$?
172321e67964Smrg    case x$lt_status in
172421e67964Smrg      x$lt_dlno_uscore) $1 ;;
172521e67964Smrg      x$lt_dlneed_uscore) $2 ;;
172621e67964Smrg      x$lt_dlunknown|x*) $3 ;;
172721e67964Smrg    esac
172821e67964Smrg  else :
172921e67964Smrg    # compilation failed
173021e67964Smrg    $3
1731c43cc173Smrg  fi
1732c43cc173Smrgfi
173321e67964Smrgrm -fr conftest*
1734c27c18e8Smrg])# _LT_TRY_DLOPEN_SELF
1735c43cc173Smrg
1736c43cc173Smrg
1737c27c18e8Smrg# LT_SYS_DLOPEN_SELF
1738c27c18e8Smrg# ------------------
1739c27c18e8SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1740c27c18e8Smrg[m4_require([_LT_HEADER_DLFCN])dnl
174121e67964Smrgif test "x$enable_dlopen" != xyes; then
174221e67964Smrg  enable_dlopen=unknown
174321e67964Smrg  enable_dlopen_self=unknown
174421e67964Smrg  enable_dlopen_self_static=unknown
174521e67964Smrgelse
174621e67964Smrg  lt_cv_dlopen=no
174721e67964Smrg  lt_cv_dlopen_libs=
1748c43cc173Smrg
174921e67964Smrg  case $host_os in
175021e67964Smrg  beos*)
175121e67964Smrg    lt_cv_dlopen="load_add_on"
175221e67964Smrg    lt_cv_dlopen_libs=
175321e67964Smrg    lt_cv_dlopen_self=yes
175421e67964Smrg    ;;
1755c43cc173Smrg
1756c27c18e8Smrg  mingw* | pw32* | cegcc*)
175721e67964Smrg    lt_cv_dlopen="LoadLibrary"
175821e67964Smrg    lt_cv_dlopen_libs=
1759c27c18e8Smrg    ;;
1760c43cc173Smrg
176121e67964Smrg  cygwin*)
176221e67964Smrg    lt_cv_dlopen="dlopen"
176321e67964Smrg    lt_cv_dlopen_libs=
1764c27c18e8Smrg    ;;
1765c43cc173Smrg
176621e67964Smrg  darwin*)
176721e67964Smrg  # if libdl is installed we need to link against it
176821e67964Smrg    AC_CHECK_LIB([dl], [dlopen],
176921e67964Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
177021e67964Smrg    lt_cv_dlopen="dyld"
177121e67964Smrg    lt_cv_dlopen_libs=
177221e67964Smrg    lt_cv_dlopen_self=yes
177321e67964Smrg    ])
1774c27c18e8Smrg    ;;
177521e67964Smrg
177621e67964Smrg  *)
177721e67964Smrg    AC_CHECK_FUNC([shl_load],
177821e67964Smrg	  [lt_cv_dlopen="shl_load"],
177921e67964Smrg      [AC_CHECK_LIB([dld], [shl_load],
178021e67964Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
178121e67964Smrg	[AC_CHECK_FUNC([dlopen],
178221e67964Smrg	      [lt_cv_dlopen="dlopen"],
178321e67964Smrg	  [AC_CHECK_LIB([dl], [dlopen],
178421e67964Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
178521e67964Smrg	    [AC_CHECK_LIB([svld], [dlopen],
178621e67964Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
178721e67964Smrg	      [AC_CHECK_LIB([dld], [dld_link],
178821e67964Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
178921e67964Smrg	      ])
179021e67964Smrg	    ])
179121e67964Smrg	  ])
179221e67964Smrg	])
179321e67964Smrg      ])
179421e67964Smrg    ;;
1795c43cc173Smrg  esac
1796c43cc173Smrg
179721e67964Smrg  if test "x$lt_cv_dlopen" != xno; then
179821e67964Smrg    enable_dlopen=yes
179921e67964Smrg  else
180021e67964Smrg    enable_dlopen=no
180121e67964Smrg  fi
1802c43cc173Smrg
180321e67964Smrg  case $lt_cv_dlopen in
180421e67964Smrg  dlopen)
180521e67964Smrg    save_CPPFLAGS="$CPPFLAGS"
180621e67964Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1807c43cc173Smrg
180821e67964Smrg    save_LDFLAGS="$LDFLAGS"
180921e67964Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1810c43cc173Smrg
181121e67964Smrg    save_LIBS="$LIBS"
181221e67964Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
1813c43cc173Smrg
181421e67964Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
181521e67964Smrg	  lt_cv_dlopen_self, [dnl
1816c27c18e8Smrg	  _LT_TRY_DLOPEN_SELF(
181721e67964Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
181821e67964Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
181921e67964Smrg    ])
1820c43cc173Smrg
182121e67964Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
182221e67964Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
182321e67964Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1824c27c18e8Smrg	  lt_cv_dlopen_self_static, [dnl
1825c27c18e8Smrg	  _LT_TRY_DLOPEN_SELF(
182621e67964Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
182721e67964Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
182821e67964Smrg      ])
182921e67964Smrg    fi
1830c43cc173Smrg
183121e67964Smrg    CPPFLAGS="$save_CPPFLAGS"
183221e67964Smrg    LDFLAGS="$save_LDFLAGS"
183321e67964Smrg    LIBS="$save_LIBS"
183421e67964Smrg    ;;
183521e67964Smrg  esac
1836c43cc173Smrg
183721e67964Smrg  case $lt_cv_dlopen_self in
183821e67964Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
183921e67964Smrg  *) enable_dlopen_self=unknown ;;
184021e67964Smrg  esac
1841c43cc173Smrg
184221e67964Smrg  case $lt_cv_dlopen_self_static in
184321e67964Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
184421e67964Smrg  *) enable_dlopen_self_static=unknown ;;
184521e67964Smrg  esac
184621e67964Smrgfi
1847c27c18e8Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
1848c27c18e8Smrg	 [Whether dlopen is supported])
1849c27c18e8Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1850c27c18e8Smrg	 [Whether dlopen of programs is supported])
1851c27c18e8Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1852c27c18e8Smrg	 [Whether dlopen of statically linked programs is supported])
1853c27c18e8Smrg])# LT_SYS_DLOPEN_SELF
1854c43cc173Smrg
1855c27c18e8Smrg# Old name:
1856c27c18e8SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1857c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
1858c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1859c43cc173Smrg
1860c27c18e8Smrg
1861c27c18e8Smrg# _LT_COMPILER_C_O([TAGNAME])
1862c27c18e8Smrg# ---------------------------
1863c27c18e8Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
1864c27c18e8Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
1865c27c18e8Smrgm4_defun([_LT_COMPILER_C_O],
1866c27c18e8Smrg[m4_require([_LT_DECL_SED])dnl
1867c27c18e8Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1868c27c18e8Smrgm4_require([_LT_TAG_COMPILER])dnl
186921e67964SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1870c27c18e8Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1871c27c18e8Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1872c27c18e8Smrg   $RM -r conftest 2>/dev/null
187321e67964Smrg   mkdir conftest
187421e67964Smrg   cd conftest
187521e67964Smrg   mkdir out
187621e67964Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1877c43cc173Smrg
187821e67964Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
187921e67964Smrg   # Insert the option either (1) after the last *FLAGS variable, or
188021e67964Smrg   # (2) before a word containing "conftest.", or (3) at the end.
188121e67964Smrg   # Note that $ac_compile itself does not contain backslashes and begins
188221e67964Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
188321e67964Smrg   lt_compile=`echo "$ac_compile" | $SED \
188421e67964Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
188521e67964Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
188621e67964Smrg   -e 's:$: $lt_compiler_flag:'`
188721e67964Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
188821e67964Smrg   (eval "$lt_compile" 2>out/conftest.err)
188921e67964Smrg   ac_status=$?
189021e67964Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
189121e67964Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
189221e67964Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
189321e67964Smrg   then
189421e67964Smrg     # The compiler can only warn and ignore the option if not recognized
189521e67964Smrg     # So say no if there are warnings
1896c27c18e8Smrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
189721e67964Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
189821e67964Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1899c27c18e8Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
190021e67964Smrg     fi
190121e67964Smrg   fi
190221e67964Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
1903c27c18e8Smrg   $RM conftest*
190421e67964Smrg   # SGI C++ compiler will create directory out/ii_files/ for
190521e67964Smrg   # template instantiation
1906c27c18e8Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
1907c27c18e8Smrg   $RM out/* && rmdir out
190821e67964Smrg   cd ..
1909c27c18e8Smrg   $RM -r conftest
1910c27c18e8Smrg   $RM conftest*
191121e67964Smrg])
1912c27c18e8Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
1913c27c18e8Smrg	[Does compiler simultaneously support -c and -o options?])
1914c27c18e8Smrg])# _LT_COMPILER_C_O
1915c43cc173Smrg
1916c43cc173Smrg
1917c27c18e8Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
1918c27c18e8Smrg# ----------------------------------
191921e67964Smrg# Check to see if we can do hard links to lock some files if needed
1920c27c18e8Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
1921c27c18e8Smrg[m4_require([_LT_ENABLE_LOCK])dnl
1922c27c18e8Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1923c27c18e8Smrg_LT_COMPILER_C_O([$1])
1924c43cc173Smrg
192521e67964Smrghard_links="nottested"
1926c27c18e8Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
192721e67964Smrg  # do not overwrite the value of need_locks provided by the user
192821e67964Smrg  AC_MSG_CHECKING([if we can lock with hard links])
192921e67964Smrg  hard_links=yes
1930c27c18e8Smrg  $RM conftest*
193121e67964Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
193221e67964Smrg  touch conftest.a
193321e67964Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
193421e67964Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
193521e67964Smrg  AC_MSG_RESULT([$hard_links])
193621e67964Smrg  if test "$hard_links" = no; then
193721e67964Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
193821e67964Smrg    need_locks=warn
193921e67964Smrg  fi
194021e67964Smrgelse
194121e67964Smrg  need_locks=no
194221e67964Smrgfi
1943c27c18e8Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
1944c27c18e8Smrg])# _LT_COMPILER_FILE_LOCKS
1945c43cc173Smrg
1946c43cc173Smrg
1947c27c18e8Smrg# _LT_CHECK_OBJDIR
1948c27c18e8Smrg# ----------------
1949c27c18e8Smrgm4_defun([_LT_CHECK_OBJDIR],
195021e67964Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
195121e67964Smrg[rm -f .libs 2>/dev/null
195221e67964Smrgmkdir .libs 2>/dev/null
195321e67964Smrgif test -d .libs; then
195421e67964Smrg  lt_cv_objdir=.libs
195521e67964Smrgelse
195621e67964Smrg  # MS-DOS does not allow filenames that begin with a dot.
195721e67964Smrg  lt_cv_objdir=_libs
195821e67964Smrgfi
195921e67964Smrgrmdir .libs 2>/dev/null])
196021e67964Smrgobjdir=$lt_cv_objdir
1961c27c18e8Smrg_LT_DECL([], [objdir], [0],
1962c27c18e8Smrg         [The name of the directory that contains temporary libtool files])dnl
1963c27c18e8Smrgm4_pattern_allow([LT_OBJDIR])dnl
1964c27c18e8SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
1965c27c18e8Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
1966c27c18e8Smrg])# _LT_CHECK_OBJDIR
1967c43cc173Smrg
1968c43cc173Smrg
1969c27c18e8Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
1970c27c18e8Smrg# --------------------------------------
197121e67964Smrg# Check hardcoding attributes.
1972c27c18e8Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
197321e67964Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
1974c27c18e8Smrg_LT_TAGVAR(hardcode_action, $1)=
1975c27c18e8Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
1976c27c18e8Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
1977c27c18e8Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
1978c43cc173Smrg
1979c27c18e8Smrg  # We can hardcode non-existent directories.
1980c27c18e8Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
198121e67964Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
198221e67964Smrg     # have to relink, otherwise we might link with an installed library
198321e67964Smrg     # when we should be linking with a yet-to-be-installed one
1984c27c18e8Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1985c27c18e8Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
198621e67964Smrg    # Linking always hardcodes the temporary library directory.
1987c27c18e8Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
198821e67964Smrg  else
198921e67964Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
1990c27c18e8Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
1991c43cc173Smrg  fi
199221e67964Smrgelse
199321e67964Smrg  # We cannot hardcode anything, or else we can only hardcode existing
199421e67964Smrg  # directories.
1995c27c18e8Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
199621e67964Smrgfi
1997c27c18e8SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
1998c43cc173Smrg
1999c27c18e8Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
2000c27c18e8Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
200121e67964Smrg  # Fast installation is not supported
200221e67964Smrg  enable_fast_install=no
200321e67964Smrgelif test "$shlibpath_overrides_runpath" = yes ||
200421e67964Smrg     test "$enable_shared" = no; then
200521e67964Smrg  # Fast installation is not necessary
200621e67964Smrg  enable_fast_install=needless
200721e67964Smrgfi
2008c27c18e8Smrg_LT_TAGDECL([], [hardcode_action], [0],
2009c27c18e8Smrg    [How to hardcode a shared library path into an executable])
2010c27c18e8Smrg])# _LT_LINKER_HARDCODE_LIBPATH
2011c43cc173Smrg
2012c43cc173Smrg
2013c27c18e8Smrg# _LT_CMD_STRIPLIB
2014c27c18e8Smrg# ----------------
2015c27c18e8Smrgm4_defun([_LT_CMD_STRIPLIB],
2016c27c18e8Smrg[m4_require([_LT_DECL_EGREP])
2017c27c18e8Smrgstriplib=
201821e67964Smrgold_striplib=
201921e67964SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2020c27c18e8Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
202121e67964Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
202221e67964Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
202321e67964Smrg  AC_MSG_RESULT([yes])
202421e67964Smrgelse
202521e67964Smrg# FIXME - insert some real tests, host_os isn't really good enough
2026c43cc173Smrg  case $host_os in
2027c27c18e8Smrg  darwin*)
2028c27c18e8Smrg    if test -n "$STRIP" ; then
2029c27c18e8Smrg      striplib="$STRIP -x"
2030c27c18e8Smrg      old_striplib="$STRIP -S"
2031c27c18e8Smrg      AC_MSG_RESULT([yes])
2032c27c18e8Smrg    else
2033c27c18e8Smrg      AC_MSG_RESULT([no])
2034c27c18e8Smrg    fi
2035c27c18e8Smrg    ;;
2036c27c18e8Smrg  *)
2037c27c18e8Smrg    AC_MSG_RESULT([no])
2038c43cc173Smrg    ;;
2039c43cc173Smrg  esac
2040c43cc173Smrgfi
2041c27c18e8Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2042c27c18e8Smrg_LT_DECL([], [striplib], [1])
2043c27c18e8Smrg])# _LT_CMD_STRIPLIB
2044c43cc173Smrg
2045c43cc173Smrg
2046c27c18e8Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
204721e67964Smrg# -----------------------------
204821e67964Smrg# PORTME Fill in your ld.so characteristics
2049c27c18e8Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2050c27c18e8Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2051c27c18e8Smrgm4_require([_LT_DECL_EGREP])dnl
2052c27c18e8Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2053c27c18e8Smrgm4_require([_LT_DECL_OBJDUMP])dnl
2054c27c18e8Smrgm4_require([_LT_DECL_SED])dnl
205521e67964SmrgAC_MSG_CHECKING([dynamic linker characteristics])
2056c27c18e8Smrgm4_if([$1],
2057c27c18e8Smrg	[], [
205821e67964Smrgif test "$GCC" = yes; then
205921e67964Smrg  case $host_os in
206021e67964Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
206121e67964Smrg    *) lt_awk_arg="/^libraries:/" ;;
206221e67964Smrg  esac
206321e67964Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2064c27c18e8Smrg  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
206521e67964Smrg    # if the path contains ";" then we assume it to be the separator
206621e67964Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
206721e67964Smrg    # assumed that no part of a normal pathname contains ";" but that should
206821e67964Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
2069c27c18e8Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
207021e67964Smrg  else
2071c27c18e8Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
2072c43cc173Smrg  fi
207321e67964Smrg  # Ok, now we have the path, separated by spaces, we can step through it
207421e67964Smrg  # and add multilib dir if necessary.
207521e67964Smrg  lt_tmp_lt_search_path_spec=
207621e67964Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
207721e67964Smrg  for lt_sys_path in $lt_search_path_spec; do
207821e67964Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
207921e67964Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
208021e67964Smrg    else
208121e67964Smrg      test -d "$lt_sys_path" && \
208221e67964Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
208321e67964Smrg    fi
208421e67964Smrg  done
2085c27c18e8Smrg  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
208621e67964SmrgBEGIN {RS=" "; FS="/|\n";} {
208721e67964Smrg  lt_foo="";
208821e67964Smrg  lt_count=0;
208921e67964Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
209021e67964Smrg    if ($lt_i != "" && $lt_i != ".") {
209121e67964Smrg      if ($lt_i == "..") {
209221e67964Smrg        lt_count++;
209321e67964Smrg      } else {
209421e67964Smrg        if (lt_count == 0) {
209521e67964Smrg          lt_foo="/" $lt_i lt_foo;
209621e67964Smrg        } else {
209721e67964Smrg          lt_count--;
209821e67964Smrg        }
209921e67964Smrg      }
210021e67964Smrg    }
210121e67964Smrg  }
210221e67964Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
210321e67964Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
210421e67964Smrg}'`
2105c27c18e8Smrg  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
210621e67964Smrgelse
210721e67964Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
210821e67964Smrgfi])
2109c27c18e8Smrglibrary_names_spec=
2110c27c18e8Smrglibname_spec='lib$name'
2111c27c18e8Smrgsoname_spec=
2112c27c18e8Smrgshrext_cmds=".so"
2113c27c18e8Smrgpostinstall_cmds=
2114c27c18e8Smrgpostuninstall_cmds=
2115c27c18e8Smrgfinish_cmds=
2116c27c18e8Smrgfinish_eval=
2117c27c18e8Smrgshlibpath_var=
2118c27c18e8Smrgshlibpath_overrides_runpath=unknown
2119c27c18e8Smrgversion_type=none
2120c27c18e8Smrgdynamic_linker="$host_os ld.so"
2121c27c18e8Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
212221e67964Smrgneed_lib_prefix=unknown
212321e67964Smrghardcode_into_libs=no
2124c43cc173Smrg
212521e67964Smrg# when you set need_version to no, make sure it does not cause -set_version
212621e67964Smrg# flags to be left without arguments
212721e67964Smrgneed_version=unknown
2128c43cc173Smrg
212921e67964Smrgcase $host_os in
213021e67964Smrgaix3*)
213121e67964Smrg  version_type=linux
213221e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
213321e67964Smrg  shlibpath_var=LIBPATH
2134c43cc173Smrg
213521e67964Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
213621e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
213721e67964Smrg  ;;
2138c43cc173Smrg
213921e67964Smrgaix[[4-9]]*)
214021e67964Smrg  version_type=linux
214121e67964Smrg  need_lib_prefix=no
214221e67964Smrg  need_version=no
214321e67964Smrg  hardcode_into_libs=yes
214421e67964Smrg  if test "$host_cpu" = ia64; then
214521e67964Smrg    # AIX 5 supports IA64
214621e67964Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
214721e67964Smrg    shlibpath_var=LD_LIBRARY_PATH
214821e67964Smrg  else
214921e67964Smrg    # With GCC up to 2.95.x, collect2 would create an import file
215021e67964Smrg    # for dependence libraries.  The import file would start with
215121e67964Smrg    # the line `#! .'.  This would cause the generated library to
215221e67964Smrg    # depend on `.', always an invalid library.  This was fixed in
215321e67964Smrg    # development snapshots of GCC prior to 3.0.
215421e67964Smrg    case $host_os in
215521e67964Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
215621e67964Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
215721e67964Smrg	   echo ' yes '
2158c27c18e8Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
215921e67964Smrg	:
216021e67964Smrg      else
216121e67964Smrg	can_build_shared=no
216221e67964Smrg      fi
216321e67964Smrg      ;;
216421e67964Smrg    esac
216521e67964Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
216621e67964Smrg    # soname into executable. Probably we can add versioning support to
216721e67964Smrg    # collect2, so additional links can be useful in future.
216821e67964Smrg    if test "$aix_use_runtimelinking" = yes; then
216921e67964Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
217021e67964Smrg      # instead of lib<name>.a to let people know that these are not
217121e67964Smrg      # typical AIX shared libraries.
217221e67964Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
217321e67964Smrg    else
217421e67964Smrg      # We preserve .a as extension for shared libraries through AIX4.2
217521e67964Smrg      # and later when we are not doing run time linking.
217621e67964Smrg      library_names_spec='${libname}${release}.a $libname.a'
217721e67964Smrg      soname_spec='${libname}${release}${shared_ext}$major'
217821e67964Smrg    fi
217921e67964Smrg    shlibpath_var=LIBPATH
218021e67964Smrg  fi
218121e67964Smrg  ;;
2182c43cc173Smrg
218321e67964Smrgamigaos*)
2184c27c18e8Smrg  case $host_cpu in
2185c27c18e8Smrg  powerpc)
2186c27c18e8Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2187c27c18e8Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2188c27c18e8Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2189c27c18e8Smrg    ;;
2190c27c18e8Smrg  m68k)
2191c27c18e8Smrg    library_names_spec='$libname.ixlibrary $libname.a'
2192c27c18e8Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2193c27c18e8Smrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''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'
2194c27c18e8Smrg    ;;
2195c27c18e8Smrg  esac
219621e67964Smrg  ;;
2197c43cc173Smrg
219821e67964Smrgbeos*)
219921e67964Smrg  library_names_spec='${libname}${shared_ext}'
220021e67964Smrg  dynamic_linker="$host_os ld.so"
220121e67964Smrg  shlibpath_var=LIBRARY_PATH
220221e67964Smrg  ;;
2203c43cc173Smrg
220421e67964Smrgbsdi[[45]]*)
220521e67964Smrg  version_type=linux
220621e67964Smrg  need_version=no
220721e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
220821e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
220921e67964Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
221021e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
221121e67964Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
221221e67964Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
221321e67964Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
221421e67964Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
221521e67964Smrg  # libtool to hard-code these into programs
221621e67964Smrg  ;;
2217c43cc173Smrg
2218c27c18e8Smrgcygwin* | mingw* | pw32* | cegcc*)
221921e67964Smrg  version_type=windows
222021e67964Smrg  shrext_cmds=".dll"
222121e67964Smrg  need_version=no
222221e67964Smrg  need_lib_prefix=no
2223c43cc173Smrg
222421e67964Smrg  case $GCC,$host_os in
2225c27c18e8Smrg  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
222621e67964Smrg    library_names_spec='$libname.dll.a'
222721e67964Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
222821e67964Smrg    postinstall_cmds='base_file=`basename \${file}`~
2229c27c18e8Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
223021e67964Smrg      dldir=$destdir/`dirname \$dlpath`~
223121e67964Smrg      test -d \$dldir || mkdir -p \$dldir~
223221e67964Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
2233c27c18e8Smrg      chmod a+x \$dldir/$dlname~
2234c27c18e8Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2235c27c18e8Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2236c27c18e8Smrg      fi'
223721e67964Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
223821e67964Smrg      dlpath=$dir/\$dldll~
2239c27c18e8Smrg       $RM \$dlpath'
224021e67964Smrg    shlibpath_overrides_runpath=yes
2241c43cc173Smrg
224221e67964Smrg    case $host_os in
224321e67964Smrg    cygwin*)
224421e67964Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
224521e67964Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
224621e67964Smrg      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
224721e67964Smrg      ;;
2248c27c18e8Smrg    mingw* | cegcc*)
224921e67964Smrg      # MinGW DLLs use traditional 'lib' prefix
225021e67964Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2251c27c18e8Smrg      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2252c27c18e8Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
225321e67964Smrg        # It is most probably a Windows format PATH printed by
225421e67964Smrg        # mingw gcc, but we are running on Cygwin. Gcc prints its search
225521e67964Smrg        # path with ; separators, and with drive letters. We can handle the
225621e67964Smrg        # drive letters (cygwin fileutils understands them), so leave them,
225721e67964Smrg        # especially as we might pass files found there to a mingw objdump,
225821e67964Smrg        # which wouldn't understand a cygwinified path. Ahh.
2259c27c18e8Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
226021e67964Smrg      else
2261c27c18e8Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
226221e67964Smrg      fi
226321e67964Smrg      ;;
226421e67964Smrg    pw32*)
226521e67964Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
226621e67964Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
226721e67964Smrg      ;;
226821e67964Smrg    esac
226921e67964Smrg    ;;
2270c43cc173Smrg
227121e67964Smrg  *)
227221e67964Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
227321e67964Smrg    ;;
227421e67964Smrg  esac
227521e67964Smrg  dynamic_linker='Win32 ld.exe'
227621e67964Smrg  # FIXME: first we should search . and the directory the executable is in
227721e67964Smrg  shlibpath_var=PATH
2278c43cc173Smrg  ;;
2279c43cc173Smrg
228021e67964Smrgdarwin* | rhapsody*)
228121e67964Smrg  dynamic_linker="$host_os dyld"
228221e67964Smrg  version_type=darwin
228321e67964Smrg  need_lib_prefix=no
228421e67964Smrg  need_version=no
2285c27c18e8Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
228621e67964Smrg  soname_spec='${libname}${release}${major}$shared_ext'
228721e67964Smrg  shlibpath_overrides_runpath=yes
228821e67964Smrg  shlibpath_var=DYLD_LIBRARY_PATH
228921e67964Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2290c27c18e8Smrgm4_if([$1], [],[
2291c27c18e8Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
229221e67964Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
229321e67964Smrg  ;;
2294c43cc173Smrg
229521e67964Smrgdgux*)
229621e67964Smrg  version_type=linux
229721e67964Smrg  need_lib_prefix=no
229821e67964Smrg  need_version=no
229921e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
230021e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
230121e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
230221e67964Smrg  ;;
2303c43cc173Smrg
230421e67964Smrgfreebsd1*)
230521e67964Smrg  dynamic_linker=no
230621e67964Smrg  ;;
2307c43cc173Smrg
230821e67964Smrgfreebsd* | dragonfly*)
230921e67964Smrg  # DragonFly does not have aout.  When/if they implement a new
231021e67964Smrg  # versioning mechanism, adjust this.
231121e67964Smrg  if test -x /usr/bin/objformat; then
231221e67964Smrg    objformat=`/usr/bin/objformat`
231321e67964Smrg  else
231421e67964Smrg    case $host_os in
231521e67964Smrg    freebsd[[123]]*) objformat=aout ;;
231621e67964Smrg    *) objformat=elf ;;
231721e67964Smrg    esac
231821e67964Smrg  fi
231921e67964Smrg  version_type=freebsd-$objformat
232021e67964Smrg  case $version_type in
232121e67964Smrg    freebsd-elf*)
232221e67964Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
232321e67964Smrg      need_version=no
232421e67964Smrg      need_lib_prefix=no
232521e67964Smrg      ;;
232621e67964Smrg    freebsd-*)
232721e67964Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
232821e67964Smrg      need_version=yes
232921e67964Smrg      ;;
233021e67964Smrg  esac
233121e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
233221e67964Smrg  case $host_os in
233321e67964Smrg  freebsd2*)
233421e67964Smrg    shlibpath_overrides_runpath=yes
233521e67964Smrg    ;;
233621e67964Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
233721e67964Smrg    shlibpath_overrides_runpath=yes
233821e67964Smrg    hardcode_into_libs=yes
233921e67964Smrg    ;;
234021e67964Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
234121e67964Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
234221e67964Smrg    shlibpath_overrides_runpath=no
234321e67964Smrg    hardcode_into_libs=yes
234421e67964Smrg    ;;
234521e67964Smrg  *) # from 4.6 on, and DragonFly
234621e67964Smrg    shlibpath_overrides_runpath=yes
234721e67964Smrg    hardcode_into_libs=yes
234821e67964Smrg    ;;
234921e67964Smrg  esac
235021e67964Smrg  ;;
2351c43cc173Smrg
235221e67964Smrggnu*)
235321e67964Smrg  version_type=linux
235421e67964Smrg  need_lib_prefix=no
235521e67964Smrg  need_version=no
235621e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
235721e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
235821e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
235921e67964Smrg  hardcode_into_libs=yes
236021e67964Smrg  ;;
236121e67964Smrg
236221e67964Smrghpux9* | hpux10* | hpux11*)
236321e67964Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
236421e67964Smrg  # link against other versions.
236521e67964Smrg  version_type=sunos
236621e67964Smrg  need_lib_prefix=no
236721e67964Smrg  need_version=no
236821e67964Smrg  case $host_cpu in
236921e67964Smrg  ia64*)
237021e67964Smrg    shrext_cmds='.so'
237121e67964Smrg    hardcode_into_libs=yes
237221e67964Smrg    dynamic_linker="$host_os dld.so"
237321e67964Smrg    shlibpath_var=LD_LIBRARY_PATH
237421e67964Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
237521e67964Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
237621e67964Smrg    soname_spec='${libname}${release}${shared_ext}$major'
237721e67964Smrg    if test "X$HPUX_IA64_MODE" = X32; then
237821e67964Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2379c43cc173Smrg    else
238021e67964Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
238121e67964Smrg    fi
238221e67964Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
238321e67964Smrg    ;;
2384c27c18e8Smrg  hppa*64*)
2385c27c18e8Smrg    shrext_cmds='.sl'
2386c27c18e8Smrg    hardcode_into_libs=yes
2387c27c18e8Smrg    dynamic_linker="$host_os dld.sl"
2388c27c18e8Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2389c27c18e8Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2390c27c18e8Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2391c27c18e8Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2392c27c18e8Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2393c27c18e8Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2394c27c18e8Smrg    ;;
2395c27c18e8Smrg  *)
239621e67964Smrg    shrext_cmds='.sl'
239721e67964Smrg    dynamic_linker="$host_os dld.sl"
239821e67964Smrg    shlibpath_var=SHLIB_PATH
239921e67964Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
240021e67964Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
240121e67964Smrg    soname_spec='${libname}${release}${shared_ext}$major'
240221e67964Smrg    ;;
240321e67964Smrg  esac
240421e67964Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555.
240521e67964Smrg  postinstall_cmds='chmod 555 $lib'
240621e67964Smrg  ;;
2407c43cc173Smrg
240821e67964Smrginterix[[3-9]]*)
240921e67964Smrg  version_type=linux
241021e67964Smrg  need_lib_prefix=no
241121e67964Smrg  need_version=no
241221e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
241321e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
241421e67964Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
241521e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
241621e67964Smrg  shlibpath_overrides_runpath=no
241721e67964Smrg  hardcode_into_libs=yes
241821e67964Smrg  ;;
2419c43cc173Smrg
242021e67964Smrgirix5* | irix6* | nonstopux*)
242121e67964Smrg  case $host_os in
242221e67964Smrg    nonstopux*) version_type=nonstopux ;;
242321e67964Smrg    *)
242421e67964Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
242521e67964Smrg		version_type=linux
2426c43cc173Smrg	else
242721e67964Smrg		version_type=irix
242821e67964Smrg	fi ;;
242921e67964Smrg  esac
243021e67964Smrg  need_lib_prefix=no
243121e67964Smrg  need_version=no
243221e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
243321e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
243421e67964Smrg  case $host_os in
243521e67964Smrg  irix5* | nonstopux*)
243621e67964Smrg    libsuff= shlibsuff=
243721e67964Smrg    ;;
243821e67964Smrg  *)
243921e67964Smrg    case $LD in # libtool.m4 will add one of these switches to LD
244021e67964Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
244121e67964Smrg      libsuff= shlibsuff= libmagic=32-bit;;
244221e67964Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
244321e67964Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
244421e67964Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
244521e67964Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
244621e67964Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
244721e67964Smrg    esac
244821e67964Smrg    ;;
244921e67964Smrg  esac
245021e67964Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
245121e67964Smrg  shlibpath_overrides_runpath=no
245221e67964Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
245321e67964Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
245421e67964Smrg  hardcode_into_libs=yes
245521e67964Smrg  ;;
2456c43cc173Smrg
245721e67964Smrg# No shared lib support for Linux oldld, aout, or coff.
245821e67964Smrglinux*oldld* | linux*aout* | linux*coff*)
245921e67964Smrg  dynamic_linker=no
246021e67964Smrg  ;;
2461c43cc173Smrg
246221e67964Smrg# This must be Linux ELF.
246321e67964Smrglinux* | k*bsd*-gnu)
246421e67964Smrg  version_type=linux
246521e67964Smrg  need_lib_prefix=no
246621e67964Smrg  need_version=no
246721e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
246821e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
246921e67964Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
247021e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
247121e67964Smrg  shlibpath_overrides_runpath=no
2472c27c18e8Smrg  # Some binutils ld are patched to set DT_RUNPATH
2473c27c18e8Smrg  save_LDFLAGS=$LDFLAGS
2474c27c18e8Smrg  save_libdir=$libdir
2475c27c18e8Smrg  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2476c27c18e8Smrg       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2477c27c18e8Smrg  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2478c27c18e8Smrg    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2479c27c18e8Smrg       [shlibpath_overrides_runpath=yes])])
2480c27c18e8Smrg  LDFLAGS=$save_LDFLAGS
2481c27c18e8Smrg  libdir=$save_libdir
2482c27c18e8Smrg
248321e67964Smrg  # This implies no fast_install, which is unacceptable.
248421e67964Smrg  # Some rework will be needed to allow for fast_install
248521e67964Smrg  # before this can be enabled.
248621e67964Smrg  hardcode_into_libs=yes
2487c27c18e8Smrg
2488c27c18e8Smrg  # Add ABI-specific directories to the system library path.
2489c27c18e8Smrg  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
2490c43cc173Smrg
249121e67964Smrg  # Append ld.so.conf contents to the search path
249221e67964Smrg  if test -f /etc/ld.so.conf; then
2493c27c18e8Smrg    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;/^$/d' | tr '\n' ' '`
249421e67964Smrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
249521e67964Smrg  fi
2496c43cc173Smrg
249721e67964Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
249821e67964Smrg  # powerpc, because MkLinux only supported shared libraries with the
249921e67964Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
250021e67964Smrg  # most powerpc-linux boxes support dynamic linking these days and
250121e67964Smrg  # people can always --disable-shared, the test was removed, and we
250221e67964Smrg  # assume the GNU/Linux dynamic linker is in use.
250321e67964Smrg  dynamic_linker='GNU/Linux ld.so'
250421e67964Smrg  ;;
2505c43cc173Smrg
250621e67964Smrgnetbsd*)
250721e67964Smrg  version_type=sunos
250821e67964Smrg  need_lib_prefix=no
250921e67964Smrg  need_version=no
2510c27c18e8Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
251121e67964Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
251221e67964Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
251321e67964Smrg    dynamic_linker='NetBSD (a.out) ld.so'
251421e67964Smrg  else
251521e67964Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
251621e67964Smrg    soname_spec='${libname}${release}${shared_ext}$major'
251721e67964Smrg    dynamic_linker='NetBSD ld.elf_so'
2518c43cc173Smrg  fi
251921e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
252021e67964Smrg  shlibpath_overrides_runpath=yes
252121e67964Smrg  hardcode_into_libs=yes
2522c43cc173Smrg  ;;
2523c43cc173Smrg
252421e67964Smrgnewsos6)
252521e67964Smrg  version_type=linux
252621e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
252721e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
252821e67964Smrg  shlibpath_overrides_runpath=yes
2529c43cc173Smrg  ;;
2530c43cc173Smrg
2531c27c18e8Smrg*nto* | *qnx*)
2532c27c18e8Smrg  version_type=qnx
253321e67964Smrg  need_lib_prefix=no
253421e67964Smrg  need_version=no
253521e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
253621e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
253721e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
2538c27c18e8Smrg  shlibpath_overrides_runpath=no
2539c27c18e8Smrg  hardcode_into_libs=yes
2540c27c18e8Smrg  dynamic_linker='ldqnx.so'
2541c43cc173Smrg  ;;
254221e67964Smrg
254321e67964Smrgopenbsd*)
254421e67964Smrg  version_type=sunos
254521e67964Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
254621e67964Smrg  need_lib_prefix=no
254721e67964Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
254821e67964Smrg  case $host_os in
2549c27c18e8Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
2550c27c18e8Smrg    *)				need_version=no  ;;
255121e67964Smrg  esac
255221e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
255321e67964Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
255421e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
2555c27c18e8Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
255621e67964Smrg    case $host_os in
255721e67964Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
255821e67964Smrg	shlibpath_overrides_runpath=no
255921e67964Smrg	;;
256021e67964Smrg      *)
256121e67964Smrg	shlibpath_overrides_runpath=yes
256221e67964Smrg	;;
2563c43cc173Smrg      esac
256421e67964Smrg  else
256521e67964Smrg    shlibpath_overrides_runpath=yes
2566c43cc173Smrg  fi
2567c43cc173Smrg  ;;
2568c43cc173Smrg
256921e67964Smrgos2*)
257021e67964Smrg  libname_spec='$name'
257121e67964Smrg  shrext_cmds=".dll"
257221e67964Smrg  need_lib_prefix=no
257321e67964Smrg  library_names_spec='$libname${shared_ext} $libname.a'
257421e67964Smrg  dynamic_linker='OS/2 ld.exe'
257521e67964Smrg  shlibpath_var=LIBPATH
2576c43cc173Smrg  ;;
2577c43cc173Smrg
257821e67964Smrgosf3* | osf4* | osf5*)
257921e67964Smrg  version_type=osf
258021e67964Smrg  need_lib_prefix=no
258121e67964Smrg  need_version=no
258221e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
258321e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
258421e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
258521e67964Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
258621e67964Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
258721e67964Smrg  ;;
2588c43cc173Smrg
258921e67964Smrgrdos*)
259021e67964Smrg  dynamic_linker=no
259121e67964Smrg  ;;
2592c43cc173Smrg
259321e67964Smrgsolaris*)
259421e67964Smrg  version_type=linux
259521e67964Smrg  need_lib_prefix=no
259621e67964Smrg  need_version=no
259721e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
259821e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
259921e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
260021e67964Smrg  shlibpath_overrides_runpath=yes
260121e67964Smrg  hardcode_into_libs=yes
260221e67964Smrg  # ldd complains unless libraries are executable
260321e67964Smrg  postinstall_cmds='chmod +x $lib'
260421e67964Smrg  ;;
2605c43cc173Smrg
260621e67964Smrgsunos4*)
260721e67964Smrg  version_type=sunos
260821e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
260921e67964Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
261021e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
261121e67964Smrg  shlibpath_overrides_runpath=yes
261221e67964Smrg  if test "$with_gnu_ld" = yes; then
261321e67964Smrg    need_lib_prefix=no
261421e67964Smrg  fi
261521e67964Smrg  need_version=yes
261621e67964Smrg  ;;
2617c43cc173Smrg
261821e67964Smrgsysv4 | sysv4.3*)
261921e67964Smrg  version_type=linux
262021e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
262121e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
262221e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
262321e67964Smrg  case $host_vendor in
262421e67964Smrg    sni)
262521e67964Smrg      shlibpath_overrides_runpath=no
262621e67964Smrg      need_lib_prefix=no
262721e67964Smrg      runpath_var=LD_RUN_PATH
262821e67964Smrg      ;;
262921e67964Smrg    siemens)
263021e67964Smrg      need_lib_prefix=no
263121e67964Smrg      ;;
263221e67964Smrg    motorola)
263321e67964Smrg      need_lib_prefix=no
263421e67964Smrg      need_version=no
263521e67964Smrg      shlibpath_overrides_runpath=no
263621e67964Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
263721e67964Smrg      ;;
263821e67964Smrg  esac
263921e67964Smrg  ;;
2640c43cc173Smrg
264121e67964Smrgsysv4*MP*)
264221e67964Smrg  if test -d /usr/nec ;then
264321e67964Smrg    version_type=linux
264421e67964Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
264521e67964Smrg    soname_spec='$libname${shared_ext}.$major'
264621e67964Smrg    shlibpath_var=LD_LIBRARY_PATH
264721e67964Smrg  fi
264821e67964Smrg  ;;
2649c43cc173Smrg
265021e67964Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
265121e67964Smrg  version_type=freebsd-elf
265221e67964Smrg  need_lib_prefix=no
265321e67964Smrg  need_version=no
265421e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
265521e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
265621e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
2657c27c18e8Smrg  shlibpath_overrides_runpath=yes
265821e67964Smrg  hardcode_into_libs=yes
265921e67964Smrg  if test "$with_gnu_ld" = yes; then
266021e67964Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
266121e67964Smrg  else
266221e67964Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
266321e67964Smrg    case $host_os in
266421e67964Smrg      sco3.2v5*)
266521e67964Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
266621e67964Smrg	;;
266721e67964Smrg    esac
266821e67964Smrg  fi
266921e67964Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
267021e67964Smrg  ;;
2671c43cc173Smrg
2672c27c18e8Smrgtpf*)
2673c27c18e8Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
2674c27c18e8Smrg  version_type=linux
2675c27c18e8Smrg  need_lib_prefix=no
2676c27c18e8Smrg  need_version=no
2677c27c18e8Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2678c27c18e8Smrg  shlibpath_var=LD_LIBRARY_PATH
2679c27c18e8Smrg  shlibpath_overrides_runpath=no
2680c27c18e8Smrg  hardcode_into_libs=yes
2681c27c18e8Smrg  ;;
2682c27c18e8Smrg
268321e67964Smrguts4*)
268421e67964Smrg  version_type=linux
268521e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
268621e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
268721e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
268821e67964Smrg  ;;
2689c43cc173Smrg
269021e67964Smrg*)
269121e67964Smrg  dynamic_linker=no
269221e67964Smrg  ;;
269321e67964Smrgesac
269421e67964SmrgAC_MSG_RESULT([$dynamic_linker])
269521e67964Smrgtest "$dynamic_linker" = no && can_build_shared=no
2696c43cc173Smrg
269721e67964Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
269821e67964Smrgif test "$GCC" = yes; then
269921e67964Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
270021e67964Smrgfi
2701c43cc173Smrg
2702c27c18e8Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2703c27c18e8Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2704c27c18e8Smrgfi
2705c27c18e8Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2706c27c18e8Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2707c27c18e8Smrgfi
2708c43cc173Smrg
2709c27c18e8Smrg_LT_DECL([], [variables_saved_for_relink], [1],
2710c27c18e8Smrg    [Variables whose values should be saved in libtool wrapper scripts and
2711c27c18e8Smrg    restored at link time])
2712c27c18e8Smrg_LT_DECL([], [need_lib_prefix], [0],
2713c27c18e8Smrg    [Do we need the "lib" prefix for modules?])
2714c27c18e8Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2715c27c18e8Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
2716c27c18e8Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
2717c27c18e8Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2718c27c18e8Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
2719c27c18e8Smrg    [Is shlibpath searched before the hard-coded library search path?])
2720c27c18e8Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2721c27c18e8Smrg_LT_DECL([], [library_names_spec], [1],
2722c27c18e8Smrg    [[List of archive names.  First name is the real one, the rest are links.
2723c27c18e8Smrg    The last name is the one that the linker finds with -lNAME]])
2724c27c18e8Smrg_LT_DECL([], [soname_spec], [1],
2725c27c18e8Smrg    [[The coded name of the library, if different from the real name]])
2726c27c18e8Smrg_LT_DECL([], [postinstall_cmds], [2],
2727c27c18e8Smrg    [Command to use after installation of a shared archive])
2728c27c18e8Smrg_LT_DECL([], [postuninstall_cmds], [2],
2729c27c18e8Smrg    [Command to use after uninstallation of a shared archive])
2730c27c18e8Smrg_LT_DECL([], [finish_cmds], [2],
2731c27c18e8Smrg    [Commands used to finish a libtool library installation in a directory])
2732c27c18e8Smrg_LT_DECL([], [finish_eval], [1],
2733c27c18e8Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
2734c27c18e8Smrg    not shown]])
2735c27c18e8Smrg_LT_DECL([], [hardcode_into_libs], [0],
2736c27c18e8Smrg    [Whether we should hardcode library paths into libraries])
2737c27c18e8Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
2738c27c18e8Smrg    [Compile-time system search path for libraries])
2739c27c18e8Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2740c27c18e8Smrg    [Run-time system search path for libraries])
2741c27c18e8Smrg])# _LT_SYS_DYNAMIC_LINKER
2742c27c18e8Smrg
2743c27c18e8Smrg
2744c27c18e8Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
274521e67964Smrg# --------------------------
274621e67964Smrg# find a file program which can recognize shared library
2747c27c18e8SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
2748c27c18e8Smrg[m4_require([_LT_DECL_EGREP])dnl
274921e67964SmrgAC_MSG_CHECKING([for $1])
275021e67964SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
275121e67964Smrg[case $MAGIC_CMD in
275221e67964Smrg[[\\/*] |  ?:[\\/]*])
275321e67964Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
275421e67964Smrg  ;;
275521e67964Smrg*)
275621e67964Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
275721e67964Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
275821e67964Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
275921e67964Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
276021e67964Smrgdnl not every word.  This closes a longstanding sh security hole.
2761c27c18e8Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
276221e67964Smrg  for ac_dir in $ac_dummy; do
276321e67964Smrg    IFS="$lt_save_ifs"
276421e67964Smrg    test -z "$ac_dir" && ac_dir=.
276521e67964Smrg    if test -f $ac_dir/$1; then
276621e67964Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
276721e67964Smrg      if test -n "$file_magic_test_file"; then
276821e67964Smrg	case $deplibs_check_method in
276921e67964Smrg	"file_magic "*)
277021e67964Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
277121e67964Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
277221e67964Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
277321e67964Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
277421e67964Smrg	    :
277521e67964Smrg	  else
2776c27c18e8Smrg	    cat <<_LT_EOF 1>&2
2777c43cc173Smrg
277821e67964Smrg*** Warning: the command libtool uses to detect shared libraries,
277921e67964Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
278021e67964Smrg*** The result is that libtool may fail to recognize shared libraries
278121e67964Smrg*** as such.  This will affect the creation of libtool libraries that
278221e67964Smrg*** depend on shared libraries, but programs linked with such libtool
278321e67964Smrg*** libraries will work regardless of this problem.  Nevertheless, you
278421e67964Smrg*** may want to report the problem to your system manager and/or to
278521e67964Smrg*** bug-libtool@gnu.org
2786c43cc173Smrg
2787c27c18e8Smrg_LT_EOF
278821e67964Smrg	  fi ;;
278921e67964Smrg	esac
279021e67964Smrg      fi
279121e67964Smrg      break
279221e67964Smrg    fi
279321e67964Smrg  done
279421e67964Smrg  IFS="$lt_save_ifs"
279521e67964Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
279621e67964Smrg  ;;
279721e67964Smrgesac])
279821e67964SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
279921e67964Smrgif test -n "$MAGIC_CMD"; then
280021e67964Smrg  AC_MSG_RESULT($MAGIC_CMD)
2801c43cc173Smrgelse
280221e67964Smrg  AC_MSG_RESULT(no)
2803c43cc173Smrgfi
2804c27c18e8Smrg_LT_DECL([], [MAGIC_CMD], [0],
2805c27c18e8Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
2806c27c18e8Smrg])# _LT_PATH_TOOL_PREFIX
2807c43cc173Smrg
2808c27c18e8Smrg# Old name:
2809c27c18e8SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
2810c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
2811c27c18e8Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
2812c43cc173Smrg
2813c27c18e8Smrg
2814c27c18e8Smrg# _LT_PATH_MAGIC
2815c27c18e8Smrg# --------------
281621e67964Smrg# find a file program which can recognize a shared library
2817c27c18e8Smrgm4_defun([_LT_PATH_MAGIC],
2818c27c18e8Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
281921e67964Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
282021e67964Smrg  if test -n "$ac_tool_prefix"; then
2821c27c18e8Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
2822c43cc173Smrg  else
282321e67964Smrg    MAGIC_CMD=:
2824c43cc173Smrg  fi
2825c43cc173Smrgfi
2826c27c18e8Smrg])# _LT_PATH_MAGIC
2827c43cc173Smrg
2828c43cc173Smrg
2829c27c18e8Smrg# LT_PATH_LD
283021e67964Smrg# ----------
283121e67964Smrg# find the pathname to the GNU or non-GNU linker
2832c27c18e8SmrgAC_DEFUN([LT_PATH_LD],
2833c27c18e8Smrg[AC_REQUIRE([AC_PROG_CC])dnl
283421e67964SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
283521e67964SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
2836c27c18e8Smrgm4_require([_LT_DECL_SED])dnl
2837c27c18e8Smrgm4_require([_LT_DECL_EGREP])dnl
2838c27c18e8Smrg
2839c27c18e8SmrgAC_ARG_WITH([gnu-ld],
2840c27c18e8Smrg    [AS_HELP_STRING([--with-gnu-ld],
2841c27c18e8Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
2842c27c18e8Smrg    [test "$withval" = no || with_gnu_ld=yes],
2843c27c18e8Smrg    [with_gnu_ld=no])dnl
2844c27c18e8Smrg
284521e67964Smrgac_prog=ld
284621e67964Smrgif test "$GCC" = yes; then
284721e67964Smrg  # Check if gcc -print-prog-name=ld gives a path.
284821e67964Smrg  AC_MSG_CHECKING([for ld used by $CC])
284921e67964Smrg  case $host in
285021e67964Smrg  *-*-mingw*)
285121e67964Smrg    # gcc leaves a trailing carriage return which upsets mingw
285221e67964Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
285321e67964Smrg  *)
285421e67964Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
285521e67964Smrg  esac
285621e67964Smrg  case $ac_prog in
285721e67964Smrg    # Accept absolute paths.
285821e67964Smrg    [[\\/]]* | ?:[[\\/]]*)
285921e67964Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
286021e67964Smrg      # Canonicalize the pathname of ld
2861c27c18e8Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
2862c27c18e8Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
2863c27c18e8Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
286421e67964Smrg      done
286521e67964Smrg      test -z "$LD" && LD="$ac_prog"
286621e67964Smrg      ;;
286721e67964Smrg  "")
286821e67964Smrg    # If it fails, then pretend we aren't using GCC.
286921e67964Smrg    ac_prog=ld
287021e67964Smrg    ;;
287121e67964Smrg  *)
287221e67964Smrg    # If it is relative, then search for the first ld in PATH.
287321e67964Smrg    with_gnu_ld=unknown
2874c43cc173Smrg    ;;
2875c43cc173Smrg  esac
287621e67964Smrgelif test "$with_gnu_ld" = yes; then
287721e67964Smrg  AC_MSG_CHECKING([for GNU ld])
287821e67964Smrgelse
287921e67964Smrg  AC_MSG_CHECKING([for non-GNU ld])
2880c43cc173Smrgfi
288121e67964SmrgAC_CACHE_VAL(lt_cv_path_LD,
288221e67964Smrg[if test -z "$LD"; then
288321e67964Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
288421e67964Smrg  for ac_dir in $PATH; do
288521e67964Smrg    IFS="$lt_save_ifs"
288621e67964Smrg    test -z "$ac_dir" && ac_dir=.
288721e67964Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
288821e67964Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
288921e67964Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
289021e67964Smrg      # but apparently some variants of GNU ld only accept -v.
289121e67964Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
289221e67964Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
289321e67964Smrg      *GNU* | *'with BFD'*)
289421e67964Smrg	test "$with_gnu_ld" != no && break
289521e67964Smrg	;;
289621e67964Smrg      *)
289721e67964Smrg	test "$with_gnu_ld" != yes && break
289821e67964Smrg	;;
289921e67964Smrg      esac
290021e67964Smrg    fi
290121e67964Smrg  done
290221e67964Smrg  IFS="$lt_save_ifs"
2903c43cc173Smrgelse
290421e67964Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
290521e67964Smrgfi])
290621e67964SmrgLD="$lt_cv_path_LD"
290721e67964Smrgif test -n "$LD"; then
290821e67964Smrg  AC_MSG_RESULT($LD)
290921e67964Smrgelse
291021e67964Smrg  AC_MSG_RESULT(no)
2911c43cc173Smrgfi
291221e67964Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2913c27c18e8Smrg_LT_PATH_LD_GNU
2914c27c18e8SmrgAC_SUBST([LD])
2915c43cc173Smrg
2916c27c18e8Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
2917c27c18e8Smrg])# LT_PATH_LD
2918c43cc173Smrg
2919c27c18e8Smrg# Old names:
2920c27c18e8SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
2921c27c18e8SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
2922c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
2923c27c18e8Smrgdnl AC_DEFUN([AM_PROG_LD], [])
2924c27c18e8Smrgdnl AC_DEFUN([AC_PROG_LD], [])
2925c27c18e8Smrg
2926c27c18e8Smrg
2927c27c18e8Smrg# _LT_PATH_LD_GNU
2928c27c18e8Smrg#- --------------
2929c27c18e8Smrgm4_defun([_LT_PATH_LD_GNU],
2930c27c18e8Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
293121e67964Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
293221e67964Smrgcase `$LD -v 2>&1 </dev/null` in
293321e67964Smrg*GNU* | *'with BFD'*)
293421e67964Smrg  lt_cv_prog_gnu_ld=yes
293521e67964Smrg  ;;
293621e67964Smrg*)
293721e67964Smrg  lt_cv_prog_gnu_ld=no
2938c43cc173Smrg  ;;
293921e67964Smrgesac])
294021e67964Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
2941c27c18e8Smrg])# _LT_PATH_LD_GNU
2942c43cc173Smrg
294321e67964Smrg
2944c27c18e8Smrg# _LT_CMD_RELOAD
2945c27c18e8Smrg# --------------
294621e67964Smrg# find reload flag for linker
294721e67964Smrg#   -- PORTME Some linkers may need a different reload flag.
2948c27c18e8Smrgm4_defun([_LT_CMD_RELOAD],
294921e67964Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
295021e67964Smrg  lt_cv_ld_reload_flag,
295121e67964Smrg  [lt_cv_ld_reload_flag='-r'])
295221e67964Smrgreload_flag=$lt_cv_ld_reload_flag
295321e67964Smrgcase $reload_flag in
295421e67964Smrg"" | " "*) ;;
295521e67964Smrg*) reload_flag=" $reload_flag" ;;
295621e67964Smrgesac
295721e67964Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
295821e67964Smrgcase $host_os in
295921e67964Smrg  darwin*)
296021e67964Smrg    if test "$GCC" = yes; then
296121e67964Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
2962c43cc173Smrg    else
296321e67964Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
2964c43cc173Smrg    fi
296521e67964Smrg    ;;
296621e67964Smrgesac
2967c27c18e8Smrg_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
2968c27c18e8Smrg_LT_DECL([], [reload_cmds], [2])dnl
2969c27c18e8Smrg])# _LT_CMD_RELOAD
2970c43cc173Smrg
297121e67964Smrg
2972c27c18e8Smrg# _LT_CHECK_MAGIC_METHOD
2973c27c18e8Smrg# ----------------------
297421e67964Smrg# how to check for library dependencies
297521e67964Smrg#  -- PORTME fill in with the dynamic library characteristics
2976c27c18e8Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
2977c27c18e8Smrg[m4_require([_LT_DECL_EGREP])
2978c27c18e8Smrgm4_require([_LT_DECL_OBJDUMP])
2979c27c18e8SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
298021e67964Smrglt_cv_deplibs_check_method,
298121e67964Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
298221e67964Smrglt_cv_file_magic_test_file=
298321e67964Smrglt_cv_deplibs_check_method='unknown'
298421e67964Smrg# Need to set the preceding variable on all platforms that support
298521e67964Smrg# interlibrary dependencies.
298621e67964Smrg# 'none' -- dependencies not supported.
298721e67964Smrg# `unknown' -- same as none, but documents that we really don't know.
298821e67964Smrg# 'pass_all' -- all dependencies passed with no checks.
298921e67964Smrg# 'test_compile' -- check by making test program.
299021e67964Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
299121e67964Smrg# which responds to the $file_magic_cmd with a given extended regex.
299221e67964Smrg# If you have `file' or equivalent on your system and you're not sure
299321e67964Smrg# whether `pass_all' will *always* work, you probably want this one.
299421e67964Smrg
299521e67964Smrgcase $host_os in
299621e67964Smrgaix[[4-9]]*)
299721e67964Smrg  lt_cv_deplibs_check_method=pass_all
2998c43cc173Smrg  ;;
2999c43cc173Smrg
3000c43cc173Smrgbeos*)
300121e67964Smrg  lt_cv_deplibs_check_method=pass_all
3002c43cc173Smrg  ;;
3003c43cc173Smrg
3004c43cc173Smrgbsdi[[45]]*)
300521e67964Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
300621e67964Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
300721e67964Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
3008c43cc173Smrg  ;;
3009c43cc173Smrg
301021e67964Smrgcygwin*)
301121e67964Smrg  # func_win32_libid is a shell function defined in ltmain.sh
301221e67964Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
301321e67964Smrg  lt_cv_file_magic_cmd='func_win32_libid'
301421e67964Smrg  ;;
3015c43cc173Smrg
301621e67964Smrgmingw* | pw32*)
301721e67964Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
301821e67964Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
301921e67964Smrg  # unless we find 'file', for example because we are cross-compiling.
302021e67964Smrg  if ( file / ) >/dev/null 2>&1; then
302121e67964Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
302221e67964Smrg    lt_cv_file_magic_cmd='func_win32_libid'
302321e67964Smrg  else
302421e67964Smrg    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
302521e67964Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
302621e67964Smrg  fi
302721e67964Smrg  ;;
3028c43cc173Smrg
3029c27c18e8Smrgcegcc)
3030c27c18e8Smrg  # use the weaker test based on 'objdump'. See mingw*.
3031c27c18e8Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3032c27c18e8Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3033c27c18e8Smrg  ;;
3034c27c18e8Smrg
303521e67964Smrgdarwin* | rhapsody*)
303621e67964Smrg  lt_cv_deplibs_check_method=pass_all
303721e67964Smrg  ;;
303821e67964Smrg
303921e67964Smrgfreebsd* | dragonfly*)
3040c27c18e8Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
304121e67964Smrg    case $host_cpu in
304221e67964Smrg    i*86 )
304321e67964Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
304421e67964Smrg      # Let's accept both of them until this is cleared up.
304521e67964Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
304621e67964Smrg      lt_cv_file_magic_cmd=/usr/bin/file
304721e67964Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3048c43cc173Smrg      ;;
3049c43cc173Smrg    esac
305021e67964Smrg  else
305121e67964Smrg    lt_cv_deplibs_check_method=pass_all
305221e67964Smrg  fi
305321e67964Smrg  ;;
305421e67964Smrg
305521e67964Smrggnu*)
305621e67964Smrg  lt_cv_deplibs_check_method=pass_all
305721e67964Smrg  ;;
3058c43cc173Smrg
305921e67964Smrghpux10.20* | hpux11*)
306021e67964Smrg  lt_cv_file_magic_cmd=/usr/bin/file
306121e67964Smrg  case $host_cpu in
306221e67964Smrg  ia64*)
306321e67964Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
306421e67964Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
306521e67964Smrg    ;;
306621e67964Smrg  hppa*64*)
306721e67964Smrg    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
306821e67964Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
306921e67964Smrg    ;;
3070c43cc173Smrg  *)
307121e67964Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
307221e67964Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3073c43cc173Smrg    ;;
3074c43cc173Smrg  esac
3075c43cc173Smrg  ;;
3076c43cc173Smrg
307721e67964Smrginterix[[3-9]]*)
307821e67964Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
307921e67964Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3080c43cc173Smrg  ;;
3081c43cc173Smrg
308221e67964Smrgirix5* | irix6* | nonstopux*)
308321e67964Smrg  case $LD in
308421e67964Smrg  *-32|*"-32 ") libmagic=32-bit;;
308521e67964Smrg  *-n32|*"-n32 ") libmagic=N32;;
308621e67964Smrg  *-64|*"-64 ") libmagic=64-bit;;
308721e67964Smrg  *) libmagic=never-match;;
308821e67964Smrg  esac
308921e67964Smrg  lt_cv_deplibs_check_method=pass_all
3090c43cc173Smrg  ;;
3091c43cc173Smrg
309221e67964Smrg# This must be Linux ELF.
309321e67964Smrglinux* | k*bsd*-gnu)
309421e67964Smrg  lt_cv_deplibs_check_method=pass_all
3095c43cc173Smrg  ;;
3096c43cc173Smrg
309721e67964Smrgnetbsd*)
3098c27c18e8Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
309921e67964Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
310021e67964Smrg  else
310121e67964Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
310221e67964Smrg  fi
3103c43cc173Smrg  ;;
3104c43cc173Smrg
310521e67964Smrgnewos6*)
310621e67964Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
310721e67964Smrg  lt_cv_file_magic_cmd=/usr/bin/file
310821e67964Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
310921e67964Smrg  ;;
311021e67964Smrg
3111c27c18e8Smrg*nto* | *qnx*)
3112c27c18e8Smrg  lt_cv_deplibs_check_method=pass_all
311321e67964Smrg  ;;
311421e67964Smrg
311521e67964Smrgopenbsd*)
3116c27c18e8Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
311721e67964Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3118c43cc173Smrg  else
311921e67964Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3120c43cc173Smrg  fi
312121e67964Smrg  ;;
312221e67964Smrg
312321e67964Smrgosf3* | osf4* | osf5*)
312421e67964Smrg  lt_cv_deplibs_check_method=pass_all
312521e67964Smrg  ;;
312621e67964Smrg
312721e67964Smrgrdos*)
312821e67964Smrg  lt_cv_deplibs_check_method=pass_all
312921e67964Smrg  ;;
313021e67964Smrg
313121e67964Smrgsolaris*)
313221e67964Smrg  lt_cv_deplibs_check_method=pass_all
313321e67964Smrg  ;;
313421e67964Smrg
3135c27c18e8Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3136c27c18e8Smrg  lt_cv_deplibs_check_method=pass_all
3137c27c18e8Smrg  ;;
3138c27c18e8Smrg
313921e67964Smrgsysv4 | sysv4.3*)
314021e67964Smrg  case $host_vendor in
314121e67964Smrg  motorola)
314221e67964Smrg    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]]'
314321e67964Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3144c43cc173Smrg    ;;
314521e67964Smrg  ncr)
314621e67964Smrg    lt_cv_deplibs_check_method=pass_all
3147c43cc173Smrg    ;;
314821e67964Smrg  sequent)
314921e67964Smrg    lt_cv_file_magic_cmd='/bin/file'
315021e67964Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3151c43cc173Smrg    ;;
315221e67964Smrg  sni)
315321e67964Smrg    lt_cv_file_magic_cmd='/bin/file'
315421e67964Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
315521e67964Smrg    lt_cv_file_magic_test_file=/lib/libc.so
315621e67964Smrg    ;;
315721e67964Smrg  siemens)
315821e67964Smrg    lt_cv_deplibs_check_method=pass_all
315921e67964Smrg    ;;
316021e67964Smrg  pc)
316121e67964Smrg    lt_cv_deplibs_check_method=pass_all
3162c43cc173Smrg    ;;
3163c43cc173Smrg  esac
3164c43cc173Smrg  ;;
3165c43cc173Smrg
3166c27c18e8Smrgtpf*)
316721e67964Smrg  lt_cv_deplibs_check_method=pass_all
3168c43cc173Smrg  ;;
316921e67964Smrgesac
317021e67964Smrg])
317121e67964Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
317221e67964Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
317321e67964Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3174c43cc173Smrg
3175c27c18e8Smrg_LT_DECL([], [deplibs_check_method], [1],
3176c27c18e8Smrg    [Method to check whether dependent libraries are shared objects])
3177c27c18e8Smrg_LT_DECL([], [file_magic_cmd], [1],
3178c27c18e8Smrg    [Command to use when deplibs_check_method == "file_magic"])
3179c27c18e8Smrg])# _LT_CHECK_MAGIC_METHOD
3180c43cc173Smrg
3181c27c18e8Smrg
3182c27c18e8Smrg# LT_PATH_NM
318321e67964Smrg# ----------
3184c27c18e8Smrg# find the pathname to a BSD- or MS-compatible name lister
3185c27c18e8SmrgAC_DEFUN([LT_PATH_NM],
3186c27c18e8Smrg[AC_REQUIRE([AC_PROG_CC])dnl
3187c27c18e8SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
318821e67964Smrg[if test -n "$NM"; then
318921e67964Smrg  # Let the user override the test.
319021e67964Smrg  lt_cv_path_NM="$NM"
319121e67964Smrgelse
319221e67964Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
319321e67964Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
319421e67964Smrg    lt_nm_to_check="$lt_nm_to_check nm"
3195c43cc173Smrg  fi
319621e67964Smrg  for lt_tmp_nm in $lt_nm_to_check; do
319721e67964Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
319821e67964Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
319921e67964Smrg      IFS="$lt_save_ifs"
320021e67964Smrg      test -z "$ac_dir" && ac_dir=.
320121e67964Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
320221e67964Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
320321e67964Smrg	# Check to see if the nm accepts a BSD-compat flag.
320421e67964Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
320521e67964Smrg	#   nm: unknown option "B" ignored
320621e67964Smrg	# Tru64's nm complains that /dev/null is an invalid object file
320721e67964Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
320821e67964Smrg	*/dev/null* | *'Invalid file or object type'*)
320921e67964Smrg	  lt_cv_path_NM="$tmp_nm -B"
321021e67964Smrg	  break
321121e67964Smrg	  ;;
321221e67964Smrg	*)
321321e67964Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
321421e67964Smrg	  */dev/null*)
321521e67964Smrg	    lt_cv_path_NM="$tmp_nm -p"
321621e67964Smrg	    break
321721e67964Smrg	    ;;
321821e67964Smrg	  *)
321921e67964Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
322021e67964Smrg	    continue # so that we can try to find one that supports BSD flags
322121e67964Smrg	    ;;
322221e67964Smrg	  esac
322321e67964Smrg	  ;;
322421e67964Smrg	esac
322521e67964Smrg      fi
322621e67964Smrg    done
322721e67964Smrg    IFS="$lt_save_ifs"
322821e67964Smrg  done
3229c27c18e8Smrg  : ${lt_cv_path_NM=no}
323021e67964Smrgfi])
3231c27c18e8Smrgif test "$lt_cv_path_NM" != "no"; then
3232c27c18e8Smrg  NM="$lt_cv_path_NM"
3233c27c18e8Smrgelse
3234c27c18e8Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
3235c27c18e8Smrg  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
3236c27c18e8Smrg  AC_SUBST([DUMPBIN])
3237c27c18e8Smrg  if test "$DUMPBIN" != ":"; then
3238c27c18e8Smrg    NM="$DUMPBIN"
3239c27c18e8Smrg  fi
3240c27c18e8Smrgfi
3241c27c18e8Smrgtest -z "$NM" && NM=nm
3242c27c18e8SmrgAC_SUBST([NM])
3243c27c18e8Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3244c27c18e8Smrg
3245c27c18e8SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3246c27c18e8Smrg  [lt_cv_nm_interface="BSD nm"
3247c27c18e8Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
3248c27c18e8Smrg  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3249c27c18e8Smrg  (eval "$ac_compile" 2>conftest.err)
3250c27c18e8Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3251c27c18e8Smrg  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3252c27c18e8Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3253c27c18e8Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3254c27c18e8Smrg  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
3255c27c18e8Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
3256c27c18e8Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3257c27c18e8Smrg    lt_cv_nm_interface="MS dumpbin"
3258c27c18e8Smrg  fi
3259c27c18e8Smrg  rm -f conftest*])
3260c27c18e8Smrg])# LT_PATH_NM
3261c43cc173Smrg
3262c27c18e8Smrg# Old names:
3263c27c18e8SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3264c27c18e8SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3265c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
3266c27c18e8Smrgdnl AC_DEFUN([AM_PROG_NM], [])
3267c27c18e8Smrgdnl AC_DEFUN([AC_PROG_NM], [])
3268c43cc173Smrg
3269c27c18e8Smrg
3270c27c18e8Smrg# LT_LIB_M
3271c27c18e8Smrg# --------
327221e67964Smrg# check for math library
3273c27c18e8SmrgAC_DEFUN([LT_LIB_M],
327421e67964Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
327521e67964SmrgLIBM=
327621e67964Smrgcase $host in
327721e67964Smrg*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
327821e67964Smrg  # These system don't have libm, or don't need it
3279c43cc173Smrg  ;;
328021e67964Smrg*-ncr-sysv4.3*)
328121e67964Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
328221e67964Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3283c43cc173Smrg  ;;
328421e67964Smrg*)
328521e67964Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
3286c43cc173Smrg  ;;
328721e67964Smrgesac
3288c27c18e8SmrgAC_SUBST([LIBM])
3289c27c18e8Smrg])# LT_LIB_M
3290c43cc173Smrg
3291c27c18e8Smrg# Old name:
3292c27c18e8SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3293c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
3294c27c18e8Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3295c43cc173Smrg
329621e67964Smrg
3297c27c18e8Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
3298c27c18e8Smrg# -------------------------------
3299c27c18e8Smrgm4_defun([_LT_COMPILER_NO_RTTI],
3300c27c18e8Smrg[m4_require([_LT_TAG_COMPILER])dnl
330121e67964Smrg
3302c27c18e8Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3303c43cc173Smrg
3304c27c18e8Smrgif test "$GCC" = yes; then
3305c27c18e8Smrg  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
3306c43cc173Smrg
3307c27c18e8Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3308c27c18e8Smrg    lt_cv_prog_compiler_rtti_exceptions,
3309c27c18e8Smrg    [-fno-rtti -fno-exceptions], [],
3310c27c18e8Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3311c27c18e8Smrgfi
3312c27c18e8Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3313c27c18e8Smrg	[Compiler flag to turn off builtin functions])
3314c27c18e8Smrg])# _LT_COMPILER_NO_RTTI
3315c43cc173Smrg
3316c43cc173Smrg
3317c27c18e8Smrg# _LT_CMD_GLOBAL_SYMBOLS
3318c27c18e8Smrg# ----------------------
3319c27c18e8Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3320c27c18e8Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3321c27c18e8SmrgAC_REQUIRE([AC_PROG_CC])dnl
3322c27c18e8SmrgAC_REQUIRE([LT_PATH_NM])dnl
3323c27c18e8SmrgAC_REQUIRE([LT_PATH_LD])dnl
3324c27c18e8Smrgm4_require([_LT_DECL_SED])dnl
3325c27c18e8Smrgm4_require([_LT_DECL_EGREP])dnl
3326c27c18e8Smrgm4_require([_LT_TAG_COMPILER])dnl
3327c43cc173Smrg
3328c27c18e8Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
3329c27c18e8SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3330c27c18e8SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
333121e67964Smrg[
3332c27c18e8Smrg# These are sane defaults that work on at least a few old systems.
3333c27c18e8Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3334c43cc173Smrg
3335c27c18e8Smrg# Character class describing NM global symbol codes.
3336c27c18e8Smrgsymcode='[[BCDEGRST]]'
3337c43cc173Smrg
3338c27c18e8Smrg# Regexp to match symbols that can be accessed directly from C.
3339c27c18e8Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3340c43cc173Smrg
3341c27c18e8Smrg# Define system-specific variables.
3342c27c18e8Smrgcase $host_os in
3343c27c18e8Smrgaix*)
3344c27c18e8Smrg  symcode='[[BCDT]]'
3345c27c18e8Smrg  ;;
3346c27c18e8Smrgcygwin* | mingw* | pw32* | cegcc*)
3347c27c18e8Smrg  symcode='[[ABCDGISTW]]'
3348c27c18e8Smrg  ;;
3349c27c18e8Smrghpux*)
3350c27c18e8Smrg  if test "$host_cpu" = ia64; then
3351c27c18e8Smrg    symcode='[[ABCDEGRST]]'
3352c27c18e8Smrg  fi
3353c27c18e8Smrg  ;;
3354c27c18e8Smrgirix* | nonstopux*)
3355c27c18e8Smrg  symcode='[[BCDEGRST]]'
3356c27c18e8Smrg  ;;
3357c27c18e8Smrgosf*)
3358c27c18e8Smrg  symcode='[[BCDEGQRST]]'
3359c27c18e8Smrg  ;;
3360c27c18e8Smrgsolaris*)
3361c27c18e8Smrg  symcode='[[BDRT]]'
3362c27c18e8Smrg  ;;
3363c27c18e8Smrgsco3.2v5*)
3364c27c18e8Smrg  symcode='[[DT]]'
3365c27c18e8Smrg  ;;
3366c27c18e8Smrgsysv4.2uw2*)
3367c27c18e8Smrg  symcode='[[DT]]'
3368c27c18e8Smrg  ;;
3369c27c18e8Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
3370c27c18e8Smrg  symcode='[[ABDT]]'
3371c27c18e8Smrg  ;;
3372c27c18e8Smrgsysv4)
3373c27c18e8Smrg  symcode='[[DFNSTU]]'
3374c27c18e8Smrg  ;;
3375c27c18e8Smrgesac
3376c43cc173Smrg
3377c27c18e8Smrg# If we're using GNU nm, then use its standard symbol codes.
3378c27c18e8Smrgcase `$NM -V 2>&1` in
3379c27c18e8Smrg*GNU* | *'with BFD'*)
3380c27c18e8Smrg  symcode='[[ABCDGIRSTW]]' ;;
3381c27c18e8Smrgesac
3382c43cc173Smrg
3383c27c18e8Smrg# Transform an extracted symbol line into a proper C declaration.
3384c27c18e8Smrg# Some systems (esp. on ia64) link data and code symbols differently,
3385c27c18e8Smrg# so use this general approach.
3386c27c18e8Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3387c43cc173Smrg
3388c27c18e8Smrg# Transform an extracted symbol line into symbol name and symbol address
3389c27c18e8Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
3390c27c18e8Smrglt_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'"
3391c43cc173Smrg
3392c27c18e8Smrg# Handle CRLF in mingw tool chain
3393c27c18e8Smrgopt_cr=
3394c27c18e8Smrgcase $build_os in
3395c27c18e8Smrgmingw*)
3396c27c18e8Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3397c27c18e8Smrg  ;;
3398c27c18e8Smrgesac
3399c43cc173Smrg
3400c27c18e8Smrg# Try without a prefix underscore, then with it.
3401c27c18e8Smrgfor ac_symprfx in "" "_"; do
3402c43cc173Smrg
3403c27c18e8Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3404c27c18e8Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
3405c43cc173Smrg
3406c27c18e8Smrg  # Write the raw and C identifiers.
3407c27c18e8Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3408c27c18e8Smrg    # Fake it for dumpbin and say T for any non-static function
3409c27c18e8Smrg    # and D for any global variable.
3410c27c18e8Smrg    # Also find C++ and __fastcall symbols from MSVC++,
3411c27c18e8Smrg    # which start with @ or ?.
3412c27c18e8Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
3413c27c18e8Smrg"     {last_section=section; section=\$ 3};"\
3414c27c18e8Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3415c27c18e8Smrg"     \$ 0!~/External *\|/{next};"\
3416c27c18e8Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3417c27c18e8Smrg"     {if(hide[section]) next};"\
3418c27c18e8Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3419c27c18e8Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3420c27c18e8Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
3421c27c18e8Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3422c27c18e8Smrg"     ' prfx=^$ac_symprfx]"
3423c27c18e8Smrg  else
3424c27c18e8Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
342521e67964Smrg  fi
3426c43cc173Smrg
3427c27c18e8Smrg  # Check to see that the pipe works correctly.
3428c27c18e8Smrg  pipe_works=no
3429c43cc173Smrg
3430c27c18e8Smrg  rm -f conftest*
3431c27c18e8Smrg  cat > conftest.$ac_ext <<_LT_EOF
3432c27c18e8Smrg#ifdef __cplusplus
3433c27c18e8Smrgextern "C" {
3434c27c18e8Smrg#endif
3435c27c18e8Smrgchar nm_test_var;
3436c27c18e8Smrgvoid nm_test_func(void);
3437c27c18e8Smrgvoid nm_test_func(void){}
3438c27c18e8Smrg#ifdef __cplusplus
3439c27c18e8Smrg}
3440c27c18e8Smrg#endif
3441c27c18e8Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
3442c27c18e8Smrg_LT_EOF
3443c43cc173Smrg
3444c27c18e8Smrg  if AC_TRY_EVAL(ac_compile); then
3445c27c18e8Smrg    # Now try to grab the symbols.
3446c27c18e8Smrg    nlist=conftest.nm
3447c27c18e8Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
3448c27c18e8Smrg      # Try sorting and uniquifying the output.
3449c27c18e8Smrg      if sort "$nlist" | uniq > "$nlist"T; then
3450c27c18e8Smrg	mv -f "$nlist"T "$nlist"
3451c27c18e8Smrg      else
3452c27c18e8Smrg	rm -f "$nlist"T
3453c27c18e8Smrg      fi
3454c43cc173Smrg
3455c27c18e8Smrg      # Make sure that we snagged all the symbols we need.
3456c27c18e8Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3457c27c18e8Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3458c27c18e8Smrg	  cat <<_LT_EOF > conftest.$ac_ext
3459c27c18e8Smrg#ifdef __cplusplus
3460c27c18e8Smrgextern "C" {
3461c27c18e8Smrg#endif
3462c43cc173Smrg
3463c27c18e8Smrg_LT_EOF
3464c27c18e8Smrg	  # Now generate the symbol file.
3465c27c18e8Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3466c43cc173Smrg
3467c27c18e8Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
3468c43cc173Smrg
3469c27c18e8Smrg/* The mapping between symbol names and symbols.  */
3470c27c18e8Smrgconst struct {
3471c27c18e8Smrg  const char *name;
3472c27c18e8Smrg  void       *address;
3473c27c18e8Smrg}
3474c27c18e8Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
3475c27c18e8Smrg{
3476c27c18e8Smrg  { "@PROGRAM@", (void *) 0 },
3477c27c18e8Smrg_LT_EOF
3478c27c18e8Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3479c27c18e8Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
3480c27c18e8Smrg  {0, (void *) 0}
3481c27c18e8Smrg};
3482c43cc173Smrg
3483c27c18e8Smrg/* This works around a problem in FreeBSD linker */
3484c27c18e8Smrg#ifdef FREEBSD_WORKAROUND
3485c27c18e8Smrgstatic const void *lt_preloaded_setup() {
3486c27c18e8Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
3487c27c18e8Smrg}
3488c27c18e8Smrg#endif
3489c43cc173Smrg
3490c27c18e8Smrg#ifdef __cplusplus
3491c27c18e8Smrg}
3492c27c18e8Smrg#endif
3493c27c18e8Smrg_LT_EOF
3494c27c18e8Smrg	  # Now try linking the two files.
3495c27c18e8Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
3496c27c18e8Smrg	  lt_save_LIBS="$LIBS"
3497c27c18e8Smrg	  lt_save_CFLAGS="$CFLAGS"
3498c27c18e8Smrg	  LIBS="conftstm.$ac_objext"
3499c27c18e8Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3500c27c18e8Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3501c27c18e8Smrg	    pipe_works=yes
3502c27c18e8Smrg	  fi
3503c27c18e8Smrg	  LIBS="$lt_save_LIBS"
3504c27c18e8Smrg	  CFLAGS="$lt_save_CFLAGS"
3505c27c18e8Smrg	else
3506c27c18e8Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3507c27c18e8Smrg	fi
3508c27c18e8Smrg      else
3509c27c18e8Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3510c27c18e8Smrg      fi
351121e67964Smrg    else
3512c27c18e8Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3513c43cc173Smrg    fi
3514c43cc173Smrg  else
3515c27c18e8Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3516c27c18e8Smrg    cat conftest.$ac_ext >&5
3517c43cc173Smrg  fi
3518c27c18e8Smrg  rm -rf conftest* conftst*
3519c43cc173Smrg
3520c27c18e8Smrg  # Do not use the global_symbol_pipe unless it works.
3521c27c18e8Smrg  if test "$pipe_works" = yes; then
3522c27c18e8Smrg    break
3523c27c18e8Smrg  else
3524c27c18e8Smrg    lt_cv_sys_global_symbol_pipe=
3525c27c18e8Smrg  fi
3526c27c18e8Smrgdone
3527c27c18e8Smrg])
3528c27c18e8Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
3529c27c18e8Smrg  lt_cv_sys_global_symbol_to_cdecl=
3530c27c18e8Smrgfi
3531c27c18e8Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3532c27c18e8Smrg  AC_MSG_RESULT(failed)
3533c43cc173Smrgelse
3534c27c18e8Smrg  AC_MSG_RESULT(ok)
3535c43cc173Smrgfi
3536c43cc173Smrg
3537c27c18e8Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3538c27c18e8Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
3539c27c18e8Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3540c27c18e8Smrg    [Transform the output of nm in a proper C declaration])
3541c27c18e8Smrg_LT_DECL([global_symbol_to_c_name_address],
3542c27c18e8Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
3543c27c18e8Smrg    [Transform the output of nm in a C name address pair])
3544c27c18e8Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3545c27c18e8Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3546c27c18e8Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
3547c27c18e8Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
3548c43cc173Smrg
3549c43cc173Smrg
3550c27c18e8Smrg# _LT_COMPILER_PIC([TAGNAME])
3551c27c18e8Smrg# ---------------------------
3552c27c18e8Smrgm4_defun([_LT_COMPILER_PIC],
3553c27c18e8Smrg[m4_require([_LT_TAG_COMPILER])dnl
3554c27c18e8Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
3555c27c18e8Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
3556c27c18e8Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
3557c43cc173Smrg
3558c27c18e8SmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
3559c27c18e8Smrgm4_if([$1], [CXX], [
3560c27c18e8Smrg  # C++ specific cases for pic, static, wl, etc.
3561c27c18e8Smrg  if test "$GXX" = yes; then
3562c27c18e8Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3563c27c18e8Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3564c43cc173Smrg
3565c27c18e8Smrg    case $host_os in
3566c27c18e8Smrg    aix*)
3567c27c18e8Smrg      # All AIX code is PIC.
356821e67964Smrg      if test "$host_cpu" = ia64; then
3569c27c18e8Smrg	# AIX 5 now supports IA64 processor
3570c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
357121e67964Smrg      fi
357221e67964Smrg      ;;
3573c43cc173Smrg
3574c27c18e8Smrg    amigaos*)
357521e67964Smrg      case $host_cpu in
3576c27c18e8Smrg      powerpc)
3577c27c18e8Smrg            # see comment about AmigaOS4 .so support
3578c27c18e8Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3579c27c18e8Smrg        ;;
3580c27c18e8Smrg      m68k)
3581c27c18e8Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
3582c27c18e8Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
3583c27c18e8Smrg            # like `-m68040'.
3584c27c18e8Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
358521e67964Smrg        ;;
358621e67964Smrg      esac
358721e67964Smrg      ;;
3588c43cc173Smrg
3589c27c18e8Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3590c27c18e8Smrg      # PIC is the default for these OSes.
3591c27c18e8Smrg      ;;
3592c27c18e8Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
3593c27c18e8Smrg      # This hack is so that the source file can tell whether it is being
3594c27c18e8Smrg      # built for inclusion in a dll (and should export symbols for example).
3595c27c18e8Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3596c27c18e8Smrg      # (--disable-auto-import) libraries
3597c27c18e8Smrg      m4_if([$1], [GCJ], [],
3598c27c18e8Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3599c27c18e8Smrg      ;;
3600c27c18e8Smrg    darwin* | rhapsody*)
3601c27c18e8Smrg      # PIC is the default on this platform
3602c27c18e8Smrg      # Common symbols not allowed in MH_DYLIB files
3603c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3604c27c18e8Smrg      ;;
3605c27c18e8Smrg    *djgpp*)
3606c27c18e8Smrg      # DJGPP does not support shared libraries at all
3607c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3608c27c18e8Smrg      ;;
3609c27c18e8Smrg    interix[[3-9]]*)
3610c27c18e8Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3611c27c18e8Smrg      # Instead, we relocate shared libraries at runtime.
3612c27c18e8Smrg      ;;
3613c27c18e8Smrg    sysv4*MP*)
3614c27c18e8Smrg      if test -d /usr/nec; then
3615c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3616c27c18e8Smrg      fi
3617c27c18e8Smrg      ;;
3618c27c18e8Smrg    hpux*)
3619c27c18e8Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3620c27c18e8Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3621c27c18e8Smrg      # sets the default TLS model and affects inlining.
3622c27c18e8Smrg      case $host_cpu in
3623c27c18e8Smrg      hppa*64*)
362421e67964Smrg	;;
362521e67964Smrg      *)
3626c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
362721e67964Smrg	;;
3628c27c18e8Smrg      esac
3629c27c18e8Smrg      ;;
3630c27c18e8Smrg    *qnx* | *nto*)
3631c27c18e8Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
3632c27c18e8Smrg      # it will coredump.
3633c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3634c27c18e8Smrg      ;;
3635c27c18e8Smrg    *)
3636c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3637c27c18e8Smrg      ;;
363821e67964Smrg    esac
3639c27c18e8Smrg  else
3640c27c18e8Smrg    case $host_os in
3641c27c18e8Smrg      aix[[4-9]]*)
3642c27c18e8Smrg	# All AIX code is PIC.
3643c27c18e8Smrg	if test "$host_cpu" = ia64; then
3644c27c18e8Smrg	  # AIX 5 now supports IA64 processor
3645c27c18e8Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3646c27c18e8Smrg	else
3647c27c18e8Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3648c27c18e8Smrg	fi
364921e67964Smrg	;;
3650c27c18e8Smrg      chorus*)
3651c27c18e8Smrg	case $cc_basename in
3652c27c18e8Smrg	cxch68*)
3653c27c18e8Smrg	  # Green Hills C++ Compiler
3654c27c18e8Smrg	  # _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"
365521e67964Smrg	  ;;
365621e67964Smrg	esac
365721e67964Smrg	;;
3658c27c18e8Smrg      dgux*)
3659c27c18e8Smrg	case $cc_basename in
3660c27c18e8Smrg	  ec++*)
3661c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3662c27c18e8Smrg	    ;;
3663c27c18e8Smrg	  ghcx*)
3664c27c18e8Smrg	    # Green Hills C++ Compiler
3665c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3666c27c18e8Smrg	    ;;
3667c27c18e8Smrg	  *)
3668c27c18e8Smrg	    ;;
366921e67964Smrg	esac
367021e67964Smrg	;;
3671c27c18e8Smrg      freebsd* | dragonfly*)
3672c27c18e8Smrg	# FreeBSD uses GNU C++
367321e67964Smrg	;;
3674c27c18e8Smrg      hpux9* | hpux10* | hpux11*)
3675c27c18e8Smrg	case $cc_basename in
3676c27c18e8Smrg	  CC*)
3677c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3678c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3679c27c18e8Smrg	    if test "$host_cpu" != ia64; then
3680c27c18e8Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3681c27c18e8Smrg	    fi
3682c27c18e8Smrg	    ;;
3683c27c18e8Smrg	  aCC*)
3684c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3685c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3686c27c18e8Smrg	    case $host_cpu in
3687c27c18e8Smrg	    hppa*64*|ia64*)
3688c27c18e8Smrg	      # +Z the default
3689c27c18e8Smrg	      ;;
3690c27c18e8Smrg	    *)
3691c27c18e8Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3692c27c18e8Smrg	      ;;
3693c27c18e8Smrg	    esac
3694c27c18e8Smrg	    ;;
3695c27c18e8Smrg	  *)
3696c27c18e8Smrg	    ;;
3697c27c18e8Smrg	esac
369821e67964Smrg	;;
3699c27c18e8Smrg      interix*)
3700c27c18e8Smrg	# This is c89, which is MS Visual C++ (no shared libs)
3701c27c18e8Smrg	# Anyone wants to do a port?
370221e67964Smrg	;;
3703c27c18e8Smrg      irix5* | irix6* | nonstopux*)
3704c27c18e8Smrg	case $cc_basename in
3705c27c18e8Smrg	  CC*)
3706c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3707c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3708c27c18e8Smrg	    # CC pic flag -KPIC is the default.
3709c27c18e8Smrg	    ;;
3710c27c18e8Smrg	  *)
3711c27c18e8Smrg	    ;;
3712c27c18e8Smrg	esac
371321e67964Smrg	;;
3714c27c18e8Smrg      linux* | k*bsd*-gnu)
3715c27c18e8Smrg	case $cc_basename in
3716c27c18e8Smrg	  KCC*)
3717c27c18e8Smrg	    # KAI C++ Compiler
3718c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3719c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3720c27c18e8Smrg	    ;;
3721c27c18e8Smrg	  ecpc* )
3722c27c18e8Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
3723c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3724c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3725c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3726c27c18e8Smrg	    ;;
3727c27c18e8Smrg	  icpc* )
3728c27c18e8Smrg	    # Intel C++, used to be incompatible with GCC.
3729c27c18e8Smrg	    # ICC 10 doesn't accept -KPIC any more.
3730c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3731c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3732c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3733c27c18e8Smrg	    ;;
3734c27c18e8Smrg	  pgCC* | pgcpp*)
3735c27c18e8Smrg	    # Portland Group C++ compiler
3736c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3737c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
3738c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3739c27c18e8Smrg	    ;;
3740c27c18e8Smrg	  cxx*)
3741c27c18e8Smrg	    # Compaq C++
3742c27c18e8Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
3743c27c18e8Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
3744c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3745c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3746c27c18e8Smrg	    ;;
3747c27c18e8Smrg	  xlc* | xlC*)
3748c27c18e8Smrg	    # IBM XL 8.0 on PPC
3749c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3750c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
3751c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
3752c27c18e8Smrg	    ;;
3753c27c18e8Smrg	  *)
3754c27c18e8Smrg	    case `$CC -V 2>&1 | sed 5q` in
3755c27c18e8Smrg	    *Sun\ C*)
3756c27c18e8Smrg	      # Sun C++ 5.9
3757c27c18e8Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3758c27c18e8Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3759c27c18e8Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3760c27c18e8Smrg	      ;;
3761c27c18e8Smrg	    esac
3762c27c18e8Smrg	    ;;
3763c27c18e8Smrg	esac
376421e67964Smrg	;;
3765c27c18e8Smrg      lynxos*)
376621e67964Smrg	;;
3767c27c18e8Smrg      m88k*)
376821e67964Smrg	;;
3769c27c18e8Smrg      mvs*)
3770c27c18e8Smrg	case $cc_basename in
3771c27c18e8Smrg	  cxx*)
3772c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
3773c27c18e8Smrg	    ;;
3774c27c18e8Smrg	  *)
3775c27c18e8Smrg	    ;;
3776c27c18e8Smrg	esac
377721e67964Smrg	;;
3778c27c18e8Smrg      netbsd*)
377921e67964Smrg	;;
3780c27c18e8Smrg      *qnx* | *nto*)
3781c27c18e8Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
3782c27c18e8Smrg        # it will coredump.
3783c27c18e8Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3784c27c18e8Smrg        ;;
3785c27c18e8Smrg      osf3* | osf4* | osf5*)
3786c27c18e8Smrg	case $cc_basename in
3787c27c18e8Smrg	  KCC*)
3788c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3789c27c18e8Smrg	    ;;
3790c27c18e8Smrg	  RCC*)
3791c27c18e8Smrg	    # Rational C++ 2.4.1
3792c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3793c27c18e8Smrg	    ;;
3794c27c18e8Smrg	  cxx*)
3795c27c18e8Smrg	    # Digital/Compaq C++
3796c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3797c27c18e8Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
3798c27c18e8Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
3799c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3800c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3801c27c18e8Smrg	    ;;
3802c27c18e8Smrg	  *)
3803c27c18e8Smrg	    ;;
3804c27c18e8Smrg	esac
380521e67964Smrg	;;
3806c27c18e8Smrg      psos*)
380721e67964Smrg	;;
3808c27c18e8Smrg      solaris*)
3809c27c18e8Smrg	case $cc_basename in
3810c27c18e8Smrg	  CC*)
3811c27c18e8Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
3812c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3813c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3814c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3815c27c18e8Smrg	    ;;
3816c27c18e8Smrg	  gcx*)
3817c27c18e8Smrg	    # Green Hills C++ Compiler
3818c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
3819c27c18e8Smrg	    ;;
3820c27c18e8Smrg	  *)
3821c27c18e8Smrg	    ;;
3822c27c18e8Smrg	esac
382321e67964Smrg	;;
3824c27c18e8Smrg      sunos4*)
3825c27c18e8Smrg	case $cc_basename in
3826c27c18e8Smrg	  CC*)
3827c27c18e8Smrg	    # Sun C++ 4.x
3828c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3829c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3830c27c18e8Smrg	    ;;
3831c27c18e8Smrg	  lcc*)
3832c27c18e8Smrg	    # Lucid
3833c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3834c27c18e8Smrg	    ;;
383521e67964Smrg	  *)
383621e67964Smrg	    ;;
383721e67964Smrg	esac
383821e67964Smrg	;;
3839c27c18e8Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
3840c27c18e8Smrg	case $cc_basename in
3841c27c18e8Smrg	  CC*)
3842c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3843c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3844c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3845c27c18e8Smrg	    ;;
3846c27c18e8Smrg	esac
384721e67964Smrg	;;
3848c27c18e8Smrg      tandem*)
3849c27c18e8Smrg	case $cc_basename in
3850c27c18e8Smrg	  NCC*)
3851c27c18e8Smrg	    # NonStop-UX NCC 3.20
3852c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3853c27c18e8Smrg	    ;;
385421e67964Smrg	  *)
385521e67964Smrg	    ;;
3856c27c18e8Smrg	esac
385721e67964Smrg	;;
3858c27c18e8Smrg      vxworks*)
385921e67964Smrg	;;
386021e67964Smrg      *)
3861c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
386221e67964Smrg	;;
386321e67964Smrg    esac
3864c27c18e8Smrg  fi
3865c27c18e8Smrg],
3866c27c18e8Smrg[
3867c27c18e8Smrg  if test "$GCC" = yes; then
3868c27c18e8Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3869c27c18e8Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3870c27c18e8Smrg
3871c27c18e8Smrg    case $host_os in
3872c27c18e8Smrg      aix*)
3873c27c18e8Smrg      # All AIX code is PIC.
3874c27c18e8Smrg      if test "$host_cpu" = ia64; then
3875c27c18e8Smrg	# AIX 5 now supports IA64 processor
3876c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3877c27c18e8Smrg      fi
3878c27c18e8Smrg      ;;
3879c27c18e8Smrg
3880c27c18e8Smrg    amigaos*)
3881c27c18e8Smrg      case $host_cpu in
3882c27c18e8Smrg      powerpc)
3883c27c18e8Smrg            # see comment about AmigaOS4 .so support
3884c27c18e8Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3885c27c18e8Smrg        ;;
3886c27c18e8Smrg      m68k)
3887c27c18e8Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
3888c27c18e8Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
3889c27c18e8Smrg            # like `-m68040'.
3890c27c18e8Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3891c27c18e8Smrg        ;;
3892c27c18e8Smrg      esac
3893c27c18e8Smrg      ;;
3894c27c18e8Smrg
3895c27c18e8Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3896c27c18e8Smrg      # PIC is the default for these OSes.
3897c27c18e8Smrg      ;;
3898c27c18e8Smrg
3899c27c18e8Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
3900c27c18e8Smrg      # This hack is so that the source file can tell whether it is being
3901c27c18e8Smrg      # built for inclusion in a dll (and should export symbols for example).
3902c27c18e8Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3903c27c18e8Smrg      # (--disable-auto-import) libraries
3904c27c18e8Smrg      m4_if([$1], [GCJ], [],
3905c27c18e8Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3906c27c18e8Smrg      ;;
3907c27c18e8Smrg
3908c27c18e8Smrg    darwin* | rhapsody*)
3909c27c18e8Smrg      # PIC is the default on this platform
3910c27c18e8Smrg      # Common symbols not allowed in MH_DYLIB files
3911c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3912c27c18e8Smrg      ;;
3913c27c18e8Smrg
3914c27c18e8Smrg    hpux*)
3915c27c18e8Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3916c27c18e8Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3917c27c18e8Smrg      # sets the default TLS model and affects inlining.
3918c27c18e8Smrg      case $host_cpu in
3919c27c18e8Smrg      hppa*64*)
3920c27c18e8Smrg	# +Z the default
392121e67964Smrg	;;
392221e67964Smrg      *)
3923c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
392421e67964Smrg	;;
3925c27c18e8Smrg      esac
3926c27c18e8Smrg      ;;
3927c27c18e8Smrg
3928c27c18e8Smrg    interix[[3-9]]*)
3929c27c18e8Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3930c27c18e8Smrg      # Instead, we relocate shared libraries at runtime.
3931c27c18e8Smrg      ;;
3932c27c18e8Smrg
3933c27c18e8Smrg    msdosdjgpp*)
3934c27c18e8Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
3935c27c18e8Smrg      # on systems that don't support them.
3936c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3937c27c18e8Smrg      enable_shared=no
3938c27c18e8Smrg      ;;
3939c27c18e8Smrg
3940c27c18e8Smrg    *nto* | *qnx*)
3941c27c18e8Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
3942c27c18e8Smrg      # it will coredump.
3943c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3944c27c18e8Smrg      ;;
3945c27c18e8Smrg
3946c27c18e8Smrg    sysv4*MP*)
3947c27c18e8Smrg      if test -d /usr/nec; then
3948c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3949c27c18e8Smrg      fi
3950c27c18e8Smrg      ;;
3951c27c18e8Smrg
3952c27c18e8Smrg    *)
3953c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3954c27c18e8Smrg      ;;
395521e67964Smrg    esac
3956c27c18e8Smrg  else
3957c27c18e8Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
3958c27c18e8Smrg    case $host_os in
3959c27c18e8Smrg    aix*)
3960c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3961c27c18e8Smrg      if test "$host_cpu" = ia64; then
3962c27c18e8Smrg	# AIX 5 now supports IA64 processor
3963c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3964c27c18e8Smrg      else
3965c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3966c27c18e8Smrg      fi
3967c27c18e8Smrg      ;;
3968c27c18e8Smrg
3969c27c18e8Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
3970c27c18e8Smrg      # This hack is so that the source file can tell whether it is being
3971c27c18e8Smrg      # built for inclusion in a dll (and should export symbols for example).
3972c27c18e8Smrg      m4_if([$1], [GCJ], [],
3973c27c18e8Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3974c27c18e8Smrg      ;;
3975c27c18e8Smrg
3976c27c18e8Smrg    hpux9* | hpux10* | hpux11*)
3977c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3978c27c18e8Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
3979c27c18e8Smrg      # not for PA HP-UX.
3980c27c18e8Smrg      case $host_cpu in
3981c27c18e8Smrg      hppa*64*|ia64*)
3982c27c18e8Smrg	# +Z the default
398321e67964Smrg	;;
398421e67964Smrg      *)
3985c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
398621e67964Smrg	;;
3987c27c18e8Smrg      esac
3988c27c18e8Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
3989c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3990c27c18e8Smrg      ;;
3991c43cc173Smrg
3992c27c18e8Smrg    irix5* | irix6* | nonstopux*)
3993c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3994c27c18e8Smrg      # PIC (with -KPIC) is the default.
3995c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3996c27c18e8Smrg      ;;
3997c43cc173Smrg
3998c27c18e8Smrg    linux* | k*bsd*-gnu)
3999c27c18e8Smrg      case $cc_basename in
4000c27c18e8Smrg      # old Intel for x86_64 which still supported -KPIC.
4001c27c18e8Smrg      ecc*)
4002c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4003c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4004c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4005c27c18e8Smrg        ;;
4006c27c18e8Smrg      # icc used to be incompatible with GCC.
4007c27c18e8Smrg      # ICC 10 doesn't accept -KPIC any more.
4008c27c18e8Smrg      icc* | ifort*)
4009c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4010c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4011c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4012c27c18e8Smrg        ;;
4013c27c18e8Smrg      # Lahey Fortran 8.1.
4014c27c18e8Smrg      lf95*)
4015c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4016c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4017c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4018c27c18e8Smrg	;;
4019c27c18e8Smrg      pgcc* | pgf77* | pgf90* | pgf95*)
4020c27c18e8Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
4021c27c18e8Smrg	# which looks to be a dead project)
4022c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4023c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4024c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4025c27c18e8Smrg        ;;
4026c27c18e8Smrg      ccc*)
4027c27c18e8Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4028c27c18e8Smrg        # All Alpha code is PIC.
4029c27c18e8Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4030c27c18e8Smrg        ;;
4031c27c18e8Smrg      xl*)
4032c27c18e8Smrg	# IBM XL C 8.0/Fortran 10.1 on PPC
4033c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4034c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4035c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4036c27c18e8Smrg	;;
4037c27c18e8Smrg      *)
4038c27c18e8Smrg	case `$CC -V 2>&1 | sed 5q` in
4039c27c18e8Smrg	*Sun\ C*)
4040c27c18e8Smrg	  # Sun C 5.9
4041c27c18e8Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4042c27c18e8Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4043c27c18e8Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4044c27c18e8Smrg	  ;;
4045c27c18e8Smrg	*Sun\ F*)
4046c27c18e8Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4047c27c18e8Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4048c27c18e8Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4049c27c18e8Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4050c27c18e8Smrg	  ;;
4051c27c18e8Smrg	esac
4052c27c18e8Smrg	;;
4053c27c18e8Smrg      esac
4054c27c18e8Smrg      ;;
4055c43cc173Smrg
4056c27c18e8Smrg    newsos6)
4057c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4058c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4059c27c18e8Smrg      ;;
4060c43cc173Smrg
4061c27c18e8Smrg    *nto* | *qnx*)
4062c27c18e8Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4063c27c18e8Smrg      # it will coredump.
4064c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4065c27c18e8Smrg      ;;
4066c43cc173Smrg
4067c27c18e8Smrg    osf3* | osf4* | osf5*)
4068c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4069c27c18e8Smrg      # All OSF/1 code is PIC.
4070c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4071c27c18e8Smrg      ;;
4072c43cc173Smrg
4073c27c18e8Smrg    rdos*)
4074c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4075c27c18e8Smrg      ;;
407621e67964Smrg
4077c27c18e8Smrg    solaris*)
4078c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4079c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4080c27c18e8Smrg      case $cc_basename in
4081c27c18e8Smrg      f77* | f90* | f95*)
4082c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4083c27c18e8Smrg      *)
4084c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4085c27c18e8Smrg      esac
4086c27c18e8Smrg      ;;
408721e67964Smrg
4088c27c18e8Smrg    sunos4*)
4089c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4090c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4091c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4092c27c18e8Smrg      ;;
409321e67964Smrg
4094c27c18e8Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
4095c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4096c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4097c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4098c27c18e8Smrg      ;;
409921e67964Smrg
4100c27c18e8Smrg    sysv4*MP*)
4101c27c18e8Smrg      if test -d /usr/nec ;then
4102c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4103c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4104c27c18e8Smrg      fi
4105c27c18e8Smrg      ;;
410621e67964Smrg
4107c27c18e8Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4108c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4109c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4110c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4111c27c18e8Smrg      ;;
411221e67964Smrg
4113c27c18e8Smrg    unicos*)
4114c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4115c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4116c27c18e8Smrg      ;;
4117c43cc173Smrg
4118c27c18e8Smrg    uts4*)
4119c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4120c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4121c27c18e8Smrg      ;;
4122c43cc173Smrg
4123c27c18e8Smrg    *)
4124c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4125c27c18e8Smrg      ;;
4126c27c18e8Smrg    esac
4127c27c18e8Smrg  fi
4128c27c18e8Smrg])
4129c27c18e8Smrgcase $host_os in
4130c27c18e8Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
4131c27c18e8Smrg  *djgpp*)
4132c27c18e8Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4133c27c18e8Smrg    ;;
4134c27c18e8Smrg  *)
4135c27c18e8Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4136c27c18e8Smrg    ;;
4137c27c18e8Smrgesac
4138c27c18e8SmrgAC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4139c27c18e8Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4140c27c18e8Smrg	[How to pass a linker flag through the compiler])
414121e67964Smrg
4142c27c18e8Smrg#
4143c27c18e8Smrg# Check to make sure the PIC flag actually works.
4144c27c18e8Smrg#
4145c27c18e8Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4146c27c18e8Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4147c27c18e8Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4148c27c18e8Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4149c27c18e8Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4150c27c18e8Smrg     "" | " "*) ;;
4151c27c18e8Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4152c27c18e8Smrg     esac],
4153c27c18e8Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4154c27c18e8Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4155c27c18e8Smrgfi
4156c27c18e8Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4157c27c18e8Smrg	[Additional compiler flags for building library objects])
415821e67964Smrg
4159c27c18e8Smrg#
4160c27c18e8Smrg# Check to make sure the static flag actually works.
4161c27c18e8Smrg#
4162c27c18e8Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4163c27c18e8Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4164c27c18e8Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4165c27c18e8Smrg  $lt_tmp_static_flag,
4166c27c18e8Smrg  [],
4167c27c18e8Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4168c27c18e8Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4169c27c18e8Smrg	[Compiler flag to prevent dynamic linking])
4170c27c18e8Smrg])# _LT_COMPILER_PIC
417121e67964Smrg
4172c27c18e8Smrg
4173c27c18e8Smrg# _LT_LINKER_SHLIBS([TAGNAME])
4174c27c18e8Smrg# ----------------------------
4175c27c18e8Smrg# See if the linker supports building shared libraries.
4176c27c18e8Smrgm4_defun([_LT_LINKER_SHLIBS],
4177c27c18e8Smrg[AC_REQUIRE([LT_PATH_LD])dnl
4178c27c18e8SmrgAC_REQUIRE([LT_PATH_NM])dnl
4179c27c18e8Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4180c27c18e8Smrgm4_require([_LT_DECL_EGREP])dnl
4181c27c18e8Smrgm4_require([_LT_DECL_SED])dnl
4182c27c18e8Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4183c27c18e8Smrgm4_require([_LT_TAG_COMPILER])dnl
4184c27c18e8SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4185c27c18e8Smrgm4_if([$1], [CXX], [
4186c27c18e8Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4187c27c18e8Smrg  case $host_os in
4188c27c18e8Smrg  aix[[4-9]]*)
4189c27c18e8Smrg    # If we're using GNU nm, then we don't want the "-C" option.
4190c27c18e8Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
4191c27c18e8Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4192c27c18e8Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4193c27c18e8Smrg    else
4194c27c18e8Smrg      _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'
419521e67964Smrg    fi
4196c43cc173Smrg    ;;
4197c27c18e8Smrg  pw32*)
4198c27c18e8Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
419921e67964Smrg  ;;
4200c27c18e8Smrg  cygwin* | mingw* | cegcc*)
4201c27c18e8Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4202c27c18e8Smrg  ;;
4203c27c18e8Smrg  *)
4204c27c18e8Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4205c27c18e8Smrg  ;;
4206c27c18e8Smrg  esac
4207c27c18e8Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4208c27c18e8Smrg], [
4209c27c18e8Smrg  runpath_var=
4210c27c18e8Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
4211c27c18e8Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
4212c27c18e8Smrg  _LT_TAGVAR(archive_cmds, $1)=
4213c27c18e8Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
4214c27c18e8Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
4215c27c18e8Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4216c27c18e8Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4217c27c18e8Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4218c27c18e8Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
4219c27c18e8Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
4220c27c18e8Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4221c27c18e8Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4222c27c18e8Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
4223c27c18e8Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4224c27c18e8Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
4225c27c18e8Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4226c27c18e8Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
4227c27c18e8Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4228c27c18e8Smrg  _LT_TAGVAR(module_cmds, $1)=
4229c27c18e8Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
4230c27c18e8Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4231c27c18e8Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4232c27c18e8Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4233c27c18e8Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4234c27c18e8Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
4235c27c18e8Smrg  # included in the symbol list
4236c27c18e8Smrg  _LT_TAGVAR(include_expsyms, $1)=
4237c27c18e8Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
4238c27c18e8Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
4239c27c18e8Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4240c27c18e8Smrg  # as well as any symbol that contains `d'.
4241c27c18e8Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4242c27c18e8Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4243c27c18e8Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
4244c27c18e8Smrg  # the symbol is explicitly referenced.  Since portable code cannot
4245c27c18e8Smrg  # rely on this symbol name, it's probably fine to never include it in
4246c27c18e8Smrg  # preloaded symbol tables.
4247c27c18e8Smrg  # Exclude shared library initialization/finalization symbols.
4248c27c18e8Smrgdnl Note also adjust exclude_expsyms for C++ above.
4249c27c18e8Smrg  extract_expsyms_cmds=
4250c43cc173Smrg
4251c27c18e8Smrg  case $host_os in
4252c27c18e8Smrg  cygwin* | mingw* | pw32* | cegcc*)
4253c27c18e8Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
4254c27c18e8Smrg    # When not using gcc, we currently assume that we are using
4255c27c18e8Smrg    # Microsoft Visual C++.
4256c27c18e8Smrg    if test "$GCC" != yes; then
4257c27c18e8Smrg      with_gnu_ld=no
4258c43cc173Smrg    fi
425921e67964Smrg    ;;
4260c27c18e8Smrg  interix*)
4261c27c18e8Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
4262c27c18e8Smrg    with_gnu_ld=yes
4263c27c18e8Smrg    ;;
4264c27c18e8Smrg  openbsd*)
4265c27c18e8Smrg    with_gnu_ld=no
4266c27c18e8Smrg    ;;
426721e67964Smrg  esac
4268c43cc173Smrg
4269c27c18e8Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
4270c27c18e8Smrg  if test "$with_gnu_ld" = yes; then
4271c27c18e8Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
4272c27c18e8Smrg    wlarc='${wl}'
4273c43cc173Smrg
4274c27c18e8Smrg    # Set some defaults for GNU ld with shared library support. These
4275c27c18e8Smrg    # are reset later if shared libraries are not supported. Putting them
4276c27c18e8Smrg    # here allows them to be overridden if necessary.
4277c27c18e8Smrg    runpath_var=LD_RUN_PATH
4278c27c18e8Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4279c27c18e8Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4280c27c18e8Smrg    # ancient GNU ld didn't support --whole-archive et. al.
4281c27c18e8Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4282c27c18e8Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4283c27c18e8Smrg    else
4284c27c18e8Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4285c27c18e8Smrg    fi
4286c27c18e8Smrg    supports_anon_versioning=no
4287c27c18e8Smrg    case `$LD -v 2>&1` in
4288c27c18e8Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4289c27c18e8Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4290c27c18e8Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4291c27c18e8Smrg      *\ 2.11.*) ;; # other 2.11 versions
4292c27c18e8Smrg      *) supports_anon_versioning=yes ;;
4293c27c18e8Smrg    esac
4294c43cc173Smrg
4295c27c18e8Smrg    # See if GNU ld supports shared libraries.
4296c27c18e8Smrg    case $host_os in
4297c27c18e8Smrg    aix[[3-9]]*)
4298c27c18e8Smrg      # On AIX/PPC, the GNU linker is very broken
4299c27c18e8Smrg      if test "$host_cpu" != ia64; then
4300c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4301c27c18e8Smrg	cat <<_LT_EOF 1>&2
4302c43cc173Smrg
4303c27c18e8Smrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
4304c27c18e8Smrg*** to be unable to reliably create shared libraries on AIX.
4305c27c18e8Smrg*** Therefore, libtool is disabling shared libraries support.  If you
4306c27c18e8Smrg*** really care for shared libraries, you may want to modify your PATH
4307c27c18e8Smrg*** so that a non-GNU linker is found, and then restart.
4308c43cc173Smrg
4309c27c18e8Smrg_LT_EOF
4310c27c18e8Smrg      fi
4311c27c18e8Smrg      ;;
4312c43cc173Smrg
4313c27c18e8Smrg    amigaos*)
4314c27c18e8Smrg      case $host_cpu in
4315c27c18e8Smrg      powerpc)
4316c27c18e8Smrg            # see comment about AmigaOS4 .so support
4317c27c18e8Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4318c27c18e8Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4319c27c18e8Smrg        ;;
4320c27c18e8Smrg      m68k)
4321c27c18e8Smrg            _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)'
4322c27c18e8Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4323c27c18e8Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4324c27c18e8Smrg        ;;
4325c27c18e8Smrg      esac
4326c27c18e8Smrg      ;;
4327c43cc173Smrg
4328c27c18e8Smrg    beos*)
4329c27c18e8Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4330c27c18e8Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4331c27c18e8Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4332c27c18e8Smrg	# support --undefined.  This deserves some investigation.  FIXME
4333c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4334c27c18e8Smrg      else
4335c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4336c27c18e8Smrg      fi
4337c27c18e8Smrg      ;;
433821e67964Smrg
4339c27c18e8Smrg    cygwin* | mingw* | pw32* | cegcc*)
4340c27c18e8Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4341c27c18e8Smrg      # as there is no search path for DLLs.
4342c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4343c27c18e8Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4344c27c18e8Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
4345c27c18e8Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4346c27c18e8Smrg      _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'
4347c27c18e8Smrg
4348c27c18e8Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4349c27c18e8Smrg        _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'
4350c27c18e8Smrg	# If the export-symbols file already is a .def file (1st line
4351c27c18e8Smrg	# is EXPORTS), use it as is; otherwise, prepend...
4352c27c18e8Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4353c27c18e8Smrg	  cp $export_symbols $output_objdir/$soname.def;
4354c27c18e8Smrg	else
4355c27c18e8Smrg	  echo EXPORTS > $output_objdir/$soname.def;
4356c27c18e8Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
4357c27c18e8Smrg	fi~
4358c27c18e8Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4359c27c18e8Smrg      else
4360c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4361c27c18e8Smrg      fi
4362c27c18e8Smrg      ;;
436321e67964Smrg
4364c27c18e8Smrg    interix[[3-9]]*)
4365c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
4366c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4367c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4368c27c18e8Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4369c27c18e8Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4370c27c18e8Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
4371c27c18e8Smrg      # default) and relocated if they conflict, which is a slow very memory
4372c27c18e8Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
4373c27c18e8Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4374c27c18e8Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
4375c27c18e8Smrg      _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'
4376c27c18e8Smrg      _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'
4377c27c18e8Smrg      ;;
437821e67964Smrg
4379c27c18e8Smrg    gnu* | linux* | tpf* | k*bsd*-gnu)
4380c27c18e8Smrg      tmp_diet=no
4381c27c18e8Smrg      if test "$host_os" = linux-dietlibc; then
4382c27c18e8Smrg	case $cc_basename in
4383c27c18e8Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
4384c27c18e8Smrg	esac
4385c27c18e8Smrg      fi
4386c27c18e8Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4387c27c18e8Smrg	 && test "$tmp_diet" = no
4388c27c18e8Smrg      then
4389c27c18e8Smrg	tmp_addflag=
4390c27c18e8Smrg	tmp_sharedflag='-shared'
4391c27c18e8Smrg	case $cc_basename,$host_cpu in
4392c27c18e8Smrg        pgcc*)				# Portland Group C compiler
4393c27c18e8Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4394c27c18e8Smrg	  tmp_addflag=' $pic_flag'
4395c27c18e8Smrg	  ;;
4396c27c18e8Smrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
4397c27c18e8Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4398c27c18e8Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
4399c27c18e8Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
4400c27c18e8Smrg	  tmp_addflag=' -i_dynamic' ;;
4401c27c18e8Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
4402c27c18e8Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
4403c27c18e8Smrg	ifc* | ifort*)			# Intel Fortran compiler
4404c27c18e8Smrg	  tmp_addflag=' -nofor_main' ;;
4405c27c18e8Smrg	lf95*)				# Lahey Fortran 8.1
4406c27c18e8Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4407c27c18e8Smrg	  tmp_sharedflag='--shared' ;;
4408c27c18e8Smrg	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
4409c27c18e8Smrg	  tmp_sharedflag='-qmkshrobj'
4410c27c18e8Smrg	  tmp_addflag= ;;
4411c27c18e8Smrg	esac
4412c27c18e8Smrg	case `$CC -V 2>&1 | sed 5q` in
4413c27c18e8Smrg	*Sun\ C*)			# Sun C 5.9
4414c27c18e8Smrg	  _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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4415c27c18e8Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4416c27c18e8Smrg	  tmp_sharedflag='-G' ;;
4417c27c18e8Smrg	*Sun\ F*)			# Sun Fortran 8.3
4418c27c18e8Smrg	  tmp_sharedflag='-G' ;;
4419c27c18e8Smrg	esac
4420c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4421c43cc173Smrg
4422c27c18e8Smrg        if test "x$supports_anon_versioning" = xyes; then
4423c27c18e8Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4424c27c18e8Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4425c27c18e8Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
4426c27c18e8Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4427c27c18e8Smrg        fi
4428c43cc173Smrg
4429c27c18e8Smrg	case $cc_basename in
4430c27c18e8Smrg	xlf*)
4431c27c18e8Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4432c27c18e8Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4433c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4434c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
4435c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
4436c27c18e8Smrg	  if test "x$supports_anon_versioning" = xyes; then
4437c27c18e8Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4438c27c18e8Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4439c27c18e8Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
4440c27c18e8Smrg	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4441c27c18e8Smrg	  fi
4442c27c18e8Smrg	  ;;
4443c27c18e8Smrg	esac
4444c27c18e8Smrg      else
4445c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
4446c27c18e8Smrg      fi
4447c27c18e8Smrg      ;;
4448c43cc173Smrg
4449c27c18e8Smrg    netbsd*)
4450c27c18e8Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4451c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4452c27c18e8Smrg	wlarc=
4453c27c18e8Smrg      else
4454c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4455c27c18e8Smrg	_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'
4456c27c18e8Smrg      fi
4457c27c18e8Smrg      ;;
4458c43cc173Smrg
4459c27c18e8Smrg    solaris*)
4460c27c18e8Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4461c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4462c27c18e8Smrg	cat <<_LT_EOF 1>&2
4463c43cc173Smrg
4464c27c18e8Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
4465c27c18e8Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
4466c27c18e8Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4467c27c18e8Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
4468c27c18e8Smrg*** your PATH or compiler configuration so that the native linker is
4469c27c18e8Smrg*** used, and then restart.
4470c43cc173Smrg
4471c27c18e8Smrg_LT_EOF
4472c27c18e8Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4473c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4474c27c18e8Smrg	_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'
4475c27c18e8Smrg      else
4476c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4477c27c18e8Smrg      fi
4478c27c18e8Smrg      ;;
4479c43cc173Smrg
4480c27c18e8Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4481c27c18e8Smrg      case `$LD -v 2>&1` in
4482c27c18e8Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4483c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4484c27c18e8Smrg	cat <<_LT_EOF 1>&2
4485c43cc173Smrg
4486c27c18e8Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4487c27c18e8Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
4488c27c18e8Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4489c27c18e8Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
4490c27c18e8Smrg*** your PATH or compiler configuration so that the native linker is
4491c27c18e8Smrg*** used, and then restart.
4492c43cc173Smrg
4493c27c18e8Smrg_LT_EOF
4494c27c18e8Smrg	;;
4495c27c18e8Smrg	*)
4496c27c18e8Smrg	  # For security reasons, it is highly recommended that you always
4497c27c18e8Smrg	  # use absolute paths for naming shared libraries, and exclude the
4498c27c18e8Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
4499c27c18e8Smrg	  # requires that you compile everything twice, which is a pain.
4500c27c18e8Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4501c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4502c27c18e8Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4503c27c18e8Smrg	    _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'
4504c27c18e8Smrg	  else
4505c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
4506c27c18e8Smrg	  fi
4507c27c18e8Smrg	;;
4508c27c18e8Smrg      esac
4509c27c18e8Smrg      ;;
4510c43cc173Smrg
4511c27c18e8Smrg    sunos4*)
4512c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4513c27c18e8Smrg      wlarc=
4514c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4515c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4516c27c18e8Smrg      ;;
4517c43cc173Smrg
4518c27c18e8Smrg    *)
4519c27c18e8Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4520c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4521c27c18e8Smrg	_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'
4522c27c18e8Smrg      else
4523c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4524c27c18e8Smrg      fi
4525c27c18e8Smrg      ;;
4526c27c18e8Smrg    esac
4527c43cc173Smrg
4528c27c18e8Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4529c27c18e8Smrg      runpath_var=
4530c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4531c27c18e8Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4532c27c18e8Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4533c27c18e8Smrg    fi
4534c27c18e8Smrg  else
4535c27c18e8Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
4536c27c18e8Smrg    case $host_os in
4537c27c18e8Smrg    aix3*)
4538c27c18e8Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4539c27c18e8Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
4540c27c18e8Smrg      _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'
4541c27c18e8Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
4542c27c18e8Smrg      # are no directories specified by -L.
4543c27c18e8Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4544c27c18e8Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4545c27c18e8Smrg	# Neither direct hardcoding nor static linking is supported with a
4546c27c18e8Smrg	# broken collect2.
4547c27c18e8Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
4548c27c18e8Smrg      fi
4549c27c18e8Smrg      ;;
4550c43cc173Smrg
4551c27c18e8Smrg    aix[[4-9]]*)
4552c27c18e8Smrg      if test "$host_cpu" = ia64; then
4553c27c18e8Smrg	# On IA64, the linker does run time linking by default, so we don't
4554c27c18e8Smrg	# have to do anything special.
4555c27c18e8Smrg	aix_use_runtimelinking=no
4556c27c18e8Smrg	exp_sym_flag='-Bexport'
4557c27c18e8Smrg	no_entry_flag=""
4558c27c18e8Smrg      else
4559c27c18e8Smrg	# If we're using GNU nm, then we don't want the "-C" option.
4560c27c18e8Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
4561c27c18e8Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4562c27c18e8Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4563c27c18e8Smrg	else
4564c27c18e8Smrg	  _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'
4565c27c18e8Smrg	fi
4566c27c18e8Smrg	aix_use_runtimelinking=no
4567c43cc173Smrg
4568c27c18e8Smrg	# Test if we are trying to use run time linking or normal
4569c27c18e8Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
4570c27c18e8Smrg	# need to do runtime linking.
4571c27c18e8Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
4572c27c18e8Smrg	  for ld_flag in $LDFLAGS; do
4573c27c18e8Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
4574c27c18e8Smrg	    aix_use_runtimelinking=yes
4575c27c18e8Smrg	    break
4576c27c18e8Smrg	  fi
4577c27c18e8Smrg	  done
4578c27c18e8Smrg	  ;;
4579c27c18e8Smrg	esac
4580c43cc173Smrg
4581c27c18e8Smrg	exp_sym_flag='-bexport'
4582c27c18e8Smrg	no_entry_flag='-bnoentry'
4583c27c18e8Smrg      fi
4584c27c18e8Smrg
4585c27c18e8Smrg      # When large executables or shared objects are built, AIX ld can
4586c27c18e8Smrg      # have problems creating the table of contents.  If linking a library
4587c27c18e8Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
4588c27c18e8Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
4589c27c18e8Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
4590c43cc173Smrg
4591c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)=''
4592c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4593c27c18e8Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4594c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
4595c27c18e8Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4596c27c18e8Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
4597c43cc173Smrg
4598c27c18e8Smrg      if test "$GCC" = yes; then
4599c27c18e8Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
4600c27c18e8Smrg	# We only want to do this on AIX 4.2 and lower, the check
4601c27c18e8Smrg	# below for broken collect2 doesn't work under 4.3+
4602c27c18e8Smrg	  collect2name=`${CC} -print-prog-name=collect2`
4603c27c18e8Smrg	  if test -f "$collect2name" &&
4604c27c18e8Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
4605c27c18e8Smrg	  then
4606c27c18e8Smrg	  # We have reworked collect2
4607c27c18e8Smrg	  :
4608c27c18e8Smrg	  else
4609c27c18e8Smrg	  # We have old collect2
4610c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
4611c27c18e8Smrg	  # It fails to find uninstalled libraries when the uninstalled
4612c27c18e8Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
4613c27c18e8Smrg	  # to unsupported forces relinking
4614c27c18e8Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
4615c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4616c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4617c27c18e8Smrg	  fi
4618c27c18e8Smrg	  ;;
4619c27c18e8Smrg	esac
4620c27c18e8Smrg	shared_flag='-shared'
4621c27c18e8Smrg	if test "$aix_use_runtimelinking" = yes; then
4622c27c18e8Smrg	  shared_flag="$shared_flag "'${wl}-G'
4623c27c18e8Smrg	fi
4624c27c18e8Smrg      else
4625c27c18e8Smrg	# not using gcc
4626c27c18e8Smrg	if test "$host_cpu" = ia64; then
4627c27c18e8Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
4628c27c18e8Smrg	# chokes on -Wl,-G. The following line is correct:
4629c27c18e8Smrg	  shared_flag='-G'
4630c27c18e8Smrg	else
4631c27c18e8Smrg	  if test "$aix_use_runtimelinking" = yes; then
4632c27c18e8Smrg	    shared_flag='${wl}-G'
4633c27c18e8Smrg	  else
4634c27c18e8Smrg	    shared_flag='${wl}-bM:SRE'
4635c27c18e8Smrg	  fi
4636c27c18e8Smrg	fi
4637c27c18e8Smrg      fi
4638c43cc173Smrg
4639c27c18e8Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
4640c27c18e8Smrg      # It seems that -bexpall does not export symbols beginning with
4641c27c18e8Smrg      # underscore (_), so it is better to generate a list of symbols to export.
4642c27c18e8Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
4643c27c18e8Smrg      if test "$aix_use_runtimelinking" = yes; then
4644c27c18e8Smrg	# Warning - without using the other runtime loading flags (-brtl),
4645c27c18e8Smrg	# -berok will link without error, but may produce a broken library.
4646c27c18e8Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
4647c27c18e8Smrg        # Determine the default libpath from the value encoded in an
4648c27c18e8Smrg        # empty executable.
4649c27c18e8Smrg        _LT_SYS_MODULE_PATH_AIX
4650c27c18e8Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4651c27c18e8Smrg        _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
4652c27c18e8Smrg      else
4653c27c18e8Smrg	if test "$host_cpu" = ia64; then
4654c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
4655c27c18e8Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
4656c27c18e8Smrg	  _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"
4657c27c18e8Smrg	else
4658c27c18e8Smrg	 # Determine the default libpath from the value encoded in an
4659c27c18e8Smrg	 # empty executable.
4660c27c18e8Smrg	 _LT_SYS_MODULE_PATH_AIX
4661c27c18e8Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4662c27c18e8Smrg	  # Warning - without using the other run time loading flags,
4663c27c18e8Smrg	  # -berok will link without error, but may produce a broken library.
4664c27c18e8Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
4665c27c18e8Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
4666c27c18e8Smrg	  # Exported symbols can be pulled into shared objects from archives
4667c27c18e8Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
4668c27c18e8Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
4669c27c18e8Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
4670c27c18e8Smrg	  _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'
4671c27c18e8Smrg	fi
4672c27c18e8Smrg      fi
4673c27c18e8Smrg      ;;
4674c43cc173Smrg
4675c27c18e8Smrg    amigaos*)
4676c27c18e8Smrg      case $host_cpu in
4677c27c18e8Smrg      powerpc)
4678c27c18e8Smrg            # see comment about AmigaOS4 .so support
4679c27c18e8Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4680c27c18e8Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4681c27c18e8Smrg        ;;
4682c27c18e8Smrg      m68k)
4683c27c18e8Smrg            _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)'
4684c27c18e8Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4685c27c18e8Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4686c27c18e8Smrg        ;;
4687c27c18e8Smrg      esac
4688c27c18e8Smrg      ;;
4689c43cc173Smrg
4690c27c18e8Smrg    bsdi[[45]]*)
4691c27c18e8Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
4692c27c18e8Smrg      ;;
4693c43cc173Smrg
4694c27c18e8Smrg    cygwin* | mingw* | pw32* | cegcc*)
4695c27c18e8Smrg      # When not using gcc, we currently assume that we are using
4696c27c18e8Smrg      # Microsoft Visual C++.
4697c27c18e8Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
4698c27c18e8Smrg      # no search path for DLLs.
4699c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
4700c27c18e8Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4701c27c18e8Smrg      # Tell ltmain to make .lib files, not .a files.
4702c27c18e8Smrg      libext=lib
4703c27c18e8Smrg      # Tell ltmain to make .dll files, not .so files.
4704c27c18e8Smrg      shrext_cmds=".dll"
4705c27c18e8Smrg      # FIXME: Setting linknames here is a bad hack.
4706c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
4707c27c18e8Smrg      # The linker will automatically build a .lib file if we build a DLL.
4708c27c18e8Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
4709c27c18e8Smrg      # FIXME: Should let the user specify the lib program.
4710c27c18e8Smrg      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
4711c27c18e8Smrg      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
4712c27c18e8Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4713c27c18e8Smrg      ;;
4714c43cc173Smrg
4715c27c18e8Smrg    darwin* | rhapsody*)
4716c27c18e8Smrg      _LT_DARWIN_LINKER_FEATURES($1)
4717c27c18e8Smrg      ;;
4718c43cc173Smrg
4719c27c18e8Smrg    dgux*)
4720c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4721c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4722c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4723c27c18e8Smrg      ;;
4724c43cc173Smrg
4725c27c18e8Smrg    freebsd1*)
4726c27c18e8Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
4727c27c18e8Smrg      ;;
4728c43cc173Smrg
4729c27c18e8Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
4730c27c18e8Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
4731c27c18e8Smrg    # does not break anything, and helps significantly (at the cost of a little
4732c27c18e8Smrg    # extra space).
4733c27c18e8Smrg    freebsd2.2*)
4734c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
4735c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4736c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4737c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4738c27c18e8Smrg      ;;
4739c43cc173Smrg
4740c27c18e8Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
4741c27c18e8Smrg    freebsd2*)
4742c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4743c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4744c27c18e8Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4745c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4746c27c18e8Smrg      ;;
4747c43cc173Smrg
4748c27c18e8Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
4749c27c18e8Smrg    freebsd* | dragonfly*)
4750c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
4751c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4752c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4753c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4754c27c18e8Smrg      ;;
4755c43cc173Smrg
4756c27c18e8Smrg    hpux9*)
4757c27c18e8Smrg      if test "$GCC" = yes; then
4758c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
4759c27c18e8Smrg      else
4760c27c18e8Smrg	_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'
4761c27c18e8Smrg      fi
4762c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4763c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4764c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4765c43cc173Smrg
4766c27c18e8Smrg      # hardcode_minus_L: Not really in the search PATH,
4767c27c18e8Smrg      # but as the default location of the library.
4768c27c18e8Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4769c27c18e8Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4770c27c18e8Smrg      ;;
4771c43cc173Smrg
4772c27c18e8Smrg    hpux10*)
4773c27c18e8Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4774c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4775c27c18e8Smrg      else
4776c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
4777c27c18e8Smrg      fi
4778c27c18e8Smrg      if test "$with_gnu_ld" = no; then
4779c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4780c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
4781c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
4782c27c18e8Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
4783c27c18e8Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4784c27c18e8Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4785c27c18e8Smrg	# hardcode_minus_L: Not really in the search PATH,
4786c27c18e8Smrg	# but as the default location of the library.
4787c27c18e8Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
4788c27c18e8Smrg      fi
4789c27c18e8Smrg      ;;
4790c43cc173Smrg
4791c27c18e8Smrg    hpux11*)
4792c27c18e8Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4793c27c18e8Smrg	case $host_cpu in
4794c27c18e8Smrg	hppa*64*)
4795c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4796c27c18e8Smrg	  ;;
4797c27c18e8Smrg	ia64*)
4798c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4799c27c18e8Smrg	  ;;
4800c27c18e8Smrg	*)
4801c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4802c27c18e8Smrg	  ;;
4803c27c18e8Smrg	esac
4804c27c18e8Smrg      else
4805c27c18e8Smrg	case $host_cpu in
4806c27c18e8Smrg	hppa*64*)
4807c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4808c27c18e8Smrg	  ;;
4809c27c18e8Smrg	ia64*)
4810c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4811c27c18e8Smrg	  ;;
4812c27c18e8Smrg	*)
4813c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4814c27c18e8Smrg	  ;;
4815c27c18e8Smrg	esac
4816c27c18e8Smrg      fi
4817c27c18e8Smrg      if test "$with_gnu_ld" = no; then
4818c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4819c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
4820c43cc173Smrg
4821c27c18e8Smrg	case $host_cpu in
4822c27c18e8Smrg	hppa*64*|ia64*)
4823c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
4824c27c18e8Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4825c27c18e8Smrg	  ;;
4826c27c18e8Smrg	*)
4827c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
4828c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4829c27c18e8Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4830c27c18e8Smrg
4831c27c18e8Smrg	  # hardcode_minus_L: Not really in the search PATH,
4832c27c18e8Smrg	  # but as the default location of the library.
4833c27c18e8Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
4834c27c18e8Smrg	  ;;
4835c27c18e8Smrg	esac
4836c27c18e8Smrg      fi
483721e67964Smrg      ;;
4838c27c18e8Smrg
4839c27c18e8Smrg    irix5* | irix6* | nonstopux*)
4840c27c18e8Smrg      if test "$GCC" = yes; then
4841c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4842c27c18e8Smrg	# Try to use the -exported_symbol ld option, if it does not
4843c27c18e8Smrg	# work, assume that -exports_file does not work either and
4844c27c18e8Smrg	# implicitly export all symbols.
4845c27c18e8Smrg        save_LDFLAGS="$LDFLAGS"
4846c27c18e8Smrg        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
4847c27c18e8Smrg        AC_LINK_IFELSE(int foo(void) {},
4848c27c18e8Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
4849c27c18e8Smrg        )
4850c27c18e8Smrg        LDFLAGS="$save_LDFLAGS"
4851c27c18e8Smrg      else
4852c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4853c27c18e8Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
4854c27c18e8Smrg      fi
4855c27c18e8Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4856c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4857c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4858c27c18e8Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
4859c27c18e8Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
486021e67964Smrg      ;;
486121e67964Smrg
4862c27c18e8Smrg    netbsd*)
4863c27c18e8Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4864c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
4865c27c18e8Smrg      else
4866c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
4867c27c18e8Smrg      fi
4868c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4869c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4870c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4871c27c18e8Smrg      ;;
4872c43cc173Smrg
4873c27c18e8Smrg    newsos6)
4874c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4875c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4876c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4877c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4878c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4879c27c18e8Smrg      ;;
4880c43cc173Smrg
4881c27c18e8Smrg    *nto* | *qnx*)
4882c27c18e8Smrg      ;;
4883c43cc173Smrg
4884c27c18e8Smrg    openbsd*)
4885c27c18e8Smrg      if test -f /usr/libexec/ld.so; then
4886c27c18e8Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
4887c27c18e8Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4888c27c18e8Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4889c27c18e8Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4890c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4891c27c18e8Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
4892c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4893c27c18e8Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4894c27c18e8Smrg	else
4895c27c18e8Smrg	  case $host_os in
4896c27c18e8Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
4897c27c18e8Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4898c27c18e8Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4899c27c18e8Smrg	     ;;
4900c27c18e8Smrg	   *)
4901c27c18e8Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4902c27c18e8Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4903c27c18e8Smrg	     ;;
4904c27c18e8Smrg	  esac
4905c27c18e8Smrg	fi
4906c27c18e8Smrg      else
4907c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4908c27c18e8Smrg      fi
4909c27c18e8Smrg      ;;
4910c43cc173Smrg
4911c27c18e8Smrg    os2*)
4912c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4913c27c18e8Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4914c27c18e8Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4915c27c18e8Smrg      _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'
4916c27c18e8Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
4917c27c18e8Smrg      ;;
4918c43cc173Smrg
4919c27c18e8Smrg    osf3*)
4920c27c18e8Smrg      if test "$GCC" = yes; then
4921c27c18e8Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4922c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4923c27c18e8Smrg      else
4924c27c18e8Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4925c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4926c27c18e8Smrg      fi
4927c27c18e8Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4928c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4929c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4930c27c18e8Smrg      ;;
4931c43cc173Smrg
4932c27c18e8Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
4933c27c18e8Smrg      if test "$GCC" = yes; then
4934c27c18e8Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4935c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4936c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4937c27c18e8Smrg      else
4938c27c18e8Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4939c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4940c27c18e8Smrg	_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~
4941c27c18e8Smrg	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
4942c43cc173Smrg
4943c27c18e8Smrg	# Both c and cxx compiler support -rpath directly
4944c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
4945c27c18e8Smrg      fi
4946c27c18e8Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4947c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4948c27c18e8Smrg      ;;
4949c43cc173Smrg
4950c27c18e8Smrg    solaris*)
4951c27c18e8Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
4952c27c18e8Smrg      if test "$GCC" = yes; then
4953c27c18e8Smrg	wlarc='${wl}'
4954c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4955c27c18e8Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4956c27c18e8Smrg	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4957c27c18e8Smrg      else
4958c27c18e8Smrg	case `$CC -V 2>&1` in
4959c27c18e8Smrg	*"Compilers 5.0"*)
4960c27c18e8Smrg	  wlarc=''
4961c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
4962c27c18e8Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4963c27c18e8Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
4964c27c18e8Smrg	  ;;
4965c27c18e8Smrg	*)
4966c27c18e8Smrg	  wlarc='${wl}'
4967c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
4968c27c18e8Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4969c27c18e8Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4970c27c18e8Smrg	  ;;
4971c27c18e8Smrg	esac
4972c27c18e8Smrg      fi
4973c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4974c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4975c27c18e8Smrg      case $host_os in
4976c27c18e8Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
4977c27c18e8Smrg      *)
4978c27c18e8Smrg	# The compiler driver will combine and reorder linker options,
4979c27c18e8Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
4980c27c18e8Smrg	# but is careful enough not to reorder.
4981c27c18e8Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
4982c27c18e8Smrg	if test "$GCC" = yes; then
4983c27c18e8Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
4984c27c18e8Smrg	else
4985c27c18e8Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
4986c27c18e8Smrg	fi
4987c27c18e8Smrg	;;
4988c27c18e8Smrg      esac
4989c27c18e8Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4990c27c18e8Smrg      ;;
4991c43cc173Smrg
4992c27c18e8Smrg    sunos4*)
4993c27c18e8Smrg      if test "x$host_vendor" = xsequent; then
4994c27c18e8Smrg	# Use $CC to link under sequent, because it throws in some extra .o
4995c27c18e8Smrg	# files that make .init and .fini sections work.
4996c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
4997c27c18e8Smrg      else
4998c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
4999c27c18e8Smrg      fi
5000c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5001c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5002c27c18e8Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5003c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5004c27c18e8Smrg      ;;
5005c43cc173Smrg
5006c27c18e8Smrg    sysv4)
5007c27c18e8Smrg      case $host_vendor in
5008c27c18e8Smrg	sni)
5009c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5010c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5011c27c18e8Smrg	;;
5012c27c18e8Smrg	siemens)
5013c27c18e8Smrg	  ## LD is ld it makes a PLAMLIB
5014c27c18e8Smrg	  ## CC just makes a GrossModule.
5015c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5016c27c18e8Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5017c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5018c27c18e8Smrg        ;;
5019c27c18e8Smrg	motorola)
5020c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5021c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5022c27c18e8Smrg	;;
5023c27c18e8Smrg      esac
5024c27c18e8Smrg      runpath_var='LD_RUN_PATH'
5025c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5026c27c18e8Smrg      ;;
5027c43cc173Smrg
5028c27c18e8Smrg    sysv4.3*)
5029c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5030c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5031c27c18e8Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5032c27c18e8Smrg      ;;
5033c43cc173Smrg
5034c27c18e8Smrg    sysv4*MP*)
5035c27c18e8Smrg      if test -d /usr/nec; then
5036c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5037c27c18e8Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5038c27c18e8Smrg	runpath_var=LD_RUN_PATH
5039c27c18e8Smrg	hardcode_runpath_var=yes
5040c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5041c27c18e8Smrg      fi
5042c27c18e8Smrg      ;;
5043c43cc173Smrg
5044c27c18e8Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5045c27c18e8Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5046c27c18e8Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5047c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5048c27c18e8Smrg      runpath_var='LD_RUN_PATH'
5049c43cc173Smrg
5050c27c18e8Smrg      if test "$GCC" = yes; then
5051c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5052c27c18e8Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5053c27c18e8Smrg      else
5054c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5055c27c18e8Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5056c27c18e8Smrg      fi
5057c27c18e8Smrg      ;;
5058c43cc173Smrg
5059c27c18e8Smrg    sysv5* | sco3.2v5* | sco5v6*)
5060c27c18e8Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
5061c27c18e8Smrg      # link with -lc, and that would cause any symbols used from libc to
5062c27c18e8Smrg      # always be unresolved, which means just about no library would
5063c27c18e8Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
5064c27c18e8Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
5065c27c18e8Smrg      # as -z defs.
5066c27c18e8Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5067c27c18e8Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5068c27c18e8Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5069c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5070c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5071c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5072c27c18e8Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5073c27c18e8Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5074c27c18e8Smrg      runpath_var='LD_RUN_PATH'
5075c43cc173Smrg
5076c27c18e8Smrg      if test "$GCC" = yes; then
5077c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5078c27c18e8Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5079c27c18e8Smrg      else
5080c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5081c27c18e8Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5082c27c18e8Smrg      fi
5083c27c18e8Smrg      ;;
5084c43cc173Smrg
5085c27c18e8Smrg    uts4*)
5086c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5087c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5088c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5089c27c18e8Smrg      ;;
5090c43cc173Smrg
5091c27c18e8Smrg    *)
5092c27c18e8Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
5093c27c18e8Smrg      ;;
5094c27c18e8Smrg    esac
5095c43cc173Smrg
5096c27c18e8Smrg    if test x$host_vendor = xsni; then
5097c27c18e8Smrg      case $host in
5098c27c18e8Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5099c27c18e8Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5100c27c18e8Smrg	;;
5101c27c18e8Smrg      esac
5102c27c18e8Smrg    fi
5103c27c18e8Smrg  fi
5104c27c18e8Smrg])
5105c27c18e8SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5106c27c18e8Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5107c43cc173Smrg
5108c27c18e8Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5109c43cc173Smrg
5110c27c18e8Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5111c27c18e8Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5112c27c18e8Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
5113c27c18e8Smrg    [The commands to extract the exported symbol list from a shared archive])
5114c43cc173Smrg
5115c27c18e8Smrg#
5116c27c18e8Smrg# Do we need to explicitly link libc?
5117c27c18e8Smrg#
5118c27c18e8Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5119c27c18e8Smrgx|xyes)
5120c27c18e8Smrg  # Assume -lc should be added
5121c27c18e8Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5122c43cc173Smrg
5123c27c18e8Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
5124c27c18e8Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
5125c27c18e8Smrg    *'~'*)
5126c27c18e8Smrg      # FIXME: we may have to deal with multi-command sequences.
5127c27c18e8Smrg      ;;
5128c27c18e8Smrg    '$CC '*)
5129c27c18e8Smrg      # Test whether the compiler implicitly links with -lc since on some
5130c27c18e8Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
5131c27c18e8Smrg      # to ld, don't add -lc before -lgcc.
5132c27c18e8Smrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
5133c27c18e8Smrg      $RM conftest*
5134c27c18e8Smrg      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5135c43cc173Smrg
5136c27c18e8Smrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
5137c27c18e8Smrg        soname=conftest
5138c27c18e8Smrg        lib=conftest
5139c27c18e8Smrg        libobjs=conftest.$ac_objext
5140c27c18e8Smrg        deplibs=
5141c27c18e8Smrg        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
5142c27c18e8Smrg	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
5143c27c18e8Smrg        compiler_flags=-v
5144c27c18e8Smrg        linker_flags=-v
5145c27c18e8Smrg        verstring=
5146c27c18e8Smrg        output_objdir=.
5147c27c18e8Smrg        libname=conftest
5148c27c18e8Smrg        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
5149c27c18e8Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=
5150c27c18e8Smrg        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
5151c27c18e8Smrg        then
5152c27c18e8Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5153c27c18e8Smrg        else
5154c27c18e8Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5155c27c18e8Smrg        fi
5156c27c18e8Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
5157c27c18e8Smrg      else
5158c27c18e8Smrg        cat conftest.err 1>&5
5159c27c18e8Smrg      fi
5160c27c18e8Smrg      $RM conftest*
5161c27c18e8Smrg      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
5162c27c18e8Smrg      ;;
5163c27c18e8Smrg    esac
5164c27c18e8Smrg  fi
5165c27c18e8Smrg  ;;
5166c27c18e8Smrgesac
5167c43cc173Smrg
5168c27c18e8Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5169c27c18e8Smrg    [Whether or not to add -lc for building shared libraries])
5170c27c18e8Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5171c27c18e8Smrg    [enable_shared_with_static_runtimes], [0],
5172c27c18e8Smrg    [Whether or not to disallow shared libs when runtime libs are static])
5173c27c18e8Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5174c27c18e8Smrg    [Compiler flag to allow reflexive dlopens])
5175c27c18e8Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
5176c27c18e8Smrg    [Compiler flag to generate shared objects directly from archives])
5177c27c18e8Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
5178c27c18e8Smrg    [Whether the compiler copes with passing no objects directly])
5179c27c18e8Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5180c27c18e8Smrg    [Create an old-style archive from a shared archive])
5181c27c18e8Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5182c27c18e8Smrg    [Create a temporary old-style archive to link instead of a shared archive])
5183c27c18e8Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5184c27c18e8Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
5185c27c18e8Smrg_LT_TAGDECL([], [module_cmds], [2],
5186c27c18e8Smrg    [Commands used to build a loadable module if different from building
5187c27c18e8Smrg    a shared archive.])
5188c27c18e8Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
5189c27c18e8Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
5190c27c18e8Smrg    [Whether we are building with GNU ld or not])
5191c27c18e8Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
5192c27c18e8Smrg    [Flag that allows shared libraries with undefined symbols to be built])
5193c27c18e8Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
5194c27c18e8Smrg    [Flag that enforces no undefined symbols])
5195c27c18e8Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5196c27c18e8Smrg    [Flag to hardcode $libdir into a binary during linking.
5197c27c18e8Smrg    This must work even if $libdir does not exist])
5198c27c18e8Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
5199c27c18e8Smrg    [[If ld is used when linking, flag to hardcode $libdir into a binary
5200c27c18e8Smrg    during linking.  This must work even if $libdir does not exist]])
5201c27c18e8Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
5202c27c18e8Smrg    [Whether we need a single "-rpath" flag with a separated argument])
5203c27c18e8Smrg_LT_TAGDECL([], [hardcode_direct], [0],
5204c27c18e8Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5205c27c18e8Smrg    DIR into the resulting binary])
5206c27c18e8Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
5207c27c18e8Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5208c27c18e8Smrg    DIR into the resulting binary and the resulting library dependency is
5209c27c18e8Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5210c27c18e8Smrg    library is relocated])
5211c27c18e8Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
5212c27c18e8Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5213c27c18e8Smrg    into the resulting binary])
5214c27c18e8Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5215c27c18e8Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5216c27c18e8Smrg    into the resulting binary])
5217c27c18e8Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
5218c27c18e8Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
5219c27c18e8Smrg    into the library and all subsequent libraries and executables linked
5220c27c18e8Smrg    against it])
5221c27c18e8Smrg_LT_TAGDECL([], [inherit_rpath], [0],
5222c27c18e8Smrg    [Set to yes if linker adds runtime paths of dependent libraries
5223c27c18e8Smrg    to runtime path list])
5224c27c18e8Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
5225c27c18e8Smrg    [Whether libtool must link a program against all its dependency libraries])
5226c27c18e8Smrg_LT_TAGDECL([], [fix_srcfile_path], [1],
5227c27c18e8Smrg    [Fix the shell variable $srcfile for the compiler])
5228c27c18e8Smrg_LT_TAGDECL([], [always_export_symbols], [0],
5229c27c18e8Smrg    [Set to "yes" if exported symbols are required])
5230c27c18e8Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
5231c27c18e8Smrg    [The commands to list exported symbols])
5232c27c18e8Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
5233c27c18e8Smrg    [Symbols that should not be listed in the preloaded symbols])
5234c27c18e8Smrg_LT_TAGDECL([], [include_expsyms], [1],
5235c27c18e8Smrg    [Symbols that must always be exported])
5236c27c18e8Smrg_LT_TAGDECL([], [prelink_cmds], [2],
5237c27c18e8Smrg    [Commands necessary for linking programs (against libraries) with templates])
5238c27c18e8Smrg_LT_TAGDECL([], [file_list_spec], [1],
5239c27c18e8Smrg    [Specify filename containing input files])
5240c27c18e8Smrgdnl FIXME: Not yet implemented
5241c27c18e8Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5242c27c18e8Smrgdnl    [Compiler flag to generate thread safe objects])
5243c27c18e8Smrg])# _LT_LINKER_SHLIBS
5244c27c18e8Smrg
5245c27c18e8Smrg
5246c27c18e8Smrg# _LT_LANG_C_CONFIG([TAG])
5247c27c18e8Smrg# ------------------------
5248c27c18e8Smrg# Ensure that the configuration variables for a C compiler are suitably
5249c27c18e8Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5250c27c18e8Smrg# the compiler configuration to `libtool'.
5251c27c18e8Smrgm4_defun([_LT_LANG_C_CONFIG],
5252c27c18e8Smrg[m4_require([_LT_DECL_EGREP])dnl
5253c27c18e8Smrglt_save_CC="$CC"
5254c27c18e8SmrgAC_LANG_PUSH(C)
5255c43cc173Smrg
5256c27c18e8Smrg# Source file extension for C test sources.
5257c27c18e8Smrgac_ext=c
5258c43cc173Smrg
5259c27c18e8Smrg# Object file extension for compiled C test sources.
5260c27c18e8Smrgobjext=o
5261c27c18e8Smrg_LT_TAGVAR(objext, $1)=$objext
5262c43cc173Smrg
5263c27c18e8Smrg# Code to be used in simple compile tests
5264c27c18e8Smrglt_simple_compile_test_code="int some_variable = 0;"
5265c43cc173Smrg
5266c27c18e8Smrg# Code to be used in simple link tests
5267c27c18e8Smrglt_simple_link_test_code='int main(){return(0);}'
5268c43cc173Smrg
5269c27c18e8Smrg_LT_TAG_COMPILER
5270c27c18e8Smrg# Save the default compiler, since it gets overwritten when the other
5271c27c18e8Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5272c27c18e8Smrgcompiler_DEFAULT=$CC
5273c43cc173Smrg
5274c27c18e8Smrg# save warnings/boilerplate of simple test code
5275c27c18e8Smrg_LT_COMPILER_BOILERPLATE
5276c27c18e8Smrg_LT_LINKER_BOILERPLATE
5277c43cc173Smrg
5278c27c18e8Smrgif test -n "$compiler"; then
5279c27c18e8Smrg  _LT_COMPILER_NO_RTTI($1)
5280c27c18e8Smrg  _LT_COMPILER_PIC($1)
5281c27c18e8Smrg  _LT_COMPILER_C_O($1)
5282c27c18e8Smrg  _LT_COMPILER_FILE_LOCKS($1)
5283c27c18e8Smrg  _LT_LINKER_SHLIBS($1)
5284c27c18e8Smrg  _LT_SYS_DYNAMIC_LINKER($1)
5285c27c18e8Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
5286c27c18e8Smrg  LT_SYS_DLOPEN_SELF
5287c27c18e8Smrg  _LT_CMD_STRIPLIB
5288c27c18e8Smrg
5289c27c18e8Smrg  # Report which library types will actually be built
5290c27c18e8Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
5291c27c18e8Smrg  AC_MSG_RESULT([$can_build_shared])
5292c27c18e8Smrg
5293c27c18e8Smrg  AC_MSG_CHECKING([whether to build shared libraries])
5294c27c18e8Smrg  test "$can_build_shared" = "no" && enable_shared=no
5295c27c18e8Smrg
5296c27c18e8Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
5297c27c18e8Smrg  # are all built from PIC.
5298c27c18e8Smrg  case $host_os in
5299c27c18e8Smrg  aix3*)
5300c27c18e8Smrg    test "$enable_shared" = yes && enable_static=no
5301c27c18e8Smrg    if test -n "$RANLIB"; then
5302c27c18e8Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
5303c27c18e8Smrg      postinstall_cmds='$RANLIB $lib'
5304c27c18e8Smrg    fi
5305c27c18e8Smrg    ;;
5306c43cc173Smrg
5307c27c18e8Smrg  aix[[4-9]]*)
5308c27c18e8Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5309c27c18e8Smrg      test "$enable_shared" = yes && enable_static=no
5310c27c18e8Smrg    fi
5311c27c18e8Smrg    ;;
5312c27c18e8Smrg  esac
5313c27c18e8Smrg  AC_MSG_RESULT([$enable_shared])
5314c43cc173Smrg
5315c27c18e8Smrg  AC_MSG_CHECKING([whether to build static libraries])
5316c27c18e8Smrg  # Make sure either enable_shared or enable_static is yes.
5317c27c18e8Smrg  test "$enable_shared" = yes || enable_static=yes
5318c27c18e8Smrg  AC_MSG_RESULT([$enable_static])
5319c43cc173Smrg
5320c27c18e8Smrg  _LT_CONFIG($1)
5321c27c18e8Smrgfi
5322c27c18e8SmrgAC_LANG_POP
5323c27c18e8SmrgCC="$lt_save_CC"
5324c27c18e8Smrg])# _LT_LANG_C_CONFIG
5325c43cc173Smrg
5326c43cc173Smrg
5327c27c18e8Smrg# _LT_PROG_CXX
5328c27c18e8Smrg# ------------
5329c27c18e8Smrg# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
5330c27c18e8Smrg# compiler, we have our own version here.
5331c27c18e8Smrgm4_defun([_LT_PROG_CXX],
5332c27c18e8Smrg[
5333c27c18e8Smrgpushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
5334c27c18e8SmrgAC_PROG_CXX
5335c27c18e8Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5336c27c18e8Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5337c27c18e8Smrg    (test "X$CXX" != "Xg++"))) ; then
5338c27c18e8Smrg  AC_PROG_CXXCPP
5339c27c18e8Smrgelse
5340c27c18e8Smrg  _lt_caught_CXX_error=yes
5341c27c18e8Smrgfi
5342c27c18e8Smrgpopdef([AC_MSG_ERROR])
5343c27c18e8Smrg])# _LT_PROG_CXX
5344c43cc173Smrg
5345c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
5346c27c18e8Smrgdnl AC_DEFUN([_LT_PROG_CXX], [])
5347c43cc173Smrg
5348c43cc173Smrg
5349c27c18e8Smrg# _LT_LANG_CXX_CONFIG([TAG])
5350c27c18e8Smrg# --------------------------
5351c27c18e8Smrg# Ensure that the configuration variables for a C++ compiler are suitably
5352c27c18e8Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5353c27c18e8Smrg# the compiler configuration to `libtool'.
5354c27c18e8Smrgm4_defun([_LT_LANG_CXX_CONFIG],
5355c27c18e8Smrg[AC_REQUIRE([_LT_PROG_CXX])dnl
5356c27c18e8Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5357c27c18e8Smrgm4_require([_LT_DECL_EGREP])dnl
5358c27c18e8Smrg
5359c27c18e8SmrgAC_LANG_PUSH(C++)
5360c27c18e8Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5361c27c18e8Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
5362c27c18e8Smrg_LT_TAGVAR(always_export_symbols, $1)=no
5363c27c18e8Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
5364c27c18e8Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
5365c27c18e8Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
5366c27c18e8Smrg_LT_TAGVAR(hardcode_direct, $1)=no
5367c27c18e8Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5368c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5369c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5370c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
5371c27c18e8Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
5372c27c18e8Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5373c27c18e8Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
5374c27c18e8Smrg_LT_TAGVAR(inherit_rpath, $1)=no
5375c27c18e8Smrg_LT_TAGVAR(module_cmds, $1)=
5376c27c18e8Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
5377c27c18e8Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
5378c27c18e8Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5379c27c18e8Smrg_LT_TAGVAR(no_undefined_flag, $1)=
5380c27c18e8Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
5381c27c18e8Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5382c43cc173Smrg
5383c27c18e8Smrg# Source file extension for C++ test sources.
5384c27c18e8Smrgac_ext=cpp
5385c43cc173Smrg
5386c27c18e8Smrg# Object file extension for compiled C++ test sources.
5387c27c18e8Smrgobjext=o
5388c27c18e8Smrg_LT_TAGVAR(objext, $1)=$objext
5389c27c18e8Smrg
5390c27c18e8Smrg# No sense in running all these tests if we already determined that
5391c27c18e8Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
5392c27c18e8Smrg# are currently assumed to apply to all compilers on this platform,
5393c27c18e8Smrg# and will be corrupted by setting them based on a non-working compiler.
5394c27c18e8Smrgif test "$_lt_caught_CXX_error" != yes; then
5395c27c18e8Smrg  # Code to be used in simple compile tests
5396c27c18e8Smrg  lt_simple_compile_test_code="int some_variable = 0;"
5397c27c18e8Smrg
5398c27c18e8Smrg  # Code to be used in simple link tests
5399c27c18e8Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5400c27c18e8Smrg
5401c27c18e8Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5402c27c18e8Smrg  _LT_TAG_COMPILER
5403c27c18e8Smrg
5404c27c18e8Smrg  # save warnings/boilerplate of simple test code
5405c27c18e8Smrg  _LT_COMPILER_BOILERPLATE
5406c27c18e8Smrg  _LT_LINKER_BOILERPLATE
5407c27c18e8Smrg
5408c27c18e8Smrg  # Allow CC to be a program name with arguments.
5409c27c18e8Smrg  lt_save_CC=$CC
5410c27c18e8Smrg  lt_save_LD=$LD
5411c27c18e8Smrg  lt_save_GCC=$GCC
5412c27c18e8Smrg  GCC=$GXX
5413c27c18e8Smrg  lt_save_with_gnu_ld=$with_gnu_ld
5414c27c18e8Smrg  lt_save_path_LD=$lt_cv_path_LD
5415c27c18e8Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5416c27c18e8Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5417c27c18e8Smrg  else
5418c27c18e8Smrg    $as_unset lt_cv_prog_gnu_ld
5419c27c18e8Smrg  fi
5420c27c18e8Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
5421c27c18e8Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
5422c27c18e8Smrg  else
5423c27c18e8Smrg    $as_unset lt_cv_path_LD
5424c27c18e8Smrg  fi
5425c27c18e8Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
5426c27c18e8Smrg  CC=${CXX-"c++"}
5427c27c18e8Smrg  compiler=$CC
5428c27c18e8Smrg  _LT_TAGVAR(compiler, $1)=$CC
5429c27c18e8Smrg  _LT_CC_BASENAME([$compiler])
5430c43cc173Smrg
5431c27c18e8Smrg  if test -n "$compiler"; then
5432c27c18e8Smrg    # We don't want -fno-exception when compiling C++ code, so set the
5433c27c18e8Smrg    # no_builtin_flag separately
5434c27c18e8Smrg    if test "$GXX" = yes; then
5435c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5436c27c18e8Smrg    else
5437c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5438c27c18e8Smrg    fi
5439c43cc173Smrg
5440c27c18e8Smrg    if test "$GXX" = yes; then
5441c27c18e8Smrg      # Set up default GNU C++ configuration
5442c43cc173Smrg
5443c27c18e8Smrg      LT_PATH_LD
5444c43cc173Smrg
5445c27c18e8Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
5446c27c18e8Smrg      # archiving commands below assume that GNU ld is being used.
5447c27c18e8Smrg      if test "$with_gnu_ld" = yes; then
5448c27c18e8Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5449c27c18e8Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5450c43cc173Smrg
5451c27c18e8Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5452c27c18e8Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5453c43cc173Smrg
5454c27c18e8Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
5455c27c18e8Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5456c27c18e8Smrg        #     investigate it a little bit more. (MM)
5457c27c18e8Smrg        wlarc='${wl}'
5458c43cc173Smrg
5459c27c18e8Smrg        # ancient GNU ld didn't support --whole-archive et. al.
5460c27c18e8Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5461c27c18e8Smrg	  $GREP 'no-whole-archive' > /dev/null; then
5462c27c18e8Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5463c27c18e8Smrg        else
5464c27c18e8Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
5465c27c18e8Smrg        fi
5466c27c18e8Smrg      else
5467c27c18e8Smrg        with_gnu_ld=no
5468c27c18e8Smrg        wlarc=
5469c27c18e8Smrg
5470c27c18e8Smrg        # A generic and very simple default shared library creation
5471c27c18e8Smrg        # command for GNU C++ for the case where it uses the native
5472c27c18e8Smrg        # linker, instead of GNU ld.  If possible, this setting should
5473c27c18e8Smrg        # overridden to take advantage of the native linker features on
5474c27c18e8Smrg        # the platform it is being used on.
5475c27c18e8Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5476c27c18e8Smrg      fi
5477c43cc173Smrg
5478c27c18e8Smrg      # Commands to make compiler produce verbose output that lists
5479c27c18e8Smrg      # what "hidden" libraries, object files and flags are used when
5480c27c18e8Smrg      # linking a shared library.
5481c27c18e8Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
5482c43cc173Smrg
5483c27c18e8Smrg    else
5484c27c18e8Smrg      GXX=no
5485c27c18e8Smrg      with_gnu_ld=no
5486c27c18e8Smrg      wlarc=
5487c27c18e8Smrg    fi
5488c43cc173Smrg
5489c27c18e8Smrg    # PORTME: fill in a description of your system's C++ link characteristics
5490c27c18e8Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5491c27c18e8Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
5492c27c18e8Smrg    case $host_os in
5493c27c18e8Smrg      aix3*)
5494c27c18e8Smrg        # FIXME: insert proper C++ library support
5495c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
5496c27c18e8Smrg        ;;
5497c27c18e8Smrg      aix[[4-9]]*)
5498c27c18e8Smrg        if test "$host_cpu" = ia64; then
5499c27c18e8Smrg          # On IA64, the linker does run time linking by default, so we don't
5500c27c18e8Smrg          # have to do anything special.
5501c27c18e8Smrg          aix_use_runtimelinking=no
5502c27c18e8Smrg          exp_sym_flag='-Bexport'
5503c27c18e8Smrg          no_entry_flag=""
5504c27c18e8Smrg        else
5505c27c18e8Smrg          aix_use_runtimelinking=no
5506c27c18e8Smrg
5507c27c18e8Smrg          # Test if we are trying to use run time linking or normal
5508c27c18e8Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5509c27c18e8Smrg          # need to do runtime linking.
5510c27c18e8Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5511c27c18e8Smrg	    for ld_flag in $LDFLAGS; do
5512c27c18e8Smrg	      case $ld_flag in
5513c27c18e8Smrg	      *-brtl*)
5514c27c18e8Smrg	        aix_use_runtimelinking=yes
5515c27c18e8Smrg	        break
5516c27c18e8Smrg	        ;;
5517c27c18e8Smrg	      esac
5518c27c18e8Smrg	    done
5519c27c18e8Smrg	    ;;
5520c27c18e8Smrg          esac
5521c43cc173Smrg
5522c27c18e8Smrg          exp_sym_flag='-bexport'
5523c27c18e8Smrg          no_entry_flag='-bnoentry'
5524c27c18e8Smrg        fi
5525c43cc173Smrg
5526c27c18e8Smrg        # When large executables or shared objects are built, AIX ld can
5527c27c18e8Smrg        # have problems creating the table of contents.  If linking a library
5528c27c18e8Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
5529c27c18e8Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5530c27c18e8Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5531c27c18e8Smrg
5532c27c18e8Smrg        _LT_TAGVAR(archive_cmds, $1)=''
5533c27c18e8Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
5534c27c18e8Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5535c27c18e8Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5536c27c18e8Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
5537c27c18e8Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5538c27c18e8Smrg
5539c27c18e8Smrg        if test "$GXX" = yes; then
5540c27c18e8Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
5541c27c18e8Smrg          # We only want to do this on AIX 4.2 and lower, the check
5542c27c18e8Smrg          # below for broken collect2 doesn't work under 4.3+
5543c27c18e8Smrg	  collect2name=`${CC} -print-prog-name=collect2`
5544c27c18e8Smrg	  if test -f "$collect2name" &&
5545c27c18e8Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5546c27c18e8Smrg	  then
5547c27c18e8Smrg	    # We have reworked collect2
5548c27c18e8Smrg	    :
5549c27c18e8Smrg	  else
5550c27c18e8Smrg	    # We have old collect2
5551c27c18e8Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
5552c27c18e8Smrg	    # It fails to find uninstalled libraries when the uninstalled
5553c27c18e8Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
5554c27c18e8Smrg	    # to unsupported forces relinking
5555c27c18e8Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
5556c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5557c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
5558c27c18e8Smrg	  fi
5559c27c18e8Smrg          esac
5560c27c18e8Smrg          shared_flag='-shared'
5561c27c18e8Smrg	  if test "$aix_use_runtimelinking" = yes; then
5562c27c18e8Smrg	    shared_flag="$shared_flag "'${wl}-G'
5563c27c18e8Smrg	  fi
5564c27c18e8Smrg        else
5565c27c18e8Smrg          # not using gcc
5566c27c18e8Smrg          if test "$host_cpu" = ia64; then
5567c27c18e8Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5568c27c18e8Smrg	  # chokes on -Wl,-G. The following line is correct:
5569c27c18e8Smrg	  shared_flag='-G'
5570c27c18e8Smrg          else
5571c27c18e8Smrg	    if test "$aix_use_runtimelinking" = yes; then
5572c27c18e8Smrg	      shared_flag='${wl}-G'
5573c27c18e8Smrg	    else
5574c27c18e8Smrg	      shared_flag='${wl}-bM:SRE'
5575c27c18e8Smrg	    fi
5576c27c18e8Smrg          fi
5577c27c18e8Smrg        fi
5578c43cc173Smrg
5579c27c18e8Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5580c27c18e8Smrg        # It seems that -bexpall does not export symbols beginning with
5581c27c18e8Smrg        # underscore (_), so it is better to generate a list of symbols to
5582c27c18e8Smrg	# export.
5583c27c18e8Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
5584c27c18e8Smrg        if test "$aix_use_runtimelinking" = yes; then
5585c27c18e8Smrg          # Warning - without using the other runtime loading flags (-brtl),
5586c27c18e8Smrg          # -berok will link without error, but may produce a broken library.
5587c27c18e8Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5588c27c18e8Smrg          # Determine the default libpath from the value encoded in an empty
5589c27c18e8Smrg          # executable.
5590c27c18e8Smrg          _LT_SYS_MODULE_PATH_AIX
5591c27c18e8Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5592c27c18e8Smrg
5593c27c18e8Smrg          _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5594c27c18e8Smrg        else
5595c27c18e8Smrg          if test "$host_cpu" = ia64; then
5596c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5597c27c18e8Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5598c27c18e8Smrg	    _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"
5599c27c18e8Smrg          else
5600c27c18e8Smrg	    # Determine the default libpath from the value encoded in an
5601c27c18e8Smrg	    # empty executable.
5602c27c18e8Smrg	    _LT_SYS_MODULE_PATH_AIX
5603c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5604c27c18e8Smrg	    # Warning - without using the other run time loading flags,
5605c27c18e8Smrg	    # -berok will link without error, but may produce a broken library.
5606c27c18e8Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5607c27c18e8Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5608c27c18e8Smrg	    # Exported symbols can be pulled into shared objects from archives
5609c27c18e8Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5610c27c18e8Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5611c27c18e8Smrg	    # This is similar to how AIX traditionally builds its shared
5612c27c18e8Smrg	    # libraries.
5613c27c18e8Smrg	    _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'
5614c27c18e8Smrg          fi
5615c27c18e8Smrg        fi
5616c27c18e8Smrg        ;;
5617c43cc173Smrg
5618c27c18e8Smrg      beos*)
5619c27c18e8Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5620c27c18e8Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5621c27c18e8Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5622c27c18e8Smrg	  # support --undefined.  This deserves some investigation.  FIXME
5623c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5624c27c18e8Smrg	else
5625c27c18e8Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
5626c27c18e8Smrg	fi
5627c27c18e8Smrg	;;
5628c43cc173Smrg
5629c27c18e8Smrg      chorus*)
5630c27c18e8Smrg        case $cc_basename in
5631c27c18e8Smrg          *)
5632c27c18e8Smrg	  # FIXME: insert proper C++ library support
5633c27c18e8Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
5634c27c18e8Smrg	  ;;
5635c27c18e8Smrg        esac
5636c27c18e8Smrg        ;;
5637c43cc173Smrg
5638c27c18e8Smrg      cygwin* | mingw* | pw32* | cegcc*)
5639c27c18e8Smrg        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5640c27c18e8Smrg        # as there is no search path for DLLs.
5641c27c18e8Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5642c27c18e8Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5643c27c18e8Smrg        _LT_TAGVAR(always_export_symbols, $1)=no
5644c27c18e8Smrg        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5645c27c18e8Smrg
5646c27c18e8Smrg        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5647c27c18e8Smrg          _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'
5648c27c18e8Smrg          # If the export-symbols file already is a .def file (1st line
5649c27c18e8Smrg          # is EXPORTS), use it as is; otherwise, prepend...
5650c27c18e8Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5651c27c18e8Smrg	    cp $export_symbols $output_objdir/$soname.def;
5652c27c18e8Smrg          else
5653c27c18e8Smrg	    echo EXPORTS > $output_objdir/$soname.def;
5654c27c18e8Smrg	    cat $export_symbols >> $output_objdir/$soname.def;
5655c27c18e8Smrg          fi~
5656c27c18e8Smrg          $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'
5657c27c18e8Smrg        else
5658c27c18e8Smrg          _LT_TAGVAR(ld_shlibs, $1)=no
5659c27c18e8Smrg        fi
5660c27c18e8Smrg        ;;
5661c27c18e8Smrg      darwin* | rhapsody*)
5662c27c18e8Smrg        _LT_DARWIN_LINKER_FEATURES($1)
5663c27c18e8Smrg	;;
5664c43cc173Smrg
5665c27c18e8Smrg      dgux*)
5666c27c18e8Smrg        case $cc_basename in
5667c27c18e8Smrg          ec++*)
5668c27c18e8Smrg	    # FIXME: insert proper C++ library support
5669c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5670c27c18e8Smrg	    ;;
5671c27c18e8Smrg          ghcx*)
5672c27c18e8Smrg	    # Green Hills C++ Compiler
5673c27c18e8Smrg	    # FIXME: insert proper C++ library support
5674c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5675c27c18e8Smrg	    ;;
5676c27c18e8Smrg          *)
5677c27c18e8Smrg	    # FIXME: insert proper C++ library support
5678c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5679c27c18e8Smrg	    ;;
5680c27c18e8Smrg        esac
5681c27c18e8Smrg        ;;
5682c27c18e8Smrg
5683c27c18e8Smrg      freebsd[[12]]*)
5684c27c18e8Smrg        # C++ shared libraries reported to be fairly broken before
5685c27c18e8Smrg	# switch to ELF
5686c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
5687c27c18e8Smrg        ;;
5688c43cc173Smrg
5689c27c18e8Smrg      freebsd-elf*)
5690c27c18e8Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5691c27c18e8Smrg        ;;
5692c43cc173Smrg
5693c27c18e8Smrg      freebsd* | dragonfly*)
5694c27c18e8Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
5695c27c18e8Smrg        # conventions
5696c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
5697c27c18e8Smrg        ;;
5698c43cc173Smrg
5699c27c18e8Smrg      gnu*)
5700c27c18e8Smrg        ;;
5701c43cc173Smrg
5702c27c18e8Smrg      hpux9*)
5703c27c18e8Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5704c27c18e8Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5705c27c18e8Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5706c27c18e8Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
5707c27c18e8Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5708c27c18e8Smrg				             # but as the default
5709c27c18e8Smrg				             # location of the library.
5710c27c18e8Smrg
5711c27c18e8Smrg        case $cc_basename in
5712c27c18e8Smrg          CC*)
5713c27c18e8Smrg            # FIXME: insert proper C++ library support
5714c27c18e8Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
5715c27c18e8Smrg            ;;
5716c27c18e8Smrg          aCC*)
5717c27c18e8Smrg            _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'
5718c27c18e8Smrg            # Commands to make compiler produce verbose output that lists
5719c27c18e8Smrg            # what "hidden" libraries, object files and flags are used when
5720c27c18e8Smrg            # linking a shared library.
5721c27c18e8Smrg            #
5722c27c18e8Smrg            # There doesn't appear to be a way to prevent this compiler from
5723c27c18e8Smrg            # explicitly linking system object files so we need to strip them
5724c27c18e8Smrg            # from the output so that they don't get included in the library
5725c27c18e8Smrg            # dependencies.
5726c27c18e8Smrg            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; $ECHO "X$list" | $Xsed'
5727c27c18e8Smrg            ;;
5728c27c18e8Smrg          *)
5729c27c18e8Smrg            if test "$GXX" = yes; then
5730c27c18e8Smrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5731c27c18e8Smrg            else
5732c27c18e8Smrg              # FIXME: insert proper C++ library support
5733c27c18e8Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
5734c27c18e8Smrg            fi
5735c27c18e8Smrg            ;;
5736c27c18e8Smrg        esac
5737c27c18e8Smrg        ;;
5738c43cc173Smrg
5739c27c18e8Smrg      hpux10*|hpux11*)
5740c27c18e8Smrg        if test $with_gnu_ld = no; then
5741c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5742c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5743c27c18e8Smrg
5744c27c18e8Smrg          case $host_cpu in
5745c27c18e8Smrg            hppa*64*|ia64*)
5746c27c18e8Smrg              ;;
5747c27c18e8Smrg            *)
5748c27c18e8Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5749c27c18e8Smrg              ;;
5750c27c18e8Smrg          esac
5751c27c18e8Smrg        fi
5752c27c18e8Smrg        case $host_cpu in
5753c27c18e8Smrg          hppa*64*|ia64*)
5754c27c18e8Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
5755c27c18e8Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5756c27c18e8Smrg            ;;
5757c27c18e8Smrg          *)
5758c27c18e8Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
5759c27c18e8Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5760c27c18e8Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5761c27c18e8Smrg					         # but as the default
5762c27c18e8Smrg					         # location of the library.
5763c27c18e8Smrg            ;;
5764c27c18e8Smrg        esac
5765c27c18e8Smrg
5766c27c18e8Smrg        case $cc_basename in
5767c27c18e8Smrg          CC*)
5768c27c18e8Smrg	    # FIXME: insert proper C++ library support
5769c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5770c27c18e8Smrg	    ;;
5771c27c18e8Smrg          aCC*)
5772c27c18e8Smrg	    case $host_cpu in
5773c27c18e8Smrg	      hppa*64*)
5774c27c18e8Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5775c27c18e8Smrg	        ;;
5776c27c18e8Smrg	      ia64*)
5777c27c18e8Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5778c27c18e8Smrg	        ;;
5779c27c18e8Smrg	      *)
5780c27c18e8Smrg	        _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'
5781c27c18e8Smrg	        ;;
5782c27c18e8Smrg	    esac
5783c27c18e8Smrg	    # Commands to make compiler produce verbose output that lists
5784c27c18e8Smrg	    # what "hidden" libraries, object files and flags are used when
5785c27c18e8Smrg	    # linking a shared library.
5786c27c18e8Smrg	    #
5787c27c18e8Smrg	    # There doesn't appear to be a way to prevent this compiler from
5788c27c18e8Smrg	    # explicitly linking system object files so we need to strip them
5789c27c18e8Smrg	    # from the output so that they don't get included in the library
5790c27c18e8Smrg	    # dependencies.
5791c27c18e8Smrg	    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; $ECHO "X$list" | $Xsed'
5792c27c18e8Smrg	    ;;
5793c27c18e8Smrg          *)
5794c27c18e8Smrg	    if test "$GXX" = yes; then
5795c27c18e8Smrg	      if test $with_gnu_ld = no; then
5796c27c18e8Smrg	        case $host_cpu in
5797c27c18e8Smrg	          hppa*64*)
5798c27c18e8Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5799c27c18e8Smrg	            ;;
5800c27c18e8Smrg	          ia64*)
5801c27c18e8Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5802c27c18e8Smrg	            ;;
5803c27c18e8Smrg	          *)
5804c27c18e8Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5805c27c18e8Smrg	            ;;
5806c27c18e8Smrg	        esac
5807c27c18e8Smrg	      fi
5808c27c18e8Smrg	    else
5809c27c18e8Smrg	      # FIXME: insert proper C++ library support
5810c27c18e8Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
5811c27c18e8Smrg	    fi
5812c27c18e8Smrg	    ;;
5813c27c18e8Smrg        esac
5814c27c18e8Smrg        ;;
5815c43cc173Smrg
5816c27c18e8Smrg      interix[[3-9]]*)
5817c27c18e8Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
5818c27c18e8Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5819c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5820c27c18e8Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5821c27c18e8Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5822c27c18e8Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
5823c27c18e8Smrg	# default) and relocated if they conflict, which is a slow very memory
5824c27c18e8Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
5825c27c18e8Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5826c27c18e8Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5827c27c18e8Smrg	_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'
5828c27c18e8Smrg	_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'
5829c27c18e8Smrg	;;
5830c27c18e8Smrg      irix5* | irix6*)
5831c27c18e8Smrg        case $cc_basename in
5832c27c18e8Smrg          CC*)
5833c27c18e8Smrg	    # SGI C++
5834c27c18e8Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
5835c27c18e8Smrg
5836c27c18e8Smrg	    # Archives containing C++ object files must be created using
5837c27c18e8Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
5838c27c18e8Smrg	    # necessary to make sure instantiated templates are included
5839c27c18e8Smrg	    # in the archive.
5840c27c18e8Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
5841c27c18e8Smrg	    ;;
5842c27c18e8Smrg          *)
5843c27c18e8Smrg	    if test "$GXX" = yes; then
5844c27c18e8Smrg	      if test "$with_gnu_ld" = no; then
5845c27c18e8Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5846c27c18e8Smrg	      else
5847c27c18e8Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
5848c27c18e8Smrg	      fi
5849c27c18e8Smrg	    fi
5850c27c18e8Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
5851c27c18e8Smrg	    ;;
5852c27c18e8Smrg        esac
5853c27c18e8Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5854c27c18e8Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5855c27c18e8Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
5856c27c18e8Smrg        ;;
5857c43cc173Smrg
5858c27c18e8Smrg      linux* | k*bsd*-gnu)
5859c27c18e8Smrg        case $cc_basename in
5860c27c18e8Smrg          KCC*)
5861c27c18e8Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
5862c27c18e8Smrg
5863c27c18e8Smrg	    # KCC will only create a shared library if the output file
5864c27c18e8Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
5865c27c18e8Smrg	    # to its proper name (with version) after linking.
5866c27c18e8Smrg	    _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'
5867c27c18e8Smrg	    _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'
5868c27c18e8Smrg	    # Commands to make compiler produce verbose output that lists
5869c27c18e8Smrg	    # what "hidden" libraries, object files and flags are used when
5870c27c18e8Smrg	    # linking a shared library.
5871c27c18e8Smrg	    #
5872c27c18e8Smrg	    # There doesn't appear to be a way to prevent this compiler from
5873c27c18e8Smrg	    # explicitly linking system object files so we need to strip them
5874c27c18e8Smrg	    # from the output so that they don't get included in the library
5875c27c18e8Smrg	    # dependencies.
5876c27c18e8Smrg	    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; $ECHO "X$list" | $Xsed'
5877c27c18e8Smrg
5878c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5879c27c18e8Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5880c27c18e8Smrg
5881c27c18e8Smrg	    # Archives containing C++ object files must be created using
5882c27c18e8Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
5883c27c18e8Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
5884c27c18e8Smrg	    ;;
5885c27c18e8Smrg	  icpc* | ecpc* )
5886c27c18e8Smrg	    # Intel C++
5887c27c18e8Smrg	    with_gnu_ld=yes
5888c27c18e8Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
5889c27c18e8Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
5890c27c18e8Smrg	    # earlier do not add the objects themselves.
5891c27c18e8Smrg	    case `$CC -V 2>&1` in
5892c27c18e8Smrg	      *"Version 7."*)
5893c27c18e8Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5894c27c18e8Smrg		_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'
5895c27c18e8Smrg		;;
5896c27c18e8Smrg	      *)  # Version 8.0 or newer
5897c27c18e8Smrg	        tmp_idyn=
5898c27c18e8Smrg	        case $host_cpu in
5899c27c18e8Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
5900c27c18e8Smrg		esac
5901c27c18e8Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5902c27c18e8Smrg		_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'
5903c27c18e8Smrg		;;
5904c27c18e8Smrg	    esac
5905c27c18e8Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5906c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5907c27c18e8Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5908c27c18e8Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5909c27c18e8Smrg	    ;;
5910c27c18e8Smrg          pgCC* | pgcpp*)
5911c27c18e8Smrg            # Portland Group C++ compiler
5912c27c18e8Smrg	    case `$CC -V` in
5913c27c18e8Smrg	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
5914c27c18e8Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
5915c27c18e8Smrg		rm -rf $tpldir~
5916c27c18e8Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
5917c27c18e8Smrg		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
5918c27c18e8Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
5919c27c18e8Smrg		rm -rf $tpldir~
5920c27c18e8Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
5921c27c18e8Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
5922c27c18e8Smrg		$RANLIB $oldlib'
5923c27c18e8Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
5924c27c18e8Smrg		rm -rf $tpldir~
5925c27c18e8Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5926c27c18e8Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5927c27c18e8Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
5928c27c18e8Smrg		rm -rf $tpldir~
5929c27c18e8Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5930c27c18e8Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
5931c27c18e8Smrg	      ;;
5932c27c18e8Smrg	    *) # Version 6 will use weak symbols
5933c27c18e8Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5934c27c18e8Smrg	      _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'
5935c27c18e8Smrg	      ;;
5936c27c18e8Smrg	    esac
5937c43cc173Smrg
5938c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5939c27c18e8Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5940c27c18e8Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
5941c27c18e8Smrg            ;;
5942c27c18e8Smrg	  cxx*)
5943c27c18e8Smrg	    # Compaq C++
5944c27c18e8Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5945c27c18e8Smrg	    _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'
5946c43cc173Smrg
5947c27c18e8Smrg	    runpath_var=LD_RUN_PATH
5948c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5949c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
595021e67964Smrg
5951c27c18e8Smrg	    # Commands to make compiler produce verbose output that lists
5952c27c18e8Smrg	    # what "hidden" libraries, object files and flags are used when
5953c27c18e8Smrg	    # linking a shared library.
5954c27c18e8Smrg	    #
5955c27c18e8Smrg	    # There doesn't appear to be a way to prevent this compiler from
5956c27c18e8Smrg	    # explicitly linking system object files so we need to strip them
5957c27c18e8Smrg	    # from the output so that they don't get included in the library
5958c27c18e8Smrg	    # dependencies.
5959c27c18e8Smrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5960c27c18e8Smrg	    ;;
5961c27c18e8Smrg	  xl*)
5962c27c18e8Smrg	    # IBM XL 8.0 on PPC, with GNU ld
5963c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5964c27c18e8Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5965c27c18e8Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5966c27c18e8Smrg	    if test "x$supports_anon_versioning" = xyes; then
5967c27c18e8Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5968c27c18e8Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5969c27c18e8Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
5970c27c18e8Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5971c27c18e8Smrg	    fi
5972c27c18e8Smrg	    ;;
5973c27c18e8Smrg	  *)
5974c27c18e8Smrg	    case `$CC -V 2>&1 | sed 5q` in
5975c27c18e8Smrg	    *Sun\ C*)
5976c27c18e8Smrg	      # Sun C++ 5.9
5977c27c18e8Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
5978c27c18e8Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5979c27c18e8Smrg	      _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'
5980c27c18e8Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5981c27c18e8Smrg	      _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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
5982c27c18e8Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
5983c27c18e8Smrg
5984c27c18e8Smrg	      # Not sure whether something based on
5985c27c18e8Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
5986c27c18e8Smrg	      # would be better.
5987c27c18e8Smrg	      output_verbose_link_cmd='echo'
5988c27c18e8Smrg
5989c27c18e8Smrg	      # Archives containing C++ object files must be created using
5990c27c18e8Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
5991c27c18e8Smrg	      # necessary to make sure instantiated templates are included
5992c27c18e8Smrg	      # in the archive.
5993c27c18e8Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
5994c27c18e8Smrg	      ;;
5995c27c18e8Smrg	    esac
5996c27c18e8Smrg	    ;;
5997c27c18e8Smrg	esac
5998c27c18e8Smrg	;;
5999c43cc173Smrg
6000c27c18e8Smrg      lynxos*)
6001c27c18e8Smrg        # FIXME: insert proper C++ library support
6002c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6003c27c18e8Smrg	;;
6004c43cc173Smrg
6005c27c18e8Smrg      m88k*)
6006c27c18e8Smrg        # FIXME: insert proper C++ library support
6007c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6008c27c18e8Smrg	;;
6009c43cc173Smrg
6010c27c18e8Smrg      mvs*)
6011c27c18e8Smrg        case $cc_basename in
6012c27c18e8Smrg          cxx*)
6013c27c18e8Smrg	    # FIXME: insert proper C++ library support
6014c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6015c27c18e8Smrg	    ;;
6016c27c18e8Smrg	  *)
6017c27c18e8Smrg	    # FIXME: insert proper C++ library support
6018c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6019c27c18e8Smrg	    ;;
6020c27c18e8Smrg	esac
6021c27c18e8Smrg	;;
6022c43cc173Smrg
6023c27c18e8Smrg      netbsd*)
6024c27c18e8Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6025c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6026c27c18e8Smrg	  wlarc=
6027c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6028c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6029c27c18e8Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6030c27c18e8Smrg	fi
6031c27c18e8Smrg	# Workaround some broken pre-1.5 toolchains
6032c27c18e8Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6033c27c18e8Smrg	;;
6034c43cc173Smrg
6035c27c18e8Smrg      *nto* | *qnx*)
6036c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6037c27c18e8Smrg	;;
6038c43cc173Smrg
6039c27c18e8Smrg      openbsd2*)
6040c27c18e8Smrg        # C++ shared libraries are fairly broken
6041c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6042c27c18e8Smrg	;;
6043c43cc173Smrg
6044c27c18e8Smrg      openbsd*)
6045c27c18e8Smrg	if test -f /usr/libexec/ld.so; then
6046c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6047c27c18e8Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6048c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6049c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6050c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6051c27c18e8Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6052c27c18e8Smrg	    _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'
6053c27c18e8Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6054c27c18e8Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6055c27c18e8Smrg	  fi
6056c27c18e8Smrg	  output_verbose_link_cmd=echo
6057c27c18e8Smrg	else
6058c27c18e8Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6059c27c18e8Smrg	fi
6060c27c18e8Smrg	;;
6061c43cc173Smrg
6062c27c18e8Smrg      osf3* | osf4* | osf5*)
6063c27c18e8Smrg        case $cc_basename in
6064c27c18e8Smrg          KCC*)
6065c27c18e8Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6066c27c18e8Smrg
6067c27c18e8Smrg	    # KCC will only create a shared library if the output file
6068c27c18e8Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6069c27c18e8Smrg	    # to its proper name (with version) after linking.
6070c27c18e8Smrg	    _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'
6071c27c18e8Smrg
6072c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6073c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6074c27c18e8Smrg
6075c27c18e8Smrg	    # Archives containing C++ object files must be created using
6076c27c18e8Smrg	    # the KAI C++ compiler.
6077c27c18e8Smrg	    case $host in
6078c27c18e8Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6079c27c18e8Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6080c27c18e8Smrg	    esac
6081c27c18e8Smrg	    ;;
6082c27c18e8Smrg          RCC*)
6083c27c18e8Smrg	    # Rational C++ 2.4.1
6084c27c18e8Smrg	    # FIXME: insert proper C++ library support
6085c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6086c27c18e8Smrg	    ;;
6087c27c18e8Smrg          cxx*)
6088c27c18e8Smrg	    case $host in
6089c27c18e8Smrg	      osf3*)
6090c27c18e8Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6091c27c18e8Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
6092c27c18e8Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6093c27c18e8Smrg		;;
6094c27c18e8Smrg	      *)
6095c27c18e8Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6096c27c18e8Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
6097c27c18e8Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6098c27c18e8Smrg	          echo "-hidden">> $lib.exp~
6099c27c18e8Smrg	          $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 "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
6100c27c18e8Smrg	          $RM $lib.exp'
6101c27c18e8Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6102c27c18e8Smrg		;;
6103c27c18e8Smrg	    esac
6104c43cc173Smrg
6105c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6106c43cc173Smrg
6107c27c18e8Smrg	    # Commands to make compiler produce verbose output that lists
6108c27c18e8Smrg	    # what "hidden" libraries, object files and flags are used when
6109c27c18e8Smrg	    # linking a shared library.
6110c27c18e8Smrg	    #
6111c27c18e8Smrg	    # There doesn't appear to be a way to prevent this compiler from
6112c27c18e8Smrg	    # explicitly linking system object files so we need to strip them
6113c27c18e8Smrg	    # from the output so that they don't get included in the library
6114c27c18e8Smrg	    # dependencies.
6115c27c18e8Smrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
6116c27c18e8Smrg	    ;;
6117c27c18e8Smrg	  *)
6118c27c18e8Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6119c27c18e8Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6120c27c18e8Smrg	      case $host in
6121c27c18e8Smrg	        osf3*)
6122c27c18e8Smrg	          _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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6123c27c18e8Smrg		  ;;
6124c27c18e8Smrg	        *)
6125c27c18e8Smrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6126c27c18e8Smrg		  ;;
6127c27c18e8Smrg	      esac
6128c27c18e8Smrg
6129c27c18e8Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6130c27c18e8Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6131c27c18e8Smrg
6132c27c18e8Smrg	      # Commands to make compiler produce verbose output that lists
6133c27c18e8Smrg	      # what "hidden" libraries, object files and flags are used when
6134c27c18e8Smrg	      # linking a shared library.
6135c27c18e8Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6136c27c18e8Smrg
6137c27c18e8Smrg	    else
6138c27c18e8Smrg	      # FIXME: insert proper C++ library support
6139c27c18e8Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6140c27c18e8Smrg	    fi
6141c27c18e8Smrg	    ;;
6142c27c18e8Smrg        esac
6143c27c18e8Smrg        ;;
6144c43cc173Smrg
6145c27c18e8Smrg      psos*)
6146c27c18e8Smrg        # FIXME: insert proper C++ library support
6147c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6148c27c18e8Smrg        ;;
6149c43cc173Smrg
6150c27c18e8Smrg      sunos4*)
6151c27c18e8Smrg        case $cc_basename in
6152c27c18e8Smrg          CC*)
6153c27c18e8Smrg	    # Sun C++ 4.x
6154c27c18e8Smrg	    # FIXME: insert proper C++ library support
6155c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6156c27c18e8Smrg	    ;;
6157c27c18e8Smrg          lcc*)
6158c27c18e8Smrg	    # Lucid
6159c27c18e8Smrg	    # FIXME: insert proper C++ library support
6160c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6161c27c18e8Smrg	    ;;
6162c27c18e8Smrg          *)
6163c27c18e8Smrg	    # FIXME: insert proper C++ library support
6164c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6165c27c18e8Smrg	    ;;
6166c27c18e8Smrg        esac
6167c27c18e8Smrg        ;;
6168c43cc173Smrg
6169c27c18e8Smrg      solaris*)
6170c27c18e8Smrg        case $cc_basename in
6171c27c18e8Smrg          CC*)
6172c27c18e8Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
6173c27c18e8Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6174c27c18e8Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6175c27c18e8Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6176c27c18e8Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6177c27c18e8Smrg	      $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'
6178c27c18e8Smrg
6179c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6180c27c18e8Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6181c27c18e8Smrg	    case $host_os in
6182c27c18e8Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6183c27c18e8Smrg	      *)
6184c27c18e8Smrg		# The compiler driver will combine and reorder linker options,
6185c27c18e8Smrg		# but understands `-z linker_flag'.
6186c27c18e8Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
6187c27c18e8Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6188c27c18e8Smrg	        ;;
6189c27c18e8Smrg	    esac
6190c27c18e8Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6191c43cc173Smrg
6192c27c18e8Smrg	    output_verbose_link_cmd='echo'
6193c43cc173Smrg
6194c27c18e8Smrg	    # Archives containing C++ object files must be created using
6195c27c18e8Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6196c27c18e8Smrg	    # necessary to make sure instantiated templates are included
6197c27c18e8Smrg	    # in the archive.
6198c27c18e8Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6199c27c18e8Smrg	    ;;
6200c27c18e8Smrg          gcx*)
6201c27c18e8Smrg	    # Green Hills C++ Compiler
6202c27c18e8Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6203c43cc173Smrg
6204c27c18e8Smrg	    # The C++ compiler must be used to create the archive.
6205c27c18e8Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6206c27c18e8Smrg	    ;;
6207c27c18e8Smrg          *)
6208c27c18e8Smrg	    # GNU C++ compiler with Solaris linker
6209c27c18e8Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6210c27c18e8Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6211c27c18e8Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6212c27c18e8Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6213c27c18e8Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6214c27c18e8Smrg		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6215c27c18e8Smrg
6216c27c18e8Smrg	        # Commands to make compiler produce verbose output that lists
6217c27c18e8Smrg	        # what "hidden" libraries, object files and flags are used when
6218c27c18e8Smrg	        # linking a shared library.
6219c27c18e8Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6220c27c18e8Smrg	      else
6221c27c18e8Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
6222c27c18e8Smrg	        # platform.
6223c27c18e8Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6224c27c18e8Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6225c27c18e8Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6226c27c18e8Smrg
6227c27c18e8Smrg	        # Commands to make compiler produce verbose output that lists
6228c27c18e8Smrg	        # what "hidden" libraries, object files and flags are used when
6229c27c18e8Smrg	        # linking a shared library.
6230c27c18e8Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6231c27c18e8Smrg	      fi
6232c27c18e8Smrg
6233c27c18e8Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6234c27c18e8Smrg	      case $host_os in
6235c27c18e8Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6236c27c18e8Smrg		*)
6237c27c18e8Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6238c27c18e8Smrg		  ;;
6239c27c18e8Smrg	      esac
6240c27c18e8Smrg	    fi
6241c27c18e8Smrg	    ;;
6242c27c18e8Smrg        esac
6243c27c18e8Smrg        ;;
6244c43cc173Smrg
6245c27c18e8Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6246c27c18e8Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6247c27c18e8Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6248c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6249c27c18e8Smrg      runpath_var='LD_RUN_PATH'
6250c43cc173Smrg
6251c27c18e8Smrg      case $cc_basename in
6252c27c18e8Smrg        CC*)
6253c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6254c27c18e8Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6255c27c18e8Smrg	  ;;
6256c27c18e8Smrg	*)
6257c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6258c27c18e8Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6259c27c18e8Smrg	  ;;
6260c27c18e8Smrg      esac
6261c27c18e8Smrg      ;;
6262c43cc173Smrg
6263c27c18e8Smrg      sysv5* | sco3.2v5* | sco5v6*)
6264c27c18e8Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
6265c27c18e8Smrg	# link with -lc, and that would cause any symbols used from libc to
6266c27c18e8Smrg	# always be unresolved, which means just about no library would
6267c27c18e8Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
6268c27c18e8Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
6269c27c18e8Smrg	# as -z defs.
6270c27c18e8Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6271c27c18e8Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6272c27c18e8Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6273c27c18e8Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6274c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6275c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6276c27c18e8Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
6277c27c18e8Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6278c27c18e8Smrg	runpath_var='LD_RUN_PATH'
6279c43cc173Smrg
6280c27c18e8Smrg	case $cc_basename in
6281c27c18e8Smrg          CC*)
6282c27c18e8Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6283c27c18e8Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6284c27c18e8Smrg	    ;;
6285c27c18e8Smrg	  *)
6286c27c18e8Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6287c27c18e8Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6288c27c18e8Smrg	    ;;
6289c27c18e8Smrg	esac
6290c27c18e8Smrg      ;;
6291c43cc173Smrg
6292c27c18e8Smrg      tandem*)
6293c27c18e8Smrg        case $cc_basename in
6294c27c18e8Smrg          NCC*)
6295c27c18e8Smrg	    # NonStop-UX NCC 3.20
6296c27c18e8Smrg	    # FIXME: insert proper C++ library support
6297c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6298c27c18e8Smrg	    ;;
6299c27c18e8Smrg          *)
6300c27c18e8Smrg	    # FIXME: insert proper C++ library support
6301c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6302c27c18e8Smrg	    ;;
6303c27c18e8Smrg        esac
6304c27c18e8Smrg        ;;
6305c43cc173Smrg
6306c27c18e8Smrg      vxworks*)
6307c27c18e8Smrg        # FIXME: insert proper C++ library support
6308c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6309c27c18e8Smrg        ;;
6310c43cc173Smrg
6311c27c18e8Smrg      *)
6312c27c18e8Smrg        # FIXME: insert proper C++ library support
6313c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6314c27c18e8Smrg        ;;
6315c27c18e8Smrg    esac
6316c43cc173Smrg
6317c27c18e8Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6318c27c18e8Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6319c27c18e8Smrg
6320c27c18e8Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
6321c27c18e8Smrg    _LT_TAGVAR(LD, $1)="$LD"
6322c27c18e8Smrg
6323c27c18e8Smrg    ## CAVEAT EMPTOR:
6324c27c18e8Smrg    ## There is no encapsulation within the following macros, do not change
6325c27c18e8Smrg    ## the running order or otherwise move them around unless you know exactly
6326c27c18e8Smrg    ## what you are doing...
6327c27c18e8Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
6328c27c18e8Smrg    _LT_COMPILER_PIC($1)
6329c27c18e8Smrg    _LT_COMPILER_C_O($1)
6330c27c18e8Smrg    _LT_COMPILER_FILE_LOCKS($1)
6331c27c18e8Smrg    _LT_LINKER_SHLIBS($1)
6332c27c18e8Smrg    _LT_SYS_DYNAMIC_LINKER($1)
6333c27c18e8Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6334c27c18e8Smrg
6335c27c18e8Smrg    _LT_CONFIG($1)
6336c27c18e8Smrg  fi # test -n "$compiler"
6337c27c18e8Smrg
6338c27c18e8Smrg  CC=$lt_save_CC
6339c27c18e8Smrg  LDCXX=$LD
6340c27c18e8Smrg  LD=$lt_save_LD
6341c27c18e8Smrg  GCC=$lt_save_GCC
6342c27c18e8Smrg  with_gnu_ld=$lt_save_with_gnu_ld
6343c27c18e8Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
6344c27c18e8Smrg  lt_cv_path_LD=$lt_save_path_LD
6345c27c18e8Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6346c27c18e8Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6347c27c18e8Smrgfi # test "$_lt_caught_CXX_error" != yes
6348c43cc173Smrg
6349c27c18e8SmrgAC_LANG_POP
6350c27c18e8Smrg])# _LT_LANG_CXX_CONFIG
6351c43cc173Smrg
6352c43cc173Smrg
6353c27c18e8Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6354c27c18e8Smrg# ---------------------------------
6355c27c18e8Smrg# Figure out "hidden" library dependencies from verbose
6356c27c18e8Smrg# compiler output when linking a shared library.
6357c27c18e8Smrg# Parse the compiler output and extract the necessary
6358c27c18e8Smrg# objects, libraries and library flags.
6359c27c18e8Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6360c27c18e8Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6361c27c18e8Smrg# Dependencies to place before and after the object being linked:
6362c27c18e8Smrg_LT_TAGVAR(predep_objects, $1)=
6363c27c18e8Smrg_LT_TAGVAR(postdep_objects, $1)=
6364c27c18e8Smrg_LT_TAGVAR(predeps, $1)=
6365c27c18e8Smrg_LT_TAGVAR(postdeps, $1)=
6366c27c18e8Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
6367c43cc173Smrg
6368c27c18e8Smrgdnl we can't use the lt_simple_compile_test_code here,
6369c27c18e8Smrgdnl because it contains code intended for an executable,
6370c27c18e8Smrgdnl not a library.  It's possible we should let each
6371c27c18e8Smrgdnl tag define a new lt_????_link_test_code variable,
6372c27c18e8Smrgdnl but it's only used here...
6373c27c18e8Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6374c27c18e8Smrgint a;
6375c27c18e8Smrgvoid foo (void) { a = 0; }
6376c27c18e8Smrg_LT_EOF
6377c27c18e8Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6378c27c18e8Smrgclass Foo
6379c27c18e8Smrg{
6380c27c18e8Smrgpublic:
6381c27c18e8Smrg  Foo (void) { a = 0; }
6382c27c18e8Smrgprivate:
6383c27c18e8Smrg  int a;
6384c27c18e8Smrg};
6385c27c18e8Smrg_LT_EOF
6386c27c18e8Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6387c27c18e8Smrg      subroutine foo
6388c27c18e8Smrg      implicit none
6389c27c18e8Smrg      integer*4 a
6390c27c18e8Smrg      a=0
6391c27c18e8Smrg      return
6392c27c18e8Smrg      end
6393c27c18e8Smrg_LT_EOF
6394c27c18e8Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6395c27c18e8Smrg      subroutine foo
6396c27c18e8Smrg      implicit none
6397c27c18e8Smrg      integer a
6398c27c18e8Smrg      a=0
6399c27c18e8Smrg      return
6400c27c18e8Smrg      end
6401c27c18e8Smrg_LT_EOF
6402c27c18e8Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6403c27c18e8Smrgpublic class foo {
6404c27c18e8Smrg  private int a;
6405c27c18e8Smrg  public void bar (void) {
6406c27c18e8Smrg    a = 0;
6407c27c18e8Smrg  }
6408c27c18e8Smrg};
6409c27c18e8Smrg_LT_EOF
6410c27c18e8Smrg])
6411c27c18e8Smrgdnl Parse the compiler output and extract the necessary
6412c27c18e8Smrgdnl objects, libraries and library flags.
6413c27c18e8Smrgif AC_TRY_EVAL(ac_compile); then
6414c27c18e8Smrg  # Parse the compiler output and extract the necessary
6415c27c18e8Smrg  # objects, libraries and library flags.
6416c43cc173Smrg
6417c27c18e8Smrg  # Sentinel used to keep track of whether or not we are before
6418c27c18e8Smrg  # the conftest object file.
6419c27c18e8Smrg  pre_test_object_deps_done=no
6420c43cc173Smrg
6421c27c18e8Smrg  for p in `eval "$output_verbose_link_cmd"`; do
6422c27c18e8Smrg    case $p in
6423c43cc173Smrg
6424c27c18e8Smrg    -L* | -R* | -l*)
6425c27c18e8Smrg       # Some compilers place space between "-{L,R}" and the path.
6426c27c18e8Smrg       # Remove the space.
6427c27c18e8Smrg       if test $p = "-L" ||
6428c27c18e8Smrg          test $p = "-R"; then
6429c27c18e8Smrg	 prev=$p
6430c27c18e8Smrg	 continue
6431c27c18e8Smrg       else
6432c27c18e8Smrg	 prev=
6433c27c18e8Smrg       fi
6434c43cc173Smrg
6435c27c18e8Smrg       if test "$pre_test_object_deps_done" = no; then
6436c27c18e8Smrg	 case $p in
6437c27c18e8Smrg	 -L* | -R*)
6438c27c18e8Smrg	   # Internal compiler library paths should come after those
6439c27c18e8Smrg	   # provided the user.  The postdeps already come after the
6440c27c18e8Smrg	   # user supplied libs so there is no need to process them.
6441c27c18e8Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
6442c27c18e8Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
6443c27c18e8Smrg	   else
6444c27c18e8Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
6445c27c18e8Smrg	   fi
6446c27c18e8Smrg	   ;;
6447c27c18e8Smrg	 # The "-l" case would never come before the object being
6448c27c18e8Smrg	 # linked, so don't bother handling this case.
6449c27c18e8Smrg	 esac
6450c27c18e8Smrg       else
6451c27c18e8Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
6452c27c18e8Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
6453c27c18e8Smrg	 else
6454c27c18e8Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
6455c27c18e8Smrg	 fi
6456c27c18e8Smrg       fi
6457c27c18e8Smrg       ;;
6458c43cc173Smrg
6459c27c18e8Smrg    *.$objext)
6460c27c18e8Smrg       # This assumes that the test object file only shows up
6461c27c18e8Smrg       # once in the compiler output.
6462c27c18e8Smrg       if test "$p" = "conftest.$objext"; then
6463c27c18e8Smrg	 pre_test_object_deps_done=yes
6464c27c18e8Smrg	 continue
6465c27c18e8Smrg       fi
6466c43cc173Smrg
6467c27c18e8Smrg       if test "$pre_test_object_deps_done" = no; then
6468c27c18e8Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
6469c27c18e8Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
6470c27c18e8Smrg	 else
6471c27c18e8Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
6472c27c18e8Smrg	 fi
6473c27c18e8Smrg       else
6474c27c18e8Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
6475c27c18e8Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
6476c27c18e8Smrg	 else
6477c27c18e8Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
6478c27c18e8Smrg	 fi
6479c27c18e8Smrg       fi
6480c27c18e8Smrg       ;;
6481c43cc173Smrg
6482c27c18e8Smrg    *) ;; # Ignore the rest.
6483c43cc173Smrg
6484c27c18e8Smrg    esac
6485c27c18e8Smrg  done
6486c43cc173Smrg
6487c27c18e8Smrg  # Clean up.
6488c27c18e8Smrg  rm -f a.out a.exe
6489c43cc173Smrgelse
6490c27c18e8Smrg  echo "libtool.m4: error: problem compiling $1 test program"
6491c43cc173Smrgfi
6492c43cc173Smrg
6493c27c18e8Smrg$RM -f confest.$objext
6494c43cc173Smrg
6495c27c18e8Smrg# PORTME: override above test on systems where it is broken
6496c27c18e8Smrgm4_if([$1], [CXX],
6497c27c18e8Smrg[case $host_os in
6498c27c18e8Smrginterix[[3-9]]*)
6499c27c18e8Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
6500c27c18e8Smrg  # hack all around it, let's just trust "g++" to DTRT.
6501c27c18e8Smrg  _LT_TAGVAR(predep_objects,$1)=
6502c27c18e8Smrg  _LT_TAGVAR(postdep_objects,$1)=
6503c27c18e8Smrg  _LT_TAGVAR(postdeps,$1)=
6504c27c18e8Smrg  ;;
6505c43cc173Smrg
6506c27c18e8Smrglinux*)
6507c27c18e8Smrg  case `$CC -V 2>&1 | sed 5q` in
6508c27c18e8Smrg  *Sun\ C*)
6509c27c18e8Smrg    # Sun C++ 5.9
6510c43cc173Smrg
6511c27c18e8Smrg    # The more standards-conforming stlport4 library is
6512c27c18e8Smrg    # incompatible with the Cstd library. Avoid specifying
6513c27c18e8Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
6514c27c18e8Smrg    # -library=stlport4 depends on it.
6515c27c18e8Smrg    case " $CXX $CXXFLAGS " in
6516c27c18e8Smrg    *" -library=stlport4 "*)
6517c27c18e8Smrg      solaris_use_stlport4=yes
6518c27c18e8Smrg      ;;
6519c27c18e8Smrg    esac
6520c43cc173Smrg
6521c27c18e8Smrg    if test "$solaris_use_stlport4" != yes; then
6522c27c18e8Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6523c27c18e8Smrg    fi
6524c27c18e8Smrg    ;;
6525c27c18e8Smrg  esac
6526c27c18e8Smrg  ;;
6527c27c18e8Smrg
6528c27c18e8Smrgsolaris*)
6529c27c18e8Smrg  case $cc_basename in
6530c27c18e8Smrg  CC*)
6531c27c18e8Smrg    # The more standards-conforming stlport4 library is
6532c27c18e8Smrg    # incompatible with the Cstd library. Avoid specifying
6533c27c18e8Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
6534c27c18e8Smrg    # -library=stlport4 depends on it.
6535c27c18e8Smrg    case " $CXX $CXXFLAGS " in
6536c27c18e8Smrg    *" -library=stlport4 "*)
6537c27c18e8Smrg      solaris_use_stlport4=yes
6538c27c18e8Smrg      ;;
6539c27c18e8Smrg    esac
6540c43cc173Smrg
6541c27c18e8Smrg    # Adding this requires a known-good setup of shared libraries for
6542c27c18e8Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
6543c27c18e8Smrg    # archive will be linked into the output, leading to subtle bugs.
6544c27c18e8Smrg    if test "$solaris_use_stlport4" != yes; then
6545c27c18e8Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6546c27c18e8Smrg    fi
6547c27c18e8Smrg    ;;
6548c27c18e8Smrg  esac
6549c27c18e8Smrg  ;;
6550c27c18e8Smrgesac
6551c27c18e8Smrg])
6552c43cc173Smrg
6553c27c18e8Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
6554c27c18e8Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
6555c27c18e8Smrgesac
6556c27c18e8Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
6557c27c18e8Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
6558c27c18e8Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
6559c27c18e8Smrgfi
6560c27c18e8Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
6561c27c18e8Smrg    [The directories searched by this compiler when creating a shared library])
6562c27c18e8Smrg_LT_TAGDECL([], [predep_objects], [1],
6563c27c18e8Smrg    [Dependencies to place before and after the objects being linked to
6564c27c18e8Smrg    create a shared library])
6565c27c18e8Smrg_LT_TAGDECL([], [postdep_objects], [1])
6566c27c18e8Smrg_LT_TAGDECL([], [predeps], [1])
6567c27c18e8Smrg_LT_TAGDECL([], [postdeps], [1])
6568c27c18e8Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
6569c27c18e8Smrg    [The library search path used internally by the compiler when linking
6570c27c18e8Smrg    a shared library])
6571c27c18e8Smrg])# _LT_SYS_HIDDEN_LIBDEPS
6572c27c18e8Smrg
6573c27c18e8Smrg
6574c27c18e8Smrg# _LT_PROG_F77
6575c27c18e8Smrg# ------------
6576c27c18e8Smrg# Since AC_PROG_F77 is broken, in that it returns the empty string
6577c27c18e8Smrg# if there is no fortran compiler, we have our own version here.
6578c27c18e8Smrgm4_defun([_LT_PROG_F77],
6579c43cc173Smrg[
6580c27c18e8Smrgpushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
6581c27c18e8SmrgAC_PROG_F77
6582c27c18e8Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
6583c27c18e8Smrg  _lt_disable_F77=yes
6584c27c18e8Smrgfi
6585c27c18e8Smrgpopdef([AC_MSG_ERROR])
6586c27c18e8Smrg])# _LT_PROG_F77
6587c43cc173Smrg
6588c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
6589c27c18e8Smrgdnl AC_DEFUN([_LT_PROG_F77], [])
6590c43cc173Smrg
6591c43cc173Smrg
6592c27c18e8Smrg# _LT_LANG_F77_CONFIG([TAG])
6593c27c18e8Smrg# --------------------------
6594c27c18e8Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
6595c27c18e8Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
6596c27c18e8Smrg# to write the compiler configuration to `libtool'.
6597c27c18e8Smrgm4_defun([_LT_LANG_F77_CONFIG],
6598c27c18e8Smrg[AC_REQUIRE([_LT_PROG_F77])dnl
6599c27c18e8SmrgAC_LANG_PUSH(Fortran 77)
6600c43cc173Smrg
6601c27c18e8Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6602c27c18e8Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
6603c27c18e8Smrg_LT_TAGVAR(always_export_symbols, $1)=no
6604c27c18e8Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6605c27c18e8Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6606c27c18e8Smrg_LT_TAGVAR(hardcode_direct, $1)=no
6607c27c18e8Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6608c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6609c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6610c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6611c27c18e8Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6612c27c18e8Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
6613c27c18e8Smrg_LT_TAGVAR(inherit_rpath, $1)=no
6614c27c18e8Smrg_LT_TAGVAR(module_cmds, $1)=
6615c27c18e8Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
6616c27c18e8Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6617c27c18e8Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6618c27c18e8Smrg_LT_TAGVAR(no_undefined_flag, $1)=
6619c27c18e8Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6620c27c18e8Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6621c43cc173Smrg
6622c27c18e8Smrg# Source file extension for f77 test sources.
6623c27c18e8Smrgac_ext=f
6624c43cc173Smrg
6625c27c18e8Smrg# Object file extension for compiled f77 test sources.
6626c27c18e8Smrgobjext=o
6627c27c18e8Smrg_LT_TAGVAR(objext, $1)=$objext
6628c27c18e8Smrg
6629c27c18e8Smrg# No sense in running all these tests if we already determined that
6630c27c18e8Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
6631c27c18e8Smrg# are currently assumed to apply to all compilers on this platform,
6632c27c18e8Smrg# and will be corrupted by setting them based on a non-working compiler.
6633c27c18e8Smrgif test "$_lt_disable_F77" != yes; then
6634c27c18e8Smrg  # Code to be used in simple compile tests
6635c27c18e8Smrg  lt_simple_compile_test_code="\
6636c27c18e8Smrg      subroutine t
6637c27c18e8Smrg      return
6638c27c18e8Smrg      end
6639c27c18e8Smrg"
6640c43cc173Smrg
6641c27c18e8Smrg  # Code to be used in simple link tests
6642c27c18e8Smrg  lt_simple_link_test_code="\
6643c27c18e8Smrg      program t
6644c27c18e8Smrg      end
6645c27c18e8Smrg"
6646c43cc173Smrg
6647c27c18e8Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6648c27c18e8Smrg  _LT_TAG_COMPILER
6649c43cc173Smrg
6650c27c18e8Smrg  # save warnings/boilerplate of simple test code
6651c27c18e8Smrg  _LT_COMPILER_BOILERPLATE
6652c27c18e8Smrg  _LT_LINKER_BOILERPLATE
6653c43cc173Smrg
6654c27c18e8Smrg  # Allow CC to be a program name with arguments.
6655c27c18e8Smrg  lt_save_CC="$CC"
6656c27c18e8Smrg  lt_save_GCC=$GCC
6657c27c18e8Smrg  CC=${F77-"f77"}
6658c27c18e8Smrg  compiler=$CC
6659c27c18e8Smrg  _LT_TAGVAR(compiler, $1)=$CC
6660c27c18e8Smrg  _LT_CC_BASENAME([$compiler])
6661c27c18e8Smrg  GCC=$G77
6662c27c18e8Smrg  if test -n "$compiler"; then
6663c27c18e8Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
6664c27c18e8Smrg    AC_MSG_RESULT([$can_build_shared])
6665c43cc173Smrg
6666c27c18e8Smrg    AC_MSG_CHECKING([whether to build shared libraries])
6667c27c18e8Smrg    test "$can_build_shared" = "no" && enable_shared=no
6668c43cc173Smrg
6669c27c18e8Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
6670c27c18e8Smrg    # are all built from PIC.
6671c27c18e8Smrg    case $host_os in
6672c27c18e8Smrg      aix3*)
6673c27c18e8Smrg        test "$enable_shared" = yes && enable_static=no
6674c27c18e8Smrg        if test -n "$RANLIB"; then
6675c27c18e8Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
6676c27c18e8Smrg          postinstall_cmds='$RANLIB $lib'
6677c27c18e8Smrg        fi
6678c27c18e8Smrg        ;;
6679c27c18e8Smrg      aix[[4-9]]*)
6680c27c18e8Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6681c27c18e8Smrg	  test "$enable_shared" = yes && enable_static=no
6682c27c18e8Smrg	fi
6683c27c18e8Smrg        ;;
6684c27c18e8Smrg    esac
6685c27c18e8Smrg    AC_MSG_RESULT([$enable_shared])
6686c27c18e8Smrg
6687c27c18e8Smrg    AC_MSG_CHECKING([whether to build static libraries])
6688c27c18e8Smrg    # Make sure either enable_shared or enable_static is yes.
6689c27c18e8Smrg    test "$enable_shared" = yes || enable_static=yes
6690c27c18e8Smrg    AC_MSG_RESULT([$enable_static])
6691c27c18e8Smrg
6692c27c18e8Smrg    _LT_TAGVAR(GCC, $1)="$G77"
6693c27c18e8Smrg    _LT_TAGVAR(LD, $1)="$LD"
6694c27c18e8Smrg
6695c27c18e8Smrg    ## CAVEAT EMPTOR:
6696c27c18e8Smrg    ## There is no encapsulation within the following macros, do not change
6697c27c18e8Smrg    ## the running order or otherwise move them around unless you know exactly
6698c27c18e8Smrg    ## what you are doing...
6699c27c18e8Smrg    _LT_COMPILER_PIC($1)
6700c27c18e8Smrg    _LT_COMPILER_C_O($1)
6701c27c18e8Smrg    _LT_COMPILER_FILE_LOCKS($1)
6702c27c18e8Smrg    _LT_LINKER_SHLIBS($1)
6703c27c18e8Smrg    _LT_SYS_DYNAMIC_LINKER($1)
6704c27c18e8Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6705c27c18e8Smrg
6706c27c18e8Smrg    _LT_CONFIG($1)
6707c27c18e8Smrg  fi # test -n "$compiler"
6708c27c18e8Smrg
6709c27c18e8Smrg  GCC=$lt_save_GCC
6710c27c18e8Smrg  CC="$lt_save_CC"
6711c27c18e8Smrgfi # test "$_lt_disable_F77" != yes
6712c43cc173Smrg
6713c27c18e8SmrgAC_LANG_POP
6714c27c18e8Smrg])# _LT_LANG_F77_CONFIG
6715c43cc173Smrg
6716c43cc173Smrg
6717c27c18e8Smrg# _LT_PROG_FC
6718c27c18e8Smrg# -----------
6719c27c18e8Smrg# Since AC_PROG_FC is broken, in that it returns the empty string
6720c27c18e8Smrg# if there is no fortran compiler, we have our own version here.
6721c27c18e8Smrgm4_defun([_LT_PROG_FC],
6722c27c18e8Smrg[
6723c27c18e8Smrgpushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
6724c27c18e8SmrgAC_PROG_FC
6725c27c18e8Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
6726c27c18e8Smrg  _lt_disable_FC=yes
6727c27c18e8Smrgfi
6728c27c18e8Smrgpopdef([AC_MSG_ERROR])
6729c27c18e8Smrg])# _LT_PROG_FC
6730c43cc173Smrg
6731c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
6732c27c18e8Smrgdnl AC_DEFUN([_LT_PROG_FC], [])
6733c43cc173Smrg
6734c43cc173Smrg
6735c27c18e8Smrg# _LT_LANG_FC_CONFIG([TAG])
6736c27c18e8Smrg# -------------------------
6737c27c18e8Smrg# Ensure that the configuration variables for a Fortran compiler are
6738c27c18e8Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
6739c27c18e8Smrg# to write the compiler configuration to `libtool'.
6740c27c18e8Smrgm4_defun([_LT_LANG_FC_CONFIG],
6741c27c18e8Smrg[AC_REQUIRE([_LT_PROG_FC])dnl
6742c27c18e8SmrgAC_LANG_PUSH(Fortran)
6743c27c18e8Smrg
6744c27c18e8Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6745c27c18e8Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
6746c27c18e8Smrg_LT_TAGVAR(always_export_symbols, $1)=no
6747c27c18e8Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6748c27c18e8Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6749c27c18e8Smrg_LT_TAGVAR(hardcode_direct, $1)=no
6750c27c18e8Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6751c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6752c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6753c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6754c27c18e8Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6755c27c18e8Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
6756c27c18e8Smrg_LT_TAGVAR(inherit_rpath, $1)=no
6757c27c18e8Smrg_LT_TAGVAR(module_cmds, $1)=
6758c27c18e8Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
6759c27c18e8Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6760c27c18e8Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6761c27c18e8Smrg_LT_TAGVAR(no_undefined_flag, $1)=
6762c27c18e8Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6763c27c18e8Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6764c27c18e8Smrg
6765c27c18e8Smrg# Source file extension for fc test sources.
6766c27c18e8Smrgac_ext=${ac_fc_srcext-f}
6767c27c18e8Smrg
6768c27c18e8Smrg# Object file extension for compiled fc test sources.
6769c27c18e8Smrgobjext=o
6770c27c18e8Smrg_LT_TAGVAR(objext, $1)=$objext
6771c27c18e8Smrg
6772c27c18e8Smrg# No sense in running all these tests if we already determined that
6773c27c18e8Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
6774c27c18e8Smrg# are currently assumed to apply to all compilers on this platform,
6775c27c18e8Smrg# and will be corrupted by setting them based on a non-working compiler.
6776c27c18e8Smrgif test "$_lt_disable_FC" != yes; then
6777c27c18e8Smrg  # Code to be used in simple compile tests
6778c27c18e8Smrg  lt_simple_compile_test_code="\
6779c27c18e8Smrg      subroutine t
6780c27c18e8Smrg      return
6781c27c18e8Smrg      end
6782c27c18e8Smrg"
6783c43cc173Smrg
6784c27c18e8Smrg  # Code to be used in simple link tests
6785c27c18e8Smrg  lt_simple_link_test_code="\
6786c27c18e8Smrg      program t
6787c27c18e8Smrg      end
6788c27c18e8Smrg"
6789c43cc173Smrg
6790c27c18e8Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6791c27c18e8Smrg  _LT_TAG_COMPILER
6792c43cc173Smrg
6793c27c18e8Smrg  # save warnings/boilerplate of simple test code
6794c27c18e8Smrg  _LT_COMPILER_BOILERPLATE
6795c27c18e8Smrg  _LT_LINKER_BOILERPLATE
6796c43cc173Smrg
6797c27c18e8Smrg  # Allow CC to be a program name with arguments.
6798c27c18e8Smrg  lt_save_CC="$CC"
6799c27c18e8Smrg  lt_save_GCC=$GCC
6800c27c18e8Smrg  CC=${FC-"f95"}
6801c27c18e8Smrg  compiler=$CC
6802c27c18e8Smrg  GCC=$ac_cv_fc_compiler_gnu
6803c43cc173Smrg
6804c27c18e8Smrg  _LT_TAGVAR(compiler, $1)=$CC
6805c27c18e8Smrg  _LT_CC_BASENAME([$compiler])
6806c27c18e8Smrg
6807c27c18e8Smrg  if test -n "$compiler"; then
6808c27c18e8Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
6809c27c18e8Smrg    AC_MSG_RESULT([$can_build_shared])
6810c27c18e8Smrg
6811c27c18e8Smrg    AC_MSG_CHECKING([whether to build shared libraries])
6812c27c18e8Smrg    test "$can_build_shared" = "no" && enable_shared=no
6813c27c18e8Smrg
6814c27c18e8Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
6815c27c18e8Smrg    # are all built from PIC.
6816c43cc173Smrg    case $host_os in
6817c27c18e8Smrg      aix3*)
6818c27c18e8Smrg        test "$enable_shared" = yes && enable_static=no
6819c27c18e8Smrg        if test -n "$RANLIB"; then
6820c27c18e8Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
6821c27c18e8Smrg          postinstall_cmds='$RANLIB $lib'
6822c27c18e8Smrg        fi
6823c27c18e8Smrg        ;;
682421e67964Smrg      aix[[4-9]]*)
6825c27c18e8Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6826c27c18e8Smrg	  test "$enable_shared" = yes && enable_static=no
6827c43cc173Smrg	fi
6828c27c18e8Smrg        ;;
6829c43cc173Smrg    esac
6830c27c18e8Smrg    AC_MSG_RESULT([$enable_shared])
6831c27c18e8Smrg
6832c27c18e8Smrg    AC_MSG_CHECKING([whether to build static libraries])
6833c27c18e8Smrg    # Make sure either enable_shared or enable_static is yes.
6834c27c18e8Smrg    test "$enable_shared" = yes || enable_static=yes
6835c27c18e8Smrg    AC_MSG_RESULT([$enable_static])
6836c27c18e8Smrg
6837c27c18e8Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
6838c27c18e8Smrg    _LT_TAGVAR(LD, $1)="$LD"
6839c27c18e8Smrg
6840c27c18e8Smrg    ## CAVEAT EMPTOR:
6841c27c18e8Smrg    ## There is no encapsulation within the following macros, do not change
6842c27c18e8Smrg    ## the running order or otherwise move them around unless you know exactly
6843c27c18e8Smrg    ## what you are doing...
6844c27c18e8Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
6845c27c18e8Smrg    _LT_COMPILER_PIC($1)
6846c27c18e8Smrg    _LT_COMPILER_C_O($1)
6847c27c18e8Smrg    _LT_COMPILER_FILE_LOCKS($1)
6848c27c18e8Smrg    _LT_LINKER_SHLIBS($1)
6849c27c18e8Smrg    _LT_SYS_DYNAMIC_LINKER($1)
6850c27c18e8Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6851c27c18e8Smrg
6852c27c18e8Smrg    _LT_CONFIG($1)
6853c27c18e8Smrg  fi # test -n "$compiler"
6854c27c18e8Smrg
6855c27c18e8Smrg  GCC=$lt_save_GCC
6856c27c18e8Smrg  CC="$lt_save_CC"
6857c27c18e8Smrgfi # test "$_lt_disable_FC" != yes
685821e67964Smrg
6859c27c18e8SmrgAC_LANG_POP
6860c27c18e8Smrg])# _LT_LANG_FC_CONFIG
686121e67964Smrg
686221e67964Smrg
6863c27c18e8Smrg# _LT_LANG_GCJ_CONFIG([TAG])
6864c27c18e8Smrg# --------------------------
6865c27c18e8Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
6866c27c18e8Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
6867c27c18e8Smrg# to write the compiler configuration to `libtool'.
6868c27c18e8Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
6869c27c18e8Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
6870c27c18e8SmrgAC_LANG_SAVE
687121e67964Smrg
6872c27c18e8Smrg# Source file extension for Java test sources.
6873c27c18e8Smrgac_ext=java
6874c27c18e8Smrg
6875c27c18e8Smrg# Object file extension for compiled Java test sources.
6876c27c18e8Smrgobjext=o
6877c27c18e8Smrg_LT_TAGVAR(objext, $1)=$objext
6878c27c18e8Smrg
6879c27c18e8Smrg# Code to be used in simple compile tests
6880c27c18e8Smrglt_simple_compile_test_code="class foo {}"
6881c27c18e8Smrg
6882c27c18e8Smrg# Code to be used in simple link tests
6883c27c18e8Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
6884c27c18e8Smrg
6885c27c18e8Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6886c27c18e8Smrg_LT_TAG_COMPILER
6887c27c18e8Smrg
6888c27c18e8Smrg# save warnings/boilerplate of simple test code
6889c27c18e8Smrg_LT_COMPILER_BOILERPLATE
6890c27c18e8Smrg_LT_LINKER_BOILERPLATE
6891c27c18e8Smrg
6892c27c18e8Smrg# Allow CC to be a program name with arguments.
6893c27c18e8Smrglt_save_CC="$CC"
6894c27c18e8Smrglt_save_GCC=$GCC
6895c27c18e8SmrgGCC=yes
6896c27c18e8SmrgCC=${GCJ-"gcj"}
6897c27c18e8Smrgcompiler=$CC
6898c27c18e8Smrg_LT_TAGVAR(compiler, $1)=$CC
6899c27c18e8Smrg_LT_TAGVAR(LD, $1)="$LD"
6900c27c18e8Smrg_LT_CC_BASENAME([$compiler])
6901c27c18e8Smrg
6902c27c18e8Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
6903c27c18e8Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6904c27c18e8Smrg
6905c27c18e8Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6906c27c18e8Smrg
6907c27c18e8Smrgif test -n "$compiler"; then
6908c27c18e8Smrg  _LT_COMPILER_NO_RTTI($1)
6909c27c18e8Smrg  _LT_COMPILER_PIC($1)
6910c27c18e8Smrg  _LT_COMPILER_C_O($1)
6911c27c18e8Smrg  _LT_COMPILER_FILE_LOCKS($1)
6912c27c18e8Smrg  _LT_LINKER_SHLIBS($1)
6913c27c18e8Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
6914c27c18e8Smrg
6915c27c18e8Smrg  _LT_CONFIG($1)
6916c27c18e8Smrgfi
6917c27c18e8Smrg
6918c27c18e8SmrgAC_LANG_RESTORE
6919c27c18e8Smrg
6920c27c18e8SmrgGCC=$lt_save_GCC
6921c27c18e8SmrgCC="$lt_save_CC"
6922c27c18e8Smrg])# _LT_LANG_GCJ_CONFIG
6923c27c18e8Smrg
6924c27c18e8Smrg
6925c27c18e8Smrg# _LT_LANG_RC_CONFIG([TAG])
6926c27c18e8Smrg# -------------------------
6927c27c18e8Smrg# Ensure that the configuration variables for the Windows resource compiler
6928c27c18e8Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
6929c27c18e8Smrg# to write the compiler configuration to `libtool'.
6930c27c18e8Smrgm4_defun([_LT_LANG_RC_CONFIG],
6931c27c18e8Smrg[AC_REQUIRE([LT_PROG_RC])dnl
6932c27c18e8SmrgAC_LANG_SAVE
6933c27c18e8Smrg
6934c27c18e8Smrg# Source file extension for RC test sources.
6935c27c18e8Smrgac_ext=rc
693621e67964Smrg
6937c27c18e8Smrg# Object file extension for compiled RC test sources.
6938c27c18e8Smrgobjext=o
6939c27c18e8Smrg_LT_TAGVAR(objext, $1)=$objext
694021e67964Smrg
6941c27c18e8Smrg# Code to be used in simple compile tests
6942c27c18e8Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
694321e67964Smrg
6944c27c18e8Smrg# Code to be used in simple link tests
6945c27c18e8Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
694621e67964Smrg
6947c27c18e8Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6948c27c18e8Smrg_LT_TAG_COMPILER
694921e67964Smrg
6950c27c18e8Smrg# save warnings/boilerplate of simple test code
6951c27c18e8Smrg_LT_COMPILER_BOILERPLATE
6952c27c18e8Smrg_LT_LINKER_BOILERPLATE
695321e67964Smrg
6954c27c18e8Smrg# Allow CC to be a program name with arguments.
6955c27c18e8Smrglt_save_CC="$CC"
6956c27c18e8Smrglt_save_GCC=$GCC
6957c27c18e8SmrgGCC=
6958c27c18e8SmrgCC=${RC-"windres"}
6959c27c18e8Smrgcompiler=$CC
6960c27c18e8Smrg_LT_TAGVAR(compiler, $1)=$CC
6961c27c18e8Smrg_LT_CC_BASENAME([$compiler])
6962c27c18e8Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
696321e67964Smrg
6964c27c18e8Smrgif test -n "$compiler"; then
6965c27c18e8Smrg  :
6966c27c18e8Smrg  _LT_CONFIG($1)
6967c27c18e8Smrgfi
696821e67964Smrg
6969c27c18e8SmrgGCC=$lt_save_GCC
6970c27c18e8SmrgAC_LANG_RESTORE
6971c27c18e8SmrgCC="$lt_save_CC"
6972c27c18e8Smrg])# _LT_LANG_RC_CONFIG
697321e67964Smrg
697421e67964Smrg
6975c27c18e8Smrg# LT_PROG_GCJ
6976c27c18e8Smrg# -----------
6977c27c18e8SmrgAC_DEFUN([LT_PROG_GCJ],
6978c27c18e8Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
6979c27c18e8Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
6980c27c18e8Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
6981c27c18e8Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
6982c27c18e8Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
6983c27c18e8Smrg])
698421e67964Smrg
6985c27c18e8Smrg# Old name:
6986c27c18e8SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
6987c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
6988c27c18e8Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
698921e67964Smrg
699021e67964Smrg
6991c27c18e8Smrg# LT_PROG_RC
6992c27c18e8Smrg# ----------
6993c27c18e8SmrgAC_DEFUN([LT_PROG_RC],
6994c27c18e8Smrg[AC_CHECK_TOOL(RC, windres,)
6995c27c18e8Smrg])
699621e67964Smrg
6997c27c18e8Smrg# Old name:
6998c27c18e8SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
6999c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
7000c27c18e8Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
700121e67964Smrg
700221e67964Smrg
7003c27c18e8Smrg# _LT_DECL_EGREP
7004c27c18e8Smrg# --------------
7005c27c18e8Smrg# If we don't have a new enough Autoconf to choose the best grep
7006c27c18e8Smrg# available, choose the one first in the user's PATH.
7007c27c18e8Smrgm4_defun([_LT_DECL_EGREP],
7008c27c18e8Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
7009c27c18e8SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
7010c27c18e8Smrgtest -z "$GREP" && GREP=grep
7011c27c18e8Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7012c27c18e8Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
7013c27c18e8Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
7014c27c18e8Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7015c27c18e8SmrgAC_SUBST([GREP])
7016c27c18e8Smrg])
701721e67964Smrg
701821e67964Smrg
7019c27c18e8Smrg# _LT_DECL_OBJDUMP
7020c27c18e8Smrg# --------------
7021c27c18e8Smrg# If we don't have a new enough Autoconf to choose the best objdump
7022c27c18e8Smrg# available, choose the one first in the user's PATH.
7023c27c18e8Smrgm4_defun([_LT_DECL_OBJDUMP],
7024c27c18e8Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
7025c27c18e8Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
7026c27c18e8Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7027c27c18e8SmrgAC_SUBST([OBJDUMP])
7028c27c18e8Smrg])
702921e67964Smrg
703021e67964Smrg
7031c27c18e8Smrg# _LT_DECL_SED
7032c27c18e8Smrg# ------------
7033c27c18e8Smrg# Check for a fully-functional sed program, that truncates
7034c27c18e8Smrg# as few characters as possible.  Prefer GNU sed if found.
7035c27c18e8Smrgm4_defun([_LT_DECL_SED],
7036c27c18e8Smrg[AC_PROG_SED
7037c27c18e8Smrgtest -z "$SED" && SED=sed
7038c27c18e8SmrgXsed="$SED -e 1s/^X//"
7039c27c18e8Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7040c27c18e8Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7041c27c18e8Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7042c27c18e8Smrg])# _LT_DECL_SED
704321e67964Smrg
7044c27c18e8Smrgm4_ifndef([AC_PROG_SED], [
7045c27c18e8Smrg# NOTE: This macro has been submitted for inclusion into   #
7046c27c18e8Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
7047c27c18e8Smrg#  a released version of Autoconf we should remove this    #
7048c27c18e8Smrg#  macro and use it instead.                               #
7049c27c18e8Smrg
7050c27c18e8Smrgm4_defun([AC_PROG_SED],
7051c27c18e8Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
7052c27c18e8SmrgAC_CACHE_VAL(lt_cv_path_SED,
7053c27c18e8Smrg[# Loop through the user's path and test for sed and gsed.
7054c27c18e8Smrg# Then use that list of sed's as ones to test for truncation.
7055c27c18e8Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7056c27c18e8Smrgfor as_dir in $PATH
7057c27c18e8Smrgdo
7058c27c18e8Smrg  IFS=$as_save_IFS
7059c27c18e8Smrg  test -z "$as_dir" && as_dir=.
7060c27c18e8Smrg  for lt_ac_prog in sed gsed; do
7061c27c18e8Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
7062c27c18e8Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7063c27c18e8Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7064c27c18e8Smrg      fi
7065c27c18e8Smrg    done
7066c27c18e8Smrg  done
7067c27c18e8Smrgdone
7068c27c18e8SmrgIFS=$as_save_IFS
7069c27c18e8Smrglt_ac_max=0
7070c27c18e8Smrglt_ac_count=0
7071c27c18e8Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
7072c27c18e8Smrg# along with /bin/sed that truncates output.
7073c27c18e8Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7074c27c18e8Smrg  test ! -f $lt_ac_sed && continue
7075c27c18e8Smrg  cat /dev/null > conftest.in
7076c27c18e8Smrg  lt_ac_count=0
7077c27c18e8Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7078c27c18e8Smrg  # Check for GNU sed and select it if it is found.
7079c27c18e8Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7080c27c18e8Smrg    lt_cv_path_SED=$lt_ac_sed
7081c27c18e8Smrg    break
708221e67964Smrg  fi
7083c27c18e8Smrg  while true; do
7084c27c18e8Smrg    cat conftest.in conftest.in >conftest.tmp
7085c27c18e8Smrg    mv conftest.tmp conftest.in
7086c27c18e8Smrg    cp conftest.in conftest.nl
7087c27c18e8Smrg    echo >>conftest.nl
7088c27c18e8Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7089c27c18e8Smrg    cmp -s conftest.out conftest.nl || break
7090c27c18e8Smrg    # 10000 chars as input seems more than enough
7091c27c18e8Smrg    test $lt_ac_count -gt 10 && break
7092c27c18e8Smrg    lt_ac_count=`expr $lt_ac_count + 1`
7093c27c18e8Smrg    if test $lt_ac_count -gt $lt_ac_max; then
7094c27c18e8Smrg      lt_ac_max=$lt_ac_count
7095c27c18e8Smrg      lt_cv_path_SED=$lt_ac_sed
7096c27c18e8Smrg    fi
7097c27c18e8Smrg  done
7098c27c18e8Smrgdone
709921e67964Smrg])
7100c27c18e8SmrgSED=$lt_cv_path_SED
7101c27c18e8SmrgAC_SUBST([SED])
7102c27c18e8SmrgAC_MSG_RESULT([$SED])
7103c27c18e8Smrg])#AC_PROG_SED
7104c27c18e8Smrg])#m4_ifndef
710521e67964Smrg
7106c27c18e8Smrg# Old name:
7107c27c18e8SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7108c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
7109c27c18e8Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
7110c27c18e8Smrg
7111c27c18e8Smrg
7112c27c18e8Smrg# _LT_CHECK_SHELL_FEATURES
7113c27c18e8Smrg# ------------------------
7114c27c18e8Smrg# Find out whether the shell is Bourne or XSI compatible,
7115c27c18e8Smrg# or has some other useful features.
7116c27c18e8Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
7117c27c18e8Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7118c27c18e8Smrg# Try some XSI features
7119c27c18e8Smrgxsi_shell=no
7120c27c18e8Smrg( _lt_dummy="a/b/c"
7121c27c18e8Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
7122c27c18e8Smrg      = c,a/b,, \
7123c27c18e8Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
7124c27c18e8Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7125c27c18e8Smrg  && xsi_shell=yes
7126c27c18e8SmrgAC_MSG_RESULT([$xsi_shell])
7127c27c18e8Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7128c27c18e8Smrg
7129c27c18e8SmrgAC_MSG_CHECKING([whether the shell understands "+="])
7130c27c18e8Smrglt_shell_append=no
7131c27c18e8Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7132c27c18e8Smrg    >/dev/null 2>&1 \
7133c27c18e8Smrg  && lt_shell_append=yes
7134c27c18e8SmrgAC_MSG_RESULT([$lt_shell_append])
7135c27c18e8Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7136c27c18e8Smrg
7137c27c18e8Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7138c27c18e8Smrg  lt_unset=unset
7139c27c18e8Smrgelse
7140c27c18e8Smrg  lt_unset=false
714121e67964Smrgfi
7142c27c18e8Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7143c27c18e8Smrg
7144c27c18e8Smrg# test EBCDIC or ASCII
7145c27c18e8Smrgcase `echo X|tr X '\101'` in
7146c27c18e8Smrg A) # ASCII based system
7147c27c18e8Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7148c27c18e8Smrg  lt_SP2NL='tr \040 \012'
7149c27c18e8Smrg  lt_NL2SP='tr \015\012 \040\040'
7150c27c18e8Smrg  ;;
7151c27c18e8Smrg *) # EBCDIC based system
7152c27c18e8Smrg  lt_SP2NL='tr \100 \n'
7153c27c18e8Smrg  lt_NL2SP='tr \r\n \100\100'
7154c27c18e8Smrg  ;;
715521e67964Smrgesac
7156c27c18e8Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7157c27c18e8Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7158c27c18e8Smrg])# _LT_CHECK_SHELL_FEATURES
715921e67964Smrg
716021e67964Smrg
7161c27c18e8Smrg# _LT_PROG_XSI_SHELLFNS
7162c27c18e8Smrg# ---------------------
7163c27c18e8Smrg# Bourne and XSI compatible variants of some useful shell functions.
7164c27c18e8Smrgm4_defun([_LT_PROG_XSI_SHELLFNS],
7165c27c18e8Smrg[case $xsi_shell in
7166c27c18e8Smrg  yes)
7167c27c18e8Smrg    cat << \_LT_EOF >> "$cfgfile"
7168c27c18e8Smrg
7169c27c18e8Smrg# func_dirname file append nondir_replacement
7170c27c18e8Smrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
7171c27c18e8Smrg# otherwise set result to NONDIR_REPLACEMENT.
7172c27c18e8Smrgfunc_dirname ()
7173c27c18e8Smrg{
7174c27c18e8Smrg  case ${1} in
7175c27c18e8Smrg    */*) func_dirname_result="${1%/*}${2}" ;;
7176c27c18e8Smrg    *  ) func_dirname_result="${3}" ;;
7177c27c18e8Smrg  esac
7178c27c18e8Smrg}
717921e67964Smrg
7180c27c18e8Smrg# func_basename file
7181c27c18e8Smrgfunc_basename ()
7182c27c18e8Smrg{
7183c27c18e8Smrg  func_basename_result="${1##*/}"
7184c27c18e8Smrg}
7185c27c18e8Smrg
7186c27c18e8Smrg# func_dirname_and_basename file append nondir_replacement
7187c27c18e8Smrg# perform func_basename and func_dirname in a single function
7188c27c18e8Smrg# call:
7189c27c18e8Smrg#   dirname:  Compute the dirname of FILE.  If nonempty,
7190c27c18e8Smrg#             add APPEND to the result, otherwise set result
7191c27c18e8Smrg#             to NONDIR_REPLACEMENT.
7192c27c18e8Smrg#             value returned in "$func_dirname_result"
7193c27c18e8Smrg#   basename: Compute filename of FILE.
7194c27c18e8Smrg#             value retuned in "$func_basename_result"
7195c27c18e8Smrg# Implementation must be kept synchronized with func_dirname
7196c27c18e8Smrg# and func_basename. For efficiency, we do not delegate to
7197c27c18e8Smrg# those functions but instead duplicate the functionality here.
7198c27c18e8Smrgfunc_dirname_and_basename ()
7199c27c18e8Smrg{
7200c27c18e8Smrg  case ${1} in
7201c27c18e8Smrg    */*) func_dirname_result="${1%/*}${2}" ;;
7202c27c18e8Smrg    *  ) func_dirname_result="${3}" ;;
7203c27c18e8Smrg  esac
7204c27c18e8Smrg  func_basename_result="${1##*/}"
7205c27c18e8Smrg}
7206c27c18e8Smrg
7207c27c18e8Smrg# func_stripname prefix suffix name
7208c27c18e8Smrg# strip PREFIX and SUFFIX off of NAME.
7209c27c18e8Smrg# PREFIX and SUFFIX must not contain globbing or regex special
7210c27c18e8Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7211c27c18e8Smrg# dot (in which case that matches only a dot).
7212c27c18e8Smrgfunc_stripname ()
7213c27c18e8Smrg{
7214c27c18e8Smrg  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7215c27c18e8Smrg  # positional parameters, so assign one to ordinary parameter first.
7216c27c18e8Smrg  func_stripname_result=${3}
7217c27c18e8Smrg  func_stripname_result=${func_stripname_result#"${1}"}
7218c27c18e8Smrg  func_stripname_result=${func_stripname_result%"${2}"}
7219c27c18e8Smrg}
7220c27c18e8Smrg
7221c27c18e8Smrg# func_opt_split
7222c27c18e8Smrgfunc_opt_split ()
7223c27c18e8Smrg{
7224c27c18e8Smrg  func_opt_split_opt=${1%%=*}
7225c27c18e8Smrg  func_opt_split_arg=${1#*=}
7226c27c18e8Smrg}
7227c27c18e8Smrg
7228c27c18e8Smrg# func_lo2o object
7229c27c18e8Smrgfunc_lo2o ()
7230c27c18e8Smrg{
7231c27c18e8Smrg  case ${1} in
7232c27c18e8Smrg    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7233c27c18e8Smrg    *)    func_lo2o_result=${1} ;;
723421e67964Smrg  esac
7235c27c18e8Smrg}
7236c27c18e8Smrg
7237c27c18e8Smrg# func_xform libobj-or-source
7238c27c18e8Smrgfunc_xform ()
7239c27c18e8Smrg{
7240c27c18e8Smrg  func_xform_result=${1%.*}.lo
7241c27c18e8Smrg}
7242c27c18e8Smrg
7243c27c18e8Smrg# func_arith arithmetic-term...
7244c27c18e8Smrgfunc_arith ()
7245c27c18e8Smrg{
7246c27c18e8Smrg  func_arith_result=$(( $[*] ))
7247c27c18e8Smrg}
7248c27c18e8Smrg
7249c27c18e8Smrg# func_len string
7250c27c18e8Smrg# STRING may not start with a hyphen.
7251c27c18e8Smrgfunc_len ()
7252c27c18e8Smrg{
7253c27c18e8Smrg  func_len_result=${#1}
7254c27c18e8Smrg}
7255c27c18e8Smrg
7256c27c18e8Smrg_LT_EOF
725721e67964Smrg    ;;
7258c27c18e8Smrg  *) # Bourne compatible functions.
7259c27c18e8Smrg    cat << \_LT_EOF >> "$cfgfile"
7260c27c18e8Smrg
7261c27c18e8Smrg# func_dirname file append nondir_replacement
7262c27c18e8Smrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
7263c27c18e8Smrg# otherwise set result to NONDIR_REPLACEMENT.
7264c27c18e8Smrgfunc_dirname ()
7265c27c18e8Smrg{
7266c27c18e8Smrg  # Extract subdirectory from the argument.
7267c27c18e8Smrg  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
7268c27c18e8Smrg  if test "X$func_dirname_result" = "X${1}"; then
7269c27c18e8Smrg    func_dirname_result="${3}"
7270c27c18e8Smrg  else
7271c27c18e8Smrg    func_dirname_result="$func_dirname_result${2}"
7272c27c18e8Smrg  fi
7273c27c18e8Smrg}
7274c27c18e8Smrg
7275c27c18e8Smrg# func_basename file
7276c27c18e8Smrgfunc_basename ()
7277c27c18e8Smrg{
7278c27c18e8Smrg  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
7279c27c18e8Smrg}
7280c27c18e8Smrg
7281c27c18e8Smrgdnl func_dirname_and_basename
7282c27c18e8Smrgdnl A portable version of this function is already defined in general.m4sh
7283c27c18e8Smrgdnl so there is no need for it here.
7284c27c18e8Smrg
7285c27c18e8Smrg# func_stripname prefix suffix name
7286c27c18e8Smrg# strip PREFIX and SUFFIX off of NAME.
7287c27c18e8Smrg# PREFIX and SUFFIX must not contain globbing or regex special
7288c27c18e8Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7289c27c18e8Smrg# dot (in which case that matches only a dot).
7290c27c18e8Smrg# func_strip_suffix prefix name
7291c27c18e8Smrgfunc_stripname ()
7292c27c18e8Smrg{
7293c27c18e8Smrg  case ${2} in
7294c27c18e8Smrg    .*) func_stripname_result=`$ECHO "X${3}" \
7295c27c18e8Smrg           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
7296c27c18e8Smrg    *)  func_stripname_result=`$ECHO "X${3}" \
7297c27c18e8Smrg           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
729821e67964Smrg  esac
7299c27c18e8Smrg}
730021e67964Smrg
7301c27c18e8Smrg# sed scripts:
7302c27c18e8Smrgmy_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
7303c27c18e8Smrgmy_sed_long_arg='1s/^-[[^=]]*=//'
730421e67964Smrg
7305c27c18e8Smrg# func_opt_split
7306c27c18e8Smrgfunc_opt_split ()
7307c27c18e8Smrg{
7308c27c18e8Smrg  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
7309c27c18e8Smrg  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
7310c27c18e8Smrg}
731121e67964Smrg
7312c27c18e8Smrg# func_lo2o object
7313c27c18e8Smrgfunc_lo2o ()
7314c27c18e8Smrg{
7315c27c18e8Smrg  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
7316c27c18e8Smrg}
731721e67964Smrg
7318c27c18e8Smrg# func_xform libobj-or-source
7319c27c18e8Smrgfunc_xform ()
7320c27c18e8Smrg{
7321c27c18e8Smrg  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
7322c27c18e8Smrg}
732321e67964Smrg
7324c27c18e8Smrg# func_arith arithmetic-term...
7325c27c18e8Smrgfunc_arith ()
7326c27c18e8Smrg{
7327c27c18e8Smrg  func_arith_result=`expr "$[@]"`
7328c27c18e8Smrg}
732921e67964Smrg
7330c27c18e8Smrg# func_len string
7331c27c18e8Smrg# STRING may not start with a hyphen.
7332c27c18e8Smrgfunc_len ()
7333c27c18e8Smrg{
7334c27c18e8Smrg  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
7335c27c18e8Smrg}
733621e67964Smrg
7337c27c18e8Smrg_LT_EOF
7338c27c18e8Smrgesac
733921e67964Smrg
7340c27c18e8Smrgcase $lt_shell_append in
7341c27c18e8Smrg  yes)
7342c27c18e8Smrg    cat << \_LT_EOF >> "$cfgfile"
734321e67964Smrg
7344c27c18e8Smrg# func_append var value
7345c27c18e8Smrg# Append VALUE to the end of shell variable VAR.
7346c27c18e8Smrgfunc_append ()
7347c27c18e8Smrg{
7348c27c18e8Smrg  eval "$[1]+=\$[2]"
7349c27c18e8Smrg}
7350c27c18e8Smrg_LT_EOF
7351c27c18e8Smrg    ;;
7352c27c18e8Smrg  *)
7353c27c18e8Smrg    cat << \_LT_EOF >> "$cfgfile"
735421e67964Smrg
7355c27c18e8Smrg# func_append var value
7356c27c18e8Smrg# Append VALUE to the end of shell variable VAR.
7357c27c18e8Smrgfunc_append ()
7358c27c18e8Smrg{
7359c27c18e8Smrg  eval "$[1]=\$$[1]\$[2]"
7360c27c18e8Smrg}
736121e67964Smrg
7362c27c18e8Smrg_LT_EOF
7363c27c18e8Smrg    ;;
7364c27c18e8Smrg  esac
7365c27c18e8Smrg])
736621e67964Smrg
7367c27c18e8Smrg# Helper functions for option handling.                    -*- Autoconf -*-
7368c27c18e8Smrg#
7369c27c18e8Smrg#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
7370c27c18e8Smrg#   Written by Gary V. Vaughan, 2004
7371c27c18e8Smrg#
7372c27c18e8Smrg# This file is free software; the Free Software Foundation gives
7373c27c18e8Smrg# unlimited permission to copy and/or distribute it, with or without
7374c27c18e8Smrg# modifications, as long as this notice is preserved.
737521e67964Smrg
7376c27c18e8Smrg# serial 6 ltoptions.m4
737721e67964Smrg
7378c27c18e8Smrg# This is to help aclocal find these macros, as it can't see m4_define.
7379c27c18e8SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
738021e67964Smrg
738121e67964Smrg
7382c27c18e8Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
7383c27c18e8Smrg# ------------------------------------------
7384c27c18e8Smrgm4_define([_LT_MANGLE_OPTION],
7385c27c18e8Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
738621e67964Smrg
738721e67964Smrg
7388c27c18e8Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
7389c27c18e8Smrg# ---------------------------------------
7390c27c18e8Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
7391c27c18e8Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
7392c27c18e8Smrg# saved as a flag.
7393c27c18e8Smrgm4_define([_LT_SET_OPTION],
7394c27c18e8Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
7395c27c18e8Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
7396c27c18e8Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
7397c27c18e8Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
7398c27c18e8Smrg])
739921e67964Smrg
740021e67964Smrg
7401c27c18e8Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
7402c27c18e8Smrg# ------------------------------------------------------------
7403c27c18e8Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7404c27c18e8Smrgm4_define([_LT_IF_OPTION],
7405c27c18e8Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
7406c27c18e8Smrg
7407c27c18e8Smrg
7408c27c18e8Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
7409c27c18e8Smrg# -------------------------------------------------------
7410c27c18e8Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
7411c27c18e8Smrg# are set.
7412c27c18e8Smrgm4_define([_LT_UNLESS_OPTIONS],
7413c27c18e8Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
7414c27c18e8Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
7415c27c18e8Smrg		      [m4_define([$0_found])])])[]dnl
7416c27c18e8Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
7417c27c18e8Smrg])[]dnl
7418c27c18e8Smrg])
741921e67964Smrg
742021e67964Smrg
7421c27c18e8Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
7422c27c18e8Smrg# ----------------------------------------
7423c27c18e8Smrg# OPTION-LIST is a space-separated list of Libtool options associated
7424c27c18e8Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
7425c27c18e8Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
7426c27c18e8Smrg# the unknown option and exit.
7427c27c18e8Smrgm4_defun([_LT_SET_OPTIONS],
7428c27c18e8Smrg[# Set options
7429c27c18e8Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
7430c27c18e8Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
7431c27c18e8Smrg
7432c27c18e8Smrgm4_if([$1],[LT_INIT],[
7433c27c18e8Smrg  dnl
7434c27c18e8Smrg  dnl Simply set some default values (i.e off) if boolean options were not
7435c27c18e8Smrg  dnl specified:
7436c27c18e8Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
7437c27c18e8Smrg  ])
7438c27c18e8Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
7439c27c18e8Smrg  ])
7440c27c18e8Smrg  dnl
7441c27c18e8Smrg  dnl If no reference was made to various pairs of opposing options, then
7442c27c18e8Smrg  dnl we run the default mode handler for the pair.  For example, if neither
7443c27c18e8Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
7444c27c18e8Smrg  dnl archives by default:
7445c27c18e8Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
7446c27c18e8Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
7447c27c18e8Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
7448c27c18e8Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
7449c27c18e8Smrg  		   [_LT_ENABLE_FAST_INSTALL])
7450c27c18e8Smrg  ])
7451c27c18e8Smrg])# _LT_SET_OPTIONS
745221e67964Smrg
745321e67964Smrg
745421e67964Smrg
7455c27c18e8Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
7456c27c18e8Smrg# -----------------------------------------
7457c27c18e8Smrgm4_define([_LT_MANGLE_DEFUN],
7458c27c18e8Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
7459c27c18e8Smrg
7460c27c18e8Smrg
7461c27c18e8Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
7462c27c18e8Smrg# -----------------------------------------------
7463c27c18e8Smrgm4_define([LT_OPTION_DEFINE],
7464c27c18e8Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
7465c27c18e8Smrg])# LT_OPTION_DEFINE
7466c27c18e8Smrg
746721e67964Smrg
7468c27c18e8Smrg# dlopen
7469c27c18e8Smrg# ------
7470c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
7471c27c18e8Smrg])
747221e67964Smrg
7473c27c18e8SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
7474c27c18e8Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
7475c27c18e8SmrgAC_DIAGNOSE([obsolete],
7476c27c18e8Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
7477c27c18e8Smrgput the `dlopen' option into LT_INIT's first parameter.])
7478c27c18e8Smrg])
747921e67964Smrg
7480c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
7481c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
748221e67964Smrg
748321e67964Smrg
7484c27c18e8Smrg# win32-dll
7485c27c18e8Smrg# ---------
7486c27c18e8Smrg# Declare package support for building win32 dll's.
7487c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
7488c27c18e8Smrg[enable_win32_dll=yes
748921e67964Smrg
7490c27c18e8Smrgcase $host in
7491c27c18e8Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
7492c27c18e8Smrg  AC_CHECK_TOOL(AS, as, false)
7493c27c18e8Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
7494c27c18e8Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
7495c27c18e8Smrg  ;;
7496c27c18e8Smrgesac
749721e67964Smrg
7498c27c18e8Smrgtest -z "$AS" && AS=as
7499c27c18e8Smrg_LT_DECL([], [AS],      [0], [Assembler program])dnl
750021e67964Smrg
7501c27c18e8Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
7502c27c18e8Smrg_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
750321e67964Smrg
7504c27c18e8Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
7505c27c18e8Smrg_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
7506c27c18e8Smrg])# win32-dll
750721e67964Smrg
7508c27c18e8SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
7509c27c18e8Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7510c27c18e8Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
7511c27c18e8SmrgAC_DIAGNOSE([obsolete],
7512c27c18e8Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
7513c27c18e8Smrgput the `win32-dll' option into LT_INIT's first parameter.])
7514c27c18e8Smrg])
751521e67964Smrg
7516c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
7517c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
751821e67964Smrg
7519c27c18e8Smrg
7520c27c18e8Smrg# _LT_ENABLE_SHARED([DEFAULT])
7521c27c18e8Smrg# ----------------------------
7522c27c18e8Smrg# implement the --enable-shared flag, and supports the `shared' and
7523c27c18e8Smrg# `disable-shared' LT_INIT options.
7524c27c18e8Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7525c27c18e8Smrgm4_define([_LT_ENABLE_SHARED],
7526c27c18e8Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
7527c27c18e8SmrgAC_ARG_ENABLE([shared],
7528c27c18e8Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
7529c27c18e8Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
7530c27c18e8Smrg    [p=${PACKAGE-default}
7531c27c18e8Smrg    case $enableval in
7532c27c18e8Smrg    yes) enable_shared=yes ;;
7533c27c18e8Smrg    no) enable_shared=no ;;
7534c27c18e8Smrg    *)
7535c27c18e8Smrg      enable_shared=no
7536c27c18e8Smrg      # Look at the argument we got.  We use all the common list separators.
7537c27c18e8Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7538c27c18e8Smrg      for pkg in $enableval; do
7539c27c18e8Smrg	IFS="$lt_save_ifs"
7540c27c18e8Smrg	if test "X$pkg" = "X$p"; then
7541c27c18e8Smrg	  enable_shared=yes
7542c27c18e8Smrg	fi
7543c27c18e8Smrg      done
7544c27c18e8Smrg      IFS="$lt_save_ifs"
754521e67964Smrg      ;;
7546c27c18e8Smrg    esac],
7547c27c18e8Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
754821e67964Smrg
7549c27c18e8Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
7550c27c18e8Smrg	[Whether or not to build shared libraries])
7551c27c18e8Smrg])# _LT_ENABLE_SHARED
755221e67964Smrg
7553c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
7554c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
755521e67964Smrg
7556c27c18e8Smrg# Old names:
7557c27c18e8SmrgAC_DEFUN([AC_ENABLE_SHARED],
7558c27c18e8Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
7559c27c18e8Smrg])
7560c27c18e8Smrg
7561c27c18e8SmrgAC_DEFUN([AC_DISABLE_SHARED],
7562c27c18e8Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
7563c27c18e8Smrg])
756421e67964Smrg
7565c27c18e8SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
7566c27c18e8SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
756721e67964Smrg
7568c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
7569c27c18e8Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
7570c27c18e8Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
757121e67964Smrg
757221e67964Smrg
757321e67964Smrg
7574c27c18e8Smrg# _LT_ENABLE_STATIC([DEFAULT])
7575c27c18e8Smrg# ----------------------------
7576c27c18e8Smrg# implement the --enable-static flag, and support the `static' and
7577c27c18e8Smrg# `disable-static' LT_INIT options.
7578c27c18e8Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7579c27c18e8Smrgm4_define([_LT_ENABLE_STATIC],
7580c27c18e8Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
7581c27c18e8SmrgAC_ARG_ENABLE([static],
7582c27c18e8Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
7583c27c18e8Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
7584c27c18e8Smrg    [p=${PACKAGE-default}
7585c27c18e8Smrg    case $enableval in
7586c27c18e8Smrg    yes) enable_static=yes ;;
7587c27c18e8Smrg    no) enable_static=no ;;
7588c27c18e8Smrg    *)
7589c27c18e8Smrg     enable_static=no
7590c27c18e8Smrg      # Look at the argument we got.  We use all the common list separators.
7591c27c18e8Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7592c27c18e8Smrg      for pkg in $enableval; do
7593c27c18e8Smrg	IFS="$lt_save_ifs"
7594c27c18e8Smrg	if test "X$pkg" = "X$p"; then
7595c27c18e8Smrg	  enable_static=yes
7596c27c18e8Smrg	fi
7597c27c18e8Smrg      done
7598c27c18e8Smrg      IFS="$lt_save_ifs"
759921e67964Smrg      ;;
7600c27c18e8Smrg    esac],
7601c27c18e8Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
760221e67964Smrg
7603c27c18e8Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
7604c27c18e8Smrg	[Whether or not to build static libraries])
7605c27c18e8Smrg])# _LT_ENABLE_STATIC
760621e67964Smrg
7607c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
7608c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
760921e67964Smrg
7610c27c18e8Smrg# Old names:
7611c27c18e8SmrgAC_DEFUN([AC_ENABLE_STATIC],
7612c27c18e8Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
7613c27c18e8Smrg])
761421e67964Smrg
7615c27c18e8SmrgAC_DEFUN([AC_DISABLE_STATIC],
7616c27c18e8Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
7617c27c18e8Smrg])
761821e67964Smrg
7619c27c18e8SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
7620c27c18e8SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
762121e67964Smrg
7622c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
7623c27c18e8Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
7624c27c18e8Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
762521e67964Smrg
762621e67964Smrg
762721e67964Smrg
7628c27c18e8Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
7629c27c18e8Smrg# ----------------------------------
7630c27c18e8Smrg# implement the --enable-fast-install flag, and support the `fast-install'
7631c27c18e8Smrg# and `disable-fast-install' LT_INIT options.
7632c27c18e8Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7633c27c18e8Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
7634c27c18e8Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
7635c27c18e8SmrgAC_ARG_ENABLE([fast-install],
7636c27c18e8Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
7637c27c18e8Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
7638c27c18e8Smrg    [p=${PACKAGE-default}
7639c27c18e8Smrg    case $enableval in
7640c27c18e8Smrg    yes) enable_fast_install=yes ;;
7641c27c18e8Smrg    no) enable_fast_install=no ;;
7642c27c18e8Smrg    *)
7643c27c18e8Smrg      enable_fast_install=no
7644c27c18e8Smrg      # Look at the argument we got.  We use all the common list separators.
7645c27c18e8Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7646c27c18e8Smrg      for pkg in $enableval; do
7647c27c18e8Smrg	IFS="$lt_save_ifs"
7648c27c18e8Smrg	if test "X$pkg" = "X$p"; then
7649c27c18e8Smrg	  enable_fast_install=yes
765021e67964Smrg	fi
7651c27c18e8Smrg      done
7652c27c18e8Smrg      IFS="$lt_save_ifs"
765321e67964Smrg      ;;
7654c27c18e8Smrg    esac],
7655c27c18e8Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
765621e67964Smrg
7657c27c18e8Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
7658c27c18e8Smrg	 [Whether or not to optimize for fast installation])dnl
7659c27c18e8Smrg])# _LT_ENABLE_FAST_INSTALL
766021e67964Smrg
7661c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
7662c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
766321e67964Smrg
7664c27c18e8Smrg# Old names:
7665c27c18e8SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
7666c27c18e8Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
7667c27c18e8SmrgAC_DIAGNOSE([obsolete],
7668c27c18e8Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
7669c27c18e8Smrgthe `fast-install' option into LT_INIT's first parameter.])
7670c27c18e8Smrg])
767121e67964Smrg
7672c27c18e8SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
7673c27c18e8Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
7674c27c18e8SmrgAC_DIAGNOSE([obsolete],
7675c27c18e8Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
7676c27c18e8Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
7677c27c18e8Smrg])
767821e67964Smrg
7679c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
7680c27c18e8Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
7681c27c18e8Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
768221e67964Smrg
768321e67964Smrg
7684c27c18e8Smrg# _LT_WITH_PIC([MODE])
7685c27c18e8Smrg# --------------------
7686c27c18e8Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
7687c27c18e8Smrg# LT_INIT options.
7688c27c18e8Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
7689c27c18e8Smrgm4_define([_LT_WITH_PIC],
7690c27c18e8Smrg[AC_ARG_WITH([pic],
7691c27c18e8Smrg    [AS_HELP_STRING([--with-pic],
7692c27c18e8Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
7693c27c18e8Smrg    [pic_mode="$withval"],
7694c27c18e8Smrg    [pic_mode=default])
769521e67964Smrg
7696c27c18e8Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
769721e67964Smrg
7698c27c18e8Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
7699c27c18e8Smrg])# _LT_WITH_PIC
770021e67964Smrg
7701c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
7702c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
7703c27c18e8Smrg
7704c27c18e8Smrg# Old name:
7705c27c18e8SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
7706c27c18e8Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
7707c27c18e8SmrgAC_DIAGNOSE([obsolete],
7708c27c18e8Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
7709c27c18e8Smrgput the `pic-only' option into LT_INIT's first parameter.])
771021e67964Smrg])
771121e67964Smrg
7712c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
7713c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
771421e67964Smrg
771521e67964Smrg
7716c27c18e8Smrgm4_define([_LTDL_MODE], [])
7717c27c18e8SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
7718c27c18e8Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
7719c27c18e8SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
7720c27c18e8Smrg		 [m4_define([_LTDL_MODE], [recursive])])
7721c27c18e8SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
7722c27c18e8Smrg		 [m4_define([_LTDL_MODE], [subproject])])
772321e67964Smrg
7724c27c18e8Smrgm4_define([_LTDL_TYPE], [])
7725c27c18e8SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
7726c27c18e8Smrg		 [m4_define([_LTDL_TYPE], [installable])])
7727c27c18e8SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
7728c27c18e8Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
772921e67964Smrg
7730c27c18e8Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
773121e67964Smrg#
7732c27c18e8Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
7733c27c18e8Smrg# Written by Gary V. Vaughan, 2004
773421e67964Smrg#
7735c27c18e8Smrg# This file is free software; the Free Software Foundation gives
7736c27c18e8Smrg# unlimited permission to copy and/or distribute it, with or without
7737c27c18e8Smrg# modifications, as long as this notice is preserved.
7738c27c18e8Smrg
7739c27c18e8Smrg# serial 6 ltsugar.m4
7740c27c18e8Smrg
7741c27c18e8Smrg# This is to help aclocal find these macros, as it can't see m4_define.
7742c27c18e8SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
7743c27c18e8Smrg
7744c27c18e8Smrg
7745c27c18e8Smrg# lt_join(SEP, ARG1, [ARG2...])
7746c27c18e8Smrg# -----------------------------
7747c27c18e8Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
7748c27c18e8Smrg# associated separator.
7749c27c18e8Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
7750c27c18e8Smrg# versions in m4sugar had bugs.
7751c27c18e8Smrgm4_define([lt_join],
7752c27c18e8Smrg[m4_if([$#], [1], [],
7753c27c18e8Smrg       [$#], [2], [[$2]],
7754c27c18e8Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
7755c27c18e8Smrgm4_define([_lt_join],
7756c27c18e8Smrg[m4_if([$#$2], [2], [],
7757c27c18e8Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
7758c27c18e8Smrg
7759c27c18e8Smrg
7760c27c18e8Smrg# lt_car(LIST)
7761c27c18e8Smrg# lt_cdr(LIST)
7762c27c18e8Smrg# ------------
7763c27c18e8Smrg# Manipulate m4 lists.
7764c27c18e8Smrg# These macros are necessary as long as will still need to support
7765c27c18e8Smrg# Autoconf-2.59 which quotes differently.
7766c27c18e8Smrgm4_define([lt_car], [[$1]])
7767c27c18e8Smrgm4_define([lt_cdr],
7768c27c18e8Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
7769c27c18e8Smrg       [$#], 1, [],
7770c27c18e8Smrg       [m4_dquote(m4_shift($@))])])
7771c27c18e8Smrgm4_define([lt_unquote], $1)
7772c27c18e8Smrg
7773c27c18e8Smrg
7774c27c18e8Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
7775c27c18e8Smrg# ------------------------------------------
7776c27c18e8Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
7777c27c18e8Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
7778c27c18e8Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
7779c27c18e8Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
7780c27c18e8Smrg# than defined and empty).
778121e67964Smrg#
7782c27c18e8Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
7783c27c18e8Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
7784c27c18e8Smrgm4_define([lt_append],
7785c27c18e8Smrg[m4_define([$1],
7786c27c18e8Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
7787c27c18e8Smrg
7788c27c18e8Smrg
7789c27c18e8Smrg
7790c27c18e8Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
7791c27c18e8Smrg# ----------------------------------------------------------
7792c27c18e8Smrg# Produce a SEP delimited list of all paired combinations of elements of
7793c27c18e8Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
7794c27c18e8Smrg# has the form PREFIXmINFIXSUFFIXn.
7795c27c18e8Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
7796c27c18e8Smrgm4_define([lt_combine],
7797c27c18e8Smrg[m4_if(m4_eval([$# > 3]), [1],
7798c27c18e8Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
7799c27c18e8Smrg[[m4_foreach([_Lt_prefix], [$2],
7800c27c18e8Smrg	     [m4_foreach([_Lt_suffix],
7801c27c18e8Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
7802c27c18e8Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
7803c27c18e8Smrg
7804c27c18e8Smrg
7805c27c18e8Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
7806c27c18e8Smrg# -----------------------------------------------------------------------
7807c27c18e8Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
7808c27c18e8Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
7809c27c18e8Smrgm4_define([lt_if_append_uniq],
7810c27c18e8Smrg[m4_ifdef([$1],
7811c27c18e8Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
7812c27c18e8Smrg		 [lt_append([$1], [$2], [$3])$4],
7813c27c18e8Smrg		 [$5])],
7814c27c18e8Smrg	  [lt_append([$1], [$2], [$3])$4])])
7815c27c18e8Smrg
7816c27c18e8Smrg
7817c27c18e8Smrg# lt_dict_add(DICT, KEY, VALUE)
7818c27c18e8Smrg# -----------------------------
7819c27c18e8Smrgm4_define([lt_dict_add],
7820c27c18e8Smrg[m4_define([$1($2)], [$3])])
782121e67964Smrg
782221e67964Smrg
7823c27c18e8Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
7824c27c18e8Smrg# --------------------------------------------
7825c27c18e8Smrgm4_define([lt_dict_add_subkey],
7826c27c18e8Smrg[m4_define([$1($2:$3)], [$4])])
7827c27c18e8Smrg
782821e67964Smrg
7829c27c18e8Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
7830c27c18e8Smrg# ----------------------------------
7831c27c18e8Smrgm4_define([lt_dict_fetch],
7832c27c18e8Smrg[m4_ifval([$3],
7833c27c18e8Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
7834c27c18e8Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
783521e67964Smrg
783621e67964Smrg
7837c27c18e8Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
7838c27c18e8Smrg# -----------------------------------------------------------------
7839c27c18e8Smrgm4_define([lt_if_dict_fetch],
7840c27c18e8Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
7841c27c18e8Smrg	[$5],
7842c27c18e8Smrg    [$6])])
784321e67964Smrg
784421e67964Smrg
7845c27c18e8Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
7846c27c18e8Smrg# --------------------------------------------------------------
7847c27c18e8Smrgm4_define([lt_dict_filter],
7848c27c18e8Smrg[m4_if([$5], [], [],
7849c27c18e8Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
7850c27c18e8Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
7851c27c18e8Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
785221e67964Smrg])
785321e67964Smrg
7854c27c18e8Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
7855c27c18e8Smrg#
7856c27c18e8Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
7857c27c18e8Smrg#   Written by Scott James Remnant, 2004
7858c27c18e8Smrg#
7859c27c18e8Smrg# This file is free software; the Free Software Foundation gives
7860c27c18e8Smrg# unlimited permission to copy and/or distribute it, with or without
7861c27c18e8Smrg# modifications, as long as this notice is preserved.
786221e67964Smrg
7863c27c18e8Smrg# Generated from ltversion.in.
786421e67964Smrg
7865c27c18e8Smrg# serial 3012 ltversion.m4
7866c27c18e8Smrg# This file is part of GNU Libtool
786721e67964Smrg
7868c27c18e8Smrgm4_define([LT_PACKAGE_VERSION], [2.2.6])
7869c27c18e8Smrgm4_define([LT_PACKAGE_REVISION], [1.3012])
787021e67964Smrg
7871c27c18e8SmrgAC_DEFUN([LTVERSION_VERSION],
7872c27c18e8Smrg[macro_version='2.2.6'
7873c27c18e8Smrgmacro_revision='1.3012'
7874c27c18e8Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
7875c27c18e8Smrg_LT_DECL(, macro_revision, 0)
787621e67964Smrg])
7877c43cc173Smrg
7878c27c18e8Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
7879c27c18e8Smrg#
7880c27c18e8Smrg#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
7881c27c18e8Smrg#   Written by Scott James Remnant, 2004.
7882c27c18e8Smrg#
7883c27c18e8Smrg# This file is free software; the Free Software Foundation gives
7884c27c18e8Smrg# unlimited permission to copy and/or distribute it, with or without
7885c27c18e8Smrg# modifications, as long as this notice is preserved.
7886c27c18e8Smrg
7887c27c18e8Smrg# serial 4 lt~obsolete.m4
7888c27c18e8Smrg
7889c27c18e8Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
7890c27c18e8Smrg#
7891c27c18e8Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
7892c27c18e8Smrg# which have later been changed to m4_define as they aren't part of the
7893c27c18e8Smrg# exported API, or moved to Autoconf or Automake where they belong.
7894c27c18e8Smrg#
7895c27c18e8Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
7896c27c18e8Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
7897c27c18e8Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
7898c27c18e8Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
7899c27c18e8Smrg# and doesn't know about Autoconf macros at all.)
7900c27c18e8Smrg#
7901c27c18e8Smrg# So we provide this file, which has a silly filename so it's always
7902c27c18e8Smrg# included after everything else.  This provides aclocal with the
7903c27c18e8Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
7904c27c18e8Smrg# because those macros already exist, or will be overwritten later.
7905c27c18e8Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
7906c27c18e8Smrg#
7907c27c18e8Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
7908c27c18e8Smrg# Yes, that means every name once taken will need to remain here until
7909c27c18e8Smrg# we give up compatibility with versions before 1.7, at which point
7910c27c18e8Smrg# we need to keep only those names which we still refer to.
7911c27c18e8Smrg
7912c27c18e8Smrg# This is to help aclocal find these macros, as it can't see m4_define.
7913c27c18e8SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
7914c27c18e8Smrg
7915c27c18e8Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
7916c27c18e8Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
7917c27c18e8Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
7918c27c18e8Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
7919c27c18e8Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
7920c27c18e8Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
7921c27c18e8Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
7922c27c18e8Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
7923c27c18e8Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
7924c27c18e8Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
7925c27c18e8Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
7926c27c18e8Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
7927c27c18e8Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
7928c27c18e8Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
7929c27c18e8Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
7930c27c18e8Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
7931c27c18e8Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
7932c27c18e8Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
7933c27c18e8Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
7934c27c18e8Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
7935c27c18e8Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
7936c27c18e8Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
7937c27c18e8Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
7938c27c18e8Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
7939c27c18e8Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
7940c27c18e8Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
7941c27c18e8Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
7942c27c18e8Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
7943c27c18e8Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
7944c27c18e8Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
7945c27c18e8Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
7946c27c18e8Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
7947c27c18e8Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
7948c27c18e8Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
7949c27c18e8Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
7950c27c18e8Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
7951c27c18e8Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
7952c27c18e8Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
7953c27c18e8Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
7954c27c18e8Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
7955c27c18e8Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
7956c27c18e8Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
7957c27c18e8Smrgm4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
7958c27c18e8Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
7959c27c18e8Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
7960c27c18e8Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
7961c27c18e8Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
7962c27c18e8Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
7963c27c18e8Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
7964c27c18e8Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
7965c27c18e8Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
7966c27c18e8Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
7967c27c18e8Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
7968c27c18e8Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
7969c27c18e8Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
7970c27c18e8Smrg
797121e67964Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
797221e67964Smrg# 
797321e67964Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
797421e67964Smrg#
797521e67964Smrg# This program is free software; you can redistribute it and/or modify
797621e67964Smrg# it under the terms of the GNU General Public License as published by
797721e67964Smrg# the Free Software Foundation; either version 2 of the License, or
797821e67964Smrg# (at your option) any later version.
797921e67964Smrg#
798021e67964Smrg# This program is distributed in the hope that it will be useful, but
798121e67964Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
798221e67964Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
798321e67964Smrg# General Public License for more details.
798421e67964Smrg#
798521e67964Smrg# You should have received a copy of the GNU General Public License
798621e67964Smrg# along with this program; if not, write to the Free Software
798721e67964Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
798821e67964Smrg#
798921e67964Smrg# As a special exception to the GNU General Public License, if you
799021e67964Smrg# distribute this file as part of a program that contains a
799121e67964Smrg# configuration script generated by Autoconf, you may include it under
799221e67964Smrg# the same distribution terms that you use for the rest of that program.
7993c43cc173Smrg
799421e67964Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
799521e67964Smrg# ----------------------------------
799621e67964SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
799721e67964Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
799821e67964Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
799921e67964SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
800021e67964Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
800121e67964Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
800221e67964Smrgfi
800321e67964Smrgif test -n "$PKG_CONFIG"; then
800421e67964Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
800521e67964Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
800621e67964Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
800721e67964Smrg		AC_MSG_RESULT([yes])
800821e67964Smrg	else
800921e67964Smrg		AC_MSG_RESULT([no])
801021e67964Smrg		PKG_CONFIG=""
801121e67964Smrg	fi
801221e67964Smrg		
801321e67964Smrgfi[]dnl
801421e67964Smrg])# PKG_PROG_PKG_CONFIG
8015c43cc173Smrg
801621e67964Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
801721e67964Smrg#
801821e67964Smrg# Check to see whether a particular set of modules exists.  Similar
801921e67964Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
802021e67964Smrg#
802121e67964Smrg#
802221e67964Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
802321e67964Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
802421e67964Smrg# PKG_CHECK_EXISTS manually
802521e67964Smrg# --------------------------------------------------------------
802621e67964SmrgAC_DEFUN([PKG_CHECK_EXISTS],
802721e67964Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
802821e67964Smrgif test -n "$PKG_CONFIG" && \
802921e67964Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
803021e67964Smrg  m4_ifval([$2], [$2], [:])
803121e67964Smrgm4_ifvaln([$3], [else
803221e67964Smrg  $3])dnl
803321e67964Smrgfi])
8034c43cc173Smrg
8035c43cc173Smrg
803621e67964Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
803721e67964Smrg# ---------------------------------------------
803821e67964Smrgm4_define([_PKG_CONFIG],
803921e67964Smrg[if test -n "$$1"; then
804021e67964Smrg    pkg_cv_[]$1="$$1"
804121e67964Smrg elif test -n "$PKG_CONFIG"; then
804221e67964Smrg    PKG_CHECK_EXISTS([$3],
804321e67964Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
804421e67964Smrg		     [pkg_failed=yes])
804521e67964Smrg else
804621e67964Smrg    pkg_failed=untried
804721e67964Smrgfi[]dnl
804821e67964Smrg])# _PKG_CONFIG
8049c43cc173Smrg
805021e67964Smrg# _PKG_SHORT_ERRORS_SUPPORTED
805121e67964Smrg# -----------------------------
805221e67964SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
805321e67964Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
805421e67964Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
805521e67964Smrg        _pkg_short_errors_supported=yes
805621e67964Smrgelse
805721e67964Smrg        _pkg_short_errors_supported=no
805821e67964Smrgfi[]dnl
805921e67964Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
8060c43cc173Smrg
8061c43cc173Smrg
806221e67964Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
806321e67964Smrg# [ACTION-IF-NOT-FOUND])
806421e67964Smrg#
806521e67964Smrg#
806621e67964Smrg# Note that if there is a possibility the first call to
806721e67964Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
806821e67964Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
806921e67964Smrg#
807021e67964Smrg#
807121e67964Smrg# --------------------------------------------------------------
807221e67964SmrgAC_DEFUN([PKG_CHECK_MODULES],
807321e67964Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
807421e67964SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
807521e67964SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
8076c43cc173Smrg
807721e67964Smrgpkg_failed=no
807821e67964SmrgAC_MSG_CHECKING([for $1])
8079c43cc173Smrg
808021e67964Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
808121e67964Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
8082c43cc173Smrg
808321e67964Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
808421e67964Smrgand $1[]_LIBS to avoid the need to call pkg-config.
808521e67964SmrgSee the pkg-config man page for more details.])
8086c43cc173Smrg
808721e67964Smrgif test $pkg_failed = yes; then
808821e67964Smrg        _PKG_SHORT_ERRORS_SUPPORTED
808921e67964Smrg        if test $_pkg_short_errors_supported = yes; then
809021e67964Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
809121e67964Smrg        else 
809221e67964Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
809321e67964Smrg        fi
809421e67964Smrg	# Put the nasty error message in config.log where it belongs
809521e67964Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8096c43cc173Smrg
809721e67964Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
809821e67964Smrg[Package requirements ($2) were not met:
8099c43cc173Smrg
810021e67964Smrg$$1_PKG_ERRORS
8101c43cc173Smrg
810221e67964SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
810321e67964Smrginstalled software in a non-standard prefix.
8104c43cc173Smrg
810521e67964Smrg_PKG_TEXT
810621e67964Smrg])],
810721e67964Smrg		[AC_MSG_RESULT([no])
810821e67964Smrg                $4])
810921e67964Smrgelif test $pkg_failed = untried; then
811021e67964Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
811121e67964Smrg[The pkg-config script could not be found or is too old.  Make sure it
811221e67964Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
811321e67964Smrgpath to pkg-config.
8114c43cc173Smrg
811521e67964Smrg_PKG_TEXT
8116c43cc173Smrg
811721e67964SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
811821e67964Smrg		[$4])
811921e67964Smrgelse
812021e67964Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
812121e67964Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
812221e67964Smrg        AC_MSG_RESULT([yes])
812321e67964Smrg	ifelse([$3], , :, [$3])
812421e67964Smrgfi[]dnl
812521e67964Smrg])# PKG_CHECK_MODULES
8126c43cc173Smrg
8127c27c18e8Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
812821e67964Smrg#
812921e67964Smrg# This file is free software; the Free Software Foundation
813021e67964Smrg# gives unlimited permission to copy and/or distribute it,
813121e67964Smrg# with or without modifications, as long as this notice is preserved.
8132c43cc173Smrg
813321e67964Smrg# AM_AUTOMAKE_VERSION(VERSION)
813421e67964Smrg# ----------------------------
813521e67964Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
813621e67964Smrg# generated from the m4 files accompanying Automake X.Y.
813721e67964Smrg# (This private macro should not be called outside this file.)
813821e67964SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
8139c27c18e8Smrg[am__api_version='1.11'
814021e67964Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
814121e67964Smrgdnl require some minimum version.  Point them to the right macro.
8142c27c18e8Smrgm4_if([$1], [1.11], [],
814321e67964Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
8144c43cc173Smrg])
8145c43cc173Smrg
814621e67964Smrg# _AM_AUTOCONF_VERSION(VERSION)
814721e67964Smrg# -----------------------------
814821e67964Smrg# aclocal traces this macro to find the Autoconf version.
814921e67964Smrg# This is a private macro too.  Using m4_define simplifies
815021e67964Smrg# the logic in aclocal, which can simply ignore this definition.
815121e67964Smrgm4_define([_AM_AUTOCONF_VERSION], [])
815221e67964Smrg
815321e67964Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
815421e67964Smrg# -------------------------------
815521e67964Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
8156c27c18e8Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
815721e67964SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
8158c27c18e8Smrg[AM_AUTOMAKE_VERSION([1.11])dnl
815921e67964Smrgm4_ifndef([AC_AUTOCONF_VERSION],
816021e67964Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
8161c27c18e8Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
816221e67964Smrg
816321e67964Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
816421e67964Smrg
816521e67964Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
8166c43cc173Smrg#
816721e67964Smrg# This file is free software; the Free Software Foundation
816821e67964Smrg# gives unlimited permission to copy and/or distribute it,
816921e67964Smrg# with or without modifications, as long as this notice is preserved.
8170c43cc173Smrg
817121e67964Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
817221e67964Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
817321e67964Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
8174c43cc173Smrg#
817521e67964Smrg# Of course, Automake must honor this variable whenever it calls a
817621e67964Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
817721e67964Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
817821e67964Smrg# depending on how configure is run.  This is pretty annoying, since
817921e67964Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
818021e67964Smrg# source directory, any form will work fine, but in subdirectories a
818121e67964Smrg# relative path needs to be adjusted first.
8182c43cc173Smrg#
818321e67964Smrg# $ac_aux_dir/missing
818421e67964Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
818521e67964Smrg# $top_srcdir/$ac_aux_dir/missing
818621e67964Smrg#    fails if $ac_aux_dir is absolute,
818721e67964Smrg#    fails when called from a subdirectory in a VPATH build with
818821e67964Smrg#          a relative $ac_aux_dir
818921e67964Smrg#
819021e67964Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
819121e67964Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
819221e67964Smrg# harmless because $srcdir is `.', but things will broke when you
819321e67964Smrg# start a VPATH build or use an absolute $srcdir.
819421e67964Smrg#
819521e67964Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
819621e67964Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
819721e67964Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
819821e67964Smrg# and then we would define $MISSING as
819921e67964Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
820021e67964Smrg# This will work as long as MISSING is not called from configure, because
820121e67964Smrg# unfortunately $(top_srcdir) has no meaning in configure.
820221e67964Smrg# However there are other variables, like CC, which are often used in
820321e67964Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
820421e67964Smrg#
820521e67964Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
820621e67964Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
820721e67964Smrg# configured tree to be moved without reconfiguration.
820821e67964Smrg
820921e67964SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
821021e67964Smrg[dnl Rely on autoconf to set up CDPATH properly.
821121e67964SmrgAC_PREREQ([2.50])dnl
821221e67964Smrg# expand $ac_aux_dir to an absolute path
821321e67964Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
8214c43cc173Smrg])
8215c43cc173Smrg
821621e67964Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
8217c43cc173Smrg
8218c27c18e8Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
821921e67964Smrg# Free Software Foundation, Inc.
822021e67964Smrg#
822121e67964Smrg# This file is free software; the Free Software Foundation
822221e67964Smrg# gives unlimited permission to copy and/or distribute it,
822321e67964Smrg# with or without modifications, as long as this notice is preserved.
8224c43cc173Smrg
8225c27c18e8Smrg# serial 9
8226c43cc173Smrg
822721e67964Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
822821e67964Smrg# -------------------------------------
822921e67964Smrg# Define a conditional.
823021e67964SmrgAC_DEFUN([AM_CONDITIONAL],
823121e67964Smrg[AC_PREREQ(2.52)dnl
823221e67964Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
823321e67964Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
823421e67964SmrgAC_SUBST([$1_TRUE])dnl
823521e67964SmrgAC_SUBST([$1_FALSE])dnl
823621e67964Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
823721e67964Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
8238c27c18e8Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
823921e67964Smrgif $2; then
824021e67964Smrg  $1_TRUE=
824121e67964Smrg  $1_FALSE='#'
824221e67964Smrgelse
824321e67964Smrg  $1_TRUE='#'
824421e67964Smrg  $1_FALSE=
824521e67964Smrgfi
824621e67964SmrgAC_CONFIG_COMMANDS_PRE(
824721e67964Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
824821e67964Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
824921e67964SmrgUsually this means the macro was only invoked conditionally.]])
825021e67964Smrgfi])])
8251c43cc173Smrg
8252c27c18e8Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
825321e67964Smrg# Free Software Foundation, Inc.
825421e67964Smrg#
825521e67964Smrg# This file is free software; the Free Software Foundation
825621e67964Smrg# gives unlimited permission to copy and/or distribute it,
825721e67964Smrg# with or without modifications, as long as this notice is preserved.
8258c43cc173Smrg
8259c27c18e8Smrg# serial 10
8260c43cc173Smrg
826121e67964Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
826221e67964Smrg# written in clear, in which case automake, when reading aclocal.m4,
826321e67964Smrg# will think it sees a *use*, and therefore will trigger all it's
826421e67964Smrg# C support machinery.  Also note that it means that autoscan, seeing
826521e67964Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
8266c43cc173Smrg
8267c43cc173Smrg
826821e67964Smrg# _AM_DEPENDENCIES(NAME)
826921e67964Smrg# ----------------------
827021e67964Smrg# See how the compiler implements dependency checking.
827121e67964Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
827221e67964Smrg# We try a few techniques and use that to set a single cache variable.
827321e67964Smrg#
827421e67964Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
827521e67964Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
827621e67964Smrg# dependency, and given that the user is not expected to run this macro,
827721e67964Smrg# just rely on AC_PROG_CC.
827821e67964SmrgAC_DEFUN([_AM_DEPENDENCIES],
827921e67964Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
828021e67964SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
828121e67964SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
828221e67964SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
8283c43cc173Smrg
828421e67964Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
828521e67964Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
828621e67964Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
828721e67964Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
828821e67964Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
828921e67964Smrg                   [depcc="$$1"   am_compiler_list=])
8290c43cc173Smrg
829121e67964SmrgAC_CACHE_CHECK([dependency style of $depcc],
829221e67964Smrg               [am_cv_$1_dependencies_compiler_type],
829321e67964Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
829421e67964Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
829521e67964Smrg  # making bogus files that we don't know about and never remove.  For
829621e67964Smrg  # instance it was reported that on HP-UX the gcc test will end up
829721e67964Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
829821e67964Smrg  # in D'.
829921e67964Smrg  mkdir conftest.dir
830021e67964Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
830121e67964Smrg  # using a relative directory.
830221e67964Smrg  cp "$am_depcomp" conftest.dir
830321e67964Smrg  cd conftest.dir
830421e67964Smrg  # We will build objects and dependencies in a subdirectory because
830521e67964Smrg  # it helps to detect inapplicable dependency modes.  For instance
830621e67964Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
830721e67964Smrg  # side effect of compilation, but ICC will put the dependencies in
830821e67964Smrg  # the current directory while Tru64 will put them in the object
830921e67964Smrg  # directory.
831021e67964Smrg  mkdir sub
8311c43cc173Smrg
831221e67964Smrg  am_cv_$1_dependencies_compiler_type=none
831321e67964Smrg  if test "$am_compiler_list" = ""; then
831421e67964Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
831521e67964Smrg  fi
8316c27c18e8Smrg  am__universal=false
8317c27c18e8Smrg  m4_case([$1], [CC],
8318c27c18e8Smrg    [case " $depcc " in #(
8319c27c18e8Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
8320c27c18e8Smrg     esac],
8321c27c18e8Smrg    [CXX],
8322c27c18e8Smrg    [case " $depcc " in #(
8323c27c18e8Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
8324c27c18e8Smrg     esac])
8325c27c18e8Smrg
832621e67964Smrg  for depmode in $am_compiler_list; do
832721e67964Smrg    # Setup a source with many dependencies, because some compilers
832821e67964Smrg    # like to wrap large dependency lists on column 80 (with \), and
832921e67964Smrg    # we should not choose a depcomp mode which is confused by this.
833021e67964Smrg    #
833121e67964Smrg    # We need to recreate these files for each test, as the compiler may
833221e67964Smrg    # overwrite some of them when testing with obscure command lines.
833321e67964Smrg    # This happens at least with the AIX C compiler.
833421e67964Smrg    : > sub/conftest.c
833521e67964Smrg    for i in 1 2 3 4 5 6; do
833621e67964Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
833721e67964Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
833821e67964Smrg      # Solaris 8's {/usr,}/bin/sh.
833921e67964Smrg      touch sub/conftst$i.h
834021e67964Smrg    done
834121e67964Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
834221e67964Smrg
8343c27c18e8Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
8344c27c18e8Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
8345c27c18e8Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
8346c27c18e8Smrg    # versions had trouble with output in subdirs
8347c27c18e8Smrg    am__obj=sub/conftest.${OBJEXT-o}
8348c27c18e8Smrg    am__minus_obj="-o $am__obj"
834921e67964Smrg    case $depmode in
8350c27c18e8Smrg    gcc)
8351c27c18e8Smrg      # This depmode causes a compiler race in universal mode.
8352c27c18e8Smrg      test "$am__universal" = false || continue
8353c27c18e8Smrg      ;;
835421e67964Smrg    nosideeffect)
835521e67964Smrg      # after this tag, mechanisms are not by side-effect, so they'll
835621e67964Smrg      # only be used when explicitly requested
835721e67964Smrg      if test "x$enable_dependency_tracking" = xyes; then
835821e67964Smrg	continue
8359c43cc173Smrg      else
836021e67964Smrg	break
8361c43cc173Smrg      fi
8362c43cc173Smrg      ;;
8363c27c18e8Smrg    msvisualcpp | msvcmsys)
8364c27c18e8Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
8365c27c18e8Smrg      # not run yet.  These depmodes are late enough in the game, and
8366c27c18e8Smrg      # so weak that their functioning should not be impacted.
8367c27c18e8Smrg      am__obj=conftest.${OBJEXT-o}
8368c27c18e8Smrg      am__minus_obj=
8369c27c18e8Smrg      ;;
837021e67964Smrg    none) break ;;
837121e67964Smrg    esac
837221e67964Smrg    if depmode=$depmode \
8373c27c18e8Smrg       source=sub/conftest.c object=$am__obj \
837421e67964Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
8375c27c18e8Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
837621e67964Smrg         >/dev/null 2>conftest.err &&
837721e67964Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
837821e67964Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
8379c27c18e8Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
838021e67964Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
838121e67964Smrg      # icc doesn't choke on unknown options, it will just issue warnings
838221e67964Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
838321e67964Smrg      # that says an option was ignored or not supported.
838421e67964Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
838521e67964Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
838621e67964Smrg      # The diagnosis changed in icc 8.0:
838721e67964Smrg      #   icc: Command line remark: option '-MP' not supported
838821e67964Smrg      if (grep 'ignoring option' conftest.err ||
838921e67964Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
839021e67964Smrg        am_cv_$1_dependencies_compiler_type=$depmode
839121e67964Smrg        break
839221e67964Smrg      fi
839321e67964Smrg    fi
839421e67964Smrg  done
839521e67964Smrg
839621e67964Smrg  cd ..
839721e67964Smrg  rm -rf conftest.dir
839821e67964Smrgelse
839921e67964Smrg  am_cv_$1_dependencies_compiler_type=none
840021e67964Smrgfi
840121e67964Smrg])
840221e67964SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
840321e67964SmrgAM_CONDITIONAL([am__fastdep$1], [
840421e67964Smrg  test "x$enable_dependency_tracking" != xno \
840521e67964Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
840621e67964Smrg])
840721e67964Smrg
840821e67964Smrg
840921e67964Smrg# AM_SET_DEPDIR
841021e67964Smrg# -------------
841121e67964Smrg# Choose a directory name for dependency files.
841221e67964Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
841321e67964SmrgAC_DEFUN([AM_SET_DEPDIR],
841421e67964Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
841521e67964SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
841621e67964Smrg])
841721e67964Smrg
841821e67964Smrg
841921e67964Smrg# AM_DEP_TRACK
842021e67964Smrg# ------------
842121e67964SmrgAC_DEFUN([AM_DEP_TRACK],
842221e67964Smrg[AC_ARG_ENABLE(dependency-tracking,
842321e67964Smrg[  --disable-dependency-tracking  speeds up one-time build
842421e67964Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
842521e67964Smrgif test "x$enable_dependency_tracking" != xno; then
842621e67964Smrg  am_depcomp="$ac_aux_dir/depcomp"
842721e67964Smrg  AMDEPBACKSLASH='\'
842821e67964Smrgfi
842921e67964SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
843021e67964SmrgAC_SUBST([AMDEPBACKSLASH])dnl
843121e67964Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
843221e67964Smrg])
843321e67964Smrg
843421e67964Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
8435c43cc173Smrg
8436c27c18e8Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
843721e67964Smrg# Free Software Foundation, Inc.
843821e67964Smrg#
843921e67964Smrg# This file is free software; the Free Software Foundation
844021e67964Smrg# gives unlimited permission to copy and/or distribute it,
844121e67964Smrg# with or without modifications, as long as this notice is preserved.
8442c43cc173Smrg
8443c27c18e8Smrg#serial 5
8444c43cc173Smrg
844521e67964Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
844621e67964Smrg# ------------------------------
844721e67964SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
8448c27c18e8Smrg[{
8449c27c18e8Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
8450c27c18e8Smrg  # are listed without --file.  Let's play safe and only enable the eval
8451c27c18e8Smrg  # if we detect the quoting.
8452c27c18e8Smrg  case $CONFIG_FILES in
8453c27c18e8Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
8454c27c18e8Smrg  *)   set x $CONFIG_FILES ;;
8455c27c18e8Smrg  esac
8456c27c18e8Smrg  shift
8457c27c18e8Smrg  for mf
8458c27c18e8Smrg  do
8459c27c18e8Smrg    # Strip MF so we end up with the name of the file.
8460c27c18e8Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
8461c27c18e8Smrg    # Check whether this is an Automake generated Makefile or not.
8462c27c18e8Smrg    # We used to match only the files named `Makefile.in', but
8463c27c18e8Smrg    # some people rename them; so instead we look at the file content.
8464c27c18e8Smrg    # Grep'ing the first line is not enough: some people post-process
8465c27c18e8Smrg    # each Makefile.in and add a new line on top of each file to say so.
8466c27c18e8Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
8467c27c18e8Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
8468c27c18e8Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
8469c27c18e8Smrg      dirpart=`AS_DIRNAME("$mf")`
8470c27c18e8Smrg    else
8471c27c18e8Smrg      continue
8472c27c18e8Smrg    fi
8473c27c18e8Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
8474c27c18e8Smrg    # from the Makefile without running `make'.
8475c27c18e8Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
8476c27c18e8Smrg    test -z "$DEPDIR" && continue
8477c27c18e8Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
8478c27c18e8Smrg    test -z "am__include" && continue
8479c27c18e8Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
8480c27c18e8Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
8481c27c18e8Smrg    U=`sed -n 's/^U = //p' < "$mf"`
8482c27c18e8Smrg    # Find all dependency output files, they are included files with
8483c27c18e8Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
8484c27c18e8Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
8485c27c18e8Smrg    # expansion.
8486c27c18e8Smrg    for file in `sed -n "
8487c27c18e8Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
8488c27c18e8Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
8489c27c18e8Smrg      # Make sure the directory exists.
8490c27c18e8Smrg      test -f "$dirpart/$file" && continue
8491c27c18e8Smrg      fdir=`AS_DIRNAME(["$file"])`
8492c27c18e8Smrg      AS_MKDIR_P([$dirpart/$fdir])
8493c27c18e8Smrg      # echo "creating $dirpart/$file"
8494c27c18e8Smrg      echo '# dummy' > "$dirpart/$file"
8495c27c18e8Smrg    done
849621e67964Smrg  done
8497c27c18e8Smrg}
849821e67964Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
8499c43cc173Smrg
8500c43cc173Smrg
850121e67964Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
850221e67964Smrg# -----------------------------
850321e67964Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
850421e67964Smrg#
850521e67964Smrg# This code is only required when automatic dependency tracking
850621e67964Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
850721e67964Smrg# need in order to bootstrap the dependency handling code.
850821e67964SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
850921e67964Smrg[AC_CONFIG_COMMANDS([depfiles],
851021e67964Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
851121e67964Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
851221e67964Smrg])
8513c43cc173Smrg
851421e67964Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
851521e67964Smrg# Free Software Foundation, Inc.
851621e67964Smrg#
851721e67964Smrg# This file is free software; the Free Software Foundation
851821e67964Smrg# gives unlimited permission to copy and/or distribute it,
851921e67964Smrg# with or without modifications, as long as this notice is preserved.
8520c43cc173Smrg
852121e67964Smrg# serial 8
8522c43cc173Smrg
852321e67964Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
852421e67964SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
8525c43cc173Smrg
852621e67964Smrg# Do all the work for Automake.                             -*- Autoconf -*-
8527c43cc173Smrg
852821e67964Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
8529c27c18e8Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
853021e67964Smrg#
853121e67964Smrg# This file is free software; the Free Software Foundation
853221e67964Smrg# gives unlimited permission to copy and/or distribute it,
853321e67964Smrg# with or without modifications, as long as this notice is preserved.
8534c43cc173Smrg
8535c27c18e8Smrg# serial 16
8536c43cc173Smrg
853721e67964Smrg# This macro actually does too much.  Some checks are only needed if
853821e67964Smrg# your package does certain things.  But this isn't really a big deal.
8539c43cc173Smrg
854021e67964Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
854121e67964Smrg# AM_INIT_AUTOMAKE([OPTIONS])
854221e67964Smrg# -----------------------------------------------
854321e67964Smrg# The call with PACKAGE and VERSION arguments is the old style
854421e67964Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
854521e67964Smrg# and VERSION should now be passed to AC_INIT and removed from
854621e67964Smrg# the call to AM_INIT_AUTOMAKE.
854721e67964Smrg# We support both call styles for the transition.  After
854821e67964Smrg# the next Automake release, Autoconf can make the AC_INIT
854921e67964Smrg# arguments mandatory, and then we can depend on a new Autoconf
855021e67964Smrg# release and drop the old call support.
855121e67964SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
8552c27c18e8Smrg[AC_PREREQ([2.62])dnl
855321e67964Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
855421e67964Smrgdnl the ones we care about.
855521e67964Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
855621e67964SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
855721e67964SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
855821e67964Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
855921e67964Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
856021e67964Smrg  # is not polluted with repeated "-I."
856121e67964Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
856221e67964Smrg  # test to see if srcdir already configured
856321e67964Smrg  if test -f $srcdir/config.status; then
856421e67964Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
856521e67964Smrg  fi
856621e67964Smrgfi
856721e67964Smrg
856821e67964Smrg# test whether we have cygpath
856921e67964Smrgif test -z "$CYGPATH_W"; then
857021e67964Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
857121e67964Smrg    CYGPATH_W='cygpath -w'
8572c43cc173Smrg  else
857321e67964Smrg    CYGPATH_W=echo
857421e67964Smrg  fi
857521e67964Smrgfi
857621e67964SmrgAC_SUBST([CYGPATH_W])
8577c43cc173Smrg
857821e67964Smrg# Define the identity of the package.
857921e67964Smrgdnl Distinguish between old-style and new-style calls.
858021e67964Smrgm4_ifval([$2],
858121e67964Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
858221e67964Smrg AC_SUBST([PACKAGE], [$1])dnl
858321e67964Smrg AC_SUBST([VERSION], [$2])],
858421e67964Smrg[_AM_SET_OPTIONS([$1])dnl
858521e67964Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
858621e67964Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
858721e67964Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
858821e67964Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
858921e67964Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
8590c43cc173Smrg
859121e67964Smrg_AM_IF_OPTION([no-define],,
859221e67964Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
859321e67964Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
8594c43cc173Smrg
859521e67964Smrg# Some tools Automake needs.
859621e67964SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
859721e67964SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
859821e67964SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
859921e67964SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
860021e67964SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
860121e67964SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
860221e67964SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
8603c27c18e8SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
8604c27c18e8SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
860521e67964SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
860621e67964Smrg# We need awk for the "check" target.  The system "awk" is bad on
860721e67964Smrg# some platforms.
860821e67964SmrgAC_REQUIRE([AC_PROG_AWK])dnl
860921e67964SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
861021e67964SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
861121e67964Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
8612c27c18e8Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
8613c27c18e8Smrg			     [_AM_PROG_TAR([v7])])])
861421e67964Smrg_AM_IF_OPTION([no-dependencies],,
861521e67964Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
8616c27c18e8Smrg		  [_AM_DEPENDENCIES(CC)],
8617c27c18e8Smrg		  [define([AC_PROG_CC],
8618c27c18e8Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
861921e67964SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
8620c27c18e8Smrg		  [_AM_DEPENDENCIES(CXX)],
8621c27c18e8Smrg		  [define([AC_PROG_CXX],
8622c27c18e8Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
862321e67964SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
8624c27c18e8Smrg		  [_AM_DEPENDENCIES(OBJC)],
8625c27c18e8Smrg		  [define([AC_PROG_OBJC],
8626c27c18e8Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
862721e67964Smrg])
8628c27c18e8Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
8629c27c18e8Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
8630c27c18e8Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
8631c27c18e8Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
8632c27c18e8SmrgAC_CONFIG_COMMANDS_PRE(dnl
8633c27c18e8Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
8634c27c18e8Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
863521e67964Smrg])
8636c43cc173Smrg
8637c27c18e8Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
8638c27c18e8Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
8639c27c18e8Smrgdnl mangled by Autoconf and run in a shell conditional statement.
8640c27c18e8Smrgm4_define([_AC_COMPILER_EXEEXT],
8641c27c18e8Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
8642c27c18e8Smrg
8643c43cc173Smrg
864421e67964Smrg# When config.status generates a header, we must update the stamp-h file.
864521e67964Smrg# This file resides in the same directory as the config header
864621e67964Smrg# that is generated.  The stamp files are numbered to have different names.
8647c43cc173Smrg
864821e67964Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
864921e67964Smrg# loop where config.status creates the headers, so we can generate
865021e67964Smrg# our stamp files there.
865121e67964SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
865221e67964Smrg[# Compute $1's index in $config_headers.
865321e67964Smrg_am_arg=$1
865421e67964Smrg_am_stamp_count=1
865521e67964Smrgfor _am_header in $config_headers :; do
865621e67964Smrg  case $_am_header in
865721e67964Smrg    $_am_arg | $_am_arg:* )
865821e67964Smrg      break ;;
865921e67964Smrg    * )
866021e67964Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
866121e67964Smrg  esac
866221e67964Smrgdone
866321e67964Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
8664c43cc173Smrg
8665c27c18e8Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
866621e67964Smrg#
866721e67964Smrg# This file is free software; the Free Software Foundation
866821e67964Smrg# gives unlimited permission to copy and/or distribute it,
866921e67964Smrg# with or without modifications, as long as this notice is preserved.
8670c43cc173Smrg
867121e67964Smrg# AM_PROG_INSTALL_SH
867221e67964Smrg# ------------------
867321e67964Smrg# Define $install_sh.
867421e67964SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
867521e67964Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
8676c27c18e8Smrgif test x"${install_sh}" != xset; then
8677c27c18e8Smrg  case $am_aux_dir in
8678c27c18e8Smrg  *\ * | *\	*)
8679c27c18e8Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
8680c27c18e8Smrg  *)
8681c27c18e8Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
8682c27c18e8Smrg  esac
8683c27c18e8Smrgfi
868421e67964SmrgAC_SUBST(install_sh)])
8685c43cc173Smrg
868621e67964Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
868721e67964Smrg#
868821e67964Smrg# This file is free software; the Free Software Foundation
868921e67964Smrg# gives unlimited permission to copy and/or distribute it,
869021e67964Smrg# with or without modifications, as long as this notice is preserved.
8691c43cc173Smrg
869221e67964Smrg# serial 2
8693c43cc173Smrg
869421e67964Smrg# Check whether the underlying file-system supports filenames
869521e67964Smrg# with a leading dot.  For instance MS-DOS doesn't.
869621e67964SmrgAC_DEFUN([AM_SET_LEADING_DOT],
869721e67964Smrg[rm -rf .tst 2>/dev/null
869821e67964Smrgmkdir .tst 2>/dev/null
869921e67964Smrgif test -d .tst; then
870021e67964Smrg  am__leading_dot=.
870121e67964Smrgelse
870221e67964Smrg  am__leading_dot=_
870321e67964Smrgfi
870421e67964Smrgrmdir .tst 2>/dev/null
870521e67964SmrgAC_SUBST([am__leading_dot])])
8706c43cc173Smrg
870721e67964Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
870821e67964Smrg# From Jim Meyering
8709c43cc173Smrg
8710c27c18e8Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
871121e67964Smrg# Free Software Foundation, Inc.
871221e67964Smrg#
871321e67964Smrg# This file is free software; the Free Software Foundation
871421e67964Smrg# gives unlimited permission to copy and/or distribute it,
871521e67964Smrg# with or without modifications, as long as this notice is preserved.
8716c43cc173Smrg
8717c27c18e8Smrg# serial 5
8718c43cc173Smrg
8719c27c18e8Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
8720c27c18e8Smrg# ----------------------------------
8721c27c18e8Smrg# Control maintainer-specific portions of Makefiles.
8722c27c18e8Smrg# Default is to disable them, unless `enable' is passed literally.
8723c27c18e8Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
8724c27c18e8Smrg# can override the default with the --enable/--disable switch.
872521e67964SmrgAC_DEFUN([AM_MAINTAINER_MODE],
8726c27c18e8Smrg[m4_case(m4_default([$1], [disable]),
8727c27c18e8Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
8728c27c18e8Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
8729c27c18e8Smrg       [m4_define([am_maintainer_other], [enable])
8730c27c18e8Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
8731c27c18e8SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
8732c27c18e8Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
8733c27c18e8Smrg  AC_ARG_ENABLE([maintainer-mode],
8734c27c18e8Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
873521e67964Smrg			  (and sometimes confusing) to the casual installer],
8736c27c18e8Smrg      [USE_MAINTAINER_MODE=$enableval],
8737c27c18e8Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
873821e67964Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
8739c27c18e8Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
874021e67964Smrg  MAINT=$MAINTAINER_MODE_TRUE
8741c27c18e8Smrg  AC_SUBST([MAINT])dnl
874221e67964Smrg]
874321e67964Smrg)
8744c43cc173Smrg
874521e67964SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
8746c43cc173Smrg
874721e67964Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
8748c43cc173Smrg
8749c27c18e8Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
875021e67964Smrg#
875121e67964Smrg# This file is free software; the Free Software Foundation
875221e67964Smrg# gives unlimited permission to copy and/or distribute it,
875321e67964Smrg# with or without modifications, as long as this notice is preserved.
8754c43cc173Smrg
8755c27c18e8Smrg# serial 4
8756c43cc173Smrg
875721e67964Smrg# AM_MAKE_INCLUDE()
875821e67964Smrg# -----------------
875921e67964Smrg# Check to see how make treats includes.
876021e67964SmrgAC_DEFUN([AM_MAKE_INCLUDE],
876121e67964Smrg[am_make=${MAKE-make}
876221e67964Smrgcat > confinc << 'END'
876321e67964Smrgam__doit:
8764c27c18e8Smrg	@echo this is the am__doit target
876521e67964Smrg.PHONY: am__doit
876621e67964SmrgEND
876721e67964Smrg# If we don't find an include directive, just comment out the code.
876821e67964SmrgAC_MSG_CHECKING([for style of include used by $am_make])
876921e67964Smrgam__include="#"
877021e67964Smrgam__quote=
877121e67964Smrg_am_result=none
877221e67964Smrg# First try GNU make style include.
877321e67964Smrgecho "include confinc" > confmf
8774c27c18e8Smrg# Ignore all kinds of additional output from `make'.
8775c27c18e8Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
8776c27c18e8Smrg*the\ am__doit\ target*)
8777c27c18e8Smrg  am__include=include
8778c27c18e8Smrg  am__quote=
8779c27c18e8Smrg  _am_result=GNU
8780c27c18e8Smrg  ;;
8781c27c18e8Smrgesac
878221e67964Smrg# Now try BSD make style include.
878321e67964Smrgif test "$am__include" = "#"; then
878421e67964Smrg   echo '.include "confinc"' > confmf
8785c27c18e8Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
8786c27c18e8Smrg   *the\ am__doit\ target*)
8787c27c18e8Smrg     am__include=.include
8788c27c18e8Smrg     am__quote="\""
8789c27c18e8Smrg     _am_result=BSD
8790c27c18e8Smrg     ;;
8791c27c18e8Smrg   esac
879221e67964Smrgfi
879321e67964SmrgAC_SUBST([am__include])
879421e67964SmrgAC_SUBST([am__quote])
879521e67964SmrgAC_MSG_RESULT([$_am_result])
879621e67964Smrgrm -f confinc confmf
879721e67964Smrg])
8798c43cc173Smrg
879921e67964Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
8800c43cc173Smrg
8801c27c18e8Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
880221e67964Smrg# Free Software Foundation, Inc.
880321e67964Smrg#
880421e67964Smrg# This file is free software; the Free Software Foundation
880521e67964Smrg# gives unlimited permission to copy and/or distribute it,
880621e67964Smrg# with or without modifications, as long as this notice is preserved.
8807c43cc173Smrg
8808c27c18e8Smrg# serial 6
8809c43cc173Smrg
881021e67964Smrg# AM_MISSING_PROG(NAME, PROGRAM)
881121e67964Smrg# ------------------------------
881221e67964SmrgAC_DEFUN([AM_MISSING_PROG],
881321e67964Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
881421e67964Smrg$1=${$1-"${am_missing_run}$2"}
881521e67964SmrgAC_SUBST($1)])
8816c43cc173Smrg
8817c43cc173Smrg
881821e67964Smrg# AM_MISSING_HAS_RUN
881921e67964Smrg# ------------------
882021e67964Smrg# Define MISSING if not defined so far and test if it supports --run.
882121e67964Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
882221e67964SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
882321e67964Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
882421e67964SmrgAC_REQUIRE_AUX_FILE([missing])dnl
8825c27c18e8Smrgif test x"${MISSING+set}" != xset; then
8826c27c18e8Smrg  case $am_aux_dir in
8827c27c18e8Smrg  *\ * | *\	*)
8828c27c18e8Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
8829c27c18e8Smrg  *)
8830c27c18e8Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
8831c27c18e8Smrg  esac
8832c27c18e8Smrgfi
883321e67964Smrg# Use eval to expand $SHELL
883421e67964Smrgif eval "$MISSING --run true"; then
883521e67964Smrg  am_missing_run="$MISSING --run "
883621e67964Smrgelse
883721e67964Smrg  am_missing_run=
883821e67964Smrg  AC_MSG_WARN([`missing' script is too old or missing])
883921e67964Smrgfi
884021e67964Smrg])
884121e67964Smrg
884221e67964Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
884321e67964Smrg#
884421e67964Smrg# This file is free software; the Free Software Foundation
884521e67964Smrg# gives unlimited permission to copy and/or distribute it,
884621e67964Smrg# with or without modifications, as long as this notice is preserved.
884721e67964Smrg
884821e67964Smrg# AM_PROG_MKDIR_P
884921e67964Smrg# ---------------
885021e67964Smrg# Check for `mkdir -p'.
885121e67964SmrgAC_DEFUN([AM_PROG_MKDIR_P],
885221e67964Smrg[AC_PREREQ([2.60])dnl
885321e67964SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
885421e67964Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
885521e67964Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
885621e67964Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
885721e67964Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
885821e67964Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
885921e67964Smrgdnl adjustment using top_builddir (which is defined more often than
886021e67964Smrgdnl MKDIR_P).
886121e67964SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
886221e67964Smrgcase $mkdir_p in
886321e67964Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
886421e67964Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
886521e67964Smrgesac
886621e67964Smrg])
8867c43cc173Smrg
886821e67964Smrg# Helper functions for option handling.                     -*- Autoconf -*-
8869c43cc173Smrg
8870c27c18e8Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
887121e67964Smrg#
887221e67964Smrg# This file is free software; the Free Software Foundation
887321e67964Smrg# gives unlimited permission to copy and/or distribute it,
887421e67964Smrg# with or without modifications, as long as this notice is preserved.
8875c43cc173Smrg
8876c27c18e8Smrg# serial 4
8877c43cc173Smrg
887821e67964Smrg# _AM_MANGLE_OPTION(NAME)
887921e67964Smrg# -----------------------
888021e67964SmrgAC_DEFUN([_AM_MANGLE_OPTION],
888121e67964Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
8882c43cc173Smrg
888321e67964Smrg# _AM_SET_OPTION(NAME)
888421e67964Smrg# ------------------------------
888521e67964Smrg# Set option NAME.  Presently that only means defining a flag for this option.
888621e67964SmrgAC_DEFUN([_AM_SET_OPTION],
888721e67964Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
8888c43cc173Smrg
888921e67964Smrg# _AM_SET_OPTIONS(OPTIONS)
889021e67964Smrg# ----------------------------------
889121e67964Smrg# OPTIONS is a space-separated list of Automake options.
889221e67964SmrgAC_DEFUN([_AM_SET_OPTIONS],
8893c27c18e8Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
8894c43cc173Smrg
889521e67964Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
889621e67964Smrg# -------------------------------------------
889721e67964Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
889821e67964SmrgAC_DEFUN([_AM_IF_OPTION],
889921e67964Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
8900c43cc173Smrg
890121e67964Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
8902c43cc173Smrg
8903c27c18e8Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
890421e67964Smrg# Free Software Foundation, Inc.
890521e67964Smrg#
890621e67964Smrg# This file is free software; the Free Software Foundation
890721e67964Smrg# gives unlimited permission to copy and/or distribute it,
890821e67964Smrg# with or without modifications, as long as this notice is preserved.
8909c43cc173Smrg
8910c27c18e8Smrg# serial 5
8911c43cc173Smrg
891221e67964Smrg# AM_SANITY_CHECK
891321e67964Smrg# ---------------
891421e67964SmrgAC_DEFUN([AM_SANITY_CHECK],
891521e67964Smrg[AC_MSG_CHECKING([whether build environment is sane])
891621e67964Smrg# Just in case
891721e67964Smrgsleep 1
891821e67964Smrgecho timestamp > conftest.file
8919c27c18e8Smrg# Reject unsafe characters in $srcdir or the absolute working directory
8920c27c18e8Smrg# name.  Accept space and tab only in the latter.
8921c27c18e8Smrgam_lf='
8922c27c18e8Smrg'
8923c27c18e8Smrgcase `pwd` in
8924c27c18e8Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8925c27c18e8Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8926c27c18e8Smrgesac
8927c27c18e8Smrgcase $srcdir in
8928c27c18e8Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8929c27c18e8Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
8930c27c18e8Smrgesac
8931c27c18e8Smrg
893221e67964Smrg# Do `set' in a subshell so we don't clobber the current shell's
893321e67964Smrg# arguments.  Must try -L first in case configure is actually a
893421e67964Smrg# symlink; some systems play weird games with the mod time of symlinks
893521e67964Smrg# (eg FreeBSD returns the mod time of the symlink's containing
893621e67964Smrg# directory).
893721e67964Smrgif (
8938c27c18e8Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
893921e67964Smrg   if test "$[*]" = "X"; then
894021e67964Smrg      # -L didn't work.
8941c27c18e8Smrg      set X `ls -t "$srcdir/configure" conftest.file`
894221e67964Smrg   fi
894321e67964Smrg   rm -f conftest.file
894421e67964Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
894521e67964Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8946c43cc173Smrg
894721e67964Smrg      # If neither matched, then we have a broken ls.  This can happen
894821e67964Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
894921e67964Smrg      # broken ls alias from the environment.  This has actually
895021e67964Smrg      # happened.  Such a system could not be considered "sane".
895121e67964Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
895221e67964Smrgalias in your environment])
895321e67964Smrg   fi
8954c43cc173Smrg
895521e67964Smrg   test "$[2]" = conftest.file
895621e67964Smrg   )
895721e67964Smrgthen
895821e67964Smrg   # Ok.
895921e67964Smrg   :
896021e67964Smrgelse
896121e67964Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
896221e67964SmrgCheck your system clock])
896321e67964Smrgfi
896421e67964SmrgAC_MSG_RESULT(yes)])
8965c43cc173Smrg
8966c27c18e8Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
8967c27c18e8Smrg#
8968c27c18e8Smrg# This file is free software; the Free Software Foundation
8969c27c18e8Smrg# gives unlimited permission to copy and/or distribute it,
8970c27c18e8Smrg# with or without modifications, as long as this notice is preserved.
8971c27c18e8Smrg
8972c27c18e8Smrg# serial 1
8973c27c18e8Smrg
8974c27c18e8Smrg# AM_SILENT_RULES([DEFAULT])
8975c27c18e8Smrg# --------------------------
8976c27c18e8Smrg# Enable less verbose build rules; with the default set to DEFAULT
8977c27c18e8Smrg# (`yes' being less verbose, `no' or empty being verbose).
8978c27c18e8SmrgAC_DEFUN([AM_SILENT_RULES],
8979c27c18e8Smrg[AC_ARG_ENABLE([silent-rules],
8980c27c18e8Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
8981c27c18e8Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
8982c27c18e8Smrgcase $enable_silent_rules in
8983c27c18e8Smrgyes) AM_DEFAULT_VERBOSITY=0;;
8984c27c18e8Smrgno)  AM_DEFAULT_VERBOSITY=1;;
8985c27c18e8Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
8986c27c18e8Smrgesac
8987c27c18e8SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
8988c27c18e8SmrgAM_BACKSLASH='\'
8989c27c18e8SmrgAC_SUBST([AM_BACKSLASH])dnl
8990c27c18e8Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8991c27c18e8Smrg])
8992c27c18e8Smrg
899321e67964Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
899421e67964Smrg#
899521e67964Smrg# This file is free software; the Free Software Foundation
899621e67964Smrg# gives unlimited permission to copy and/or distribute it,
899721e67964Smrg# with or without modifications, as long as this notice is preserved.
899821e67964Smrg
899921e67964Smrg# AM_PROG_INSTALL_STRIP
900021e67964Smrg# ---------------------
900121e67964Smrg# One issue with vendor `install' (even GNU) is that you can't
900221e67964Smrg# specify the program used to strip binaries.  This is especially
900321e67964Smrg# annoying in cross-compiling environments, where the build's strip
900421e67964Smrg# is unlikely to handle the host's binaries.
900521e67964Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
900621e67964Smrg# always use install-sh in `make install-strip', and initialize
900721e67964Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
900821e67964SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
900921e67964Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
901021e67964Smrg# Installed binaries are usually stripped using `strip' when the user
901121e67964Smrg# run `make install-strip'.  However `strip' might not be the right
901221e67964Smrg# tool to use in cross-compilation environments, therefore Automake
901321e67964Smrg# will honor the `STRIP' environment variable to overrule this program.
901421e67964Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
901521e67964Smrgif test "$cross_compiling" != no; then
901621e67964Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
901721e67964Smrgfi
901821e67964SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
901921e67964SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
902021e67964Smrg
9021c27c18e8Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
902221e67964Smrg#
902321e67964Smrg# This file is free software; the Free Software Foundation
902421e67964Smrg# gives unlimited permission to copy and/or distribute it,
902521e67964Smrg# with or without modifications, as long as this notice is preserved.
9026c43cc173Smrg
9027c27c18e8Smrg# serial 2
9028c27c18e8Smrg
902921e67964Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
903021e67964Smrg# ---------------------------
903121e67964Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
903221e67964Smrg# This macro is traced by Automake.
903321e67964SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9034c43cc173Smrg
9035c27c18e8Smrg# AM_SUBST_NOTMAKE(VARIABLE)
9036c27c18e8Smrg# ---------------------------
9037c27c18e8Smrg# Public sister of _AM_SUBST_NOTMAKE.
9038c27c18e8SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9039c27c18e8Smrg
904021e67964Smrg# Check how to create a tarball.                            -*- Autoconf -*-
9041c43cc173Smrg
904221e67964Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
904321e67964Smrg#
904421e67964Smrg# This file is free software; the Free Software Foundation
904521e67964Smrg# gives unlimited permission to copy and/or distribute it,
904621e67964Smrg# with or without modifications, as long as this notice is preserved.
904721e67964Smrg
904821e67964Smrg# serial 2
9049c43cc173Smrg
905021e67964Smrg# _AM_PROG_TAR(FORMAT)
905121e67964Smrg# --------------------
905221e67964Smrg# Check how to create a tarball in format FORMAT.
905321e67964Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
9054c43cc173Smrg#
905521e67964Smrg# Substitute a variable $(am__tar) that is a command
905621e67964Smrg# writing to stdout a FORMAT-tarball containing the directory
905721e67964Smrg# $tardir.
905821e67964Smrg#     tardir=directory && $(am__tar) > result.tar
9059c43cc173Smrg#
906021e67964Smrg# Substitute a variable $(am__untar) that extract such
906121e67964Smrg# a tarball read from stdin.
906221e67964Smrg#     $(am__untar) < result.tar
906321e67964SmrgAC_DEFUN([_AM_PROG_TAR],
906421e67964Smrg[# Always define AMTAR for backward compatibility.
906521e67964SmrgAM_MISSING_PROG([AMTAR], [tar])
906621e67964Smrgm4_if([$1], [v7],
906721e67964Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
906821e67964Smrg     [m4_case([$1], [ustar],, [pax],,
906921e67964Smrg              [m4_fatal([Unknown tar format])])
907021e67964SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
907121e67964Smrg# Loop over all known methods to create a tar archive until one works.
907221e67964Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
907321e67964Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
907421e67964Smrg# Do not fold the above two line into one, because Tru64 sh and
907521e67964Smrg# Solaris sh will not grok spaces in the rhs of `-'.
907621e67964Smrgfor _am_tool in $_am_tools
907721e67964Smrgdo
907821e67964Smrg  case $_am_tool in
907921e67964Smrg  gnutar)
908021e67964Smrg    for _am_tar in tar gnutar gtar;
908121e67964Smrg    do
908221e67964Smrg      AM_RUN_LOG([$_am_tar --version]) && break
908321e67964Smrg    done
908421e67964Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
908521e67964Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
908621e67964Smrg    am__untar="$_am_tar -xf -"
908721e67964Smrg    ;;
908821e67964Smrg  plaintar)
908921e67964Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
909021e67964Smrg    # ustar tarball either.
909121e67964Smrg    (tar --version) >/dev/null 2>&1 && continue
909221e67964Smrg    am__tar='tar chf - "$$tardir"'
909321e67964Smrg    am__tar_='tar chf - "$tardir"'
909421e67964Smrg    am__untar='tar xf -'
909521e67964Smrg    ;;
909621e67964Smrg  pax)
909721e67964Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
909821e67964Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
909921e67964Smrg    am__untar='pax -r'
910021e67964Smrg    ;;
910121e67964Smrg  cpio)
910221e67964Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
910321e67964Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
910421e67964Smrg    am__untar='cpio -i -H $1 -d'
910521e67964Smrg    ;;
910621e67964Smrg  none)
910721e67964Smrg    am__tar=false
910821e67964Smrg    am__tar_=false
910921e67964Smrg    am__untar=false
911021e67964Smrg    ;;
911121e67964Smrg  esac
9112c43cc173Smrg
911321e67964Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
911421e67964Smrg  # and am__untar set.
911521e67964Smrg  test -n "${am_cv_prog_tar_$1}" && break
9116c43cc173Smrg
911721e67964Smrg  # tar/untar a dummy directory, and stop if the command works
911821e67964Smrg  rm -rf conftest.dir
911921e67964Smrg  mkdir conftest.dir
912021e67964Smrg  echo GrepMe > conftest.dir/file
912121e67964Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
912221e67964Smrg  rm -rf conftest.dir
912321e67964Smrg  if test -s conftest.tar; then
912421e67964Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
912521e67964Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
9126c43cc173Smrg  fi
912721e67964Smrgdone
912821e67964Smrgrm -rf conftest.dir
9129c43cc173Smrg
913021e67964SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
913121e67964SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
913221e67964SmrgAC_SUBST([am__tar])
913321e67964SmrgAC_SUBST([am__untar])
913421e67964Smrg]) # _AM_PROG_TAR
9135c43cc173Smrg
913621e67964Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
913721e67964Smrgdnl
913821e67964Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
913921e67964Smrgdnl 
914021e67964Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
914121e67964Smrgdnl copy of this software and associated documentation files (the
914221e67964Smrgdnl "Software"), to deal in the Software without restriction, including
914321e67964Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
914421e67964Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
914521e67964Smrgdnl to whom the Software is furnished to do so, provided that the above
914621e67964Smrgdnl copyright notice(s) and this permission notice appear in all copies of
914721e67964Smrgdnl the Software and that both the above copyright notice(s) and this
914821e67964Smrgdnl permission notice appear in supporting documentation.
914921e67964Smrgdnl
915021e67964Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
915121e67964Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
915221e67964Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
915321e67964Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
915421e67964Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
915521e67964Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
915621e67964Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
915721e67964Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
915821e67964Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
915921e67964Smrgdnl
916021e67964Smrgdnl Except as contained in this notice, the name of a copyright holder
916121e67964Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
916221e67964Smrgdnl or other dealings in this Software without prior written authorization
916321e67964Smrgdnl of the copyright holder.
916421e67964Smrg
916521e67964Smrg# XORG_MACROS_VERSION(required-version)
916621e67964Smrg# -------------------------------------
916721e67964Smrg# Minimum version: 1.1.0
9168c43cc173Smrg#
916921e67964Smrg# If you're using a macro added in Version 1.1 or newer, include this in
917021e67964Smrg# your configure.ac with the minimum required version, such as:
917121e67964Smrg# XORG_MACROS_VERSION(1.1)
9172c43cc173Smrg#
9173c27c18e8Smrg# To ensure that this macro is defined, also add:
9174c27c18e8Smrg# m4_ifndef([XORG_MACROS_VERSION],
9175c27c18e8Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9176c43cc173Smrg#
9177c43cc173Smrg#
917821e67964Smrg# See the "minimum version" comment for each macro you use to see what 
917921e67964Smrg# version you require.
9180c27c18e8Smrgm4_defun([XORG_MACROS_VERSION],[
9181c27c18e8Smrgm4_define([vers_have], [1.3.0])
9182c27c18e8Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9183c27c18e8Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9184c27c18e8Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
9185c27c18e8Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9186c27c18e8Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
9187c27c18e8Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9188c27c18e8Smrgm4_undefine([vers_have])
9189c27c18e8Smrgm4_undefine([maj_have])
9190c27c18e8Smrgm4_undefine([maj_needed])
919121e67964Smrg]) # XORG_MACROS_VERSION
9192c43cc173Smrg
919321e67964Smrg# XORG_PROG_RAWCPP()
919421e67964Smrg# ------------------
919521e67964Smrg# Minimum version: 1.0.0
919621e67964Smrg#
919721e67964Smrg# Find cpp program and necessary flags for use in pre-processing text files
919821e67964Smrg# such as man pages and config files
919921e67964SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
920021e67964SmrgAC_REQUIRE([AC_PROG_CPP])
920121e67964SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
920221e67964Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9203c43cc173Smrg
920421e67964Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
920521e67964Smrg# which is not the best choice for supporting other OS'es, but covers most
920621e67964Smrg# of the ones we need for now.
920721e67964SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
920821e67964SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
920921e67964Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
921021e67964Smrg	AC_MSG_RESULT([no])
921121e67964Smrgelse
921221e67964Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
921321e67964Smrg		RAWCPPFLAGS=-undef
921421e67964Smrg		AC_MSG_RESULT([yes])
921521e67964Smrg	# under Cygwin unix is still defined even with -undef
921621e67964Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
921721e67964Smrg		RAWCPPFLAGS="-undef -ansi"
921821e67964Smrg		AC_MSG_RESULT([yes, with -ansi])
921921e67964Smrg	else
922021e67964Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
922121e67964Smrg	fi
922221e67964Smrgfi
922321e67964Smrgrm -f conftest.$ac_ext
9224c43cc173Smrg
922521e67964SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
922621e67964SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
922721e67964Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
922821e67964Smrg	AC_MSG_RESULT([no])
922921e67964Smrgelse
923021e67964Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
923121e67964Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
923221e67964Smrg		AC_MSG_RESULT([yes])
923321e67964Smrg	else
923421e67964Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
923521e67964Smrg	fi
923621e67964Smrgfi
923721e67964Smrgrm -f conftest.$ac_ext
923821e67964SmrgAC_SUBST(RAWCPPFLAGS)
923921e67964Smrg]) # XORG_PROG_RAWCPP
9240c43cc173Smrg
924121e67964Smrg# XORG_MANPAGE_SECTIONS()
924221e67964Smrg# -----------------------
924321e67964Smrg# Minimum version: 1.0.0
924421e67964Smrg#
924521e67964Smrg# Determine which sections man pages go in for the different man page types
924621e67964Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
924721e67964Smrg# Not sure if there's any better way than just hardcoding by OS name.
924821e67964Smrg# Override default settings by setting environment variables
9249c43cc173Smrg
925021e67964SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
925121e67964SmrgAC_REQUIRE([AC_CANONICAL_HOST])
9252c43cc173Smrg
925321e67964Smrgif test x$APP_MAN_SUFFIX = x    ; then
925421e67964Smrg    APP_MAN_SUFFIX=1
925521e67964Smrgfi
925621e67964Smrgif test x$APP_MAN_DIR = x    ; then
925721e67964Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
925821e67964Smrgfi
9259c43cc173Smrg
926021e67964Smrgif test x$LIB_MAN_SUFFIX = x    ; then
926121e67964Smrg    LIB_MAN_SUFFIX=3
926221e67964Smrgfi
926321e67964Smrgif test x$LIB_MAN_DIR = x    ; then
926421e67964Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
926521e67964Smrgfi
9266c43cc173Smrg
926721e67964Smrgif test x$FILE_MAN_SUFFIX = x    ; then
926821e67964Smrg    case $host_os in
926921e67964Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
927021e67964Smrg	*)		FILE_MAN_SUFFIX=5  ;;
927121e67964Smrg    esac
927221e67964Smrgfi
927321e67964Smrgif test x$FILE_MAN_DIR = x    ; then
927421e67964Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
927521e67964Smrgfi
9276c43cc173Smrg
927721e67964Smrgif test x$MISC_MAN_SUFFIX = x    ; then
927821e67964Smrg    case $host_os in
927921e67964Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
928021e67964Smrg	*)		MISC_MAN_SUFFIX=7  ;;
928121e67964Smrg    esac
928221e67964Smrgfi
928321e67964Smrgif test x$MISC_MAN_DIR = x    ; then
928421e67964Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
928521e67964Smrgfi
9286c43cc173Smrg
928721e67964Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
928821e67964Smrg    case $host_os in
928921e67964Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
929021e67964Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
929121e67964Smrg    esac
929221e67964Smrgfi
929321e67964Smrgif test x$DRIVER_MAN_DIR = x    ; then
929421e67964Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
929521e67964Smrgfi
9296c43cc173Smrg
929721e67964Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
929821e67964Smrg    case $host_os in
929921e67964Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
930021e67964Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
930121e67964Smrg    esac
930221e67964Smrgfi
930321e67964Smrgif test x$ADMIN_MAN_DIR = x    ; then
930421e67964Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
930521e67964Smrgfi
9306c43cc173Smrg
9307c43cc173Smrg
930821e67964SmrgAC_SUBST([APP_MAN_SUFFIX])
930921e67964SmrgAC_SUBST([LIB_MAN_SUFFIX])
931021e67964SmrgAC_SUBST([FILE_MAN_SUFFIX])
931121e67964SmrgAC_SUBST([MISC_MAN_SUFFIX])
931221e67964SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
931321e67964SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
931421e67964SmrgAC_SUBST([APP_MAN_DIR])
931521e67964SmrgAC_SUBST([LIB_MAN_DIR])
931621e67964SmrgAC_SUBST([FILE_MAN_DIR])
931721e67964SmrgAC_SUBST([MISC_MAN_DIR])
931821e67964SmrgAC_SUBST([DRIVER_MAN_DIR])
931921e67964SmrgAC_SUBST([ADMIN_MAN_DIR])
932021e67964Smrg]) # XORG_MANPAGE_SECTIONS
9321c43cc173Smrg
932221e67964Smrg# XORG_CHECK_LINUXDOC
932321e67964Smrg# -------------------
932421e67964Smrg# Minimum version: 1.0.0
9325c43cc173Smrg#
932621e67964Smrg# Defines the variable MAKE_TEXT if the necessary tools and
932721e67964Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
932821e67964Smrg# Whether or not the necessary tools and files are found can be checked
932921e67964Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
933021e67964SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
933121e67964Smrgif test x$XORG_SGML_PATH = x ; then
933221e67964Smrg    XORG_SGML_PATH=$prefix/share/sgml
9333c43cc173Smrgfi
933421e67964SmrgHAVE_DEFS_ENT=
9335c43cc173Smrg
933621e67964Smrgif test x"$cross_compiling" = x"yes" ; then
933721e67964Smrg  HAVE_DEFS_ENT=no
933821e67964Smrgelse
933921e67964Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
934021e67964Smrgfi
9341c43cc173Smrg
934221e67964SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
934321e67964SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
9344c43cc173Smrg
934521e67964SmrgAC_MSG_CHECKING([Whether to build documentation])
9346c43cc173Smrg
934721e67964Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
934821e67964Smrg   BUILDDOC=yes
934921e67964Smrgelse
935021e67964Smrg   BUILDDOC=no
935121e67964Smrgfi
9352c43cc173Smrg
935321e67964SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9354c43cc173Smrg
935521e67964SmrgAC_MSG_RESULT([$BUILDDOC])
935621e67964Smrg
935721e67964SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
935821e67964Smrg
935921e67964Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
936021e67964Smrg   BUILDPDFDOC=yes
9361c43cc173Smrgelse
936221e67964Smrg   BUILDPDFDOC=no
9363c43cc173Smrgfi
9364c43cc173Smrg
936521e67964SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9366c43cc173Smrg
936721e67964SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9368c43cc173Smrg
936921e67964SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
937021e67964SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
937121e67964SmrgMAKE_PDF="$PS2PDF"
937221e67964SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9373c43cc173Smrg
937421e67964SmrgAC_SUBST(MAKE_TEXT)
937521e67964SmrgAC_SUBST(MAKE_PS)
937621e67964SmrgAC_SUBST(MAKE_PDF)
937721e67964SmrgAC_SUBST(MAKE_HTML)
937821e67964Smrg]) # XORG_CHECK_LINUXDOC
937921e67964Smrg
938021e67964Smrg# XORG_CHECK_DOCBOOK
938121e67964Smrg# -------------------
938221e67964Smrg# Minimum version: 1.0.0
9383c43cc173Smrg#
938421e67964Smrg# Checks for the ability to build output formats from SGML DocBook source.
938521e67964Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
938621e67964Smrg# indicates whether the necessary tools and files are found and, if set,
938721e67964Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
938821e67964SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
938921e67964Smrgif test x$XORG_SGML_PATH = x ; then
939021e67964Smrg    XORG_SGML_PATH=$prefix/share/sgml
939121e67964Smrgfi
939221e67964SmrgHAVE_DEFS_ENT=
939321e67964SmrgBUILDTXTDOC=no
939421e67964SmrgBUILDPDFDOC=no
939521e67964SmrgBUILDPSDOC=no
939621e67964SmrgBUILDHTMLDOC=no
9397c43cc173Smrg
939821e67964SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
9399c43cc173Smrg
940021e67964SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
940121e67964SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
940221e67964SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
940321e67964SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9404c43cc173Smrg
940521e67964SmrgAC_MSG_CHECKING([Whether to build text documentation])
940621e67964Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
940721e67964Smrg   test x$BUILD_TXTDOC != xno; then
940821e67964Smrg	BUILDTXTDOC=yes
940921e67964Smrgfi
941021e67964SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
941121e67964SmrgAC_MSG_RESULT([$BUILDTXTDOC])
9412c43cc173Smrg
941321e67964SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
941421e67964Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
941521e67964Smrg   test x$BUILD_PDFDOC != xno; then
941621e67964Smrg	BUILDPDFDOC=yes
941721e67964Smrgfi
941821e67964SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
941921e67964SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9420c43cc173Smrg
942121e67964SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
942221e67964Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
942321e67964Smrg   test x$BUILD_PSDOC != xno; then
942421e67964Smrg	BUILDPSDOC=yes
942521e67964Smrgfi
942621e67964SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
942721e67964SmrgAC_MSG_RESULT([$BUILDPSDOC])
9428c43cc173Smrg
942921e67964SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
943021e67964Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
943121e67964Smrg   test x$BUILD_HTMLDOC != xno; then
943221e67964Smrg	BUILDHTMLDOC=yes
943321e67964Smrgfi
943421e67964SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
943521e67964SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
9436c43cc173Smrg
943721e67964SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
943821e67964SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
943921e67964SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
944021e67964SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
944121e67964Smrg
944221e67964SmrgAC_SUBST(MAKE_TEXT)
944321e67964SmrgAC_SUBST(MAKE_PS)
944421e67964SmrgAC_SUBST(MAKE_PDF)
944521e67964SmrgAC_SUBST(MAKE_HTML)
944621e67964Smrg]) # XORG_CHECK_DOCBOOK
944721e67964Smrg
944821e67964Smrg# XORG_CHECK_MALLOC_ZERO
944921e67964Smrg# ----------------------
945021e67964Smrg# Minimum version: 1.0.0
9451c43cc173Smrg#
945221e67964Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
945321e67964Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
945421e67964Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
945521e67964SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
945621e67964SmrgAC_ARG_ENABLE(malloc0returnsnull,
9457c27c18e8Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
945821e67964Smrg		       [malloc(0) returns NULL (default: auto)]),
945921e67964Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
946021e67964Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
9461c43cc173Smrg
946221e67964SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
946321e67964Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
946421e67964Smrg	AC_RUN_IFELSE([
946521e67964Smrgchar *malloc();
946621e67964Smrgchar *realloc();
946721e67964Smrgchar *calloc();
946821e67964Smrgmain() {
946921e67964Smrg    char *m0, *r0, *c0, *p;
947021e67964Smrg    m0 = malloc(0);
947121e67964Smrg    p = malloc(10);
947221e67964Smrg    r0 = realloc(p,0);
947321e67964Smrg    c0 = calloc(0);
947421e67964Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
947521e67964Smrg}],
947621e67964Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
947721e67964Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
947821e67964Smrgfi
947921e67964SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
9480c43cc173Smrg
948121e67964Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
948221e67964Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
948321e67964Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
948421e67964Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
948521e67964Smrgelse
948621e67964Smrg	MALLOC_ZERO_CFLAGS=""
948721e67964Smrg	XMALLOC_ZERO_CFLAGS=""
948821e67964Smrg	XTMALLOC_ZERO_CFLAGS=""
948921e67964Smrgfi
9490c43cc173Smrg
949121e67964SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
949221e67964SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
949321e67964SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
949421e67964Smrg]) # XORG_CHECK_MALLOC_ZERO
949521e67964Smrg
949621e67964Smrg# XORG_WITH_LINT()
949721e67964Smrg# ----------------
949821e67964Smrg# Minimum version: 1.1.0
949921e67964Smrg#
950021e67964Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
950121e67964Smrg# is specified.   (Use --with-lint=sparse for sparse.)
950221e67964Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
950321e67964Smrg# Sets $LINT_FLAGS to flags to pass to source checker
950421e67964Smrg# Sets LINT automake conditional if enabled (default: disabled)
950521e67964Smrg#
950621e67964SmrgAC_DEFUN([XORG_WITH_LINT],[
9507c43cc173Smrg
950821e67964Smrg# Allow checking code with lint, sparse, etc.
9509c27c18e8SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
951021e67964Smrg		[Use a lint-style source code checker (default: disabled)])],
951121e67964Smrg		[use_lint=$withval], [use_lint=no])
951221e67964Smrgif test "x$use_lint" = "xyes" ; then
951321e67964Smrg	LINT="lint"
9514c43cc173Smrgelse
951521e67964Smrg	LINT="$use_lint"
951621e67964Smrgfi
951721e67964Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
951821e67964Smrg    case $LINT in
951921e67964Smrg	lint|*/lint)
952021e67964Smrg	    case $host_os in
952121e67964Smrg		solaris*)
952221e67964Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
952321e67964Smrg			;;
952421e67964Smrg	    esac
952521e67964Smrg	    ;;
952621e67964Smrg    esac
9527c43cc173Smrgfi
9528c43cc173Smrg
952921e67964SmrgAC_SUBST(LINT)
953021e67964SmrgAC_SUBST(LINT_FLAGS)
953121e67964SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
9532c43cc173Smrg
953321e67964Smrg]) # XORG_WITH_LINT
9534c43cc173Smrg
953521e67964Smrg# XORG_LINT_LIBRARY(LIBNAME)
953621e67964Smrg# --------------------------
953721e67964Smrg# Minimum version: 1.1.0
953821e67964Smrg#
953921e67964Smrg# Sets up flags for building lint libraries for checking programs that call
954021e67964Smrg# functions in the library.
954121e67964Smrg# Disabled by default, enable with --enable-lint-library
954221e67964Smrg# Sets: 
954321e67964Smrg#	@LINTLIB@		- name of lint library file to make
954421e67964Smrg#	MAKE_LINT_LIB		- automake conditional
9545c43cc173Smrg#
9546c43cc173Smrg
954721e67964SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
954821e67964SmrgAC_REQUIRE([XORG_WITH_LINT])
954921e67964Smrg# Build lint "library" for more indepth checks of programs calling this library
9550c27c18e8SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
955121e67964Smrg	[Create lint library (default: disabled)])],
955221e67964Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
955321e67964Smrgif test "x$make_lint_lib" != "xno" ; then
955421e67964Smrg	if test "x$LINT" = "xno" ; then
955521e67964Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
955621e67964Smrg	fi
955721e67964Smrg	if test "x$make_lint_lib" = "xyes" ; then
955821e67964Smrg		LINTLIB=llib-l$1.ln
955921e67964Smrg	else
956021e67964Smrg		LINTLIB=$make_lint_lib
956121e67964Smrg	fi
956221e67964Smrgfi
956321e67964SmrgAC_SUBST(LINTLIB)
956421e67964SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
9565c43cc173Smrg
956621e67964Smrg]) # XORG_LINT_LIBRARY
9567c43cc173Smrg
956821e67964Smrg# XORG_CWARNFLAGS
956921e67964Smrg# ---------------
957021e67964Smrg# Minimum version: 1.2.0
9571c43cc173Smrg#
957221e67964Smrg# Defines CWARNFLAGS to enable C compiler warnings.
957321e67964Smrg#
957421e67964SmrgAC_DEFUN([XORG_CWARNFLAGS], [
957521e67964SmrgAC_REQUIRE([AC_PROG_CC])
957621e67964Smrgif  test "x$GCC" = xyes ; then
957721e67964Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
957821e67964Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
957921e67964Smrg-Wbad-function-cast"
9580c27c18e8Smrg    case `$CC -dumpversion` in
958121e67964Smrg    3.4.* | 4.*)
958221e67964Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
958321e67964Smrg	;;
958421e67964Smrg    esac
958521e67964Smrgelse
958621e67964Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
958721e67964Smrg    if test "x$SUNCC" = "xyes"; then
958821e67964Smrg	CWARNFLAGS="-v"
958921e67964Smrg    fi
959021e67964Smrgfi
959121e67964SmrgAC_SUBST(CWARNFLAGS)
9592c27c18e8Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
959321e67964Smrg]) # XORG_CWARNFLAGS
9594c27c18e8Smrg
9595c27c18e8Smrg# XORG_STRICT_OPTION
9596c27c18e8Smrg# -----------------------
9597c27c18e8Smrg# Minimum version: 1.3.0
9598c27c18e8Smrg#
9599c27c18e8Smrg# Add configure option to enable strict compilation
9600c27c18e8SmrgAC_DEFUN([XORG_STRICT_OPTION], [
9601c27c18e8SmrgAC_REQUIRE([AC_PROG_CC])
9602c27c18e8SmrgAC_REQUIRE([AC_PROG_CC_C99])
9603c27c18e8SmrgAC_REQUIRE([XORG_CWARNFLAGS])
9604c27c18e8Smrg
9605c27c18e8SmrgAC_ARG_ENABLE(strict-compilation,
9606c27c18e8Smrg			  AS_HELP_STRING([--enable-strict-compilation],
9607c27c18e8Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
9608c27c18e8Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
9609c27c18e8Smrgif test "x$STRICT_COMPILE" = "xyes"; then
9610c27c18e8Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
9611c27c18e8Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
9612c27c18e8Smrg	if test "x$GCC" = xyes ; then
9613c27c18e8Smrg		STRICT_CFLAGS="-pedantic -Werror"
9614c27c18e8Smrg	elif test "x$SUNCC" = "xyes"; then
9615c27c18e8Smrg		STRICT_CFLAGS="-errwarn"
9616c27c18e8Smrg    elif test "x$INTELCC" = "xyes"; then
9617c27c18e8Smrg		STRICT_CFLAGS="-Werror"
9618c27c18e8Smrg	fi
9619c27c18e8Smrgfi
9620c27c18e8SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
9621c27c18e8SmrgAC_SUBST([CWARNFLAGS])
9622c27c18e8Smrg]) # XORG_STRICT_OPTION
9623c27c18e8Smrg
9624c27c18e8Smrg# XORG_DEFAULT_OPTIONS
9625c27c18e8Smrg# --------------------
9626c27c18e8Smrg# Minimum version: 1.3.0
9627c27c18e8Smrg#
9628c27c18e8Smrg# Defines default options for X.Org modules.
9629c27c18e8Smrg#
9630c27c18e8SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
9631c27c18e8SmrgXORG_CWARNFLAGS
9632c27c18e8SmrgXORG_STRICT_OPTION
9633c27c18e8SmrgXORG_RELEASE_VERSION
9634c27c18e8SmrgXORG_CHANGELOG
9635c27c18e8SmrgXORG_MANPAGE_SECTIONS
9636c27c18e8Smrg]) # XORG_DEFAULT_OPTIONS
963721e67964Smrgdnl Copyright 2005 Red Hat, Inc
963821e67964Smrgdnl
963921e67964Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
964021e67964Smrgdnl documentation for any purpose is hereby granted without fee, provided that
964121e67964Smrgdnl the above copyright notice appear in all copies and that both that
964221e67964Smrgdnl copyright notice and this permission notice appear in supporting
964321e67964Smrgdnl documentation.
964421e67964Smrgdnl
964521e67964Smrgdnl The above copyright notice and this permission notice shall be included
964621e67964Smrgdnl in all copies or substantial portions of the Software.
964721e67964Smrgdnl
964821e67964Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
964921e67964Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
965021e67964Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
965121e67964Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
965221e67964Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
965321e67964Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
965421e67964Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
965521e67964Smrgdnl
965621e67964Smrgdnl Except as contained in this notice, the name of the copyright holders shall
965721e67964Smrgdnl not be used in advertising or otherwise to promote the sale, use or
965821e67964Smrgdnl other dealings in this Software without prior written authorization
965921e67964Smrgdnl from the copyright holders.
966021e67964Smrgdnl
9661c43cc173Smrg
966221e67964Smrg# XORG_RELEASE_VERSION
9663c43cc173Smrg# --------------------
966421e67964Smrg# Adds --with/without-release-string and changes the PACKAGE and
966521e67964Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
966621e67964Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
966721e67964Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
966821e67964Smrg 
966921e67964SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
967021e67964Smrg	AC_ARG_WITH(release-version,
9671c27c18e8Smrg			AS_HELP_STRING([--with-release-version=STRING],
967221e67964Smrg				[Use release version string in package name]),
967321e67964Smrg			[RELEASE_VERSION="$withval"],
967421e67964Smrg			[RELEASE_VERSION=""])
967521e67964Smrg	if test "x$RELEASE_VERSION" != "x"; then
967621e67964Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
967721e67964Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
967821e67964Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
967921e67964Smrg	fi
968021e67964Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
968121e67964Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
968221e67964Smrg		[Major version of this package])
968321e67964Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
968421e67964Smrg	if test "x$PVM" = "x"; then
968521e67964Smrg		PVM="0"
968621e67964Smrg	fi
968721e67964Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
968821e67964Smrg		[$PVM],
968921e67964Smrg		[Minor version of this package])
969021e67964Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
969121e67964Smrg	if test "x$PVP" = "x"; then
969221e67964Smrg		PVP="0"
969321e67964Smrg	fi
969421e67964Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
969521e67964Smrg		[$PVP],
969621e67964Smrg		[Patch version of this package])
969721e67964Smrg])
969821e67964Smrg
969921e67964Smrg# XORG_CHANGELOG()
970021e67964Smrg# ----------------
970121e67964Smrg# Minimum version: 1.2.0
9702c43cc173Smrg#
970321e67964Smrg# Defines the variable CHANGELOG_CMD as the command to generate
970421e67964Smrg# ChangeLog from git.
9705c43cc173Smrg#
970621e67964Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
970721e67964Smrg#
970821e67964SmrgAC_DEFUN([XORG_CHANGELOG], [
970921e67964SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
971021e67964Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
971121e67964Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
971221e67964SmrgAC_SUBST([CHANGELOG_CMD])
971321e67964SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
971421e67964Smrg]) # XORG_CHANGELOG
9715c43cc173Smrg
9716