aclocal.m4 revision 34977a2f
134977a2fSmrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
2ee3138f1Smrg
3ee3138f1Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
434977a2fSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5ee3138f1Smrg# This file is free software; the Free Software Foundation
6ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
7ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
8ee3138f1Smrg
9ee3138f1Smrg# This program is distributed in the hope that it will be useful,
10ee3138f1Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11ee3138f1Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12ee3138f1Smrg# PARTICULAR PURPOSE.
13ee3138f1Smrg
14ee3138f1Smrgm4_ifndef([AC_AUTOCONF_VERSION],
15ee3138f1Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1679a8a9c6Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
1779a8a9c6Smrg[m4_warning([this file was generated for autoconf 2.63.
18ee3138f1SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19ee3138f1SmrgIf you have problems, you may need to regenerate the build system entirely.
20ee3138f1SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21ee3138f1Smrg
22ee3138f1Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2334977a2fSmrg#
2434977a2fSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
2534977a2fSmrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
2634977a2fSmrg#   Written by Gordon Matzigkeit, 1996
2734977a2fSmrg#
2834977a2fSmrg# This file is free software; the Free Software Foundation gives
2934977a2fSmrg# unlimited permission to copy and/or distribute it, with or without
3034977a2fSmrg# modifications, as long as this notice is preserved.
3134977a2fSmrg
3234977a2fSmrgm4_define([_LT_COPYING], [dnl
3334977a2fSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
3434977a2fSmrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
3534977a2fSmrg#   Written by Gordon Matzigkeit, 1996
3634977a2fSmrg#
3734977a2fSmrg#   This file is part of GNU Libtool.
3834977a2fSmrg#
3934977a2fSmrg# GNU Libtool is free software; you can redistribute it and/or
4034977a2fSmrg# modify it under the terms of the GNU General Public License as
4134977a2fSmrg# published by the Free Software Foundation; either version 2 of
4234977a2fSmrg# the License, or (at your option) any later version.
4334977a2fSmrg#
4434977a2fSmrg# As a special exception to the GNU General Public License,
4534977a2fSmrg# if you distribute this file as part of a program or library that
4634977a2fSmrg# is built using GNU Libtool, you may include this file under the
4734977a2fSmrg# same distribution terms that you use for the rest of that program.
4834977a2fSmrg#
4934977a2fSmrg# GNU Libtool is distributed in the hope that it will be useful,
5034977a2fSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
5134977a2fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5234977a2fSmrg# GNU General Public License for more details.
5334977a2fSmrg#
5434977a2fSmrg# You should have received a copy of the GNU General Public License
5534977a2fSmrg# along with GNU Libtool; see the file COPYING.  If not, a copy
5634977a2fSmrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
5734977a2fSmrg# obtained by writing to the Free Software Foundation, Inc.,
5834977a2fSmrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
5934977a2fSmrg])
60ee3138f1Smrg
6134977a2fSmrg# serial 56 LT_INIT
62ee3138f1Smrg
63ee3138f1Smrg
6434977a2fSmrg# LT_PREREQ(VERSION)
6534977a2fSmrg# ------------------
6634977a2fSmrg# Complain and exit if this libtool version is less that VERSION.
6734977a2fSmrgm4_defun([LT_PREREQ],
6834977a2fSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
6934977a2fSmrg       [m4_default([$3],
7034977a2fSmrg		   [m4_fatal([Libtool version $1 or higher is required],
7134977a2fSmrg		             63)])],
7234977a2fSmrg       [$2])])
73ee3138f1Smrg
74ee3138f1Smrg
7534977a2fSmrg# _LT_CHECK_BUILDDIR
7634977a2fSmrg# ------------------
7734977a2fSmrg# Complain if the absolute build directory name contains unusual characters
7834977a2fSmrgm4_defun([_LT_CHECK_BUILDDIR],
7934977a2fSmrg[case `pwd` in
8034977a2fSmrg  *\ * | *\	*)
8134977a2fSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
8234977a2fSmrgesac
8334977a2fSmrg])
8434977a2fSmrg
8534977a2fSmrg
8634977a2fSmrg# LT_INIT([OPTIONS])
8734977a2fSmrg# ------------------
8834977a2fSmrgAC_DEFUN([LT_INIT],
8934977a2fSmrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
9034977a2fSmrgAC_BEFORE([$0], [LT_LANG])dnl
9134977a2fSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
9234977a2fSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
9334977a2fSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
9434977a2fSmrg
9534977a2fSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
9634977a2fSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
9734977a2fSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
9834977a2fSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
9934977a2fSmrgdnl unless we require an AC_DEFUNed macro:
10034977a2fSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
10134977a2fSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
10234977a2fSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
10334977a2fSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
10434977a2fSmrgm4_require([_LT_PROG_LTMAIN])dnl
10534977a2fSmrg
10634977a2fSmrgdnl Parse OPTIONS
10734977a2fSmrg_LT_SET_OPTIONS([$0], [$1])
108ee3138f1Smrg
109ee3138f1Smrg# This can be used to rebuild libtool when needed
11034977a2fSmrgLIBTOOL_DEPS="$ltmain"
111ee3138f1Smrg
112ee3138f1Smrg# Always use our own libtool.
113ee3138f1SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
114ee3138f1SmrgAC_SUBST(LIBTOOL)dnl
115ee3138f1Smrg
11634977a2fSmrg_LT_SETUP
117ee3138f1Smrg
11834977a2fSmrg# Only expand once:
11934977a2fSmrgm4_define([LT_INIT])
12034977a2fSmrg])# LT_INIT
121ee3138f1Smrg
12234977a2fSmrg# Old names:
12334977a2fSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
12434977a2fSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
12534977a2fSmrgdnl aclocal-1.4 backwards compatibility:
12634977a2fSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
12734977a2fSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
12834977a2fSmrg
12934977a2fSmrg
13034977a2fSmrg# _LT_CC_BASENAME(CC)
13134977a2fSmrg# -------------------
13234977a2fSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
13334977a2fSmrgm4_defun([_LT_CC_BASENAME],
13434977a2fSmrg[for cc_temp in $1""; do
13534977a2fSmrg  case $cc_temp in
13634977a2fSmrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
13734977a2fSmrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
13834977a2fSmrg    \-*) ;;
13934977a2fSmrg    *) break;;
14034977a2fSmrg  esac
14134977a2fSmrgdone
14234977a2fSmrgcc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
14334977a2fSmrg])
14434977a2fSmrg
14534977a2fSmrg
14634977a2fSmrg# _LT_FILEUTILS_DEFAULTS
14734977a2fSmrg# ----------------------
14834977a2fSmrg# It is okay to use these file commands and assume they have been set
14934977a2fSmrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
15034977a2fSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
15134977a2fSmrg[: ${CP="cp -f"}
15234977a2fSmrg: ${MV="mv -f"}
15334977a2fSmrg: ${RM="rm -f"}
15434977a2fSmrg])# _LT_FILEUTILS_DEFAULTS
15534977a2fSmrg
15634977a2fSmrg
15734977a2fSmrg# _LT_SETUP
15834977a2fSmrg# ---------
15934977a2fSmrgm4_defun([_LT_SETUP],
16034977a2fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
161ee3138f1SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
16234977a2fSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
16334977a2fSmrg_LT_DECL([], [host], [0])dnl
16434977a2fSmrg_LT_DECL([], [host_os], [0])dnl
16534977a2fSmrgdnl
16634977a2fSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
16734977a2fSmrg_LT_DECL([], [build], [0])dnl
16834977a2fSmrg_LT_DECL([], [build_os], [0])dnl
16934977a2fSmrgdnl
170ee3138f1SmrgAC_REQUIRE([AC_PROG_CC])dnl
17134977a2fSmrgAC_REQUIRE([LT_PATH_LD])dnl
17234977a2fSmrgAC_REQUIRE([LT_PATH_NM])dnl
17334977a2fSmrgdnl
174ee3138f1SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
17534977a2fSmrgtest -z "$LN_S" && LN_S="ln -s"
17634977a2fSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
17734977a2fSmrgdnl
17834977a2fSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
17934977a2fSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
18034977a2fSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
181ee3138f1Smrgdnl
18234977a2fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
18334977a2fSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
18434977a2fSmrgm4_require([_LT_CMD_RELOAD])dnl
18534977a2fSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
18634977a2fSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
18734977a2fSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
18834977a2fSmrg
18934977a2fSmrg_LT_CONFIG_LIBTOOL_INIT([
19034977a2fSmrg# See if we are running on zsh, and set the options which allow our
19134977a2fSmrg# commands through without removal of \ escapes INIT.
19234977a2fSmrgif test -n "\${ZSH_VERSION+set}" ; then
19334977a2fSmrg   setopt NO_GLOB_SUBST
19434977a2fSmrgfi
19534977a2fSmrg])
19634977a2fSmrgif test -n "${ZSH_VERSION+set}" ; then
19734977a2fSmrg   setopt NO_GLOB_SUBST
19834977a2fSmrgfi
19934977a2fSmrg
20034977a2fSmrg_LT_CHECK_OBJDIR
201ee3138f1Smrg
20234977a2fSmrgm4_require([_LT_TAG_COMPILER])dnl
20334977a2fSmrg_LT_PROG_ECHO_BACKSLASH
204ee3138f1Smrg
205ee3138f1Smrgcase $host_os in
206ee3138f1Smrgaix3*)
207ee3138f1Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
208ee3138f1Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
209ee3138f1Smrg  # vanish in a puff of smoke.
210ee3138f1Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
211ee3138f1Smrg    COLLECT_NAMES=
212ee3138f1Smrg    export COLLECT_NAMES
213ee3138f1Smrg  fi
214ee3138f1Smrg  ;;
215ee3138f1Smrgesac
216ee3138f1Smrg
217ee3138f1Smrg# Sed substitution that helps us do robust quoting.  It backslashifies
218ee3138f1Smrg# metacharacters that are still active within double-quoted strings.
21934977a2fSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
220ee3138f1Smrg
221ee3138f1Smrg# Same as above, but do not quote variable references.
22234977a2fSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
223ee3138f1Smrg
224ee3138f1Smrg# Sed substitution to delay expansion of an escaped shell variable in a
225ee3138f1Smrg# double_quote_subst'ed string.
226ee3138f1Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
227ee3138f1Smrg
22834977a2fSmrg# Sed substitution to delay expansion of an escaped single quote.
22934977a2fSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
23034977a2fSmrg
231ee3138f1Smrg# Sed substitution to avoid accidental globbing in evaled expressions
232ee3138f1Smrgno_glob_subst='s/\*/\\\*/g'
233ee3138f1Smrg
234ee3138f1Smrg# Global variables:
23534977a2fSmrgofile=libtool
236ee3138f1Smrgcan_build_shared=yes
237ee3138f1Smrg
238ee3138f1Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
239ee3138f1Smrg# which needs '.lib').
240ee3138f1Smrglibext=a
241ee3138f1Smrg
24234977a2fSmrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
243ee3138f1Smrg
244ee3138f1Smrgold_CC="$CC"
245ee3138f1Smrgold_CFLAGS="$CFLAGS"
246ee3138f1Smrg
247ee3138f1Smrg# Set sane defaults for various variables
248ee3138f1Smrgtest -z "$CC" && CC=cc
249ee3138f1Smrgtest -z "$LTCC" && LTCC=$CC
250ee3138f1Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
251ee3138f1Smrgtest -z "$LD" && LD=ld
252ee3138f1Smrgtest -z "$ac_objext" && ac_objext=o
253ee3138f1Smrg
254ee3138f1Smrg_LT_CC_BASENAME([$compiler])
255ee3138f1Smrg
256ee3138f1Smrg# Only perform the check for file, if the check method requires it
25734977a2fSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
258ee3138f1Smrgcase $deplibs_check_method in
259ee3138f1Smrgfile_magic*)
260ee3138f1Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
26134977a2fSmrg    _LT_PATH_MAGIC
262ee3138f1Smrg  fi
263ee3138f1Smrg  ;;
264ee3138f1Smrgesac
265ee3138f1Smrg
26634977a2fSmrg# Use C for the default configuration in the libtool script
26734977a2fSmrgLT_SUPPORTED_TAG([CC])
26834977a2fSmrg_LT_LANG_C_CONFIG
26934977a2fSmrg_LT_LANG_DEFAULT_CONFIG
27034977a2fSmrg_LT_CONFIG_COMMANDS
27134977a2fSmrg])# _LT_SETUP
27279a8a9c6Smrg
273ee3138f1Smrg
27434977a2fSmrg# _LT_PROG_LTMAIN
27534977a2fSmrg# ---------------
27634977a2fSmrg# Note that this code is called both from `configure', and `config.status'
27734977a2fSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
27834977a2fSmrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
27934977a2fSmrg# so we pass a copy along to make sure it has a sensible value anyway.
28034977a2fSmrgm4_defun([_LT_PROG_LTMAIN],
28134977a2fSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
28234977a2fSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
28334977a2fSmrgltmain="$ac_aux_dir/ltmain.sh"
28434977a2fSmrg])# _LT_PROG_LTMAIN
285ee3138f1Smrg
286ee3138f1Smrg
28734977a2fSmrg
28834977a2fSmrg# So that we can recreate a full libtool script including additional
28934977a2fSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
29034977a2fSmrg# in macros and then make a single call at the end using the `libtool'
29134977a2fSmrg# label.
29234977a2fSmrg
29334977a2fSmrg
29434977a2fSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
29534977a2fSmrg# ----------------------------------------
29634977a2fSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
29734977a2fSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
29834977a2fSmrg[m4_ifval([$1],
29934977a2fSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
30034977a2fSmrg                     [$1
30134977a2fSmrg])])])
30234977a2fSmrg
30334977a2fSmrg# Initialize.
30434977a2fSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
30534977a2fSmrg
30634977a2fSmrg
30734977a2fSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
30834977a2fSmrg# ------------------------------
30934977a2fSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
31034977a2fSmrgm4_define([_LT_CONFIG_LIBTOOL],
31134977a2fSmrg[m4_ifval([$1],
31234977a2fSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
31334977a2fSmrg                     [$1
31434977a2fSmrg])])])
31534977a2fSmrg
31634977a2fSmrg# Initialize.
31734977a2fSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
31834977a2fSmrg
31934977a2fSmrg
32034977a2fSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
32134977a2fSmrg# -----------------------------------------------------
32234977a2fSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
32334977a2fSmrg[_LT_CONFIG_LIBTOOL([$1])
32434977a2fSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
32534977a2fSmrg])
32634977a2fSmrg
32734977a2fSmrg
32834977a2fSmrg# _LT_FORMAT_COMMENT([COMMENT])
32934977a2fSmrg# -----------------------------
33034977a2fSmrg# Add leading comment marks to the start of each line, and a trailing
33134977a2fSmrg# full-stop to the whole comment if one is not present already.
33234977a2fSmrgm4_define([_LT_FORMAT_COMMENT],
33334977a2fSmrg[m4_ifval([$1], [
33434977a2fSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
33534977a2fSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
33634977a2fSmrg)])
33734977a2fSmrg
33834977a2fSmrg
33934977a2fSmrg
34034977a2fSmrg
34134977a2fSmrg
34234977a2fSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
34334977a2fSmrg# -------------------------------------------------------------------
34434977a2fSmrg# CONFIGNAME is the name given to the value in the libtool script.
34534977a2fSmrg# VARNAME is the (base) name used in the configure script.
34634977a2fSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
34734977a2fSmrg# VARNAME.  Any other value will be used directly.
34834977a2fSmrgm4_define([_LT_DECL],
34934977a2fSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
35034977a2fSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
35134977a2fSmrg	[m4_ifval([$1], [$1], [$2])])
35234977a2fSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
35334977a2fSmrg    m4_ifval([$4],
35434977a2fSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
35534977a2fSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
35634977a2fSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
35734977a2fSmrg])
35834977a2fSmrg
35934977a2fSmrg
36034977a2fSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
36134977a2fSmrg# --------------------------------------------------------
36234977a2fSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
36334977a2fSmrg
36434977a2fSmrg
36534977a2fSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
36634977a2fSmrg# ------------------------------------------------
36734977a2fSmrgm4_define([lt_decl_tag_varnames],
36834977a2fSmrg[_lt_decl_filter([tagged?], [yes], $@)])
36934977a2fSmrg
37034977a2fSmrg
37134977a2fSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
37234977a2fSmrg# ---------------------------------------------------------
37334977a2fSmrgm4_define([_lt_decl_filter],
37434977a2fSmrg[m4_case([$#],
37534977a2fSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
37634977a2fSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
37734977a2fSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
37834977a2fSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
37934977a2fSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
38034977a2fSmrg])
38134977a2fSmrg
38234977a2fSmrg
38334977a2fSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
38434977a2fSmrg# --------------------------------------------------
38534977a2fSmrgm4_define([lt_decl_quote_varnames],
38634977a2fSmrg[_lt_decl_filter([value], [1], $@)])
38734977a2fSmrg
38834977a2fSmrg
38934977a2fSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
39034977a2fSmrg# ---------------------------------------------------
39134977a2fSmrgm4_define([lt_decl_dquote_varnames],
39234977a2fSmrg[_lt_decl_filter([value], [2], $@)])
39334977a2fSmrg
39434977a2fSmrg
39534977a2fSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
39634977a2fSmrg# ---------------------------------------------------
39734977a2fSmrgm4_define([lt_decl_varnames_tagged],
39834977a2fSmrg[m4_assert([$# <= 2])dnl
39934977a2fSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
40034977a2fSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
40134977a2fSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
40234977a2fSmrgm4_define([_lt_decl_varnames_tagged],
40334977a2fSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
40434977a2fSmrg
40534977a2fSmrg
40634977a2fSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
40734977a2fSmrg# ------------------------------------------------
40834977a2fSmrgm4_define([lt_decl_all_varnames],
40934977a2fSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
41034977a2fSmrg     m4_if([$2], [],
41134977a2fSmrg	   m4_quote(lt_decl_varnames),
41234977a2fSmrg	m4_quote(m4_shift($@))))[]dnl
41334977a2fSmrg])
41434977a2fSmrgm4_define([_lt_decl_all_varnames],
41534977a2fSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
41634977a2fSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
41734977a2fSmrg])
41834977a2fSmrg
41934977a2fSmrg
42034977a2fSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
42134977a2fSmrg# ------------------------------------
42234977a2fSmrg# Quote a variable value, and forward it to `config.status' so that its
42334977a2fSmrg# declaration there will have the same value as in `configure'.  VARNAME
42434977a2fSmrg# must have a single quote delimited value for this to work.
42534977a2fSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
42634977a2fSmrg[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
42734977a2fSmrg
42834977a2fSmrg
42934977a2fSmrg# _LT_CONFIG_STATUS_DECLARATIONS
43034977a2fSmrg# ------------------------------
43134977a2fSmrg# We delimit libtool config variables with single quotes, so when
43234977a2fSmrg# we write them to config.status, we have to be sure to quote all
43334977a2fSmrg# embedded single quotes properly.  In configure, this macro expands
43434977a2fSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
43534977a2fSmrg#
43634977a2fSmrg#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
43734977a2fSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
43834977a2fSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
43934977a2fSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
440ee3138f1Smrg
441ee3138f1Smrg
44234977a2fSmrg# _LT_LIBTOOL_TAGS
44334977a2fSmrg# ----------------
44434977a2fSmrg# Output comment and list of tags supported by the script
44534977a2fSmrgm4_defun([_LT_LIBTOOL_TAGS],
44634977a2fSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
44734977a2fSmrgavailable_tags="_LT_TAGS"dnl
44834977a2fSmrg])
44934977a2fSmrg
45034977a2fSmrg
45134977a2fSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
45234977a2fSmrg# -----------------------------------
45334977a2fSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
45434977a2fSmrg# expand to a commented shell variable setting:
45534977a2fSmrg#
45634977a2fSmrg#    # Some comment about what VAR is for.
45734977a2fSmrg#    visible_name=$lt_internal_name
45834977a2fSmrgm4_define([_LT_LIBTOOL_DECLARE],
45934977a2fSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
46034977a2fSmrg					   [description])))[]dnl
46134977a2fSmrgm4_pushdef([_libtool_name],
46234977a2fSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
46334977a2fSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
46434977a2fSmrg    [0], [_libtool_name=[$]$1],
46534977a2fSmrg    [1], [_libtool_name=$lt_[]$1],
46634977a2fSmrg    [2], [_libtool_name=$lt_[]$1],
46734977a2fSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
46834977a2fSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
46934977a2fSmrg])
47034977a2fSmrg
47134977a2fSmrg
47234977a2fSmrg# _LT_LIBTOOL_CONFIG_VARS
47334977a2fSmrg# -----------------------
47434977a2fSmrg# Produce commented declarations of non-tagged libtool config variables
47534977a2fSmrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
47634977a2fSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
47734977a2fSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
47834977a2fSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
47934977a2fSmrg[m4_foreach([_lt_var],
48034977a2fSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
48134977a2fSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
48234977a2fSmrg
48334977a2fSmrg
48434977a2fSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
48534977a2fSmrg# -------------------------
48634977a2fSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
48734977a2fSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
48834977a2fSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
48934977a2fSmrg
49034977a2fSmrg
49134977a2fSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
49234977a2fSmrg# ------------------------------
49334977a2fSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
49434977a2fSmrg
49534977a2fSmrg
49634977a2fSmrg# _LT_CONFIG_COMMANDS
497ee3138f1Smrg# -------------------
49834977a2fSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
49934977a2fSmrg# variables for single and double quote escaping we saved from calls
50034977a2fSmrg# to _LT_DECL, we can put quote escaped variables declarations
50134977a2fSmrg# into `config.status', and then the shell code to quote escape them in
50234977a2fSmrg# for loops in `config.status'.  Finally, any additional code accumulated
50334977a2fSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
50434977a2fSmrgm4_defun([_LT_CONFIG_COMMANDS],
50534977a2fSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
50634977a2fSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
50734977a2fSmrg	dnl instead of duplicating it all over again into config.status,
50834977a2fSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
50934977a2fSmrg	dnl needs to know what name is stored there:
51034977a2fSmrg        [AC_CONFIG_COMMANDS([libtool],
51134977a2fSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
51234977a2fSmrg    dnl If the libtool generation code is destined for config.status,
51334977a2fSmrg    dnl expand the accumulated commands and init code now:
51434977a2fSmrg    [AC_CONFIG_COMMANDS([libtool],
51534977a2fSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
51634977a2fSmrg])#_LT_CONFIG_COMMANDS
51734977a2fSmrg
51834977a2fSmrg
51934977a2fSmrg# Initialize.
52034977a2fSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
52134977a2fSmrg[
52234977a2fSmrg
52334977a2fSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
52434977a2fSmrg# if CDPATH is set.
52534977a2fSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
52634977a2fSmrg
52734977a2fSmrgsed_quote_subst='$sed_quote_subst'
52834977a2fSmrgdouble_quote_subst='$double_quote_subst'
52934977a2fSmrgdelay_variable_subst='$delay_variable_subst'
53034977a2fSmrg_LT_CONFIG_STATUS_DECLARATIONS
53134977a2fSmrgLTCC='$LTCC'
53234977a2fSmrgLTCFLAGS='$LTCFLAGS'
53334977a2fSmrgcompiler='$compiler_DEFAULT'
53434977a2fSmrg
53534977a2fSmrg# Quote evaled strings.
53634977a2fSmrgfor var in lt_decl_all_varnames([[ \
53734977a2fSmrg]], lt_decl_quote_varnames); do
53834977a2fSmrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
53934977a2fSmrg    *[[\\\\\\\`\\"\\\$]]*)
54034977a2fSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
54134977a2fSmrg      ;;
54234977a2fSmrg    *)
54334977a2fSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
54434977a2fSmrg      ;;
54534977a2fSmrg    esac
54634977a2fSmrgdone
54734977a2fSmrg
54834977a2fSmrg# Double-quote double-evaled strings.
54934977a2fSmrgfor var in lt_decl_all_varnames([[ \
55034977a2fSmrg]], lt_decl_dquote_varnames); do
55134977a2fSmrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
55234977a2fSmrg    *[[\\\\\\\`\\"\\\$]]*)
55334977a2fSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
55434977a2fSmrg      ;;
55534977a2fSmrg    *)
55634977a2fSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
55734977a2fSmrg      ;;
55834977a2fSmrg    esac
55934977a2fSmrgdone
56034977a2fSmrg
56134977a2fSmrg# Fix-up fallback echo if it was mangled by the above quoting rules.
56234977a2fSmrgcase \$lt_ECHO in
56334977a2fSmrg*'\\\[$]0 --fallback-echo"')dnl "
56434977a2fSmrg  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
56534977a2fSmrg  ;;
56634977a2fSmrgesac
56734977a2fSmrg
56834977a2fSmrg_LT_OUTPUT_LIBTOOL_INIT
56934977a2fSmrg])
57034977a2fSmrg
57134977a2fSmrg
57234977a2fSmrg# LT_OUTPUT
57334977a2fSmrg# ---------
57434977a2fSmrg# This macro allows early generation of the libtool script (before
57534977a2fSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
57634977a2fSmrg# tests.
57734977a2fSmrgAC_DEFUN([LT_OUTPUT],
57834977a2fSmrg[: ${CONFIG_LT=./config.lt}
57934977a2fSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
58034977a2fSmrgcat >"$CONFIG_LT" <<_LTEOF
58134977a2fSmrg#! $SHELL
58234977a2fSmrg# Generated by $as_me.
58334977a2fSmrg# Run this file to recreate a libtool stub with the current configuration.
58434977a2fSmrg
58534977a2fSmrglt_cl_silent=false
58634977a2fSmrgSHELL=\${CONFIG_SHELL-$SHELL}
58734977a2fSmrg_LTEOF
58834977a2fSmrg
58934977a2fSmrgcat >>"$CONFIG_LT" <<\_LTEOF
59034977a2fSmrgAS_SHELL_SANITIZE
59134977a2fSmrg_AS_PREPARE
59234977a2fSmrg
59334977a2fSmrgexec AS_MESSAGE_FD>&1
59434977a2fSmrgexec AS_MESSAGE_LOG_FD>>config.log
59534977a2fSmrg{
59634977a2fSmrg  echo
59734977a2fSmrg  AS_BOX([Running $as_me.])
59834977a2fSmrg} >&AS_MESSAGE_LOG_FD
59934977a2fSmrg
60034977a2fSmrglt_cl_help="\
60134977a2fSmrg\`$as_me' creates a local libtool stub from the current configuration,
60234977a2fSmrgfor use in further configure time tests before the real libtool is
60334977a2fSmrggenerated.
60434977a2fSmrg
60534977a2fSmrgUsage: $[0] [[OPTIONS]]
60634977a2fSmrg
60734977a2fSmrg  -h, --help      print this help, then exit
60834977a2fSmrg  -V, --version   print version number, then exit
60934977a2fSmrg  -q, --quiet     do not print progress messages
61034977a2fSmrg  -d, --debug     don't remove temporary files
61134977a2fSmrg
61234977a2fSmrgReport bugs to <bug-libtool@gnu.org>."
61334977a2fSmrg
61434977a2fSmrglt_cl_version="\
61534977a2fSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
61634977a2fSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
61734977a2fSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
61834977a2fSmrg
61934977a2fSmrgCopyright (C) 2008 Free Software Foundation, Inc.
62034977a2fSmrgThis config.lt script is free software; the Free Software Foundation
62134977a2fSmrggives unlimited permision to copy, distribute and modify it."
62234977a2fSmrg
62334977a2fSmrgwhile test $[#] != 0
62434977a2fSmrgdo
62534977a2fSmrg  case $[1] in
62634977a2fSmrg    --version | --v* | -V )
62734977a2fSmrg      echo "$lt_cl_version"; exit 0 ;;
62834977a2fSmrg    --help | --h* | -h )
62934977a2fSmrg      echo "$lt_cl_help"; exit 0 ;;
63034977a2fSmrg    --debug | --d* | -d )
63134977a2fSmrg      debug=: ;;
63234977a2fSmrg    --quiet | --q* | --silent | --s* | -q )
63334977a2fSmrg      lt_cl_silent=: ;;
63434977a2fSmrg
63534977a2fSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
63634977a2fSmrgTry \`$[0] --help' for more information.]) ;;
63734977a2fSmrg
63834977a2fSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
63934977a2fSmrgTry \`$[0] --help' for more information.]) ;;
64034977a2fSmrg  esac
64134977a2fSmrg  shift
64234977a2fSmrgdone
64334977a2fSmrg
64434977a2fSmrgif $lt_cl_silent; then
64534977a2fSmrg  exec AS_MESSAGE_FD>/dev/null
64634977a2fSmrgfi
64734977a2fSmrg_LTEOF
64834977a2fSmrg
64934977a2fSmrgcat >>"$CONFIG_LT" <<_LTEOF
65034977a2fSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
65134977a2fSmrg_LTEOF
65234977a2fSmrg
65334977a2fSmrgcat >>"$CONFIG_LT" <<\_LTEOF
65434977a2fSmrgAC_MSG_NOTICE([creating $ofile])
65534977a2fSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
65634977a2fSmrgAS_EXIT(0)
65734977a2fSmrg_LTEOF
65834977a2fSmrgchmod +x "$CONFIG_LT"
65934977a2fSmrg
66034977a2fSmrg# configure is writing to config.log, but config.lt does its own redirection,
66134977a2fSmrg# appending to config.log, which fails on DOS, as config.log is still kept
66234977a2fSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
66334977a2fSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
66434977a2fSmrgif test "$no_create" != yes; then
66534977a2fSmrg  lt_cl_success=:
66634977a2fSmrg  test "$silent" = yes &&
66734977a2fSmrg    lt_config_lt_args="$lt_config_lt_args --quiet"
66834977a2fSmrg  exec AS_MESSAGE_LOG_FD>/dev/null
66934977a2fSmrg  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
67034977a2fSmrg  exec AS_MESSAGE_LOG_FD>>config.log
67134977a2fSmrg  $lt_cl_success || AS_EXIT(1)
67234977a2fSmrgfi
67334977a2fSmrg])# LT_OUTPUT
67434977a2fSmrg
67534977a2fSmrg
67634977a2fSmrg# _LT_CONFIG(TAG)
67734977a2fSmrg# ---------------
67834977a2fSmrg# If TAG is the built-in tag, create an initial libtool script with a
67934977a2fSmrg# default configuration from the untagged config vars.  Otherwise add code
68034977a2fSmrg# to config.status for appending the configuration named by TAG from the
68134977a2fSmrg# matching tagged config vars.
68234977a2fSmrgm4_defun([_LT_CONFIG],
68334977a2fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
68434977a2fSmrg_LT_CONFIG_SAVE_COMMANDS([
68534977a2fSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
68634977a2fSmrg  m4_if(_LT_TAG, [C], [
68734977a2fSmrg    # See if we are running on zsh, and set the options which allow our
68834977a2fSmrg    # commands through without removal of \ escapes.
68934977a2fSmrg    if test -n "${ZSH_VERSION+set}" ; then
69034977a2fSmrg      setopt NO_GLOB_SUBST
69134977a2fSmrg    fi
69234977a2fSmrg
69334977a2fSmrg    cfgfile="${ofile}T"
69434977a2fSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
69534977a2fSmrg    $RM "$cfgfile"
69634977a2fSmrg
69734977a2fSmrg    cat <<_LT_EOF >> "$cfgfile"
69834977a2fSmrg#! $SHELL
69934977a2fSmrg
70034977a2fSmrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
70134977a2fSmrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
70234977a2fSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
70334977a2fSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
70434977a2fSmrg#
70534977a2fSmrg_LT_COPYING
70634977a2fSmrg_LT_LIBTOOL_TAGS
70734977a2fSmrg
70834977a2fSmrg# ### BEGIN LIBTOOL CONFIG
70934977a2fSmrg_LT_LIBTOOL_CONFIG_VARS
71034977a2fSmrg_LT_LIBTOOL_TAG_VARS
71134977a2fSmrg# ### END LIBTOOL CONFIG
71234977a2fSmrg
71334977a2fSmrg_LT_EOF
71434977a2fSmrg
71534977a2fSmrg  case $host_os in
71634977a2fSmrg  aix3*)
71734977a2fSmrg    cat <<\_LT_EOF >> "$cfgfile"
71834977a2fSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
71934977a2fSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
72034977a2fSmrg# vanish in a puff of smoke.
72134977a2fSmrgif test "X${COLLECT_NAMES+set}" != Xset; then
72234977a2fSmrg  COLLECT_NAMES=
72334977a2fSmrg  export COLLECT_NAMES
72434977a2fSmrgfi
72534977a2fSmrg_LT_EOF
72634977a2fSmrg    ;;
72734977a2fSmrg  esac
72834977a2fSmrg
72934977a2fSmrg  _LT_PROG_LTMAIN
73034977a2fSmrg
73134977a2fSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
73234977a2fSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
73334977a2fSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
73434977a2fSmrg  # is reportedly fixed, but why not run on old versions too?
73534977a2fSmrg  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
73634977a2fSmrg    || (rm -f "$cfgfile"; exit 1)
73734977a2fSmrg
73834977a2fSmrg  _LT_PROG_XSI_SHELLFNS
73934977a2fSmrg
74034977a2fSmrg  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
74134977a2fSmrg    || (rm -f "$cfgfile"; exit 1)
74234977a2fSmrg
74334977a2fSmrg  mv -f "$cfgfile" "$ofile" ||
74434977a2fSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
74534977a2fSmrg  chmod +x "$ofile"
74634977a2fSmrg],
74734977a2fSmrg[cat <<_LT_EOF >> "$ofile"
74834977a2fSmrg
74934977a2fSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
75034977a2fSmrgdnl in a comment (ie after a #).
75134977a2fSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
75234977a2fSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
75334977a2fSmrg# ### END LIBTOOL TAG CONFIG: $1
75434977a2fSmrg_LT_EOF
75534977a2fSmrg])dnl /m4_if
75634977a2fSmrg],
75734977a2fSmrg[m4_if([$1], [], [
75834977a2fSmrg    PACKAGE='$PACKAGE'
75934977a2fSmrg    VERSION='$VERSION'
76034977a2fSmrg    TIMESTAMP='$TIMESTAMP'
76134977a2fSmrg    RM='$RM'
76234977a2fSmrg    ofile='$ofile'], [])
76334977a2fSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
76434977a2fSmrg])# _LT_CONFIG
76534977a2fSmrg
76634977a2fSmrg
76734977a2fSmrg# LT_SUPPORTED_TAG(TAG)
76834977a2fSmrg# ---------------------
76934977a2fSmrg# Trace this macro to discover what tags are supported by the libtool
77034977a2fSmrg# --tag option, using:
77134977a2fSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
77234977a2fSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
77334977a2fSmrg
77434977a2fSmrg
77534977a2fSmrg# C support is built-in for now
77634977a2fSmrgm4_define([_LT_LANG_C_enabled], [])
77734977a2fSmrgm4_define([_LT_TAGS], [])
77834977a2fSmrg
77934977a2fSmrg
78034977a2fSmrg# LT_LANG(LANG)
78134977a2fSmrg# -------------
78234977a2fSmrg# Enable libtool support for the given language if not already enabled.
78334977a2fSmrgAC_DEFUN([LT_LANG],
78434977a2fSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
78534977a2fSmrgm4_case([$1],
78634977a2fSmrg  [C],			[_LT_LANG(C)],
78734977a2fSmrg  [C++],		[_LT_LANG(CXX)],
78834977a2fSmrg  [Java],		[_LT_LANG(GCJ)],
78934977a2fSmrg  [Fortran 77],		[_LT_LANG(F77)],
79034977a2fSmrg  [Fortran],		[_LT_LANG(FC)],
79134977a2fSmrg  [Windows Resource],	[_LT_LANG(RC)],
79234977a2fSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
79334977a2fSmrg    [_LT_LANG($1)],
79434977a2fSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
79534977a2fSmrg])# LT_LANG
79634977a2fSmrg
79734977a2fSmrg
79834977a2fSmrg# _LT_LANG(LANGNAME)
79934977a2fSmrg# ------------------
80034977a2fSmrgm4_defun([_LT_LANG],
80134977a2fSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
80234977a2fSmrg  [LT_SUPPORTED_TAG([$1])dnl
80334977a2fSmrg  m4_append([_LT_TAGS], [$1 ])dnl
80434977a2fSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
80534977a2fSmrg  _LT_LANG_$1_CONFIG($1)])dnl
80634977a2fSmrg])# _LT_LANG
80734977a2fSmrg
80834977a2fSmrg
80934977a2fSmrg# _LT_LANG_DEFAULT_CONFIG
81034977a2fSmrg# -----------------------
81134977a2fSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
81234977a2fSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
81334977a2fSmrg  [LT_LANG(CXX)],
81434977a2fSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
81534977a2fSmrg
81634977a2fSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
81734977a2fSmrg  [LT_LANG(F77)],
81834977a2fSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
81934977a2fSmrg
82034977a2fSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
82134977a2fSmrg  [LT_LANG(FC)],
82234977a2fSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
82334977a2fSmrg
82434977a2fSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
82534977a2fSmrgdnl pulling things in needlessly.
82634977a2fSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
82734977a2fSmrg  [LT_LANG(GCJ)],
82834977a2fSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
82934977a2fSmrg    [LT_LANG(GCJ)],
83034977a2fSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
83134977a2fSmrg      [LT_LANG(GCJ)],
83234977a2fSmrg      [m4_ifdef([AC_PROG_GCJ],
83334977a2fSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
83434977a2fSmrg       m4_ifdef([A][M_PROG_GCJ],
83534977a2fSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
83634977a2fSmrg       m4_ifdef([LT_PROG_GCJ],
83734977a2fSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
83834977a2fSmrg
83934977a2fSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
84034977a2fSmrg  [LT_LANG(RC)],
84134977a2fSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
84234977a2fSmrg])# _LT_LANG_DEFAULT_CONFIG
84334977a2fSmrg
84434977a2fSmrg# Obsolete macros:
84534977a2fSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
84634977a2fSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
84734977a2fSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
84834977a2fSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
84934977a2fSmrgdnl aclocal-1.4 backwards compatibility:
85034977a2fSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
85134977a2fSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
85234977a2fSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
85334977a2fSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
85434977a2fSmrg
85534977a2fSmrg
85634977a2fSmrg# _LT_TAG_COMPILER
85734977a2fSmrg# ----------------
85834977a2fSmrgm4_defun([_LT_TAG_COMPILER],
859ee3138f1Smrg[AC_REQUIRE([AC_PROG_CC])dnl
860ee3138f1Smrg
86134977a2fSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
86234977a2fSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
86334977a2fSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
86434977a2fSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
86534977a2fSmrg
866ee3138f1Smrg# If no C compiler was specified, use CC.
867ee3138f1SmrgLTCC=${LTCC-"$CC"}
868ee3138f1Smrg
869ee3138f1Smrg# If no C compiler flags were specified, use CFLAGS.
870ee3138f1SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
871ee3138f1Smrg
872ee3138f1Smrg# Allow CC to be a program name with arguments.
873ee3138f1Smrgcompiler=$CC
87434977a2fSmrg])# _LT_TAG_COMPILER
875ee3138f1Smrg
876ee3138f1Smrg
877ee3138f1Smrg# _LT_COMPILER_BOILERPLATE
878ee3138f1Smrg# ------------------------
879ee3138f1Smrg# Check for compiler boilerplate output or warnings with
880ee3138f1Smrg# the simple compiler test code.
88134977a2fSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
88234977a2fSmrg[m4_require([_LT_DECL_SED])dnl
883ee3138f1Smrgac_outfile=conftest.$ac_objext
884ee3138f1Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
885ee3138f1Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
886ee3138f1Smrg_lt_compiler_boilerplate=`cat conftest.err`
88734977a2fSmrg$RM conftest*
888ee3138f1Smrg])# _LT_COMPILER_BOILERPLATE
889ee3138f1Smrg
890ee3138f1Smrg
891ee3138f1Smrg# _LT_LINKER_BOILERPLATE
892ee3138f1Smrg# ----------------------
893ee3138f1Smrg# Check for linker boilerplate output or warnings with
894ee3138f1Smrg# the simple link test code.
89534977a2fSmrgm4_defun([_LT_LINKER_BOILERPLATE],
89634977a2fSmrg[m4_require([_LT_DECL_SED])dnl
897ee3138f1Smrgac_outfile=conftest.$ac_objext
898ee3138f1Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
899ee3138f1Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
900ee3138f1Smrg_lt_linker_boilerplate=`cat conftest.err`
90134977a2fSmrg$RM -r conftest*
902ee3138f1Smrg])# _LT_LINKER_BOILERPLATE
903ee3138f1Smrg
90479a8a9c6Smrg# _LT_REQUIRED_DARWIN_CHECKS
90534977a2fSmrg# -------------------------
90634977a2fSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
90779a8a9c6Smrg  case $host_os in
90879a8a9c6Smrg    rhapsody* | darwin*)
90979a8a9c6Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
91079a8a9c6Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
91134977a2fSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
91234977a2fSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
91334977a2fSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
91434977a2fSmrg    _LT_DECL([], [DSYMUTIL], [1],
91534977a2fSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
91634977a2fSmrg    _LT_DECL([], [NMEDIT], [1],
91734977a2fSmrg      [Tool to change global to local symbols on Mac OS X])
91834977a2fSmrg    _LT_DECL([], [LIPO], [1],
91934977a2fSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
92034977a2fSmrg    _LT_DECL([], [OTOOL], [1],
92134977a2fSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
92234977a2fSmrg    _LT_DECL([], [OTOOL64], [1],
92334977a2fSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
92479a8a9c6Smrg
92579a8a9c6Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
92679a8a9c6Smrg      [lt_cv_apple_cc_single_mod=no
92779a8a9c6Smrg      if test -z "${LT_MULTI_MODULE}"; then
92834977a2fSmrg	# By default we will add the -single_module flag. You can override
92934977a2fSmrg	# by either setting the environment variable LT_MULTI_MODULE
93034977a2fSmrg	# non-empty at configure time, or by adding -multi_module to the
93134977a2fSmrg	# link flags.
93234977a2fSmrg	rm -rf libconftest.dylib*
93334977a2fSmrg	echo "int foo(void){return 1;}" > conftest.c
93434977a2fSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
93534977a2fSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
93634977a2fSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
93734977a2fSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
93834977a2fSmrg        _lt_result=$?
93934977a2fSmrg	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
94034977a2fSmrg	  lt_cv_apple_cc_single_mod=yes
94134977a2fSmrg	else
94234977a2fSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
94334977a2fSmrg	fi
94434977a2fSmrg	rm -rf libconftest.dylib*
94534977a2fSmrg	rm -f conftest.*
94679a8a9c6Smrg      fi])
94779a8a9c6Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
94879a8a9c6Smrg      [lt_cv_ld_exported_symbols_list],
94979a8a9c6Smrg      [lt_cv_ld_exported_symbols_list=no
95079a8a9c6Smrg      save_LDFLAGS=$LDFLAGS
95179a8a9c6Smrg      echo "_main" > conftest.sym
95279a8a9c6Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
95379a8a9c6Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
95434977a2fSmrg	[lt_cv_ld_exported_symbols_list=yes],
95534977a2fSmrg	[lt_cv_ld_exported_symbols_list=no])
95634977a2fSmrg	LDFLAGS="$save_LDFLAGS"
95779a8a9c6Smrg    ])
95879a8a9c6Smrg    case $host_os in
95934977a2fSmrg    rhapsody* | darwin1.[[012]])
96079a8a9c6Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
96179a8a9c6Smrg    darwin1.*)
96234977a2fSmrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
96334977a2fSmrg    darwin*) # darwin 5.x on
96479a8a9c6Smrg      # if running on 10.5 or later, the deployment target defaults
96579a8a9c6Smrg      # to the OS version, if on x86, and 10.4, the deployment
96679a8a9c6Smrg      # target defaults to 10.4. Don't you love it?
96779a8a9c6Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
96834977a2fSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
96934977a2fSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
97034977a2fSmrg	10.[[012]]*)
97134977a2fSmrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
97234977a2fSmrg	10.*)
97334977a2fSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
97479a8a9c6Smrg      esac
97579a8a9c6Smrg    ;;
97679a8a9c6Smrg  esac
97779a8a9c6Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
97879a8a9c6Smrg      _lt_dar_single_mod='$single_module'
97979a8a9c6Smrg    fi
98079a8a9c6Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
98179a8a9c6Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
98279a8a9c6Smrg    else
98334977a2fSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
98479a8a9c6Smrg    fi
98579a8a9c6Smrg    if test "$DSYMUTIL" != ":"; then
98634977a2fSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
98779a8a9c6Smrg    else
98879a8a9c6Smrg      _lt_dsymutil=
98979a8a9c6Smrg    fi
99079a8a9c6Smrg    ;;
99179a8a9c6Smrg  esac
99279a8a9c6Smrg])
993ee3138f1Smrg
99434977a2fSmrg
99534977a2fSmrg# _LT_DARWIN_LINKER_FEATURES
99634977a2fSmrg# --------------------------
99734977a2fSmrg# Checks for linker and compiler features on darwin
99834977a2fSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
99934977a2fSmrg[
100034977a2fSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
100134977a2fSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
100234977a2fSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
100334977a2fSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
100434977a2fSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
100534977a2fSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
100634977a2fSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
100734977a2fSmrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
100834977a2fSmrg  case $cc_basename in
100934977a2fSmrg     ifort*) _lt_dar_can_shared=yes ;;
101034977a2fSmrg     *) _lt_dar_can_shared=$GCC ;;
101134977a2fSmrg  esac
101234977a2fSmrg  if test "$_lt_dar_can_shared" = "yes"; then
101334977a2fSmrg    output_verbose_link_cmd=echo
101434977a2fSmrg    _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}"
101534977a2fSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
101634977a2fSmrg    _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}"
101734977a2fSmrg    _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}"
101834977a2fSmrg    m4_if([$1], [CXX],
101934977a2fSmrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
102034977a2fSmrg      _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}"
102134977a2fSmrg      _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}"
102234977a2fSmrg    fi
102334977a2fSmrg],[])
102434977a2fSmrg  else
102534977a2fSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
102634977a2fSmrg  fi
102734977a2fSmrg])
102834977a2fSmrg
102934977a2fSmrg# _LT_SYS_MODULE_PATH_AIX
103034977a2fSmrg# -----------------------
1031ee3138f1Smrg# Links a minimal program and checks the executable
1032ee3138f1Smrg# for the system default hardcoded library path. In most cases,
1033ee3138f1Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
1034ee3138f1Smrg# the location of the communication and MPI libs are included too.
1035ee3138f1Smrg# If we don't find anything, use the default library path according
1036ee3138f1Smrg# to the aix ld manual.
103734977a2fSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
103834977a2fSmrg[m4_require([_LT_DECL_SED])dnl
1039ee3138f1SmrgAC_LINK_IFELSE(AC_LANG_PROGRAM,[
1040ee3138f1Smrglt_aix_libpath_sed='
1041ee3138f1Smrg    /Import File Strings/,/^$/ {
1042ee3138f1Smrg	/^0/ {
1043ee3138f1Smrg	    s/^0  *\(.*\)$/\1/
1044ee3138f1Smrg	    p
1045ee3138f1Smrg	}
1046ee3138f1Smrg    }'
1047ee3138f1Smrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1048ee3138f1Smrg# Check for a 64-bit object if we didn't find anything.
1049ee3138f1Smrgif test -z "$aix_libpath"; then
1050ee3138f1Smrg  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1051ee3138f1Smrgfi],[])
1052ee3138f1Smrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
105334977a2fSmrg])# _LT_SYS_MODULE_PATH_AIX
1054ee3138f1Smrg
1055ee3138f1Smrg
105634977a2fSmrg# _LT_SHELL_INIT(ARG)
105734977a2fSmrg# -------------------
105834977a2fSmrgm4_define([_LT_SHELL_INIT],
1059ee3138f1Smrg[ifdef([AC_DIVERSION_NOTICE],
1060ee3138f1Smrg	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
1061ee3138f1Smrg	 [AC_DIVERT_PUSH(NOTICE)])
1062ee3138f1Smrg$1
1063ee3138f1SmrgAC_DIVERT_POP
106434977a2fSmrg])# _LT_SHELL_INIT
1065ee3138f1Smrg
1066ee3138f1Smrg
106734977a2fSmrg# _LT_PROG_ECHO_BACKSLASH
106834977a2fSmrg# -----------------------
1069ee3138f1Smrg# Add some code to the start of the generated configure script which
1070ee3138f1Smrg# will find an echo command which doesn't interpret backslashes.
107134977a2fSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
107234977a2fSmrg[_LT_SHELL_INIT([
1073ee3138f1Smrg# Check that we are running under the correct shell.
1074ee3138f1SmrgSHELL=${CONFIG_SHELL-/bin/sh}
1075ee3138f1Smrg
107634977a2fSmrgcase X$lt_ECHO in
1077ee3138f1SmrgX*--fallback-echo)
1078ee3138f1Smrg  # Remove one level of quotation (which was required for Make).
107934977a2fSmrg  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
1080ee3138f1Smrg  ;;
1081ee3138f1Smrgesac
1082ee3138f1Smrg
108334977a2fSmrgECHO=${lt_ECHO-echo}
1084ee3138f1Smrgif test "X[$]1" = X--no-reexec; then
1085ee3138f1Smrg  # Discard the --no-reexec flag, and continue.
1086ee3138f1Smrg  shift
1087ee3138f1Smrgelif test "X[$]1" = X--fallback-echo; then
1088ee3138f1Smrg  # Avoid inline document here, it may be left over
1089ee3138f1Smrg  :
109034977a2fSmrgelif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
109134977a2fSmrg  # Yippee, $ECHO works!
1092ee3138f1Smrg  :
1093ee3138f1Smrgelse
1094ee3138f1Smrg  # Restart under the correct shell.
1095ee3138f1Smrg  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
1096ee3138f1Smrgfi
1097ee3138f1Smrg
1098ee3138f1Smrgif test "X[$]1" = X--fallback-echo; then
1099ee3138f1Smrg  # used as fallback echo
1100ee3138f1Smrg  shift
110134977a2fSmrg  cat <<_LT_EOF
1102ee3138f1Smrg[$]*
110334977a2fSmrg_LT_EOF
1104ee3138f1Smrg  exit 0
1105ee3138f1Smrgfi
1106ee3138f1Smrg
1107ee3138f1Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
1108ee3138f1Smrg# if CDPATH is set.
1109ee3138f1Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1110ee3138f1Smrg
111134977a2fSmrgif test -z "$lt_ECHO"; then
111234977a2fSmrg  if test "X${echo_test_string+set}" != Xset; then
111334977a2fSmrg    # find a string as large as possible, as long as the shell can cope with it
111434977a2fSmrg    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
111534977a2fSmrg      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
111634977a2fSmrg      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
111734977a2fSmrg	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
111834977a2fSmrg      then
111934977a2fSmrg        break
112034977a2fSmrg      fi
112134977a2fSmrg    done
112234977a2fSmrg  fi
1123ee3138f1Smrg
112434977a2fSmrg  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
112534977a2fSmrg     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
112634977a2fSmrg     test "X$echo_testing_string" = "X$echo_test_string"; then
112734977a2fSmrg    :
112834977a2fSmrg  else
112934977a2fSmrg    # The Solaris, AIX, and Digital Unix default echo programs unquote
113034977a2fSmrg    # backslashes.  This makes it impossible to quote backslashes using
113134977a2fSmrg    #   echo "$something" | sed 's/\\/\\\\/g'
113234977a2fSmrg    #
113334977a2fSmrg    # So, first we look for a working echo in the user's PATH.
1134ee3138f1Smrg
113534977a2fSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
113634977a2fSmrg    for dir in $PATH /usr/ucb; do
113734977a2fSmrg      IFS="$lt_save_ifs"
113834977a2fSmrg      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
113934977a2fSmrg         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
114034977a2fSmrg         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
114134977a2fSmrg         test "X$echo_testing_string" = "X$echo_test_string"; then
114234977a2fSmrg        ECHO="$dir/echo"
114334977a2fSmrg        break
114434977a2fSmrg      fi
114534977a2fSmrg    done
1146ee3138f1Smrg    IFS="$lt_save_ifs"
1147ee3138f1Smrg
114834977a2fSmrg    if test "X$ECHO" = Xecho; then
114934977a2fSmrg      # We didn't find a better echo, so look for alternatives.
115034977a2fSmrg      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
115134977a2fSmrg         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
115234977a2fSmrg         test "X$echo_testing_string" = "X$echo_test_string"; then
115334977a2fSmrg        # This shell has a builtin print -r that does the trick.
115434977a2fSmrg        ECHO='print -r'
115534977a2fSmrg      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
115634977a2fSmrg	   test "X$CONFIG_SHELL" != X/bin/ksh; then
115734977a2fSmrg        # If we have ksh, try running configure again with it.
115834977a2fSmrg        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
115934977a2fSmrg        export ORIGINAL_CONFIG_SHELL
116034977a2fSmrg        CONFIG_SHELL=/bin/ksh
116134977a2fSmrg        export CONFIG_SHELL
116234977a2fSmrg        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1163ee3138f1Smrg      else
116434977a2fSmrg        # Try using printf.
116534977a2fSmrg        ECHO='printf %s\n'
116634977a2fSmrg        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
116734977a2fSmrg	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
116834977a2fSmrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
116934977a2fSmrg	  # Cool, printf works
117034977a2fSmrg	  :
117134977a2fSmrg        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
117234977a2fSmrg	     test "X$echo_testing_string" = 'X\t' &&
117334977a2fSmrg	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
117434977a2fSmrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
117534977a2fSmrg	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
117634977a2fSmrg	  export CONFIG_SHELL
117734977a2fSmrg	  SHELL="$CONFIG_SHELL"
117834977a2fSmrg	  export SHELL
117934977a2fSmrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
118034977a2fSmrg        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
118134977a2fSmrg	     test "X$echo_testing_string" = 'X\t' &&
118234977a2fSmrg	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
118334977a2fSmrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
118434977a2fSmrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
118534977a2fSmrg        else
118634977a2fSmrg	  # maybe with a smaller string...
118734977a2fSmrg	  prev=:
1188ee3138f1Smrg
118934977a2fSmrg	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
119034977a2fSmrg	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
119134977a2fSmrg	    then
119234977a2fSmrg	      break
119334977a2fSmrg	    fi
119434977a2fSmrg	    prev="$cmd"
119534977a2fSmrg	  done
1196ee3138f1Smrg
119734977a2fSmrg	  if test "$prev" != 'sed 50q "[$]0"'; then
119834977a2fSmrg	    echo_test_string=`eval $prev`
119934977a2fSmrg	    export echo_test_string
120034977a2fSmrg	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
120134977a2fSmrg	  else
120234977a2fSmrg	    # Oops.  We lost completely, so just stick with echo.
120334977a2fSmrg	    ECHO=echo
120434977a2fSmrg	  fi
120534977a2fSmrg        fi
1206ee3138f1Smrg      fi
1207ee3138f1Smrg    fi
1208ee3138f1Smrg  fi
1209ee3138f1Smrgfi
1210ee3138f1Smrg
1211ee3138f1Smrg# Copy echo and quote the copy suitably for passing to libtool from
1212ee3138f1Smrg# the Makefile, instead of quoting the original, which is used later.
121334977a2fSmrglt_ECHO=$ECHO
121434977a2fSmrgif test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
121534977a2fSmrg   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1216ee3138f1Smrgfi
1217ee3138f1Smrg
121834977a2fSmrgAC_SUBST(lt_ECHO)
121934977a2fSmrg])
122034977a2fSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
122134977a2fSmrg_LT_DECL([], [ECHO], [1],
122234977a2fSmrg    [An echo program that does not interpret backslashes])
122334977a2fSmrg])# _LT_PROG_ECHO_BACKSLASH
1224ee3138f1Smrg
1225ee3138f1Smrg
122634977a2fSmrg# _LT_ENABLE_LOCK
122734977a2fSmrg# ---------------
122834977a2fSmrgm4_defun([_LT_ENABLE_LOCK],
1229ee3138f1Smrg[AC_ARG_ENABLE([libtool-lock],
123034977a2fSmrg  [AS_HELP_STRING([--disable-libtool-lock],
123134977a2fSmrg    [avoid locking (might break parallel builds)])])
1232ee3138f1Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1233ee3138f1Smrg
1234ee3138f1Smrg# Some flags need to be propagated to the compiler or linker for good
1235ee3138f1Smrg# libtool support.
1236ee3138f1Smrgcase $host in
1237ee3138f1Smrgia64-*-hpux*)
1238ee3138f1Smrg  # Find out which ABI we are using.
1239ee3138f1Smrg  echo 'int i;' > conftest.$ac_ext
1240ee3138f1Smrg  if AC_TRY_EVAL(ac_compile); then
1241ee3138f1Smrg    case `/usr/bin/file conftest.$ac_objext` in
124234977a2fSmrg      *ELF-32*)
124334977a2fSmrg	HPUX_IA64_MODE="32"
124434977a2fSmrg	;;
124534977a2fSmrg      *ELF-64*)
124634977a2fSmrg	HPUX_IA64_MODE="64"
124734977a2fSmrg	;;
1248ee3138f1Smrg    esac
1249ee3138f1Smrg  fi
1250ee3138f1Smrg  rm -rf conftest*
1251ee3138f1Smrg  ;;
1252ee3138f1Smrg*-*-irix6*)
1253ee3138f1Smrg  # Find out which ABI we are using.
1254ee3138f1Smrg  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1255ee3138f1Smrg  if AC_TRY_EVAL(ac_compile); then
125634977a2fSmrg    if test "$lt_cv_prog_gnu_ld" = yes; then
125734977a2fSmrg      case `/usr/bin/file conftest.$ac_objext` in
125834977a2fSmrg	*32-bit*)
125934977a2fSmrg	  LD="${LD-ld} -melf32bsmip"
126034977a2fSmrg	  ;;
126134977a2fSmrg	*N32*)
126234977a2fSmrg	  LD="${LD-ld} -melf32bmipn32"
126334977a2fSmrg	  ;;
126434977a2fSmrg	*64-bit*)
126534977a2fSmrg	  LD="${LD-ld} -melf64bmip"
126634977a2fSmrg	;;
126734977a2fSmrg      esac
126834977a2fSmrg    else
126934977a2fSmrg      case `/usr/bin/file conftest.$ac_objext` in
127034977a2fSmrg	*32-bit*)
127134977a2fSmrg	  LD="${LD-ld} -32"
127234977a2fSmrg	  ;;
127334977a2fSmrg	*N32*)
127434977a2fSmrg	  LD="${LD-ld} -n32"
127534977a2fSmrg	  ;;
127634977a2fSmrg	*64-bit*)
127734977a2fSmrg	  LD="${LD-ld} -64"
127834977a2fSmrg	  ;;
127934977a2fSmrg      esac
128034977a2fSmrg    fi
1281ee3138f1Smrg  fi
1282ee3138f1Smrg  rm -rf conftest*
1283ee3138f1Smrg  ;;
1284ee3138f1Smrg
1285ee3138f1Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
128634977a2fSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1287ee3138f1Smrg  # Find out which ABI we are using.
1288ee3138f1Smrg  echo 'int i;' > conftest.$ac_ext
1289ee3138f1Smrg  if AC_TRY_EVAL(ac_compile); then
1290ee3138f1Smrg    case `/usr/bin/file conftest.o` in
129134977a2fSmrg      *32-bit*)
129234977a2fSmrg	case $host in
129334977a2fSmrg	  x86_64-*kfreebsd*-gnu)
129434977a2fSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
129534977a2fSmrg	    ;;
129634977a2fSmrg	  x86_64-*linux*)
129734977a2fSmrg	    LD="${LD-ld} -m elf_i386"
129834977a2fSmrg	    ;;
129934977a2fSmrg	  ppc64-*linux*|powerpc64-*linux*)
130034977a2fSmrg	    LD="${LD-ld} -m elf32ppclinux"
130134977a2fSmrg	    ;;
130234977a2fSmrg	  s390x-*linux*)
130334977a2fSmrg	    LD="${LD-ld} -m elf_s390"
130434977a2fSmrg	    ;;
130534977a2fSmrg	  sparc64-*linux*)
130634977a2fSmrg	    LD="${LD-ld} -m elf32_sparc"
130734977a2fSmrg	    ;;
130834977a2fSmrg	esac
130934977a2fSmrg	;;
131034977a2fSmrg      *64-bit*)
131134977a2fSmrg	case $host in
131234977a2fSmrg	  x86_64-*kfreebsd*-gnu)
131334977a2fSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
131434977a2fSmrg	    ;;
131534977a2fSmrg	  x86_64-*linux*)
131634977a2fSmrg	    LD="${LD-ld} -m elf_x86_64"
131734977a2fSmrg	    ;;
131834977a2fSmrg	  ppc*-*linux*|powerpc*-*linux*)
131934977a2fSmrg	    LD="${LD-ld} -m elf64ppc"
132034977a2fSmrg	    ;;
132134977a2fSmrg	  s390*-*linux*|s390*-*tpf*)
132234977a2fSmrg	    LD="${LD-ld} -m elf64_s390"
132334977a2fSmrg	    ;;
132434977a2fSmrg	  sparc*-*linux*)
132534977a2fSmrg	    LD="${LD-ld} -m elf64_sparc"
132634977a2fSmrg	    ;;
132734977a2fSmrg	esac
132834977a2fSmrg	;;
1329ee3138f1Smrg    esac
1330ee3138f1Smrg  fi
1331ee3138f1Smrg  rm -rf conftest*
1332ee3138f1Smrg  ;;
1333ee3138f1Smrg
1334ee3138f1Smrg*-*-sco3.2v5*)
1335ee3138f1Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1336ee3138f1Smrg  SAVE_CFLAGS="$CFLAGS"
1337ee3138f1Smrg  CFLAGS="$CFLAGS -belf"
1338ee3138f1Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1339ee3138f1Smrg    [AC_LANG_PUSH(C)
134034977a2fSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1341ee3138f1Smrg     AC_LANG_POP])
1342ee3138f1Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1343ee3138f1Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1344ee3138f1Smrg    CFLAGS="$SAVE_CFLAGS"
1345ee3138f1Smrg  fi
1346ee3138f1Smrg  ;;
1347ee3138f1Smrgsparc*-*solaris*)
1348ee3138f1Smrg  # Find out which ABI we are using.
1349ee3138f1Smrg  echo 'int i;' > conftest.$ac_ext
1350ee3138f1Smrg  if AC_TRY_EVAL(ac_compile); then
1351ee3138f1Smrg    case `/usr/bin/file conftest.o` in
1352ee3138f1Smrg    *64-bit*)
1353ee3138f1Smrg      case $lt_cv_prog_gnu_ld in
1354ee3138f1Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
135579a8a9c6Smrg      *)
135634977a2fSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
135779a8a9c6Smrg	  LD="${LD-ld} -64"
135879a8a9c6Smrg	fi
135979a8a9c6Smrg	;;
1360ee3138f1Smrg      esac
1361ee3138f1Smrg      ;;
1362ee3138f1Smrg    esac
1363ee3138f1Smrg  fi
1364ee3138f1Smrg  rm -rf conftest*
1365ee3138f1Smrg  ;;
1366ee3138f1Smrgesac
1367ee3138f1Smrg
1368ee3138f1Smrgneed_locks="$enable_libtool_lock"
136934977a2fSmrg])# _LT_ENABLE_LOCK
137034977a2fSmrg
137134977a2fSmrg
137234977a2fSmrg# _LT_CMD_OLD_ARCHIVE
137334977a2fSmrg# -------------------
137434977a2fSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
137534977a2fSmrg[AC_CHECK_TOOL(AR, ar, false)
137634977a2fSmrgtest -z "$AR" && AR=ar
137734977a2fSmrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
137834977a2fSmrg_LT_DECL([], [AR], [1], [The archiver])
137934977a2fSmrg_LT_DECL([], [AR_FLAGS], [1])
138034977a2fSmrg
138134977a2fSmrgAC_CHECK_TOOL(STRIP, strip, :)
138234977a2fSmrgtest -z "$STRIP" && STRIP=:
138334977a2fSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
138434977a2fSmrg
138534977a2fSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
138634977a2fSmrgtest -z "$RANLIB" && RANLIB=:
138734977a2fSmrg_LT_DECL([], [RANLIB], [1],
138834977a2fSmrg    [Commands used to install an old-style archive])
138934977a2fSmrg
139034977a2fSmrg# Determine commands to create old-style static archives.
139134977a2fSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
139234977a2fSmrgold_postinstall_cmds='chmod 644 $oldlib'
139334977a2fSmrgold_postuninstall_cmds=
1394ee3138f1Smrg
139534977a2fSmrgif test -n "$RANLIB"; then
139634977a2fSmrg  case $host_os in
139734977a2fSmrg  openbsd*)
139834977a2fSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
139934977a2fSmrg    ;;
140034977a2fSmrg  *)
140134977a2fSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
140234977a2fSmrg    ;;
140334977a2fSmrg  esac
140434977a2fSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
140534977a2fSmrgfi
140634977a2fSmrg_LT_DECL([], [old_postinstall_cmds], [2])
140734977a2fSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
140834977a2fSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
140934977a2fSmrg    [Commands used to build an old-style archive])
141034977a2fSmrg])# _LT_CMD_OLD_ARCHIVE
1411ee3138f1Smrg
1412ee3138f1Smrg
141334977a2fSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1414ee3138f1Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1415ee3138f1Smrg# ----------------------------------------------------------------
1416ee3138f1Smrg# Check whether the given compiler option works
141734977a2fSmrgAC_DEFUN([_LT_COMPILER_OPTION],
141834977a2fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
141934977a2fSmrgm4_require([_LT_DECL_SED])dnl
1420ee3138f1SmrgAC_CACHE_CHECK([$1], [$2],
1421ee3138f1Smrg  [$2=no
142234977a2fSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1423ee3138f1Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1424ee3138f1Smrg   lt_compiler_flag="$3"
1425ee3138f1Smrg   # Insert the option either (1) after the last *FLAGS variable, or
1426ee3138f1Smrg   # (2) before a word containing "conftest.", or (3) at the end.
1427ee3138f1Smrg   # Note that $ac_compile itself does not contain backslashes and begins
1428ee3138f1Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1429ee3138f1Smrg   # The option is referenced via a variable to avoid confusing sed.
1430ee3138f1Smrg   lt_compile=`echo "$ac_compile" | $SED \
1431ee3138f1Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1432ee3138f1Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1433ee3138f1Smrg   -e 's:$: $lt_compiler_flag:'`
1434ee3138f1Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1435ee3138f1Smrg   (eval "$lt_compile" 2>conftest.err)
1436ee3138f1Smrg   ac_status=$?
1437ee3138f1Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
1438ee3138f1Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1439ee3138f1Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1440ee3138f1Smrg     # The compiler can only warn and ignore the option if not recognized
1441ee3138f1Smrg     # So say no if there are warnings other than the usual output.
144234977a2fSmrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
1443ee3138f1Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1444ee3138f1Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1445ee3138f1Smrg       $2=yes
1446ee3138f1Smrg     fi
1447ee3138f1Smrg   fi
144834977a2fSmrg   $RM conftest*
1449ee3138f1Smrg])
1450ee3138f1Smrg
1451ee3138f1Smrgif test x"[$]$2" = xyes; then
145234977a2fSmrg    m4_if([$5], , :, [$5])
1453ee3138f1Smrgelse
145434977a2fSmrg    m4_if([$6], , :, [$6])
1455ee3138f1Smrgfi
145634977a2fSmrg])# _LT_COMPILER_OPTION
1457ee3138f1Smrg
145834977a2fSmrg# Old name:
145934977a2fSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
146034977a2fSmrgdnl aclocal-1.4 backwards compatibility:
146134977a2fSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1462ee3138f1Smrg
146334977a2fSmrg
146434977a2fSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
146534977a2fSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
146634977a2fSmrg# ----------------------------------------------------
146734977a2fSmrg# Check whether the given linker option works
146834977a2fSmrgAC_DEFUN([_LT_LINKER_OPTION],
146934977a2fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
147034977a2fSmrgm4_require([_LT_DECL_SED])dnl
1471ee3138f1SmrgAC_CACHE_CHECK([$1], [$2],
1472ee3138f1Smrg  [$2=no
1473ee3138f1Smrg   save_LDFLAGS="$LDFLAGS"
1474ee3138f1Smrg   LDFLAGS="$LDFLAGS $3"
1475ee3138f1Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1476ee3138f1Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1477ee3138f1Smrg     # The linker can only warn and ignore the option if not recognized
1478ee3138f1Smrg     # So say no if there are warnings
1479ee3138f1Smrg     if test -s conftest.err; then
1480ee3138f1Smrg       # Append any errors to the config.log.
1481ee3138f1Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
148234977a2fSmrg       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
1483ee3138f1Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1484ee3138f1Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
1485ee3138f1Smrg         $2=yes
1486ee3138f1Smrg       fi
1487ee3138f1Smrg     else
1488ee3138f1Smrg       $2=yes
1489ee3138f1Smrg     fi
1490ee3138f1Smrg   fi
149134977a2fSmrg   $RM -r conftest*
1492ee3138f1Smrg   LDFLAGS="$save_LDFLAGS"
1493ee3138f1Smrg])
1494ee3138f1Smrg
1495ee3138f1Smrgif test x"[$]$2" = xyes; then
149634977a2fSmrg    m4_if([$4], , :, [$4])
1497ee3138f1Smrgelse
149834977a2fSmrg    m4_if([$5], , :, [$5])
1499ee3138f1Smrgfi
150034977a2fSmrg])# _LT_LINKER_OPTION
1501ee3138f1Smrg
150234977a2fSmrg# Old name:
150334977a2fSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
150434977a2fSmrgdnl aclocal-1.4 backwards compatibility:
150534977a2fSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1506ee3138f1Smrg
150734977a2fSmrg
150834977a2fSmrg# LT_CMD_MAX_LEN
150934977a2fSmrg#---------------
151034977a2fSmrgAC_DEFUN([LT_CMD_MAX_LEN],
151134977a2fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
151234977a2fSmrg# find the maximum length of command line arguments
1513ee3138f1SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
1514ee3138f1SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1515ee3138f1Smrg  i=0
1516ee3138f1Smrg  teststring="ABCD"
1517ee3138f1Smrg
1518ee3138f1Smrg  case $build_os in
1519ee3138f1Smrg  msdosdjgpp*)
1520ee3138f1Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
1521ee3138f1Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
1522ee3138f1Smrg    # during glob expansion).  Even if it were fixed, the result of this
1523ee3138f1Smrg    # check would be larger than it should be.
1524ee3138f1Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1525ee3138f1Smrg    ;;
1526ee3138f1Smrg
1527ee3138f1Smrg  gnu*)
1528ee3138f1Smrg    # Under GNU Hurd, this test is not required because there is
1529ee3138f1Smrg    # no limit to the length of command line arguments.
1530ee3138f1Smrg    # Libtool will interpret -1 as no limit whatsoever
1531ee3138f1Smrg    lt_cv_sys_max_cmd_len=-1;
1532ee3138f1Smrg    ;;
1533ee3138f1Smrg
153434977a2fSmrg  cygwin* | mingw* | cegcc*)
1535ee3138f1Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
1536ee3138f1Smrg    # about 5 minutes as the teststring grows exponentially.
1537ee3138f1Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
1538ee3138f1Smrg    # you end up with a "frozen" computer, even though with patience
1539ee3138f1Smrg    # the test eventually succeeds (with a max line length of 256k).
1540ee3138f1Smrg    # Instead, let's just punt: use the minimum linelength reported by
1541ee3138f1Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
1542ee3138f1Smrg    lt_cv_sys_max_cmd_len=8192;
1543ee3138f1Smrg    ;;
1544ee3138f1Smrg
1545ee3138f1Smrg  amigaos*)
1546ee3138f1Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
1547ee3138f1Smrg    # So we just punt and use a minimum line length of 8192.
1548ee3138f1Smrg    lt_cv_sys_max_cmd_len=8192;
1549ee3138f1Smrg    ;;
1550ee3138f1Smrg
1551ee3138f1Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1552ee3138f1Smrg    # This has been around since 386BSD, at least.  Likely further.
1553ee3138f1Smrg    if test -x /sbin/sysctl; then
1554ee3138f1Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1555ee3138f1Smrg    elif test -x /usr/sbin/sysctl; then
1556ee3138f1Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1557ee3138f1Smrg    else
1558ee3138f1Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1559ee3138f1Smrg    fi
1560ee3138f1Smrg    # And add a safety zone
1561ee3138f1Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1562ee3138f1Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1563ee3138f1Smrg    ;;
1564ee3138f1Smrg
1565ee3138f1Smrg  interix*)
1566ee3138f1Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1567ee3138f1Smrg    lt_cv_sys_max_cmd_len=196608
1568ee3138f1Smrg    ;;
1569ee3138f1Smrg
1570ee3138f1Smrg  osf*)
1571ee3138f1Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1572ee3138f1Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1573ee3138f1Smrg    # nice to cause kernel panics so lets avoid the loop below.
1574ee3138f1Smrg    # First set a reasonable default.
1575ee3138f1Smrg    lt_cv_sys_max_cmd_len=16384
1576ee3138f1Smrg    #
1577ee3138f1Smrg    if test -x /sbin/sysconfig; then
1578ee3138f1Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1579ee3138f1Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1580ee3138f1Smrg      esac
1581ee3138f1Smrg    fi
1582ee3138f1Smrg    ;;
1583ee3138f1Smrg  sco3.2v5*)
1584ee3138f1Smrg    lt_cv_sys_max_cmd_len=102400
1585ee3138f1Smrg    ;;
1586ee3138f1Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
1587ee3138f1Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1588ee3138f1Smrg    if test -n "$kargmax"; then
158934977a2fSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1590ee3138f1Smrg    else
1591ee3138f1Smrg      lt_cv_sys_max_cmd_len=32768
1592ee3138f1Smrg    fi
1593ee3138f1Smrg    ;;
1594ee3138f1Smrg  *)
1595ee3138f1Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1596ee3138f1Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
1597ee3138f1Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1598ee3138f1Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1599ee3138f1Smrg    else
160034977a2fSmrg      # Make teststring a little bigger before we do anything with it.
160134977a2fSmrg      # a 1K string should be a reasonable start.
160234977a2fSmrg      for i in 1 2 3 4 5 6 7 8 ; do
160334977a2fSmrg        teststring=$teststring$teststring
160434977a2fSmrg      done
1605ee3138f1Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
160634977a2fSmrg      # If test is not a shell built-in, we'll probably end up computing a
160734977a2fSmrg      # maximum length that is only half of the actual maximum length, but
160834977a2fSmrg      # we can't tell.
160934977a2fSmrg      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
161034977a2fSmrg	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
1611ee3138f1Smrg	      test $i != 17 # 1/2 MB should be enough
1612ee3138f1Smrg      do
1613ee3138f1Smrg        i=`expr $i + 1`
1614ee3138f1Smrg        teststring=$teststring$teststring
1615ee3138f1Smrg      done
161634977a2fSmrg      # Only check the string length outside the loop.
161734977a2fSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1618ee3138f1Smrg      teststring=
161934977a2fSmrg      # Add a significant safety factor because C++ compilers can tack on
162034977a2fSmrg      # massive amounts of additional arguments before passing them to the
162134977a2fSmrg      # linker.  It appears as though 1/2 is a usable value.
1622ee3138f1Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1623ee3138f1Smrg    fi
1624ee3138f1Smrg    ;;
1625ee3138f1Smrg  esac
1626ee3138f1Smrg])
1627ee3138f1Smrgif test -n $lt_cv_sys_max_cmd_len ; then
1628ee3138f1Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1629ee3138f1Smrgelse
1630ee3138f1Smrg  AC_MSG_RESULT(none)
1631ee3138f1Smrgfi
163234977a2fSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
163334977a2fSmrg_LT_DECL([], [max_cmd_len], [0],
163434977a2fSmrg    [What is the maximum length of a command?])
163534977a2fSmrg])# LT_CMD_MAX_LEN
1636ee3138f1Smrg
163734977a2fSmrg# Old name:
163834977a2fSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
163934977a2fSmrgdnl aclocal-1.4 backwards compatibility:
164034977a2fSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1641ee3138f1Smrg
164234977a2fSmrg
164334977a2fSmrg# _LT_HEADER_DLFCN
164434977a2fSmrg# ----------------
164534977a2fSmrgm4_defun([_LT_HEADER_DLFCN],
164634977a2fSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
164734977a2fSmrg])# _LT_HEADER_DLFCN
1648ee3138f1Smrg
1649ee3138f1Smrg
165034977a2fSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
165134977a2fSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
165234977a2fSmrg# ----------------------------------------------------------------
165334977a2fSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
165434977a2fSmrg[m4_require([_LT_HEADER_DLFCN])dnl
1655ee3138f1Smrgif test "$cross_compiling" = yes; then :
1656ee3138f1Smrg  [$4]
1657ee3138f1Smrgelse
1658ee3138f1Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1659ee3138f1Smrg  lt_status=$lt_dlunknown
166034977a2fSmrg  cat > conftest.$ac_ext <<_LT_EOF
1661ee3138f1Smrg[#line __oline__ "configure"
1662ee3138f1Smrg#include "confdefs.h"
1663ee3138f1Smrg
1664ee3138f1Smrg#if HAVE_DLFCN_H
1665ee3138f1Smrg#include <dlfcn.h>
1666ee3138f1Smrg#endif
1667ee3138f1Smrg
1668ee3138f1Smrg#include <stdio.h>
1669ee3138f1Smrg
1670ee3138f1Smrg#ifdef RTLD_GLOBAL
1671ee3138f1Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
1672ee3138f1Smrg#else
1673ee3138f1Smrg#  ifdef DL_GLOBAL
1674ee3138f1Smrg#    define LT_DLGLOBAL		DL_GLOBAL
1675ee3138f1Smrg#  else
1676ee3138f1Smrg#    define LT_DLGLOBAL		0
1677ee3138f1Smrg#  endif
1678ee3138f1Smrg#endif
1679ee3138f1Smrg
1680ee3138f1Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1681ee3138f1Smrg   find out it does not work in some platform. */
1682ee3138f1Smrg#ifndef LT_DLLAZY_OR_NOW
1683ee3138f1Smrg#  ifdef RTLD_LAZY
1684ee3138f1Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1685ee3138f1Smrg#  else
1686ee3138f1Smrg#    ifdef DL_LAZY
1687ee3138f1Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
1688ee3138f1Smrg#    else
1689ee3138f1Smrg#      ifdef RTLD_NOW
1690ee3138f1Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1691ee3138f1Smrg#      else
1692ee3138f1Smrg#        ifdef DL_NOW
1693ee3138f1Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
1694ee3138f1Smrg#        else
1695ee3138f1Smrg#          define LT_DLLAZY_OR_NOW	0
1696ee3138f1Smrg#        endif
1697ee3138f1Smrg#      endif
1698ee3138f1Smrg#    endif
1699ee3138f1Smrg#  endif
1700ee3138f1Smrg#endif
1701ee3138f1Smrg
1702ee3138f1Smrgvoid fnord() { int i=42;}
1703ee3138f1Smrgint main ()
1704ee3138f1Smrg{
1705ee3138f1Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1706ee3138f1Smrg  int status = $lt_dlunknown;
1707ee3138f1Smrg
1708ee3138f1Smrg  if (self)
1709ee3138f1Smrg    {
1710ee3138f1Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1711ee3138f1Smrg      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1712ee3138f1Smrg      /* dlclose (self); */
1713ee3138f1Smrg    }
1714ee3138f1Smrg  else
1715ee3138f1Smrg    puts (dlerror ());
1716ee3138f1Smrg
171734977a2fSmrg  return status;
1718ee3138f1Smrg}]
171934977a2fSmrg_LT_EOF
1720ee3138f1Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1721ee3138f1Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1722ee3138f1Smrg    lt_status=$?
1723ee3138f1Smrg    case x$lt_status in
1724ee3138f1Smrg      x$lt_dlno_uscore) $1 ;;
1725ee3138f1Smrg      x$lt_dlneed_uscore) $2 ;;
1726ee3138f1Smrg      x$lt_dlunknown|x*) $3 ;;
1727ee3138f1Smrg    esac
1728ee3138f1Smrg  else :
1729ee3138f1Smrg    # compilation failed
1730ee3138f1Smrg    $3
1731ee3138f1Smrg  fi
1732ee3138f1Smrgfi
1733ee3138f1Smrgrm -fr conftest*
173434977a2fSmrg])# _LT_TRY_DLOPEN_SELF
1735ee3138f1Smrg
1736ee3138f1Smrg
173734977a2fSmrg# LT_SYS_DLOPEN_SELF
173834977a2fSmrg# ------------------
173934977a2fSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
174034977a2fSmrg[m4_require([_LT_HEADER_DLFCN])dnl
1741ee3138f1Smrgif test "x$enable_dlopen" != xyes; then
1742ee3138f1Smrg  enable_dlopen=unknown
1743ee3138f1Smrg  enable_dlopen_self=unknown
1744ee3138f1Smrg  enable_dlopen_self_static=unknown
1745ee3138f1Smrgelse
1746ee3138f1Smrg  lt_cv_dlopen=no
1747ee3138f1Smrg  lt_cv_dlopen_libs=
1748ee3138f1Smrg
1749ee3138f1Smrg  case $host_os in
1750ee3138f1Smrg  beos*)
1751ee3138f1Smrg    lt_cv_dlopen="load_add_on"
1752ee3138f1Smrg    lt_cv_dlopen_libs=
1753ee3138f1Smrg    lt_cv_dlopen_self=yes
1754ee3138f1Smrg    ;;
1755ee3138f1Smrg
175634977a2fSmrg  mingw* | pw32* | cegcc*)
1757ee3138f1Smrg    lt_cv_dlopen="LoadLibrary"
1758ee3138f1Smrg    lt_cv_dlopen_libs=
175934977a2fSmrg    ;;
1760ee3138f1Smrg
1761ee3138f1Smrg  cygwin*)
1762ee3138f1Smrg    lt_cv_dlopen="dlopen"
1763ee3138f1Smrg    lt_cv_dlopen_libs=
176434977a2fSmrg    ;;
1765ee3138f1Smrg
1766ee3138f1Smrg  darwin*)
1767ee3138f1Smrg  # if libdl is installed we need to link against it
1768ee3138f1Smrg    AC_CHECK_LIB([dl], [dlopen],
1769ee3138f1Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1770ee3138f1Smrg    lt_cv_dlopen="dyld"
1771ee3138f1Smrg    lt_cv_dlopen_libs=
1772ee3138f1Smrg    lt_cv_dlopen_self=yes
1773ee3138f1Smrg    ])
177434977a2fSmrg    ;;
1775ee3138f1Smrg
1776ee3138f1Smrg  *)
1777ee3138f1Smrg    AC_CHECK_FUNC([shl_load],
1778ee3138f1Smrg	  [lt_cv_dlopen="shl_load"],
1779ee3138f1Smrg      [AC_CHECK_LIB([dld], [shl_load],
178079a8a9c6Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1781ee3138f1Smrg	[AC_CHECK_FUNC([dlopen],
1782ee3138f1Smrg	      [lt_cv_dlopen="dlopen"],
1783ee3138f1Smrg	  [AC_CHECK_LIB([dl], [dlopen],
1784ee3138f1Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1785ee3138f1Smrg	    [AC_CHECK_LIB([svld], [dlopen],
1786ee3138f1Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1787ee3138f1Smrg	      [AC_CHECK_LIB([dld], [dld_link],
178879a8a9c6Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1789ee3138f1Smrg	      ])
1790ee3138f1Smrg	    ])
1791ee3138f1Smrg	  ])
1792ee3138f1Smrg	])
1793ee3138f1Smrg      ])
1794ee3138f1Smrg    ;;
1795ee3138f1Smrg  esac
1796ee3138f1Smrg
1797ee3138f1Smrg  if test "x$lt_cv_dlopen" != xno; then
1798ee3138f1Smrg    enable_dlopen=yes
1799ee3138f1Smrg  else
1800ee3138f1Smrg    enable_dlopen=no
1801ee3138f1Smrg  fi
1802ee3138f1Smrg
1803ee3138f1Smrg  case $lt_cv_dlopen in
1804ee3138f1Smrg  dlopen)
1805ee3138f1Smrg    save_CPPFLAGS="$CPPFLAGS"
1806ee3138f1Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1807ee3138f1Smrg
1808ee3138f1Smrg    save_LDFLAGS="$LDFLAGS"
1809ee3138f1Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1810ee3138f1Smrg
1811ee3138f1Smrg    save_LIBS="$LIBS"
1812ee3138f1Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
1813ee3138f1Smrg
1814ee3138f1Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
1815ee3138f1Smrg	  lt_cv_dlopen_self, [dnl
181634977a2fSmrg	  _LT_TRY_DLOPEN_SELF(
1817ee3138f1Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1818ee3138f1Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1819ee3138f1Smrg    ])
1820ee3138f1Smrg
1821ee3138f1Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
1822ee3138f1Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1823ee3138f1Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
182434977a2fSmrg	  lt_cv_dlopen_self_static, [dnl
182534977a2fSmrg	  _LT_TRY_DLOPEN_SELF(
1826ee3138f1Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1827ee3138f1Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1828ee3138f1Smrg      ])
1829ee3138f1Smrg    fi
1830ee3138f1Smrg
1831ee3138f1Smrg    CPPFLAGS="$save_CPPFLAGS"
1832ee3138f1Smrg    LDFLAGS="$save_LDFLAGS"
1833ee3138f1Smrg    LIBS="$save_LIBS"
1834ee3138f1Smrg    ;;
1835ee3138f1Smrg  esac
1836ee3138f1Smrg
1837ee3138f1Smrg  case $lt_cv_dlopen_self in
1838ee3138f1Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1839ee3138f1Smrg  *) enable_dlopen_self=unknown ;;
1840ee3138f1Smrg  esac
1841ee3138f1Smrg
1842ee3138f1Smrg  case $lt_cv_dlopen_self_static in
1843ee3138f1Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1844ee3138f1Smrg  *) enable_dlopen_self_static=unknown ;;
1845ee3138f1Smrg  esac
1846ee3138f1Smrgfi
184734977a2fSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
184834977a2fSmrg	 [Whether dlopen is supported])
184934977a2fSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
185034977a2fSmrg	 [Whether dlopen of programs is supported])
185134977a2fSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
185234977a2fSmrg	 [Whether dlopen of statically linked programs is supported])
185334977a2fSmrg])# LT_SYS_DLOPEN_SELF
1854ee3138f1Smrg
185534977a2fSmrg# Old name:
185634977a2fSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
185734977a2fSmrgdnl aclocal-1.4 backwards compatibility:
185834977a2fSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1859ee3138f1Smrg
186034977a2fSmrg
186134977a2fSmrg# _LT_COMPILER_C_O([TAGNAME])
186234977a2fSmrg# ---------------------------
186334977a2fSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
186434977a2fSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
186534977a2fSmrgm4_defun([_LT_COMPILER_C_O],
186634977a2fSmrg[m4_require([_LT_DECL_SED])dnl
186734977a2fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
186834977a2fSmrgm4_require([_LT_TAG_COMPILER])dnl
1869ee3138f1SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
187034977a2fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
187134977a2fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
187234977a2fSmrg   $RM -r conftest 2>/dev/null
1873ee3138f1Smrg   mkdir conftest
1874ee3138f1Smrg   cd conftest
1875ee3138f1Smrg   mkdir out
1876ee3138f1Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1877ee3138f1Smrg
1878ee3138f1Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
1879ee3138f1Smrg   # Insert the option either (1) after the last *FLAGS variable, or
1880ee3138f1Smrg   # (2) before a word containing "conftest.", or (3) at the end.
1881ee3138f1Smrg   # Note that $ac_compile itself does not contain backslashes and begins
1882ee3138f1Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1883ee3138f1Smrg   lt_compile=`echo "$ac_compile" | $SED \
1884ee3138f1Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1885ee3138f1Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1886ee3138f1Smrg   -e 's:$: $lt_compiler_flag:'`
1887ee3138f1Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1888ee3138f1Smrg   (eval "$lt_compile" 2>out/conftest.err)
1889ee3138f1Smrg   ac_status=$?
1890ee3138f1Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
1891ee3138f1Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1892ee3138f1Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
1893ee3138f1Smrg   then
1894ee3138f1Smrg     # The compiler can only warn and ignore the option if not recognized
1895ee3138f1Smrg     # So say no if there are warnings
189634977a2fSmrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
1897ee3138f1Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
1898ee3138f1Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
189934977a2fSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
1900ee3138f1Smrg     fi
1901ee3138f1Smrg   fi
1902ee3138f1Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
190334977a2fSmrg   $RM conftest*
1904ee3138f1Smrg   # SGI C++ compiler will create directory out/ii_files/ for
1905ee3138f1Smrg   # template instantiation
190634977a2fSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
190734977a2fSmrg   $RM out/* && rmdir out
1908ee3138f1Smrg   cd ..
190934977a2fSmrg   $RM -r conftest
191034977a2fSmrg   $RM conftest*
1911ee3138f1Smrg])
191234977a2fSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
191334977a2fSmrg	[Does compiler simultaneously support -c and -o options?])
191434977a2fSmrg])# _LT_COMPILER_C_O
1915ee3138f1Smrg
1916ee3138f1Smrg
191734977a2fSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
191834977a2fSmrg# ----------------------------------
1919ee3138f1Smrg# Check to see if we can do hard links to lock some files if needed
192034977a2fSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
192134977a2fSmrg[m4_require([_LT_ENABLE_LOCK])dnl
192234977a2fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
192334977a2fSmrg_LT_COMPILER_C_O([$1])
1924ee3138f1Smrg
1925ee3138f1Smrghard_links="nottested"
192634977a2fSmrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
1927ee3138f1Smrg  # do not overwrite the value of need_locks provided by the user
1928ee3138f1Smrg  AC_MSG_CHECKING([if we can lock with hard links])
1929ee3138f1Smrg  hard_links=yes
193034977a2fSmrg  $RM conftest*
1931ee3138f1Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1932ee3138f1Smrg  touch conftest.a
1933ee3138f1Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
1934ee3138f1Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1935ee3138f1Smrg  AC_MSG_RESULT([$hard_links])
1936ee3138f1Smrg  if test "$hard_links" = no; then
1937ee3138f1Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
1938ee3138f1Smrg    need_locks=warn
1939ee3138f1Smrg  fi
1940ee3138f1Smrgelse
1941ee3138f1Smrg  need_locks=no
1942ee3138f1Smrgfi
194334977a2fSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
194434977a2fSmrg])# _LT_COMPILER_FILE_LOCKS
1945ee3138f1Smrg
1946ee3138f1Smrg
194734977a2fSmrg# _LT_CHECK_OBJDIR
194834977a2fSmrg# ----------------
194934977a2fSmrgm4_defun([_LT_CHECK_OBJDIR],
1950ee3138f1Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1951ee3138f1Smrg[rm -f .libs 2>/dev/null
1952ee3138f1Smrgmkdir .libs 2>/dev/null
1953ee3138f1Smrgif test -d .libs; then
1954ee3138f1Smrg  lt_cv_objdir=.libs
1955ee3138f1Smrgelse
1956ee3138f1Smrg  # MS-DOS does not allow filenames that begin with a dot.
1957ee3138f1Smrg  lt_cv_objdir=_libs
1958ee3138f1Smrgfi
1959ee3138f1Smrgrmdir .libs 2>/dev/null])
1960ee3138f1Smrgobjdir=$lt_cv_objdir
196134977a2fSmrg_LT_DECL([], [objdir], [0],
196234977a2fSmrg         [The name of the directory that contains temporary libtool files])dnl
196334977a2fSmrgm4_pattern_allow([LT_OBJDIR])dnl
196434977a2fSmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
196534977a2fSmrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
196634977a2fSmrg])# _LT_CHECK_OBJDIR
1967ee3138f1Smrg
1968ee3138f1Smrg
196934977a2fSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
197034977a2fSmrg# --------------------------------------
1971ee3138f1Smrg# Check hardcoding attributes.
197234977a2fSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
1973ee3138f1Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
197434977a2fSmrg_LT_TAGVAR(hardcode_action, $1)=
197534977a2fSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
197634977a2fSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
197734977a2fSmrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
1978ee3138f1Smrg
197934977a2fSmrg  # We can hardcode non-existent directories.
198034977a2fSmrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
1981ee3138f1Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
1982ee3138f1Smrg     # have to relink, otherwise we might link with an installed library
1983ee3138f1Smrg     # when we should be linking with a yet-to-be-installed one
198434977a2fSmrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
198534977a2fSmrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
1986ee3138f1Smrg    # Linking always hardcodes the temporary library directory.
198734977a2fSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
1988ee3138f1Smrg  else
1989ee3138f1Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
199034977a2fSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
1991ee3138f1Smrg  fi
1992ee3138f1Smrgelse
1993ee3138f1Smrg  # We cannot hardcode anything, or else we can only hardcode existing
1994ee3138f1Smrg  # directories.
199534977a2fSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
1996ee3138f1Smrgfi
199734977a2fSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
1998ee3138f1Smrg
199934977a2fSmrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
200034977a2fSmrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
2001ee3138f1Smrg  # Fast installation is not supported
2002ee3138f1Smrg  enable_fast_install=no
2003ee3138f1Smrgelif test "$shlibpath_overrides_runpath" = yes ||
2004ee3138f1Smrg     test "$enable_shared" = no; then
2005ee3138f1Smrg  # Fast installation is not necessary
2006ee3138f1Smrg  enable_fast_install=needless
2007ee3138f1Smrgfi
200834977a2fSmrg_LT_TAGDECL([], [hardcode_action], [0],
200934977a2fSmrg    [How to hardcode a shared library path into an executable])
201034977a2fSmrg])# _LT_LINKER_HARDCODE_LIBPATH
2011ee3138f1Smrg
2012ee3138f1Smrg
201334977a2fSmrg# _LT_CMD_STRIPLIB
201434977a2fSmrg# ----------------
201534977a2fSmrgm4_defun([_LT_CMD_STRIPLIB],
201634977a2fSmrg[m4_require([_LT_DECL_EGREP])
201734977a2fSmrgstriplib=
2018ee3138f1Smrgold_striplib=
2019ee3138f1SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
202034977a2fSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2021ee3138f1Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2022ee3138f1Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2023ee3138f1Smrg  AC_MSG_RESULT([yes])
2024ee3138f1Smrgelse
2025ee3138f1Smrg# FIXME - insert some real tests, host_os isn't really good enough
2026ee3138f1Smrg  case $host_os in
202734977a2fSmrg  darwin*)
202834977a2fSmrg    if test -n "$STRIP" ; then
202934977a2fSmrg      striplib="$STRIP -x"
203034977a2fSmrg      old_striplib="$STRIP -S"
203134977a2fSmrg      AC_MSG_RESULT([yes])
203234977a2fSmrg    else
203334977a2fSmrg      AC_MSG_RESULT([no])
203434977a2fSmrg    fi
203534977a2fSmrg    ;;
203634977a2fSmrg  *)
203734977a2fSmrg    AC_MSG_RESULT([no])
2038ee3138f1Smrg    ;;
2039ee3138f1Smrg  esac
2040ee3138f1Smrgfi
204134977a2fSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
204234977a2fSmrg_LT_DECL([], [striplib], [1])
204334977a2fSmrg])# _LT_CMD_STRIPLIB
2044ee3138f1Smrg
2045ee3138f1Smrg
204634977a2fSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
2047ee3138f1Smrg# -----------------------------
2048ee3138f1Smrg# PORTME Fill in your ld.so characteristics
204934977a2fSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
205034977a2fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
205134977a2fSmrgm4_require([_LT_DECL_EGREP])dnl
205234977a2fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
205334977a2fSmrgm4_require([_LT_DECL_OBJDUMP])dnl
205434977a2fSmrgm4_require([_LT_DECL_SED])dnl
2055ee3138f1SmrgAC_MSG_CHECKING([dynamic linker characteristics])
205634977a2fSmrgm4_if([$1],
205734977a2fSmrg	[], [
2058ee3138f1Smrgif test "$GCC" = yes; then
2059ee3138f1Smrg  case $host_os in
2060ee3138f1Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2061ee3138f1Smrg    *) lt_awk_arg="/^libraries:/" ;;
2062ee3138f1Smrg  esac
2063ee3138f1Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
206434977a2fSmrg  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
2065ee3138f1Smrg    # if the path contains ";" then we assume it to be the separator
2066ee3138f1Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
2067ee3138f1Smrg    # assumed that no part of a normal pathname contains ";" but that should
2068ee3138f1Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
206934977a2fSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
2070ee3138f1Smrg  else
207134977a2fSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
2072ee3138f1Smrg  fi
2073ee3138f1Smrg  # Ok, now we have the path, separated by spaces, we can step through it
2074ee3138f1Smrg  # and add multilib dir if necessary.
2075ee3138f1Smrg  lt_tmp_lt_search_path_spec=
2076ee3138f1Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2077ee3138f1Smrg  for lt_sys_path in $lt_search_path_spec; do
2078ee3138f1Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2079ee3138f1Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2080ee3138f1Smrg    else
2081ee3138f1Smrg      test -d "$lt_sys_path" && \
2082ee3138f1Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2083ee3138f1Smrg    fi
2084ee3138f1Smrg  done
208534977a2fSmrg  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
2086ee3138f1SmrgBEGIN {RS=" "; FS="/|\n";} {
2087ee3138f1Smrg  lt_foo="";
2088ee3138f1Smrg  lt_count=0;
2089ee3138f1Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
2090ee3138f1Smrg    if ($lt_i != "" && $lt_i != ".") {
2091ee3138f1Smrg      if ($lt_i == "..") {
2092ee3138f1Smrg        lt_count++;
2093ee3138f1Smrg      } else {
2094ee3138f1Smrg        if (lt_count == 0) {
2095ee3138f1Smrg          lt_foo="/" $lt_i lt_foo;
2096ee3138f1Smrg        } else {
2097ee3138f1Smrg          lt_count--;
2098ee3138f1Smrg        }
2099ee3138f1Smrg      }
2100ee3138f1Smrg    }
2101ee3138f1Smrg  }
2102ee3138f1Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2103ee3138f1Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2104ee3138f1Smrg}'`
210534977a2fSmrg  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
2106ee3138f1Smrgelse
2107ee3138f1Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2108ee3138f1Smrgfi])
210934977a2fSmrglibrary_names_spec=
211034977a2fSmrglibname_spec='lib$name'
211134977a2fSmrgsoname_spec=
211234977a2fSmrgshrext_cmds=".so"
211334977a2fSmrgpostinstall_cmds=
211434977a2fSmrgpostuninstall_cmds=
211534977a2fSmrgfinish_cmds=
211634977a2fSmrgfinish_eval=
211734977a2fSmrgshlibpath_var=
211834977a2fSmrgshlibpath_overrides_runpath=unknown
211934977a2fSmrgversion_type=none
212034977a2fSmrgdynamic_linker="$host_os ld.so"
212134977a2fSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
2122ee3138f1Smrgneed_lib_prefix=unknown
2123ee3138f1Smrghardcode_into_libs=no
2124ee3138f1Smrg
2125ee3138f1Smrg# when you set need_version to no, make sure it does not cause -set_version
2126ee3138f1Smrg# flags to be left without arguments
2127ee3138f1Smrgneed_version=unknown
2128ee3138f1Smrg
2129ee3138f1Smrgcase $host_os in
2130ee3138f1Smrgaix3*)
2131ee3138f1Smrg  version_type=linux
2132ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2133ee3138f1Smrg  shlibpath_var=LIBPATH
2134ee3138f1Smrg
2135ee3138f1Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
2136ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2137ee3138f1Smrg  ;;
2138ee3138f1Smrg
213979a8a9c6Smrgaix[[4-9]]*)
2140ee3138f1Smrg  version_type=linux
2141ee3138f1Smrg  need_lib_prefix=no
2142ee3138f1Smrg  need_version=no
2143ee3138f1Smrg  hardcode_into_libs=yes
2144ee3138f1Smrg  if test "$host_cpu" = ia64; then
2145ee3138f1Smrg    # AIX 5 supports IA64
2146ee3138f1Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2147ee3138f1Smrg    shlibpath_var=LD_LIBRARY_PATH
2148ee3138f1Smrg  else
2149ee3138f1Smrg    # With GCC up to 2.95.x, collect2 would create an import file
2150ee3138f1Smrg    # for dependence libraries.  The import file would start with
2151ee3138f1Smrg    # the line `#! .'.  This would cause the generated library to
2152ee3138f1Smrg    # depend on `.', always an invalid library.  This was fixed in
2153ee3138f1Smrg    # development snapshots of GCC prior to 3.0.
2154ee3138f1Smrg    case $host_os in
2155ee3138f1Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
2156ee3138f1Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2157ee3138f1Smrg	   echo ' yes '
215834977a2fSmrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2159ee3138f1Smrg	:
2160ee3138f1Smrg      else
2161ee3138f1Smrg	can_build_shared=no
2162ee3138f1Smrg      fi
2163ee3138f1Smrg      ;;
2164ee3138f1Smrg    esac
2165ee3138f1Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2166ee3138f1Smrg    # soname into executable. Probably we can add versioning support to
2167ee3138f1Smrg    # collect2, so additional links can be useful in future.
2168ee3138f1Smrg    if test "$aix_use_runtimelinking" = yes; then
2169ee3138f1Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2170ee3138f1Smrg      # instead of lib<name>.a to let people know that these are not
2171ee3138f1Smrg      # typical AIX shared libraries.
2172ee3138f1Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2173ee3138f1Smrg    else
2174ee3138f1Smrg      # We preserve .a as extension for shared libraries through AIX4.2
2175ee3138f1Smrg      # and later when we are not doing run time linking.
2176ee3138f1Smrg      library_names_spec='${libname}${release}.a $libname.a'
2177ee3138f1Smrg      soname_spec='${libname}${release}${shared_ext}$major'
2178ee3138f1Smrg    fi
2179ee3138f1Smrg    shlibpath_var=LIBPATH
2180ee3138f1Smrg  fi
2181ee3138f1Smrg  ;;
2182ee3138f1Smrg
2183ee3138f1Smrgamigaos*)
218434977a2fSmrg  case $host_cpu in
218534977a2fSmrg  powerpc)
218634977a2fSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
218734977a2fSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
218834977a2fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
218934977a2fSmrg    ;;
219034977a2fSmrg  m68k)
219134977a2fSmrg    library_names_spec='$libname.ixlibrary $libname.a'
219234977a2fSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
219334977a2fSmrg    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'
219434977a2fSmrg    ;;
219534977a2fSmrg  esac
2196ee3138f1Smrg  ;;
2197ee3138f1Smrg
2198ee3138f1Smrgbeos*)
2199ee3138f1Smrg  library_names_spec='${libname}${shared_ext}'
2200ee3138f1Smrg  dynamic_linker="$host_os ld.so"
2201ee3138f1Smrg  shlibpath_var=LIBRARY_PATH
2202ee3138f1Smrg  ;;
2203ee3138f1Smrg
2204ee3138f1Smrgbsdi[[45]]*)
2205ee3138f1Smrg  version_type=linux
2206ee3138f1Smrg  need_version=no
2207ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2208ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2209ee3138f1Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2210ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
2211ee3138f1Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2212ee3138f1Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2213ee3138f1Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
2214ee3138f1Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2215ee3138f1Smrg  # libtool to hard-code these into programs
2216ee3138f1Smrg  ;;
2217ee3138f1Smrg
221834977a2fSmrgcygwin* | mingw* | pw32* | cegcc*)
2219ee3138f1Smrg  version_type=windows
2220ee3138f1Smrg  shrext_cmds=".dll"
2221ee3138f1Smrg  need_version=no
2222ee3138f1Smrg  need_lib_prefix=no
2223ee3138f1Smrg
2224ee3138f1Smrg  case $GCC,$host_os in
222534977a2fSmrg  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
2226ee3138f1Smrg    library_names_spec='$libname.dll.a'
2227ee3138f1Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2228ee3138f1Smrg    postinstall_cmds='base_file=`basename \${file}`~
222934977a2fSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2230ee3138f1Smrg      dldir=$destdir/`dirname \$dlpath`~
2231ee3138f1Smrg      test -d \$dldir || mkdir -p \$dldir~
2232ee3138f1Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
223334977a2fSmrg      chmod a+x \$dldir/$dlname~
223434977a2fSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
223534977a2fSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
223634977a2fSmrg      fi'
2237ee3138f1Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2238ee3138f1Smrg      dlpath=$dir/\$dldll~
223934977a2fSmrg       $RM \$dlpath'
2240ee3138f1Smrg    shlibpath_overrides_runpath=yes
2241ee3138f1Smrg
2242ee3138f1Smrg    case $host_os in
2243ee3138f1Smrg    cygwin*)
2244ee3138f1Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2245ee3138f1Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2246ee3138f1Smrg      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
2247ee3138f1Smrg      ;;
224834977a2fSmrg    mingw* | cegcc*)
2249ee3138f1Smrg      # MinGW DLLs use traditional 'lib' prefix
2250ee3138f1Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
225134977a2fSmrg      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
225234977a2fSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2253ee3138f1Smrg        # It is most probably a Windows format PATH printed by
2254ee3138f1Smrg        # mingw gcc, but we are running on Cygwin. Gcc prints its search
2255ee3138f1Smrg        # path with ; separators, and with drive letters. We can handle the
2256ee3138f1Smrg        # drive letters (cygwin fileutils understands them), so leave them,
2257ee3138f1Smrg        # especially as we might pass files found there to a mingw objdump,
2258ee3138f1Smrg        # which wouldn't understand a cygwinified path. Ahh.
225934977a2fSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2260ee3138f1Smrg      else
226134977a2fSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
2262ee3138f1Smrg      fi
2263ee3138f1Smrg      ;;
2264ee3138f1Smrg    pw32*)
2265ee3138f1Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2266ee3138f1Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2267ee3138f1Smrg      ;;
2268ee3138f1Smrg    esac
2269ee3138f1Smrg    ;;
2270ee3138f1Smrg
2271ee3138f1Smrg  *)
2272ee3138f1Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2273ee3138f1Smrg    ;;
2274ee3138f1Smrg  esac
2275ee3138f1Smrg  dynamic_linker='Win32 ld.exe'
2276ee3138f1Smrg  # FIXME: first we should search . and the directory the executable is in
2277ee3138f1Smrg  shlibpath_var=PATH
2278ee3138f1Smrg  ;;
2279ee3138f1Smrg
2280ee3138f1Smrgdarwin* | rhapsody*)
2281ee3138f1Smrg  dynamic_linker="$host_os dyld"
2282ee3138f1Smrg  version_type=darwin
2283ee3138f1Smrg  need_lib_prefix=no
2284ee3138f1Smrg  need_version=no
228534977a2fSmrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2286ee3138f1Smrg  soname_spec='${libname}${release}${major}$shared_ext'
2287ee3138f1Smrg  shlibpath_overrides_runpath=yes
2288ee3138f1Smrg  shlibpath_var=DYLD_LIBRARY_PATH
2289ee3138f1Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
229034977a2fSmrgm4_if([$1], [],[
229134977a2fSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2292ee3138f1Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2293ee3138f1Smrg  ;;
2294ee3138f1Smrg
2295ee3138f1Smrgdgux*)
2296ee3138f1Smrg  version_type=linux
2297ee3138f1Smrg  need_lib_prefix=no
2298ee3138f1Smrg  need_version=no
2299ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2300ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2301ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
2302ee3138f1Smrg  ;;
2303ee3138f1Smrg
2304ee3138f1Smrgfreebsd1*)
2305ee3138f1Smrg  dynamic_linker=no
2306ee3138f1Smrg  ;;
2307ee3138f1Smrg
2308ee3138f1Smrgfreebsd* | dragonfly*)
2309ee3138f1Smrg  # DragonFly does not have aout.  When/if they implement a new
2310ee3138f1Smrg  # versioning mechanism, adjust this.
2311ee3138f1Smrg  if test -x /usr/bin/objformat; then
2312ee3138f1Smrg    objformat=`/usr/bin/objformat`
2313ee3138f1Smrg  else
2314ee3138f1Smrg    case $host_os in
2315ee3138f1Smrg    freebsd[[123]]*) objformat=aout ;;
2316ee3138f1Smrg    *) objformat=elf ;;
2317ee3138f1Smrg    esac
2318ee3138f1Smrg  fi
2319ee3138f1Smrg  version_type=freebsd-$objformat
2320ee3138f1Smrg  case $version_type in
2321ee3138f1Smrg    freebsd-elf*)
2322ee3138f1Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2323ee3138f1Smrg      need_version=no
2324ee3138f1Smrg      need_lib_prefix=no
2325ee3138f1Smrg      ;;
2326ee3138f1Smrg    freebsd-*)
2327ee3138f1Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2328ee3138f1Smrg      need_version=yes
2329ee3138f1Smrg      ;;
2330ee3138f1Smrg  esac
2331ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
2332ee3138f1Smrg  case $host_os in
2333ee3138f1Smrg  freebsd2*)
2334ee3138f1Smrg    shlibpath_overrides_runpath=yes
2335ee3138f1Smrg    ;;
2336ee3138f1Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2337ee3138f1Smrg    shlibpath_overrides_runpath=yes
2338ee3138f1Smrg    hardcode_into_libs=yes
2339ee3138f1Smrg    ;;
2340ee3138f1Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2341ee3138f1Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2342ee3138f1Smrg    shlibpath_overrides_runpath=no
2343ee3138f1Smrg    hardcode_into_libs=yes
2344ee3138f1Smrg    ;;
2345ee3138f1Smrg  *) # from 4.6 on, and DragonFly
2346ee3138f1Smrg    shlibpath_overrides_runpath=yes
2347ee3138f1Smrg    hardcode_into_libs=yes
2348ee3138f1Smrg    ;;
2349ee3138f1Smrg  esac
2350ee3138f1Smrg  ;;
2351ee3138f1Smrg
2352ee3138f1Smrggnu*)
2353ee3138f1Smrg  version_type=linux
2354ee3138f1Smrg  need_lib_prefix=no
2355ee3138f1Smrg  need_version=no
2356ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2357ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2358ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
2359ee3138f1Smrg  hardcode_into_libs=yes
2360ee3138f1Smrg  ;;
2361ee3138f1Smrg
2362ee3138f1Smrghpux9* | hpux10* | hpux11*)
2363ee3138f1Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
2364ee3138f1Smrg  # link against other versions.
2365ee3138f1Smrg  version_type=sunos
2366ee3138f1Smrg  need_lib_prefix=no
2367ee3138f1Smrg  need_version=no
2368ee3138f1Smrg  case $host_cpu in
2369ee3138f1Smrg  ia64*)
2370ee3138f1Smrg    shrext_cmds='.so'
2371ee3138f1Smrg    hardcode_into_libs=yes
2372ee3138f1Smrg    dynamic_linker="$host_os dld.so"
2373ee3138f1Smrg    shlibpath_var=LD_LIBRARY_PATH
2374ee3138f1Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2375ee3138f1Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2376ee3138f1Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2377ee3138f1Smrg    if test "X$HPUX_IA64_MODE" = X32; then
2378ee3138f1Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2379ee3138f1Smrg    else
2380ee3138f1Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2381ee3138f1Smrg    fi
2382ee3138f1Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2383ee3138f1Smrg    ;;
238434977a2fSmrg  hppa*64*)
238534977a2fSmrg    shrext_cmds='.sl'
238634977a2fSmrg    hardcode_into_libs=yes
238734977a2fSmrg    dynamic_linker="$host_os dld.sl"
238834977a2fSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
238934977a2fSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
239034977a2fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
239134977a2fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
239234977a2fSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
239334977a2fSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
239434977a2fSmrg    ;;
239534977a2fSmrg  *)
2396ee3138f1Smrg    shrext_cmds='.sl'
2397ee3138f1Smrg    dynamic_linker="$host_os dld.sl"
2398ee3138f1Smrg    shlibpath_var=SHLIB_PATH
2399ee3138f1Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2400ee3138f1Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2401ee3138f1Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2402ee3138f1Smrg    ;;
2403ee3138f1Smrg  esac
2404ee3138f1Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555.
2405ee3138f1Smrg  postinstall_cmds='chmod 555 $lib'
2406ee3138f1Smrg  ;;
2407ee3138f1Smrg
2408ee3138f1Smrginterix[[3-9]]*)
2409ee3138f1Smrg  version_type=linux
2410ee3138f1Smrg  need_lib_prefix=no
2411ee3138f1Smrg  need_version=no
2412ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2413ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2414ee3138f1Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2415ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
2416ee3138f1Smrg  shlibpath_overrides_runpath=no
2417ee3138f1Smrg  hardcode_into_libs=yes
2418ee3138f1Smrg  ;;
2419ee3138f1Smrg
2420ee3138f1Smrgirix5* | irix6* | nonstopux*)
2421ee3138f1Smrg  case $host_os in
2422ee3138f1Smrg    nonstopux*) version_type=nonstopux ;;
2423ee3138f1Smrg    *)
2424ee3138f1Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
2425ee3138f1Smrg		version_type=linux
2426ee3138f1Smrg	else
2427ee3138f1Smrg		version_type=irix
2428ee3138f1Smrg	fi ;;
2429ee3138f1Smrg  esac
2430ee3138f1Smrg  need_lib_prefix=no
2431ee3138f1Smrg  need_version=no
2432ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2433ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2434ee3138f1Smrg  case $host_os in
2435ee3138f1Smrg  irix5* | nonstopux*)
2436ee3138f1Smrg    libsuff= shlibsuff=
2437ee3138f1Smrg    ;;
2438ee3138f1Smrg  *)
2439ee3138f1Smrg    case $LD in # libtool.m4 will add one of these switches to LD
2440ee3138f1Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2441ee3138f1Smrg      libsuff= shlibsuff= libmagic=32-bit;;
2442ee3138f1Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2443ee3138f1Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
2444ee3138f1Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2445ee3138f1Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2446ee3138f1Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
2447ee3138f1Smrg    esac
2448ee3138f1Smrg    ;;
2449ee3138f1Smrg  esac
2450ee3138f1Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2451ee3138f1Smrg  shlibpath_overrides_runpath=no
2452ee3138f1Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2453ee3138f1Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2454ee3138f1Smrg  hardcode_into_libs=yes
2455ee3138f1Smrg  ;;
2456ee3138f1Smrg
2457ee3138f1Smrg# No shared lib support for Linux oldld, aout, or coff.
2458ee3138f1Smrglinux*oldld* | linux*aout* | linux*coff*)
2459ee3138f1Smrg  dynamic_linker=no
2460ee3138f1Smrg  ;;
2461ee3138f1Smrg
2462ee3138f1Smrg# This must be Linux ELF.
2463ee3138f1Smrglinux* | k*bsd*-gnu)
2464ee3138f1Smrg  version_type=linux
2465ee3138f1Smrg  need_lib_prefix=no
2466ee3138f1Smrg  need_version=no
2467ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2468ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2469ee3138f1Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2470ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
2471ee3138f1Smrg  shlibpath_overrides_runpath=no
247234977a2fSmrg  # Some binutils ld are patched to set DT_RUNPATH
247334977a2fSmrg  save_LDFLAGS=$LDFLAGS
247434977a2fSmrg  save_libdir=$libdir
247534977a2fSmrg  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
247634977a2fSmrg       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
247734977a2fSmrg  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
247834977a2fSmrg    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
247934977a2fSmrg       [shlibpath_overrides_runpath=yes])])
248034977a2fSmrg  LDFLAGS=$save_LDFLAGS
248134977a2fSmrg  libdir=$save_libdir
248234977a2fSmrg
2483ee3138f1Smrg  # This implies no fast_install, which is unacceptable.
2484ee3138f1Smrg  # Some rework will be needed to allow for fast_install
2485ee3138f1Smrg  # before this can be enabled.
2486ee3138f1Smrg  hardcode_into_libs=yes
248779a8a9c6Smrg
248834977a2fSmrg  # Add ABI-specific directories to the system library path.
248934977a2fSmrg  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
2490ee3138f1Smrg
2491ee3138f1Smrg  # Append ld.so.conf contents to the search path
2492ee3138f1Smrg  if test -f /etc/ld.so.conf; then
249334977a2fSmrg    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' ' '`
2494ee3138f1Smrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
2495ee3138f1Smrg  fi
2496ee3138f1Smrg
2497ee3138f1Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2498ee3138f1Smrg  # powerpc, because MkLinux only supported shared libraries with the
2499ee3138f1Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2500ee3138f1Smrg  # most powerpc-linux boxes support dynamic linking these days and
2501ee3138f1Smrg  # people can always --disable-shared, the test was removed, and we
2502ee3138f1Smrg  # assume the GNU/Linux dynamic linker is in use.
2503ee3138f1Smrg  dynamic_linker='GNU/Linux ld.so'
2504ee3138f1Smrg  ;;
2505ee3138f1Smrg
2506ee3138f1Smrgnetbsd*)
2507ee3138f1Smrg  version_type=sunos
2508ee3138f1Smrg  need_lib_prefix=no
2509ee3138f1Smrg  need_version=no
251034977a2fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2511ee3138f1Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2512ee3138f1Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2513ee3138f1Smrg    dynamic_linker='NetBSD (a.out) ld.so'
2514ee3138f1Smrg  else
2515ee3138f1Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2516ee3138f1Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2517ee3138f1Smrg    dynamic_linker='NetBSD ld.elf_so'
2518ee3138f1Smrg  fi
2519ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
2520ee3138f1Smrg  shlibpath_overrides_runpath=yes
2521ee3138f1Smrg  hardcode_into_libs=yes
2522ee3138f1Smrg  ;;
2523ee3138f1Smrg
2524ee3138f1Smrgnewsos6)
2525ee3138f1Smrg  version_type=linux
2526ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2527ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
2528ee3138f1Smrg  shlibpath_overrides_runpath=yes
2529ee3138f1Smrg  ;;
2530ee3138f1Smrg
253134977a2fSmrg*nto* | *qnx*)
253234977a2fSmrg  version_type=qnx
2533ee3138f1Smrg  need_lib_prefix=no
2534ee3138f1Smrg  need_version=no
2535ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2536ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2537ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
253834977a2fSmrg  shlibpath_overrides_runpath=no
253934977a2fSmrg  hardcode_into_libs=yes
254034977a2fSmrg  dynamic_linker='ldqnx.so'
2541ee3138f1Smrg  ;;
2542ee3138f1Smrg
2543ee3138f1Smrgopenbsd*)
2544ee3138f1Smrg  version_type=sunos
2545ee3138f1Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
2546ee3138f1Smrg  need_lib_prefix=no
2547ee3138f1Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2548ee3138f1Smrg  case $host_os in
254934977a2fSmrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
255034977a2fSmrg    *)				need_version=no  ;;
2551ee3138f1Smrg  esac
2552ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2553ee3138f1Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2554ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
255534977a2fSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2556ee3138f1Smrg    case $host_os in
2557ee3138f1Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
2558ee3138f1Smrg	shlibpath_overrides_runpath=no
2559ee3138f1Smrg	;;
2560ee3138f1Smrg      *)
2561ee3138f1Smrg	shlibpath_overrides_runpath=yes
2562ee3138f1Smrg	;;
2563ee3138f1Smrg      esac
2564ee3138f1Smrg  else
2565ee3138f1Smrg    shlibpath_overrides_runpath=yes
2566ee3138f1Smrg  fi
2567ee3138f1Smrg  ;;
2568ee3138f1Smrg
2569ee3138f1Smrgos2*)
2570ee3138f1Smrg  libname_spec='$name'
2571ee3138f1Smrg  shrext_cmds=".dll"
2572ee3138f1Smrg  need_lib_prefix=no
2573ee3138f1Smrg  library_names_spec='$libname${shared_ext} $libname.a'
2574ee3138f1Smrg  dynamic_linker='OS/2 ld.exe'
2575ee3138f1Smrg  shlibpath_var=LIBPATH
2576ee3138f1Smrg  ;;
2577ee3138f1Smrg
2578ee3138f1Smrgosf3* | osf4* | osf5*)
2579ee3138f1Smrg  version_type=osf
2580ee3138f1Smrg  need_lib_prefix=no
2581ee3138f1Smrg  need_version=no
2582ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2583ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2584ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
2585ee3138f1Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2586ee3138f1Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2587ee3138f1Smrg  ;;
2588ee3138f1Smrg
2589ee3138f1Smrgrdos*)
2590ee3138f1Smrg  dynamic_linker=no
2591ee3138f1Smrg  ;;
2592ee3138f1Smrg
2593ee3138f1Smrgsolaris*)
2594ee3138f1Smrg  version_type=linux
2595ee3138f1Smrg  need_lib_prefix=no
2596ee3138f1Smrg  need_version=no
2597ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2598ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2599ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
2600ee3138f1Smrg  shlibpath_overrides_runpath=yes
2601ee3138f1Smrg  hardcode_into_libs=yes
2602ee3138f1Smrg  # ldd complains unless libraries are executable
2603ee3138f1Smrg  postinstall_cmds='chmod +x $lib'
2604ee3138f1Smrg  ;;
2605ee3138f1Smrg
2606ee3138f1Smrgsunos4*)
2607ee3138f1Smrg  version_type=sunos
2608ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2609ee3138f1Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2610ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
2611ee3138f1Smrg  shlibpath_overrides_runpath=yes
2612ee3138f1Smrg  if test "$with_gnu_ld" = yes; then
2613ee3138f1Smrg    need_lib_prefix=no
2614ee3138f1Smrg  fi
2615ee3138f1Smrg  need_version=yes
2616ee3138f1Smrg  ;;
2617ee3138f1Smrg
2618ee3138f1Smrgsysv4 | sysv4.3*)
2619ee3138f1Smrg  version_type=linux
2620ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2621ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2622ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
2623ee3138f1Smrg  case $host_vendor in
2624ee3138f1Smrg    sni)
2625ee3138f1Smrg      shlibpath_overrides_runpath=no
2626ee3138f1Smrg      need_lib_prefix=no
2627ee3138f1Smrg      runpath_var=LD_RUN_PATH
2628ee3138f1Smrg      ;;
2629ee3138f1Smrg    siemens)
2630ee3138f1Smrg      need_lib_prefix=no
2631ee3138f1Smrg      ;;
2632ee3138f1Smrg    motorola)
2633ee3138f1Smrg      need_lib_prefix=no
2634ee3138f1Smrg      need_version=no
2635ee3138f1Smrg      shlibpath_overrides_runpath=no
2636ee3138f1Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2637ee3138f1Smrg      ;;
2638ee3138f1Smrg  esac
2639ee3138f1Smrg  ;;
2640ee3138f1Smrg
2641ee3138f1Smrgsysv4*MP*)
2642ee3138f1Smrg  if test -d /usr/nec ;then
2643ee3138f1Smrg    version_type=linux
2644ee3138f1Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2645ee3138f1Smrg    soname_spec='$libname${shared_ext}.$major'
2646ee3138f1Smrg    shlibpath_var=LD_LIBRARY_PATH
2647ee3138f1Smrg  fi
2648ee3138f1Smrg  ;;
2649ee3138f1Smrg
2650ee3138f1Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2651ee3138f1Smrg  version_type=freebsd-elf
2652ee3138f1Smrg  need_lib_prefix=no
2653ee3138f1Smrg  need_version=no
2654ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2655ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2656ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
265734977a2fSmrg  shlibpath_overrides_runpath=yes
2658ee3138f1Smrg  hardcode_into_libs=yes
2659ee3138f1Smrg  if test "$with_gnu_ld" = yes; then
2660ee3138f1Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2661ee3138f1Smrg  else
2662ee3138f1Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2663ee3138f1Smrg    case $host_os in
2664ee3138f1Smrg      sco3.2v5*)
2665ee3138f1Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2666ee3138f1Smrg	;;
2667ee3138f1Smrg    esac
2668ee3138f1Smrg  fi
2669ee3138f1Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
2670ee3138f1Smrg  ;;
2671ee3138f1Smrg
267234977a2fSmrgtpf*)
267334977a2fSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
267434977a2fSmrg  version_type=linux
267534977a2fSmrg  need_lib_prefix=no
267634977a2fSmrg  need_version=no
267734977a2fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
267834977a2fSmrg  shlibpath_var=LD_LIBRARY_PATH
267934977a2fSmrg  shlibpath_overrides_runpath=no
268034977a2fSmrg  hardcode_into_libs=yes
268134977a2fSmrg  ;;
268234977a2fSmrg
2683ee3138f1Smrguts4*)
2684ee3138f1Smrg  version_type=linux
2685ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2686ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2687ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
2688ee3138f1Smrg  ;;
2689ee3138f1Smrg
2690ee3138f1Smrg*)
2691ee3138f1Smrg  dynamic_linker=no
2692ee3138f1Smrg  ;;
2693ee3138f1Smrgesac
2694ee3138f1SmrgAC_MSG_RESULT([$dynamic_linker])
2695ee3138f1Smrgtest "$dynamic_linker" = no && can_build_shared=no
2696ee3138f1Smrg
2697ee3138f1Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2698ee3138f1Smrgif test "$GCC" = yes; then
2699ee3138f1Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2700ee3138f1Smrgfi
2701ee3138f1Smrg
270234977a2fSmrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
270334977a2fSmrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
270434977a2fSmrgfi
270534977a2fSmrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
270634977a2fSmrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2707ee3138f1Smrgfi
2708ee3138f1Smrg
270934977a2fSmrg_LT_DECL([], [variables_saved_for_relink], [1],
271034977a2fSmrg    [Variables whose values should be saved in libtool wrapper scripts and
271134977a2fSmrg    restored at link time])
271234977a2fSmrg_LT_DECL([], [need_lib_prefix], [0],
271334977a2fSmrg    [Do we need the "lib" prefix for modules?])
271434977a2fSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
271534977a2fSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
271634977a2fSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
271734977a2fSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
271834977a2fSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
271934977a2fSmrg    [Is shlibpath searched before the hard-coded library search path?])
272034977a2fSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
272134977a2fSmrg_LT_DECL([], [library_names_spec], [1],
272234977a2fSmrg    [[List of archive names.  First name is the real one, the rest are links.
272334977a2fSmrg    The last name is the one that the linker finds with -lNAME]])
272434977a2fSmrg_LT_DECL([], [soname_spec], [1],
272534977a2fSmrg    [[The coded name of the library, if different from the real name]])
272634977a2fSmrg_LT_DECL([], [postinstall_cmds], [2],
272734977a2fSmrg    [Command to use after installation of a shared archive])
272834977a2fSmrg_LT_DECL([], [postuninstall_cmds], [2],
272934977a2fSmrg    [Command to use after uninstallation of a shared archive])
273034977a2fSmrg_LT_DECL([], [finish_cmds], [2],
273134977a2fSmrg    [Commands used to finish a libtool library installation in a directory])
273234977a2fSmrg_LT_DECL([], [finish_eval], [1],
273334977a2fSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
273434977a2fSmrg    not shown]])
273534977a2fSmrg_LT_DECL([], [hardcode_into_libs], [0],
273634977a2fSmrg    [Whether we should hardcode library paths into libraries])
273734977a2fSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
273834977a2fSmrg    [Compile-time system search path for libraries])
273934977a2fSmrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
274034977a2fSmrg    [Run-time system search path for libraries])
274134977a2fSmrg])# _LT_SYS_DYNAMIC_LINKER
274234977a2fSmrg
274334977a2fSmrg
274434977a2fSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
2745ee3138f1Smrg# --------------------------
2746ee3138f1Smrg# find a file program which can recognize shared library
274734977a2fSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
274834977a2fSmrg[m4_require([_LT_DECL_EGREP])dnl
2749ee3138f1SmrgAC_MSG_CHECKING([for $1])
2750ee3138f1SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2751ee3138f1Smrg[case $MAGIC_CMD in
2752ee3138f1Smrg[[\\/*] |  ?:[\\/]*])
2753ee3138f1Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2754ee3138f1Smrg  ;;
2755ee3138f1Smrg*)
2756ee3138f1Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
2757ee3138f1Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2758ee3138f1Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
2759ee3138f1Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
2760ee3138f1Smrgdnl not every word.  This closes a longstanding sh security hole.
276134977a2fSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
2762ee3138f1Smrg  for ac_dir in $ac_dummy; do
2763ee3138f1Smrg    IFS="$lt_save_ifs"
2764ee3138f1Smrg    test -z "$ac_dir" && ac_dir=.
2765ee3138f1Smrg    if test -f $ac_dir/$1; then
2766ee3138f1Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2767ee3138f1Smrg      if test -n "$file_magic_test_file"; then
2768ee3138f1Smrg	case $deplibs_check_method in
2769ee3138f1Smrg	"file_magic "*)
2770ee3138f1Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2771ee3138f1Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2772ee3138f1Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2773ee3138f1Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
2774ee3138f1Smrg	    :
2775ee3138f1Smrg	  else
277634977a2fSmrg	    cat <<_LT_EOF 1>&2
2777ee3138f1Smrg
2778ee3138f1Smrg*** Warning: the command libtool uses to detect shared libraries,
2779ee3138f1Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
2780ee3138f1Smrg*** The result is that libtool may fail to recognize shared libraries
2781ee3138f1Smrg*** as such.  This will affect the creation of libtool libraries that
2782ee3138f1Smrg*** depend on shared libraries, but programs linked with such libtool
2783ee3138f1Smrg*** libraries will work regardless of this problem.  Nevertheless, you
2784ee3138f1Smrg*** may want to report the problem to your system manager and/or to
2785ee3138f1Smrg*** bug-libtool@gnu.org
2786ee3138f1Smrg
278734977a2fSmrg_LT_EOF
2788ee3138f1Smrg	  fi ;;
2789ee3138f1Smrg	esac
2790ee3138f1Smrg      fi
2791ee3138f1Smrg      break
2792ee3138f1Smrg    fi
2793ee3138f1Smrg  done
2794ee3138f1Smrg  IFS="$lt_save_ifs"
2795ee3138f1Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
2796ee3138f1Smrg  ;;
2797ee3138f1Smrgesac])
2798ee3138f1SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2799ee3138f1Smrgif test -n "$MAGIC_CMD"; then
2800ee3138f1Smrg  AC_MSG_RESULT($MAGIC_CMD)
2801ee3138f1Smrgelse
2802ee3138f1Smrg  AC_MSG_RESULT(no)
2803ee3138f1Smrgfi
280434977a2fSmrg_LT_DECL([], [MAGIC_CMD], [0],
280534977a2fSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
280634977a2fSmrg])# _LT_PATH_TOOL_PREFIX
2807ee3138f1Smrg
280834977a2fSmrg# Old name:
280934977a2fSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
281034977a2fSmrgdnl aclocal-1.4 backwards compatibility:
281134977a2fSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
2812ee3138f1Smrg
281334977a2fSmrg
281434977a2fSmrg# _LT_PATH_MAGIC
281534977a2fSmrg# --------------
2816ee3138f1Smrg# find a file program which can recognize a shared library
281734977a2fSmrgm4_defun([_LT_PATH_MAGIC],
281834977a2fSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
2819ee3138f1Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
2820ee3138f1Smrg  if test -n "$ac_tool_prefix"; then
282134977a2fSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
2822ee3138f1Smrg  else
2823ee3138f1Smrg    MAGIC_CMD=:
2824ee3138f1Smrg  fi
2825ee3138f1Smrgfi
282634977a2fSmrg])# _LT_PATH_MAGIC
2827ee3138f1Smrg
2828ee3138f1Smrg
282934977a2fSmrg# LT_PATH_LD
2830ee3138f1Smrg# ----------
2831ee3138f1Smrg# find the pathname to the GNU or non-GNU linker
283234977a2fSmrgAC_DEFUN([LT_PATH_LD],
283334977a2fSmrg[AC_REQUIRE([AC_PROG_CC])dnl
2834ee3138f1SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
2835ee3138f1SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
283634977a2fSmrgm4_require([_LT_DECL_SED])dnl
283734977a2fSmrgm4_require([_LT_DECL_EGREP])dnl
283834977a2fSmrg
283934977a2fSmrgAC_ARG_WITH([gnu-ld],
284034977a2fSmrg    [AS_HELP_STRING([--with-gnu-ld],
284134977a2fSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
284234977a2fSmrg    [test "$withval" = no || with_gnu_ld=yes],
284334977a2fSmrg    [with_gnu_ld=no])dnl
284434977a2fSmrg
2845ee3138f1Smrgac_prog=ld
2846ee3138f1Smrgif test "$GCC" = yes; then
2847ee3138f1Smrg  # Check if gcc -print-prog-name=ld gives a path.
2848ee3138f1Smrg  AC_MSG_CHECKING([for ld used by $CC])
2849ee3138f1Smrg  case $host in
2850ee3138f1Smrg  *-*-mingw*)
2851ee3138f1Smrg    # gcc leaves a trailing carriage return which upsets mingw
2852ee3138f1Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2853ee3138f1Smrg  *)
2854ee3138f1Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2855ee3138f1Smrg  esac
2856ee3138f1Smrg  case $ac_prog in
2857ee3138f1Smrg    # Accept absolute paths.
2858ee3138f1Smrg    [[\\/]]* | ?:[[\\/]]*)
2859ee3138f1Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
2860ee3138f1Smrg      # Canonicalize the pathname of ld
286134977a2fSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
286234977a2fSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
286334977a2fSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
2864ee3138f1Smrg      done
2865ee3138f1Smrg      test -z "$LD" && LD="$ac_prog"
2866ee3138f1Smrg      ;;
2867ee3138f1Smrg  "")
2868ee3138f1Smrg    # If it fails, then pretend we aren't using GCC.
2869ee3138f1Smrg    ac_prog=ld
2870ee3138f1Smrg    ;;
2871ee3138f1Smrg  *)
2872ee3138f1Smrg    # If it is relative, then search for the first ld in PATH.
2873ee3138f1Smrg    with_gnu_ld=unknown
2874ee3138f1Smrg    ;;
2875ee3138f1Smrg  esac
2876ee3138f1Smrgelif test "$with_gnu_ld" = yes; then
2877ee3138f1Smrg  AC_MSG_CHECKING([for GNU ld])
2878ee3138f1Smrgelse
2879ee3138f1Smrg  AC_MSG_CHECKING([for non-GNU ld])
2880ee3138f1Smrgfi
2881ee3138f1SmrgAC_CACHE_VAL(lt_cv_path_LD,
2882ee3138f1Smrg[if test -z "$LD"; then
2883ee3138f1Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2884ee3138f1Smrg  for ac_dir in $PATH; do
2885ee3138f1Smrg    IFS="$lt_save_ifs"
2886ee3138f1Smrg    test -z "$ac_dir" && ac_dir=.
2887ee3138f1Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2888ee3138f1Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
2889ee3138f1Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
2890ee3138f1Smrg      # but apparently some variants of GNU ld only accept -v.
2891ee3138f1Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
2892ee3138f1Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
2893ee3138f1Smrg      *GNU* | *'with BFD'*)
2894ee3138f1Smrg	test "$with_gnu_ld" != no && break
2895ee3138f1Smrg	;;
2896ee3138f1Smrg      *)
2897ee3138f1Smrg	test "$with_gnu_ld" != yes && break
2898ee3138f1Smrg	;;
2899ee3138f1Smrg      esac
2900ee3138f1Smrg    fi
2901ee3138f1Smrg  done
2902ee3138f1Smrg  IFS="$lt_save_ifs"
2903ee3138f1Smrgelse
2904ee3138f1Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
2905ee3138f1Smrgfi])
2906ee3138f1SmrgLD="$lt_cv_path_LD"
2907ee3138f1Smrgif test -n "$LD"; then
2908ee3138f1Smrg  AC_MSG_RESULT($LD)
2909ee3138f1Smrgelse
2910ee3138f1Smrg  AC_MSG_RESULT(no)
2911ee3138f1Smrgfi
2912ee3138f1Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
291334977a2fSmrg_LT_PATH_LD_GNU
291434977a2fSmrgAC_SUBST([LD])
2915ee3138f1Smrg
291634977a2fSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
291734977a2fSmrg])# LT_PATH_LD
2918ee3138f1Smrg
291934977a2fSmrg# Old names:
292034977a2fSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
292134977a2fSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
292234977a2fSmrgdnl aclocal-1.4 backwards compatibility:
292334977a2fSmrgdnl AC_DEFUN([AM_PROG_LD], [])
292434977a2fSmrgdnl AC_DEFUN([AC_PROG_LD], [])
292534977a2fSmrg
292634977a2fSmrg
292734977a2fSmrg# _LT_PATH_LD_GNU
292834977a2fSmrg#- --------------
292934977a2fSmrgm4_defun([_LT_PATH_LD_GNU],
293034977a2fSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
2931ee3138f1Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
2932ee3138f1Smrgcase `$LD -v 2>&1 </dev/null` in
2933ee3138f1Smrg*GNU* | *'with BFD'*)
2934ee3138f1Smrg  lt_cv_prog_gnu_ld=yes
2935ee3138f1Smrg  ;;
2936ee3138f1Smrg*)
2937ee3138f1Smrg  lt_cv_prog_gnu_ld=no
2938ee3138f1Smrg  ;;
2939ee3138f1Smrgesac])
2940ee3138f1Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
294134977a2fSmrg])# _LT_PATH_LD_GNU
2942ee3138f1Smrg
2943ee3138f1Smrg
294434977a2fSmrg# _LT_CMD_RELOAD
294534977a2fSmrg# --------------
2946ee3138f1Smrg# find reload flag for linker
2947ee3138f1Smrg#   -- PORTME Some linkers may need a different reload flag.
294834977a2fSmrgm4_defun([_LT_CMD_RELOAD],
2949ee3138f1Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
2950ee3138f1Smrg  lt_cv_ld_reload_flag,
2951ee3138f1Smrg  [lt_cv_ld_reload_flag='-r'])
2952ee3138f1Smrgreload_flag=$lt_cv_ld_reload_flag
2953ee3138f1Smrgcase $reload_flag in
2954ee3138f1Smrg"" | " "*) ;;
2955ee3138f1Smrg*) reload_flag=" $reload_flag" ;;
2956ee3138f1Smrgesac
2957ee3138f1Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
2958ee3138f1Smrgcase $host_os in
2959ee3138f1Smrg  darwin*)
2960ee3138f1Smrg    if test "$GCC" = yes; then
2961ee3138f1Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
2962ee3138f1Smrg    else
2963ee3138f1Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
2964ee3138f1Smrg    fi
2965ee3138f1Smrg    ;;
2966ee3138f1Smrgesac
296734977a2fSmrg_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
296834977a2fSmrg_LT_DECL([], [reload_cmds], [2])dnl
296934977a2fSmrg])# _LT_CMD_RELOAD
2970ee3138f1Smrg
2971ee3138f1Smrg
297234977a2fSmrg# _LT_CHECK_MAGIC_METHOD
297334977a2fSmrg# ----------------------
2974ee3138f1Smrg# how to check for library dependencies
2975ee3138f1Smrg#  -- PORTME fill in with the dynamic library characteristics
297634977a2fSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
297734977a2fSmrg[m4_require([_LT_DECL_EGREP])
297834977a2fSmrgm4_require([_LT_DECL_OBJDUMP])
297934977a2fSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
2980ee3138f1Smrglt_cv_deplibs_check_method,
2981ee3138f1Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
2982ee3138f1Smrglt_cv_file_magic_test_file=
2983ee3138f1Smrglt_cv_deplibs_check_method='unknown'
2984ee3138f1Smrg# Need to set the preceding variable on all platforms that support
2985ee3138f1Smrg# interlibrary dependencies.
2986ee3138f1Smrg# 'none' -- dependencies not supported.
2987ee3138f1Smrg# `unknown' -- same as none, but documents that we really don't know.
2988ee3138f1Smrg# 'pass_all' -- all dependencies passed with no checks.
2989ee3138f1Smrg# 'test_compile' -- check by making test program.
2990ee3138f1Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
2991ee3138f1Smrg# which responds to the $file_magic_cmd with a given extended regex.
2992ee3138f1Smrg# If you have `file' or equivalent on your system and you're not sure
2993ee3138f1Smrg# whether `pass_all' will *always* work, you probably want this one.
2994ee3138f1Smrg
2995ee3138f1Smrgcase $host_os in
299679a8a9c6Smrgaix[[4-9]]*)
2997ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
2998ee3138f1Smrg  ;;
2999ee3138f1Smrg
3000ee3138f1Smrgbeos*)
3001ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
3002ee3138f1Smrg  ;;
3003ee3138f1Smrg
3004ee3138f1Smrgbsdi[[45]]*)
3005ee3138f1Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3006ee3138f1Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
3007ee3138f1Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
3008ee3138f1Smrg  ;;
3009ee3138f1Smrg
3010ee3138f1Smrgcygwin*)
3011ee3138f1Smrg  # func_win32_libid is a shell function defined in ltmain.sh
3012ee3138f1Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3013ee3138f1Smrg  lt_cv_file_magic_cmd='func_win32_libid'
3014ee3138f1Smrg  ;;
3015ee3138f1Smrg
3016ee3138f1Smrgmingw* | pw32*)
3017ee3138f1Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
3018ee3138f1Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3019ee3138f1Smrg  # unless we find 'file', for example because we are cross-compiling.
3020ee3138f1Smrg  if ( file / ) >/dev/null 2>&1; then
3021ee3138f1Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3022ee3138f1Smrg    lt_cv_file_magic_cmd='func_win32_libid'
3023ee3138f1Smrg  else
3024ee3138f1Smrg    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3025ee3138f1Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
3026ee3138f1Smrg  fi
3027ee3138f1Smrg  ;;
3028ee3138f1Smrg
302934977a2fSmrgcegcc)
303034977a2fSmrg  # use the weaker test based on 'objdump'. See mingw*.
303134977a2fSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
303234977a2fSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
303334977a2fSmrg  ;;
303434977a2fSmrg
3035ee3138f1Smrgdarwin* | rhapsody*)
3036ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
3037ee3138f1Smrg  ;;
3038ee3138f1Smrg
3039ee3138f1Smrgfreebsd* | dragonfly*)
304034977a2fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3041ee3138f1Smrg    case $host_cpu in
3042ee3138f1Smrg    i*86 )
3043ee3138f1Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
3044ee3138f1Smrg      # Let's accept both of them until this is cleared up.
3045ee3138f1Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3046ee3138f1Smrg      lt_cv_file_magic_cmd=/usr/bin/file
3047ee3138f1Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3048ee3138f1Smrg      ;;
3049ee3138f1Smrg    esac
3050ee3138f1Smrg  else
3051ee3138f1Smrg    lt_cv_deplibs_check_method=pass_all
3052ee3138f1Smrg  fi
3053ee3138f1Smrg  ;;
3054ee3138f1Smrg
3055ee3138f1Smrggnu*)
3056ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
3057ee3138f1Smrg  ;;
3058ee3138f1Smrg
3059ee3138f1Smrghpux10.20* | hpux11*)
3060ee3138f1Smrg  lt_cv_file_magic_cmd=/usr/bin/file
3061ee3138f1Smrg  case $host_cpu in
3062ee3138f1Smrg  ia64*)
3063ee3138f1Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3064ee3138f1Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3065ee3138f1Smrg    ;;
3066ee3138f1Smrg  hppa*64*)
3067ee3138f1Smrg    [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]']
3068ee3138f1Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3069ee3138f1Smrg    ;;
3070ee3138f1Smrg  *)
3071ee3138f1Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
3072ee3138f1Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3073ee3138f1Smrg    ;;
3074ee3138f1Smrg  esac
3075ee3138f1Smrg  ;;
3076ee3138f1Smrg
3077ee3138f1Smrginterix[[3-9]]*)
3078ee3138f1Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3079ee3138f1Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3080ee3138f1Smrg  ;;
3081ee3138f1Smrg
3082ee3138f1Smrgirix5* | irix6* | nonstopux*)
3083ee3138f1Smrg  case $LD in
3084ee3138f1Smrg  *-32|*"-32 ") libmagic=32-bit;;
3085ee3138f1Smrg  *-n32|*"-n32 ") libmagic=N32;;
3086ee3138f1Smrg  *-64|*"-64 ") libmagic=64-bit;;
3087ee3138f1Smrg  *) libmagic=never-match;;
3088ee3138f1Smrg  esac
3089ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
3090ee3138f1Smrg  ;;
3091ee3138f1Smrg
3092ee3138f1Smrg# This must be Linux ELF.
3093ee3138f1Smrglinux* | k*bsd*-gnu)
3094ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
3095ee3138f1Smrg  ;;
3096ee3138f1Smrg
3097ee3138f1Smrgnetbsd*)
309834977a2fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3099ee3138f1Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3100ee3138f1Smrg  else
3101ee3138f1Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3102ee3138f1Smrg  fi
3103ee3138f1Smrg  ;;
3104ee3138f1Smrg
3105ee3138f1Smrgnewos6*)
3106ee3138f1Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3107ee3138f1Smrg  lt_cv_file_magic_cmd=/usr/bin/file
3108ee3138f1Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3109ee3138f1Smrg  ;;
3110ee3138f1Smrg
311134977a2fSmrg*nto* | *qnx*)
311234977a2fSmrg  lt_cv_deplibs_check_method=pass_all
3113ee3138f1Smrg  ;;
3114ee3138f1Smrg
3115ee3138f1Smrgopenbsd*)
311634977a2fSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3117ee3138f1Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3118ee3138f1Smrg  else
3119ee3138f1Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3120ee3138f1Smrg  fi
3121ee3138f1Smrg  ;;
3122ee3138f1Smrg
3123ee3138f1Smrgosf3* | osf4* | osf5*)
3124ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
3125ee3138f1Smrg  ;;
3126ee3138f1Smrg
3127ee3138f1Smrgrdos*)
3128ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
3129ee3138f1Smrg  ;;
3130ee3138f1Smrg
3131ee3138f1Smrgsolaris*)
3132ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
3133ee3138f1Smrg  ;;
3134ee3138f1Smrg
313534977a2fSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
313634977a2fSmrg  lt_cv_deplibs_check_method=pass_all
313734977a2fSmrg  ;;
313834977a2fSmrg
3139ee3138f1Smrgsysv4 | sysv4.3*)
3140ee3138f1Smrg  case $host_vendor in
3141ee3138f1Smrg  motorola)
3142ee3138f1Smrg    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]]'
3143ee3138f1Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3144ee3138f1Smrg    ;;
3145ee3138f1Smrg  ncr)
3146ee3138f1Smrg    lt_cv_deplibs_check_method=pass_all
3147ee3138f1Smrg    ;;
3148ee3138f1Smrg  sequent)
3149ee3138f1Smrg    lt_cv_file_magic_cmd='/bin/file'
3150ee3138f1Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3151ee3138f1Smrg    ;;
3152ee3138f1Smrg  sni)
3153ee3138f1Smrg    lt_cv_file_magic_cmd='/bin/file'
3154ee3138f1Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3155ee3138f1Smrg    lt_cv_file_magic_test_file=/lib/libc.so
3156ee3138f1Smrg    ;;
3157ee3138f1Smrg  siemens)
3158ee3138f1Smrg    lt_cv_deplibs_check_method=pass_all
3159ee3138f1Smrg    ;;
3160ee3138f1Smrg  pc)
3161ee3138f1Smrg    lt_cv_deplibs_check_method=pass_all
3162ee3138f1Smrg    ;;
3163ee3138f1Smrg  esac
3164ee3138f1Smrg  ;;
3165ee3138f1Smrg
316634977a2fSmrgtpf*)
3167ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
3168ee3138f1Smrg  ;;
3169ee3138f1Smrgesac
3170ee3138f1Smrg])
3171ee3138f1Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
3172ee3138f1Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
3173ee3138f1Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3174ee3138f1Smrg
317534977a2fSmrg_LT_DECL([], [deplibs_check_method], [1],
317634977a2fSmrg    [Method to check whether dependent libraries are shared objects])
317734977a2fSmrg_LT_DECL([], [file_magic_cmd], [1],
317834977a2fSmrg    [Command to use when deplibs_check_method == "file_magic"])
317934977a2fSmrg])# _LT_CHECK_MAGIC_METHOD
3180ee3138f1Smrg
318134977a2fSmrg
318234977a2fSmrg# LT_PATH_NM
3183ee3138f1Smrg# ----------
318434977a2fSmrg# find the pathname to a BSD- or MS-compatible name lister
318534977a2fSmrgAC_DEFUN([LT_PATH_NM],
318634977a2fSmrg[AC_REQUIRE([AC_PROG_CC])dnl
318734977a2fSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3188ee3138f1Smrg[if test -n "$NM"; then
3189ee3138f1Smrg  # Let the user override the test.
3190ee3138f1Smrg  lt_cv_path_NM="$NM"
3191ee3138f1Smrgelse
3192ee3138f1Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
3193ee3138f1Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3194ee3138f1Smrg    lt_nm_to_check="$lt_nm_to_check nm"
3195ee3138f1Smrg  fi
3196ee3138f1Smrg  for lt_tmp_nm in $lt_nm_to_check; do
3197ee3138f1Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3198ee3138f1Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3199ee3138f1Smrg      IFS="$lt_save_ifs"
3200ee3138f1Smrg      test -z "$ac_dir" && ac_dir=.
3201ee3138f1Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
3202ee3138f1Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3203ee3138f1Smrg	# Check to see if the nm accepts a BSD-compat flag.
3204ee3138f1Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
3205ee3138f1Smrg	#   nm: unknown option "B" ignored
3206ee3138f1Smrg	# Tru64's nm complains that /dev/null is an invalid object file
3207ee3138f1Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3208ee3138f1Smrg	*/dev/null* | *'Invalid file or object type'*)
3209ee3138f1Smrg	  lt_cv_path_NM="$tmp_nm -B"
3210ee3138f1Smrg	  break
3211ee3138f1Smrg	  ;;
3212ee3138f1Smrg	*)
3213ee3138f1Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3214ee3138f1Smrg	  */dev/null*)
3215ee3138f1Smrg	    lt_cv_path_NM="$tmp_nm -p"
3216ee3138f1Smrg	    break
3217ee3138f1Smrg	    ;;
3218ee3138f1Smrg	  *)
3219ee3138f1Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3220ee3138f1Smrg	    continue # so that we can try to find one that supports BSD flags
3221ee3138f1Smrg	    ;;
3222ee3138f1Smrg	  esac
3223ee3138f1Smrg	  ;;
3224ee3138f1Smrg	esac
3225ee3138f1Smrg      fi
3226ee3138f1Smrg    done
3227ee3138f1Smrg    IFS="$lt_save_ifs"
3228ee3138f1Smrg  done
322934977a2fSmrg  : ${lt_cv_path_NM=no}
3230ee3138f1Smrgfi])
323134977a2fSmrgif test "$lt_cv_path_NM" != "no"; then
323234977a2fSmrg  NM="$lt_cv_path_NM"
323334977a2fSmrgelse
323434977a2fSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
323534977a2fSmrg  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
323634977a2fSmrg  AC_SUBST([DUMPBIN])
323734977a2fSmrg  if test "$DUMPBIN" != ":"; then
323834977a2fSmrg    NM="$DUMPBIN"
323934977a2fSmrg  fi
324034977a2fSmrgfi
324134977a2fSmrgtest -z "$NM" && NM=nm
324234977a2fSmrgAC_SUBST([NM])
324334977a2fSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
324434977a2fSmrg
324534977a2fSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
324634977a2fSmrg  [lt_cv_nm_interface="BSD nm"
324734977a2fSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
324834977a2fSmrg  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
324934977a2fSmrg  (eval "$ac_compile" 2>conftest.err)
325034977a2fSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
325134977a2fSmrg  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
325234977a2fSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
325334977a2fSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
325434977a2fSmrg  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
325534977a2fSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
325634977a2fSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
325734977a2fSmrg    lt_cv_nm_interface="MS dumpbin"
325834977a2fSmrg  fi
325934977a2fSmrg  rm -f conftest*])
326034977a2fSmrg])# LT_PATH_NM
3261ee3138f1Smrg
326234977a2fSmrg# Old names:
326334977a2fSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
326434977a2fSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
326534977a2fSmrgdnl aclocal-1.4 backwards compatibility:
326634977a2fSmrgdnl AC_DEFUN([AM_PROG_NM], [])
326734977a2fSmrgdnl AC_DEFUN([AC_PROG_NM], [])
3268ee3138f1Smrg
326934977a2fSmrg
327034977a2fSmrg# LT_LIB_M
327134977a2fSmrg# --------
3272ee3138f1Smrg# check for math library
327334977a2fSmrgAC_DEFUN([LT_LIB_M],
3274ee3138f1Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3275ee3138f1SmrgLIBM=
3276ee3138f1Smrgcase $host in
3277ee3138f1Smrg*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
3278ee3138f1Smrg  # These system don't have libm, or don't need it
3279ee3138f1Smrg  ;;
3280ee3138f1Smrg*-ncr-sysv4.3*)
3281ee3138f1Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3282ee3138f1Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3283ee3138f1Smrg  ;;
3284ee3138f1Smrg*)
3285ee3138f1Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
3286ee3138f1Smrg  ;;
3287ee3138f1Smrgesac
328834977a2fSmrgAC_SUBST([LIBM])
328934977a2fSmrg])# LT_LIB_M
3290ee3138f1Smrg
329134977a2fSmrg# Old name:
329234977a2fSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
329334977a2fSmrgdnl aclocal-1.4 backwards compatibility:
329434977a2fSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3295ee3138f1Smrg
3296ee3138f1Smrg
329734977a2fSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
329834977a2fSmrg# -------------------------------
329934977a2fSmrgm4_defun([_LT_COMPILER_NO_RTTI],
330034977a2fSmrg[m4_require([_LT_TAG_COMPILER])dnl
3301ee3138f1Smrg
330234977a2fSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3303ee3138f1Smrg
330434977a2fSmrgif test "$GCC" = yes; then
330534977a2fSmrg  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
3306ee3138f1Smrg
330734977a2fSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
330834977a2fSmrg    lt_cv_prog_compiler_rtti_exceptions,
330934977a2fSmrg    [-fno-rtti -fno-exceptions], [],
331034977a2fSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
331134977a2fSmrgfi
331234977a2fSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
331334977a2fSmrg	[Compiler flag to turn off builtin functions])
331434977a2fSmrg])# _LT_COMPILER_NO_RTTI
3315ee3138f1Smrg
3316ee3138f1Smrg
331734977a2fSmrg# _LT_CMD_GLOBAL_SYMBOLS
331834977a2fSmrg# ----------------------
331934977a2fSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
332034977a2fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
332134977a2fSmrgAC_REQUIRE([AC_PROG_CC])dnl
332234977a2fSmrgAC_REQUIRE([LT_PATH_NM])dnl
332334977a2fSmrgAC_REQUIRE([LT_PATH_LD])dnl
332434977a2fSmrgm4_require([_LT_DECL_SED])dnl
332534977a2fSmrgm4_require([_LT_DECL_EGREP])dnl
332634977a2fSmrgm4_require([_LT_TAG_COMPILER])dnl
3327ee3138f1Smrg
332834977a2fSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
332934977a2fSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
333034977a2fSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3331ee3138f1Smrg[
333234977a2fSmrg# These are sane defaults that work on at least a few old systems.
333334977a2fSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3334ee3138f1Smrg
333534977a2fSmrg# Character class describing NM global symbol codes.
333634977a2fSmrgsymcode='[[BCDEGRST]]'
3337ee3138f1Smrg
333834977a2fSmrg# Regexp to match symbols that can be accessed directly from C.
333934977a2fSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3340ee3138f1Smrg
334134977a2fSmrg# Define system-specific variables.
334234977a2fSmrgcase $host_os in
334334977a2fSmrgaix*)
334434977a2fSmrg  symcode='[[BCDT]]'
334534977a2fSmrg  ;;
334634977a2fSmrgcygwin* | mingw* | pw32* | cegcc*)
334734977a2fSmrg  symcode='[[ABCDGISTW]]'
334834977a2fSmrg  ;;
334934977a2fSmrghpux*)
335034977a2fSmrg  if test "$host_cpu" = ia64; then
335134977a2fSmrg    symcode='[[ABCDEGRST]]'
335234977a2fSmrg  fi
335334977a2fSmrg  ;;
335434977a2fSmrgirix* | nonstopux*)
335534977a2fSmrg  symcode='[[BCDEGRST]]'
335634977a2fSmrg  ;;
335734977a2fSmrgosf*)
335834977a2fSmrg  symcode='[[BCDEGQRST]]'
335934977a2fSmrg  ;;
336034977a2fSmrgsolaris*)
336134977a2fSmrg  symcode='[[BDRT]]'
336234977a2fSmrg  ;;
336334977a2fSmrgsco3.2v5*)
336434977a2fSmrg  symcode='[[DT]]'
336534977a2fSmrg  ;;
336634977a2fSmrgsysv4.2uw2*)
336734977a2fSmrg  symcode='[[DT]]'
336834977a2fSmrg  ;;
336934977a2fSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
337034977a2fSmrg  symcode='[[ABDT]]'
337134977a2fSmrg  ;;
337234977a2fSmrgsysv4)
337334977a2fSmrg  symcode='[[DFNSTU]]'
337434977a2fSmrg  ;;
337534977a2fSmrgesac
3376ee3138f1Smrg
337734977a2fSmrg# If we're using GNU nm, then use its standard symbol codes.
337834977a2fSmrgcase `$NM -V 2>&1` in
337934977a2fSmrg*GNU* | *'with BFD'*)
338034977a2fSmrg  symcode='[[ABCDGIRSTW]]' ;;
338134977a2fSmrgesac
3382ee3138f1Smrg
338334977a2fSmrg# Transform an extracted symbol line into a proper C declaration.
338434977a2fSmrg# Some systems (esp. on ia64) link data and code symbols differently,
338534977a2fSmrg# so use this general approach.
338634977a2fSmrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3387ee3138f1Smrg
338834977a2fSmrg# Transform an extracted symbol line into symbol name and symbol address
338934977a2fSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
339034977a2fSmrglt_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'"
3391ee3138f1Smrg
339234977a2fSmrg# Handle CRLF in mingw tool chain
339334977a2fSmrgopt_cr=
339434977a2fSmrgcase $build_os in
339534977a2fSmrgmingw*)
339634977a2fSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
339734977a2fSmrg  ;;
339834977a2fSmrgesac
3399ee3138f1Smrg
340034977a2fSmrg# Try without a prefix underscore, then with it.
340134977a2fSmrgfor ac_symprfx in "" "_"; do
3402ee3138f1Smrg
340334977a2fSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
340434977a2fSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
3405ee3138f1Smrg
340634977a2fSmrg  # Write the raw and C identifiers.
340734977a2fSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
340834977a2fSmrg    # Fake it for dumpbin and say T for any non-static function
340934977a2fSmrg    # and D for any global variable.
341034977a2fSmrg    # Also find C++ and __fastcall symbols from MSVC++,
341134977a2fSmrg    # which start with @ or ?.
341234977a2fSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
341334977a2fSmrg"     {last_section=section; section=\$ 3};"\
341434977a2fSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
341534977a2fSmrg"     \$ 0!~/External *\|/{next};"\
341634977a2fSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
341734977a2fSmrg"     {if(hide[section]) next};"\
341834977a2fSmrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
341934977a2fSmrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
342034977a2fSmrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
342134977a2fSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
342234977a2fSmrg"     ' prfx=^$ac_symprfx]"
342334977a2fSmrg  else
342434977a2fSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
3425ee3138f1Smrg  fi
3426ee3138f1Smrg
342734977a2fSmrg  # Check to see that the pipe works correctly.
342834977a2fSmrg  pipe_works=no
3429ee3138f1Smrg
343034977a2fSmrg  rm -f conftest*
343134977a2fSmrg  cat > conftest.$ac_ext <<_LT_EOF
343234977a2fSmrg#ifdef __cplusplus
343334977a2fSmrgextern "C" {
343434977a2fSmrg#endif
343534977a2fSmrgchar nm_test_var;
343634977a2fSmrgvoid nm_test_func(void);
343734977a2fSmrgvoid nm_test_func(void){}
343834977a2fSmrg#ifdef __cplusplus
343934977a2fSmrg}
344034977a2fSmrg#endif
344134977a2fSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
344234977a2fSmrg_LT_EOF
3443ee3138f1Smrg
344434977a2fSmrg  if AC_TRY_EVAL(ac_compile); then
344534977a2fSmrg    # Now try to grab the symbols.
344634977a2fSmrg    nlist=conftest.nm
344734977a2fSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
344834977a2fSmrg      # Try sorting and uniquifying the output.
344934977a2fSmrg      if sort "$nlist" | uniq > "$nlist"T; then
345034977a2fSmrg	mv -f "$nlist"T "$nlist"
345134977a2fSmrg      else
345234977a2fSmrg	rm -f "$nlist"T
345334977a2fSmrg      fi
3454ee3138f1Smrg
345534977a2fSmrg      # Make sure that we snagged all the symbols we need.
345634977a2fSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
345734977a2fSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
345834977a2fSmrg	  cat <<_LT_EOF > conftest.$ac_ext
345934977a2fSmrg#ifdef __cplusplus
346034977a2fSmrgextern "C" {
346134977a2fSmrg#endif
3462ee3138f1Smrg
346334977a2fSmrg_LT_EOF
346434977a2fSmrg	  # Now generate the symbol file.
346534977a2fSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3466ee3138f1Smrg
346734977a2fSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
3468ee3138f1Smrg
346934977a2fSmrg/* The mapping between symbol names and symbols.  */
347034977a2fSmrgconst struct {
347134977a2fSmrg  const char *name;
347234977a2fSmrg  void       *address;
347334977a2fSmrg}
347434977a2fSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
347534977a2fSmrg{
347634977a2fSmrg  { "@PROGRAM@", (void *) 0 },
347734977a2fSmrg_LT_EOF
347834977a2fSmrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
347934977a2fSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
348034977a2fSmrg  {0, (void *) 0}
348134977a2fSmrg};
3482ee3138f1Smrg
348334977a2fSmrg/* This works around a problem in FreeBSD linker */
348434977a2fSmrg#ifdef FREEBSD_WORKAROUND
348534977a2fSmrgstatic const void *lt_preloaded_setup() {
348634977a2fSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
348734977a2fSmrg}
348834977a2fSmrg#endif
3489ee3138f1Smrg
349034977a2fSmrg#ifdef __cplusplus
349134977a2fSmrg}
349234977a2fSmrg#endif
349334977a2fSmrg_LT_EOF
349434977a2fSmrg	  # Now try linking the two files.
349534977a2fSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
349634977a2fSmrg	  lt_save_LIBS="$LIBS"
349734977a2fSmrg	  lt_save_CFLAGS="$CFLAGS"
349834977a2fSmrg	  LIBS="conftstm.$ac_objext"
349934977a2fSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
350034977a2fSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
350134977a2fSmrg	    pipe_works=yes
350234977a2fSmrg	  fi
350334977a2fSmrg	  LIBS="$lt_save_LIBS"
350434977a2fSmrg	  CFLAGS="$lt_save_CFLAGS"
350534977a2fSmrg	else
350634977a2fSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
350734977a2fSmrg	fi
350834977a2fSmrg      else
350934977a2fSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
351034977a2fSmrg      fi
3511ee3138f1Smrg    else
351234977a2fSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3513ee3138f1Smrg    fi
3514ee3138f1Smrg  else
351534977a2fSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
351634977a2fSmrg    cat conftest.$ac_ext >&5
3517ee3138f1Smrg  fi
351834977a2fSmrg  rm -rf conftest* conftst*
3519ee3138f1Smrg
352034977a2fSmrg  # Do not use the global_symbol_pipe unless it works.
352134977a2fSmrg  if test "$pipe_works" = yes; then
352234977a2fSmrg    break
352334977a2fSmrg  else
352434977a2fSmrg    lt_cv_sys_global_symbol_pipe=
352534977a2fSmrg  fi
352634977a2fSmrgdone
352734977a2fSmrg])
352834977a2fSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
352934977a2fSmrg  lt_cv_sys_global_symbol_to_cdecl=
353034977a2fSmrgfi
353134977a2fSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
353234977a2fSmrg  AC_MSG_RESULT(failed)
3533ee3138f1Smrgelse
353434977a2fSmrg  AC_MSG_RESULT(ok)
3535ee3138f1Smrgfi
3536ee3138f1Smrg
353734977a2fSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
353834977a2fSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
353934977a2fSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
354034977a2fSmrg    [Transform the output of nm in a proper C declaration])
354134977a2fSmrg_LT_DECL([global_symbol_to_c_name_address],
354234977a2fSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
354334977a2fSmrg    [Transform the output of nm in a C name address pair])
354434977a2fSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
354534977a2fSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
354634977a2fSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
354734977a2fSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
3548ee3138f1Smrg
3549ee3138f1Smrg
355034977a2fSmrg# _LT_COMPILER_PIC([TAGNAME])
355134977a2fSmrg# ---------------------------
355234977a2fSmrgm4_defun([_LT_COMPILER_PIC],
355334977a2fSmrg[m4_require([_LT_TAG_COMPILER])dnl
355434977a2fSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
355534977a2fSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
355634977a2fSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
3557ee3138f1Smrg
355834977a2fSmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
355934977a2fSmrgm4_if([$1], [CXX], [
356034977a2fSmrg  # C++ specific cases for pic, static, wl, etc.
356134977a2fSmrg  if test "$GXX" = yes; then
356234977a2fSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
356334977a2fSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3564ee3138f1Smrg
356534977a2fSmrg    case $host_os in
356634977a2fSmrg    aix*)
356734977a2fSmrg      # All AIX code is PIC.
3568ee3138f1Smrg      if test "$host_cpu" = ia64; then
356934977a2fSmrg	# AIX 5 now supports IA64 processor
357034977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3571ee3138f1Smrg      fi
3572ee3138f1Smrg      ;;
3573ee3138f1Smrg
357434977a2fSmrg    amigaos*)
3575ee3138f1Smrg      case $host_cpu in
357634977a2fSmrg      powerpc)
357734977a2fSmrg            # see comment about AmigaOS4 .so support
357834977a2fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
357934977a2fSmrg        ;;
358034977a2fSmrg      m68k)
358134977a2fSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
358234977a2fSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
358334977a2fSmrg            # like `-m68040'.
358434977a2fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3585ee3138f1Smrg        ;;
3586ee3138f1Smrg      esac
3587ee3138f1Smrg      ;;
3588ee3138f1Smrg
358934977a2fSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
359034977a2fSmrg      # PIC is the default for these OSes.
359134977a2fSmrg      ;;
359234977a2fSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
359334977a2fSmrg      # This hack is so that the source file can tell whether it is being
359434977a2fSmrg      # built for inclusion in a dll (and should export symbols for example).
359534977a2fSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
359634977a2fSmrg      # (--disable-auto-import) libraries
359734977a2fSmrg      m4_if([$1], [GCJ], [],
359834977a2fSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
359934977a2fSmrg      ;;
360034977a2fSmrg    darwin* | rhapsody*)
360134977a2fSmrg      # PIC is the default on this platform
360234977a2fSmrg      # Common symbols not allowed in MH_DYLIB files
360334977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
360434977a2fSmrg      ;;
360534977a2fSmrg    *djgpp*)
360634977a2fSmrg      # DJGPP does not support shared libraries at all
360734977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
360834977a2fSmrg      ;;
360934977a2fSmrg    interix[[3-9]]*)
361034977a2fSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
361134977a2fSmrg      # Instead, we relocate shared libraries at runtime.
361234977a2fSmrg      ;;
361334977a2fSmrg    sysv4*MP*)
361434977a2fSmrg      if test -d /usr/nec; then
361534977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
361634977a2fSmrg      fi
361734977a2fSmrg      ;;
361834977a2fSmrg    hpux*)
361934977a2fSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
362034977a2fSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
362134977a2fSmrg      # sets the default TLS model and affects inlining.
362234977a2fSmrg      case $host_cpu in
362334977a2fSmrg      hppa*64*)
3624ee3138f1Smrg	;;
3625ee3138f1Smrg      *)
362634977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3627ee3138f1Smrg	;;
362834977a2fSmrg      esac
362934977a2fSmrg      ;;
363034977a2fSmrg    *qnx* | *nto*)
363134977a2fSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
363234977a2fSmrg      # it will coredump.
363334977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
363434977a2fSmrg      ;;
363534977a2fSmrg    *)
363634977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
363734977a2fSmrg      ;;
3638ee3138f1Smrg    esac
363934977a2fSmrg  else
364034977a2fSmrg    case $host_os in
364134977a2fSmrg      aix[[4-9]]*)
364234977a2fSmrg	# All AIX code is PIC.
364334977a2fSmrg	if test "$host_cpu" = ia64; then
364434977a2fSmrg	  # AIX 5 now supports IA64 processor
364534977a2fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
364634977a2fSmrg	else
364734977a2fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3648ee3138f1Smrg	fi
3649ee3138f1Smrg	;;
365034977a2fSmrg      chorus*)
365134977a2fSmrg	case $cc_basename in
365234977a2fSmrg	cxch68*)
365334977a2fSmrg	  # Green Hills C++ Compiler
365434977a2fSmrg	  # _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"
3655ee3138f1Smrg	  ;;
3656ee3138f1Smrg	esac
3657ee3138f1Smrg	;;
365834977a2fSmrg      dgux*)
365934977a2fSmrg	case $cc_basename in
366034977a2fSmrg	  ec++*)
366134977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
366234977a2fSmrg	    ;;
366334977a2fSmrg	  ghcx*)
366434977a2fSmrg	    # Green Hills C++ Compiler
366534977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
366634977a2fSmrg	    ;;
366734977a2fSmrg	  *)
366834977a2fSmrg	    ;;
3669ee3138f1Smrg	esac
3670ee3138f1Smrg	;;
367134977a2fSmrg      freebsd* | dragonfly*)
367234977a2fSmrg	# FreeBSD uses GNU C++
3673ee3138f1Smrg	;;
367434977a2fSmrg      hpux9* | hpux10* | hpux11*)
367534977a2fSmrg	case $cc_basename in
367634977a2fSmrg	  CC*)
367734977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
367834977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
367934977a2fSmrg	    if test "$host_cpu" != ia64; then
368034977a2fSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
368134977a2fSmrg	    fi
368234977a2fSmrg	    ;;
368334977a2fSmrg	  aCC*)
368434977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
368534977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
368634977a2fSmrg	    case $host_cpu in
368734977a2fSmrg	    hppa*64*|ia64*)
368834977a2fSmrg	      # +Z the default
368934977a2fSmrg	      ;;
369034977a2fSmrg	    *)
369134977a2fSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
369234977a2fSmrg	      ;;
369334977a2fSmrg	    esac
369434977a2fSmrg	    ;;
369534977a2fSmrg	  *)
369634977a2fSmrg	    ;;
369734977a2fSmrg	esac
3698ee3138f1Smrg	;;
369934977a2fSmrg      interix*)
370034977a2fSmrg	# This is c89, which is MS Visual C++ (no shared libs)
370134977a2fSmrg	# Anyone wants to do a port?
3702ee3138f1Smrg	;;
370334977a2fSmrg      irix5* | irix6* | nonstopux*)
370434977a2fSmrg	case $cc_basename in
370534977a2fSmrg	  CC*)
370634977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
370734977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
370834977a2fSmrg	    # CC pic flag -KPIC is the default.
370934977a2fSmrg	    ;;
371034977a2fSmrg	  *)
371134977a2fSmrg	    ;;
371234977a2fSmrg	esac
3713ee3138f1Smrg	;;
371434977a2fSmrg      linux* | k*bsd*-gnu)
371534977a2fSmrg	case $cc_basename in
371634977a2fSmrg	  KCC*)
371734977a2fSmrg	    # KAI C++ Compiler
371834977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
371934977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
372034977a2fSmrg	    ;;
372134977a2fSmrg	  ecpc* )
372234977a2fSmrg	    # old Intel C++ for x86_64 which still supported -KPIC.
372334977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
372434977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
372534977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
372634977a2fSmrg	    ;;
372734977a2fSmrg	  icpc* )
372834977a2fSmrg	    # Intel C++, used to be incompatible with GCC.
372934977a2fSmrg	    # ICC 10 doesn't accept -KPIC any more.
373034977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
373134977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
373234977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
373334977a2fSmrg	    ;;
373434977a2fSmrg	  pgCC* | pgcpp*)
373534977a2fSmrg	    # Portland Group C++ compiler
373634977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
373734977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
373834977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
373934977a2fSmrg	    ;;
374034977a2fSmrg	  cxx*)
374134977a2fSmrg	    # Compaq C++
374234977a2fSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
374334977a2fSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
374434977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
374534977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
374634977a2fSmrg	    ;;
374734977a2fSmrg	  xlc* | xlC*)
374834977a2fSmrg	    # IBM XL 8.0 on PPC
374934977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
375034977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
375134977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
375234977a2fSmrg	    ;;
375334977a2fSmrg	  *)
375434977a2fSmrg	    case `$CC -V 2>&1 | sed 5q` in
375534977a2fSmrg	    *Sun\ C*)
375634977a2fSmrg	      # Sun C++ 5.9
375734977a2fSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
375834977a2fSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
375934977a2fSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
376034977a2fSmrg	      ;;
376134977a2fSmrg	    esac
376234977a2fSmrg	    ;;
376334977a2fSmrg	esac
3764ee3138f1Smrg	;;
376534977a2fSmrg      lynxos*)
3766ee3138f1Smrg	;;
376734977a2fSmrg      m88k*)
3768ee3138f1Smrg	;;
376934977a2fSmrg      mvs*)
377034977a2fSmrg	case $cc_basename in
377134977a2fSmrg	  cxx*)
377234977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
377334977a2fSmrg	    ;;
377434977a2fSmrg	  *)
377534977a2fSmrg	    ;;
377634977a2fSmrg	esac
3777ee3138f1Smrg	;;
377834977a2fSmrg      netbsd*)
3779ee3138f1Smrg	;;
378034977a2fSmrg      *qnx* | *nto*)
378134977a2fSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
378234977a2fSmrg        # it will coredump.
378334977a2fSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
378434977a2fSmrg        ;;
378534977a2fSmrg      osf3* | osf4* | osf5*)
378634977a2fSmrg	case $cc_basename in
378734977a2fSmrg	  KCC*)
378834977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
378934977a2fSmrg	    ;;
379034977a2fSmrg	  RCC*)
379134977a2fSmrg	    # Rational C++ 2.4.1
379234977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
379334977a2fSmrg	    ;;
379434977a2fSmrg	  cxx*)
379534977a2fSmrg	    # Digital/Compaq C++
379634977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
379734977a2fSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
379834977a2fSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
379934977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
380034977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
380134977a2fSmrg	    ;;
380234977a2fSmrg	  *)
380334977a2fSmrg	    ;;
380434977a2fSmrg	esac
3805ee3138f1Smrg	;;
380634977a2fSmrg      psos*)
3807ee3138f1Smrg	;;
380834977a2fSmrg      solaris*)
380934977a2fSmrg	case $cc_basename in
381034977a2fSmrg	  CC*)
381134977a2fSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
381234977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
381334977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
381434977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
381534977a2fSmrg	    ;;
381634977a2fSmrg	  gcx*)
381734977a2fSmrg	    # Green Hills C++ Compiler
381834977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
381934977a2fSmrg	    ;;
382034977a2fSmrg	  *)
382134977a2fSmrg	    ;;
382234977a2fSmrg	esac
3823ee3138f1Smrg	;;
382434977a2fSmrg      sunos4*)
382534977a2fSmrg	case $cc_basename in
382634977a2fSmrg	  CC*)
382734977a2fSmrg	    # Sun C++ 4.x
382834977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
382934977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
383034977a2fSmrg	    ;;
383134977a2fSmrg	  lcc*)
383234977a2fSmrg	    # Lucid
383334977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
383434977a2fSmrg	    ;;
383534977a2fSmrg	  *)
383634977a2fSmrg	    ;;
383734977a2fSmrg	esac
3838ee3138f1Smrg	;;
383934977a2fSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
384034977a2fSmrg	case $cc_basename in
384134977a2fSmrg	  CC*)
384234977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
384334977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
384434977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
384534977a2fSmrg	    ;;
384634977a2fSmrg	esac
384734977a2fSmrg	;;
384834977a2fSmrg      tandem*)
384934977a2fSmrg	case $cc_basename in
385034977a2fSmrg	  NCC*)
385134977a2fSmrg	    # NonStop-UX NCC 3.20
385234977a2fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
385334977a2fSmrg	    ;;
3854ee3138f1Smrg	  *)
3855ee3138f1Smrg	    ;;
3856ee3138f1Smrg	esac
3857ee3138f1Smrg	;;
385834977a2fSmrg      vxworks*)
3859ee3138f1Smrg	;;
3860ee3138f1Smrg      *)
386134977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
386234977a2fSmrg	;;
386334977a2fSmrg    esac
386434977a2fSmrg  fi
386534977a2fSmrg],
386634977a2fSmrg[
386734977a2fSmrg  if test "$GCC" = yes; then
386834977a2fSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
386934977a2fSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3870ee3138f1Smrg
387134977a2fSmrg    case $host_os in
387234977a2fSmrg      aix*)
387334977a2fSmrg      # All AIX code is PIC.
387434977a2fSmrg      if test "$host_cpu" = ia64; then
387534977a2fSmrg	# AIX 5 now supports IA64 processor
387634977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
387734977a2fSmrg      fi
387834977a2fSmrg      ;;
3879ee3138f1Smrg
388034977a2fSmrg    amigaos*)
388134977a2fSmrg      case $host_cpu in
388234977a2fSmrg      powerpc)
388334977a2fSmrg            # see comment about AmigaOS4 .so support
388434977a2fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
388534977a2fSmrg        ;;
388634977a2fSmrg      m68k)
388734977a2fSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
388834977a2fSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
388934977a2fSmrg            # like `-m68040'.
389034977a2fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
389134977a2fSmrg        ;;
389234977a2fSmrg      esac
389334977a2fSmrg      ;;
3894ee3138f1Smrg
389534977a2fSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
389634977a2fSmrg      # PIC is the default for these OSes.
389734977a2fSmrg      ;;
389834977a2fSmrg
389934977a2fSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
390034977a2fSmrg      # This hack is so that the source file can tell whether it is being
390134977a2fSmrg      # built for inclusion in a dll (and should export symbols for example).
390234977a2fSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
390334977a2fSmrg      # (--disable-auto-import) libraries
390434977a2fSmrg      m4_if([$1], [GCJ], [],
390534977a2fSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
390634977a2fSmrg      ;;
390734977a2fSmrg
390834977a2fSmrg    darwin* | rhapsody*)
390934977a2fSmrg      # PIC is the default on this platform
391034977a2fSmrg      # Common symbols not allowed in MH_DYLIB files
391134977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
391234977a2fSmrg      ;;
391334977a2fSmrg
391434977a2fSmrg    hpux*)
391534977a2fSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
391634977a2fSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
391734977a2fSmrg      # sets the default TLS model and affects inlining.
391834977a2fSmrg      case $host_cpu in
391934977a2fSmrg      hppa*64*)
392034977a2fSmrg	# +Z the default
3921ee3138f1Smrg	;;
3922ee3138f1Smrg      *)
392334977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3924ee3138f1Smrg	;;
392534977a2fSmrg      esac
392634977a2fSmrg      ;;
392734977a2fSmrg
392834977a2fSmrg    interix[[3-9]]*)
392934977a2fSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
393034977a2fSmrg      # Instead, we relocate shared libraries at runtime.
393134977a2fSmrg      ;;
393234977a2fSmrg
393334977a2fSmrg    msdosdjgpp*)
393434977a2fSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
393534977a2fSmrg      # on systems that don't support them.
393634977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
393734977a2fSmrg      enable_shared=no
393834977a2fSmrg      ;;
393934977a2fSmrg
394034977a2fSmrg    *nto* | *qnx*)
394134977a2fSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
394234977a2fSmrg      # it will coredump.
394334977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
394434977a2fSmrg      ;;
394534977a2fSmrg
394634977a2fSmrg    sysv4*MP*)
394734977a2fSmrg      if test -d /usr/nec; then
394834977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
394934977a2fSmrg      fi
395034977a2fSmrg      ;;
395134977a2fSmrg
395234977a2fSmrg    *)
395334977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
395434977a2fSmrg      ;;
3955ee3138f1Smrg    esac
395634977a2fSmrg  else
395734977a2fSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
395834977a2fSmrg    case $host_os in
395934977a2fSmrg    aix*)
396034977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
396134977a2fSmrg      if test "$host_cpu" = ia64; then
396234977a2fSmrg	# AIX 5 now supports IA64 processor
396334977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
396434977a2fSmrg      else
396534977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
396634977a2fSmrg      fi
396734977a2fSmrg      ;;
396834977a2fSmrg
396934977a2fSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
397034977a2fSmrg      # This hack is so that the source file can tell whether it is being
397134977a2fSmrg      # built for inclusion in a dll (and should export symbols for example).
397234977a2fSmrg      m4_if([$1], [GCJ], [],
397334977a2fSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
397434977a2fSmrg      ;;
397534977a2fSmrg
397634977a2fSmrg    hpux9* | hpux10* | hpux11*)
397734977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
397834977a2fSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
397934977a2fSmrg      # not for PA HP-UX.
398034977a2fSmrg      case $host_cpu in
398134977a2fSmrg      hppa*64*|ia64*)
398234977a2fSmrg	# +Z the default
3983ee3138f1Smrg	;;
3984ee3138f1Smrg      *)
398534977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3986ee3138f1Smrg	;;
398734977a2fSmrg      esac
398834977a2fSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
398934977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
399034977a2fSmrg      ;;
399134977a2fSmrg
399234977a2fSmrg    irix5* | irix6* | nonstopux*)
399334977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
399434977a2fSmrg      # PIC (with -KPIC) is the default.
399534977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
399634977a2fSmrg      ;;
399734977a2fSmrg
399834977a2fSmrg    linux* | k*bsd*-gnu)
399934977a2fSmrg      case $cc_basename in
400034977a2fSmrg      # old Intel for x86_64 which still supported -KPIC.
400134977a2fSmrg      ecc*)
400234977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
400334977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
400434977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
400534977a2fSmrg        ;;
400634977a2fSmrg      # icc used to be incompatible with GCC.
400734977a2fSmrg      # ICC 10 doesn't accept -KPIC any more.
400834977a2fSmrg      icc* | ifort*)
400934977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
401034977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
401134977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
401234977a2fSmrg        ;;
401334977a2fSmrg      # Lahey Fortran 8.1.
401434977a2fSmrg      lf95*)
401534977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
401634977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
401734977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
401834977a2fSmrg	;;
401934977a2fSmrg      pgcc* | pgf77* | pgf90* | pgf95*)
402034977a2fSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
402134977a2fSmrg	# which looks to be a dead project)
402234977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
402334977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
402434977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
402534977a2fSmrg        ;;
402634977a2fSmrg      ccc*)
402734977a2fSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
402834977a2fSmrg        # All Alpha code is PIC.
402934977a2fSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
403034977a2fSmrg        ;;
403134977a2fSmrg      xl*)
403234977a2fSmrg	# IBM XL C 8.0/Fortran 10.1 on PPC
403334977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
403434977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
403534977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4036ee3138f1Smrg	;;
4037ee3138f1Smrg      *)
403834977a2fSmrg	case `$CC -V 2>&1 | sed 5q` in
403934977a2fSmrg	*Sun\ C*)
404034977a2fSmrg	  # Sun C 5.9
404134977a2fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
404234977a2fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
404334977a2fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
404434977a2fSmrg	  ;;
404534977a2fSmrg	*Sun\ F*)
404634977a2fSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
404734977a2fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
404834977a2fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
404934977a2fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
405034977a2fSmrg	  ;;
405134977a2fSmrg	esac
4052ee3138f1Smrg	;;
405334977a2fSmrg      esac
405434977a2fSmrg      ;;
4055ee3138f1Smrg
405634977a2fSmrg    newsos6)
405734977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
405834977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
405934977a2fSmrg      ;;
4060ee3138f1Smrg
406134977a2fSmrg    *nto* | *qnx*)
406234977a2fSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
406334977a2fSmrg      # it will coredump.
406434977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
406534977a2fSmrg      ;;
4066ee3138f1Smrg
406734977a2fSmrg    osf3* | osf4* | osf5*)
406834977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
406934977a2fSmrg      # All OSF/1 code is PIC.
407034977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
407134977a2fSmrg      ;;
4072ee3138f1Smrg
407334977a2fSmrg    rdos*)
407434977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
407534977a2fSmrg      ;;
4076ee3138f1Smrg
407734977a2fSmrg    solaris*)
407834977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
407934977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
408034977a2fSmrg      case $cc_basename in
408134977a2fSmrg      f77* | f90* | f95*)
408234977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
408334977a2fSmrg      *)
408434977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
408534977a2fSmrg      esac
408634977a2fSmrg      ;;
4087ee3138f1Smrg
408834977a2fSmrg    sunos4*)
408934977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
409034977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
409134977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
409234977a2fSmrg      ;;
4093ee3138f1Smrg
409434977a2fSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
409534977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
409634977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
409734977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
409834977a2fSmrg      ;;
4099ee3138f1Smrg
410034977a2fSmrg    sysv4*MP*)
410134977a2fSmrg      if test -d /usr/nec ;then
410234977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
410334977a2fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
410434977a2fSmrg      fi
410534977a2fSmrg      ;;
4106ee3138f1Smrg
410734977a2fSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
410834977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
410934977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
411034977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
411134977a2fSmrg      ;;
4112ee3138f1Smrg
411334977a2fSmrg    unicos*)
411434977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
411534977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
411634977a2fSmrg      ;;
4117ee3138f1Smrg
411834977a2fSmrg    uts4*)
411934977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
412034977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
412134977a2fSmrg      ;;
4122ee3138f1Smrg
412334977a2fSmrg    *)
412434977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
412534977a2fSmrg      ;;
4126ee3138f1Smrg    esac
412734977a2fSmrg  fi
412834977a2fSmrg])
412934977a2fSmrgcase $host_os in
413034977a2fSmrg  # For platforms which do not support PIC, -DPIC is meaningless:
413134977a2fSmrg  *djgpp*)
413234977a2fSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
413334977a2fSmrg    ;;
413434977a2fSmrg  *)
413534977a2fSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
413634977a2fSmrg    ;;
413734977a2fSmrgesac
413834977a2fSmrgAC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
413934977a2fSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
414034977a2fSmrg	[How to pass a linker flag through the compiler])
4141ee3138f1Smrg
414234977a2fSmrg#
414334977a2fSmrg# Check to make sure the PIC flag actually works.
414434977a2fSmrg#
414534977a2fSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
414634977a2fSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
414734977a2fSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
414834977a2fSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
414934977a2fSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
415034977a2fSmrg     "" | " "*) ;;
415134977a2fSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
415234977a2fSmrg     esac],
415334977a2fSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
415434977a2fSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4155ee3138f1Smrgfi
415634977a2fSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
415734977a2fSmrg	[Additional compiler flags for building library objects])
4158ee3138f1Smrg
415934977a2fSmrg#
416034977a2fSmrg# Check to make sure the static flag actually works.
416134977a2fSmrg#
416234977a2fSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
416334977a2fSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
416434977a2fSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
416534977a2fSmrg  $lt_tmp_static_flag,
416634977a2fSmrg  [],
416734977a2fSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
416834977a2fSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
416934977a2fSmrg	[Compiler flag to prevent dynamic linking])
417034977a2fSmrg])# _LT_COMPILER_PIC
417179a8a9c6Smrg
4172ee3138f1Smrg
417334977a2fSmrg# _LT_LINKER_SHLIBS([TAGNAME])
417434977a2fSmrg# ----------------------------
417534977a2fSmrg# See if the linker supports building shared libraries.
417634977a2fSmrgm4_defun([_LT_LINKER_SHLIBS],
417734977a2fSmrg[AC_REQUIRE([LT_PATH_LD])dnl
417834977a2fSmrgAC_REQUIRE([LT_PATH_NM])dnl
417934977a2fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
418034977a2fSmrgm4_require([_LT_DECL_EGREP])dnl
418134977a2fSmrgm4_require([_LT_DECL_SED])dnl
418234977a2fSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
418334977a2fSmrgm4_require([_LT_TAG_COMPILER])dnl
418434977a2fSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
418534977a2fSmrgm4_if([$1], [CXX], [
418634977a2fSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
418734977a2fSmrg  case $host_os in
418834977a2fSmrg  aix[[4-9]]*)
418934977a2fSmrg    # If we're using GNU nm, then we don't want the "-C" option.
419034977a2fSmrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
419134977a2fSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
419234977a2fSmrg      _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'
419334977a2fSmrg    else
419434977a2fSmrg      _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'
4195ee3138f1Smrg    fi
4196ee3138f1Smrg    ;;
419734977a2fSmrg  pw32*)
419834977a2fSmrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4199ee3138f1Smrg  ;;
420034977a2fSmrg  cygwin* | mingw* | cegcc*)
420134977a2fSmrg    _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'
420234977a2fSmrg  ;;
420334977a2fSmrg  *)
420434977a2fSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
420534977a2fSmrg  ;;
420634977a2fSmrg  esac
420734977a2fSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
420834977a2fSmrg], [
420934977a2fSmrg  runpath_var=
421034977a2fSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
421134977a2fSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
421234977a2fSmrg  _LT_TAGVAR(archive_cmds, $1)=
421334977a2fSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
421434977a2fSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
421534977a2fSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
421634977a2fSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
421734977a2fSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
421834977a2fSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
421934977a2fSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
422034977a2fSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
422134977a2fSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
422234977a2fSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
422334977a2fSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
422434977a2fSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
422534977a2fSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
422634977a2fSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
422734977a2fSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
422834977a2fSmrg  _LT_TAGVAR(module_cmds, $1)=
422934977a2fSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
423034977a2fSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
423134977a2fSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
423234977a2fSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
423334977a2fSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
423434977a2fSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
423534977a2fSmrg  # included in the symbol list
423634977a2fSmrg  _LT_TAGVAR(include_expsyms, $1)=
423734977a2fSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
423834977a2fSmrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
423934977a2fSmrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
424034977a2fSmrg  # as well as any symbol that contains `d'.
424134977a2fSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
424234977a2fSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
424334977a2fSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
424434977a2fSmrg  # the symbol is explicitly referenced.  Since portable code cannot
424534977a2fSmrg  # rely on this symbol name, it's probably fine to never include it in
424634977a2fSmrg  # preloaded symbol tables.
424734977a2fSmrg  # Exclude shared library initialization/finalization symbols.
424834977a2fSmrgdnl Note also adjust exclude_expsyms for C++ above.
424934977a2fSmrg  extract_expsyms_cmds=
4250ee3138f1Smrg
425134977a2fSmrg  case $host_os in
425234977a2fSmrg  cygwin* | mingw* | pw32* | cegcc*)
425334977a2fSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
425434977a2fSmrg    # When not using gcc, we currently assume that we are using
425534977a2fSmrg    # Microsoft Visual C++.
425634977a2fSmrg    if test "$GCC" != yes; then
425734977a2fSmrg      with_gnu_ld=no
4258ee3138f1Smrg    fi
4259ee3138f1Smrg    ;;
426034977a2fSmrg  interix*)
426134977a2fSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
426234977a2fSmrg    with_gnu_ld=yes
426334977a2fSmrg    ;;
426434977a2fSmrg  openbsd*)
426534977a2fSmrg    with_gnu_ld=no
426634977a2fSmrg    ;;
4267ee3138f1Smrg  esac
4268ee3138f1Smrg
426934977a2fSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
427034977a2fSmrg  if test "$with_gnu_ld" = yes; then
427134977a2fSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
427234977a2fSmrg    wlarc='${wl}'
4273ee3138f1Smrg
427434977a2fSmrg    # Set some defaults for GNU ld with shared library support. These
427534977a2fSmrg    # are reset later if shared libraries are not supported. Putting them
427634977a2fSmrg    # here allows them to be overridden if necessary.
427734977a2fSmrg    runpath_var=LD_RUN_PATH
427834977a2fSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
427934977a2fSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
428034977a2fSmrg    # ancient GNU ld didn't support --whole-archive et. al.
428134977a2fSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
428234977a2fSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
428334977a2fSmrg    else
428434977a2fSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
428534977a2fSmrg    fi
428634977a2fSmrg    supports_anon_versioning=no
428734977a2fSmrg    case `$LD -v 2>&1` in
428834977a2fSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
428934977a2fSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
429034977a2fSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
429134977a2fSmrg      *\ 2.11.*) ;; # other 2.11 versions
429234977a2fSmrg      *) supports_anon_versioning=yes ;;
429334977a2fSmrg    esac
4294ee3138f1Smrg
429534977a2fSmrg    # See if GNU ld supports shared libraries.
429634977a2fSmrg    case $host_os in
429734977a2fSmrg    aix[[3-9]]*)
429834977a2fSmrg      # On AIX/PPC, the GNU linker is very broken
429934977a2fSmrg      if test "$host_cpu" != ia64; then
430034977a2fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
430134977a2fSmrg	cat <<_LT_EOF 1>&2
4302ee3138f1Smrg
430334977a2fSmrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
430434977a2fSmrg*** to be unable to reliably create shared libraries on AIX.
430534977a2fSmrg*** Therefore, libtool is disabling shared libraries support.  If you
430634977a2fSmrg*** really care for shared libraries, you may want to modify your PATH
430734977a2fSmrg*** so that a non-GNU linker is found, and then restart.
4308ee3138f1Smrg
430934977a2fSmrg_LT_EOF
431034977a2fSmrg      fi
431134977a2fSmrg      ;;
4312ee3138f1Smrg
431334977a2fSmrg    amigaos*)
431434977a2fSmrg      case $host_cpu in
431534977a2fSmrg      powerpc)
431634977a2fSmrg            # see comment about AmigaOS4 .so support
431734977a2fSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
431834977a2fSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
431934977a2fSmrg        ;;
432034977a2fSmrg      m68k)
432134977a2fSmrg            _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)'
432234977a2fSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
432334977a2fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
432434977a2fSmrg        ;;
432534977a2fSmrg      esac
432634977a2fSmrg      ;;
4327ee3138f1Smrg
432834977a2fSmrg    beos*)
432934977a2fSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
433034977a2fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
433134977a2fSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
433234977a2fSmrg	# support --undefined.  This deserves some investigation.  FIXME
433334977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
433434977a2fSmrg      else
433534977a2fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
433634977a2fSmrg      fi
433734977a2fSmrg      ;;
4338ee3138f1Smrg
433934977a2fSmrg    cygwin* | mingw* | pw32* | cegcc*)
434034977a2fSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
434134977a2fSmrg      # as there is no search path for DLLs.
434234977a2fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
434334977a2fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
434434977a2fSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
434534977a2fSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
434634977a2fSmrg      _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'
434734977a2fSmrg
434834977a2fSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
434934977a2fSmrg        _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'
435034977a2fSmrg	# If the export-symbols file already is a .def file (1st line
435134977a2fSmrg	# is EXPORTS), use it as is; otherwise, prepend...
435234977a2fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
435334977a2fSmrg	  cp $export_symbols $output_objdir/$soname.def;
435434977a2fSmrg	else
435534977a2fSmrg	  echo EXPORTS > $output_objdir/$soname.def;
435634977a2fSmrg	  cat $export_symbols >> $output_objdir/$soname.def;
435734977a2fSmrg	fi~
435834977a2fSmrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
435934977a2fSmrg      else
436034977a2fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
436134977a2fSmrg      fi
436234977a2fSmrg      ;;
4363ee3138f1Smrg
436434977a2fSmrg    interix[[3-9]]*)
436534977a2fSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
436634977a2fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
436734977a2fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
436834977a2fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
436934977a2fSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
437034977a2fSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
437134977a2fSmrg      # default) and relocated if they conflict, which is a slow very memory
437234977a2fSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
437334977a2fSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
437434977a2fSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
437534977a2fSmrg      _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'
437634977a2fSmrg      _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'
437734977a2fSmrg      ;;
4378ee3138f1Smrg
437934977a2fSmrg    gnu* | linux* | tpf* | k*bsd*-gnu)
438034977a2fSmrg      tmp_diet=no
438134977a2fSmrg      if test "$host_os" = linux-dietlibc; then
438234977a2fSmrg	case $cc_basename in
438334977a2fSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
438434977a2fSmrg	esac
438534977a2fSmrg      fi
438634977a2fSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
438734977a2fSmrg	 && test "$tmp_diet" = no
438834977a2fSmrg      then
438934977a2fSmrg	tmp_addflag=
439034977a2fSmrg	tmp_sharedflag='-shared'
439134977a2fSmrg	case $cc_basename,$host_cpu in
439234977a2fSmrg        pgcc*)				# Portland Group C compiler
439334977a2fSmrg	  _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'
439434977a2fSmrg	  tmp_addflag=' $pic_flag'
439534977a2fSmrg	  ;;
439634977a2fSmrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
439734977a2fSmrg	  _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'
439834977a2fSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
439934977a2fSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
440034977a2fSmrg	  tmp_addflag=' -i_dynamic' ;;
440134977a2fSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
440234977a2fSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
440334977a2fSmrg	ifc* | ifort*)			# Intel Fortran compiler
440434977a2fSmrg	  tmp_addflag=' -nofor_main' ;;
440534977a2fSmrg	lf95*)				# Lahey Fortran 8.1
440634977a2fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
440734977a2fSmrg	  tmp_sharedflag='--shared' ;;
440834977a2fSmrg	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
440934977a2fSmrg	  tmp_sharedflag='-qmkshrobj'
441034977a2fSmrg	  tmp_addflag= ;;
441134977a2fSmrg	esac
441234977a2fSmrg	case `$CC -V 2>&1 | sed 5q` in
441334977a2fSmrg	*Sun\ C*)			# Sun C 5.9
441434977a2fSmrg	  _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'
441534977a2fSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
441634977a2fSmrg	  tmp_sharedflag='-G' ;;
441734977a2fSmrg	*Sun\ F*)			# Sun Fortran 8.3
441834977a2fSmrg	  tmp_sharedflag='-G' ;;
441934977a2fSmrg	esac
442034977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4421ee3138f1Smrg
442234977a2fSmrg        if test "x$supports_anon_versioning" = xyes; then
442334977a2fSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
442434977a2fSmrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
442534977a2fSmrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
442634977a2fSmrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
442734977a2fSmrg        fi
4428ee3138f1Smrg
442934977a2fSmrg	case $cc_basename in
443034977a2fSmrg	xlf*)
443134977a2fSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
443234977a2fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
443334977a2fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
443434977a2fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
443534977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
443634977a2fSmrg	  if test "x$supports_anon_versioning" = xyes; then
443734977a2fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
443834977a2fSmrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
443934977a2fSmrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
444034977a2fSmrg	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
444134977a2fSmrg	  fi
444234977a2fSmrg	  ;;
444334977a2fSmrg	esac
444434977a2fSmrg      else
444534977a2fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
444634977a2fSmrg      fi
444734977a2fSmrg      ;;
4448ee3138f1Smrg
444934977a2fSmrg    netbsd*)
445034977a2fSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
445134977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
445234977a2fSmrg	wlarc=
445334977a2fSmrg      else
445434977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
445534977a2fSmrg	_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'
445634977a2fSmrg      fi
445734977a2fSmrg      ;;
4458ee3138f1Smrg
445934977a2fSmrg    solaris*)
446034977a2fSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
446134977a2fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
446234977a2fSmrg	cat <<_LT_EOF 1>&2
4463ee3138f1Smrg
446434977a2fSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
446534977a2fSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
446634977a2fSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
446734977a2fSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
446834977a2fSmrg*** your PATH or compiler configuration so that the native linker is
446934977a2fSmrg*** used, and then restart.
4470ee3138f1Smrg
447134977a2fSmrg_LT_EOF
447234977a2fSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
447334977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
447434977a2fSmrg	_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'
447534977a2fSmrg      else
447634977a2fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
447734977a2fSmrg      fi
447834977a2fSmrg      ;;
4479ee3138f1Smrg
448034977a2fSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
448134977a2fSmrg      case `$LD -v 2>&1` in
448234977a2fSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
448334977a2fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
448434977a2fSmrg	cat <<_LT_EOF 1>&2
4485ee3138f1Smrg
448634977a2fSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
448734977a2fSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
448834977a2fSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
448934977a2fSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
449034977a2fSmrg*** your PATH or compiler configuration so that the native linker is
449134977a2fSmrg*** used, and then restart.
4492ee3138f1Smrg
449334977a2fSmrg_LT_EOF
449434977a2fSmrg	;;
449534977a2fSmrg	*)
449634977a2fSmrg	  # For security reasons, it is highly recommended that you always
449734977a2fSmrg	  # use absolute paths for naming shared libraries, and exclude the
449834977a2fSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
449934977a2fSmrg	  # requires that you compile everything twice, which is a pain.
450034977a2fSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
450134977a2fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
450234977a2fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
450334977a2fSmrg	    _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'
450434977a2fSmrg	  else
450534977a2fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
450634977a2fSmrg	  fi
450734977a2fSmrg	;;
450834977a2fSmrg      esac
450934977a2fSmrg      ;;
4510ee3138f1Smrg
451134977a2fSmrg    sunos4*)
451234977a2fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
451334977a2fSmrg      wlarc=
451434977a2fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
451534977a2fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
451634977a2fSmrg      ;;
4517ee3138f1Smrg
451834977a2fSmrg    *)
451934977a2fSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
452034977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
452134977a2fSmrg	_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'
452234977a2fSmrg      else
452334977a2fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
452434977a2fSmrg      fi
452534977a2fSmrg      ;;
452634977a2fSmrg    esac
4527ee3138f1Smrg
452834977a2fSmrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
452934977a2fSmrg      runpath_var=
453034977a2fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
453134977a2fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
453234977a2fSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
453334977a2fSmrg    fi
453434977a2fSmrg  else
453534977a2fSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
453634977a2fSmrg    case $host_os in
453734977a2fSmrg    aix3*)
453834977a2fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
453934977a2fSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
454034977a2fSmrg      _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'
454134977a2fSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
454234977a2fSmrg      # are no directories specified by -L.
454334977a2fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
454434977a2fSmrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
454534977a2fSmrg	# Neither direct hardcoding nor static linking is supported with a
454634977a2fSmrg	# broken collect2.
454734977a2fSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
454834977a2fSmrg      fi
454934977a2fSmrg      ;;
4550ee3138f1Smrg
455134977a2fSmrg    aix[[4-9]]*)
455234977a2fSmrg      if test "$host_cpu" = ia64; then
455334977a2fSmrg	# On IA64, the linker does run time linking by default, so we don't
455434977a2fSmrg	# have to do anything special.
455534977a2fSmrg	aix_use_runtimelinking=no
455634977a2fSmrg	exp_sym_flag='-Bexport'
455734977a2fSmrg	no_entry_flag=""
455834977a2fSmrg      else
455934977a2fSmrg	# If we're using GNU nm, then we don't want the "-C" option.
456034977a2fSmrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
456134977a2fSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
456234977a2fSmrg	  _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'
456334977a2fSmrg	else
456434977a2fSmrg	  _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'
456534977a2fSmrg	fi
456634977a2fSmrg	aix_use_runtimelinking=no
4567ee3138f1Smrg
456834977a2fSmrg	# Test if we are trying to use run time linking or normal
456934977a2fSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
457034977a2fSmrg	# need to do runtime linking.
457134977a2fSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
457234977a2fSmrg	  for ld_flag in $LDFLAGS; do
457334977a2fSmrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
457434977a2fSmrg	    aix_use_runtimelinking=yes
457534977a2fSmrg	    break
457634977a2fSmrg	  fi
457734977a2fSmrg	  done
457834977a2fSmrg	  ;;
457934977a2fSmrg	esac
4580ee3138f1Smrg
458134977a2fSmrg	exp_sym_flag='-bexport'
458234977a2fSmrg	no_entry_flag='-bnoentry'
458334977a2fSmrg      fi
458434977a2fSmrg
458534977a2fSmrg      # When large executables or shared objects are built, AIX ld can
458634977a2fSmrg      # have problems creating the table of contents.  If linking a library
458734977a2fSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
458834977a2fSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
458934977a2fSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
4590ee3138f1Smrg
459134977a2fSmrg      _LT_TAGVAR(archive_cmds, $1)=''
459234977a2fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
459334977a2fSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
459434977a2fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
459534977a2fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
459634977a2fSmrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
4597ee3138f1Smrg
459834977a2fSmrg      if test "$GCC" = yes; then
459934977a2fSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
460034977a2fSmrg	# We only want to do this on AIX 4.2 and lower, the check
460134977a2fSmrg	# below for broken collect2 doesn't work under 4.3+
460234977a2fSmrg	  collect2name=`${CC} -print-prog-name=collect2`
460334977a2fSmrg	  if test -f "$collect2name" &&
460434977a2fSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
460534977a2fSmrg	  then
460634977a2fSmrg	  # We have reworked collect2
460734977a2fSmrg	  :
460834977a2fSmrg	  else
460934977a2fSmrg	  # We have old collect2
461034977a2fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
461134977a2fSmrg	  # It fails to find uninstalled libraries when the uninstalled
461234977a2fSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
461334977a2fSmrg	  # to unsupported forces relinking
461434977a2fSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
461534977a2fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
461634977a2fSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
461734977a2fSmrg	  fi
461834977a2fSmrg	  ;;
461934977a2fSmrg	esac
462034977a2fSmrg	shared_flag='-shared'
462134977a2fSmrg	if test "$aix_use_runtimelinking" = yes; then
462234977a2fSmrg	  shared_flag="$shared_flag "'${wl}-G'
462334977a2fSmrg	fi
462434977a2fSmrg      else
462534977a2fSmrg	# not using gcc
462634977a2fSmrg	if test "$host_cpu" = ia64; then
462734977a2fSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
462834977a2fSmrg	# chokes on -Wl,-G. The following line is correct:
462934977a2fSmrg	  shared_flag='-G'
463034977a2fSmrg	else
463134977a2fSmrg	  if test "$aix_use_runtimelinking" = yes; then
463234977a2fSmrg	    shared_flag='${wl}-G'
463334977a2fSmrg	  else
463434977a2fSmrg	    shared_flag='${wl}-bM:SRE'
463534977a2fSmrg	  fi
463634977a2fSmrg	fi
463734977a2fSmrg      fi
4638ee3138f1Smrg
463934977a2fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
464034977a2fSmrg      # It seems that -bexpall does not export symbols beginning with
464134977a2fSmrg      # underscore (_), so it is better to generate a list of symbols to export.
464234977a2fSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
464334977a2fSmrg      if test "$aix_use_runtimelinking" = yes; then
464434977a2fSmrg	# Warning - without using the other runtime loading flags (-brtl),
464534977a2fSmrg	# -berok will link without error, but may produce a broken library.
464634977a2fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
464734977a2fSmrg        # Determine the default libpath from the value encoded in an
464834977a2fSmrg        # empty executable.
464934977a2fSmrg        _LT_SYS_MODULE_PATH_AIX
465034977a2fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
465134977a2fSmrg        _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"
465234977a2fSmrg      else
465334977a2fSmrg	if test "$host_cpu" = ia64; then
465434977a2fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
465534977a2fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
465634977a2fSmrg	  _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"
465734977a2fSmrg	else
465834977a2fSmrg	 # Determine the default libpath from the value encoded in an
465934977a2fSmrg	 # empty executable.
466034977a2fSmrg	 _LT_SYS_MODULE_PATH_AIX
466134977a2fSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
466234977a2fSmrg	  # Warning - without using the other run time loading flags,
466334977a2fSmrg	  # -berok will link without error, but may produce a broken library.
466434977a2fSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
466534977a2fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
466634977a2fSmrg	  # Exported symbols can be pulled into shared objects from archives
466734977a2fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
466834977a2fSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
466934977a2fSmrg	  # This is similar to how AIX traditionally builds its shared libraries.
467034977a2fSmrg	  _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'
467134977a2fSmrg	fi
467234977a2fSmrg      fi
467334977a2fSmrg      ;;
4674ee3138f1Smrg
467534977a2fSmrg    amigaos*)
467634977a2fSmrg      case $host_cpu in
467734977a2fSmrg      powerpc)
467834977a2fSmrg            # see comment about AmigaOS4 .so support
467934977a2fSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
468034977a2fSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
468134977a2fSmrg        ;;
468234977a2fSmrg      m68k)
468334977a2fSmrg            _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)'
468434977a2fSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
468534977a2fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
468634977a2fSmrg        ;;
468734977a2fSmrg      esac
468834977a2fSmrg      ;;
4689ee3138f1Smrg
469034977a2fSmrg    bsdi[[45]]*)
469134977a2fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
469234977a2fSmrg      ;;
4693ee3138f1Smrg
469434977a2fSmrg    cygwin* | mingw* | pw32* | cegcc*)
469534977a2fSmrg      # When not using gcc, we currently assume that we are using
469634977a2fSmrg      # Microsoft Visual C++.
469734977a2fSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
469834977a2fSmrg      # no search path for DLLs.
469934977a2fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
470034977a2fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
470134977a2fSmrg      # Tell ltmain to make .lib files, not .a files.
470234977a2fSmrg      libext=lib
470334977a2fSmrg      # Tell ltmain to make .dll files, not .so files.
470434977a2fSmrg      shrext_cmds=".dll"
470534977a2fSmrg      # FIXME: Setting linknames here is a bad hack.
470634977a2fSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
470734977a2fSmrg      # The linker will automatically build a .lib file if we build a DLL.
470834977a2fSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
470934977a2fSmrg      # FIXME: Should let the user specify the lib program.
471034977a2fSmrg      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
471134977a2fSmrg      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
471234977a2fSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
471334977a2fSmrg      ;;
4714ee3138f1Smrg
471534977a2fSmrg    darwin* | rhapsody*)
471634977a2fSmrg      _LT_DARWIN_LINKER_FEATURES($1)
471734977a2fSmrg      ;;
4718ee3138f1Smrg
471934977a2fSmrg    dgux*)
472034977a2fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
472134977a2fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
472234977a2fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
472334977a2fSmrg      ;;
4724ee3138f1Smrg
472534977a2fSmrg    freebsd1*)
472634977a2fSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
472734977a2fSmrg      ;;
4728ee3138f1Smrg
472934977a2fSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
473034977a2fSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
473134977a2fSmrg    # does not break anything, and helps significantly (at the cost of a little
473234977a2fSmrg    # extra space).
473334977a2fSmrg    freebsd2.2*)
473434977a2fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
473534977a2fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
473634977a2fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
473734977a2fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
473834977a2fSmrg      ;;
4739ee3138f1Smrg
474034977a2fSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
474134977a2fSmrg    freebsd2*)
474234977a2fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
474334977a2fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
474434977a2fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
474534977a2fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
474634977a2fSmrg      ;;
4747ee3138f1Smrg
474834977a2fSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
474934977a2fSmrg    freebsd* | dragonfly*)
475034977a2fSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
475134977a2fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
475234977a2fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
475334977a2fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
475434977a2fSmrg      ;;
4755ee3138f1Smrg
475634977a2fSmrg    hpux9*)
475734977a2fSmrg      if test "$GCC" = yes; then
475834977a2fSmrg	_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'
475934977a2fSmrg      else
476034977a2fSmrg	_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'
476134977a2fSmrg      fi
476234977a2fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
476334977a2fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
476434977a2fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4765ee3138f1Smrg
476634977a2fSmrg      # hardcode_minus_L: Not really in the search PATH,
476734977a2fSmrg      # but as the default location of the library.
476834977a2fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
476934977a2fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
477034977a2fSmrg      ;;
4771ee3138f1Smrg
477234977a2fSmrg    hpux10*)
477334977a2fSmrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
477434977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
477534977a2fSmrg      else
477634977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
477734977a2fSmrg      fi
477834977a2fSmrg      if test "$with_gnu_ld" = no; then
477934977a2fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
478034977a2fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
478134977a2fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
478234977a2fSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
478334977a2fSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
478434977a2fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
478534977a2fSmrg	# hardcode_minus_L: Not really in the search PATH,
478634977a2fSmrg	# but as the default location of the library.
478734977a2fSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
478834977a2fSmrg      fi
478934977a2fSmrg      ;;
4790ee3138f1Smrg
479134977a2fSmrg    hpux11*)
479234977a2fSmrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
479334977a2fSmrg	case $host_cpu in
479434977a2fSmrg	hppa*64*)
479534977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
479634977a2fSmrg	  ;;
479734977a2fSmrg	ia64*)
479834977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
479934977a2fSmrg	  ;;
480034977a2fSmrg	*)
480134977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
480234977a2fSmrg	  ;;
480334977a2fSmrg	esac
480434977a2fSmrg      else
480534977a2fSmrg	case $host_cpu in
480634977a2fSmrg	hppa*64*)
480734977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
480834977a2fSmrg	  ;;
480934977a2fSmrg	ia64*)
481034977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
481134977a2fSmrg	  ;;
481234977a2fSmrg	*)
481334977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
481434977a2fSmrg	  ;;
481534977a2fSmrg	esac
481634977a2fSmrg      fi
481734977a2fSmrg      if test "$with_gnu_ld" = no; then
481834977a2fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
481934977a2fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
4820ee3138f1Smrg
482134977a2fSmrg	case $host_cpu in
482234977a2fSmrg	hppa*64*|ia64*)
482334977a2fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
482434977a2fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
482534977a2fSmrg	  ;;
482634977a2fSmrg	*)
482734977a2fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
482834977a2fSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
482934977a2fSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
483034977a2fSmrg
483134977a2fSmrg	  # hardcode_minus_L: Not really in the search PATH,
483234977a2fSmrg	  # but as the default location of the library.
483334977a2fSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
483434977a2fSmrg	  ;;
483534977a2fSmrg	esac
483634977a2fSmrg      fi
4837ee3138f1Smrg      ;;
483834977a2fSmrg
483934977a2fSmrg    irix5* | irix6* | nonstopux*)
484034977a2fSmrg      if test "$GCC" = yes; then
484134977a2fSmrg	_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'
484234977a2fSmrg	# Try to use the -exported_symbol ld option, if it does not
484334977a2fSmrg	# work, assume that -exports_file does not work either and
484434977a2fSmrg	# implicitly export all symbols.
484534977a2fSmrg        save_LDFLAGS="$LDFLAGS"
484634977a2fSmrg        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
484734977a2fSmrg        AC_LINK_IFELSE(int foo(void) {},
484834977a2fSmrg          _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'
484934977a2fSmrg        )
485034977a2fSmrg        LDFLAGS="$save_LDFLAGS"
485134977a2fSmrg      else
485234977a2fSmrg	_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'
485334977a2fSmrg	_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'
485434977a2fSmrg      fi
485534977a2fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
485634977a2fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
485734977a2fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
485834977a2fSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
485934977a2fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4860ee3138f1Smrg      ;;
4861ee3138f1Smrg
486234977a2fSmrg    netbsd*)
486334977a2fSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
486434977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
486534977a2fSmrg      else
486634977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
486734977a2fSmrg      fi
486834977a2fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
486934977a2fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
487034977a2fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
487134977a2fSmrg      ;;
4872ee3138f1Smrg
487334977a2fSmrg    newsos6)
487434977a2fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
487534977a2fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
487634977a2fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
487734977a2fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
487834977a2fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
487934977a2fSmrg      ;;
4880ee3138f1Smrg
488134977a2fSmrg    *nto* | *qnx*)
488234977a2fSmrg      ;;
4883ee3138f1Smrg
488434977a2fSmrg    openbsd*)
488534977a2fSmrg      if test -f /usr/libexec/ld.so; then
488634977a2fSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
488734977a2fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
488834977a2fSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
488934977a2fSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
489034977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
489134977a2fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
489234977a2fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
489334977a2fSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
489434977a2fSmrg	else
489534977a2fSmrg	  case $host_os in
489634977a2fSmrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
489734977a2fSmrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
489834977a2fSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
489934977a2fSmrg	     ;;
490034977a2fSmrg	   *)
490134977a2fSmrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
490234977a2fSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
490334977a2fSmrg	     ;;
490434977a2fSmrg	  esac
490534977a2fSmrg	fi
490634977a2fSmrg      else
490734977a2fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
490834977a2fSmrg      fi
490934977a2fSmrg      ;;
4910ee3138f1Smrg
491134977a2fSmrg    os2*)
491234977a2fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
491334977a2fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
491434977a2fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
491534977a2fSmrg      _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'
491634977a2fSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
491734977a2fSmrg      ;;
4918ee3138f1Smrg
491934977a2fSmrg    osf3*)
492034977a2fSmrg      if test "$GCC" = yes; then
492134977a2fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
492234977a2fSmrg	_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'
492334977a2fSmrg      else
492434977a2fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
492534977a2fSmrg	_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'
492634977a2fSmrg      fi
492734977a2fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
492834977a2fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
492934977a2fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
493034977a2fSmrg      ;;
4931ee3138f1Smrg
493234977a2fSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
493334977a2fSmrg      if test "$GCC" = yes; then
493434977a2fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
493534977a2fSmrg	_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'
493634977a2fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
493734977a2fSmrg      else
493834977a2fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
493934977a2fSmrg	_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'
494034977a2fSmrg	_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~
494134977a2fSmrg	$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'
4942ee3138f1Smrg
494334977a2fSmrg	# Both c and cxx compiler support -rpath directly
494434977a2fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
494534977a2fSmrg      fi
494634977a2fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
494734977a2fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
494834977a2fSmrg      ;;
4949ee3138f1Smrg
495034977a2fSmrg    solaris*)
495134977a2fSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
495234977a2fSmrg      if test "$GCC" = yes; then
495334977a2fSmrg	wlarc='${wl}'
495434977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
495534977a2fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
495634977a2fSmrg	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
495734977a2fSmrg      else
495834977a2fSmrg	case `$CC -V 2>&1` in
495934977a2fSmrg	*"Compilers 5.0"*)
496034977a2fSmrg	  wlarc=''
496134977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
496234977a2fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
496334977a2fSmrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
496434977a2fSmrg	  ;;
496534977a2fSmrg	*)
496634977a2fSmrg	  wlarc='${wl}'
496734977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
496834977a2fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
496934977a2fSmrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
497034977a2fSmrg	  ;;
497134977a2fSmrg	esac
497234977a2fSmrg      fi
497334977a2fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
497434977a2fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
497534977a2fSmrg      case $host_os in
497634977a2fSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
497734977a2fSmrg      *)
497834977a2fSmrg	# The compiler driver will combine and reorder linker options,
497934977a2fSmrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
498034977a2fSmrg	# but is careful enough not to reorder.
498134977a2fSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
498234977a2fSmrg	if test "$GCC" = yes; then
498334977a2fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
498434977a2fSmrg	else
498534977a2fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
498634977a2fSmrg	fi
498734977a2fSmrg	;;
498834977a2fSmrg      esac
498934977a2fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
499034977a2fSmrg      ;;
4991ee3138f1Smrg
499234977a2fSmrg    sunos4*)
499334977a2fSmrg      if test "x$host_vendor" = xsequent; then
499434977a2fSmrg	# Use $CC to link under sequent, because it throws in some extra .o
499534977a2fSmrg	# files that make .init and .fini sections work.
499634977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
499734977a2fSmrg      else
499834977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
499934977a2fSmrg      fi
500034977a2fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
500134977a2fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
500234977a2fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
500334977a2fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
500434977a2fSmrg      ;;
5005ee3138f1Smrg
500634977a2fSmrg    sysv4)
500734977a2fSmrg      case $host_vendor in
500834977a2fSmrg	sni)
500934977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
501034977a2fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
501134977a2fSmrg	;;
501234977a2fSmrg	siemens)
501334977a2fSmrg	  ## LD is ld it makes a PLAMLIB
501434977a2fSmrg	  ## CC just makes a GrossModule.
501534977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
501634977a2fSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
501734977a2fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
501834977a2fSmrg        ;;
501934977a2fSmrg	motorola)
502034977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
502134977a2fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
502234977a2fSmrg	;;
502334977a2fSmrg      esac
502434977a2fSmrg      runpath_var='LD_RUN_PATH'
502534977a2fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
502634977a2fSmrg      ;;
5027ee3138f1Smrg
502834977a2fSmrg    sysv4.3*)
502934977a2fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
503034977a2fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
503134977a2fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
503234977a2fSmrg      ;;
5033ee3138f1Smrg
503434977a2fSmrg    sysv4*MP*)
503534977a2fSmrg      if test -d /usr/nec; then
503634977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
503734977a2fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
503834977a2fSmrg	runpath_var=LD_RUN_PATH
503934977a2fSmrg	hardcode_runpath_var=yes
504034977a2fSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
504134977a2fSmrg      fi
504234977a2fSmrg      ;;
5043ee3138f1Smrg
504434977a2fSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
504534977a2fSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
504634977a2fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
504734977a2fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
504834977a2fSmrg      runpath_var='LD_RUN_PATH'
5049ee3138f1Smrg
505034977a2fSmrg      if test "$GCC" = yes; then
505134977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
505234977a2fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
505334977a2fSmrg      else
505434977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
505534977a2fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
505634977a2fSmrg      fi
505734977a2fSmrg      ;;
5058ee3138f1Smrg
505934977a2fSmrg    sysv5* | sco3.2v5* | sco5v6*)
506034977a2fSmrg      # Note: We can NOT use -z defs as we might desire, because we do not
506134977a2fSmrg      # link with -lc, and that would cause any symbols used from libc to
506234977a2fSmrg      # always be unresolved, which means just about no library would
506334977a2fSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
506434977a2fSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
506534977a2fSmrg      # as -z defs.
506634977a2fSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
506734977a2fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
506834977a2fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
506934977a2fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
507034977a2fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
507134977a2fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
507234977a2fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
507334977a2fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
507434977a2fSmrg      runpath_var='LD_RUN_PATH'
5075ee3138f1Smrg
507634977a2fSmrg      if test "$GCC" = yes; then
507734977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
507834977a2fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
507934977a2fSmrg      else
508034977a2fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
508134977a2fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
508234977a2fSmrg      fi
508334977a2fSmrg      ;;
5084ee3138f1Smrg
508534977a2fSmrg    uts4*)
508634977a2fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
508734977a2fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
508834977a2fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
508934977a2fSmrg      ;;
5090ee3138f1Smrg
509134977a2fSmrg    *)
509234977a2fSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
509334977a2fSmrg      ;;
509434977a2fSmrg    esac
5095ee3138f1Smrg
509634977a2fSmrg    if test x$host_vendor = xsni; then
509734977a2fSmrg      case $host in
509834977a2fSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
509934977a2fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
510034977a2fSmrg	;;
510134977a2fSmrg      esac
510234977a2fSmrg    fi
510334977a2fSmrg  fi
510434977a2fSmrg])
510534977a2fSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
510634977a2fSmrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5107ee3138f1Smrg
510834977a2fSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5109ee3138f1Smrg
511034977a2fSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
511134977a2fSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
511234977a2fSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
511334977a2fSmrg    [The commands to extract the exported symbol list from a shared archive])
5114ee3138f1Smrg
511534977a2fSmrg#
511634977a2fSmrg# Do we need to explicitly link libc?
511734977a2fSmrg#
511834977a2fSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
511934977a2fSmrgx|xyes)
512034977a2fSmrg  # Assume -lc should be added
512134977a2fSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5122ee3138f1Smrg
512334977a2fSmrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
512434977a2fSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
512534977a2fSmrg    *'~'*)
512634977a2fSmrg      # FIXME: we may have to deal with multi-command sequences.
512734977a2fSmrg      ;;
512834977a2fSmrg    '$CC '*)
512934977a2fSmrg      # Test whether the compiler implicitly links with -lc since on some
513034977a2fSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
513134977a2fSmrg      # to ld, don't add -lc before -lgcc.
513234977a2fSmrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
513334977a2fSmrg      $RM conftest*
513434977a2fSmrg      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5135ee3138f1Smrg
513634977a2fSmrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
513734977a2fSmrg        soname=conftest
513834977a2fSmrg        lib=conftest
513934977a2fSmrg        libobjs=conftest.$ac_objext
514034977a2fSmrg        deplibs=
514134977a2fSmrg        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
514234977a2fSmrg	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
514334977a2fSmrg        compiler_flags=-v
514434977a2fSmrg        linker_flags=-v
514534977a2fSmrg        verstring=
514634977a2fSmrg        output_objdir=.
514734977a2fSmrg        libname=conftest
514834977a2fSmrg        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
514934977a2fSmrg        _LT_TAGVAR(allow_undefined_flag, $1)=
515034977a2fSmrg        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
515134977a2fSmrg        then
515234977a2fSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
515334977a2fSmrg        else
515434977a2fSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
515534977a2fSmrg        fi
515634977a2fSmrg        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
515734977a2fSmrg      else
515834977a2fSmrg        cat conftest.err 1>&5
515934977a2fSmrg      fi
516034977a2fSmrg      $RM conftest*
516134977a2fSmrg      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
516234977a2fSmrg      ;;
516334977a2fSmrg    esac
516434977a2fSmrg  fi
516534977a2fSmrg  ;;
516634977a2fSmrgesac
5167ee3138f1Smrg
516834977a2fSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
516934977a2fSmrg    [Whether or not to add -lc for building shared libraries])
517034977a2fSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
517134977a2fSmrg    [enable_shared_with_static_runtimes], [0],
517234977a2fSmrg    [Whether or not to disallow shared libs when runtime libs are static])
517334977a2fSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
517434977a2fSmrg    [Compiler flag to allow reflexive dlopens])
517534977a2fSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
517634977a2fSmrg    [Compiler flag to generate shared objects directly from archives])
517734977a2fSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
517834977a2fSmrg    [Whether the compiler copes with passing no objects directly])
517934977a2fSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
518034977a2fSmrg    [Create an old-style archive from a shared archive])
518134977a2fSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
518234977a2fSmrg    [Create a temporary old-style archive to link instead of a shared archive])
518334977a2fSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
518434977a2fSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
518534977a2fSmrg_LT_TAGDECL([], [module_cmds], [2],
518634977a2fSmrg    [Commands used to build a loadable module if different from building
518734977a2fSmrg    a shared archive.])
518834977a2fSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
518934977a2fSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
519034977a2fSmrg    [Whether we are building with GNU ld or not])
519134977a2fSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
519234977a2fSmrg    [Flag that allows shared libraries with undefined symbols to be built])
519334977a2fSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
519434977a2fSmrg    [Flag that enforces no undefined symbols])
519534977a2fSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
519634977a2fSmrg    [Flag to hardcode $libdir into a binary during linking.
519734977a2fSmrg    This must work even if $libdir does not exist])
519834977a2fSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
519934977a2fSmrg    [[If ld is used when linking, flag to hardcode $libdir into a binary
520034977a2fSmrg    during linking.  This must work even if $libdir does not exist]])
520134977a2fSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
520234977a2fSmrg    [Whether we need a single "-rpath" flag with a separated argument])
520334977a2fSmrg_LT_TAGDECL([], [hardcode_direct], [0],
520434977a2fSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
520534977a2fSmrg    DIR into the resulting binary])
520634977a2fSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
520734977a2fSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
520834977a2fSmrg    DIR into the resulting binary and the resulting library dependency is
520934977a2fSmrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
521034977a2fSmrg    library is relocated])
521134977a2fSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
521234977a2fSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
521334977a2fSmrg    into the resulting binary])
521434977a2fSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
521534977a2fSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
521634977a2fSmrg    into the resulting binary])
521734977a2fSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
521834977a2fSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
521934977a2fSmrg    into the library and all subsequent libraries and executables linked
522034977a2fSmrg    against it])
522134977a2fSmrg_LT_TAGDECL([], [inherit_rpath], [0],
522234977a2fSmrg    [Set to yes if linker adds runtime paths of dependent libraries
522334977a2fSmrg    to runtime path list])
522434977a2fSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
522534977a2fSmrg    [Whether libtool must link a program against all its dependency libraries])
522634977a2fSmrg_LT_TAGDECL([], [fix_srcfile_path], [1],
522734977a2fSmrg    [Fix the shell variable $srcfile for the compiler])
522834977a2fSmrg_LT_TAGDECL([], [always_export_symbols], [0],
522934977a2fSmrg    [Set to "yes" if exported symbols are required])
523034977a2fSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
523134977a2fSmrg    [The commands to list exported symbols])
523234977a2fSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
523334977a2fSmrg    [Symbols that should not be listed in the preloaded symbols])
523434977a2fSmrg_LT_TAGDECL([], [include_expsyms], [1],
523534977a2fSmrg    [Symbols that must always be exported])
523634977a2fSmrg_LT_TAGDECL([], [prelink_cmds], [2],
523734977a2fSmrg    [Commands necessary for linking programs (against libraries) with templates])
523834977a2fSmrg_LT_TAGDECL([], [file_list_spec], [1],
523934977a2fSmrg    [Specify filename containing input files])
524034977a2fSmrgdnl FIXME: Not yet implemented
524134977a2fSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
524234977a2fSmrgdnl    [Compiler flag to generate thread safe objects])
524334977a2fSmrg])# _LT_LINKER_SHLIBS
524434977a2fSmrg
524534977a2fSmrg
524634977a2fSmrg# _LT_LANG_C_CONFIG([TAG])
524734977a2fSmrg# ------------------------
524834977a2fSmrg# Ensure that the configuration variables for a C compiler are suitably
524934977a2fSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
525034977a2fSmrg# the compiler configuration to `libtool'.
525134977a2fSmrgm4_defun([_LT_LANG_C_CONFIG],
525234977a2fSmrg[m4_require([_LT_DECL_EGREP])dnl
525334977a2fSmrglt_save_CC="$CC"
525434977a2fSmrgAC_LANG_PUSH(C)
5255ee3138f1Smrg
525634977a2fSmrg# Source file extension for C test sources.
525734977a2fSmrgac_ext=c
5258ee3138f1Smrg
525934977a2fSmrg# Object file extension for compiled C test sources.
526034977a2fSmrgobjext=o
526134977a2fSmrg_LT_TAGVAR(objext, $1)=$objext
5262ee3138f1Smrg
526334977a2fSmrg# Code to be used in simple compile tests
526434977a2fSmrglt_simple_compile_test_code="int some_variable = 0;"
5265ee3138f1Smrg
526634977a2fSmrg# Code to be used in simple link tests
526734977a2fSmrglt_simple_link_test_code='int main(){return(0);}'
5268ee3138f1Smrg
526934977a2fSmrg_LT_TAG_COMPILER
527034977a2fSmrg# Save the default compiler, since it gets overwritten when the other
527134977a2fSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
527234977a2fSmrgcompiler_DEFAULT=$CC
5273ee3138f1Smrg
527434977a2fSmrg# save warnings/boilerplate of simple test code
527534977a2fSmrg_LT_COMPILER_BOILERPLATE
527634977a2fSmrg_LT_LINKER_BOILERPLATE
5277ee3138f1Smrg
527834977a2fSmrgif test -n "$compiler"; then
527934977a2fSmrg  _LT_COMPILER_NO_RTTI($1)
528034977a2fSmrg  _LT_COMPILER_PIC($1)
528134977a2fSmrg  _LT_COMPILER_C_O($1)
528234977a2fSmrg  _LT_COMPILER_FILE_LOCKS($1)
528334977a2fSmrg  _LT_LINKER_SHLIBS($1)
528434977a2fSmrg  _LT_SYS_DYNAMIC_LINKER($1)
528534977a2fSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
528634977a2fSmrg  LT_SYS_DLOPEN_SELF
528734977a2fSmrg  _LT_CMD_STRIPLIB
528834977a2fSmrg
528934977a2fSmrg  # Report which library types will actually be built
529034977a2fSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
529134977a2fSmrg  AC_MSG_RESULT([$can_build_shared])
529234977a2fSmrg
529334977a2fSmrg  AC_MSG_CHECKING([whether to build shared libraries])
529434977a2fSmrg  test "$can_build_shared" = "no" && enable_shared=no
529534977a2fSmrg
529634977a2fSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
529734977a2fSmrg  # are all built from PIC.
529834977a2fSmrg  case $host_os in
529934977a2fSmrg  aix3*)
530034977a2fSmrg    test "$enable_shared" = yes && enable_static=no
530134977a2fSmrg    if test -n "$RANLIB"; then
530234977a2fSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
530334977a2fSmrg      postinstall_cmds='$RANLIB $lib'
530434977a2fSmrg    fi
530534977a2fSmrg    ;;
5306ee3138f1Smrg
530734977a2fSmrg  aix[[4-9]]*)
530834977a2fSmrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
530934977a2fSmrg      test "$enable_shared" = yes && enable_static=no
531034977a2fSmrg    fi
531134977a2fSmrg    ;;
531234977a2fSmrg  esac
531334977a2fSmrg  AC_MSG_RESULT([$enable_shared])
5314ee3138f1Smrg
531534977a2fSmrg  AC_MSG_CHECKING([whether to build static libraries])
531634977a2fSmrg  # Make sure either enable_shared or enable_static is yes.
531734977a2fSmrg  test "$enable_shared" = yes || enable_static=yes
531834977a2fSmrg  AC_MSG_RESULT([$enable_static])
5319ee3138f1Smrg
532034977a2fSmrg  _LT_CONFIG($1)
532134977a2fSmrgfi
532234977a2fSmrgAC_LANG_POP
532334977a2fSmrgCC="$lt_save_CC"
532434977a2fSmrg])# _LT_LANG_C_CONFIG
5325ee3138f1Smrg
5326ee3138f1Smrg
532734977a2fSmrg# _LT_PROG_CXX
532834977a2fSmrg# ------------
532934977a2fSmrg# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
533034977a2fSmrg# compiler, we have our own version here.
533134977a2fSmrgm4_defun([_LT_PROG_CXX],
533234977a2fSmrg[
533334977a2fSmrgpushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
533434977a2fSmrgAC_PROG_CXX
533534977a2fSmrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
533634977a2fSmrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
533734977a2fSmrg    (test "X$CXX" != "Xg++"))) ; then
533834977a2fSmrg  AC_PROG_CXXCPP
533934977a2fSmrgelse
534034977a2fSmrg  _lt_caught_CXX_error=yes
534134977a2fSmrgfi
534234977a2fSmrgpopdef([AC_MSG_ERROR])
534334977a2fSmrg])# _LT_PROG_CXX
5344ee3138f1Smrg
534534977a2fSmrgdnl aclocal-1.4 backwards compatibility:
534634977a2fSmrgdnl AC_DEFUN([_LT_PROG_CXX], [])
5347ee3138f1Smrg
5348ee3138f1Smrg
534934977a2fSmrg# _LT_LANG_CXX_CONFIG([TAG])
535034977a2fSmrg# --------------------------
535134977a2fSmrg# Ensure that the configuration variables for a C++ compiler are suitably
535234977a2fSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
535334977a2fSmrg# the compiler configuration to `libtool'.
535434977a2fSmrgm4_defun([_LT_LANG_CXX_CONFIG],
535534977a2fSmrg[AC_REQUIRE([_LT_PROG_CXX])dnl
535634977a2fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
535734977a2fSmrgm4_require([_LT_DECL_EGREP])dnl
535834977a2fSmrg
535934977a2fSmrgAC_LANG_PUSH(C++)
536034977a2fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
536134977a2fSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
536234977a2fSmrg_LT_TAGVAR(always_export_symbols, $1)=no
536334977a2fSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
536434977a2fSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
536534977a2fSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
536634977a2fSmrg_LT_TAGVAR(hardcode_direct, $1)=no
536734977a2fSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
536834977a2fSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
536934977a2fSmrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
537034977a2fSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
537134977a2fSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
537234977a2fSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
537334977a2fSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
537434977a2fSmrg_LT_TAGVAR(inherit_rpath, $1)=no
537534977a2fSmrg_LT_TAGVAR(module_cmds, $1)=
537634977a2fSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
537734977a2fSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
537834977a2fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
537934977a2fSmrg_LT_TAGVAR(no_undefined_flag, $1)=
538034977a2fSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
538134977a2fSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5382ee3138f1Smrg
538334977a2fSmrg# Source file extension for C++ test sources.
538434977a2fSmrgac_ext=cpp
5385ee3138f1Smrg
538634977a2fSmrg# Object file extension for compiled C++ test sources.
538734977a2fSmrgobjext=o
538834977a2fSmrg_LT_TAGVAR(objext, $1)=$objext
538934977a2fSmrg
539034977a2fSmrg# No sense in running all these tests if we already determined that
539134977a2fSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
539234977a2fSmrg# are currently assumed to apply to all compilers on this platform,
539334977a2fSmrg# and will be corrupted by setting them based on a non-working compiler.
539434977a2fSmrgif test "$_lt_caught_CXX_error" != yes; then
539534977a2fSmrg  # Code to be used in simple compile tests
539634977a2fSmrg  lt_simple_compile_test_code="int some_variable = 0;"
539734977a2fSmrg
539834977a2fSmrg  # Code to be used in simple link tests
539934977a2fSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
540034977a2fSmrg
540134977a2fSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
540234977a2fSmrg  _LT_TAG_COMPILER
540334977a2fSmrg
540434977a2fSmrg  # save warnings/boilerplate of simple test code
540534977a2fSmrg  _LT_COMPILER_BOILERPLATE
540634977a2fSmrg  _LT_LINKER_BOILERPLATE
540734977a2fSmrg
540834977a2fSmrg  # Allow CC to be a program name with arguments.
540934977a2fSmrg  lt_save_CC=$CC
541034977a2fSmrg  lt_save_LD=$LD
541134977a2fSmrg  lt_save_GCC=$GCC
541234977a2fSmrg  GCC=$GXX
541334977a2fSmrg  lt_save_with_gnu_ld=$with_gnu_ld
541434977a2fSmrg  lt_save_path_LD=$lt_cv_path_LD
541534977a2fSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
541634977a2fSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
541734977a2fSmrg  else
541834977a2fSmrg    $as_unset lt_cv_prog_gnu_ld
541934977a2fSmrg  fi
542034977a2fSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
542134977a2fSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
542234977a2fSmrg  else
542334977a2fSmrg    $as_unset lt_cv_path_LD
542434977a2fSmrg  fi
542534977a2fSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
542634977a2fSmrg  CC=${CXX-"c++"}
542734977a2fSmrg  compiler=$CC
542834977a2fSmrg  _LT_TAGVAR(compiler, $1)=$CC
542934977a2fSmrg  _LT_CC_BASENAME([$compiler])
5430ee3138f1Smrg
543134977a2fSmrg  if test -n "$compiler"; then
543234977a2fSmrg    # We don't want -fno-exception when compiling C++ code, so set the
543334977a2fSmrg    # no_builtin_flag separately
543434977a2fSmrg    if test "$GXX" = yes; then
543534977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
543634977a2fSmrg    else
543734977a2fSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
543834977a2fSmrg    fi
5439ee3138f1Smrg
544034977a2fSmrg    if test "$GXX" = yes; then
544134977a2fSmrg      # Set up default GNU C++ configuration
5442ee3138f1Smrg
544334977a2fSmrg      LT_PATH_LD
5444ee3138f1Smrg
544534977a2fSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
544634977a2fSmrg      # archiving commands below assume that GNU ld is being used.
544734977a2fSmrg      if test "$with_gnu_ld" = yes; then
544834977a2fSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
544934977a2fSmrg        _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'
5450ee3138f1Smrg
545134977a2fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
545234977a2fSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5453ee3138f1Smrg
545434977a2fSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
545534977a2fSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
545634977a2fSmrg        #     investigate it a little bit more. (MM)
545734977a2fSmrg        wlarc='${wl}'
5458ee3138f1Smrg
545934977a2fSmrg        # ancient GNU ld didn't support --whole-archive et. al.
546034977a2fSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
546134977a2fSmrg	  $GREP 'no-whole-archive' > /dev/null; then
546234977a2fSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
546334977a2fSmrg        else
546434977a2fSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
546534977a2fSmrg        fi
546634977a2fSmrg      else
546734977a2fSmrg        with_gnu_ld=no
546834977a2fSmrg        wlarc=
546934977a2fSmrg
547034977a2fSmrg        # A generic and very simple default shared library creation
547134977a2fSmrg        # command for GNU C++ for the case where it uses the native
547234977a2fSmrg        # linker, instead of GNU ld.  If possible, this setting should
547334977a2fSmrg        # overridden to take advantage of the native linker features on
547434977a2fSmrg        # the platform it is being used on.
547534977a2fSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
547634977a2fSmrg      fi
5477ee3138f1Smrg
547834977a2fSmrg      # Commands to make compiler produce verbose output that lists
547934977a2fSmrg      # what "hidden" libraries, object files and flags are used when
548034977a2fSmrg      # linking a shared library.
548134977a2fSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
5482ee3138f1Smrg
548334977a2fSmrg    else
548434977a2fSmrg      GXX=no
548534977a2fSmrg      with_gnu_ld=no
548634977a2fSmrg      wlarc=
548734977a2fSmrg    fi
5488ee3138f1Smrg
548934977a2fSmrg    # PORTME: fill in a description of your system's C++ link characteristics
549034977a2fSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
549134977a2fSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
549234977a2fSmrg    case $host_os in
549334977a2fSmrg      aix3*)
549434977a2fSmrg        # FIXME: insert proper C++ library support
549534977a2fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
549634977a2fSmrg        ;;
549734977a2fSmrg      aix[[4-9]]*)
549834977a2fSmrg        if test "$host_cpu" = ia64; then
549934977a2fSmrg          # On IA64, the linker does run time linking by default, so we don't
550034977a2fSmrg          # have to do anything special.
550134977a2fSmrg          aix_use_runtimelinking=no
550234977a2fSmrg          exp_sym_flag='-Bexport'
550334977a2fSmrg          no_entry_flag=""
550434977a2fSmrg        else
550534977a2fSmrg          aix_use_runtimelinking=no
550634977a2fSmrg
550734977a2fSmrg          # Test if we are trying to use run time linking or normal
550834977a2fSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
550934977a2fSmrg          # need to do runtime linking.
551034977a2fSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
551134977a2fSmrg	    for ld_flag in $LDFLAGS; do
551234977a2fSmrg	      case $ld_flag in
551334977a2fSmrg	      *-brtl*)
551434977a2fSmrg	        aix_use_runtimelinking=yes
551534977a2fSmrg	        break
551634977a2fSmrg	        ;;
551734977a2fSmrg	      esac
551834977a2fSmrg	    done
551934977a2fSmrg	    ;;
552034977a2fSmrg          esac
5521ee3138f1Smrg
552234977a2fSmrg          exp_sym_flag='-bexport'
552334977a2fSmrg          no_entry_flag='-bnoentry'
552434977a2fSmrg        fi
5525ee3138f1Smrg
552634977a2fSmrg        # When large executables or shared objects are built, AIX ld can
552734977a2fSmrg        # have problems creating the table of contents.  If linking a library
552834977a2fSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
552934977a2fSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
553034977a2fSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
553134977a2fSmrg
553234977a2fSmrg        _LT_TAGVAR(archive_cmds, $1)=''
553334977a2fSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
553434977a2fSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
553534977a2fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
553634977a2fSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
553734977a2fSmrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
553834977a2fSmrg
553934977a2fSmrg        if test "$GXX" = yes; then
554034977a2fSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
554134977a2fSmrg          # We only want to do this on AIX 4.2 and lower, the check
554234977a2fSmrg          # below for broken collect2 doesn't work under 4.3+
554334977a2fSmrg	  collect2name=`${CC} -print-prog-name=collect2`
554434977a2fSmrg	  if test -f "$collect2name" &&
554534977a2fSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
554634977a2fSmrg	  then
554734977a2fSmrg	    # We have reworked collect2
554834977a2fSmrg	    :
554934977a2fSmrg	  else
555034977a2fSmrg	    # We have old collect2
555134977a2fSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
555234977a2fSmrg	    # It fails to find uninstalled libraries when the uninstalled
555334977a2fSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
555434977a2fSmrg	    # to unsupported forces relinking
555534977a2fSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
555634977a2fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
555734977a2fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
555834977a2fSmrg	  fi
555934977a2fSmrg          esac
556034977a2fSmrg          shared_flag='-shared'
556134977a2fSmrg	  if test "$aix_use_runtimelinking" = yes; then
556234977a2fSmrg	    shared_flag="$shared_flag "'${wl}-G'
556334977a2fSmrg	  fi
556434977a2fSmrg        else
556534977a2fSmrg          # not using gcc
556634977a2fSmrg          if test "$host_cpu" = ia64; then
556734977a2fSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
556834977a2fSmrg	  # chokes on -Wl,-G. The following line is correct:
556934977a2fSmrg	  shared_flag='-G'
557034977a2fSmrg          else
557134977a2fSmrg	    if test "$aix_use_runtimelinking" = yes; then
557234977a2fSmrg	      shared_flag='${wl}-G'
557334977a2fSmrg	    else
557434977a2fSmrg	      shared_flag='${wl}-bM:SRE'
557534977a2fSmrg	    fi
557634977a2fSmrg          fi
557734977a2fSmrg        fi
5578ee3138f1Smrg
557934977a2fSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
558034977a2fSmrg        # It seems that -bexpall does not export symbols beginning with
558134977a2fSmrg        # underscore (_), so it is better to generate a list of symbols to
558234977a2fSmrg	# export.
558334977a2fSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
558434977a2fSmrg        if test "$aix_use_runtimelinking" = yes; then
558534977a2fSmrg          # Warning - without using the other runtime loading flags (-brtl),
558634977a2fSmrg          # -berok will link without error, but may produce a broken library.
558734977a2fSmrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
558834977a2fSmrg          # Determine the default libpath from the value encoded in an empty
558934977a2fSmrg          # executable.
559034977a2fSmrg          _LT_SYS_MODULE_PATH_AIX
559134977a2fSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
559234977a2fSmrg
559334977a2fSmrg          _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"
559434977a2fSmrg        else
559534977a2fSmrg          if test "$host_cpu" = ia64; then
559634977a2fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
559734977a2fSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
559834977a2fSmrg	    _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"
559934977a2fSmrg          else
560034977a2fSmrg	    # Determine the default libpath from the value encoded in an
560134977a2fSmrg	    # empty executable.
560234977a2fSmrg	    _LT_SYS_MODULE_PATH_AIX
560334977a2fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
560434977a2fSmrg	    # Warning - without using the other run time loading flags,
560534977a2fSmrg	    # -berok will link without error, but may produce a broken library.
560634977a2fSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
560734977a2fSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
560834977a2fSmrg	    # Exported symbols can be pulled into shared objects from archives
560934977a2fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
561034977a2fSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
561134977a2fSmrg	    # This is similar to how AIX traditionally builds its shared
561234977a2fSmrg	    # libraries.
561334977a2fSmrg	    _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'
561434977a2fSmrg          fi
561534977a2fSmrg        fi
561634977a2fSmrg        ;;
5617ee3138f1Smrg
561834977a2fSmrg      beos*)
561934977a2fSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
562034977a2fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
562134977a2fSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
562234977a2fSmrg	  # support --undefined.  This deserves some investigation.  FIXME
562334977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
562434977a2fSmrg	else
562534977a2fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
562634977a2fSmrg	fi
562734977a2fSmrg	;;
5628ee3138f1Smrg
562934977a2fSmrg      chorus*)
563034977a2fSmrg        case $cc_basename in
563134977a2fSmrg          *)
563234977a2fSmrg	  # FIXME: insert proper C++ library support
563334977a2fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
563434977a2fSmrg	  ;;
563534977a2fSmrg        esac
563634977a2fSmrg        ;;
5637ee3138f1Smrg
563834977a2fSmrg      cygwin* | mingw* | pw32* | cegcc*)
563934977a2fSmrg        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
564034977a2fSmrg        # as there is no search path for DLLs.
564134977a2fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
564234977a2fSmrg        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
564334977a2fSmrg        _LT_TAGVAR(always_export_symbols, $1)=no
564434977a2fSmrg        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
564534977a2fSmrg
564634977a2fSmrg        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
564734977a2fSmrg          _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'
564834977a2fSmrg          # If the export-symbols file already is a .def file (1st line
564934977a2fSmrg          # is EXPORTS), use it as is; otherwise, prepend...
565034977a2fSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
565134977a2fSmrg	    cp $export_symbols $output_objdir/$soname.def;
565234977a2fSmrg          else
565334977a2fSmrg	    echo EXPORTS > $output_objdir/$soname.def;
565434977a2fSmrg	    cat $export_symbols >> $output_objdir/$soname.def;
565534977a2fSmrg          fi~
565634977a2fSmrg          $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'
565734977a2fSmrg        else
565834977a2fSmrg          _LT_TAGVAR(ld_shlibs, $1)=no
565934977a2fSmrg        fi
566034977a2fSmrg        ;;
566134977a2fSmrg      darwin* | rhapsody*)
566234977a2fSmrg        _LT_DARWIN_LINKER_FEATURES($1)
566334977a2fSmrg	;;
5664ee3138f1Smrg
566534977a2fSmrg      dgux*)
566634977a2fSmrg        case $cc_basename in
566734977a2fSmrg          ec++*)
566834977a2fSmrg	    # FIXME: insert proper C++ library support
566934977a2fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
567034977a2fSmrg	    ;;
567134977a2fSmrg          ghcx*)
567234977a2fSmrg	    # Green Hills C++ Compiler
567334977a2fSmrg	    # FIXME: insert proper C++ library support
567434977a2fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
567534977a2fSmrg	    ;;
567634977a2fSmrg          *)
567734977a2fSmrg	    # FIXME: insert proper C++ library support
567834977a2fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
567934977a2fSmrg	    ;;
568034977a2fSmrg        esac
568134977a2fSmrg        ;;
568234977a2fSmrg
568334977a2fSmrg      freebsd[[12]]*)
568434977a2fSmrg        # C++ shared libraries reported to be fairly broken before
568534977a2fSmrg	# switch to ELF
568634977a2fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
568734977a2fSmrg        ;;
5688ee3138f1Smrg
568934977a2fSmrg      freebsd-elf*)
569034977a2fSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
569134977a2fSmrg        ;;
5692ee3138f1Smrg
569334977a2fSmrg      freebsd* | dragonfly*)
569434977a2fSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
569534977a2fSmrg        # conventions
569634977a2fSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
569734977a2fSmrg        ;;
5698ee3138f1Smrg
569934977a2fSmrg      gnu*)
570034977a2fSmrg        ;;
5701ee3138f1Smrg
570234977a2fSmrg      hpux9*)
570334977a2fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
570434977a2fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
570534977a2fSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
570634977a2fSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
570734977a2fSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
570834977a2fSmrg				             # but as the default
570934977a2fSmrg				             # location of the library.
571034977a2fSmrg
571134977a2fSmrg        case $cc_basename in
571234977a2fSmrg          CC*)
571334977a2fSmrg            # FIXME: insert proper C++ library support
571434977a2fSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
571534977a2fSmrg            ;;
571634977a2fSmrg          aCC*)
571734977a2fSmrg            _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'
571834977a2fSmrg            # Commands to make compiler produce verbose output that lists
571934977a2fSmrg            # what "hidden" libraries, object files and flags are used when
572034977a2fSmrg            # linking a shared library.
572134977a2fSmrg            #
572234977a2fSmrg            # There doesn't appear to be a way to prevent this compiler from
572334977a2fSmrg            # explicitly linking system object files so we need to strip them
572434977a2fSmrg            # from the output so that they don't get included in the library
572534977a2fSmrg            # dependencies.
572634977a2fSmrg            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'
572734977a2fSmrg            ;;
572834977a2fSmrg          *)
572934977a2fSmrg            if test "$GXX" = yes; then
573034977a2fSmrg              _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'
573134977a2fSmrg            else
573234977a2fSmrg              # FIXME: insert proper C++ library support
573334977a2fSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
573434977a2fSmrg            fi
573534977a2fSmrg            ;;
573634977a2fSmrg        esac
573734977a2fSmrg        ;;
5738ee3138f1Smrg
573934977a2fSmrg      hpux10*|hpux11*)
574034977a2fSmrg        if test $with_gnu_ld = no; then
574134977a2fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
574234977a2fSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
574334977a2fSmrg
574434977a2fSmrg          case $host_cpu in
574534977a2fSmrg            hppa*64*|ia64*)
574634977a2fSmrg              ;;
574734977a2fSmrg            *)
574834977a2fSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
574934977a2fSmrg              ;;
575034977a2fSmrg          esac
575134977a2fSmrg        fi
575234977a2fSmrg        case $host_cpu in
575334977a2fSmrg          hppa*64*|ia64*)
575434977a2fSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
575534977a2fSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
575634977a2fSmrg            ;;
575734977a2fSmrg          *)
575834977a2fSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
575934977a2fSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
576034977a2fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
576134977a2fSmrg					         # but as the default
576234977a2fSmrg					         # location of the library.
576334977a2fSmrg            ;;
576434977a2fSmrg        esac
576534977a2fSmrg
576634977a2fSmrg        case $cc_basename in
576734977a2fSmrg          CC*)
576834977a2fSmrg	    # FIXME: insert proper C++ library support
576934977a2fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
577034977a2fSmrg	    ;;
577134977a2fSmrg          aCC*)
577234977a2fSmrg	    case $host_cpu in
577334977a2fSmrg	      hppa*64*)
577434977a2fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
577534977a2fSmrg	        ;;
577634977a2fSmrg	      ia64*)
577734977a2fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
577834977a2fSmrg	        ;;
577934977a2fSmrg	      *)
578034977a2fSmrg	        _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'
578134977a2fSmrg	        ;;
578234977a2fSmrg	    esac
578334977a2fSmrg	    # Commands to make compiler produce verbose output that lists
578434977a2fSmrg	    # what "hidden" libraries, object files and flags are used when
578534977a2fSmrg	    # linking a shared library.
578634977a2fSmrg	    #
578734977a2fSmrg	    # There doesn't appear to be a way to prevent this compiler from
578834977a2fSmrg	    # explicitly linking system object files so we need to strip them
578934977a2fSmrg	    # from the output so that they don't get included in the library
579034977a2fSmrg	    # dependencies.
579134977a2fSmrg	    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'
579234977a2fSmrg	    ;;
579334977a2fSmrg          *)
579434977a2fSmrg	    if test "$GXX" = yes; then
579534977a2fSmrg	      if test $with_gnu_ld = no; then
579634977a2fSmrg	        case $host_cpu in
579734977a2fSmrg	          hppa*64*)
579834977a2fSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
579934977a2fSmrg	            ;;
580034977a2fSmrg	          ia64*)
580134977a2fSmrg	            _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'
580234977a2fSmrg	            ;;
580334977a2fSmrg	          *)
580434977a2fSmrg	            _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'
580534977a2fSmrg	            ;;
580634977a2fSmrg	        esac
580734977a2fSmrg	      fi
580834977a2fSmrg	    else
580934977a2fSmrg	      # FIXME: insert proper C++ library support
581034977a2fSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
581134977a2fSmrg	    fi
581234977a2fSmrg	    ;;
581334977a2fSmrg        esac
581434977a2fSmrg        ;;
5815ee3138f1Smrg
581634977a2fSmrg      interix[[3-9]]*)
581734977a2fSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
581834977a2fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
581934977a2fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
582034977a2fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
582134977a2fSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
582234977a2fSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
582334977a2fSmrg	# default) and relocated if they conflict, which is a slow very memory
582434977a2fSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
582534977a2fSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
582634977a2fSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
582734977a2fSmrg	_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'
582834977a2fSmrg	_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'
582934977a2fSmrg	;;
583034977a2fSmrg      irix5* | irix6*)
583134977a2fSmrg        case $cc_basename in
583234977a2fSmrg          CC*)
583334977a2fSmrg	    # SGI C++
583434977a2fSmrg	    _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'
583534977a2fSmrg
583634977a2fSmrg	    # Archives containing C++ object files must be created using
583734977a2fSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
583834977a2fSmrg	    # necessary to make sure instantiated templates are included
583934977a2fSmrg	    # in the archive.
584034977a2fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
584134977a2fSmrg	    ;;
584234977a2fSmrg          *)
584334977a2fSmrg	    if test "$GXX" = yes; then
584434977a2fSmrg	      if test "$with_gnu_ld" = no; then
584534977a2fSmrg	        _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'
584634977a2fSmrg	      else
584734977a2fSmrg	        _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'
584834977a2fSmrg	      fi
584934977a2fSmrg	    fi
585034977a2fSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
585134977a2fSmrg	    ;;
585234977a2fSmrg        esac
585334977a2fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
585434977a2fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
585534977a2fSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
585634977a2fSmrg        ;;
5857ee3138f1Smrg
585834977a2fSmrg      linux* | k*bsd*-gnu)
585934977a2fSmrg        case $cc_basename in
586034977a2fSmrg          KCC*)
586134977a2fSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
586234977a2fSmrg
586334977a2fSmrg	    # KCC will only create a shared library if the output file
586434977a2fSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
586534977a2fSmrg	    # to its proper name (with version) after linking.
586634977a2fSmrg	    _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'
586734977a2fSmrg	    _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'
586834977a2fSmrg	    # Commands to make compiler produce verbose output that lists
586934977a2fSmrg	    # what "hidden" libraries, object files and flags are used when
587034977a2fSmrg	    # linking a shared library.
587134977a2fSmrg	    #
587234977a2fSmrg	    # There doesn't appear to be a way to prevent this compiler from
587334977a2fSmrg	    # explicitly linking system object files so we need to strip them
587434977a2fSmrg	    # from the output so that they don't get included in the library
587534977a2fSmrg	    # dependencies.
587634977a2fSmrg	    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'
587734977a2fSmrg
587834977a2fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
587934977a2fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
588034977a2fSmrg
588134977a2fSmrg	    # Archives containing C++ object files must be created using
588234977a2fSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
588334977a2fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
588434977a2fSmrg	    ;;
588534977a2fSmrg	  icpc* | ecpc* )
588634977a2fSmrg	    # Intel C++
588734977a2fSmrg	    with_gnu_ld=yes
588834977a2fSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
588934977a2fSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
589034977a2fSmrg	    # earlier do not add the objects themselves.
589134977a2fSmrg	    case `$CC -V 2>&1` in
589234977a2fSmrg	      *"Version 7."*)
589334977a2fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
589434977a2fSmrg		_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'
589534977a2fSmrg		;;
589634977a2fSmrg	      *)  # Version 8.0 or newer
589734977a2fSmrg	        tmp_idyn=
589834977a2fSmrg	        case $host_cpu in
589934977a2fSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
590034977a2fSmrg		esac
590134977a2fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
590234977a2fSmrg		_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'
590334977a2fSmrg		;;
590434977a2fSmrg	    esac
590534977a2fSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
590634977a2fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
590734977a2fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
590834977a2fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
590934977a2fSmrg	    ;;
591034977a2fSmrg          pgCC* | pgcpp*)
591134977a2fSmrg            # Portland Group C++ compiler
591234977a2fSmrg	    case `$CC -V` in
591334977a2fSmrg	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
591434977a2fSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
591534977a2fSmrg		rm -rf $tpldir~
591634977a2fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
591734977a2fSmrg		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
591834977a2fSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
591934977a2fSmrg		rm -rf $tpldir~
592034977a2fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
592134977a2fSmrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
592234977a2fSmrg		$RANLIB $oldlib'
592334977a2fSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
592434977a2fSmrg		rm -rf $tpldir~
592534977a2fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
592634977a2fSmrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
592734977a2fSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
592834977a2fSmrg		rm -rf $tpldir~
592934977a2fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
593034977a2fSmrg		$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'
593134977a2fSmrg	      ;;
593234977a2fSmrg	    *) # Version 6 will use weak symbols
593334977a2fSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
593434977a2fSmrg	      _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'
593534977a2fSmrg	      ;;
593634977a2fSmrg	    esac
5937ee3138f1Smrg
593834977a2fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
593934977a2fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
594034977a2fSmrg	    _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'
594134977a2fSmrg            ;;
594234977a2fSmrg	  cxx*)
594334977a2fSmrg	    # Compaq C++
594434977a2fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
594534977a2fSmrg	    _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'
5946ee3138f1Smrg
594734977a2fSmrg	    runpath_var=LD_RUN_PATH
594834977a2fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
594934977a2fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
595079a8a9c6Smrg
595134977a2fSmrg	    # Commands to make compiler produce verbose output that lists
595234977a2fSmrg	    # what "hidden" libraries, object files and flags are used when
595334977a2fSmrg	    # linking a shared library.
595434977a2fSmrg	    #
595534977a2fSmrg	    # There doesn't appear to be a way to prevent this compiler from
595634977a2fSmrg	    # explicitly linking system object files so we need to strip them
595734977a2fSmrg	    # from the output so that they don't get included in the library
595834977a2fSmrg	    # dependencies.
595934977a2fSmrg	    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'
596034977a2fSmrg	    ;;
596134977a2fSmrg	  xl*)
596234977a2fSmrg	    # IBM XL 8.0 on PPC, with GNU ld
596334977a2fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
596434977a2fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
596534977a2fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
596634977a2fSmrg	    if test "x$supports_anon_versioning" = xyes; then
596734977a2fSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
596834977a2fSmrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
596934977a2fSmrg		echo "local: *; };" >> $output_objdir/$libname.ver~
597034977a2fSmrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
597134977a2fSmrg	    fi
597234977a2fSmrg	    ;;
597334977a2fSmrg	  *)
597434977a2fSmrg	    case `$CC -V 2>&1 | sed 5q` in
597534977a2fSmrg	    *Sun\ C*)
597634977a2fSmrg	      # Sun C++ 5.9
597734977a2fSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
597834977a2fSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
597934977a2fSmrg	      _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'
598034977a2fSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
598134977a2fSmrg	      _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'
598234977a2fSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
598334977a2fSmrg
598434977a2fSmrg	      # Not sure whether something based on
598534977a2fSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
598634977a2fSmrg	      # would be better.
598734977a2fSmrg	      output_verbose_link_cmd='echo'
598834977a2fSmrg
598934977a2fSmrg	      # Archives containing C++ object files must be created using
599034977a2fSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
599134977a2fSmrg	      # necessary to make sure instantiated templates are included
599234977a2fSmrg	      # in the archive.
599334977a2fSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
599434977a2fSmrg	      ;;
599534977a2fSmrg	    esac
599634977a2fSmrg	    ;;
599734977a2fSmrg	esac
599834977a2fSmrg	;;
5999ee3138f1Smrg
600034977a2fSmrg      lynxos*)
600134977a2fSmrg        # FIXME: insert proper C++ library support
600234977a2fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
600334977a2fSmrg	;;
6004ee3138f1Smrg
600534977a2fSmrg      m88k*)
600634977a2fSmrg        # FIXME: insert proper C++ library support
600734977a2fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
600834977a2fSmrg	;;
6009ee3138f1Smrg
601034977a2fSmrg      mvs*)
601134977a2fSmrg        case $cc_basename in
601234977a2fSmrg          cxx*)
601334977a2fSmrg	    # FIXME: insert proper C++ library support
601434977a2fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
601534977a2fSmrg	    ;;
601634977a2fSmrg	  *)
601734977a2fSmrg	    # FIXME: insert proper C++ library support
601834977a2fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
601934977a2fSmrg	    ;;
602034977a2fSmrg	esac
602134977a2fSmrg	;;
6022ee3138f1Smrg
602334977a2fSmrg      netbsd*)
602434977a2fSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
602534977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
602634977a2fSmrg	  wlarc=
602734977a2fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
602834977a2fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
602934977a2fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
603034977a2fSmrg	fi
603134977a2fSmrg	# Workaround some broken pre-1.5 toolchains
603234977a2fSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
603334977a2fSmrg	;;
6034ee3138f1Smrg
603534977a2fSmrg      *nto* | *qnx*)
603634977a2fSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
603734977a2fSmrg	;;
6038ee3138f1Smrg
603934977a2fSmrg      openbsd2*)
604034977a2fSmrg        # C++ shared libraries are fairly broken
604134977a2fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
604234977a2fSmrg	;;
6043ee3138f1Smrg
604434977a2fSmrg      openbsd*)
604534977a2fSmrg	if test -f /usr/libexec/ld.so; then
604634977a2fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
604734977a2fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
604834977a2fSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
604934977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
605034977a2fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
605134977a2fSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
605234977a2fSmrg	    _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'
605334977a2fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
605434977a2fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
605534977a2fSmrg	  fi
605634977a2fSmrg	  output_verbose_link_cmd=echo
605734977a2fSmrg	else
605834977a2fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
605934977a2fSmrg	fi
606034977a2fSmrg	;;
6061ee3138f1Smrg
606234977a2fSmrg      osf3* | osf4* | osf5*)
606334977a2fSmrg        case $cc_basename in
606434977a2fSmrg          KCC*)
606534977a2fSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
606634977a2fSmrg
606734977a2fSmrg	    # KCC will only create a shared library if the output file
606834977a2fSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
606934977a2fSmrg	    # to its proper name (with version) after linking.
607034977a2fSmrg	    _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'
607134977a2fSmrg
607234977a2fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
607334977a2fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
607434977a2fSmrg
607534977a2fSmrg	    # Archives containing C++ object files must be created using
607634977a2fSmrg	    # the KAI C++ compiler.
607734977a2fSmrg	    case $host in
607834977a2fSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
607934977a2fSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
608034977a2fSmrg	    esac
608134977a2fSmrg	    ;;
608234977a2fSmrg          RCC*)
608334977a2fSmrg	    # Rational C++ 2.4.1
608434977a2fSmrg	    # FIXME: insert proper C++ library support
608534977a2fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
608634977a2fSmrg	    ;;
608734977a2fSmrg          cxx*)
608834977a2fSmrg	    case $host in
608934977a2fSmrg	      osf3*)
609034977a2fSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
609134977a2fSmrg	        _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'
609234977a2fSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
609334977a2fSmrg		;;
609434977a2fSmrg	      *)
609534977a2fSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
609634977a2fSmrg	        _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'
609734977a2fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
609834977a2fSmrg	          echo "-hidden">> $lib.exp~
609934977a2fSmrg	          $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~
610034977a2fSmrg	          $RM $lib.exp'
610134977a2fSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
610234977a2fSmrg		;;
610334977a2fSmrg	    esac
6104ee3138f1Smrg
610534977a2fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6106ee3138f1Smrg
610734977a2fSmrg	    # Commands to make compiler produce verbose output that lists
610834977a2fSmrg	    # what "hidden" libraries, object files and flags are used when
610934977a2fSmrg	    # linking a shared library.
611034977a2fSmrg	    #
611134977a2fSmrg	    # There doesn't appear to be a way to prevent this compiler from
611234977a2fSmrg	    # explicitly linking system object files so we need to strip them
611334977a2fSmrg	    # from the output so that they don't get included in the library
611434977a2fSmrg	    # dependencies.
611534977a2fSmrg	    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'
611634977a2fSmrg	    ;;
611734977a2fSmrg	  *)
611834977a2fSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
611934977a2fSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
612034977a2fSmrg	      case $host in
612134977a2fSmrg	        osf3*)
612234977a2fSmrg	          _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'
612334977a2fSmrg		  ;;
612434977a2fSmrg	        *)
612534977a2fSmrg	          _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'
612634977a2fSmrg		  ;;
612734977a2fSmrg	      esac
612834977a2fSmrg
612934977a2fSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
613034977a2fSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
613134977a2fSmrg
613234977a2fSmrg	      # Commands to make compiler produce verbose output that lists
613334977a2fSmrg	      # what "hidden" libraries, object files and flags are used when
613434977a2fSmrg	      # linking a shared library.
613534977a2fSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
613634977a2fSmrg
613734977a2fSmrg	    else
613834977a2fSmrg	      # FIXME: insert proper C++ library support
613934977a2fSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
614034977a2fSmrg	    fi
614134977a2fSmrg	    ;;
614234977a2fSmrg        esac
614334977a2fSmrg        ;;
6144ee3138f1Smrg
614534977a2fSmrg      psos*)
614634977a2fSmrg        # FIXME: insert proper C++ library support
614734977a2fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
614834977a2fSmrg        ;;
6149ee3138f1Smrg
615034977a2fSmrg      sunos4*)
615134977a2fSmrg        case $cc_basename in
615234977a2fSmrg          CC*)
615334977a2fSmrg	    # Sun C++ 4.x
615434977a2fSmrg	    # FIXME: insert proper C++ library support
615534977a2fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
615634977a2fSmrg	    ;;
615734977a2fSmrg          lcc*)
615834977a2fSmrg	    # Lucid
615934977a2fSmrg	    # FIXME: insert proper C++ library support
616034977a2fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
616134977a2fSmrg	    ;;
616234977a2fSmrg          *)
616334977a2fSmrg	    # FIXME: insert proper C++ library support
616434977a2fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
616534977a2fSmrg	    ;;
616634977a2fSmrg        esac
616734977a2fSmrg        ;;
6168ee3138f1Smrg
616934977a2fSmrg      solaris*)
617034977a2fSmrg        case $cc_basename in
617134977a2fSmrg          CC*)
617234977a2fSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
617334977a2fSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
617434977a2fSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
617534977a2fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
617634977a2fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
617734977a2fSmrg	      $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'
617834977a2fSmrg
617934977a2fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
618034977a2fSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
618134977a2fSmrg	    case $host_os in
618234977a2fSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
618334977a2fSmrg	      *)
618434977a2fSmrg		# The compiler driver will combine and reorder linker options,
618534977a2fSmrg		# but understands `-z linker_flag'.
618634977a2fSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
618734977a2fSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
618834977a2fSmrg	        ;;
618934977a2fSmrg	    esac
619034977a2fSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6191ee3138f1Smrg
619234977a2fSmrg	    output_verbose_link_cmd='echo'
6193ee3138f1Smrg
619434977a2fSmrg	    # Archives containing C++ object files must be created using
619534977a2fSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
619634977a2fSmrg	    # necessary to make sure instantiated templates are included
619734977a2fSmrg	    # in the archive.
619834977a2fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
619934977a2fSmrg	    ;;
620034977a2fSmrg          gcx*)
620134977a2fSmrg	    # Green Hills C++ Compiler
620234977a2fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6203ee3138f1Smrg
620434977a2fSmrg	    # The C++ compiler must be used to create the archive.
620534977a2fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
620634977a2fSmrg	    ;;
620734977a2fSmrg          *)
620834977a2fSmrg	    # GNU C++ compiler with Solaris linker
620934977a2fSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
621034977a2fSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
621134977a2fSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
621234977a2fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
621334977a2fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
621434977a2fSmrg		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
621534977a2fSmrg
621634977a2fSmrg	        # Commands to make compiler produce verbose output that lists
621734977a2fSmrg	        # what "hidden" libraries, object files and flags are used when
621834977a2fSmrg	        # linking a shared library.
621934977a2fSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
622034977a2fSmrg	      else
622134977a2fSmrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
622234977a2fSmrg	        # platform.
622334977a2fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
622434977a2fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
622534977a2fSmrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
622634977a2fSmrg
622734977a2fSmrg	        # Commands to make compiler produce verbose output that lists
622834977a2fSmrg	        # what "hidden" libraries, object files and flags are used when
622934977a2fSmrg	        # linking a shared library.
623034977a2fSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
623134977a2fSmrg	      fi
623234977a2fSmrg
623334977a2fSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
623434977a2fSmrg	      case $host_os in
623534977a2fSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
623634977a2fSmrg		*)
623734977a2fSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
623834977a2fSmrg		  ;;
623934977a2fSmrg	      esac
624034977a2fSmrg	    fi
624134977a2fSmrg	    ;;
624234977a2fSmrg        esac
624334977a2fSmrg        ;;
6244ee3138f1Smrg
624534977a2fSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
624634977a2fSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
624734977a2fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
624834977a2fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
624934977a2fSmrg      runpath_var='LD_RUN_PATH'
6250ee3138f1Smrg
625134977a2fSmrg      case $cc_basename in
625234977a2fSmrg        CC*)
625334977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
625434977a2fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
625534977a2fSmrg	  ;;
625634977a2fSmrg	*)
625734977a2fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
625834977a2fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
625934977a2fSmrg	  ;;
626034977a2fSmrg      esac
626134977a2fSmrg      ;;
6262ee3138f1Smrg
626334977a2fSmrg      sysv5* | sco3.2v5* | sco5v6*)
626434977a2fSmrg	# Note: We can NOT use -z defs as we might desire, because we do not
626534977a2fSmrg	# link with -lc, and that would cause any symbols used from libc to
626634977a2fSmrg	# always be unresolved, which means just about no library would
626734977a2fSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
626834977a2fSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
626934977a2fSmrg	# as -z defs.
627034977a2fSmrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
627134977a2fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
627234977a2fSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
627334977a2fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
627434977a2fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
627534977a2fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
627634977a2fSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
627734977a2fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
627834977a2fSmrg	runpath_var='LD_RUN_PATH'
6279ee3138f1Smrg
628034977a2fSmrg	case $cc_basename in
628134977a2fSmrg          CC*)
628234977a2fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
628334977a2fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
628434977a2fSmrg	    ;;
628534977a2fSmrg	  *)
628634977a2fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
628734977a2fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
628834977a2fSmrg	    ;;
628934977a2fSmrg	esac
629034977a2fSmrg      ;;
6291ee3138f1Smrg
629234977a2fSmrg      tandem*)
629334977a2fSmrg        case $cc_basename in
629434977a2fSmrg          NCC*)
629534977a2fSmrg	    # NonStop-UX NCC 3.20
629634977a2fSmrg	    # FIXME: insert proper C++ library support
629734977a2fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
629834977a2fSmrg	    ;;
629934977a2fSmrg          *)
630034977a2fSmrg	    # FIXME: insert proper C++ library support
630134977a2fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
630234977a2fSmrg	    ;;
630334977a2fSmrg        esac
630434977a2fSmrg        ;;
6305ee3138f1Smrg
630634977a2fSmrg      vxworks*)
630734977a2fSmrg        # FIXME: insert proper C++ library support
630834977a2fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
630934977a2fSmrg        ;;
6310ee3138f1Smrg
631134977a2fSmrg      *)
631234977a2fSmrg        # FIXME: insert proper C++ library support
631334977a2fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
631434977a2fSmrg        ;;
631534977a2fSmrg    esac
6316ee3138f1Smrg
631734977a2fSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
631834977a2fSmrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
631934977a2fSmrg
632034977a2fSmrg    _LT_TAGVAR(GCC, $1)="$GXX"
632134977a2fSmrg    _LT_TAGVAR(LD, $1)="$LD"
632234977a2fSmrg
632334977a2fSmrg    ## CAVEAT EMPTOR:
632434977a2fSmrg    ## There is no encapsulation within the following macros, do not change
632534977a2fSmrg    ## the running order or otherwise move them around unless you know exactly
632634977a2fSmrg    ## what you are doing...
632734977a2fSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
632834977a2fSmrg    _LT_COMPILER_PIC($1)
632934977a2fSmrg    _LT_COMPILER_C_O($1)
633034977a2fSmrg    _LT_COMPILER_FILE_LOCKS($1)
633134977a2fSmrg    _LT_LINKER_SHLIBS($1)
633234977a2fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
633334977a2fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
633434977a2fSmrg
633534977a2fSmrg    _LT_CONFIG($1)
633634977a2fSmrg  fi # test -n "$compiler"
633734977a2fSmrg
633834977a2fSmrg  CC=$lt_save_CC
633934977a2fSmrg  LDCXX=$LD
634034977a2fSmrg  LD=$lt_save_LD
634134977a2fSmrg  GCC=$lt_save_GCC
634234977a2fSmrg  with_gnu_ld=$lt_save_with_gnu_ld
634334977a2fSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
634434977a2fSmrg  lt_cv_path_LD=$lt_save_path_LD
634534977a2fSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
634634977a2fSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
634734977a2fSmrgfi # test "$_lt_caught_CXX_error" != yes
6348ee3138f1Smrg
634934977a2fSmrgAC_LANG_POP
635034977a2fSmrg])# _LT_LANG_CXX_CONFIG
6351ee3138f1Smrg
6352ee3138f1Smrg
635334977a2fSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
635434977a2fSmrg# ---------------------------------
635534977a2fSmrg# Figure out "hidden" library dependencies from verbose
635634977a2fSmrg# compiler output when linking a shared library.
635734977a2fSmrg# Parse the compiler output and extract the necessary
635834977a2fSmrg# objects, libraries and library flags.
635934977a2fSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
636034977a2fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
636134977a2fSmrg# Dependencies to place before and after the object being linked:
636234977a2fSmrg_LT_TAGVAR(predep_objects, $1)=
636334977a2fSmrg_LT_TAGVAR(postdep_objects, $1)=
636434977a2fSmrg_LT_TAGVAR(predeps, $1)=
636534977a2fSmrg_LT_TAGVAR(postdeps, $1)=
636634977a2fSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
6367ee3138f1Smrg
636834977a2fSmrgdnl we can't use the lt_simple_compile_test_code here,
636934977a2fSmrgdnl because it contains code intended for an executable,
637034977a2fSmrgdnl not a library.  It's possible we should let each
637134977a2fSmrgdnl tag define a new lt_????_link_test_code variable,
637234977a2fSmrgdnl but it's only used here...
637334977a2fSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
637434977a2fSmrgint a;
637534977a2fSmrgvoid foo (void) { a = 0; }
637634977a2fSmrg_LT_EOF
637734977a2fSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
637834977a2fSmrgclass Foo
637934977a2fSmrg{
638034977a2fSmrgpublic:
638134977a2fSmrg  Foo (void) { a = 0; }
638234977a2fSmrgprivate:
638334977a2fSmrg  int a;
638434977a2fSmrg};
638534977a2fSmrg_LT_EOF
638634977a2fSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
638734977a2fSmrg      subroutine foo
638834977a2fSmrg      implicit none
638934977a2fSmrg      integer*4 a
639034977a2fSmrg      a=0
639134977a2fSmrg      return
639234977a2fSmrg      end
639334977a2fSmrg_LT_EOF
639434977a2fSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
639534977a2fSmrg      subroutine foo
639634977a2fSmrg      implicit none
639734977a2fSmrg      integer a
639834977a2fSmrg      a=0
639934977a2fSmrg      return
640034977a2fSmrg      end
640134977a2fSmrg_LT_EOF
640234977a2fSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
640334977a2fSmrgpublic class foo {
640434977a2fSmrg  private int a;
640534977a2fSmrg  public void bar (void) {
640634977a2fSmrg    a = 0;
640734977a2fSmrg  }
640834977a2fSmrg};
640934977a2fSmrg_LT_EOF
641034977a2fSmrg])
641134977a2fSmrgdnl Parse the compiler output and extract the necessary
641234977a2fSmrgdnl objects, libraries and library flags.
641334977a2fSmrgif AC_TRY_EVAL(ac_compile); then
641434977a2fSmrg  # Parse the compiler output and extract the necessary
641534977a2fSmrg  # objects, libraries and library flags.
6416ee3138f1Smrg
641734977a2fSmrg  # Sentinel used to keep track of whether or not we are before
641834977a2fSmrg  # the conftest object file.
641934977a2fSmrg  pre_test_object_deps_done=no
6420ee3138f1Smrg
642134977a2fSmrg  for p in `eval "$output_verbose_link_cmd"`; do
642234977a2fSmrg    case $p in
6423ee3138f1Smrg
642434977a2fSmrg    -L* | -R* | -l*)
642534977a2fSmrg       # Some compilers place space between "-{L,R}" and the path.
642634977a2fSmrg       # Remove the space.
642734977a2fSmrg       if test $p = "-L" ||
642834977a2fSmrg          test $p = "-R"; then
642934977a2fSmrg	 prev=$p
643034977a2fSmrg	 continue
643134977a2fSmrg       else
643234977a2fSmrg	 prev=
643334977a2fSmrg       fi
6434ee3138f1Smrg
643534977a2fSmrg       if test "$pre_test_object_deps_done" = no; then
643634977a2fSmrg	 case $p in
643734977a2fSmrg	 -L* | -R*)
643834977a2fSmrg	   # Internal compiler library paths should come after those
643934977a2fSmrg	   # provided the user.  The postdeps already come after the
644034977a2fSmrg	   # user supplied libs so there is no need to process them.
644134977a2fSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
644234977a2fSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
644334977a2fSmrg	   else
644434977a2fSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
644534977a2fSmrg	   fi
644634977a2fSmrg	   ;;
644734977a2fSmrg	 # The "-l" case would never come before the object being
644834977a2fSmrg	 # linked, so don't bother handling this case.
644934977a2fSmrg	 esac
645034977a2fSmrg       else
645134977a2fSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
645234977a2fSmrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
645334977a2fSmrg	 else
645434977a2fSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
645534977a2fSmrg	 fi
645634977a2fSmrg       fi
645734977a2fSmrg       ;;
6458ee3138f1Smrg
645934977a2fSmrg    *.$objext)
646034977a2fSmrg       # This assumes that the test object file only shows up
646134977a2fSmrg       # once in the compiler output.
646234977a2fSmrg       if test "$p" = "conftest.$objext"; then
646334977a2fSmrg	 pre_test_object_deps_done=yes
646434977a2fSmrg	 continue
646534977a2fSmrg       fi
6466ee3138f1Smrg
646734977a2fSmrg       if test "$pre_test_object_deps_done" = no; then
646834977a2fSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
646934977a2fSmrg	   _LT_TAGVAR(predep_objects, $1)="$p"
647034977a2fSmrg	 else
647134977a2fSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
647234977a2fSmrg	 fi
647334977a2fSmrg       else
647434977a2fSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
647534977a2fSmrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
647634977a2fSmrg	 else
647734977a2fSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
647834977a2fSmrg	 fi
647934977a2fSmrg       fi
648034977a2fSmrg       ;;
6481ee3138f1Smrg
648234977a2fSmrg    *) ;; # Ignore the rest.
6483ee3138f1Smrg
648434977a2fSmrg    esac
648534977a2fSmrg  done
6486ee3138f1Smrg
648734977a2fSmrg  # Clean up.
648834977a2fSmrg  rm -f a.out a.exe
6489ee3138f1Smrgelse
649034977a2fSmrg  echo "libtool.m4: error: problem compiling $1 test program"
6491ee3138f1Smrgfi
6492ee3138f1Smrg
649334977a2fSmrg$RM -f confest.$objext
6494ee3138f1Smrg
649534977a2fSmrg# PORTME: override above test on systems where it is broken
649634977a2fSmrgm4_if([$1], [CXX],
649734977a2fSmrg[case $host_os in
649834977a2fSmrginterix[[3-9]]*)
649934977a2fSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
650034977a2fSmrg  # hack all around it, let's just trust "g++" to DTRT.
650134977a2fSmrg  _LT_TAGVAR(predep_objects,$1)=
650234977a2fSmrg  _LT_TAGVAR(postdep_objects,$1)=
650334977a2fSmrg  _LT_TAGVAR(postdeps,$1)=
650434977a2fSmrg  ;;
6505ee3138f1Smrg
650634977a2fSmrglinux*)
650734977a2fSmrg  case `$CC -V 2>&1 | sed 5q` in
650834977a2fSmrg  *Sun\ C*)
650934977a2fSmrg    # Sun C++ 5.9
6510ee3138f1Smrg
651134977a2fSmrg    # The more standards-conforming stlport4 library is
651234977a2fSmrg    # incompatible with the Cstd library. Avoid specifying
651334977a2fSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
651434977a2fSmrg    # -library=stlport4 depends on it.
651534977a2fSmrg    case " $CXX $CXXFLAGS " in
651634977a2fSmrg    *" -library=stlport4 "*)
651734977a2fSmrg      solaris_use_stlport4=yes
651834977a2fSmrg      ;;
651934977a2fSmrg    esac
6520ee3138f1Smrg
652134977a2fSmrg    if test "$solaris_use_stlport4" != yes; then
652234977a2fSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
652334977a2fSmrg    fi
652434977a2fSmrg    ;;
652534977a2fSmrg  esac
652634977a2fSmrg  ;;
652734977a2fSmrg
652834977a2fSmrgsolaris*)
652934977a2fSmrg  case $cc_basename in
653034977a2fSmrg  CC*)
653134977a2fSmrg    # The more standards-conforming stlport4 library is
653234977a2fSmrg    # incompatible with the Cstd library. Avoid specifying
653334977a2fSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
653434977a2fSmrg    # -library=stlport4 depends on it.
653534977a2fSmrg    case " $CXX $CXXFLAGS " in
653634977a2fSmrg    *" -library=stlport4 "*)
653734977a2fSmrg      solaris_use_stlport4=yes
653834977a2fSmrg      ;;
653934977a2fSmrg    esac
6540ee3138f1Smrg
654134977a2fSmrg    # Adding this requires a known-good setup of shared libraries for
654234977a2fSmrg    # Sun compiler versions before 5.6, else PIC objects from an old
654334977a2fSmrg    # archive will be linked into the output, leading to subtle bugs.
654434977a2fSmrg    if test "$solaris_use_stlport4" != yes; then
654534977a2fSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
654634977a2fSmrg    fi
654734977a2fSmrg    ;;
654834977a2fSmrg  esac
654934977a2fSmrg  ;;
655034977a2fSmrgesac
655134977a2fSmrg])
6552ee3138f1Smrg
655334977a2fSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
655434977a2fSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
655534977a2fSmrgesac
655634977a2fSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
655734977a2fSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
655834977a2fSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
655934977a2fSmrgfi
656034977a2fSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
656134977a2fSmrg    [The directories searched by this compiler when creating a shared library])
656234977a2fSmrg_LT_TAGDECL([], [predep_objects], [1],
656334977a2fSmrg    [Dependencies to place before and after the objects being linked to
656434977a2fSmrg    create a shared library])
656534977a2fSmrg_LT_TAGDECL([], [postdep_objects], [1])
656634977a2fSmrg_LT_TAGDECL([], [predeps], [1])
656734977a2fSmrg_LT_TAGDECL([], [postdeps], [1])
656834977a2fSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
656934977a2fSmrg    [The library search path used internally by the compiler when linking
657034977a2fSmrg    a shared library])
657134977a2fSmrg])# _LT_SYS_HIDDEN_LIBDEPS
657234977a2fSmrg
657334977a2fSmrg
657434977a2fSmrg# _LT_PROG_F77
657534977a2fSmrg# ------------
657634977a2fSmrg# Since AC_PROG_F77 is broken, in that it returns the empty string
657734977a2fSmrg# if there is no fortran compiler, we have our own version here.
657834977a2fSmrgm4_defun([_LT_PROG_F77],
6579ee3138f1Smrg[
658034977a2fSmrgpushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
658134977a2fSmrgAC_PROG_F77
658234977a2fSmrgif test -z "$F77" || test "X$F77" = "Xno"; then
658334977a2fSmrg  _lt_disable_F77=yes
658434977a2fSmrgfi
658534977a2fSmrgpopdef([AC_MSG_ERROR])
658634977a2fSmrg])# _LT_PROG_F77
6587ee3138f1Smrg
658834977a2fSmrgdnl aclocal-1.4 backwards compatibility:
658934977a2fSmrgdnl AC_DEFUN([_LT_PROG_F77], [])
6590ee3138f1Smrg
6591ee3138f1Smrg
659234977a2fSmrg# _LT_LANG_F77_CONFIG([TAG])
659334977a2fSmrg# --------------------------
659434977a2fSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
659534977a2fSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
659634977a2fSmrg# to write the compiler configuration to `libtool'.
659734977a2fSmrgm4_defun([_LT_LANG_F77_CONFIG],
659834977a2fSmrg[AC_REQUIRE([_LT_PROG_F77])dnl
659934977a2fSmrgAC_LANG_PUSH(Fortran 77)
6600ee3138f1Smrg
660134977a2fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
660234977a2fSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
660334977a2fSmrg_LT_TAGVAR(always_export_symbols, $1)=no
660434977a2fSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
660534977a2fSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
660634977a2fSmrg_LT_TAGVAR(hardcode_direct, $1)=no
660734977a2fSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
660834977a2fSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
660934977a2fSmrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
661034977a2fSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
661134977a2fSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
661234977a2fSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
661334977a2fSmrg_LT_TAGVAR(inherit_rpath, $1)=no
661434977a2fSmrg_LT_TAGVAR(module_cmds, $1)=
661534977a2fSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
661634977a2fSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
661734977a2fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
661834977a2fSmrg_LT_TAGVAR(no_undefined_flag, $1)=
661934977a2fSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
662034977a2fSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6621ee3138f1Smrg
662234977a2fSmrg# Source file extension for f77 test sources.
662334977a2fSmrgac_ext=f
6624ee3138f1Smrg
662534977a2fSmrg# Object file extension for compiled f77 test sources.
662634977a2fSmrgobjext=o
662734977a2fSmrg_LT_TAGVAR(objext, $1)=$objext
662834977a2fSmrg
662934977a2fSmrg# No sense in running all these tests if we already determined that
663034977a2fSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
663134977a2fSmrg# are currently assumed to apply to all compilers on this platform,
663234977a2fSmrg# and will be corrupted by setting them based on a non-working compiler.
663334977a2fSmrgif test "$_lt_disable_F77" != yes; then
663434977a2fSmrg  # Code to be used in simple compile tests
663534977a2fSmrg  lt_simple_compile_test_code="\
663634977a2fSmrg      subroutine t
663734977a2fSmrg      return
663834977a2fSmrg      end
663934977a2fSmrg"
6640ee3138f1Smrg
664134977a2fSmrg  # Code to be used in simple link tests
664234977a2fSmrg  lt_simple_link_test_code="\
664334977a2fSmrg      program t
664434977a2fSmrg      end
664534977a2fSmrg"
6646ee3138f1Smrg
664734977a2fSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
664834977a2fSmrg  _LT_TAG_COMPILER
6649ee3138f1Smrg
665034977a2fSmrg  # save warnings/boilerplate of simple test code
665134977a2fSmrg  _LT_COMPILER_BOILERPLATE
665234977a2fSmrg  _LT_LINKER_BOILERPLATE
6653ee3138f1Smrg
665434977a2fSmrg  # Allow CC to be a program name with arguments.
665534977a2fSmrg  lt_save_CC="$CC"
665634977a2fSmrg  lt_save_GCC=$GCC
665734977a2fSmrg  CC=${F77-"f77"}
665834977a2fSmrg  compiler=$CC
665934977a2fSmrg  _LT_TAGVAR(compiler, $1)=$CC
666034977a2fSmrg  _LT_CC_BASENAME([$compiler])
666134977a2fSmrg  GCC=$G77
666234977a2fSmrg  if test -n "$compiler"; then
666334977a2fSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
666434977a2fSmrg    AC_MSG_RESULT([$can_build_shared])
6665ee3138f1Smrg
666634977a2fSmrg    AC_MSG_CHECKING([whether to build shared libraries])
666734977a2fSmrg    test "$can_build_shared" = "no" && enable_shared=no
6668ee3138f1Smrg
666934977a2fSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
667034977a2fSmrg    # are all built from PIC.
667134977a2fSmrg    case $host_os in
667234977a2fSmrg      aix3*)
667334977a2fSmrg        test "$enable_shared" = yes && enable_static=no
667434977a2fSmrg        if test -n "$RANLIB"; then
667534977a2fSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
667634977a2fSmrg          postinstall_cmds='$RANLIB $lib'
667734977a2fSmrg        fi
667834977a2fSmrg        ;;
667934977a2fSmrg      aix[[4-9]]*)
668034977a2fSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
668134977a2fSmrg	  test "$enable_shared" = yes && enable_static=no
668234977a2fSmrg	fi
668334977a2fSmrg        ;;
668434977a2fSmrg    esac
668534977a2fSmrg    AC_MSG_RESULT([$enable_shared])
668634977a2fSmrg
668734977a2fSmrg    AC_MSG_CHECKING([whether to build static libraries])
668834977a2fSmrg    # Make sure either enable_shared or enable_static is yes.
668934977a2fSmrg    test "$enable_shared" = yes || enable_static=yes
669034977a2fSmrg    AC_MSG_RESULT([$enable_static])
669134977a2fSmrg
669234977a2fSmrg    _LT_TAGVAR(GCC, $1)="$G77"
669334977a2fSmrg    _LT_TAGVAR(LD, $1)="$LD"
669434977a2fSmrg
669534977a2fSmrg    ## CAVEAT EMPTOR:
669634977a2fSmrg    ## There is no encapsulation within the following macros, do not change
669734977a2fSmrg    ## the running order or otherwise move them around unless you know exactly
669834977a2fSmrg    ## what you are doing...
669934977a2fSmrg    _LT_COMPILER_PIC($1)
670034977a2fSmrg    _LT_COMPILER_C_O($1)
670134977a2fSmrg    _LT_COMPILER_FILE_LOCKS($1)
670234977a2fSmrg    _LT_LINKER_SHLIBS($1)
670334977a2fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
670434977a2fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
670534977a2fSmrg
670634977a2fSmrg    _LT_CONFIG($1)
670734977a2fSmrg  fi # test -n "$compiler"
670834977a2fSmrg
670934977a2fSmrg  GCC=$lt_save_GCC
671034977a2fSmrg  CC="$lt_save_CC"
671134977a2fSmrgfi # test "$_lt_disable_F77" != yes
6712ee3138f1Smrg
671334977a2fSmrgAC_LANG_POP
671434977a2fSmrg])# _LT_LANG_F77_CONFIG
6715ee3138f1Smrg
6716ee3138f1Smrg
671734977a2fSmrg# _LT_PROG_FC
671834977a2fSmrg# -----------
671934977a2fSmrg# Since AC_PROG_FC is broken, in that it returns the empty string
672034977a2fSmrg# if there is no fortran compiler, we have our own version here.
672134977a2fSmrgm4_defun([_LT_PROG_FC],
672234977a2fSmrg[
672334977a2fSmrgpushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
672434977a2fSmrgAC_PROG_FC
672534977a2fSmrgif test -z "$FC" || test "X$FC" = "Xno"; then
672634977a2fSmrg  _lt_disable_FC=yes
672734977a2fSmrgfi
672834977a2fSmrgpopdef([AC_MSG_ERROR])
672934977a2fSmrg])# _LT_PROG_FC
6730ee3138f1Smrg
673134977a2fSmrgdnl aclocal-1.4 backwards compatibility:
673234977a2fSmrgdnl AC_DEFUN([_LT_PROG_FC], [])
6733ee3138f1Smrg
6734ee3138f1Smrg
673534977a2fSmrg# _LT_LANG_FC_CONFIG([TAG])
673634977a2fSmrg# -------------------------
673734977a2fSmrg# Ensure that the configuration variables for a Fortran compiler are
673834977a2fSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
673934977a2fSmrg# to write the compiler configuration to `libtool'.
674034977a2fSmrgm4_defun([_LT_LANG_FC_CONFIG],
674134977a2fSmrg[AC_REQUIRE([_LT_PROG_FC])dnl
674234977a2fSmrgAC_LANG_PUSH(Fortran)
674334977a2fSmrg
674434977a2fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
674534977a2fSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
674634977a2fSmrg_LT_TAGVAR(always_export_symbols, $1)=no
674734977a2fSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
674834977a2fSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
674934977a2fSmrg_LT_TAGVAR(hardcode_direct, $1)=no
675034977a2fSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
675134977a2fSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
675234977a2fSmrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
675334977a2fSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
675434977a2fSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
675534977a2fSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
675634977a2fSmrg_LT_TAGVAR(inherit_rpath, $1)=no
675734977a2fSmrg_LT_TAGVAR(module_cmds, $1)=
675834977a2fSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
675934977a2fSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
676034977a2fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
676134977a2fSmrg_LT_TAGVAR(no_undefined_flag, $1)=
676234977a2fSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
676334977a2fSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
676434977a2fSmrg
676534977a2fSmrg# Source file extension for fc test sources.
676634977a2fSmrgac_ext=${ac_fc_srcext-f}
676734977a2fSmrg
676834977a2fSmrg# Object file extension for compiled fc test sources.
676934977a2fSmrgobjext=o
677034977a2fSmrg_LT_TAGVAR(objext, $1)=$objext
677134977a2fSmrg
677234977a2fSmrg# No sense in running all these tests if we already determined that
677334977a2fSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
677434977a2fSmrg# are currently assumed to apply to all compilers on this platform,
677534977a2fSmrg# and will be corrupted by setting them based on a non-working compiler.
677634977a2fSmrgif test "$_lt_disable_FC" != yes; then
677734977a2fSmrg  # Code to be used in simple compile tests
677834977a2fSmrg  lt_simple_compile_test_code="\
677934977a2fSmrg      subroutine t
678034977a2fSmrg      return
678134977a2fSmrg      end
678234977a2fSmrg"
6783ee3138f1Smrg
678434977a2fSmrg  # Code to be used in simple link tests
678534977a2fSmrg  lt_simple_link_test_code="\
678634977a2fSmrg      program t
678734977a2fSmrg      end
678834977a2fSmrg"
6789ee3138f1Smrg
679034977a2fSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
679134977a2fSmrg  _LT_TAG_COMPILER
6792ee3138f1Smrg
679334977a2fSmrg  # save warnings/boilerplate of simple test code
679434977a2fSmrg  _LT_COMPILER_BOILERPLATE
679534977a2fSmrg  _LT_LINKER_BOILERPLATE
6796ee3138f1Smrg
679734977a2fSmrg  # Allow CC to be a program name with arguments.
679834977a2fSmrg  lt_save_CC="$CC"
679934977a2fSmrg  lt_save_GCC=$GCC
680034977a2fSmrg  CC=${FC-"f95"}
680134977a2fSmrg  compiler=$CC
680234977a2fSmrg  GCC=$ac_cv_fc_compiler_gnu
680334977a2fSmrg
680434977a2fSmrg  _LT_TAGVAR(compiler, $1)=$CC
680534977a2fSmrg  _LT_CC_BASENAME([$compiler])
680634977a2fSmrg
680734977a2fSmrg  if test -n "$compiler"; then
680834977a2fSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
680934977a2fSmrg    AC_MSG_RESULT([$can_build_shared])
6810ee3138f1Smrg
681134977a2fSmrg    AC_MSG_CHECKING([whether to build shared libraries])
681234977a2fSmrg    test "$can_build_shared" = "no" && enable_shared=no
681334977a2fSmrg
681434977a2fSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
681534977a2fSmrg    # are all built from PIC.
6816ee3138f1Smrg    case $host_os in
681734977a2fSmrg      aix3*)
681834977a2fSmrg        test "$enable_shared" = yes && enable_static=no
681934977a2fSmrg        if test -n "$RANLIB"; then
682034977a2fSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
682134977a2fSmrg          postinstall_cmds='$RANLIB $lib'
682234977a2fSmrg        fi
682334977a2fSmrg        ;;
682479a8a9c6Smrg      aix[[4-9]]*)
682534977a2fSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
682634977a2fSmrg	  test "$enable_shared" = yes && enable_static=no
6827ee3138f1Smrg	fi
682834977a2fSmrg        ;;
6829ee3138f1Smrg    esac
683034977a2fSmrg    AC_MSG_RESULT([$enable_shared])
683134977a2fSmrg
683234977a2fSmrg    AC_MSG_CHECKING([whether to build static libraries])
683334977a2fSmrg    # Make sure either enable_shared or enable_static is yes.
683434977a2fSmrg    test "$enable_shared" = yes || enable_static=yes
683534977a2fSmrg    AC_MSG_RESULT([$enable_static])
683634977a2fSmrg
683734977a2fSmrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
683834977a2fSmrg    _LT_TAGVAR(LD, $1)="$LD"
683934977a2fSmrg
684034977a2fSmrg    ## CAVEAT EMPTOR:
684134977a2fSmrg    ## There is no encapsulation within the following macros, do not change
684234977a2fSmrg    ## the running order or otherwise move them around unless you know exactly
684334977a2fSmrg    ## what you are doing...
684434977a2fSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
684534977a2fSmrg    _LT_COMPILER_PIC($1)
684634977a2fSmrg    _LT_COMPILER_C_O($1)
684734977a2fSmrg    _LT_COMPILER_FILE_LOCKS($1)
684834977a2fSmrg    _LT_LINKER_SHLIBS($1)
684934977a2fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
685034977a2fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
685134977a2fSmrg
685234977a2fSmrg    _LT_CONFIG($1)
685334977a2fSmrg  fi # test -n "$compiler"
685434977a2fSmrg
685534977a2fSmrg  GCC=$lt_save_GCC
685634977a2fSmrg  CC="$lt_save_CC"
685734977a2fSmrgfi # test "$_lt_disable_FC" != yes
6858ee3138f1Smrg
685934977a2fSmrgAC_LANG_POP
686034977a2fSmrg])# _LT_LANG_FC_CONFIG
6861ee3138f1Smrg
6862ee3138f1Smrg
686334977a2fSmrg# _LT_LANG_GCJ_CONFIG([TAG])
686434977a2fSmrg# --------------------------
686534977a2fSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
686634977a2fSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
686734977a2fSmrg# to write the compiler configuration to `libtool'.
686834977a2fSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
686934977a2fSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
687034977a2fSmrgAC_LANG_SAVE
6871ee3138f1Smrg
687234977a2fSmrg# Source file extension for Java test sources.
687334977a2fSmrgac_ext=java
6874ee3138f1Smrg
687534977a2fSmrg# Object file extension for compiled Java test sources.
687634977a2fSmrgobjext=o
687734977a2fSmrg_LT_TAGVAR(objext, $1)=$objext
6878ee3138f1Smrg
687934977a2fSmrg# Code to be used in simple compile tests
688034977a2fSmrglt_simple_compile_test_code="class foo {}"
6881ee3138f1Smrg
688234977a2fSmrg# Code to be used in simple link tests
688334977a2fSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
6884ee3138f1Smrg
688534977a2fSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
688634977a2fSmrg_LT_TAG_COMPILER
688734977a2fSmrg
688834977a2fSmrg# save warnings/boilerplate of simple test code
688934977a2fSmrg_LT_COMPILER_BOILERPLATE
689034977a2fSmrg_LT_LINKER_BOILERPLATE
689134977a2fSmrg
689234977a2fSmrg# Allow CC to be a program name with arguments.
689334977a2fSmrglt_save_CC="$CC"
689434977a2fSmrglt_save_GCC=$GCC
689534977a2fSmrgGCC=yes
689634977a2fSmrgCC=${GCJ-"gcj"}
689734977a2fSmrgcompiler=$CC
689834977a2fSmrg_LT_TAGVAR(compiler, $1)=$CC
689934977a2fSmrg_LT_TAGVAR(LD, $1)="$LD"
690034977a2fSmrg_LT_CC_BASENAME([$compiler])
690134977a2fSmrg
690234977a2fSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
690334977a2fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
690434977a2fSmrg
690534977a2fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
690634977a2fSmrg
690734977a2fSmrgif test -n "$compiler"; then
690834977a2fSmrg  _LT_COMPILER_NO_RTTI($1)
690934977a2fSmrg  _LT_COMPILER_PIC($1)
691034977a2fSmrg  _LT_COMPILER_C_O($1)
691134977a2fSmrg  _LT_COMPILER_FILE_LOCKS($1)
691234977a2fSmrg  _LT_LINKER_SHLIBS($1)
691334977a2fSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
691434977a2fSmrg
691534977a2fSmrg  _LT_CONFIG($1)
691634977a2fSmrgfi
691734977a2fSmrg
691834977a2fSmrgAC_LANG_RESTORE
691934977a2fSmrg
692034977a2fSmrgGCC=$lt_save_GCC
692134977a2fSmrgCC="$lt_save_CC"
692234977a2fSmrg])# _LT_LANG_GCJ_CONFIG
6923ee3138f1Smrg
6924ee3138f1Smrg
692534977a2fSmrg# _LT_LANG_RC_CONFIG([TAG])
692634977a2fSmrg# -------------------------
692734977a2fSmrg# Ensure that the configuration variables for the Windows resource compiler
692834977a2fSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
692934977a2fSmrg# to write the compiler configuration to `libtool'.
693034977a2fSmrgm4_defun([_LT_LANG_RC_CONFIG],
693134977a2fSmrg[AC_REQUIRE([LT_PROG_RC])dnl
693234977a2fSmrgAC_LANG_SAVE
6933ee3138f1Smrg
693434977a2fSmrg# Source file extension for RC test sources.
693534977a2fSmrgac_ext=rc
6936ee3138f1Smrg
693734977a2fSmrg# Object file extension for compiled RC test sources.
693834977a2fSmrgobjext=o
693934977a2fSmrg_LT_TAGVAR(objext, $1)=$objext
6940ee3138f1Smrg
694134977a2fSmrg# Code to be used in simple compile tests
694234977a2fSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
6943ee3138f1Smrg
694434977a2fSmrg# Code to be used in simple link tests
694534977a2fSmrglt_simple_link_test_code="$lt_simple_compile_test_code"
6946ee3138f1Smrg
694734977a2fSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
694834977a2fSmrg_LT_TAG_COMPILER
6949ee3138f1Smrg
695034977a2fSmrg# save warnings/boilerplate of simple test code
695134977a2fSmrg_LT_COMPILER_BOILERPLATE
695234977a2fSmrg_LT_LINKER_BOILERPLATE
6953ee3138f1Smrg
695434977a2fSmrg# Allow CC to be a program name with arguments.
695534977a2fSmrglt_save_CC="$CC"
695634977a2fSmrglt_save_GCC=$GCC
695734977a2fSmrgGCC=
695834977a2fSmrgCC=${RC-"windres"}
695934977a2fSmrgcompiler=$CC
696034977a2fSmrg_LT_TAGVAR(compiler, $1)=$CC
696134977a2fSmrg_LT_CC_BASENAME([$compiler])
696234977a2fSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
6963ee3138f1Smrg
696434977a2fSmrgif test -n "$compiler"; then
696534977a2fSmrg  :
696634977a2fSmrg  _LT_CONFIG($1)
696734977a2fSmrgfi
6968ee3138f1Smrg
696934977a2fSmrgGCC=$lt_save_GCC
697034977a2fSmrgAC_LANG_RESTORE
697134977a2fSmrgCC="$lt_save_CC"
697234977a2fSmrg])# _LT_LANG_RC_CONFIG
6973ee3138f1Smrg
6974ee3138f1Smrg
697534977a2fSmrg# LT_PROG_GCJ
697634977a2fSmrg# -----------
697734977a2fSmrgAC_DEFUN([LT_PROG_GCJ],
697834977a2fSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
697934977a2fSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
698034977a2fSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
698134977a2fSmrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
698234977a2fSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
698334977a2fSmrg])
6984ee3138f1Smrg
698534977a2fSmrg# Old name:
698634977a2fSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
698734977a2fSmrgdnl aclocal-1.4 backwards compatibility:
698834977a2fSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
6989ee3138f1Smrg
6990ee3138f1Smrg
699134977a2fSmrg# LT_PROG_RC
699234977a2fSmrg# ----------
699334977a2fSmrgAC_DEFUN([LT_PROG_RC],
699434977a2fSmrg[AC_CHECK_TOOL(RC, windres,)
699534977a2fSmrg])
6996ee3138f1Smrg
699734977a2fSmrg# Old name:
699834977a2fSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
699934977a2fSmrgdnl aclocal-1.4 backwards compatibility:
700034977a2fSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
700134977a2fSmrg
700234977a2fSmrg
700334977a2fSmrg# _LT_DECL_EGREP
700434977a2fSmrg# --------------
700534977a2fSmrg# If we don't have a new enough Autoconf to choose the best grep
700634977a2fSmrg# available, choose the one first in the user's PATH.
700734977a2fSmrgm4_defun([_LT_DECL_EGREP],
700834977a2fSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
700934977a2fSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
701034977a2fSmrgtest -z "$GREP" && GREP=grep
701134977a2fSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
701234977a2fSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
701334977a2fSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
701434977a2fSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
701534977a2fSmrgAC_SUBST([GREP])
7016ee3138f1Smrg])
7017ee3138f1Smrg
7018ee3138f1Smrg
701934977a2fSmrg# _LT_DECL_OBJDUMP
702034977a2fSmrg# --------------
702134977a2fSmrg# If we don't have a new enough Autoconf to choose the best objdump
702234977a2fSmrg# available, choose the one first in the user's PATH.
702334977a2fSmrgm4_defun([_LT_DECL_OBJDUMP],
702434977a2fSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
702534977a2fSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
702634977a2fSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
702734977a2fSmrgAC_SUBST([OBJDUMP])
7028ee3138f1Smrg])
7029ee3138f1Smrg
7030ee3138f1Smrg
703134977a2fSmrg# _LT_DECL_SED
703234977a2fSmrg# ------------
703334977a2fSmrg# Check for a fully-functional sed program, that truncates
703434977a2fSmrg# as few characters as possible.  Prefer GNU sed if found.
703534977a2fSmrgm4_defun([_LT_DECL_SED],
703634977a2fSmrg[AC_PROG_SED
703734977a2fSmrgtest -z "$SED" && SED=sed
703834977a2fSmrgXsed="$SED -e 1s/^X//"
703934977a2fSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
704034977a2fSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
704134977a2fSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
704234977a2fSmrg])# _LT_DECL_SED
704334977a2fSmrg
704434977a2fSmrgm4_ifndef([AC_PROG_SED], [
704534977a2fSmrg# NOTE: This macro has been submitted for inclusion into   #
704634977a2fSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
704734977a2fSmrg#  a released version of Autoconf we should remove this    #
704834977a2fSmrg#  macro and use it instead.                               #
704934977a2fSmrg
705034977a2fSmrgm4_defun([AC_PROG_SED],
705134977a2fSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
705234977a2fSmrgAC_CACHE_VAL(lt_cv_path_SED,
705334977a2fSmrg[# Loop through the user's path and test for sed and gsed.
705434977a2fSmrg# Then use that list of sed's as ones to test for truncation.
705534977a2fSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
705634977a2fSmrgfor as_dir in $PATH
705734977a2fSmrgdo
705834977a2fSmrg  IFS=$as_save_IFS
705934977a2fSmrg  test -z "$as_dir" && as_dir=.
706034977a2fSmrg  for lt_ac_prog in sed gsed; do
706134977a2fSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
706234977a2fSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
706334977a2fSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
706434977a2fSmrg      fi
706534977a2fSmrg    done
706634977a2fSmrg  done
706734977a2fSmrgdone
706834977a2fSmrgIFS=$as_save_IFS
706934977a2fSmrglt_ac_max=0
707034977a2fSmrglt_ac_count=0
707134977a2fSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
707234977a2fSmrg# along with /bin/sed that truncates output.
707334977a2fSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
707434977a2fSmrg  test ! -f $lt_ac_sed && continue
707534977a2fSmrg  cat /dev/null > conftest.in
707634977a2fSmrg  lt_ac_count=0
707734977a2fSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
707834977a2fSmrg  # Check for GNU sed and select it if it is found.
707934977a2fSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
708034977a2fSmrg    lt_cv_path_SED=$lt_ac_sed
708134977a2fSmrg    break
708234977a2fSmrg  fi
708334977a2fSmrg  while true; do
708434977a2fSmrg    cat conftest.in conftest.in >conftest.tmp
708534977a2fSmrg    mv conftest.tmp conftest.in
708634977a2fSmrg    cp conftest.in conftest.nl
708734977a2fSmrg    echo >>conftest.nl
708834977a2fSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
708934977a2fSmrg    cmp -s conftest.out conftest.nl || break
709034977a2fSmrg    # 10000 chars as input seems more than enough
709134977a2fSmrg    test $lt_ac_count -gt 10 && break
709234977a2fSmrg    lt_ac_count=`expr $lt_ac_count + 1`
709334977a2fSmrg    if test $lt_ac_count -gt $lt_ac_max; then
709434977a2fSmrg      lt_ac_max=$lt_ac_count
709534977a2fSmrg      lt_cv_path_SED=$lt_ac_sed
7096ee3138f1Smrg    fi
709734977a2fSmrg  done
709834977a2fSmrgdone
709934977a2fSmrg])
710034977a2fSmrgSED=$lt_cv_path_SED
710134977a2fSmrgAC_SUBST([SED])
710234977a2fSmrgAC_MSG_RESULT([$SED])
710334977a2fSmrg])#AC_PROG_SED
710434977a2fSmrg])#m4_ifndef
710534977a2fSmrg
710634977a2fSmrg# Old name:
710734977a2fSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
710834977a2fSmrgdnl aclocal-1.4 backwards compatibility:
710934977a2fSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
711034977a2fSmrg
711134977a2fSmrg
711234977a2fSmrg# _LT_CHECK_SHELL_FEATURES
711334977a2fSmrg# ------------------------
711434977a2fSmrg# Find out whether the shell is Bourne or XSI compatible,
711534977a2fSmrg# or has some other useful features.
711634977a2fSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
711734977a2fSmrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
711834977a2fSmrg# Try some XSI features
711934977a2fSmrgxsi_shell=no
712034977a2fSmrg( _lt_dummy="a/b/c"
712134977a2fSmrg  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
712234977a2fSmrg      = c,a/b,, \
712334977a2fSmrg    && eval 'test $(( 1 + 1 )) -eq 2 \
712434977a2fSmrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
712534977a2fSmrg  && xsi_shell=yes
712634977a2fSmrgAC_MSG_RESULT([$xsi_shell])
712734977a2fSmrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
712834977a2fSmrg
712934977a2fSmrgAC_MSG_CHECKING([whether the shell understands "+="])
713034977a2fSmrglt_shell_append=no
713134977a2fSmrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
713234977a2fSmrg    >/dev/null 2>&1 \
713334977a2fSmrg  && lt_shell_append=yes
713434977a2fSmrgAC_MSG_RESULT([$lt_shell_append])
713534977a2fSmrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
713634977a2fSmrg
713734977a2fSmrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
713834977a2fSmrg  lt_unset=unset
713934977a2fSmrgelse
714034977a2fSmrg  lt_unset=false
714134977a2fSmrgfi
714234977a2fSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
714334977a2fSmrg
714434977a2fSmrg# test EBCDIC or ASCII
714534977a2fSmrgcase `echo X|tr X '\101'` in
714634977a2fSmrg A) # ASCII based system
714734977a2fSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
714834977a2fSmrg  lt_SP2NL='tr \040 \012'
714934977a2fSmrg  lt_NL2SP='tr \015\012 \040\040'
715034977a2fSmrg  ;;
715134977a2fSmrg *) # EBCDIC based system
715234977a2fSmrg  lt_SP2NL='tr \100 \n'
715334977a2fSmrg  lt_NL2SP='tr \r\n \100\100'
715434977a2fSmrg  ;;
715534977a2fSmrgesac
715634977a2fSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
715734977a2fSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
715834977a2fSmrg])# _LT_CHECK_SHELL_FEATURES
715934977a2fSmrg
716034977a2fSmrg
716134977a2fSmrg# _LT_PROG_XSI_SHELLFNS
716234977a2fSmrg# ---------------------
716334977a2fSmrg# Bourne and XSI compatible variants of some useful shell functions.
716434977a2fSmrgm4_defun([_LT_PROG_XSI_SHELLFNS],
716534977a2fSmrg[case $xsi_shell in
716634977a2fSmrg  yes)
716734977a2fSmrg    cat << \_LT_EOF >> "$cfgfile"
716834977a2fSmrg
716934977a2fSmrg# func_dirname file append nondir_replacement
717034977a2fSmrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
717134977a2fSmrg# otherwise set result to NONDIR_REPLACEMENT.
717234977a2fSmrgfunc_dirname ()
717334977a2fSmrg{
717434977a2fSmrg  case ${1} in
717534977a2fSmrg    */*) func_dirname_result="${1%/*}${2}" ;;
717634977a2fSmrg    *  ) func_dirname_result="${3}" ;;
7177ee3138f1Smrg  esac
717834977a2fSmrg}
7179ee3138f1Smrg
718034977a2fSmrg# func_basename file
718134977a2fSmrgfunc_basename ()
718234977a2fSmrg{
718334977a2fSmrg  func_basename_result="${1##*/}"
718434977a2fSmrg}
7185ee3138f1Smrg
718634977a2fSmrg# func_dirname_and_basename file append nondir_replacement
718734977a2fSmrg# perform func_basename and func_dirname in a single function
718834977a2fSmrg# call:
718934977a2fSmrg#   dirname:  Compute the dirname of FILE.  If nonempty,
719034977a2fSmrg#             add APPEND to the result, otherwise set result
719134977a2fSmrg#             to NONDIR_REPLACEMENT.
719234977a2fSmrg#             value returned in "$func_dirname_result"
719334977a2fSmrg#   basename: Compute filename of FILE.
719434977a2fSmrg#             value retuned in "$func_basename_result"
719534977a2fSmrg# Implementation must be kept synchronized with func_dirname
719634977a2fSmrg# and func_basename. For efficiency, we do not delegate to
719734977a2fSmrg# those functions but instead duplicate the functionality here.
719834977a2fSmrgfunc_dirname_and_basename ()
719934977a2fSmrg{
720034977a2fSmrg  case ${1} in
720134977a2fSmrg    */*) func_dirname_result="${1%/*}${2}" ;;
720234977a2fSmrg    *  ) func_dirname_result="${3}" ;;
720334977a2fSmrg  esac
720434977a2fSmrg  func_basename_result="${1##*/}"
720534977a2fSmrg}
7206ee3138f1Smrg
720734977a2fSmrg# func_stripname prefix suffix name
720834977a2fSmrg# strip PREFIX and SUFFIX off of NAME.
720934977a2fSmrg# PREFIX and SUFFIX must not contain globbing or regex special
721034977a2fSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
721134977a2fSmrg# dot (in which case that matches only a dot).
721234977a2fSmrgfunc_stripname ()
721334977a2fSmrg{
721434977a2fSmrg  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
721534977a2fSmrg  # positional parameters, so assign one to ordinary parameter first.
721634977a2fSmrg  func_stripname_result=${3}
721734977a2fSmrg  func_stripname_result=${func_stripname_result#"${1}"}
721834977a2fSmrg  func_stripname_result=${func_stripname_result%"${2}"}
721934977a2fSmrg}
7220ee3138f1Smrg
722134977a2fSmrg# func_opt_split
722234977a2fSmrgfunc_opt_split ()
722334977a2fSmrg{
722434977a2fSmrg  func_opt_split_opt=${1%%=*}
722534977a2fSmrg  func_opt_split_arg=${1#*=}
722634977a2fSmrg}
7227ee3138f1Smrg
722834977a2fSmrg# func_lo2o object
722934977a2fSmrgfunc_lo2o ()
723034977a2fSmrg{
723134977a2fSmrg  case ${1} in
723234977a2fSmrg    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
723334977a2fSmrg    *)    func_lo2o_result=${1} ;;
723434977a2fSmrg  esac
723534977a2fSmrg}
7236ee3138f1Smrg
723734977a2fSmrg# func_xform libobj-or-source
723834977a2fSmrgfunc_xform ()
723934977a2fSmrg{
724034977a2fSmrg  func_xform_result=${1%.*}.lo
724134977a2fSmrg}
7242ee3138f1Smrg
724334977a2fSmrg# func_arith arithmetic-term...
724434977a2fSmrgfunc_arith ()
724534977a2fSmrg{
724634977a2fSmrg  func_arith_result=$(( $[*] ))
724734977a2fSmrg}
7248ee3138f1Smrg
724934977a2fSmrg# func_len string
725034977a2fSmrg# STRING may not start with a hyphen.
725134977a2fSmrgfunc_len ()
725234977a2fSmrg{
725334977a2fSmrg  func_len_result=${#1}
725434977a2fSmrg}
7255ee3138f1Smrg
725634977a2fSmrg_LT_EOF
725734977a2fSmrg    ;;
725834977a2fSmrg  *) # Bourne compatible functions.
725934977a2fSmrg    cat << \_LT_EOF >> "$cfgfile"
7260ee3138f1Smrg
726134977a2fSmrg# func_dirname file append nondir_replacement
726234977a2fSmrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
726334977a2fSmrg# otherwise set result to NONDIR_REPLACEMENT.
726434977a2fSmrgfunc_dirname ()
726534977a2fSmrg{
726634977a2fSmrg  # Extract subdirectory from the argument.
726734977a2fSmrg  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
726834977a2fSmrg  if test "X$func_dirname_result" = "X${1}"; then
726934977a2fSmrg    func_dirname_result="${3}"
727034977a2fSmrg  else
727134977a2fSmrg    func_dirname_result="$func_dirname_result${2}"
727234977a2fSmrg  fi
727334977a2fSmrg}
7274ee3138f1Smrg
727534977a2fSmrg# func_basename file
727634977a2fSmrgfunc_basename ()
727734977a2fSmrg{
727834977a2fSmrg  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
727934977a2fSmrg}
7280ee3138f1Smrg
728134977a2fSmrgdnl func_dirname_and_basename
728234977a2fSmrgdnl A portable version of this function is already defined in general.m4sh
728334977a2fSmrgdnl so there is no need for it here.
728434977a2fSmrg
728534977a2fSmrg# func_stripname prefix suffix name
728634977a2fSmrg# strip PREFIX and SUFFIX off of NAME.
728734977a2fSmrg# PREFIX and SUFFIX must not contain globbing or regex special
728834977a2fSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
728934977a2fSmrg# dot (in which case that matches only a dot).
729034977a2fSmrg# func_strip_suffix prefix name
729134977a2fSmrgfunc_stripname ()
729234977a2fSmrg{
729334977a2fSmrg  case ${2} in
729434977a2fSmrg    .*) func_stripname_result=`$ECHO "X${3}" \
729534977a2fSmrg           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
729634977a2fSmrg    *)  func_stripname_result=`$ECHO "X${3}" \
729734977a2fSmrg           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
729834977a2fSmrg  esac
729934977a2fSmrg}
7300ee3138f1Smrg
730134977a2fSmrg# sed scripts:
730234977a2fSmrgmy_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
730334977a2fSmrgmy_sed_long_arg='1s/^-[[^=]]*=//'
7304ee3138f1Smrg
730534977a2fSmrg# func_opt_split
730634977a2fSmrgfunc_opt_split ()
730734977a2fSmrg{
730834977a2fSmrg  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
730934977a2fSmrg  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
731034977a2fSmrg}
7311ee3138f1Smrg
731234977a2fSmrg# func_lo2o object
731334977a2fSmrgfunc_lo2o ()
731434977a2fSmrg{
731534977a2fSmrg  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
731634977a2fSmrg}
7317ee3138f1Smrg
731834977a2fSmrg# func_xform libobj-or-source
731934977a2fSmrgfunc_xform ()
732034977a2fSmrg{
732134977a2fSmrg  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
732234977a2fSmrg}
7323ee3138f1Smrg
732434977a2fSmrg# func_arith arithmetic-term...
732534977a2fSmrgfunc_arith ()
732634977a2fSmrg{
732734977a2fSmrg  func_arith_result=`expr "$[@]"`
732834977a2fSmrg}
7329ee3138f1Smrg
733034977a2fSmrg# func_len string
733134977a2fSmrg# STRING may not start with a hyphen.
733234977a2fSmrgfunc_len ()
733334977a2fSmrg{
733434977a2fSmrg  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
733534977a2fSmrg}
7336ee3138f1Smrg
733734977a2fSmrg_LT_EOF
733834977a2fSmrgesac
7339ee3138f1Smrg
734034977a2fSmrgcase $lt_shell_append in
734134977a2fSmrg  yes)
734234977a2fSmrg    cat << \_LT_EOF >> "$cfgfile"
7343ee3138f1Smrg
734434977a2fSmrg# func_append var value
734534977a2fSmrg# Append VALUE to the end of shell variable VAR.
734634977a2fSmrgfunc_append ()
734734977a2fSmrg{
734834977a2fSmrg  eval "$[1]+=\$[2]"
734934977a2fSmrg}
735034977a2fSmrg_LT_EOF
735134977a2fSmrg    ;;
735234977a2fSmrg  *)
735334977a2fSmrg    cat << \_LT_EOF >> "$cfgfile"
7354ee3138f1Smrg
735534977a2fSmrg# func_append var value
735634977a2fSmrg# Append VALUE to the end of shell variable VAR.
735734977a2fSmrgfunc_append ()
735834977a2fSmrg{
735934977a2fSmrg  eval "$[1]=\$$[1]\$[2]"
736034977a2fSmrg}
7361ee3138f1Smrg
736234977a2fSmrg_LT_EOF
736334977a2fSmrg    ;;
736434977a2fSmrg  esac
736534977a2fSmrg])
7366ee3138f1Smrg
736734977a2fSmrg# Helper functions for option handling.                    -*- Autoconf -*-
736834977a2fSmrg#
736934977a2fSmrg#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
737034977a2fSmrg#   Written by Gary V. Vaughan, 2004
737134977a2fSmrg#
737234977a2fSmrg# This file is free software; the Free Software Foundation gives
737334977a2fSmrg# unlimited permission to copy and/or distribute it, with or without
737434977a2fSmrg# modifications, as long as this notice is preserved.
7375ee3138f1Smrg
737634977a2fSmrg# serial 6 ltoptions.m4
7377ee3138f1Smrg
737834977a2fSmrg# This is to help aclocal find these macros, as it can't see m4_define.
737934977a2fSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
7380ee3138f1Smrg
7381ee3138f1Smrg
738234977a2fSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
738334977a2fSmrg# ------------------------------------------
738434977a2fSmrgm4_define([_LT_MANGLE_OPTION],
738534977a2fSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
7386ee3138f1Smrg
7387ee3138f1Smrg
738834977a2fSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
738934977a2fSmrg# ---------------------------------------
739034977a2fSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
739134977a2fSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
739234977a2fSmrg# saved as a flag.
739334977a2fSmrgm4_define([_LT_SET_OPTION],
739434977a2fSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
739534977a2fSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
739634977a2fSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
739734977a2fSmrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
739834977a2fSmrg])
7399ee3138f1Smrg
7400ee3138f1Smrg
740134977a2fSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
740234977a2fSmrg# ------------------------------------------------------------
740334977a2fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
740434977a2fSmrgm4_define([_LT_IF_OPTION],
740534977a2fSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
740634977a2fSmrg
740734977a2fSmrg
740834977a2fSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
740934977a2fSmrg# -------------------------------------------------------
741034977a2fSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
741134977a2fSmrg# are set.
741234977a2fSmrgm4_define([_LT_UNLESS_OPTIONS],
741334977a2fSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
741434977a2fSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
741534977a2fSmrg		      [m4_define([$0_found])])])[]dnl
741634977a2fSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
741734977a2fSmrg])[]dnl
741834977a2fSmrg])
7419ee3138f1Smrg
7420ee3138f1Smrg
742134977a2fSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
742234977a2fSmrg# ----------------------------------------
742334977a2fSmrg# OPTION-LIST is a space-separated list of Libtool options associated
742434977a2fSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
742534977a2fSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
742634977a2fSmrg# the unknown option and exit.
742734977a2fSmrgm4_defun([_LT_SET_OPTIONS],
742834977a2fSmrg[# Set options
742934977a2fSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
743034977a2fSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
743134977a2fSmrg
743234977a2fSmrgm4_if([$1],[LT_INIT],[
743334977a2fSmrg  dnl
743434977a2fSmrg  dnl Simply set some default values (i.e off) if boolean options were not
743534977a2fSmrg  dnl specified:
743634977a2fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
743734977a2fSmrg  ])
743834977a2fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
743934977a2fSmrg  ])
744034977a2fSmrg  dnl
744134977a2fSmrg  dnl If no reference was made to various pairs of opposing options, then
744234977a2fSmrg  dnl we run the default mode handler for the pair.  For example, if neither
744334977a2fSmrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
744434977a2fSmrg  dnl archives by default:
744534977a2fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
744634977a2fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
744734977a2fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
744834977a2fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
744934977a2fSmrg  		   [_LT_ENABLE_FAST_INSTALL])
745034977a2fSmrg  ])
745134977a2fSmrg])# _LT_SET_OPTIONS
7452ee3138f1Smrg
7453ee3138f1Smrg
7454ee3138f1Smrg
745534977a2fSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
745634977a2fSmrg# -----------------------------------------
745734977a2fSmrgm4_define([_LT_MANGLE_DEFUN],
745834977a2fSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
7459ee3138f1Smrg
7460ee3138f1Smrg
746134977a2fSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
746234977a2fSmrg# -----------------------------------------------
746334977a2fSmrgm4_define([LT_OPTION_DEFINE],
746434977a2fSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
746534977a2fSmrg])# LT_OPTION_DEFINE
7466ee3138f1Smrg
7467ee3138f1Smrg
746834977a2fSmrg# dlopen
746934977a2fSmrg# ------
747034977a2fSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
747134977a2fSmrg])
7472ee3138f1Smrg
747334977a2fSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
747434977a2fSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
747534977a2fSmrgAC_DIAGNOSE([obsolete],
747634977a2fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
747734977a2fSmrgput the `dlopen' option into LT_INIT's first parameter.])
747834977a2fSmrg])
7479ee3138f1Smrg
748034977a2fSmrgdnl aclocal-1.4 backwards compatibility:
748134977a2fSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
7482ee3138f1Smrg
7483ee3138f1Smrg
748434977a2fSmrg# win32-dll
748534977a2fSmrg# ---------
748634977a2fSmrg# Declare package support for building win32 dll's.
748734977a2fSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
748834977a2fSmrg[enable_win32_dll=yes
7489ee3138f1Smrg
749034977a2fSmrgcase $host in
749134977a2fSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
749234977a2fSmrg  AC_CHECK_TOOL(AS, as, false)
749334977a2fSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
749434977a2fSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
749534977a2fSmrg  ;;
749634977a2fSmrgesac
7497ee3138f1Smrg
749834977a2fSmrgtest -z "$AS" && AS=as
749934977a2fSmrg_LT_DECL([], [AS],      [0], [Assembler program])dnl
7500ee3138f1Smrg
750134977a2fSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
750234977a2fSmrg_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
7503ee3138f1Smrg
750434977a2fSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
750534977a2fSmrg_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
750634977a2fSmrg])# win32-dll
7507ee3138f1Smrg
750834977a2fSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
750934977a2fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
751034977a2fSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
751134977a2fSmrgAC_DIAGNOSE([obsolete],
751234977a2fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
751334977a2fSmrgput the `win32-dll' option into LT_INIT's first parameter.])
751434977a2fSmrg])
7515ee3138f1Smrg
751634977a2fSmrgdnl aclocal-1.4 backwards compatibility:
751734977a2fSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
7518ee3138f1Smrg
7519ee3138f1Smrg
752034977a2fSmrg# _LT_ENABLE_SHARED([DEFAULT])
752134977a2fSmrg# ----------------------------
752234977a2fSmrg# implement the --enable-shared flag, and supports the `shared' and
752334977a2fSmrg# `disable-shared' LT_INIT options.
752434977a2fSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
752534977a2fSmrgm4_define([_LT_ENABLE_SHARED],
752634977a2fSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
752734977a2fSmrgAC_ARG_ENABLE([shared],
752834977a2fSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
752934977a2fSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
753034977a2fSmrg    [p=${PACKAGE-default}
753134977a2fSmrg    case $enableval in
753234977a2fSmrg    yes) enable_shared=yes ;;
753334977a2fSmrg    no) enable_shared=no ;;
753434977a2fSmrg    *)
753534977a2fSmrg      enable_shared=no
753634977a2fSmrg      # Look at the argument we got.  We use all the common list separators.
753734977a2fSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
753834977a2fSmrg      for pkg in $enableval; do
753934977a2fSmrg	IFS="$lt_save_ifs"
754034977a2fSmrg	if test "X$pkg" = "X$p"; then
754134977a2fSmrg	  enable_shared=yes
754234977a2fSmrg	fi
754334977a2fSmrg      done
754434977a2fSmrg      IFS="$lt_save_ifs"
7545ee3138f1Smrg      ;;
754634977a2fSmrg    esac],
754734977a2fSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
7548ee3138f1Smrg
754934977a2fSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
755034977a2fSmrg	[Whether or not to build shared libraries])
755134977a2fSmrg])# _LT_ENABLE_SHARED
755234977a2fSmrg
755334977a2fSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
755434977a2fSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
755534977a2fSmrg
755634977a2fSmrg# Old names:
755734977a2fSmrgAC_DEFUN([AC_ENABLE_SHARED],
755834977a2fSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
755934977a2fSmrg])
756034977a2fSmrg
756134977a2fSmrgAC_DEFUN([AC_DISABLE_SHARED],
756234977a2fSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
756334977a2fSmrg])
756434977a2fSmrg
756534977a2fSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
756634977a2fSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
756734977a2fSmrg
756834977a2fSmrgdnl aclocal-1.4 backwards compatibility:
756934977a2fSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
757034977a2fSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
757134977a2fSmrg
757234977a2fSmrg
757334977a2fSmrg
757434977a2fSmrg# _LT_ENABLE_STATIC([DEFAULT])
757534977a2fSmrg# ----------------------------
757634977a2fSmrg# implement the --enable-static flag, and support the `static' and
757734977a2fSmrg# `disable-static' LT_INIT options.
757834977a2fSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
757934977a2fSmrgm4_define([_LT_ENABLE_STATIC],
758034977a2fSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
758134977a2fSmrgAC_ARG_ENABLE([static],
758234977a2fSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
758334977a2fSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
758434977a2fSmrg    [p=${PACKAGE-default}
758534977a2fSmrg    case $enableval in
758634977a2fSmrg    yes) enable_static=yes ;;
758734977a2fSmrg    no) enable_static=no ;;
758834977a2fSmrg    *)
758934977a2fSmrg     enable_static=no
759034977a2fSmrg      # Look at the argument we got.  We use all the common list separators.
759134977a2fSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
759234977a2fSmrg      for pkg in $enableval; do
759334977a2fSmrg	IFS="$lt_save_ifs"
759434977a2fSmrg	if test "X$pkg" = "X$p"; then
759534977a2fSmrg	  enable_static=yes
7596ee3138f1Smrg	fi
759734977a2fSmrg      done
759834977a2fSmrg      IFS="$lt_save_ifs"
7599ee3138f1Smrg      ;;
760034977a2fSmrg    esac],
760134977a2fSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
7602ee3138f1Smrg
760334977a2fSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
760434977a2fSmrg	[Whether or not to build static libraries])
760534977a2fSmrg])# _LT_ENABLE_STATIC
760634977a2fSmrg
760734977a2fSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
760834977a2fSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
760934977a2fSmrg
761034977a2fSmrg# Old names:
761134977a2fSmrgAC_DEFUN([AC_ENABLE_STATIC],
761234977a2fSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
761334977a2fSmrg])
761434977a2fSmrg
761534977a2fSmrgAC_DEFUN([AC_DISABLE_STATIC],
761634977a2fSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
761734977a2fSmrg])
761834977a2fSmrg
761934977a2fSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
762034977a2fSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
762134977a2fSmrg
762234977a2fSmrgdnl aclocal-1.4 backwards compatibility:
762334977a2fSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
762434977a2fSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
762534977a2fSmrg
762634977a2fSmrg
762734977a2fSmrg
762834977a2fSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
762934977a2fSmrg# ----------------------------------
763034977a2fSmrg# implement the --enable-fast-install flag, and support the `fast-install'
763134977a2fSmrg# and `disable-fast-install' LT_INIT options.
763234977a2fSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
763334977a2fSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
763434977a2fSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
763534977a2fSmrgAC_ARG_ENABLE([fast-install],
763634977a2fSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
763734977a2fSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
763834977a2fSmrg    [p=${PACKAGE-default}
763934977a2fSmrg    case $enableval in
764034977a2fSmrg    yes) enable_fast_install=yes ;;
764134977a2fSmrg    no) enable_fast_install=no ;;
764234977a2fSmrg    *)
764334977a2fSmrg      enable_fast_install=no
764434977a2fSmrg      # Look at the argument we got.  We use all the common list separators.
764534977a2fSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
764634977a2fSmrg      for pkg in $enableval; do
764734977a2fSmrg	IFS="$lt_save_ifs"
764834977a2fSmrg	if test "X$pkg" = "X$p"; then
764934977a2fSmrg	  enable_fast_install=yes
765034977a2fSmrg	fi
765134977a2fSmrg      done
765234977a2fSmrg      IFS="$lt_save_ifs"
7653ee3138f1Smrg      ;;
765434977a2fSmrg    esac],
765534977a2fSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
7656ee3138f1Smrg
765734977a2fSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
765834977a2fSmrg	 [Whether or not to optimize for fast installation])dnl
765934977a2fSmrg])# _LT_ENABLE_FAST_INSTALL
7660ee3138f1Smrg
766134977a2fSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
766234977a2fSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
7663ee3138f1Smrg
766434977a2fSmrg# Old names:
766534977a2fSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
766634977a2fSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
766734977a2fSmrgAC_DIAGNOSE([obsolete],
766834977a2fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
766934977a2fSmrgthe `fast-install' option into LT_INIT's first parameter.])
767034977a2fSmrg])
7671ee3138f1Smrg
767234977a2fSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
767334977a2fSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
767434977a2fSmrgAC_DIAGNOSE([obsolete],
767534977a2fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
767634977a2fSmrgthe `disable-fast-install' option into LT_INIT's first parameter.])
767734977a2fSmrg])
7678ee3138f1Smrg
767934977a2fSmrgdnl aclocal-1.4 backwards compatibility:
768034977a2fSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
768134977a2fSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
7682ee3138f1Smrg
7683ee3138f1Smrg
768434977a2fSmrg# _LT_WITH_PIC([MODE])
768534977a2fSmrg# --------------------
768634977a2fSmrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
768734977a2fSmrg# LT_INIT options.
768834977a2fSmrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
768934977a2fSmrgm4_define([_LT_WITH_PIC],
769034977a2fSmrg[AC_ARG_WITH([pic],
769134977a2fSmrg    [AS_HELP_STRING([--with-pic],
769234977a2fSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
769334977a2fSmrg    [pic_mode="$withval"],
769434977a2fSmrg    [pic_mode=default])
7695ee3138f1Smrg
769634977a2fSmrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
7697ee3138f1Smrg
769834977a2fSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
769934977a2fSmrg])# _LT_WITH_PIC
770034977a2fSmrg
770134977a2fSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
770234977a2fSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
770334977a2fSmrg
770434977a2fSmrg# Old name:
770534977a2fSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
770634977a2fSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
770734977a2fSmrgAC_DIAGNOSE([obsolete],
770834977a2fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
770934977a2fSmrgput the `pic-only' option into LT_INIT's first parameter.])
7710ee3138f1Smrg])
7711ee3138f1Smrg
771234977a2fSmrgdnl aclocal-1.4 backwards compatibility:
771334977a2fSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
7714ee3138f1Smrg
7715ee3138f1Smrg
771634977a2fSmrgm4_define([_LTDL_MODE], [])
771734977a2fSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
771834977a2fSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
771934977a2fSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
772034977a2fSmrg		 [m4_define([_LTDL_MODE], [recursive])])
772134977a2fSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
772234977a2fSmrg		 [m4_define([_LTDL_MODE], [subproject])])
7723ee3138f1Smrg
772434977a2fSmrgm4_define([_LTDL_TYPE], [])
772534977a2fSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
772634977a2fSmrg		 [m4_define([_LTDL_TYPE], [installable])])
772734977a2fSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
772834977a2fSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
7729ee3138f1Smrg
773034977a2fSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
7731ee3138f1Smrg#
773234977a2fSmrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
773334977a2fSmrg# Written by Gary V. Vaughan, 2004
7734ee3138f1Smrg#
773534977a2fSmrg# This file is free software; the Free Software Foundation gives
773634977a2fSmrg# unlimited permission to copy and/or distribute it, with or without
773734977a2fSmrg# modifications, as long as this notice is preserved.
773834977a2fSmrg
773934977a2fSmrg# serial 6 ltsugar.m4
774034977a2fSmrg
774134977a2fSmrg# This is to help aclocal find these macros, as it can't see m4_define.
774234977a2fSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
774334977a2fSmrg
774434977a2fSmrg
774534977a2fSmrg# lt_join(SEP, ARG1, [ARG2...])
774634977a2fSmrg# -----------------------------
774734977a2fSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
774834977a2fSmrg# associated separator.
774934977a2fSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
775034977a2fSmrg# versions in m4sugar had bugs.
775134977a2fSmrgm4_define([lt_join],
775234977a2fSmrg[m4_if([$#], [1], [],
775334977a2fSmrg       [$#], [2], [[$2]],
775434977a2fSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
775534977a2fSmrgm4_define([_lt_join],
775634977a2fSmrg[m4_if([$#$2], [2], [],
775734977a2fSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
775834977a2fSmrg
775934977a2fSmrg
776034977a2fSmrg# lt_car(LIST)
776134977a2fSmrg# lt_cdr(LIST)
776234977a2fSmrg# ------------
776334977a2fSmrg# Manipulate m4 lists.
776434977a2fSmrg# These macros are necessary as long as will still need to support
776534977a2fSmrg# Autoconf-2.59 which quotes differently.
776634977a2fSmrgm4_define([lt_car], [[$1]])
776734977a2fSmrgm4_define([lt_cdr],
776834977a2fSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
776934977a2fSmrg       [$#], 1, [],
777034977a2fSmrg       [m4_dquote(m4_shift($@))])])
777134977a2fSmrgm4_define([lt_unquote], $1)
777234977a2fSmrg
777334977a2fSmrg
777434977a2fSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
777534977a2fSmrg# ------------------------------------------
777634977a2fSmrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
777734977a2fSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
777834977a2fSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
777934977a2fSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
778034977a2fSmrg# than defined and empty).
7781ee3138f1Smrg#
778234977a2fSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
778334977a2fSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
778434977a2fSmrgm4_define([lt_append],
778534977a2fSmrg[m4_define([$1],
778634977a2fSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
778734977a2fSmrg
778834977a2fSmrg
778934977a2fSmrg
779034977a2fSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
779134977a2fSmrg# ----------------------------------------------------------
779234977a2fSmrg# Produce a SEP delimited list of all paired combinations of elements of
779334977a2fSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
779434977a2fSmrg# has the form PREFIXmINFIXSUFFIXn.
779534977a2fSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
779634977a2fSmrgm4_define([lt_combine],
779734977a2fSmrg[m4_if(m4_eval([$# > 3]), [1],
779834977a2fSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
779934977a2fSmrg[[m4_foreach([_Lt_prefix], [$2],
780034977a2fSmrg	     [m4_foreach([_Lt_suffix],
780134977a2fSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
780234977a2fSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
780334977a2fSmrg
780434977a2fSmrg
780534977a2fSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
780634977a2fSmrg# -----------------------------------------------------------------------
780734977a2fSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
780834977a2fSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
780934977a2fSmrgm4_define([lt_if_append_uniq],
781034977a2fSmrg[m4_ifdef([$1],
781134977a2fSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
781234977a2fSmrg		 [lt_append([$1], [$2], [$3])$4],
781334977a2fSmrg		 [$5])],
781434977a2fSmrg	  [lt_append([$1], [$2], [$3])$4])])
781534977a2fSmrg
781634977a2fSmrg
781734977a2fSmrg# lt_dict_add(DICT, KEY, VALUE)
781834977a2fSmrg# -----------------------------
781934977a2fSmrgm4_define([lt_dict_add],
782034977a2fSmrg[m4_define([$1($2)], [$3])])
7821ee3138f1Smrg
7822ee3138f1Smrg
782334977a2fSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
782434977a2fSmrg# --------------------------------------------
782534977a2fSmrgm4_define([lt_dict_add_subkey],
782634977a2fSmrg[m4_define([$1($2:$3)], [$4])])
7827ee3138f1Smrg
7828ee3138f1Smrg
782934977a2fSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
783034977a2fSmrg# ----------------------------------
783134977a2fSmrgm4_define([lt_dict_fetch],
783234977a2fSmrg[m4_ifval([$3],
783334977a2fSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
783434977a2fSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
7835ee3138f1Smrg
7836ee3138f1Smrg
783734977a2fSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
783834977a2fSmrg# -----------------------------------------------------------------
783934977a2fSmrgm4_define([lt_if_dict_fetch],
784034977a2fSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
784134977a2fSmrg	[$5],
784234977a2fSmrg    [$6])])
7843ee3138f1Smrg
784434977a2fSmrg
784534977a2fSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
784634977a2fSmrg# --------------------------------------------------------------
784734977a2fSmrgm4_define([lt_dict_filter],
784834977a2fSmrg[m4_if([$5], [], [],
784934977a2fSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
785034977a2fSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
785134977a2fSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
7852ee3138f1Smrg])
7853ee3138f1Smrg
785434977a2fSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
785534977a2fSmrg#
785634977a2fSmrg#   Copyright (C) 2004 Free Software Foundation, Inc.
785734977a2fSmrg#   Written by Scott James Remnant, 2004
785834977a2fSmrg#
785934977a2fSmrg# This file is free software; the Free Software Foundation gives
786034977a2fSmrg# unlimited permission to copy and/or distribute it, with or without
786134977a2fSmrg# modifications, as long as this notice is preserved.
7862ee3138f1Smrg
786334977a2fSmrg# Generated from ltversion.in.
7864ee3138f1Smrg
786534977a2fSmrg# serial 3012 ltversion.m4
786634977a2fSmrg# This file is part of GNU Libtool
7867ee3138f1Smrg
786834977a2fSmrgm4_define([LT_PACKAGE_VERSION], [2.2.6])
786934977a2fSmrgm4_define([LT_PACKAGE_REVISION], [1.3012])
7870ee3138f1Smrg
787134977a2fSmrgAC_DEFUN([LTVERSION_VERSION],
787234977a2fSmrg[macro_version='2.2.6'
787334977a2fSmrgmacro_revision='1.3012'
787434977a2fSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
787534977a2fSmrg_LT_DECL(, macro_revision, 0)
7876ee3138f1Smrg])
7877ee3138f1Smrg
787834977a2fSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
787934977a2fSmrg#
788034977a2fSmrg#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
788134977a2fSmrg#   Written by Scott James Remnant, 2004.
788234977a2fSmrg#
788334977a2fSmrg# This file is free software; the Free Software Foundation gives
788434977a2fSmrg# unlimited permission to copy and/or distribute it, with or without
788534977a2fSmrg# modifications, as long as this notice is preserved.
788634977a2fSmrg
788734977a2fSmrg# serial 4 lt~obsolete.m4
788834977a2fSmrg
788934977a2fSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
789034977a2fSmrg#
789134977a2fSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
789234977a2fSmrg# which have later been changed to m4_define as they aren't part of the
789334977a2fSmrg# exported API, or moved to Autoconf or Automake where they belong.
789434977a2fSmrg#
789534977a2fSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
789634977a2fSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
789734977a2fSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
789834977a2fSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
789934977a2fSmrg# and doesn't know about Autoconf macros at all.)
790034977a2fSmrg#
790134977a2fSmrg# So we provide this file, which has a silly filename so it's always
790234977a2fSmrg# included after everything else.  This provides aclocal with the
790334977a2fSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
790434977a2fSmrg# because those macros already exist, or will be overwritten later.
790534977a2fSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
790634977a2fSmrg#
790734977a2fSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
790834977a2fSmrg# Yes, that means every name once taken will need to remain here until
790934977a2fSmrg# we give up compatibility with versions before 1.7, at which point
791034977a2fSmrg# we need to keep only those names which we still refer to.
791134977a2fSmrg
791234977a2fSmrg# This is to help aclocal find these macros, as it can't see m4_define.
791334977a2fSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
791434977a2fSmrg
791534977a2fSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
791634977a2fSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
791734977a2fSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
791834977a2fSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
791934977a2fSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
792034977a2fSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
792134977a2fSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
792234977a2fSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
792334977a2fSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
792434977a2fSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
792534977a2fSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
792634977a2fSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
792734977a2fSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
792834977a2fSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
792934977a2fSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
793034977a2fSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
793134977a2fSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
793234977a2fSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
793334977a2fSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
793434977a2fSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
793534977a2fSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
793634977a2fSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
793734977a2fSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
793834977a2fSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
793934977a2fSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
794034977a2fSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
794134977a2fSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
794234977a2fSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
794334977a2fSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
794434977a2fSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
794534977a2fSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
794634977a2fSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
794734977a2fSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
794834977a2fSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
794934977a2fSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
795034977a2fSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
795134977a2fSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
795234977a2fSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
795334977a2fSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
795434977a2fSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
795534977a2fSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
795634977a2fSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
795734977a2fSmrgm4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
795834977a2fSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
795934977a2fSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
796034977a2fSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
796134977a2fSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
796234977a2fSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
796334977a2fSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
796434977a2fSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
796534977a2fSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
796634977a2fSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
796734977a2fSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
796834977a2fSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
796934977a2fSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
797034977a2fSmrg
7971ee3138f1Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
7972ee3138f1Smrg# 
7973ee3138f1Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
7974ee3138f1Smrg#
7975ee3138f1Smrg# This program is free software; you can redistribute it and/or modify
7976ee3138f1Smrg# it under the terms of the GNU General Public License as published by
7977ee3138f1Smrg# the Free Software Foundation; either version 2 of the License, or
7978ee3138f1Smrg# (at your option) any later version.
7979ee3138f1Smrg#
7980ee3138f1Smrg# This program is distributed in the hope that it will be useful, but
7981ee3138f1Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
7982ee3138f1Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7983ee3138f1Smrg# General Public License for more details.
7984ee3138f1Smrg#
7985ee3138f1Smrg# You should have received a copy of the GNU General Public License
7986ee3138f1Smrg# along with this program; if not, write to the Free Software
7987ee3138f1Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7988ee3138f1Smrg#
7989ee3138f1Smrg# As a special exception to the GNU General Public License, if you
7990ee3138f1Smrg# distribute this file as part of a program that contains a
7991ee3138f1Smrg# configuration script generated by Autoconf, you may include it under
7992ee3138f1Smrg# the same distribution terms that you use for the rest of that program.
7993ee3138f1Smrg
7994ee3138f1Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
7995ee3138f1Smrg# ----------------------------------
7996ee3138f1SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
7997ee3138f1Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
7998ee3138f1Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
7999ee3138f1SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
8000ee3138f1Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
8001ee3138f1Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
8002ee3138f1Smrgfi
8003ee3138f1Smrgif test -n "$PKG_CONFIG"; then
8004ee3138f1Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
8005ee3138f1Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
8006ee3138f1Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
8007ee3138f1Smrg		AC_MSG_RESULT([yes])
8008ee3138f1Smrg	else
8009ee3138f1Smrg		AC_MSG_RESULT([no])
8010ee3138f1Smrg		PKG_CONFIG=""
8011ee3138f1Smrg	fi
8012ee3138f1Smrg		
8013ee3138f1Smrgfi[]dnl
8014ee3138f1Smrg])# PKG_PROG_PKG_CONFIG
8015ee3138f1Smrg
8016ee3138f1Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8017ee3138f1Smrg#
8018ee3138f1Smrg# Check to see whether a particular set of modules exists.  Similar
8019ee3138f1Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
8020ee3138f1Smrg#
8021ee3138f1Smrg#
8022ee3138f1Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
8023ee3138f1Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
8024ee3138f1Smrg# PKG_CHECK_EXISTS manually
8025ee3138f1Smrg# --------------------------------------------------------------
8026ee3138f1SmrgAC_DEFUN([PKG_CHECK_EXISTS],
8027ee3138f1Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8028ee3138f1Smrgif test -n "$PKG_CONFIG" && \
8029ee3138f1Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
8030ee3138f1Smrg  m4_ifval([$2], [$2], [:])
8031ee3138f1Smrgm4_ifvaln([$3], [else
8032ee3138f1Smrg  $3])dnl
8033ee3138f1Smrgfi])
8034ee3138f1Smrg
8035ee3138f1Smrg
8036ee3138f1Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8037ee3138f1Smrg# ---------------------------------------------
8038ee3138f1Smrgm4_define([_PKG_CONFIG],
8039ee3138f1Smrg[if test -n "$$1"; then
8040ee3138f1Smrg    pkg_cv_[]$1="$$1"
8041ee3138f1Smrg elif test -n "$PKG_CONFIG"; then
8042ee3138f1Smrg    PKG_CHECK_EXISTS([$3],
8043ee3138f1Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
8044ee3138f1Smrg		     [pkg_failed=yes])
8045ee3138f1Smrg else
8046ee3138f1Smrg    pkg_failed=untried
8047ee3138f1Smrgfi[]dnl
8048ee3138f1Smrg])# _PKG_CONFIG
8049ee3138f1Smrg
8050ee3138f1Smrg# _PKG_SHORT_ERRORS_SUPPORTED
8051ee3138f1Smrg# -----------------------------
8052ee3138f1SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
8053ee3138f1Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8054ee3138f1Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
8055ee3138f1Smrg        _pkg_short_errors_supported=yes
8056ee3138f1Smrgelse
8057ee3138f1Smrg        _pkg_short_errors_supported=no
8058ee3138f1Smrgfi[]dnl
8059ee3138f1Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
8060ee3138f1Smrg
8061ee3138f1Smrg
8062ee3138f1Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
8063ee3138f1Smrg# [ACTION-IF-NOT-FOUND])
8064ee3138f1Smrg#
8065ee3138f1Smrg#
8066ee3138f1Smrg# Note that if there is a possibility the first call to
8067ee3138f1Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
8068ee3138f1Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
8069ee3138f1Smrg#
8070ee3138f1Smrg#
8071ee3138f1Smrg# --------------------------------------------------------------
8072ee3138f1SmrgAC_DEFUN([PKG_CHECK_MODULES],
8073ee3138f1Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8074ee3138f1SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
8075ee3138f1SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
8076ee3138f1Smrg
8077ee3138f1Smrgpkg_failed=no
8078ee3138f1SmrgAC_MSG_CHECKING([for $1])
8079ee3138f1Smrg
8080ee3138f1Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
8081ee3138f1Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
8082ee3138f1Smrg
8083ee3138f1Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
8084ee3138f1Smrgand $1[]_LIBS to avoid the need to call pkg-config.
8085ee3138f1SmrgSee the pkg-config man page for more details.])
8086ee3138f1Smrg
8087ee3138f1Smrgif test $pkg_failed = yes; then
8088ee3138f1Smrg        _PKG_SHORT_ERRORS_SUPPORTED
8089ee3138f1Smrg        if test $_pkg_short_errors_supported = yes; then
8090ee3138f1Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
8091ee3138f1Smrg        else 
8092ee3138f1Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
8093ee3138f1Smrg        fi
8094ee3138f1Smrg	# Put the nasty error message in config.log where it belongs
8095ee3138f1Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8096ee3138f1Smrg
8097ee3138f1Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
8098ee3138f1Smrg[Package requirements ($2) were not met:
8099ee3138f1Smrg
8100ee3138f1Smrg$$1_PKG_ERRORS
8101ee3138f1Smrg
8102ee3138f1SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
8103ee3138f1Smrginstalled software in a non-standard prefix.
8104ee3138f1Smrg
8105ee3138f1Smrg_PKG_TEXT
8106ee3138f1Smrg])],
8107ee3138f1Smrg		[AC_MSG_RESULT([no])
8108ee3138f1Smrg                $4])
8109ee3138f1Smrgelif test $pkg_failed = untried; then
8110ee3138f1Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
8111ee3138f1Smrg[The pkg-config script could not be found or is too old.  Make sure it
8112ee3138f1Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
8113ee3138f1Smrgpath to pkg-config.
8114ee3138f1Smrg
8115ee3138f1Smrg_PKG_TEXT
8116ee3138f1Smrg
8117ee3138f1SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
8118ee3138f1Smrg		[$4])
8119ee3138f1Smrgelse
8120ee3138f1Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
8121ee3138f1Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
8122ee3138f1Smrg        AC_MSG_RESULT([yes])
8123ee3138f1Smrg	ifelse([$3], , :, [$3])
8124ee3138f1Smrgfi[]dnl
8125ee3138f1Smrg])# PKG_CHECK_MODULES
8126ee3138f1Smrg
812734977a2fSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
812834977a2fSmrg#
812934977a2fSmrg# This file is free software; the Free Software Foundation
813034977a2fSmrg# gives unlimited permission to copy and/or distribute it,
813134977a2fSmrg# with or without modifications, as long as this notice is preserved.
8132ee3138f1Smrg
813334977a2fSmrg# AM_AUTOMAKE_VERSION(VERSION)
813434977a2fSmrg# ----------------------------
813534977a2fSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
813634977a2fSmrg# generated from the m4 files accompanying Automake X.Y.
813734977a2fSmrg# (This private macro should not be called outside this file.)
813834977a2fSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
813934977a2fSmrg[am__api_version='1.11'
814034977a2fSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
814134977a2fSmrgdnl require some minimum version.  Point them to the right macro.
814234977a2fSmrgm4_if([$1], [1.11], [],
814334977a2fSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
814434977a2fSmrg])
814534977a2fSmrg
814634977a2fSmrg# _AM_AUTOCONF_VERSION(VERSION)
814734977a2fSmrg# -----------------------------
814834977a2fSmrg# aclocal traces this macro to find the Autoconf version.
814934977a2fSmrg# This is a private macro too.  Using m4_define simplifies
815034977a2fSmrg# the logic in aclocal, which can simply ignore this definition.
815134977a2fSmrgm4_define([_AM_AUTOCONF_VERSION], [])
815234977a2fSmrg
815334977a2fSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
815434977a2fSmrg# -------------------------------
815534977a2fSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
815634977a2fSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
815734977a2fSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
815834977a2fSmrg[AM_AUTOMAKE_VERSION([1.11])dnl
815934977a2fSmrgm4_ifndef([AC_AUTOCONF_VERSION],
816034977a2fSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
816134977a2fSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
816234977a2fSmrg
816334977a2fSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
816434977a2fSmrg
816534977a2fSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
816634977a2fSmrg#
816734977a2fSmrg# This file is free software; the Free Software Foundation
816834977a2fSmrg# gives unlimited permission to copy and/or distribute it,
816934977a2fSmrg# with or without modifications, as long as this notice is preserved.
817034977a2fSmrg
817134977a2fSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
817234977a2fSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
817334977a2fSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
8174ee3138f1Smrg#
817534977a2fSmrg# Of course, Automake must honor this variable whenever it calls a
817634977a2fSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
817734977a2fSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
817834977a2fSmrg# depending on how configure is run.  This is pretty annoying, since
817934977a2fSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
818034977a2fSmrg# source directory, any form will work fine, but in subdirectories a
818134977a2fSmrg# relative path needs to be adjusted first.
8182ee3138f1Smrg#
818334977a2fSmrg# $ac_aux_dir/missing
818434977a2fSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
818534977a2fSmrg# $top_srcdir/$ac_aux_dir/missing
818634977a2fSmrg#    fails if $ac_aux_dir is absolute,
818734977a2fSmrg#    fails when called from a subdirectory in a VPATH build with
818834977a2fSmrg#          a relative $ac_aux_dir
8189ee3138f1Smrg#
819034977a2fSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
819134977a2fSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
819234977a2fSmrg# harmless because $srcdir is `.', but things will broke when you
819334977a2fSmrg# start a VPATH build or use an absolute $srcdir.
8194ee3138f1Smrg#
819534977a2fSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
819634977a2fSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
819734977a2fSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
819834977a2fSmrg# and then we would define $MISSING as
819934977a2fSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
820034977a2fSmrg# This will work as long as MISSING is not called from configure, because
820134977a2fSmrg# unfortunately $(top_srcdir) has no meaning in configure.
820234977a2fSmrg# However there are other variables, like CC, which are often used in
820334977a2fSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
8204ee3138f1Smrg#
820534977a2fSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
820634977a2fSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
820734977a2fSmrg# configured tree to be moved without reconfiguration.
8208ee3138f1Smrg
820934977a2fSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
821034977a2fSmrg[dnl Rely on autoconf to set up CDPATH properly.
821134977a2fSmrgAC_PREREQ([2.50])dnl
821234977a2fSmrg# expand $ac_aux_dir to an absolute path
821334977a2fSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
821434977a2fSmrg])
8215ee3138f1Smrg
821634977a2fSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
8217ee3138f1Smrg
821834977a2fSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
821934977a2fSmrg# Free Software Foundation, Inc.
8220ee3138f1Smrg#
822134977a2fSmrg# This file is free software; the Free Software Foundation
822234977a2fSmrg# gives unlimited permission to copy and/or distribute it,
822334977a2fSmrg# with or without modifications, as long as this notice is preserved.
8224ee3138f1Smrg
822534977a2fSmrg# serial 9
8226ee3138f1Smrg
822734977a2fSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
822834977a2fSmrg# -------------------------------------
822934977a2fSmrg# Define a conditional.
823034977a2fSmrgAC_DEFUN([AM_CONDITIONAL],
823134977a2fSmrg[AC_PREREQ(2.52)dnl
823234977a2fSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
823334977a2fSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
823434977a2fSmrgAC_SUBST([$1_TRUE])dnl
823534977a2fSmrgAC_SUBST([$1_FALSE])dnl
823634977a2fSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
823734977a2fSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
823834977a2fSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
823934977a2fSmrgif $2; then
824034977a2fSmrg  $1_TRUE=
824134977a2fSmrg  $1_FALSE='#'
824234977a2fSmrgelse
824334977a2fSmrg  $1_TRUE='#'
824434977a2fSmrg  $1_FALSE=
8245ee3138f1Smrgfi
824634977a2fSmrgAC_CONFIG_COMMANDS_PRE(
824734977a2fSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
824834977a2fSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
824934977a2fSmrgUsually this means the macro was only invoked conditionally.]])
825034977a2fSmrgfi])])
8251ee3138f1Smrg
825234977a2fSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
825334977a2fSmrg# Free Software Foundation, Inc.
825434977a2fSmrg#
825534977a2fSmrg# This file is free software; the Free Software Foundation
825634977a2fSmrg# gives unlimited permission to copy and/or distribute it,
825734977a2fSmrg# with or without modifications, as long as this notice is preserved.
8258ee3138f1Smrg
825934977a2fSmrg# serial 10
8260ee3138f1Smrg
826134977a2fSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
826234977a2fSmrg# written in clear, in which case automake, when reading aclocal.m4,
826334977a2fSmrg# will think it sees a *use*, and therefore will trigger all it's
826434977a2fSmrg# C support machinery.  Also note that it means that autoscan, seeing
826534977a2fSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
8266ee3138f1Smrg
8267ee3138f1Smrg
826834977a2fSmrg# _AM_DEPENDENCIES(NAME)
826934977a2fSmrg# ----------------------
827034977a2fSmrg# See how the compiler implements dependency checking.
827134977a2fSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
827234977a2fSmrg# We try a few techniques and use that to set a single cache variable.
827334977a2fSmrg#
827434977a2fSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
827534977a2fSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
827634977a2fSmrg# dependency, and given that the user is not expected to run this macro,
827734977a2fSmrg# just rely on AC_PROG_CC.
827834977a2fSmrgAC_DEFUN([_AM_DEPENDENCIES],
827934977a2fSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
828034977a2fSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
828134977a2fSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
828234977a2fSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
8283ee3138f1Smrg
828434977a2fSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
828534977a2fSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
828634977a2fSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
828734977a2fSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
828834977a2fSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
828934977a2fSmrg                   [depcc="$$1"   am_compiler_list=])
8290ee3138f1Smrg
829134977a2fSmrgAC_CACHE_CHECK([dependency style of $depcc],
829234977a2fSmrg               [am_cv_$1_dependencies_compiler_type],
829334977a2fSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
829434977a2fSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
829534977a2fSmrg  # making bogus files that we don't know about and never remove.  For
829634977a2fSmrg  # instance it was reported that on HP-UX the gcc test will end up
829734977a2fSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
829834977a2fSmrg  # in D'.
829934977a2fSmrg  mkdir conftest.dir
830034977a2fSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
830134977a2fSmrg  # using a relative directory.
830234977a2fSmrg  cp "$am_depcomp" conftest.dir
830334977a2fSmrg  cd conftest.dir
830434977a2fSmrg  # We will build objects and dependencies in a subdirectory because
830534977a2fSmrg  # it helps to detect inapplicable dependency modes.  For instance
830634977a2fSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
830734977a2fSmrg  # side effect of compilation, but ICC will put the dependencies in
830834977a2fSmrg  # the current directory while Tru64 will put them in the object
830934977a2fSmrg  # directory.
831034977a2fSmrg  mkdir sub
8311ee3138f1Smrg
831234977a2fSmrg  am_cv_$1_dependencies_compiler_type=none
831334977a2fSmrg  if test "$am_compiler_list" = ""; then
831434977a2fSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
831534977a2fSmrg  fi
831634977a2fSmrg  am__universal=false
831734977a2fSmrg  m4_case([$1], [CC],
831834977a2fSmrg    [case " $depcc " in #(
831934977a2fSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
832034977a2fSmrg     esac],
832134977a2fSmrg    [CXX],
832234977a2fSmrg    [case " $depcc " in #(
832334977a2fSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
832434977a2fSmrg     esac])
8325ee3138f1Smrg
832634977a2fSmrg  for depmode in $am_compiler_list; do
832734977a2fSmrg    # Setup a source with many dependencies, because some compilers
832834977a2fSmrg    # like to wrap large dependency lists on column 80 (with \), and
832934977a2fSmrg    # we should not choose a depcomp mode which is confused by this.
833034977a2fSmrg    #
833134977a2fSmrg    # We need to recreate these files for each test, as the compiler may
833234977a2fSmrg    # overwrite some of them when testing with obscure command lines.
833334977a2fSmrg    # This happens at least with the AIX C compiler.
833434977a2fSmrg    : > sub/conftest.c
833534977a2fSmrg    for i in 1 2 3 4 5 6; do
833634977a2fSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
833734977a2fSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
833834977a2fSmrg      # Solaris 8's {/usr,}/bin/sh.
833934977a2fSmrg      touch sub/conftst$i.h
834034977a2fSmrg    done
834134977a2fSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
8342ee3138f1Smrg
834334977a2fSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
834434977a2fSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
834534977a2fSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
834634977a2fSmrg    # versions had trouble with output in subdirs
834734977a2fSmrg    am__obj=sub/conftest.${OBJEXT-o}
834834977a2fSmrg    am__minus_obj="-o $am__obj"
834934977a2fSmrg    case $depmode in
835034977a2fSmrg    gcc)
835134977a2fSmrg      # This depmode causes a compiler race in universal mode.
835234977a2fSmrg      test "$am__universal" = false || continue
835334977a2fSmrg      ;;
835434977a2fSmrg    nosideeffect)
835534977a2fSmrg      # after this tag, mechanisms are not by side-effect, so they'll
835634977a2fSmrg      # only be used when explicitly requested
835734977a2fSmrg      if test "x$enable_dependency_tracking" = xyes; then
835834977a2fSmrg	continue
835934977a2fSmrg      else
836034977a2fSmrg	break
836134977a2fSmrg      fi
836234977a2fSmrg      ;;
836334977a2fSmrg    msvisualcpp | msvcmsys)
836434977a2fSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
836534977a2fSmrg      # not run yet.  These depmodes are late enough in the game, and
836634977a2fSmrg      # so weak that their functioning should not be impacted.
836734977a2fSmrg      am__obj=conftest.${OBJEXT-o}
836834977a2fSmrg      am__minus_obj=
836934977a2fSmrg      ;;
837034977a2fSmrg    none) break ;;
837134977a2fSmrg    esac
837234977a2fSmrg    if depmode=$depmode \
837334977a2fSmrg       source=sub/conftest.c object=$am__obj \
837434977a2fSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
837534977a2fSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
837634977a2fSmrg         >/dev/null 2>conftest.err &&
837734977a2fSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
837834977a2fSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
837934977a2fSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
838034977a2fSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
838134977a2fSmrg      # icc doesn't choke on unknown options, it will just issue warnings
838234977a2fSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
838334977a2fSmrg      # that says an option was ignored or not supported.
838434977a2fSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
838534977a2fSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
838634977a2fSmrg      # The diagnosis changed in icc 8.0:
838734977a2fSmrg      #   icc: Command line remark: option '-MP' not supported
838834977a2fSmrg      if (grep 'ignoring option' conftest.err ||
838934977a2fSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
839034977a2fSmrg        am_cv_$1_dependencies_compiler_type=$depmode
839134977a2fSmrg        break
839234977a2fSmrg      fi
839334977a2fSmrg    fi
839434977a2fSmrg  done
8395ee3138f1Smrg
839634977a2fSmrg  cd ..
839734977a2fSmrg  rm -rf conftest.dir
8398ee3138f1Smrgelse
839934977a2fSmrg  am_cv_$1_dependencies_compiler_type=none
8400ee3138f1Smrgfi
840134977a2fSmrg])
840234977a2fSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
840334977a2fSmrgAM_CONDITIONAL([am__fastdep$1], [
840434977a2fSmrg  test "x$enable_dependency_tracking" != xno \
840534977a2fSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
840634977a2fSmrg])
8407ee3138f1Smrg
8408ee3138f1Smrg
840934977a2fSmrg# AM_SET_DEPDIR
841034977a2fSmrg# -------------
841134977a2fSmrg# Choose a directory name for dependency files.
841234977a2fSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
841334977a2fSmrgAC_DEFUN([AM_SET_DEPDIR],
841434977a2fSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
841534977a2fSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
841634977a2fSmrg])
8417ee3138f1Smrg
8418ee3138f1Smrg
841934977a2fSmrg# AM_DEP_TRACK
842034977a2fSmrg# ------------
842134977a2fSmrgAC_DEFUN([AM_DEP_TRACK],
842234977a2fSmrg[AC_ARG_ENABLE(dependency-tracking,
842334977a2fSmrg[  --disable-dependency-tracking  speeds up one-time build
842434977a2fSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
842534977a2fSmrgif test "x$enable_dependency_tracking" != xno; then
842634977a2fSmrg  am_depcomp="$ac_aux_dir/depcomp"
842734977a2fSmrg  AMDEPBACKSLASH='\'
8428ee3138f1Smrgfi
842934977a2fSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
843034977a2fSmrgAC_SUBST([AMDEPBACKSLASH])dnl
843134977a2fSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
843234977a2fSmrg])
8433ee3138f1Smrg
843434977a2fSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
8435ee3138f1Smrg
843634977a2fSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
843734977a2fSmrg# Free Software Foundation, Inc.
8438ee3138f1Smrg#
843934977a2fSmrg# This file is free software; the Free Software Foundation
844034977a2fSmrg# gives unlimited permission to copy and/or distribute it,
844134977a2fSmrg# with or without modifications, as long as this notice is preserved.
8442ee3138f1Smrg
844334977a2fSmrg#serial 5
8444ee3138f1Smrg
844534977a2fSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
844634977a2fSmrg# ------------------------------
844734977a2fSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
844834977a2fSmrg[{
844934977a2fSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
845034977a2fSmrg  # are listed without --file.  Let's play safe and only enable the eval
845134977a2fSmrg  # if we detect the quoting.
845234977a2fSmrg  case $CONFIG_FILES in
845334977a2fSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
845434977a2fSmrg  *)   set x $CONFIG_FILES ;;
845534977a2fSmrg  esac
845634977a2fSmrg  shift
845734977a2fSmrg  for mf
845834977a2fSmrg  do
845934977a2fSmrg    # Strip MF so we end up with the name of the file.
846034977a2fSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
846134977a2fSmrg    # Check whether this is an Automake generated Makefile or not.
846234977a2fSmrg    # We used to match only the files named `Makefile.in', but
846334977a2fSmrg    # some people rename them; so instead we look at the file content.
846434977a2fSmrg    # Grep'ing the first line is not enough: some people post-process
846534977a2fSmrg    # each Makefile.in and add a new line on top of each file to say so.
846634977a2fSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
846734977a2fSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
846834977a2fSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
846934977a2fSmrg      dirpart=`AS_DIRNAME("$mf")`
847034977a2fSmrg    else
847134977a2fSmrg      continue
847234977a2fSmrg    fi
847334977a2fSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
847434977a2fSmrg    # from the Makefile without running `make'.
847534977a2fSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
847634977a2fSmrg    test -z "$DEPDIR" && continue
847734977a2fSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
847834977a2fSmrg    test -z "am__include" && continue
847934977a2fSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
848034977a2fSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
848134977a2fSmrg    U=`sed -n 's/^U = //p' < "$mf"`
848234977a2fSmrg    # Find all dependency output files, they are included files with
848334977a2fSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
848434977a2fSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
848534977a2fSmrg    # expansion.
848634977a2fSmrg    for file in `sed -n "
848734977a2fSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
848834977a2fSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
848934977a2fSmrg      # Make sure the directory exists.
849034977a2fSmrg      test -f "$dirpart/$file" && continue
849134977a2fSmrg      fdir=`AS_DIRNAME(["$file"])`
849234977a2fSmrg      AS_MKDIR_P([$dirpart/$fdir])
849334977a2fSmrg      # echo "creating $dirpart/$file"
849434977a2fSmrg      echo '# dummy' > "$dirpart/$file"
849534977a2fSmrg    done
849634977a2fSmrg  done
849734977a2fSmrg}
849834977a2fSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
8499ee3138f1Smrg
8500ee3138f1Smrg
850134977a2fSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
850234977a2fSmrg# -----------------------------
850334977a2fSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
850434977a2fSmrg#
850534977a2fSmrg# This code is only required when automatic dependency tracking
850634977a2fSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
850734977a2fSmrg# need in order to bootstrap the dependency handling code.
850834977a2fSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
850934977a2fSmrg[AC_CONFIG_COMMANDS([depfiles],
851034977a2fSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
851134977a2fSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
851234977a2fSmrg])
8513ee3138f1Smrg
851434977a2fSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
851534977a2fSmrg# Free Software Foundation, Inc.
851634977a2fSmrg#
851734977a2fSmrg# This file is free software; the Free Software Foundation
851834977a2fSmrg# gives unlimited permission to copy and/or distribute it,
851934977a2fSmrg# with or without modifications, as long as this notice is preserved.
8520ee3138f1Smrg
852134977a2fSmrg# serial 8
8522ee3138f1Smrg
852334977a2fSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
852434977a2fSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
8525ee3138f1Smrg
852634977a2fSmrg# Do all the work for Automake.                             -*- Autoconf -*-
8527ee3138f1Smrg
852834977a2fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
852934977a2fSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
8530ee3138f1Smrg#
853134977a2fSmrg# This file is free software; the Free Software Foundation
853234977a2fSmrg# gives unlimited permission to copy and/or distribute it,
853334977a2fSmrg# with or without modifications, as long as this notice is preserved.
8534ee3138f1Smrg
853534977a2fSmrg# serial 16
853634977a2fSmrg
853734977a2fSmrg# This macro actually does too much.  Some checks are only needed if
853834977a2fSmrg# your package does certain things.  But this isn't really a big deal.
853934977a2fSmrg
854034977a2fSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
854134977a2fSmrg# AM_INIT_AUTOMAKE([OPTIONS])
854234977a2fSmrg# -----------------------------------------------
854334977a2fSmrg# The call with PACKAGE and VERSION arguments is the old style
854434977a2fSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
854534977a2fSmrg# and VERSION should now be passed to AC_INIT and removed from
854634977a2fSmrg# the call to AM_INIT_AUTOMAKE.
854734977a2fSmrg# We support both call styles for the transition.  After
854834977a2fSmrg# the next Automake release, Autoconf can make the AC_INIT
854934977a2fSmrg# arguments mandatory, and then we can depend on a new Autoconf
855034977a2fSmrg# release and drop the old call support.
855134977a2fSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
855234977a2fSmrg[AC_PREREQ([2.62])dnl
855334977a2fSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
855434977a2fSmrgdnl the ones we care about.
855534977a2fSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
855634977a2fSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
855734977a2fSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
855834977a2fSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
855934977a2fSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
856034977a2fSmrg  # is not polluted with repeated "-I."
856134977a2fSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
856234977a2fSmrg  # test to see if srcdir already configured
856334977a2fSmrg  if test -f $srcdir/config.status; then
856434977a2fSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
856534977a2fSmrg  fi
8566ee3138f1Smrgfi
8567ee3138f1Smrg
856834977a2fSmrg# test whether we have cygpath
856934977a2fSmrgif test -z "$CYGPATH_W"; then
857034977a2fSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
857134977a2fSmrg    CYGPATH_W='cygpath -w'
857234977a2fSmrg  else
857334977a2fSmrg    CYGPATH_W=echo
857434977a2fSmrg  fi
8575ee3138f1Smrgfi
857634977a2fSmrgAC_SUBST([CYGPATH_W])
8577ee3138f1Smrg
857834977a2fSmrg# Define the identity of the package.
857934977a2fSmrgdnl Distinguish between old-style and new-style calls.
858034977a2fSmrgm4_ifval([$2],
858134977a2fSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
858234977a2fSmrg AC_SUBST([PACKAGE], [$1])dnl
858334977a2fSmrg AC_SUBST([VERSION], [$2])],
858434977a2fSmrg[_AM_SET_OPTIONS([$1])dnl
858534977a2fSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
858634977a2fSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
858734977a2fSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
858834977a2fSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
858934977a2fSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
8590ee3138f1Smrg
859134977a2fSmrg_AM_IF_OPTION([no-define],,
859234977a2fSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
859334977a2fSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
8594ee3138f1Smrg
859534977a2fSmrg# Some tools Automake needs.
859634977a2fSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
859734977a2fSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
859834977a2fSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
859934977a2fSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
860034977a2fSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
860134977a2fSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
860234977a2fSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
860334977a2fSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
860434977a2fSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
860534977a2fSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
860634977a2fSmrg# We need awk for the "check" target.  The system "awk" is bad on
860734977a2fSmrg# some platforms.
860834977a2fSmrgAC_REQUIRE([AC_PROG_AWK])dnl
860934977a2fSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
861034977a2fSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
861134977a2fSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
861234977a2fSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
861334977a2fSmrg			     [_AM_PROG_TAR([v7])])])
861434977a2fSmrg_AM_IF_OPTION([no-dependencies],,
861534977a2fSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
861634977a2fSmrg		  [_AM_DEPENDENCIES(CC)],
861734977a2fSmrg		  [define([AC_PROG_CC],
861834977a2fSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
861934977a2fSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
862034977a2fSmrg		  [_AM_DEPENDENCIES(CXX)],
862134977a2fSmrg		  [define([AC_PROG_CXX],
862234977a2fSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
862334977a2fSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
862434977a2fSmrg		  [_AM_DEPENDENCIES(OBJC)],
862534977a2fSmrg		  [define([AC_PROG_OBJC],
862634977a2fSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
862734977a2fSmrg])
862834977a2fSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
862934977a2fSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
863034977a2fSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
863134977a2fSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
863234977a2fSmrgAC_CONFIG_COMMANDS_PRE(dnl
863334977a2fSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
863434977a2fSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
863534977a2fSmrg])
8636ee3138f1Smrg
863734977a2fSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
863834977a2fSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
863934977a2fSmrgdnl mangled by Autoconf and run in a shell conditional statement.
864034977a2fSmrgm4_define([_AC_COMPILER_EXEEXT],
864134977a2fSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
8642ee3138f1Smrg
8643ee3138f1Smrg
864434977a2fSmrg# When config.status generates a header, we must update the stamp-h file.
864534977a2fSmrg# This file resides in the same directory as the config header
864634977a2fSmrg# that is generated.  The stamp files are numbered to have different names.
8647ee3138f1Smrg
864834977a2fSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
864934977a2fSmrg# loop where config.status creates the headers, so we can generate
865034977a2fSmrg# our stamp files there.
865134977a2fSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
865234977a2fSmrg[# Compute $1's index in $config_headers.
865334977a2fSmrg_am_arg=$1
865434977a2fSmrg_am_stamp_count=1
865534977a2fSmrgfor _am_header in $config_headers :; do
865634977a2fSmrg  case $_am_header in
865734977a2fSmrg    $_am_arg | $_am_arg:* )
865834977a2fSmrg      break ;;
865934977a2fSmrg    * )
866034977a2fSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
866134977a2fSmrg  esac
866234977a2fSmrgdone
866334977a2fSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
8664ee3138f1Smrg
866534977a2fSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
866679a8a9c6Smrg#
866734977a2fSmrg# This file is free software; the Free Software Foundation
866834977a2fSmrg# gives unlimited permission to copy and/or distribute it,
866934977a2fSmrg# with or without modifications, as long as this notice is preserved.
8670ee3138f1Smrg
867134977a2fSmrg# AM_PROG_INSTALL_SH
867234977a2fSmrg# ------------------
867334977a2fSmrg# Define $install_sh.
867434977a2fSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
867534977a2fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
867634977a2fSmrgif test x"${install_sh}" != xset; then
867734977a2fSmrg  case $am_aux_dir in
867834977a2fSmrg  *\ * | *\	*)
867934977a2fSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
868034977a2fSmrg  *)
868134977a2fSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
868234977a2fSmrg  esac
868334977a2fSmrgfi
868434977a2fSmrgAC_SUBST(install_sh)])
8685ee3138f1Smrg
868634977a2fSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
868779a8a9c6Smrg#
868834977a2fSmrg# This file is free software; the Free Software Foundation
868934977a2fSmrg# gives unlimited permission to copy and/or distribute it,
869034977a2fSmrg# with or without modifications, as long as this notice is preserved.
869179a8a9c6Smrg
869234977a2fSmrg# serial 2
869379a8a9c6Smrg
869434977a2fSmrg# Check whether the underlying file-system supports filenames
869534977a2fSmrg# with a leading dot.  For instance MS-DOS doesn't.
869634977a2fSmrgAC_DEFUN([AM_SET_LEADING_DOT],
869734977a2fSmrg[rm -rf .tst 2>/dev/null
869834977a2fSmrgmkdir .tst 2>/dev/null
869934977a2fSmrgif test -d .tst; then
870034977a2fSmrg  am__leading_dot=.
870134977a2fSmrgelse
870234977a2fSmrg  am__leading_dot=_
870334977a2fSmrgfi
870434977a2fSmrgrmdir .tst 2>/dev/null
870534977a2fSmrgAC_SUBST([am__leading_dot])])
870679a8a9c6Smrg
870734977a2fSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
870834977a2fSmrg# From Jim Meyering
870979a8a9c6Smrg
871034977a2fSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
871134977a2fSmrg# Free Software Foundation, Inc.
8712ee3138f1Smrg#
8713ee3138f1Smrg# This file is free software; the Free Software Foundation
8714ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
8715ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
8716ee3138f1Smrg
871734977a2fSmrg# serial 5
8718ee3138f1Smrg
871934977a2fSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
872034977a2fSmrg# ----------------------------------
872134977a2fSmrg# Control maintainer-specific portions of Makefiles.
872234977a2fSmrg# Default is to disable them, unless `enable' is passed literally.
872334977a2fSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
872434977a2fSmrg# can override the default with the --enable/--disable switch.
872534977a2fSmrgAC_DEFUN([AM_MAINTAINER_MODE],
872634977a2fSmrg[m4_case(m4_default([$1], [disable]),
872734977a2fSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
872834977a2fSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
872934977a2fSmrg       [m4_define([am_maintainer_other], [enable])
873034977a2fSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
873134977a2fSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
873234977a2fSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
873334977a2fSmrg  AC_ARG_ENABLE([maintainer-mode],
873434977a2fSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
873534977a2fSmrg			  (and sometimes confusing) to the casual installer],
873634977a2fSmrg      [USE_MAINTAINER_MODE=$enableval],
873734977a2fSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
873834977a2fSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
873934977a2fSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
874034977a2fSmrg  MAINT=$MAINTAINER_MODE_TRUE
874134977a2fSmrg  AC_SUBST([MAINT])dnl
874234977a2fSmrg]
874334977a2fSmrg)
8744ee3138f1Smrg
874534977a2fSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
8746ee3138f1Smrg
874734977a2fSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
8748ee3138f1Smrg
874934977a2fSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
8750ee3138f1Smrg#
8751ee3138f1Smrg# This file is free software; the Free Software Foundation
8752ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
8753ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
8754ee3138f1Smrg
875534977a2fSmrg# serial 4
875634977a2fSmrg
875734977a2fSmrg# AM_MAKE_INCLUDE()
875834977a2fSmrg# -----------------
875934977a2fSmrg# Check to see how make treats includes.
876034977a2fSmrgAC_DEFUN([AM_MAKE_INCLUDE],
876134977a2fSmrg[am_make=${MAKE-make}
876234977a2fSmrgcat > confinc << 'END'
876334977a2fSmrgam__doit:
876434977a2fSmrg	@echo this is the am__doit target
876534977a2fSmrg.PHONY: am__doit
876634977a2fSmrgEND
876734977a2fSmrg# If we don't find an include directive, just comment out the code.
876834977a2fSmrgAC_MSG_CHECKING([for style of include used by $am_make])
876934977a2fSmrgam__include="#"
877034977a2fSmrgam__quote=
877134977a2fSmrg_am_result=none
877234977a2fSmrg# First try GNU make style include.
877334977a2fSmrgecho "include confinc" > confmf
877434977a2fSmrg# Ignore all kinds of additional output from `make'.
877534977a2fSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
877634977a2fSmrg*the\ am__doit\ target*)
877734977a2fSmrg  am__include=include
877834977a2fSmrg  am__quote=
877934977a2fSmrg  _am_result=GNU
878034977a2fSmrg  ;;
878134977a2fSmrgesac
878234977a2fSmrg# Now try BSD make style include.
878334977a2fSmrgif test "$am__include" = "#"; then
878434977a2fSmrg   echo '.include "confinc"' > confmf
878534977a2fSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
878634977a2fSmrg   *the\ am__doit\ target*)
878734977a2fSmrg     am__include=.include
878834977a2fSmrg     am__quote="\""
878934977a2fSmrg     _am_result=BSD
879034977a2fSmrg     ;;
879134977a2fSmrg   esac
879234977a2fSmrgfi
879334977a2fSmrgAC_SUBST([am__include])
879434977a2fSmrgAC_SUBST([am__quote])
879534977a2fSmrgAC_MSG_RESULT([$_am_result])
879634977a2fSmrgrm -f confinc confmf
879734977a2fSmrg])
879834977a2fSmrg
879934977a2fSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
880034977a2fSmrg
880134977a2fSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
880234977a2fSmrg# Free Software Foundation, Inc.
8803ee3138f1Smrg#
880434977a2fSmrg# This file is free software; the Free Software Foundation
880534977a2fSmrg# gives unlimited permission to copy and/or distribute it,
880634977a2fSmrg# with or without modifications, as long as this notice is preserved.
880734977a2fSmrg
880834977a2fSmrg# serial 6
880934977a2fSmrg
881034977a2fSmrg# AM_MISSING_PROG(NAME, PROGRAM)
881134977a2fSmrg# ------------------------------
881234977a2fSmrgAC_DEFUN([AM_MISSING_PROG],
881334977a2fSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
881434977a2fSmrg$1=${$1-"${am_missing_run}$2"}
881534977a2fSmrgAC_SUBST($1)])
881634977a2fSmrg
881734977a2fSmrg
881834977a2fSmrg# AM_MISSING_HAS_RUN
881934977a2fSmrg# ------------------
882034977a2fSmrg# Define MISSING if not defined so far and test if it supports --run.
882134977a2fSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
882234977a2fSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
882334977a2fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
882434977a2fSmrgAC_REQUIRE_AUX_FILE([missing])dnl
882534977a2fSmrgif test x"${MISSING+set}" != xset; then
882634977a2fSmrg  case $am_aux_dir in
882734977a2fSmrg  *\ * | *\	*)
882834977a2fSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
882934977a2fSmrg  *)
883034977a2fSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
883134977a2fSmrg  esac
883234977a2fSmrgfi
883334977a2fSmrg# Use eval to expand $SHELL
883434977a2fSmrgif eval "$MISSING --run true"; then
883534977a2fSmrg  am_missing_run="$MISSING --run "
883634977a2fSmrgelse
883734977a2fSmrg  am_missing_run=
883834977a2fSmrg  AC_MSG_WARN([`missing' script is too old or missing])
883934977a2fSmrgfi
884034977a2fSmrg])
884134977a2fSmrg
884234977a2fSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
8843ee3138f1Smrg#
884434977a2fSmrg# This file is free software; the Free Software Foundation
884534977a2fSmrg# gives unlimited permission to copy and/or distribute it,
884634977a2fSmrg# with or without modifications, as long as this notice is preserved.
884734977a2fSmrg
884834977a2fSmrg# AM_PROG_MKDIR_P
884934977a2fSmrg# ---------------
885034977a2fSmrg# Check for `mkdir -p'.
885134977a2fSmrgAC_DEFUN([AM_PROG_MKDIR_P],
885234977a2fSmrg[AC_PREREQ([2.60])dnl
885334977a2fSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
885434977a2fSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
885534977a2fSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
885634977a2fSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
885734977a2fSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
885834977a2fSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
885934977a2fSmrgdnl adjustment using top_builddir (which is defined more often than
886034977a2fSmrgdnl MKDIR_P).
886134977a2fSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
886234977a2fSmrgcase $mkdir_p in
886334977a2fSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
886434977a2fSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
886534977a2fSmrgesac
886634977a2fSmrg])
886734977a2fSmrg
886834977a2fSmrg# Helper functions for option handling.                     -*- Autoconf -*-
886934977a2fSmrg
887034977a2fSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
8871ee3138f1Smrg#
887234977a2fSmrg# This file is free software; the Free Software Foundation
887334977a2fSmrg# gives unlimited permission to copy and/or distribute it,
887434977a2fSmrg# with or without modifications, as long as this notice is preserved.
887534977a2fSmrg
887634977a2fSmrg# serial 4
887734977a2fSmrg
887834977a2fSmrg# _AM_MANGLE_OPTION(NAME)
887934977a2fSmrg# -----------------------
888034977a2fSmrgAC_DEFUN([_AM_MANGLE_OPTION],
888134977a2fSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
888234977a2fSmrg
888334977a2fSmrg# _AM_SET_OPTION(NAME)
888434977a2fSmrg# ------------------------------
888534977a2fSmrg# Set option NAME.  Presently that only means defining a flag for this option.
888634977a2fSmrgAC_DEFUN([_AM_SET_OPTION],
888734977a2fSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
888834977a2fSmrg
888934977a2fSmrg# _AM_SET_OPTIONS(OPTIONS)
889034977a2fSmrg# ----------------------------------
889134977a2fSmrg# OPTIONS is a space-separated list of Automake options.
889234977a2fSmrgAC_DEFUN([_AM_SET_OPTIONS],
889334977a2fSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
8894ee3138f1Smrg
889534977a2fSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
889634977a2fSmrg# -------------------------------------------
889734977a2fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
889834977a2fSmrgAC_DEFUN([_AM_IF_OPTION],
889934977a2fSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
8900ee3138f1Smrg
890134977a2fSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
8902ee3138f1Smrg
890334977a2fSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
8904ee3138f1Smrg# Free Software Foundation, Inc.
8905ee3138f1Smrg#
8906ee3138f1Smrg# This file is free software; the Free Software Foundation
8907ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
8908ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
8909ee3138f1Smrg
891034977a2fSmrg# serial 5
8911ee3138f1Smrg
891234977a2fSmrg# AM_SANITY_CHECK
891334977a2fSmrg# ---------------
891434977a2fSmrgAC_DEFUN([AM_SANITY_CHECK],
891534977a2fSmrg[AC_MSG_CHECKING([whether build environment is sane])
891634977a2fSmrg# Just in case
891734977a2fSmrgsleep 1
891834977a2fSmrgecho timestamp > conftest.file
891934977a2fSmrg# Reject unsafe characters in $srcdir or the absolute working directory
892034977a2fSmrg# name.  Accept space and tab only in the latter.
892134977a2fSmrgam_lf='
892234977a2fSmrg'
892334977a2fSmrgcase `pwd` in
892434977a2fSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
892534977a2fSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
892634977a2fSmrgesac
892734977a2fSmrgcase $srcdir in
892834977a2fSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
892934977a2fSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
893034977a2fSmrgesac
893134977a2fSmrg
893234977a2fSmrg# Do `set' in a subshell so we don't clobber the current shell's
893334977a2fSmrg# arguments.  Must try -L first in case configure is actually a
893434977a2fSmrg# symlink; some systems play weird games with the mod time of symlinks
893534977a2fSmrg# (eg FreeBSD returns the mod time of the symlink's containing
893634977a2fSmrg# directory).
893734977a2fSmrgif (
893834977a2fSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
893934977a2fSmrg   if test "$[*]" = "X"; then
894034977a2fSmrg      # -L didn't work.
894134977a2fSmrg      set X `ls -t "$srcdir/configure" conftest.file`
894234977a2fSmrg   fi
894334977a2fSmrg   rm -f conftest.file
894434977a2fSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
894534977a2fSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
894634977a2fSmrg
894734977a2fSmrg      # If neither matched, then we have a broken ls.  This can happen
894834977a2fSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
894934977a2fSmrg      # broken ls alias from the environment.  This has actually
895034977a2fSmrg      # happened.  Such a system could not be considered "sane".
895134977a2fSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
895234977a2fSmrgalias in your environment])
895334977a2fSmrg   fi
895434977a2fSmrg
895534977a2fSmrg   test "$[2]" = conftest.file
895634977a2fSmrg   )
895734977a2fSmrgthen
895834977a2fSmrg   # Ok.
895934977a2fSmrg   :
8960ee3138f1Smrgelse
896134977a2fSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
896234977a2fSmrgCheck your system clock])
8963ee3138f1Smrgfi
896434977a2fSmrgAC_MSG_RESULT(yes)])
8965ee3138f1Smrg
896634977a2fSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
8967ee3138f1Smrg#
8968ee3138f1Smrg# This file is free software; the Free Software Foundation
8969ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
8970ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
8971ee3138f1Smrg
897234977a2fSmrg# serial 1
8973ee3138f1Smrg
897434977a2fSmrg# AM_SILENT_RULES([DEFAULT])
897534977a2fSmrg# --------------------------
897634977a2fSmrg# Enable less verbose build rules; with the default set to DEFAULT
897734977a2fSmrg# (`yes' being less verbose, `no' or empty being verbose).
897834977a2fSmrgAC_DEFUN([AM_SILENT_RULES],
897934977a2fSmrg[AC_ARG_ENABLE([silent-rules],
898034977a2fSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
898134977a2fSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
898234977a2fSmrgcase $enable_silent_rules in
898334977a2fSmrgyes) AM_DEFAULT_VERBOSITY=0;;
898434977a2fSmrgno)  AM_DEFAULT_VERBOSITY=1;;
898534977a2fSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
898634977a2fSmrgesac
898734977a2fSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
898834977a2fSmrgAM_BACKSLASH='\'
898934977a2fSmrgAC_SUBST([AM_BACKSLASH])dnl
899034977a2fSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
899134977a2fSmrg])
8992ee3138f1Smrg
899334977a2fSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
8994ee3138f1Smrg#
899534977a2fSmrg# This file is free software; the Free Software Foundation
899634977a2fSmrg# gives unlimited permission to copy and/or distribute it,
899734977a2fSmrg# with or without modifications, as long as this notice is preserved.
8998ee3138f1Smrg
899934977a2fSmrg# AM_PROG_INSTALL_STRIP
900034977a2fSmrg# ---------------------
900134977a2fSmrg# One issue with vendor `install' (even GNU) is that you can't
900234977a2fSmrg# specify the program used to strip binaries.  This is especially
900334977a2fSmrg# annoying in cross-compiling environments, where the build's strip
900434977a2fSmrg# is unlikely to handle the host's binaries.
900534977a2fSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
900634977a2fSmrg# always use install-sh in `make install-strip', and initialize
900734977a2fSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
900834977a2fSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
900934977a2fSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
901034977a2fSmrg# Installed binaries are usually stripped using `strip' when the user
901134977a2fSmrg# run `make install-strip'.  However `strip' might not be the right
901234977a2fSmrg# tool to use in cross-compilation environments, therefore Automake
901334977a2fSmrg# will honor the `STRIP' environment variable to overrule this program.
901434977a2fSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
901534977a2fSmrgif test "$cross_compiling" != no; then
901634977a2fSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
9017ee3138f1Smrgfi
901834977a2fSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
901934977a2fSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
9020ee3138f1Smrg
902134977a2fSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
902234977a2fSmrg#
902334977a2fSmrg# This file is free software; the Free Software Foundation
902434977a2fSmrg# gives unlimited permission to copy and/or distribute it,
902534977a2fSmrg# with or without modifications, as long as this notice is preserved.
9026ee3138f1Smrg
902734977a2fSmrg# serial 2
9028ee3138f1Smrg
902934977a2fSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
903034977a2fSmrg# ---------------------------
903134977a2fSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
903234977a2fSmrg# This macro is traced by Automake.
903334977a2fSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9034ee3138f1Smrg
903534977a2fSmrg# AM_SUBST_NOTMAKE(VARIABLE)
903634977a2fSmrg# ---------------------------
903734977a2fSmrg# Public sister of _AM_SUBST_NOTMAKE.
903834977a2fSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9039ee3138f1Smrg
904034977a2fSmrg# Check how to create a tarball.                            -*- Autoconf -*-
9041ee3138f1Smrg
904234977a2fSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
9043ee3138f1Smrg#
9044ee3138f1Smrg# This file is free software; the Free Software Foundation
9045ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
9046ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
9047ee3138f1Smrg
904834977a2fSmrg# serial 2
9049ee3138f1Smrg
905034977a2fSmrg# _AM_PROG_TAR(FORMAT)
905134977a2fSmrg# --------------------
905234977a2fSmrg# Check how to create a tarball in format FORMAT.
905334977a2fSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
905434977a2fSmrg#
905534977a2fSmrg# Substitute a variable $(am__tar) that is a command
905634977a2fSmrg# writing to stdout a FORMAT-tarball containing the directory
905734977a2fSmrg# $tardir.
905834977a2fSmrg#     tardir=directory && $(am__tar) > result.tar
905934977a2fSmrg#
906034977a2fSmrg# Substitute a variable $(am__untar) that extract such
906134977a2fSmrg# a tarball read from stdin.
906234977a2fSmrg#     $(am__untar) < result.tar
906334977a2fSmrgAC_DEFUN([_AM_PROG_TAR],
906434977a2fSmrg[# Always define AMTAR for backward compatibility.
906534977a2fSmrgAM_MISSING_PROG([AMTAR], [tar])
906634977a2fSmrgm4_if([$1], [v7],
906734977a2fSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
906834977a2fSmrg     [m4_case([$1], [ustar],, [pax],,
906934977a2fSmrg              [m4_fatal([Unknown tar format])])
907034977a2fSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
907134977a2fSmrg# Loop over all known methods to create a tar archive until one works.
907234977a2fSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
907334977a2fSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
907434977a2fSmrg# Do not fold the above two line into one, because Tru64 sh and
907534977a2fSmrg# Solaris sh will not grok spaces in the rhs of `-'.
907634977a2fSmrgfor _am_tool in $_am_tools
907779a8a9c6Smrgdo
907834977a2fSmrg  case $_am_tool in
907934977a2fSmrg  gnutar)
908034977a2fSmrg    for _am_tar in tar gnutar gtar;
908134977a2fSmrg    do
908234977a2fSmrg      AM_RUN_LOG([$_am_tar --version]) && break
908334977a2fSmrg    done
908434977a2fSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
908534977a2fSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
908634977a2fSmrg    am__untar="$_am_tar -xf -"
908734977a2fSmrg    ;;
908834977a2fSmrg  plaintar)
908934977a2fSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
909034977a2fSmrg    # ustar tarball either.
909134977a2fSmrg    (tar --version) >/dev/null 2>&1 && continue
909234977a2fSmrg    am__tar='tar chf - "$$tardir"'
909334977a2fSmrg    am__tar_='tar chf - "$tardir"'
909434977a2fSmrg    am__untar='tar xf -'
909534977a2fSmrg    ;;
909634977a2fSmrg  pax)
909734977a2fSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
909834977a2fSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
909934977a2fSmrg    am__untar='pax -r'
910034977a2fSmrg    ;;
910134977a2fSmrg  cpio)
910234977a2fSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
910334977a2fSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
910434977a2fSmrg    am__untar='cpio -i -H $1 -d'
910534977a2fSmrg    ;;
910634977a2fSmrg  none)
910734977a2fSmrg    am__tar=false
910834977a2fSmrg    am__tar_=false
910934977a2fSmrg    am__untar=false
911034977a2fSmrg    ;;
911134977a2fSmrg  esac
911234977a2fSmrg
911334977a2fSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
911434977a2fSmrg  # and am__untar set.
911534977a2fSmrg  test -n "${am_cv_prog_tar_$1}" && break
911634977a2fSmrg
911734977a2fSmrg  # tar/untar a dummy directory, and stop if the command works
911834977a2fSmrg  rm -rf conftest.dir
911934977a2fSmrg  mkdir conftest.dir
912034977a2fSmrg  echo GrepMe > conftest.dir/file
912134977a2fSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
912234977a2fSmrg  rm -rf conftest.dir
912334977a2fSmrg  if test -s conftest.tar; then
912434977a2fSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
912534977a2fSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
9126ee3138f1Smrg  fi
9127ee3138f1Smrgdone
912834977a2fSmrgrm -rf conftest.dir
9129ee3138f1Smrg
913034977a2fSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
913134977a2fSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
913234977a2fSmrgAC_SUBST([am__tar])
913334977a2fSmrgAC_SUBST([am__untar])
913434977a2fSmrg]) # _AM_PROG_TAR
9135ee3138f1Smrg
913634977a2fSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
913734977a2fSmrgdnl
913834977a2fSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
913934977a2fSmrgdnl 
914034977a2fSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
914134977a2fSmrgdnl copy of this software and associated documentation files (the
914234977a2fSmrgdnl "Software"), to deal in the Software without restriction, including
914334977a2fSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
914434977a2fSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
914534977a2fSmrgdnl to whom the Software is furnished to do so, provided that the above
914634977a2fSmrgdnl copyright notice(s) and this permission notice appear in all copies of
914734977a2fSmrgdnl the Software and that both the above copyright notice(s) and this
914834977a2fSmrgdnl permission notice appear in supporting documentation.
914934977a2fSmrgdnl
915034977a2fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
915134977a2fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
915234977a2fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
915334977a2fSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
915434977a2fSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
915534977a2fSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
915634977a2fSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
915734977a2fSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
915834977a2fSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
915934977a2fSmrgdnl
916034977a2fSmrgdnl Except as contained in this notice, the name of a copyright holder
916134977a2fSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
916234977a2fSmrgdnl or other dealings in this Software without prior written authorization
916334977a2fSmrgdnl of the copyright holder.
9164ee3138f1Smrg
916534977a2fSmrg# XORG_MACROS_VERSION(required-version)
916634977a2fSmrg# -------------------------------------
916734977a2fSmrg# Minimum version: 1.1.0
9168ee3138f1Smrg#
916934977a2fSmrg# If you're using a macro added in Version 1.1 or newer, include this in
917034977a2fSmrg# your configure.ac with the minimum required version, such as:
917134977a2fSmrg# XORG_MACROS_VERSION(1.1)
917234977a2fSmrg#
917334977a2fSmrg# To ensure that this macro is defined, also add:
917434977a2fSmrg# m4_ifndef([XORG_MACROS_VERSION],
917534977a2fSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
917634977a2fSmrg#
917734977a2fSmrg#
917834977a2fSmrg# See the "minimum version" comment for each macro you use to see what 
917934977a2fSmrg# version you require.
918034977a2fSmrgm4_defun([XORG_MACROS_VERSION],[
918134977a2fSmrgm4_define([vers_have], [1.3.0])
918234977a2fSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
918334977a2fSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
918434977a2fSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
918534977a2fSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
918634977a2fSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
918734977a2fSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
918834977a2fSmrgm4_undefine([vers_have])
918934977a2fSmrgm4_undefine([maj_have])
919034977a2fSmrgm4_undefine([maj_needed])
919134977a2fSmrg]) # XORG_MACROS_VERSION
9192ee3138f1Smrg
919334977a2fSmrg# XORG_PROG_RAWCPP()
919434977a2fSmrg# ------------------
919534977a2fSmrg# Minimum version: 1.0.0
919634977a2fSmrg#
919734977a2fSmrg# Find cpp program and necessary flags for use in pre-processing text files
919834977a2fSmrg# such as man pages and config files
919934977a2fSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
920034977a2fSmrgAC_REQUIRE([AC_PROG_CPP])
920134977a2fSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
920234977a2fSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9203ee3138f1Smrg
920434977a2fSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
920534977a2fSmrg# which is not the best choice for supporting other OS'es, but covers most
920634977a2fSmrg# of the ones we need for now.
920734977a2fSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
920834977a2fSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
920934977a2fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
921034977a2fSmrg	AC_MSG_RESULT([no])
921134977a2fSmrgelse
921234977a2fSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
921334977a2fSmrg		RAWCPPFLAGS=-undef
921434977a2fSmrg		AC_MSG_RESULT([yes])
921534977a2fSmrg	# under Cygwin unix is still defined even with -undef
921634977a2fSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
921734977a2fSmrg		RAWCPPFLAGS="-undef -ansi"
921834977a2fSmrg		AC_MSG_RESULT([yes, with -ansi])
921934977a2fSmrg	else
922034977a2fSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
922134977a2fSmrg	fi
922234977a2fSmrgfi
922334977a2fSmrgrm -f conftest.$ac_ext
9224ee3138f1Smrg
922534977a2fSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
922634977a2fSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
922734977a2fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
922834977a2fSmrg	AC_MSG_RESULT([no])
922934977a2fSmrgelse
923034977a2fSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
923134977a2fSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
923234977a2fSmrg		AC_MSG_RESULT([yes])
923334977a2fSmrg	else
923434977a2fSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
923534977a2fSmrg	fi
923634977a2fSmrgfi
923734977a2fSmrgrm -f conftest.$ac_ext
923834977a2fSmrgAC_SUBST(RAWCPPFLAGS)
923934977a2fSmrg]) # XORG_PROG_RAWCPP
9240ee3138f1Smrg
924134977a2fSmrg# XORG_MANPAGE_SECTIONS()
924234977a2fSmrg# -----------------------
924334977a2fSmrg# Minimum version: 1.0.0
9244ee3138f1Smrg#
924534977a2fSmrg# Determine which sections man pages go in for the different man page types
924634977a2fSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
924734977a2fSmrg# Not sure if there's any better way than just hardcoding by OS name.
924834977a2fSmrg# Override default settings by setting environment variables
9249ee3138f1Smrg
925034977a2fSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
925134977a2fSmrgAC_REQUIRE([AC_CANONICAL_HOST])
9252ee3138f1Smrg
925334977a2fSmrgif test x$APP_MAN_SUFFIX = x    ; then
925434977a2fSmrg    APP_MAN_SUFFIX=1
925534977a2fSmrgfi
925634977a2fSmrgif test x$APP_MAN_DIR = x    ; then
925734977a2fSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9258ee3138f1Smrgfi
9259ee3138f1Smrg
926034977a2fSmrgif test x$LIB_MAN_SUFFIX = x    ; then
926134977a2fSmrg    LIB_MAN_SUFFIX=3
926234977a2fSmrgfi
926334977a2fSmrgif test x$LIB_MAN_DIR = x    ; then
926434977a2fSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9265ee3138f1Smrgfi
9266ee3138f1Smrg
926734977a2fSmrgif test x$FILE_MAN_SUFFIX = x    ; then
926834977a2fSmrg    case $host_os in
926934977a2fSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
927034977a2fSmrg	*)		FILE_MAN_SUFFIX=5  ;;
927134977a2fSmrg    esac
927234977a2fSmrgfi
927334977a2fSmrgif test x$FILE_MAN_DIR = x    ; then
927434977a2fSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
927534977a2fSmrgfi
9276ee3138f1Smrg
927734977a2fSmrgif test x$MISC_MAN_SUFFIX = x    ; then
927834977a2fSmrg    case $host_os in
927934977a2fSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
928034977a2fSmrg	*)		MISC_MAN_SUFFIX=7  ;;
928134977a2fSmrg    esac
928234977a2fSmrgfi
928334977a2fSmrgif test x$MISC_MAN_DIR = x    ; then
928434977a2fSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
928534977a2fSmrgfi
9286ee3138f1Smrg
928734977a2fSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
928834977a2fSmrg    case $host_os in
928934977a2fSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
929034977a2fSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
929134977a2fSmrg    esac
929234977a2fSmrgfi
929334977a2fSmrgif test x$DRIVER_MAN_DIR = x    ; then
929434977a2fSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
929534977a2fSmrgfi
9296ee3138f1Smrg
929734977a2fSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
929834977a2fSmrg    case $host_os in
929934977a2fSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
930034977a2fSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
930134977a2fSmrg    esac
930234977a2fSmrgfi
930334977a2fSmrgif test x$ADMIN_MAN_DIR = x    ; then
930434977a2fSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
930534977a2fSmrgfi
9306ee3138f1Smrg
9307ee3138f1Smrg
930834977a2fSmrgAC_SUBST([APP_MAN_SUFFIX])
930934977a2fSmrgAC_SUBST([LIB_MAN_SUFFIX])
931034977a2fSmrgAC_SUBST([FILE_MAN_SUFFIX])
931134977a2fSmrgAC_SUBST([MISC_MAN_SUFFIX])
931234977a2fSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
931334977a2fSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
931434977a2fSmrgAC_SUBST([APP_MAN_DIR])
931534977a2fSmrgAC_SUBST([LIB_MAN_DIR])
931634977a2fSmrgAC_SUBST([FILE_MAN_DIR])
931734977a2fSmrgAC_SUBST([MISC_MAN_DIR])
931834977a2fSmrgAC_SUBST([DRIVER_MAN_DIR])
931934977a2fSmrgAC_SUBST([ADMIN_MAN_DIR])
932034977a2fSmrg]) # XORG_MANPAGE_SECTIONS
9321ee3138f1Smrg
932234977a2fSmrg# XORG_CHECK_LINUXDOC
932334977a2fSmrg# -------------------
932434977a2fSmrg# Minimum version: 1.0.0
9325ee3138f1Smrg#
932634977a2fSmrg# Defines the variable MAKE_TEXT if the necessary tools and
932734977a2fSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
932834977a2fSmrg# Whether or not the necessary tools and files are found can be checked
932934977a2fSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
933034977a2fSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
933134977a2fSmrgif test x$XORG_SGML_PATH = x ; then
933234977a2fSmrg    XORG_SGML_PATH=$prefix/share/sgml
933334977a2fSmrgfi
933434977a2fSmrgHAVE_DEFS_ENT=
9335ee3138f1Smrg
933634977a2fSmrgif test x"$cross_compiling" = x"yes" ; then
933734977a2fSmrg  HAVE_DEFS_ENT=no
933834977a2fSmrgelse
933934977a2fSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
934034977a2fSmrgfi
9341ee3138f1Smrg
934234977a2fSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
934334977a2fSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
9344ee3138f1Smrg
934534977a2fSmrgAC_MSG_CHECKING([Whether to build documentation])
9346ee3138f1Smrg
934734977a2fSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
934834977a2fSmrg   BUILDDOC=yes
9349ee3138f1Smrgelse
935034977a2fSmrg   BUILDDOC=no
9351ee3138f1Smrgfi
9352ee3138f1Smrg
935334977a2fSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9354ee3138f1Smrg
935534977a2fSmrgAC_MSG_RESULT([$BUILDDOC])
9356ee3138f1Smrg
935734977a2fSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
9358ee3138f1Smrg
935934977a2fSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
936034977a2fSmrg   BUILDPDFDOC=yes
936134977a2fSmrgelse
936234977a2fSmrg   BUILDPDFDOC=no
936334977a2fSmrgfi
9364ee3138f1Smrg
936534977a2fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9366ee3138f1Smrg
936734977a2fSmrgAC_MSG_RESULT([$BUILDPDFDOC])
9368ee3138f1Smrg
936934977a2fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
937034977a2fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
937134977a2fSmrgMAKE_PDF="$PS2PDF"
937234977a2fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9373ee3138f1Smrg
937434977a2fSmrgAC_SUBST(MAKE_TEXT)
937534977a2fSmrgAC_SUBST(MAKE_PS)
937634977a2fSmrgAC_SUBST(MAKE_PDF)
937734977a2fSmrgAC_SUBST(MAKE_HTML)
937834977a2fSmrg]) # XORG_CHECK_LINUXDOC
9379ee3138f1Smrg
938034977a2fSmrg# XORG_CHECK_DOCBOOK
938134977a2fSmrg# -------------------
938234977a2fSmrg# Minimum version: 1.0.0
938334977a2fSmrg#
938434977a2fSmrg# Checks for the ability to build output formats from SGML DocBook source.
938534977a2fSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
938634977a2fSmrg# indicates whether the necessary tools and files are found and, if set,
938734977a2fSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
938834977a2fSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
938934977a2fSmrgif test x$XORG_SGML_PATH = x ; then
939034977a2fSmrg    XORG_SGML_PATH=$prefix/share/sgml
9391ee3138f1Smrgfi
939234977a2fSmrgHAVE_DEFS_ENT=
939334977a2fSmrgBUILDTXTDOC=no
939434977a2fSmrgBUILDPDFDOC=no
939534977a2fSmrgBUILDPSDOC=no
939634977a2fSmrgBUILDHTMLDOC=no
9397ee3138f1Smrg
939834977a2fSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
9399ee3138f1Smrg
940034977a2fSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
940134977a2fSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
940234977a2fSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
940334977a2fSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9404ee3138f1Smrg
940534977a2fSmrgAC_MSG_CHECKING([Whether to build text documentation])
940634977a2fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
940734977a2fSmrg   test x$BUILD_TXTDOC != xno; then
940834977a2fSmrg	BUILDTXTDOC=yes
940934977a2fSmrgfi
941034977a2fSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
941134977a2fSmrgAC_MSG_RESULT([$BUILDTXTDOC])
9412ee3138f1Smrg
941334977a2fSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
941434977a2fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
941534977a2fSmrg   test x$BUILD_PDFDOC != xno; then
941634977a2fSmrg	BUILDPDFDOC=yes
941734977a2fSmrgfi
941834977a2fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
941934977a2fSmrgAC_MSG_RESULT([$BUILDPDFDOC])
9420ee3138f1Smrg
942134977a2fSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
942234977a2fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
942334977a2fSmrg   test x$BUILD_PSDOC != xno; then
942434977a2fSmrg	BUILDPSDOC=yes
9425ee3138f1Smrgfi
942634977a2fSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
942734977a2fSmrgAC_MSG_RESULT([$BUILDPSDOC])
9428ee3138f1Smrg
942934977a2fSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
943034977a2fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
943134977a2fSmrg   test x$BUILD_HTMLDOC != xno; then
943234977a2fSmrg	BUILDHTMLDOC=yes
943334977a2fSmrgfi
943434977a2fSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
943534977a2fSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
9436ee3138f1Smrg
943734977a2fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
943834977a2fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
943934977a2fSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
944034977a2fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9441ee3138f1Smrg
944234977a2fSmrgAC_SUBST(MAKE_TEXT)
944334977a2fSmrgAC_SUBST(MAKE_PS)
944434977a2fSmrgAC_SUBST(MAKE_PDF)
944534977a2fSmrgAC_SUBST(MAKE_HTML)
944634977a2fSmrg]) # XORG_CHECK_DOCBOOK
9447ee3138f1Smrg
944834977a2fSmrg# XORG_CHECK_MALLOC_ZERO
944934977a2fSmrg# ----------------------
945034977a2fSmrg# Minimum version: 1.0.0
9451ee3138f1Smrg#
945234977a2fSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
945334977a2fSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
945434977a2fSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
945534977a2fSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
945634977a2fSmrgAC_ARG_ENABLE(malloc0returnsnull,
945734977a2fSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
945834977a2fSmrg		       [malloc(0) returns NULL (default: auto)]),
945934977a2fSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
946034977a2fSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
9461ee3138f1Smrg
946234977a2fSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
946334977a2fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
946434977a2fSmrg	AC_RUN_IFELSE([
946534977a2fSmrgchar *malloc();
946634977a2fSmrgchar *realloc();
946734977a2fSmrgchar *calloc();
946834977a2fSmrgmain() {
946934977a2fSmrg    char *m0, *r0, *c0, *p;
947034977a2fSmrg    m0 = malloc(0);
947134977a2fSmrg    p = malloc(10);
947234977a2fSmrg    r0 = realloc(p,0);
947334977a2fSmrg    c0 = calloc(0);
947434977a2fSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
947534977a2fSmrg}],
947634977a2fSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
947734977a2fSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
947834977a2fSmrgfi
947934977a2fSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
9480ee3138f1Smrg
948134977a2fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
948234977a2fSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
948334977a2fSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
948434977a2fSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
948534977a2fSmrgelse
948634977a2fSmrg	MALLOC_ZERO_CFLAGS=""
948734977a2fSmrg	XMALLOC_ZERO_CFLAGS=""
948834977a2fSmrg	XTMALLOC_ZERO_CFLAGS=""
948934977a2fSmrgfi
9490ee3138f1Smrg
949134977a2fSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
949234977a2fSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
949334977a2fSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
949434977a2fSmrg]) # XORG_CHECK_MALLOC_ZERO
9495ee3138f1Smrg
949634977a2fSmrg# XORG_WITH_LINT()
949734977a2fSmrg# ----------------
949834977a2fSmrg# Minimum version: 1.1.0
949934977a2fSmrg#
950034977a2fSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
950134977a2fSmrg# is specified.   (Use --with-lint=sparse for sparse.)
950234977a2fSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
950334977a2fSmrg# Sets $LINT_FLAGS to flags to pass to source checker
950434977a2fSmrg# Sets LINT automake conditional if enabled (default: disabled)
950534977a2fSmrg#
950634977a2fSmrgAC_DEFUN([XORG_WITH_LINT],[
9507ee3138f1Smrg
950834977a2fSmrg# Allow checking code with lint, sparse, etc.
950934977a2fSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
951034977a2fSmrg		[Use a lint-style source code checker (default: disabled)])],
951134977a2fSmrg		[use_lint=$withval], [use_lint=no])
951234977a2fSmrgif test "x$use_lint" = "xyes" ; then
951334977a2fSmrg	LINT="lint"
951434977a2fSmrgelse
951534977a2fSmrg	LINT="$use_lint"
951634977a2fSmrgfi
951734977a2fSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
951834977a2fSmrg    case $LINT in
951934977a2fSmrg	lint|*/lint)
952034977a2fSmrg	    case $host_os in
952134977a2fSmrg		solaris*)
952234977a2fSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
952334977a2fSmrg			;;
952434977a2fSmrg	    esac
952534977a2fSmrg	    ;;
952634977a2fSmrg    esac
952734977a2fSmrgfi
9528ee3138f1Smrg
952934977a2fSmrgAC_SUBST(LINT)
953034977a2fSmrgAC_SUBST(LINT_FLAGS)
953134977a2fSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
9532ee3138f1Smrg
953334977a2fSmrg]) # XORG_WITH_LINT
9534ee3138f1Smrg
953534977a2fSmrg# XORG_LINT_LIBRARY(LIBNAME)
953634977a2fSmrg# --------------------------
953734977a2fSmrg# Minimum version: 1.1.0
953834977a2fSmrg#
953934977a2fSmrg# Sets up flags for building lint libraries for checking programs that call
954034977a2fSmrg# functions in the library.
954134977a2fSmrg# Disabled by default, enable with --enable-lint-library
954234977a2fSmrg# Sets: 
954334977a2fSmrg#	@LINTLIB@		- name of lint library file to make
954434977a2fSmrg#	MAKE_LINT_LIB		- automake conditional
954534977a2fSmrg#
9546ee3138f1Smrg
954734977a2fSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
954834977a2fSmrgAC_REQUIRE([XORG_WITH_LINT])
954934977a2fSmrg# Build lint "library" for more indepth checks of programs calling this library
955034977a2fSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
955134977a2fSmrg	[Create lint library (default: disabled)])],
955234977a2fSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
955334977a2fSmrgif test "x$make_lint_lib" != "xno" ; then
955434977a2fSmrg	if test "x$LINT" = "xno" ; then
955534977a2fSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
955634977a2fSmrg	fi
955734977a2fSmrg	if test "x$make_lint_lib" = "xyes" ; then
955834977a2fSmrg		LINTLIB=llib-l$1.ln
955934977a2fSmrg	else
956034977a2fSmrg		LINTLIB=$make_lint_lib
956134977a2fSmrg	fi
956234977a2fSmrgfi
956334977a2fSmrgAC_SUBST(LINTLIB)
956434977a2fSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
9565ee3138f1Smrg
956634977a2fSmrg]) # XORG_LINT_LIBRARY
9567ee3138f1Smrg
956834977a2fSmrg# XORG_CWARNFLAGS
956934977a2fSmrg# ---------------
957034977a2fSmrg# Minimum version: 1.2.0
957134977a2fSmrg#
957234977a2fSmrg# Defines CWARNFLAGS to enable C compiler warnings.
957334977a2fSmrg#
957434977a2fSmrgAC_DEFUN([XORG_CWARNFLAGS], [
957534977a2fSmrgAC_REQUIRE([AC_PROG_CC])
957634977a2fSmrgif  test "x$GCC" = xyes ; then
957734977a2fSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
957834977a2fSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
957934977a2fSmrg-Wbad-function-cast"
958034977a2fSmrg    case `$CC -dumpversion` in
958134977a2fSmrg    3.4.* | 4.*)
958234977a2fSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
958334977a2fSmrg	;;
958434977a2fSmrg    esac
9585ee3138f1Smrgelse
958634977a2fSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
958734977a2fSmrg    if test "x$SUNCC" = "xyes"; then
958834977a2fSmrg	CWARNFLAGS="-v"
958934977a2fSmrg    fi
9590ee3138f1Smrgfi
959134977a2fSmrgAC_SUBST(CWARNFLAGS)
959234977a2fSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
959334977a2fSmrg]) # XORG_CWARNFLAGS
9594ee3138f1Smrg
959534977a2fSmrg# XORG_STRICT_OPTION
959634977a2fSmrg# -----------------------
959734977a2fSmrg# Minimum version: 1.3.0
9598ee3138f1Smrg#
959934977a2fSmrg# Add configure option to enable strict compilation
960034977a2fSmrgAC_DEFUN([XORG_STRICT_OPTION], [
960134977a2fSmrgAC_REQUIRE([AC_PROG_CC])
960234977a2fSmrgAC_REQUIRE([AC_PROG_CC_C99])
960334977a2fSmrgAC_REQUIRE([XORG_CWARNFLAGS])
960434977a2fSmrg
960534977a2fSmrgAC_ARG_ENABLE(strict-compilation,
960634977a2fSmrg			  AS_HELP_STRING([--enable-strict-compilation],
960734977a2fSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
960834977a2fSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
960934977a2fSmrgif test "x$STRICT_COMPILE" = "xyes"; then
961034977a2fSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
961134977a2fSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
961234977a2fSmrg	if test "x$GCC" = xyes ; then
961334977a2fSmrg		STRICT_CFLAGS="-pedantic -Werror"
961434977a2fSmrg	elif test "x$SUNCC" = "xyes"; then
961534977a2fSmrg		STRICT_CFLAGS="-errwarn"
961634977a2fSmrg    elif test "x$INTELCC" = "xyes"; then
961734977a2fSmrg		STRICT_CFLAGS="-Werror"
961834977a2fSmrg	fi
9619ee3138f1Smrgfi
962034977a2fSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
962134977a2fSmrgAC_SUBST([CWARNFLAGS])
962234977a2fSmrg]) # XORG_STRICT_OPTION
9623ee3138f1Smrg
962434977a2fSmrg# XORG_DEFAULT_OPTIONS
962534977a2fSmrg# --------------------
962634977a2fSmrg# Minimum version: 1.3.0
9627ee3138f1Smrg#
962834977a2fSmrg# Defines default options for X.Org modules.
9629ee3138f1Smrg#
963034977a2fSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
963134977a2fSmrgXORG_CWARNFLAGS
963234977a2fSmrgXORG_STRICT_OPTION
963334977a2fSmrgXORG_RELEASE_VERSION
963434977a2fSmrgXORG_CHANGELOG
963534977a2fSmrgXORG_MANPAGE_SECTIONS
963634977a2fSmrg]) # XORG_DEFAULT_OPTIONS
963734977a2fSmrgdnl Copyright 2005 Red Hat, Inc
963834977a2fSmrgdnl
963934977a2fSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
964034977a2fSmrgdnl documentation for any purpose is hereby granted without fee, provided that
964134977a2fSmrgdnl the above copyright notice appear in all copies and that both that
964234977a2fSmrgdnl copyright notice and this permission notice appear in supporting
964334977a2fSmrgdnl documentation.
964434977a2fSmrgdnl
964534977a2fSmrgdnl The above copyright notice and this permission notice shall be included
964634977a2fSmrgdnl in all copies or substantial portions of the Software.
964734977a2fSmrgdnl
964834977a2fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
964934977a2fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
965034977a2fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
965134977a2fSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
965234977a2fSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
965334977a2fSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
965434977a2fSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
965534977a2fSmrgdnl
965634977a2fSmrgdnl Except as contained in this notice, the name of the copyright holders shall
965734977a2fSmrgdnl not be used in advertising or otherwise to promote the sale, use or
965834977a2fSmrgdnl other dealings in this Software without prior written authorization
965934977a2fSmrgdnl from the copyright holders.
966034977a2fSmrgdnl
9661ee3138f1Smrg
966234977a2fSmrg# XORG_RELEASE_VERSION
9663ee3138f1Smrg# --------------------
966434977a2fSmrg# Adds --with/without-release-string and changes the PACKAGE and
966534977a2fSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
966634977a2fSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
966734977a2fSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
966834977a2fSmrg 
966934977a2fSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
967034977a2fSmrg	AC_ARG_WITH(release-version,
967134977a2fSmrg			AS_HELP_STRING([--with-release-version=STRING],
967234977a2fSmrg				[Use release version string in package name]),
967334977a2fSmrg			[RELEASE_VERSION="$withval"],
967434977a2fSmrg			[RELEASE_VERSION=""])
967534977a2fSmrg	if test "x$RELEASE_VERSION" != "x"; then
967634977a2fSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
967734977a2fSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
967834977a2fSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
967934977a2fSmrg	fi
968034977a2fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
968134977a2fSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
968234977a2fSmrg		[Major version of this package])
968334977a2fSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
968434977a2fSmrg	if test "x$PVM" = "x"; then
968534977a2fSmrg		PVM="0"
968634977a2fSmrg	fi
968734977a2fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
968834977a2fSmrg		[$PVM],
968934977a2fSmrg		[Minor version of this package])
969034977a2fSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
969134977a2fSmrg	if test "x$PVP" = "x"; then
969234977a2fSmrg		PVP="0"
969334977a2fSmrg	fi
969434977a2fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
969534977a2fSmrg		[$PVP],
969634977a2fSmrg		[Patch version of this package])
969734977a2fSmrg])
969834977a2fSmrg
969934977a2fSmrg# XORG_CHANGELOG()
970034977a2fSmrg# ----------------
970134977a2fSmrg# Minimum version: 1.2.0
9702ee3138f1Smrg#
970334977a2fSmrg# Defines the variable CHANGELOG_CMD as the command to generate
970434977a2fSmrg# ChangeLog from git.
9705ee3138f1Smrg#
970634977a2fSmrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
970734977a2fSmrg#
970834977a2fSmrgAC_DEFUN([XORG_CHANGELOG], [
970934977a2fSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
971034977a2fSmrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
971134977a2fSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
971234977a2fSmrgAC_SUBST([CHANGELOG_CMD])
971334977a2fSmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
971434977a2fSmrg]) # XORG_CHANGELOG
9715ee3138f1Smrg
971634977a2fSmrgdnl Copyright 2005 Red Hat, Inc
971734977a2fSmrgdnl 
971834977a2fSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
971934977a2fSmrgdnl documentation for any purpose is hereby granted without fee, provided that
972034977a2fSmrgdnl the above copyright notice appear in all copies and that both that
972134977a2fSmrgdnl copyright notice and this permission notice appear in supporting
972234977a2fSmrgdnl documentation.
972334977a2fSmrgdnl 
972434977a2fSmrgdnl The above copyright notice and this permission notice shall be included
972534977a2fSmrgdnl in all copies or substantial portions of the Software.
972634977a2fSmrgdnl 
972734977a2fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
972834977a2fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
972934977a2fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
973034977a2fSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
973134977a2fSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
973234977a2fSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
973334977a2fSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
973434977a2fSmrgdnl 
973534977a2fSmrgdnl Except as contained in this notice, the name of the copyright holders shall
973634977a2fSmrgdnl not be used in advertising or otherwise to promote the sale, use or
973734977a2fSmrgdnl other dealings in this Software without prior written authorization
973834977a2fSmrgdnl from the copyright holders.
973934977a2fSmrgdnl 
9740ee3138f1Smrg
974134977a2fSmrg# XORG_DRIVER_CHECK_EXT()
974234977a2fSmrg# --------------------------
974334977a2fSmrg# Checks for the $1 define in xorg-server.h (from the sdk).  If it
974434977a2fSmrg# is defined, then add $1 to $REQUIRED_MODULES.
9745ee3138f1Smrg
974634977a2fSmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
974734977a2fSmrg	SAVE_CFLAGS="$CFLAGS"
974834977a2fSmrg	CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
974934977a2fSmrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
975034977a2fSmrg#include "xorg-server.h"
975134977a2fSmrg#if !defined $1
975234977a2fSmrg#error $1 not defined
975334977a2fSmrg#endif
975434977a2fSmrg		]])],
975534977a2fSmrg		[_EXT_CHECK=yes],
975634977a2fSmrg		[_EXT_CHECK=no])
975734977a2fSmrg	CFLAGS="$SAVE_CFLAGS"
975834977a2fSmrg	AC_MSG_CHECKING([if $1 is defined])
975934977a2fSmrg	AC_MSG_RESULT([$_EXT_CHECK])
976034977a2fSmrg	if test "$_EXT_CHECK" != no; then
976134977a2fSmrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
976234977a2fSmrg	fi
976334977a2fSmrg])
9764ee3138f1Smrg
9765