aclocal.m4 revision 8c4a8e55
18c4a8e55Smrg# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
2b042e37fSmrg
3b042e37fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
48c4a8e55Smrg# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
5b042e37fSmrg# This file is free software; the Free Software Foundation
6b042e37fSmrg# gives unlimited permission to copy and/or distribute it,
7b042e37fSmrg# with or without modifications, as long as this notice is preserved.
8b042e37fSmrg
9b042e37fSmrg# This program is distributed in the hope that it will be useful,
10b042e37fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11b042e37fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12b042e37fSmrg# PARTICULAR PURPOSE.
13b042e37fSmrg
148c4a8e55Smrgm4_ifndef([AC_AUTOCONF_VERSION],
158c4a8e55Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
168c4a8e55Smrgm4_if(AC_AUTOCONF_VERSION, [2.63],,
178c4a8e55Smrg[m4_warning([this file was generated for autoconf 2.63.
188c4a8e55SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
198c4a8e55SmrgIf you have problems, you may need to regenerate the build system entirely.
208c4a8e55SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21b042e37fSmrg
228c4a8e55Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
23b042e37fSmrg#
248c4a8e55Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
258c4a8e55Smrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
268c4a8e55Smrg#   Written by Gordon Matzigkeit, 1996
27b042e37fSmrg#
288c4a8e55Smrg# This file is free software; the Free Software Foundation gives
298c4a8e55Smrg# unlimited permission to copy and/or distribute it, with or without
308c4a8e55Smrg# modifications, as long as this notice is preserved.
318c4a8e55Smrg
328c4a8e55Smrgm4_define([_LT_COPYING], [dnl
338c4a8e55Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
348c4a8e55Smrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
358c4a8e55Smrg#   Written by Gordon Matzigkeit, 1996
36b042e37fSmrg#
378c4a8e55Smrg#   This file is part of GNU Libtool.
38b042e37fSmrg#
398c4a8e55Smrg# GNU Libtool is free software; you can redistribute it and/or
408c4a8e55Smrg# modify it under the terms of the GNU General Public License as
418c4a8e55Smrg# published by the Free Software Foundation; either version 2 of
428c4a8e55Smrg# the License, or (at your option) any later version.
43b042e37fSmrg#
448c4a8e55Smrg# As a special exception to the GNU General Public License,
458c4a8e55Smrg# if you distribute this file as part of a program or library that
468c4a8e55Smrg# is built using GNU Libtool, you may include this file under the
478c4a8e55Smrg# same distribution terms that you use for the rest of that program.
48b042e37fSmrg#
498c4a8e55Smrg# GNU Libtool is distributed in the hope that it will be useful,
508c4a8e55Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
518c4a8e55Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
528c4a8e55Smrg# GNU General Public License for more details.
53b042e37fSmrg#
548c4a8e55Smrg# You should have received a copy of the GNU General Public License
558c4a8e55Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
568c4a8e55Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
578c4a8e55Smrg# obtained by writing to the Free Software Foundation, Inc.,
588c4a8e55Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
598c4a8e55Smrg])
60b042e37fSmrg
618c4a8e55Smrg# serial 56 LT_INIT
62b042e37fSmrg
63b042e37fSmrg
648c4a8e55Smrg# LT_PREREQ(VERSION)
658c4a8e55Smrg# ------------------
668c4a8e55Smrg# Complain and exit if this libtool version is less that VERSION.
678c4a8e55Smrgm4_defun([LT_PREREQ],
688c4a8e55Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
698c4a8e55Smrg       [m4_default([$3],
708c4a8e55Smrg		   [m4_fatal([Libtool version $1 or higher is required],
718c4a8e55Smrg		             63)])],
728c4a8e55Smrg       [$2])])
73b042e37fSmrg
74b042e37fSmrg
758c4a8e55Smrg# _LT_CHECK_BUILDDIR
768c4a8e55Smrg# ------------------
778c4a8e55Smrg# Complain if the absolute build directory name contains unusual characters
788c4a8e55Smrgm4_defun([_LT_CHECK_BUILDDIR],
798c4a8e55Smrg[case `pwd` in
808c4a8e55Smrg  *\ * | *\	*)
818c4a8e55Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
828c4a8e55Smrgesac
838c4a8e55Smrg])
84b042e37fSmrg
85b042e37fSmrg
868c4a8e55Smrg# LT_INIT([OPTIONS])
878c4a8e55Smrg# ------------------
888c4a8e55SmrgAC_DEFUN([LT_INIT],
898c4a8e55Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
908c4a8e55SmrgAC_BEFORE([$0], [LT_LANG])dnl
918c4a8e55SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
928c4a8e55SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
938c4a8e55Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
948c4a8e55Smrg
958c4a8e55Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
968c4a8e55Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
978c4a8e55Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
988c4a8e55Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
998c4a8e55Smrgdnl unless we require an AC_DEFUNed macro:
1008c4a8e55SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
1018c4a8e55SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
1028c4a8e55SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
1038c4a8e55SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
1048c4a8e55Smrgm4_require([_LT_PROG_LTMAIN])dnl
1058c4a8e55Smrg
1068c4a8e55Smrgdnl Parse OPTIONS
1078c4a8e55Smrg_LT_SET_OPTIONS([$0], [$1])
108b042e37fSmrg
1098c4a8e55Smrg# This can be used to rebuild libtool when needed
1108c4a8e55SmrgLIBTOOL_DEPS="$ltmain"
111b042e37fSmrg
1128c4a8e55Smrg# Always use our own libtool.
1138c4a8e55SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
1148c4a8e55SmrgAC_SUBST(LIBTOOL)dnl
115b042e37fSmrg
1168c4a8e55Smrg_LT_SETUP
117b042e37fSmrg
1188c4a8e55Smrg# Only expand once:
1198c4a8e55Smrgm4_define([LT_INIT])
1208c4a8e55Smrg])# LT_INIT
121b042e37fSmrg
1228c4a8e55Smrg# Old names:
1238c4a8e55SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1248c4a8e55SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1258c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
1268c4a8e55Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1278c4a8e55Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
128b042e37fSmrg
129b042e37fSmrg
1308c4a8e55Smrg# _LT_CC_BASENAME(CC)
1318c4a8e55Smrg# -------------------
1328c4a8e55Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1338c4a8e55Smrgm4_defun([_LT_CC_BASENAME],
1348c4a8e55Smrg[for cc_temp in $1""; do
1358c4a8e55Smrg  case $cc_temp in
1368c4a8e55Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1378c4a8e55Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1388c4a8e55Smrg    \-*) ;;
1398c4a8e55Smrg    *) break;;
1408c4a8e55Smrg  esac
1418c4a8e55Smrgdone
1428c4a8e55Smrgcc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
1438c4a8e55Smrg])
144b042e37fSmrg
145b042e37fSmrg
1468c4a8e55Smrg# _LT_FILEUTILS_DEFAULTS
1478c4a8e55Smrg# ----------------------
1488c4a8e55Smrg# It is okay to use these file commands and assume they have been set
1498c4a8e55Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
1508c4a8e55Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
1518c4a8e55Smrg[: ${CP="cp -f"}
1528c4a8e55Smrg: ${MV="mv -f"}
1538c4a8e55Smrg: ${RM="rm -f"}
1548c4a8e55Smrg])# _LT_FILEUTILS_DEFAULTS
1558c4a8e55Smrg
1568c4a8e55Smrg
1578c4a8e55Smrg# _LT_SETUP
1588c4a8e55Smrg# ---------
1598c4a8e55Smrgm4_defun([_LT_SETUP],
1608c4a8e55Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1618c4a8e55SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
1628c4a8e55Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
1638c4a8e55Smrg_LT_DECL([], [host], [0])dnl
1648c4a8e55Smrg_LT_DECL([], [host_os], [0])dnl
165b042e37fSmrgdnl
1668c4a8e55Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
1678c4a8e55Smrg_LT_DECL([], [build], [0])dnl
1688c4a8e55Smrg_LT_DECL([], [build_os], [0])dnl
169b042e37fSmrgdnl
1708c4a8e55SmrgAC_REQUIRE([AC_PROG_CC])dnl
1718c4a8e55SmrgAC_REQUIRE([LT_PATH_LD])dnl
1728c4a8e55SmrgAC_REQUIRE([LT_PATH_NM])dnl
173b042e37fSmrgdnl
1748c4a8e55SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
1758c4a8e55Smrgtest -z "$LN_S" && LN_S="ln -s"
1768c4a8e55Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1778c4a8e55Smrgdnl
1788c4a8e55SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
1798c4a8e55Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
1808c4a8e55Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1818c4a8e55Smrgdnl
1828c4a8e55Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1838c4a8e55Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
1848c4a8e55Smrgm4_require([_LT_CMD_RELOAD])dnl
1858c4a8e55Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
1868c4a8e55Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
1878c4a8e55Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
1888c4a8e55Smrg
1898c4a8e55Smrg_LT_CONFIG_LIBTOOL_INIT([
1908c4a8e55Smrg# See if we are running on zsh, and set the options which allow our
1918c4a8e55Smrg# commands through without removal of \ escapes INIT.
1928c4a8e55Smrgif test -n "\${ZSH_VERSION+set}" ; then
1938c4a8e55Smrg   setopt NO_GLOB_SUBST
1948c4a8e55Smrgfi
1958c4a8e55Smrg])
1968c4a8e55Smrgif test -n "${ZSH_VERSION+set}" ; then
1978c4a8e55Smrg   setopt NO_GLOB_SUBST
1988c4a8e55Smrgfi
199b042e37fSmrg
2008c4a8e55Smrg_LT_CHECK_OBJDIR
201b042e37fSmrg
2028c4a8e55Smrgm4_require([_LT_TAG_COMPILER])dnl
2038c4a8e55Smrg_LT_PROG_ECHO_BACKSLASH
204b042e37fSmrg
2058c4a8e55Smrgcase $host_os in
2068c4a8e55Smrgaix3*)
2078c4a8e55Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
2088c4a8e55Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
2098c4a8e55Smrg  # vanish in a puff of smoke.
2108c4a8e55Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
2118c4a8e55Smrg    COLLECT_NAMES=
2128c4a8e55Smrg    export COLLECT_NAMES
2138c4a8e55Smrg  fi
2148c4a8e55Smrg  ;;
2158c4a8e55Smrgesac
216b042e37fSmrg
2178c4a8e55Smrg# Sed substitution that helps us do robust quoting.  It backslashifies
2188c4a8e55Smrg# metacharacters that are still active within double-quoted strings.
2198c4a8e55Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
220b042e37fSmrg
2218c4a8e55Smrg# Same as above, but do not quote variable references.
2228c4a8e55Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
223b042e37fSmrg
2248c4a8e55Smrg# Sed substitution to delay expansion of an escaped shell variable in a
2258c4a8e55Smrg# double_quote_subst'ed string.
2268c4a8e55Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
227b042e37fSmrg
2288c4a8e55Smrg# Sed substitution to delay expansion of an escaped single quote.
2298c4a8e55Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
230b042e37fSmrg
2318c4a8e55Smrg# Sed substitution to avoid accidental globbing in evaled expressions
2328c4a8e55Smrgno_glob_subst='s/\*/\\\*/g'
233b042e37fSmrg
2348c4a8e55Smrg# Global variables:
2358c4a8e55Smrgofile=libtool
2368c4a8e55Smrgcan_build_shared=yes
237b042e37fSmrg
2388c4a8e55Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
2398c4a8e55Smrg# which needs '.lib').
2408c4a8e55Smrglibext=a
241b042e37fSmrg
2428c4a8e55Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
243b042e37fSmrg
2448c4a8e55Smrgold_CC="$CC"
2458c4a8e55Smrgold_CFLAGS="$CFLAGS"
246b042e37fSmrg
2478c4a8e55Smrg# Set sane defaults for various variables
2488c4a8e55Smrgtest -z "$CC" && CC=cc
2498c4a8e55Smrgtest -z "$LTCC" && LTCC=$CC
2508c4a8e55Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
2518c4a8e55Smrgtest -z "$LD" && LD=ld
2528c4a8e55Smrgtest -z "$ac_objext" && ac_objext=o
253b042e37fSmrg
2548c4a8e55Smrg_LT_CC_BASENAME([$compiler])
255b042e37fSmrg
2568c4a8e55Smrg# Only perform the check for file, if the check method requires it
2578c4a8e55Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
2588c4a8e55Smrgcase $deplibs_check_method in
2598c4a8e55Smrgfile_magic*)
2608c4a8e55Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
2618c4a8e55Smrg    _LT_PATH_MAGIC
2628c4a8e55Smrg  fi
2638c4a8e55Smrg  ;;
2648c4a8e55Smrgesac
265b042e37fSmrg
2668c4a8e55Smrg# Use C for the default configuration in the libtool script
2678c4a8e55SmrgLT_SUPPORTED_TAG([CC])
2688c4a8e55Smrg_LT_LANG_C_CONFIG
2698c4a8e55Smrg_LT_LANG_DEFAULT_CONFIG
2708c4a8e55Smrg_LT_CONFIG_COMMANDS
2718c4a8e55Smrg])# _LT_SETUP
272b042e37fSmrg
273b042e37fSmrg
2748c4a8e55Smrg# _LT_PROG_LTMAIN
2758c4a8e55Smrg# ---------------
2768c4a8e55Smrg# Note that this code is called both from `configure', and `config.status'
2778c4a8e55Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
2788c4a8e55Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
2798c4a8e55Smrg# so we pass a copy along to make sure it has a sensible value anyway.
2808c4a8e55Smrgm4_defun([_LT_PROG_LTMAIN],
2818c4a8e55Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
2828c4a8e55Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
2838c4a8e55Smrgltmain="$ac_aux_dir/ltmain.sh"
2848c4a8e55Smrg])# _LT_PROG_LTMAIN
285b042e37fSmrg
286b042e37fSmrg
287b042e37fSmrg
2888c4a8e55Smrg# So that we can recreate a full libtool script including additional
2898c4a8e55Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
2908c4a8e55Smrg# in macros and then make a single call at the end using the `libtool'
2918c4a8e55Smrg# label.
292b042e37fSmrg
293b042e37fSmrg
2948c4a8e55Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
2958c4a8e55Smrg# ----------------------------------------
2968c4a8e55Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
2978c4a8e55Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
2988c4a8e55Smrg[m4_ifval([$1],
2998c4a8e55Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
3008c4a8e55Smrg                     [$1
3018c4a8e55Smrg])])])
302b042e37fSmrg
3038c4a8e55Smrg# Initialize.
3048c4a8e55Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
305b042e37fSmrg
306b042e37fSmrg
3078c4a8e55Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
3088c4a8e55Smrg# ------------------------------
3098c4a8e55Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3108c4a8e55Smrgm4_define([_LT_CONFIG_LIBTOOL],
3118c4a8e55Smrg[m4_ifval([$1],
3128c4a8e55Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
3138c4a8e55Smrg                     [$1
3148c4a8e55Smrg])])])
3158c4a8e55Smrg
3168c4a8e55Smrg# Initialize.
3178c4a8e55Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
3188c4a8e55Smrg
3198c4a8e55Smrg
3208c4a8e55Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
3218c4a8e55Smrg# -----------------------------------------------------
3228c4a8e55Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
3238c4a8e55Smrg[_LT_CONFIG_LIBTOOL([$1])
3248c4a8e55Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
3258c4a8e55Smrg])
326b042e37fSmrg
327b042e37fSmrg
3288c4a8e55Smrg# _LT_FORMAT_COMMENT([COMMENT])
3298c4a8e55Smrg# -----------------------------
3308c4a8e55Smrg# Add leading comment marks to the start of each line, and a trailing
3318c4a8e55Smrg# full-stop to the whole comment if one is not present already.
3328c4a8e55Smrgm4_define([_LT_FORMAT_COMMENT],
3338c4a8e55Smrg[m4_ifval([$1], [
3348c4a8e55Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
3358c4a8e55Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
3368c4a8e55Smrg)])
3378c4a8e55Smrg
3388c4a8e55Smrg
3398c4a8e55Smrg
3408c4a8e55Smrg
3418c4a8e55Smrg
3428c4a8e55Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
3438c4a8e55Smrg# -------------------------------------------------------------------
3448c4a8e55Smrg# CONFIGNAME is the name given to the value in the libtool script.
3458c4a8e55Smrg# VARNAME is the (base) name used in the configure script.
3468c4a8e55Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
3478c4a8e55Smrg# VARNAME.  Any other value will be used directly.
3488c4a8e55Smrgm4_define([_LT_DECL],
3498c4a8e55Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
3508c4a8e55Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
3518c4a8e55Smrg	[m4_ifval([$1], [$1], [$2])])
3528c4a8e55Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
3538c4a8e55Smrg    m4_ifval([$4],
3548c4a8e55Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
3558c4a8e55Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
3568c4a8e55Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
3578c4a8e55Smrg])
358b042e37fSmrg
359b042e37fSmrg
3608c4a8e55Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
3618c4a8e55Smrg# --------------------------------------------------------
3628c4a8e55Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
363b042e37fSmrg
364b042e37fSmrg
3658c4a8e55Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
3668c4a8e55Smrg# ------------------------------------------------
3678c4a8e55Smrgm4_define([lt_decl_tag_varnames],
3688c4a8e55Smrg[_lt_decl_filter([tagged?], [yes], $@)])
369b042e37fSmrg
370b042e37fSmrg
3718c4a8e55Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
3728c4a8e55Smrg# ---------------------------------------------------------
3738c4a8e55Smrgm4_define([_lt_decl_filter],
3748c4a8e55Smrg[m4_case([$#],
3758c4a8e55Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
3768c4a8e55Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
3778c4a8e55Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
3788c4a8e55Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
3798c4a8e55Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
3808c4a8e55Smrg])
381b042e37fSmrg
382b042e37fSmrg
3838c4a8e55Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
3848c4a8e55Smrg# --------------------------------------------------
3858c4a8e55Smrgm4_define([lt_decl_quote_varnames],
3868c4a8e55Smrg[_lt_decl_filter([value], [1], $@)])
387b042e37fSmrg
388b042e37fSmrg
3898c4a8e55Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
3908c4a8e55Smrg# ---------------------------------------------------
3918c4a8e55Smrgm4_define([lt_decl_dquote_varnames],
3928c4a8e55Smrg[_lt_decl_filter([value], [2], $@)])
393b042e37fSmrg
394b042e37fSmrg
3958c4a8e55Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
3968c4a8e55Smrg# ---------------------------------------------------
3978c4a8e55Smrgm4_define([lt_decl_varnames_tagged],
3988c4a8e55Smrg[m4_assert([$# <= 2])dnl
3998c4a8e55Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
4008c4a8e55Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
4018c4a8e55Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
4028c4a8e55Smrgm4_define([_lt_decl_varnames_tagged],
4038c4a8e55Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
404b042e37fSmrg
405b042e37fSmrg
4068c4a8e55Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
4078c4a8e55Smrg# ------------------------------------------------
4088c4a8e55Smrgm4_define([lt_decl_all_varnames],
4098c4a8e55Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
4108c4a8e55Smrg     m4_if([$2], [],
4118c4a8e55Smrg	   m4_quote(lt_decl_varnames),
4128c4a8e55Smrg	m4_quote(m4_shift($@))))[]dnl
4138c4a8e55Smrg])
4148c4a8e55Smrgm4_define([_lt_decl_all_varnames],
4158c4a8e55Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
4168c4a8e55Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
4178c4a8e55Smrg])
418b042e37fSmrg
419b042e37fSmrg
4208c4a8e55Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
4218c4a8e55Smrg# ------------------------------------
4228c4a8e55Smrg# Quote a variable value, and forward it to `config.status' so that its
4238c4a8e55Smrg# declaration there will have the same value as in `configure'.  VARNAME
4248c4a8e55Smrg# must have a single quote delimited value for this to work.
4258c4a8e55Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
4268c4a8e55Smrg[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
427b042e37fSmrg
4288c4a8e55Smrg
4298c4a8e55Smrg# _LT_CONFIG_STATUS_DECLARATIONS
4308c4a8e55Smrg# ------------------------------
4318c4a8e55Smrg# We delimit libtool config variables with single quotes, so when
4328c4a8e55Smrg# we write them to config.status, we have to be sure to quote all
4338c4a8e55Smrg# embedded single quotes properly.  In configure, this macro expands
4348c4a8e55Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
435b042e37fSmrg#
4368c4a8e55Smrg#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
4378c4a8e55Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
4388c4a8e55Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
4398c4a8e55Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
440b042e37fSmrg
441b042e37fSmrg
4428c4a8e55Smrg# _LT_LIBTOOL_TAGS
4438c4a8e55Smrg# ----------------
4448c4a8e55Smrg# Output comment and list of tags supported by the script
4458c4a8e55Smrgm4_defun([_LT_LIBTOOL_TAGS],
4468c4a8e55Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
4478c4a8e55Smrgavailable_tags="_LT_TAGS"dnl
4488c4a8e55Smrg])
449b042e37fSmrg
450b042e37fSmrg
4518c4a8e55Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
4528c4a8e55Smrg# -----------------------------------
4538c4a8e55Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
4548c4a8e55Smrg# expand to a commented shell variable setting:
4558c4a8e55Smrg#
4568c4a8e55Smrg#    # Some comment about what VAR is for.
4578c4a8e55Smrg#    visible_name=$lt_internal_name
4588c4a8e55Smrgm4_define([_LT_LIBTOOL_DECLARE],
4598c4a8e55Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
4608c4a8e55Smrg					   [description])))[]dnl
4618c4a8e55Smrgm4_pushdef([_libtool_name],
4628c4a8e55Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
4638c4a8e55Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
4648c4a8e55Smrg    [0], [_libtool_name=[$]$1],
4658c4a8e55Smrg    [1], [_libtool_name=$lt_[]$1],
4668c4a8e55Smrg    [2], [_libtool_name=$lt_[]$1],
4678c4a8e55Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
4688c4a8e55Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
469b042e37fSmrg])
470b042e37fSmrg
471b042e37fSmrg
4728c4a8e55Smrg# _LT_LIBTOOL_CONFIG_VARS
4738c4a8e55Smrg# -----------------------
4748c4a8e55Smrg# Produce commented declarations of non-tagged libtool config variables
4758c4a8e55Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
4768c4a8e55Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
4778c4a8e55Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
4788c4a8e55Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
4798c4a8e55Smrg[m4_foreach([_lt_var],
4808c4a8e55Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
4818c4a8e55Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
482b042e37fSmrg
483b042e37fSmrg
4848c4a8e55Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
4858c4a8e55Smrg# -------------------------
4868c4a8e55Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
4878c4a8e55Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
4888c4a8e55Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
489b042e37fSmrg
490b042e37fSmrg
4918c4a8e55Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
4928c4a8e55Smrg# ------------------------------
4938c4a8e55Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
494b042e37fSmrg
495b042e37fSmrg
4968c4a8e55Smrg# _LT_CONFIG_COMMANDS
4978c4a8e55Smrg# -------------------
4988c4a8e55Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
4998c4a8e55Smrg# variables for single and double quote escaping we saved from calls
5008c4a8e55Smrg# to _LT_DECL, we can put quote escaped variables declarations
5018c4a8e55Smrg# into `config.status', and then the shell code to quote escape them in
5028c4a8e55Smrg# for loops in `config.status'.  Finally, any additional code accumulated
5038c4a8e55Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
5048c4a8e55Smrgm4_defun([_LT_CONFIG_COMMANDS],
5058c4a8e55Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
5068c4a8e55Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
5078c4a8e55Smrg	dnl instead of duplicating it all over again into config.status,
5088c4a8e55Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
5098c4a8e55Smrg	dnl needs to know what name is stored there:
5108c4a8e55Smrg        [AC_CONFIG_COMMANDS([libtool],
5118c4a8e55Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
5128c4a8e55Smrg    dnl If the libtool generation code is destined for config.status,
5138c4a8e55Smrg    dnl expand the accumulated commands and init code now:
5148c4a8e55Smrg    [AC_CONFIG_COMMANDS([libtool],
5158c4a8e55Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
5168c4a8e55Smrg])#_LT_CONFIG_COMMANDS
5178c4a8e55Smrg
5188c4a8e55Smrg
5198c4a8e55Smrg# Initialize.
5208c4a8e55Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
5218c4a8e55Smrg[
522b042e37fSmrg
5238c4a8e55Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
5248c4a8e55Smrg# if CDPATH is set.
5258c4a8e55Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
526b042e37fSmrg
5278c4a8e55Smrgsed_quote_subst='$sed_quote_subst'
5288c4a8e55Smrgdouble_quote_subst='$double_quote_subst'
5298c4a8e55Smrgdelay_variable_subst='$delay_variable_subst'
5308c4a8e55Smrg_LT_CONFIG_STATUS_DECLARATIONS
5318c4a8e55SmrgLTCC='$LTCC'
5328c4a8e55SmrgLTCFLAGS='$LTCFLAGS'
5338c4a8e55Smrgcompiler='$compiler_DEFAULT'
5348c4a8e55Smrg
5358c4a8e55Smrg# Quote evaled strings.
5368c4a8e55Smrgfor var in lt_decl_all_varnames([[ \
5378c4a8e55Smrg]], lt_decl_quote_varnames); do
5388c4a8e55Smrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
5398c4a8e55Smrg    *[[\\\\\\\`\\"\\\$]]*)
5408c4a8e55Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
5418c4a8e55Smrg      ;;
5428c4a8e55Smrg    *)
5438c4a8e55Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5448c4a8e55Smrg      ;;
5458c4a8e55Smrg    esac
5468c4a8e55Smrgdone
547b042e37fSmrg
5488c4a8e55Smrg# Double-quote double-evaled strings.
5498c4a8e55Smrgfor var in lt_decl_all_varnames([[ \
5508c4a8e55Smrg]], lt_decl_dquote_varnames); do
5518c4a8e55Smrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
5528c4a8e55Smrg    *[[\\\\\\\`\\"\\\$]]*)
5538c4a8e55Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
5548c4a8e55Smrg      ;;
5558c4a8e55Smrg    *)
5568c4a8e55Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5578c4a8e55Smrg      ;;
5588c4a8e55Smrg    esac
5598c4a8e55Smrgdone
560b042e37fSmrg
5618c4a8e55Smrg# Fix-up fallback echo if it was mangled by the above quoting rules.
5628c4a8e55Smrgcase \$lt_ECHO in
5638c4a8e55Smrg*'\\\[$]0 --fallback-echo"')dnl "
5648c4a8e55Smrg  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
5658c4a8e55Smrg  ;;
5668c4a8e55Smrgesac
567b042e37fSmrg
5688c4a8e55Smrg_LT_OUTPUT_LIBTOOL_INIT
5698c4a8e55Smrg])
570b042e37fSmrg
571b042e37fSmrg
5728c4a8e55Smrg# LT_OUTPUT
5738c4a8e55Smrg# ---------
5748c4a8e55Smrg# This macro allows early generation of the libtool script (before
5758c4a8e55Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
5768c4a8e55Smrg# tests.
5778c4a8e55SmrgAC_DEFUN([LT_OUTPUT],
5788c4a8e55Smrg[: ${CONFIG_LT=./config.lt}
5798c4a8e55SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
5808c4a8e55Smrgcat >"$CONFIG_LT" <<_LTEOF
5818c4a8e55Smrg#! $SHELL
5828c4a8e55Smrg# Generated by $as_me.
5838c4a8e55Smrg# Run this file to recreate a libtool stub with the current configuration.
5848c4a8e55Smrg
5858c4a8e55Smrglt_cl_silent=false
5868c4a8e55SmrgSHELL=\${CONFIG_SHELL-$SHELL}
5878c4a8e55Smrg_LTEOF
5888c4a8e55Smrg
5898c4a8e55Smrgcat >>"$CONFIG_LT" <<\_LTEOF
5908c4a8e55SmrgAS_SHELL_SANITIZE
5918c4a8e55Smrg_AS_PREPARE
5928c4a8e55Smrg
5938c4a8e55Smrgexec AS_MESSAGE_FD>&1
5948c4a8e55Smrgexec AS_MESSAGE_LOG_FD>>config.log
5958c4a8e55Smrg{
5968c4a8e55Smrg  echo
5978c4a8e55Smrg  AS_BOX([Running $as_me.])
5988c4a8e55Smrg} >&AS_MESSAGE_LOG_FD
599b042e37fSmrg
6008c4a8e55Smrglt_cl_help="\
6018c4a8e55Smrg\`$as_me' creates a local libtool stub from the current configuration,
6028c4a8e55Smrgfor use in further configure time tests before the real libtool is
6038c4a8e55Smrggenerated.
604b042e37fSmrg
6058c4a8e55SmrgUsage: $[0] [[OPTIONS]]
606b042e37fSmrg
6078c4a8e55Smrg  -h, --help      print this help, then exit
6088c4a8e55Smrg  -V, --version   print version number, then exit
6098c4a8e55Smrg  -q, --quiet     do not print progress messages
6108c4a8e55Smrg  -d, --debug     don't remove temporary files
611b042e37fSmrg
6128c4a8e55SmrgReport bugs to <bug-libtool@gnu.org>."
613b042e37fSmrg
6148c4a8e55Smrglt_cl_version="\
6158c4a8e55Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
6168c4a8e55Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
6178c4a8e55Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
618b042e37fSmrg
6198c4a8e55SmrgCopyright (C) 2008 Free Software Foundation, Inc.
6208c4a8e55SmrgThis config.lt script is free software; the Free Software Foundation
6218c4a8e55Smrggives unlimited permision to copy, distribute and modify it."
622b042e37fSmrg
6238c4a8e55Smrgwhile test $[#] != 0
6248c4a8e55Smrgdo
6258c4a8e55Smrg  case $[1] in
6268c4a8e55Smrg    --version | --v* | -V )
6278c4a8e55Smrg      echo "$lt_cl_version"; exit 0 ;;
6288c4a8e55Smrg    --help | --h* | -h )
6298c4a8e55Smrg      echo "$lt_cl_help"; exit 0 ;;
6308c4a8e55Smrg    --debug | --d* | -d )
6318c4a8e55Smrg      debug=: ;;
6328c4a8e55Smrg    --quiet | --q* | --silent | --s* | -q )
6338c4a8e55Smrg      lt_cl_silent=: ;;
6348c4a8e55Smrg
6358c4a8e55Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
6368c4a8e55SmrgTry \`$[0] --help' for more information.]) ;;
6378c4a8e55Smrg
6388c4a8e55Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
6398c4a8e55SmrgTry \`$[0] --help' for more information.]) ;;
6408c4a8e55Smrg  esac
6418c4a8e55Smrg  shift
6428c4a8e55Smrgdone
643b042e37fSmrg
6448c4a8e55Smrgif $lt_cl_silent; then
6458c4a8e55Smrg  exec AS_MESSAGE_FD>/dev/null
6468c4a8e55Smrgfi
6478c4a8e55Smrg_LTEOF
6488c4a8e55Smrg
6498c4a8e55Smrgcat >>"$CONFIG_LT" <<_LTEOF
6508c4a8e55Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
6518c4a8e55Smrg_LTEOF
6528c4a8e55Smrg
6538c4a8e55Smrgcat >>"$CONFIG_LT" <<\_LTEOF
6548c4a8e55SmrgAC_MSG_NOTICE([creating $ofile])
6558c4a8e55Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
6568c4a8e55SmrgAS_EXIT(0)
6578c4a8e55Smrg_LTEOF
6588c4a8e55Smrgchmod +x "$CONFIG_LT"
6598c4a8e55Smrg
6608c4a8e55Smrg# configure is writing to config.log, but config.lt does its own redirection,
6618c4a8e55Smrg# appending to config.log, which fails on DOS, as config.log is still kept
6628c4a8e55Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
6638c4a8e55Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
6648c4a8e55Smrgif test "$no_create" != yes; then
6658c4a8e55Smrg  lt_cl_success=:
6668c4a8e55Smrg  test "$silent" = yes &&
6678c4a8e55Smrg    lt_config_lt_args="$lt_config_lt_args --quiet"
6688c4a8e55Smrg  exec AS_MESSAGE_LOG_FD>/dev/null
6698c4a8e55Smrg  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
6708c4a8e55Smrg  exec AS_MESSAGE_LOG_FD>>config.log
6718c4a8e55Smrg  $lt_cl_success || AS_EXIT(1)
6728c4a8e55Smrgfi
6738c4a8e55Smrg])# LT_OUTPUT
674b042e37fSmrg
675b042e37fSmrg
6768c4a8e55Smrg# _LT_CONFIG(TAG)
6778c4a8e55Smrg# ---------------
6788c4a8e55Smrg# If TAG is the built-in tag, create an initial libtool script with a
6798c4a8e55Smrg# default configuration from the untagged config vars.  Otherwise add code
6808c4a8e55Smrg# to config.status for appending the configuration named by TAG from the
6818c4a8e55Smrg# matching tagged config vars.
6828c4a8e55Smrgm4_defun([_LT_CONFIG],
6838c4a8e55Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6848c4a8e55Smrg_LT_CONFIG_SAVE_COMMANDS([
6858c4a8e55Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
6868c4a8e55Smrg  m4_if(_LT_TAG, [C], [
6878c4a8e55Smrg    # See if we are running on zsh, and set the options which allow our
6888c4a8e55Smrg    # commands through without removal of \ escapes.
6898c4a8e55Smrg    if test -n "${ZSH_VERSION+set}" ; then
6908c4a8e55Smrg      setopt NO_GLOB_SUBST
6918c4a8e55Smrg    fi
692b042e37fSmrg
6938c4a8e55Smrg    cfgfile="${ofile}T"
6948c4a8e55Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
6958c4a8e55Smrg    $RM "$cfgfile"
696b042e37fSmrg
6978c4a8e55Smrg    cat <<_LT_EOF >> "$cfgfile"
6988c4a8e55Smrg#! $SHELL
699b042e37fSmrg
7008c4a8e55Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
7018c4a8e55Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
7028c4a8e55Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7038c4a8e55Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
704b042e37fSmrg#
7058c4a8e55Smrg_LT_COPYING
7068c4a8e55Smrg_LT_LIBTOOL_TAGS
707b042e37fSmrg
7088c4a8e55Smrg# ### BEGIN LIBTOOL CONFIG
7098c4a8e55Smrg_LT_LIBTOOL_CONFIG_VARS
7108c4a8e55Smrg_LT_LIBTOOL_TAG_VARS
7118c4a8e55Smrg# ### END LIBTOOL CONFIG
712b042e37fSmrg
7138c4a8e55Smrg_LT_EOF
714b042e37fSmrg
7158c4a8e55Smrg  case $host_os in
7168c4a8e55Smrg  aix3*)
7178c4a8e55Smrg    cat <<\_LT_EOF >> "$cfgfile"
7188c4a8e55Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
7198c4a8e55Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
7208c4a8e55Smrg# vanish in a puff of smoke.
7218c4a8e55Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
7228c4a8e55Smrg  COLLECT_NAMES=
7238c4a8e55Smrg  export COLLECT_NAMES
7248c4a8e55Smrgfi
7258c4a8e55Smrg_LT_EOF
7268c4a8e55Smrg    ;;
7278c4a8e55Smrg  esac
728b042e37fSmrg
7298c4a8e55Smrg  _LT_PROG_LTMAIN
730b042e37fSmrg
7318c4a8e55Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
7328c4a8e55Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
7338c4a8e55Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
7348c4a8e55Smrg  # is reportedly fixed, but why not run on old versions too?
7358c4a8e55Smrg  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
7368c4a8e55Smrg    || (rm -f "$cfgfile"; exit 1)
737b042e37fSmrg
7388c4a8e55Smrg  _LT_PROG_XSI_SHELLFNS
739b042e37fSmrg
7408c4a8e55Smrg  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
7418c4a8e55Smrg    || (rm -f "$cfgfile"; exit 1)
742b042e37fSmrg
7438c4a8e55Smrg  mv -f "$cfgfile" "$ofile" ||
7448c4a8e55Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
7458c4a8e55Smrg  chmod +x "$ofile"
7468c4a8e55Smrg],
7478c4a8e55Smrg[cat <<_LT_EOF >> "$ofile"
748b042e37fSmrg
7498c4a8e55Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
7508c4a8e55Smrgdnl in a comment (ie after a #).
7518c4a8e55Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
7528c4a8e55Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
7538c4a8e55Smrg# ### END LIBTOOL TAG CONFIG: $1
7548c4a8e55Smrg_LT_EOF
7558c4a8e55Smrg])dnl /m4_if
7568c4a8e55Smrg],
7578c4a8e55Smrg[m4_if([$1], [], [
7588c4a8e55Smrg    PACKAGE='$PACKAGE'
7598c4a8e55Smrg    VERSION='$VERSION'
7608c4a8e55Smrg    TIMESTAMP='$TIMESTAMP'
7618c4a8e55Smrg    RM='$RM'
7628c4a8e55Smrg    ofile='$ofile'], [])
7638c4a8e55Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
7648c4a8e55Smrg])# _LT_CONFIG
765b042e37fSmrg
766b042e37fSmrg
7678c4a8e55Smrg# LT_SUPPORTED_TAG(TAG)
7688c4a8e55Smrg# ---------------------
7698c4a8e55Smrg# Trace this macro to discover what tags are supported by the libtool
7708c4a8e55Smrg# --tag option, using:
7718c4a8e55Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
7728c4a8e55SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
773b042e37fSmrg
774b042e37fSmrg
7758c4a8e55Smrg# C support is built-in for now
7768c4a8e55Smrgm4_define([_LT_LANG_C_enabled], [])
7778c4a8e55Smrgm4_define([_LT_TAGS], [])
778b042e37fSmrg
779b042e37fSmrg
7808c4a8e55Smrg# LT_LANG(LANG)
7818c4a8e55Smrg# -------------
7828c4a8e55Smrg# Enable libtool support for the given language if not already enabled.
7838c4a8e55SmrgAC_DEFUN([LT_LANG],
7848c4a8e55Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
7858c4a8e55Smrgm4_case([$1],
7868c4a8e55Smrg  [C],			[_LT_LANG(C)],
7878c4a8e55Smrg  [C++],		[_LT_LANG(CXX)],
7888c4a8e55Smrg  [Java],		[_LT_LANG(GCJ)],
7898c4a8e55Smrg  [Fortran 77],		[_LT_LANG(F77)],
7908c4a8e55Smrg  [Fortran],		[_LT_LANG(FC)],
7918c4a8e55Smrg  [Windows Resource],	[_LT_LANG(RC)],
7928c4a8e55Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
7938c4a8e55Smrg    [_LT_LANG($1)],
7948c4a8e55Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
7958c4a8e55Smrg])# LT_LANG
7968c4a8e55Smrg
7978c4a8e55Smrg
7988c4a8e55Smrg# _LT_LANG(LANGNAME)
7998c4a8e55Smrg# ------------------
8008c4a8e55Smrgm4_defun([_LT_LANG],
8018c4a8e55Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
8028c4a8e55Smrg  [LT_SUPPORTED_TAG([$1])dnl
8038c4a8e55Smrg  m4_append([_LT_TAGS], [$1 ])dnl
8048c4a8e55Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
8058c4a8e55Smrg  _LT_LANG_$1_CONFIG($1)])dnl
8068c4a8e55Smrg])# _LT_LANG
807b042e37fSmrg
808b042e37fSmrg
8098c4a8e55Smrg# _LT_LANG_DEFAULT_CONFIG
8108c4a8e55Smrg# -----------------------
8118c4a8e55Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
8128c4a8e55Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
8138c4a8e55Smrg  [LT_LANG(CXX)],
8148c4a8e55Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
8158c4a8e55Smrg
8168c4a8e55SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
8178c4a8e55Smrg  [LT_LANG(F77)],
8188c4a8e55Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
8198c4a8e55Smrg
8208c4a8e55SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
8218c4a8e55Smrg  [LT_LANG(FC)],
8228c4a8e55Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
8238c4a8e55Smrg
8248c4a8e55Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
8258c4a8e55Smrgdnl pulling things in needlessly.
8268c4a8e55SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
8278c4a8e55Smrg  [LT_LANG(GCJ)],
8288c4a8e55Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
8298c4a8e55Smrg    [LT_LANG(GCJ)],
8308c4a8e55Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
8318c4a8e55Smrg      [LT_LANG(GCJ)],
8328c4a8e55Smrg      [m4_ifdef([AC_PROG_GCJ],
8338c4a8e55Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
8348c4a8e55Smrg       m4_ifdef([A][M_PROG_GCJ],
8358c4a8e55Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
8368c4a8e55Smrg       m4_ifdef([LT_PROG_GCJ],
8378c4a8e55Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
8388c4a8e55Smrg
8398c4a8e55SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
8408c4a8e55Smrg  [LT_LANG(RC)],
8418c4a8e55Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
8428c4a8e55Smrg])# _LT_LANG_DEFAULT_CONFIG
8438c4a8e55Smrg
8448c4a8e55Smrg# Obsolete macros:
8458c4a8e55SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
8468c4a8e55SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
8478c4a8e55SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
8488c4a8e55SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
8498c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
8508c4a8e55Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
8518c4a8e55Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
8528c4a8e55Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
8538c4a8e55Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
8548c4a8e55Smrg
8558c4a8e55Smrg
8568c4a8e55Smrg# _LT_TAG_COMPILER
8578c4a8e55Smrg# ----------------
8588c4a8e55Smrgm4_defun([_LT_TAG_COMPILER],
8598c4a8e55Smrg[AC_REQUIRE([AC_PROG_CC])dnl
860b042e37fSmrg
8618c4a8e55Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
8628c4a8e55Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
8638c4a8e55Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
8648c4a8e55Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
865b042e37fSmrg
8668c4a8e55Smrg# If no C compiler was specified, use CC.
8678c4a8e55SmrgLTCC=${LTCC-"$CC"}
868b042e37fSmrg
8698c4a8e55Smrg# If no C compiler flags were specified, use CFLAGS.
8708c4a8e55SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
871b042e37fSmrg
8728c4a8e55Smrg# Allow CC to be a program name with arguments.
8738c4a8e55Smrgcompiler=$CC
8748c4a8e55Smrg])# _LT_TAG_COMPILER
875b042e37fSmrg
876b042e37fSmrg
8778c4a8e55Smrg# _LT_COMPILER_BOILERPLATE
8788c4a8e55Smrg# ------------------------
8798c4a8e55Smrg# Check for compiler boilerplate output or warnings with
8808c4a8e55Smrg# the simple compiler test code.
8818c4a8e55Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
8828c4a8e55Smrg[m4_require([_LT_DECL_SED])dnl
8838c4a8e55Smrgac_outfile=conftest.$ac_objext
8848c4a8e55Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
8858c4a8e55Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
8868c4a8e55Smrg_lt_compiler_boilerplate=`cat conftest.err`
8878c4a8e55Smrg$RM conftest*
8888c4a8e55Smrg])# _LT_COMPILER_BOILERPLATE
889b042e37fSmrg
890b042e37fSmrg
8918c4a8e55Smrg# _LT_LINKER_BOILERPLATE
8928c4a8e55Smrg# ----------------------
8938c4a8e55Smrg# Check for linker boilerplate output or warnings with
8948c4a8e55Smrg# the simple link test code.
8958c4a8e55Smrgm4_defun([_LT_LINKER_BOILERPLATE],
8968c4a8e55Smrg[m4_require([_LT_DECL_SED])dnl
8978c4a8e55Smrgac_outfile=conftest.$ac_objext
8988c4a8e55Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
8998c4a8e55Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
9008c4a8e55Smrg_lt_linker_boilerplate=`cat conftest.err`
9018c4a8e55Smrg$RM -r conftest*
9028c4a8e55Smrg])# _LT_LINKER_BOILERPLATE
903b042e37fSmrg
9048c4a8e55Smrg# _LT_REQUIRED_DARWIN_CHECKS
9058c4a8e55Smrg# -------------------------
9068c4a8e55Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
9078c4a8e55Smrg  case $host_os in
9088c4a8e55Smrg    rhapsody* | darwin*)
9098c4a8e55Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
9108c4a8e55Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
9118c4a8e55Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
9128c4a8e55Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
9138c4a8e55Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
9148c4a8e55Smrg    _LT_DECL([], [DSYMUTIL], [1],
9158c4a8e55Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
9168c4a8e55Smrg    _LT_DECL([], [NMEDIT], [1],
9178c4a8e55Smrg      [Tool to change global to local symbols on Mac OS X])
9188c4a8e55Smrg    _LT_DECL([], [LIPO], [1],
9198c4a8e55Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
9208c4a8e55Smrg    _LT_DECL([], [OTOOL], [1],
9218c4a8e55Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
9228c4a8e55Smrg    _LT_DECL([], [OTOOL64], [1],
9238c4a8e55Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
9248c4a8e55Smrg
9258c4a8e55Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
9268c4a8e55Smrg      [lt_cv_apple_cc_single_mod=no
9278c4a8e55Smrg      if test -z "${LT_MULTI_MODULE}"; then
9288c4a8e55Smrg	# By default we will add the -single_module flag. You can override
9298c4a8e55Smrg	# by either setting the environment variable LT_MULTI_MODULE
9308c4a8e55Smrg	# non-empty at configure time, or by adding -multi_module to the
9318c4a8e55Smrg	# link flags.
9328c4a8e55Smrg	rm -rf libconftest.dylib*
9338c4a8e55Smrg	echo "int foo(void){return 1;}" > conftest.c
9348c4a8e55Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
9358c4a8e55Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
9368c4a8e55Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
9378c4a8e55Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
9388c4a8e55Smrg        _lt_result=$?
9398c4a8e55Smrg	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
9408c4a8e55Smrg	  lt_cv_apple_cc_single_mod=yes
9418c4a8e55Smrg	else
9428c4a8e55Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
9438c4a8e55Smrg	fi
9448c4a8e55Smrg	rm -rf libconftest.dylib*
9458c4a8e55Smrg	rm -f conftest.*
9468c4a8e55Smrg      fi])
9478c4a8e55Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
9488c4a8e55Smrg      [lt_cv_ld_exported_symbols_list],
9498c4a8e55Smrg      [lt_cv_ld_exported_symbols_list=no
9508c4a8e55Smrg      save_LDFLAGS=$LDFLAGS
9518c4a8e55Smrg      echo "_main" > conftest.sym
9528c4a8e55Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
9538c4a8e55Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
9548c4a8e55Smrg	[lt_cv_ld_exported_symbols_list=yes],
9558c4a8e55Smrg	[lt_cv_ld_exported_symbols_list=no])
9568c4a8e55Smrg	LDFLAGS="$save_LDFLAGS"
9578c4a8e55Smrg    ])
9588c4a8e55Smrg    case $host_os in
9598c4a8e55Smrg    rhapsody* | darwin1.[[012]])
9608c4a8e55Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
9618c4a8e55Smrg    darwin1.*)
9628c4a8e55Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
9638c4a8e55Smrg    darwin*) # darwin 5.x on
9648c4a8e55Smrg      # if running on 10.5 or later, the deployment target defaults
9658c4a8e55Smrg      # to the OS version, if on x86, and 10.4, the deployment
9668c4a8e55Smrg      # target defaults to 10.4. Don't you love it?
9678c4a8e55Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
9688c4a8e55Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
9698c4a8e55Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
9708c4a8e55Smrg	10.[[012]]*)
9718c4a8e55Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
9728c4a8e55Smrg	10.*)
9738c4a8e55Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
9748c4a8e55Smrg      esac
9758c4a8e55Smrg    ;;
9768c4a8e55Smrg  esac
9778c4a8e55Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
9788c4a8e55Smrg      _lt_dar_single_mod='$single_module'
9798c4a8e55Smrg    fi
9808c4a8e55Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
9818c4a8e55Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
9828c4a8e55Smrg    else
9838c4a8e55Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
9848c4a8e55Smrg    fi
9858c4a8e55Smrg    if test "$DSYMUTIL" != ":"; then
9868c4a8e55Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
9878c4a8e55Smrg    else
9888c4a8e55Smrg      _lt_dsymutil=
9898c4a8e55Smrg    fi
9908c4a8e55Smrg    ;;
9918c4a8e55Smrg  esac
9928c4a8e55Smrg])
993b042e37fSmrg
994b042e37fSmrg
9958c4a8e55Smrg# _LT_DARWIN_LINKER_FEATURES
9968c4a8e55Smrg# --------------------------
9978c4a8e55Smrg# Checks for linker and compiler features on darwin
9988c4a8e55Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
9998c4a8e55Smrg[
10008c4a8e55Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
10018c4a8e55Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10028c4a8e55Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
10038c4a8e55Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
10048c4a8e55Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
10058c4a8e55Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
10068c4a8e55Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
10078c4a8e55Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
10088c4a8e55Smrg  case $cc_basename in
10098c4a8e55Smrg     ifort*) _lt_dar_can_shared=yes ;;
10108c4a8e55Smrg     *) _lt_dar_can_shared=$GCC ;;
10118c4a8e55Smrg  esac
10128c4a8e55Smrg  if test "$_lt_dar_can_shared" = "yes"; then
10138c4a8e55Smrg    output_verbose_link_cmd=echo
10148c4a8e55Smrg    _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}"
10158c4a8e55Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
10168c4a8e55Smrg    _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}"
10178c4a8e55Smrg    _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}"
10188c4a8e55Smrg    m4_if([$1], [CXX],
10198c4a8e55Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
10208c4a8e55Smrg      _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}"
10218c4a8e55Smrg      _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}"
10228c4a8e55Smrg    fi
10238c4a8e55Smrg],[])
10248c4a8e55Smrg  else
10258c4a8e55Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
10268c4a8e55Smrg  fi
10278c4a8e55Smrg])
1028b042e37fSmrg
10298c4a8e55Smrg# _LT_SYS_MODULE_PATH_AIX
10308c4a8e55Smrg# -----------------------
10318c4a8e55Smrg# Links a minimal program and checks the executable
10328c4a8e55Smrg# for the system default hardcoded library path. In most cases,
10338c4a8e55Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
10348c4a8e55Smrg# the location of the communication and MPI libs are included too.
10358c4a8e55Smrg# If we don't find anything, use the default library path according
10368c4a8e55Smrg# to the aix ld manual.
10378c4a8e55Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
10388c4a8e55Smrg[m4_require([_LT_DECL_SED])dnl
10398c4a8e55SmrgAC_LINK_IFELSE(AC_LANG_PROGRAM,[
10408c4a8e55Smrglt_aix_libpath_sed='
10418c4a8e55Smrg    /Import File Strings/,/^$/ {
10428c4a8e55Smrg	/^0/ {
10438c4a8e55Smrg	    s/^0  *\(.*\)$/\1/
10448c4a8e55Smrg	    p
10458c4a8e55Smrg	}
10468c4a8e55Smrg    }'
10478c4a8e55Smrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
10488c4a8e55Smrg# Check for a 64-bit object if we didn't find anything.
10498c4a8e55Smrgif test -z "$aix_libpath"; then
10508c4a8e55Smrg  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
10518c4a8e55Smrgfi],[])
10528c4a8e55Smrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
10538c4a8e55Smrg])# _LT_SYS_MODULE_PATH_AIX
1054b042e37fSmrg
1055b042e37fSmrg
10568c4a8e55Smrg# _LT_SHELL_INIT(ARG)
10578c4a8e55Smrg# -------------------
10588c4a8e55Smrgm4_define([_LT_SHELL_INIT],
10598c4a8e55Smrg[ifdef([AC_DIVERSION_NOTICE],
10608c4a8e55Smrg	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
10618c4a8e55Smrg	 [AC_DIVERT_PUSH(NOTICE)])
10628c4a8e55Smrg$1
10638c4a8e55SmrgAC_DIVERT_POP
10648c4a8e55Smrg])# _LT_SHELL_INIT
1065b042e37fSmrg
1066b042e37fSmrg
10678c4a8e55Smrg# _LT_PROG_ECHO_BACKSLASH
10688c4a8e55Smrg# -----------------------
10698c4a8e55Smrg# Add some code to the start of the generated configure script which
10708c4a8e55Smrg# will find an echo command which doesn't interpret backslashes.
10718c4a8e55Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
10728c4a8e55Smrg[_LT_SHELL_INIT([
10738c4a8e55Smrg# Check that we are running under the correct shell.
10748c4a8e55SmrgSHELL=${CONFIG_SHELL-/bin/sh}
1075b042e37fSmrg
10768c4a8e55Smrgcase X$lt_ECHO in
10778c4a8e55SmrgX*--fallback-echo)
10788c4a8e55Smrg  # Remove one level of quotation (which was required for Make).
10798c4a8e55Smrg  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
10808c4a8e55Smrg  ;;
10818c4a8e55Smrgesac
1082b042e37fSmrg
10838c4a8e55SmrgECHO=${lt_ECHO-echo}
10848c4a8e55Smrgif test "X[$]1" = X--no-reexec; then
10858c4a8e55Smrg  # Discard the --no-reexec flag, and continue.
10868c4a8e55Smrg  shift
10878c4a8e55Smrgelif test "X[$]1" = X--fallback-echo; then
10888c4a8e55Smrg  # Avoid inline document here, it may be left over
10898c4a8e55Smrg  :
10908c4a8e55Smrgelif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
10918c4a8e55Smrg  # Yippee, $ECHO works!
10928c4a8e55Smrg  :
10938c4a8e55Smrgelse
10948c4a8e55Smrg  # Restart under the correct shell.
10958c4a8e55Smrg  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
10968c4a8e55Smrgfi
1097b042e37fSmrg
10988c4a8e55Smrgif test "X[$]1" = X--fallback-echo; then
10998c4a8e55Smrg  # used as fallback echo
11008c4a8e55Smrg  shift
11018c4a8e55Smrg  cat <<_LT_EOF
11028c4a8e55Smrg[$]*
11038c4a8e55Smrg_LT_EOF
11048c4a8e55Smrg  exit 0
11058c4a8e55Smrgfi
1106b042e37fSmrg
11078c4a8e55Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
11088c4a8e55Smrg# if CDPATH is set.
11098c4a8e55Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1110b042e37fSmrg
11118c4a8e55Smrgif test -z "$lt_ECHO"; then
11128c4a8e55Smrg  if test "X${echo_test_string+set}" != Xset; then
11138c4a8e55Smrg    # find a string as large as possible, as long as the shell can cope with it
11148c4a8e55Smrg    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
11158c4a8e55Smrg      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
11168c4a8e55Smrg      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
11178c4a8e55Smrg	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
11188c4a8e55Smrg      then
11198c4a8e55Smrg        break
11208c4a8e55Smrg      fi
11218c4a8e55Smrg    done
1122b042e37fSmrg  fi
1123b042e37fSmrg
11248c4a8e55Smrg  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
11258c4a8e55Smrg     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
11268c4a8e55Smrg     test "X$echo_testing_string" = "X$echo_test_string"; then
11278c4a8e55Smrg    :
11288c4a8e55Smrg  else
11298c4a8e55Smrg    # The Solaris, AIX, and Digital Unix default echo programs unquote
11308c4a8e55Smrg    # backslashes.  This makes it impossible to quote backslashes using
11318c4a8e55Smrg    #   echo "$something" | sed 's/\\/\\\\/g'
11328c4a8e55Smrg    #
11338c4a8e55Smrg    # So, first we look for a working echo in the user's PATH.
1134b042e37fSmrg
11358c4a8e55Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
11368c4a8e55Smrg    for dir in $PATH /usr/ucb; do
11378c4a8e55Smrg      IFS="$lt_save_ifs"
11388c4a8e55Smrg      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
11398c4a8e55Smrg         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
11408c4a8e55Smrg         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
11418c4a8e55Smrg         test "X$echo_testing_string" = "X$echo_test_string"; then
11428c4a8e55Smrg        ECHO="$dir/echo"
11438c4a8e55Smrg        break
11448c4a8e55Smrg      fi
11458c4a8e55Smrg    done
1146b042e37fSmrg    IFS="$lt_save_ifs"
1147b042e37fSmrg
11488c4a8e55Smrg    if test "X$ECHO" = Xecho; then
11498c4a8e55Smrg      # We didn't find a better echo, so look for alternatives.
11508c4a8e55Smrg      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
11518c4a8e55Smrg         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
11528c4a8e55Smrg         test "X$echo_testing_string" = "X$echo_test_string"; then
11538c4a8e55Smrg        # This shell has a builtin print -r that does the trick.
11548c4a8e55Smrg        ECHO='print -r'
11558c4a8e55Smrg      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
11568c4a8e55Smrg	   test "X$CONFIG_SHELL" != X/bin/ksh; then
11578c4a8e55Smrg        # If we have ksh, try running configure again with it.
11588c4a8e55Smrg        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
11598c4a8e55Smrg        export ORIGINAL_CONFIG_SHELL
11608c4a8e55Smrg        CONFIG_SHELL=/bin/ksh
11618c4a8e55Smrg        export CONFIG_SHELL
11628c4a8e55Smrg        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1163b042e37fSmrg      else
11648c4a8e55Smrg        # Try using printf.
11658c4a8e55Smrg        ECHO='printf %s\n'
11668c4a8e55Smrg        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
11678c4a8e55Smrg	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
11688c4a8e55Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
11698c4a8e55Smrg	  # Cool, printf works
11708c4a8e55Smrg	  :
11718c4a8e55Smrg        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
11728c4a8e55Smrg	     test "X$echo_testing_string" = 'X\t' &&
11738c4a8e55Smrg	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
11748c4a8e55Smrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
11758c4a8e55Smrg	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
11768c4a8e55Smrg	  export CONFIG_SHELL
11778c4a8e55Smrg	  SHELL="$CONFIG_SHELL"
11788c4a8e55Smrg	  export SHELL
11798c4a8e55Smrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
11808c4a8e55Smrg        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
11818c4a8e55Smrg	     test "X$echo_testing_string" = 'X\t' &&
11828c4a8e55Smrg	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
11838c4a8e55Smrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
11848c4a8e55Smrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
11858c4a8e55Smrg        else
11868c4a8e55Smrg	  # maybe with a smaller string...
11878c4a8e55Smrg	  prev=:
1188b042e37fSmrg
11898c4a8e55Smrg	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
11908c4a8e55Smrg	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
11918c4a8e55Smrg	    then
11928c4a8e55Smrg	      break
11938c4a8e55Smrg	    fi
11948c4a8e55Smrg	    prev="$cmd"
11958c4a8e55Smrg	  done
1196b042e37fSmrg
11978c4a8e55Smrg	  if test "$prev" != 'sed 50q "[$]0"'; then
11988c4a8e55Smrg	    echo_test_string=`eval $prev`
11998c4a8e55Smrg	    export echo_test_string
12008c4a8e55Smrg	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
12018c4a8e55Smrg	  else
12028c4a8e55Smrg	    # Oops.  We lost completely, so just stick with echo.
12038c4a8e55Smrg	    ECHO=echo
12048c4a8e55Smrg	  fi
12058c4a8e55Smrg        fi
1206b042e37fSmrg      fi
1207b042e37fSmrg    fi
1208b042e37fSmrg  fi
1209b042e37fSmrgfi
1210b042e37fSmrg
1211b042e37fSmrg# Copy echo and quote the copy suitably for passing to libtool from
1212b042e37fSmrg# the Makefile, instead of quoting the original, which is used later.
12138c4a8e55Smrglt_ECHO=$ECHO
12148c4a8e55Smrgif test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
12158c4a8e55Smrg   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1216b042e37fSmrgfi
1217b042e37fSmrg
12188c4a8e55SmrgAC_SUBST(lt_ECHO)
12198c4a8e55Smrg])
12208c4a8e55Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
12218c4a8e55Smrg_LT_DECL([], [ECHO], [1],
12228c4a8e55Smrg    [An echo program that does not interpret backslashes])
12238c4a8e55Smrg])# _LT_PROG_ECHO_BACKSLASH
1224b042e37fSmrg
1225b042e37fSmrg
12268c4a8e55Smrg# _LT_ENABLE_LOCK
12278c4a8e55Smrg# ---------------
12288c4a8e55Smrgm4_defun([_LT_ENABLE_LOCK],
1229b042e37fSmrg[AC_ARG_ENABLE([libtool-lock],
12308c4a8e55Smrg  [AS_HELP_STRING([--disable-libtool-lock],
12318c4a8e55Smrg    [avoid locking (might break parallel builds)])])
1232b042e37fSmrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1233b042e37fSmrg
1234b042e37fSmrg# Some flags need to be propagated to the compiler or linker for good
1235b042e37fSmrg# libtool support.
1236b042e37fSmrgcase $host in
1237b042e37fSmrgia64-*-hpux*)
1238b042e37fSmrg  # Find out which ABI we are using.
1239b042e37fSmrg  echo 'int i;' > conftest.$ac_ext
1240b042e37fSmrg  if AC_TRY_EVAL(ac_compile); then
1241b042e37fSmrg    case `/usr/bin/file conftest.$ac_objext` in
12428c4a8e55Smrg      *ELF-32*)
12438c4a8e55Smrg	HPUX_IA64_MODE="32"
12448c4a8e55Smrg	;;
12458c4a8e55Smrg      *ELF-64*)
12468c4a8e55Smrg	HPUX_IA64_MODE="64"
12478c4a8e55Smrg	;;
1248b042e37fSmrg    esac
1249b042e37fSmrg  fi
1250b042e37fSmrg  rm -rf conftest*
1251b042e37fSmrg  ;;
1252b042e37fSmrg*-*-irix6*)
1253b042e37fSmrg  # Find out which ABI we are using.
1254b042e37fSmrg  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1255b042e37fSmrg  if AC_TRY_EVAL(ac_compile); then
12568c4a8e55Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
12578c4a8e55Smrg      case `/usr/bin/file conftest.$ac_objext` in
12588c4a8e55Smrg	*32-bit*)
12598c4a8e55Smrg	  LD="${LD-ld} -melf32bsmip"
12608c4a8e55Smrg	  ;;
12618c4a8e55Smrg	*N32*)
12628c4a8e55Smrg	  LD="${LD-ld} -melf32bmipn32"
12638c4a8e55Smrg	  ;;
12648c4a8e55Smrg	*64-bit*)
12658c4a8e55Smrg	  LD="${LD-ld} -melf64bmip"
12668c4a8e55Smrg	;;
12678c4a8e55Smrg      esac
12688c4a8e55Smrg    else
12698c4a8e55Smrg      case `/usr/bin/file conftest.$ac_objext` in
12708c4a8e55Smrg	*32-bit*)
12718c4a8e55Smrg	  LD="${LD-ld} -32"
12728c4a8e55Smrg	  ;;
12738c4a8e55Smrg	*N32*)
12748c4a8e55Smrg	  LD="${LD-ld} -n32"
12758c4a8e55Smrg	  ;;
12768c4a8e55Smrg	*64-bit*)
12778c4a8e55Smrg	  LD="${LD-ld} -64"
12788c4a8e55Smrg	  ;;
12798c4a8e55Smrg      esac
12808c4a8e55Smrg    fi
1281b042e37fSmrg  fi
1282b042e37fSmrg  rm -rf conftest*
1283b042e37fSmrg  ;;
1284b042e37fSmrg
12858c4a8e55Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
12868c4a8e55Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1287b042e37fSmrg  # Find out which ABI we are using.
1288b042e37fSmrg  echo 'int i;' > conftest.$ac_ext
1289b042e37fSmrg  if AC_TRY_EVAL(ac_compile); then
1290b042e37fSmrg    case `/usr/bin/file conftest.o` in
12918c4a8e55Smrg      *32-bit*)
12928c4a8e55Smrg	case $host in
12938c4a8e55Smrg	  x86_64-*kfreebsd*-gnu)
12948c4a8e55Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
12958c4a8e55Smrg	    ;;
12968c4a8e55Smrg	  x86_64-*linux*)
12978c4a8e55Smrg	    LD="${LD-ld} -m elf_i386"
12988c4a8e55Smrg	    ;;
12998c4a8e55Smrg	  ppc64-*linux*|powerpc64-*linux*)
13008c4a8e55Smrg	    LD="${LD-ld} -m elf32ppclinux"
13018c4a8e55Smrg	    ;;
13028c4a8e55Smrg	  s390x-*linux*)
13038c4a8e55Smrg	    LD="${LD-ld} -m elf_s390"
13048c4a8e55Smrg	    ;;
13058c4a8e55Smrg	  sparc64-*linux*)
13068c4a8e55Smrg	    LD="${LD-ld} -m elf32_sparc"
13078c4a8e55Smrg	    ;;
13088c4a8e55Smrg	esac
13098c4a8e55Smrg	;;
13108c4a8e55Smrg      *64-bit*)
13118c4a8e55Smrg	case $host in
13128c4a8e55Smrg	  x86_64-*kfreebsd*-gnu)
13138c4a8e55Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
13148c4a8e55Smrg	    ;;
13158c4a8e55Smrg	  x86_64-*linux*)
13168c4a8e55Smrg	    LD="${LD-ld} -m elf_x86_64"
13178c4a8e55Smrg	    ;;
13188c4a8e55Smrg	  ppc*-*linux*|powerpc*-*linux*)
13198c4a8e55Smrg	    LD="${LD-ld} -m elf64ppc"
13208c4a8e55Smrg	    ;;
13218c4a8e55Smrg	  s390*-*linux*|s390*-*tpf*)
13228c4a8e55Smrg	    LD="${LD-ld} -m elf64_s390"
13238c4a8e55Smrg	    ;;
13248c4a8e55Smrg	  sparc*-*linux*)
13258c4a8e55Smrg	    LD="${LD-ld} -m elf64_sparc"
13268c4a8e55Smrg	    ;;
13278c4a8e55Smrg	esac
13288c4a8e55Smrg	;;
13298c4a8e55Smrg    esac
13308c4a8e55Smrg  fi
13318c4a8e55Smrg  rm -rf conftest*
13328c4a8e55Smrg  ;;
13338c4a8e55Smrg
13348c4a8e55Smrg*-*-sco3.2v5*)
13358c4a8e55Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1336b042e37fSmrg  SAVE_CFLAGS="$CFLAGS"
1337b042e37fSmrg  CFLAGS="$CFLAGS -belf"
1338b042e37fSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1339b042e37fSmrg    [AC_LANG_PUSH(C)
13408c4a8e55Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1341b042e37fSmrg     AC_LANG_POP])
1342b042e37fSmrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1343b042e37fSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1344b042e37fSmrg    CFLAGS="$SAVE_CFLAGS"
1345b042e37fSmrg  fi
1346b042e37fSmrg  ;;
1347b042e37fSmrgsparc*-*solaris*)
1348b042e37fSmrg  # Find out which ABI we are using.
1349b042e37fSmrg  echo 'int i;' > conftest.$ac_ext
1350b042e37fSmrg  if AC_TRY_EVAL(ac_compile); then
1351b042e37fSmrg    case `/usr/bin/file conftest.o` in
1352b042e37fSmrg    *64-bit*)
1353b042e37fSmrg      case $lt_cv_prog_gnu_ld in
1354b042e37fSmrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
13558c4a8e55Smrg      *)
13568c4a8e55Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
13578c4a8e55Smrg	  LD="${LD-ld} -64"
13588c4a8e55Smrg	fi
13598c4a8e55Smrg	;;
1360b042e37fSmrg      esac
1361b042e37fSmrg      ;;
1362b042e37fSmrg    esac
1363b042e37fSmrg  fi
1364b042e37fSmrg  rm -rf conftest*
1365b042e37fSmrg  ;;
1366b042e37fSmrgesac
1367b042e37fSmrg
1368b042e37fSmrgneed_locks="$enable_libtool_lock"
13698c4a8e55Smrg])# _LT_ENABLE_LOCK
13708c4a8e55Smrg
13718c4a8e55Smrg
13728c4a8e55Smrg# _LT_CMD_OLD_ARCHIVE
13738c4a8e55Smrg# -------------------
13748c4a8e55Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
13758c4a8e55Smrg[AC_CHECK_TOOL(AR, ar, false)
13768c4a8e55Smrgtest -z "$AR" && AR=ar
13778c4a8e55Smrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
13788c4a8e55Smrg_LT_DECL([], [AR], [1], [The archiver])
13798c4a8e55Smrg_LT_DECL([], [AR_FLAGS], [1])
13808c4a8e55Smrg
13818c4a8e55SmrgAC_CHECK_TOOL(STRIP, strip, :)
13828c4a8e55Smrgtest -z "$STRIP" && STRIP=:
13838c4a8e55Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
13848c4a8e55Smrg
13858c4a8e55SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
13868c4a8e55Smrgtest -z "$RANLIB" && RANLIB=:
13878c4a8e55Smrg_LT_DECL([], [RANLIB], [1],
13888c4a8e55Smrg    [Commands used to install an old-style archive])
13898c4a8e55Smrg
13908c4a8e55Smrg# Determine commands to create old-style static archives.
13918c4a8e55Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
13928c4a8e55Smrgold_postinstall_cmds='chmod 644 $oldlib'
13938c4a8e55Smrgold_postuninstall_cmds=
1394b042e37fSmrg
13958c4a8e55Smrgif test -n "$RANLIB"; then
13968c4a8e55Smrg  case $host_os in
13978c4a8e55Smrg  openbsd*)
13988c4a8e55Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
13998c4a8e55Smrg    ;;
14008c4a8e55Smrg  *)
14018c4a8e55Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
14028c4a8e55Smrg    ;;
14038c4a8e55Smrg  esac
14048c4a8e55Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
14058c4a8e55Smrgfi
14068c4a8e55Smrg_LT_DECL([], [old_postinstall_cmds], [2])
14078c4a8e55Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
14088c4a8e55Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
14098c4a8e55Smrg    [Commands used to build an old-style archive])
14108c4a8e55Smrg])# _LT_CMD_OLD_ARCHIVE
1411b042e37fSmrg
1412b042e37fSmrg
14138c4a8e55Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1414b042e37fSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1415b042e37fSmrg# ----------------------------------------------------------------
1416b042e37fSmrg# Check whether the given compiler option works
14178c4a8e55SmrgAC_DEFUN([_LT_COMPILER_OPTION],
14188c4a8e55Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
14198c4a8e55Smrgm4_require([_LT_DECL_SED])dnl
1420b042e37fSmrgAC_CACHE_CHECK([$1], [$2],
1421b042e37fSmrg  [$2=no
14228c4a8e55Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
14238c4a8e55Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1424b042e37fSmrg   lt_compiler_flag="$3"
1425b042e37fSmrg   # Insert the option either (1) after the last *FLAGS variable, or
1426b042e37fSmrg   # (2) before a word containing "conftest.", or (3) at the end.
1427b042e37fSmrg   # Note that $ac_compile itself does not contain backslashes and begins
1428b042e37fSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1429b042e37fSmrg   # The option is referenced via a variable to avoid confusing sed.
1430b042e37fSmrg   lt_compile=`echo "$ac_compile" | $SED \
1431b042e37fSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1432b042e37fSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1433b042e37fSmrg   -e 's:$: $lt_compiler_flag:'`
1434b042e37fSmrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1435b042e37fSmrg   (eval "$lt_compile" 2>conftest.err)
1436b042e37fSmrg   ac_status=$?
1437b042e37fSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
1438b042e37fSmrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1439b042e37fSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1440b042e37fSmrg     # The compiler can only warn and ignore the option if not recognized
1441b042e37fSmrg     # So say no if there are warnings other than the usual output.
14428c4a8e55Smrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
1443b042e37fSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1444b042e37fSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1445b042e37fSmrg       $2=yes
1446b042e37fSmrg     fi
1447b042e37fSmrg   fi
14488c4a8e55Smrg   $RM conftest*
1449b042e37fSmrg])
1450b042e37fSmrg
1451b042e37fSmrgif test x"[$]$2" = xyes; then
14528c4a8e55Smrg    m4_if([$5], , :, [$5])
1453b042e37fSmrgelse
14548c4a8e55Smrg    m4_if([$6], , :, [$6])
1455b042e37fSmrgfi
14568c4a8e55Smrg])# _LT_COMPILER_OPTION
1457b042e37fSmrg
14588c4a8e55Smrg# Old name:
14598c4a8e55SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
14608c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
14618c4a8e55Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1462b042e37fSmrg
14638c4a8e55Smrg
14648c4a8e55Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
14658c4a8e55Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
14668c4a8e55Smrg# ----------------------------------------------------
14678c4a8e55Smrg# Check whether the given linker option works
14688c4a8e55SmrgAC_DEFUN([_LT_LINKER_OPTION],
14698c4a8e55Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
14708c4a8e55Smrgm4_require([_LT_DECL_SED])dnl
14718c4a8e55SmrgAC_CACHE_CHECK([$1], [$2],
1472b042e37fSmrg  [$2=no
1473b042e37fSmrg   save_LDFLAGS="$LDFLAGS"
1474b042e37fSmrg   LDFLAGS="$LDFLAGS $3"
14758c4a8e55Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1476b042e37fSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1477b042e37fSmrg     # The linker can only warn and ignore the option if not recognized
1478b042e37fSmrg     # So say no if there are warnings
1479b042e37fSmrg     if test -s conftest.err; then
1480b042e37fSmrg       # Append any errors to the config.log.
1481b042e37fSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
14828c4a8e55Smrg       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
1483b042e37fSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1484b042e37fSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
1485b042e37fSmrg         $2=yes
1486b042e37fSmrg       fi
1487b042e37fSmrg     else
1488b042e37fSmrg       $2=yes
1489b042e37fSmrg     fi
1490b042e37fSmrg   fi
14918c4a8e55Smrg   $RM -r conftest*
1492b042e37fSmrg   LDFLAGS="$save_LDFLAGS"
1493b042e37fSmrg])
1494b042e37fSmrg
1495b042e37fSmrgif test x"[$]$2" = xyes; then
14968c4a8e55Smrg    m4_if([$4], , :, [$4])
1497b042e37fSmrgelse
14988c4a8e55Smrg    m4_if([$5], , :, [$5])
1499b042e37fSmrgfi
15008c4a8e55Smrg])# _LT_LINKER_OPTION
1501b042e37fSmrg
15028c4a8e55Smrg# Old name:
15038c4a8e55SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
15048c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
15058c4a8e55Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1506b042e37fSmrg
15078c4a8e55Smrg
15088c4a8e55Smrg# LT_CMD_MAX_LEN
15098c4a8e55Smrg#---------------
15108c4a8e55SmrgAC_DEFUN([LT_CMD_MAX_LEN],
15118c4a8e55Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
15128c4a8e55Smrg# find the maximum length of command line arguments
1513b042e37fSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
1514b042e37fSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1515b042e37fSmrg  i=0
1516b042e37fSmrg  teststring="ABCD"
1517b042e37fSmrg
1518b042e37fSmrg  case $build_os in
1519b042e37fSmrg  msdosdjgpp*)
1520b042e37fSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
1521b042e37fSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
1522b042e37fSmrg    # during glob expansion).  Even if it were fixed, the result of this
1523b042e37fSmrg    # check would be larger than it should be.
1524b042e37fSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1525b042e37fSmrg    ;;
1526b042e37fSmrg
1527b042e37fSmrg  gnu*)
1528b042e37fSmrg    # Under GNU Hurd, this test is not required because there is
1529b042e37fSmrg    # no limit to the length of command line arguments.
1530b042e37fSmrg    # Libtool will interpret -1 as no limit whatsoever
1531b042e37fSmrg    lt_cv_sys_max_cmd_len=-1;
1532b042e37fSmrg    ;;
1533b042e37fSmrg
15348c4a8e55Smrg  cygwin* | mingw* | cegcc*)
1535b042e37fSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
1536b042e37fSmrg    # about 5 minutes as the teststring grows exponentially.
1537b042e37fSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
1538b042e37fSmrg    # you end up with a "frozen" computer, even though with patience
1539b042e37fSmrg    # the test eventually succeeds (with a max line length of 256k).
1540b042e37fSmrg    # Instead, let's just punt: use the minimum linelength reported by
1541b042e37fSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
1542b042e37fSmrg    lt_cv_sys_max_cmd_len=8192;
1543b042e37fSmrg    ;;
1544b042e37fSmrg
1545b042e37fSmrg  amigaos*)
1546b042e37fSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
1547b042e37fSmrg    # So we just punt and use a minimum line length of 8192.
1548b042e37fSmrg    lt_cv_sys_max_cmd_len=8192;
1549b042e37fSmrg    ;;
1550b042e37fSmrg
1551b042e37fSmrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1552b042e37fSmrg    # This has been around since 386BSD, at least.  Likely further.
1553b042e37fSmrg    if test -x /sbin/sysctl; then
1554b042e37fSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1555b042e37fSmrg    elif test -x /usr/sbin/sysctl; then
1556b042e37fSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1557b042e37fSmrg    else
1558b042e37fSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1559b042e37fSmrg    fi
1560b042e37fSmrg    # And add a safety zone
1561b042e37fSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1562b042e37fSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1563b042e37fSmrg    ;;
1564b042e37fSmrg
1565b042e37fSmrg  interix*)
1566b042e37fSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1567b042e37fSmrg    lt_cv_sys_max_cmd_len=196608
1568b042e37fSmrg    ;;
1569b042e37fSmrg
1570b042e37fSmrg  osf*)
1571b042e37fSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1572b042e37fSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1573b042e37fSmrg    # nice to cause kernel panics so lets avoid the loop below.
1574b042e37fSmrg    # First set a reasonable default.
1575b042e37fSmrg    lt_cv_sys_max_cmd_len=16384
1576b042e37fSmrg    #
1577b042e37fSmrg    if test -x /sbin/sysconfig; then
1578b042e37fSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1579b042e37fSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1580b042e37fSmrg      esac
1581b042e37fSmrg    fi
1582b042e37fSmrg    ;;
1583b042e37fSmrg  sco3.2v5*)
1584b042e37fSmrg    lt_cv_sys_max_cmd_len=102400
1585b042e37fSmrg    ;;
1586b042e37fSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
1587b042e37fSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1588b042e37fSmrg    if test -n "$kargmax"; then
15898c4a8e55Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1590b042e37fSmrg    else
1591b042e37fSmrg      lt_cv_sys_max_cmd_len=32768
1592b042e37fSmrg    fi
1593b042e37fSmrg    ;;
1594b042e37fSmrg  *)
15958c4a8e55Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
15968c4a8e55Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
15978c4a8e55Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
15988c4a8e55Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
15998c4a8e55Smrg    else
16008c4a8e55Smrg      # Make teststring a little bigger before we do anything with it.
16018c4a8e55Smrg      # a 1K string should be a reasonable start.
16028c4a8e55Smrg      for i in 1 2 3 4 5 6 7 8 ; do
16038c4a8e55Smrg        teststring=$teststring$teststring
16048c4a8e55Smrg      done
16058c4a8e55Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
16068c4a8e55Smrg      # If test is not a shell built-in, we'll probably end up computing a
16078c4a8e55Smrg      # maximum length that is only half of the actual maximum length, but
16088c4a8e55Smrg      # we can't tell.
16098c4a8e55Smrg      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
16108c4a8e55Smrg	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
16118c4a8e55Smrg	      test $i != 17 # 1/2 MB should be enough
16128c4a8e55Smrg      do
16138c4a8e55Smrg        i=`expr $i + 1`
16148c4a8e55Smrg        teststring=$teststring$teststring
16158c4a8e55Smrg      done
16168c4a8e55Smrg      # Only check the string length outside the loop.
16178c4a8e55Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
16188c4a8e55Smrg      teststring=
16198c4a8e55Smrg      # Add a significant safety factor because C++ compilers can tack on
16208c4a8e55Smrg      # massive amounts of additional arguments before passing them to the
16218c4a8e55Smrg      # linker.  It appears as though 1/2 is a usable value.
16228c4a8e55Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
16238c4a8e55Smrg    fi
1624b042e37fSmrg    ;;
1625b042e37fSmrg  esac
1626b042e37fSmrg])
1627b042e37fSmrgif test -n $lt_cv_sys_max_cmd_len ; then
1628b042e37fSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1629b042e37fSmrgelse
1630b042e37fSmrg  AC_MSG_RESULT(none)
1631b042e37fSmrgfi
16328c4a8e55Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
16338c4a8e55Smrg_LT_DECL([], [max_cmd_len], [0],
16348c4a8e55Smrg    [What is the maximum length of a command?])
16358c4a8e55Smrg])# LT_CMD_MAX_LEN
1636b042e37fSmrg
16378c4a8e55Smrg# Old name:
16388c4a8e55SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
16398c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
16408c4a8e55Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1641b042e37fSmrg
16428c4a8e55Smrg
16438c4a8e55Smrg# _LT_HEADER_DLFCN
16448c4a8e55Smrg# ----------------
16458c4a8e55Smrgm4_defun([_LT_HEADER_DLFCN],
16468c4a8e55Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
16478c4a8e55Smrg])# _LT_HEADER_DLFCN
1648b042e37fSmrg
1649b042e37fSmrg
16508c4a8e55Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
16518c4a8e55Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
16528c4a8e55Smrg# ----------------------------------------------------------------
16538c4a8e55Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
16548c4a8e55Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1655b042e37fSmrgif test "$cross_compiling" = yes; then :
1656b042e37fSmrg  [$4]
1657b042e37fSmrgelse
1658b042e37fSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1659b042e37fSmrg  lt_status=$lt_dlunknown
16608c4a8e55Smrg  cat > conftest.$ac_ext <<_LT_EOF
1661b042e37fSmrg[#line __oline__ "configure"
1662b042e37fSmrg#include "confdefs.h"
1663b042e37fSmrg
1664b042e37fSmrg#if HAVE_DLFCN_H
1665b042e37fSmrg#include <dlfcn.h>
1666b042e37fSmrg#endif
1667b042e37fSmrg
1668b042e37fSmrg#include <stdio.h>
1669b042e37fSmrg
1670b042e37fSmrg#ifdef RTLD_GLOBAL
1671b042e37fSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
1672b042e37fSmrg#else
1673b042e37fSmrg#  ifdef DL_GLOBAL
1674b042e37fSmrg#    define LT_DLGLOBAL		DL_GLOBAL
1675b042e37fSmrg#  else
1676b042e37fSmrg#    define LT_DLGLOBAL		0
1677b042e37fSmrg#  endif
1678b042e37fSmrg#endif
1679b042e37fSmrg
1680b042e37fSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1681b042e37fSmrg   find out it does not work in some platform. */
1682b042e37fSmrg#ifndef LT_DLLAZY_OR_NOW
1683b042e37fSmrg#  ifdef RTLD_LAZY
1684b042e37fSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1685b042e37fSmrg#  else
1686b042e37fSmrg#    ifdef DL_LAZY
1687b042e37fSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
1688b042e37fSmrg#    else
1689b042e37fSmrg#      ifdef RTLD_NOW
1690b042e37fSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1691b042e37fSmrg#      else
1692b042e37fSmrg#        ifdef DL_NOW
1693b042e37fSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
1694b042e37fSmrg#        else
1695b042e37fSmrg#          define LT_DLLAZY_OR_NOW	0
1696b042e37fSmrg#        endif
1697b042e37fSmrg#      endif
1698b042e37fSmrg#    endif
1699b042e37fSmrg#  endif
1700b042e37fSmrg#endif
1701b042e37fSmrg
1702b042e37fSmrgvoid fnord() { int i=42;}
1703b042e37fSmrgint main ()
1704b042e37fSmrg{
1705b042e37fSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1706b042e37fSmrg  int status = $lt_dlunknown;
1707b042e37fSmrg
1708b042e37fSmrg  if (self)
1709b042e37fSmrg    {
1710b042e37fSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1711b042e37fSmrg      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1712b042e37fSmrg      /* dlclose (self); */
1713b042e37fSmrg    }
1714b042e37fSmrg  else
1715b042e37fSmrg    puts (dlerror ());
1716b042e37fSmrg
17178c4a8e55Smrg  return status;
1718b042e37fSmrg}]
17198c4a8e55Smrg_LT_EOF
1720b042e37fSmrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1721b042e37fSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1722b042e37fSmrg    lt_status=$?
1723b042e37fSmrg    case x$lt_status in
1724b042e37fSmrg      x$lt_dlno_uscore) $1 ;;
1725b042e37fSmrg      x$lt_dlneed_uscore) $2 ;;
1726b042e37fSmrg      x$lt_dlunknown|x*) $3 ;;
1727b042e37fSmrg    esac
1728b042e37fSmrg  else :
1729b042e37fSmrg    # compilation failed
1730b042e37fSmrg    $3
1731b042e37fSmrg  fi
1732b042e37fSmrgfi
1733b042e37fSmrgrm -fr conftest*
17348c4a8e55Smrg])# _LT_TRY_DLOPEN_SELF
1735b042e37fSmrg
1736b042e37fSmrg
17378c4a8e55Smrg# LT_SYS_DLOPEN_SELF
17388c4a8e55Smrg# ------------------
17398c4a8e55SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
17408c4a8e55Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1741b042e37fSmrgif test "x$enable_dlopen" != xyes; then
1742b042e37fSmrg  enable_dlopen=unknown
1743b042e37fSmrg  enable_dlopen_self=unknown
1744b042e37fSmrg  enable_dlopen_self_static=unknown
1745b042e37fSmrgelse
1746b042e37fSmrg  lt_cv_dlopen=no
1747b042e37fSmrg  lt_cv_dlopen_libs=
1748b042e37fSmrg
1749b042e37fSmrg  case $host_os in
1750b042e37fSmrg  beos*)
1751b042e37fSmrg    lt_cv_dlopen="load_add_on"
1752b042e37fSmrg    lt_cv_dlopen_libs=
1753b042e37fSmrg    lt_cv_dlopen_self=yes
1754b042e37fSmrg    ;;
1755b042e37fSmrg
17568c4a8e55Smrg  mingw* | pw32* | cegcc*)
1757b042e37fSmrg    lt_cv_dlopen="LoadLibrary"
1758b042e37fSmrg    lt_cv_dlopen_libs=
17598c4a8e55Smrg    ;;
1760b042e37fSmrg
1761b042e37fSmrg  cygwin*)
1762b042e37fSmrg    lt_cv_dlopen="dlopen"
1763b042e37fSmrg    lt_cv_dlopen_libs=
17648c4a8e55Smrg    ;;
1765b042e37fSmrg
1766b042e37fSmrg  darwin*)
1767b042e37fSmrg  # if libdl is installed we need to link against it
1768b042e37fSmrg    AC_CHECK_LIB([dl], [dlopen],
1769b042e37fSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1770b042e37fSmrg    lt_cv_dlopen="dyld"
1771b042e37fSmrg    lt_cv_dlopen_libs=
1772b042e37fSmrg    lt_cv_dlopen_self=yes
1773b042e37fSmrg    ])
17748c4a8e55Smrg    ;;
1775b042e37fSmrg
1776b042e37fSmrg  *)
1777b042e37fSmrg    AC_CHECK_FUNC([shl_load],
1778b042e37fSmrg	  [lt_cv_dlopen="shl_load"],
1779b042e37fSmrg      [AC_CHECK_LIB([dld], [shl_load],
17808c4a8e55Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1781b042e37fSmrg	[AC_CHECK_FUNC([dlopen],
1782b042e37fSmrg	      [lt_cv_dlopen="dlopen"],
1783b042e37fSmrg	  [AC_CHECK_LIB([dl], [dlopen],
1784b042e37fSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1785b042e37fSmrg	    [AC_CHECK_LIB([svld], [dlopen],
1786b042e37fSmrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1787b042e37fSmrg	      [AC_CHECK_LIB([dld], [dld_link],
17888c4a8e55Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1789b042e37fSmrg	      ])
1790b042e37fSmrg	    ])
1791b042e37fSmrg	  ])
1792b042e37fSmrg	])
1793b042e37fSmrg      ])
1794b042e37fSmrg    ;;
1795b042e37fSmrg  esac
1796b042e37fSmrg
1797b042e37fSmrg  if test "x$lt_cv_dlopen" != xno; then
1798b042e37fSmrg    enable_dlopen=yes
1799b042e37fSmrg  else
1800b042e37fSmrg    enable_dlopen=no
1801b042e37fSmrg  fi
1802b042e37fSmrg
1803b042e37fSmrg  case $lt_cv_dlopen in
1804b042e37fSmrg  dlopen)
1805b042e37fSmrg    save_CPPFLAGS="$CPPFLAGS"
1806b042e37fSmrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1807b042e37fSmrg
1808b042e37fSmrg    save_LDFLAGS="$LDFLAGS"
1809b042e37fSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1810b042e37fSmrg
1811b042e37fSmrg    save_LIBS="$LIBS"
1812b042e37fSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
1813b042e37fSmrg
1814b042e37fSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
1815b042e37fSmrg	  lt_cv_dlopen_self, [dnl
18168c4a8e55Smrg	  _LT_TRY_DLOPEN_SELF(
1817b042e37fSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1818b042e37fSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1819b042e37fSmrg    ])
1820b042e37fSmrg
1821b042e37fSmrg    if test "x$lt_cv_dlopen_self" = xyes; then
1822b042e37fSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1823b042e37fSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
18248c4a8e55Smrg	  lt_cv_dlopen_self_static, [dnl
18258c4a8e55Smrg	  _LT_TRY_DLOPEN_SELF(
1826b042e37fSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1827b042e37fSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1828b042e37fSmrg      ])
1829b042e37fSmrg    fi
1830b042e37fSmrg
1831b042e37fSmrg    CPPFLAGS="$save_CPPFLAGS"
1832b042e37fSmrg    LDFLAGS="$save_LDFLAGS"
1833b042e37fSmrg    LIBS="$save_LIBS"
1834b042e37fSmrg    ;;
1835b042e37fSmrg  esac
1836b042e37fSmrg
1837b042e37fSmrg  case $lt_cv_dlopen_self in
1838b042e37fSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1839b042e37fSmrg  *) enable_dlopen_self=unknown ;;
1840b042e37fSmrg  esac
1841b042e37fSmrg
1842b042e37fSmrg  case $lt_cv_dlopen_self_static in
1843b042e37fSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1844b042e37fSmrg  *) enable_dlopen_self_static=unknown ;;
1845b042e37fSmrg  esac
1846b042e37fSmrgfi
18478c4a8e55Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
18488c4a8e55Smrg	 [Whether dlopen is supported])
18498c4a8e55Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
18508c4a8e55Smrg	 [Whether dlopen of programs is supported])
18518c4a8e55Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
18528c4a8e55Smrg	 [Whether dlopen of statically linked programs is supported])
18538c4a8e55Smrg])# LT_SYS_DLOPEN_SELF
1854b042e37fSmrg
18558c4a8e55Smrg# Old name:
18568c4a8e55SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
18578c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
18588c4a8e55Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1859b042e37fSmrg
18608c4a8e55Smrg
18618c4a8e55Smrg# _LT_COMPILER_C_O([TAGNAME])
18628c4a8e55Smrg# ---------------------------
18638c4a8e55Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
18648c4a8e55Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
18658c4a8e55Smrgm4_defun([_LT_COMPILER_C_O],
18668c4a8e55Smrg[m4_require([_LT_DECL_SED])dnl
18678c4a8e55Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
18688c4a8e55Smrgm4_require([_LT_TAG_COMPILER])dnl
1869b042e37fSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
18708c4a8e55Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
18718c4a8e55Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
18728c4a8e55Smrg   $RM -r conftest 2>/dev/null
1873b042e37fSmrg   mkdir conftest
1874b042e37fSmrg   cd conftest
1875b042e37fSmrg   mkdir out
18768c4a8e55Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1877b042e37fSmrg
1878b042e37fSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
1879b042e37fSmrg   # Insert the option either (1) after the last *FLAGS variable, or
1880b042e37fSmrg   # (2) before a word containing "conftest.", or (3) at the end.
1881b042e37fSmrg   # Note that $ac_compile itself does not contain backslashes and begins
1882b042e37fSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1883b042e37fSmrg   lt_compile=`echo "$ac_compile" | $SED \
1884b042e37fSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1885b042e37fSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1886b042e37fSmrg   -e 's:$: $lt_compiler_flag:'`
1887b042e37fSmrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1888b042e37fSmrg   (eval "$lt_compile" 2>out/conftest.err)
1889b042e37fSmrg   ac_status=$?
1890b042e37fSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
1891b042e37fSmrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1892b042e37fSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
1893b042e37fSmrg   then
1894b042e37fSmrg     # The compiler can only warn and ignore the option if not recognized
1895b042e37fSmrg     # So say no if there are warnings
18968c4a8e55Smrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
1897b042e37fSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
1898b042e37fSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
18998c4a8e55Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
1900b042e37fSmrg     fi
1901b042e37fSmrg   fi
1902b042e37fSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
19038c4a8e55Smrg   $RM conftest*
1904b042e37fSmrg   # SGI C++ compiler will create directory out/ii_files/ for
1905b042e37fSmrg   # template instantiation
19068c4a8e55Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
19078c4a8e55Smrg   $RM out/* && rmdir out
1908b042e37fSmrg   cd ..
19098c4a8e55Smrg   $RM -r conftest
19108c4a8e55Smrg   $RM conftest*
1911b042e37fSmrg])
19128c4a8e55Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
19138c4a8e55Smrg	[Does compiler simultaneously support -c and -o options?])
19148c4a8e55Smrg])# _LT_COMPILER_C_O
1915b042e37fSmrg
1916b042e37fSmrg
19178c4a8e55Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
19188c4a8e55Smrg# ----------------------------------
1919b042e37fSmrg# Check to see if we can do hard links to lock some files if needed
19208c4a8e55Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
19218c4a8e55Smrg[m4_require([_LT_ENABLE_LOCK])dnl
19228c4a8e55Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
19238c4a8e55Smrg_LT_COMPILER_C_O([$1])
1924b042e37fSmrg
1925b042e37fSmrghard_links="nottested"
19268c4a8e55Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
1927b042e37fSmrg  # do not overwrite the value of need_locks provided by the user
1928b042e37fSmrg  AC_MSG_CHECKING([if we can lock with hard links])
1929b042e37fSmrg  hard_links=yes
19308c4a8e55Smrg  $RM conftest*
1931b042e37fSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1932b042e37fSmrg  touch conftest.a
1933b042e37fSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
1934b042e37fSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1935b042e37fSmrg  AC_MSG_RESULT([$hard_links])
1936b042e37fSmrg  if test "$hard_links" = no; then
1937b042e37fSmrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
1938b042e37fSmrg    need_locks=warn
1939b042e37fSmrg  fi
1940b042e37fSmrgelse
1941b042e37fSmrg  need_locks=no
1942b042e37fSmrgfi
19438c4a8e55Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
19448c4a8e55Smrg])# _LT_COMPILER_FILE_LOCKS
1945b042e37fSmrg
1946b042e37fSmrg
19478c4a8e55Smrg# _LT_CHECK_OBJDIR
19488c4a8e55Smrg# ----------------
19498c4a8e55Smrgm4_defun([_LT_CHECK_OBJDIR],
1950b042e37fSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1951b042e37fSmrg[rm -f .libs 2>/dev/null
1952b042e37fSmrgmkdir .libs 2>/dev/null
1953b042e37fSmrgif test -d .libs; then
1954b042e37fSmrg  lt_cv_objdir=.libs
1955b042e37fSmrgelse
1956b042e37fSmrg  # MS-DOS does not allow filenames that begin with a dot.
1957b042e37fSmrg  lt_cv_objdir=_libs
1958b042e37fSmrgfi
1959b042e37fSmrgrmdir .libs 2>/dev/null])
1960b042e37fSmrgobjdir=$lt_cv_objdir
19618c4a8e55Smrg_LT_DECL([], [objdir], [0],
19628c4a8e55Smrg         [The name of the directory that contains temporary libtool files])dnl
19638c4a8e55Smrgm4_pattern_allow([LT_OBJDIR])dnl
19648c4a8e55SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
19658c4a8e55Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
19668c4a8e55Smrg])# _LT_CHECK_OBJDIR
1967b042e37fSmrg
1968b042e37fSmrg
19698c4a8e55Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
19708c4a8e55Smrg# --------------------------------------
1971b042e37fSmrg# Check hardcoding attributes.
19728c4a8e55Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
1973b042e37fSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
19748c4a8e55Smrg_LT_TAGVAR(hardcode_action, $1)=
19758c4a8e55Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
19768c4a8e55Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
19778c4a8e55Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
1978b042e37fSmrg
19798c4a8e55Smrg  # We can hardcode non-existent directories.
19808c4a8e55Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
1981b042e37fSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
1982b042e37fSmrg     # have to relink, otherwise we might link with an installed library
1983b042e37fSmrg     # when we should be linking with a yet-to-be-installed one
19848c4a8e55Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
19858c4a8e55Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
1986b042e37fSmrg    # Linking always hardcodes the temporary library directory.
19878c4a8e55Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
1988b042e37fSmrg  else
1989b042e37fSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
19908c4a8e55Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
1991b042e37fSmrg  fi
1992b042e37fSmrgelse
1993b042e37fSmrg  # We cannot hardcode anything, or else we can only hardcode existing
1994b042e37fSmrg  # directories.
19958c4a8e55Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
1996b042e37fSmrgfi
19978c4a8e55SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
1998b042e37fSmrg
19998c4a8e55Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
20008c4a8e55Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
2001b042e37fSmrg  # Fast installation is not supported
2002b042e37fSmrg  enable_fast_install=no
2003b042e37fSmrgelif test "$shlibpath_overrides_runpath" = yes ||
2004b042e37fSmrg     test "$enable_shared" = no; then
2005b042e37fSmrg  # Fast installation is not necessary
2006b042e37fSmrg  enable_fast_install=needless
2007b042e37fSmrgfi
20088c4a8e55Smrg_LT_TAGDECL([], [hardcode_action], [0],
20098c4a8e55Smrg    [How to hardcode a shared library path into an executable])
20108c4a8e55Smrg])# _LT_LINKER_HARDCODE_LIBPATH
2011b042e37fSmrg
2012b042e37fSmrg
20138c4a8e55Smrg# _LT_CMD_STRIPLIB
20148c4a8e55Smrg# ----------------
20158c4a8e55Smrgm4_defun([_LT_CMD_STRIPLIB],
20168c4a8e55Smrg[m4_require([_LT_DECL_EGREP])
20178c4a8e55Smrgstriplib=
2018b042e37fSmrgold_striplib=
2019b042e37fSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
20208c4a8e55Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2021b042e37fSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2022b042e37fSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2023b042e37fSmrg  AC_MSG_RESULT([yes])
2024b042e37fSmrgelse
2025b042e37fSmrg# FIXME - insert some real tests, host_os isn't really good enough
2026b042e37fSmrg  case $host_os in
20278c4a8e55Smrg  darwin*)
20288c4a8e55Smrg    if test -n "$STRIP" ; then
20298c4a8e55Smrg      striplib="$STRIP -x"
20308c4a8e55Smrg      old_striplib="$STRIP -S"
20318c4a8e55Smrg      AC_MSG_RESULT([yes])
20328c4a8e55Smrg    else
20338c4a8e55Smrg      AC_MSG_RESULT([no])
20348c4a8e55Smrg    fi
20358c4a8e55Smrg    ;;
20368c4a8e55Smrg  *)
20378c4a8e55Smrg    AC_MSG_RESULT([no])
2038b042e37fSmrg    ;;
2039b042e37fSmrg  esac
2040b042e37fSmrgfi
20418c4a8e55Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
20428c4a8e55Smrg_LT_DECL([], [striplib], [1])
20438c4a8e55Smrg])# _LT_CMD_STRIPLIB
2044b042e37fSmrg
2045b042e37fSmrg
20468c4a8e55Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
2047b042e37fSmrg# -----------------------------
2048b042e37fSmrg# PORTME Fill in your ld.so characteristics
20498c4a8e55Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
20508c4a8e55Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
20518c4a8e55Smrgm4_require([_LT_DECL_EGREP])dnl
20528c4a8e55Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
20538c4a8e55Smrgm4_require([_LT_DECL_OBJDUMP])dnl
20548c4a8e55Smrgm4_require([_LT_DECL_SED])dnl
20558c4a8e55SmrgAC_MSG_CHECKING([dynamic linker characteristics])
20568c4a8e55Smrgm4_if([$1],
20578c4a8e55Smrg	[], [
20588c4a8e55Smrgif test "$GCC" = yes; then
20598c4a8e55Smrg  case $host_os in
20608c4a8e55Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
20618c4a8e55Smrg    *) lt_awk_arg="/^libraries:/" ;;
20628c4a8e55Smrg  esac
20638c4a8e55Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
20648c4a8e55Smrg  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
20658c4a8e55Smrg    # if the path contains ";" then we assume it to be the separator
20668c4a8e55Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
20678c4a8e55Smrg    # assumed that no part of a normal pathname contains ";" but that should
20688c4a8e55Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
20698c4a8e55Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
20708c4a8e55Smrg  else
20718c4a8e55Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
20728c4a8e55Smrg  fi
20738c4a8e55Smrg  # Ok, now we have the path, separated by spaces, we can step through it
20748c4a8e55Smrg  # and add multilib dir if necessary.
20758c4a8e55Smrg  lt_tmp_lt_search_path_spec=
20768c4a8e55Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
20778c4a8e55Smrg  for lt_sys_path in $lt_search_path_spec; do
20788c4a8e55Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
20798c4a8e55Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
20808c4a8e55Smrg    else
20818c4a8e55Smrg      test -d "$lt_sys_path" && \
20828c4a8e55Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
20838c4a8e55Smrg    fi
20848c4a8e55Smrg  done
20858c4a8e55Smrg  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
20868c4a8e55SmrgBEGIN {RS=" "; FS="/|\n";} {
20878c4a8e55Smrg  lt_foo="";
20888c4a8e55Smrg  lt_count=0;
20898c4a8e55Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
20908c4a8e55Smrg    if ($lt_i != "" && $lt_i != ".") {
20918c4a8e55Smrg      if ($lt_i == "..") {
20928c4a8e55Smrg        lt_count++;
20938c4a8e55Smrg      } else {
20948c4a8e55Smrg        if (lt_count == 0) {
20958c4a8e55Smrg          lt_foo="/" $lt_i lt_foo;
20968c4a8e55Smrg        } else {
20978c4a8e55Smrg          lt_count--;
20988c4a8e55Smrg        }
20998c4a8e55Smrg      }
21008c4a8e55Smrg    }
21018c4a8e55Smrg  }
21028c4a8e55Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
21038c4a8e55Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
21048c4a8e55Smrg}'`
21058c4a8e55Smrg  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
21068c4a8e55Smrgelse
21078c4a8e55Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
21088c4a8e55Smrgfi])
2109b042e37fSmrglibrary_names_spec=
2110b042e37fSmrglibname_spec='lib$name'
2111b042e37fSmrgsoname_spec=
2112b042e37fSmrgshrext_cmds=".so"
2113b042e37fSmrgpostinstall_cmds=
2114b042e37fSmrgpostuninstall_cmds=
2115b042e37fSmrgfinish_cmds=
2116b042e37fSmrgfinish_eval=
2117b042e37fSmrgshlibpath_var=
2118b042e37fSmrgshlibpath_overrides_runpath=unknown
2119b042e37fSmrgversion_type=none
2120b042e37fSmrgdynamic_linker="$host_os ld.so"
2121b042e37fSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
2122b042e37fSmrgneed_lib_prefix=unknown
2123b042e37fSmrghardcode_into_libs=no
2124b042e37fSmrg
2125b042e37fSmrg# when you set need_version to no, make sure it does not cause -set_version
2126b042e37fSmrg# flags to be left without arguments
2127b042e37fSmrgneed_version=unknown
2128b042e37fSmrg
2129b042e37fSmrgcase $host_os in
2130b042e37fSmrgaix3*)
2131b042e37fSmrg  version_type=linux
2132b042e37fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2133b042e37fSmrg  shlibpath_var=LIBPATH
2134b042e37fSmrg
2135b042e37fSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
2136b042e37fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2137b042e37fSmrg  ;;
2138b042e37fSmrg
21398c4a8e55Smrgaix[[4-9]]*)
2140b042e37fSmrg  version_type=linux
2141b042e37fSmrg  need_lib_prefix=no
2142b042e37fSmrg  need_version=no
2143b042e37fSmrg  hardcode_into_libs=yes
2144b042e37fSmrg  if test "$host_cpu" = ia64; then
2145b042e37fSmrg    # AIX 5 supports IA64
2146b042e37fSmrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2147b042e37fSmrg    shlibpath_var=LD_LIBRARY_PATH
2148b042e37fSmrg  else
2149b042e37fSmrg    # With GCC up to 2.95.x, collect2 would create an import file
2150b042e37fSmrg    # for dependence libraries.  The import file would start with
2151b042e37fSmrg    # the line `#! .'.  This would cause the generated library to
2152b042e37fSmrg    # depend on `.', always an invalid library.  This was fixed in
2153b042e37fSmrg    # development snapshots of GCC prior to 3.0.
2154b042e37fSmrg    case $host_os in
2155b042e37fSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
2156b042e37fSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2157b042e37fSmrg	   echo ' yes '
21588c4a8e55Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2159b042e37fSmrg	:
2160b042e37fSmrg      else
2161b042e37fSmrg	can_build_shared=no
2162b042e37fSmrg      fi
2163b042e37fSmrg      ;;
2164b042e37fSmrg    esac
2165b042e37fSmrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2166b042e37fSmrg    # soname into executable. Probably we can add versioning support to
2167b042e37fSmrg    # collect2, so additional links can be useful in future.
2168b042e37fSmrg    if test "$aix_use_runtimelinking" = yes; then
2169b042e37fSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2170b042e37fSmrg      # instead of lib<name>.a to let people know that these are not
2171b042e37fSmrg      # typical AIX shared libraries.
2172b042e37fSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2173b042e37fSmrg    else
2174b042e37fSmrg      # We preserve .a as extension for shared libraries through AIX4.2
2175b042e37fSmrg      # and later when we are not doing run time linking.
2176b042e37fSmrg      library_names_spec='${libname}${release}.a $libname.a'
2177b042e37fSmrg      soname_spec='${libname}${release}${shared_ext}$major'
2178b042e37fSmrg    fi
2179b042e37fSmrg    shlibpath_var=LIBPATH
2180b042e37fSmrg  fi
2181b042e37fSmrg  ;;
2182b042e37fSmrg
2183b042e37fSmrgamigaos*)
21848c4a8e55Smrg  case $host_cpu in
21858c4a8e55Smrg  powerpc)
21868c4a8e55Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
21878c4a8e55Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
21888c4a8e55Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
21898c4a8e55Smrg    ;;
21908c4a8e55Smrg  m68k)
21918c4a8e55Smrg    library_names_spec='$libname.ixlibrary $libname.a'
21928c4a8e55Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
21938c4a8e55Smrg    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'
21948c4a8e55Smrg    ;;
21958c4a8e55Smrg  esac
2196b042e37fSmrg  ;;
2197b042e37fSmrg
2198b042e37fSmrgbeos*)
2199b042e37fSmrg  library_names_spec='${libname}${shared_ext}'
2200b042e37fSmrg  dynamic_linker="$host_os ld.so"
2201b042e37fSmrg  shlibpath_var=LIBRARY_PATH
2202b042e37fSmrg  ;;
2203b042e37fSmrg
2204b042e37fSmrgbsdi[[45]]*)
2205b042e37fSmrg  version_type=linux
2206b042e37fSmrg  need_version=no
2207b042e37fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2208b042e37fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2209b042e37fSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2210b042e37fSmrg  shlibpath_var=LD_LIBRARY_PATH
2211b042e37fSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2212b042e37fSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2213b042e37fSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
2214b042e37fSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2215b042e37fSmrg  # libtool to hard-code these into programs
2216b042e37fSmrg  ;;
2217b042e37fSmrg
22188c4a8e55Smrgcygwin* | mingw* | pw32* | cegcc*)
2219b042e37fSmrg  version_type=windows
2220b042e37fSmrg  shrext_cmds=".dll"
2221b042e37fSmrg  need_version=no
2222b042e37fSmrg  need_lib_prefix=no
2223b042e37fSmrg
2224b042e37fSmrg  case $GCC,$host_os in
22258c4a8e55Smrg  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
2226b042e37fSmrg    library_names_spec='$libname.dll.a'
2227b042e37fSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2228b042e37fSmrg    postinstall_cmds='base_file=`basename \${file}`~
22298c4a8e55Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2230b042e37fSmrg      dldir=$destdir/`dirname \$dlpath`~
2231b042e37fSmrg      test -d \$dldir || mkdir -p \$dldir~
2232b042e37fSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
22338c4a8e55Smrg      chmod a+x \$dldir/$dlname~
22348c4a8e55Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
22358c4a8e55Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
22368c4a8e55Smrg      fi'
2237b042e37fSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2238b042e37fSmrg      dlpath=$dir/\$dldll~
22398c4a8e55Smrg       $RM \$dlpath'
2240b042e37fSmrg    shlibpath_overrides_runpath=yes
2241b042e37fSmrg
2242b042e37fSmrg    case $host_os in
2243b042e37fSmrg    cygwin*)
2244b042e37fSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2245b042e37fSmrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2246b042e37fSmrg      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
2247b042e37fSmrg      ;;
22488c4a8e55Smrg    mingw* | cegcc*)
2249b042e37fSmrg      # MinGW DLLs use traditional 'lib' prefix
2250b042e37fSmrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
22518c4a8e55Smrg      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
22528c4a8e55Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2253b042e37fSmrg        # It is most probably a Windows format PATH printed by
2254b042e37fSmrg        # mingw gcc, but we are running on Cygwin. Gcc prints its search
2255b042e37fSmrg        # path with ; separators, and with drive letters. We can handle the
2256b042e37fSmrg        # drive letters (cygwin fileutils understands them), so leave them,
2257b042e37fSmrg        # especially as we might pass files found there to a mingw objdump,
2258b042e37fSmrg        # which wouldn't understand a cygwinified path. Ahh.
22598c4a8e55Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2260b042e37fSmrg      else
22618c4a8e55Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
2262b042e37fSmrg      fi
2263b042e37fSmrg      ;;
2264b042e37fSmrg    pw32*)
2265b042e37fSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2266b042e37fSmrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2267b042e37fSmrg      ;;
2268b042e37fSmrg    esac
2269b042e37fSmrg    ;;
2270b042e37fSmrg
2271b042e37fSmrg  *)
2272b042e37fSmrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2273b042e37fSmrg    ;;
2274b042e37fSmrg  esac
2275b042e37fSmrg  dynamic_linker='Win32 ld.exe'
2276b042e37fSmrg  # FIXME: first we should search . and the directory the executable is in
2277b042e37fSmrg  shlibpath_var=PATH
2278b042e37fSmrg  ;;
2279b042e37fSmrg
2280b042e37fSmrgdarwin* | rhapsody*)
2281b042e37fSmrg  dynamic_linker="$host_os dyld"
2282b042e37fSmrg  version_type=darwin
2283b042e37fSmrg  need_lib_prefix=no
2284b042e37fSmrg  need_version=no
22858c4a8e55Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2286b042e37fSmrg  soname_spec='${libname}${release}${major}$shared_ext'
2287b042e37fSmrg  shlibpath_overrides_runpath=yes
2288b042e37fSmrg  shlibpath_var=DYLD_LIBRARY_PATH
2289b042e37fSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
22908c4a8e55Smrgm4_if([$1], [],[
22918c4a8e55Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2292b042e37fSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2293b042e37fSmrg  ;;
2294b042e37fSmrg
2295b042e37fSmrgdgux*)
2296b042e37fSmrg  version_type=linux
2297b042e37fSmrg  need_lib_prefix=no
2298b042e37fSmrg  need_version=no
2299b042e37fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2300b042e37fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2301b042e37fSmrg  shlibpath_var=LD_LIBRARY_PATH
2302b042e37fSmrg  ;;
2303b042e37fSmrg
2304b042e37fSmrgfreebsd1*)
2305b042e37fSmrg  dynamic_linker=no
2306b042e37fSmrg  ;;
2307b042e37fSmrg
2308b042e37fSmrgfreebsd* | dragonfly*)
2309b042e37fSmrg  # DragonFly does not have aout.  When/if they implement a new
2310b042e37fSmrg  # versioning mechanism, adjust this.
2311b042e37fSmrg  if test -x /usr/bin/objformat; then
2312b042e37fSmrg    objformat=`/usr/bin/objformat`
2313b042e37fSmrg  else
2314b042e37fSmrg    case $host_os in
2315b042e37fSmrg    freebsd[[123]]*) objformat=aout ;;
2316b042e37fSmrg    *) objformat=elf ;;
2317b042e37fSmrg    esac
2318b042e37fSmrg  fi
2319b042e37fSmrg  version_type=freebsd-$objformat
2320b042e37fSmrg  case $version_type in
2321b042e37fSmrg    freebsd-elf*)
2322b042e37fSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2323b042e37fSmrg      need_version=no
2324b042e37fSmrg      need_lib_prefix=no
2325b042e37fSmrg      ;;
2326b042e37fSmrg    freebsd-*)
2327b042e37fSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2328b042e37fSmrg      need_version=yes
2329b042e37fSmrg      ;;
2330b042e37fSmrg  esac
2331b042e37fSmrg  shlibpath_var=LD_LIBRARY_PATH
2332b042e37fSmrg  case $host_os in
2333b042e37fSmrg  freebsd2*)
2334b042e37fSmrg    shlibpath_overrides_runpath=yes
2335b042e37fSmrg    ;;
2336b042e37fSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2337b042e37fSmrg    shlibpath_overrides_runpath=yes
2338b042e37fSmrg    hardcode_into_libs=yes
2339b042e37fSmrg    ;;
2340b042e37fSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2341b042e37fSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2342b042e37fSmrg    shlibpath_overrides_runpath=no
2343b042e37fSmrg    hardcode_into_libs=yes
2344b042e37fSmrg    ;;
23458c4a8e55Smrg  *) # from 4.6 on, and DragonFly
2346b042e37fSmrg    shlibpath_overrides_runpath=yes
2347b042e37fSmrg    hardcode_into_libs=yes
2348b042e37fSmrg    ;;
2349b042e37fSmrg  esac
2350b042e37fSmrg  ;;
2351b042e37fSmrg
2352b042e37fSmrggnu*)
2353b042e37fSmrg  version_type=linux
2354b042e37fSmrg  need_lib_prefix=no
2355b042e37fSmrg  need_version=no
2356b042e37fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2357b042e37fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2358b042e37fSmrg  shlibpath_var=LD_LIBRARY_PATH
2359b042e37fSmrg  hardcode_into_libs=yes
2360b042e37fSmrg  ;;
2361b042e37fSmrg
2362b042e37fSmrghpux9* | hpux10* | hpux11*)
2363b042e37fSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
2364b042e37fSmrg  # link against other versions.
2365b042e37fSmrg  version_type=sunos
2366b042e37fSmrg  need_lib_prefix=no
2367b042e37fSmrg  need_version=no
2368b042e37fSmrg  case $host_cpu in
2369b042e37fSmrg  ia64*)
2370b042e37fSmrg    shrext_cmds='.so'
2371b042e37fSmrg    hardcode_into_libs=yes
2372b042e37fSmrg    dynamic_linker="$host_os dld.so"
2373b042e37fSmrg    shlibpath_var=LD_LIBRARY_PATH
2374b042e37fSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2375b042e37fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2376b042e37fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
2377b042e37fSmrg    if test "X$HPUX_IA64_MODE" = X32; then
2378b042e37fSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2379b042e37fSmrg    else
2380b042e37fSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2381b042e37fSmrg    fi
2382b042e37fSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2383b042e37fSmrg    ;;
23848c4a8e55Smrg  hppa*64*)
23858c4a8e55Smrg    shrext_cmds='.sl'
23868c4a8e55Smrg    hardcode_into_libs=yes
23878c4a8e55Smrg    dynamic_linker="$host_os dld.sl"
23888c4a8e55Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
23898c4a8e55Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
23908c4a8e55Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23918c4a8e55Smrg    soname_spec='${libname}${release}${shared_ext}$major'
23928c4a8e55Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
23938c4a8e55Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
23948c4a8e55Smrg    ;;
23958c4a8e55Smrg  *)
2396b042e37fSmrg    shrext_cmds='.sl'
2397b042e37fSmrg    dynamic_linker="$host_os dld.sl"
2398b042e37fSmrg    shlibpath_var=SHLIB_PATH
2399b042e37fSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2400b042e37fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2401b042e37fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
2402b042e37fSmrg    ;;
2403b042e37fSmrg  esac
2404b042e37fSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555.
2405b042e37fSmrg  postinstall_cmds='chmod 555 $lib'
2406b042e37fSmrg  ;;
2407b042e37fSmrg
24088c4a8e55Smrginterix[[3-9]]*)
2409b042e37fSmrg  version_type=linux
2410b042e37fSmrg  need_lib_prefix=no
2411b042e37fSmrg  need_version=no
2412b042e37fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2413b042e37fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2414b042e37fSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2415b042e37fSmrg  shlibpath_var=LD_LIBRARY_PATH
2416b042e37fSmrg  shlibpath_overrides_runpath=no
2417b042e37fSmrg  hardcode_into_libs=yes
2418b042e37fSmrg  ;;
2419b042e37fSmrg
2420b042e37fSmrgirix5* | irix6* | nonstopux*)
2421b042e37fSmrg  case $host_os in
2422b042e37fSmrg    nonstopux*) version_type=nonstopux ;;
2423b042e37fSmrg    *)
2424b042e37fSmrg	if test "$lt_cv_prog_gnu_ld" = yes; then
2425b042e37fSmrg		version_type=linux
2426b042e37fSmrg	else
2427b042e37fSmrg		version_type=irix
2428b042e37fSmrg	fi ;;
2429b042e37fSmrg  esac
2430b042e37fSmrg  need_lib_prefix=no
2431b042e37fSmrg  need_version=no
2432b042e37fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2433b042e37fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2434b042e37fSmrg  case $host_os in
2435b042e37fSmrg  irix5* | nonstopux*)
2436b042e37fSmrg    libsuff= shlibsuff=
2437b042e37fSmrg    ;;
2438b042e37fSmrg  *)
2439b042e37fSmrg    case $LD in # libtool.m4 will add one of these switches to LD
2440b042e37fSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2441b042e37fSmrg      libsuff= shlibsuff= libmagic=32-bit;;
2442b042e37fSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2443b042e37fSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
2444b042e37fSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2445b042e37fSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2446b042e37fSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
2447b042e37fSmrg    esac
2448b042e37fSmrg    ;;
2449b042e37fSmrg  esac
2450b042e37fSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2451b042e37fSmrg  shlibpath_overrides_runpath=no
2452b042e37fSmrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2453b042e37fSmrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2454b042e37fSmrg  hardcode_into_libs=yes
2455b042e37fSmrg  ;;
2456b042e37fSmrg
2457b042e37fSmrg# No shared lib support for Linux oldld, aout, or coff.
2458b042e37fSmrglinux*oldld* | linux*aout* | linux*coff*)
2459b042e37fSmrg  dynamic_linker=no
2460b042e37fSmrg  ;;
2461b042e37fSmrg
2462b042e37fSmrg# This must be Linux ELF.
24638c4a8e55Smrglinux* | k*bsd*-gnu)
2464b042e37fSmrg  version_type=linux
2465b042e37fSmrg  need_lib_prefix=no
2466b042e37fSmrg  need_version=no
2467b042e37fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2468b042e37fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2469b042e37fSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2470b042e37fSmrg  shlibpath_var=LD_LIBRARY_PATH
2471b042e37fSmrg  shlibpath_overrides_runpath=no
24728c4a8e55Smrg  # Some binutils ld are patched to set DT_RUNPATH
24738c4a8e55Smrg  save_LDFLAGS=$LDFLAGS
24748c4a8e55Smrg  save_libdir=$libdir
24758c4a8e55Smrg  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
24768c4a8e55Smrg       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
24778c4a8e55Smrg  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
24788c4a8e55Smrg    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
24798c4a8e55Smrg       [shlibpath_overrides_runpath=yes])])
24808c4a8e55Smrg  LDFLAGS=$save_LDFLAGS
24818c4a8e55Smrg  libdir=$save_libdir
24828c4a8e55Smrg
2483b042e37fSmrg  # This implies no fast_install, which is unacceptable.
2484b042e37fSmrg  # Some rework will be needed to allow for fast_install
2485b042e37fSmrg  # before this can be enabled.
2486b042e37fSmrg  hardcode_into_libs=yes
2487b042e37fSmrg
2488b042e37fSmrg  # Append ld.so.conf contents to the search path
2489b042e37fSmrg  if test -f /etc/ld.so.conf; then
24908c4a8e55Smrg    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' ' '`
2491b042e37fSmrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2492b042e37fSmrg  fi
2493b042e37fSmrg
2494b042e37fSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2495b042e37fSmrg  # powerpc, because MkLinux only supported shared libraries with the
2496b042e37fSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2497b042e37fSmrg  # most powerpc-linux boxes support dynamic linking these days and
2498b042e37fSmrg  # people can always --disable-shared, the test was removed, and we
2499b042e37fSmrg  # assume the GNU/Linux dynamic linker is in use.
2500b042e37fSmrg  dynamic_linker='GNU/Linux ld.so'
2501b042e37fSmrg  ;;
2502b042e37fSmrg
2503b042e37fSmrgnetbsd*)
2504b042e37fSmrg  version_type=sunos
2505b042e37fSmrg  need_lib_prefix=no
2506b042e37fSmrg  need_version=no
25078c4a8e55Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2508b042e37fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2509b042e37fSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2510b042e37fSmrg    dynamic_linker='NetBSD (a.out) ld.so'
2511b042e37fSmrg  else
2512b042e37fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2513b042e37fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
2514b042e37fSmrg    dynamic_linker='NetBSD ld.elf_so'
2515b042e37fSmrg  fi
2516b042e37fSmrg  shlibpath_var=LD_LIBRARY_PATH
2517b042e37fSmrg  shlibpath_overrides_runpath=yes
2518b042e37fSmrg  hardcode_into_libs=yes
2519b042e37fSmrg  ;;
2520b042e37fSmrg
2521b042e37fSmrgnewsos6)
2522b042e37fSmrg  version_type=linux
2523b042e37fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2524b042e37fSmrg  shlibpath_var=LD_LIBRARY_PATH
2525b042e37fSmrg  shlibpath_overrides_runpath=yes
2526b042e37fSmrg  ;;
2527b042e37fSmrg
25288c4a8e55Smrg*nto* | *qnx*)
25298c4a8e55Smrg  version_type=qnx
2530b042e37fSmrg  need_lib_prefix=no
2531b042e37fSmrg  need_version=no
2532b042e37fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2533b042e37fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2534b042e37fSmrg  shlibpath_var=LD_LIBRARY_PATH
25358c4a8e55Smrg  shlibpath_overrides_runpath=no
25368c4a8e55Smrg  hardcode_into_libs=yes
25378c4a8e55Smrg  dynamic_linker='ldqnx.so'
2538b042e37fSmrg  ;;
2539b042e37fSmrg
2540b042e37fSmrgopenbsd*)
2541b042e37fSmrg  version_type=sunos
2542b042e37fSmrg  sys_lib_dlsearch_path_spec="/usr/lib"
2543b042e37fSmrg  need_lib_prefix=no
2544b042e37fSmrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2545b042e37fSmrg  case $host_os in
25468c4a8e55Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
25478c4a8e55Smrg    *)				need_version=no  ;;
2548b042e37fSmrg  esac
2549b042e37fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2550b042e37fSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2551b042e37fSmrg  shlibpath_var=LD_LIBRARY_PATH
25528c4a8e55Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2553b042e37fSmrg    case $host_os in
2554b042e37fSmrg      openbsd2.[[89]] | openbsd2.[[89]].*)
2555b042e37fSmrg	shlibpath_overrides_runpath=no
2556b042e37fSmrg	;;
2557b042e37fSmrg      *)
2558b042e37fSmrg	shlibpath_overrides_runpath=yes
2559b042e37fSmrg	;;
2560b042e37fSmrg      esac
2561b042e37fSmrg  else
2562b042e37fSmrg    shlibpath_overrides_runpath=yes
2563b042e37fSmrg  fi
2564b042e37fSmrg  ;;
2565b042e37fSmrg
2566b042e37fSmrgos2*)
2567b042e37fSmrg  libname_spec='$name'
2568b042e37fSmrg  shrext_cmds=".dll"
2569b042e37fSmrg  need_lib_prefix=no
2570b042e37fSmrg  library_names_spec='$libname${shared_ext} $libname.a'
2571b042e37fSmrg  dynamic_linker='OS/2 ld.exe'
2572b042e37fSmrg  shlibpath_var=LIBPATH
2573b042e37fSmrg  ;;
2574b042e37fSmrg
2575b042e37fSmrgosf3* | osf4* | osf5*)
2576b042e37fSmrg  version_type=osf
2577b042e37fSmrg  need_lib_prefix=no
2578b042e37fSmrg  need_version=no
2579b042e37fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2580b042e37fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2581b042e37fSmrg  shlibpath_var=LD_LIBRARY_PATH
2582b042e37fSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2583b042e37fSmrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2584b042e37fSmrg  ;;
2585b042e37fSmrg
25868c4a8e55Smrgrdos*)
25878c4a8e55Smrg  dynamic_linker=no
25888c4a8e55Smrg  ;;
25898c4a8e55Smrg
2590b042e37fSmrgsolaris*)
2591b042e37fSmrg  version_type=linux
2592b042e37fSmrg  need_lib_prefix=no
2593b042e37fSmrg  need_version=no
2594b042e37fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2595b042e37fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2596b042e37fSmrg  shlibpath_var=LD_LIBRARY_PATH
2597b042e37fSmrg  shlibpath_overrides_runpath=yes
2598b042e37fSmrg  hardcode_into_libs=yes
2599b042e37fSmrg  # ldd complains unless libraries are executable
2600b042e37fSmrg  postinstall_cmds='chmod +x $lib'
2601b042e37fSmrg  ;;
2602b042e37fSmrg
2603b042e37fSmrgsunos4*)
2604b042e37fSmrg  version_type=sunos
2605b042e37fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2606b042e37fSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2607b042e37fSmrg  shlibpath_var=LD_LIBRARY_PATH
2608b042e37fSmrg  shlibpath_overrides_runpath=yes
2609b042e37fSmrg  if test "$with_gnu_ld" = yes; then
2610b042e37fSmrg    need_lib_prefix=no
2611b042e37fSmrg  fi
2612b042e37fSmrg  need_version=yes
2613b042e37fSmrg  ;;
2614b042e37fSmrg
2615b042e37fSmrgsysv4 | sysv4.3*)
2616b042e37fSmrg  version_type=linux
2617b042e37fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2618b042e37fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2619b042e37fSmrg  shlibpath_var=LD_LIBRARY_PATH
2620b042e37fSmrg  case $host_vendor in
2621b042e37fSmrg    sni)
2622b042e37fSmrg      shlibpath_overrides_runpath=no
2623b042e37fSmrg      need_lib_prefix=no
2624b042e37fSmrg      runpath_var=LD_RUN_PATH
2625b042e37fSmrg      ;;
2626b042e37fSmrg    siemens)
2627b042e37fSmrg      need_lib_prefix=no
2628b042e37fSmrg      ;;
2629b042e37fSmrg    motorola)
2630b042e37fSmrg      need_lib_prefix=no
2631b042e37fSmrg      need_version=no
2632b042e37fSmrg      shlibpath_overrides_runpath=no
2633b042e37fSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2634b042e37fSmrg      ;;
2635b042e37fSmrg  esac
2636b042e37fSmrg  ;;
2637b042e37fSmrg
2638b042e37fSmrgsysv4*MP*)
2639b042e37fSmrg  if test -d /usr/nec ;then
2640b042e37fSmrg    version_type=linux
2641b042e37fSmrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2642b042e37fSmrg    soname_spec='$libname${shared_ext}.$major'
2643b042e37fSmrg    shlibpath_var=LD_LIBRARY_PATH
2644b042e37fSmrg  fi
2645b042e37fSmrg  ;;
2646b042e37fSmrg
2647b042e37fSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2648b042e37fSmrg  version_type=freebsd-elf
2649b042e37fSmrg  need_lib_prefix=no
2650b042e37fSmrg  need_version=no
2651b042e37fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2652b042e37fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2653b042e37fSmrg  shlibpath_var=LD_LIBRARY_PATH
26548c4a8e55Smrg  shlibpath_overrides_runpath=yes
2655b042e37fSmrg  hardcode_into_libs=yes
2656b042e37fSmrg  if test "$with_gnu_ld" = yes; then
2657b042e37fSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2658b042e37fSmrg  else
2659b042e37fSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2660b042e37fSmrg    case $host_os in
2661b042e37fSmrg      sco3.2v5*)
2662b042e37fSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2663b042e37fSmrg	;;
2664b042e37fSmrg    esac
2665b042e37fSmrg  fi
2666b042e37fSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
2667b042e37fSmrg  ;;
2668b042e37fSmrg
26698c4a8e55Smrgtpf*)
26708c4a8e55Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
26718c4a8e55Smrg  version_type=linux
26728c4a8e55Smrg  need_lib_prefix=no
26738c4a8e55Smrg  need_version=no
26748c4a8e55Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
26758c4a8e55Smrg  shlibpath_var=LD_LIBRARY_PATH
26768c4a8e55Smrg  shlibpath_overrides_runpath=no
26778c4a8e55Smrg  hardcode_into_libs=yes
26788c4a8e55Smrg  ;;
26798c4a8e55Smrg
2680b042e37fSmrguts4*)
2681b042e37fSmrg  version_type=linux
2682b042e37fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2683b042e37fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2684b042e37fSmrg  shlibpath_var=LD_LIBRARY_PATH
2685b042e37fSmrg  ;;
2686b042e37fSmrg
2687b042e37fSmrg*)
2688b042e37fSmrg  dynamic_linker=no
2689b042e37fSmrg  ;;
2690b042e37fSmrgesac
2691b042e37fSmrgAC_MSG_RESULT([$dynamic_linker])
2692b042e37fSmrgtest "$dynamic_linker" = no && can_build_shared=no
2693b042e37fSmrg
2694b042e37fSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2695b042e37fSmrgif test "$GCC" = yes; then
2696b042e37fSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2697b042e37fSmrgfi
2698b042e37fSmrg
26998c4a8e55Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
27008c4a8e55Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
27018c4a8e55Smrgfi
27028c4a8e55Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
27038c4a8e55Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
27048c4a8e55Smrgfi
2705b042e37fSmrg
27068c4a8e55Smrg_LT_DECL([], [variables_saved_for_relink], [1],
27078c4a8e55Smrg    [Variables whose values should be saved in libtool wrapper scripts and
27088c4a8e55Smrg    restored at link time])
27098c4a8e55Smrg_LT_DECL([], [need_lib_prefix], [0],
27108c4a8e55Smrg    [Do we need the "lib" prefix for modules?])
27118c4a8e55Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
27128c4a8e55Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
27138c4a8e55Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
27148c4a8e55Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
27158c4a8e55Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
27168c4a8e55Smrg    [Is shlibpath searched before the hard-coded library search path?])
27178c4a8e55Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
27188c4a8e55Smrg_LT_DECL([], [library_names_spec], [1],
27198c4a8e55Smrg    [[List of archive names.  First name is the real one, the rest are links.
27208c4a8e55Smrg    The last name is the one that the linker finds with -lNAME]])
27218c4a8e55Smrg_LT_DECL([], [soname_spec], [1],
27228c4a8e55Smrg    [[The coded name of the library, if different from the real name]])
27238c4a8e55Smrg_LT_DECL([], [postinstall_cmds], [2],
27248c4a8e55Smrg    [Command to use after installation of a shared archive])
27258c4a8e55Smrg_LT_DECL([], [postuninstall_cmds], [2],
27268c4a8e55Smrg    [Command to use after uninstallation of a shared archive])
27278c4a8e55Smrg_LT_DECL([], [finish_cmds], [2],
27288c4a8e55Smrg    [Commands used to finish a libtool library installation in a directory])
27298c4a8e55Smrg_LT_DECL([], [finish_eval], [1],
27308c4a8e55Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
27318c4a8e55Smrg    not shown]])
27328c4a8e55Smrg_LT_DECL([], [hardcode_into_libs], [0],
27338c4a8e55Smrg    [Whether we should hardcode library paths into libraries])
27348c4a8e55Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
27358c4a8e55Smrg    [Compile-time system search path for libraries])
27368c4a8e55Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
27378c4a8e55Smrg    [Run-time system search path for libraries])
27388c4a8e55Smrg])# _LT_SYS_DYNAMIC_LINKER
27398c4a8e55Smrg
27408c4a8e55Smrg
27418c4a8e55Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
27428c4a8e55Smrg# --------------------------
27438c4a8e55Smrg# find a file program which can recognize shared library
27448c4a8e55SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
27458c4a8e55Smrg[m4_require([_LT_DECL_EGREP])dnl
27468c4a8e55SmrgAC_MSG_CHECKING([for $1])
27478c4a8e55SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
27488c4a8e55Smrg[case $MAGIC_CMD in
27498c4a8e55Smrg[[\\/*] |  ?:[\\/]*])
27508c4a8e55Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
27518c4a8e55Smrg  ;;
27528c4a8e55Smrg*)
27538c4a8e55Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
27548c4a8e55Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
27558c4a8e55Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
27568c4a8e55Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
27578c4a8e55Smrgdnl not every word.  This closes a longstanding sh security hole.
27588c4a8e55Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
27598c4a8e55Smrg  for ac_dir in $ac_dummy; do
2760b042e37fSmrg    IFS="$lt_save_ifs"
27618c4a8e55Smrg    test -z "$ac_dir" && ac_dir=.
27628c4a8e55Smrg    if test -f $ac_dir/$1; then
27638c4a8e55Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
27648c4a8e55Smrg      if test -n "$file_magic_test_file"; then
27658c4a8e55Smrg	case $deplibs_check_method in
27668c4a8e55Smrg	"file_magic "*)
27678c4a8e55Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
27688c4a8e55Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
27698c4a8e55Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
27708c4a8e55Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
27718c4a8e55Smrg	    :
27728c4a8e55Smrg	  else
27738c4a8e55Smrg	    cat <<_LT_EOF 1>&2
27748c4a8e55Smrg
27758c4a8e55Smrg*** Warning: the command libtool uses to detect shared libraries,
27768c4a8e55Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
27778c4a8e55Smrg*** The result is that libtool may fail to recognize shared libraries
27788c4a8e55Smrg*** as such.  This will affect the creation of libtool libraries that
27798c4a8e55Smrg*** depend on shared libraries, but programs linked with such libtool
27808c4a8e55Smrg*** libraries will work regardless of this problem.  Nevertheless, you
27818c4a8e55Smrg*** may want to report the problem to your system manager and/or to
27828c4a8e55Smrg*** bug-libtool@gnu.org
2783b042e37fSmrg
27848c4a8e55Smrg_LT_EOF
27858c4a8e55Smrg	  fi ;;
27868c4a8e55Smrg	esac
27878c4a8e55Smrg      fi
27888c4a8e55Smrg      break
2789b042e37fSmrg    fi
27908c4a8e55Smrg  done
27918c4a8e55Smrg  IFS="$lt_save_ifs"
27928c4a8e55Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
27938c4a8e55Smrg  ;;
27948c4a8e55Smrgesac])
27958c4a8e55SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
27968c4a8e55Smrgif test -n "$MAGIC_CMD"; then
27978c4a8e55Smrg  AC_MSG_RESULT($MAGIC_CMD)
27988c4a8e55Smrgelse
27998c4a8e55Smrg  AC_MSG_RESULT(no)
28008c4a8e55Smrgfi
28018c4a8e55Smrg_LT_DECL([], [MAGIC_CMD], [0],
28028c4a8e55Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
28038c4a8e55Smrg])# _LT_PATH_TOOL_PREFIX
2804b042e37fSmrg
28058c4a8e55Smrg# Old name:
28068c4a8e55SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
28078c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
28088c4a8e55Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
2809b042e37fSmrg
2810b042e37fSmrg
28118c4a8e55Smrg# _LT_PATH_MAGIC
28128c4a8e55Smrg# --------------
28138c4a8e55Smrg# find a file program which can recognize a shared library
28148c4a8e55Smrgm4_defun([_LT_PATH_MAGIC],
28158c4a8e55Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
2816b042e37fSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
2817b042e37fSmrg  if test -n "$ac_tool_prefix"; then
28188c4a8e55Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
2819b042e37fSmrg  else
2820b042e37fSmrg    MAGIC_CMD=:
2821b042e37fSmrg  fi
2822b042e37fSmrgfi
28238c4a8e55Smrg])# _LT_PATH_MAGIC
2824b042e37fSmrg
2825b042e37fSmrg
28268c4a8e55Smrg# LT_PATH_LD
2827b042e37fSmrg# ----------
2828b042e37fSmrg# find the pathname to the GNU or non-GNU linker
28298c4a8e55SmrgAC_DEFUN([LT_PATH_LD],
28308c4a8e55Smrg[AC_REQUIRE([AC_PROG_CC])dnl
2831b042e37fSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
2832b042e37fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
28338c4a8e55Smrgm4_require([_LT_DECL_SED])dnl
28348c4a8e55Smrgm4_require([_LT_DECL_EGREP])dnl
28358c4a8e55Smrg
28368c4a8e55SmrgAC_ARG_WITH([gnu-ld],
28378c4a8e55Smrg    [AS_HELP_STRING([--with-gnu-ld],
28388c4a8e55Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
28398c4a8e55Smrg    [test "$withval" = no || with_gnu_ld=yes],
28408c4a8e55Smrg    [with_gnu_ld=no])dnl
28418c4a8e55Smrg
2842b042e37fSmrgac_prog=ld
2843b042e37fSmrgif test "$GCC" = yes; then
2844b042e37fSmrg  # Check if gcc -print-prog-name=ld gives a path.
2845b042e37fSmrg  AC_MSG_CHECKING([for ld used by $CC])
2846b042e37fSmrg  case $host in
2847b042e37fSmrg  *-*-mingw*)
2848b042e37fSmrg    # gcc leaves a trailing carriage return which upsets mingw
2849b042e37fSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2850b042e37fSmrg  *)
2851b042e37fSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2852b042e37fSmrg  esac
2853b042e37fSmrg  case $ac_prog in
2854b042e37fSmrg    # Accept absolute paths.
2855b042e37fSmrg    [[\\/]]* | ?:[[\\/]]*)
2856b042e37fSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
2857b042e37fSmrg      # Canonicalize the pathname of ld
28588c4a8e55Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
28598c4a8e55Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
28608c4a8e55Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
2861b042e37fSmrg      done
2862b042e37fSmrg      test -z "$LD" && LD="$ac_prog"
2863b042e37fSmrg      ;;
2864b042e37fSmrg  "")
2865b042e37fSmrg    # If it fails, then pretend we aren't using GCC.
2866b042e37fSmrg    ac_prog=ld
2867b042e37fSmrg    ;;
2868b042e37fSmrg  *)
2869b042e37fSmrg    # If it is relative, then search for the first ld in PATH.
2870b042e37fSmrg    with_gnu_ld=unknown
2871b042e37fSmrg    ;;
2872b042e37fSmrg  esac
2873b042e37fSmrgelif test "$with_gnu_ld" = yes; then
2874b042e37fSmrg  AC_MSG_CHECKING([for GNU ld])
2875b042e37fSmrgelse
2876b042e37fSmrg  AC_MSG_CHECKING([for non-GNU ld])
2877b042e37fSmrgfi
2878b042e37fSmrgAC_CACHE_VAL(lt_cv_path_LD,
2879b042e37fSmrg[if test -z "$LD"; then
2880b042e37fSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2881b042e37fSmrg  for ac_dir in $PATH; do
2882b042e37fSmrg    IFS="$lt_save_ifs"
2883b042e37fSmrg    test -z "$ac_dir" && ac_dir=.
2884b042e37fSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2885b042e37fSmrg      lt_cv_path_LD="$ac_dir/$ac_prog"
2886b042e37fSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
2887b042e37fSmrg      # but apparently some variants of GNU ld only accept -v.
2888b042e37fSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
2889b042e37fSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
2890b042e37fSmrg      *GNU* | *'with BFD'*)
2891b042e37fSmrg	test "$with_gnu_ld" != no && break
2892b042e37fSmrg	;;
2893b042e37fSmrg      *)
2894b042e37fSmrg	test "$with_gnu_ld" != yes && break
2895b042e37fSmrg	;;
2896b042e37fSmrg      esac
2897b042e37fSmrg    fi
2898b042e37fSmrg  done
2899b042e37fSmrg  IFS="$lt_save_ifs"
2900b042e37fSmrgelse
2901b042e37fSmrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
2902b042e37fSmrgfi])
2903b042e37fSmrgLD="$lt_cv_path_LD"
2904b042e37fSmrgif test -n "$LD"; then
2905b042e37fSmrg  AC_MSG_RESULT($LD)
2906b042e37fSmrgelse
2907b042e37fSmrg  AC_MSG_RESULT(no)
2908b042e37fSmrgfi
2909b042e37fSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
29108c4a8e55Smrg_LT_PATH_LD_GNU
29118c4a8e55SmrgAC_SUBST([LD])
2912b042e37fSmrg
29138c4a8e55Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
29148c4a8e55Smrg])# LT_PATH_LD
2915b042e37fSmrg
29168c4a8e55Smrg# Old names:
29178c4a8e55SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
29188c4a8e55SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
29198c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
29208c4a8e55Smrgdnl AC_DEFUN([AM_PROG_LD], [])
29218c4a8e55Smrgdnl AC_DEFUN([AC_PROG_LD], [])
29228c4a8e55Smrg
29238c4a8e55Smrg
29248c4a8e55Smrg# _LT_PATH_LD_GNU
29258c4a8e55Smrg#- --------------
29268c4a8e55Smrgm4_defun([_LT_PATH_LD_GNU],
29278c4a8e55Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
2928b042e37fSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
2929b042e37fSmrgcase `$LD -v 2>&1 </dev/null` in
2930b042e37fSmrg*GNU* | *'with BFD'*)
2931b042e37fSmrg  lt_cv_prog_gnu_ld=yes
2932b042e37fSmrg  ;;
2933b042e37fSmrg*)
2934b042e37fSmrg  lt_cv_prog_gnu_ld=no
2935b042e37fSmrg  ;;
2936b042e37fSmrgesac])
2937b042e37fSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
29388c4a8e55Smrg])# _LT_PATH_LD_GNU
2939b042e37fSmrg
2940b042e37fSmrg
29418c4a8e55Smrg# _LT_CMD_RELOAD
29428c4a8e55Smrg# --------------
2943b042e37fSmrg# find reload flag for linker
2944b042e37fSmrg#   -- PORTME Some linkers may need a different reload flag.
29458c4a8e55Smrgm4_defun([_LT_CMD_RELOAD],
2946b042e37fSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
2947b042e37fSmrg  lt_cv_ld_reload_flag,
2948b042e37fSmrg  [lt_cv_ld_reload_flag='-r'])
2949b042e37fSmrgreload_flag=$lt_cv_ld_reload_flag
2950b042e37fSmrgcase $reload_flag in
2951b042e37fSmrg"" | " "*) ;;
2952b042e37fSmrg*) reload_flag=" $reload_flag" ;;
2953b042e37fSmrgesac
2954b042e37fSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
2955b042e37fSmrgcase $host_os in
2956b042e37fSmrg  darwin*)
2957b042e37fSmrg    if test "$GCC" = yes; then
2958b042e37fSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
2959b042e37fSmrg    else
2960b042e37fSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
2961b042e37fSmrg    fi
2962b042e37fSmrg    ;;
2963b042e37fSmrgesac
29648c4a8e55Smrg_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
29658c4a8e55Smrg_LT_DECL([], [reload_cmds], [2])dnl
29668c4a8e55Smrg])# _LT_CMD_RELOAD
2967b042e37fSmrg
2968b042e37fSmrg
29698c4a8e55Smrg# _LT_CHECK_MAGIC_METHOD
29708c4a8e55Smrg# ----------------------
2971b042e37fSmrg# how to check for library dependencies
2972b042e37fSmrg#  -- PORTME fill in with the dynamic library characteristics
29738c4a8e55Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
29748c4a8e55Smrg[m4_require([_LT_DECL_EGREP])
29758c4a8e55Smrgm4_require([_LT_DECL_OBJDUMP])
29768c4a8e55SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
2977b042e37fSmrglt_cv_deplibs_check_method,
2978b042e37fSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
2979b042e37fSmrglt_cv_file_magic_test_file=
2980b042e37fSmrglt_cv_deplibs_check_method='unknown'
2981b042e37fSmrg# Need to set the preceding variable on all platforms that support
2982b042e37fSmrg# interlibrary dependencies.
2983b042e37fSmrg# 'none' -- dependencies not supported.
2984b042e37fSmrg# `unknown' -- same as none, but documents that we really don't know.
2985b042e37fSmrg# 'pass_all' -- all dependencies passed with no checks.
2986b042e37fSmrg# 'test_compile' -- check by making test program.
2987b042e37fSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
2988b042e37fSmrg# which responds to the $file_magic_cmd with a given extended regex.
2989b042e37fSmrg# If you have `file' or equivalent on your system and you're not sure
2990b042e37fSmrg# whether `pass_all' will *always* work, you probably want this one.
2991b042e37fSmrg
2992b042e37fSmrgcase $host_os in
29938c4a8e55Smrgaix[[4-9]]*)
2994b042e37fSmrg  lt_cv_deplibs_check_method=pass_all
2995b042e37fSmrg  ;;
2996b042e37fSmrg
2997b042e37fSmrgbeos*)
2998b042e37fSmrg  lt_cv_deplibs_check_method=pass_all
2999b042e37fSmrg  ;;
3000b042e37fSmrg
3001b042e37fSmrgbsdi[[45]]*)
3002b042e37fSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3003b042e37fSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
3004b042e37fSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
3005b042e37fSmrg  ;;
3006b042e37fSmrg
3007b042e37fSmrgcygwin*)
3008b042e37fSmrg  # func_win32_libid is a shell function defined in ltmain.sh
3009b042e37fSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3010b042e37fSmrg  lt_cv_file_magic_cmd='func_win32_libid'
3011b042e37fSmrg  ;;
3012b042e37fSmrg
3013b042e37fSmrgmingw* | pw32*)
3014b042e37fSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
30158c4a8e55Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
30168c4a8e55Smrg  # unless we find 'file', for example because we are cross-compiling.
30178c4a8e55Smrg  if ( file / ) >/dev/null 2>&1; then
30188c4a8e55Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
30198c4a8e55Smrg    lt_cv_file_magic_cmd='func_win32_libid'
30208c4a8e55Smrg  else
30218c4a8e55Smrg    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
30228c4a8e55Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
30238c4a8e55Smrg  fi
30248c4a8e55Smrg  ;;
30258c4a8e55Smrg
30268c4a8e55Smrgcegcc)
30278c4a8e55Smrg  # use the weaker test based on 'objdump'. See mingw*.
30288c4a8e55Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3029b042e37fSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3030b042e37fSmrg  ;;
3031b042e37fSmrg
3032b042e37fSmrgdarwin* | rhapsody*)
3033b042e37fSmrg  lt_cv_deplibs_check_method=pass_all
3034b042e37fSmrg  ;;
3035b042e37fSmrg
30368c4a8e55Smrgfreebsd* | dragonfly*)
30378c4a8e55Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3038b042e37fSmrg    case $host_cpu in
3039b042e37fSmrg    i*86 )
3040b042e37fSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
3041b042e37fSmrg      # Let's accept both of them until this is cleared up.
3042b042e37fSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3043b042e37fSmrg      lt_cv_file_magic_cmd=/usr/bin/file
3044b042e37fSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3045b042e37fSmrg      ;;
3046b042e37fSmrg    esac
3047b042e37fSmrg  else
3048b042e37fSmrg    lt_cv_deplibs_check_method=pass_all
3049b042e37fSmrg  fi
3050b042e37fSmrg  ;;
3051b042e37fSmrg
3052b042e37fSmrggnu*)
3053b042e37fSmrg  lt_cv_deplibs_check_method=pass_all
3054b042e37fSmrg  ;;
3055b042e37fSmrg
3056b042e37fSmrghpux10.20* | hpux11*)
3057b042e37fSmrg  lt_cv_file_magic_cmd=/usr/bin/file
3058b042e37fSmrg  case $host_cpu in
3059b042e37fSmrg  ia64*)
3060b042e37fSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3061b042e37fSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3062b042e37fSmrg    ;;
3063b042e37fSmrg  hppa*64*)
3064b042e37fSmrg    [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]']
3065b042e37fSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3066b042e37fSmrg    ;;
3067b042e37fSmrg  *)
3068b042e37fSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
3069b042e37fSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3070b042e37fSmrg    ;;
3071b042e37fSmrg  esac
3072b042e37fSmrg  ;;
3073b042e37fSmrg
30748c4a8e55Smrginterix[[3-9]]*)
3075b042e37fSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3076b042e37fSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3077b042e37fSmrg  ;;
3078b042e37fSmrg
3079b042e37fSmrgirix5* | irix6* | nonstopux*)
3080b042e37fSmrg  case $LD in
3081b042e37fSmrg  *-32|*"-32 ") libmagic=32-bit;;
3082b042e37fSmrg  *-n32|*"-n32 ") libmagic=N32;;
3083b042e37fSmrg  *-64|*"-64 ") libmagic=64-bit;;
3084b042e37fSmrg  *) libmagic=never-match;;
3085b042e37fSmrg  esac
3086b042e37fSmrg  lt_cv_deplibs_check_method=pass_all
3087b042e37fSmrg  ;;
3088b042e37fSmrg
3089b042e37fSmrg# This must be Linux ELF.
30908c4a8e55Smrglinux* | k*bsd*-gnu)
3091b042e37fSmrg  lt_cv_deplibs_check_method=pass_all
3092b042e37fSmrg  ;;
3093b042e37fSmrg
3094b042e37fSmrgnetbsd*)
30958c4a8e55Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3096b042e37fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3097b042e37fSmrg  else
3098b042e37fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3099b042e37fSmrg  fi
3100b042e37fSmrg  ;;
3101b042e37fSmrg
3102b042e37fSmrgnewos6*)
3103b042e37fSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3104b042e37fSmrg  lt_cv_file_magic_cmd=/usr/bin/file
3105b042e37fSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3106b042e37fSmrg  ;;
3107b042e37fSmrg
31088c4a8e55Smrg*nto* | *qnx*)
31098c4a8e55Smrg  lt_cv_deplibs_check_method=pass_all
3110b042e37fSmrg  ;;
3111b042e37fSmrg
3112b042e37fSmrgopenbsd*)
31138c4a8e55Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3114b042e37fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3115b042e37fSmrg  else
3116b042e37fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3117b042e37fSmrg  fi
3118b042e37fSmrg  ;;
3119b042e37fSmrg
3120b042e37fSmrgosf3* | osf4* | osf5*)
3121b042e37fSmrg  lt_cv_deplibs_check_method=pass_all
3122b042e37fSmrg  ;;
3123b042e37fSmrg
31248c4a8e55Smrgrdos*)
31258c4a8e55Smrg  lt_cv_deplibs_check_method=pass_all
31268c4a8e55Smrg  ;;
31278c4a8e55Smrg
3128b042e37fSmrgsolaris*)
3129b042e37fSmrg  lt_cv_deplibs_check_method=pass_all
3130b042e37fSmrg  ;;
3131b042e37fSmrg
31328c4a8e55Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
31338c4a8e55Smrg  lt_cv_deplibs_check_method=pass_all
31348c4a8e55Smrg  ;;
31358c4a8e55Smrg
3136b042e37fSmrgsysv4 | sysv4.3*)
3137b042e37fSmrg  case $host_vendor in
3138b042e37fSmrg  motorola)
3139b042e37fSmrg    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]]'
3140b042e37fSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3141b042e37fSmrg    ;;
3142b042e37fSmrg  ncr)
3143b042e37fSmrg    lt_cv_deplibs_check_method=pass_all
3144b042e37fSmrg    ;;
3145b042e37fSmrg  sequent)
3146b042e37fSmrg    lt_cv_file_magic_cmd='/bin/file'
3147b042e37fSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3148b042e37fSmrg    ;;
3149b042e37fSmrg  sni)
3150b042e37fSmrg    lt_cv_file_magic_cmd='/bin/file'
3151b042e37fSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3152b042e37fSmrg    lt_cv_file_magic_test_file=/lib/libc.so
3153b042e37fSmrg    ;;
3154b042e37fSmrg  siemens)
3155b042e37fSmrg    lt_cv_deplibs_check_method=pass_all
3156b042e37fSmrg    ;;
3157b042e37fSmrg  pc)
3158b042e37fSmrg    lt_cv_deplibs_check_method=pass_all
3159b042e37fSmrg    ;;
3160b042e37fSmrg  esac
3161b042e37fSmrg  ;;
3162b042e37fSmrg
31638c4a8e55Smrgtpf*)
3164b042e37fSmrg  lt_cv_deplibs_check_method=pass_all
3165b042e37fSmrg  ;;
3166b042e37fSmrgesac
3167b042e37fSmrg])
3168b042e37fSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
3169b042e37fSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
3170b042e37fSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3171b042e37fSmrg
31728c4a8e55Smrg_LT_DECL([], [deplibs_check_method], [1],
31738c4a8e55Smrg    [Method to check whether dependent libraries are shared objects])
31748c4a8e55Smrg_LT_DECL([], [file_magic_cmd], [1],
31758c4a8e55Smrg    [Command to use when deplibs_check_method == "file_magic"])
31768c4a8e55Smrg])# _LT_CHECK_MAGIC_METHOD
3177b042e37fSmrg
31788c4a8e55Smrg
31798c4a8e55Smrg# LT_PATH_NM
3180b042e37fSmrg# ----------
31818c4a8e55Smrg# find the pathname to a BSD- or MS-compatible name lister
31828c4a8e55SmrgAC_DEFUN([LT_PATH_NM],
31838c4a8e55Smrg[AC_REQUIRE([AC_PROG_CC])dnl
31848c4a8e55SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3185b042e37fSmrg[if test -n "$NM"; then
3186b042e37fSmrg  # Let the user override the test.
3187b042e37fSmrg  lt_cv_path_NM="$NM"
3188b042e37fSmrgelse
3189b042e37fSmrg  lt_nm_to_check="${ac_tool_prefix}nm"
31908c4a8e55Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3191b042e37fSmrg    lt_nm_to_check="$lt_nm_to_check nm"
3192b042e37fSmrg  fi
3193b042e37fSmrg  for lt_tmp_nm in $lt_nm_to_check; do
3194b042e37fSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3195b042e37fSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3196b042e37fSmrg      IFS="$lt_save_ifs"
3197b042e37fSmrg      test -z "$ac_dir" && ac_dir=.
3198b042e37fSmrg      tmp_nm="$ac_dir/$lt_tmp_nm"
3199b042e37fSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3200b042e37fSmrg	# Check to see if the nm accepts a BSD-compat flag.
3201b042e37fSmrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
3202b042e37fSmrg	#   nm: unknown option "B" ignored
3203b042e37fSmrg	# Tru64's nm complains that /dev/null is an invalid object file
3204b042e37fSmrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3205b042e37fSmrg	*/dev/null* | *'Invalid file or object type'*)
3206b042e37fSmrg	  lt_cv_path_NM="$tmp_nm -B"
3207b042e37fSmrg	  break
3208b042e37fSmrg	  ;;
3209b042e37fSmrg	*)
3210b042e37fSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3211b042e37fSmrg	  */dev/null*)
3212b042e37fSmrg	    lt_cv_path_NM="$tmp_nm -p"
3213b042e37fSmrg	    break
3214b042e37fSmrg	    ;;
3215b042e37fSmrg	  *)
3216b042e37fSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3217b042e37fSmrg	    continue # so that we can try to find one that supports BSD flags
3218b042e37fSmrg	    ;;
3219b042e37fSmrg	  esac
3220b042e37fSmrg	  ;;
3221b042e37fSmrg	esac
3222b042e37fSmrg      fi
3223b042e37fSmrg    done
3224b042e37fSmrg    IFS="$lt_save_ifs"
3225b042e37fSmrg  done
32268c4a8e55Smrg  : ${lt_cv_path_NM=no}
3227b042e37fSmrgfi])
32288c4a8e55Smrgif test "$lt_cv_path_NM" != "no"; then
32298c4a8e55Smrg  NM="$lt_cv_path_NM"
32308c4a8e55Smrgelse
32318c4a8e55Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
32328c4a8e55Smrg  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
32338c4a8e55Smrg  AC_SUBST([DUMPBIN])
32348c4a8e55Smrg  if test "$DUMPBIN" != ":"; then
32358c4a8e55Smrg    NM="$DUMPBIN"
32368c4a8e55Smrg  fi
32378c4a8e55Smrgfi
32388c4a8e55Smrgtest -z "$NM" && NM=nm
32398c4a8e55SmrgAC_SUBST([NM])
32408c4a8e55Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
32418c4a8e55Smrg
32428c4a8e55SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
32438c4a8e55Smrg  [lt_cv_nm_interface="BSD nm"
32448c4a8e55Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
32458c4a8e55Smrg  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
32468c4a8e55Smrg  (eval "$ac_compile" 2>conftest.err)
32478c4a8e55Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
32488c4a8e55Smrg  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
32498c4a8e55Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
32508c4a8e55Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
32518c4a8e55Smrg  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
32528c4a8e55Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
32538c4a8e55Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
32548c4a8e55Smrg    lt_cv_nm_interface="MS dumpbin"
32558c4a8e55Smrg  fi
32568c4a8e55Smrg  rm -f conftest*])
32578c4a8e55Smrg])# LT_PATH_NM
3258b042e37fSmrg
32598c4a8e55Smrg# Old names:
32608c4a8e55SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
32618c4a8e55SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
32628c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
32638c4a8e55Smrgdnl AC_DEFUN([AM_PROG_NM], [])
32648c4a8e55Smrgdnl AC_DEFUN([AC_PROG_NM], [])
3265b042e37fSmrg
32668c4a8e55Smrg
32678c4a8e55Smrg# LT_LIB_M
32688c4a8e55Smrg# --------
3269b042e37fSmrg# check for math library
32708c4a8e55SmrgAC_DEFUN([LT_LIB_M],
3271b042e37fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3272b042e37fSmrgLIBM=
3273b042e37fSmrgcase $host in
3274b042e37fSmrg*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
3275b042e37fSmrg  # These system don't have libm, or don't need it
3276b042e37fSmrg  ;;
3277b042e37fSmrg*-ncr-sysv4.3*)
3278b042e37fSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3279b042e37fSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3280b042e37fSmrg  ;;
3281b042e37fSmrg*)
3282b042e37fSmrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
3283b042e37fSmrg  ;;
3284b042e37fSmrgesac
32858c4a8e55SmrgAC_SUBST([LIBM])
32868c4a8e55Smrg])# LT_LIB_M
3287b042e37fSmrg
32888c4a8e55Smrg# Old name:
32898c4a8e55SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
32908c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
32918c4a8e55Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3292b042e37fSmrg
3293b042e37fSmrg
32948c4a8e55Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
32958c4a8e55Smrg# -------------------------------
32968c4a8e55Smrgm4_defun([_LT_COMPILER_NO_RTTI],
32978c4a8e55Smrg[m4_require([_LT_TAG_COMPILER])dnl
3298b042e37fSmrg
32998c4a8e55Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3300b042e37fSmrg
33018c4a8e55Smrgif test "$GCC" = yes; then
33028c4a8e55Smrg  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
3303b042e37fSmrg
33048c4a8e55Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
33058c4a8e55Smrg    lt_cv_prog_compiler_rtti_exceptions,
33068c4a8e55Smrg    [-fno-rtti -fno-exceptions], [],
33078c4a8e55Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3308b042e37fSmrgfi
33098c4a8e55Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
33108c4a8e55Smrg	[Compiler flag to turn off builtin functions])
33118c4a8e55Smrg])# _LT_COMPILER_NO_RTTI
3312b042e37fSmrg
3313b042e37fSmrg
33148c4a8e55Smrg# _LT_CMD_GLOBAL_SYMBOLS
33158c4a8e55Smrg# ----------------------
33168c4a8e55Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
33178c4a8e55Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
33188c4a8e55SmrgAC_REQUIRE([AC_PROG_CC])dnl
33198c4a8e55SmrgAC_REQUIRE([LT_PATH_NM])dnl
33208c4a8e55SmrgAC_REQUIRE([LT_PATH_LD])dnl
33218c4a8e55Smrgm4_require([_LT_DECL_SED])dnl
33228c4a8e55Smrgm4_require([_LT_DECL_EGREP])dnl
33238c4a8e55Smrgm4_require([_LT_TAG_COMPILER])dnl
3324b042e37fSmrg
33258c4a8e55Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
33268c4a8e55SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
33278c4a8e55SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
33288c4a8e55Smrg[
33298c4a8e55Smrg# These are sane defaults that work on at least a few old systems.
33308c4a8e55Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3331b042e37fSmrg
33328c4a8e55Smrg# Character class describing NM global symbol codes.
33338c4a8e55Smrgsymcode='[[BCDEGRST]]'
3334b042e37fSmrg
33358c4a8e55Smrg# Regexp to match symbols that can be accessed directly from C.
33368c4a8e55Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3337b042e37fSmrg
33388c4a8e55Smrg# Define system-specific variables.
3339b042e37fSmrgcase $host_os in
33408c4a8e55Smrgaix*)
33418c4a8e55Smrg  symcode='[[BCDT]]'
3342b042e37fSmrg  ;;
33438c4a8e55Smrgcygwin* | mingw* | pw32* | cegcc*)
33448c4a8e55Smrg  symcode='[[ABCDGISTW]]'
33458c4a8e55Smrg  ;;
33468c4a8e55Smrghpux*)
33478c4a8e55Smrg  if test "$host_cpu" = ia64; then
33488c4a8e55Smrg    symcode='[[ABCDEGRST]]'
3349b042e37fSmrg  fi
33508c4a8e55Smrg  ;;
33518c4a8e55Smrgirix* | nonstopux*)
33528c4a8e55Smrg  symcode='[[BCDEGRST]]'
33538c4a8e55Smrg  ;;
33548c4a8e55Smrgosf*)
33558c4a8e55Smrg  symcode='[[BCDEGQRST]]'
33568c4a8e55Smrg  ;;
33578c4a8e55Smrgsolaris*)
33588c4a8e55Smrg  symcode='[[BDRT]]'
33598c4a8e55Smrg  ;;
33608c4a8e55Smrgsco3.2v5*)
33618c4a8e55Smrg  symcode='[[DT]]'
33628c4a8e55Smrg  ;;
33638c4a8e55Smrgsysv4.2uw2*)
33648c4a8e55Smrg  symcode='[[DT]]'
33658c4a8e55Smrg  ;;
33668c4a8e55Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
33678c4a8e55Smrg  symcode='[[ABDT]]'
33688c4a8e55Smrg  ;;
33698c4a8e55Smrgsysv4)
33708c4a8e55Smrg  symcode='[[DFNSTU]]'
33718c4a8e55Smrg  ;;
3372b042e37fSmrgesac
3373b042e37fSmrg
33748c4a8e55Smrg# If we're using GNU nm, then use its standard symbol codes.
33758c4a8e55Smrgcase `$NM -V 2>&1` in
33768c4a8e55Smrg*GNU* | *'with BFD'*)
33778c4a8e55Smrg  symcode='[[ABCDGIRSTW]]' ;;
33788c4a8e55Smrgesac
3379b042e37fSmrg
33808c4a8e55Smrg# Transform an extracted symbol line into a proper C declaration.
33818c4a8e55Smrg# Some systems (esp. on ia64) link data and code symbols differently,
33828c4a8e55Smrg# so use this general approach.
33838c4a8e55Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3384b042e37fSmrg
33858c4a8e55Smrg# Transform an extracted symbol line into symbol name and symbol address
33868c4a8e55Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
33878c4a8e55Smrglt_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'"
3388b042e37fSmrg
33898c4a8e55Smrg# Handle CRLF in mingw tool chain
33908c4a8e55Smrgopt_cr=
33918c4a8e55Smrgcase $build_os in
33928c4a8e55Smrgmingw*)
33938c4a8e55Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
33948c4a8e55Smrg  ;;
33958c4a8e55Smrgesac
3396b042e37fSmrg
33978c4a8e55Smrg# Try without a prefix underscore, then with it.
33988c4a8e55Smrgfor ac_symprfx in "" "_"; do
3399b042e37fSmrg
34008c4a8e55Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
34018c4a8e55Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
3402b042e37fSmrg
34038c4a8e55Smrg  # Write the raw and C identifiers.
34048c4a8e55Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
34058c4a8e55Smrg    # Fake it for dumpbin and say T for any non-static function
34068c4a8e55Smrg    # and D for any global variable.
34078c4a8e55Smrg    # Also find C++ and __fastcall symbols from MSVC++,
34088c4a8e55Smrg    # which start with @ or ?.
34098c4a8e55Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
34108c4a8e55Smrg"     {last_section=section; section=\$ 3};"\
34118c4a8e55Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
34128c4a8e55Smrg"     \$ 0!~/External *\|/{next};"\
34138c4a8e55Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
34148c4a8e55Smrg"     {if(hide[section]) next};"\
34158c4a8e55Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
34168c4a8e55Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
34178c4a8e55Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
34188c4a8e55Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
34198c4a8e55Smrg"     ' prfx=^$ac_symprfx]"
34208c4a8e55Smrg  else
34218c4a8e55Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
34228c4a8e55Smrg  fi
3423b042e37fSmrg
34248c4a8e55Smrg  # Check to see that the pipe works correctly.
34258c4a8e55Smrg  pipe_works=no
3426b042e37fSmrg
34278c4a8e55Smrg  rm -f conftest*
34288c4a8e55Smrg  cat > conftest.$ac_ext <<_LT_EOF
34298c4a8e55Smrg#ifdef __cplusplus
34308c4a8e55Smrgextern "C" {
34318c4a8e55Smrg#endif
34328c4a8e55Smrgchar nm_test_var;
34338c4a8e55Smrgvoid nm_test_func(void);
34348c4a8e55Smrgvoid nm_test_func(void){}
34358c4a8e55Smrg#ifdef __cplusplus
34368c4a8e55Smrg}
34378c4a8e55Smrg#endif
34388c4a8e55Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
34398c4a8e55Smrg_LT_EOF
3440b042e37fSmrg
34418c4a8e55Smrg  if AC_TRY_EVAL(ac_compile); then
34428c4a8e55Smrg    # Now try to grab the symbols.
34438c4a8e55Smrg    nlist=conftest.nm
34448c4a8e55Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
34458c4a8e55Smrg      # Try sorting and uniquifying the output.
34468c4a8e55Smrg      if sort "$nlist" | uniq > "$nlist"T; then
34478c4a8e55Smrg	mv -f "$nlist"T "$nlist"
34488c4a8e55Smrg      else
34498c4a8e55Smrg	rm -f "$nlist"T
34508c4a8e55Smrg      fi
3451b042e37fSmrg
34528c4a8e55Smrg      # Make sure that we snagged all the symbols we need.
34538c4a8e55Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
34548c4a8e55Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
34558c4a8e55Smrg	  cat <<_LT_EOF > conftest.$ac_ext
34568c4a8e55Smrg#ifdef __cplusplus
34578c4a8e55Smrgextern "C" {
34588c4a8e55Smrg#endif
3459b042e37fSmrg
34608c4a8e55Smrg_LT_EOF
34618c4a8e55Smrg	  # Now generate the symbol file.
34628c4a8e55Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3463b042e37fSmrg
34648c4a8e55Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
3465b042e37fSmrg
34668c4a8e55Smrg/* The mapping between symbol names and symbols.  */
34678c4a8e55Smrgconst struct {
34688c4a8e55Smrg  const char *name;
34698c4a8e55Smrg  void       *address;
34708c4a8e55Smrg}
34718c4a8e55Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
34728c4a8e55Smrg{
34738c4a8e55Smrg  { "@PROGRAM@", (void *) 0 },
34748c4a8e55Smrg_LT_EOF
34758c4a8e55Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
34768c4a8e55Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
34778c4a8e55Smrg  {0, (void *) 0}
34788c4a8e55Smrg};
3479b042e37fSmrg
34808c4a8e55Smrg/* This works around a problem in FreeBSD linker */
34818c4a8e55Smrg#ifdef FREEBSD_WORKAROUND
34828c4a8e55Smrgstatic const void *lt_preloaded_setup() {
34838c4a8e55Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
34848c4a8e55Smrg}
34858c4a8e55Smrg#endif
3486b042e37fSmrg
34878c4a8e55Smrg#ifdef __cplusplus
34888c4a8e55Smrg}
34898c4a8e55Smrg#endif
34908c4a8e55Smrg_LT_EOF
34918c4a8e55Smrg	  # Now try linking the two files.
34928c4a8e55Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
34938c4a8e55Smrg	  lt_save_LIBS="$LIBS"
34948c4a8e55Smrg	  lt_save_CFLAGS="$CFLAGS"
34958c4a8e55Smrg	  LIBS="conftstm.$ac_objext"
34968c4a8e55Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
34978c4a8e55Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
34988c4a8e55Smrg	    pipe_works=yes
34998c4a8e55Smrg	  fi
35008c4a8e55Smrg	  LIBS="$lt_save_LIBS"
35018c4a8e55Smrg	  CFLAGS="$lt_save_CFLAGS"
35028c4a8e55Smrg	else
35038c4a8e55Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
35048c4a8e55Smrg	fi
35058c4a8e55Smrg      else
35068c4a8e55Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
35078c4a8e55Smrg      fi
3508b042e37fSmrg    else
35098c4a8e55Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3510b042e37fSmrg    fi
3511b042e37fSmrg  else
35128c4a8e55Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
35138c4a8e55Smrg    cat conftest.$ac_ext >&5
3514b042e37fSmrg  fi
35158c4a8e55Smrg  rm -rf conftest* conftst*
3516b042e37fSmrg
35178c4a8e55Smrg  # Do not use the global_symbol_pipe unless it works.
35188c4a8e55Smrg  if test "$pipe_works" = yes; then
35198c4a8e55Smrg    break
35208c4a8e55Smrg  else
35218c4a8e55Smrg    lt_cv_sys_global_symbol_pipe=
35228c4a8e55Smrg  fi
35238c4a8e55Smrgdone
35248c4a8e55Smrg])
35258c4a8e55Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
35268c4a8e55Smrg  lt_cv_sys_global_symbol_to_cdecl=
35278c4a8e55Smrgfi
35288c4a8e55Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
35298c4a8e55Smrg  AC_MSG_RESULT(failed)
3530b042e37fSmrgelse
35318c4a8e55Smrg  AC_MSG_RESULT(ok)
3532b042e37fSmrgfi
3533b042e37fSmrg
35348c4a8e55Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
35358c4a8e55Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
35368c4a8e55Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
35378c4a8e55Smrg    [Transform the output of nm in a proper C declaration])
35388c4a8e55Smrg_LT_DECL([global_symbol_to_c_name_address],
35398c4a8e55Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
35408c4a8e55Smrg    [Transform the output of nm in a C name address pair])
35418c4a8e55Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
35428c4a8e55Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
35438c4a8e55Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
35448c4a8e55Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
3545b042e37fSmrg
3546b042e37fSmrg
35478c4a8e55Smrg# _LT_COMPILER_PIC([TAGNAME])
35488c4a8e55Smrg# ---------------------------
35498c4a8e55Smrgm4_defun([_LT_COMPILER_PIC],
35508c4a8e55Smrg[m4_require([_LT_TAG_COMPILER])dnl
35518c4a8e55Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
35528c4a8e55Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
35538c4a8e55Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
3554b042e37fSmrg
35558c4a8e55SmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
35568c4a8e55Smrgm4_if([$1], [CXX], [
35578c4a8e55Smrg  # C++ specific cases for pic, static, wl, etc.
35588c4a8e55Smrg  if test "$GXX" = yes; then
35598c4a8e55Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
35608c4a8e55Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3561b042e37fSmrg
35628c4a8e55Smrg    case $host_os in
35638c4a8e55Smrg    aix*)
35648c4a8e55Smrg      # All AIX code is PIC.
3565b042e37fSmrg      if test "$host_cpu" = ia64; then
35668c4a8e55Smrg	# AIX 5 now supports IA64 processor
35678c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3568b042e37fSmrg      fi
35698c4a8e55Smrg      ;;
3570b042e37fSmrg
35718c4a8e55Smrg    amigaos*)
35728c4a8e55Smrg      case $host_cpu in
35738c4a8e55Smrg      powerpc)
35748c4a8e55Smrg            # see comment about AmigaOS4 .so support
35758c4a8e55Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3576b042e37fSmrg        ;;
35778c4a8e55Smrg      m68k)
35788c4a8e55Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
35798c4a8e55Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
35808c4a8e55Smrg            # like `-m68040'.
35818c4a8e55Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
35828c4a8e55Smrg        ;;
35838c4a8e55Smrg      esac
35848c4a8e55Smrg      ;;
3585b042e37fSmrg
35868c4a8e55Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
35878c4a8e55Smrg      # PIC is the default for these OSes.
3588b042e37fSmrg      ;;
35898c4a8e55Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
35908c4a8e55Smrg      # This hack is so that the source file can tell whether it is being
35918c4a8e55Smrg      # built for inclusion in a dll (and should export symbols for example).
35928c4a8e55Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
35938c4a8e55Smrg      # (--disable-auto-import) libraries
35948c4a8e55Smrg      m4_if([$1], [GCJ], [],
35958c4a8e55Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3596b042e37fSmrg      ;;
35978c4a8e55Smrg    darwin* | rhapsody*)
35988c4a8e55Smrg      # PIC is the default on this platform
35998c4a8e55Smrg      # Common symbols not allowed in MH_DYLIB files
36008c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
36018c4a8e55Smrg      ;;
36028c4a8e55Smrg    *djgpp*)
36038c4a8e55Smrg      # DJGPP does not support shared libraries at all
36048c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
36058c4a8e55Smrg      ;;
36068c4a8e55Smrg    interix[[3-9]]*)
36078c4a8e55Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
36088c4a8e55Smrg      # Instead, we relocate shared libraries at runtime.
36098c4a8e55Smrg      ;;
36108c4a8e55Smrg    sysv4*MP*)
36118c4a8e55Smrg      if test -d /usr/nec; then
36128c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3613b042e37fSmrg      fi
3614b042e37fSmrg      ;;
36158c4a8e55Smrg    hpux*)
36168c4a8e55Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
36178c4a8e55Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
36188c4a8e55Smrg      # sets the default TLS model and affects inlining.
3619b042e37fSmrg      case $host_cpu in
36208c4a8e55Smrg      hppa*64*)
36218c4a8e55Smrg	;;
3622b042e37fSmrg      *)
36238c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
36248c4a8e55Smrg	;;
3625b042e37fSmrg      esac
36268c4a8e55Smrg      ;;
36278c4a8e55Smrg    *qnx* | *nto*)
36288c4a8e55Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
36298c4a8e55Smrg      # it will coredump.
36308c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3631b042e37fSmrg      ;;
3632b042e37fSmrg    *)
36338c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3634b042e37fSmrg      ;;
3635b042e37fSmrg    esac
36368c4a8e55Smrg  else
36378c4a8e55Smrg    case $host_os in
36388c4a8e55Smrg      aix[[4-9]]*)
36398c4a8e55Smrg	# All AIX code is PIC.
36408c4a8e55Smrg	if test "$host_cpu" = ia64; then
36418c4a8e55Smrg	  # AIX 5 now supports IA64 processor
36428c4a8e55Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
36438c4a8e55Smrg	else
36448c4a8e55Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
36458c4a8e55Smrg	fi
3646b042e37fSmrg	;;
36478c4a8e55Smrg      chorus*)
36488c4a8e55Smrg	case $cc_basename in
36498c4a8e55Smrg	cxch68*)
36508c4a8e55Smrg	  # Green Hills C++ Compiler
36518c4a8e55Smrg	  # _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"
3652b042e37fSmrg	  ;;
3653b042e37fSmrg	esac
3654b042e37fSmrg	;;
36558c4a8e55Smrg      dgux*)
36568c4a8e55Smrg	case $cc_basename in
36578c4a8e55Smrg	  ec++*)
36588c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
36598c4a8e55Smrg	    ;;
36608c4a8e55Smrg	  ghcx*)
36618c4a8e55Smrg	    # Green Hills C++ Compiler
36628c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
36638c4a8e55Smrg	    ;;
36648c4a8e55Smrg	  *)
36658c4a8e55Smrg	    ;;
36668c4a8e55Smrg	esac
36678c4a8e55Smrg	;;
36688c4a8e55Smrg      freebsd* | dragonfly*)
36698c4a8e55Smrg	# FreeBSD uses GNU C++
36708c4a8e55Smrg	;;
36718c4a8e55Smrg      hpux9* | hpux10* | hpux11*)
36728c4a8e55Smrg	case $cc_basename in
36738c4a8e55Smrg	  CC*)
36748c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
36758c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
36768c4a8e55Smrg	    if test "$host_cpu" != ia64; then
36778c4a8e55Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
36788c4a8e55Smrg	    fi
36798c4a8e55Smrg	    ;;
36808c4a8e55Smrg	  aCC*)
36818c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
36828c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3683b042e37fSmrg	    case $host_cpu in
36848c4a8e55Smrg	    hppa*64*|ia64*)
36858c4a8e55Smrg	      # +Z the default
3686b042e37fSmrg	      ;;
3687b042e37fSmrg	    *)
36888c4a8e55Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3689b042e37fSmrg	      ;;
3690b042e37fSmrg	    esac
36918c4a8e55Smrg	    ;;
36928c4a8e55Smrg	  *)
36938c4a8e55Smrg	    ;;
3694b042e37fSmrg	esac
3695b042e37fSmrg	;;
36968c4a8e55Smrg      interix*)
36978c4a8e55Smrg	# This is c89, which is MS Visual C++ (no shared libs)
36988c4a8e55Smrg	# Anyone wants to do a port?
3699b042e37fSmrg	;;
37008c4a8e55Smrg      irix5* | irix6* | nonstopux*)
37018c4a8e55Smrg	case $cc_basename in
37028c4a8e55Smrg	  CC*)
37038c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37048c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
37058c4a8e55Smrg	    # CC pic flag -KPIC is the default.
37068c4a8e55Smrg	    ;;
37078c4a8e55Smrg	  *)
37088c4a8e55Smrg	    ;;
37098c4a8e55Smrg	esac
3710b042e37fSmrg	;;
37118c4a8e55Smrg      linux* | k*bsd*-gnu)
37128c4a8e55Smrg	case $cc_basename in
37138c4a8e55Smrg	  KCC*)
37148c4a8e55Smrg	    # KAI C++ Compiler
37158c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
37168c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
37178c4a8e55Smrg	    ;;
37188c4a8e55Smrg	  ecpc* )
37198c4a8e55Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
37208c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37218c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37228c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
37238c4a8e55Smrg	    ;;
37248c4a8e55Smrg	  icpc* )
37258c4a8e55Smrg	    # Intel C++, used to be incompatible with GCC.
37268c4a8e55Smrg	    # ICC 10 doesn't accept -KPIC any more.
37278c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37288c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
37298c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
37308c4a8e55Smrg	    ;;
37318c4a8e55Smrg	  pgCC* | pgcpp*)
37328c4a8e55Smrg	    # Portland Group C++ compiler
37338c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37348c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
37358c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37368c4a8e55Smrg	    ;;
37378c4a8e55Smrg	  cxx*)
37388c4a8e55Smrg	    # Compaq C++
37398c4a8e55Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
37408c4a8e55Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
37418c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
37428c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
37438c4a8e55Smrg	    ;;
37448c4a8e55Smrg	  xlc* | xlC*)
37458c4a8e55Smrg	    # IBM XL 8.0 on PPC
37468c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37478c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
37488c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
37498c4a8e55Smrg	    ;;
37508c4a8e55Smrg	  *)
37518c4a8e55Smrg	    case `$CC -V 2>&1 | sed 5q` in
37528c4a8e55Smrg	    *Sun\ C*)
37538c4a8e55Smrg	      # Sun C++ 5.9
37548c4a8e55Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37558c4a8e55Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37568c4a8e55Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
37578c4a8e55Smrg	      ;;
37588c4a8e55Smrg	    esac
37598c4a8e55Smrg	    ;;
37608c4a8e55Smrg	esac
3761b042e37fSmrg	;;
37628c4a8e55Smrg      lynxos*)
3763b042e37fSmrg	;;
37648c4a8e55Smrg      m88k*)
3765b042e37fSmrg	;;
37668c4a8e55Smrg      mvs*)
37678c4a8e55Smrg	case $cc_basename in
37688c4a8e55Smrg	  cxx*)
37698c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
37708c4a8e55Smrg	    ;;
37718c4a8e55Smrg	  *)
37728c4a8e55Smrg	    ;;
37738c4a8e55Smrg	esac
3774b042e37fSmrg	;;
37758c4a8e55Smrg      netbsd*)
3776b042e37fSmrg	;;
37778c4a8e55Smrg      *qnx* | *nto*)
37788c4a8e55Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
37798c4a8e55Smrg        # it will coredump.
37808c4a8e55Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
37818c4a8e55Smrg        ;;
37828c4a8e55Smrg      osf3* | osf4* | osf5*)
37838c4a8e55Smrg	case $cc_basename in
37848c4a8e55Smrg	  KCC*)
37858c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
37868c4a8e55Smrg	    ;;
37878c4a8e55Smrg	  RCC*)
37888c4a8e55Smrg	    # Rational C++ 2.4.1
37898c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
37908c4a8e55Smrg	    ;;
37918c4a8e55Smrg	  cxx*)
37928c4a8e55Smrg	    # Digital/Compaq C++
37938c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37948c4a8e55Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
37958c4a8e55Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
37968c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
37978c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
37988c4a8e55Smrg	    ;;
37998c4a8e55Smrg	  *)
38008c4a8e55Smrg	    ;;
38018c4a8e55Smrg	esac
3802b042e37fSmrg	;;
38038c4a8e55Smrg      psos*)
3804b042e37fSmrg	;;
38058c4a8e55Smrg      solaris*)
38068c4a8e55Smrg	case $cc_basename in
38078c4a8e55Smrg	  CC*)
38088c4a8e55Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
38098c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
38108c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
38118c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
38128c4a8e55Smrg	    ;;
38138c4a8e55Smrg	  gcx*)
38148c4a8e55Smrg	    # Green Hills C++ Compiler
38158c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
38168c4a8e55Smrg	    ;;
38178c4a8e55Smrg	  *)
38188c4a8e55Smrg	    ;;
38198c4a8e55Smrg	esac
3820b042e37fSmrg	;;
38218c4a8e55Smrg      sunos4*)
38228c4a8e55Smrg	case $cc_basename in
38238c4a8e55Smrg	  CC*)
38248c4a8e55Smrg	    # Sun C++ 4.x
38258c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
38268c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
38278c4a8e55Smrg	    ;;
38288c4a8e55Smrg	  lcc*)
38298c4a8e55Smrg	    # Lucid
38308c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
38318c4a8e55Smrg	    ;;
38328c4a8e55Smrg	  *)
38338c4a8e55Smrg	    ;;
38348c4a8e55Smrg	esac
3835b042e37fSmrg	;;
38368c4a8e55Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
38378c4a8e55Smrg	case $cc_basename in
38388c4a8e55Smrg	  CC*)
38398c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
38408c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
38418c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
38428c4a8e55Smrg	    ;;
38438c4a8e55Smrg	esac
3844b042e37fSmrg	;;
38458c4a8e55Smrg      tandem*)
38468c4a8e55Smrg	case $cc_basename in
38478c4a8e55Smrg	  NCC*)
38488c4a8e55Smrg	    # NonStop-UX NCC 3.20
38498c4a8e55Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
38508c4a8e55Smrg	    ;;
3851b042e37fSmrg	  *)
3852b042e37fSmrg	    ;;
3853b042e37fSmrg	esac
3854b042e37fSmrg	;;
38558c4a8e55Smrg      vxworks*)
3856b042e37fSmrg	;;
3857b042e37fSmrg      *)
38588c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
38598c4a8e55Smrg	;;
38608c4a8e55Smrg    esac
38618c4a8e55Smrg  fi
38628c4a8e55Smrg],
38638c4a8e55Smrg[
38648c4a8e55Smrg  if test "$GCC" = yes; then
38658c4a8e55Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
38668c4a8e55Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3867b042e37fSmrg
38688c4a8e55Smrg    case $host_os in
38698c4a8e55Smrg      aix*)
38708c4a8e55Smrg      # All AIX code is PIC.
38718c4a8e55Smrg      if test "$host_cpu" = ia64; then
38728c4a8e55Smrg	# AIX 5 now supports IA64 processor
38738c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
38748c4a8e55Smrg      fi
38758c4a8e55Smrg      ;;
3876b042e37fSmrg
38778c4a8e55Smrg    amigaos*)
38788c4a8e55Smrg      case $host_cpu in
38798c4a8e55Smrg      powerpc)
38808c4a8e55Smrg            # see comment about AmigaOS4 .so support
38818c4a8e55Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
38828c4a8e55Smrg        ;;
38838c4a8e55Smrg      m68k)
38848c4a8e55Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
38858c4a8e55Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
38868c4a8e55Smrg            # like `-m68040'.
38878c4a8e55Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
38888c4a8e55Smrg        ;;
38898c4a8e55Smrg      esac
38908c4a8e55Smrg      ;;
3891b042e37fSmrg
38928c4a8e55Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
38938c4a8e55Smrg      # PIC is the default for these OSes.
38948c4a8e55Smrg      ;;
38958c4a8e55Smrg
38968c4a8e55Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
38978c4a8e55Smrg      # This hack is so that the source file can tell whether it is being
38988c4a8e55Smrg      # built for inclusion in a dll (and should export symbols for example).
38998c4a8e55Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
39008c4a8e55Smrg      # (--disable-auto-import) libraries
39018c4a8e55Smrg      m4_if([$1], [GCJ], [],
39028c4a8e55Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
39038c4a8e55Smrg      ;;
39048c4a8e55Smrg
39058c4a8e55Smrg    darwin* | rhapsody*)
39068c4a8e55Smrg      # PIC is the default on this platform
39078c4a8e55Smrg      # Common symbols not allowed in MH_DYLIB files
39088c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
39098c4a8e55Smrg      ;;
39108c4a8e55Smrg
39118c4a8e55Smrg    hpux*)
39128c4a8e55Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
39138c4a8e55Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
39148c4a8e55Smrg      # sets the default TLS model and affects inlining.
39158c4a8e55Smrg      case $host_cpu in
39168c4a8e55Smrg      hppa*64*)
39178c4a8e55Smrg	# +Z the default
3918b042e37fSmrg	;;
3919b042e37fSmrg      *)
39208c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3921b042e37fSmrg	;;
39228c4a8e55Smrg      esac
39238c4a8e55Smrg      ;;
39248c4a8e55Smrg
39258c4a8e55Smrg    interix[[3-9]]*)
39268c4a8e55Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
39278c4a8e55Smrg      # Instead, we relocate shared libraries at runtime.
39288c4a8e55Smrg      ;;
39298c4a8e55Smrg
39308c4a8e55Smrg    msdosdjgpp*)
39318c4a8e55Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
39328c4a8e55Smrg      # on systems that don't support them.
39338c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
39348c4a8e55Smrg      enable_shared=no
39358c4a8e55Smrg      ;;
39368c4a8e55Smrg
39378c4a8e55Smrg    *nto* | *qnx*)
39388c4a8e55Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
39398c4a8e55Smrg      # it will coredump.
39408c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
39418c4a8e55Smrg      ;;
39428c4a8e55Smrg
39438c4a8e55Smrg    sysv4*MP*)
39448c4a8e55Smrg      if test -d /usr/nec; then
39458c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
39468c4a8e55Smrg      fi
39478c4a8e55Smrg      ;;
39488c4a8e55Smrg
39498c4a8e55Smrg    *)
39508c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39518c4a8e55Smrg      ;;
3952b042e37fSmrg    esac
39538c4a8e55Smrg  else
39548c4a8e55Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
39558c4a8e55Smrg    case $host_os in
39568c4a8e55Smrg    aix*)
39578c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
39588c4a8e55Smrg      if test "$host_cpu" = ia64; then
39598c4a8e55Smrg	# AIX 5 now supports IA64 processor
39608c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
39618c4a8e55Smrg      else
39628c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
39638c4a8e55Smrg      fi
39648c4a8e55Smrg      ;;
39658c4a8e55Smrg
39668c4a8e55Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
39678c4a8e55Smrg      # This hack is so that the source file can tell whether it is being
39688c4a8e55Smrg      # built for inclusion in a dll (and should export symbols for example).
39698c4a8e55Smrg      m4_if([$1], [GCJ], [],
39708c4a8e55Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
39718c4a8e55Smrg      ;;
39728c4a8e55Smrg
39738c4a8e55Smrg    hpux9* | hpux10* | hpux11*)
39748c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
39758c4a8e55Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
39768c4a8e55Smrg      # not for PA HP-UX.
39778c4a8e55Smrg      case $host_cpu in
39788c4a8e55Smrg      hppa*64*|ia64*)
39798c4a8e55Smrg	# +Z the default
3980b042e37fSmrg	;;
3981b042e37fSmrg      *)
39828c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3983b042e37fSmrg	;;
39848c4a8e55Smrg      esac
39858c4a8e55Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
39868c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
39878c4a8e55Smrg      ;;
39888c4a8e55Smrg
39898c4a8e55Smrg    irix5* | irix6* | nonstopux*)
39908c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
39918c4a8e55Smrg      # PIC (with -KPIC) is the default.
39928c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
39938c4a8e55Smrg      ;;
39948c4a8e55Smrg
39958c4a8e55Smrg    linux* | k*bsd*-gnu)
39968c4a8e55Smrg      case $cc_basename in
39978c4a8e55Smrg      # old Intel for x86_64 which still supported -KPIC.
39988c4a8e55Smrg      ecc*)
39998c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40008c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40018c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
40028c4a8e55Smrg        ;;
40038c4a8e55Smrg      # icc used to be incompatible with GCC.
40048c4a8e55Smrg      # ICC 10 doesn't accept -KPIC any more.
40058c4a8e55Smrg      icc* | ifort*)
40068c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40078c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
40088c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
40098c4a8e55Smrg        ;;
40108c4a8e55Smrg      # Lahey Fortran 8.1.
40118c4a8e55Smrg      lf95*)
40128c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40138c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
40148c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
40158c4a8e55Smrg	;;
40168c4a8e55Smrg      pgcc* | pgf77* | pgf90* | pgf95*)
40178c4a8e55Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
40188c4a8e55Smrg	# which looks to be a dead project)
40198c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40208c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
40218c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
40228c4a8e55Smrg        ;;
40238c4a8e55Smrg      ccc*)
40248c4a8e55Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40258c4a8e55Smrg        # All Alpha code is PIC.
40268c4a8e55Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40278c4a8e55Smrg        ;;
40288c4a8e55Smrg      xl*)
40298c4a8e55Smrg	# IBM XL C 8.0/Fortran 10.1 on PPC
40308c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40318c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
40328c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4033b042e37fSmrg	;;
4034b042e37fSmrg      *)
40358c4a8e55Smrg	case `$CC -V 2>&1 | sed 5q` in
40368c4a8e55Smrg	*Sun\ C*)
40378c4a8e55Smrg	  # Sun C 5.9
40388c4a8e55Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40398c4a8e55Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
40408c4a8e55Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40418c4a8e55Smrg	  ;;
40428c4a8e55Smrg	*Sun\ F*)
40438c4a8e55Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
40448c4a8e55Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40458c4a8e55Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
40468c4a8e55Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
40478c4a8e55Smrg	  ;;
40488c4a8e55Smrg	esac
4049b042e37fSmrg	;;
40508c4a8e55Smrg      esac
40518c4a8e55Smrg      ;;
4052b042e37fSmrg
40538c4a8e55Smrg    newsos6)
40548c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40558c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
40568c4a8e55Smrg      ;;
4057b042e37fSmrg
40588c4a8e55Smrg    *nto* | *qnx*)
40598c4a8e55Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
40608c4a8e55Smrg      # it will coredump.
40618c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
40628c4a8e55Smrg      ;;
4063b042e37fSmrg
40648c4a8e55Smrg    osf3* | osf4* | osf5*)
40658c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40668c4a8e55Smrg      # All OSF/1 code is PIC.
40678c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40688c4a8e55Smrg      ;;
4069b042e37fSmrg
40708c4a8e55Smrg    rdos*)
40718c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40728c4a8e55Smrg      ;;
4073b042e37fSmrg
40748c4a8e55Smrg    solaris*)
40758c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40768c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
40778c4a8e55Smrg      case $cc_basename in
40788c4a8e55Smrg      f77* | f90* | f95*)
40798c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
40808c4a8e55Smrg      *)
40818c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
40828c4a8e55Smrg      esac
40838c4a8e55Smrg      ;;
4084b042e37fSmrg
40858c4a8e55Smrg    sunos4*)
40868c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
40878c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
40888c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
40898c4a8e55Smrg      ;;
4090b042e37fSmrg
40918c4a8e55Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
40928c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40938c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40948c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
40958c4a8e55Smrg      ;;
4096b042e37fSmrg
40978c4a8e55Smrg    sysv4*MP*)
40988c4a8e55Smrg      if test -d /usr/nec ;then
40998c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
41008c4a8e55Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41018c4a8e55Smrg      fi
41028c4a8e55Smrg      ;;
4103b042e37fSmrg
41048c4a8e55Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
41058c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41068c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41078c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41088c4a8e55Smrg      ;;
4109b042e37fSmrg
41108c4a8e55Smrg    unicos*)
41118c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41128c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
41138c4a8e55Smrg      ;;
4114b042e37fSmrg
41158c4a8e55Smrg    uts4*)
41168c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
41178c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41188c4a8e55Smrg      ;;
4119b042e37fSmrg
41208c4a8e55Smrg    *)
41218c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
41228c4a8e55Smrg      ;;
4123b042e37fSmrg    esac
41248c4a8e55Smrg  fi
41258c4a8e55Smrg])
41268c4a8e55Smrgcase $host_os in
41278c4a8e55Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
41288c4a8e55Smrg  *djgpp*)
41298c4a8e55Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
41308c4a8e55Smrg    ;;
41318c4a8e55Smrg  *)
41328c4a8e55Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
41338c4a8e55Smrg    ;;
41348c4a8e55Smrgesac
41358c4a8e55SmrgAC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
41368c4a8e55Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
41378c4a8e55Smrg	[How to pass a linker flag through the compiler])
4138b042e37fSmrg
41398c4a8e55Smrg#
41408c4a8e55Smrg# Check to make sure the PIC flag actually works.
41418c4a8e55Smrg#
41428c4a8e55Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
41438c4a8e55Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
41448c4a8e55Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
41458c4a8e55Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
41468c4a8e55Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
41478c4a8e55Smrg     "" | " "*) ;;
41488c4a8e55Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
41498c4a8e55Smrg     esac],
41508c4a8e55Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
41518c4a8e55Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4152b042e37fSmrgfi
41538c4a8e55Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
41548c4a8e55Smrg	[Additional compiler flags for building library objects])
4155b042e37fSmrg
41568c4a8e55Smrg#
41578c4a8e55Smrg# Check to make sure the static flag actually works.
41588c4a8e55Smrg#
41598c4a8e55Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
41608c4a8e55Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
41618c4a8e55Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
41628c4a8e55Smrg  $lt_tmp_static_flag,
41638c4a8e55Smrg  [],
41648c4a8e55Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
41658c4a8e55Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
41668c4a8e55Smrg	[Compiler flag to prevent dynamic linking])
41678c4a8e55Smrg])# _LT_COMPILER_PIC
4168b042e37fSmrg
4169b042e37fSmrg
41708c4a8e55Smrg# _LT_LINKER_SHLIBS([TAGNAME])
41718c4a8e55Smrg# ----------------------------
41728c4a8e55Smrg# See if the linker supports building shared libraries.
41738c4a8e55Smrgm4_defun([_LT_LINKER_SHLIBS],
41748c4a8e55Smrg[AC_REQUIRE([LT_PATH_LD])dnl
41758c4a8e55SmrgAC_REQUIRE([LT_PATH_NM])dnl
41768c4a8e55Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
41778c4a8e55Smrgm4_require([_LT_DECL_EGREP])dnl
41788c4a8e55Smrgm4_require([_LT_DECL_SED])dnl
41798c4a8e55Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
41808c4a8e55Smrgm4_require([_LT_TAG_COMPILER])dnl
41818c4a8e55SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
41828c4a8e55Smrgm4_if([$1], [CXX], [
41838c4a8e55Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
41848c4a8e55Smrg  case $host_os in
41858c4a8e55Smrg  aix[[4-9]]*)
41868c4a8e55Smrg    # If we're using GNU nm, then we don't want the "-C" option.
41878c4a8e55Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
41888c4a8e55Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
41898c4a8e55Smrg      _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'
41908c4a8e55Smrg    else
41918c4a8e55Smrg      _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'
41928c4a8e55Smrg    fi
4193b042e37fSmrg    ;;
41948c4a8e55Smrg  pw32*)
41958c4a8e55Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4196b042e37fSmrg  ;;
41978c4a8e55Smrg  cygwin* | mingw* | cegcc*)
41988c4a8e55Smrg    _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'
41998c4a8e55Smrg  ;;
42008c4a8e55Smrg  *)
42018c4a8e55Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
42028c4a8e55Smrg  ;;
42038c4a8e55Smrg  esac
42048c4a8e55Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
42058c4a8e55Smrg], [
42068c4a8e55Smrg  runpath_var=
42078c4a8e55Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
42088c4a8e55Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
42098c4a8e55Smrg  _LT_TAGVAR(archive_cmds, $1)=
42108c4a8e55Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
42118c4a8e55Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
42128c4a8e55Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
42138c4a8e55Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
42148c4a8e55Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
42158c4a8e55Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
42168c4a8e55Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
42178c4a8e55Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
42188c4a8e55Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
42198c4a8e55Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
42208c4a8e55Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
42218c4a8e55Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
42228c4a8e55Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
42238c4a8e55Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
42248c4a8e55Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
42258c4a8e55Smrg  _LT_TAGVAR(module_cmds, $1)=
42268c4a8e55Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
42278c4a8e55Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
42288c4a8e55Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
42298c4a8e55Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
42308c4a8e55Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
42318c4a8e55Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
42328c4a8e55Smrg  # included in the symbol list
42338c4a8e55Smrg  _LT_TAGVAR(include_expsyms, $1)=
42348c4a8e55Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
42358c4a8e55Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
42368c4a8e55Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
42378c4a8e55Smrg  # as well as any symbol that contains `d'.
42388c4a8e55Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
42398c4a8e55Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
42408c4a8e55Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
42418c4a8e55Smrg  # the symbol is explicitly referenced.  Since portable code cannot
42428c4a8e55Smrg  # rely on this symbol name, it's probably fine to never include it in
42438c4a8e55Smrg  # preloaded symbol tables.
42448c4a8e55Smrg  # Exclude shared library initialization/finalization symbols.
42458c4a8e55Smrgdnl Note also adjust exclude_expsyms for C++ above.
42468c4a8e55Smrg  extract_expsyms_cmds=
4247b042e37fSmrg
42488c4a8e55Smrg  case $host_os in
42498c4a8e55Smrg  cygwin* | mingw* | pw32* | cegcc*)
42508c4a8e55Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
42518c4a8e55Smrg    # When not using gcc, we currently assume that we are using
42528c4a8e55Smrg    # Microsoft Visual C++.
42538c4a8e55Smrg    if test "$GCC" != yes; then
42548c4a8e55Smrg      with_gnu_ld=no
42558c4a8e55Smrg    fi
42568c4a8e55Smrg    ;;
42578c4a8e55Smrg  interix*)
42588c4a8e55Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
42598c4a8e55Smrg    with_gnu_ld=yes
42608c4a8e55Smrg    ;;
42618c4a8e55Smrg  openbsd*)
42628c4a8e55Smrg    with_gnu_ld=no
42638c4a8e55Smrg    ;;
42648c4a8e55Smrg  esac
4265b042e37fSmrg
42668c4a8e55Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
42678c4a8e55Smrg  if test "$with_gnu_ld" = yes; then
42688c4a8e55Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
42698c4a8e55Smrg    wlarc='${wl}'
4270b042e37fSmrg
42718c4a8e55Smrg    # Set some defaults for GNU ld with shared library support. These
42728c4a8e55Smrg    # are reset later if shared libraries are not supported. Putting them
42738c4a8e55Smrg    # here allows them to be overridden if necessary.
42748c4a8e55Smrg    runpath_var=LD_RUN_PATH
42758c4a8e55Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
42768c4a8e55Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
42778c4a8e55Smrg    # ancient GNU ld didn't support --whole-archive et. al.
42788c4a8e55Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
42798c4a8e55Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
42808c4a8e55Smrg    else
42818c4a8e55Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
42828c4a8e55Smrg    fi
42838c4a8e55Smrg    supports_anon_versioning=no
42848c4a8e55Smrg    case `$LD -v 2>&1` in
42858c4a8e55Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
42868c4a8e55Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
42878c4a8e55Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
42888c4a8e55Smrg      *\ 2.11.*) ;; # other 2.11 versions
42898c4a8e55Smrg      *) supports_anon_versioning=yes ;;
42908c4a8e55Smrg    esac
4291b042e37fSmrg
42928c4a8e55Smrg    # See if GNU ld supports shared libraries.
42938c4a8e55Smrg    case $host_os in
42948c4a8e55Smrg    aix[[3-9]]*)
42958c4a8e55Smrg      # On AIX/PPC, the GNU linker is very broken
42968c4a8e55Smrg      if test "$host_cpu" != ia64; then
42978c4a8e55Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
42988c4a8e55Smrg	cat <<_LT_EOF 1>&2
4299b042e37fSmrg
43008c4a8e55Smrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
43018c4a8e55Smrg*** to be unable to reliably create shared libraries on AIX.
43028c4a8e55Smrg*** Therefore, libtool is disabling shared libraries support.  If you
43038c4a8e55Smrg*** really care for shared libraries, you may want to modify your PATH
43048c4a8e55Smrg*** so that a non-GNU linker is found, and then restart.
4305b042e37fSmrg
43068c4a8e55Smrg_LT_EOF
43078c4a8e55Smrg      fi
43088c4a8e55Smrg      ;;
4309b042e37fSmrg
43108c4a8e55Smrg    amigaos*)
43118c4a8e55Smrg      case $host_cpu in
43128c4a8e55Smrg      powerpc)
43138c4a8e55Smrg            # see comment about AmigaOS4 .so support
43148c4a8e55Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
43158c4a8e55Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
43168c4a8e55Smrg        ;;
43178c4a8e55Smrg      m68k)
43188c4a8e55Smrg            _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)'
43198c4a8e55Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
43208c4a8e55Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
43218c4a8e55Smrg        ;;
43228c4a8e55Smrg      esac
43238c4a8e55Smrg      ;;
4324b042e37fSmrg
43258c4a8e55Smrg    beos*)
43268c4a8e55Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
43278c4a8e55Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
43288c4a8e55Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
43298c4a8e55Smrg	# support --undefined.  This deserves some investigation.  FIXME
43308c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
43318c4a8e55Smrg      else
43328c4a8e55Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
43338c4a8e55Smrg      fi
43348c4a8e55Smrg      ;;
4335b042e37fSmrg
43368c4a8e55Smrg    cygwin* | mingw* | pw32* | cegcc*)
43378c4a8e55Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
43388c4a8e55Smrg      # as there is no search path for DLLs.
43398c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
43408c4a8e55Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
43418c4a8e55Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
43428c4a8e55Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
43438c4a8e55Smrg      _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'
43448c4a8e55Smrg
43458c4a8e55Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
43468c4a8e55Smrg        _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'
43478c4a8e55Smrg	# If the export-symbols file already is a .def file (1st line
43488c4a8e55Smrg	# is EXPORTS), use it as is; otherwise, prepend...
43498c4a8e55Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
43508c4a8e55Smrg	  cp $export_symbols $output_objdir/$soname.def;
43518c4a8e55Smrg	else
43528c4a8e55Smrg	  echo EXPORTS > $output_objdir/$soname.def;
43538c4a8e55Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
43548c4a8e55Smrg	fi~
43558c4a8e55Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
43568c4a8e55Smrg      else
43578c4a8e55Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
43588c4a8e55Smrg      fi
43598c4a8e55Smrg      ;;
4360b042e37fSmrg
43618c4a8e55Smrg    interix[[3-9]]*)
43628c4a8e55Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
43638c4a8e55Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
43648c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
43658c4a8e55Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
43668c4a8e55Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
43678c4a8e55Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
43688c4a8e55Smrg      # default) and relocated if they conflict, which is a slow very memory
43698c4a8e55Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
43708c4a8e55Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
43718c4a8e55Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
43728c4a8e55Smrg      _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'
43738c4a8e55Smrg      _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'
43748c4a8e55Smrg      ;;
4375b042e37fSmrg
43768c4a8e55Smrg    gnu* | linux* | tpf* | k*bsd*-gnu)
43778c4a8e55Smrg      tmp_diet=no
43788c4a8e55Smrg      if test "$host_os" = linux-dietlibc; then
43798c4a8e55Smrg	case $cc_basename in
43808c4a8e55Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
43818c4a8e55Smrg	esac
43828c4a8e55Smrg      fi
43838c4a8e55Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
43848c4a8e55Smrg	 && test "$tmp_diet" = no
43858c4a8e55Smrg      then
43868c4a8e55Smrg	tmp_addflag=
43878c4a8e55Smrg	tmp_sharedflag='-shared'
43888c4a8e55Smrg	case $cc_basename,$host_cpu in
43898c4a8e55Smrg        pgcc*)				# Portland Group C compiler
43908c4a8e55Smrg	  _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'
43918c4a8e55Smrg	  tmp_addflag=' $pic_flag'
43928c4a8e55Smrg	  ;;
43938c4a8e55Smrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
43948c4a8e55Smrg	  _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'
43958c4a8e55Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
43968c4a8e55Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
43978c4a8e55Smrg	  tmp_addflag=' -i_dynamic' ;;
43988c4a8e55Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
43998c4a8e55Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
44008c4a8e55Smrg	ifc* | ifort*)			# Intel Fortran compiler
44018c4a8e55Smrg	  tmp_addflag=' -nofor_main' ;;
44028c4a8e55Smrg	lf95*)				# Lahey Fortran 8.1
44038c4a8e55Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
44048c4a8e55Smrg	  tmp_sharedflag='--shared' ;;
44058c4a8e55Smrg	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
44068c4a8e55Smrg	  tmp_sharedflag='-qmkshrobj'
44078c4a8e55Smrg	  tmp_addflag= ;;
44088c4a8e55Smrg	esac
44098c4a8e55Smrg	case `$CC -V 2>&1 | sed 5q` in
44108c4a8e55Smrg	*Sun\ C*)			# Sun C 5.9
44118c4a8e55Smrg	  _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'
44128c4a8e55Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
44138c4a8e55Smrg	  tmp_sharedflag='-G' ;;
44148c4a8e55Smrg	*Sun\ F*)			# Sun Fortran 8.3
44158c4a8e55Smrg	  tmp_sharedflag='-G' ;;
44168c4a8e55Smrg	esac
44178c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4418b042e37fSmrg
44198c4a8e55Smrg        if test "x$supports_anon_versioning" = xyes; then
44208c4a8e55Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
44218c4a8e55Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
44228c4a8e55Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
44238c4a8e55Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
44248c4a8e55Smrg        fi
4425b042e37fSmrg
44268c4a8e55Smrg	case $cc_basename in
44278c4a8e55Smrg	xlf*)
44288c4a8e55Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
44298c4a8e55Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
44308c4a8e55Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
44318c4a8e55Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
44328c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
44338c4a8e55Smrg	  if test "x$supports_anon_versioning" = xyes; then
44348c4a8e55Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
44358c4a8e55Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
44368c4a8e55Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
44378c4a8e55Smrg	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
44388c4a8e55Smrg	  fi
44398c4a8e55Smrg	  ;;
44408c4a8e55Smrg	esac
44418c4a8e55Smrg      else
44428c4a8e55Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
44438c4a8e55Smrg      fi
44448c4a8e55Smrg      ;;
4445b042e37fSmrg
44468c4a8e55Smrg    netbsd*)
44478c4a8e55Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
44488c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
44498c4a8e55Smrg	wlarc=
44508c4a8e55Smrg      else
44518c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
44528c4a8e55Smrg	_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'
44538c4a8e55Smrg      fi
44548c4a8e55Smrg      ;;
4455b042e37fSmrg
44568c4a8e55Smrg    solaris*)
44578c4a8e55Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
44588c4a8e55Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
44598c4a8e55Smrg	cat <<_LT_EOF 1>&2
4460b042e37fSmrg
44618c4a8e55Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
44628c4a8e55Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
44638c4a8e55Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
44648c4a8e55Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
44658c4a8e55Smrg*** your PATH or compiler configuration so that the native linker is
44668c4a8e55Smrg*** used, and then restart.
4467b042e37fSmrg
44688c4a8e55Smrg_LT_EOF
44698c4a8e55Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
44708c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
44718c4a8e55Smrg	_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'
44728c4a8e55Smrg      else
44738c4a8e55Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
44748c4a8e55Smrg      fi
44758c4a8e55Smrg      ;;
4476b042e37fSmrg
44778c4a8e55Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
44788c4a8e55Smrg      case `$LD -v 2>&1` in
44798c4a8e55Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
44808c4a8e55Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
44818c4a8e55Smrg	cat <<_LT_EOF 1>&2
4482b042e37fSmrg
44838c4a8e55Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
44848c4a8e55Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
44858c4a8e55Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
44868c4a8e55Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
44878c4a8e55Smrg*** your PATH or compiler configuration so that the native linker is
44888c4a8e55Smrg*** used, and then restart.
4489b042e37fSmrg
44908c4a8e55Smrg_LT_EOF
44918c4a8e55Smrg	;;
44928c4a8e55Smrg	*)
44938c4a8e55Smrg	  # For security reasons, it is highly recommended that you always
44948c4a8e55Smrg	  # use absolute paths for naming shared libraries, and exclude the
44958c4a8e55Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
44968c4a8e55Smrg	  # requires that you compile everything twice, which is a pain.
44978c4a8e55Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
44988c4a8e55Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
44998c4a8e55Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
45008c4a8e55Smrg	    _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'
45018c4a8e55Smrg	  else
45028c4a8e55Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
45038c4a8e55Smrg	  fi
45048c4a8e55Smrg	;;
45058c4a8e55Smrg      esac
45068c4a8e55Smrg      ;;
4507b042e37fSmrg
45088c4a8e55Smrg    sunos4*)
45098c4a8e55Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
45108c4a8e55Smrg      wlarc=
45118c4a8e55Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
45128c4a8e55Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
45138c4a8e55Smrg      ;;
4514b042e37fSmrg
45158c4a8e55Smrg    *)
45168c4a8e55Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
45178c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
45188c4a8e55Smrg	_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'
45198c4a8e55Smrg      else
45208c4a8e55Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
45218c4a8e55Smrg      fi
45228c4a8e55Smrg      ;;
45238c4a8e55Smrg    esac
4524b042e37fSmrg
45258c4a8e55Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
45268c4a8e55Smrg      runpath_var=
45278c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
45288c4a8e55Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
45298c4a8e55Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
45308c4a8e55Smrg    fi
45318c4a8e55Smrg  else
45328c4a8e55Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
45338c4a8e55Smrg    case $host_os in
45348c4a8e55Smrg    aix3*)
45358c4a8e55Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
45368c4a8e55Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
45378c4a8e55Smrg      _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'
45388c4a8e55Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
45398c4a8e55Smrg      # are no directories specified by -L.
45408c4a8e55Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
45418c4a8e55Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
45428c4a8e55Smrg	# Neither direct hardcoding nor static linking is supported with a
45438c4a8e55Smrg	# broken collect2.
45448c4a8e55Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
45458c4a8e55Smrg      fi
45468c4a8e55Smrg      ;;
4547b042e37fSmrg
45488c4a8e55Smrg    aix[[4-9]]*)
45498c4a8e55Smrg      if test "$host_cpu" = ia64; then
45508c4a8e55Smrg	# On IA64, the linker does run time linking by default, so we don't
45518c4a8e55Smrg	# have to do anything special.
45528c4a8e55Smrg	aix_use_runtimelinking=no
45538c4a8e55Smrg	exp_sym_flag='-Bexport'
45548c4a8e55Smrg	no_entry_flag=""
45558c4a8e55Smrg      else
45568c4a8e55Smrg	# If we're using GNU nm, then we don't want the "-C" option.
45578c4a8e55Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
45588c4a8e55Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
45598c4a8e55Smrg	  _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'
45608c4a8e55Smrg	else
45618c4a8e55Smrg	  _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'
45628c4a8e55Smrg	fi
45638c4a8e55Smrg	aix_use_runtimelinking=no
4564b042e37fSmrg
45658c4a8e55Smrg	# Test if we are trying to use run time linking or normal
45668c4a8e55Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
45678c4a8e55Smrg	# need to do runtime linking.
45688c4a8e55Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
45698c4a8e55Smrg	  for ld_flag in $LDFLAGS; do
45708c4a8e55Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
45718c4a8e55Smrg	    aix_use_runtimelinking=yes
45728c4a8e55Smrg	    break
45738c4a8e55Smrg	  fi
45748c4a8e55Smrg	  done
45758c4a8e55Smrg	  ;;
45768c4a8e55Smrg	esac
4577b042e37fSmrg
45788c4a8e55Smrg	exp_sym_flag='-bexport'
45798c4a8e55Smrg	no_entry_flag='-bnoentry'
45808c4a8e55Smrg      fi
4581b042e37fSmrg
45828c4a8e55Smrg      # When large executables or shared objects are built, AIX ld can
45838c4a8e55Smrg      # have problems creating the table of contents.  If linking a library
45848c4a8e55Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
45858c4a8e55Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
45868c4a8e55Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
4587b042e37fSmrg
45888c4a8e55Smrg      _LT_TAGVAR(archive_cmds, $1)=''
45898c4a8e55Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
45908c4a8e55Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
45918c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
45928c4a8e55Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
45938c4a8e55Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
4594b042e37fSmrg
45958c4a8e55Smrg      if test "$GCC" = yes; then
45968c4a8e55Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
45978c4a8e55Smrg	# We only want to do this on AIX 4.2 and lower, the check
45988c4a8e55Smrg	# below for broken collect2 doesn't work under 4.3+
45998c4a8e55Smrg	  collect2name=`${CC} -print-prog-name=collect2`
46008c4a8e55Smrg	  if test -f "$collect2name" &&
46018c4a8e55Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
46028c4a8e55Smrg	  then
46038c4a8e55Smrg	  # We have reworked collect2
46048c4a8e55Smrg	  :
46058c4a8e55Smrg	  else
46068c4a8e55Smrg	  # We have old collect2
46078c4a8e55Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
46088c4a8e55Smrg	  # It fails to find uninstalled libraries when the uninstalled
46098c4a8e55Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
46108c4a8e55Smrg	  # to unsupported forces relinking
46118c4a8e55Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
46128c4a8e55Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
46138c4a8e55Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
46148c4a8e55Smrg	  fi
46158c4a8e55Smrg	  ;;
46168c4a8e55Smrg	esac
46178c4a8e55Smrg	shared_flag='-shared'
46188c4a8e55Smrg	if test "$aix_use_runtimelinking" = yes; then
46198c4a8e55Smrg	  shared_flag="$shared_flag "'${wl}-G'
46208c4a8e55Smrg	fi
46218c4a8e55Smrg      else
46228c4a8e55Smrg	# not using gcc
46238c4a8e55Smrg	if test "$host_cpu" = ia64; then
46248c4a8e55Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
46258c4a8e55Smrg	# chokes on -Wl,-G. The following line is correct:
46268c4a8e55Smrg	  shared_flag='-G'
46278c4a8e55Smrg	else
46288c4a8e55Smrg	  if test "$aix_use_runtimelinking" = yes; then
46298c4a8e55Smrg	    shared_flag='${wl}-G'
46308c4a8e55Smrg	  else
46318c4a8e55Smrg	    shared_flag='${wl}-bM:SRE'
46328c4a8e55Smrg	  fi
46338c4a8e55Smrg	fi
46348c4a8e55Smrg      fi
4635b042e37fSmrg
46368c4a8e55Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
46378c4a8e55Smrg      # It seems that -bexpall does not export symbols beginning with
46388c4a8e55Smrg      # underscore (_), so it is better to generate a list of symbols to export.
46398c4a8e55Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
46408c4a8e55Smrg      if test "$aix_use_runtimelinking" = yes; then
46418c4a8e55Smrg	# Warning - without using the other runtime loading flags (-brtl),
46428c4a8e55Smrg	# -berok will link without error, but may produce a broken library.
46438c4a8e55Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
46448c4a8e55Smrg        # Determine the default libpath from the value encoded in an
46458c4a8e55Smrg        # empty executable.
46468c4a8e55Smrg        _LT_SYS_MODULE_PATH_AIX
46478c4a8e55Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
46488c4a8e55Smrg        _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"
46498c4a8e55Smrg      else
46508c4a8e55Smrg	if test "$host_cpu" = ia64; then
46518c4a8e55Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
46528c4a8e55Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
46538c4a8e55Smrg	  _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"
46548c4a8e55Smrg	else
46558c4a8e55Smrg	 # Determine the default libpath from the value encoded in an
46568c4a8e55Smrg	 # empty executable.
46578c4a8e55Smrg	 _LT_SYS_MODULE_PATH_AIX
46588c4a8e55Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
46598c4a8e55Smrg	  # Warning - without using the other run time loading flags,
46608c4a8e55Smrg	  # -berok will link without error, but may produce a broken library.
46618c4a8e55Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
46628c4a8e55Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
46638c4a8e55Smrg	  # Exported symbols can be pulled into shared objects from archives
46648c4a8e55Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
46658c4a8e55Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
46668c4a8e55Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
46678c4a8e55Smrg	  _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'
46688c4a8e55Smrg	fi
46698c4a8e55Smrg      fi
46708c4a8e55Smrg      ;;
4671b042e37fSmrg
46728c4a8e55Smrg    amigaos*)
46738c4a8e55Smrg      case $host_cpu in
46748c4a8e55Smrg      powerpc)
46758c4a8e55Smrg            # see comment about AmigaOS4 .so support
46768c4a8e55Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
46778c4a8e55Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
46788c4a8e55Smrg        ;;
46798c4a8e55Smrg      m68k)
46808c4a8e55Smrg            _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)'
46818c4a8e55Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
46828c4a8e55Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
46838c4a8e55Smrg        ;;
46848c4a8e55Smrg      esac
46858c4a8e55Smrg      ;;
4686b042e37fSmrg
46878c4a8e55Smrg    bsdi[[45]]*)
46888c4a8e55Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
46898c4a8e55Smrg      ;;
4690b042e37fSmrg
46918c4a8e55Smrg    cygwin* | mingw* | pw32* | cegcc*)
46928c4a8e55Smrg      # When not using gcc, we currently assume that we are using
46938c4a8e55Smrg      # Microsoft Visual C++.
46948c4a8e55Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
46958c4a8e55Smrg      # no search path for DLLs.
46968c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
46978c4a8e55Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
46988c4a8e55Smrg      # Tell ltmain to make .lib files, not .a files.
46998c4a8e55Smrg      libext=lib
47008c4a8e55Smrg      # Tell ltmain to make .dll files, not .so files.
47018c4a8e55Smrg      shrext_cmds=".dll"
47028c4a8e55Smrg      # FIXME: Setting linknames here is a bad hack.
47038c4a8e55Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
47048c4a8e55Smrg      # The linker will automatically build a .lib file if we build a DLL.
47058c4a8e55Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
47068c4a8e55Smrg      # FIXME: Should let the user specify the lib program.
47078c4a8e55Smrg      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
47088c4a8e55Smrg      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
47098c4a8e55Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
47108c4a8e55Smrg      ;;
4711b042e37fSmrg
47128c4a8e55Smrg    darwin* | rhapsody*)
47138c4a8e55Smrg      _LT_DARWIN_LINKER_FEATURES($1)
47148c4a8e55Smrg      ;;
4715b042e37fSmrg
47168c4a8e55Smrg    dgux*)
47178c4a8e55Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
47188c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
47198c4a8e55Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
47208c4a8e55Smrg      ;;
4721b042e37fSmrg
47228c4a8e55Smrg    freebsd1*)
47238c4a8e55Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
47248c4a8e55Smrg      ;;
4725b042e37fSmrg
47268c4a8e55Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
47278c4a8e55Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
47288c4a8e55Smrg    # does not break anything, and helps significantly (at the cost of a little
47298c4a8e55Smrg    # extra space).
47308c4a8e55Smrg    freebsd2.2*)
47318c4a8e55Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
47328c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
47338c4a8e55Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
47348c4a8e55Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
47358c4a8e55Smrg      ;;
4736b042e37fSmrg
47378c4a8e55Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
47388c4a8e55Smrg    freebsd2*)
47398c4a8e55Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
47408c4a8e55Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
47418c4a8e55Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
47428c4a8e55Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
47438c4a8e55Smrg      ;;
4744b042e37fSmrg
47458c4a8e55Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
47468c4a8e55Smrg    freebsd* | dragonfly*)
47478c4a8e55Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
47488c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
47498c4a8e55Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
47508c4a8e55Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
47518c4a8e55Smrg      ;;
4752b042e37fSmrg
47538c4a8e55Smrg    hpux9*)
47548c4a8e55Smrg      if test "$GCC" = yes; then
47558c4a8e55Smrg	_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'
47568c4a8e55Smrg      else
47578c4a8e55Smrg	_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'
47588c4a8e55Smrg      fi
47598c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
47608c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
47618c4a8e55Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4762b042e37fSmrg
47638c4a8e55Smrg      # hardcode_minus_L: Not really in the search PATH,
47648c4a8e55Smrg      # but as the default location of the library.
47658c4a8e55Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
47668c4a8e55Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4767b042e37fSmrg      ;;
4768b042e37fSmrg
47698c4a8e55Smrg    hpux10*)
47708c4a8e55Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
47718c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
47728c4a8e55Smrg      else
47738c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
47748c4a8e55Smrg      fi
47758c4a8e55Smrg      if test "$with_gnu_ld" = no; then
47768c4a8e55Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
47778c4a8e55Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
47788c4a8e55Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
47798c4a8e55Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
47808c4a8e55Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
47818c4a8e55Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
47828c4a8e55Smrg	# hardcode_minus_L: Not really in the search PATH,
47838c4a8e55Smrg	# but as the default location of the library.
47848c4a8e55Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
47858c4a8e55Smrg      fi
47868c4a8e55Smrg      ;;
4787b042e37fSmrg
47888c4a8e55Smrg    hpux11*)
47898c4a8e55Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
47908c4a8e55Smrg	case $host_cpu in
47918c4a8e55Smrg	hppa*64*)
47928c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
47938c4a8e55Smrg	  ;;
47948c4a8e55Smrg	ia64*)
47958c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
47968c4a8e55Smrg	  ;;
47978c4a8e55Smrg	*)
47988c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
47998c4a8e55Smrg	  ;;
48008c4a8e55Smrg	esac
48018c4a8e55Smrg      else
48028c4a8e55Smrg	case $host_cpu in
48038c4a8e55Smrg	hppa*64*)
48048c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
48058c4a8e55Smrg	  ;;
48068c4a8e55Smrg	ia64*)
48078c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
48088c4a8e55Smrg	  ;;
48098c4a8e55Smrg	*)
48108c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
48118c4a8e55Smrg	  ;;
48128c4a8e55Smrg	esac
48138c4a8e55Smrg      fi
48148c4a8e55Smrg      if test "$with_gnu_ld" = no; then
48158c4a8e55Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
48168c4a8e55Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
4817b042e37fSmrg
48188c4a8e55Smrg	case $host_cpu in
48198c4a8e55Smrg	hppa*64*|ia64*)
48208c4a8e55Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
48218c4a8e55Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
48228c4a8e55Smrg	  ;;
48238c4a8e55Smrg	*)
48248c4a8e55Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
48258c4a8e55Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
48268c4a8e55Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4827b042e37fSmrg
48288c4a8e55Smrg	  # hardcode_minus_L: Not really in the search PATH,
48298c4a8e55Smrg	  # but as the default location of the library.
48308c4a8e55Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
48318c4a8e55Smrg	  ;;
48328c4a8e55Smrg	esac
48338c4a8e55Smrg      fi
48348c4a8e55Smrg      ;;
4835b042e37fSmrg
48368c4a8e55Smrg    irix5* | irix6* | nonstopux*)
48378c4a8e55Smrg      if test "$GCC" = yes; then
48388c4a8e55Smrg	_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'
48398c4a8e55Smrg	# Try to use the -exported_symbol ld option, if it does not
48408c4a8e55Smrg	# work, assume that -exports_file does not work either and
48418c4a8e55Smrg	# implicitly export all symbols.
48428c4a8e55Smrg        save_LDFLAGS="$LDFLAGS"
48438c4a8e55Smrg        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
48448c4a8e55Smrg        AC_LINK_IFELSE(int foo(void) {},
48458c4a8e55Smrg          _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'
48468c4a8e55Smrg        )
48478c4a8e55Smrg        LDFLAGS="$save_LDFLAGS"
48488c4a8e55Smrg      else
48498c4a8e55Smrg	_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'
48508c4a8e55Smrg	_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'
48518c4a8e55Smrg      fi
48528c4a8e55Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
48538c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
48548c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
48558c4a8e55Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
48568c4a8e55Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
48578c4a8e55Smrg      ;;
4858b042e37fSmrg
48598c4a8e55Smrg    netbsd*)
48608c4a8e55Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
48618c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
48628c4a8e55Smrg      else
48638c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
48648c4a8e55Smrg      fi
48658c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
48668c4a8e55Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
48678c4a8e55Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
48688c4a8e55Smrg      ;;
4869b042e37fSmrg
48708c4a8e55Smrg    newsos6)
48718c4a8e55Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
48728c4a8e55Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
48738c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
48748c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
48758c4a8e55Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
48768c4a8e55Smrg      ;;
4877b042e37fSmrg
48788c4a8e55Smrg    *nto* | *qnx*)
48798c4a8e55Smrg      ;;
4880b042e37fSmrg
48818c4a8e55Smrg    openbsd*)
48828c4a8e55Smrg      if test -f /usr/libexec/ld.so; then
48838c4a8e55Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
48848c4a8e55Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
48858c4a8e55Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
48868c4a8e55Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
48878c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
48888c4a8e55Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
48898c4a8e55Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
48908c4a8e55Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
48918c4a8e55Smrg	else
48928c4a8e55Smrg	  case $host_os in
48938c4a8e55Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
48948c4a8e55Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
48958c4a8e55Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
48968c4a8e55Smrg	     ;;
48978c4a8e55Smrg	   *)
48988c4a8e55Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
48998c4a8e55Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
49008c4a8e55Smrg	     ;;
49018c4a8e55Smrg	  esac
49028c4a8e55Smrg	fi
49038c4a8e55Smrg      else
49048c4a8e55Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
49058c4a8e55Smrg      fi
49068c4a8e55Smrg      ;;
4907b042e37fSmrg
49088c4a8e55Smrg    os2*)
49098c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
49108c4a8e55Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
49118c4a8e55Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
49128c4a8e55Smrg      _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'
49138c4a8e55Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
49148c4a8e55Smrg      ;;
4915b042e37fSmrg
49168c4a8e55Smrg    osf3*)
49178c4a8e55Smrg      if test "$GCC" = yes; then
49188c4a8e55Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
49198c4a8e55Smrg	_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'
49208c4a8e55Smrg      else
49218c4a8e55Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
49228c4a8e55Smrg	_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'
49238c4a8e55Smrg      fi
49248c4a8e55Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
49258c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
49268c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
49278c4a8e55Smrg      ;;
4928b042e37fSmrg
49298c4a8e55Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
49308c4a8e55Smrg      if test "$GCC" = yes; then
49318c4a8e55Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
49328c4a8e55Smrg	_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'
49338c4a8e55Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
49348c4a8e55Smrg      else
49358c4a8e55Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
49368c4a8e55Smrg	_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'
49378c4a8e55Smrg	_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~
49388c4a8e55Smrg	$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'
4939b042e37fSmrg
49408c4a8e55Smrg	# Both c and cxx compiler support -rpath directly
49418c4a8e55Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
49428c4a8e55Smrg      fi
49438c4a8e55Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
49448c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
49458c4a8e55Smrg      ;;
4946b042e37fSmrg
49478c4a8e55Smrg    solaris*)
49488c4a8e55Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
49498c4a8e55Smrg      if test "$GCC" = yes; then
49508c4a8e55Smrg	wlarc='${wl}'
49518c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
49528c4a8e55Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
49538c4a8e55Smrg	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
49548c4a8e55Smrg      else
49558c4a8e55Smrg	case `$CC -V 2>&1` in
49568c4a8e55Smrg	*"Compilers 5.0"*)
49578c4a8e55Smrg	  wlarc=''
49588c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
49598c4a8e55Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
49608c4a8e55Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
49618c4a8e55Smrg	  ;;
49628c4a8e55Smrg	*)
49638c4a8e55Smrg	  wlarc='${wl}'
49648c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
49658c4a8e55Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
49668c4a8e55Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
49678c4a8e55Smrg	  ;;
49688c4a8e55Smrg	esac
49698c4a8e55Smrg      fi
49708c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
49718c4a8e55Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
49728c4a8e55Smrg      case $host_os in
49738c4a8e55Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
49748c4a8e55Smrg      *)
49758c4a8e55Smrg	# The compiler driver will combine and reorder linker options,
49768c4a8e55Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
49778c4a8e55Smrg	# but is careful enough not to reorder.
49788c4a8e55Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
49798c4a8e55Smrg	if test "$GCC" = yes; then
49808c4a8e55Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
49818c4a8e55Smrg	else
49828c4a8e55Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
49838c4a8e55Smrg	fi
49848c4a8e55Smrg	;;
49858c4a8e55Smrg      esac
49868c4a8e55Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
49878c4a8e55Smrg      ;;
4988b042e37fSmrg
49898c4a8e55Smrg    sunos4*)
49908c4a8e55Smrg      if test "x$host_vendor" = xsequent; then
49918c4a8e55Smrg	# Use $CC to link under sequent, because it throws in some extra .o
49928c4a8e55Smrg	# files that make .init and .fini sections work.
49938c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
49948c4a8e55Smrg      else
49958c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
49968c4a8e55Smrg      fi
49978c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
49988c4a8e55Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
49998c4a8e55Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
50008c4a8e55Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
50018c4a8e55Smrg      ;;
5002b042e37fSmrg
50038c4a8e55Smrg    sysv4)
50048c4a8e55Smrg      case $host_vendor in
50058c4a8e55Smrg	sni)
50068c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
50078c4a8e55Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
50088c4a8e55Smrg	;;
50098c4a8e55Smrg	siemens)
50108c4a8e55Smrg	  ## LD is ld it makes a PLAMLIB
50118c4a8e55Smrg	  ## CC just makes a GrossModule.
50128c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
50138c4a8e55Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
50148c4a8e55Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
50158c4a8e55Smrg        ;;
50168c4a8e55Smrg	motorola)
50178c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
50188c4a8e55Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
50198c4a8e55Smrg	;;
50208c4a8e55Smrg      esac
50218c4a8e55Smrg      runpath_var='LD_RUN_PATH'
50228c4a8e55Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
50238c4a8e55Smrg      ;;
5024b042e37fSmrg
50258c4a8e55Smrg    sysv4.3*)
50268c4a8e55Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
50278c4a8e55Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
50288c4a8e55Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
50298c4a8e55Smrg      ;;
5030b042e37fSmrg
50318c4a8e55Smrg    sysv4*MP*)
50328c4a8e55Smrg      if test -d /usr/nec; then
50338c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
50348c4a8e55Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
50358c4a8e55Smrg	runpath_var=LD_RUN_PATH
50368c4a8e55Smrg	hardcode_runpath_var=yes
50378c4a8e55Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
50388c4a8e55Smrg      fi
50398c4a8e55Smrg      ;;
5040b042e37fSmrg
50418c4a8e55Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
50428c4a8e55Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
50438c4a8e55Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
50448c4a8e55Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
50458c4a8e55Smrg      runpath_var='LD_RUN_PATH'
5046b042e37fSmrg
50478c4a8e55Smrg      if test "$GCC" = yes; then
50488c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
50498c4a8e55Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
50508c4a8e55Smrg      else
50518c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
50528c4a8e55Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
50538c4a8e55Smrg      fi
50548c4a8e55Smrg      ;;
5055b042e37fSmrg
50568c4a8e55Smrg    sysv5* | sco3.2v5* | sco5v6*)
50578c4a8e55Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
50588c4a8e55Smrg      # link with -lc, and that would cause any symbols used from libc to
50598c4a8e55Smrg      # always be unresolved, which means just about no library would
50608c4a8e55Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
50618c4a8e55Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
50628c4a8e55Smrg      # as -z defs.
50638c4a8e55Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
50648c4a8e55Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
50658c4a8e55Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
50668c4a8e55Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
50678c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
50688c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
50698c4a8e55Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
50708c4a8e55Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
50718c4a8e55Smrg      runpath_var='LD_RUN_PATH'
5072b042e37fSmrg
50738c4a8e55Smrg      if test "$GCC" = yes; then
50748c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
50758c4a8e55Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
50768c4a8e55Smrg      else
50778c4a8e55Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
50788c4a8e55Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
50798c4a8e55Smrg      fi
50808c4a8e55Smrg      ;;
5081b042e37fSmrg
50828c4a8e55Smrg    uts4*)
50838c4a8e55Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
50848c4a8e55Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
50858c4a8e55Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
50868c4a8e55Smrg      ;;
5087b042e37fSmrg
50888c4a8e55Smrg    *)
50898c4a8e55Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
50908c4a8e55Smrg      ;;
50918c4a8e55Smrg    esac
5092b042e37fSmrg
50938c4a8e55Smrg    if test x$host_vendor = xsni; then
50948c4a8e55Smrg      case $host in
50958c4a8e55Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
50968c4a8e55Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
50978c4a8e55Smrg	;;
50988c4a8e55Smrg      esac
50998c4a8e55Smrg    fi
51008c4a8e55Smrg  fi
51018c4a8e55Smrg])
51028c4a8e55SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
51038c4a8e55Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5104b042e37fSmrg
51058c4a8e55Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5106b042e37fSmrg
51078c4a8e55Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
51088c4a8e55Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
51098c4a8e55Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
51108c4a8e55Smrg    [The commands to extract the exported symbol list from a shared archive])
5111b042e37fSmrg
51128c4a8e55Smrg#
51138c4a8e55Smrg# Do we need to explicitly link libc?
51148c4a8e55Smrg#
51158c4a8e55Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
51168c4a8e55Smrgx|xyes)
51178c4a8e55Smrg  # Assume -lc should be added
51188c4a8e55Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5119b042e37fSmrg
51208c4a8e55Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
51218c4a8e55Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
51228c4a8e55Smrg    *'~'*)
51238c4a8e55Smrg      # FIXME: we may have to deal with multi-command sequences.
51248c4a8e55Smrg      ;;
51258c4a8e55Smrg    '$CC '*)
51268c4a8e55Smrg      # Test whether the compiler implicitly links with -lc since on some
51278c4a8e55Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
51288c4a8e55Smrg      # to ld, don't add -lc before -lgcc.
51298c4a8e55Smrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
51308c4a8e55Smrg      $RM conftest*
51318c4a8e55Smrg      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5132b042e37fSmrg
51338c4a8e55Smrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
51348c4a8e55Smrg        soname=conftest
51358c4a8e55Smrg        lib=conftest
51368c4a8e55Smrg        libobjs=conftest.$ac_objext
51378c4a8e55Smrg        deplibs=
51388c4a8e55Smrg        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
51398c4a8e55Smrg	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
51408c4a8e55Smrg        compiler_flags=-v
51418c4a8e55Smrg        linker_flags=-v
51428c4a8e55Smrg        verstring=
51438c4a8e55Smrg        output_objdir=.
51448c4a8e55Smrg        libname=conftest
51458c4a8e55Smrg        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
51468c4a8e55Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=
51478c4a8e55Smrg        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
51488c4a8e55Smrg        then
51498c4a8e55Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
51508c4a8e55Smrg        else
51518c4a8e55Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
51528c4a8e55Smrg        fi
51538c4a8e55Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
51548c4a8e55Smrg      else
51558c4a8e55Smrg        cat conftest.err 1>&5
51568c4a8e55Smrg      fi
51578c4a8e55Smrg      $RM conftest*
51588c4a8e55Smrg      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
51598c4a8e55Smrg      ;;
51608c4a8e55Smrg    esac
51618c4a8e55Smrg  fi
51628c4a8e55Smrg  ;;
51638c4a8e55Smrgesac
5164b042e37fSmrg
51658c4a8e55Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
51668c4a8e55Smrg    [Whether or not to add -lc for building shared libraries])
51678c4a8e55Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
51688c4a8e55Smrg    [enable_shared_with_static_runtimes], [0],
51698c4a8e55Smrg    [Whether or not to disallow shared libs when runtime libs are static])
51708c4a8e55Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
51718c4a8e55Smrg    [Compiler flag to allow reflexive dlopens])
51728c4a8e55Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
51738c4a8e55Smrg    [Compiler flag to generate shared objects directly from archives])
51748c4a8e55Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
51758c4a8e55Smrg    [Whether the compiler copes with passing no objects directly])
51768c4a8e55Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
51778c4a8e55Smrg    [Create an old-style archive from a shared archive])
51788c4a8e55Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
51798c4a8e55Smrg    [Create a temporary old-style archive to link instead of a shared archive])
51808c4a8e55Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
51818c4a8e55Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
51828c4a8e55Smrg_LT_TAGDECL([], [module_cmds], [2],
51838c4a8e55Smrg    [Commands used to build a loadable module if different from building
51848c4a8e55Smrg    a shared archive.])
51858c4a8e55Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
51868c4a8e55Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
51878c4a8e55Smrg    [Whether we are building with GNU ld or not])
51888c4a8e55Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
51898c4a8e55Smrg    [Flag that allows shared libraries with undefined symbols to be built])
51908c4a8e55Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
51918c4a8e55Smrg    [Flag that enforces no undefined symbols])
51928c4a8e55Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
51938c4a8e55Smrg    [Flag to hardcode $libdir into a binary during linking.
51948c4a8e55Smrg    This must work even if $libdir does not exist])
51958c4a8e55Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
51968c4a8e55Smrg    [[If ld is used when linking, flag to hardcode $libdir into a binary
51978c4a8e55Smrg    during linking.  This must work even if $libdir does not exist]])
51988c4a8e55Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
51998c4a8e55Smrg    [Whether we need a single "-rpath" flag with a separated argument])
52008c4a8e55Smrg_LT_TAGDECL([], [hardcode_direct], [0],
52018c4a8e55Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
52028c4a8e55Smrg    DIR into the resulting binary])
52038c4a8e55Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
52048c4a8e55Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
52058c4a8e55Smrg    DIR into the resulting binary and the resulting library dependency is
52068c4a8e55Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
52078c4a8e55Smrg    library is relocated])
52088c4a8e55Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
52098c4a8e55Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
52108c4a8e55Smrg    into the resulting binary])
52118c4a8e55Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
52128c4a8e55Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
52138c4a8e55Smrg    into the resulting binary])
52148c4a8e55Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
52158c4a8e55Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
52168c4a8e55Smrg    into the library and all subsequent libraries and executables linked
52178c4a8e55Smrg    against it])
52188c4a8e55Smrg_LT_TAGDECL([], [inherit_rpath], [0],
52198c4a8e55Smrg    [Set to yes if linker adds runtime paths of dependent libraries
52208c4a8e55Smrg    to runtime path list])
52218c4a8e55Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
52228c4a8e55Smrg    [Whether libtool must link a program against all its dependency libraries])
52238c4a8e55Smrg_LT_TAGDECL([], [fix_srcfile_path], [1],
52248c4a8e55Smrg    [Fix the shell variable $srcfile for the compiler])
52258c4a8e55Smrg_LT_TAGDECL([], [always_export_symbols], [0],
52268c4a8e55Smrg    [Set to "yes" if exported symbols are required])
52278c4a8e55Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
52288c4a8e55Smrg    [The commands to list exported symbols])
52298c4a8e55Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
52308c4a8e55Smrg    [Symbols that should not be listed in the preloaded symbols])
52318c4a8e55Smrg_LT_TAGDECL([], [include_expsyms], [1],
52328c4a8e55Smrg    [Symbols that must always be exported])
52338c4a8e55Smrg_LT_TAGDECL([], [prelink_cmds], [2],
52348c4a8e55Smrg    [Commands necessary for linking programs (against libraries) with templates])
52358c4a8e55Smrg_LT_TAGDECL([], [file_list_spec], [1],
52368c4a8e55Smrg    [Specify filename containing input files])
52378c4a8e55Smrgdnl FIXME: Not yet implemented
52388c4a8e55Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
52398c4a8e55Smrgdnl    [Compiler flag to generate thread safe objects])
52408c4a8e55Smrg])# _LT_LINKER_SHLIBS
52418c4a8e55Smrg
52428c4a8e55Smrg
52438c4a8e55Smrg# _LT_LANG_C_CONFIG([TAG])
52448c4a8e55Smrg# ------------------------
52458c4a8e55Smrg# Ensure that the configuration variables for a C compiler are suitably
52468c4a8e55Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
52478c4a8e55Smrg# the compiler configuration to `libtool'.
52488c4a8e55Smrgm4_defun([_LT_LANG_C_CONFIG],
52498c4a8e55Smrg[m4_require([_LT_DECL_EGREP])dnl
52508c4a8e55Smrglt_save_CC="$CC"
52518c4a8e55SmrgAC_LANG_PUSH(C)
5252b042e37fSmrg
52538c4a8e55Smrg# Source file extension for C test sources.
52548c4a8e55Smrgac_ext=c
5255b042e37fSmrg
52568c4a8e55Smrg# Object file extension for compiled C test sources.
52578c4a8e55Smrgobjext=o
52588c4a8e55Smrg_LT_TAGVAR(objext, $1)=$objext
5259b042e37fSmrg
52608c4a8e55Smrg# Code to be used in simple compile tests
52618c4a8e55Smrglt_simple_compile_test_code="int some_variable = 0;"
5262b042e37fSmrg
52638c4a8e55Smrg# Code to be used in simple link tests
52648c4a8e55Smrglt_simple_link_test_code='int main(){return(0);}'
5265b042e37fSmrg
52668c4a8e55Smrg_LT_TAG_COMPILER
52678c4a8e55Smrg# Save the default compiler, since it gets overwritten when the other
52688c4a8e55Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
52698c4a8e55Smrgcompiler_DEFAULT=$CC
5270b042e37fSmrg
52718c4a8e55Smrg# save warnings/boilerplate of simple test code
52728c4a8e55Smrg_LT_COMPILER_BOILERPLATE
52738c4a8e55Smrg_LT_LINKER_BOILERPLATE
5274b042e37fSmrg
52758c4a8e55Smrgif test -n "$compiler"; then
52768c4a8e55Smrg  _LT_COMPILER_NO_RTTI($1)
52778c4a8e55Smrg  _LT_COMPILER_PIC($1)
52788c4a8e55Smrg  _LT_COMPILER_C_O($1)
52798c4a8e55Smrg  _LT_COMPILER_FILE_LOCKS($1)
52808c4a8e55Smrg  _LT_LINKER_SHLIBS($1)
52818c4a8e55Smrg  _LT_SYS_DYNAMIC_LINKER($1)
52828c4a8e55Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
52838c4a8e55Smrg  LT_SYS_DLOPEN_SELF
52848c4a8e55Smrg  _LT_CMD_STRIPLIB
52858c4a8e55Smrg
52868c4a8e55Smrg  # Report which library types will actually be built
52878c4a8e55Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
52888c4a8e55Smrg  AC_MSG_RESULT([$can_build_shared])
52898c4a8e55Smrg
52908c4a8e55Smrg  AC_MSG_CHECKING([whether to build shared libraries])
52918c4a8e55Smrg  test "$can_build_shared" = "no" && enable_shared=no
52928c4a8e55Smrg
52938c4a8e55Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
52948c4a8e55Smrg  # are all built from PIC.
52958c4a8e55Smrg  case $host_os in
52968c4a8e55Smrg  aix3*)
52978c4a8e55Smrg    test "$enable_shared" = yes && enable_static=no
52988c4a8e55Smrg    if test -n "$RANLIB"; then
52998c4a8e55Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
53008c4a8e55Smrg      postinstall_cmds='$RANLIB $lib'
53018c4a8e55Smrg    fi
53028c4a8e55Smrg    ;;
5303b042e37fSmrg
53048c4a8e55Smrg  aix[[4-9]]*)
53058c4a8e55Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
53068c4a8e55Smrg      test "$enable_shared" = yes && enable_static=no
53078c4a8e55Smrg    fi
53088c4a8e55Smrg    ;;
53098c4a8e55Smrg  esac
53108c4a8e55Smrg  AC_MSG_RESULT([$enable_shared])
5311b042e37fSmrg
53128c4a8e55Smrg  AC_MSG_CHECKING([whether to build static libraries])
53138c4a8e55Smrg  # Make sure either enable_shared or enable_static is yes.
53148c4a8e55Smrg  test "$enable_shared" = yes || enable_static=yes
53158c4a8e55Smrg  AC_MSG_RESULT([$enable_static])
5316b042e37fSmrg
53178c4a8e55Smrg  _LT_CONFIG($1)
53188c4a8e55Smrgfi
53198c4a8e55SmrgAC_LANG_POP
53208c4a8e55SmrgCC="$lt_save_CC"
53218c4a8e55Smrg])# _LT_LANG_C_CONFIG
5322b042e37fSmrg
5323b042e37fSmrg
53248c4a8e55Smrg# _LT_PROG_CXX
53258c4a8e55Smrg# ------------
53268c4a8e55Smrg# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
53278c4a8e55Smrg# compiler, we have our own version here.
53288c4a8e55Smrgm4_defun([_LT_PROG_CXX],
53298c4a8e55Smrg[
53308c4a8e55Smrgpushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
53318c4a8e55SmrgAC_PROG_CXX
53328c4a8e55Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
53338c4a8e55Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
53348c4a8e55Smrg    (test "X$CXX" != "Xg++"))) ; then
53358c4a8e55Smrg  AC_PROG_CXXCPP
53368c4a8e55Smrgelse
53378c4a8e55Smrg  _lt_caught_CXX_error=yes
53388c4a8e55Smrgfi
53398c4a8e55Smrgpopdef([AC_MSG_ERROR])
53408c4a8e55Smrg])# _LT_PROG_CXX
5341b042e37fSmrg
53428c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
53438c4a8e55Smrgdnl AC_DEFUN([_LT_PROG_CXX], [])
5344b042e37fSmrg
5345b042e37fSmrg
53468c4a8e55Smrg# _LT_LANG_CXX_CONFIG([TAG])
53478c4a8e55Smrg# --------------------------
53488c4a8e55Smrg# Ensure that the configuration variables for a C++ compiler are suitably
53498c4a8e55Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
53508c4a8e55Smrg# the compiler configuration to `libtool'.
53518c4a8e55Smrgm4_defun([_LT_LANG_CXX_CONFIG],
53528c4a8e55Smrg[AC_REQUIRE([_LT_PROG_CXX])dnl
53538c4a8e55Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
53548c4a8e55Smrgm4_require([_LT_DECL_EGREP])dnl
53558c4a8e55Smrg
53568c4a8e55SmrgAC_LANG_PUSH(C++)
53578c4a8e55Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
53588c4a8e55Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
53598c4a8e55Smrg_LT_TAGVAR(always_export_symbols, $1)=no
53608c4a8e55Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
53618c4a8e55Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
53628c4a8e55Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
53638c4a8e55Smrg_LT_TAGVAR(hardcode_direct, $1)=no
53648c4a8e55Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
53658c4a8e55Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
53668c4a8e55Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
53678c4a8e55Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
53688c4a8e55Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
53698c4a8e55Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
53708c4a8e55Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
53718c4a8e55Smrg_LT_TAGVAR(inherit_rpath, $1)=no
53728c4a8e55Smrg_LT_TAGVAR(module_cmds, $1)=
53738c4a8e55Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
53748c4a8e55Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
53758c4a8e55Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
53768c4a8e55Smrg_LT_TAGVAR(no_undefined_flag, $1)=
53778c4a8e55Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
53788c4a8e55Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5379b042e37fSmrg
53808c4a8e55Smrg# Source file extension for C++ test sources.
53818c4a8e55Smrgac_ext=cpp
5382b042e37fSmrg
53838c4a8e55Smrg# Object file extension for compiled C++ test sources.
53848c4a8e55Smrgobjext=o
53858c4a8e55Smrg_LT_TAGVAR(objext, $1)=$objext
53868c4a8e55Smrg
53878c4a8e55Smrg# No sense in running all these tests if we already determined that
53888c4a8e55Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
53898c4a8e55Smrg# are currently assumed to apply to all compilers on this platform,
53908c4a8e55Smrg# and will be corrupted by setting them based on a non-working compiler.
53918c4a8e55Smrgif test "$_lt_caught_CXX_error" != yes; then
53928c4a8e55Smrg  # Code to be used in simple compile tests
53938c4a8e55Smrg  lt_simple_compile_test_code="int some_variable = 0;"
53948c4a8e55Smrg
53958c4a8e55Smrg  # Code to be used in simple link tests
53968c4a8e55Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
53978c4a8e55Smrg
53988c4a8e55Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
53998c4a8e55Smrg  _LT_TAG_COMPILER
54008c4a8e55Smrg
54018c4a8e55Smrg  # save warnings/boilerplate of simple test code
54028c4a8e55Smrg  _LT_COMPILER_BOILERPLATE
54038c4a8e55Smrg  _LT_LINKER_BOILERPLATE
54048c4a8e55Smrg
54058c4a8e55Smrg  # Allow CC to be a program name with arguments.
54068c4a8e55Smrg  lt_save_CC=$CC
54078c4a8e55Smrg  lt_save_LD=$LD
54088c4a8e55Smrg  lt_save_GCC=$GCC
54098c4a8e55Smrg  GCC=$GXX
54108c4a8e55Smrg  lt_save_with_gnu_ld=$with_gnu_ld
54118c4a8e55Smrg  lt_save_path_LD=$lt_cv_path_LD
54128c4a8e55Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
54138c4a8e55Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
54148c4a8e55Smrg  else
54158c4a8e55Smrg    $as_unset lt_cv_prog_gnu_ld
54168c4a8e55Smrg  fi
54178c4a8e55Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
54188c4a8e55Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
54198c4a8e55Smrg  else
54208c4a8e55Smrg    $as_unset lt_cv_path_LD
54218c4a8e55Smrg  fi
54228c4a8e55Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
54238c4a8e55Smrg  CC=${CXX-"c++"}
54248c4a8e55Smrg  compiler=$CC
54258c4a8e55Smrg  _LT_TAGVAR(compiler, $1)=$CC
54268c4a8e55Smrg  _LT_CC_BASENAME([$compiler])
5427b042e37fSmrg
54288c4a8e55Smrg  if test -n "$compiler"; then
54298c4a8e55Smrg    # We don't want -fno-exception when compiling C++ code, so set the
54308c4a8e55Smrg    # no_builtin_flag separately
54318c4a8e55Smrg    if test "$GXX" = yes; then
54328c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
54338c4a8e55Smrg    else
54348c4a8e55Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
54358c4a8e55Smrg    fi
5436b042e37fSmrg
54378c4a8e55Smrg    if test "$GXX" = yes; then
54388c4a8e55Smrg      # Set up default GNU C++ configuration
5439b042e37fSmrg
54408c4a8e55Smrg      LT_PATH_LD
5441b042e37fSmrg
54428c4a8e55Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
54438c4a8e55Smrg      # archiving commands below assume that GNU ld is being used.
54448c4a8e55Smrg      if test "$with_gnu_ld" = yes; then
54458c4a8e55Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
54468c4a8e55Smrg        _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'
5447b042e37fSmrg
54488c4a8e55Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
54498c4a8e55Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5450b042e37fSmrg
54518c4a8e55Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
54528c4a8e55Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
54538c4a8e55Smrg        #     investigate it a little bit more. (MM)
54548c4a8e55Smrg        wlarc='${wl}'
5455b042e37fSmrg
54568c4a8e55Smrg        # ancient GNU ld didn't support --whole-archive et. al.
54578c4a8e55Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
54588c4a8e55Smrg	  $GREP 'no-whole-archive' > /dev/null; then
54598c4a8e55Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
54608c4a8e55Smrg        else
54618c4a8e55Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
54628c4a8e55Smrg        fi
54638c4a8e55Smrg      else
54648c4a8e55Smrg        with_gnu_ld=no
54658c4a8e55Smrg        wlarc=
54668c4a8e55Smrg
54678c4a8e55Smrg        # A generic and very simple default shared library creation
54688c4a8e55Smrg        # command for GNU C++ for the case where it uses the native
54698c4a8e55Smrg        # linker, instead of GNU ld.  If possible, this setting should
54708c4a8e55Smrg        # overridden to take advantage of the native linker features on
54718c4a8e55Smrg        # the platform it is being used on.
54728c4a8e55Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
54738c4a8e55Smrg      fi
5474b042e37fSmrg
54758c4a8e55Smrg      # Commands to make compiler produce verbose output that lists
54768c4a8e55Smrg      # what "hidden" libraries, object files and flags are used when
54778c4a8e55Smrg      # linking a shared library.
54788c4a8e55Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
5479b042e37fSmrg
54808c4a8e55Smrg    else
54818c4a8e55Smrg      GXX=no
54828c4a8e55Smrg      with_gnu_ld=no
54838c4a8e55Smrg      wlarc=
54848c4a8e55Smrg    fi
5485b042e37fSmrg
54868c4a8e55Smrg    # PORTME: fill in a description of your system's C++ link characteristics
54878c4a8e55Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
54888c4a8e55Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
54898c4a8e55Smrg    case $host_os in
54908c4a8e55Smrg      aix3*)
54918c4a8e55Smrg        # FIXME: insert proper C++ library support
54928c4a8e55Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
54938c4a8e55Smrg        ;;
54948c4a8e55Smrg      aix[[4-9]]*)
54958c4a8e55Smrg        if test "$host_cpu" = ia64; then
54968c4a8e55Smrg          # On IA64, the linker does run time linking by default, so we don't
54978c4a8e55Smrg          # have to do anything special.
54988c4a8e55Smrg          aix_use_runtimelinking=no
54998c4a8e55Smrg          exp_sym_flag='-Bexport'
55008c4a8e55Smrg          no_entry_flag=""
55018c4a8e55Smrg        else
55028c4a8e55Smrg          aix_use_runtimelinking=no
55038c4a8e55Smrg
55048c4a8e55Smrg          # Test if we are trying to use run time linking or normal
55058c4a8e55Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
55068c4a8e55Smrg          # need to do runtime linking.
55078c4a8e55Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
55088c4a8e55Smrg	    for ld_flag in $LDFLAGS; do
55098c4a8e55Smrg	      case $ld_flag in
55108c4a8e55Smrg	      *-brtl*)
55118c4a8e55Smrg	        aix_use_runtimelinking=yes
55128c4a8e55Smrg	        break
55138c4a8e55Smrg	        ;;
55148c4a8e55Smrg	      esac
55158c4a8e55Smrg	    done
55168c4a8e55Smrg	    ;;
55178c4a8e55Smrg          esac
5518b042e37fSmrg
55198c4a8e55Smrg          exp_sym_flag='-bexport'
55208c4a8e55Smrg          no_entry_flag='-bnoentry'
55218c4a8e55Smrg        fi
5522b042e37fSmrg
55238c4a8e55Smrg        # When large executables or shared objects are built, AIX ld can
55248c4a8e55Smrg        # have problems creating the table of contents.  If linking a library
55258c4a8e55Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
55268c4a8e55Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
55278c4a8e55Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
55288c4a8e55Smrg
55298c4a8e55Smrg        _LT_TAGVAR(archive_cmds, $1)=''
55308c4a8e55Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
55318c4a8e55Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
55328c4a8e55Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
55338c4a8e55Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
55348c4a8e55Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
55358c4a8e55Smrg
55368c4a8e55Smrg        if test "$GXX" = yes; then
55378c4a8e55Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
55388c4a8e55Smrg          # We only want to do this on AIX 4.2 and lower, the check
55398c4a8e55Smrg          # below for broken collect2 doesn't work under 4.3+
55408c4a8e55Smrg	  collect2name=`${CC} -print-prog-name=collect2`
55418c4a8e55Smrg	  if test -f "$collect2name" &&
55428c4a8e55Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
55438c4a8e55Smrg	  then
55448c4a8e55Smrg	    # We have reworked collect2
55458c4a8e55Smrg	    :
55468c4a8e55Smrg	  else
55478c4a8e55Smrg	    # We have old collect2
55488c4a8e55Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
55498c4a8e55Smrg	    # It fails to find uninstalled libraries when the uninstalled
55508c4a8e55Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
55518c4a8e55Smrg	    # to unsupported forces relinking
55528c4a8e55Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
55538c4a8e55Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
55548c4a8e55Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
55558c4a8e55Smrg	  fi
55568c4a8e55Smrg          esac
55578c4a8e55Smrg          shared_flag='-shared'
55588c4a8e55Smrg	  if test "$aix_use_runtimelinking" = yes; then
55598c4a8e55Smrg	    shared_flag="$shared_flag "'${wl}-G'
55608c4a8e55Smrg	  fi
55618c4a8e55Smrg        else
55628c4a8e55Smrg          # not using gcc
55638c4a8e55Smrg          if test "$host_cpu" = ia64; then
55648c4a8e55Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
55658c4a8e55Smrg	  # chokes on -Wl,-G. The following line is correct:
55668c4a8e55Smrg	  shared_flag='-G'
55678c4a8e55Smrg          else
55688c4a8e55Smrg	    if test "$aix_use_runtimelinking" = yes; then
55698c4a8e55Smrg	      shared_flag='${wl}-G'
55708c4a8e55Smrg	    else
55718c4a8e55Smrg	      shared_flag='${wl}-bM:SRE'
55728c4a8e55Smrg	    fi
55738c4a8e55Smrg          fi
55748c4a8e55Smrg        fi
5575b042e37fSmrg
55768c4a8e55Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
55778c4a8e55Smrg        # It seems that -bexpall does not export symbols beginning with
55788c4a8e55Smrg        # underscore (_), so it is better to generate a list of symbols to
55798c4a8e55Smrg	# export.
55808c4a8e55Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
55818c4a8e55Smrg        if test "$aix_use_runtimelinking" = yes; then
55828c4a8e55Smrg          # Warning - without using the other runtime loading flags (-brtl),
55838c4a8e55Smrg          # -berok will link without error, but may produce a broken library.
55848c4a8e55Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
55858c4a8e55Smrg          # Determine the default libpath from the value encoded in an empty
55868c4a8e55Smrg          # executable.
55878c4a8e55Smrg          _LT_SYS_MODULE_PATH_AIX
55888c4a8e55Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
55898c4a8e55Smrg
55908c4a8e55Smrg          _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"
55918c4a8e55Smrg        else
55928c4a8e55Smrg          if test "$host_cpu" = ia64; then
55938c4a8e55Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
55948c4a8e55Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
55958c4a8e55Smrg	    _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"
55968c4a8e55Smrg          else
55978c4a8e55Smrg	    # Determine the default libpath from the value encoded in an
55988c4a8e55Smrg	    # empty executable.
55998c4a8e55Smrg	    _LT_SYS_MODULE_PATH_AIX
56008c4a8e55Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
56018c4a8e55Smrg	    # Warning - without using the other run time loading flags,
56028c4a8e55Smrg	    # -berok will link without error, but may produce a broken library.
56038c4a8e55Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
56048c4a8e55Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
56058c4a8e55Smrg	    # Exported symbols can be pulled into shared objects from archives
56068c4a8e55Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
56078c4a8e55Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
56088c4a8e55Smrg	    # This is similar to how AIX traditionally builds its shared
56098c4a8e55Smrg	    # libraries.
56108c4a8e55Smrg	    _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'
56118c4a8e55Smrg          fi
56128c4a8e55Smrg        fi
56138c4a8e55Smrg        ;;
5614b042e37fSmrg
56158c4a8e55Smrg      beos*)
56168c4a8e55Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
56178c4a8e55Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
56188c4a8e55Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
56198c4a8e55Smrg	  # support --undefined.  This deserves some investigation.  FIXME
56208c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
56218c4a8e55Smrg	else
56228c4a8e55Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
56238c4a8e55Smrg	fi
56248c4a8e55Smrg	;;
5625b042e37fSmrg
56268c4a8e55Smrg      chorus*)
56278c4a8e55Smrg        case $cc_basename in
56288c4a8e55Smrg          *)
56298c4a8e55Smrg	  # FIXME: insert proper C++ library support
56308c4a8e55Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
56318c4a8e55Smrg	  ;;
56328c4a8e55Smrg        esac
56338c4a8e55Smrg        ;;
5634b042e37fSmrg
56358c4a8e55Smrg      cygwin* | mingw* | pw32* | cegcc*)
56368c4a8e55Smrg        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
56378c4a8e55Smrg        # as there is no search path for DLLs.
56388c4a8e55Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
56398c4a8e55Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
56408c4a8e55Smrg        _LT_TAGVAR(always_export_symbols, $1)=no
56418c4a8e55Smrg        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
56428c4a8e55Smrg
56438c4a8e55Smrg        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
56448c4a8e55Smrg          _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'
56458c4a8e55Smrg          # If the export-symbols file already is a .def file (1st line
56468c4a8e55Smrg          # is EXPORTS), use it as is; otherwise, prepend...
56478c4a8e55Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
56488c4a8e55Smrg	    cp $export_symbols $output_objdir/$soname.def;
56498c4a8e55Smrg          else
56508c4a8e55Smrg	    echo EXPORTS > $output_objdir/$soname.def;
56518c4a8e55Smrg	    cat $export_symbols >> $output_objdir/$soname.def;
56528c4a8e55Smrg          fi~
56538c4a8e55Smrg          $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'
56548c4a8e55Smrg        else
56558c4a8e55Smrg          _LT_TAGVAR(ld_shlibs, $1)=no
56568c4a8e55Smrg        fi
56578c4a8e55Smrg        ;;
56588c4a8e55Smrg      darwin* | rhapsody*)
56598c4a8e55Smrg        _LT_DARWIN_LINKER_FEATURES($1)
56608c4a8e55Smrg	;;
5661b042e37fSmrg
56628c4a8e55Smrg      dgux*)
56638c4a8e55Smrg        case $cc_basename in
56648c4a8e55Smrg          ec++*)
56658c4a8e55Smrg	    # FIXME: insert proper C++ library support
56668c4a8e55Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
56678c4a8e55Smrg	    ;;
56688c4a8e55Smrg          ghcx*)
56698c4a8e55Smrg	    # Green Hills C++ Compiler
56708c4a8e55Smrg	    # FIXME: insert proper C++ library support
56718c4a8e55Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
56728c4a8e55Smrg	    ;;
56738c4a8e55Smrg          *)
56748c4a8e55Smrg	    # FIXME: insert proper C++ library support
56758c4a8e55Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
56768c4a8e55Smrg	    ;;
56778c4a8e55Smrg        esac
56788c4a8e55Smrg        ;;
5679b042e37fSmrg
56808c4a8e55Smrg      freebsd[[12]]*)
56818c4a8e55Smrg        # C++ shared libraries reported to be fairly broken before
56828c4a8e55Smrg	# switch to ELF
56838c4a8e55Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
56848c4a8e55Smrg        ;;
5685b042e37fSmrg
56868c4a8e55Smrg      freebsd-elf*)
56878c4a8e55Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
56888c4a8e55Smrg        ;;
5689b042e37fSmrg
56908c4a8e55Smrg      freebsd* | dragonfly*)
56918c4a8e55Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
56928c4a8e55Smrg        # conventions
56938c4a8e55Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
56948c4a8e55Smrg        ;;
5695b042e37fSmrg
56968c4a8e55Smrg      gnu*)
56978c4a8e55Smrg        ;;
5698b042e37fSmrg
56998c4a8e55Smrg      hpux9*)
57008c4a8e55Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
57018c4a8e55Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
57028c4a8e55Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
57038c4a8e55Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
57048c4a8e55Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
57058c4a8e55Smrg				             # but as the default
57068c4a8e55Smrg				             # location of the library.
57078c4a8e55Smrg
57088c4a8e55Smrg        case $cc_basename in
57098c4a8e55Smrg          CC*)
57108c4a8e55Smrg            # FIXME: insert proper C++ library support
57118c4a8e55Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
57128c4a8e55Smrg            ;;
57138c4a8e55Smrg          aCC*)
57148c4a8e55Smrg            _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'
57158c4a8e55Smrg            # Commands to make compiler produce verbose output that lists
57168c4a8e55Smrg            # what "hidden" libraries, object files and flags are used when
57178c4a8e55Smrg            # linking a shared library.
57188c4a8e55Smrg            #
57198c4a8e55Smrg            # There doesn't appear to be a way to prevent this compiler from
57208c4a8e55Smrg            # explicitly linking system object files so we need to strip them
57218c4a8e55Smrg            # from the output so that they don't get included in the library
57228c4a8e55Smrg            # dependencies.
57238c4a8e55Smrg            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'
57248c4a8e55Smrg            ;;
57258c4a8e55Smrg          *)
57268c4a8e55Smrg            if test "$GXX" = yes; then
57278c4a8e55Smrg              _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'
57288c4a8e55Smrg            else
57298c4a8e55Smrg              # FIXME: insert proper C++ library support
57308c4a8e55Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
57318c4a8e55Smrg            fi
57328c4a8e55Smrg            ;;
57338c4a8e55Smrg        esac
57348c4a8e55Smrg        ;;
5735b042e37fSmrg
57368c4a8e55Smrg      hpux10*|hpux11*)
57378c4a8e55Smrg        if test $with_gnu_ld = no; then
57388c4a8e55Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
57398c4a8e55Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
57408c4a8e55Smrg
57418c4a8e55Smrg          case $host_cpu in
57428c4a8e55Smrg            hppa*64*|ia64*)
57438c4a8e55Smrg              ;;
57448c4a8e55Smrg            *)
57458c4a8e55Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
57468c4a8e55Smrg              ;;
57478c4a8e55Smrg          esac
57488c4a8e55Smrg        fi
57498c4a8e55Smrg        case $host_cpu in
57508c4a8e55Smrg          hppa*64*|ia64*)
57518c4a8e55Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
57528c4a8e55Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
57538c4a8e55Smrg            ;;
57548c4a8e55Smrg          *)
57558c4a8e55Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
57568c4a8e55Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
57578c4a8e55Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
57588c4a8e55Smrg					         # but as the default
57598c4a8e55Smrg					         # location of the library.
57608c4a8e55Smrg            ;;
57618c4a8e55Smrg        esac
5762b042e37fSmrg
57638c4a8e55Smrg        case $cc_basename in
57648c4a8e55Smrg          CC*)
57658c4a8e55Smrg	    # FIXME: insert proper C++ library support
57668c4a8e55Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
57678c4a8e55Smrg	    ;;
57688c4a8e55Smrg          aCC*)
57698c4a8e55Smrg	    case $host_cpu in
57708c4a8e55Smrg	      hppa*64*)
57718c4a8e55Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
57728c4a8e55Smrg	        ;;
57738c4a8e55Smrg	      ia64*)
57748c4a8e55Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
57758c4a8e55Smrg	        ;;
57768c4a8e55Smrg	      *)
57778c4a8e55Smrg	        _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'
57788c4a8e55Smrg	        ;;
57798c4a8e55Smrg	    esac
57808c4a8e55Smrg	    # Commands to make compiler produce verbose output that lists
57818c4a8e55Smrg	    # what "hidden" libraries, object files and flags are used when
57828c4a8e55Smrg	    # linking a shared library.
57838c4a8e55Smrg	    #
57848c4a8e55Smrg	    # There doesn't appear to be a way to prevent this compiler from
57858c4a8e55Smrg	    # explicitly linking system object files so we need to strip them
57868c4a8e55Smrg	    # from the output so that they don't get included in the library
57878c4a8e55Smrg	    # dependencies.
57888c4a8e55Smrg	    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'
57898c4a8e55Smrg	    ;;
57908c4a8e55Smrg          *)
57918c4a8e55Smrg	    if test "$GXX" = yes; then
57928c4a8e55Smrg	      if test $with_gnu_ld = no; then
57938c4a8e55Smrg	        case $host_cpu in
57948c4a8e55Smrg	          hppa*64*)
57958c4a8e55Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
57968c4a8e55Smrg	            ;;
57978c4a8e55Smrg	          ia64*)
57988c4a8e55Smrg	            _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'
57998c4a8e55Smrg	            ;;
58008c4a8e55Smrg	          *)
58018c4a8e55Smrg	            _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'
58028c4a8e55Smrg	            ;;
58038c4a8e55Smrg	        esac
58048c4a8e55Smrg	      fi
58058c4a8e55Smrg	    else
58068c4a8e55Smrg	      # FIXME: insert proper C++ library support
58078c4a8e55Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
58088c4a8e55Smrg	    fi
58098c4a8e55Smrg	    ;;
58108c4a8e55Smrg        esac
58118c4a8e55Smrg        ;;
5812b042e37fSmrg
58138c4a8e55Smrg      interix[[3-9]]*)
58148c4a8e55Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
58158c4a8e55Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58168c4a8e55Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
58178c4a8e55Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
58188c4a8e55Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
58198c4a8e55Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
58208c4a8e55Smrg	# default) and relocated if they conflict, which is a slow very memory
58218c4a8e55Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
58228c4a8e55Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
58238c4a8e55Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
58248c4a8e55Smrg	_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'
58258c4a8e55Smrg	_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'
58268c4a8e55Smrg	;;
58278c4a8e55Smrg      irix5* | irix6*)
58288c4a8e55Smrg        case $cc_basename in
58298c4a8e55Smrg          CC*)
58308c4a8e55Smrg	    # SGI C++
58318c4a8e55Smrg	    _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'
58328c4a8e55Smrg
58338c4a8e55Smrg	    # Archives containing C++ object files must be created using
58348c4a8e55Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
58358c4a8e55Smrg	    # necessary to make sure instantiated templates are included
58368c4a8e55Smrg	    # in the archive.
58378c4a8e55Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
58388c4a8e55Smrg	    ;;
58398c4a8e55Smrg          *)
58408c4a8e55Smrg	    if test "$GXX" = yes; then
58418c4a8e55Smrg	      if test "$with_gnu_ld" = no; then
58428c4a8e55Smrg	        _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'
58438c4a8e55Smrg	      else
58448c4a8e55Smrg	        _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'
58458c4a8e55Smrg	      fi
58468c4a8e55Smrg	    fi
58478c4a8e55Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
58488c4a8e55Smrg	    ;;
58498c4a8e55Smrg        esac
58508c4a8e55Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
58518c4a8e55Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
58528c4a8e55Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
58538c4a8e55Smrg        ;;
5854b042e37fSmrg
58558c4a8e55Smrg      linux* | k*bsd*-gnu)
58568c4a8e55Smrg        case $cc_basename in
58578c4a8e55Smrg          KCC*)
58588c4a8e55Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
5859b042e37fSmrg
58608c4a8e55Smrg	    # KCC will only create a shared library if the output file
58618c4a8e55Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
58628c4a8e55Smrg	    # to its proper name (with version) after linking.
58638c4a8e55Smrg	    _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'
58648c4a8e55Smrg	    _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'
58658c4a8e55Smrg	    # Commands to make compiler produce verbose output that lists
58668c4a8e55Smrg	    # what "hidden" libraries, object files and flags are used when
58678c4a8e55Smrg	    # linking a shared library.
58688c4a8e55Smrg	    #
58698c4a8e55Smrg	    # There doesn't appear to be a way to prevent this compiler from
58708c4a8e55Smrg	    # explicitly linking system object files so we need to strip them
58718c4a8e55Smrg	    # from the output so that they don't get included in the library
58728c4a8e55Smrg	    # dependencies.
58738c4a8e55Smrg	    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'
58748c4a8e55Smrg
58758c4a8e55Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
58768c4a8e55Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
58778c4a8e55Smrg
58788c4a8e55Smrg	    # Archives containing C++ object files must be created using
58798c4a8e55Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
58808c4a8e55Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
58818c4a8e55Smrg	    ;;
58828c4a8e55Smrg	  icpc* | ecpc* )
58838c4a8e55Smrg	    # Intel C++
58848c4a8e55Smrg	    with_gnu_ld=yes
58858c4a8e55Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
58868c4a8e55Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
58878c4a8e55Smrg	    # earlier do not add the objects themselves.
58888c4a8e55Smrg	    case `$CC -V 2>&1` in
58898c4a8e55Smrg	      *"Version 7."*)
58908c4a8e55Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
58918c4a8e55Smrg		_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'
58928c4a8e55Smrg		;;
58938c4a8e55Smrg	      *)  # Version 8.0 or newer
58948c4a8e55Smrg	        tmp_idyn=
58958c4a8e55Smrg	        case $host_cpu in
58968c4a8e55Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
58978c4a8e55Smrg		esac
58988c4a8e55Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
58998c4a8e55Smrg		_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'
59008c4a8e55Smrg		;;
59018c4a8e55Smrg	    esac
59028c4a8e55Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
59038c4a8e55Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
59048c4a8e55Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
59058c4a8e55Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
59068c4a8e55Smrg	    ;;
59078c4a8e55Smrg          pgCC* | pgcpp*)
59088c4a8e55Smrg            # Portland Group C++ compiler
59098c4a8e55Smrg	    case `$CC -V` in
59108c4a8e55Smrg	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
59118c4a8e55Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
59128c4a8e55Smrg		rm -rf $tpldir~
59138c4a8e55Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
59148c4a8e55Smrg		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
59158c4a8e55Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
59168c4a8e55Smrg		rm -rf $tpldir~
59178c4a8e55Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
59188c4a8e55Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
59198c4a8e55Smrg		$RANLIB $oldlib'
59208c4a8e55Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
59218c4a8e55Smrg		rm -rf $tpldir~
59228c4a8e55Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
59238c4a8e55Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
59248c4a8e55Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
59258c4a8e55Smrg		rm -rf $tpldir~
59268c4a8e55Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
59278c4a8e55Smrg		$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'
59288c4a8e55Smrg	      ;;
59298c4a8e55Smrg	    *) # Version 6 will use weak symbols
59308c4a8e55Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
59318c4a8e55Smrg	      _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'
59328c4a8e55Smrg	      ;;
59338c4a8e55Smrg	    esac
5934b042e37fSmrg
59358c4a8e55Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
59368c4a8e55Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
59378c4a8e55Smrg	    _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'
59388c4a8e55Smrg            ;;
59398c4a8e55Smrg	  cxx*)
59408c4a8e55Smrg	    # Compaq C++
59418c4a8e55Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
59428c4a8e55Smrg	    _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'
5943b042e37fSmrg
59448c4a8e55Smrg	    runpath_var=LD_RUN_PATH
59458c4a8e55Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
59468c4a8e55Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5947b042e37fSmrg
59488c4a8e55Smrg	    # Commands to make compiler produce verbose output that lists
59498c4a8e55Smrg	    # what "hidden" libraries, object files and flags are used when
59508c4a8e55Smrg	    # linking a shared library.
59518c4a8e55Smrg	    #
59528c4a8e55Smrg	    # There doesn't appear to be a way to prevent this compiler from
59538c4a8e55Smrg	    # explicitly linking system object files so we need to strip them
59548c4a8e55Smrg	    # from the output so that they don't get included in the library
59558c4a8e55Smrg	    # dependencies.
59568c4a8e55Smrg	    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'
59578c4a8e55Smrg	    ;;
59588c4a8e55Smrg	  xl*)
59598c4a8e55Smrg	    # IBM XL 8.0 on PPC, with GNU ld
59608c4a8e55Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
59618c4a8e55Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
59628c4a8e55Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
59638c4a8e55Smrg	    if test "x$supports_anon_versioning" = xyes; then
59648c4a8e55Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
59658c4a8e55Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
59668c4a8e55Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
59678c4a8e55Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
59688c4a8e55Smrg	    fi
59698c4a8e55Smrg	    ;;
59708c4a8e55Smrg	  *)
59718c4a8e55Smrg	    case `$CC -V 2>&1 | sed 5q` in
59728c4a8e55Smrg	    *Sun\ C*)
59738c4a8e55Smrg	      # Sun C++ 5.9
59748c4a8e55Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
59758c4a8e55Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
59768c4a8e55Smrg	      _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'
59778c4a8e55Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
59788c4a8e55Smrg	      _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'
59798c4a8e55Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
59808c4a8e55Smrg
59818c4a8e55Smrg	      # Not sure whether something based on
59828c4a8e55Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
59838c4a8e55Smrg	      # would be better.
59848c4a8e55Smrg	      output_verbose_link_cmd='echo'
59858c4a8e55Smrg
59868c4a8e55Smrg	      # Archives containing C++ object files must be created using
59878c4a8e55Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
59888c4a8e55Smrg	      # necessary to make sure instantiated templates are included
59898c4a8e55Smrg	      # in the archive.
59908c4a8e55Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
59918c4a8e55Smrg	      ;;
59928c4a8e55Smrg	    esac
59938c4a8e55Smrg	    ;;
59948c4a8e55Smrg	esac
59958c4a8e55Smrg	;;
5996b042e37fSmrg
59978c4a8e55Smrg      lynxos*)
59988c4a8e55Smrg        # FIXME: insert proper C++ library support
59998c4a8e55Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
60008c4a8e55Smrg	;;
6001b042e37fSmrg
60028c4a8e55Smrg      m88k*)
60038c4a8e55Smrg        # FIXME: insert proper C++ library support
60048c4a8e55Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
60058c4a8e55Smrg	;;
6006b042e37fSmrg
60078c4a8e55Smrg      mvs*)
60088c4a8e55Smrg        case $cc_basename in
60098c4a8e55Smrg          cxx*)
60108c4a8e55Smrg	    # FIXME: insert proper C++ library support
60118c4a8e55Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
60128c4a8e55Smrg	    ;;
60138c4a8e55Smrg	  *)
60148c4a8e55Smrg	    # FIXME: insert proper C++ library support
60158c4a8e55Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
60168c4a8e55Smrg	    ;;
60178c4a8e55Smrg	esac
60188c4a8e55Smrg	;;
6019b042e37fSmrg
60208c4a8e55Smrg      netbsd*)
60218c4a8e55Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
60228c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
60238c4a8e55Smrg	  wlarc=
60248c4a8e55Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
60258c4a8e55Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
60268c4a8e55Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60278c4a8e55Smrg	fi
60288c4a8e55Smrg	# Workaround some broken pre-1.5 toolchains
60298c4a8e55Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
60308c4a8e55Smrg	;;
6031b042e37fSmrg
60328c4a8e55Smrg      *nto* | *qnx*)
60338c4a8e55Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
60348c4a8e55Smrg	;;
6035b042e37fSmrg
60368c4a8e55Smrg      openbsd2*)
60378c4a8e55Smrg        # C++ shared libraries are fairly broken
60388c4a8e55Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
60398c4a8e55Smrg	;;
6040b042e37fSmrg
60418c4a8e55Smrg      openbsd*)
60428c4a8e55Smrg	if test -f /usr/libexec/ld.so; then
60438c4a8e55Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
60448c4a8e55Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60458c4a8e55Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
60468c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
60478c4a8e55Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
60488c4a8e55Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
60498c4a8e55Smrg	    _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'
60508c4a8e55Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
60518c4a8e55Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
60528c4a8e55Smrg	  fi
60538c4a8e55Smrg	  output_verbose_link_cmd=echo
60548c4a8e55Smrg	else
60558c4a8e55Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
60568c4a8e55Smrg	fi
60578c4a8e55Smrg	;;
6058b042e37fSmrg
60598c4a8e55Smrg      osf3* | osf4* | osf5*)
60608c4a8e55Smrg        case $cc_basename in
60618c4a8e55Smrg          KCC*)
60628c4a8e55Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
60638c4a8e55Smrg
60648c4a8e55Smrg	    # KCC will only create a shared library if the output file
60658c4a8e55Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
60668c4a8e55Smrg	    # to its proper name (with version) after linking.
60678c4a8e55Smrg	    _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'
60688c4a8e55Smrg
60698c4a8e55Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
60708c4a8e55Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
60718c4a8e55Smrg
60728c4a8e55Smrg	    # Archives containing C++ object files must be created using
60738c4a8e55Smrg	    # the KAI C++ compiler.
60748c4a8e55Smrg	    case $host in
60758c4a8e55Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
60768c4a8e55Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
60778c4a8e55Smrg	    esac
60788c4a8e55Smrg	    ;;
60798c4a8e55Smrg          RCC*)
60808c4a8e55Smrg	    # Rational C++ 2.4.1
60818c4a8e55Smrg	    # FIXME: insert proper C++ library support
60828c4a8e55Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
60838c4a8e55Smrg	    ;;
60848c4a8e55Smrg          cxx*)
60858c4a8e55Smrg	    case $host in
60868c4a8e55Smrg	      osf3*)
60878c4a8e55Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
60888c4a8e55Smrg	        _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'
60898c4a8e55Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
60908c4a8e55Smrg		;;
60918c4a8e55Smrg	      *)
60928c4a8e55Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
60938c4a8e55Smrg	        _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'
60948c4a8e55Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
60958c4a8e55Smrg	          echo "-hidden">> $lib.exp~
60968c4a8e55Smrg	          $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~
60978c4a8e55Smrg	          $RM $lib.exp'
60988c4a8e55Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
60998c4a8e55Smrg		;;
61008c4a8e55Smrg	    esac
6101b042e37fSmrg
61028c4a8e55Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6103b042e37fSmrg
61048c4a8e55Smrg	    # Commands to make compiler produce verbose output that lists
61058c4a8e55Smrg	    # what "hidden" libraries, object files and flags are used when
61068c4a8e55Smrg	    # linking a shared library.
61078c4a8e55Smrg	    #
61088c4a8e55Smrg	    # There doesn't appear to be a way to prevent this compiler from
61098c4a8e55Smrg	    # explicitly linking system object files so we need to strip them
61108c4a8e55Smrg	    # from the output so that they don't get included in the library
61118c4a8e55Smrg	    # dependencies.
61128c4a8e55Smrg	    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'
61138c4a8e55Smrg	    ;;
61148c4a8e55Smrg	  *)
61158c4a8e55Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
61168c4a8e55Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
61178c4a8e55Smrg	      case $host in
61188c4a8e55Smrg	        osf3*)
61198c4a8e55Smrg	          _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'
61208c4a8e55Smrg		  ;;
61218c4a8e55Smrg	        *)
61228c4a8e55Smrg	          _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'
61238c4a8e55Smrg		  ;;
61248c4a8e55Smrg	      esac
61258c4a8e55Smrg
61268c4a8e55Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
61278c4a8e55Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
61288c4a8e55Smrg
61298c4a8e55Smrg	      # Commands to make compiler produce verbose output that lists
61308c4a8e55Smrg	      # what "hidden" libraries, object files and flags are used when
61318c4a8e55Smrg	      # linking a shared library.
61328c4a8e55Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
61338c4a8e55Smrg
61348c4a8e55Smrg	    else
61358c4a8e55Smrg	      # FIXME: insert proper C++ library support
61368c4a8e55Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
61378c4a8e55Smrg	    fi
61388c4a8e55Smrg	    ;;
61398c4a8e55Smrg        esac
61408c4a8e55Smrg        ;;
6141b042e37fSmrg
61428c4a8e55Smrg      psos*)
61438c4a8e55Smrg        # FIXME: insert proper C++ library support
61448c4a8e55Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
61458c4a8e55Smrg        ;;
6146b042e37fSmrg
61478c4a8e55Smrg      sunos4*)
61488c4a8e55Smrg        case $cc_basename in
61498c4a8e55Smrg          CC*)
61508c4a8e55Smrg	    # Sun C++ 4.x
61518c4a8e55Smrg	    # FIXME: insert proper C++ library support
61528c4a8e55Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
61538c4a8e55Smrg	    ;;
61548c4a8e55Smrg          lcc*)
61558c4a8e55Smrg	    # Lucid
61568c4a8e55Smrg	    # FIXME: insert proper C++ library support
61578c4a8e55Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
61588c4a8e55Smrg	    ;;
61598c4a8e55Smrg          *)
61608c4a8e55Smrg	    # FIXME: insert proper C++ library support
61618c4a8e55Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
61628c4a8e55Smrg	    ;;
61638c4a8e55Smrg        esac
61648c4a8e55Smrg        ;;
6165b042e37fSmrg
61668c4a8e55Smrg      solaris*)
61678c4a8e55Smrg        case $cc_basename in
61688c4a8e55Smrg          CC*)
61698c4a8e55Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
61708c4a8e55Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
61718c4a8e55Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
61728c4a8e55Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
61738c4a8e55Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
61748c4a8e55Smrg	      $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'
61758c4a8e55Smrg
61768c4a8e55Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
61778c4a8e55Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
61788c4a8e55Smrg	    case $host_os in
61798c4a8e55Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
61808c4a8e55Smrg	      *)
61818c4a8e55Smrg		# The compiler driver will combine and reorder linker options,
61828c4a8e55Smrg		# but understands `-z linker_flag'.
61838c4a8e55Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
61848c4a8e55Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
61858c4a8e55Smrg	        ;;
61868c4a8e55Smrg	    esac
61878c4a8e55Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6188b042e37fSmrg
61898c4a8e55Smrg	    output_verbose_link_cmd='echo'
6190b042e37fSmrg
61918c4a8e55Smrg	    # Archives containing C++ object files must be created using
61928c4a8e55Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
61938c4a8e55Smrg	    # necessary to make sure instantiated templates are included
61948c4a8e55Smrg	    # in the archive.
61958c4a8e55Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
61968c4a8e55Smrg	    ;;
61978c4a8e55Smrg          gcx*)
61988c4a8e55Smrg	    # Green Hills C++ Compiler
61998c4a8e55Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6200b042e37fSmrg
62018c4a8e55Smrg	    # The C++ compiler must be used to create the archive.
62028c4a8e55Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
62038c4a8e55Smrg	    ;;
62048c4a8e55Smrg          *)
62058c4a8e55Smrg	    # GNU C++ compiler with Solaris linker
62068c4a8e55Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
62078c4a8e55Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
62088c4a8e55Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
62098c4a8e55Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
62108c4a8e55Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
62118c4a8e55Smrg		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
62128c4a8e55Smrg
62138c4a8e55Smrg	        # Commands to make compiler produce verbose output that lists
62148c4a8e55Smrg	        # what "hidden" libraries, object files and flags are used when
62158c4a8e55Smrg	        # linking a shared library.
62168c4a8e55Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
62178c4a8e55Smrg	      else
62188c4a8e55Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
62198c4a8e55Smrg	        # platform.
62208c4a8e55Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
62218c4a8e55Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
62228c4a8e55Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
62238c4a8e55Smrg
62248c4a8e55Smrg	        # Commands to make compiler produce verbose output that lists
62258c4a8e55Smrg	        # what "hidden" libraries, object files and flags are used when
62268c4a8e55Smrg	        # linking a shared library.
62278c4a8e55Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
62288c4a8e55Smrg	      fi
62298c4a8e55Smrg
62308c4a8e55Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
62318c4a8e55Smrg	      case $host_os in
62328c4a8e55Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
62338c4a8e55Smrg		*)
62348c4a8e55Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
62358c4a8e55Smrg		  ;;
62368c4a8e55Smrg	      esac
62378c4a8e55Smrg	    fi
62388c4a8e55Smrg	    ;;
62398c4a8e55Smrg        esac
62408c4a8e55Smrg        ;;
6241b042e37fSmrg
62428c4a8e55Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
62438c4a8e55Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
62448c4a8e55Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
62458c4a8e55Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
62468c4a8e55Smrg      runpath_var='LD_RUN_PATH'
6247b042e37fSmrg
62488c4a8e55Smrg      case $cc_basename in
62498c4a8e55Smrg        CC*)
62508c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
62518c4a8e55Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
62528c4a8e55Smrg	  ;;
62538c4a8e55Smrg	*)
62548c4a8e55Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
62558c4a8e55Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
62568c4a8e55Smrg	  ;;
62578c4a8e55Smrg      esac
62588c4a8e55Smrg      ;;
6259b042e37fSmrg
62608c4a8e55Smrg      sysv5* | sco3.2v5* | sco5v6*)
62618c4a8e55Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
62628c4a8e55Smrg	# link with -lc, and that would cause any symbols used from libc to
62638c4a8e55Smrg	# always be unresolved, which means just about no library would
62648c4a8e55Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
62658c4a8e55Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
62668c4a8e55Smrg	# as -z defs.
62678c4a8e55Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
62688c4a8e55Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
62698c4a8e55Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
62708c4a8e55Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
62718c4a8e55Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
62728c4a8e55Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
62738c4a8e55Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
62748c4a8e55Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
62758c4a8e55Smrg	runpath_var='LD_RUN_PATH'
6276b042e37fSmrg
62778c4a8e55Smrg	case $cc_basename in
62788c4a8e55Smrg          CC*)
62798c4a8e55Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
62808c4a8e55Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
62818c4a8e55Smrg	    ;;
62828c4a8e55Smrg	  *)
62838c4a8e55Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
62848c4a8e55Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
62858c4a8e55Smrg	    ;;
62868c4a8e55Smrg	esac
62878c4a8e55Smrg      ;;
6288b042e37fSmrg
62898c4a8e55Smrg      tandem*)
62908c4a8e55Smrg        case $cc_basename in
62918c4a8e55Smrg          NCC*)
62928c4a8e55Smrg	    # NonStop-UX NCC 3.20
62938c4a8e55Smrg	    # FIXME: insert proper C++ library support
62948c4a8e55Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62958c4a8e55Smrg	    ;;
62968c4a8e55Smrg          *)
62978c4a8e55Smrg	    # FIXME: insert proper C++ library support
62988c4a8e55Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62998c4a8e55Smrg	    ;;
63008c4a8e55Smrg        esac
63018c4a8e55Smrg        ;;
6302b042e37fSmrg
63038c4a8e55Smrg      vxworks*)
63048c4a8e55Smrg        # FIXME: insert proper C++ library support
63058c4a8e55Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
63068c4a8e55Smrg        ;;
6307b042e37fSmrg
63088c4a8e55Smrg      *)
63098c4a8e55Smrg        # FIXME: insert proper C++ library support
63108c4a8e55Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
63118c4a8e55Smrg        ;;
63128c4a8e55Smrg    esac
6313b042e37fSmrg
63148c4a8e55Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
63158c4a8e55Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
63168c4a8e55Smrg
63178c4a8e55Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
63188c4a8e55Smrg    _LT_TAGVAR(LD, $1)="$LD"
63198c4a8e55Smrg
63208c4a8e55Smrg    ## CAVEAT EMPTOR:
63218c4a8e55Smrg    ## There is no encapsulation within the following macros, do not change
63228c4a8e55Smrg    ## the running order or otherwise move them around unless you know exactly
63238c4a8e55Smrg    ## what you are doing...
63248c4a8e55Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
63258c4a8e55Smrg    _LT_COMPILER_PIC($1)
63268c4a8e55Smrg    _LT_COMPILER_C_O($1)
63278c4a8e55Smrg    _LT_COMPILER_FILE_LOCKS($1)
63288c4a8e55Smrg    _LT_LINKER_SHLIBS($1)
63298c4a8e55Smrg    _LT_SYS_DYNAMIC_LINKER($1)
63308c4a8e55Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
63318c4a8e55Smrg
63328c4a8e55Smrg    _LT_CONFIG($1)
63338c4a8e55Smrg  fi # test -n "$compiler"
63348c4a8e55Smrg
63358c4a8e55Smrg  CC=$lt_save_CC
63368c4a8e55Smrg  LDCXX=$LD
63378c4a8e55Smrg  LD=$lt_save_LD
63388c4a8e55Smrg  GCC=$lt_save_GCC
63398c4a8e55Smrg  with_gnu_ld=$lt_save_with_gnu_ld
63408c4a8e55Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
63418c4a8e55Smrg  lt_cv_path_LD=$lt_save_path_LD
63428c4a8e55Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
63438c4a8e55Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
63448c4a8e55Smrgfi # test "$_lt_caught_CXX_error" != yes
6345b042e37fSmrg
63468c4a8e55SmrgAC_LANG_POP
63478c4a8e55Smrg])# _LT_LANG_CXX_CONFIG
6348b042e37fSmrg
6349b042e37fSmrg
63508c4a8e55Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
63518c4a8e55Smrg# ---------------------------------
63528c4a8e55Smrg# Figure out "hidden" library dependencies from verbose
63538c4a8e55Smrg# compiler output when linking a shared library.
63548c4a8e55Smrg# Parse the compiler output and extract the necessary
63558c4a8e55Smrg# objects, libraries and library flags.
63568c4a8e55Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
63578c4a8e55Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
63588c4a8e55Smrg# Dependencies to place before and after the object being linked:
63598c4a8e55Smrg_LT_TAGVAR(predep_objects, $1)=
63608c4a8e55Smrg_LT_TAGVAR(postdep_objects, $1)=
63618c4a8e55Smrg_LT_TAGVAR(predeps, $1)=
63628c4a8e55Smrg_LT_TAGVAR(postdeps, $1)=
63638c4a8e55Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
6364b042e37fSmrg
63658c4a8e55Smrgdnl we can't use the lt_simple_compile_test_code here,
63668c4a8e55Smrgdnl because it contains code intended for an executable,
63678c4a8e55Smrgdnl not a library.  It's possible we should let each
63688c4a8e55Smrgdnl tag define a new lt_????_link_test_code variable,
63698c4a8e55Smrgdnl but it's only used here...
63708c4a8e55Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
63718c4a8e55Smrgint a;
63728c4a8e55Smrgvoid foo (void) { a = 0; }
63738c4a8e55Smrg_LT_EOF
63748c4a8e55Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
63758c4a8e55Smrgclass Foo
63768c4a8e55Smrg{
63778c4a8e55Smrgpublic:
63788c4a8e55Smrg  Foo (void) { a = 0; }
63798c4a8e55Smrgprivate:
63808c4a8e55Smrg  int a;
63818c4a8e55Smrg};
63828c4a8e55Smrg_LT_EOF
63838c4a8e55Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
63848c4a8e55Smrg      subroutine foo
63858c4a8e55Smrg      implicit none
63868c4a8e55Smrg      integer*4 a
63878c4a8e55Smrg      a=0
63888c4a8e55Smrg      return
63898c4a8e55Smrg      end
63908c4a8e55Smrg_LT_EOF
63918c4a8e55Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
63928c4a8e55Smrg      subroutine foo
63938c4a8e55Smrg      implicit none
63948c4a8e55Smrg      integer a
63958c4a8e55Smrg      a=0
63968c4a8e55Smrg      return
63978c4a8e55Smrg      end
63988c4a8e55Smrg_LT_EOF
63998c4a8e55Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
64008c4a8e55Smrgpublic class foo {
64018c4a8e55Smrg  private int a;
64028c4a8e55Smrg  public void bar (void) {
64038c4a8e55Smrg    a = 0;
64048c4a8e55Smrg  }
64058c4a8e55Smrg};
64068c4a8e55Smrg_LT_EOF
64078c4a8e55Smrg])
64088c4a8e55Smrgdnl Parse the compiler output and extract the necessary
64098c4a8e55Smrgdnl objects, libraries and library flags.
64108c4a8e55Smrgif AC_TRY_EVAL(ac_compile); then
64118c4a8e55Smrg  # Parse the compiler output and extract the necessary
64128c4a8e55Smrg  # objects, libraries and library flags.
6413b042e37fSmrg
64148c4a8e55Smrg  # Sentinel used to keep track of whether or not we are before
64158c4a8e55Smrg  # the conftest object file.
64168c4a8e55Smrg  pre_test_object_deps_done=no
6417b042e37fSmrg
64188c4a8e55Smrg  for p in `eval "$output_verbose_link_cmd"`; do
64198c4a8e55Smrg    case $p in
6420b042e37fSmrg
64218c4a8e55Smrg    -L* | -R* | -l*)
64228c4a8e55Smrg       # Some compilers place space between "-{L,R}" and the path.
64238c4a8e55Smrg       # Remove the space.
64248c4a8e55Smrg       if test $p = "-L" ||
64258c4a8e55Smrg          test $p = "-R"; then
64268c4a8e55Smrg	 prev=$p
64278c4a8e55Smrg	 continue
64288c4a8e55Smrg       else
64298c4a8e55Smrg	 prev=
64308c4a8e55Smrg       fi
6431b042e37fSmrg
64328c4a8e55Smrg       if test "$pre_test_object_deps_done" = no; then
64338c4a8e55Smrg	 case $p in
64348c4a8e55Smrg	 -L* | -R*)
64358c4a8e55Smrg	   # Internal compiler library paths should come after those
64368c4a8e55Smrg	   # provided the user.  The postdeps already come after the
64378c4a8e55Smrg	   # user supplied libs so there is no need to process them.
64388c4a8e55Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
64398c4a8e55Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
64408c4a8e55Smrg	   else
64418c4a8e55Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
64428c4a8e55Smrg	   fi
64438c4a8e55Smrg	   ;;
64448c4a8e55Smrg	 # The "-l" case would never come before the object being
64458c4a8e55Smrg	 # linked, so don't bother handling this case.
64468c4a8e55Smrg	 esac
64478c4a8e55Smrg       else
64488c4a8e55Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
64498c4a8e55Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
64508c4a8e55Smrg	 else
64518c4a8e55Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
64528c4a8e55Smrg	 fi
64538c4a8e55Smrg       fi
64548c4a8e55Smrg       ;;
6455b042e37fSmrg
64568c4a8e55Smrg    *.$objext)
64578c4a8e55Smrg       # This assumes that the test object file only shows up
64588c4a8e55Smrg       # once in the compiler output.
64598c4a8e55Smrg       if test "$p" = "conftest.$objext"; then
64608c4a8e55Smrg	 pre_test_object_deps_done=yes
64618c4a8e55Smrg	 continue
64628c4a8e55Smrg       fi
6463b042e37fSmrg
64648c4a8e55Smrg       if test "$pre_test_object_deps_done" = no; then
64658c4a8e55Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
64668c4a8e55Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
64678c4a8e55Smrg	 else
64688c4a8e55Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
64698c4a8e55Smrg	 fi
64708c4a8e55Smrg       else
64718c4a8e55Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
64728c4a8e55Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
64738c4a8e55Smrg	 else
64748c4a8e55Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
64758c4a8e55Smrg	 fi
64768c4a8e55Smrg       fi
64778c4a8e55Smrg       ;;
6478b042e37fSmrg
64798c4a8e55Smrg    *) ;; # Ignore the rest.
6480b042e37fSmrg
64818c4a8e55Smrg    esac
64828c4a8e55Smrg  done
6483b042e37fSmrg
64848c4a8e55Smrg  # Clean up.
64858c4a8e55Smrg  rm -f a.out a.exe
64868c4a8e55Smrgelse
64878c4a8e55Smrg  echo "libtool.m4: error: problem compiling $1 test program"
64888c4a8e55Smrgfi
6489b042e37fSmrg
64908c4a8e55Smrg$RM -f confest.$objext
6491b042e37fSmrg
64928c4a8e55Smrg# PORTME: override above test on systems where it is broken
64938c4a8e55Smrgm4_if([$1], [CXX],
64948c4a8e55Smrg[case $host_os in
64958c4a8e55Smrginterix[[3-9]]*)
64968c4a8e55Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
64978c4a8e55Smrg  # hack all around it, let's just trust "g++" to DTRT.
64988c4a8e55Smrg  _LT_TAGVAR(predep_objects,$1)=
64998c4a8e55Smrg  _LT_TAGVAR(postdep_objects,$1)=
65008c4a8e55Smrg  _LT_TAGVAR(postdeps,$1)=
6501b042e37fSmrg  ;;
65028c4a8e55Smrg
6503b042e37fSmrglinux*)
65048c4a8e55Smrg  case `$CC -V 2>&1 | sed 5q` in
65058c4a8e55Smrg  *Sun\ C*)
65068c4a8e55Smrg    # Sun C++ 5.9
65078c4a8e55Smrg
65088c4a8e55Smrg    # The more standards-conforming stlport4 library is
65098c4a8e55Smrg    # incompatible with the Cstd library. Avoid specifying
65108c4a8e55Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
65118c4a8e55Smrg    # -library=stlport4 depends on it.
65128c4a8e55Smrg    case " $CXX $CXXFLAGS " in
65138c4a8e55Smrg    *" -library=stlport4 "*)
65148c4a8e55Smrg      solaris_use_stlport4=yes
65158c4a8e55Smrg      ;;
65168c4a8e55Smrg    esac
65178c4a8e55Smrg
65188c4a8e55Smrg    if test "$solaris_use_stlport4" != yes; then
65198c4a8e55Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
65208c4a8e55Smrg    fi
65218c4a8e55Smrg    ;;
65228c4a8e55Smrg  esac
6523b042e37fSmrg  ;;
65248c4a8e55Smrg
6525b042e37fSmrgsolaris*)
65268c4a8e55Smrg  case $cc_basename in
65278c4a8e55Smrg  CC*)
65288c4a8e55Smrg    # The more standards-conforming stlport4 library is
65298c4a8e55Smrg    # incompatible with the Cstd library. Avoid specifying
65308c4a8e55Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
65318c4a8e55Smrg    # -library=stlport4 depends on it.
65328c4a8e55Smrg    case " $CXX $CXXFLAGS " in
65338c4a8e55Smrg    *" -library=stlport4 "*)
65348c4a8e55Smrg      solaris_use_stlport4=yes
65358c4a8e55Smrg      ;;
65368c4a8e55Smrg    esac
65378c4a8e55Smrg
65388c4a8e55Smrg    # Adding this requires a known-good setup of shared libraries for
65398c4a8e55Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
65408c4a8e55Smrg    # archive will be linked into the output, leading to subtle bugs.
65418c4a8e55Smrg    if test "$solaris_use_stlport4" != yes; then
65428c4a8e55Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
65438c4a8e55Smrg    fi
65448c4a8e55Smrg    ;;
65458c4a8e55Smrg  esac
6546b042e37fSmrg  ;;
6547b042e37fSmrgesac
65488c4a8e55Smrg])
6549b042e37fSmrg
65508c4a8e55Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
65518c4a8e55Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
6552b042e37fSmrgesac
65538c4a8e55Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
65548c4a8e55Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
65558c4a8e55Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
65568c4a8e55Smrgfi
65578c4a8e55Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
65588c4a8e55Smrg    [The directories searched by this compiler when creating a shared library])
65598c4a8e55Smrg_LT_TAGDECL([], [predep_objects], [1],
65608c4a8e55Smrg    [Dependencies to place before and after the objects being linked to
65618c4a8e55Smrg    create a shared library])
65628c4a8e55Smrg_LT_TAGDECL([], [postdep_objects], [1])
65638c4a8e55Smrg_LT_TAGDECL([], [predeps], [1])
65648c4a8e55Smrg_LT_TAGDECL([], [postdeps], [1])
65658c4a8e55Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
65668c4a8e55Smrg    [The library search path used internally by the compiler when linking
65678c4a8e55Smrg    a shared library])
65688c4a8e55Smrg])# _LT_SYS_HIDDEN_LIBDEPS
65698c4a8e55Smrg
65708c4a8e55Smrg
65718c4a8e55Smrg# _LT_PROG_F77
65728c4a8e55Smrg# ------------
65738c4a8e55Smrg# Since AC_PROG_F77 is broken, in that it returns the empty string
65748c4a8e55Smrg# if there is no fortran compiler, we have our own version here.
65758c4a8e55Smrgm4_defun([_LT_PROG_F77],
65768c4a8e55Smrg[
65778c4a8e55Smrgpushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
65788c4a8e55SmrgAC_PROG_F77
65798c4a8e55Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
65808c4a8e55Smrg  _lt_disable_F77=yes
65818c4a8e55Smrgfi
65828c4a8e55Smrgpopdef([AC_MSG_ERROR])
65838c4a8e55Smrg])# _LT_PROG_F77
6584b042e37fSmrg
65858c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
65868c4a8e55Smrgdnl AC_DEFUN([_LT_PROG_F77], [])
6587b042e37fSmrg
6588b042e37fSmrg
65898c4a8e55Smrg# _LT_LANG_F77_CONFIG([TAG])
65908c4a8e55Smrg# --------------------------
65918c4a8e55Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
65928c4a8e55Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
65938c4a8e55Smrg# to write the compiler configuration to `libtool'.
65948c4a8e55Smrgm4_defun([_LT_LANG_F77_CONFIG],
65958c4a8e55Smrg[AC_REQUIRE([_LT_PROG_F77])dnl
65968c4a8e55SmrgAC_LANG_PUSH(Fortran 77)
6597b042e37fSmrg
65988c4a8e55Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
65998c4a8e55Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
66008c4a8e55Smrg_LT_TAGVAR(always_export_symbols, $1)=no
66018c4a8e55Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
66028c4a8e55Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
66038c4a8e55Smrg_LT_TAGVAR(hardcode_direct, $1)=no
66048c4a8e55Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
66058c4a8e55Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
66068c4a8e55Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
66078c4a8e55Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
66088c4a8e55Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
66098c4a8e55Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
66108c4a8e55Smrg_LT_TAGVAR(inherit_rpath, $1)=no
66118c4a8e55Smrg_LT_TAGVAR(module_cmds, $1)=
66128c4a8e55Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
66138c4a8e55Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
66148c4a8e55Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
66158c4a8e55Smrg_LT_TAGVAR(no_undefined_flag, $1)=
66168c4a8e55Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
66178c4a8e55Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6618b042e37fSmrg
66198c4a8e55Smrg# Source file extension for f77 test sources.
66208c4a8e55Smrgac_ext=f
6621b042e37fSmrg
66228c4a8e55Smrg# Object file extension for compiled f77 test sources.
66238c4a8e55Smrgobjext=o
66248c4a8e55Smrg_LT_TAGVAR(objext, $1)=$objext
66258c4a8e55Smrg
66268c4a8e55Smrg# No sense in running all these tests if we already determined that
66278c4a8e55Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
66288c4a8e55Smrg# are currently assumed to apply to all compilers on this platform,
66298c4a8e55Smrg# and will be corrupted by setting them based on a non-working compiler.
66308c4a8e55Smrgif test "$_lt_disable_F77" != yes; then
66318c4a8e55Smrg  # Code to be used in simple compile tests
66328c4a8e55Smrg  lt_simple_compile_test_code="\
66338c4a8e55Smrg      subroutine t
66348c4a8e55Smrg      return
66358c4a8e55Smrg      end
66368c4a8e55Smrg"
6637b042e37fSmrg
66388c4a8e55Smrg  # Code to be used in simple link tests
66398c4a8e55Smrg  lt_simple_link_test_code="\
66408c4a8e55Smrg      program t
66418c4a8e55Smrg      end
66428c4a8e55Smrg"
6643b042e37fSmrg
66448c4a8e55Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
66458c4a8e55Smrg  _LT_TAG_COMPILER
6646b042e37fSmrg
66478c4a8e55Smrg  # save warnings/boilerplate of simple test code
66488c4a8e55Smrg  _LT_COMPILER_BOILERPLATE
66498c4a8e55Smrg  _LT_LINKER_BOILERPLATE
6650b042e37fSmrg
66518c4a8e55Smrg  # Allow CC to be a program name with arguments.
66528c4a8e55Smrg  lt_save_CC="$CC"
66538c4a8e55Smrg  lt_save_GCC=$GCC
66548c4a8e55Smrg  CC=${F77-"f77"}
66558c4a8e55Smrg  compiler=$CC
66568c4a8e55Smrg  _LT_TAGVAR(compiler, $1)=$CC
66578c4a8e55Smrg  _LT_CC_BASENAME([$compiler])
66588c4a8e55Smrg  GCC=$G77
66598c4a8e55Smrg  if test -n "$compiler"; then
66608c4a8e55Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
66618c4a8e55Smrg    AC_MSG_RESULT([$can_build_shared])
6662b042e37fSmrg
66638c4a8e55Smrg    AC_MSG_CHECKING([whether to build shared libraries])
66648c4a8e55Smrg    test "$can_build_shared" = "no" && enable_shared=no
6665b042e37fSmrg
66668c4a8e55Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
66678c4a8e55Smrg    # are all built from PIC.
66688c4a8e55Smrg    case $host_os in
66698c4a8e55Smrg      aix3*)
66708c4a8e55Smrg        test "$enable_shared" = yes && enable_static=no
66718c4a8e55Smrg        if test -n "$RANLIB"; then
66728c4a8e55Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
66738c4a8e55Smrg          postinstall_cmds='$RANLIB $lib'
66748c4a8e55Smrg        fi
66758c4a8e55Smrg        ;;
66768c4a8e55Smrg      aix[[4-9]]*)
66778c4a8e55Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
66788c4a8e55Smrg	  test "$enable_shared" = yes && enable_static=no
6679b042e37fSmrg	fi
66808c4a8e55Smrg        ;;
66818c4a8e55Smrg    esac
66828c4a8e55Smrg    AC_MSG_RESULT([$enable_shared])
66838c4a8e55Smrg
66848c4a8e55Smrg    AC_MSG_CHECKING([whether to build static libraries])
66858c4a8e55Smrg    # Make sure either enable_shared or enable_static is yes.
66868c4a8e55Smrg    test "$enable_shared" = yes || enable_static=yes
66878c4a8e55Smrg    AC_MSG_RESULT([$enable_static])
66888c4a8e55Smrg
66898c4a8e55Smrg    _LT_TAGVAR(GCC, $1)="$G77"
66908c4a8e55Smrg    _LT_TAGVAR(LD, $1)="$LD"
66918c4a8e55Smrg
66928c4a8e55Smrg    ## CAVEAT EMPTOR:
66938c4a8e55Smrg    ## There is no encapsulation within the following macros, do not change
66948c4a8e55Smrg    ## the running order or otherwise move them around unless you know exactly
66958c4a8e55Smrg    ## what you are doing...
66968c4a8e55Smrg    _LT_COMPILER_PIC($1)
66978c4a8e55Smrg    _LT_COMPILER_C_O($1)
66988c4a8e55Smrg    _LT_COMPILER_FILE_LOCKS($1)
66998c4a8e55Smrg    _LT_LINKER_SHLIBS($1)
67008c4a8e55Smrg    _LT_SYS_DYNAMIC_LINKER($1)
67018c4a8e55Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
67028c4a8e55Smrg
67038c4a8e55Smrg    _LT_CONFIG($1)
67048c4a8e55Smrg  fi # test -n "$compiler"
67058c4a8e55Smrg
67068c4a8e55Smrg  GCC=$lt_save_GCC
67078c4a8e55Smrg  CC="$lt_save_CC"
67088c4a8e55Smrgfi # test "$_lt_disable_F77" != yes
6709b042e37fSmrg
67108c4a8e55SmrgAC_LANG_POP
67118c4a8e55Smrg])# _LT_LANG_F77_CONFIG
67128c4a8e55Smrg
67138c4a8e55Smrg
67148c4a8e55Smrg# _LT_PROG_FC
67158c4a8e55Smrg# -----------
67168c4a8e55Smrg# Since AC_PROG_FC is broken, in that it returns the empty string
67178c4a8e55Smrg# if there is no fortran compiler, we have our own version here.
67188c4a8e55Smrgm4_defun([_LT_PROG_FC],
67198c4a8e55Smrg[
67208c4a8e55Smrgpushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
67218c4a8e55SmrgAC_PROG_FC
67228c4a8e55Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
67238c4a8e55Smrg  _lt_disable_FC=yes
6724b042e37fSmrgfi
67258c4a8e55Smrgpopdef([AC_MSG_ERROR])
67268c4a8e55Smrg])# _LT_PROG_FC
6727b042e37fSmrg
67288c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
67298c4a8e55Smrgdnl AC_DEFUN([_LT_PROG_FC], [])
6730b042e37fSmrg
6731b042e37fSmrg
67328c4a8e55Smrg# _LT_LANG_FC_CONFIG([TAG])
67338c4a8e55Smrg# -------------------------
67348c4a8e55Smrg# Ensure that the configuration variables for a Fortran compiler are
67358c4a8e55Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
67368c4a8e55Smrg# to write the compiler configuration to `libtool'.
67378c4a8e55Smrgm4_defun([_LT_LANG_FC_CONFIG],
67388c4a8e55Smrg[AC_REQUIRE([_LT_PROG_FC])dnl
67398c4a8e55SmrgAC_LANG_PUSH(Fortran)
67408c4a8e55Smrg
67418c4a8e55Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
67428c4a8e55Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
67438c4a8e55Smrg_LT_TAGVAR(always_export_symbols, $1)=no
67448c4a8e55Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
67458c4a8e55Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
67468c4a8e55Smrg_LT_TAGVAR(hardcode_direct, $1)=no
67478c4a8e55Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
67488c4a8e55Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
67498c4a8e55Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
67508c4a8e55Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
67518c4a8e55Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
67528c4a8e55Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
67538c4a8e55Smrg_LT_TAGVAR(inherit_rpath, $1)=no
67548c4a8e55Smrg_LT_TAGVAR(module_cmds, $1)=
67558c4a8e55Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
67568c4a8e55Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
67578c4a8e55Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
67588c4a8e55Smrg_LT_TAGVAR(no_undefined_flag, $1)=
67598c4a8e55Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
67608c4a8e55Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
67618c4a8e55Smrg
67628c4a8e55Smrg# Source file extension for fc test sources.
67638c4a8e55Smrgac_ext=${ac_fc_srcext-f}
67648c4a8e55Smrg
67658c4a8e55Smrg# Object file extension for compiled fc test sources.
67668c4a8e55Smrgobjext=o
67678c4a8e55Smrg_LT_TAGVAR(objext, $1)=$objext
67688c4a8e55Smrg
67698c4a8e55Smrg# No sense in running all these tests if we already determined that
67708c4a8e55Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
67718c4a8e55Smrg# are currently assumed to apply to all compilers on this platform,
67728c4a8e55Smrg# and will be corrupted by setting them based on a non-working compiler.
67738c4a8e55Smrgif test "$_lt_disable_FC" != yes; then
67748c4a8e55Smrg  # Code to be used in simple compile tests
67758c4a8e55Smrg  lt_simple_compile_test_code="\
67768c4a8e55Smrg      subroutine t
67778c4a8e55Smrg      return
67788c4a8e55Smrg      end
67798c4a8e55Smrg"
6780b042e37fSmrg
67818c4a8e55Smrg  # Code to be used in simple link tests
67828c4a8e55Smrg  lt_simple_link_test_code="\
67838c4a8e55Smrg      program t
67848c4a8e55Smrg      end
67858c4a8e55Smrg"
67868c4a8e55Smrg
67878c4a8e55Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
67888c4a8e55Smrg  _LT_TAG_COMPILER
67898c4a8e55Smrg
67908c4a8e55Smrg  # save warnings/boilerplate of simple test code
67918c4a8e55Smrg  _LT_COMPILER_BOILERPLATE
67928c4a8e55Smrg  _LT_LINKER_BOILERPLATE
67938c4a8e55Smrg
67948c4a8e55Smrg  # Allow CC to be a program name with arguments.
67958c4a8e55Smrg  lt_save_CC="$CC"
67968c4a8e55Smrg  lt_save_GCC=$GCC
67978c4a8e55Smrg  CC=${FC-"f95"}
67988c4a8e55Smrg  compiler=$CC
67998c4a8e55Smrg  GCC=$ac_cv_fc_compiler_gnu
68008c4a8e55Smrg
68018c4a8e55Smrg  _LT_TAGVAR(compiler, $1)=$CC
68028c4a8e55Smrg  _LT_CC_BASENAME([$compiler])
68038c4a8e55Smrg
68048c4a8e55Smrg  if test -n "$compiler"; then
68058c4a8e55Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
68068c4a8e55Smrg    AC_MSG_RESULT([$can_build_shared])
68078c4a8e55Smrg
68088c4a8e55Smrg    AC_MSG_CHECKING([whether to build shared libraries])
68098c4a8e55Smrg    test "$can_build_shared" = "no" && enable_shared=no
68108c4a8e55Smrg
68118c4a8e55Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
68128c4a8e55Smrg    # are all built from PIC.
6813b042e37fSmrg    case $host_os in
68148c4a8e55Smrg      aix3*)
68158c4a8e55Smrg        test "$enable_shared" = yes && enable_static=no
68168c4a8e55Smrg        if test -n "$RANLIB"; then
68178c4a8e55Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
68188c4a8e55Smrg          postinstall_cmds='$RANLIB $lib'
68198c4a8e55Smrg        fi
68208c4a8e55Smrg        ;;
68218c4a8e55Smrg      aix[[4-9]]*)
68228c4a8e55Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
68238c4a8e55Smrg	  test "$enable_shared" = yes && enable_static=no
6824b042e37fSmrg	fi
68258c4a8e55Smrg        ;;
6826b042e37fSmrg    esac
68278c4a8e55Smrg    AC_MSG_RESULT([$enable_shared])
68288c4a8e55Smrg
68298c4a8e55Smrg    AC_MSG_CHECKING([whether to build static libraries])
68308c4a8e55Smrg    # Make sure either enable_shared or enable_static is yes.
68318c4a8e55Smrg    test "$enable_shared" = yes || enable_static=yes
68328c4a8e55Smrg    AC_MSG_RESULT([$enable_static])
68338c4a8e55Smrg
68348c4a8e55Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
68358c4a8e55Smrg    _LT_TAGVAR(LD, $1)="$LD"
68368c4a8e55Smrg
68378c4a8e55Smrg    ## CAVEAT EMPTOR:
68388c4a8e55Smrg    ## There is no encapsulation within the following macros, do not change
68398c4a8e55Smrg    ## the running order or otherwise move them around unless you know exactly
68408c4a8e55Smrg    ## what you are doing...
68418c4a8e55Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
68428c4a8e55Smrg    _LT_COMPILER_PIC($1)
68438c4a8e55Smrg    _LT_COMPILER_C_O($1)
68448c4a8e55Smrg    _LT_COMPILER_FILE_LOCKS($1)
68458c4a8e55Smrg    _LT_LINKER_SHLIBS($1)
68468c4a8e55Smrg    _LT_SYS_DYNAMIC_LINKER($1)
68478c4a8e55Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
68488c4a8e55Smrg
68498c4a8e55Smrg    _LT_CONFIG($1)
68508c4a8e55Smrg  fi # test -n "$compiler"
68518c4a8e55Smrg
68528c4a8e55Smrg  GCC=$lt_save_GCC
68538c4a8e55Smrg  CC="$lt_save_CC"
68548c4a8e55Smrgfi # test "$_lt_disable_FC" != yes
6855b042e37fSmrg
68568c4a8e55SmrgAC_LANG_POP
68578c4a8e55Smrg])# _LT_LANG_FC_CONFIG
6858b042e37fSmrg
6859b042e37fSmrg
68608c4a8e55Smrg# _LT_LANG_GCJ_CONFIG([TAG])
68618c4a8e55Smrg# --------------------------
68628c4a8e55Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
68638c4a8e55Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
68648c4a8e55Smrg# to write the compiler configuration to `libtool'.
68658c4a8e55Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
68668c4a8e55Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
68678c4a8e55SmrgAC_LANG_SAVE
6868b042e37fSmrg
68698c4a8e55Smrg# Source file extension for Java test sources.
68708c4a8e55Smrgac_ext=java
6871b042e37fSmrg
68728c4a8e55Smrg# Object file extension for compiled Java test sources.
68738c4a8e55Smrgobjext=o
68748c4a8e55Smrg_LT_TAGVAR(objext, $1)=$objext
6875b042e37fSmrg
68768c4a8e55Smrg# Code to be used in simple compile tests
68778c4a8e55Smrglt_simple_compile_test_code="class foo {}"
6878b042e37fSmrg
68798c4a8e55Smrg# Code to be used in simple link tests
68808c4a8e55Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
6881b042e37fSmrg
68828c4a8e55Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
68838c4a8e55Smrg_LT_TAG_COMPILER
6884b042e37fSmrg
68858c4a8e55Smrg# save warnings/boilerplate of simple test code
68868c4a8e55Smrg_LT_COMPILER_BOILERPLATE
68878c4a8e55Smrg_LT_LINKER_BOILERPLATE
6888b042e37fSmrg
68898c4a8e55Smrg# Allow CC to be a program name with arguments.
68908c4a8e55Smrglt_save_CC="$CC"
68918c4a8e55Smrglt_save_GCC=$GCC
68928c4a8e55SmrgGCC=yes
68938c4a8e55SmrgCC=${GCJ-"gcj"}
68948c4a8e55Smrgcompiler=$CC
68958c4a8e55Smrg_LT_TAGVAR(compiler, $1)=$CC
68968c4a8e55Smrg_LT_TAGVAR(LD, $1)="$LD"
68978c4a8e55Smrg_LT_CC_BASENAME([$compiler])
6898b042e37fSmrg
68998c4a8e55Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
69008c4a8e55Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6901b042e37fSmrg
69028c4a8e55Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6903b042e37fSmrg
69048c4a8e55Smrgif test -n "$compiler"; then
69058c4a8e55Smrg  _LT_COMPILER_NO_RTTI($1)
69068c4a8e55Smrg  _LT_COMPILER_PIC($1)
69078c4a8e55Smrg  _LT_COMPILER_C_O($1)
69088c4a8e55Smrg  _LT_COMPILER_FILE_LOCKS($1)
69098c4a8e55Smrg  _LT_LINKER_SHLIBS($1)
69108c4a8e55Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
6911b042e37fSmrg
69128c4a8e55Smrg  _LT_CONFIG($1)
69138c4a8e55Smrgfi
6914b042e37fSmrg
69158c4a8e55SmrgAC_LANG_RESTORE
6916b042e37fSmrg
69178c4a8e55SmrgGCC=$lt_save_GCC
69188c4a8e55SmrgCC="$lt_save_CC"
69198c4a8e55Smrg])# _LT_LANG_GCJ_CONFIG
6920b042e37fSmrg
6921b042e37fSmrg
69228c4a8e55Smrg# _LT_LANG_RC_CONFIG([TAG])
69238c4a8e55Smrg# -------------------------
69248c4a8e55Smrg# Ensure that the configuration variables for the Windows resource compiler
69258c4a8e55Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
69268c4a8e55Smrg# to write the compiler configuration to `libtool'.
69278c4a8e55Smrgm4_defun([_LT_LANG_RC_CONFIG],
69288c4a8e55Smrg[AC_REQUIRE([LT_PROG_RC])dnl
69298c4a8e55SmrgAC_LANG_SAVE
6930b042e37fSmrg
69318c4a8e55Smrg# Source file extension for RC test sources.
69328c4a8e55Smrgac_ext=rc
6933b042e37fSmrg
69348c4a8e55Smrg# Object file extension for compiled RC test sources.
69358c4a8e55Smrgobjext=o
69368c4a8e55Smrg_LT_TAGVAR(objext, $1)=$objext
6937b042e37fSmrg
69388c4a8e55Smrg# Code to be used in simple compile tests
69398c4a8e55Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
6940b042e37fSmrg
69418c4a8e55Smrg# Code to be used in simple link tests
69428c4a8e55Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
6943b042e37fSmrg
69448c4a8e55Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
69458c4a8e55Smrg_LT_TAG_COMPILER
6946b042e37fSmrg
69478c4a8e55Smrg# save warnings/boilerplate of simple test code
69488c4a8e55Smrg_LT_COMPILER_BOILERPLATE
69498c4a8e55Smrg_LT_LINKER_BOILERPLATE
6950b042e37fSmrg
69518c4a8e55Smrg# Allow CC to be a program name with arguments.
69528c4a8e55Smrglt_save_CC="$CC"
69538c4a8e55Smrglt_save_GCC=$GCC
69548c4a8e55SmrgGCC=
69558c4a8e55SmrgCC=${RC-"windres"}
69568c4a8e55Smrgcompiler=$CC
69578c4a8e55Smrg_LT_TAGVAR(compiler, $1)=$CC
69588c4a8e55Smrg_LT_CC_BASENAME([$compiler])
69598c4a8e55Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
69608c4a8e55Smrg
69618c4a8e55Smrgif test -n "$compiler"; then
69628c4a8e55Smrg  :
69638c4a8e55Smrg  _LT_CONFIG($1)
6964b042e37fSmrgfi
6965b042e37fSmrg
69668c4a8e55SmrgGCC=$lt_save_GCC
69678c4a8e55SmrgAC_LANG_RESTORE
69688c4a8e55SmrgCC="$lt_save_CC"
69698c4a8e55Smrg])# _LT_LANG_RC_CONFIG
69708c4a8e55Smrg
69718c4a8e55Smrg
69728c4a8e55Smrg# LT_PROG_GCJ
69738c4a8e55Smrg# -----------
69748c4a8e55SmrgAC_DEFUN([LT_PROG_GCJ],
69758c4a8e55Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
69768c4a8e55Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
69778c4a8e55Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
69788c4a8e55Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
69798c4a8e55Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
6980b042e37fSmrg])
6981b042e37fSmrg
69828c4a8e55Smrg# Old name:
69838c4a8e55SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
69848c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
69858c4a8e55Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
6986b042e37fSmrg
6987b042e37fSmrg
69888c4a8e55Smrg# LT_PROG_RC
69898c4a8e55Smrg# ----------
69908c4a8e55SmrgAC_DEFUN([LT_PROG_RC],
69918c4a8e55Smrg[AC_CHECK_TOOL(RC, windres,)
69928c4a8e55Smrg])
6993b042e37fSmrg
69948c4a8e55Smrg# Old name:
69958c4a8e55SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
69968c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
69978c4a8e55Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
6998b042e37fSmrg
6999b042e37fSmrg
70008c4a8e55Smrg# _LT_DECL_EGREP
70018c4a8e55Smrg# --------------
70028c4a8e55Smrg# If we don't have a new enough Autoconf to choose the best grep
70038c4a8e55Smrg# available, choose the one first in the user's PATH.
70048c4a8e55Smrgm4_defun([_LT_DECL_EGREP],
70058c4a8e55Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
70068c4a8e55SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
70078c4a8e55Smrgtest -z "$GREP" && GREP=grep
70088c4a8e55Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
70098c4a8e55Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
70108c4a8e55Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
70118c4a8e55Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
70128c4a8e55SmrgAC_SUBST([GREP])
70138c4a8e55Smrg])
7014b042e37fSmrg
7015b042e37fSmrg
70168c4a8e55Smrg# _LT_DECL_OBJDUMP
70178c4a8e55Smrg# --------------
70188c4a8e55Smrg# If we don't have a new enough Autoconf to choose the best objdump
70198c4a8e55Smrg# available, choose the one first in the user's PATH.
70208c4a8e55Smrgm4_defun([_LT_DECL_OBJDUMP],
70218c4a8e55Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
70228c4a8e55Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
70238c4a8e55Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
70248c4a8e55SmrgAC_SUBST([OBJDUMP])
70258c4a8e55Smrg])
7026b042e37fSmrg
7027b042e37fSmrg
70288c4a8e55Smrg# _LT_DECL_SED
70298c4a8e55Smrg# ------------
70308c4a8e55Smrg# Check for a fully-functional sed program, that truncates
70318c4a8e55Smrg# as few characters as possible.  Prefer GNU sed if found.
70328c4a8e55Smrgm4_defun([_LT_DECL_SED],
70338c4a8e55Smrg[AC_PROG_SED
70348c4a8e55Smrgtest -z "$SED" && SED=sed
70358c4a8e55SmrgXsed="$SED -e 1s/^X//"
70368c4a8e55Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
70378c4a8e55Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
70388c4a8e55Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
70398c4a8e55Smrg])# _LT_DECL_SED
70408c4a8e55Smrg
70418c4a8e55Smrgm4_ifndef([AC_PROG_SED], [
70428c4a8e55Smrg# NOTE: This macro has been submitted for inclusion into   #
70438c4a8e55Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
70448c4a8e55Smrg#  a released version of Autoconf we should remove this    #
70458c4a8e55Smrg#  macro and use it instead.                               #
70468c4a8e55Smrg
70478c4a8e55Smrgm4_defun([AC_PROG_SED],
70488c4a8e55Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
70498c4a8e55SmrgAC_CACHE_VAL(lt_cv_path_SED,
70508c4a8e55Smrg[# Loop through the user's path and test for sed and gsed.
70518c4a8e55Smrg# Then use that list of sed's as ones to test for truncation.
70528c4a8e55Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
70538c4a8e55Smrgfor as_dir in $PATH
70548c4a8e55Smrgdo
70558c4a8e55Smrg  IFS=$as_save_IFS
70568c4a8e55Smrg  test -z "$as_dir" && as_dir=.
70578c4a8e55Smrg  for lt_ac_prog in sed gsed; do
70588c4a8e55Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
70598c4a8e55Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
70608c4a8e55Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7061b042e37fSmrg      fi
70628c4a8e55Smrg    done
70638c4a8e55Smrg  done
70648c4a8e55Smrgdone
70658c4a8e55SmrgIFS=$as_save_IFS
70668c4a8e55Smrglt_ac_max=0
70678c4a8e55Smrglt_ac_count=0
70688c4a8e55Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
70698c4a8e55Smrg# along with /bin/sed that truncates output.
70708c4a8e55Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
70718c4a8e55Smrg  test ! -f $lt_ac_sed && continue
70728c4a8e55Smrg  cat /dev/null > conftest.in
70738c4a8e55Smrg  lt_ac_count=0
70748c4a8e55Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
70758c4a8e55Smrg  # Check for GNU sed and select it if it is found.
70768c4a8e55Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
70778c4a8e55Smrg    lt_cv_path_SED=$lt_ac_sed
70788c4a8e55Smrg    break
70798c4a8e55Smrg  fi
70808c4a8e55Smrg  while true; do
70818c4a8e55Smrg    cat conftest.in conftest.in >conftest.tmp
70828c4a8e55Smrg    mv conftest.tmp conftest.in
70838c4a8e55Smrg    cp conftest.in conftest.nl
70848c4a8e55Smrg    echo >>conftest.nl
70858c4a8e55Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
70868c4a8e55Smrg    cmp -s conftest.out conftest.nl || break
70878c4a8e55Smrg    # 10000 chars as input seems more than enough
70888c4a8e55Smrg    test $lt_ac_count -gt 10 && break
70898c4a8e55Smrg    lt_ac_count=`expr $lt_ac_count + 1`
70908c4a8e55Smrg    if test $lt_ac_count -gt $lt_ac_max; then
70918c4a8e55Smrg      lt_ac_max=$lt_ac_count
70928c4a8e55Smrg      lt_cv_path_SED=$lt_ac_sed
70938c4a8e55Smrg    fi
70948c4a8e55Smrg  done
70958c4a8e55Smrgdone
70968c4a8e55Smrg])
70978c4a8e55SmrgSED=$lt_cv_path_SED
70988c4a8e55SmrgAC_SUBST([SED])
70998c4a8e55SmrgAC_MSG_RESULT([$SED])
71008c4a8e55Smrg])#AC_PROG_SED
71018c4a8e55Smrg])#m4_ifndef
7102b042e37fSmrg
71038c4a8e55Smrg# Old name:
71048c4a8e55SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
71058c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
71068c4a8e55Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
7107b042e37fSmrg
7108b042e37fSmrg
71098c4a8e55Smrg# _LT_CHECK_SHELL_FEATURES
71108c4a8e55Smrg# ------------------------
71118c4a8e55Smrg# Find out whether the shell is Bourne or XSI compatible,
71128c4a8e55Smrg# or has some other useful features.
71138c4a8e55Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
71148c4a8e55Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
71158c4a8e55Smrg# Try some XSI features
71168c4a8e55Smrgxsi_shell=no
71178c4a8e55Smrg( _lt_dummy="a/b/c"
71188c4a8e55Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
71198c4a8e55Smrg      = c,a/b,, \
71208c4a8e55Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
71218c4a8e55Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
71228c4a8e55Smrg  && xsi_shell=yes
71238c4a8e55SmrgAC_MSG_RESULT([$xsi_shell])
71248c4a8e55Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
71258c4a8e55Smrg
71268c4a8e55SmrgAC_MSG_CHECKING([whether the shell understands "+="])
71278c4a8e55Smrglt_shell_append=no
71288c4a8e55Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
71298c4a8e55Smrg    >/dev/null 2>&1 \
71308c4a8e55Smrg  && lt_shell_append=yes
71318c4a8e55SmrgAC_MSG_RESULT([$lt_shell_append])
71328c4a8e55Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
71338c4a8e55Smrg
71348c4a8e55Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
71358c4a8e55Smrg  lt_unset=unset
71368c4a8e55Smrgelse
71378c4a8e55Smrg  lt_unset=false
71388c4a8e55Smrgfi
71398c4a8e55Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
71408c4a8e55Smrg
71418c4a8e55Smrg# test EBCDIC or ASCII
71428c4a8e55Smrgcase `echo X|tr X '\101'` in
71438c4a8e55Smrg A) # ASCII based system
71448c4a8e55Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
71458c4a8e55Smrg  lt_SP2NL='tr \040 \012'
71468c4a8e55Smrg  lt_NL2SP='tr \015\012 \040\040'
71478c4a8e55Smrg  ;;
71488c4a8e55Smrg *) # EBCDIC based system
71498c4a8e55Smrg  lt_SP2NL='tr \100 \n'
71508c4a8e55Smrg  lt_NL2SP='tr \r\n \100\100'
71518c4a8e55Smrg  ;;
71528c4a8e55Smrgesac
71538c4a8e55Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
71548c4a8e55Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
71558c4a8e55Smrg])# _LT_CHECK_SHELL_FEATURES
7156b042e37fSmrg
7157b042e37fSmrg
71588c4a8e55Smrg# _LT_PROG_XSI_SHELLFNS
71598c4a8e55Smrg# ---------------------
71608c4a8e55Smrg# Bourne and XSI compatible variants of some useful shell functions.
71618c4a8e55Smrgm4_defun([_LT_PROG_XSI_SHELLFNS],
71628c4a8e55Smrg[case $xsi_shell in
71638c4a8e55Smrg  yes)
71648c4a8e55Smrg    cat << \_LT_EOF >> "$cfgfile"
71658c4a8e55Smrg
71668c4a8e55Smrg# func_dirname file append nondir_replacement
71678c4a8e55Smrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
71688c4a8e55Smrg# otherwise set result to NONDIR_REPLACEMENT.
71698c4a8e55Smrgfunc_dirname ()
71708c4a8e55Smrg{
71718c4a8e55Smrg  case ${1} in
71728c4a8e55Smrg    */*) func_dirname_result="${1%/*}${2}" ;;
71738c4a8e55Smrg    *  ) func_dirname_result="${3}" ;;
71748c4a8e55Smrg  esac
71758c4a8e55Smrg}
7176b042e37fSmrg
71778c4a8e55Smrg# func_basename file
71788c4a8e55Smrgfunc_basename ()
71798c4a8e55Smrg{
71808c4a8e55Smrg  func_basename_result="${1##*/}"
71818c4a8e55Smrg}
7182b042e37fSmrg
71838c4a8e55Smrg# func_dirname_and_basename file append nondir_replacement
71848c4a8e55Smrg# perform func_basename and func_dirname in a single function
71858c4a8e55Smrg# call:
71868c4a8e55Smrg#   dirname:  Compute the dirname of FILE.  If nonempty,
71878c4a8e55Smrg#             add APPEND to the result, otherwise set result
71888c4a8e55Smrg#             to NONDIR_REPLACEMENT.
71898c4a8e55Smrg#             value returned in "$func_dirname_result"
71908c4a8e55Smrg#   basename: Compute filename of FILE.
71918c4a8e55Smrg#             value retuned in "$func_basename_result"
71928c4a8e55Smrg# Implementation must be kept synchronized with func_dirname
71938c4a8e55Smrg# and func_basename. For efficiency, we do not delegate to
71948c4a8e55Smrg# those functions but instead duplicate the functionality here.
71958c4a8e55Smrgfunc_dirname_and_basename ()
71968c4a8e55Smrg{
71978c4a8e55Smrg  case ${1} in
71988c4a8e55Smrg    */*) func_dirname_result="${1%/*}${2}" ;;
71998c4a8e55Smrg    *  ) func_dirname_result="${3}" ;;
72008c4a8e55Smrg  esac
72018c4a8e55Smrg  func_basename_result="${1##*/}"
72028c4a8e55Smrg}
7203b042e37fSmrg
72048c4a8e55Smrg# func_stripname prefix suffix name
72058c4a8e55Smrg# strip PREFIX and SUFFIX off of NAME.
72068c4a8e55Smrg# PREFIX and SUFFIX must not contain globbing or regex special
72078c4a8e55Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
72088c4a8e55Smrg# dot (in which case that matches only a dot).
72098c4a8e55Smrgfunc_stripname ()
72108c4a8e55Smrg{
72118c4a8e55Smrg  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
72128c4a8e55Smrg  # positional parameters, so assign one to ordinary parameter first.
72138c4a8e55Smrg  func_stripname_result=${3}
72148c4a8e55Smrg  func_stripname_result=${func_stripname_result#"${1}"}
72158c4a8e55Smrg  func_stripname_result=${func_stripname_result%"${2}"}
72168c4a8e55Smrg}
7217b042e37fSmrg
72188c4a8e55Smrg# func_opt_split
72198c4a8e55Smrgfunc_opt_split ()
72208c4a8e55Smrg{
72218c4a8e55Smrg  func_opt_split_opt=${1%%=*}
72228c4a8e55Smrg  func_opt_split_arg=${1#*=}
72238c4a8e55Smrg}
7224b042e37fSmrg
72258c4a8e55Smrg# func_lo2o object
72268c4a8e55Smrgfunc_lo2o ()
72278c4a8e55Smrg{
72288c4a8e55Smrg  case ${1} in
72298c4a8e55Smrg    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
72308c4a8e55Smrg    *)    func_lo2o_result=${1} ;;
72318c4a8e55Smrg  esac
72328c4a8e55Smrg}
7233b042e37fSmrg
72348c4a8e55Smrg# func_xform libobj-or-source
72358c4a8e55Smrgfunc_xform ()
72368c4a8e55Smrg{
72378c4a8e55Smrg  func_xform_result=${1%.*}.lo
72388c4a8e55Smrg}
7239b042e37fSmrg
72408c4a8e55Smrg# func_arith arithmetic-term...
72418c4a8e55Smrgfunc_arith ()
72428c4a8e55Smrg{
72438c4a8e55Smrg  func_arith_result=$(( $[*] ))
72448c4a8e55Smrg}
7245b042e37fSmrg
72468c4a8e55Smrg# func_len string
72478c4a8e55Smrg# STRING may not start with a hyphen.
72488c4a8e55Smrgfunc_len ()
72498c4a8e55Smrg{
72508c4a8e55Smrg  func_len_result=${#1}
72518c4a8e55Smrg}
72528c4a8e55Smrg
72538c4a8e55Smrg_LT_EOF
72548c4a8e55Smrg    ;;
72558c4a8e55Smrg  *) # Bourne compatible functions.
72568c4a8e55Smrg    cat << \_LT_EOF >> "$cfgfile"
72578c4a8e55Smrg
72588c4a8e55Smrg# func_dirname file append nondir_replacement
72598c4a8e55Smrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
72608c4a8e55Smrg# otherwise set result to NONDIR_REPLACEMENT.
72618c4a8e55Smrgfunc_dirname ()
72628c4a8e55Smrg{
72638c4a8e55Smrg  # Extract subdirectory from the argument.
72648c4a8e55Smrg  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
72658c4a8e55Smrg  if test "X$func_dirname_result" = "X${1}"; then
72668c4a8e55Smrg    func_dirname_result="${3}"
7267b042e37fSmrg  else
72688c4a8e55Smrg    func_dirname_result="$func_dirname_result${2}"
72698c4a8e55Smrg  fi
72708c4a8e55Smrg}
7271b042e37fSmrg
72728c4a8e55Smrg# func_basename file
72738c4a8e55Smrgfunc_basename ()
72748c4a8e55Smrg{
72758c4a8e55Smrg  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
72768c4a8e55Smrg}
7277b042e37fSmrg
72788c4a8e55Smrgdnl func_dirname_and_basename
72798c4a8e55Smrgdnl A portable version of this function is already defined in general.m4sh
72808c4a8e55Smrgdnl so there is no need for it here.
72818c4a8e55Smrg
72828c4a8e55Smrg# func_stripname prefix suffix name
72838c4a8e55Smrg# strip PREFIX and SUFFIX off of NAME.
72848c4a8e55Smrg# PREFIX and SUFFIX must not contain globbing or regex special
72858c4a8e55Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
72868c4a8e55Smrg# dot (in which case that matches only a dot).
72878c4a8e55Smrg# func_strip_suffix prefix name
72888c4a8e55Smrgfunc_stripname ()
72898c4a8e55Smrg{
72908c4a8e55Smrg  case ${2} in
72918c4a8e55Smrg    .*) func_stripname_result=`$ECHO "X${3}" \
72928c4a8e55Smrg           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
72938c4a8e55Smrg    *)  func_stripname_result=`$ECHO "X${3}" \
72948c4a8e55Smrg           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
72958c4a8e55Smrg  esac
72968c4a8e55Smrg}
7297b042e37fSmrg
72988c4a8e55Smrg# sed scripts:
72998c4a8e55Smrgmy_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
73008c4a8e55Smrgmy_sed_long_arg='1s/^-[[^=]]*=//'
7301b042e37fSmrg
73028c4a8e55Smrg# func_opt_split
73038c4a8e55Smrgfunc_opt_split ()
73048c4a8e55Smrg{
73058c4a8e55Smrg  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
73068c4a8e55Smrg  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
73078c4a8e55Smrg}
7308b042e37fSmrg
73098c4a8e55Smrg# func_lo2o object
73108c4a8e55Smrgfunc_lo2o ()
73118c4a8e55Smrg{
73128c4a8e55Smrg  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
73138c4a8e55Smrg}
7314b042e37fSmrg
73158c4a8e55Smrg# func_xform libobj-or-source
73168c4a8e55Smrgfunc_xform ()
73178c4a8e55Smrg{
73188c4a8e55Smrg  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
73198c4a8e55Smrg}
7320b042e37fSmrg
73218c4a8e55Smrg# func_arith arithmetic-term...
73228c4a8e55Smrgfunc_arith ()
73238c4a8e55Smrg{
73248c4a8e55Smrg  func_arith_result=`expr "$[@]"`
73258c4a8e55Smrg}
7326b042e37fSmrg
73278c4a8e55Smrg# func_len string
73288c4a8e55Smrg# STRING may not start with a hyphen.
73298c4a8e55Smrgfunc_len ()
73308c4a8e55Smrg{
73318c4a8e55Smrg  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
73328c4a8e55Smrg}
7333b042e37fSmrg
73348c4a8e55Smrg_LT_EOF
73358c4a8e55Smrgesac
7336b042e37fSmrg
73378c4a8e55Smrgcase $lt_shell_append in
73388c4a8e55Smrg  yes)
73398c4a8e55Smrg    cat << \_LT_EOF >> "$cfgfile"
7340b042e37fSmrg
73418c4a8e55Smrg# func_append var value
73428c4a8e55Smrg# Append VALUE to the end of shell variable VAR.
73438c4a8e55Smrgfunc_append ()
73448c4a8e55Smrg{
73458c4a8e55Smrg  eval "$[1]+=\$[2]"
73468c4a8e55Smrg}
73478c4a8e55Smrg_LT_EOF
73488c4a8e55Smrg    ;;
73498c4a8e55Smrg  *)
73508c4a8e55Smrg    cat << \_LT_EOF >> "$cfgfile"
7351b042e37fSmrg
73528c4a8e55Smrg# func_append var value
73538c4a8e55Smrg# Append VALUE to the end of shell variable VAR.
73548c4a8e55Smrgfunc_append ()
73558c4a8e55Smrg{
73568c4a8e55Smrg  eval "$[1]=\$$[1]\$[2]"
73578c4a8e55Smrg}
7358b042e37fSmrg
73598c4a8e55Smrg_LT_EOF
73608c4a8e55Smrg    ;;
73618c4a8e55Smrg  esac
73628c4a8e55Smrg])
7363b042e37fSmrg
73648c4a8e55Smrg# Helper functions for option handling.                    -*- Autoconf -*-
73658c4a8e55Smrg#
73668c4a8e55Smrg#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
73678c4a8e55Smrg#   Written by Gary V. Vaughan, 2004
73688c4a8e55Smrg#
73698c4a8e55Smrg# This file is free software; the Free Software Foundation gives
73708c4a8e55Smrg# unlimited permission to copy and/or distribute it, with or without
73718c4a8e55Smrg# modifications, as long as this notice is preserved.
7372b042e37fSmrg
73738c4a8e55Smrg# serial 6 ltoptions.m4
7374b042e37fSmrg
73758c4a8e55Smrg# This is to help aclocal find these macros, as it can't see m4_define.
73768c4a8e55SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
7377b042e37fSmrg
7378b042e37fSmrg
73798c4a8e55Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
73808c4a8e55Smrg# ------------------------------------------
73818c4a8e55Smrgm4_define([_LT_MANGLE_OPTION],
73828c4a8e55Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
7383b042e37fSmrg
7384b042e37fSmrg
73858c4a8e55Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
73868c4a8e55Smrg# ---------------------------------------
73878c4a8e55Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
73888c4a8e55Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
73898c4a8e55Smrg# saved as a flag.
73908c4a8e55Smrgm4_define([_LT_SET_OPTION],
73918c4a8e55Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
73928c4a8e55Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
73938c4a8e55Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
73948c4a8e55Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
73958c4a8e55Smrg])
7396b042e37fSmrg
7397b042e37fSmrg
73988c4a8e55Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
73998c4a8e55Smrg# ------------------------------------------------------------
74008c4a8e55Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
74018c4a8e55Smrgm4_define([_LT_IF_OPTION],
74028c4a8e55Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
74038c4a8e55Smrg
74048c4a8e55Smrg
74058c4a8e55Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
74068c4a8e55Smrg# -------------------------------------------------------
74078c4a8e55Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
74088c4a8e55Smrg# are set.
74098c4a8e55Smrgm4_define([_LT_UNLESS_OPTIONS],
74108c4a8e55Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
74118c4a8e55Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
74128c4a8e55Smrg		      [m4_define([$0_found])])])[]dnl
74138c4a8e55Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
74148c4a8e55Smrg])[]dnl
74158c4a8e55Smrg])
7416b042e37fSmrg
7417b042e37fSmrg
74188c4a8e55Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
74198c4a8e55Smrg# ----------------------------------------
74208c4a8e55Smrg# OPTION-LIST is a space-separated list of Libtool options associated
74218c4a8e55Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
74228c4a8e55Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
74238c4a8e55Smrg# the unknown option and exit.
74248c4a8e55Smrgm4_defun([_LT_SET_OPTIONS],
74258c4a8e55Smrg[# Set options
74268c4a8e55Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
74278c4a8e55Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
74288c4a8e55Smrg
74298c4a8e55Smrgm4_if([$1],[LT_INIT],[
74308c4a8e55Smrg  dnl
74318c4a8e55Smrg  dnl Simply set some default values (i.e off) if boolean options were not
74328c4a8e55Smrg  dnl specified:
74338c4a8e55Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
74348c4a8e55Smrg  ])
74358c4a8e55Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
74368c4a8e55Smrg  ])
74378c4a8e55Smrg  dnl
74388c4a8e55Smrg  dnl If no reference was made to various pairs of opposing options, then
74398c4a8e55Smrg  dnl we run the default mode handler for the pair.  For example, if neither
74408c4a8e55Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
74418c4a8e55Smrg  dnl archives by default:
74428c4a8e55Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
74438c4a8e55Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
74448c4a8e55Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
74458c4a8e55Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
74468c4a8e55Smrg  		   [_LT_ENABLE_FAST_INSTALL])
74478c4a8e55Smrg  ])
74488c4a8e55Smrg])# _LT_SET_OPTIONS
7449b042e37fSmrg
7450b042e37fSmrg
7451b042e37fSmrg
74528c4a8e55Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
74538c4a8e55Smrg# -----------------------------------------
74548c4a8e55Smrgm4_define([_LT_MANGLE_DEFUN],
74558c4a8e55Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
7456b042e37fSmrg
7457b042e37fSmrg
74588c4a8e55Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
74598c4a8e55Smrg# -----------------------------------------------
74608c4a8e55Smrgm4_define([LT_OPTION_DEFINE],
74618c4a8e55Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
74628c4a8e55Smrg])# LT_OPTION_DEFINE
7463b042e37fSmrg
7464b042e37fSmrg
74658c4a8e55Smrg# dlopen
74668c4a8e55Smrg# ------
74678c4a8e55SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
74688c4a8e55Smrg])
7469b042e37fSmrg
74708c4a8e55SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
74718c4a8e55Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
74728c4a8e55SmrgAC_DIAGNOSE([obsolete],
74738c4a8e55Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
74748c4a8e55Smrgput the `dlopen' option into LT_INIT's first parameter.])
74758c4a8e55Smrg])
7476b042e37fSmrg
74778c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
74788c4a8e55Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
7479b042e37fSmrg
7480b042e37fSmrg
74818c4a8e55Smrg# win32-dll
74828c4a8e55Smrg# ---------
74838c4a8e55Smrg# Declare package support for building win32 dll's.
74848c4a8e55SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
74858c4a8e55Smrg[enable_win32_dll=yes
7486b042e37fSmrg
74878c4a8e55Smrgcase $host in
74888c4a8e55Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
74898c4a8e55Smrg  AC_CHECK_TOOL(AS, as, false)
74908c4a8e55Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
74918c4a8e55Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
74928c4a8e55Smrg  ;;
74938c4a8e55Smrgesac
7494b042e37fSmrg
74958c4a8e55Smrgtest -z "$AS" && AS=as
74968c4a8e55Smrg_LT_DECL([], [AS],      [0], [Assembler program])dnl
7497b042e37fSmrg
74988c4a8e55Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
74998c4a8e55Smrg_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
7500b042e37fSmrg
75018c4a8e55Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
75028c4a8e55Smrg_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
75038c4a8e55Smrg])# win32-dll
7504b042e37fSmrg
75058c4a8e55SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
75068c4a8e55Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
75078c4a8e55Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
75088c4a8e55SmrgAC_DIAGNOSE([obsolete],
75098c4a8e55Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
75108c4a8e55Smrgput the `win32-dll' option into LT_INIT's first parameter.])
75118c4a8e55Smrg])
7512b042e37fSmrg
75138c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
75148c4a8e55Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
7515b042e37fSmrg
7516b042e37fSmrg
75178c4a8e55Smrg# _LT_ENABLE_SHARED([DEFAULT])
75188c4a8e55Smrg# ----------------------------
75198c4a8e55Smrg# implement the --enable-shared flag, and supports the `shared' and
75208c4a8e55Smrg# `disable-shared' LT_INIT options.
75218c4a8e55Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
75228c4a8e55Smrgm4_define([_LT_ENABLE_SHARED],
75238c4a8e55Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
75248c4a8e55SmrgAC_ARG_ENABLE([shared],
75258c4a8e55Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
75268c4a8e55Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
75278c4a8e55Smrg    [p=${PACKAGE-default}
75288c4a8e55Smrg    case $enableval in
75298c4a8e55Smrg    yes) enable_shared=yes ;;
75308c4a8e55Smrg    no) enable_shared=no ;;
7531b042e37fSmrg    *)
75328c4a8e55Smrg      enable_shared=no
75338c4a8e55Smrg      # Look at the argument we got.  We use all the common list separators.
75348c4a8e55Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
75358c4a8e55Smrg      for pkg in $enableval; do
75368c4a8e55Smrg	IFS="$lt_save_ifs"
75378c4a8e55Smrg	if test "X$pkg" = "X$p"; then
75388c4a8e55Smrg	  enable_shared=yes
75398c4a8e55Smrg	fi
75408c4a8e55Smrg      done
75418c4a8e55Smrg      IFS="$lt_save_ifs"
7542b042e37fSmrg      ;;
75438c4a8e55Smrg    esac],
75448c4a8e55Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
7545b042e37fSmrg
75468c4a8e55Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
75478c4a8e55Smrg	[Whether or not to build shared libraries])
75488c4a8e55Smrg])# _LT_ENABLE_SHARED
7549b042e37fSmrg
75508c4a8e55SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
75518c4a8e55SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
7552b042e37fSmrg
75538c4a8e55Smrg# Old names:
75548c4a8e55SmrgAC_DEFUN([AC_ENABLE_SHARED],
75558c4a8e55Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
75568c4a8e55Smrg])
75578c4a8e55Smrg
75588c4a8e55SmrgAC_DEFUN([AC_DISABLE_SHARED],
75598c4a8e55Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
75608c4a8e55Smrg])
7561b042e37fSmrg
75628c4a8e55SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
75638c4a8e55SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
7564b042e37fSmrg
75658c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
75668c4a8e55Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
75678c4a8e55Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
7568b042e37fSmrg
7569b042e37fSmrg
7570b042e37fSmrg
75718c4a8e55Smrg# _LT_ENABLE_STATIC([DEFAULT])
75728c4a8e55Smrg# ----------------------------
75738c4a8e55Smrg# implement the --enable-static flag, and support the `static' and
75748c4a8e55Smrg# `disable-static' LT_INIT options.
75758c4a8e55Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
75768c4a8e55Smrgm4_define([_LT_ENABLE_STATIC],
75778c4a8e55Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
75788c4a8e55SmrgAC_ARG_ENABLE([static],
75798c4a8e55Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
75808c4a8e55Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
75818c4a8e55Smrg    [p=${PACKAGE-default}
75828c4a8e55Smrg    case $enableval in
75838c4a8e55Smrg    yes) enable_static=yes ;;
75848c4a8e55Smrg    no) enable_static=no ;;
75858c4a8e55Smrg    *)
75868c4a8e55Smrg     enable_static=no
75878c4a8e55Smrg      # Look at the argument we got.  We use all the common list separators.
75888c4a8e55Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
75898c4a8e55Smrg      for pkg in $enableval; do
75908c4a8e55Smrg	IFS="$lt_save_ifs"
75918c4a8e55Smrg	if test "X$pkg" = "X$p"; then
75928c4a8e55Smrg	  enable_static=yes
75938c4a8e55Smrg	fi
75948c4a8e55Smrg      done
75958c4a8e55Smrg      IFS="$lt_save_ifs"
75968c4a8e55Smrg      ;;
75978c4a8e55Smrg    esac],
75988c4a8e55Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
7599b042e37fSmrg
76008c4a8e55Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
76018c4a8e55Smrg	[Whether or not to build static libraries])
76028c4a8e55Smrg])# _LT_ENABLE_STATIC
7603b042e37fSmrg
76048c4a8e55SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
76058c4a8e55SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
7606b042e37fSmrg
76078c4a8e55Smrg# Old names:
76088c4a8e55SmrgAC_DEFUN([AC_ENABLE_STATIC],
76098c4a8e55Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
7610b042e37fSmrg])
7611b042e37fSmrg
76128c4a8e55SmrgAC_DEFUN([AC_DISABLE_STATIC],
76138c4a8e55Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
7614b042e37fSmrg])
7615b042e37fSmrg
76168c4a8e55SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
76178c4a8e55SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
76188c4a8e55Smrg
76198c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
76208c4a8e55Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
76218c4a8e55Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
76228c4a8e55Smrg
76238c4a8e55Smrg
76248c4a8e55Smrg
76258c4a8e55Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
76268c4a8e55Smrg# ----------------------------------
76278c4a8e55Smrg# implement the --enable-fast-install flag, and support the `fast-install'
76288c4a8e55Smrg# and `disable-fast-install' LT_INIT options.
76298c4a8e55Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
76308c4a8e55Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
76318c4a8e55Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
76328c4a8e55SmrgAC_ARG_ENABLE([fast-install],
76338c4a8e55Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
76348c4a8e55Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
76358c4a8e55Smrg    [p=${PACKAGE-default}
76368c4a8e55Smrg    case $enableval in
76378c4a8e55Smrg    yes) enable_fast_install=yes ;;
76388c4a8e55Smrg    no) enable_fast_install=no ;;
76398c4a8e55Smrg    *)
76408c4a8e55Smrg      enable_fast_install=no
76418c4a8e55Smrg      # Look at the argument we got.  We use all the common list separators.
76428c4a8e55Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
76438c4a8e55Smrg      for pkg in $enableval; do
76448c4a8e55Smrg	IFS="$lt_save_ifs"
76458c4a8e55Smrg	if test "X$pkg" = "X$p"; then
76468c4a8e55Smrg	  enable_fast_install=yes
76478c4a8e55Smrg	fi
76488c4a8e55Smrg      done
76498c4a8e55Smrg      IFS="$lt_save_ifs"
76508c4a8e55Smrg      ;;
76518c4a8e55Smrg    esac],
76528c4a8e55Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
76538c4a8e55Smrg
76548c4a8e55Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
76558c4a8e55Smrg	 [Whether or not to optimize for fast installation])dnl
76568c4a8e55Smrg])# _LT_ENABLE_FAST_INSTALL
76578c4a8e55Smrg
76588c4a8e55SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
76598c4a8e55SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
76608c4a8e55Smrg
76618c4a8e55Smrg# Old names:
76628c4a8e55SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
76638c4a8e55Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
76648c4a8e55SmrgAC_DIAGNOSE([obsolete],
76658c4a8e55Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
76668c4a8e55Smrgthe `fast-install' option into LT_INIT's first parameter.])
7667b042e37fSmrg])
76688c4a8e55Smrg
76698c4a8e55SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
76708c4a8e55Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
76718c4a8e55SmrgAC_DIAGNOSE([obsolete],
76728c4a8e55Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
76738c4a8e55Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
7674b042e37fSmrg])
7675b042e37fSmrg
76768c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
76778c4a8e55Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
76788c4a8e55Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
7679b042e37fSmrg
7680b042e37fSmrg
76818c4a8e55Smrg# _LT_WITH_PIC([MODE])
76828c4a8e55Smrg# --------------------
76838c4a8e55Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
76848c4a8e55Smrg# LT_INIT options.
76858c4a8e55Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
76868c4a8e55Smrgm4_define([_LT_WITH_PIC],
76878c4a8e55Smrg[AC_ARG_WITH([pic],
76888c4a8e55Smrg    [AS_HELP_STRING([--with-pic],
76898c4a8e55Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
76908c4a8e55Smrg    [pic_mode="$withval"],
76918c4a8e55Smrg    [pic_mode=default])
7692b042e37fSmrg
76938c4a8e55Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
7694b042e37fSmrg
76958c4a8e55Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
76968c4a8e55Smrg])# _LT_WITH_PIC
7697b042e37fSmrg
76988c4a8e55SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
76998c4a8e55SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
7700b042e37fSmrg
77018c4a8e55Smrg# Old name:
77028c4a8e55SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
77038c4a8e55Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
77048c4a8e55SmrgAC_DIAGNOSE([obsolete],
77058c4a8e55Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
77068c4a8e55Smrgput the `pic-only' option into LT_INIT's first parameter.])
77078c4a8e55Smrg])
7708b042e37fSmrg
77098c4a8e55Smrgdnl aclocal-1.4 backwards compatibility:
77108c4a8e55Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
7711b042e37fSmrg
7712b042e37fSmrg
77138c4a8e55Smrgm4_define([_LTDL_MODE], [])
77148c4a8e55SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
77158c4a8e55Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
77168c4a8e55SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
77178c4a8e55Smrg		 [m4_define([_LTDL_MODE], [recursive])])
77188c4a8e55SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
77198c4a8e55Smrg		 [m4_define([_LTDL_MODE], [subproject])])
7720b042e37fSmrg
77218c4a8e55Smrgm4_define([_LTDL_TYPE], [])
77228c4a8e55SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
77238c4a8e55Smrg		 [m4_define([_LTDL_TYPE], [installable])])
77248c4a8e55SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
77258c4a8e55Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
7726b042e37fSmrg
77278c4a8e55Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
77288c4a8e55Smrg#
77298c4a8e55Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
77308c4a8e55Smrg# Written by Gary V. Vaughan, 2004
77318c4a8e55Smrg#
77328c4a8e55Smrg# This file is free software; the Free Software Foundation gives
77338c4a8e55Smrg# unlimited permission to copy and/or distribute it, with or without
77348c4a8e55Smrg# modifications, as long as this notice is preserved.
7735b042e37fSmrg
77368c4a8e55Smrg# serial 6 ltsugar.m4
7737b042e37fSmrg
77388c4a8e55Smrg# This is to help aclocal find these macros, as it can't see m4_define.
77398c4a8e55SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
7740b042e37fSmrg
7741b042e37fSmrg
77428c4a8e55Smrg# lt_join(SEP, ARG1, [ARG2...])
77438c4a8e55Smrg# -----------------------------
77448c4a8e55Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
77458c4a8e55Smrg# associated separator.
77468c4a8e55Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
77478c4a8e55Smrg# versions in m4sugar had bugs.
77488c4a8e55Smrgm4_define([lt_join],
77498c4a8e55Smrg[m4_if([$#], [1], [],
77508c4a8e55Smrg       [$#], [2], [[$2]],
77518c4a8e55Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
77528c4a8e55Smrgm4_define([_lt_join],
77538c4a8e55Smrg[m4_if([$#$2], [2], [],
77548c4a8e55Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
77558c4a8e55Smrg
77568c4a8e55Smrg
77578c4a8e55Smrg# lt_car(LIST)
77588c4a8e55Smrg# lt_cdr(LIST)
77598c4a8e55Smrg# ------------
77608c4a8e55Smrg# Manipulate m4 lists.
77618c4a8e55Smrg# These macros are necessary as long as will still need to support
77628c4a8e55Smrg# Autoconf-2.59 which quotes differently.
77638c4a8e55Smrgm4_define([lt_car], [[$1]])
77648c4a8e55Smrgm4_define([lt_cdr],
77658c4a8e55Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
77668c4a8e55Smrg       [$#], 1, [],
77678c4a8e55Smrg       [m4_dquote(m4_shift($@))])])
77688c4a8e55Smrgm4_define([lt_unquote], $1)
77698c4a8e55Smrg
77708c4a8e55Smrg
77718c4a8e55Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
77728c4a8e55Smrg# ------------------------------------------
77738c4a8e55Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
77748c4a8e55Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
77758c4a8e55Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
77768c4a8e55Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
77778c4a8e55Smrg# than defined and empty).
7778b042e37fSmrg#
77798c4a8e55Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
77808c4a8e55Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
77818c4a8e55Smrgm4_define([lt_append],
77828c4a8e55Smrg[m4_define([$1],
77838c4a8e55Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
77848c4a8e55Smrg
77858c4a8e55Smrg
77868c4a8e55Smrg
77878c4a8e55Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
77888c4a8e55Smrg# ----------------------------------------------------------
77898c4a8e55Smrg# Produce a SEP delimited list of all paired combinations of elements of
77908c4a8e55Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
77918c4a8e55Smrg# has the form PREFIXmINFIXSUFFIXn.
77928c4a8e55Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
77938c4a8e55Smrgm4_define([lt_combine],
77948c4a8e55Smrg[m4_if(m4_eval([$# > 3]), [1],
77958c4a8e55Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
77968c4a8e55Smrg[[m4_foreach([_Lt_prefix], [$2],
77978c4a8e55Smrg	     [m4_foreach([_Lt_suffix],
77988c4a8e55Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
77998c4a8e55Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
78008c4a8e55Smrg
78018c4a8e55Smrg
78028c4a8e55Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
78038c4a8e55Smrg# -----------------------------------------------------------------------
78048c4a8e55Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
78058c4a8e55Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
78068c4a8e55Smrgm4_define([lt_if_append_uniq],
78078c4a8e55Smrg[m4_ifdef([$1],
78088c4a8e55Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
78098c4a8e55Smrg		 [lt_append([$1], [$2], [$3])$4],
78108c4a8e55Smrg		 [$5])],
78118c4a8e55Smrg	  [lt_append([$1], [$2], [$3])$4])])
78128c4a8e55Smrg
78138c4a8e55Smrg
78148c4a8e55Smrg# lt_dict_add(DICT, KEY, VALUE)
78158c4a8e55Smrg# -----------------------------
78168c4a8e55Smrgm4_define([lt_dict_add],
78178c4a8e55Smrg[m4_define([$1($2)], [$3])])
7818b042e37fSmrg
7819b042e37fSmrg
78208c4a8e55Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
78218c4a8e55Smrg# --------------------------------------------
78228c4a8e55Smrgm4_define([lt_dict_add_subkey],
78238c4a8e55Smrg[m4_define([$1($2:$3)], [$4])])
7824b042e37fSmrg
7825b042e37fSmrg
78268c4a8e55Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
78278c4a8e55Smrg# ----------------------------------
78288c4a8e55Smrgm4_define([lt_dict_fetch],
78298c4a8e55Smrg[m4_ifval([$3],
78308c4a8e55Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
78318c4a8e55Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
7832b042e37fSmrg
7833b042e37fSmrg
78348c4a8e55Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
78358c4a8e55Smrg# -----------------------------------------------------------------
78368c4a8e55Smrgm4_define([lt_if_dict_fetch],
78378c4a8e55Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
78388c4a8e55Smrg	[$5],
78398c4a8e55Smrg    [$6])])
7840b042e37fSmrg
7841b042e37fSmrg
78428c4a8e55Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
78438c4a8e55Smrg# --------------------------------------------------------------
78448c4a8e55Smrgm4_define([lt_dict_filter],
78458c4a8e55Smrg[m4_if([$5], [], [],
78468c4a8e55Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
78478c4a8e55Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
78488c4a8e55Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
78498c4a8e55Smrg])
7850b042e37fSmrg
78518c4a8e55Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
7852b042e37fSmrg#
78538c4a8e55Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
78548c4a8e55Smrg#   Written by Scott James Remnant, 2004
78558c4a8e55Smrg#
78568c4a8e55Smrg# This file is free software; the Free Software Foundation gives
78578c4a8e55Smrg# unlimited permission to copy and/or distribute it, with or without
78588c4a8e55Smrg# modifications, as long as this notice is preserved.
7859b042e37fSmrg
78608c4a8e55Smrg# Generated from ltversion.in.
7861b042e37fSmrg
78628c4a8e55Smrg# serial 3012 ltversion.m4
78638c4a8e55Smrg# This file is part of GNU Libtool
7864b042e37fSmrg
78658c4a8e55Smrgm4_define([LT_PACKAGE_VERSION], [2.2.6])
78668c4a8e55Smrgm4_define([LT_PACKAGE_REVISION], [1.3012])
7867b042e37fSmrg
78688c4a8e55SmrgAC_DEFUN([LTVERSION_VERSION],
78698c4a8e55Smrg[macro_version='2.2.6'
78708c4a8e55Smrgmacro_revision='1.3012'
78718c4a8e55Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
78728c4a8e55Smrg_LT_DECL(, macro_revision, 0)
78738c4a8e55Smrg])
7874b042e37fSmrg
78758c4a8e55Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
7876b042e37fSmrg#
78778c4a8e55Smrg#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
78788c4a8e55Smrg#   Written by Scott James Remnant, 2004.
7879b042e37fSmrg#
78808c4a8e55Smrg# This file is free software; the Free Software Foundation gives
78818c4a8e55Smrg# unlimited permission to copy and/or distribute it, with or without
78828c4a8e55Smrg# modifications, as long as this notice is preserved.
7883b042e37fSmrg
78848c4a8e55Smrg# serial 4 lt~obsolete.m4
7885b042e37fSmrg
78868c4a8e55Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
7887b042e37fSmrg#
78888c4a8e55Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
78898c4a8e55Smrg# which have later been changed to m4_define as they aren't part of the
78908c4a8e55Smrg# exported API, or moved to Autoconf or Automake where they belong.
78918c4a8e55Smrg#
78928c4a8e55Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
78938c4a8e55Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
78948c4a8e55Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
78958c4a8e55Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
78968c4a8e55Smrg# and doesn't know about Autoconf macros at all.)
78978c4a8e55Smrg#
78988c4a8e55Smrg# So we provide this file, which has a silly filename so it's always
78998c4a8e55Smrg# included after everything else.  This provides aclocal with the
79008c4a8e55Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
79018c4a8e55Smrg# because those macros already exist, or will be overwritten later.
79028c4a8e55Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
79038c4a8e55Smrg#
79048c4a8e55Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
79058c4a8e55Smrg# Yes, that means every name once taken will need to remain here until
79068c4a8e55Smrg# we give up compatibility with versions before 1.7, at which point
79078c4a8e55Smrg# we need to keep only those names which we still refer to.
79088c4a8e55Smrg
79098c4a8e55Smrg# This is to help aclocal find these macros, as it can't see m4_define.
79108c4a8e55SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
79118c4a8e55Smrg
79128c4a8e55Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
79138c4a8e55Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
79148c4a8e55Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
79158c4a8e55Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
79168c4a8e55Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
79178c4a8e55Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
79188c4a8e55Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
79198c4a8e55Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
79208c4a8e55Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
79218c4a8e55Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
79228c4a8e55Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
79238c4a8e55Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
79248c4a8e55Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
79258c4a8e55Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
79268c4a8e55Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
79278c4a8e55Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
79288c4a8e55Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
79298c4a8e55Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
79308c4a8e55Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
79318c4a8e55Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
79328c4a8e55Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
79338c4a8e55Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
79348c4a8e55Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
79358c4a8e55Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
79368c4a8e55Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
79378c4a8e55Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
79388c4a8e55Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
79398c4a8e55Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
79408c4a8e55Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
79418c4a8e55Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
79428c4a8e55Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
79438c4a8e55Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
79448c4a8e55Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
79458c4a8e55Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
79468c4a8e55Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
79478c4a8e55Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
79488c4a8e55Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
79498c4a8e55Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
79508c4a8e55Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
79518c4a8e55Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
79528c4a8e55Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
79538c4a8e55Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
79548c4a8e55Smrgm4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
79558c4a8e55Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
79568c4a8e55Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
79578c4a8e55Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
79588c4a8e55Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
79598c4a8e55Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
79608c4a8e55Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
79618c4a8e55Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
79628c4a8e55Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
79638c4a8e55Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
79648c4a8e55Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
79658c4a8e55Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
79668c4a8e55Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
7967b042e37fSmrg
79688c4a8e55Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
79698c4a8e55Smrg# 
79708c4a8e55Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
7971b042e37fSmrg#
79728c4a8e55Smrg# This program is free software; you can redistribute it and/or modify
79738c4a8e55Smrg# it under the terms of the GNU General Public License as published by
79748c4a8e55Smrg# the Free Software Foundation; either version 2 of the License, or
79758c4a8e55Smrg# (at your option) any later version.
7976b042e37fSmrg#
79778c4a8e55Smrg# This program is distributed in the hope that it will be useful, but
79788c4a8e55Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
79798c4a8e55Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
79808c4a8e55Smrg# General Public License for more details.
79818c4a8e55Smrg#
79828c4a8e55Smrg# You should have received a copy of the GNU General Public License
79838c4a8e55Smrg# along with this program; if not, write to the Free Software
79848c4a8e55Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
79858c4a8e55Smrg#
79868c4a8e55Smrg# As a special exception to the GNU General Public License, if you
79878c4a8e55Smrg# distribute this file as part of a program that contains a
79888c4a8e55Smrg# configuration script generated by Autoconf, you may include it under
79898c4a8e55Smrg# the same distribution terms that you use for the rest of that program.
79908c4a8e55Smrg
79918c4a8e55Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
79928c4a8e55Smrg# ----------------------------------
79938c4a8e55SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
79948c4a8e55Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
79958c4a8e55Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
79968c4a8e55SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
79978c4a8e55Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
79988c4a8e55Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
79998c4a8e55Smrgfi
80008c4a8e55Smrgif test -n "$PKG_CONFIG"; then
80018c4a8e55Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
80028c4a8e55Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
80038c4a8e55Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
80048c4a8e55Smrg		AC_MSG_RESULT([yes])
80058c4a8e55Smrg	else
80068c4a8e55Smrg		AC_MSG_RESULT([no])
80078c4a8e55Smrg		PKG_CONFIG=""
80088c4a8e55Smrg	fi
80098c4a8e55Smrg		
80108c4a8e55Smrgfi[]dnl
80118c4a8e55Smrg])# PKG_PROG_PKG_CONFIG
80128c4a8e55Smrg
80138c4a8e55Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
80148c4a8e55Smrg#
80158c4a8e55Smrg# Check to see whether a particular set of modules exists.  Similar
80168c4a8e55Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
80178c4a8e55Smrg#
80188c4a8e55Smrg#
80198c4a8e55Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
80208c4a8e55Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
80218c4a8e55Smrg# PKG_CHECK_EXISTS manually
80228c4a8e55Smrg# --------------------------------------------------------------
80238c4a8e55SmrgAC_DEFUN([PKG_CHECK_EXISTS],
80248c4a8e55Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
80258c4a8e55Smrgif test -n "$PKG_CONFIG" && \
80268c4a8e55Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
80278c4a8e55Smrg  m4_ifval([$2], [$2], [:])
80288c4a8e55Smrgm4_ifvaln([$3], [else
80298c4a8e55Smrg  $3])dnl
80308c4a8e55Smrgfi])
80318c4a8e55Smrg
80328c4a8e55Smrg
80338c4a8e55Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
80348c4a8e55Smrg# ---------------------------------------------
80358c4a8e55Smrgm4_define([_PKG_CONFIG],
80368c4a8e55Smrg[if test -n "$$1"; then
80378c4a8e55Smrg    pkg_cv_[]$1="$$1"
80388c4a8e55Smrg elif test -n "$PKG_CONFIG"; then
80398c4a8e55Smrg    PKG_CHECK_EXISTS([$3],
80408c4a8e55Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
80418c4a8e55Smrg		     [pkg_failed=yes])
80428c4a8e55Smrg else
80438c4a8e55Smrg    pkg_failed=untried
80448c4a8e55Smrgfi[]dnl
80458c4a8e55Smrg])# _PKG_CONFIG
80468c4a8e55Smrg
80478c4a8e55Smrg# _PKG_SHORT_ERRORS_SUPPORTED
80488c4a8e55Smrg# -----------------------------
80498c4a8e55SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
80508c4a8e55Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
80518c4a8e55Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
80528c4a8e55Smrg        _pkg_short_errors_supported=yes
80538c4a8e55Smrgelse
80548c4a8e55Smrg        _pkg_short_errors_supported=no
80558c4a8e55Smrgfi[]dnl
80568c4a8e55Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
80578c4a8e55Smrg
80588c4a8e55Smrg
80598c4a8e55Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
80608c4a8e55Smrg# [ACTION-IF-NOT-FOUND])
80618c4a8e55Smrg#
80628c4a8e55Smrg#
80638c4a8e55Smrg# Note that if there is a possibility the first call to
80648c4a8e55Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
80658c4a8e55Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
80668c4a8e55Smrg#
80678c4a8e55Smrg#
80688c4a8e55Smrg# --------------------------------------------------------------
80698c4a8e55SmrgAC_DEFUN([PKG_CHECK_MODULES],
80708c4a8e55Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
80718c4a8e55SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
80728c4a8e55SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
80738c4a8e55Smrg
80748c4a8e55Smrgpkg_failed=no
80758c4a8e55SmrgAC_MSG_CHECKING([for $1])
80768c4a8e55Smrg
80778c4a8e55Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
80788c4a8e55Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
80798c4a8e55Smrg
80808c4a8e55Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
80818c4a8e55Smrgand $1[]_LIBS to avoid the need to call pkg-config.
80828c4a8e55SmrgSee the pkg-config man page for more details.])
80838c4a8e55Smrg
80848c4a8e55Smrgif test $pkg_failed = yes; then
80858c4a8e55Smrg        _PKG_SHORT_ERRORS_SUPPORTED
80868c4a8e55Smrg        if test $_pkg_short_errors_supported = yes; then
80878c4a8e55Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
80888c4a8e55Smrg        else 
80898c4a8e55Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
80908c4a8e55Smrg        fi
80918c4a8e55Smrg	# Put the nasty error message in config.log where it belongs
80928c4a8e55Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
80938c4a8e55Smrg
80948c4a8e55Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
80958c4a8e55Smrg[Package requirements ($2) were not met:
80968c4a8e55Smrg
80978c4a8e55Smrg$$1_PKG_ERRORS
80988c4a8e55Smrg
80998c4a8e55SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
81008c4a8e55Smrginstalled software in a non-standard prefix.
81018c4a8e55Smrg
81028c4a8e55Smrg_PKG_TEXT
81038c4a8e55Smrg])],
81048c4a8e55Smrg		[AC_MSG_RESULT([no])
81058c4a8e55Smrg                $4])
81068c4a8e55Smrgelif test $pkg_failed = untried; then
81078c4a8e55Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
81088c4a8e55Smrg[The pkg-config script could not be found or is too old.  Make sure it
81098c4a8e55Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
81108c4a8e55Smrgpath to pkg-config.
81118c4a8e55Smrg
81128c4a8e55Smrg_PKG_TEXT
81138c4a8e55Smrg
81148c4a8e55SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
81158c4a8e55Smrg		[$4])
81168c4a8e55Smrgelse
81178c4a8e55Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
81188c4a8e55Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
81198c4a8e55Smrg        AC_MSG_RESULT([yes])
81208c4a8e55Smrg	ifelse([$3], , :, [$3])
81218c4a8e55Smrgfi[]dnl
81228c4a8e55Smrg])# PKG_CHECK_MODULES
81238c4a8e55Smrg
81248c4a8e55Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
81258c4a8e55Smrg#
81268c4a8e55Smrg# This file is free software; the Free Software Foundation
81278c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
81288c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
81298c4a8e55Smrg
81308c4a8e55Smrg# AM_AUTOMAKE_VERSION(VERSION)
81318c4a8e55Smrg# ----------------------------
81328c4a8e55Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
81338c4a8e55Smrg# generated from the m4 files accompanying Automake X.Y.
81348c4a8e55Smrg# (This private macro should not be called outside this file.)
81358c4a8e55SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
81368c4a8e55Smrg[am__api_version='1.10'
81378c4a8e55Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
81388c4a8e55Smrgdnl require some minimum version.  Point them to the right macro.
81398c4a8e55Smrgm4_if([$1], [1.10.1], [],
81408c4a8e55Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
81418c4a8e55Smrg])
81428c4a8e55Smrg
81438c4a8e55Smrg# _AM_AUTOCONF_VERSION(VERSION)
81448c4a8e55Smrg# -----------------------------
81458c4a8e55Smrg# aclocal traces this macro to find the Autoconf version.
81468c4a8e55Smrg# This is a private macro too.  Using m4_define simplifies
81478c4a8e55Smrg# the logic in aclocal, which can simply ignore this definition.
81488c4a8e55Smrgm4_define([_AM_AUTOCONF_VERSION], [])
81498c4a8e55Smrg
81508c4a8e55Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
81518c4a8e55Smrg# -------------------------------
81528c4a8e55Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
81538c4a8e55Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
81548c4a8e55SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
81558c4a8e55Smrg[AM_AUTOMAKE_VERSION([1.10.1])dnl
81568c4a8e55Smrgm4_ifndef([AC_AUTOCONF_VERSION],
81578c4a8e55Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
81588c4a8e55Smrg_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
81598c4a8e55Smrg
81608c4a8e55Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
81618c4a8e55Smrg
81628c4a8e55Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
81638c4a8e55Smrg#
81648c4a8e55Smrg# This file is free software; the Free Software Foundation
81658c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
81668c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
81678c4a8e55Smrg
81688c4a8e55Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
81698c4a8e55Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
81708c4a8e55Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
81718c4a8e55Smrg#
81728c4a8e55Smrg# Of course, Automake must honor this variable whenever it calls a
81738c4a8e55Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
81748c4a8e55Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
81758c4a8e55Smrg# depending on how configure is run.  This is pretty annoying, since
81768c4a8e55Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
81778c4a8e55Smrg# source directory, any form will work fine, but in subdirectories a
81788c4a8e55Smrg# relative path needs to be adjusted first.
81798c4a8e55Smrg#
81808c4a8e55Smrg# $ac_aux_dir/missing
81818c4a8e55Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
81828c4a8e55Smrg# $top_srcdir/$ac_aux_dir/missing
81838c4a8e55Smrg#    fails if $ac_aux_dir is absolute,
81848c4a8e55Smrg#    fails when called from a subdirectory in a VPATH build with
81858c4a8e55Smrg#          a relative $ac_aux_dir
81868c4a8e55Smrg#
81878c4a8e55Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
81888c4a8e55Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
81898c4a8e55Smrg# harmless because $srcdir is `.', but things will broke when you
81908c4a8e55Smrg# start a VPATH build or use an absolute $srcdir.
81918c4a8e55Smrg#
81928c4a8e55Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
81938c4a8e55Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
81948c4a8e55Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
81958c4a8e55Smrg# and then we would define $MISSING as
81968c4a8e55Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
81978c4a8e55Smrg# This will work as long as MISSING is not called from configure, because
81988c4a8e55Smrg# unfortunately $(top_srcdir) has no meaning in configure.
81998c4a8e55Smrg# However there are other variables, like CC, which are often used in
82008c4a8e55Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
82018c4a8e55Smrg#
82028c4a8e55Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
82038c4a8e55Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
82048c4a8e55Smrg# configured tree to be moved without reconfiguration.
82058c4a8e55Smrg
82068c4a8e55SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
82078c4a8e55Smrg[dnl Rely on autoconf to set up CDPATH properly.
82088c4a8e55SmrgAC_PREREQ([2.50])dnl
82098c4a8e55Smrg# expand $ac_aux_dir to an absolute path
82108c4a8e55Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
82118c4a8e55Smrg])
82128c4a8e55Smrg
82138c4a8e55Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
82148c4a8e55Smrg
82158c4a8e55Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
82168c4a8e55Smrg# Free Software Foundation, Inc.
82178c4a8e55Smrg#
82188c4a8e55Smrg# This file is free software; the Free Software Foundation
82198c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
82208c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
82218c4a8e55Smrg
82228c4a8e55Smrg# serial 8
82238c4a8e55Smrg
82248c4a8e55Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
82258c4a8e55Smrg# -------------------------------------
82268c4a8e55Smrg# Define a conditional.
82278c4a8e55SmrgAC_DEFUN([AM_CONDITIONAL],
82288c4a8e55Smrg[AC_PREREQ(2.52)dnl
82298c4a8e55Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
82308c4a8e55Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
82318c4a8e55SmrgAC_SUBST([$1_TRUE])dnl
82328c4a8e55SmrgAC_SUBST([$1_FALSE])dnl
82338c4a8e55Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
82348c4a8e55Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
82358c4a8e55Smrgif $2; then
82368c4a8e55Smrg  $1_TRUE=
82378c4a8e55Smrg  $1_FALSE='#'
82388c4a8e55Smrgelse
82398c4a8e55Smrg  $1_TRUE='#'
82408c4a8e55Smrg  $1_FALSE=
82418c4a8e55Smrgfi
82428c4a8e55SmrgAC_CONFIG_COMMANDS_PRE(
82438c4a8e55Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
82448c4a8e55Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
82458c4a8e55SmrgUsually this means the macro was only invoked conditionally.]])
82468c4a8e55Smrgfi])])
82478c4a8e55Smrg
82488c4a8e55Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
82498c4a8e55Smrg# Free Software Foundation, Inc.
82508c4a8e55Smrg#
82518c4a8e55Smrg# This file is free software; the Free Software Foundation
82528c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
82538c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
82548c4a8e55Smrg
82558c4a8e55Smrg# serial 9
82568c4a8e55Smrg
82578c4a8e55Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
82588c4a8e55Smrg# written in clear, in which case automake, when reading aclocal.m4,
82598c4a8e55Smrg# will think it sees a *use*, and therefore will trigger all it's
82608c4a8e55Smrg# C support machinery.  Also note that it means that autoscan, seeing
82618c4a8e55Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
82628c4a8e55Smrg
82638c4a8e55Smrg
82648c4a8e55Smrg# _AM_DEPENDENCIES(NAME)
82658c4a8e55Smrg# ----------------------
82668c4a8e55Smrg# See how the compiler implements dependency checking.
82678c4a8e55Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
82688c4a8e55Smrg# We try a few techniques and use that to set a single cache variable.
82698c4a8e55Smrg#
82708c4a8e55Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
82718c4a8e55Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
82728c4a8e55Smrg# dependency, and given that the user is not expected to run this macro,
82738c4a8e55Smrg# just rely on AC_PROG_CC.
82748c4a8e55SmrgAC_DEFUN([_AM_DEPENDENCIES],
82758c4a8e55Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
82768c4a8e55SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
82778c4a8e55SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
82788c4a8e55SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
82798c4a8e55Smrg
82808c4a8e55Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
82818c4a8e55Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
82828c4a8e55Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
82838c4a8e55Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
82848c4a8e55Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
82858c4a8e55Smrg                   [depcc="$$1"   am_compiler_list=])
82868c4a8e55Smrg
82878c4a8e55SmrgAC_CACHE_CHECK([dependency style of $depcc],
82888c4a8e55Smrg               [am_cv_$1_dependencies_compiler_type],
82898c4a8e55Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
82908c4a8e55Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
82918c4a8e55Smrg  # making bogus files that we don't know about and never remove.  For
82928c4a8e55Smrg  # instance it was reported that on HP-UX the gcc test will end up
82938c4a8e55Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
82948c4a8e55Smrg  # in D'.
82958c4a8e55Smrg  mkdir conftest.dir
82968c4a8e55Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
82978c4a8e55Smrg  # using a relative directory.
82988c4a8e55Smrg  cp "$am_depcomp" conftest.dir
82998c4a8e55Smrg  cd conftest.dir
83008c4a8e55Smrg  # We will build objects and dependencies in a subdirectory because
83018c4a8e55Smrg  # it helps to detect inapplicable dependency modes.  For instance
83028c4a8e55Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
83038c4a8e55Smrg  # side effect of compilation, but ICC will put the dependencies in
83048c4a8e55Smrg  # the current directory while Tru64 will put them in the object
83058c4a8e55Smrg  # directory.
83068c4a8e55Smrg  mkdir sub
83078c4a8e55Smrg
83088c4a8e55Smrg  am_cv_$1_dependencies_compiler_type=none
83098c4a8e55Smrg  if test "$am_compiler_list" = ""; then
83108c4a8e55Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
83118c4a8e55Smrg  fi
83128c4a8e55Smrg  for depmode in $am_compiler_list; do
83138c4a8e55Smrg    # Setup a source with many dependencies, because some compilers
83148c4a8e55Smrg    # like to wrap large dependency lists on column 80 (with \), and
83158c4a8e55Smrg    # we should not choose a depcomp mode which is confused by this.
83168c4a8e55Smrg    #
83178c4a8e55Smrg    # We need to recreate these files for each test, as the compiler may
83188c4a8e55Smrg    # overwrite some of them when testing with obscure command lines.
83198c4a8e55Smrg    # This happens at least with the AIX C compiler.
83208c4a8e55Smrg    : > sub/conftest.c
83218c4a8e55Smrg    for i in 1 2 3 4 5 6; do
83228c4a8e55Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
83238c4a8e55Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
83248c4a8e55Smrg      # Solaris 8's {/usr,}/bin/sh.
83258c4a8e55Smrg      touch sub/conftst$i.h
83268c4a8e55Smrg    done
83278c4a8e55Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
83288c4a8e55Smrg
83298c4a8e55Smrg    case $depmode in
83308c4a8e55Smrg    nosideeffect)
83318c4a8e55Smrg      # after this tag, mechanisms are not by side-effect, so they'll
83328c4a8e55Smrg      # only be used when explicitly requested
83338c4a8e55Smrg      if test "x$enable_dependency_tracking" = xyes; then
83348c4a8e55Smrg	continue
83358c4a8e55Smrg      else
83368c4a8e55Smrg	break
83378c4a8e55Smrg      fi
83388c4a8e55Smrg      ;;
83398c4a8e55Smrg    none) break ;;
83408c4a8e55Smrg    esac
83418c4a8e55Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
83428c4a8e55Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
83438c4a8e55Smrg    # handle `-M -o', and we need to detect this.
83448c4a8e55Smrg    if depmode=$depmode \
83458c4a8e55Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
83468c4a8e55Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
83478c4a8e55Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
83488c4a8e55Smrg         >/dev/null 2>conftest.err &&
83498c4a8e55Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
83508c4a8e55Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
83518c4a8e55Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
83528c4a8e55Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
83538c4a8e55Smrg      # icc doesn't choke on unknown options, it will just issue warnings
83548c4a8e55Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
83558c4a8e55Smrg      # that says an option was ignored or not supported.
83568c4a8e55Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
83578c4a8e55Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
83588c4a8e55Smrg      # The diagnosis changed in icc 8.0:
83598c4a8e55Smrg      #   icc: Command line remark: option '-MP' not supported
83608c4a8e55Smrg      if (grep 'ignoring option' conftest.err ||
83618c4a8e55Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
83628c4a8e55Smrg        am_cv_$1_dependencies_compiler_type=$depmode
83638c4a8e55Smrg        break
83648c4a8e55Smrg      fi
83658c4a8e55Smrg    fi
83668c4a8e55Smrg  done
83678c4a8e55Smrg
83688c4a8e55Smrg  cd ..
83698c4a8e55Smrg  rm -rf conftest.dir
83708c4a8e55Smrgelse
83718c4a8e55Smrg  am_cv_$1_dependencies_compiler_type=none
83728c4a8e55Smrgfi
83738c4a8e55Smrg])
83748c4a8e55SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
83758c4a8e55SmrgAM_CONDITIONAL([am__fastdep$1], [
83768c4a8e55Smrg  test "x$enable_dependency_tracking" != xno \
83778c4a8e55Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
83788c4a8e55Smrg])
83798c4a8e55Smrg
83808c4a8e55Smrg
83818c4a8e55Smrg# AM_SET_DEPDIR
83828c4a8e55Smrg# -------------
83838c4a8e55Smrg# Choose a directory name for dependency files.
83848c4a8e55Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
83858c4a8e55SmrgAC_DEFUN([AM_SET_DEPDIR],
83868c4a8e55Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
83878c4a8e55SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
83888c4a8e55Smrg])
83898c4a8e55Smrg
83908c4a8e55Smrg
83918c4a8e55Smrg# AM_DEP_TRACK
83928c4a8e55Smrg# ------------
83938c4a8e55SmrgAC_DEFUN([AM_DEP_TRACK],
83948c4a8e55Smrg[AC_ARG_ENABLE(dependency-tracking,
83958c4a8e55Smrg[  --disable-dependency-tracking  speeds up one-time build
83968c4a8e55Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
83978c4a8e55Smrgif test "x$enable_dependency_tracking" != xno; then
83988c4a8e55Smrg  am_depcomp="$ac_aux_dir/depcomp"
83998c4a8e55Smrg  AMDEPBACKSLASH='\'
84008c4a8e55Smrgfi
84018c4a8e55SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
84028c4a8e55SmrgAC_SUBST([AMDEPBACKSLASH])dnl
84038c4a8e55Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
84048c4a8e55Smrg])
84058c4a8e55Smrg
84068c4a8e55Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
84078c4a8e55Smrg
84088c4a8e55Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
84098c4a8e55Smrg# Free Software Foundation, Inc.
84108c4a8e55Smrg#
84118c4a8e55Smrg# This file is free software; the Free Software Foundation
84128c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
84138c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
84148c4a8e55Smrg
84158c4a8e55Smrg#serial 3
84168c4a8e55Smrg
84178c4a8e55Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
84188c4a8e55Smrg# ------------------------------
84198c4a8e55SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
84208c4a8e55Smrg[for mf in $CONFIG_FILES; do
84218c4a8e55Smrg  # Strip MF so we end up with the name of the file.
84228c4a8e55Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
84238c4a8e55Smrg  # Check whether this is an Automake generated Makefile or not.
84248c4a8e55Smrg  # We used to match only the files named `Makefile.in', but
84258c4a8e55Smrg  # some people rename them; so instead we look at the file content.
84268c4a8e55Smrg  # Grep'ing the first line is not enough: some people post-process
84278c4a8e55Smrg  # each Makefile.in and add a new line on top of each file to say so.
84288c4a8e55Smrg  # Grep'ing the whole file is not good either: AIX grep has a line
84298c4a8e55Smrg  # limit of 2048, but all sed's we know have understand at least 4000.
84308c4a8e55Smrg  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
84318c4a8e55Smrg    dirpart=`AS_DIRNAME("$mf")`
84328c4a8e55Smrg  else
84338c4a8e55Smrg    continue
84348c4a8e55Smrg  fi
84358c4a8e55Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
84368c4a8e55Smrg  # from the Makefile without running `make'.
84378c4a8e55Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
84388c4a8e55Smrg  test -z "$DEPDIR" && continue
84398c4a8e55Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
84408c4a8e55Smrg  test -z "am__include" && continue
84418c4a8e55Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
84428c4a8e55Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
84438c4a8e55Smrg  U=`sed -n 's/^U = //p' < "$mf"`
84448c4a8e55Smrg  # Find all dependency output files, they are included files with
84458c4a8e55Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
84468c4a8e55Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
84478c4a8e55Smrg  # expansion.
84488c4a8e55Smrg  for file in `sed -n "
84498c4a8e55Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
84508c4a8e55Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
84518c4a8e55Smrg    # Make sure the directory exists.
84528c4a8e55Smrg    test -f "$dirpart/$file" && continue
84538c4a8e55Smrg    fdir=`AS_DIRNAME(["$file"])`
84548c4a8e55Smrg    AS_MKDIR_P([$dirpart/$fdir])
84558c4a8e55Smrg    # echo "creating $dirpart/$file"
84568c4a8e55Smrg    echo '# dummy' > "$dirpart/$file"
84578c4a8e55Smrg  done
84588c4a8e55Smrgdone
84598c4a8e55Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
84608c4a8e55Smrg
84618c4a8e55Smrg
84628c4a8e55Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
84638c4a8e55Smrg# -----------------------------
84648c4a8e55Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
84658c4a8e55Smrg#
84668c4a8e55Smrg# This code is only required when automatic dependency tracking
84678c4a8e55Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
84688c4a8e55Smrg# need in order to bootstrap the dependency handling code.
84698c4a8e55SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
84708c4a8e55Smrg[AC_CONFIG_COMMANDS([depfiles],
84718c4a8e55Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
84728c4a8e55Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
84738c4a8e55Smrg])
84748c4a8e55Smrg
84758c4a8e55Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
84768c4a8e55Smrg# Free Software Foundation, Inc.
84778c4a8e55Smrg#
84788c4a8e55Smrg# This file is free software; the Free Software Foundation
84798c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
84808c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
84818c4a8e55Smrg
84828c4a8e55Smrg# serial 8
84838c4a8e55Smrg
84848c4a8e55Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
84858c4a8e55SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
84868c4a8e55Smrg
84878c4a8e55Smrg# Do all the work for Automake.                             -*- Autoconf -*-
84888c4a8e55Smrg
84898c4a8e55Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
84908c4a8e55Smrg# 2005, 2006, 2008 Free Software Foundation, Inc.
84918c4a8e55Smrg#
84928c4a8e55Smrg# This file is free software; the Free Software Foundation
84938c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
84948c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
84958c4a8e55Smrg
84968c4a8e55Smrg# serial 13
84978c4a8e55Smrg
84988c4a8e55Smrg# This macro actually does too much.  Some checks are only needed if
84998c4a8e55Smrg# your package does certain things.  But this isn't really a big deal.
85008c4a8e55Smrg
85018c4a8e55Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
85028c4a8e55Smrg# AM_INIT_AUTOMAKE([OPTIONS])
85038c4a8e55Smrg# -----------------------------------------------
85048c4a8e55Smrg# The call with PACKAGE and VERSION arguments is the old style
85058c4a8e55Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
85068c4a8e55Smrg# and VERSION should now be passed to AC_INIT and removed from
85078c4a8e55Smrg# the call to AM_INIT_AUTOMAKE.
85088c4a8e55Smrg# We support both call styles for the transition.  After
85098c4a8e55Smrg# the next Automake release, Autoconf can make the AC_INIT
85108c4a8e55Smrg# arguments mandatory, and then we can depend on a new Autoconf
85118c4a8e55Smrg# release and drop the old call support.
85128c4a8e55SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
85138c4a8e55Smrg[AC_PREREQ([2.60])dnl
85148c4a8e55Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
85158c4a8e55Smrgdnl the ones we care about.
85168c4a8e55Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
85178c4a8e55SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
85188c4a8e55SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
85198c4a8e55Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
85208c4a8e55Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
85218c4a8e55Smrg  # is not polluted with repeated "-I."
85228c4a8e55Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
85238c4a8e55Smrg  # test to see if srcdir already configured
85248c4a8e55Smrg  if test -f $srcdir/config.status; then
85258c4a8e55Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
85268c4a8e55Smrg  fi
85278c4a8e55Smrgfi
85288c4a8e55Smrg
85298c4a8e55Smrg# test whether we have cygpath
85308c4a8e55Smrgif test -z "$CYGPATH_W"; then
85318c4a8e55Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
85328c4a8e55Smrg    CYGPATH_W='cygpath -w'
85338c4a8e55Smrg  else
85348c4a8e55Smrg    CYGPATH_W=echo
85358c4a8e55Smrg  fi
85368c4a8e55Smrgfi
85378c4a8e55SmrgAC_SUBST([CYGPATH_W])
85388c4a8e55Smrg
85398c4a8e55Smrg# Define the identity of the package.
85408c4a8e55Smrgdnl Distinguish between old-style and new-style calls.
85418c4a8e55Smrgm4_ifval([$2],
85428c4a8e55Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
85438c4a8e55Smrg AC_SUBST([PACKAGE], [$1])dnl
85448c4a8e55Smrg AC_SUBST([VERSION], [$2])],
85458c4a8e55Smrg[_AM_SET_OPTIONS([$1])dnl
85468c4a8e55Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
85478c4a8e55Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
85488c4a8e55Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
85498c4a8e55Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
85508c4a8e55Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
85518c4a8e55Smrg
85528c4a8e55Smrg_AM_IF_OPTION([no-define],,
85538c4a8e55Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
85548c4a8e55Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
85558c4a8e55Smrg
85568c4a8e55Smrg# Some tools Automake needs.
85578c4a8e55SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
85588c4a8e55SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
85598c4a8e55SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
85608c4a8e55SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
85618c4a8e55SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
85628c4a8e55SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
85638c4a8e55SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
85648c4a8e55SmrgAM_PROG_INSTALL_SH
85658c4a8e55SmrgAM_PROG_INSTALL_STRIP
85668c4a8e55SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
85678c4a8e55Smrg# We need awk for the "check" target.  The system "awk" is bad on
85688c4a8e55Smrg# some platforms.
85698c4a8e55SmrgAC_REQUIRE([AC_PROG_AWK])dnl
85708c4a8e55SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
85718c4a8e55SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
85728c4a8e55Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
85738c4a8e55Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
85748c4a8e55Smrg	      		     [_AM_PROG_TAR([v7])])])
85758c4a8e55Smrg_AM_IF_OPTION([no-dependencies],,
85768c4a8e55Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
85778c4a8e55Smrg                  [_AM_DEPENDENCIES(CC)],
85788c4a8e55Smrg                  [define([AC_PROG_CC],
85798c4a8e55Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
85808c4a8e55SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
85818c4a8e55Smrg                  [_AM_DEPENDENCIES(CXX)],
85828c4a8e55Smrg                  [define([AC_PROG_CXX],
85838c4a8e55Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
85848c4a8e55SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
85858c4a8e55Smrg                  [_AM_DEPENDENCIES(OBJC)],
85868c4a8e55Smrg                  [define([AC_PROG_OBJC],
85878c4a8e55Smrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
85888c4a8e55Smrg])
85898c4a8e55Smrg])
85908c4a8e55Smrg
85918c4a8e55Smrg
85928c4a8e55Smrg# When config.status generates a header, we must update the stamp-h file.
85938c4a8e55Smrg# This file resides in the same directory as the config header
85948c4a8e55Smrg# that is generated.  The stamp files are numbered to have different names.
85958c4a8e55Smrg
85968c4a8e55Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
85978c4a8e55Smrg# loop where config.status creates the headers, so we can generate
85988c4a8e55Smrg# our stamp files there.
85998c4a8e55SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
86008c4a8e55Smrg[# Compute $1's index in $config_headers.
86018c4a8e55Smrg_am_arg=$1
86028c4a8e55Smrg_am_stamp_count=1
86038c4a8e55Smrgfor _am_header in $config_headers :; do
86048c4a8e55Smrg  case $_am_header in
86058c4a8e55Smrg    $_am_arg | $_am_arg:* )
86068c4a8e55Smrg      break ;;
86078c4a8e55Smrg    * )
86088c4a8e55Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
86098c4a8e55Smrg  esac
86108c4a8e55Smrgdone
86118c4a8e55Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
86128c4a8e55Smrg
86138c4a8e55Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
86148c4a8e55Smrg#
86158c4a8e55Smrg# This file is free software; the Free Software Foundation
86168c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
86178c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
86188c4a8e55Smrg
86198c4a8e55Smrg# AM_PROG_INSTALL_SH
86208c4a8e55Smrg# ------------------
86218c4a8e55Smrg# Define $install_sh.
86228c4a8e55SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
86238c4a8e55Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
86248c4a8e55Smrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
86258c4a8e55SmrgAC_SUBST(install_sh)])
86268c4a8e55Smrg
86278c4a8e55Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
86288c4a8e55Smrg#
86298c4a8e55Smrg# This file is free software; the Free Software Foundation
86308c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
86318c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
86328c4a8e55Smrg
86338c4a8e55Smrg# serial 2
86348c4a8e55Smrg
86358c4a8e55Smrg# Check whether the underlying file-system supports filenames
86368c4a8e55Smrg# with a leading dot.  For instance MS-DOS doesn't.
86378c4a8e55SmrgAC_DEFUN([AM_SET_LEADING_DOT],
86388c4a8e55Smrg[rm -rf .tst 2>/dev/null
86398c4a8e55Smrgmkdir .tst 2>/dev/null
86408c4a8e55Smrgif test -d .tst; then
86418c4a8e55Smrg  am__leading_dot=.
86428c4a8e55Smrgelse
86438c4a8e55Smrg  am__leading_dot=_
86448c4a8e55Smrgfi
86458c4a8e55Smrgrmdir .tst 2>/dev/null
86468c4a8e55SmrgAC_SUBST([am__leading_dot])])
86478c4a8e55Smrg
86488c4a8e55Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
86498c4a8e55Smrg# From Jim Meyering
86508c4a8e55Smrg
86518c4a8e55Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
86528c4a8e55Smrg# Free Software Foundation, Inc.
86538c4a8e55Smrg#
86548c4a8e55Smrg# This file is free software; the Free Software Foundation
86558c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
86568c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
86578c4a8e55Smrg
86588c4a8e55Smrg# serial 4
86598c4a8e55Smrg
86608c4a8e55SmrgAC_DEFUN([AM_MAINTAINER_MODE],
86618c4a8e55Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
86628c4a8e55Smrg  dnl maintainer-mode is disabled by default
86638c4a8e55Smrg  AC_ARG_ENABLE(maintainer-mode,
86648c4a8e55Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
86658c4a8e55Smrg			  (and sometimes confusing) to the casual installer],
86668c4a8e55Smrg      USE_MAINTAINER_MODE=$enableval,
86678c4a8e55Smrg      USE_MAINTAINER_MODE=no)
86688c4a8e55Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
86698c4a8e55Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
86708c4a8e55Smrg  MAINT=$MAINTAINER_MODE_TRUE
86718c4a8e55Smrg  AC_SUBST(MAINT)dnl
86728c4a8e55Smrg]
86738c4a8e55Smrg)
86748c4a8e55Smrg
86758c4a8e55SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
86768c4a8e55Smrg
86778c4a8e55Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
86788c4a8e55Smrg
86798c4a8e55Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
86808c4a8e55Smrg#
86818c4a8e55Smrg# This file is free software; the Free Software Foundation
86828c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
86838c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
86848c4a8e55Smrg
86858c4a8e55Smrg# serial 3
86868c4a8e55Smrg
86878c4a8e55Smrg# AM_MAKE_INCLUDE()
86888c4a8e55Smrg# -----------------
86898c4a8e55Smrg# Check to see how make treats includes.
86908c4a8e55SmrgAC_DEFUN([AM_MAKE_INCLUDE],
86918c4a8e55Smrg[am_make=${MAKE-make}
86928c4a8e55Smrgcat > confinc << 'END'
86938c4a8e55Smrgam__doit:
86948c4a8e55Smrg	@echo done
86958c4a8e55Smrg.PHONY: am__doit
86968c4a8e55SmrgEND
86978c4a8e55Smrg# If we don't find an include directive, just comment out the code.
86988c4a8e55SmrgAC_MSG_CHECKING([for style of include used by $am_make])
86998c4a8e55Smrgam__include="#"
87008c4a8e55Smrgam__quote=
87018c4a8e55Smrg_am_result=none
87028c4a8e55Smrg# First try GNU make style include.
87038c4a8e55Smrgecho "include confinc" > confmf
87048c4a8e55Smrg# We grep out `Entering directory' and `Leaving directory'
87058c4a8e55Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
87068c4a8e55Smrg# In particular we don't look at `^make:' because GNU make might
87078c4a8e55Smrg# be invoked under some other name (usually "gmake"), in which
87088c4a8e55Smrg# case it prints its new name instead of `make'.
87098c4a8e55Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
87108c4a8e55Smrg   am__include=include
87118c4a8e55Smrg   am__quote=
87128c4a8e55Smrg   _am_result=GNU
87138c4a8e55Smrgfi
87148c4a8e55Smrg# Now try BSD make style include.
87158c4a8e55Smrgif test "$am__include" = "#"; then
87168c4a8e55Smrg   echo '.include "confinc"' > confmf
87178c4a8e55Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
87188c4a8e55Smrg      am__include=.include
87198c4a8e55Smrg      am__quote="\""
87208c4a8e55Smrg      _am_result=BSD
87218c4a8e55Smrg   fi
87228c4a8e55Smrgfi
87238c4a8e55SmrgAC_SUBST([am__include])
87248c4a8e55SmrgAC_SUBST([am__quote])
87258c4a8e55SmrgAC_MSG_RESULT([$_am_result])
87268c4a8e55Smrgrm -f confinc confmf
87278c4a8e55Smrg])
87288c4a8e55Smrg
87298c4a8e55Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
87308c4a8e55Smrg
87318c4a8e55Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
87328c4a8e55Smrg# Free Software Foundation, Inc.
87338c4a8e55Smrg#
87348c4a8e55Smrg# This file is free software; the Free Software Foundation
87358c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
87368c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
87378c4a8e55Smrg
87388c4a8e55Smrg# serial 5
87398c4a8e55Smrg
87408c4a8e55Smrg# AM_MISSING_PROG(NAME, PROGRAM)
87418c4a8e55Smrg# ------------------------------
87428c4a8e55SmrgAC_DEFUN([AM_MISSING_PROG],
87438c4a8e55Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
87448c4a8e55Smrg$1=${$1-"${am_missing_run}$2"}
87458c4a8e55SmrgAC_SUBST($1)])
87468c4a8e55Smrg
87478c4a8e55Smrg
87488c4a8e55Smrg# AM_MISSING_HAS_RUN
87498c4a8e55Smrg# ------------------
87508c4a8e55Smrg# Define MISSING if not defined so far and test if it supports --run.
87518c4a8e55Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
87528c4a8e55SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
87538c4a8e55Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
87548c4a8e55SmrgAC_REQUIRE_AUX_FILE([missing])dnl
87558c4a8e55Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
87568c4a8e55Smrg# Use eval to expand $SHELL
87578c4a8e55Smrgif eval "$MISSING --run true"; then
87588c4a8e55Smrg  am_missing_run="$MISSING --run "
87598c4a8e55Smrgelse
87608c4a8e55Smrg  am_missing_run=
87618c4a8e55Smrg  AC_MSG_WARN([`missing' script is too old or missing])
87628c4a8e55Smrgfi
87638c4a8e55Smrg])
87648c4a8e55Smrg
87658c4a8e55Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
87668c4a8e55Smrg#
87678c4a8e55Smrg# This file is free software; the Free Software Foundation
87688c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
87698c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
87708c4a8e55Smrg
87718c4a8e55Smrg# AM_PROG_MKDIR_P
87728c4a8e55Smrg# ---------------
87738c4a8e55Smrg# Check for `mkdir -p'.
87748c4a8e55SmrgAC_DEFUN([AM_PROG_MKDIR_P],
87758c4a8e55Smrg[AC_PREREQ([2.60])dnl
87768c4a8e55SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
87778c4a8e55Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
87788c4a8e55Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
87798c4a8e55Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
87808c4a8e55Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
87818c4a8e55Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
87828c4a8e55Smrgdnl adjustment using top_builddir (which is defined more often than
87838c4a8e55Smrgdnl MKDIR_P).
87848c4a8e55SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
87858c4a8e55Smrgcase $mkdir_p in
87868c4a8e55Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
87878c4a8e55Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
87888c4a8e55Smrgesac
87898c4a8e55Smrg])
87908c4a8e55Smrg
87918c4a8e55Smrg# Helper functions for option handling.                     -*- Autoconf -*-
87928c4a8e55Smrg
87938c4a8e55Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
87948c4a8e55Smrg#
87958c4a8e55Smrg# This file is free software; the Free Software Foundation
87968c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
87978c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
87988c4a8e55Smrg
87998c4a8e55Smrg# serial 3
88008c4a8e55Smrg
88018c4a8e55Smrg# _AM_MANGLE_OPTION(NAME)
88028c4a8e55Smrg# -----------------------
88038c4a8e55SmrgAC_DEFUN([_AM_MANGLE_OPTION],
88048c4a8e55Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
88058c4a8e55Smrg
88068c4a8e55Smrg# _AM_SET_OPTION(NAME)
88078c4a8e55Smrg# ------------------------------
88088c4a8e55Smrg# Set option NAME.  Presently that only means defining a flag for this option.
88098c4a8e55SmrgAC_DEFUN([_AM_SET_OPTION],
88108c4a8e55Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
88118c4a8e55Smrg
88128c4a8e55Smrg# _AM_SET_OPTIONS(OPTIONS)
88138c4a8e55Smrg# ----------------------------------
88148c4a8e55Smrg# OPTIONS is a space-separated list of Automake options.
88158c4a8e55SmrgAC_DEFUN([_AM_SET_OPTIONS],
88168c4a8e55Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
88178c4a8e55Smrg
88188c4a8e55Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
88198c4a8e55Smrg# -------------------------------------------
88208c4a8e55Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
88218c4a8e55SmrgAC_DEFUN([_AM_IF_OPTION],
88228c4a8e55Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
88238c4a8e55Smrg
88248c4a8e55Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
88258c4a8e55Smrg
88268c4a8e55Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
88278c4a8e55Smrg# Free Software Foundation, Inc.
88288c4a8e55Smrg#
88298c4a8e55Smrg# This file is free software; the Free Software Foundation
88308c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
88318c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
88328c4a8e55Smrg
88338c4a8e55Smrg# serial 4
88348c4a8e55Smrg
88358c4a8e55Smrg# AM_SANITY_CHECK
88368c4a8e55Smrg# ---------------
88378c4a8e55SmrgAC_DEFUN([AM_SANITY_CHECK],
88388c4a8e55Smrg[AC_MSG_CHECKING([whether build environment is sane])
88398c4a8e55Smrg# Just in case
88408c4a8e55Smrgsleep 1
88418c4a8e55Smrgecho timestamp > conftest.file
88428c4a8e55Smrg# Do `set' in a subshell so we don't clobber the current shell's
88438c4a8e55Smrg# arguments.  Must try -L first in case configure is actually a
88448c4a8e55Smrg# symlink; some systems play weird games with the mod time of symlinks
88458c4a8e55Smrg# (eg FreeBSD returns the mod time of the symlink's containing
88468c4a8e55Smrg# directory).
88478c4a8e55Smrgif (
88488c4a8e55Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
88498c4a8e55Smrg   if test "$[*]" = "X"; then
88508c4a8e55Smrg      # -L didn't work.
88518c4a8e55Smrg      set X `ls -t $srcdir/configure conftest.file`
88528c4a8e55Smrg   fi
88538c4a8e55Smrg   rm -f conftest.file
88548c4a8e55Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
88558c4a8e55Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
88568c4a8e55Smrg
88578c4a8e55Smrg      # If neither matched, then we have a broken ls.  This can happen
88588c4a8e55Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
88598c4a8e55Smrg      # broken ls alias from the environment.  This has actually
88608c4a8e55Smrg      # happened.  Such a system could not be considered "sane".
88618c4a8e55Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
88628c4a8e55Smrgalias in your environment])
88638c4a8e55Smrg   fi
88648c4a8e55Smrg
88658c4a8e55Smrg   test "$[2]" = conftest.file
88668c4a8e55Smrg   )
88678c4a8e55Smrgthen
88688c4a8e55Smrg   # Ok.
88698c4a8e55Smrg   :
88708c4a8e55Smrgelse
88718c4a8e55Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
88728c4a8e55SmrgCheck your system clock])
88738c4a8e55Smrgfi
88748c4a8e55SmrgAC_MSG_RESULT(yes)])
88758c4a8e55Smrg
88768c4a8e55Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
88778c4a8e55Smrg#
88788c4a8e55Smrg# This file is free software; the Free Software Foundation
88798c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
88808c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
88818c4a8e55Smrg
88828c4a8e55Smrg# AM_PROG_INSTALL_STRIP
88838c4a8e55Smrg# ---------------------
88848c4a8e55Smrg# One issue with vendor `install' (even GNU) is that you can't
88858c4a8e55Smrg# specify the program used to strip binaries.  This is especially
88868c4a8e55Smrg# annoying in cross-compiling environments, where the build's strip
88878c4a8e55Smrg# is unlikely to handle the host's binaries.
88888c4a8e55Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
88898c4a8e55Smrg# always use install-sh in `make install-strip', and initialize
88908c4a8e55Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
88918c4a8e55SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
88928c4a8e55Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
88938c4a8e55Smrg# Installed binaries are usually stripped using `strip' when the user
88948c4a8e55Smrg# run `make install-strip'.  However `strip' might not be the right
88958c4a8e55Smrg# tool to use in cross-compilation environments, therefore Automake
88968c4a8e55Smrg# will honor the `STRIP' environment variable to overrule this program.
88978c4a8e55Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
88988c4a8e55Smrgif test "$cross_compiling" != no; then
88998c4a8e55Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
89008c4a8e55Smrgfi
89018c4a8e55SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
89028c4a8e55SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
89038c4a8e55Smrg
89048c4a8e55Smrg# Copyright (C) 2006  Free Software Foundation, Inc.
89058c4a8e55Smrg#
89068c4a8e55Smrg# This file is free software; the Free Software Foundation
89078c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
89088c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
89098c4a8e55Smrg
89108c4a8e55Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
89118c4a8e55Smrg# ---------------------------
89128c4a8e55Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
89138c4a8e55Smrg# This macro is traced by Automake.
89148c4a8e55SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
89158c4a8e55Smrg
89168c4a8e55Smrg# Check how to create a tarball.                            -*- Autoconf -*-
89178c4a8e55Smrg
89188c4a8e55Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
89198c4a8e55Smrg#
89208c4a8e55Smrg# This file is free software; the Free Software Foundation
89218c4a8e55Smrg# gives unlimited permission to copy and/or distribute it,
89228c4a8e55Smrg# with or without modifications, as long as this notice is preserved.
89238c4a8e55Smrg
89248c4a8e55Smrg# serial 2
89258c4a8e55Smrg
89268c4a8e55Smrg# _AM_PROG_TAR(FORMAT)
89278c4a8e55Smrg# --------------------
89288c4a8e55Smrg# Check how to create a tarball in format FORMAT.
89298c4a8e55Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
89308c4a8e55Smrg#
89318c4a8e55Smrg# Substitute a variable $(am__tar) that is a command
89328c4a8e55Smrg# writing to stdout a FORMAT-tarball containing the directory
89338c4a8e55Smrg# $tardir.
89348c4a8e55Smrg#     tardir=directory && $(am__tar) > result.tar
89358c4a8e55Smrg#
89368c4a8e55Smrg# Substitute a variable $(am__untar) that extract such
89378c4a8e55Smrg# a tarball read from stdin.
89388c4a8e55Smrg#     $(am__untar) < result.tar
89398c4a8e55SmrgAC_DEFUN([_AM_PROG_TAR],
89408c4a8e55Smrg[# Always define AMTAR for backward compatibility.
89418c4a8e55SmrgAM_MISSING_PROG([AMTAR], [tar])
89428c4a8e55Smrgm4_if([$1], [v7],
89438c4a8e55Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
89448c4a8e55Smrg     [m4_case([$1], [ustar],, [pax],,
89458c4a8e55Smrg              [m4_fatal([Unknown tar format])])
89468c4a8e55SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
89478c4a8e55Smrg# Loop over all known methods to create a tar archive until one works.
89488c4a8e55Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
89498c4a8e55Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
89508c4a8e55Smrg# Do not fold the above two line into one, because Tru64 sh and
89518c4a8e55Smrg# Solaris sh will not grok spaces in the rhs of `-'.
89528c4a8e55Smrgfor _am_tool in $_am_tools
89538c4a8e55Smrgdo
89548c4a8e55Smrg  case $_am_tool in
89558c4a8e55Smrg  gnutar)
8956b042e37fSmrg    for _am_tar in tar gnutar gtar;
8957b042e37fSmrg    do
8958b042e37fSmrg      AM_RUN_LOG([$_am_tar --version]) && break
8959b042e37fSmrg    done
8960b042e37fSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
8961b042e37fSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
8962b042e37fSmrg    am__untar="$_am_tar -xf -"
8963b042e37fSmrg    ;;
8964b042e37fSmrg  plaintar)
8965b042e37fSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
8966b042e37fSmrg    # ustar tarball either.
8967b042e37fSmrg    (tar --version) >/dev/null 2>&1 && continue
8968b042e37fSmrg    am__tar='tar chf - "$$tardir"'
8969b042e37fSmrg    am__tar_='tar chf - "$tardir"'
8970b042e37fSmrg    am__untar='tar xf -'
8971b042e37fSmrg    ;;
8972b042e37fSmrg  pax)
8973b042e37fSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
8974b042e37fSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
8975b042e37fSmrg    am__untar='pax -r'
8976b042e37fSmrg    ;;
8977b042e37fSmrg  cpio)
8978b042e37fSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
8979b042e37fSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
8980b042e37fSmrg    am__untar='cpio -i -H $1 -d'
8981b042e37fSmrg    ;;
8982b042e37fSmrg  none)
8983b042e37fSmrg    am__tar=false
8984b042e37fSmrg    am__tar_=false
8985b042e37fSmrg    am__untar=false
8986b042e37fSmrg    ;;
8987b042e37fSmrg  esac
8988b042e37fSmrg
89898c4a8e55Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
89908c4a8e55Smrg  # and am__untar set.
89918c4a8e55Smrg  test -n "${am_cv_prog_tar_$1}" && break
89928c4a8e55Smrg
89938c4a8e55Smrg  # tar/untar a dummy directory, and stop if the command works
89948c4a8e55Smrg  rm -rf conftest.dir
89958c4a8e55Smrg  mkdir conftest.dir
89968c4a8e55Smrg  echo GrepMe > conftest.dir/file
89978c4a8e55Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
89988c4a8e55Smrg  rm -rf conftest.dir
89998c4a8e55Smrg  if test -s conftest.tar; then
90008c4a8e55Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
90018c4a8e55Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
90028c4a8e55Smrg  fi
90038c4a8e55Smrgdone
90048c4a8e55Smrgrm -rf conftest.dir
90058c4a8e55Smrg
90068c4a8e55SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
90078c4a8e55SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
90088c4a8e55SmrgAC_SUBST([am__tar])
90098c4a8e55SmrgAC_SUBST([am__untar])
90108c4a8e55Smrg]) # _AM_PROG_TAR
90118c4a8e55Smrg
90128c4a8e55Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
90138c4a8e55Smrgdnl
90148c4a8e55Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
90158c4a8e55Smrgdnl 
90168c4a8e55Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
90178c4a8e55Smrgdnl copy of this software and associated documentation files (the
90188c4a8e55Smrgdnl "Software"), to deal in the Software without restriction, including
90198c4a8e55Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
90208c4a8e55Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
90218c4a8e55Smrgdnl to whom the Software is furnished to do so, provided that the above
90228c4a8e55Smrgdnl copyright notice(s) and this permission notice appear in all copies of
90238c4a8e55Smrgdnl the Software and that both the above copyright notice(s) and this
90248c4a8e55Smrgdnl permission notice appear in supporting documentation.
90258c4a8e55Smrgdnl
90268c4a8e55Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
90278c4a8e55Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
90288c4a8e55Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
90298c4a8e55Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
90308c4a8e55Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
90318c4a8e55Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
90328c4a8e55Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
90338c4a8e55Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
90348c4a8e55Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
90358c4a8e55Smrgdnl
90368c4a8e55Smrgdnl Except as contained in this notice, the name of a copyright holder
90378c4a8e55Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
90388c4a8e55Smrgdnl or other dealings in this Software without prior written authorization
90398c4a8e55Smrgdnl of the copyright holder.
90408c4a8e55Smrg
90418c4a8e55Smrg# XORG_MACROS_VERSION(required-version)
90428c4a8e55Smrg# -------------------------------------
90438c4a8e55Smrg# Minimum version: 1.1.0
90448c4a8e55Smrg#
90458c4a8e55Smrg# If you're using a macro added in Version 1.1 or newer, include this in
90468c4a8e55Smrg# your configure.ac with the minimum required version, such as:
90478c4a8e55Smrg# XORG_MACROS_VERSION(1.1)
90488c4a8e55Smrg#
90498c4a8e55Smrg# To ensure that this macro is defined, also add:
90508c4a8e55Smrg# m4_ifndef([XORG_MACROS_VERSION],
90518c4a8e55Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
90528c4a8e55Smrg#
90538c4a8e55Smrg#
90548c4a8e55Smrg# See the "minimum version" comment for each macro you use to see what 
90558c4a8e55Smrg# version you require.
90568c4a8e55SmrgAC_DEFUN([XORG_MACROS_VERSION],[
90578c4a8e55Smrg	[XORG_MACROS_needed_version=$1
90588c4a8e55Smrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
90598c4a8e55Smrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
90608c4a8e55Smrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
90618c4a8e55Smrg	[XORG_MACROS_version=1.2.1
90628c4a8e55Smrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
90638c4a8e55Smrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
90648c4a8e55Smrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
90658c4a8e55Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_needed_major}.x])
90668c4a8e55Smrg	fi
90678c4a8e55Smrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
90688c4a8e55Smrg		AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}.0 or newer])
90698c4a8e55Smrg	fi
90708c4a8e55Smrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
90718c4a8e55Smrg]) # XORG_MACROS_VERSION
90728c4a8e55Smrg
90738c4a8e55Smrg# XORG_PROG_RAWCPP()
90748c4a8e55Smrg# ------------------
90758c4a8e55Smrg# Minimum version: 1.0.0
90768c4a8e55Smrg#
90778c4a8e55Smrg# Find cpp program and necessary flags for use in pre-processing text files
90788c4a8e55Smrg# such as man pages and config files
90798c4a8e55SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
90808c4a8e55SmrgAC_REQUIRE([AC_PROG_CPP])
90818c4a8e55SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
90828c4a8e55Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
90838c4a8e55Smrg
90848c4a8e55Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
90858c4a8e55Smrg# which is not the best choice for supporting other OS'es, but covers most
90868c4a8e55Smrg# of the ones we need for now.
90878c4a8e55SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
90888c4a8e55SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
90898c4a8e55Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
90908c4a8e55Smrg	AC_MSG_RESULT([no])
90918c4a8e55Smrgelse
90928c4a8e55Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
90938c4a8e55Smrg		RAWCPPFLAGS=-undef
90948c4a8e55Smrg		AC_MSG_RESULT([yes])
90958c4a8e55Smrg	# under Cygwin unix is still defined even with -undef
90968c4a8e55Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
90978c4a8e55Smrg		RAWCPPFLAGS="-undef -ansi"
90988c4a8e55Smrg		AC_MSG_RESULT([yes, with -ansi])
90998c4a8e55Smrg	else
91008c4a8e55Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
91018c4a8e55Smrg	fi
91028c4a8e55Smrgfi
91038c4a8e55Smrgrm -f conftest.$ac_ext
91048c4a8e55Smrg
91058c4a8e55SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
91068c4a8e55SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
91078c4a8e55Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
91088c4a8e55Smrg	AC_MSG_RESULT([no])
91098c4a8e55Smrgelse
91108c4a8e55Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
91118c4a8e55Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
91128c4a8e55Smrg		AC_MSG_RESULT([yes])
91138c4a8e55Smrg	else
91148c4a8e55Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
91158c4a8e55Smrg	fi
91168c4a8e55Smrgfi
91178c4a8e55Smrgrm -f conftest.$ac_ext
91188c4a8e55SmrgAC_SUBST(RAWCPPFLAGS)
91198c4a8e55Smrg]) # XORG_PROG_RAWCPP
91208c4a8e55Smrg
91218c4a8e55Smrg# XORG_MANPAGE_SECTIONS()
91228c4a8e55Smrg# -----------------------
91238c4a8e55Smrg# Minimum version: 1.0.0
91248c4a8e55Smrg#
91258c4a8e55Smrg# Determine which sections man pages go in for the different man page types
91268c4a8e55Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
91278c4a8e55Smrg# Not sure if there's any better way than just hardcoding by OS name.
91288c4a8e55Smrg# Override default settings by setting environment variables
91298c4a8e55Smrg
91308c4a8e55SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
91318c4a8e55SmrgAC_REQUIRE([AC_CANONICAL_HOST])
91328c4a8e55Smrg
91338c4a8e55Smrgif test x$APP_MAN_SUFFIX = x    ; then
91348c4a8e55Smrg    APP_MAN_SUFFIX=1
91358c4a8e55Smrgfi
91368c4a8e55Smrgif test x$APP_MAN_DIR = x    ; then
91378c4a8e55Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
91388c4a8e55Smrgfi
91398c4a8e55Smrg
91408c4a8e55Smrgif test x$LIB_MAN_SUFFIX = x    ; then
91418c4a8e55Smrg    LIB_MAN_SUFFIX=3
91428c4a8e55Smrgfi
91438c4a8e55Smrgif test x$LIB_MAN_DIR = x    ; then
91448c4a8e55Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
91458c4a8e55Smrgfi
91468c4a8e55Smrg
91478c4a8e55Smrgif test x$FILE_MAN_SUFFIX = x    ; then
91488c4a8e55Smrg    case $host_os in
91498c4a8e55Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
91508c4a8e55Smrg	*)		FILE_MAN_SUFFIX=5  ;;
91518c4a8e55Smrg    esac
91528c4a8e55Smrgfi
91538c4a8e55Smrgif test x$FILE_MAN_DIR = x    ; then
91548c4a8e55Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
91558c4a8e55Smrgfi
91568c4a8e55Smrg
91578c4a8e55Smrgif test x$MISC_MAN_SUFFIX = x    ; then
91588c4a8e55Smrg    case $host_os in
91598c4a8e55Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
91608c4a8e55Smrg	*)		MISC_MAN_SUFFIX=7  ;;
91618c4a8e55Smrg    esac
91628c4a8e55Smrgfi
91638c4a8e55Smrgif test x$MISC_MAN_DIR = x    ; then
91648c4a8e55Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
91658c4a8e55Smrgfi
91668c4a8e55Smrg
91678c4a8e55Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
91688c4a8e55Smrg    case $host_os in
91698c4a8e55Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
91708c4a8e55Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
91718c4a8e55Smrg    esac
91728c4a8e55Smrgfi
91738c4a8e55Smrgif test x$DRIVER_MAN_DIR = x    ; then
91748c4a8e55Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
91758c4a8e55Smrgfi
91768c4a8e55Smrg
91778c4a8e55Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
91788c4a8e55Smrg    case $host_os in
91798c4a8e55Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
91808c4a8e55Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
91818c4a8e55Smrg    esac
91828c4a8e55Smrgfi
91838c4a8e55Smrgif test x$ADMIN_MAN_DIR = x    ; then
91848c4a8e55Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
91858c4a8e55Smrgfi
91868c4a8e55Smrg
91878c4a8e55Smrg
91888c4a8e55SmrgAC_SUBST([APP_MAN_SUFFIX])
91898c4a8e55SmrgAC_SUBST([LIB_MAN_SUFFIX])
91908c4a8e55SmrgAC_SUBST([FILE_MAN_SUFFIX])
91918c4a8e55SmrgAC_SUBST([MISC_MAN_SUFFIX])
91928c4a8e55SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
91938c4a8e55SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
91948c4a8e55SmrgAC_SUBST([APP_MAN_DIR])
91958c4a8e55SmrgAC_SUBST([LIB_MAN_DIR])
91968c4a8e55SmrgAC_SUBST([FILE_MAN_DIR])
91978c4a8e55SmrgAC_SUBST([MISC_MAN_DIR])
91988c4a8e55SmrgAC_SUBST([DRIVER_MAN_DIR])
91998c4a8e55SmrgAC_SUBST([ADMIN_MAN_DIR])
92008c4a8e55Smrg]) # XORG_MANPAGE_SECTIONS
92018c4a8e55Smrg
92028c4a8e55Smrg# XORG_CHECK_LINUXDOC
92038c4a8e55Smrg# -------------------
92048c4a8e55Smrg# Minimum version: 1.0.0
92058c4a8e55Smrg#
92068c4a8e55Smrg# Defines the variable MAKE_TEXT if the necessary tools and
92078c4a8e55Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
92088c4a8e55Smrg# Whether or not the necessary tools and files are found can be checked
92098c4a8e55Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
92108c4a8e55SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
92118c4a8e55Smrgif test x$XORG_SGML_PATH = x ; then
92128c4a8e55Smrg    XORG_SGML_PATH=$prefix/share/sgml
92138c4a8e55Smrgfi
92148c4a8e55SmrgHAVE_DEFS_ENT=
92158c4a8e55Smrg
92168c4a8e55Smrgif test x"$cross_compiling" = x"yes" ; then
92178c4a8e55Smrg  HAVE_DEFS_ENT=no
92188c4a8e55Smrgelse
92198c4a8e55Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
92208c4a8e55Smrgfi
92218c4a8e55Smrg
92228c4a8e55SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
92238c4a8e55SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
92248c4a8e55Smrg
92258c4a8e55SmrgAC_MSG_CHECKING([Whether to build documentation])
92268c4a8e55Smrg
92278c4a8e55Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
92288c4a8e55Smrg   BUILDDOC=yes
92298c4a8e55Smrgelse
92308c4a8e55Smrg   BUILDDOC=no
92318c4a8e55Smrgfi
92328c4a8e55Smrg
92338c4a8e55SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
92348c4a8e55Smrg
92358c4a8e55SmrgAC_MSG_RESULT([$BUILDDOC])
92368c4a8e55Smrg
92378c4a8e55SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
92388c4a8e55Smrg
92398c4a8e55Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
92408c4a8e55Smrg   BUILDPDFDOC=yes
92418c4a8e55Smrgelse
92428c4a8e55Smrg   BUILDPDFDOC=no
92438c4a8e55Smrgfi
92448c4a8e55Smrg
92458c4a8e55SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
92468c4a8e55Smrg
92478c4a8e55SmrgAC_MSG_RESULT([$BUILDPDFDOC])
92488c4a8e55Smrg
92498c4a8e55SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
92508c4a8e55SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
92518c4a8e55SmrgMAKE_PDF="$PS2PDF"
92528c4a8e55SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
92538c4a8e55Smrg
92548c4a8e55SmrgAC_SUBST(MAKE_TEXT)
92558c4a8e55SmrgAC_SUBST(MAKE_PS)
92568c4a8e55SmrgAC_SUBST(MAKE_PDF)
92578c4a8e55SmrgAC_SUBST(MAKE_HTML)
92588c4a8e55Smrg]) # XORG_CHECK_LINUXDOC
92598c4a8e55Smrg
92608c4a8e55Smrg# XORG_CHECK_DOCBOOK
92618c4a8e55Smrg# -------------------
92628c4a8e55Smrg# Minimum version: 1.0.0
92638c4a8e55Smrg#
92648c4a8e55Smrg# Checks for the ability to build output formats from SGML DocBook source.
92658c4a8e55Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
92668c4a8e55Smrg# indicates whether the necessary tools and files are found and, if set,
92678c4a8e55Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
92688c4a8e55SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
92698c4a8e55Smrgif test x$XORG_SGML_PATH = x ; then
92708c4a8e55Smrg    XORG_SGML_PATH=$prefix/share/sgml
92718c4a8e55Smrgfi
92728c4a8e55SmrgHAVE_DEFS_ENT=
92738c4a8e55SmrgBUILDTXTDOC=no
92748c4a8e55SmrgBUILDPDFDOC=no
92758c4a8e55SmrgBUILDPSDOC=no
92768c4a8e55SmrgBUILDHTMLDOC=no
92778c4a8e55Smrg
92788c4a8e55SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
92798c4a8e55Smrg
92808c4a8e55SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
92818c4a8e55SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
92828c4a8e55SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
92838c4a8e55SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
92848c4a8e55Smrg
92858c4a8e55SmrgAC_MSG_CHECKING([Whether to build text documentation])
92868c4a8e55Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
92878c4a8e55Smrg   test x$BUILD_TXTDOC != xno; then
92888c4a8e55Smrg	BUILDTXTDOC=yes
92898c4a8e55Smrgfi
92908c4a8e55SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
92918c4a8e55SmrgAC_MSG_RESULT([$BUILDTXTDOC])
9292b042e37fSmrg
92938c4a8e55SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
92948c4a8e55Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
92958c4a8e55Smrg   test x$BUILD_PDFDOC != xno; then
92968c4a8e55Smrg	BUILDPDFDOC=yes
92978c4a8e55Smrgfi
92988c4a8e55SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
92998c4a8e55SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9300b042e37fSmrg
93018c4a8e55SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
93028c4a8e55Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
93038c4a8e55Smrg   test x$BUILD_PSDOC != xno; then
93048c4a8e55Smrg	BUILDPSDOC=yes
93058c4a8e55Smrgfi
93068c4a8e55SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
93078c4a8e55SmrgAC_MSG_RESULT([$BUILDPSDOC])
93088c4a8e55Smrg
93098c4a8e55SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
93108c4a8e55Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
93118c4a8e55Smrg   test x$BUILD_HTMLDOC != xno; then
93128c4a8e55Smrg	BUILDHTMLDOC=yes
93138c4a8e55Smrgfi
93148c4a8e55SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
93158c4a8e55SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
93168c4a8e55Smrg
93178c4a8e55SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
93188c4a8e55SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
93198c4a8e55SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
93208c4a8e55SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
93218c4a8e55Smrg
93228c4a8e55SmrgAC_SUBST(MAKE_TEXT)
93238c4a8e55SmrgAC_SUBST(MAKE_PS)
93248c4a8e55SmrgAC_SUBST(MAKE_PDF)
93258c4a8e55SmrgAC_SUBST(MAKE_HTML)
93268c4a8e55Smrg]) # XORG_CHECK_DOCBOOK
93278c4a8e55Smrg
93288c4a8e55Smrg# XORG_CHECK_MALLOC_ZERO
93298c4a8e55Smrg# ----------------------
93308c4a8e55Smrg# Minimum version: 1.0.0
93318c4a8e55Smrg#
93328c4a8e55Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
93338c4a8e55Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
93348c4a8e55Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
93358c4a8e55SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
93368c4a8e55SmrgAC_ARG_ENABLE(malloc0returnsnull,
93378c4a8e55Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
93388c4a8e55Smrg		       [malloc(0) returns NULL (default: auto)]),
93398c4a8e55Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
93408c4a8e55Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
93418c4a8e55Smrg
93428c4a8e55SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
93438c4a8e55Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
93448c4a8e55Smrg	AC_RUN_IFELSE([
93458c4a8e55Smrgchar *malloc();
93468c4a8e55Smrgchar *realloc();
93478c4a8e55Smrgchar *calloc();
93488c4a8e55Smrgmain() {
93498c4a8e55Smrg    char *m0, *r0, *c0, *p;
93508c4a8e55Smrg    m0 = malloc(0);
93518c4a8e55Smrg    p = malloc(10);
93528c4a8e55Smrg    r0 = realloc(p,0);
93538c4a8e55Smrg    c0 = calloc(0);
93548c4a8e55Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
93558c4a8e55Smrg}],
93568c4a8e55Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
93578c4a8e55Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
93588c4a8e55Smrgfi
93598c4a8e55SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
93608c4a8e55Smrg
93618c4a8e55Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
93628c4a8e55Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
93638c4a8e55Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
93648c4a8e55Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
93658c4a8e55Smrgelse
93668c4a8e55Smrg	MALLOC_ZERO_CFLAGS=""
93678c4a8e55Smrg	XMALLOC_ZERO_CFLAGS=""
93688c4a8e55Smrg	XTMALLOC_ZERO_CFLAGS=""
93698c4a8e55Smrgfi
93708c4a8e55Smrg
93718c4a8e55SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
93728c4a8e55SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
93738c4a8e55SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
93748c4a8e55Smrg]) # XORG_CHECK_MALLOC_ZERO
93758c4a8e55Smrg
93768c4a8e55Smrg# XORG_WITH_LINT()
93778c4a8e55Smrg# ----------------
93788c4a8e55Smrg# Minimum version: 1.1.0
93798c4a8e55Smrg#
93808c4a8e55Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
93818c4a8e55Smrg# is specified.   (Use --with-lint=sparse for sparse.)
93828c4a8e55Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
93838c4a8e55Smrg# Sets $LINT_FLAGS to flags to pass to source checker
93848c4a8e55Smrg# Sets LINT automake conditional if enabled (default: disabled)
93858c4a8e55Smrg#
93868c4a8e55SmrgAC_DEFUN([XORG_WITH_LINT],[
93878c4a8e55Smrg
93888c4a8e55Smrg# Allow checking code with lint, sparse, etc.
93898c4a8e55SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
93908c4a8e55Smrg		[Use a lint-style source code checker (default: disabled)])],
93918c4a8e55Smrg		[use_lint=$withval], [use_lint=no])
93928c4a8e55Smrgif test "x$use_lint" = "xyes" ; then
93938c4a8e55Smrg	LINT="lint"
93948c4a8e55Smrgelse
93958c4a8e55Smrg	LINT="$use_lint"
93968c4a8e55Smrgfi
93978c4a8e55Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
93988c4a8e55Smrg    case $LINT in
93998c4a8e55Smrg	lint|*/lint)
94008c4a8e55Smrg	    case $host_os in
94018c4a8e55Smrg		solaris*)
94028c4a8e55Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
94038c4a8e55Smrg			;;
94048c4a8e55Smrg	    esac
94058c4a8e55Smrg	    ;;
94068c4a8e55Smrg    esac
94078c4a8e55Smrgfi
94088c4a8e55Smrg
94098c4a8e55SmrgAC_SUBST(LINT)
94108c4a8e55SmrgAC_SUBST(LINT_FLAGS)
94118c4a8e55SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
94128c4a8e55Smrg
94138c4a8e55Smrg]) # XORG_WITH_LINT
94148c4a8e55Smrg
94158c4a8e55Smrg# XORG_LINT_LIBRARY(LIBNAME)
94168c4a8e55Smrg# --------------------------
94178c4a8e55Smrg# Minimum version: 1.1.0
94188c4a8e55Smrg#
94198c4a8e55Smrg# Sets up flags for building lint libraries for checking programs that call
94208c4a8e55Smrg# functions in the library.
94218c4a8e55Smrg# Disabled by default, enable with --enable-lint-library
94228c4a8e55Smrg# Sets: 
94238c4a8e55Smrg#	@LINTLIB@		- name of lint library file to make
94248c4a8e55Smrg#	MAKE_LINT_LIB		- automake conditional
94258c4a8e55Smrg#
94268c4a8e55Smrg
94278c4a8e55SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
94288c4a8e55SmrgAC_REQUIRE([XORG_WITH_LINT])
94298c4a8e55Smrg# Build lint "library" for more indepth checks of programs calling this library
94308c4a8e55SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
94318c4a8e55Smrg	[Create lint library (default: disabled)])],
94328c4a8e55Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
94338c4a8e55Smrgif test "x$make_lint_lib" != "xno" ; then
94348c4a8e55Smrg	if test "x$LINT" = "xno" ; then
94358c4a8e55Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
94368c4a8e55Smrg	fi
94378c4a8e55Smrg	if test "x$make_lint_lib" = "xyes" ; then
94388c4a8e55Smrg		LINTLIB=llib-l$1.ln
94398c4a8e55Smrg	else
94408c4a8e55Smrg		LINTLIB=$make_lint_lib
94418c4a8e55Smrg	fi
94428c4a8e55Smrgfi
94438c4a8e55SmrgAC_SUBST(LINTLIB)
94448c4a8e55SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
94458c4a8e55Smrg
94468c4a8e55Smrg]) # XORG_LINT_LIBRARY
94478c4a8e55Smrg
94488c4a8e55Smrg# XORG_CWARNFLAGS
94498c4a8e55Smrg# ---------------
94508c4a8e55Smrg# Minimum version: 1.2.0
94518c4a8e55Smrg#
94528c4a8e55Smrg# Defines CWARNFLAGS to enable C compiler warnings.
94538c4a8e55Smrg#
94548c4a8e55SmrgAC_DEFUN([XORG_CWARNFLAGS], [
94558c4a8e55SmrgAC_REQUIRE([AC_PROG_CC])
94568c4a8e55Smrgif  test "x$GCC" = xyes ; then
94578c4a8e55Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
94588c4a8e55Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
94598c4a8e55Smrg-Wbad-function-cast"
94608c4a8e55Smrg    case `gcc -dumpversion` in
94618c4a8e55Smrg    3.4.* | 4.*)
94628c4a8e55Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
94638c4a8e55Smrg	;;
94648c4a8e55Smrg    esac
94658c4a8e55Smrgelse
94668c4a8e55Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
94678c4a8e55Smrg    if test "x$SUNCC" = "xyes"; then
94688c4a8e55Smrg	CWARNFLAGS="-v"
94698c4a8e55Smrg    fi
94708c4a8e55Smrgfi
94718c4a8e55SmrgAC_SUBST(CWARNFLAGS)
94728c4a8e55Smrg]) # XORG_CWARNFLAGS
94738c4a8e55Smrgdnl Copyright 2005 Red Hat, Inc
94748c4a8e55Smrgdnl
94758c4a8e55Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
94768c4a8e55Smrgdnl documentation for any purpose is hereby granted without fee, provided that
94778c4a8e55Smrgdnl the above copyright notice appear in all copies and that both that
94788c4a8e55Smrgdnl copyright notice and this permission notice appear in supporting
94798c4a8e55Smrgdnl documentation.
94808c4a8e55Smrgdnl
94818c4a8e55Smrgdnl The above copyright notice and this permission notice shall be included
94828c4a8e55Smrgdnl in all copies or substantial portions of the Software.
94838c4a8e55Smrgdnl
94848c4a8e55Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
94858c4a8e55Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
94868c4a8e55Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
94878c4a8e55Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
94888c4a8e55Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
94898c4a8e55Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
94908c4a8e55Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
94918c4a8e55Smrgdnl
94928c4a8e55Smrgdnl Except as contained in this notice, the name of the copyright holders shall
94938c4a8e55Smrgdnl not be used in advertising or otherwise to promote the sale, use or
94948c4a8e55Smrgdnl other dealings in this Software without prior written authorization
94958c4a8e55Smrgdnl from the copyright holders.
94968c4a8e55Smrgdnl
94978c4a8e55Smrg
94988c4a8e55Smrg# XORG_RELEASE_VERSION
94998c4a8e55Smrg# --------------------
95008c4a8e55Smrg# Adds --with/without-release-string and changes the PACKAGE and
95018c4a8e55Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
95028c4a8e55Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
95038c4a8e55Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
95048c4a8e55Smrg 
95058c4a8e55SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
95068c4a8e55Smrg	AC_ARG_WITH(release-version,
95078c4a8e55Smrg			AC_HELP_STRING([--with-release-version=STRING],
95088c4a8e55Smrg				[Use release version string in package name]),
95098c4a8e55Smrg			[RELEASE_VERSION="$withval"],
95108c4a8e55Smrg			[RELEASE_VERSION=""])
95118c4a8e55Smrg	if test "x$RELEASE_VERSION" != "x"; then
95128c4a8e55Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
95138c4a8e55Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
95148c4a8e55Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
95158c4a8e55Smrg	fi
95168c4a8e55Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
95178c4a8e55Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
95188c4a8e55Smrg		[Major version of this package])
95198c4a8e55Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
95208c4a8e55Smrg	if test "x$PVM" = "x"; then
95218c4a8e55Smrg		PVM="0"
95228c4a8e55Smrg	fi
95238c4a8e55Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
95248c4a8e55Smrg		[$PVM],
95258c4a8e55Smrg		[Minor version of this package])
95268c4a8e55Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
95278c4a8e55Smrg	if test "x$PVP" = "x"; then
95288c4a8e55Smrg		PVP="0"
95298c4a8e55Smrg	fi
95308c4a8e55Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
95318c4a8e55Smrg		[$PVP],
95328c4a8e55Smrg		[Patch version of this package])
95338c4a8e55Smrg])
95348c4a8e55Smrg
95358c4a8e55Smrg# XORG_CHANGELOG()
95368c4a8e55Smrg# ----------------
95378c4a8e55Smrg# Minimum version: 1.2.0
95388c4a8e55Smrg#
95398c4a8e55Smrg# Defines the variable CHANGELOG_CMD as the command to generate
95408c4a8e55Smrg# ChangeLog from git.
95418c4a8e55Smrg#
95428c4a8e55Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
95438c4a8e55Smrg#
95448c4a8e55SmrgAC_DEFUN([XORG_CHANGELOG], [
95458c4a8e55SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
95468c4a8e55Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
95478c4a8e55Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
95488c4a8e55SmrgAC_SUBST([CHANGELOG_CMD])
95498c4a8e55SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
95508c4a8e55Smrg]) # XORG_CHANGELOG
9551b042e37fSmrg
9552