aclocal.m4 revision 38770048
138770048Smrg# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
2ab47cfaaSmrg
3ab47cfaaSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4aa9e3350Smrg# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
5aa9e3350Smrg# Inc.
6ab47cfaaSmrg# This file is free software; the Free Software Foundation
7ab47cfaaSmrg# gives unlimited permission to copy and/or distribute it,
8ab47cfaaSmrg# with or without modifications, as long as this notice is preserved.
9ab47cfaaSmrg
10ab47cfaaSmrg# This program is distributed in the hope that it will be useful,
11ab47cfaaSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12ab47cfaaSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13ab47cfaaSmrg# PARTICULAR PURPOSE.
14ab47cfaaSmrg
158697ee19Smrgm4_ifndef([AC_AUTOCONF_VERSION],
168697ee19Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1738770048Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
1838770048Smrg[m4_warning([this file was generated for autoconf 2.69.
198697ee19SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
208697ee19SmrgIf you have problems, you may need to regenerate the build system entirely.
218697ee19SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
228697ee19Smrg
23ab47cfaaSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
246aec45a7Smrg#
256aec45a7Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
26aa9e3350Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
27aa9e3350Smrg#                 Foundation, Inc.
286aec45a7Smrg#   Written by Gordon Matzigkeit, 1996
296aec45a7Smrg#
306aec45a7Smrg# This file is free software; the Free Software Foundation gives
316aec45a7Smrg# unlimited permission to copy and/or distribute it, with or without
326aec45a7Smrg# modifications, as long as this notice is preserved.
336aec45a7Smrg
346aec45a7Smrgm4_define([_LT_COPYING], [dnl
356aec45a7Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
36aa9e3350Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
37aa9e3350Smrg#                 Foundation, Inc.
386aec45a7Smrg#   Written by Gordon Matzigkeit, 1996
396aec45a7Smrg#
406aec45a7Smrg#   This file is part of GNU Libtool.
416aec45a7Smrg#
426aec45a7Smrg# GNU Libtool is free software; you can redistribute it and/or
436aec45a7Smrg# modify it under the terms of the GNU General Public License as
446aec45a7Smrg# published by the Free Software Foundation; either version 2 of
456aec45a7Smrg# the License, or (at your option) any later version.
466aec45a7Smrg#
476aec45a7Smrg# As a special exception to the GNU General Public License,
486aec45a7Smrg# if you distribute this file as part of a program or library that
496aec45a7Smrg# is built using GNU Libtool, you may include this file under the
506aec45a7Smrg# same distribution terms that you use for the rest of that program.
516aec45a7Smrg#
526aec45a7Smrg# GNU Libtool is distributed in the hope that it will be useful,
536aec45a7Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
546aec45a7Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
556aec45a7Smrg# GNU General Public License for more details.
566aec45a7Smrg#
576aec45a7Smrg# You should have received a copy of the GNU General Public License
586aec45a7Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
596aec45a7Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
606aec45a7Smrg# obtained by writing to the Free Software Foundation, Inc.,
616aec45a7Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
626aec45a7Smrg])
63ab47cfaaSmrg
646aec45a7Smrg# serial 57 LT_INIT
65ab47cfaaSmrg
66ab47cfaaSmrg
676aec45a7Smrg# LT_PREREQ(VERSION)
686aec45a7Smrg# ------------------
696aec45a7Smrg# Complain and exit if this libtool version is less that VERSION.
706aec45a7Smrgm4_defun([LT_PREREQ],
716aec45a7Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
726aec45a7Smrg       [m4_default([$3],
736aec45a7Smrg		   [m4_fatal([Libtool version $1 or higher is required],
746aec45a7Smrg		             63)])],
756aec45a7Smrg       [$2])])
761473d951Smrg
771473d951Smrg
786aec45a7Smrg# _LT_CHECK_BUILDDIR
796aec45a7Smrg# ------------------
806aec45a7Smrg# Complain if the absolute build directory name contains unusual characters
816aec45a7Smrgm4_defun([_LT_CHECK_BUILDDIR],
826aec45a7Smrg[case `pwd` in
836aec45a7Smrg  *\ * | *\	*)
846aec45a7Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
856aec45a7Smrgesac
866aec45a7Smrg])
876aec45a7Smrg
886aec45a7Smrg
896aec45a7Smrg# LT_INIT([OPTIONS])
906aec45a7Smrg# ------------------
916aec45a7SmrgAC_DEFUN([LT_INIT],
926aec45a7Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
936aec45a7SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
946aec45a7SmrgAC_BEFORE([$0], [LT_LANG])dnl
956aec45a7SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
966aec45a7SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
976aec45a7Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
986aec45a7Smrg
996aec45a7Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
1006aec45a7Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
1016aec45a7Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
1026aec45a7Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
1036aec45a7Smrgdnl unless we require an AC_DEFUNed macro:
1046aec45a7SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
1056aec45a7SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
1066aec45a7SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
1076aec45a7SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
1086aec45a7Smrgm4_require([_LT_PROG_LTMAIN])dnl
1096aec45a7Smrg
1106aec45a7Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1116aec45a7Smrg
1126aec45a7Smrgdnl Parse OPTIONS
1136aec45a7Smrg_LT_SET_OPTIONS([$0], [$1])
114ab47cfaaSmrg
115ab47cfaaSmrg# This can be used to rebuild libtool when needed
1166aec45a7SmrgLIBTOOL_DEPS="$ltmain"
117ab47cfaaSmrg
118ab47cfaaSmrg# Always use our own libtool.
119ab47cfaaSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
120ab47cfaaSmrgAC_SUBST(LIBTOOL)dnl
121ab47cfaaSmrg
1226aec45a7Smrg_LT_SETUP
1231473d951Smrg
1246aec45a7Smrg# Only expand once:
1256aec45a7Smrgm4_define([LT_INIT])
1266aec45a7Smrg])# LT_INIT
1271473d951Smrg
1286aec45a7Smrg# Old names:
1296aec45a7SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1306aec45a7SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1316aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
1326aec45a7Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1336aec45a7Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1346aec45a7Smrg
1356aec45a7Smrg
1366aec45a7Smrg# _LT_CC_BASENAME(CC)
1376aec45a7Smrg# -------------------
1386aec45a7Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1396aec45a7Smrgm4_defun([_LT_CC_BASENAME],
1406aec45a7Smrg[for cc_temp in $1""; do
1416aec45a7Smrg  case $cc_temp in
1426aec45a7Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1436aec45a7Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1446aec45a7Smrg    \-*) ;;
1456aec45a7Smrg    *) break;;
1466aec45a7Smrg  esac
1476aec45a7Smrgdone
1486aec45a7Smrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
1496aec45a7Smrg])
1506aec45a7Smrg
1516aec45a7Smrg
1526aec45a7Smrg# _LT_FILEUTILS_DEFAULTS
1536aec45a7Smrg# ----------------------
1546aec45a7Smrg# It is okay to use these file commands and assume they have been set
1556aec45a7Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
1566aec45a7Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
1576aec45a7Smrg[: ${CP="cp -f"}
1586aec45a7Smrg: ${MV="mv -f"}
1596aec45a7Smrg: ${RM="rm -f"}
1606aec45a7Smrg])# _LT_FILEUTILS_DEFAULTS
1616aec45a7Smrg
1626aec45a7Smrg
1636aec45a7Smrg# _LT_SETUP
1646aec45a7Smrg# ---------
1656aec45a7Smrgm4_defun([_LT_SETUP],
1666aec45a7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
167ab47cfaaSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
1686aec45a7SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1696aec45a7SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1705c42550eSmrg
171aa9e3350Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
172aa9e3350Smrgdnl
1736aec45a7Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
1746aec45a7Smrg_LT_DECL([], [host], [0])dnl
1756aec45a7Smrg_LT_DECL([], [host_os], [0])dnl
1766aec45a7Smrgdnl
1776aec45a7Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
1786aec45a7Smrg_LT_DECL([], [build], [0])dnl
1796aec45a7Smrg_LT_DECL([], [build_os], [0])dnl
1806aec45a7Smrgdnl
1816aec45a7SmrgAC_REQUIRE([AC_PROG_CC])dnl
1826aec45a7SmrgAC_REQUIRE([LT_PATH_LD])dnl
1836aec45a7SmrgAC_REQUIRE([LT_PATH_NM])dnl
1846aec45a7Smrgdnl
185ab47cfaaSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
1866aec45a7Smrgtest -z "$LN_S" && LN_S="ln -s"
1876aec45a7Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1886aec45a7Smrgdnl
1896aec45a7SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
1906aec45a7Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
1916aec45a7Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1921473d951Smrgdnl
1936aec45a7Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1946aec45a7Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
195aa9e3350Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
1966aec45a7Smrgm4_require([_LT_CMD_RELOAD])dnl
1976aec45a7Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
198aa9e3350Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
1996aec45a7Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
2006aec45a7Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
201aa9e3350Smrgm4_require([_LT_WITH_SYSROOT])dnl
2026aec45a7Smrg
2036aec45a7Smrg_LT_CONFIG_LIBTOOL_INIT([
2046aec45a7Smrg# See if we are running on zsh, and set the options which allow our
2056aec45a7Smrg# commands through without removal of \ escapes INIT.
2066aec45a7Smrgif test -n "\${ZSH_VERSION+set}" ; then
2076aec45a7Smrg   setopt NO_GLOB_SUBST
2086aec45a7Smrgfi
2096aec45a7Smrg])
2106aec45a7Smrgif test -n "${ZSH_VERSION+set}" ; then
2116aec45a7Smrg   setopt NO_GLOB_SUBST
2126aec45a7Smrgfi
2136aec45a7Smrg
2146aec45a7Smrg_LT_CHECK_OBJDIR
215ab47cfaaSmrg
2166aec45a7Smrgm4_require([_LT_TAG_COMPILER])dnl
217ab47cfaaSmrg
218ab47cfaaSmrgcase $host_os in
219ab47cfaaSmrgaix3*)
220ab47cfaaSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
221ab47cfaaSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
222ab47cfaaSmrg  # vanish in a puff of smoke.
223ab47cfaaSmrg  if test "X${COLLECT_NAMES+set}" != Xset; then
224ab47cfaaSmrg    COLLECT_NAMES=
225ab47cfaaSmrg    export COLLECT_NAMES
226ab47cfaaSmrg  fi
227ab47cfaaSmrg  ;;
228ab47cfaaSmrgesac
229ab47cfaaSmrg
230ab47cfaaSmrg# Global variables:
2316aec45a7Smrgofile=libtool
232ab47cfaaSmrgcan_build_shared=yes
233ab47cfaaSmrg
234ab47cfaaSmrg# All known linkers require a `.a' archive for static linking (except MSVC,
235ab47cfaaSmrg# which needs '.lib').
236ab47cfaaSmrglibext=a
237ab47cfaaSmrg
2386aec45a7Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
2395c42550eSmrg
240ab47cfaaSmrgold_CC="$CC"
241ab47cfaaSmrgold_CFLAGS="$CFLAGS"
242ab47cfaaSmrg
243ab47cfaaSmrg# Set sane defaults for various variables
244ab47cfaaSmrgtest -z "$CC" && CC=cc
245ab47cfaaSmrgtest -z "$LTCC" && LTCC=$CC
246ab47cfaaSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
247ab47cfaaSmrgtest -z "$LD" && LD=ld
248ab47cfaaSmrgtest -z "$ac_objext" && ac_objext=o
249ab47cfaaSmrg
250ab47cfaaSmrg_LT_CC_BASENAME([$compiler])
251ab47cfaaSmrg
252ab47cfaaSmrg# Only perform the check for file, if the check method requires it
2536aec45a7Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
254ab47cfaaSmrgcase $deplibs_check_method in
255ab47cfaaSmrgfile_magic*)
256ab47cfaaSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
2576aec45a7Smrg    _LT_PATH_MAGIC
258ab47cfaaSmrg  fi
259ab47cfaaSmrg  ;;
260ab47cfaaSmrgesac
261ab47cfaaSmrg
2626aec45a7Smrg# Use C for the default configuration in the libtool script
2636aec45a7SmrgLT_SUPPORTED_TAG([CC])
2646aec45a7Smrg_LT_LANG_C_CONFIG
2656aec45a7Smrg_LT_LANG_DEFAULT_CONFIG
2666aec45a7Smrg_LT_CONFIG_COMMANDS
2676aec45a7Smrg])# _LT_SETUP
2681473d951Smrg
2691473d951Smrg
2706aec45a7Smrg# _LT_PREPARE_SED_QUOTE_VARS
2716aec45a7Smrg# --------------------------
2726aec45a7Smrg# Define a few sed substitution that help us do robust quoting.
2736aec45a7Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
2746aec45a7Smrg[# Backslashify metacharacters that are still active within
2756aec45a7Smrg# double-quoted strings.
2766aec45a7Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
2771473d951Smrg
2786aec45a7Smrg# Same as above, but do not quote variable references.
2796aec45a7Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
2801473d951Smrg
2816aec45a7Smrg# Sed substitution to delay expansion of an escaped shell variable in a
2826aec45a7Smrg# double_quote_subst'ed string.
2836aec45a7Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
2841473d951Smrg
2856aec45a7Smrg# Sed substitution to delay expansion of an escaped single quote.
2866aec45a7Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
2871473d951Smrg
2886aec45a7Smrg# Sed substitution to avoid accidental globbing in evaled expressions
2896aec45a7Smrgno_glob_subst='s/\*/\\\*/g'
2906aec45a7Smrg])
291ab47cfaaSmrg
2926aec45a7Smrg# _LT_PROG_LTMAIN
2936aec45a7Smrg# ---------------
2946aec45a7Smrg# Note that this code is called both from `configure', and `config.status'
2956aec45a7Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
2966aec45a7Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
2976aec45a7Smrg# so we pass a copy along to make sure it has a sensible value anyway.
2986aec45a7Smrgm4_defun([_LT_PROG_LTMAIN],
2996aec45a7Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
3006aec45a7Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
3016aec45a7Smrgltmain="$ac_aux_dir/ltmain.sh"
3026aec45a7Smrg])# _LT_PROG_LTMAIN
303ab47cfaaSmrg
304ab47cfaaSmrg
3055c42550eSmrg
3066aec45a7Smrg# So that we can recreate a full libtool script including additional
3076aec45a7Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
3086aec45a7Smrg# in macros and then make a single call at the end using the `libtool'
3096aec45a7Smrg# label.
3105c42550eSmrg
311ab47cfaaSmrg
3126aec45a7Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
3136aec45a7Smrg# ----------------------------------------
3146aec45a7Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3156aec45a7Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
3166aec45a7Smrg[m4_ifval([$1],
3176aec45a7Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
3186aec45a7Smrg                     [$1
3196aec45a7Smrg])])])
320ab47cfaaSmrg
3216aec45a7Smrg# Initialize.
3226aec45a7Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
323ab47cfaaSmrg
324ab47cfaaSmrg
3256aec45a7Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
3266aec45a7Smrg# ------------------------------
3276aec45a7Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3286aec45a7Smrgm4_define([_LT_CONFIG_LIBTOOL],
3296aec45a7Smrg[m4_ifval([$1],
3306aec45a7Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
3316aec45a7Smrg                     [$1
3326aec45a7Smrg])])])
3336aec45a7Smrg
3346aec45a7Smrg# Initialize.
3356aec45a7Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
3366aec45a7Smrg
3376aec45a7Smrg
3386aec45a7Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
3396aec45a7Smrg# -----------------------------------------------------
3406aec45a7Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
3416aec45a7Smrg[_LT_CONFIG_LIBTOOL([$1])
3426aec45a7Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
3436aec45a7Smrg])
344ab47cfaaSmrg
3451473d951Smrg
3466aec45a7Smrg# _LT_FORMAT_COMMENT([COMMENT])
3476aec45a7Smrg# -----------------------------
3486aec45a7Smrg# Add leading comment marks to the start of each line, and a trailing
3496aec45a7Smrg# full-stop to the whole comment if one is not present already.
3506aec45a7Smrgm4_define([_LT_FORMAT_COMMENT],
3516aec45a7Smrg[m4_ifval([$1], [
3526aec45a7Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
3536aec45a7Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
3546aec45a7Smrg)])
3556aec45a7Smrg
3566aec45a7Smrg
3576aec45a7Smrg
3586aec45a7Smrg
3596aec45a7Smrg
3606aec45a7Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
3616aec45a7Smrg# -------------------------------------------------------------------
3626aec45a7Smrg# CONFIGNAME is the name given to the value in the libtool script.
3636aec45a7Smrg# VARNAME is the (base) name used in the configure script.
3646aec45a7Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
3656aec45a7Smrg# VARNAME.  Any other value will be used directly.
3666aec45a7Smrgm4_define([_LT_DECL],
3676aec45a7Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
3686aec45a7Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
3696aec45a7Smrg	[m4_ifval([$1], [$1], [$2])])
3706aec45a7Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
3716aec45a7Smrg    m4_ifval([$4],
3726aec45a7Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
3736aec45a7Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
3746aec45a7Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
3751473d951Smrg])
3761473d951Smrg
377ab47cfaaSmrg
3786aec45a7Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
3796aec45a7Smrg# --------------------------------------------------------
3806aec45a7Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
381ab47cfaaSmrg
382ab47cfaaSmrg
3836aec45a7Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
3846aec45a7Smrg# ------------------------------------------------
3856aec45a7Smrgm4_define([lt_decl_tag_varnames],
3866aec45a7Smrg[_lt_decl_filter([tagged?], [yes], $@)])
387ab47cfaaSmrg
388ab47cfaaSmrg
3896aec45a7Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
3906aec45a7Smrg# ---------------------------------------------------------
3916aec45a7Smrgm4_define([_lt_decl_filter],
3926aec45a7Smrg[m4_case([$#],
3936aec45a7Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
3946aec45a7Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
3956aec45a7Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
3966aec45a7Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
3976aec45a7Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
3986aec45a7Smrg])
399ab47cfaaSmrg
400ab47cfaaSmrg
4016aec45a7Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
4026aec45a7Smrg# --------------------------------------------------
4036aec45a7Smrgm4_define([lt_decl_quote_varnames],
4046aec45a7Smrg[_lt_decl_filter([value], [1], $@)])
405ab47cfaaSmrg
406ab47cfaaSmrg
4076aec45a7Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
4086aec45a7Smrg# ---------------------------------------------------
4096aec45a7Smrgm4_define([lt_decl_dquote_varnames],
4106aec45a7Smrg[_lt_decl_filter([value], [2], $@)])
411ab47cfaaSmrg
412ab47cfaaSmrg
4136aec45a7Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
4146aec45a7Smrg# ---------------------------------------------------
4156aec45a7Smrgm4_define([lt_decl_varnames_tagged],
4166aec45a7Smrg[m4_assert([$# <= 2])dnl
4176aec45a7Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
4186aec45a7Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
4196aec45a7Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
4206aec45a7Smrgm4_define([_lt_decl_varnames_tagged],
4216aec45a7Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
422ab47cfaaSmrg
4235c42550eSmrg
4246aec45a7Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
4256aec45a7Smrg# ------------------------------------------------
4266aec45a7Smrgm4_define([lt_decl_all_varnames],
4276aec45a7Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
4286aec45a7Smrg     m4_if([$2], [],
4296aec45a7Smrg	   m4_quote(lt_decl_varnames),
4306aec45a7Smrg	m4_quote(m4_shift($@))))[]dnl
4316aec45a7Smrg])
4326aec45a7Smrgm4_define([_lt_decl_all_varnames],
4336aec45a7Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
4346aec45a7Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
4356aec45a7Smrg])
436ab47cfaaSmrg
437ab47cfaaSmrg
4386aec45a7Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
4396aec45a7Smrg# ------------------------------------
4406aec45a7Smrg# Quote a variable value, and forward it to `config.status' so that its
4416aec45a7Smrg# declaration there will have the same value as in `configure'.  VARNAME
4426aec45a7Smrg# must have a single quote delimited value for this to work.
4436aec45a7Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
4446aec45a7Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
445ab47cfaaSmrg
446ab47cfaaSmrg
4476aec45a7Smrg# _LT_CONFIG_STATUS_DECLARATIONS
4486aec45a7Smrg# ------------------------------
4496aec45a7Smrg# We delimit libtool config variables with single quotes, so when
4506aec45a7Smrg# we write them to config.status, we have to be sure to quote all
4516aec45a7Smrg# embedded single quotes properly.  In configure, this macro expands
4526aec45a7Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
4536aec45a7Smrg#
4546aec45a7Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
4556aec45a7Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
4566aec45a7Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
4576aec45a7Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
458ab47cfaaSmrg
4596aec45a7Smrg
4606aec45a7Smrg# _LT_LIBTOOL_TAGS
4616aec45a7Smrg# ----------------
4626aec45a7Smrg# Output comment and list of tags supported by the script
4636aec45a7Smrgm4_defun([_LT_LIBTOOL_TAGS],
4646aec45a7Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
4656aec45a7Smrgavailable_tags="_LT_TAGS"dnl
4666aec45a7Smrg])
4676aec45a7Smrg
4686aec45a7Smrg
4696aec45a7Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
4706aec45a7Smrg# -----------------------------------
4716aec45a7Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
4726aec45a7Smrg# expand to a commented shell variable setting:
4736aec45a7Smrg#
4746aec45a7Smrg#    # Some comment about what VAR is for.
4756aec45a7Smrg#    visible_name=$lt_internal_name
4766aec45a7Smrgm4_define([_LT_LIBTOOL_DECLARE],
4776aec45a7Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
4786aec45a7Smrg					   [description])))[]dnl
4796aec45a7Smrgm4_pushdef([_libtool_name],
4806aec45a7Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
4816aec45a7Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
4826aec45a7Smrg    [0], [_libtool_name=[$]$1],
4836aec45a7Smrg    [1], [_libtool_name=$lt_[]$1],
4846aec45a7Smrg    [2], [_libtool_name=$lt_[]$1],
4856aec45a7Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
4866aec45a7Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
4876aec45a7Smrg])
4886aec45a7Smrg
4896aec45a7Smrg
4906aec45a7Smrg# _LT_LIBTOOL_CONFIG_VARS
4916aec45a7Smrg# -----------------------
4926aec45a7Smrg# Produce commented declarations of non-tagged libtool config variables
4936aec45a7Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
4946aec45a7Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
4956aec45a7Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
4966aec45a7Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
4976aec45a7Smrg[m4_foreach([_lt_var],
4986aec45a7Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
4996aec45a7Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
5006aec45a7Smrg
5016aec45a7Smrg
5026aec45a7Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
5036aec45a7Smrg# -------------------------
5046aec45a7Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
5056aec45a7Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
5066aec45a7Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
5076aec45a7Smrg
5086aec45a7Smrg
5096aec45a7Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
5106aec45a7Smrg# ------------------------------
5116aec45a7Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
5126aec45a7Smrg
5136aec45a7Smrg
5146aec45a7Smrg# _LT_CONFIG_COMMANDS
5156aec45a7Smrg# -------------------
5166aec45a7Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
5176aec45a7Smrg# variables for single and double quote escaping we saved from calls
5186aec45a7Smrg# to _LT_DECL, we can put quote escaped variables declarations
5196aec45a7Smrg# into `config.status', and then the shell code to quote escape them in
5206aec45a7Smrg# for loops in `config.status'.  Finally, any additional code accumulated
5216aec45a7Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
5226aec45a7Smrgm4_defun([_LT_CONFIG_COMMANDS],
5236aec45a7Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
5246aec45a7Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
5256aec45a7Smrg	dnl instead of duplicating it all over again into config.status,
5266aec45a7Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
5276aec45a7Smrg	dnl needs to know what name is stored there:
5286aec45a7Smrg        [AC_CONFIG_COMMANDS([libtool],
5296aec45a7Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
5306aec45a7Smrg    dnl If the libtool generation code is destined for config.status,
5316aec45a7Smrg    dnl expand the accumulated commands and init code now:
5326aec45a7Smrg    [AC_CONFIG_COMMANDS([libtool],
5336aec45a7Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
5346aec45a7Smrg])#_LT_CONFIG_COMMANDS
5356aec45a7Smrg
5366aec45a7Smrg
5376aec45a7Smrg# Initialize.
5386aec45a7Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
5396aec45a7Smrg[
5406aec45a7Smrg
5416aec45a7Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
5426aec45a7Smrg# if CDPATH is set.
5436aec45a7Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5446aec45a7Smrg
5456aec45a7Smrgsed_quote_subst='$sed_quote_subst'
5466aec45a7Smrgdouble_quote_subst='$double_quote_subst'
5476aec45a7Smrgdelay_variable_subst='$delay_variable_subst'
5486aec45a7Smrg_LT_CONFIG_STATUS_DECLARATIONS
5496aec45a7SmrgLTCC='$LTCC'
5506aec45a7SmrgLTCFLAGS='$LTCFLAGS'
5516aec45a7Smrgcompiler='$compiler_DEFAULT'
5526aec45a7Smrg
5536aec45a7Smrg# A function that is used when there is no print builtin or printf.
5546aec45a7Smrgfunc_fallback_echo ()
5556aec45a7Smrg{
5566aec45a7Smrg  eval 'cat <<_LTECHO_EOF
5576aec45a7Smrg\$[]1
5586aec45a7Smrg_LTECHO_EOF'
5596aec45a7Smrg}
5606aec45a7Smrg
5616aec45a7Smrg# Quote evaled strings.
5626aec45a7Smrgfor var in lt_decl_all_varnames([[ \
5636aec45a7Smrg]], lt_decl_quote_varnames); do
5646aec45a7Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
5656aec45a7Smrg    *[[\\\\\\\`\\"\\\$]]*)
5666aec45a7Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
5675c42550eSmrg      ;;
5686aec45a7Smrg    *)
5696aec45a7Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5705c42550eSmrg      ;;
5715c42550eSmrg    esac
5726aec45a7Smrgdone
573ab47cfaaSmrg
5746aec45a7Smrg# Double-quote double-evaled strings.
5756aec45a7Smrgfor var in lt_decl_all_varnames([[ \
5766aec45a7Smrg]], lt_decl_dquote_varnames); do
5776aec45a7Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
5786aec45a7Smrg    *[[\\\\\\\`\\"\\\$]]*)
5796aec45a7Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
5805c42550eSmrg      ;;
5816aec45a7Smrg    *)
5826aec45a7Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5835c42550eSmrg      ;;
584ab47cfaaSmrg    esac
5856aec45a7Smrgdone
586ab47cfaaSmrg
5876aec45a7Smrg_LT_OUTPUT_LIBTOOL_INIT
5886aec45a7Smrg])
5895c42550eSmrg
5906aec45a7Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
5916aec45a7Smrg# ------------------------------------
5926aec45a7Smrg# Generate a child script FILE with all initialization necessary to
5936aec45a7Smrg# reuse the environment learned by the parent script, and make the
5946aec45a7Smrg# file executable.  If COMMENT is supplied, it is inserted after the
5956aec45a7Smrg# `#!' sequence but before initialization text begins.  After this
5966aec45a7Smrg# macro, additional text can be appended to FILE to form the body of
5976aec45a7Smrg# the child script.  The macro ends with non-zero status if the
5986aec45a7Smrg# file could not be fully written (such as if the disk is full).
5996aec45a7Smrgm4_ifdef([AS_INIT_GENERATED],
6006aec45a7Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
6016aec45a7Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
6026aec45a7Smrg[m4_require([AS_PREPARE])]dnl
6036aec45a7Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
6046aec45a7Smrg[lt_write_fail=0
6056aec45a7Smrgcat >$1 <<_ASEOF || lt_write_fail=1
6066aec45a7Smrg#! $SHELL
6076aec45a7Smrg# Generated by $as_me.
6086aec45a7Smrg$2
6096aec45a7SmrgSHELL=\${CONFIG_SHELL-$SHELL}
6106aec45a7Smrgexport SHELL
6116aec45a7Smrg_ASEOF
6126aec45a7Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
6136aec45a7SmrgAS_SHELL_SANITIZE
6146aec45a7Smrg_AS_PREPARE
6156aec45a7Smrgexec AS_MESSAGE_FD>&1
6166aec45a7Smrg_ASEOF
6176aec45a7Smrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
6186aec45a7Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
6196aec45a7Smrg
6206aec45a7Smrg# LT_OUTPUT
6216aec45a7Smrg# ---------
6226aec45a7Smrg# This macro allows early generation of the libtool script (before
6236aec45a7Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
6246aec45a7Smrg# tests.
6256aec45a7SmrgAC_DEFUN([LT_OUTPUT],
6266aec45a7Smrg[: ${CONFIG_LT=./config.lt}
6276aec45a7SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
6286aec45a7Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
6296aec45a7Smrg[# Run this file to recreate a libtool stub with the current configuration.])
6306aec45a7Smrg
6316aec45a7Smrgcat >>"$CONFIG_LT" <<\_LTEOF
6326aec45a7Smrglt_cl_silent=false
6336aec45a7Smrgexec AS_MESSAGE_LOG_FD>>config.log
6346aec45a7Smrg{
6356aec45a7Smrg  echo
6366aec45a7Smrg  AS_BOX([Running $as_me.])
6376aec45a7Smrg} >&AS_MESSAGE_LOG_FD
638ab47cfaaSmrg
6396aec45a7Smrglt_cl_help="\
6406aec45a7Smrg\`$as_me' creates a local libtool stub from the current configuration,
6416aec45a7Smrgfor use in further configure time tests before the real libtool is
6426aec45a7Smrggenerated.
6431473d951Smrg
6446aec45a7SmrgUsage: $[0] [[OPTIONS]]
645ab47cfaaSmrg
6466aec45a7Smrg  -h, --help      print this help, then exit
6476aec45a7Smrg  -V, --version   print version number, then exit
6486aec45a7Smrg  -q, --quiet     do not print progress messages
6496aec45a7Smrg  -d, --debug     don't remove temporary files
650ab47cfaaSmrg
6516aec45a7SmrgReport bugs to <bug-libtool@gnu.org>."
652ab47cfaaSmrg
6536aec45a7Smrglt_cl_version="\
6546aec45a7Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
6556aec45a7Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
6566aec45a7Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
657ab47cfaaSmrg
658aa9e3350SmrgCopyright (C) 2011 Free Software Foundation, Inc.
6596aec45a7SmrgThis config.lt script is free software; the Free Software Foundation
6606aec45a7Smrggives unlimited permision to copy, distribute and modify it."
6611473d951Smrg
6626aec45a7Smrgwhile test $[#] != 0
6636aec45a7Smrgdo
6646aec45a7Smrg  case $[1] in
6656aec45a7Smrg    --version | --v* | -V )
6666aec45a7Smrg      echo "$lt_cl_version"; exit 0 ;;
6676aec45a7Smrg    --help | --h* | -h )
6686aec45a7Smrg      echo "$lt_cl_help"; exit 0 ;;
6696aec45a7Smrg    --debug | --d* | -d )
6706aec45a7Smrg      debug=: ;;
6716aec45a7Smrg    --quiet | --q* | --silent | --s* | -q )
6726aec45a7Smrg      lt_cl_silent=: ;;
6736aec45a7Smrg
6746aec45a7Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
6756aec45a7SmrgTry \`$[0] --help' for more information.]) ;;
6766aec45a7Smrg
6776aec45a7Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
6786aec45a7SmrgTry \`$[0] --help' for more information.]) ;;
6796aec45a7Smrg  esac
6806aec45a7Smrg  shift
6816aec45a7Smrgdone
682ab47cfaaSmrg
6836aec45a7Smrgif $lt_cl_silent; then
6846aec45a7Smrg  exec AS_MESSAGE_FD>/dev/null
685ab47cfaaSmrgfi
6866aec45a7Smrg_LTEOF
6876aec45a7Smrg
6886aec45a7Smrgcat >>"$CONFIG_LT" <<_LTEOF
6896aec45a7Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
6906aec45a7Smrg_LTEOF
6916aec45a7Smrg
6926aec45a7Smrgcat >>"$CONFIG_LT" <<\_LTEOF
6936aec45a7SmrgAC_MSG_NOTICE([creating $ofile])
6946aec45a7Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
6956aec45a7SmrgAS_EXIT(0)
6966aec45a7Smrg_LTEOF
6976aec45a7Smrgchmod +x "$CONFIG_LT"
6986aec45a7Smrg
6996aec45a7Smrg# configure is writing to config.log, but config.lt does its own redirection,
7006aec45a7Smrg# appending to config.log, which fails on DOS, as config.log is still kept
7016aec45a7Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
7026aec45a7Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
7036aec45a7Smrglt_cl_success=:
7046aec45a7Smrgtest "$silent" = yes &&
7056aec45a7Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
7066aec45a7Smrgexec AS_MESSAGE_LOG_FD>/dev/null
7076aec45a7Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
7086aec45a7Smrgexec AS_MESSAGE_LOG_FD>>config.log
7096aec45a7Smrg$lt_cl_success || AS_EXIT(1)
7106aec45a7Smrg])# LT_OUTPUT
7116aec45a7Smrg
7126aec45a7Smrg
7136aec45a7Smrg# _LT_CONFIG(TAG)
7146aec45a7Smrg# ---------------
7156aec45a7Smrg# If TAG is the built-in tag, create an initial libtool script with a
7166aec45a7Smrg# default configuration from the untagged config vars.  Otherwise add code
7176aec45a7Smrg# to config.status for appending the configuration named by TAG from the
7186aec45a7Smrg# matching tagged config vars.
7196aec45a7Smrgm4_defun([_LT_CONFIG],
7206aec45a7Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7216aec45a7Smrg_LT_CONFIG_SAVE_COMMANDS([
7226aec45a7Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
7236aec45a7Smrg  m4_if(_LT_TAG, [C], [
7246aec45a7Smrg    # See if we are running on zsh, and set the options which allow our
7256aec45a7Smrg    # commands through without removal of \ escapes.
7266aec45a7Smrg    if test -n "${ZSH_VERSION+set}" ; then
7276aec45a7Smrg      setopt NO_GLOB_SUBST
7286aec45a7Smrg    fi
729ab47cfaaSmrg
7306aec45a7Smrg    cfgfile="${ofile}T"
7316aec45a7Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
7326aec45a7Smrg    $RM "$cfgfile"
733ab47cfaaSmrg
7346aec45a7Smrg    cat <<_LT_EOF >> "$cfgfile"
7356aec45a7Smrg#! $SHELL
736ab47cfaaSmrg
7376aec45a7Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
7386aec45a7Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
7396aec45a7Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7406aec45a7Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
7416aec45a7Smrg#
7426aec45a7Smrg_LT_COPYING
7436aec45a7Smrg_LT_LIBTOOL_TAGS
744ab47cfaaSmrg
7456aec45a7Smrg# ### BEGIN LIBTOOL CONFIG
7466aec45a7Smrg_LT_LIBTOOL_CONFIG_VARS
7476aec45a7Smrg_LT_LIBTOOL_TAG_VARS
7486aec45a7Smrg# ### END LIBTOOL CONFIG
749ab47cfaaSmrg
7506aec45a7Smrg_LT_EOF
751ab47cfaaSmrg
7526aec45a7Smrg  case $host_os in
7536aec45a7Smrg  aix3*)
7546aec45a7Smrg    cat <<\_LT_EOF >> "$cfgfile"
7556aec45a7Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
7566aec45a7Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
7576aec45a7Smrg# vanish in a puff of smoke.
7586aec45a7Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
7596aec45a7Smrg  COLLECT_NAMES=
7606aec45a7Smrg  export COLLECT_NAMES
7616aec45a7Smrgfi
7626aec45a7Smrg_LT_EOF
763ab47cfaaSmrg    ;;
7646aec45a7Smrg  esac
765ab47cfaaSmrg
7666aec45a7Smrg  _LT_PROG_LTMAIN
767ab47cfaaSmrg
7686aec45a7Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
7696aec45a7Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
7706aec45a7Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
7716aec45a7Smrg  # is reportedly fixed, but why not run on old versions too?
772aa9e3350Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
773aa9e3350Smrg     || (rm -f "$cfgfile"; exit 1)
774ab47cfaaSmrg
775aa9e3350Smrg  _LT_PROG_REPLACE_SHELLFNS
776ab47cfaaSmrg
777aa9e3350Smrg   mv -f "$cfgfile" "$ofile" ||
7786aec45a7Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
7796aec45a7Smrg  chmod +x "$ofile"
7806aec45a7Smrg],
7816aec45a7Smrg[cat <<_LT_EOF >> "$ofile"
782ab47cfaaSmrg
7836aec45a7Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
7846aec45a7Smrgdnl in a comment (ie after a #).
7856aec45a7Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
7866aec45a7Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
7876aec45a7Smrg# ### END LIBTOOL TAG CONFIG: $1
7886aec45a7Smrg_LT_EOF
7896aec45a7Smrg])dnl /m4_if
7906aec45a7Smrg],
7916aec45a7Smrg[m4_if([$1], [], [
7926aec45a7Smrg    PACKAGE='$PACKAGE'
7936aec45a7Smrg    VERSION='$VERSION'
7946aec45a7Smrg    TIMESTAMP='$TIMESTAMP'
7956aec45a7Smrg    RM='$RM'
7966aec45a7Smrg    ofile='$ofile'], [])
7976aec45a7Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
7986aec45a7Smrg])# _LT_CONFIG
799ab47cfaaSmrg
800ab47cfaaSmrg
8016aec45a7Smrg# LT_SUPPORTED_TAG(TAG)
8026aec45a7Smrg# ---------------------
8036aec45a7Smrg# Trace this macro to discover what tags are supported by the libtool
8046aec45a7Smrg# --tag option, using:
8056aec45a7Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
8066aec45a7SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
807ab47cfaaSmrg
808ab47cfaaSmrg
8096aec45a7Smrg# C support is built-in for now
8106aec45a7Smrgm4_define([_LT_LANG_C_enabled], [])
8116aec45a7Smrgm4_define([_LT_TAGS], [])
812ab47cfaaSmrg
8135c42550eSmrg
8146aec45a7Smrg# LT_LANG(LANG)
8156aec45a7Smrg# -------------
8166aec45a7Smrg# Enable libtool support for the given language if not already enabled.
8176aec45a7SmrgAC_DEFUN([LT_LANG],
8186aec45a7Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
8196aec45a7Smrgm4_case([$1],
8206aec45a7Smrg  [C],			[_LT_LANG(C)],
8216aec45a7Smrg  [C++],		[_LT_LANG(CXX)],
822aa9e3350Smrg  [Go],			[_LT_LANG(GO)],
8236aec45a7Smrg  [Java],		[_LT_LANG(GCJ)],
8246aec45a7Smrg  [Fortran 77],		[_LT_LANG(F77)],
8256aec45a7Smrg  [Fortran],		[_LT_LANG(FC)],
8266aec45a7Smrg  [Windows Resource],	[_LT_LANG(RC)],
8276aec45a7Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
8286aec45a7Smrg    [_LT_LANG($1)],
8296aec45a7Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
8306aec45a7Smrg])# LT_LANG
8316aec45a7Smrg
8326aec45a7Smrg
8336aec45a7Smrg# _LT_LANG(LANGNAME)
8346aec45a7Smrg# ------------------
8356aec45a7Smrgm4_defun([_LT_LANG],
8366aec45a7Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
8376aec45a7Smrg  [LT_SUPPORTED_TAG([$1])dnl
8386aec45a7Smrg  m4_append([_LT_TAGS], [$1 ])dnl
8396aec45a7Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
8406aec45a7Smrg  _LT_LANG_$1_CONFIG($1)])dnl
8416aec45a7Smrg])# _LT_LANG
842ab47cfaaSmrg
843ab47cfaaSmrg
844aa9e3350Smrgm4_ifndef([AC_PROG_GO], [
845aa9e3350Smrg# NOTE: This macro has been submitted for inclusion into   #
846aa9e3350Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
847aa9e3350Smrg#  a released version of Autoconf we should remove this    #
848aa9e3350Smrg#  macro and use it instead.                               #
849aa9e3350Smrgm4_defun([AC_PROG_GO],
850aa9e3350Smrg[AC_LANG_PUSH(Go)dnl
851aa9e3350SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
852aa9e3350SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
853aa9e3350Smrg_AC_ARG_VAR_LDFLAGS()dnl
854aa9e3350SmrgAC_CHECK_TOOL(GOC, gccgo)
855aa9e3350Smrgif test -z "$GOC"; then
856aa9e3350Smrg  if test -n "$ac_tool_prefix"; then
857aa9e3350Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
858aa9e3350Smrg  fi
859aa9e3350Smrgfi
860aa9e3350Smrgif test -z "$GOC"; then
861aa9e3350Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
862aa9e3350Smrgfi
863aa9e3350Smrg])#m4_defun
864aa9e3350Smrg])#m4_ifndef
865aa9e3350Smrg
866aa9e3350Smrg
8676aec45a7Smrg# _LT_LANG_DEFAULT_CONFIG
8686aec45a7Smrg# -----------------------
8696aec45a7Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
8706aec45a7Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
8716aec45a7Smrg  [LT_LANG(CXX)],
8726aec45a7Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
8736aec45a7Smrg
8746aec45a7SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
8756aec45a7Smrg  [LT_LANG(F77)],
8766aec45a7Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
8776aec45a7Smrg
8786aec45a7SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
8796aec45a7Smrg  [LT_LANG(FC)],
8806aec45a7Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
8816aec45a7Smrg
8826aec45a7Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
8836aec45a7Smrgdnl pulling things in needlessly.
8846aec45a7SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
8856aec45a7Smrg  [LT_LANG(GCJ)],
8866aec45a7Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
8876aec45a7Smrg    [LT_LANG(GCJ)],
8886aec45a7Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
8896aec45a7Smrg      [LT_LANG(GCJ)],
8906aec45a7Smrg      [m4_ifdef([AC_PROG_GCJ],
8916aec45a7Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
8926aec45a7Smrg       m4_ifdef([A][M_PROG_GCJ],
8936aec45a7Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
8946aec45a7Smrg       m4_ifdef([LT_PROG_GCJ],
8956aec45a7Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
8966aec45a7Smrg
897aa9e3350SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
898aa9e3350Smrg  [LT_LANG(GO)],
899aa9e3350Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
900aa9e3350Smrg
9016aec45a7SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
9026aec45a7Smrg  [LT_LANG(RC)],
9036aec45a7Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
9046aec45a7Smrg])# _LT_LANG_DEFAULT_CONFIG
9056aec45a7Smrg
9066aec45a7Smrg# Obsolete macros:
9076aec45a7SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
9086aec45a7SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
9096aec45a7SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
9106aec45a7SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
9116aec45a7SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
9126aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
9136aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
9146aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
9156aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
9166aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
9176aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
9186aec45a7Smrg
9196aec45a7Smrg
9206aec45a7Smrg# _LT_TAG_COMPILER
9216aec45a7Smrg# ----------------
9226aec45a7Smrgm4_defun([_LT_TAG_COMPILER],
9236aec45a7Smrg[AC_REQUIRE([AC_PROG_CC])dnl
924ab47cfaaSmrg
9256aec45a7Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
9266aec45a7Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
9276aec45a7Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
9286aec45a7Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
929ab47cfaaSmrg
9306aec45a7Smrg# If no C compiler was specified, use CC.
9316aec45a7SmrgLTCC=${LTCC-"$CC"}
932ab47cfaaSmrg
9336aec45a7Smrg# If no C compiler flags were specified, use CFLAGS.
9346aec45a7SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
935ab47cfaaSmrg
9366aec45a7Smrg# Allow CC to be a program name with arguments.
9376aec45a7Smrgcompiler=$CC
9386aec45a7Smrg])# _LT_TAG_COMPILER
939ab47cfaaSmrg
940ab47cfaaSmrg
9416aec45a7Smrg# _LT_COMPILER_BOILERPLATE
9426aec45a7Smrg# ------------------------
9436aec45a7Smrg# Check for compiler boilerplate output or warnings with
9446aec45a7Smrg# the simple compiler test code.
9456aec45a7Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
9466aec45a7Smrg[m4_require([_LT_DECL_SED])dnl
9476aec45a7Smrgac_outfile=conftest.$ac_objext
9486aec45a7Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
9496aec45a7Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
9506aec45a7Smrg_lt_compiler_boilerplate=`cat conftest.err`
9516aec45a7Smrg$RM conftest*
9526aec45a7Smrg])# _LT_COMPILER_BOILERPLATE
953ab47cfaaSmrg
9546aec45a7Smrg
9556aec45a7Smrg# _LT_LINKER_BOILERPLATE
9566aec45a7Smrg# ----------------------
9576aec45a7Smrg# Check for linker boilerplate output or warnings with
9586aec45a7Smrg# the simple link test code.
9596aec45a7Smrgm4_defun([_LT_LINKER_BOILERPLATE],
9606aec45a7Smrg[m4_require([_LT_DECL_SED])dnl
9616aec45a7Smrgac_outfile=conftest.$ac_objext
9626aec45a7Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
9636aec45a7Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
9646aec45a7Smrg_lt_linker_boilerplate=`cat conftest.err`
9656aec45a7Smrg$RM -r conftest*
9666aec45a7Smrg])# _LT_LINKER_BOILERPLATE
9676aec45a7Smrg
9686aec45a7Smrg# _LT_REQUIRED_DARWIN_CHECKS
9696aec45a7Smrg# -------------------------
9706aec45a7Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
9716aec45a7Smrg  case $host_os in
9726aec45a7Smrg    rhapsody* | darwin*)
9736aec45a7Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
9746aec45a7Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
9756aec45a7Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
9766aec45a7Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
9776aec45a7Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
9786aec45a7Smrg    _LT_DECL([], [DSYMUTIL], [1],
9796aec45a7Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
9806aec45a7Smrg    _LT_DECL([], [NMEDIT], [1],
9816aec45a7Smrg      [Tool to change global to local symbols on Mac OS X])
9826aec45a7Smrg    _LT_DECL([], [LIPO], [1],
9836aec45a7Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
9846aec45a7Smrg    _LT_DECL([], [OTOOL], [1],
9856aec45a7Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
9866aec45a7Smrg    _LT_DECL([], [OTOOL64], [1],
9876aec45a7Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
9886aec45a7Smrg
9896aec45a7Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
9906aec45a7Smrg      [lt_cv_apple_cc_single_mod=no
9916aec45a7Smrg      if test -z "${LT_MULTI_MODULE}"; then
9926aec45a7Smrg	# By default we will add the -single_module flag. You can override
9936aec45a7Smrg	# by either setting the environment variable LT_MULTI_MODULE
9946aec45a7Smrg	# non-empty at configure time, or by adding -multi_module to the
9956aec45a7Smrg	# link flags.
9966aec45a7Smrg	rm -rf libconftest.dylib*
9976aec45a7Smrg	echo "int foo(void){return 1;}" > conftest.c
9986aec45a7Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
9996aec45a7Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
10006aec45a7Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
10016aec45a7Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
10026aec45a7Smrg        _lt_result=$?
1003aa9e3350Smrg	# If there is a non-empty error log, and "single_module"
1004aa9e3350Smrg	# appears in it, assume the flag caused a linker warning
1005aa9e3350Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
1006aa9e3350Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1007aa9e3350Smrg	# Otherwise, if the output was created with a 0 exit code from
1008aa9e3350Smrg	# the compiler, it worked.
1009aa9e3350Smrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
10106aec45a7Smrg	  lt_cv_apple_cc_single_mod=yes
10116aec45a7Smrg	else
10126aec45a7Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
10136aec45a7Smrg	fi
10146aec45a7Smrg	rm -rf libconftest.dylib*
10156aec45a7Smrg	rm -f conftest.*
10166aec45a7Smrg      fi])
1017aa9e3350Smrg
10186aec45a7Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
10196aec45a7Smrg      [lt_cv_ld_exported_symbols_list],
10206aec45a7Smrg      [lt_cv_ld_exported_symbols_list=no
10216aec45a7Smrg      save_LDFLAGS=$LDFLAGS
10226aec45a7Smrg      echo "_main" > conftest.sym
10236aec45a7Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
10246aec45a7Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
10256aec45a7Smrg	[lt_cv_ld_exported_symbols_list=yes],
10266aec45a7Smrg	[lt_cv_ld_exported_symbols_list=no])
10276aec45a7Smrg	LDFLAGS="$save_LDFLAGS"
10286aec45a7Smrg    ])
1029aa9e3350Smrg
10306aec45a7Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
10316aec45a7Smrg      [lt_cv_ld_force_load=no
10326aec45a7Smrg      cat > conftest.c << _LT_EOF
10336aec45a7Smrgint forced_loaded() { return 2;}
10346aec45a7Smrg_LT_EOF
10356aec45a7Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
10366aec45a7Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
10376aec45a7Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
10386aec45a7Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
10396aec45a7Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
10406aec45a7Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
10416aec45a7Smrg      cat > conftest.c << _LT_EOF
10426aec45a7Smrgint main() { return 0;}
10436aec45a7Smrg_LT_EOF
10446aec45a7Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
10456aec45a7Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
10466aec45a7Smrg      _lt_result=$?
1047aa9e3350Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
1048aa9e3350Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1049aa9e3350Smrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
10506aec45a7Smrg	lt_cv_ld_force_load=yes
10516aec45a7Smrg      else
10526aec45a7Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
10536aec45a7Smrg      fi
10546aec45a7Smrg        rm -f conftest.err libconftest.a conftest conftest.c
10556aec45a7Smrg        rm -rf conftest.dSYM
10566aec45a7Smrg    ])
10576aec45a7Smrg    case $host_os in
10586aec45a7Smrg    rhapsody* | darwin1.[[012]])
10596aec45a7Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
10606aec45a7Smrg    darwin1.*)
10616aec45a7Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
10626aec45a7Smrg    darwin*) # darwin 5.x on
10636aec45a7Smrg      # if running on 10.5 or later, the deployment target defaults
10646aec45a7Smrg      # to the OS version, if on x86, and 10.4, the deployment
10656aec45a7Smrg      # target defaults to 10.4. Don't you love it?
10666aec45a7Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10676aec45a7Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
10686aec45a7Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
10696aec45a7Smrg	10.[[012]]*)
10706aec45a7Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
10716aec45a7Smrg	10.*)
10726aec45a7Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
10736aec45a7Smrg      esac
10746aec45a7Smrg    ;;
10756aec45a7Smrg  esac
10766aec45a7Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
10776aec45a7Smrg      _lt_dar_single_mod='$single_module'
10786aec45a7Smrg    fi
10796aec45a7Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
10806aec45a7Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
10816aec45a7Smrg    else
10826aec45a7Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
10836aec45a7Smrg    fi
10846aec45a7Smrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
10856aec45a7Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
10866aec45a7Smrg    else
10876aec45a7Smrg      _lt_dsymutil=
10886aec45a7Smrg    fi
1089ab47cfaaSmrg    ;;
1090ab47cfaaSmrg  esac
10916aec45a7Smrg])
1092ab47cfaaSmrg
10936aec45a7Smrg
1094aa9e3350Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
1095aa9e3350Smrg# ---------------------------------
10966aec45a7Smrg# Checks for linker and compiler features on darwin
10976aec45a7Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
10986aec45a7Smrg[
10996aec45a7Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
11006aec45a7Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
11016aec45a7Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
11026aec45a7Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
11036aec45a7Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
11046aec45a7Smrg  if test "$lt_cv_ld_force_load" = "yes"; then
11056aec45a7Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
1106aa9e3350Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1107aa9e3350Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1108ab47cfaaSmrg  else
11096aec45a7Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1110ab47cfaaSmrg  fi
11116aec45a7Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
11126aec45a7Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
11136aec45a7Smrg  case $cc_basename in
11146aec45a7Smrg     ifort*) _lt_dar_can_shared=yes ;;
11156aec45a7Smrg     *) _lt_dar_can_shared=$GCC ;;
11166aec45a7Smrg  esac
11176aec45a7Smrg  if test "$_lt_dar_can_shared" = "yes"; then
11186aec45a7Smrg    output_verbose_link_cmd=func_echo_all
11196aec45a7Smrg    _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}"
11206aec45a7Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
11216aec45a7Smrg    _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}"
11226aec45a7Smrg    _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}"
11236aec45a7Smrg    m4_if([$1], [CXX],
11246aec45a7Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
11256aec45a7Smrg      _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}"
11266aec45a7Smrg      _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}"
11276aec45a7Smrg    fi
11286aec45a7Smrg],[])
11296aec45a7Smrg  else
11306aec45a7Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
11316aec45a7Smrg  fi
11326aec45a7Smrg])
1133ab47cfaaSmrg
1134aa9e3350Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1135aa9e3350Smrg# ----------------------------------
11366aec45a7Smrg# Links a minimal program and checks the executable
11376aec45a7Smrg# for the system default hardcoded library path. In most cases,
11386aec45a7Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
11396aec45a7Smrg# the location of the communication and MPI libs are included too.
11406aec45a7Smrg# If we don't find anything, use the default library path according
11416aec45a7Smrg# to the aix ld manual.
1142aa9e3350Smrg# Store the results from the different compilers for each TAGNAME.
1143aa9e3350Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
11446aec45a7Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
11456aec45a7Smrg[m4_require([_LT_DECL_SED])dnl
1146aa9e3350Smrgif test "${lt_cv_aix_libpath+set}" = set; then
1147aa9e3350Smrg  aix_libpath=$lt_cv_aix_libpath
1148aa9e3350Smrgelse
1149aa9e3350Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1150aa9e3350Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1151aa9e3350Smrg  lt_aix_libpath_sed='[
1152aa9e3350Smrg      /Import File Strings/,/^$/ {
1153aa9e3350Smrg	  /^0/ {
1154aa9e3350Smrg	      s/^0  *\([^ ]*\) *$/\1/
1155aa9e3350Smrg	      p
1156aa9e3350Smrg	  }
1157aa9e3350Smrg      }]'
1158aa9e3350Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1159aa9e3350Smrg  # Check for a 64-bit object if we didn't find anything.
1160aa9e3350Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1161aa9e3350Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1162aa9e3350Smrg  fi],[])
1163aa9e3350Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1164aa9e3350Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
1165aa9e3350Smrg  fi
1166aa9e3350Smrg  ])
1167aa9e3350Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1168aa9e3350Smrgfi
11696aec45a7Smrg])# _LT_SYS_MODULE_PATH_AIX
1170ab47cfaaSmrg
1171ab47cfaaSmrg
11726aec45a7Smrg# _LT_SHELL_INIT(ARG)
11736aec45a7Smrg# -------------------
11746aec45a7Smrgm4_define([_LT_SHELL_INIT],
11756aec45a7Smrg[m4_divert_text([M4SH-INIT], [$1
11766aec45a7Smrg])])# _LT_SHELL_INIT
1177ab47cfaaSmrg
11786aec45a7Smrg
11796aec45a7Smrg
11806aec45a7Smrg# _LT_PROG_ECHO_BACKSLASH
11816aec45a7Smrg# -----------------------
11826aec45a7Smrg# Find how we can fake an echo command that does not interpret backslash.
11836aec45a7Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
11846aec45a7Smrg# of the generated configure script which will find a shell with a builtin
11856aec45a7Smrg# printf (which we can use as an echo command).
11866aec45a7Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
11876aec45a7Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
11886aec45a7SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
11896aec45a7SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
11906aec45a7Smrg
11916aec45a7SmrgAC_MSG_CHECKING([how to print strings])
11926aec45a7Smrg# Test print first, because it will be a builtin if present.
1193aa9e3350Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
11946aec45a7Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
11956aec45a7Smrg  ECHO='print -r --'
11966aec45a7Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
11976aec45a7Smrg  ECHO='printf %s\n'
11986aec45a7Smrgelse
11996aec45a7Smrg  # Use this function as a fallback that always works.
12006aec45a7Smrg  func_fallback_echo ()
12016aec45a7Smrg  {
12026aec45a7Smrg    eval 'cat <<_LTECHO_EOF
12036aec45a7Smrg$[]1
12046aec45a7Smrg_LTECHO_EOF'
12056aec45a7Smrg  }
12066aec45a7Smrg  ECHO='func_fallback_echo'
12076aec45a7Smrgfi
12086aec45a7Smrg
12096aec45a7Smrg# func_echo_all arg...
12106aec45a7Smrg# Invoke $ECHO with all args, space-separated.
12116aec45a7Smrgfunc_echo_all ()
12126aec45a7Smrg{
12136aec45a7Smrg    $ECHO "$*" 
12146aec45a7Smrg}
12156aec45a7Smrg
12166aec45a7Smrgcase "$ECHO" in
12176aec45a7Smrg  printf*) AC_MSG_RESULT([printf]) ;;
12186aec45a7Smrg  print*) AC_MSG_RESULT([print -r]) ;;
12196aec45a7Smrg  *) AC_MSG_RESULT([cat]) ;;
12206aec45a7Smrgesac
12216aec45a7Smrg
12226aec45a7Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
12236aec45a7Smrg[_AS_DETECT_SUGGESTED([
12246aec45a7Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
12256aec45a7Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
12266aec45a7Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
12276aec45a7Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
12286aec45a7Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
12296aec45a7Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
12306aec45a7Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
12316aec45a7Smrg
12326aec45a7Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
12336aec45a7Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
12346aec45a7Smrg])# _LT_PROG_ECHO_BACKSLASH
12356aec45a7Smrg
12366aec45a7Smrg
1237aa9e3350Smrg# _LT_WITH_SYSROOT
1238aa9e3350Smrg# ----------------
1239aa9e3350SmrgAC_DEFUN([_LT_WITH_SYSROOT],
1240aa9e3350Smrg[AC_MSG_CHECKING([for sysroot])
1241aa9e3350SmrgAC_ARG_WITH([sysroot],
1242aa9e3350Smrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
1243aa9e3350Smrg                        (or the compiler's sysroot if not specified).],
1244aa9e3350Smrg[], [with_sysroot=no])
1245aa9e3350Smrg
1246aa9e3350Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
1247aa9e3350Smrgdnl in case the user passed a directory name.
1248aa9e3350Smrglt_sysroot=
1249aa9e3350Smrgcase ${with_sysroot} in #(
1250aa9e3350Smrg yes)
1251aa9e3350Smrg   if test "$GCC" = yes; then
1252aa9e3350Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1253aa9e3350Smrg   fi
1254aa9e3350Smrg   ;; #(
1255aa9e3350Smrg /*)
1256aa9e3350Smrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1257aa9e3350Smrg   ;; #(
1258aa9e3350Smrg no|'')
1259aa9e3350Smrg   ;; #(
1260aa9e3350Smrg *)
1261aa9e3350Smrg   AC_MSG_RESULT([${with_sysroot}])
1262aa9e3350Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
1263aa9e3350Smrg   ;;
1264aa9e3350Smrgesac
1265aa9e3350Smrg
1266aa9e3350Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
1267aa9e3350Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1268aa9e3350Smrg[dependent libraries, and in which our libraries should be installed.])])
1269aa9e3350Smrg
12706aec45a7Smrg# _LT_ENABLE_LOCK
12716aec45a7Smrg# ---------------
12726aec45a7Smrgm4_defun([_LT_ENABLE_LOCK],
12736aec45a7Smrg[AC_ARG_ENABLE([libtool-lock],
12746aec45a7Smrg  [AS_HELP_STRING([--disable-libtool-lock],
12756aec45a7Smrg    [avoid locking (might break parallel builds)])])
12766aec45a7Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
12776aec45a7Smrg
12786aec45a7Smrg# Some flags need to be propagated to the compiler or linker for good
12796aec45a7Smrg# libtool support.
12806aec45a7Smrgcase $host in
12816aec45a7Smrgia64-*-hpux*)
12826aec45a7Smrg  # Find out which ABI we are using.
12836aec45a7Smrg  echo 'int i;' > conftest.$ac_ext
12846aec45a7Smrg  if AC_TRY_EVAL(ac_compile); then
12856aec45a7Smrg    case `/usr/bin/file conftest.$ac_objext` in
12866aec45a7Smrg      *ELF-32*)
12876aec45a7Smrg	HPUX_IA64_MODE="32"
12886aec45a7Smrg	;;
12896aec45a7Smrg      *ELF-64*)
12906aec45a7Smrg	HPUX_IA64_MODE="64"
12916aec45a7Smrg	;;
12926aec45a7Smrg    esac
12936aec45a7Smrg  fi
12946aec45a7Smrg  rm -rf conftest*
12956aec45a7Smrg  ;;
12966aec45a7Smrg*-*-irix6*)
12976aec45a7Smrg  # Find out which ABI we are using.
12986aec45a7Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
12996aec45a7Smrg  if AC_TRY_EVAL(ac_compile); then
13006aec45a7Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
13016aec45a7Smrg      case `/usr/bin/file conftest.$ac_objext` in
13026aec45a7Smrg	*32-bit*)
13036aec45a7Smrg	  LD="${LD-ld} -melf32bsmip"
13046aec45a7Smrg	  ;;
13056aec45a7Smrg	*N32*)
13066aec45a7Smrg	  LD="${LD-ld} -melf32bmipn32"
13076aec45a7Smrg	  ;;
13086aec45a7Smrg	*64-bit*)
13096aec45a7Smrg	  LD="${LD-ld} -melf64bmip"
13106aec45a7Smrg	;;
13116aec45a7Smrg      esac
13126aec45a7Smrg    else
13136aec45a7Smrg      case `/usr/bin/file conftest.$ac_objext` in
13146aec45a7Smrg	*32-bit*)
13156aec45a7Smrg	  LD="${LD-ld} -32"
13166aec45a7Smrg	  ;;
13176aec45a7Smrg	*N32*)
13186aec45a7Smrg	  LD="${LD-ld} -n32"
13196aec45a7Smrg	  ;;
13206aec45a7Smrg	*64-bit*)
13216aec45a7Smrg	  LD="${LD-ld} -64"
13226aec45a7Smrg	  ;;
13236aec45a7Smrg      esac
1324ab47cfaaSmrg    fi
13256aec45a7Smrg  fi
13266aec45a7Smrg  rm -rf conftest*
13276aec45a7Smrg  ;;
1328ab47cfaaSmrg
13296aec45a7Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
13306aec45a7Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
13316aec45a7Smrg  # Find out which ABI we are using.
13326aec45a7Smrg  echo 'int i;' > conftest.$ac_ext
13336aec45a7Smrg  if AC_TRY_EVAL(ac_compile); then
13346aec45a7Smrg    case `/usr/bin/file conftest.o` in
13356aec45a7Smrg      *32-bit*)
13366aec45a7Smrg	case $host in
13376aec45a7Smrg	  x86_64-*kfreebsd*-gnu)
13386aec45a7Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
13396aec45a7Smrg	    ;;
13406aec45a7Smrg	  x86_64-*linux*)
134138770048Smrg	    case `/usr/bin/file conftest.o` in
134238770048Smrg	      *x86-64*)
134338770048Smrg		LD="${LD-ld} -m elf32_x86_64"
134438770048Smrg		;;
134538770048Smrg	      *)
134638770048Smrg		LD="${LD-ld} -m elf_i386"
134738770048Smrg		;;
134838770048Smrg	    esac
13496aec45a7Smrg	    ;;
13506aec45a7Smrg	  ppc64-*linux*|powerpc64-*linux*)
13516aec45a7Smrg	    LD="${LD-ld} -m elf32ppclinux"
13526aec45a7Smrg	    ;;
13536aec45a7Smrg	  s390x-*linux*)
13546aec45a7Smrg	    LD="${LD-ld} -m elf_s390"
13556aec45a7Smrg	    ;;
13566aec45a7Smrg	  sparc64-*linux*)
13576aec45a7Smrg	    LD="${LD-ld} -m elf32_sparc"
13586aec45a7Smrg	    ;;
13596aec45a7Smrg	esac
13606aec45a7Smrg	;;
13616aec45a7Smrg      *64-bit*)
13626aec45a7Smrg	case $host in
13636aec45a7Smrg	  x86_64-*kfreebsd*-gnu)
13646aec45a7Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
13656aec45a7Smrg	    ;;
13666aec45a7Smrg	  x86_64-*linux*)
13676aec45a7Smrg	    LD="${LD-ld} -m elf_x86_64"
13686aec45a7Smrg	    ;;
13696aec45a7Smrg	  ppc*-*linux*|powerpc*-*linux*)
13706aec45a7Smrg	    LD="${LD-ld} -m elf64ppc"
13716aec45a7Smrg	    ;;
13726aec45a7Smrg	  s390*-*linux*|s390*-*tpf*)
13736aec45a7Smrg	    LD="${LD-ld} -m elf64_s390"
13746aec45a7Smrg	    ;;
13756aec45a7Smrg	  sparc*-*linux*)
13766aec45a7Smrg	    LD="${LD-ld} -m elf64_sparc"
13776aec45a7Smrg	    ;;
13786aec45a7Smrg	esac
13796aec45a7Smrg	;;
13806aec45a7Smrg    esac
13816aec45a7Smrg  fi
13826aec45a7Smrg  rm -rf conftest*
13836aec45a7Smrg  ;;
1384ab47cfaaSmrg
13856aec45a7Smrg*-*-sco3.2v5*)
13866aec45a7Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
13876aec45a7Smrg  SAVE_CFLAGS="$CFLAGS"
13886aec45a7Smrg  CFLAGS="$CFLAGS -belf"
13896aec45a7Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
13906aec45a7Smrg    [AC_LANG_PUSH(C)
13916aec45a7Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
13926aec45a7Smrg     AC_LANG_POP])
13936aec45a7Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
13946aec45a7Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
13956aec45a7Smrg    CFLAGS="$SAVE_CFLAGS"
13966aec45a7Smrg  fi
13976aec45a7Smrg  ;;
1398aa9e3350Smrg*-*solaris*)
13996aec45a7Smrg  # Find out which ABI we are using.
14006aec45a7Smrg  echo 'int i;' > conftest.$ac_ext
14016aec45a7Smrg  if AC_TRY_EVAL(ac_compile); then
14026aec45a7Smrg    case `/usr/bin/file conftest.o` in
14036aec45a7Smrg    *64-bit*)
14046aec45a7Smrg      case $lt_cv_prog_gnu_ld in
1405aa9e3350Smrg      yes*)
1406aa9e3350Smrg        case $host in
1407aa9e3350Smrg        i?86-*-solaris*)
1408aa9e3350Smrg          LD="${LD-ld} -m elf_x86_64"
1409aa9e3350Smrg          ;;
1410aa9e3350Smrg        sparc*-*-solaris*)
1411aa9e3350Smrg          LD="${LD-ld} -m elf64_sparc"
1412aa9e3350Smrg          ;;
1413aa9e3350Smrg        esac
1414aa9e3350Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
1415aa9e3350Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1416aa9e3350Smrg          LD="${LD-ld}_sol2"
1417aa9e3350Smrg        fi
1418aa9e3350Smrg        ;;
14196aec45a7Smrg      *)
14206aec45a7Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
14216aec45a7Smrg	  LD="${LD-ld} -64"
14226aec45a7Smrg	fi
14236aec45a7Smrg	;;
14246aec45a7Smrg      esac
14256aec45a7Smrg      ;;
14266aec45a7Smrg    esac
14276aec45a7Smrg  fi
14286aec45a7Smrg  rm -rf conftest*
14296aec45a7Smrg  ;;
14306aec45a7Smrgesac
1431ab47cfaaSmrg
14326aec45a7Smrgneed_locks="$enable_libtool_lock"
14336aec45a7Smrg])# _LT_ENABLE_LOCK
14346aec45a7Smrg
14356aec45a7Smrg
1436aa9e3350Smrg# _LT_PROG_AR
1437aa9e3350Smrg# -----------
1438aa9e3350Smrgm4_defun([_LT_PROG_AR],
1439aa9e3350Smrg[AC_CHECK_TOOLS(AR, [ar], false)
1440aa9e3350Smrg: ${AR=ar}
1441aa9e3350Smrg: ${AR_FLAGS=cru}
1442aa9e3350Smrg_LT_DECL([], [AR], [1], [The archiver])
1443aa9e3350Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1444aa9e3350Smrg
1445aa9e3350SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1446aa9e3350Smrg  [lt_cv_ar_at_file=no
1447aa9e3350Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1448aa9e3350Smrg     [echo conftest.$ac_objext > conftest.lst
1449aa9e3350Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1450aa9e3350Smrg      AC_TRY_EVAL([lt_ar_try])
1451aa9e3350Smrg      if test "$ac_status" -eq 0; then
1452aa9e3350Smrg	# Ensure the archiver fails upon bogus file names.
1453aa9e3350Smrg	rm -f conftest.$ac_objext libconftest.a
1454aa9e3350Smrg	AC_TRY_EVAL([lt_ar_try])
1455aa9e3350Smrg	if test "$ac_status" -ne 0; then
1456aa9e3350Smrg          lt_cv_ar_at_file=@
1457aa9e3350Smrg        fi
1458aa9e3350Smrg      fi
1459aa9e3350Smrg      rm -f conftest.* libconftest.a
1460aa9e3350Smrg     ])
1461aa9e3350Smrg  ])
1462aa9e3350Smrg
1463aa9e3350Smrgif test "x$lt_cv_ar_at_file" = xno; then
1464aa9e3350Smrg  archiver_list_spec=
1465aa9e3350Smrgelse
1466aa9e3350Smrg  archiver_list_spec=$lt_cv_ar_at_file
1467aa9e3350Smrgfi
1468aa9e3350Smrg_LT_DECL([], [archiver_list_spec], [1],
1469aa9e3350Smrg  [How to feed a file listing to the archiver])
1470aa9e3350Smrg])# _LT_PROG_AR
1471aa9e3350Smrg
1472aa9e3350Smrg
14736aec45a7Smrg# _LT_CMD_OLD_ARCHIVE
14746aec45a7Smrg# -------------------
14756aec45a7Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1476aa9e3350Smrg[_LT_PROG_AR
14776aec45a7Smrg
14786aec45a7SmrgAC_CHECK_TOOL(STRIP, strip, :)
14796aec45a7Smrgtest -z "$STRIP" && STRIP=:
14806aec45a7Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
14816aec45a7Smrg
14826aec45a7SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
14836aec45a7Smrgtest -z "$RANLIB" && RANLIB=:
14846aec45a7Smrg_LT_DECL([], [RANLIB], [1],
14856aec45a7Smrg    [Commands used to install an old-style archive])
14866aec45a7Smrg
14876aec45a7Smrg# Determine commands to create old-style static archives.
14886aec45a7Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
14896aec45a7Smrgold_postinstall_cmds='chmod 644 $oldlib'
14906aec45a7Smrgold_postuninstall_cmds=
14916aec45a7Smrg
14926aec45a7Smrgif test -n "$RANLIB"; then
14936aec45a7Smrg  case $host_os in
14946aec45a7Smrg  openbsd*)
1495aa9e3350Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
14966aec45a7Smrg    ;;
14976aec45a7Smrg  *)
1498aa9e3350Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
14996aec45a7Smrg    ;;
1500ab47cfaaSmrg  esac
1501aa9e3350Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1502ab47cfaaSmrgfi
1503ab47cfaaSmrg
15046aec45a7Smrgcase $host_os in
15056aec45a7Smrg  darwin*)
15066aec45a7Smrg    lock_old_archive_extraction=yes ;;
15076aec45a7Smrg  *)
15086aec45a7Smrg    lock_old_archive_extraction=no ;;
15096aec45a7Smrgesac
15106aec45a7Smrg_LT_DECL([], [old_postinstall_cmds], [2])
15116aec45a7Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
15126aec45a7Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
15136aec45a7Smrg    [Commands used to build an old-style archive])
15146aec45a7Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
15156aec45a7Smrg    [Whether to use a lock for old archive extraction])
15166aec45a7Smrg])# _LT_CMD_OLD_ARCHIVE
15171473d951Smrg
1518ab47cfaaSmrg
15196aec45a7Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
15206aec45a7Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
15216aec45a7Smrg# ----------------------------------------------------------------
15226aec45a7Smrg# Check whether the given compiler option works
15236aec45a7SmrgAC_DEFUN([_LT_COMPILER_OPTION],
15246aec45a7Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
15256aec45a7Smrgm4_require([_LT_DECL_SED])dnl
15266aec45a7SmrgAC_CACHE_CHECK([$1], [$2],
15276aec45a7Smrg  [$2=no
15286aec45a7Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
15296aec45a7Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
15306aec45a7Smrg   lt_compiler_flag="$3"
1531ab47cfaaSmrg   # Insert the option either (1) after the last *FLAGS variable, or
1532ab47cfaaSmrg   # (2) before a word containing "conftest.", or (3) at the end.
1533ab47cfaaSmrg   # Note that $ac_compile itself does not contain backslashes and begins
1534ab47cfaaSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
15356aec45a7Smrg   # The option is referenced via a variable to avoid confusing sed.
1536ab47cfaaSmrg   lt_compile=`echo "$ac_compile" | $SED \
1537ab47cfaaSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1538ab47cfaaSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1539ab47cfaaSmrg   -e 's:$: $lt_compiler_flag:'`
15406aec45a7Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
15416aec45a7Smrg   (eval "$lt_compile" 2>conftest.err)
1542ab47cfaaSmrg   ac_status=$?
15436aec45a7Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
15446aec45a7Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
15456aec45a7Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1546ab47cfaaSmrg     # The compiler can only warn and ignore the option if not recognized
15476aec45a7Smrg     # So say no if there are warnings other than the usual output.
15486aec45a7Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
15496aec45a7Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
15506aec45a7Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
15516aec45a7Smrg       $2=yes
1552ab47cfaaSmrg     fi
1553ab47cfaaSmrg   fi
15546aec45a7Smrg   $RM conftest*
1555ab47cfaaSmrg])
1556ab47cfaaSmrg
15576aec45a7Smrgif test x"[$]$2" = xyes; then
15586aec45a7Smrg    m4_if([$5], , :, [$5])
1559ab47cfaaSmrgelse
15606aec45a7Smrg    m4_if([$6], , :, [$6])
1561ab47cfaaSmrgfi
15626aec45a7Smrg])# _LT_COMPILER_OPTION
1563ab47cfaaSmrg
15646aec45a7Smrg# Old name:
15656aec45a7SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
15666aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
15676aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1568ab47cfaaSmrg
1569ab47cfaaSmrg
15706aec45a7Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
15716aec45a7Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
15726aec45a7Smrg# ----------------------------------------------------
15736aec45a7Smrg# Check whether the given linker option works
15746aec45a7SmrgAC_DEFUN([_LT_LINKER_OPTION],
15756aec45a7Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
15766aec45a7Smrgm4_require([_LT_DECL_SED])dnl
15776aec45a7SmrgAC_CACHE_CHECK([$1], [$2],
15786aec45a7Smrg  [$2=no
15796aec45a7Smrg   save_LDFLAGS="$LDFLAGS"
15806aec45a7Smrg   LDFLAGS="$LDFLAGS $3"
15816aec45a7Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
15826aec45a7Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
15836aec45a7Smrg     # The linker can only warn and ignore the option if not recognized
15846aec45a7Smrg     # So say no if there are warnings
15856aec45a7Smrg     if test -s conftest.err; then
15866aec45a7Smrg       # Append any errors to the config.log.
15876aec45a7Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
15886aec45a7Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
15896aec45a7Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
15906aec45a7Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
15916aec45a7Smrg         $2=yes
15926aec45a7Smrg       fi
15936aec45a7Smrg     else
15946aec45a7Smrg       $2=yes
15956aec45a7Smrg     fi
15966aec45a7Smrg   fi
15976aec45a7Smrg   $RM -r conftest*
15986aec45a7Smrg   LDFLAGS="$save_LDFLAGS"
15996aec45a7Smrg])
1600ab47cfaaSmrg
16016aec45a7Smrgif test x"[$]$2" = xyes; then
16026aec45a7Smrg    m4_if([$4], , :, [$4])
1603ab47cfaaSmrgelse
16046aec45a7Smrg    m4_if([$5], , :, [$5])
1605ab47cfaaSmrgfi
16066aec45a7Smrg])# _LT_LINKER_OPTION
1607ab47cfaaSmrg
16086aec45a7Smrg# Old name:
16096aec45a7SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
16106aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
16116aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1612ab47cfaaSmrg
1613ab47cfaaSmrg
16146aec45a7Smrg# LT_CMD_MAX_LEN
16156aec45a7Smrg#---------------
16166aec45a7SmrgAC_DEFUN([LT_CMD_MAX_LEN],
16176aec45a7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
16186aec45a7Smrg# find the maximum length of command line arguments
16196aec45a7SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
16206aec45a7SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
16216aec45a7Smrg  i=0
16226aec45a7Smrg  teststring="ABCD"
1623ab47cfaaSmrg
16246aec45a7Smrg  case $build_os in
16256aec45a7Smrg  msdosdjgpp*)
16266aec45a7Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
16276aec45a7Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
16286aec45a7Smrg    # during glob expansion).  Even if it were fixed, the result of this
16296aec45a7Smrg    # check would be larger than it should be.
16306aec45a7Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
16316aec45a7Smrg    ;;
1632ab47cfaaSmrg
16336aec45a7Smrg  gnu*)
16346aec45a7Smrg    # Under GNU Hurd, this test is not required because there is
16356aec45a7Smrg    # no limit to the length of command line arguments.
16366aec45a7Smrg    # Libtool will interpret -1 as no limit whatsoever
16376aec45a7Smrg    lt_cv_sys_max_cmd_len=-1;
16386aec45a7Smrg    ;;
1639ab47cfaaSmrg
16406aec45a7Smrg  cygwin* | mingw* | cegcc*)
16416aec45a7Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
16426aec45a7Smrg    # about 5 minutes as the teststring grows exponentially.
16436aec45a7Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
16446aec45a7Smrg    # you end up with a "frozen" computer, even though with patience
16456aec45a7Smrg    # the test eventually succeeds (with a max line length of 256k).
16466aec45a7Smrg    # Instead, let's just punt: use the minimum linelength reported by
16476aec45a7Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
16486aec45a7Smrg    lt_cv_sys_max_cmd_len=8192;
16496aec45a7Smrg    ;;
1650ab47cfaaSmrg
16516aec45a7Smrg  mint*)
16526aec45a7Smrg    # On MiNT this can take a long time and run out of memory.
16536aec45a7Smrg    lt_cv_sys_max_cmd_len=8192;
16546aec45a7Smrg    ;;
1655ab47cfaaSmrg
16566aec45a7Smrg  amigaos*)
16576aec45a7Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
16586aec45a7Smrg    # So we just punt and use a minimum line length of 8192.
16596aec45a7Smrg    lt_cv_sys_max_cmd_len=8192;
16606aec45a7Smrg    ;;
1661ab47cfaaSmrg
16626aec45a7Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
16636aec45a7Smrg    # This has been around since 386BSD, at least.  Likely further.
16646aec45a7Smrg    if test -x /sbin/sysctl; then
16656aec45a7Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
16666aec45a7Smrg    elif test -x /usr/sbin/sysctl; then
16676aec45a7Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1668ab47cfaaSmrg    else
16696aec45a7Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1670ab47cfaaSmrg    fi
16716aec45a7Smrg    # And add a safety zone
16726aec45a7Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
16736aec45a7Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
16746aec45a7Smrg    ;;
1675ab47cfaaSmrg
16766aec45a7Smrg  interix*)
16776aec45a7Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
16786aec45a7Smrg    lt_cv_sys_max_cmd_len=196608
16796aec45a7Smrg    ;;
1680ab47cfaaSmrg
1681aa9e3350Smrg  os2*)
1682aa9e3350Smrg    # The test takes a long time on OS/2.
1683aa9e3350Smrg    lt_cv_sys_max_cmd_len=8192
1684aa9e3350Smrg    ;;
1685aa9e3350Smrg
16866aec45a7Smrg  osf*)
16876aec45a7Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
16886aec45a7Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
16896aec45a7Smrg    # nice to cause kernel panics so lets avoid the loop below.
16906aec45a7Smrg    # First set a reasonable default.
16916aec45a7Smrg    lt_cv_sys_max_cmd_len=16384
16926aec45a7Smrg    #
16936aec45a7Smrg    if test -x /sbin/sysconfig; then
16946aec45a7Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
16956aec45a7Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
16966aec45a7Smrg      esac
16976aec45a7Smrg    fi
16986aec45a7Smrg    ;;
16996aec45a7Smrg  sco3.2v5*)
17006aec45a7Smrg    lt_cv_sys_max_cmd_len=102400
17016aec45a7Smrg    ;;
17026aec45a7Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
17036aec45a7Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
17046aec45a7Smrg    if test -n "$kargmax"; then
17056aec45a7Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
17066aec45a7Smrg    else
17076aec45a7Smrg      lt_cv_sys_max_cmd_len=32768
17086aec45a7Smrg    fi
1709ab47cfaaSmrg    ;;
1710ab47cfaaSmrg  *)
17116aec45a7Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
171238770048Smrg    if test -n "$lt_cv_sys_max_cmd_len" && \
171338770048Smrg	test undefined != "$lt_cv_sys_max_cmd_len"; then
17146aec45a7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
17156aec45a7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
17166aec45a7Smrg    else
17176aec45a7Smrg      # Make teststring a little bigger before we do anything with it.
17186aec45a7Smrg      # a 1K string should be a reasonable start.
17196aec45a7Smrg      for i in 1 2 3 4 5 6 7 8 ; do
17206aec45a7Smrg        teststring=$teststring$teststring
17216aec45a7Smrg      done
17226aec45a7Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
17236aec45a7Smrg      # If test is not a shell built-in, we'll probably end up computing a
17246aec45a7Smrg      # maximum length that is only half of the actual maximum length, but
17256aec45a7Smrg      # we can't tell.
1726aa9e3350Smrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
17276aec45a7Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
17286aec45a7Smrg	      test $i != 17 # 1/2 MB should be enough
17296aec45a7Smrg      do
17306aec45a7Smrg        i=`expr $i + 1`
17316aec45a7Smrg        teststring=$teststring$teststring
17326aec45a7Smrg      done
17336aec45a7Smrg      # Only check the string length outside the loop.
17346aec45a7Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
17356aec45a7Smrg      teststring=
17366aec45a7Smrg      # Add a significant safety factor because C++ compilers can tack on
17376aec45a7Smrg      # massive amounts of additional arguments before passing them to the
17386aec45a7Smrg      # linker.  It appears as though 1/2 is a usable value.
17396aec45a7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
17406aec45a7Smrg    fi
1741ab47cfaaSmrg    ;;
1742ab47cfaaSmrg  esac
17436aec45a7Smrg])
17446aec45a7Smrgif test -n $lt_cv_sys_max_cmd_len ; then
17456aec45a7Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
17466aec45a7Smrgelse
17476aec45a7Smrg  AC_MSG_RESULT(none)
17486aec45a7Smrgfi
17496aec45a7Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
17506aec45a7Smrg_LT_DECL([], [max_cmd_len], [0],
17516aec45a7Smrg    [What is the maximum length of a command?])
17526aec45a7Smrg])# LT_CMD_MAX_LEN
1753ab47cfaaSmrg
17546aec45a7Smrg# Old name:
17556aec45a7SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
17566aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
17576aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1758ab47cfaaSmrg
1759ab47cfaaSmrg
17606aec45a7Smrg# _LT_HEADER_DLFCN
17616aec45a7Smrg# ----------------
17626aec45a7Smrgm4_defun([_LT_HEADER_DLFCN],
17636aec45a7Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
17646aec45a7Smrg])# _LT_HEADER_DLFCN
1765ab47cfaaSmrg
17666aec45a7Smrg
17676aec45a7Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
17686aec45a7Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
17696aec45a7Smrg# ----------------------------------------------------------------
17706aec45a7Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
17716aec45a7Smrg[m4_require([_LT_HEADER_DLFCN])dnl
17726aec45a7Smrgif test "$cross_compiling" = yes; then :
17736aec45a7Smrg  [$4]
17746aec45a7Smrgelse
17756aec45a7Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
17766aec45a7Smrg  lt_status=$lt_dlunknown
17776aec45a7Smrg  cat > conftest.$ac_ext <<_LT_EOF
17786aec45a7Smrg[#line $LINENO "configure"
17796aec45a7Smrg#include "confdefs.h"
17806aec45a7Smrg
17816aec45a7Smrg#if HAVE_DLFCN_H
17826aec45a7Smrg#include <dlfcn.h>
17836aec45a7Smrg#endif
17846aec45a7Smrg
17856aec45a7Smrg#include <stdio.h>
17866aec45a7Smrg
17876aec45a7Smrg#ifdef RTLD_GLOBAL
17886aec45a7Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
17896aec45a7Smrg#else
17906aec45a7Smrg#  ifdef DL_GLOBAL
17916aec45a7Smrg#    define LT_DLGLOBAL		DL_GLOBAL
17926aec45a7Smrg#  else
17936aec45a7Smrg#    define LT_DLGLOBAL		0
17946aec45a7Smrg#  endif
17956aec45a7Smrg#endif
17966aec45a7Smrg
17976aec45a7Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
17986aec45a7Smrg   find out it does not work in some platform. */
17996aec45a7Smrg#ifndef LT_DLLAZY_OR_NOW
18006aec45a7Smrg#  ifdef RTLD_LAZY
18016aec45a7Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
18026aec45a7Smrg#  else
18036aec45a7Smrg#    ifdef DL_LAZY
18046aec45a7Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
18056aec45a7Smrg#    else
18066aec45a7Smrg#      ifdef RTLD_NOW
18076aec45a7Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
18086aec45a7Smrg#      else
18096aec45a7Smrg#        ifdef DL_NOW
18106aec45a7Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
18116aec45a7Smrg#        else
18126aec45a7Smrg#          define LT_DLLAZY_OR_NOW	0
18136aec45a7Smrg#        endif
18146aec45a7Smrg#      endif
18156aec45a7Smrg#    endif
18166aec45a7Smrg#  endif
18176aec45a7Smrg#endif
18186aec45a7Smrg
18196aec45a7Smrg/* When -fvisbility=hidden is used, assume the code has been annotated
18206aec45a7Smrg   correspondingly for the symbols needed.  */
18216aec45a7Smrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1822aa9e3350Smrgint fnord () __attribute__((visibility("default")));
18236aec45a7Smrg#endif
18246aec45a7Smrg
1825aa9e3350Smrgint fnord () { return 42; }
18266aec45a7Smrgint main ()
18276aec45a7Smrg{
18286aec45a7Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
18296aec45a7Smrg  int status = $lt_dlunknown;
18306aec45a7Smrg
18316aec45a7Smrg  if (self)
18326aec45a7Smrg    {
18336aec45a7Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
18346aec45a7Smrg      else
18356aec45a7Smrg        {
18366aec45a7Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
18376aec45a7Smrg          else puts (dlerror ());
18386aec45a7Smrg	}
18396aec45a7Smrg      /* dlclose (self); */
18406aec45a7Smrg    }
1841ab47cfaaSmrg  else
18426aec45a7Smrg    puts (dlerror ());
18436aec45a7Smrg
18446aec45a7Smrg  return status;
18456aec45a7Smrg}]
18466aec45a7Smrg_LT_EOF
18476aec45a7Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
18486aec45a7Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
18496aec45a7Smrg    lt_status=$?
18506aec45a7Smrg    case x$lt_status in
18516aec45a7Smrg      x$lt_dlno_uscore) $1 ;;
18526aec45a7Smrg      x$lt_dlneed_uscore) $2 ;;
18536aec45a7Smrg      x$lt_dlunknown|x*) $3 ;;
1854ab47cfaaSmrg    esac
18556aec45a7Smrg  else :
18566aec45a7Smrg    # compilation failed
18576aec45a7Smrg    $3
1858ab47cfaaSmrg  fi
18596aec45a7Smrgfi
18606aec45a7Smrgrm -fr conftest*
18616aec45a7Smrg])# _LT_TRY_DLOPEN_SELF
18626aec45a7Smrg
18636aec45a7Smrg
18646aec45a7Smrg# LT_SYS_DLOPEN_SELF
18656aec45a7Smrg# ------------------
18666aec45a7SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
18676aec45a7Smrg[m4_require([_LT_HEADER_DLFCN])dnl
18686aec45a7Smrgif test "x$enable_dlopen" != xyes; then
18696aec45a7Smrg  enable_dlopen=unknown
18706aec45a7Smrg  enable_dlopen_self=unknown
18716aec45a7Smrg  enable_dlopen_self_static=unknown
18726aec45a7Smrgelse
18736aec45a7Smrg  lt_cv_dlopen=no
18746aec45a7Smrg  lt_cv_dlopen_libs=
18756aec45a7Smrg
1876ab47cfaaSmrg  case $host_os in
18776aec45a7Smrg  beos*)
18786aec45a7Smrg    lt_cv_dlopen="load_add_on"
18796aec45a7Smrg    lt_cv_dlopen_libs=
18806aec45a7Smrg    lt_cv_dlopen_self=yes
1881ab47cfaaSmrg    ;;
18826aec45a7Smrg
18836aec45a7Smrg  mingw* | pw32* | cegcc*)
18846aec45a7Smrg    lt_cv_dlopen="LoadLibrary"
18856aec45a7Smrg    lt_cv_dlopen_libs=
1886ab47cfaaSmrg    ;;
18876aec45a7Smrg
18886aec45a7Smrg  cygwin*)
18896aec45a7Smrg    lt_cv_dlopen="dlopen"
18906aec45a7Smrg    lt_cv_dlopen_libs=
1891ab47cfaaSmrg    ;;
18926aec45a7Smrg
18936aec45a7Smrg  darwin*)
18946aec45a7Smrg  # if libdl is installed we need to link against it
18956aec45a7Smrg    AC_CHECK_LIB([dl], [dlopen],
18966aec45a7Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
18976aec45a7Smrg    lt_cv_dlopen="dyld"
18986aec45a7Smrg    lt_cv_dlopen_libs=
18996aec45a7Smrg    lt_cv_dlopen_self=yes
19006aec45a7Smrg    ])
19016aec45a7Smrg    ;;
19026aec45a7Smrg
19036aec45a7Smrg  *)
19046aec45a7Smrg    AC_CHECK_FUNC([shl_load],
19056aec45a7Smrg	  [lt_cv_dlopen="shl_load"],
19066aec45a7Smrg      [AC_CHECK_LIB([dld], [shl_load],
19076aec45a7Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
19086aec45a7Smrg	[AC_CHECK_FUNC([dlopen],
19096aec45a7Smrg	      [lt_cv_dlopen="dlopen"],
19106aec45a7Smrg	  [AC_CHECK_LIB([dl], [dlopen],
19116aec45a7Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
19126aec45a7Smrg	    [AC_CHECK_LIB([svld], [dlopen],
19136aec45a7Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
19146aec45a7Smrg	      [AC_CHECK_LIB([dld], [dld_link],
19156aec45a7Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
19166aec45a7Smrg	      ])
19176aec45a7Smrg	    ])
19186aec45a7Smrg	  ])
19196aec45a7Smrg	])
19206aec45a7Smrg      ])
1921ab47cfaaSmrg    ;;
1922ab47cfaaSmrg  esac
1923ab47cfaaSmrg
19246aec45a7Smrg  if test "x$lt_cv_dlopen" != xno; then
19256aec45a7Smrg    enable_dlopen=yes
19266aec45a7Smrg  else
19276aec45a7Smrg    enable_dlopen=no
19286aec45a7Smrg  fi
1929ab47cfaaSmrg
19306aec45a7Smrg  case $lt_cv_dlopen in
19316aec45a7Smrg  dlopen)
19326aec45a7Smrg    save_CPPFLAGS="$CPPFLAGS"
19336aec45a7Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
19346aec45a7Smrg
19356aec45a7Smrg    save_LDFLAGS="$LDFLAGS"
19366aec45a7Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
19376aec45a7Smrg
19386aec45a7Smrg    save_LIBS="$LIBS"
19396aec45a7Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
19406aec45a7Smrg
19416aec45a7Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
19426aec45a7Smrg	  lt_cv_dlopen_self, [dnl
19436aec45a7Smrg	  _LT_TRY_DLOPEN_SELF(
19446aec45a7Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
19456aec45a7Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
19466aec45a7Smrg    ])
19476aec45a7Smrg
19486aec45a7Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
19496aec45a7Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
19506aec45a7Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
19516aec45a7Smrg	  lt_cv_dlopen_self_static, [dnl
19526aec45a7Smrg	  _LT_TRY_DLOPEN_SELF(
19536aec45a7Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
19546aec45a7Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
19556aec45a7Smrg      ])
1956ab47cfaaSmrg    fi
19576aec45a7Smrg
19586aec45a7Smrg    CPPFLAGS="$save_CPPFLAGS"
19596aec45a7Smrg    LDFLAGS="$save_LDFLAGS"
19606aec45a7Smrg    LIBS="$save_LIBS"
1961ab47cfaaSmrg    ;;
1962ab47cfaaSmrg  esac
1963ab47cfaaSmrg
19646aec45a7Smrg  case $lt_cv_dlopen_self in
19656aec45a7Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
19666aec45a7Smrg  *) enable_dlopen_self=unknown ;;
1967ab47cfaaSmrg  esac
19686aec45a7Smrg
19696aec45a7Smrg  case $lt_cv_dlopen_self_static in
19706aec45a7Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
19716aec45a7Smrg  *) enable_dlopen_self_static=unknown ;;
1972ab47cfaaSmrg  esac
19736aec45a7Smrgfi
19746aec45a7Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
19756aec45a7Smrg	 [Whether dlopen is supported])
19766aec45a7Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
19776aec45a7Smrg	 [Whether dlopen of programs is supported])
19786aec45a7Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
19796aec45a7Smrg	 [Whether dlopen of statically linked programs is supported])
19806aec45a7Smrg])# LT_SYS_DLOPEN_SELF
1981ab47cfaaSmrg
19826aec45a7Smrg# Old name:
19836aec45a7SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
19846aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
19856aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1986ab47cfaaSmrg
1987ab47cfaaSmrg
19886aec45a7Smrg# _LT_COMPILER_C_O([TAGNAME])
19896aec45a7Smrg# ---------------------------
19906aec45a7Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
19916aec45a7Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
19926aec45a7Smrgm4_defun([_LT_COMPILER_C_O],
19936aec45a7Smrg[m4_require([_LT_DECL_SED])dnl
19946aec45a7Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
19956aec45a7Smrgm4_require([_LT_TAG_COMPILER])dnl
19966aec45a7SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
19976aec45a7Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
19986aec45a7Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
19996aec45a7Smrg   $RM -r conftest 2>/dev/null
20006aec45a7Smrg   mkdir conftest
20016aec45a7Smrg   cd conftest
20026aec45a7Smrg   mkdir out
20036aec45a7Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
20046aec45a7Smrg
20056aec45a7Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
20066aec45a7Smrg   # Insert the option either (1) after the last *FLAGS variable, or
20076aec45a7Smrg   # (2) before a word containing "conftest.", or (3) at the end.
20086aec45a7Smrg   # Note that $ac_compile itself does not contain backslashes and begins
20096aec45a7Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
20106aec45a7Smrg   lt_compile=`echo "$ac_compile" | $SED \
20116aec45a7Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
20126aec45a7Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
20136aec45a7Smrg   -e 's:$: $lt_compiler_flag:'`
20146aec45a7Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
20156aec45a7Smrg   (eval "$lt_compile" 2>out/conftest.err)
20166aec45a7Smrg   ac_status=$?
20176aec45a7Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
20186aec45a7Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
20196aec45a7Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
20206aec45a7Smrg   then
20216aec45a7Smrg     # The compiler can only warn and ignore the option if not recognized
20226aec45a7Smrg     # So say no if there are warnings
20236aec45a7Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
20246aec45a7Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
20256aec45a7Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
20266aec45a7Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
20276aec45a7Smrg     fi
20286aec45a7Smrg   fi
20296aec45a7Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
20306aec45a7Smrg   $RM conftest*
20316aec45a7Smrg   # SGI C++ compiler will create directory out/ii_files/ for
20326aec45a7Smrg   # template instantiation
20336aec45a7Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
20346aec45a7Smrg   $RM out/* && rmdir out
20356aec45a7Smrg   cd ..
20366aec45a7Smrg   $RM -r conftest
20376aec45a7Smrg   $RM conftest*
20386aec45a7Smrg])
20396aec45a7Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
20406aec45a7Smrg	[Does compiler simultaneously support -c and -o options?])
20416aec45a7Smrg])# _LT_COMPILER_C_O
20426aec45a7Smrg
20436aec45a7Smrg
20446aec45a7Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
20456aec45a7Smrg# ----------------------------------
20466aec45a7Smrg# Check to see if we can do hard links to lock some files if needed
20476aec45a7Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
20486aec45a7Smrg[m4_require([_LT_ENABLE_LOCK])dnl
20496aec45a7Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
20506aec45a7Smrg_LT_COMPILER_C_O([$1])
20516aec45a7Smrg
20526aec45a7Smrghard_links="nottested"
20536aec45a7Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
20546aec45a7Smrg  # do not overwrite the value of need_locks provided by the user
20556aec45a7Smrg  AC_MSG_CHECKING([if we can lock with hard links])
20566aec45a7Smrg  hard_links=yes
20576aec45a7Smrg  $RM conftest*
20586aec45a7Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
20596aec45a7Smrg  touch conftest.a
20606aec45a7Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
20616aec45a7Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
20626aec45a7Smrg  AC_MSG_RESULT([$hard_links])
20636aec45a7Smrg  if test "$hard_links" = no; then
20646aec45a7Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
20656aec45a7Smrg    need_locks=warn
2066ab47cfaaSmrg  fi
20676aec45a7Smrgelse
20686aec45a7Smrg  need_locks=no
20696aec45a7Smrgfi
20706aec45a7Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
20716aec45a7Smrg])# _LT_COMPILER_FILE_LOCKS
2072ab47cfaaSmrg
2073ab47cfaaSmrg
20746aec45a7Smrg# _LT_CHECK_OBJDIR
20756aec45a7Smrg# ----------------
20766aec45a7Smrgm4_defun([_LT_CHECK_OBJDIR],
20776aec45a7Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
20786aec45a7Smrg[rm -f .libs 2>/dev/null
20796aec45a7Smrgmkdir .libs 2>/dev/null
20806aec45a7Smrgif test -d .libs; then
20816aec45a7Smrg  lt_cv_objdir=.libs
20826aec45a7Smrgelse
20836aec45a7Smrg  # MS-DOS does not allow filenames that begin with a dot.
20846aec45a7Smrg  lt_cv_objdir=_libs
20856aec45a7Smrgfi
20866aec45a7Smrgrmdir .libs 2>/dev/null])
20876aec45a7Smrgobjdir=$lt_cv_objdir
20886aec45a7Smrg_LT_DECL([], [objdir], [0],
20896aec45a7Smrg         [The name of the directory that contains temporary libtool files])dnl
20906aec45a7Smrgm4_pattern_allow([LT_OBJDIR])dnl
20916aec45a7SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
20926aec45a7Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
20936aec45a7Smrg])# _LT_CHECK_OBJDIR
20946aec45a7Smrg
20956aec45a7Smrg
20966aec45a7Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
20976aec45a7Smrg# --------------------------------------
20986aec45a7Smrg# Check hardcoding attributes.
20996aec45a7Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
21006aec45a7Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
21016aec45a7Smrg_LT_TAGVAR(hardcode_action, $1)=
21026aec45a7Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
21036aec45a7Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
21046aec45a7Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
21056aec45a7Smrg
21066aec45a7Smrg  # We can hardcode non-existent directories.
21076aec45a7Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
21086aec45a7Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
21096aec45a7Smrg     # have to relink, otherwise we might link with an installed library
21106aec45a7Smrg     # when we should be linking with a yet-to-be-installed one
21116aec45a7Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
21126aec45a7Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
21136aec45a7Smrg    # Linking always hardcodes the temporary library directory.
21146aec45a7Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
2115ab47cfaaSmrg  else
21166aec45a7Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
21176aec45a7Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
2118ab47cfaaSmrg  fi
21196aec45a7Smrgelse
21206aec45a7Smrg  # We cannot hardcode anything, or else we can only hardcode existing
21216aec45a7Smrg  # directories.
21226aec45a7Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
21236aec45a7Smrgfi
21246aec45a7SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2125ab47cfaaSmrg
21266aec45a7Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
21276aec45a7Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
21286aec45a7Smrg  # Fast installation is not supported
21296aec45a7Smrg  enable_fast_install=no
21306aec45a7Smrgelif test "$shlibpath_overrides_runpath" = yes ||
21316aec45a7Smrg     test "$enable_shared" = no; then
21326aec45a7Smrg  # Fast installation is not necessary
21336aec45a7Smrg  enable_fast_install=needless
21346aec45a7Smrgfi
21356aec45a7Smrg_LT_TAGDECL([], [hardcode_action], [0],
21366aec45a7Smrg    [How to hardcode a shared library path into an executable])
21376aec45a7Smrg])# _LT_LINKER_HARDCODE_LIBPATH
2138ab47cfaaSmrg
21396aec45a7Smrg
21406aec45a7Smrg# _LT_CMD_STRIPLIB
21416aec45a7Smrg# ----------------
21426aec45a7Smrgm4_defun([_LT_CMD_STRIPLIB],
21436aec45a7Smrg[m4_require([_LT_DECL_EGREP])
21446aec45a7Smrgstriplib=
21456aec45a7Smrgold_striplib=
21466aec45a7SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
21476aec45a7Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
21486aec45a7Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
21496aec45a7Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
21506aec45a7Smrg  AC_MSG_RESULT([yes])
21516aec45a7Smrgelse
21526aec45a7Smrg# FIXME - insert some real tests, host_os isn't really good enough
21536aec45a7Smrg  case $host_os in
21546aec45a7Smrg  darwin*)
21556aec45a7Smrg    if test -n "$STRIP" ; then
21566aec45a7Smrg      striplib="$STRIP -x"
21576aec45a7Smrg      old_striplib="$STRIP -S"
21586aec45a7Smrg      AC_MSG_RESULT([yes])
21596aec45a7Smrg    else
21606aec45a7Smrg      AC_MSG_RESULT([no])
21616aec45a7Smrg    fi
21626aec45a7Smrg    ;;
21636aec45a7Smrg  *)
21646aec45a7Smrg    AC_MSG_RESULT([no])
21656aec45a7Smrg    ;;
21666aec45a7Smrg  esac
21676aec45a7Smrgfi
21686aec45a7Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
21696aec45a7Smrg_LT_DECL([], [striplib], [1])
21706aec45a7Smrg])# _LT_CMD_STRIPLIB
21716aec45a7Smrg
21726aec45a7Smrg
21736aec45a7Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
21746aec45a7Smrg# -----------------------------
21756aec45a7Smrg# PORTME Fill in your ld.so characteristics
21766aec45a7Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
21776aec45a7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
21786aec45a7Smrgm4_require([_LT_DECL_EGREP])dnl
21796aec45a7Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
21806aec45a7Smrgm4_require([_LT_DECL_OBJDUMP])dnl
21816aec45a7Smrgm4_require([_LT_DECL_SED])dnl
21826aec45a7Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
21836aec45a7SmrgAC_MSG_CHECKING([dynamic linker characteristics])
21846aec45a7Smrgm4_if([$1],
21856aec45a7Smrg	[], [
21866aec45a7Smrgif test "$GCC" = yes; then
21876aec45a7Smrg  case $host_os in
21886aec45a7Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
21896aec45a7Smrg    *) lt_awk_arg="/^libraries:/" ;;
21906aec45a7Smrg  esac
21916aec45a7Smrg  case $host_os in
21926aec45a7Smrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
21936aec45a7Smrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
21946aec45a7Smrg  esac
21956aec45a7Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
21966aec45a7Smrg  case $lt_search_path_spec in
21976aec45a7Smrg  *\;*)
21986aec45a7Smrg    # if the path contains ";" then we assume it to be the separator
21996aec45a7Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
22006aec45a7Smrg    # assumed that no part of a normal pathname contains ";" but that should
22016aec45a7Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
22026aec45a7Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
22036aec45a7Smrg    ;;
22046aec45a7Smrg  *)
22056aec45a7Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
22066aec45a7Smrg    ;;
22076aec45a7Smrg  esac
22086aec45a7Smrg  # Ok, now we have the path, separated by spaces, we can step through it
22096aec45a7Smrg  # and add multilib dir if necessary.
22106aec45a7Smrg  lt_tmp_lt_search_path_spec=
22116aec45a7Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
22126aec45a7Smrg  for lt_sys_path in $lt_search_path_spec; do
22136aec45a7Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
22146aec45a7Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
22156aec45a7Smrg    else
22166aec45a7Smrg      test -d "$lt_sys_path" && \
22176aec45a7Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
22186aec45a7Smrg    fi
22196aec45a7Smrg  done
22206aec45a7Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
22216aec45a7SmrgBEGIN {RS=" "; FS="/|\n";} {
22226aec45a7Smrg  lt_foo="";
22236aec45a7Smrg  lt_count=0;
22246aec45a7Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
22256aec45a7Smrg    if ($lt_i != "" && $lt_i != ".") {
22266aec45a7Smrg      if ($lt_i == "..") {
22276aec45a7Smrg        lt_count++;
22286aec45a7Smrg      } else {
22296aec45a7Smrg        if (lt_count == 0) {
22306aec45a7Smrg          lt_foo="/" $lt_i lt_foo;
22316aec45a7Smrg        } else {
22326aec45a7Smrg          lt_count--;
22336aec45a7Smrg        }
22346aec45a7Smrg      }
22356aec45a7Smrg    }
22366aec45a7Smrg  }
22376aec45a7Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
22386aec45a7Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
22396aec45a7Smrg}'`
22406aec45a7Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
22416aec45a7Smrg  # for these hosts.
22426aec45a7Smrg  case $host_os in
22436aec45a7Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
22446aec45a7Smrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
22456aec45a7Smrg  esac
22466aec45a7Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
22476aec45a7Smrgelse
22486aec45a7Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
22496aec45a7Smrgfi])
22506aec45a7Smrglibrary_names_spec=
22516aec45a7Smrglibname_spec='lib$name'
22526aec45a7Smrgsoname_spec=
22536aec45a7Smrgshrext_cmds=".so"
22546aec45a7Smrgpostinstall_cmds=
22556aec45a7Smrgpostuninstall_cmds=
22566aec45a7Smrgfinish_cmds=
22576aec45a7Smrgfinish_eval=
22586aec45a7Smrgshlibpath_var=
22596aec45a7Smrgshlibpath_overrides_runpath=unknown
22606aec45a7Smrgversion_type=none
22616aec45a7Smrgdynamic_linker="$host_os ld.so"
22626aec45a7Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
22636aec45a7Smrgneed_lib_prefix=unknown
22646aec45a7Smrghardcode_into_libs=no
22656aec45a7Smrg
22666aec45a7Smrg# when you set need_version to no, make sure it does not cause -set_version
22676aec45a7Smrg# flags to be left without arguments
22686aec45a7Smrgneed_version=unknown
22696aec45a7Smrg
22706aec45a7Smrgcase $host_os in
22716aec45a7Smrgaix3*)
2272aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
22736aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
22746aec45a7Smrg  shlibpath_var=LIBPATH
22756aec45a7Smrg
22766aec45a7Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
2277ab47cfaaSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2278ab47cfaaSmrg  ;;
2279ab47cfaaSmrg
22806aec45a7Smrgaix[[4-9]]*)
2281aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2282ab47cfaaSmrg  need_lib_prefix=no
22836aec45a7Smrg  need_version=no
22846aec45a7Smrg  hardcode_into_libs=yes
22856aec45a7Smrg  if test "$host_cpu" = ia64; then
22866aec45a7Smrg    # AIX 5 supports IA64
22876aec45a7Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
22886aec45a7Smrg    shlibpath_var=LD_LIBRARY_PATH
2289ab47cfaaSmrg  else
22906aec45a7Smrg    # With GCC up to 2.95.x, collect2 would create an import file
22916aec45a7Smrg    # for dependence libraries.  The import file would start with
22926aec45a7Smrg    # the line `#! .'.  This would cause the generated library to
22936aec45a7Smrg    # depend on `.', always an invalid library.  This was fixed in
22946aec45a7Smrg    # development snapshots of GCC prior to 3.0.
22956aec45a7Smrg    case $host_os in
22966aec45a7Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
22976aec45a7Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
22986aec45a7Smrg	   echo ' yes '
22996aec45a7Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
23006aec45a7Smrg	:
23016aec45a7Smrg      else
23026aec45a7Smrg	can_build_shared=no
23036aec45a7Smrg      fi
23046aec45a7Smrg      ;;
23056aec45a7Smrg    esac
23066aec45a7Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
23076aec45a7Smrg    # soname into executable. Probably we can add versioning support to
23086aec45a7Smrg    # collect2, so additional links can be useful in future.
23096aec45a7Smrg    if test "$aix_use_runtimelinking" = yes; then
23106aec45a7Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
23116aec45a7Smrg      # instead of lib<name>.a to let people know that these are not
23126aec45a7Smrg      # typical AIX shared libraries.
23136aec45a7Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23146aec45a7Smrg    else
23156aec45a7Smrg      # We preserve .a as extension for shared libraries through AIX4.2
23166aec45a7Smrg      # and later when we are not doing run time linking.
23176aec45a7Smrg      library_names_spec='${libname}${release}.a $libname.a'
23186aec45a7Smrg      soname_spec='${libname}${release}${shared_ext}$major'
23196aec45a7Smrg    fi
23206aec45a7Smrg    shlibpath_var=LIBPATH
2321ab47cfaaSmrg  fi
2322ab47cfaaSmrg  ;;
2323ab47cfaaSmrg
23246aec45a7Smrgamigaos*)
23256aec45a7Smrg  case $host_cpu in
23266aec45a7Smrg  powerpc)
23276aec45a7Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
23286aec45a7Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
23296aec45a7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23306aec45a7Smrg    ;;
23316aec45a7Smrg  m68k)
23326aec45a7Smrg    library_names_spec='$libname.ixlibrary $libname.a'
23336aec45a7Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
23346aec45a7Smrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
23356aec45a7Smrg    ;;
23366aec45a7Smrg  esac
2337ab47cfaaSmrg  ;;
2338ab47cfaaSmrg
23396aec45a7Smrgbeos*)
23406aec45a7Smrg  library_names_spec='${libname}${shared_ext}'
23416aec45a7Smrg  dynamic_linker="$host_os ld.so"
23426aec45a7Smrg  shlibpath_var=LIBRARY_PATH
23436aec45a7Smrg  ;;
23446aec45a7Smrg
23456aec45a7Smrgbsdi[[45]]*)
2346aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2347ab47cfaaSmrg  need_version=no
2348ab47cfaaSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23496aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
23506aec45a7Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2351ab47cfaaSmrg  shlibpath_var=LD_LIBRARY_PATH
23526aec45a7Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
23536aec45a7Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
23546aec45a7Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
23556aec45a7Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
23566aec45a7Smrg  # libtool to hard-code these into programs
2357ab47cfaaSmrg  ;;
2358ab47cfaaSmrg
23596aec45a7Smrgcygwin* | mingw* | pw32* | cegcc*)
23606aec45a7Smrg  version_type=windows
23616aec45a7Smrg  shrext_cmds=".dll"
23626aec45a7Smrg  need_version=no
23636aec45a7Smrg  need_lib_prefix=no
23646aec45a7Smrg
2365aa9e3350Smrg  case $GCC,$cc_basename in
2366aa9e3350Smrg  yes,*)
2367aa9e3350Smrg    # gcc
23686aec45a7Smrg    library_names_spec='$libname.dll.a'
23696aec45a7Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
23706aec45a7Smrg    postinstall_cmds='base_file=`basename \${file}`~
23716aec45a7Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
23726aec45a7Smrg      dldir=$destdir/`dirname \$dlpath`~
23736aec45a7Smrg      test -d \$dldir || mkdir -p \$dldir~
23746aec45a7Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
23756aec45a7Smrg      chmod a+x \$dldir/$dlname~
23766aec45a7Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
23776aec45a7Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
23786aec45a7Smrg      fi'
23796aec45a7Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
23806aec45a7Smrg      dlpath=$dir/\$dldll~
23816aec45a7Smrg       $RM \$dlpath'
23826aec45a7Smrg    shlibpath_overrides_runpath=yes
23836aec45a7Smrg
23846aec45a7Smrg    case $host_os in
23856aec45a7Smrg    cygwin*)
23866aec45a7Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
23876aec45a7Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
23886aec45a7Smrgm4_if([$1], [],[
23896aec45a7Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
23906aec45a7Smrg      ;;
23916aec45a7Smrg    mingw* | cegcc*)
23926aec45a7Smrg      # MinGW DLLs use traditional 'lib' prefix
23936aec45a7Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
23946aec45a7Smrg      ;;
23956aec45a7Smrg    pw32*)
23966aec45a7Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
23976aec45a7Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
23986aec45a7Smrg      ;;
23996aec45a7Smrg    esac
2400aa9e3350Smrg    dynamic_linker='Win32 ld.exe'
2401aa9e3350Smrg    ;;
2402aa9e3350Smrg
2403aa9e3350Smrg  *,cl*)
2404aa9e3350Smrg    # Native MSVC
2405aa9e3350Smrg    libname_spec='$name'
2406aa9e3350Smrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2407aa9e3350Smrg    library_names_spec='${libname}.dll.lib'
2408aa9e3350Smrg
2409aa9e3350Smrg    case $build_os in
2410aa9e3350Smrg    mingw*)
2411aa9e3350Smrg      sys_lib_search_path_spec=
2412aa9e3350Smrg      lt_save_ifs=$IFS
2413aa9e3350Smrg      IFS=';'
2414aa9e3350Smrg      for lt_path in $LIB
2415aa9e3350Smrg      do
2416aa9e3350Smrg        IFS=$lt_save_ifs
2417aa9e3350Smrg        # Let DOS variable expansion print the short 8.3 style file name.
2418aa9e3350Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2419aa9e3350Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2420aa9e3350Smrg      done
2421aa9e3350Smrg      IFS=$lt_save_ifs
2422aa9e3350Smrg      # Convert to MSYS style.
2423aa9e3350Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2424aa9e3350Smrg      ;;
2425aa9e3350Smrg    cygwin*)
2426aa9e3350Smrg      # Convert to unix form, then to dos form, then back to unix form
2427aa9e3350Smrg      # but this time dos style (no spaces!) so that the unix form looks
2428aa9e3350Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
2429aa9e3350Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2430aa9e3350Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2431aa9e3350Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2432aa9e3350Smrg      ;;
2433aa9e3350Smrg    *)
2434aa9e3350Smrg      sys_lib_search_path_spec="$LIB"
2435aa9e3350Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2436aa9e3350Smrg        # It is most probably a Windows format PATH.
2437aa9e3350Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2438aa9e3350Smrg      else
2439aa9e3350Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2440aa9e3350Smrg      fi
2441aa9e3350Smrg      # FIXME: find the short name or the path components, as spaces are
2442aa9e3350Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
2443aa9e3350Smrg      ;;
2444aa9e3350Smrg    esac
2445aa9e3350Smrg
2446aa9e3350Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2447aa9e3350Smrg    postinstall_cmds='base_file=`basename \${file}`~
2448aa9e3350Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2449aa9e3350Smrg      dldir=$destdir/`dirname \$dlpath`~
2450aa9e3350Smrg      test -d \$dldir || mkdir -p \$dldir~
2451aa9e3350Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
2452aa9e3350Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2453aa9e3350Smrg      dlpath=$dir/\$dldll~
2454aa9e3350Smrg       $RM \$dlpath'
2455aa9e3350Smrg    shlibpath_overrides_runpath=yes
2456aa9e3350Smrg    dynamic_linker='Win32 link.exe'
24576aec45a7Smrg    ;;
24586aec45a7Smrg
24596aec45a7Smrg  *)
2460aa9e3350Smrg    # Assume MSVC wrapper
24616aec45a7Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2462aa9e3350Smrg    dynamic_linker='Win32 ld.exe'
24636aec45a7Smrg    ;;
24646aec45a7Smrg  esac
24656aec45a7Smrg  # FIXME: first we should search . and the directory the executable is in
24666aec45a7Smrg  shlibpath_var=PATH
24678697ee19Smrg  ;;
24688697ee19Smrg
24696aec45a7Smrgdarwin* | rhapsody*)
24706aec45a7Smrg  dynamic_linker="$host_os dyld"
24716aec45a7Smrg  version_type=darwin
24726aec45a7Smrg  need_lib_prefix=no
24736aec45a7Smrg  need_version=no
24746aec45a7Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
24756aec45a7Smrg  soname_spec='${libname}${release}${major}$shared_ext'
24766aec45a7Smrg  shlibpath_overrides_runpath=yes
24776aec45a7Smrg  shlibpath_var=DYLD_LIBRARY_PATH
24786aec45a7Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
24796aec45a7Smrgm4_if([$1], [],[
24806aec45a7Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
24816aec45a7Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
24826aec45a7Smrg  ;;
24836aec45a7Smrg
24846aec45a7Smrgdgux*)
2485aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2486ab47cfaaSmrg  need_lib_prefix=no
2487ab47cfaaSmrg  need_version=no
24886aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2489ab47cfaaSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2490ab47cfaaSmrg  shlibpath_var=LD_LIBRARY_PATH
2491ab47cfaaSmrg  ;;
2492ab47cfaaSmrg
24936aec45a7Smrgfreebsd* | dragonfly*)
24946aec45a7Smrg  # DragonFly does not have aout.  When/if they implement a new
24956aec45a7Smrg  # versioning mechanism, adjust this.
24966aec45a7Smrg  if test -x /usr/bin/objformat; then
24976aec45a7Smrg    objformat=`/usr/bin/objformat`
24986aec45a7Smrg  else
24996aec45a7Smrg    case $host_os in
2500aa9e3350Smrg    freebsd[[23]].*) objformat=aout ;;
25016aec45a7Smrg    *) objformat=elf ;;
25026aec45a7Smrg    esac
25036aec45a7Smrg  fi
25046aec45a7Smrg  version_type=freebsd-$objformat
25056aec45a7Smrg  case $version_type in
25066aec45a7Smrg    freebsd-elf*)
25076aec45a7Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
25086aec45a7Smrg      need_version=no
2509ab47cfaaSmrg      need_lib_prefix=no
2510ab47cfaaSmrg      ;;
25116aec45a7Smrg    freebsd-*)
25126aec45a7Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
25136aec45a7Smrg      need_version=yes
2514ab47cfaaSmrg      ;;
2515ab47cfaaSmrg  esac
25166aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
25176aec45a7Smrg  case $host_os in
2518aa9e3350Smrg  freebsd2.*)
25196aec45a7Smrg    shlibpath_overrides_runpath=yes
25206aec45a7Smrg    ;;
25216aec45a7Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
25226aec45a7Smrg    shlibpath_overrides_runpath=yes
25236aec45a7Smrg    hardcode_into_libs=yes
25246aec45a7Smrg    ;;
25256aec45a7Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
25266aec45a7Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
25276aec45a7Smrg    shlibpath_overrides_runpath=no
25286aec45a7Smrg    hardcode_into_libs=yes
25296aec45a7Smrg    ;;
25306aec45a7Smrg  *) # from 4.6 on, and DragonFly
25316aec45a7Smrg    shlibpath_overrides_runpath=yes
25326aec45a7Smrg    hardcode_into_libs=yes
25336aec45a7Smrg    ;;
25346aec45a7Smrg  esac
2535ab47cfaaSmrg  ;;
2536ab47cfaaSmrg
25376aec45a7Smrghaiku*)
2538aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
25396aec45a7Smrg  need_lib_prefix=no
25406aec45a7Smrg  need_version=no
25416aec45a7Smrg  dynamic_linker="$host_os runtime_loader"
25426aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2543ab47cfaaSmrg  soname_spec='${libname}${release}${shared_ext}$major'
25446aec45a7Smrg  shlibpath_var=LIBRARY_PATH
25456aec45a7Smrg  shlibpath_overrides_runpath=yes
25466aec45a7Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
25476aec45a7Smrg  hardcode_into_libs=yes
2548ab47cfaaSmrg  ;;
25495c42550eSmrg
25506aec45a7Smrghpux9* | hpux10* | hpux11*)
25516aec45a7Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
25526aec45a7Smrg  # link against other versions.
25536aec45a7Smrg  version_type=sunos
25546aec45a7Smrg  need_lib_prefix=no
25556aec45a7Smrg  need_version=no
25566aec45a7Smrg  case $host_cpu in
25576aec45a7Smrg  ia64*)
25586aec45a7Smrg    shrext_cmds='.so'
25596aec45a7Smrg    hardcode_into_libs=yes
25606aec45a7Smrg    dynamic_linker="$host_os dld.so"
25616aec45a7Smrg    shlibpath_var=LD_LIBRARY_PATH
25626aec45a7Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
25636aec45a7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25646aec45a7Smrg    soname_spec='${libname}${release}${shared_ext}$major'
25656aec45a7Smrg    if test "X$HPUX_IA64_MODE" = X32; then
25666aec45a7Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
25675c42550eSmrg    else
25686aec45a7Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
25695c42550eSmrg    fi
25706aec45a7Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
25716aec45a7Smrg    ;;
25726aec45a7Smrg  hppa*64*)
25736aec45a7Smrg    shrext_cmds='.sl'
25746aec45a7Smrg    hardcode_into_libs=yes
25756aec45a7Smrg    dynamic_linker="$host_os dld.sl"
25766aec45a7Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
25776aec45a7Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
25786aec45a7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25796aec45a7Smrg    soname_spec='${libname}${release}${shared_ext}$major'
25806aec45a7Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
25816aec45a7Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
25826aec45a7Smrg    ;;
25836aec45a7Smrg  *)
25846aec45a7Smrg    shrext_cmds='.sl'
25856aec45a7Smrg    dynamic_linker="$host_os dld.sl"
25866aec45a7Smrg    shlibpath_var=SHLIB_PATH
25876aec45a7Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
25886aec45a7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25896aec45a7Smrg    soname_spec='${libname}${release}${shared_ext}$major'
25906aec45a7Smrg    ;;
25916aec45a7Smrg  esac
25926aec45a7Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
25936aec45a7Smrg  postinstall_cmds='chmod 555 $lib'
25946aec45a7Smrg  # or fails outright, so override atomically:
25956aec45a7Smrg  install_override_mode=555
25966aec45a7Smrg  ;;
25975c42550eSmrg
25986aec45a7Smrginterix[[3-9]]*)
2599aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
26006aec45a7Smrg  need_lib_prefix=no
26016aec45a7Smrg  need_version=no
26026aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
26036aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
26046aec45a7Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
26056aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
26066aec45a7Smrg  shlibpath_overrides_runpath=no
26076aec45a7Smrg  hardcode_into_libs=yes
26086aec45a7Smrg  ;;
26095c42550eSmrg
26106aec45a7Smrgirix5* | irix6* | nonstopux*)
26116aec45a7Smrg  case $host_os in
26126aec45a7Smrg    nonstopux*) version_type=nonstopux ;;
26136aec45a7Smrg    *)
26146aec45a7Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
2615aa9e3350Smrg		version_type=linux # correct to gnu/linux during the next big refactor
26166aec45a7Smrg	else
26176aec45a7Smrg		version_type=irix
26186aec45a7Smrg	fi ;;
26196aec45a7Smrg  esac
26206aec45a7Smrg  need_lib_prefix=no
26216aec45a7Smrg  need_version=no
26226aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
26236aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
26246aec45a7Smrg  case $host_os in
26256aec45a7Smrg  irix5* | nonstopux*)
26266aec45a7Smrg    libsuff= shlibsuff=
26276aec45a7Smrg    ;;
26286aec45a7Smrg  *)
26296aec45a7Smrg    case $LD in # libtool.m4 will add one of these switches to LD
26306aec45a7Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
26316aec45a7Smrg      libsuff= shlibsuff= libmagic=32-bit;;
26326aec45a7Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
26336aec45a7Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
26346aec45a7Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
26356aec45a7Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
26366aec45a7Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
26375c42550eSmrg    esac
26386aec45a7Smrg    ;;
26396aec45a7Smrg  esac
26406aec45a7Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
26416aec45a7Smrg  shlibpath_overrides_runpath=no
26426aec45a7Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
26436aec45a7Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
26446aec45a7Smrg  hardcode_into_libs=yes
26456aec45a7Smrg  ;;
26465c42550eSmrg
26476aec45a7Smrg# No shared lib support for Linux oldld, aout, or coff.
26486aec45a7Smrglinux*oldld* | linux*aout* | linux*coff*)
26496aec45a7Smrg  dynamic_linker=no
26506aec45a7Smrg  ;;
26515c42550eSmrg
2652aa9e3350Smrg# This must be glibc/ELF.
265338770048Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
2654aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
26556aec45a7Smrg  need_lib_prefix=no
26566aec45a7Smrg  need_version=no
26576aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
26586aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
26596aec45a7Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
26606aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
26616aec45a7Smrg  shlibpath_overrides_runpath=no
26625c42550eSmrg
26636aec45a7Smrg  # Some binutils ld are patched to set DT_RUNPATH
26646aec45a7Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
26656aec45a7Smrg    [lt_cv_shlibpath_overrides_runpath=no
26666aec45a7Smrg    save_LDFLAGS=$LDFLAGS
26676aec45a7Smrg    save_libdir=$libdir
26686aec45a7Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
26696aec45a7Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
26706aec45a7Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
26716aec45a7Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
26726aec45a7Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
26736aec45a7Smrg    LDFLAGS=$save_LDFLAGS
26746aec45a7Smrg    libdir=$save_libdir
26756aec45a7Smrg    ])
26766aec45a7Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
26775c42550eSmrg
26786aec45a7Smrg  # This implies no fast_install, which is unacceptable.
26796aec45a7Smrg  # Some rework will be needed to allow for fast_install
26806aec45a7Smrg  # before this can be enabled.
26816aec45a7Smrg  hardcode_into_libs=yes
26825c42550eSmrg
26836aec45a7Smrg  # Append ld.so.conf contents to the search path
26846aec45a7Smrg  if test -f /etc/ld.so.conf; then
26856aec45a7Smrg    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
268638770048Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
26875c42550eSmrg  fi
26885c42550eSmrg
26896aec45a7Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
26906aec45a7Smrg  # powerpc, because MkLinux only supported shared libraries with the
26916aec45a7Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
26926aec45a7Smrg  # most powerpc-linux boxes support dynamic linking these days and
26936aec45a7Smrg  # people can always --disable-shared, the test was removed, and we
26946aec45a7Smrg  # assume the GNU/Linux dynamic linker is in use.
26956aec45a7Smrg  dynamic_linker='GNU/Linux ld.so'
26966aec45a7Smrg  ;;
26975c42550eSmrg
269838770048Smrgnetbsdelf*-gnu)
269938770048Smrg  version_type=linux
270038770048Smrg  need_lib_prefix=no
270138770048Smrg  need_version=no
270238770048Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
270338770048Smrg  soname_spec='${libname}${release}${shared_ext}$major'
270438770048Smrg  shlibpath_var=LD_LIBRARY_PATH
270538770048Smrg  shlibpath_overrides_runpath=no
270638770048Smrg  hardcode_into_libs=yes
270738770048Smrg  dynamic_linker='NetBSD ld.elf_so'
270838770048Smrg  ;;
270938770048Smrg
27106aec45a7Smrgnetbsd*)
27116aec45a7Smrg  version_type=sunos
27126aec45a7Smrg  need_lib_prefix=no
27136aec45a7Smrg  need_version=no
27146aec45a7Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
27156aec45a7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
27166aec45a7Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
27176aec45a7Smrg    dynamic_linker='NetBSD (a.out) ld.so'
27186aec45a7Smrg  else
27196aec45a7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
27206aec45a7Smrg    soname_spec='${libname}${release}${shared_ext}$major'
27216aec45a7Smrg    dynamic_linker='NetBSD ld.elf_so'
27226aec45a7Smrg  fi
27236aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
27246aec45a7Smrg  shlibpath_overrides_runpath=yes
27256aec45a7Smrg  hardcode_into_libs=yes
27266aec45a7Smrg  ;;
27275c42550eSmrg
27286aec45a7Smrgnewsos6)
2729aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
27306aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27316aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
27326aec45a7Smrg  shlibpath_overrides_runpath=yes
27336aec45a7Smrg  ;;
27345c42550eSmrg
27356aec45a7Smrg*nto* | *qnx*)
27366aec45a7Smrg  version_type=qnx
27376aec45a7Smrg  need_lib_prefix=no
27386aec45a7Smrg  need_version=no
27396aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27406aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
27416aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
27426aec45a7Smrg  shlibpath_overrides_runpath=no
27436aec45a7Smrg  hardcode_into_libs=yes
27446aec45a7Smrg  dynamic_linker='ldqnx.so'
27456aec45a7Smrg  ;;
27465c42550eSmrg
27476aec45a7Smrgopenbsd*)
27486aec45a7Smrg  version_type=sunos
27496aec45a7Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
27506aec45a7Smrg  need_lib_prefix=no
27516aec45a7Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
27526aec45a7Smrg  case $host_os in
27536aec45a7Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
27546aec45a7Smrg    *)				need_version=no  ;;
27556aec45a7Smrg  esac
27566aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
27576aec45a7Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
27586aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
27596aec45a7Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
27606aec45a7Smrg    case $host_os in
27616aec45a7Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
27626aec45a7Smrg	shlibpath_overrides_runpath=no
27636aec45a7Smrg	;;
27646aec45a7Smrg      *)
27656aec45a7Smrg	shlibpath_overrides_runpath=yes
27666aec45a7Smrg	;;
27676aec45a7Smrg      esac
27686aec45a7Smrg  else
27696aec45a7Smrg    shlibpath_overrides_runpath=yes
27706aec45a7Smrg  fi
27716aec45a7Smrg  ;;
27725c42550eSmrg
27736aec45a7Smrgos2*)
27746aec45a7Smrg  libname_spec='$name'
27756aec45a7Smrg  shrext_cmds=".dll"
27766aec45a7Smrg  need_lib_prefix=no
27776aec45a7Smrg  library_names_spec='$libname${shared_ext} $libname.a'
27786aec45a7Smrg  dynamic_linker='OS/2 ld.exe'
27796aec45a7Smrg  shlibpath_var=LIBPATH
27806aec45a7Smrg  ;;
27815c42550eSmrg
27826aec45a7Smrgosf3* | osf4* | osf5*)
27836aec45a7Smrg  version_type=osf
27846aec45a7Smrg  need_lib_prefix=no
27856aec45a7Smrg  need_version=no
27866aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
27876aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27886aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
27896aec45a7Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
27906aec45a7Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
27916aec45a7Smrg  ;;
27925c42550eSmrg
27936aec45a7Smrgrdos*)
27946aec45a7Smrg  dynamic_linker=no
27956aec45a7Smrg  ;;
27965c42550eSmrg
27976aec45a7Smrgsolaris*)
2798aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
27996aec45a7Smrg  need_lib_prefix=no
28006aec45a7Smrg  need_version=no
28016aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28026aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
28036aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
28046aec45a7Smrg  shlibpath_overrides_runpath=yes
28056aec45a7Smrg  hardcode_into_libs=yes
28066aec45a7Smrg  # ldd complains unless libraries are executable
28076aec45a7Smrg  postinstall_cmds='chmod +x $lib'
28086aec45a7Smrg  ;;
28095c42550eSmrg
28106aec45a7Smrgsunos4*)
28116aec45a7Smrg  version_type=sunos
28126aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
28136aec45a7Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
28146aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
28156aec45a7Smrg  shlibpath_overrides_runpath=yes
28166aec45a7Smrg  if test "$with_gnu_ld" = yes; then
28176aec45a7Smrg    need_lib_prefix=no
28186aec45a7Smrg  fi
28196aec45a7Smrg  need_version=yes
28206aec45a7Smrg  ;;
28215c42550eSmrg
28226aec45a7Smrgsysv4 | sysv4.3*)
2823aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
28246aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28256aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
28266aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
28276aec45a7Smrg  case $host_vendor in
28286aec45a7Smrg    sni)
28296aec45a7Smrg      shlibpath_overrides_runpath=no
28306aec45a7Smrg      need_lib_prefix=no
28316aec45a7Smrg      runpath_var=LD_RUN_PATH
28326aec45a7Smrg      ;;
28336aec45a7Smrg    siemens)
28346aec45a7Smrg      need_lib_prefix=no
28356aec45a7Smrg      ;;
28366aec45a7Smrg    motorola)
28376aec45a7Smrg      need_lib_prefix=no
28386aec45a7Smrg      need_version=no
28396aec45a7Smrg      shlibpath_overrides_runpath=no
28406aec45a7Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
28416aec45a7Smrg      ;;
28426aec45a7Smrg  esac
28436aec45a7Smrg  ;;
28445c42550eSmrg
28456aec45a7Smrgsysv4*MP*)
28466aec45a7Smrg  if test -d /usr/nec ;then
2847aa9e3350Smrg    version_type=linux # correct to gnu/linux during the next big refactor
28486aec45a7Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
28496aec45a7Smrg    soname_spec='$libname${shared_ext}.$major'
28506aec45a7Smrg    shlibpath_var=LD_LIBRARY_PATH
28516aec45a7Smrg  fi
28526aec45a7Smrg  ;;
28535c42550eSmrg
28546aec45a7Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
28556aec45a7Smrg  version_type=freebsd-elf
28566aec45a7Smrg  need_lib_prefix=no
28576aec45a7Smrg  need_version=no
28586aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
28596aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
28606aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
28616aec45a7Smrg  shlibpath_overrides_runpath=yes
28626aec45a7Smrg  hardcode_into_libs=yes
28636aec45a7Smrg  if test "$with_gnu_ld" = yes; then
28646aec45a7Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
28656aec45a7Smrg  else
28666aec45a7Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
28676aec45a7Smrg    case $host_os in
28686aec45a7Smrg      sco3.2v5*)
28696aec45a7Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
28706aec45a7Smrg	;;
28716aec45a7Smrg    esac
28726aec45a7Smrg  fi
28736aec45a7Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
28746aec45a7Smrg  ;;
28755c42550eSmrg
28766aec45a7Smrgtpf*)
28776aec45a7Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
2878aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
28796aec45a7Smrg  need_lib_prefix=no
28806aec45a7Smrg  need_version=no
28816aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28826aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
28836aec45a7Smrg  shlibpath_overrides_runpath=no
28846aec45a7Smrg  hardcode_into_libs=yes
28856aec45a7Smrg  ;;
28865c42550eSmrg
28876aec45a7Smrguts4*)
2888aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
28896aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28906aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
28916aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
28926aec45a7Smrg  ;;
28935c42550eSmrg
28946aec45a7Smrg*)
28956aec45a7Smrg  dynamic_linker=no
28966aec45a7Smrg  ;;
28976aec45a7Smrgesac
28986aec45a7SmrgAC_MSG_RESULT([$dynamic_linker])
28996aec45a7Smrgtest "$dynamic_linker" = no && can_build_shared=no
29005c42550eSmrg
29016aec45a7Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
29026aec45a7Smrgif test "$GCC" = yes; then
29036aec45a7Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
29046aec45a7Smrgfi
29055c42550eSmrg
29066aec45a7Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
29076aec45a7Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
29086aec45a7Smrgfi
29096aec45a7Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
29106aec45a7Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
29116aec45a7Smrgfi
29125c42550eSmrg
29136aec45a7Smrg_LT_DECL([], [variables_saved_for_relink], [1],
29146aec45a7Smrg    [Variables whose values should be saved in libtool wrapper scripts and
29156aec45a7Smrg    restored at link time])
29166aec45a7Smrg_LT_DECL([], [need_lib_prefix], [0],
29176aec45a7Smrg    [Do we need the "lib" prefix for modules?])
29186aec45a7Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
29196aec45a7Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
29206aec45a7Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
29216aec45a7Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
29226aec45a7Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
29236aec45a7Smrg    [Is shlibpath searched before the hard-coded library search path?])
29246aec45a7Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
29256aec45a7Smrg_LT_DECL([], [library_names_spec], [1],
29266aec45a7Smrg    [[List of archive names.  First name is the real one, the rest are links.
29276aec45a7Smrg    The last name is the one that the linker finds with -lNAME]])
29286aec45a7Smrg_LT_DECL([], [soname_spec], [1],
29296aec45a7Smrg    [[The coded name of the library, if different from the real name]])
29306aec45a7Smrg_LT_DECL([], [install_override_mode], [1],
29316aec45a7Smrg    [Permission mode override for installation of shared libraries])
29326aec45a7Smrg_LT_DECL([], [postinstall_cmds], [2],
29336aec45a7Smrg    [Command to use after installation of a shared archive])
29346aec45a7Smrg_LT_DECL([], [postuninstall_cmds], [2],
29356aec45a7Smrg    [Command to use after uninstallation of a shared archive])
29366aec45a7Smrg_LT_DECL([], [finish_cmds], [2],
29376aec45a7Smrg    [Commands used to finish a libtool library installation in a directory])
29386aec45a7Smrg_LT_DECL([], [finish_eval], [1],
29396aec45a7Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
29406aec45a7Smrg    not shown]])
29416aec45a7Smrg_LT_DECL([], [hardcode_into_libs], [0],
29426aec45a7Smrg    [Whether we should hardcode library paths into libraries])
29436aec45a7Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
29446aec45a7Smrg    [Compile-time system search path for libraries])
29456aec45a7Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
29466aec45a7Smrg    [Run-time system search path for libraries])
29476aec45a7Smrg])# _LT_SYS_DYNAMIC_LINKER
29486aec45a7Smrg
29496aec45a7Smrg
29506aec45a7Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
29516aec45a7Smrg# --------------------------
29525c42550eSmrg# find a file program which can recognize shared library
29536aec45a7SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
29546aec45a7Smrg[m4_require([_LT_DECL_EGREP])dnl
29555c42550eSmrgAC_MSG_CHECKING([for $1])
29565c42550eSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
29575c42550eSmrg[case $MAGIC_CMD in
2958ab47cfaaSmrg[[\\/*] |  ?:[\\/]*])
2959ab47cfaaSmrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2960ab47cfaaSmrg  ;;
2961ab47cfaaSmrg*)
2962ab47cfaaSmrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
2963ab47cfaaSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2964ab47cfaaSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
2965ab47cfaaSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
2966ab47cfaaSmrgdnl not every word.  This closes a longstanding sh security hole.
29676aec45a7Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
2968ab47cfaaSmrg  for ac_dir in $ac_dummy; do
2969ab47cfaaSmrg    IFS="$lt_save_ifs"
2970ab47cfaaSmrg    test -z "$ac_dir" && ac_dir=.
2971ab47cfaaSmrg    if test -f $ac_dir/$1; then
2972ab47cfaaSmrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2973ab47cfaaSmrg      if test -n "$file_magic_test_file"; then
2974ab47cfaaSmrg	case $deplibs_check_method in
2975ab47cfaaSmrg	"file_magic "*)
2976ab47cfaaSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2977ab47cfaaSmrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2978ab47cfaaSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2979ab47cfaaSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
2980ab47cfaaSmrg	    :
2981ab47cfaaSmrg	  else
29826aec45a7Smrg	    cat <<_LT_EOF 1>&2
2983ab47cfaaSmrg
2984ab47cfaaSmrg*** Warning: the command libtool uses to detect shared libraries,
2985ab47cfaaSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
2986ab47cfaaSmrg*** The result is that libtool may fail to recognize shared libraries
2987ab47cfaaSmrg*** as such.  This will affect the creation of libtool libraries that
2988ab47cfaaSmrg*** depend on shared libraries, but programs linked with such libtool
2989ab47cfaaSmrg*** libraries will work regardless of this problem.  Nevertheless, you
2990ab47cfaaSmrg*** may want to report the problem to your system manager and/or to
2991ab47cfaaSmrg*** bug-libtool@gnu.org
2992ab47cfaaSmrg
29936aec45a7Smrg_LT_EOF
2994ab47cfaaSmrg	  fi ;;
2995ab47cfaaSmrg	esac
2996ab47cfaaSmrg      fi
2997ab47cfaaSmrg      break
2998ab47cfaaSmrg    fi
2999ab47cfaaSmrg  done
3000ab47cfaaSmrg  IFS="$lt_save_ifs"
3001ab47cfaaSmrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
3002ab47cfaaSmrg  ;;
3003ab47cfaaSmrgesac])
3004ab47cfaaSmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3005ab47cfaaSmrgif test -n "$MAGIC_CMD"; then
3006ab47cfaaSmrg  AC_MSG_RESULT($MAGIC_CMD)
3007ab47cfaaSmrgelse
3008ab47cfaaSmrg  AC_MSG_RESULT(no)
3009ab47cfaaSmrgfi
30106aec45a7Smrg_LT_DECL([], [MAGIC_CMD], [0],
30116aec45a7Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
30126aec45a7Smrg])# _LT_PATH_TOOL_PREFIX
3013ab47cfaaSmrg
30146aec45a7Smrg# Old name:
30156aec45a7SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
30166aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
30176aec45a7Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
30181473d951Smrg
30196aec45a7Smrg
30206aec45a7Smrg# _LT_PATH_MAGIC
30216aec45a7Smrg# --------------
30228697ee19Smrg# find a file program which can recognize a shared library
30236aec45a7Smrgm4_defun([_LT_PATH_MAGIC],
30246aec45a7Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3025ab47cfaaSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
3026ab47cfaaSmrg  if test -n "$ac_tool_prefix"; then
30276aec45a7Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3028ab47cfaaSmrg  else
3029ab47cfaaSmrg    MAGIC_CMD=:
3030ab47cfaaSmrg  fi
3031ab47cfaaSmrgfi
30326aec45a7Smrg])# _LT_PATH_MAGIC
3033ab47cfaaSmrg
3034ab47cfaaSmrg
30356aec45a7Smrg# LT_PATH_LD
3036ab47cfaaSmrg# ----------
3037ab47cfaaSmrg# find the pathname to the GNU or non-GNU linker
30386aec45a7SmrgAC_DEFUN([LT_PATH_LD],
30396aec45a7Smrg[AC_REQUIRE([AC_PROG_CC])dnl
30405c42550eSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
30415c42550eSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
30426aec45a7Smrgm4_require([_LT_DECL_SED])dnl
30436aec45a7Smrgm4_require([_LT_DECL_EGREP])dnl
30446aec45a7Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
30456aec45a7Smrg
30466aec45a7SmrgAC_ARG_WITH([gnu-ld],
30476aec45a7Smrg    [AS_HELP_STRING([--with-gnu-ld],
30486aec45a7Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
30496aec45a7Smrg    [test "$withval" = no || with_gnu_ld=yes],
30506aec45a7Smrg    [with_gnu_ld=no])dnl
30516aec45a7Smrg
3052ab47cfaaSmrgac_prog=ld
3053ab47cfaaSmrgif test "$GCC" = yes; then
3054ab47cfaaSmrg  # Check if gcc -print-prog-name=ld gives a path.
3055ab47cfaaSmrg  AC_MSG_CHECKING([for ld used by $CC])
3056ab47cfaaSmrg  case $host in
3057ab47cfaaSmrg  *-*-mingw*)
3058ab47cfaaSmrg    # gcc leaves a trailing carriage return which upsets mingw
3059ab47cfaaSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3060ab47cfaaSmrg  *)
3061ab47cfaaSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3062ab47cfaaSmrg  esac
3063ab47cfaaSmrg  case $ac_prog in
3064ab47cfaaSmrg    # Accept absolute paths.
3065ab47cfaaSmrg    [[\\/]]* | ?:[[\\/]]*)
3066ab47cfaaSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
3067ab47cfaaSmrg      # Canonicalize the pathname of ld
30686aec45a7Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
30696aec45a7Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
30706aec45a7Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3071ab47cfaaSmrg      done
3072ab47cfaaSmrg      test -z "$LD" && LD="$ac_prog"
3073ab47cfaaSmrg      ;;
3074ab47cfaaSmrg  "")
3075ab47cfaaSmrg    # If it fails, then pretend we aren't using GCC.
3076ab47cfaaSmrg    ac_prog=ld
3077ab47cfaaSmrg    ;;
3078ab47cfaaSmrg  *)
3079ab47cfaaSmrg    # If it is relative, then search for the first ld in PATH.
3080ab47cfaaSmrg    with_gnu_ld=unknown
3081ab47cfaaSmrg    ;;
3082ab47cfaaSmrg  esac
3083ab47cfaaSmrgelif test "$with_gnu_ld" = yes; then
3084ab47cfaaSmrg  AC_MSG_CHECKING([for GNU ld])
3085ab47cfaaSmrgelse
3086ab47cfaaSmrg  AC_MSG_CHECKING([for non-GNU ld])
3087ab47cfaaSmrgfi
3088ab47cfaaSmrgAC_CACHE_VAL(lt_cv_path_LD,
3089ab47cfaaSmrg[if test -z "$LD"; then
3090ab47cfaaSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3091ab47cfaaSmrg  for ac_dir in $PATH; do
3092ab47cfaaSmrg    IFS="$lt_save_ifs"
3093ab47cfaaSmrg    test -z "$ac_dir" && ac_dir=.
3094ab47cfaaSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3095ab47cfaaSmrg      lt_cv_path_LD="$ac_dir/$ac_prog"
3096ab47cfaaSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
3097ab47cfaaSmrg      # but apparently some variants of GNU ld only accept -v.
3098ab47cfaaSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
3099ab47cfaaSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3100ab47cfaaSmrg      *GNU* | *'with BFD'*)
3101ab47cfaaSmrg	test "$with_gnu_ld" != no && break
3102ab47cfaaSmrg	;;
3103ab47cfaaSmrg      *)
3104ab47cfaaSmrg	test "$with_gnu_ld" != yes && break
3105ab47cfaaSmrg	;;
3106ab47cfaaSmrg      esac
3107ab47cfaaSmrg    fi
3108ab47cfaaSmrg  done
3109ab47cfaaSmrg  IFS="$lt_save_ifs"
3110ab47cfaaSmrgelse
3111ab47cfaaSmrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
3112ab47cfaaSmrgfi])
3113ab47cfaaSmrgLD="$lt_cv_path_LD"
3114ab47cfaaSmrgif test -n "$LD"; then
3115ab47cfaaSmrg  AC_MSG_RESULT($LD)
3116ab47cfaaSmrgelse
3117ab47cfaaSmrg  AC_MSG_RESULT(no)
3118ab47cfaaSmrgfi
3119ab47cfaaSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
31206aec45a7Smrg_LT_PATH_LD_GNU
31216aec45a7SmrgAC_SUBST([LD])
3122ab47cfaaSmrg
31236aec45a7Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
31246aec45a7Smrg])# LT_PATH_LD
3125ab47cfaaSmrg
31266aec45a7Smrg# Old names:
31276aec45a7SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
31286aec45a7SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
31296aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
31306aec45a7Smrgdnl AC_DEFUN([AM_PROG_LD], [])
31316aec45a7Smrgdnl AC_DEFUN([AC_PROG_LD], [])
31326aec45a7Smrg
31336aec45a7Smrg
31346aec45a7Smrg# _LT_PATH_LD_GNU
31356aec45a7Smrg#- --------------
31366aec45a7Smrgm4_defun([_LT_PATH_LD_GNU],
31376aec45a7Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3138ab47cfaaSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3139ab47cfaaSmrgcase `$LD -v 2>&1 </dev/null` in
3140ab47cfaaSmrg*GNU* | *'with BFD'*)
3141ab47cfaaSmrg  lt_cv_prog_gnu_ld=yes
3142ab47cfaaSmrg  ;;
3143ab47cfaaSmrg*)
3144ab47cfaaSmrg  lt_cv_prog_gnu_ld=no
3145ab47cfaaSmrg  ;;
3146ab47cfaaSmrgesac])
3147ab47cfaaSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
31486aec45a7Smrg])# _LT_PATH_LD_GNU
3149ab47cfaaSmrg
3150ab47cfaaSmrg
31516aec45a7Smrg# _LT_CMD_RELOAD
31526aec45a7Smrg# --------------
3153ab47cfaaSmrg# find reload flag for linker
3154ab47cfaaSmrg#   -- PORTME Some linkers may need a different reload flag.
31556aec45a7Smrgm4_defun([_LT_CMD_RELOAD],
3156ab47cfaaSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
3157ab47cfaaSmrg  lt_cv_ld_reload_flag,
3158ab47cfaaSmrg  [lt_cv_ld_reload_flag='-r'])
3159ab47cfaaSmrgreload_flag=$lt_cv_ld_reload_flag
3160ab47cfaaSmrgcase $reload_flag in
3161ab47cfaaSmrg"" | " "*) ;;
3162ab47cfaaSmrg*) reload_flag=" $reload_flag" ;;
3163ab47cfaaSmrgesac
3164ab47cfaaSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
3165ab47cfaaSmrgcase $host_os in
3166aa9e3350Smrg  cygwin* | mingw* | pw32* | cegcc*)
3167aa9e3350Smrg    if test "$GCC" != yes; then
3168aa9e3350Smrg      reload_cmds=false
3169aa9e3350Smrg    fi
3170aa9e3350Smrg    ;;
3171ab47cfaaSmrg  darwin*)
3172ab47cfaaSmrg    if test "$GCC" = yes; then
3173ab47cfaaSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
3174ab47cfaaSmrg    else
3175ab47cfaaSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3176ab47cfaaSmrg    fi
3177ab47cfaaSmrg    ;;
3178ab47cfaaSmrgesac
31796aec45a7Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
31806aec45a7Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
31816aec45a7Smrg])# _LT_CMD_RELOAD
3182ab47cfaaSmrg
3183ab47cfaaSmrg
31846aec45a7Smrg# _LT_CHECK_MAGIC_METHOD
31856aec45a7Smrg# ----------------------
3186ab47cfaaSmrg# how to check for library dependencies
3187ab47cfaaSmrg#  -- PORTME fill in with the dynamic library characteristics
31886aec45a7Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
31896aec45a7Smrg[m4_require([_LT_DECL_EGREP])
31906aec45a7Smrgm4_require([_LT_DECL_OBJDUMP])
31916aec45a7SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
3192ab47cfaaSmrglt_cv_deplibs_check_method,
3193ab47cfaaSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
3194ab47cfaaSmrglt_cv_file_magic_test_file=
3195ab47cfaaSmrglt_cv_deplibs_check_method='unknown'
3196ab47cfaaSmrg# Need to set the preceding variable on all platforms that support
3197ab47cfaaSmrg# interlibrary dependencies.
3198ab47cfaaSmrg# 'none' -- dependencies not supported.
3199ab47cfaaSmrg# `unknown' -- same as none, but documents that we really don't know.
3200ab47cfaaSmrg# 'pass_all' -- all dependencies passed with no checks.
3201ab47cfaaSmrg# 'test_compile' -- check by making test program.
3202ab47cfaaSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
3203ab47cfaaSmrg# which responds to the $file_magic_cmd with a given extended regex.
3204ab47cfaaSmrg# If you have `file' or equivalent on your system and you're not sure
3205ab47cfaaSmrg# whether `pass_all' will *always* work, you probably want this one.
3206ab47cfaaSmrg
3207ab47cfaaSmrgcase $host_os in
32081473d951Smrgaix[[4-9]]*)
3209ab47cfaaSmrg  lt_cv_deplibs_check_method=pass_all
3210ab47cfaaSmrg  ;;
3211ab47cfaaSmrg
3212ab47cfaaSmrgbeos*)
3213ab47cfaaSmrg  lt_cv_deplibs_check_method=pass_all
3214ab47cfaaSmrg  ;;
3215ab47cfaaSmrg
3216ab47cfaaSmrgbsdi[[45]]*)
3217ab47cfaaSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3218ab47cfaaSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
3219ab47cfaaSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
3220ab47cfaaSmrg  ;;
3221ab47cfaaSmrg
3222ab47cfaaSmrgcygwin*)
3223ab47cfaaSmrg  # func_win32_libid is a shell function defined in ltmain.sh
3224ab47cfaaSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3225ab47cfaaSmrg  lt_cv_file_magic_cmd='func_win32_libid'
3226ab47cfaaSmrg  ;;
3227ab47cfaaSmrg
3228ab47cfaaSmrgmingw* | pw32*)
3229ab47cfaaSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
32308697ee19Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
32318697ee19Smrg  # unless we find 'file', for example because we are cross-compiling.
32326aec45a7Smrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
32336aec45a7Smrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
32348697ee19Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
32358697ee19Smrg    lt_cv_file_magic_cmd='func_win32_libid'
32368697ee19Smrg  else
32376aec45a7Smrg    # Keep this pattern in sync with the one in func_win32_libid.
32386aec45a7Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
32398697ee19Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
32408697ee19Smrg  fi
3241ab47cfaaSmrg  ;;
3242ab47cfaaSmrg
32436aec45a7Smrgcegcc*)
32446aec45a7Smrg  # use the weaker test based on 'objdump'. See mingw*.
32456aec45a7Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
32466aec45a7Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
32476aec45a7Smrg  ;;
32486aec45a7Smrg
3249ab47cfaaSmrgdarwin* | rhapsody*)
3250ab47cfaaSmrg  lt_cv_deplibs_check_method=pass_all
3251ab47cfaaSmrg  ;;
3252ab47cfaaSmrg
3253ab47cfaaSmrgfreebsd* | dragonfly*)
32546aec45a7Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3255ab47cfaaSmrg    case $host_cpu in
3256ab47cfaaSmrg    i*86 )
3257ab47cfaaSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
3258ab47cfaaSmrg      # Let's accept both of them until this is cleared up.
3259ab47cfaaSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3260ab47cfaaSmrg      lt_cv_file_magic_cmd=/usr/bin/file
3261ab47cfaaSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3262ab47cfaaSmrg      ;;
3263ab47cfaaSmrg    esac
3264ab47cfaaSmrg  else
3265ab47cfaaSmrg    lt_cv_deplibs_check_method=pass_all
3266ab47cfaaSmrg  fi
3267ab47cfaaSmrg  ;;
3268ab47cfaaSmrg
32696aec45a7Smrghaiku*)
32706aec45a7Smrg  lt_cv_deplibs_check_method=pass_all
32716aec45a7Smrg  ;;
32726aec45a7Smrg
3273ab47cfaaSmrghpux10.20* | hpux11*)
3274ab47cfaaSmrg  lt_cv_file_magic_cmd=/usr/bin/file
3275ab47cfaaSmrg  case $host_cpu in
3276ab47cfaaSmrg  ia64*)
3277ab47cfaaSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3278ab47cfaaSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3279ab47cfaaSmrg    ;;
3280ab47cfaaSmrg  hppa*64*)
32816aec45a7Smrg    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
3282ab47cfaaSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3283ab47cfaaSmrg    ;;
3284ab47cfaaSmrg  *)
32856aec45a7Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3286ab47cfaaSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3287ab47cfaaSmrg    ;;
3288ab47cfaaSmrg  esac
3289ab47cfaaSmrg  ;;
3290ab47cfaaSmrg
32918697ee19Smrginterix[[3-9]]*)
3292ab47cfaaSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3293ab47cfaaSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3294ab47cfaaSmrg  ;;
3295ab47cfaaSmrg
3296ab47cfaaSmrgirix5* | irix6* | nonstopux*)
3297ab47cfaaSmrg  case $LD in
3298ab47cfaaSmrg  *-32|*"-32 ") libmagic=32-bit;;
3299ab47cfaaSmrg  *-n32|*"-n32 ") libmagic=N32;;
3300ab47cfaaSmrg  *-64|*"-64 ") libmagic=64-bit;;
3301ab47cfaaSmrg  *) libmagic=never-match;;
3302ab47cfaaSmrg  esac
3303ab47cfaaSmrg  lt_cv_deplibs_check_method=pass_all
3304ab47cfaaSmrg  ;;
3305ab47cfaaSmrg
3306aa9e3350Smrg# This must be glibc/ELF.
330738770048Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
3308ab47cfaaSmrg  lt_cv_deplibs_check_method=pass_all
3309ab47cfaaSmrg  ;;
3310ab47cfaaSmrg
331138770048Smrgnetbsd* | netbsdelf*-gnu)
33126aec45a7Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3313ab47cfaaSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3314ab47cfaaSmrg  else
3315ab47cfaaSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3316ab47cfaaSmrg  fi
3317ab47cfaaSmrg  ;;
3318ab47cfaaSmrg
3319ab47cfaaSmrgnewos6*)
3320ab47cfaaSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3321ab47cfaaSmrg  lt_cv_file_magic_cmd=/usr/bin/file
3322ab47cfaaSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3323ab47cfaaSmrg  ;;
3324ab47cfaaSmrg
33256aec45a7Smrg*nto* | *qnx*)
33266aec45a7Smrg  lt_cv_deplibs_check_method=pass_all
3327ab47cfaaSmrg  ;;
3328ab47cfaaSmrg
3329ab47cfaaSmrgopenbsd*)
33306aec45a7Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3331ab47cfaaSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3332ab47cfaaSmrg  else
3333ab47cfaaSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3334ab47cfaaSmrg  fi
3335ab47cfaaSmrg  ;;
3336ab47cfaaSmrg
3337ab47cfaaSmrgosf3* | osf4* | osf5*)
3338ab47cfaaSmrg  lt_cv_deplibs_check_method=pass_all
3339ab47cfaaSmrg  ;;
3340ab47cfaaSmrg
33418697ee19Smrgrdos*)
33428697ee19Smrg  lt_cv_deplibs_check_method=pass_all
33438697ee19Smrg  ;;
33448697ee19Smrg
3345ab47cfaaSmrgsolaris*)
3346ab47cfaaSmrg  lt_cv_deplibs_check_method=pass_all
3347ab47cfaaSmrg  ;;
3348ab47cfaaSmrg
33496aec45a7Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
33506aec45a7Smrg  lt_cv_deplibs_check_method=pass_all
33516aec45a7Smrg  ;;
33526aec45a7Smrg
3353ab47cfaaSmrgsysv4 | sysv4.3*)
3354ab47cfaaSmrg  case $host_vendor in
3355ab47cfaaSmrg  motorola)
3356ab47cfaaSmrg    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]]'
3357ab47cfaaSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3358ab47cfaaSmrg    ;;
3359ab47cfaaSmrg  ncr)
3360ab47cfaaSmrg    lt_cv_deplibs_check_method=pass_all
3361ab47cfaaSmrg    ;;
3362ab47cfaaSmrg  sequent)
3363ab47cfaaSmrg    lt_cv_file_magic_cmd='/bin/file'
3364ab47cfaaSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3365ab47cfaaSmrg    ;;
3366ab47cfaaSmrg  sni)
3367ab47cfaaSmrg    lt_cv_file_magic_cmd='/bin/file'
3368ab47cfaaSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3369ab47cfaaSmrg    lt_cv_file_magic_test_file=/lib/libc.so
3370ab47cfaaSmrg    ;;
3371ab47cfaaSmrg  siemens)
3372ab47cfaaSmrg    lt_cv_deplibs_check_method=pass_all
3373ab47cfaaSmrg    ;;
3374ab47cfaaSmrg  pc)
3375ab47cfaaSmrg    lt_cv_deplibs_check_method=pass_all
3376ab47cfaaSmrg    ;;
3377ab47cfaaSmrg  esac
3378ab47cfaaSmrg  ;;
3379ab47cfaaSmrg
33806aec45a7Smrgtpf*)
3381ab47cfaaSmrg  lt_cv_deplibs_check_method=pass_all
3382ab47cfaaSmrg  ;;
3383ab47cfaaSmrgesac
3384ab47cfaaSmrg])
3385aa9e3350Smrg
3386aa9e3350Smrgfile_magic_glob=
3387aa9e3350Smrgwant_nocaseglob=no
3388aa9e3350Smrgif test "$build" = "$host"; then
3389aa9e3350Smrg  case $host_os in
3390aa9e3350Smrg  mingw* | pw32*)
3391aa9e3350Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3392aa9e3350Smrg      want_nocaseglob=yes
3393aa9e3350Smrg    else
3394aa9e3350Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3395aa9e3350Smrg    fi
3396aa9e3350Smrg    ;;
3397aa9e3350Smrg  esac
3398aa9e3350Smrgfi
3399aa9e3350Smrg
3400ab47cfaaSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
3401ab47cfaaSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
3402ab47cfaaSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
34036aec45a7Smrg
34046aec45a7Smrg_LT_DECL([], [deplibs_check_method], [1],
34056aec45a7Smrg    [Method to check whether dependent libraries are shared objects])
34066aec45a7Smrg_LT_DECL([], [file_magic_cmd], [1],
3407aa9e3350Smrg    [Command to use when deplibs_check_method = "file_magic"])
3408aa9e3350Smrg_LT_DECL([], [file_magic_glob], [1],
3409aa9e3350Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
3410aa9e3350Smrg_LT_DECL([], [want_nocaseglob], [1],
3411aa9e3350Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
34126aec45a7Smrg])# _LT_CHECK_MAGIC_METHOD
3413ab47cfaaSmrg
3414ab47cfaaSmrg
34156aec45a7Smrg# LT_PATH_NM
3416ab47cfaaSmrg# ----------
34176aec45a7Smrg# find the pathname to a BSD- or MS-compatible name lister
34186aec45a7SmrgAC_DEFUN([LT_PATH_NM],
34196aec45a7Smrg[AC_REQUIRE([AC_PROG_CC])dnl
34206aec45a7SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3421ab47cfaaSmrg[if test -n "$NM"; then
3422ab47cfaaSmrg  # Let the user override the test.
3423ab47cfaaSmrg  lt_cv_path_NM="$NM"
3424ab47cfaaSmrgelse
3425ab47cfaaSmrg  lt_nm_to_check="${ac_tool_prefix}nm"
34268697ee19Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3427ab47cfaaSmrg    lt_nm_to_check="$lt_nm_to_check nm"
3428ab47cfaaSmrg  fi
3429ab47cfaaSmrg  for lt_tmp_nm in $lt_nm_to_check; do
3430ab47cfaaSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3431ab47cfaaSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3432ab47cfaaSmrg      IFS="$lt_save_ifs"
3433ab47cfaaSmrg      test -z "$ac_dir" && ac_dir=.
3434ab47cfaaSmrg      tmp_nm="$ac_dir/$lt_tmp_nm"
3435ab47cfaaSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3436ab47cfaaSmrg	# Check to see if the nm accepts a BSD-compat flag.
3437ab47cfaaSmrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
3438ab47cfaaSmrg	#   nm: unknown option "B" ignored
3439ab47cfaaSmrg	# Tru64's nm complains that /dev/null is an invalid object file
3440ab47cfaaSmrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3441ab47cfaaSmrg	*/dev/null* | *'Invalid file or object type'*)
3442ab47cfaaSmrg	  lt_cv_path_NM="$tmp_nm -B"
3443ab47cfaaSmrg	  break
3444ab47cfaaSmrg	  ;;
3445ab47cfaaSmrg	*)
3446ab47cfaaSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3447ab47cfaaSmrg	  */dev/null*)
3448ab47cfaaSmrg	    lt_cv_path_NM="$tmp_nm -p"
3449ab47cfaaSmrg	    break
3450ab47cfaaSmrg	    ;;
3451ab47cfaaSmrg	  *)
3452ab47cfaaSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3453ab47cfaaSmrg	    continue # so that we can try to find one that supports BSD flags
3454ab47cfaaSmrg	    ;;
3455ab47cfaaSmrg	  esac
3456ab47cfaaSmrg	  ;;
3457ab47cfaaSmrg	esac
3458ab47cfaaSmrg      fi
3459ab47cfaaSmrg    done
3460ab47cfaaSmrg    IFS="$lt_save_ifs"
3461ab47cfaaSmrg  done
34626aec45a7Smrg  : ${lt_cv_path_NM=no}
3463ab47cfaaSmrgfi])
34646aec45a7Smrgif test "$lt_cv_path_NM" != "no"; then
34656aec45a7Smrg  NM="$lt_cv_path_NM"
34666aec45a7Smrgelse
34676aec45a7Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
34686aec45a7Smrg  if test -n "$DUMPBIN"; then :
34696aec45a7Smrg    # Let the user override the test.
34706aec45a7Smrg  else
34716aec45a7Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
34726aec45a7Smrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
34736aec45a7Smrg    *COFF*)
34746aec45a7Smrg      DUMPBIN="$DUMPBIN -symbols"
34756aec45a7Smrg      ;;
34766aec45a7Smrg    *)
34776aec45a7Smrg      DUMPBIN=:
34786aec45a7Smrg      ;;
34796aec45a7Smrg    esac
34806aec45a7Smrg  fi
34816aec45a7Smrg  AC_SUBST([DUMPBIN])
34826aec45a7Smrg  if test "$DUMPBIN" != ":"; then
34836aec45a7Smrg    NM="$DUMPBIN"
34846aec45a7Smrg  fi
34856aec45a7Smrgfi
34866aec45a7Smrgtest -z "$NM" && NM=nm
34876aec45a7SmrgAC_SUBST([NM])
34886aec45a7Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
34896aec45a7Smrg
34906aec45a7SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
34916aec45a7Smrg  [lt_cv_nm_interface="BSD nm"
34926aec45a7Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
34936aec45a7Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
34946aec45a7Smrg  (eval "$ac_compile" 2>conftest.err)
34956aec45a7Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
34966aec45a7Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
34976aec45a7Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
34986aec45a7Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
34996aec45a7Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
35006aec45a7Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
35016aec45a7Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
35026aec45a7Smrg    lt_cv_nm_interface="MS dumpbin"
35036aec45a7Smrg  fi
35046aec45a7Smrg  rm -f conftest*])
35056aec45a7Smrg])# LT_PATH_NM
3506ab47cfaaSmrg
35076aec45a7Smrg# Old names:
35086aec45a7SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
35096aec45a7SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
35106aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
35116aec45a7Smrgdnl AC_DEFUN([AM_PROG_NM], [])
35126aec45a7Smrgdnl AC_DEFUN([AC_PROG_NM], [])
35131473d951Smrg
3514aa9e3350Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3515aa9e3350Smrg# --------------------------------
3516aa9e3350Smrg# how to determine the name of the shared library
3517aa9e3350Smrg# associated with a specific link library.
3518aa9e3350Smrg#  -- PORTME fill in with the dynamic library characteristics
3519aa9e3350Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3520aa9e3350Smrg[m4_require([_LT_DECL_EGREP])
3521aa9e3350Smrgm4_require([_LT_DECL_OBJDUMP])
3522aa9e3350Smrgm4_require([_LT_DECL_DLLTOOL])
3523aa9e3350SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
3524aa9e3350Smrglt_cv_sharedlib_from_linklib_cmd,
3525aa9e3350Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3526aa9e3350Smrg
3527aa9e3350Smrgcase $host_os in
3528aa9e3350Smrgcygwin* | mingw* | pw32* | cegcc*)
3529aa9e3350Smrg  # two different shell functions defined in ltmain.sh
3530aa9e3350Smrg  # decide which to use based on capabilities of $DLLTOOL
3531aa9e3350Smrg  case `$DLLTOOL --help 2>&1` in
3532aa9e3350Smrg  *--identify-strict*)
3533aa9e3350Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3534aa9e3350Smrg    ;;
3535aa9e3350Smrg  *)
3536aa9e3350Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3537aa9e3350Smrg    ;;
3538aa9e3350Smrg  esac
3539aa9e3350Smrg  ;;
3540aa9e3350Smrg*)
3541aa9e3350Smrg  # fallback: assume linklib IS sharedlib
3542aa9e3350Smrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
3543aa9e3350Smrg  ;;
3544aa9e3350Smrgesac
3545aa9e3350Smrg])
3546aa9e3350Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3547aa9e3350Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3548aa9e3350Smrg
3549aa9e3350Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3550aa9e3350Smrg    [Command to associate shared and link libraries])
3551aa9e3350Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3552aa9e3350Smrg
3553aa9e3350Smrg
3554aa9e3350Smrg# _LT_PATH_MANIFEST_TOOL
3555aa9e3350Smrg# ----------------------
3556aa9e3350Smrg# locate the manifest tool
3557aa9e3350Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
3558aa9e3350Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3559aa9e3350Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3560aa9e3350SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3561aa9e3350Smrg  [lt_cv_path_mainfest_tool=no
3562aa9e3350Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3563aa9e3350Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3564aa9e3350Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3565aa9e3350Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3566aa9e3350Smrg    lt_cv_path_mainfest_tool=yes
3567aa9e3350Smrg  fi
3568aa9e3350Smrg  rm -f conftest*])
3569aa9e3350Smrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
3570aa9e3350Smrg  MANIFEST_TOOL=:
3571aa9e3350Smrgfi
3572aa9e3350Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3573aa9e3350Smrg])# _LT_PATH_MANIFEST_TOOL
3574aa9e3350Smrg
35756aec45a7Smrg
35766aec45a7Smrg# LT_LIB_M
35776aec45a7Smrg# --------
3578ab47cfaaSmrg# check for math library
35796aec45a7SmrgAC_DEFUN([LT_LIB_M],
3580ab47cfaaSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3581ab47cfaaSmrgLIBM=
3582ab47cfaaSmrgcase $host in
35836aec45a7Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3584ab47cfaaSmrg  # These system don't have libm, or don't need it
3585ab47cfaaSmrg  ;;
3586ab47cfaaSmrg*-ncr-sysv4.3*)
3587ab47cfaaSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3588ab47cfaaSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3589ab47cfaaSmrg  ;;
3590ab47cfaaSmrg*)
3591ab47cfaaSmrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
3592ab47cfaaSmrg  ;;
3593ab47cfaaSmrgesac
35946aec45a7SmrgAC_SUBST([LIBM])
35956aec45a7Smrg])# LT_LIB_M
3596ab47cfaaSmrg
35976aec45a7Smrg# Old name:
35986aec45a7SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
35996aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
36006aec45a7Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3601ab47cfaaSmrg
3602ab47cfaaSmrg
36036aec45a7Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
36046aec45a7Smrg# -------------------------------
36056aec45a7Smrgm4_defun([_LT_COMPILER_NO_RTTI],
36066aec45a7Smrg[m4_require([_LT_TAG_COMPILER])dnl
3607ab47cfaaSmrg
36086aec45a7Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3609ab47cfaaSmrg
36106aec45a7Smrgif test "$GCC" = yes; then
36116aec45a7Smrg  case $cc_basename in
36126aec45a7Smrg  nvcc*)
36136aec45a7Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
36146aec45a7Smrg  *)
36156aec45a7Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
36166aec45a7Smrg  esac
3617ab47cfaaSmrg
36186aec45a7Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
36196aec45a7Smrg    lt_cv_prog_compiler_rtti_exceptions,
36206aec45a7Smrg    [-fno-rtti -fno-exceptions], [],
36216aec45a7Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
36225c42550eSmrgfi
36236aec45a7Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
36246aec45a7Smrg	[Compiler flag to turn off builtin functions])
36256aec45a7Smrg])# _LT_COMPILER_NO_RTTI
3626ab47cfaaSmrg
3627ab47cfaaSmrg
36286aec45a7Smrg# _LT_CMD_GLOBAL_SYMBOLS
36296aec45a7Smrg# ----------------------
36306aec45a7Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
36316aec45a7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
36326aec45a7SmrgAC_REQUIRE([AC_PROG_CC])dnl
36336aec45a7SmrgAC_REQUIRE([AC_PROG_AWK])dnl
36346aec45a7SmrgAC_REQUIRE([LT_PATH_NM])dnl
36356aec45a7SmrgAC_REQUIRE([LT_PATH_LD])dnl
36366aec45a7Smrgm4_require([_LT_DECL_SED])dnl
36376aec45a7Smrgm4_require([_LT_DECL_EGREP])dnl
36386aec45a7Smrgm4_require([_LT_TAG_COMPILER])dnl
36395c42550eSmrg
36406aec45a7Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
36416aec45a7SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
36426aec45a7SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
36436aec45a7Smrg[
36446aec45a7Smrg# These are sane defaults that work on at least a few old systems.
36456aec45a7Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
36465c42550eSmrg
36476aec45a7Smrg# Character class describing NM global symbol codes.
36486aec45a7Smrgsymcode='[[BCDEGRST]]'
36495c42550eSmrg
36506aec45a7Smrg# Regexp to match symbols that can be accessed directly from C.
36516aec45a7Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
36525c42550eSmrg
36536aec45a7Smrg# Define system-specific variables.
36545c42550eSmrgcase $host_os in
36556aec45a7Smrgaix*)
36566aec45a7Smrg  symcode='[[BCDT]]'
36575c42550eSmrg  ;;
36586aec45a7Smrgcygwin* | mingw* | pw32* | cegcc*)
36596aec45a7Smrg  symcode='[[ABCDGISTW]]'
36606aec45a7Smrg  ;;
36616aec45a7Smrghpux*)
36626aec45a7Smrg  if test "$host_cpu" = ia64; then
36636aec45a7Smrg    symcode='[[ABCDEGRST]]'
36645c42550eSmrg  fi
36656aec45a7Smrg  ;;
36666aec45a7Smrgirix* | nonstopux*)
36676aec45a7Smrg  symcode='[[BCDEGRST]]'
36686aec45a7Smrg  ;;
36696aec45a7Smrgosf*)
36706aec45a7Smrg  symcode='[[BCDEGQRST]]'
36716aec45a7Smrg  ;;
36726aec45a7Smrgsolaris*)
36736aec45a7Smrg  symcode='[[BDRT]]'
36746aec45a7Smrg  ;;
36756aec45a7Smrgsco3.2v5*)
36766aec45a7Smrg  symcode='[[DT]]'
36776aec45a7Smrg  ;;
36786aec45a7Smrgsysv4.2uw2*)
36796aec45a7Smrg  symcode='[[DT]]'
36806aec45a7Smrg  ;;
36816aec45a7Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
36826aec45a7Smrg  symcode='[[ABDT]]'
36836aec45a7Smrg  ;;
36846aec45a7Smrgsysv4)
36856aec45a7Smrg  symcode='[[DFNSTU]]'
36866aec45a7Smrg  ;;
36875c42550eSmrgesac
3688ab47cfaaSmrg
36896aec45a7Smrg# If we're using GNU nm, then use its standard symbol codes.
36906aec45a7Smrgcase `$NM -V 2>&1` in
36916aec45a7Smrg*GNU* | *'with BFD'*)
36926aec45a7Smrg  symcode='[[ABCDGIRSTW]]' ;;
36936aec45a7Smrgesac
3694ab47cfaaSmrg
36956aec45a7Smrg# Transform an extracted symbol line into a proper C declaration.
36966aec45a7Smrg# Some systems (esp. on ia64) link data and code symbols differently,
36976aec45a7Smrg# so use this general approach.
36986aec45a7Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3699ab47cfaaSmrg
37006aec45a7Smrg# Transform an extracted symbol line into symbol name and symbol address
3701aa9e3350Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
3702aa9e3350Smrglt_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'"
3703ab47cfaaSmrg
37046aec45a7Smrg# Handle CRLF in mingw tool chain
37056aec45a7Smrgopt_cr=
37066aec45a7Smrgcase $build_os in
37076aec45a7Smrgmingw*)
37086aec45a7Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
37096aec45a7Smrg  ;;
37106aec45a7Smrgesac
37115c42550eSmrg
37126aec45a7Smrg# Try without a prefix underscore, then with it.
37136aec45a7Smrgfor ac_symprfx in "" "_"; do
37145c42550eSmrg
37156aec45a7Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
37166aec45a7Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
37175c42550eSmrg
37186aec45a7Smrg  # Write the raw and C identifiers.
37196aec45a7Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
37206aec45a7Smrg    # Fake it for dumpbin and say T for any non-static function
37216aec45a7Smrg    # and D for any global variable.
37226aec45a7Smrg    # Also find C++ and __fastcall symbols from MSVC++,
37236aec45a7Smrg    # which start with @ or ?.
37246aec45a7Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
37256aec45a7Smrg"     {last_section=section; section=\$ 3};"\
3726aa9e3350Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
37276aec45a7Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
37286aec45a7Smrg"     \$ 0!~/External *\|/{next};"\
37296aec45a7Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
37306aec45a7Smrg"     {if(hide[section]) next};"\
37316aec45a7Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
37326aec45a7Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
37336aec45a7Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
37346aec45a7Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
37356aec45a7Smrg"     ' prfx=^$ac_symprfx]"
37366aec45a7Smrg  else
37376aec45a7Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
37386aec45a7Smrg  fi
3739aa9e3350Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
37405c42550eSmrg
37416aec45a7Smrg  # Check to see that the pipe works correctly.
37426aec45a7Smrg  pipe_works=no
37435c42550eSmrg
37446aec45a7Smrg  rm -f conftest*
37456aec45a7Smrg  cat > conftest.$ac_ext <<_LT_EOF
37466aec45a7Smrg#ifdef __cplusplus
37476aec45a7Smrgextern "C" {
37486aec45a7Smrg#endif
37496aec45a7Smrgchar nm_test_var;
37506aec45a7Smrgvoid nm_test_func(void);
37516aec45a7Smrgvoid nm_test_func(void){}
37526aec45a7Smrg#ifdef __cplusplus
37536aec45a7Smrg}
37546aec45a7Smrg#endif
37556aec45a7Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
37566aec45a7Smrg_LT_EOF
37575c42550eSmrg
37586aec45a7Smrg  if AC_TRY_EVAL(ac_compile); then
37596aec45a7Smrg    # Now try to grab the symbols.
37606aec45a7Smrg    nlist=conftest.nm
37616aec45a7Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
37626aec45a7Smrg      # Try sorting and uniquifying the output.
37636aec45a7Smrg      if sort "$nlist" | uniq > "$nlist"T; then
37646aec45a7Smrg	mv -f "$nlist"T "$nlist"
37656aec45a7Smrg      else
37666aec45a7Smrg	rm -f "$nlist"T
37676aec45a7Smrg      fi
37685c42550eSmrg
37696aec45a7Smrg      # Make sure that we snagged all the symbols we need.
37706aec45a7Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
37716aec45a7Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
37726aec45a7Smrg	  cat <<_LT_EOF > conftest.$ac_ext
3773aa9e3350Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
3774aa9e3350Smrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3775aa9e3350Smrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
3776aa9e3350Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
3777aa9e3350Smrg# define LT@&t@_DLSYM_CONST
3778aa9e3350Smrg#elif defined(__osf__)
3779aa9e3350Smrg/* This system does not cope well with relocations in const data.  */
3780aa9e3350Smrg# define LT@&t@_DLSYM_CONST
3781aa9e3350Smrg#else
3782aa9e3350Smrg# define LT@&t@_DLSYM_CONST const
3783aa9e3350Smrg#endif
3784aa9e3350Smrg
37856aec45a7Smrg#ifdef __cplusplus
37866aec45a7Smrgextern "C" {
37876aec45a7Smrg#endif
37885c42550eSmrg
37896aec45a7Smrg_LT_EOF
37906aec45a7Smrg	  # Now generate the symbol file.
37916aec45a7Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
37925c42550eSmrg
37936aec45a7Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
37945c42550eSmrg
37956aec45a7Smrg/* The mapping between symbol names and symbols.  */
3796aa9e3350SmrgLT@&t@_DLSYM_CONST struct {
37976aec45a7Smrg  const char *name;
37986aec45a7Smrg  void       *address;
37996aec45a7Smrg}
38006aec45a7Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
38016aec45a7Smrg{
38026aec45a7Smrg  { "@PROGRAM@", (void *) 0 },
38036aec45a7Smrg_LT_EOF
38046aec45a7Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
38056aec45a7Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
38066aec45a7Smrg  {0, (void *) 0}
38076aec45a7Smrg};
38085c42550eSmrg
38096aec45a7Smrg/* This works around a problem in FreeBSD linker */
38106aec45a7Smrg#ifdef FREEBSD_WORKAROUND
38116aec45a7Smrgstatic const void *lt_preloaded_setup() {
38126aec45a7Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
38136aec45a7Smrg}
38146aec45a7Smrg#endif
38155c42550eSmrg
38166aec45a7Smrg#ifdef __cplusplus
38176aec45a7Smrg}
38186aec45a7Smrg#endif
38196aec45a7Smrg_LT_EOF
38206aec45a7Smrg	  # Now try linking the two files.
38216aec45a7Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
3822aa9e3350Smrg	  lt_globsym_save_LIBS=$LIBS
3823aa9e3350Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
38246aec45a7Smrg	  LIBS="conftstm.$ac_objext"
38256aec45a7Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
38266aec45a7Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
38276aec45a7Smrg	    pipe_works=yes
38286aec45a7Smrg	  fi
3829aa9e3350Smrg	  LIBS=$lt_globsym_save_LIBS
3830aa9e3350Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
38316aec45a7Smrg	else
38326aec45a7Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
38336aec45a7Smrg	fi
38346aec45a7Smrg      else
38356aec45a7Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
38366aec45a7Smrg      fi
3837ab47cfaaSmrg    else
38386aec45a7Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3839ab47cfaaSmrg    fi
3840ab47cfaaSmrg  else
38416aec45a7Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
38426aec45a7Smrg    cat conftest.$ac_ext >&5
3843ab47cfaaSmrg  fi
38446aec45a7Smrg  rm -rf conftest* conftst*
3845ab47cfaaSmrg
38466aec45a7Smrg  # Do not use the global_symbol_pipe unless it works.
38476aec45a7Smrg  if test "$pipe_works" = yes; then
38486aec45a7Smrg    break
38496aec45a7Smrg  else
38506aec45a7Smrg    lt_cv_sys_global_symbol_pipe=
38516aec45a7Smrg  fi
38526aec45a7Smrgdone
38536aec45a7Smrg])
38546aec45a7Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
38556aec45a7Smrg  lt_cv_sys_global_symbol_to_cdecl=
38566aec45a7Smrgfi
38576aec45a7Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
38586aec45a7Smrg  AC_MSG_RESULT(failed)
3859ab47cfaaSmrgelse
38606aec45a7Smrg  AC_MSG_RESULT(ok)
3861ab47cfaaSmrgfi
3862ab47cfaaSmrg
3863aa9e3350Smrg# Response file support.
3864aa9e3350Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
3865aa9e3350Smrg  nm_file_list_spec='@'
3866aa9e3350Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
3867aa9e3350Smrg  nm_file_list_spec='@'
3868aa9e3350Smrgfi
3869aa9e3350Smrg
38706aec45a7Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
38716aec45a7Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
38726aec45a7Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
38736aec45a7Smrg    [Transform the output of nm in a proper C declaration])
38746aec45a7Smrg_LT_DECL([global_symbol_to_c_name_address],
38756aec45a7Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
38766aec45a7Smrg    [Transform the output of nm in a C name address pair])
38776aec45a7Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
38786aec45a7Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
38796aec45a7Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
3880aa9e3350Smrg_LT_DECL([], [nm_file_list_spec], [1],
3881aa9e3350Smrg    [Specify filename containing input files for $NM])
38826aec45a7Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
3883ab47cfaaSmrg
3884ab47cfaaSmrg
38856aec45a7Smrg# _LT_COMPILER_PIC([TAGNAME])
38866aec45a7Smrg# ---------------------------
38876aec45a7Smrgm4_defun([_LT_COMPILER_PIC],
38886aec45a7Smrg[m4_require([_LT_TAG_COMPILER])dnl
38896aec45a7Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
38906aec45a7Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
38916aec45a7Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
3892ab47cfaaSmrg
38936aec45a7Smrgm4_if([$1], [CXX], [
38946aec45a7Smrg  # C++ specific cases for pic, static, wl, etc.
38956aec45a7Smrg  if test "$GXX" = yes; then
38966aec45a7Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
38976aec45a7Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
38985c42550eSmrg
38996aec45a7Smrg    case $host_os in
39006aec45a7Smrg    aix*)
39016aec45a7Smrg      # All AIX code is PIC.
39025c42550eSmrg      if test "$host_cpu" = ia64; then
39036aec45a7Smrg	# AIX 5 now supports IA64 processor
39046aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
39055c42550eSmrg      fi
39066aec45a7Smrg      ;;
39075c42550eSmrg
39086aec45a7Smrg    amigaos*)
39096aec45a7Smrg      case $host_cpu in
39106aec45a7Smrg      powerpc)
39116aec45a7Smrg            # see comment about AmigaOS4 .so support
39126aec45a7Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39135c42550eSmrg        ;;
39146aec45a7Smrg      m68k)
39156aec45a7Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
39166aec45a7Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
39176aec45a7Smrg            # like `-m68040'.
39186aec45a7Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
39196aec45a7Smrg        ;;
39206aec45a7Smrg      esac
39216aec45a7Smrg      ;;
39225c42550eSmrg
39236aec45a7Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
39246aec45a7Smrg      # PIC is the default for these OSes.
39255c42550eSmrg      ;;
39266aec45a7Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
39276aec45a7Smrg      # This hack is so that the source file can tell whether it is being
39286aec45a7Smrg      # built for inclusion in a dll (and should export symbols for example).
39296aec45a7Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
39306aec45a7Smrg      # (--disable-auto-import) libraries
39316aec45a7Smrg      m4_if([$1], [GCJ], [],
39326aec45a7Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
39335c42550eSmrg      ;;
39346aec45a7Smrg    darwin* | rhapsody*)
39356aec45a7Smrg      # PIC is the default on this platform
39366aec45a7Smrg      # Common symbols not allowed in MH_DYLIB files
39376aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
39386aec45a7Smrg      ;;
39396aec45a7Smrg    *djgpp*)
39406aec45a7Smrg      # DJGPP does not support shared libraries at all
39416aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
39426aec45a7Smrg      ;;
39436aec45a7Smrg    haiku*)
39446aec45a7Smrg      # PIC is the default for Haiku.
39456aec45a7Smrg      # The "-static" flag exists, but is broken.
39466aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
39476aec45a7Smrg      ;;
39486aec45a7Smrg    interix[[3-9]]*)
39496aec45a7Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
39506aec45a7Smrg      # Instead, we relocate shared libraries at runtime.
39516aec45a7Smrg      ;;
39526aec45a7Smrg    sysv4*MP*)
39536aec45a7Smrg      if test -d /usr/nec; then
39546aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3955ab47cfaaSmrg      fi
3956ab47cfaaSmrg      ;;
39576aec45a7Smrg    hpux*)
39586aec45a7Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
39596aec45a7Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
39606aec45a7Smrg      # sets the default TLS model and affects inlining.
3961ab47cfaaSmrg      case $host_cpu in
39626aec45a7Smrg      hppa*64*)
39636aec45a7Smrg	;;
39645c42550eSmrg      *)
39656aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39666aec45a7Smrg	;;
3967ab47cfaaSmrg      esac
39686aec45a7Smrg      ;;
39696aec45a7Smrg    *qnx* | *nto*)
39706aec45a7Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
39716aec45a7Smrg      # it will coredump.
39726aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
39735c42550eSmrg      ;;
39745c42550eSmrg    *)
39756aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3976ab47cfaaSmrg      ;;
39775c42550eSmrg    esac
39786aec45a7Smrg  else
39796aec45a7Smrg    case $host_os in
39806aec45a7Smrg      aix[[4-9]]*)
39816aec45a7Smrg	# All AIX code is PIC.
39826aec45a7Smrg	if test "$host_cpu" = ia64; then
39836aec45a7Smrg	  # AIX 5 now supports IA64 processor
39846aec45a7Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
39856aec45a7Smrg	else
39866aec45a7Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
39876aec45a7Smrg	fi
3988ab47cfaaSmrg	;;
39896aec45a7Smrg      chorus*)
39906aec45a7Smrg	case $cc_basename in
39916aec45a7Smrg	cxch68*)
39926aec45a7Smrg	  # Green Hills C++ Compiler
39936aec45a7Smrg	  # _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"
3994ab47cfaaSmrg	  ;;
3995ab47cfaaSmrg	esac
3996ab47cfaaSmrg	;;
3997aa9e3350Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
3998aa9e3350Smrg	# This hack is so that the source file can tell whether it is being
3999aa9e3350Smrg	# built for inclusion in a dll (and should export symbols for example).
4000aa9e3350Smrg	m4_if([$1], [GCJ], [],
4001aa9e3350Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4002aa9e3350Smrg	;;
40036aec45a7Smrg      dgux*)
40046aec45a7Smrg	case $cc_basename in
40056aec45a7Smrg	  ec++*)
40066aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40076aec45a7Smrg	    ;;
40086aec45a7Smrg	  ghcx*)
40096aec45a7Smrg	    # Green Hills C++ Compiler
40106aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
40116aec45a7Smrg	    ;;
40126aec45a7Smrg	  *)
40136aec45a7Smrg	    ;;
40146aec45a7Smrg	esac
40156aec45a7Smrg	;;
40166aec45a7Smrg      freebsd* | dragonfly*)
40176aec45a7Smrg	# FreeBSD uses GNU C++
40186aec45a7Smrg	;;
40196aec45a7Smrg      hpux9* | hpux10* | hpux11*)
40206aec45a7Smrg	case $cc_basename in
40216aec45a7Smrg	  CC*)
40226aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40236aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
40246aec45a7Smrg	    if test "$host_cpu" != ia64; then
40256aec45a7Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
40266aec45a7Smrg	    fi
40276aec45a7Smrg	    ;;
40286aec45a7Smrg	  aCC*)
40296aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40306aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4031ab47cfaaSmrg	    case $host_cpu in
40326aec45a7Smrg	    hppa*64*|ia64*)
40336aec45a7Smrg	      # +Z the default
4034ab47cfaaSmrg	      ;;
4035ab47cfaaSmrg	    *)
40366aec45a7Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4037ab47cfaaSmrg	      ;;
4038ab47cfaaSmrg	    esac
40396aec45a7Smrg	    ;;
40406aec45a7Smrg	  *)
40416aec45a7Smrg	    ;;
40426aec45a7Smrg	esac
4043ab47cfaaSmrg	;;
40446aec45a7Smrg      interix*)
40456aec45a7Smrg	# This is c89, which is MS Visual C++ (no shared libs)
40466aec45a7Smrg	# Anyone wants to do a port?
40475c42550eSmrg	;;
40486aec45a7Smrg      irix5* | irix6* | nonstopux*)
40496aec45a7Smrg	case $cc_basename in
40506aec45a7Smrg	  CC*)
40516aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40526aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40536aec45a7Smrg	    # CC pic flag -KPIC is the default.
40546aec45a7Smrg	    ;;
40556aec45a7Smrg	  *)
40566aec45a7Smrg	    ;;
40576aec45a7Smrg	esac
40585c42550eSmrg	;;
405938770048Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
40606aec45a7Smrg	case $cc_basename in
40616aec45a7Smrg	  KCC*)
40626aec45a7Smrg	    # KAI C++ Compiler
40636aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
40646aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
40656aec45a7Smrg	    ;;
40666aec45a7Smrg	  ecpc* )
40676aec45a7Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
40686aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40696aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40706aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
40716aec45a7Smrg	    ;;
40726aec45a7Smrg	  icpc* )
40736aec45a7Smrg	    # Intel C++, used to be incompatible with GCC.
40746aec45a7Smrg	    # ICC 10 doesn't accept -KPIC any more.
40756aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40766aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
40776aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
40786aec45a7Smrg	    ;;
40796aec45a7Smrg	  pgCC* | pgcpp*)
40806aec45a7Smrg	    # Portland Group C++ compiler
40816aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40826aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
40836aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
40846aec45a7Smrg	    ;;
40856aec45a7Smrg	  cxx*)
40866aec45a7Smrg	    # Compaq C++
40876aec45a7Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
40886aec45a7Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
40896aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
40906aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40916aec45a7Smrg	    ;;
40926aec45a7Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
40936aec45a7Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
40946aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40956aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
40966aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
40976aec45a7Smrg	    ;;
40986aec45a7Smrg	  *)
40996aec45a7Smrg	    case `$CC -V 2>&1 | sed 5q` in
41006aec45a7Smrg	    *Sun\ C*)
41016aec45a7Smrg	      # Sun C++ 5.9
41026aec45a7Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41036aec45a7Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41046aec45a7Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
41056aec45a7Smrg	      ;;
41066aec45a7Smrg	    esac
41076aec45a7Smrg	    ;;
41088697ee19Smrg	esac
41098697ee19Smrg	;;
41106aec45a7Smrg      lynxos*)
41115c42550eSmrg	;;
41126aec45a7Smrg      m88k*)
41136aec45a7Smrg	;;
41146aec45a7Smrg      mvs*)
41156aec45a7Smrg	case $cc_basename in
41166aec45a7Smrg	  cxx*)
41176aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
41186aec45a7Smrg	    ;;
41196aec45a7Smrg	  *)
41206aec45a7Smrg	    ;;
41211473d951Smrg	esac
4122ab47cfaaSmrg	;;
412338770048Smrg      netbsd* | netbsdelf*-gnu)
4124ab47cfaaSmrg	;;
41256aec45a7Smrg      *qnx* | *nto*)
41266aec45a7Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
41276aec45a7Smrg        # it will coredump.
41286aec45a7Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
41296aec45a7Smrg        ;;
41306aec45a7Smrg      osf3* | osf4* | osf5*)
41316aec45a7Smrg	case $cc_basename in
41326aec45a7Smrg	  KCC*)
41336aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
41346aec45a7Smrg	    ;;
41356aec45a7Smrg	  RCC*)
41366aec45a7Smrg	    # Rational C++ 2.4.1
41376aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
41386aec45a7Smrg	    ;;
41396aec45a7Smrg	  cxx*)
41406aec45a7Smrg	    # Digital/Compaq C++
41416aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41426aec45a7Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
41436aec45a7Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
41446aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
41456aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
41466aec45a7Smrg	    ;;
41476aec45a7Smrg	  *)
41486aec45a7Smrg	    ;;
41496aec45a7Smrg	esac
4150ab47cfaaSmrg	;;
41516aec45a7Smrg      psos*)
41526aec45a7Smrg	;;
41536aec45a7Smrg      solaris*)
41546aec45a7Smrg	case $cc_basename in
41556aec45a7Smrg	  CC* | sunCC*)
41566aec45a7Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
41576aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41586aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41596aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
41606aec45a7Smrg	    ;;
41616aec45a7Smrg	  gcx*)
41626aec45a7Smrg	    # Green Hills C++ Compiler
41636aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
41646aec45a7Smrg	    ;;
41656aec45a7Smrg	  *)
41666aec45a7Smrg	    ;;
41676aec45a7Smrg	esac
41686aec45a7Smrg	;;
41696aec45a7Smrg      sunos4*)
41706aec45a7Smrg	case $cc_basename in
41716aec45a7Smrg	  CC*)
41726aec45a7Smrg	    # Sun C++ 4.x
41736aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
41746aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41756aec45a7Smrg	    ;;
41766aec45a7Smrg	  lcc*)
41776aec45a7Smrg	    # Lucid
41786aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
41796aec45a7Smrg	    ;;
41806aec45a7Smrg	  *)
41816aec45a7Smrg	    ;;
41826aec45a7Smrg	esac
4183ab47cfaaSmrg	;;
41846aec45a7Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
41856aec45a7Smrg	case $cc_basename in
41866aec45a7Smrg	  CC*)
41876aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41886aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41896aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41906aec45a7Smrg	    ;;
41916aec45a7Smrg	esac
41926aec45a7Smrg	;;
41936aec45a7Smrg      tandem*)
41946aec45a7Smrg	case $cc_basename in
41956aec45a7Smrg	  NCC*)
41966aec45a7Smrg	    # NonStop-UX NCC 3.20
41976aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41986aec45a7Smrg	    ;;
41996aec45a7Smrg	  *)
42006aec45a7Smrg	    ;;
42016aec45a7Smrg	esac
4202ab47cfaaSmrg	;;
42036aec45a7Smrg      vxworks*)
4204ab47cfaaSmrg	;;
42055c42550eSmrg      *)
42066aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4207ab47cfaaSmrg	;;
42085c42550eSmrg    esac
42096aec45a7Smrg  fi
42106aec45a7Smrg],
42116aec45a7Smrg[
42126aec45a7Smrg  if test "$GCC" = yes; then
42136aec45a7Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
42146aec45a7Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
42156aec45a7Smrg
42166aec45a7Smrg    case $host_os in
42176aec45a7Smrg      aix*)
42186aec45a7Smrg      # All AIX code is PIC.
42196aec45a7Smrg      if test "$host_cpu" = ia64; then
42206aec45a7Smrg	# AIX 5 now supports IA64 processor
42216aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
42226aec45a7Smrg      fi
42236aec45a7Smrg      ;;
42245c42550eSmrg
42256aec45a7Smrg    amigaos*)
42266aec45a7Smrg      case $host_cpu in
42276aec45a7Smrg      powerpc)
42286aec45a7Smrg            # see comment about AmigaOS4 .so support
42296aec45a7Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42306aec45a7Smrg        ;;
42316aec45a7Smrg      m68k)
42326aec45a7Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
42336aec45a7Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
42346aec45a7Smrg            # like `-m68040'.
42356aec45a7Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
42366aec45a7Smrg        ;;
42376aec45a7Smrg      esac
42386aec45a7Smrg      ;;
42395c42550eSmrg
42406aec45a7Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
42416aec45a7Smrg      # PIC is the default for these OSes.
42426aec45a7Smrg      ;;
42435c42550eSmrg
42446aec45a7Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
42456aec45a7Smrg      # This hack is so that the source file can tell whether it is being
42466aec45a7Smrg      # built for inclusion in a dll (and should export symbols for example).
42476aec45a7Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
42486aec45a7Smrg      # (--disable-auto-import) libraries
42496aec45a7Smrg      m4_if([$1], [GCJ], [],
42506aec45a7Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
42516aec45a7Smrg      ;;
42525c42550eSmrg
42536aec45a7Smrg    darwin* | rhapsody*)
42546aec45a7Smrg      # PIC is the default on this platform
42556aec45a7Smrg      # Common symbols not allowed in MH_DYLIB files
42566aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
42576aec45a7Smrg      ;;
42585c42550eSmrg
42596aec45a7Smrg    haiku*)
42606aec45a7Smrg      # PIC is the default for Haiku.
42616aec45a7Smrg      # The "-static" flag exists, but is broken.
42626aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
42636aec45a7Smrg      ;;
42645c42550eSmrg
42656aec45a7Smrg    hpux*)
42666aec45a7Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
42676aec45a7Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
42686aec45a7Smrg      # sets the default TLS model and affects inlining.
42696aec45a7Smrg      case $host_cpu in
42706aec45a7Smrg      hppa*64*)
42716aec45a7Smrg	# +Z the default
42725c42550eSmrg	;;
42735c42550eSmrg      *)
42746aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42755c42550eSmrg	;;
42766aec45a7Smrg      esac
42776aec45a7Smrg      ;;
42785c42550eSmrg
42796aec45a7Smrg    interix[[3-9]]*)
42806aec45a7Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
42816aec45a7Smrg      # Instead, we relocate shared libraries at runtime.
42826aec45a7Smrg      ;;
42835c42550eSmrg
42846aec45a7Smrg    msdosdjgpp*)
42856aec45a7Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
42866aec45a7Smrg      # on systems that don't support them.
42876aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
42886aec45a7Smrg      enable_shared=no
42896aec45a7Smrg      ;;
4290ab47cfaaSmrg
42916aec45a7Smrg    *nto* | *qnx*)
42926aec45a7Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
42936aec45a7Smrg      # it will coredump.
42946aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
42956aec45a7Smrg      ;;
42961473d951Smrg
42976aec45a7Smrg    sysv4*MP*)
42986aec45a7Smrg      if test -d /usr/nec; then
42996aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
43006aec45a7Smrg      fi
43016aec45a7Smrg      ;;
43021473d951Smrg
43036aec45a7Smrg    *)
43046aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
43056aec45a7Smrg      ;;
43065c42550eSmrg    esac
43075c42550eSmrg
43085c42550eSmrg    case $cc_basename in
43096aec45a7Smrg    nvcc*) # Cuda Compiler Driver 2.2
43106aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4311aa9e3350Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4312aa9e3350Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4313aa9e3350Smrg      fi
43146aec45a7Smrg      ;;
4315ab47cfaaSmrg    esac
43166aec45a7Smrg  else
43176aec45a7Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
43186aec45a7Smrg    case $host_os in
43196aec45a7Smrg    aix*)
43206aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43216aec45a7Smrg      if test "$host_cpu" = ia64; then
43226aec45a7Smrg	# AIX 5 now supports IA64 processor
43236aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43246aec45a7Smrg      else
43256aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
43266aec45a7Smrg      fi
43276aec45a7Smrg      ;;
43285c42550eSmrg
43296aec45a7Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
43306aec45a7Smrg      # This hack is so that the source file can tell whether it is being
43316aec45a7Smrg      # built for inclusion in a dll (and should export symbols for example).
43326aec45a7Smrg      m4_if([$1], [GCJ], [],
43336aec45a7Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
43346aec45a7Smrg      ;;
43356aec45a7Smrg
43366aec45a7Smrg    hpux9* | hpux10* | hpux11*)
43376aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43386aec45a7Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
43396aec45a7Smrg      # not for PA HP-UX.
43406aec45a7Smrg      case $host_cpu in
43416aec45a7Smrg      hppa*64*|ia64*)
43426aec45a7Smrg	# +Z the default
4343ab47cfaaSmrg	;;
4344ab47cfaaSmrg      *)
43456aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
43461473d951Smrg	;;
43476aec45a7Smrg      esac
43486aec45a7Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
43496aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
43506aec45a7Smrg      ;;
43516aec45a7Smrg
43526aec45a7Smrg    irix5* | irix6* | nonstopux*)
43536aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43546aec45a7Smrg      # PIC (with -KPIC) is the default.
43556aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
43566aec45a7Smrg      ;;
43576aec45a7Smrg
435838770048Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
43596aec45a7Smrg      case $cc_basename in
43606aec45a7Smrg      # old Intel for x86_64 which still supported -KPIC.
43616aec45a7Smrg      ecc*)
43626aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43636aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
43646aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
43656aec45a7Smrg        ;;
43666aec45a7Smrg      # icc used to be incompatible with GCC.
43676aec45a7Smrg      # ICC 10 doesn't accept -KPIC any more.
43686aec45a7Smrg      icc* | ifort*)
43696aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43706aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
43716aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
43726aec45a7Smrg        ;;
43736aec45a7Smrg      # Lahey Fortran 8.1.
43746aec45a7Smrg      lf95*)
43756aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43766aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
43776aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
43786aec45a7Smrg	;;
4379aa9e3350Smrg      nagfor*)
4380aa9e3350Smrg	# NAG Fortran compiler
4381aa9e3350Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4382aa9e3350Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4383aa9e3350Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4384aa9e3350Smrg	;;
43856aec45a7Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
43866aec45a7Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
43876aec45a7Smrg	# which looks to be a dead project)
43886aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43896aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
43906aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43916aec45a7Smrg        ;;
43926aec45a7Smrg      ccc*)
43936aec45a7Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43946aec45a7Smrg        # All Alpha code is PIC.
43956aec45a7Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
43966aec45a7Smrg        ;;
43976aec45a7Smrg      xl* | bgxl* | bgf* | mpixl*)
43986aec45a7Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
43996aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44006aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
44016aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4402ab47cfaaSmrg	;;
4403ab47cfaaSmrg      *)
44046aec45a7Smrg	case `$CC -V 2>&1 | sed 5q` in
4405aa9e3350Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
44066aec45a7Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
44076aec45a7Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44086aec45a7Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44096aec45a7Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
44106aec45a7Smrg	  ;;
4411aa9e3350Smrg	*Sun\ F* | *Sun*Fortran*)
4412aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4413aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4414aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4415aa9e3350Smrg	  ;;
44166aec45a7Smrg	*Sun\ C*)
44176aec45a7Smrg	  # Sun C 5.9
44186aec45a7Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44196aec45a7Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44206aec45a7Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44216aec45a7Smrg	  ;;
4422aa9e3350Smrg        *Intel*\ [[CF]]*Compiler*)
4423aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4424aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4425aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4426aa9e3350Smrg	  ;;
4427aa9e3350Smrg	*Portland\ Group*)
4428aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4429aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4430aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4431aa9e3350Smrg	  ;;
44326aec45a7Smrg	esac
4433ab47cfaaSmrg	;;
44346aec45a7Smrg      esac
44356aec45a7Smrg      ;;
4436ab47cfaaSmrg
44376aec45a7Smrg    newsos6)
44386aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44396aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44406aec45a7Smrg      ;;
4441ab47cfaaSmrg
44426aec45a7Smrg    *nto* | *qnx*)
44436aec45a7Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
44446aec45a7Smrg      # it will coredump.
44456aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
44466aec45a7Smrg      ;;
4447ab47cfaaSmrg
44486aec45a7Smrg    osf3* | osf4* | osf5*)
44496aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44506aec45a7Smrg      # All OSF/1 code is PIC.
44516aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44526aec45a7Smrg      ;;
4453ab47cfaaSmrg
44546aec45a7Smrg    rdos*)
44556aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44566aec45a7Smrg      ;;
4457ab47cfaaSmrg
44586aec45a7Smrg    solaris*)
44596aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44606aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44616aec45a7Smrg      case $cc_basename in
44626aec45a7Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
44636aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
44646aec45a7Smrg      *)
44656aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
44666aec45a7Smrg      esac
44676aec45a7Smrg      ;;
4468ab47cfaaSmrg
44696aec45a7Smrg    sunos4*)
44706aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44716aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
44726aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44736aec45a7Smrg      ;;
4474ab47cfaaSmrg
44756aec45a7Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
44766aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44776aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44786aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44796aec45a7Smrg      ;;
4480ab47cfaaSmrg
44816aec45a7Smrg    sysv4*MP*)
44826aec45a7Smrg      if test -d /usr/nec ;then
44836aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
44846aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44856aec45a7Smrg      fi
44866aec45a7Smrg      ;;
4487ab47cfaaSmrg
44886aec45a7Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
44896aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44906aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44916aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44926aec45a7Smrg      ;;
4493ab47cfaaSmrg
44946aec45a7Smrg    unicos*)
44956aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44966aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
44976aec45a7Smrg      ;;
44985c42550eSmrg
44996aec45a7Smrg    uts4*)
45006aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
45016aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
45026aec45a7Smrg      ;;
4503ab47cfaaSmrg
45046aec45a7Smrg    *)
45056aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
45066aec45a7Smrg      ;;
4507ab47cfaaSmrg    esac
45086aec45a7Smrg  fi
45096aec45a7Smrg])
45106aec45a7Smrgcase $host_os in
45116aec45a7Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
45126aec45a7Smrg  *djgpp*)
45136aec45a7Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
45146aec45a7Smrg    ;;
45156aec45a7Smrg  *)
45166aec45a7Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
45176aec45a7Smrg    ;;
45186aec45a7Smrgesac
4519aa9e3350Smrg
4520aa9e3350SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
4521aa9e3350Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4522aa9e3350Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4523aa9e3350Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4524ab47cfaaSmrg
45256aec45a7Smrg#
45266aec45a7Smrg# Check to make sure the PIC flag actually works.
45276aec45a7Smrg#
45286aec45a7Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
45296aec45a7Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
45306aec45a7Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
45316aec45a7Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
45326aec45a7Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
45336aec45a7Smrg     "" | " "*) ;;
45346aec45a7Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
45356aec45a7Smrg     esac],
45366aec45a7Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
45376aec45a7Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
45381473d951Smrgfi
45396aec45a7Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
45406aec45a7Smrg	[Additional compiler flags for building library objects])
4541ab47cfaaSmrg
4542aa9e3350Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4543aa9e3350Smrg	[How to pass a linker flag through the compiler])
45446aec45a7Smrg#
45456aec45a7Smrg# Check to make sure the static flag actually works.
45466aec45a7Smrg#
45476aec45a7Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
45486aec45a7Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
45496aec45a7Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
45506aec45a7Smrg  $lt_tmp_static_flag,
45516aec45a7Smrg  [],
45526aec45a7Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
45536aec45a7Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
45546aec45a7Smrg	[Compiler flag to prevent dynamic linking])
45556aec45a7Smrg])# _LT_COMPILER_PIC
4556ab47cfaaSmrg
45575c42550eSmrg
45586aec45a7Smrg# _LT_LINKER_SHLIBS([TAGNAME])
45596aec45a7Smrg# ----------------------------
45606aec45a7Smrg# See if the linker supports building shared libraries.
45616aec45a7Smrgm4_defun([_LT_LINKER_SHLIBS],
45626aec45a7Smrg[AC_REQUIRE([LT_PATH_LD])dnl
45636aec45a7SmrgAC_REQUIRE([LT_PATH_NM])dnl
4564aa9e3350Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
45656aec45a7Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
45666aec45a7Smrgm4_require([_LT_DECL_EGREP])dnl
45676aec45a7Smrgm4_require([_LT_DECL_SED])dnl
45686aec45a7Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
45696aec45a7Smrgm4_require([_LT_TAG_COMPILER])dnl
45706aec45a7SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
45716aec45a7Smrgm4_if([$1], [CXX], [
45726aec45a7Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4573aa9e3350Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
45746aec45a7Smrg  case $host_os in
45756aec45a7Smrg  aix[[4-9]]*)
45766aec45a7Smrg    # If we're using GNU nm, then we don't want the "-C" option.
45776aec45a7Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
45786aec45a7Smrg    # Also, AIX nm treats weak defined symbols like other global defined
45796aec45a7Smrg    # symbols, whereas GNU nm marks them as "W".
45806aec45a7Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
45816aec45a7Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
45826aec45a7Smrg    else
45836aec45a7Smrg      _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'
45848697ee19Smrg    fi
45858697ee19Smrg    ;;
45866aec45a7Smrg  pw32*)
45876aec45a7Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4588aa9e3350Smrg    ;;
45896aec45a7Smrg  cygwin* | mingw* | cegcc*)
4590aa9e3350Smrg    case $cc_basename in
4591aa9e3350Smrg    cl*)
4592aa9e3350Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4593aa9e3350Smrg      ;;
4594aa9e3350Smrg    *)
4595aa9e3350Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4596aa9e3350Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4597aa9e3350Smrg      ;;
4598aa9e3350Smrg    esac
4599aa9e3350Smrg    ;;
460038770048Smrg  linux* | k*bsd*-gnu | gnu*)
460138770048Smrg    _LT_TAGVAR(link_all_deplibs, $1)=no
460238770048Smrg    ;;
46036aec45a7Smrg  *)
46046aec45a7Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4605aa9e3350Smrg    ;;
46066aec45a7Smrg  esac
46076aec45a7Smrg], [
46086aec45a7Smrg  runpath_var=
46096aec45a7Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
46106aec45a7Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
46116aec45a7Smrg  _LT_TAGVAR(archive_cmds, $1)=
46126aec45a7Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
46136aec45a7Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
46146aec45a7Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
46156aec45a7Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
46166aec45a7Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
46176aec45a7Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
46186aec45a7Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
46196aec45a7Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
46206aec45a7Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
46216aec45a7Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
46226aec45a7Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
46236aec45a7Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
46246aec45a7Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
46256aec45a7Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
46266aec45a7Smrg  _LT_TAGVAR(module_cmds, $1)=
46276aec45a7Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
46286aec45a7Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
46296aec45a7Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
46306aec45a7Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
46316aec45a7Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
46326aec45a7Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
46336aec45a7Smrg  # included in the symbol list
46346aec45a7Smrg  _LT_TAGVAR(include_expsyms, $1)=
46356aec45a7Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
46366aec45a7Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
46376aec45a7Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
46386aec45a7Smrg  # as well as any symbol that contains `d'.
46396aec45a7Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
46406aec45a7Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
46416aec45a7Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
46426aec45a7Smrg  # the symbol is explicitly referenced.  Since portable code cannot
46436aec45a7Smrg  # rely on this symbol name, it's probably fine to never include it in
46446aec45a7Smrg  # preloaded symbol tables.
46456aec45a7Smrg  # Exclude shared library initialization/finalization symbols.
46466aec45a7Smrgdnl Note also adjust exclude_expsyms for C++ above.
46476aec45a7Smrg  extract_expsyms_cmds=
46488697ee19Smrg
46496aec45a7Smrg  case $host_os in
46506aec45a7Smrg  cygwin* | mingw* | pw32* | cegcc*)
46516aec45a7Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
46526aec45a7Smrg    # When not using gcc, we currently assume that we are using
46536aec45a7Smrg    # Microsoft Visual C++.
46546aec45a7Smrg    if test "$GCC" != yes; then
46556aec45a7Smrg      with_gnu_ld=no
46568697ee19Smrg    fi
4657ab47cfaaSmrg    ;;
46586aec45a7Smrg  interix*)
46596aec45a7Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
46606aec45a7Smrg    with_gnu_ld=yes
46616aec45a7Smrg    ;;
46626aec45a7Smrg  openbsd*)
46636aec45a7Smrg    with_gnu_ld=no
46646aec45a7Smrg    ;;
466538770048Smrg  linux* | k*bsd*-gnu | gnu*)
466638770048Smrg    _LT_TAGVAR(link_all_deplibs, $1)=no
466738770048Smrg    ;;
4668ab47cfaaSmrg  esac
4669ab47cfaaSmrg
46706aec45a7Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
4671ab47cfaaSmrg
46726aec45a7Smrg  # On some targets, GNU ld is compatible enough with the native linker
46736aec45a7Smrg  # that we're better off using the native interface for both.
46746aec45a7Smrg  lt_use_gnu_ld_interface=no
46756aec45a7Smrg  if test "$with_gnu_ld" = yes; then
46766aec45a7Smrg    case $host_os in
46776aec45a7Smrg      aix*)
46786aec45a7Smrg	# The AIX port of GNU ld has always aspired to compatibility
46796aec45a7Smrg	# with the native linker.  However, as the warning in the GNU ld
46806aec45a7Smrg	# block says, versions before 2.19.5* couldn't really create working
46816aec45a7Smrg	# shared libraries, regardless of the interface used.
46826aec45a7Smrg	case `$LD -v 2>&1` in
46836aec45a7Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
46846aec45a7Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
46856aec45a7Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
46866aec45a7Smrg	  *)
46876aec45a7Smrg	    lt_use_gnu_ld_interface=yes
46886aec45a7Smrg	    ;;
46896aec45a7Smrg	esac
46906aec45a7Smrg	;;
46916aec45a7Smrg      *)
46926aec45a7Smrg	lt_use_gnu_ld_interface=yes
46936aec45a7Smrg	;;
46946aec45a7Smrg    esac
46956aec45a7Smrg  fi
4696ab47cfaaSmrg
46976aec45a7Smrg  if test "$lt_use_gnu_ld_interface" = yes; then
46986aec45a7Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
46996aec45a7Smrg    wlarc='${wl}'
4700ab47cfaaSmrg
47016aec45a7Smrg    # Set some defaults for GNU ld with shared library support. These
47026aec45a7Smrg    # are reset later if shared libraries are not supported. Putting them
47036aec45a7Smrg    # here allows them to be overridden if necessary.
47046aec45a7Smrg    runpath_var=LD_RUN_PATH
47056aec45a7Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
47066aec45a7Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
47076aec45a7Smrg    # ancient GNU ld didn't support --whole-archive et. al.
47086aec45a7Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
47096aec45a7Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
47106aec45a7Smrg    else
47116aec45a7Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
47126aec45a7Smrg    fi
47136aec45a7Smrg    supports_anon_versioning=no
47146aec45a7Smrg    case `$LD -v 2>&1` in
47156aec45a7Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
47166aec45a7Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
47176aec45a7Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
47186aec45a7Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
47196aec45a7Smrg      *\ 2.11.*) ;; # other 2.11 versions
47206aec45a7Smrg      *) supports_anon_versioning=yes ;;
47216aec45a7Smrg    esac
4722ab47cfaaSmrg
47236aec45a7Smrg    # See if GNU ld supports shared libraries.
47246aec45a7Smrg    case $host_os in
47256aec45a7Smrg    aix[[3-9]]*)
47266aec45a7Smrg      # On AIX/PPC, the GNU linker is very broken
47276aec45a7Smrg      if test "$host_cpu" != ia64; then
47286aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
47296aec45a7Smrg	cat <<_LT_EOF 1>&2
4730ab47cfaaSmrg
47316aec45a7Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
47326aec45a7Smrg*** to be unable to reliably create shared libraries on AIX.
47336aec45a7Smrg*** Therefore, libtool is disabling shared libraries support.  If you
47346aec45a7Smrg*** really care for shared libraries, you may want to install binutils
47356aec45a7Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
47366aec45a7Smrg*** You will then need to restart the configuration process.
4737ab47cfaaSmrg
47386aec45a7Smrg_LT_EOF
47396aec45a7Smrg      fi
47406aec45a7Smrg      ;;
4741ab47cfaaSmrg
47426aec45a7Smrg    amigaos*)
47436aec45a7Smrg      case $host_cpu in
47446aec45a7Smrg      powerpc)
47456aec45a7Smrg            # see comment about AmigaOS4 .so support
47466aec45a7Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
47476aec45a7Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
47486aec45a7Smrg        ;;
47496aec45a7Smrg      m68k)
47506aec45a7Smrg            _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)'
47516aec45a7Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
47526aec45a7Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
47536aec45a7Smrg        ;;
47546aec45a7Smrg      esac
47556aec45a7Smrg      ;;
4756ab47cfaaSmrg
47576aec45a7Smrg    beos*)
47586aec45a7Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
47596aec45a7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
47606aec45a7Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
47616aec45a7Smrg	# support --undefined.  This deserves some investigation.  FIXME
47626aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
47636aec45a7Smrg      else
47646aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
47656aec45a7Smrg      fi
47666aec45a7Smrg      ;;
4767ab47cfaaSmrg
47686aec45a7Smrg    cygwin* | mingw* | pw32* | cegcc*)
47696aec45a7Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
47706aec45a7Smrg      # as there is no search path for DLLs.
47716aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
47726aec45a7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
47736aec45a7Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
47746aec45a7Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
47756aec45a7Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4776aa9e3350Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4777aa9e3350Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
47786aec45a7Smrg
47796aec45a7Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
47806aec45a7Smrg        _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'
47816aec45a7Smrg	# If the export-symbols file already is a .def file (1st line
47826aec45a7Smrg	# is EXPORTS), use it as is; otherwise, prepend...
47836aec45a7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
47846aec45a7Smrg	  cp $export_symbols $output_objdir/$soname.def;
47856aec45a7Smrg	else
47866aec45a7Smrg	  echo EXPORTS > $output_objdir/$soname.def;
47876aec45a7Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
47886aec45a7Smrg	fi~
47896aec45a7Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
47906aec45a7Smrg      else
47916aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
47926aec45a7Smrg      fi
47936aec45a7Smrg      ;;
4794ab47cfaaSmrg
47956aec45a7Smrg    haiku*)
47966aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
47976aec45a7Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
47986aec45a7Smrg      ;;
4799ab47cfaaSmrg
48006aec45a7Smrg    interix[[3-9]]*)
48016aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
48026aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
48036aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
48046aec45a7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
48056aec45a7Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
48066aec45a7Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
48076aec45a7Smrg      # default) and relocated if they conflict, which is a slow very memory
48086aec45a7Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
48096aec45a7Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
48106aec45a7Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
48116aec45a7Smrg      _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'
48126aec45a7Smrg      _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'
48136aec45a7Smrg      ;;
4814ab47cfaaSmrg
48156aec45a7Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
48166aec45a7Smrg      tmp_diet=no
48176aec45a7Smrg      if test "$host_os" = linux-dietlibc; then
48186aec45a7Smrg	case $cc_basename in
48196aec45a7Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
48206aec45a7Smrg	esac
48216aec45a7Smrg      fi
48226aec45a7Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
48236aec45a7Smrg	 && test "$tmp_diet" = no
48246aec45a7Smrg      then
4825aa9e3350Smrg	tmp_addflag=' $pic_flag'
48266aec45a7Smrg	tmp_sharedflag='-shared'
48276aec45a7Smrg	case $cc_basename,$host_cpu in
48286aec45a7Smrg        pgcc*)				# Portland Group C compiler
48296aec45a7Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
48306aec45a7Smrg	  tmp_addflag=' $pic_flag'
48316aec45a7Smrg	  ;;
48326aec45a7Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
48336aec45a7Smrg					# Portland Group f77 and f90 compilers
48346aec45a7Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
48356aec45a7Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
48366aec45a7Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
48376aec45a7Smrg	  tmp_addflag=' -i_dynamic' ;;
48386aec45a7Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
48396aec45a7Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
48406aec45a7Smrg	ifc* | ifort*)			# Intel Fortran compiler
48416aec45a7Smrg	  tmp_addflag=' -nofor_main' ;;
48426aec45a7Smrg	lf95*)				# Lahey Fortran 8.1
48436aec45a7Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
48446aec45a7Smrg	  tmp_sharedflag='--shared' ;;
48456aec45a7Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
48466aec45a7Smrg	  tmp_sharedflag='-qmkshrobj'
48476aec45a7Smrg	  tmp_addflag= ;;
48486aec45a7Smrg	nvcc*)	# Cuda Compiler Driver 2.2
48496aec45a7Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
48506aec45a7Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
48516aec45a7Smrg	  ;;
48526aec45a7Smrg	esac
48536aec45a7Smrg	case `$CC -V 2>&1 | sed 5q` in
48546aec45a7Smrg	*Sun\ C*)			# Sun C 5.9
48556aec45a7Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
48566aec45a7Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
48576aec45a7Smrg	  tmp_sharedflag='-G' ;;
48586aec45a7Smrg	*Sun\ F*)			# Sun Fortran 8.3
48596aec45a7Smrg	  tmp_sharedflag='-G' ;;
48606aec45a7Smrg	esac
48616aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4862ab47cfaaSmrg
48636aec45a7Smrg        if test "x$supports_anon_versioning" = xyes; then
48646aec45a7Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
48656aec45a7Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
48666aec45a7Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
48676aec45a7Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
48686aec45a7Smrg        fi
4869ab47cfaaSmrg
48706aec45a7Smrg	case $cc_basename in
48716aec45a7Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
48726aec45a7Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
48736aec45a7Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4874aa9e3350Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
48756aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
48766aec45a7Smrg	  if test "x$supports_anon_versioning" = xyes; then
48776aec45a7Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
48786aec45a7Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
48796aec45a7Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
48806aec45a7Smrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
48816aec45a7Smrg	  fi
48826aec45a7Smrg	  ;;
48836aec45a7Smrg	esac
48846aec45a7Smrg      else
48856aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
48866aec45a7Smrg      fi
48876aec45a7Smrg      ;;
4888ab47cfaaSmrg
488938770048Smrg    netbsd* | netbsdelf*-gnu)
48906aec45a7Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
48916aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
48926aec45a7Smrg	wlarc=
48936aec45a7Smrg      else
4894aa9e3350Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4895aa9e3350Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
48966aec45a7Smrg      fi
48976aec45a7Smrg      ;;
4898ab47cfaaSmrg
48996aec45a7Smrg    solaris*)
49006aec45a7Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
49016aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
49026aec45a7Smrg	cat <<_LT_EOF 1>&2
4903ab47cfaaSmrg
49046aec45a7Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
49056aec45a7Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
49066aec45a7Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
49076aec45a7Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
49086aec45a7Smrg*** your PATH or compiler configuration so that the native linker is
49096aec45a7Smrg*** used, and then restart.
4910ab47cfaaSmrg
49116aec45a7Smrg_LT_EOF
49126aec45a7Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4913aa9e3350Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4914aa9e3350Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
49156aec45a7Smrg      else
49166aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
49176aec45a7Smrg      fi
49186aec45a7Smrg      ;;
4919ab47cfaaSmrg
49206aec45a7Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
49216aec45a7Smrg      case `$LD -v 2>&1` in
49226aec45a7Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
49236aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
49246aec45a7Smrg	cat <<_LT_EOF 1>&2
4925ab47cfaaSmrg
49266aec45a7Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
49276aec45a7Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
49286aec45a7Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
49296aec45a7Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
49306aec45a7Smrg*** your PATH or compiler configuration so that the native linker is
49316aec45a7Smrg*** used, and then restart.
4932ab47cfaaSmrg
49336aec45a7Smrg_LT_EOF
49346aec45a7Smrg	;;
49356aec45a7Smrg	*)
49366aec45a7Smrg	  # For security reasons, it is highly recommended that you always
49376aec45a7Smrg	  # use absolute paths for naming shared libraries, and exclude the
49386aec45a7Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
49396aec45a7Smrg	  # requires that you compile everything twice, which is a pain.
49406aec45a7Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
49416aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
49426aec45a7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49436aec45a7Smrg	    _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'
49446aec45a7Smrg	  else
49456aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
49466aec45a7Smrg	  fi
49476aec45a7Smrg	;;
49486aec45a7Smrg      esac
49496aec45a7Smrg      ;;
4950ab47cfaaSmrg
49516aec45a7Smrg    sunos4*)
49526aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
49536aec45a7Smrg      wlarc=
49546aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
49556aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
49566aec45a7Smrg      ;;
4957ab47cfaaSmrg
49586aec45a7Smrg    *)
49596aec45a7Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4960aa9e3350Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4961aa9e3350Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
49626aec45a7Smrg      else
49636aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
49646aec45a7Smrg      fi
49656aec45a7Smrg      ;;
49666aec45a7Smrg    esac
4967ab47cfaaSmrg
49686aec45a7Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
49696aec45a7Smrg      runpath_var=
49706aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
49716aec45a7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
49726aec45a7Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
49736aec45a7Smrg    fi
49746aec45a7Smrg  else
49756aec45a7Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
49766aec45a7Smrg    case $host_os in
49776aec45a7Smrg    aix3*)
49786aec45a7Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
49796aec45a7Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
49806aec45a7Smrg      _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'
49816aec45a7Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
49826aec45a7Smrg      # are no directories specified by -L.
49836aec45a7Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
49846aec45a7Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
49856aec45a7Smrg	# Neither direct hardcoding nor static linking is supported with a
49866aec45a7Smrg	# broken collect2.
49876aec45a7Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
49886aec45a7Smrg      fi
49896aec45a7Smrg      ;;
4990ab47cfaaSmrg
49916aec45a7Smrg    aix[[4-9]]*)
49926aec45a7Smrg      if test "$host_cpu" = ia64; then
49936aec45a7Smrg	# On IA64, the linker does run time linking by default, so we don't
49946aec45a7Smrg	# have to do anything special.
49956aec45a7Smrg	aix_use_runtimelinking=no
49966aec45a7Smrg	exp_sym_flag='-Bexport'
49976aec45a7Smrg	no_entry_flag=""
49986aec45a7Smrg      else
49996aec45a7Smrg	# If we're using GNU nm, then we don't want the "-C" option.
50006aec45a7Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
50016aec45a7Smrg	# Also, AIX nm treats weak defined symbols like other global
50026aec45a7Smrg	# defined symbols, whereas GNU nm marks them as "W".
50036aec45a7Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
50046aec45a7Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
50056aec45a7Smrg	else
50066aec45a7Smrg	  _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'
50076aec45a7Smrg	fi
50086aec45a7Smrg	aix_use_runtimelinking=no
5009ab47cfaaSmrg
50106aec45a7Smrg	# Test if we are trying to use run time linking or normal
50116aec45a7Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
50126aec45a7Smrg	# need to do runtime linking.
50136aec45a7Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
50146aec45a7Smrg	  for ld_flag in $LDFLAGS; do
50156aec45a7Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
50166aec45a7Smrg	    aix_use_runtimelinking=yes
50176aec45a7Smrg	    break
50186aec45a7Smrg	  fi
50196aec45a7Smrg	  done
50206aec45a7Smrg	  ;;
50216aec45a7Smrg	esac
5022ab47cfaaSmrg
50236aec45a7Smrg	exp_sym_flag='-bexport'
50246aec45a7Smrg	no_entry_flag='-bnoentry'
50256aec45a7Smrg      fi
5026ab47cfaaSmrg
50276aec45a7Smrg      # When large executables or shared objects are built, AIX ld can
50286aec45a7Smrg      # have problems creating the table of contents.  If linking a library
50296aec45a7Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
50306aec45a7Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
50316aec45a7Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5032ab47cfaaSmrg
50336aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)=''
50346aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
50356aec45a7Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
50366aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
50376aec45a7Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
50386aec45a7Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5039ab47cfaaSmrg
50406aec45a7Smrg      if test "$GCC" = yes; then
50416aec45a7Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
50426aec45a7Smrg	# We only want to do this on AIX 4.2 and lower, the check
50436aec45a7Smrg	# below for broken collect2 doesn't work under 4.3+
50446aec45a7Smrg	  collect2name=`${CC} -print-prog-name=collect2`
50456aec45a7Smrg	  if test -f "$collect2name" &&
50466aec45a7Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
50476aec45a7Smrg	  then
50486aec45a7Smrg	  # We have reworked collect2
50496aec45a7Smrg	  :
50506aec45a7Smrg	  else
50516aec45a7Smrg	  # We have old collect2
50526aec45a7Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
50536aec45a7Smrg	  # It fails to find uninstalled libraries when the uninstalled
50546aec45a7Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
50556aec45a7Smrg	  # to unsupported forces relinking
50566aec45a7Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
50576aec45a7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
50586aec45a7Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
50596aec45a7Smrg	  fi
50606aec45a7Smrg	  ;;
50616aec45a7Smrg	esac
50626aec45a7Smrg	shared_flag='-shared'
50636aec45a7Smrg	if test "$aix_use_runtimelinking" = yes; then
50646aec45a7Smrg	  shared_flag="$shared_flag "'${wl}-G'
50656aec45a7Smrg	fi
506638770048Smrg	_LT_TAGVAR(link_all_deplibs, $1)=no
50676aec45a7Smrg      else
50686aec45a7Smrg	# not using gcc
50696aec45a7Smrg	if test "$host_cpu" = ia64; then
50706aec45a7Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
50716aec45a7Smrg	# chokes on -Wl,-G. The following line is correct:
50726aec45a7Smrg	  shared_flag='-G'
50736aec45a7Smrg	else
50746aec45a7Smrg	  if test "$aix_use_runtimelinking" = yes; then
50756aec45a7Smrg	    shared_flag='${wl}-G'
50766aec45a7Smrg	  else
50776aec45a7Smrg	    shared_flag='${wl}-bM:SRE'
50786aec45a7Smrg	  fi
50796aec45a7Smrg	fi
50806aec45a7Smrg      fi
5081ab47cfaaSmrg
50826aec45a7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
50836aec45a7Smrg      # It seems that -bexpall does not export symbols beginning with
50846aec45a7Smrg      # underscore (_), so it is better to generate a list of symbols to export.
50856aec45a7Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
50866aec45a7Smrg      if test "$aix_use_runtimelinking" = yes; then
50876aec45a7Smrg	# Warning - without using the other runtime loading flags (-brtl),
50886aec45a7Smrg	# -berok will link without error, but may produce a broken library.
50896aec45a7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
50906aec45a7Smrg        # Determine the default libpath from the value encoded in an
50916aec45a7Smrg        # empty executable.
5092aa9e3350Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
50936aec45a7Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
50946aec45a7Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
50956aec45a7Smrg      else
50966aec45a7Smrg	if test "$host_cpu" = ia64; then
50976aec45a7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
50986aec45a7Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
50996aec45a7Smrg	  _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"
51006aec45a7Smrg	else
51016aec45a7Smrg	 # Determine the default libpath from the value encoded in an
51026aec45a7Smrg	 # empty executable.
5103aa9e3350Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
51046aec45a7Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
51056aec45a7Smrg	  # Warning - without using the other run time loading flags,
51066aec45a7Smrg	  # -berok will link without error, but may produce a broken library.
51076aec45a7Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
51086aec45a7Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
51096aec45a7Smrg	  if test "$with_gnu_ld" = yes; then
51106aec45a7Smrg	    # We only use this code for GNU lds that support --whole-archive.
51116aec45a7Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
51126aec45a7Smrg	  else
51136aec45a7Smrg	    # Exported symbols can be pulled into shared objects from archives
51146aec45a7Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
51156aec45a7Smrg	  fi
51166aec45a7Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
51176aec45a7Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
51186aec45a7Smrg	  _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'
51196aec45a7Smrg	fi
51206aec45a7Smrg      fi
51216aec45a7Smrg      ;;
5122ab47cfaaSmrg
51236aec45a7Smrg    amigaos*)
51246aec45a7Smrg      case $host_cpu in
51256aec45a7Smrg      powerpc)
51266aec45a7Smrg            # see comment about AmigaOS4 .so support
51276aec45a7Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
51286aec45a7Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
51296aec45a7Smrg        ;;
51306aec45a7Smrg      m68k)
51316aec45a7Smrg            _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)'
51326aec45a7Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
51336aec45a7Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
51346aec45a7Smrg        ;;
51356aec45a7Smrg      esac
51366aec45a7Smrg      ;;
5137ab47cfaaSmrg
51386aec45a7Smrg    bsdi[[45]]*)
51396aec45a7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
51406aec45a7Smrg      ;;
5141ab47cfaaSmrg
51426aec45a7Smrg    cygwin* | mingw* | pw32* | cegcc*)
51436aec45a7Smrg      # When not using gcc, we currently assume that we are using
51446aec45a7Smrg      # Microsoft Visual C++.
51456aec45a7Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
51466aec45a7Smrg      # no search path for DLLs.
5147aa9e3350Smrg      case $cc_basename in
5148aa9e3350Smrg      cl*)
5149aa9e3350Smrg	# Native MSVC
5150aa9e3350Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5151aa9e3350Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5152aa9e3350Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
5153aa9e3350Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
5154aa9e3350Smrg	# Tell ltmain to make .lib files, not .a files.
5155aa9e3350Smrg	libext=lib
5156aa9e3350Smrg	# Tell ltmain to make .dll files, not .so files.
5157aa9e3350Smrg	shrext_cmds=".dll"
5158aa9e3350Smrg	# FIXME: Setting linknames here is a bad hack.
5159aa9e3350Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
5160aa9e3350Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5161aa9e3350Smrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
5162aa9e3350Smrg	  else
5163aa9e3350Smrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
5164aa9e3350Smrg	  fi~
5165aa9e3350Smrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5166aa9e3350Smrg	  linknames='
5167aa9e3350Smrg	# The linker will not automatically build a static lib if we build a DLL.
5168aa9e3350Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5169aa9e3350Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5170aa9e3350Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5171aa9e3350Smrg	_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'
5172aa9e3350Smrg	# Don't use ranlib
5173aa9e3350Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5174aa9e3350Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5175aa9e3350Smrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
5176aa9e3350Smrg	  case $lt_outputfile in
5177aa9e3350Smrg	    *.exe|*.EXE) ;;
5178aa9e3350Smrg	    *)
5179aa9e3350Smrg	      lt_outputfile="$lt_outputfile.exe"
5180aa9e3350Smrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
5181aa9e3350Smrg	      ;;
5182aa9e3350Smrg	  esac~
5183aa9e3350Smrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
5184aa9e3350Smrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5185aa9e3350Smrg	    $RM "$lt_outputfile.manifest";
5186aa9e3350Smrg	  fi'
5187aa9e3350Smrg	;;
5188aa9e3350Smrg      *)
5189aa9e3350Smrg	# Assume MSVC wrapper
5190aa9e3350Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5191aa9e3350Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5192aa9e3350Smrg	# Tell ltmain to make .lib files, not .a files.
5193aa9e3350Smrg	libext=lib
5194aa9e3350Smrg	# Tell ltmain to make .dll files, not .so files.
5195aa9e3350Smrg	shrext_cmds=".dll"
5196aa9e3350Smrg	# FIXME: Setting linknames here is a bad hack.
5197aa9e3350Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5198aa9e3350Smrg	# The linker will automatically build a .lib file if we build a DLL.
5199aa9e3350Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5200aa9e3350Smrg	# FIXME: Should let the user specify the lib program.
5201aa9e3350Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5202aa9e3350Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5203aa9e3350Smrg	;;
5204aa9e3350Smrg      esac
52056aec45a7Smrg      ;;
5206ab47cfaaSmrg
52076aec45a7Smrg    darwin* | rhapsody*)
52086aec45a7Smrg      _LT_DARWIN_LINKER_FEATURES($1)
52096aec45a7Smrg      ;;
5210ab47cfaaSmrg
52116aec45a7Smrg    dgux*)
52126aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
52136aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
52146aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52156aec45a7Smrg      ;;
5216ab47cfaaSmrg
52176aec45a7Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
52186aec45a7Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
52196aec45a7Smrg    # does not break anything, and helps significantly (at the cost of a little
52206aec45a7Smrg    # extra space).
52216aec45a7Smrg    freebsd2.2*)
52226aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
52236aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
52246aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52256aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52261473d951Smrg      ;;
52276aec45a7Smrg
52286aec45a7Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5229aa9e3350Smrg    freebsd2.*)
52306aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
52316aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52326aec45a7Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
52336aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5234ab47cfaaSmrg      ;;
52351473d951Smrg
52366aec45a7Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
52376aec45a7Smrg    freebsd* | dragonfly*)
5238aa9e3350Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
52396aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
52406aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52416aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52426aec45a7Smrg      ;;
5243ab47cfaaSmrg
52446aec45a7Smrg    hpux9*)
52456aec45a7Smrg      if test "$GCC" = yes; then
5246aa9e3350Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
52476aec45a7Smrg      else
52486aec45a7Smrg	_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'
52496aec45a7Smrg      fi
52506aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
52516aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
52526aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5253ab47cfaaSmrg
52546aec45a7Smrg      # hardcode_minus_L: Not really in the search PATH,
52556aec45a7Smrg      # but as the default location of the library.
52566aec45a7Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
52576aec45a7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
52586aec45a7Smrg      ;;
5259ab47cfaaSmrg
52606aec45a7Smrg    hpux10*)
52616aec45a7Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5262aa9e3350Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
52636aec45a7Smrg      else
52646aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
52656aec45a7Smrg      fi
52666aec45a7Smrg      if test "$with_gnu_ld" = no; then
52676aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
52686aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
52696aec45a7Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
52706aec45a7Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
52716aec45a7Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
52726aec45a7Smrg	# hardcode_minus_L: Not really in the search PATH,
52736aec45a7Smrg	# but as the default location of the library.
52746aec45a7Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
52756aec45a7Smrg      fi
52766aec45a7Smrg      ;;
5277ab47cfaaSmrg
52786aec45a7Smrg    hpux11*)
52796aec45a7Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
52806aec45a7Smrg	case $host_cpu in
52816aec45a7Smrg	hppa*64*)
52826aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
52836aec45a7Smrg	  ;;
52846aec45a7Smrg	ia64*)
5285aa9e3350Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
52866aec45a7Smrg	  ;;
52876aec45a7Smrg	*)
5288aa9e3350Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
52896aec45a7Smrg	  ;;
52906aec45a7Smrg	esac
52916aec45a7Smrg      else
52926aec45a7Smrg	case $host_cpu in
52936aec45a7Smrg	hppa*64*)
52946aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
52956aec45a7Smrg	  ;;
52966aec45a7Smrg	ia64*)
52976aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
52986aec45a7Smrg	  ;;
52996aec45a7Smrg	*)
53006aec45a7Smrg	m4_if($1, [], [
53016aec45a7Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
53026aec45a7Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
53036aec45a7Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
53046aec45a7Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
53056aec45a7Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
53066aec45a7Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
53076aec45a7Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
53086aec45a7Smrg	  ;;
53096aec45a7Smrg	esac
53106aec45a7Smrg      fi
53116aec45a7Smrg      if test "$with_gnu_ld" = no; then
53126aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
53136aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5314ab47cfaaSmrg
53156aec45a7Smrg	case $host_cpu in
53166aec45a7Smrg	hppa*64*|ia64*)
53176aec45a7Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
53186aec45a7Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53196aec45a7Smrg	  ;;
53206aec45a7Smrg	*)
53216aec45a7Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
53226aec45a7Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
53236aec45a7Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5324ab47cfaaSmrg
53256aec45a7Smrg	  # hardcode_minus_L: Not really in the search PATH,
53266aec45a7Smrg	  # but as the default location of the library.
53276aec45a7Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
53286aec45a7Smrg	  ;;
53296aec45a7Smrg	esac
53306aec45a7Smrg      fi
53316aec45a7Smrg      ;;
5332ab47cfaaSmrg
53336aec45a7Smrg    irix5* | irix6* | nonstopux*)
53346aec45a7Smrg      if test "$GCC" = yes; then
5335aa9e3350Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
53366aec45a7Smrg	# Try to use the -exported_symbol ld option, if it does not
53376aec45a7Smrg	# work, assume that -exports_file does not work either and
53386aec45a7Smrg	# implicitly export all symbols.
5339aa9e3350Smrg	# This should be the same for all languages, so no per-tag cache variable.
5340aa9e3350Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5341aa9e3350Smrg	  [lt_cv_irix_exported_symbol],
5342aa9e3350Smrg	  [save_LDFLAGS="$LDFLAGS"
5343aa9e3350Smrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
5344aa9e3350Smrg	   AC_LINK_IFELSE(
5345aa9e3350Smrg	     [AC_LANG_SOURCE(
5346aa9e3350Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5347aa9e3350Smrg			      [C++], [[int foo (void) { return 0; }]],
5348aa9e3350Smrg			      [Fortran 77], [[
5349aa9e3350Smrg      subroutine foo
5350aa9e3350Smrg      end]],
5351aa9e3350Smrg			      [Fortran], [[
5352aa9e3350Smrg      subroutine foo
5353aa9e3350Smrg      end]])])],
5354aa9e3350Smrg	      [lt_cv_irix_exported_symbol=yes],
5355aa9e3350Smrg	      [lt_cv_irix_exported_symbol=no])
5356aa9e3350Smrg           LDFLAGS="$save_LDFLAGS"])
5357aa9e3350Smrg	if test "$lt_cv_irix_exported_symbol" = yes; then
5358aa9e3350Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
5359aa9e3350Smrg	fi
53606aec45a7Smrg      else
53616aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
53626aec45a7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
53636aec45a7Smrg      fi
53646aec45a7Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
53656aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
53666aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
53676aec45a7Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
53686aec45a7Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
53696aec45a7Smrg      ;;
5370ab47cfaaSmrg
537138770048Smrg    netbsd* | netbsdelf*-gnu)
53726aec45a7Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
53736aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
53746aec45a7Smrg      else
53756aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
53766aec45a7Smrg      fi
53776aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
53786aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
53796aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53806aec45a7Smrg      ;;
5381ab47cfaaSmrg
53826aec45a7Smrg    newsos6)
53836aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
53846aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
53856aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
53866aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
53876aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53886aec45a7Smrg      ;;
5389ab47cfaaSmrg
53906aec45a7Smrg    *nto* | *qnx*)
53916aec45a7Smrg      ;;
5392ab47cfaaSmrg
53936aec45a7Smrg    openbsd*)
53946aec45a7Smrg      if test -f /usr/libexec/ld.so; then
53956aec45a7Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
53966aec45a7Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53976aec45a7Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
53986aec45a7Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
53996aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
54006aec45a7Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
54016aec45a7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
54026aec45a7Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
54036aec45a7Smrg	else
54046aec45a7Smrg	  case $host_os in
54056aec45a7Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
54066aec45a7Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
54076aec45a7Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
54086aec45a7Smrg	     ;;
54096aec45a7Smrg	   *)
54106aec45a7Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
54116aec45a7Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
54126aec45a7Smrg	     ;;
54136aec45a7Smrg	  esac
54146aec45a7Smrg	fi
54156aec45a7Smrg      else
54166aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
54176aec45a7Smrg      fi
54186aec45a7Smrg      ;;
5419ab47cfaaSmrg
54206aec45a7Smrg    os2*)
54216aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
54226aec45a7Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
54236aec45a7Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
54246aec45a7Smrg      _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'
54256aec45a7Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
54266aec45a7Smrg      ;;
5427ab47cfaaSmrg
54286aec45a7Smrg    osf3*)
54296aec45a7Smrg      if test "$GCC" = yes; then
54306aec45a7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
54316aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
54326aec45a7Smrg      else
54336aec45a7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
54346aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
54356aec45a7Smrg      fi
54366aec45a7Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
54376aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
54386aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
54396aec45a7Smrg      ;;
5440ab47cfaaSmrg
54416aec45a7Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
54426aec45a7Smrg      if test "$GCC" = yes; then
54436aec45a7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5444aa9e3350Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
54456aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
54466aec45a7Smrg      else
54476aec45a7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
54486aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
54496aec45a7Smrg	_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~
54506aec45a7Smrg	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
5451ab47cfaaSmrg
54526aec45a7Smrg	# Both c and cxx compiler support -rpath directly
54536aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
54546aec45a7Smrg      fi
54556aec45a7Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
54566aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
54576aec45a7Smrg      ;;
5458ab47cfaaSmrg
54596aec45a7Smrg    solaris*)
54606aec45a7Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
54616aec45a7Smrg      if test "$GCC" = yes; then
54626aec45a7Smrg	wlarc='${wl}'
5463aa9e3350Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
54646aec45a7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5465aa9e3350Smrg	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
54666aec45a7Smrg      else
54676aec45a7Smrg	case `$CC -V 2>&1` in
54686aec45a7Smrg	*"Compilers 5.0"*)
54696aec45a7Smrg	  wlarc=''
54706aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
54716aec45a7Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
54726aec45a7Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
54736aec45a7Smrg	  ;;
54746aec45a7Smrg	*)
54756aec45a7Smrg	  wlarc='${wl}'
54766aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
54776aec45a7Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
54786aec45a7Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
54796aec45a7Smrg	  ;;
54806aec45a7Smrg	esac
54816aec45a7Smrg      fi
54826aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
54836aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
54846aec45a7Smrg      case $host_os in
54856aec45a7Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
54866aec45a7Smrg      *)
54876aec45a7Smrg	# The compiler driver will combine and reorder linker options,
54886aec45a7Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
54896aec45a7Smrg	# but is careful enough not to reorder.
54906aec45a7Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
54916aec45a7Smrg	if test "$GCC" = yes; then
54926aec45a7Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
54936aec45a7Smrg	else
54946aec45a7Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
54956aec45a7Smrg	fi
54966aec45a7Smrg	;;
54976aec45a7Smrg      esac
54986aec45a7Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
54996aec45a7Smrg      ;;
5500ab47cfaaSmrg
55016aec45a7Smrg    sunos4*)
55026aec45a7Smrg      if test "x$host_vendor" = xsequent; then
55036aec45a7Smrg	# Use $CC to link under sequent, because it throws in some extra .o
55046aec45a7Smrg	# files that make .init and .fini sections work.
55056aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
55066aec45a7Smrg      else
55076aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
55086aec45a7Smrg      fi
55096aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
55106aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
55116aec45a7Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
55126aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55136aec45a7Smrg      ;;
5514ab47cfaaSmrg
55156aec45a7Smrg    sysv4)
55166aec45a7Smrg      case $host_vendor in
55176aec45a7Smrg	sni)
55186aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55196aec45a7Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
55206aec45a7Smrg	;;
55216aec45a7Smrg	siemens)
55226aec45a7Smrg	  ## LD is ld it makes a PLAMLIB
55236aec45a7Smrg	  ## CC just makes a GrossModule.
55246aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
55256aec45a7Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
55266aec45a7Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
55276aec45a7Smrg        ;;
55286aec45a7Smrg	motorola)
55296aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55306aec45a7Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
55316aec45a7Smrg	;;
55326aec45a7Smrg      esac
55336aec45a7Smrg      runpath_var='LD_RUN_PATH'
55346aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55356aec45a7Smrg      ;;
5536ab47cfaaSmrg
55376aec45a7Smrg    sysv4.3*)
55386aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55396aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55406aec45a7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
55416aec45a7Smrg      ;;
5542ab47cfaaSmrg
55436aec45a7Smrg    sysv4*MP*)
55446aec45a7Smrg      if test -d /usr/nec; then
55456aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55466aec45a7Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55476aec45a7Smrg	runpath_var=LD_RUN_PATH
55486aec45a7Smrg	hardcode_runpath_var=yes
55496aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
55506aec45a7Smrg      fi
55516aec45a7Smrg      ;;
5552ab47cfaaSmrg
55536aec45a7Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
55546aec45a7Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
55556aec45a7Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
55566aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55576aec45a7Smrg      runpath_var='LD_RUN_PATH'
5558ab47cfaaSmrg
55596aec45a7Smrg      if test "$GCC" = yes; then
55606aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55616aec45a7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55626aec45a7Smrg      else
55636aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55646aec45a7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55656aec45a7Smrg      fi
55666aec45a7Smrg      ;;
5567ab47cfaaSmrg
55686aec45a7Smrg    sysv5* | sco3.2v5* | sco5v6*)
55696aec45a7Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
55706aec45a7Smrg      # link with -lc, and that would cause any symbols used from libc to
55716aec45a7Smrg      # always be unresolved, which means just about no library would
55726aec45a7Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
55736aec45a7Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
55746aec45a7Smrg      # as -z defs.
55756aec45a7Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
55766aec45a7Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
55776aec45a7Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
55786aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55796aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
55806aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
55816aec45a7Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
55826aec45a7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
55836aec45a7Smrg      runpath_var='LD_RUN_PATH'
5584ab47cfaaSmrg
55856aec45a7Smrg      if test "$GCC" = yes; then
55866aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55876aec45a7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55886aec45a7Smrg      else
55896aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55906aec45a7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55916aec45a7Smrg      fi
55926aec45a7Smrg      ;;
5593ab47cfaaSmrg
55946aec45a7Smrg    uts4*)
55956aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55966aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
55976aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55986aec45a7Smrg      ;;
5599ab47cfaaSmrg
56006aec45a7Smrg    *)
56016aec45a7Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
56026aec45a7Smrg      ;;
56036aec45a7Smrg    esac
5604ab47cfaaSmrg
56056aec45a7Smrg    if test x$host_vendor = xsni; then
56066aec45a7Smrg      case $host in
56076aec45a7Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
56086aec45a7Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
56096aec45a7Smrg	;;
56106aec45a7Smrg      esac
56116aec45a7Smrg    fi
56126aec45a7Smrg  fi
56136aec45a7Smrg])
56146aec45a7SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
56156aec45a7Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5616ab47cfaaSmrg
56176aec45a7Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5618ab47cfaaSmrg
56196aec45a7Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
56206aec45a7Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
56216aec45a7Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
56226aec45a7Smrg    [The commands to extract the exported symbol list from a shared archive])
5623ab47cfaaSmrg
56246aec45a7Smrg#
56256aec45a7Smrg# Do we need to explicitly link libc?
56266aec45a7Smrg#
56276aec45a7Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
56286aec45a7Smrgx|xyes)
56296aec45a7Smrg  # Assume -lc should be added
56306aec45a7Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5631ab47cfaaSmrg
56326aec45a7Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
56336aec45a7Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
56346aec45a7Smrg    *'~'*)
56356aec45a7Smrg      # FIXME: we may have to deal with multi-command sequences.
56366aec45a7Smrg      ;;
56376aec45a7Smrg    '$CC '*)
56386aec45a7Smrg      # Test whether the compiler implicitly links with -lc since on some
56396aec45a7Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
56406aec45a7Smrg      # to ld, don't add -lc before -lgcc.
56416aec45a7Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
56426aec45a7Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
56436aec45a7Smrg	[$RM conftest*
56446aec45a7Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
56456aec45a7Smrg
56466aec45a7Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
56476aec45a7Smrg	  soname=conftest
56486aec45a7Smrg	  lib=conftest
56496aec45a7Smrg	  libobjs=conftest.$ac_objext
56506aec45a7Smrg	  deplibs=
56516aec45a7Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
56526aec45a7Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
56536aec45a7Smrg	  compiler_flags=-v
56546aec45a7Smrg	  linker_flags=-v
56556aec45a7Smrg	  verstring=
56566aec45a7Smrg	  output_objdir=.
56576aec45a7Smrg	  libname=conftest
56586aec45a7Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
56596aec45a7Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
56606aec45a7Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
56616aec45a7Smrg	  then
56626aec45a7Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
56636aec45a7Smrg	  else
56646aec45a7Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
56656aec45a7Smrg	  fi
56666aec45a7Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
56676aec45a7Smrg	else
56686aec45a7Smrg	  cat conftest.err 1>&5
56696aec45a7Smrg	fi
56706aec45a7Smrg	$RM conftest*
56716aec45a7Smrg	])
56726aec45a7Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
56736aec45a7Smrg      ;;
56746aec45a7Smrg    esac
56756aec45a7Smrg  fi
56766aec45a7Smrg  ;;
56776aec45a7Smrgesac
5678ab47cfaaSmrg
56796aec45a7Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
56806aec45a7Smrg    [Whether or not to add -lc for building shared libraries])
56816aec45a7Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
56826aec45a7Smrg    [enable_shared_with_static_runtimes], [0],
56836aec45a7Smrg    [Whether or not to disallow shared libs when runtime libs are static])
56846aec45a7Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
56856aec45a7Smrg    [Compiler flag to allow reflexive dlopens])
56866aec45a7Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
56876aec45a7Smrg    [Compiler flag to generate shared objects directly from archives])
56886aec45a7Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
56896aec45a7Smrg    [Whether the compiler copes with passing no objects directly])
56906aec45a7Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
56916aec45a7Smrg    [Create an old-style archive from a shared archive])
56926aec45a7Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
56936aec45a7Smrg    [Create a temporary old-style archive to link instead of a shared archive])
56946aec45a7Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
56956aec45a7Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
56966aec45a7Smrg_LT_TAGDECL([], [module_cmds], [2],
56976aec45a7Smrg    [Commands used to build a loadable module if different from building
56986aec45a7Smrg    a shared archive.])
56996aec45a7Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
57006aec45a7Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
57016aec45a7Smrg    [Whether we are building with GNU ld or not])
57026aec45a7Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
57036aec45a7Smrg    [Flag that allows shared libraries with undefined symbols to be built])
57046aec45a7Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
57056aec45a7Smrg    [Flag that enforces no undefined symbols])
57066aec45a7Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
57076aec45a7Smrg    [Flag to hardcode $libdir into a binary during linking.
57086aec45a7Smrg    This must work even if $libdir does not exist])
57096aec45a7Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
57106aec45a7Smrg    [Whether we need a single "-rpath" flag with a separated argument])
57116aec45a7Smrg_LT_TAGDECL([], [hardcode_direct], [0],
57126aec45a7Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
57136aec45a7Smrg    DIR into the resulting binary])
57146aec45a7Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
57156aec45a7Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
57166aec45a7Smrg    DIR into the resulting binary and the resulting library dependency is
57176aec45a7Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
57186aec45a7Smrg    library is relocated])
57196aec45a7Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
57206aec45a7Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
57216aec45a7Smrg    into the resulting binary])
57226aec45a7Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
57236aec45a7Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
57246aec45a7Smrg    into the resulting binary])
57256aec45a7Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
57266aec45a7Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
57276aec45a7Smrg    into the library and all subsequent libraries and executables linked
57286aec45a7Smrg    against it])
57296aec45a7Smrg_LT_TAGDECL([], [inherit_rpath], [0],
57306aec45a7Smrg    [Set to yes if linker adds runtime paths of dependent libraries
57316aec45a7Smrg    to runtime path list])
57326aec45a7Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
57336aec45a7Smrg    [Whether libtool must link a program against all its dependency libraries])
57346aec45a7Smrg_LT_TAGDECL([], [always_export_symbols], [0],
57356aec45a7Smrg    [Set to "yes" if exported symbols are required])
57366aec45a7Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
57376aec45a7Smrg    [The commands to list exported symbols])
57386aec45a7Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
57396aec45a7Smrg    [Symbols that should not be listed in the preloaded symbols])
57406aec45a7Smrg_LT_TAGDECL([], [include_expsyms], [1],
57416aec45a7Smrg    [Symbols that must always be exported])
57426aec45a7Smrg_LT_TAGDECL([], [prelink_cmds], [2],
57436aec45a7Smrg    [Commands necessary for linking programs (against libraries) with templates])
5744aa9e3350Smrg_LT_TAGDECL([], [postlink_cmds], [2],
5745aa9e3350Smrg    [Commands necessary for finishing linking programs])
57466aec45a7Smrg_LT_TAGDECL([], [file_list_spec], [1],
57476aec45a7Smrg    [Specify filename containing input files])
57486aec45a7Smrgdnl FIXME: Not yet implemented
57496aec45a7Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
57506aec45a7Smrgdnl    [Compiler flag to generate thread safe objects])
57516aec45a7Smrg])# _LT_LINKER_SHLIBS
57526aec45a7Smrg
57536aec45a7Smrg
57546aec45a7Smrg# _LT_LANG_C_CONFIG([TAG])
57556aec45a7Smrg# ------------------------
57566aec45a7Smrg# Ensure that the configuration variables for a C compiler are suitably
57576aec45a7Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
57586aec45a7Smrg# the compiler configuration to `libtool'.
57596aec45a7Smrgm4_defun([_LT_LANG_C_CONFIG],
57606aec45a7Smrg[m4_require([_LT_DECL_EGREP])dnl
57616aec45a7Smrglt_save_CC="$CC"
57626aec45a7SmrgAC_LANG_PUSH(C)
5763ab47cfaaSmrg
57646aec45a7Smrg# Source file extension for C test sources.
57656aec45a7Smrgac_ext=c
5766ab47cfaaSmrg
57676aec45a7Smrg# Object file extension for compiled C test sources.
57686aec45a7Smrgobjext=o
57696aec45a7Smrg_LT_TAGVAR(objext, $1)=$objext
5770ab47cfaaSmrg
57716aec45a7Smrg# Code to be used in simple compile tests
57726aec45a7Smrglt_simple_compile_test_code="int some_variable = 0;"
5773ab47cfaaSmrg
57746aec45a7Smrg# Code to be used in simple link tests
57756aec45a7Smrglt_simple_link_test_code='int main(){return(0);}'
5776ab47cfaaSmrg
57776aec45a7Smrg_LT_TAG_COMPILER
57786aec45a7Smrg# Save the default compiler, since it gets overwritten when the other
57796aec45a7Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
57806aec45a7Smrgcompiler_DEFAULT=$CC
5781ab47cfaaSmrg
57826aec45a7Smrg# save warnings/boilerplate of simple test code
57836aec45a7Smrg_LT_COMPILER_BOILERPLATE
57846aec45a7Smrg_LT_LINKER_BOILERPLATE
5785ab47cfaaSmrg
57866aec45a7Smrgif test -n "$compiler"; then
57876aec45a7Smrg  _LT_COMPILER_NO_RTTI($1)
57886aec45a7Smrg  _LT_COMPILER_PIC($1)
57896aec45a7Smrg  _LT_COMPILER_C_O($1)
57906aec45a7Smrg  _LT_COMPILER_FILE_LOCKS($1)
57916aec45a7Smrg  _LT_LINKER_SHLIBS($1)
57926aec45a7Smrg  _LT_SYS_DYNAMIC_LINKER($1)
57936aec45a7Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
57946aec45a7Smrg  LT_SYS_DLOPEN_SELF
57956aec45a7Smrg  _LT_CMD_STRIPLIB
57966aec45a7Smrg
57976aec45a7Smrg  # Report which library types will actually be built
57986aec45a7Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
57996aec45a7Smrg  AC_MSG_RESULT([$can_build_shared])
58006aec45a7Smrg
58016aec45a7Smrg  AC_MSG_CHECKING([whether to build shared libraries])
58026aec45a7Smrg  test "$can_build_shared" = "no" && enable_shared=no
58036aec45a7Smrg
58046aec45a7Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
58056aec45a7Smrg  # are all built from PIC.
58066aec45a7Smrg  case $host_os in
58076aec45a7Smrg  aix3*)
58086aec45a7Smrg    test "$enable_shared" = yes && enable_static=no
58096aec45a7Smrg    if test -n "$RANLIB"; then
58106aec45a7Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
58116aec45a7Smrg      postinstall_cmds='$RANLIB $lib'
58126aec45a7Smrg    fi
58136aec45a7Smrg    ;;
5814ab47cfaaSmrg
58156aec45a7Smrg  aix[[4-9]]*)
58166aec45a7Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
58176aec45a7Smrg      test "$enable_shared" = yes && enable_static=no
58186aec45a7Smrg    fi
58196aec45a7Smrg    ;;
58206aec45a7Smrg  esac
58216aec45a7Smrg  AC_MSG_RESULT([$enable_shared])
5822ab47cfaaSmrg
58236aec45a7Smrg  AC_MSG_CHECKING([whether to build static libraries])
58246aec45a7Smrg  # Make sure either enable_shared or enable_static is yes.
58256aec45a7Smrg  test "$enable_shared" = yes || enable_static=yes
58266aec45a7Smrg  AC_MSG_RESULT([$enable_static])
5827ab47cfaaSmrg
58286aec45a7Smrg  _LT_CONFIG($1)
58296aec45a7Smrgfi
58306aec45a7SmrgAC_LANG_POP
58316aec45a7SmrgCC="$lt_save_CC"
58326aec45a7Smrg])# _LT_LANG_C_CONFIG
5833ab47cfaaSmrg
5834ab47cfaaSmrg
58356aec45a7Smrg# _LT_LANG_CXX_CONFIG([TAG])
58366aec45a7Smrg# --------------------------
58376aec45a7Smrg# Ensure that the configuration variables for a C++ compiler are suitably
58386aec45a7Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
58396aec45a7Smrg# the compiler configuration to `libtool'.
58406aec45a7Smrgm4_defun([_LT_LANG_CXX_CONFIG],
58416aec45a7Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
58426aec45a7Smrgm4_require([_LT_DECL_EGREP])dnl
5843aa9e3350Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
58446aec45a7Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
58456aec45a7Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
58466aec45a7Smrg    (test "X$CXX" != "Xg++"))) ; then
58476aec45a7Smrg  AC_PROG_CXXCPP
58486aec45a7Smrgelse
58496aec45a7Smrg  _lt_caught_CXX_error=yes
58506aec45a7Smrgfi
5851ab47cfaaSmrg
58526aec45a7SmrgAC_LANG_PUSH(C++)
58536aec45a7Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
58546aec45a7Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
58556aec45a7Smrg_LT_TAGVAR(always_export_symbols, $1)=no
58566aec45a7Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
58576aec45a7Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
58586aec45a7Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
58596aec45a7Smrg_LT_TAGVAR(hardcode_direct, $1)=no
58606aec45a7Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
58616aec45a7Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
58626aec45a7Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
58636aec45a7Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
58646aec45a7Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
58656aec45a7Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
58666aec45a7Smrg_LT_TAGVAR(inherit_rpath, $1)=no
58676aec45a7Smrg_LT_TAGVAR(module_cmds, $1)=
58686aec45a7Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
58696aec45a7Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
58706aec45a7Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
58716aec45a7Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
58726aec45a7Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
58736aec45a7Smrg_LT_TAGVAR(no_undefined_flag, $1)=
58746aec45a7Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
58756aec45a7Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5876ab47cfaaSmrg
58776aec45a7Smrg# Source file extension for C++ test sources.
58786aec45a7Smrgac_ext=cpp
5879ab47cfaaSmrg
58806aec45a7Smrg# Object file extension for compiled C++ test sources.
58816aec45a7Smrgobjext=o
58826aec45a7Smrg_LT_TAGVAR(objext, $1)=$objext
58836aec45a7Smrg
58846aec45a7Smrg# No sense in running all these tests if we already determined that
58856aec45a7Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
58866aec45a7Smrg# are currently assumed to apply to all compilers on this platform,
58876aec45a7Smrg# and will be corrupted by setting them based on a non-working compiler.
58886aec45a7Smrgif test "$_lt_caught_CXX_error" != yes; then
58896aec45a7Smrg  # Code to be used in simple compile tests
58906aec45a7Smrg  lt_simple_compile_test_code="int some_variable = 0;"
58916aec45a7Smrg
58926aec45a7Smrg  # Code to be used in simple link tests
58936aec45a7Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
58946aec45a7Smrg
58956aec45a7Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
58966aec45a7Smrg  _LT_TAG_COMPILER
58976aec45a7Smrg
58986aec45a7Smrg  # save warnings/boilerplate of simple test code
58996aec45a7Smrg  _LT_COMPILER_BOILERPLATE
59006aec45a7Smrg  _LT_LINKER_BOILERPLATE
59016aec45a7Smrg
59026aec45a7Smrg  # Allow CC to be a program name with arguments.
59036aec45a7Smrg  lt_save_CC=$CC
5904aa9e3350Smrg  lt_save_CFLAGS=$CFLAGS
59056aec45a7Smrg  lt_save_LD=$LD
59066aec45a7Smrg  lt_save_GCC=$GCC
59076aec45a7Smrg  GCC=$GXX
59086aec45a7Smrg  lt_save_with_gnu_ld=$with_gnu_ld
59096aec45a7Smrg  lt_save_path_LD=$lt_cv_path_LD
59106aec45a7Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
59116aec45a7Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
59126aec45a7Smrg  else
59136aec45a7Smrg    $as_unset lt_cv_prog_gnu_ld
59146aec45a7Smrg  fi
59156aec45a7Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
59166aec45a7Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
59176aec45a7Smrg  else
59186aec45a7Smrg    $as_unset lt_cv_path_LD
59196aec45a7Smrg  fi
59206aec45a7Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
59216aec45a7Smrg  CC=${CXX-"c++"}
5922aa9e3350Smrg  CFLAGS=$CXXFLAGS
59236aec45a7Smrg  compiler=$CC
59246aec45a7Smrg  _LT_TAGVAR(compiler, $1)=$CC
59256aec45a7Smrg  _LT_CC_BASENAME([$compiler])
5926ab47cfaaSmrg
59276aec45a7Smrg  if test -n "$compiler"; then
59286aec45a7Smrg    # We don't want -fno-exception when compiling C++ code, so set the
59296aec45a7Smrg    # no_builtin_flag separately
59306aec45a7Smrg    if test "$GXX" = yes; then
59316aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
59326aec45a7Smrg    else
59336aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
59346aec45a7Smrg    fi
5935ab47cfaaSmrg
59366aec45a7Smrg    if test "$GXX" = yes; then
59376aec45a7Smrg      # Set up default GNU C++ configuration
5938ab47cfaaSmrg
59396aec45a7Smrg      LT_PATH_LD
5940ab47cfaaSmrg
59416aec45a7Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
59426aec45a7Smrg      # archiving commands below assume that GNU ld is being used.
59436aec45a7Smrg      if test "$with_gnu_ld" = yes; then
5944aa9e3350Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5945aa9e3350Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5946ab47cfaaSmrg
59476aec45a7Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
59486aec45a7Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5949ab47cfaaSmrg
59506aec45a7Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
59516aec45a7Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
59526aec45a7Smrg        #     investigate it a little bit more. (MM)
59536aec45a7Smrg        wlarc='${wl}'
5954ab47cfaaSmrg
59556aec45a7Smrg        # ancient GNU ld didn't support --whole-archive et. al.
59566aec45a7Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
59576aec45a7Smrg	  $GREP 'no-whole-archive' > /dev/null; then
59586aec45a7Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
59596aec45a7Smrg        else
59606aec45a7Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
59616aec45a7Smrg        fi
59626aec45a7Smrg      else
59636aec45a7Smrg        with_gnu_ld=no
59646aec45a7Smrg        wlarc=
59656aec45a7Smrg
59666aec45a7Smrg        # A generic and very simple default shared library creation
59676aec45a7Smrg        # command for GNU C++ for the case where it uses the native
59686aec45a7Smrg        # linker, instead of GNU ld.  If possible, this setting should
59696aec45a7Smrg        # overridden to take advantage of the native linker features on
59706aec45a7Smrg        # the platform it is being used on.
59716aec45a7Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
59726aec45a7Smrg      fi
5973ab47cfaaSmrg
59746aec45a7Smrg      # Commands to make compiler produce verbose output that lists
59756aec45a7Smrg      # what "hidden" libraries, object files and flags are used when
59766aec45a7Smrg      # linking a shared library.
59776aec45a7Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
5978ab47cfaaSmrg
59796aec45a7Smrg    else
59806aec45a7Smrg      GXX=no
59816aec45a7Smrg      with_gnu_ld=no
59826aec45a7Smrg      wlarc=
59836aec45a7Smrg    fi
5984ab47cfaaSmrg
59856aec45a7Smrg    # PORTME: fill in a description of your system's C++ link characteristics
59866aec45a7Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
59876aec45a7Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
59886aec45a7Smrg    case $host_os in
59896aec45a7Smrg      aix3*)
59906aec45a7Smrg        # FIXME: insert proper C++ library support
59916aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
59926aec45a7Smrg        ;;
59936aec45a7Smrg      aix[[4-9]]*)
59946aec45a7Smrg        if test "$host_cpu" = ia64; then
59956aec45a7Smrg          # On IA64, the linker does run time linking by default, so we don't
59966aec45a7Smrg          # have to do anything special.
59976aec45a7Smrg          aix_use_runtimelinking=no
59986aec45a7Smrg          exp_sym_flag='-Bexport'
59996aec45a7Smrg          no_entry_flag=""
60006aec45a7Smrg        else
60016aec45a7Smrg          aix_use_runtimelinking=no
60026aec45a7Smrg
60036aec45a7Smrg          # Test if we are trying to use run time linking or normal
60046aec45a7Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
60056aec45a7Smrg          # need to do runtime linking.
60066aec45a7Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
60076aec45a7Smrg	    for ld_flag in $LDFLAGS; do
60086aec45a7Smrg	      case $ld_flag in
60096aec45a7Smrg	      *-brtl*)
60106aec45a7Smrg	        aix_use_runtimelinking=yes
60116aec45a7Smrg	        break
60126aec45a7Smrg	        ;;
60136aec45a7Smrg	      esac
60146aec45a7Smrg	    done
60156aec45a7Smrg	    ;;
60166aec45a7Smrg          esac
6017ab47cfaaSmrg
60186aec45a7Smrg          exp_sym_flag='-bexport'
60196aec45a7Smrg          no_entry_flag='-bnoentry'
60206aec45a7Smrg        fi
6021ab47cfaaSmrg
60226aec45a7Smrg        # When large executables or shared objects are built, AIX ld can
60236aec45a7Smrg        # have problems creating the table of contents.  If linking a library
60246aec45a7Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
60256aec45a7Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
60266aec45a7Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
60276aec45a7Smrg
60286aec45a7Smrg        _LT_TAGVAR(archive_cmds, $1)=''
60296aec45a7Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
60306aec45a7Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
60316aec45a7Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
60326aec45a7Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
60336aec45a7Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
60346aec45a7Smrg
60356aec45a7Smrg        if test "$GXX" = yes; then
60366aec45a7Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
60376aec45a7Smrg          # We only want to do this on AIX 4.2 and lower, the check
60386aec45a7Smrg          # below for broken collect2 doesn't work under 4.3+
60396aec45a7Smrg	  collect2name=`${CC} -print-prog-name=collect2`
60406aec45a7Smrg	  if test -f "$collect2name" &&
60416aec45a7Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
60426aec45a7Smrg	  then
60436aec45a7Smrg	    # We have reworked collect2
60446aec45a7Smrg	    :
60456aec45a7Smrg	  else
60466aec45a7Smrg	    # We have old collect2
60476aec45a7Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
60486aec45a7Smrg	    # It fails to find uninstalled libraries when the uninstalled
60496aec45a7Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
60506aec45a7Smrg	    # to unsupported forces relinking
60516aec45a7Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
60526aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
60536aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
60546aec45a7Smrg	  fi
60556aec45a7Smrg          esac
60566aec45a7Smrg          shared_flag='-shared'
60576aec45a7Smrg	  if test "$aix_use_runtimelinking" = yes; then
60586aec45a7Smrg	    shared_flag="$shared_flag "'${wl}-G'
60596aec45a7Smrg	  fi
60606aec45a7Smrg        else
60616aec45a7Smrg          # not using gcc
60626aec45a7Smrg          if test "$host_cpu" = ia64; then
60636aec45a7Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
60646aec45a7Smrg	  # chokes on -Wl,-G. The following line is correct:
60656aec45a7Smrg	  shared_flag='-G'
60666aec45a7Smrg          else
60676aec45a7Smrg	    if test "$aix_use_runtimelinking" = yes; then
60686aec45a7Smrg	      shared_flag='${wl}-G'
60696aec45a7Smrg	    else
60706aec45a7Smrg	      shared_flag='${wl}-bM:SRE'
60716aec45a7Smrg	    fi
60726aec45a7Smrg          fi
60736aec45a7Smrg        fi
6074ab47cfaaSmrg
60756aec45a7Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
60766aec45a7Smrg        # It seems that -bexpall does not export symbols beginning with
60776aec45a7Smrg        # underscore (_), so it is better to generate a list of symbols to
60786aec45a7Smrg	# export.
60796aec45a7Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
60806aec45a7Smrg        if test "$aix_use_runtimelinking" = yes; then
60816aec45a7Smrg          # Warning - without using the other runtime loading flags (-brtl),
60826aec45a7Smrg          # -berok will link without error, but may produce a broken library.
60836aec45a7Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
60846aec45a7Smrg          # Determine the default libpath from the value encoded in an empty
60856aec45a7Smrg          # executable.
6086aa9e3350Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
60876aec45a7Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
60886aec45a7Smrg
60896aec45a7Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
60906aec45a7Smrg        else
60916aec45a7Smrg          if test "$host_cpu" = ia64; then
60926aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
60936aec45a7Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
60946aec45a7Smrg	    _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"
60956aec45a7Smrg          else
60966aec45a7Smrg	    # Determine the default libpath from the value encoded in an
60976aec45a7Smrg	    # empty executable.
6098aa9e3350Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
60996aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
61006aec45a7Smrg	    # Warning - without using the other run time loading flags,
61016aec45a7Smrg	    # -berok will link without error, but may produce a broken library.
61026aec45a7Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
61036aec45a7Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
61046aec45a7Smrg	    if test "$with_gnu_ld" = yes; then
61056aec45a7Smrg	      # We only use this code for GNU lds that support --whole-archive.
61066aec45a7Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
61076aec45a7Smrg	    else
61086aec45a7Smrg	      # Exported symbols can be pulled into shared objects from archives
61096aec45a7Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
61106aec45a7Smrg	    fi
61116aec45a7Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
61126aec45a7Smrg	    # This is similar to how AIX traditionally builds its shared
61136aec45a7Smrg	    # libraries.
61146aec45a7Smrg	    _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'
61156aec45a7Smrg          fi
61166aec45a7Smrg        fi
61176aec45a7Smrg        ;;
6118ab47cfaaSmrg
61196aec45a7Smrg      beos*)
61206aec45a7Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
61216aec45a7Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61226aec45a7Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
61236aec45a7Smrg	  # support --undefined.  This deserves some investigation.  FIXME
61246aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
61256aec45a7Smrg	else
61266aec45a7Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
61276aec45a7Smrg	fi
61286aec45a7Smrg	;;
6129ab47cfaaSmrg
61306aec45a7Smrg      chorus*)
61316aec45a7Smrg        case $cc_basename in
61326aec45a7Smrg          *)
61336aec45a7Smrg	  # FIXME: insert proper C++ library support
61346aec45a7Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
61356aec45a7Smrg	  ;;
61366aec45a7Smrg        esac
61376aec45a7Smrg        ;;
6138ab47cfaaSmrg
61396aec45a7Smrg      cygwin* | mingw* | pw32* | cegcc*)
6140aa9e3350Smrg	case $GXX,$cc_basename in
6141aa9e3350Smrg	,cl* | no,cl*)
6142aa9e3350Smrg	  # Native MSVC
6143aa9e3350Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
6144aa9e3350Smrg	  # no search path for DLLs.
6145aa9e3350Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6146aa9e3350Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6147aa9e3350Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
6148aa9e3350Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
6149aa9e3350Smrg	  # Tell ltmain to make .lib files, not .a files.
6150aa9e3350Smrg	  libext=lib
6151aa9e3350Smrg	  # Tell ltmain to make .dll files, not .so files.
6152aa9e3350Smrg	  shrext_cmds=".dll"
6153aa9e3350Smrg	  # FIXME: Setting linknames here is a bad hack.
6154aa9e3350Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6155aa9e3350Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6156aa9e3350Smrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6157aa9e3350Smrg	    else
6158aa9e3350Smrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6159aa9e3350Smrg	    fi~
6160aa9e3350Smrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6161aa9e3350Smrg	    linknames='
6162aa9e3350Smrg	  # The linker will not automatically build a static lib if we build a DLL.
6163aa9e3350Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6164aa9e3350Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6165aa9e3350Smrg	  # Don't use ranlib
6166aa9e3350Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6167aa9e3350Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6168aa9e3350Smrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
6169aa9e3350Smrg	    case $lt_outputfile in
6170aa9e3350Smrg	      *.exe|*.EXE) ;;
6171aa9e3350Smrg	      *)
6172aa9e3350Smrg		lt_outputfile="$lt_outputfile.exe"
6173aa9e3350Smrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
6174aa9e3350Smrg		;;
6175aa9e3350Smrg	    esac~
6176aa9e3350Smrg	    func_to_tool_file "$lt_outputfile"~
6177aa9e3350Smrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6178aa9e3350Smrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6179aa9e3350Smrg	      $RM "$lt_outputfile.manifest";
6180aa9e3350Smrg	    fi'
6181aa9e3350Smrg	  ;;
6182aa9e3350Smrg	*)
6183aa9e3350Smrg	  # g++
6184aa9e3350Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6185aa9e3350Smrg	  # as there is no search path for DLLs.
6186aa9e3350Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6187aa9e3350Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
6188aa9e3350Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6189aa9e3350Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
6190aa9e3350Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6191aa9e3350Smrg
6192aa9e3350Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6193aa9e3350Smrg	    _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'
6194aa9e3350Smrg	    # If the export-symbols file already is a .def file (1st line
6195aa9e3350Smrg	    # is EXPORTS), use it as is; otherwise, prepend...
6196aa9e3350Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6197aa9e3350Smrg	      cp $export_symbols $output_objdir/$soname.def;
6198aa9e3350Smrg	    else
6199aa9e3350Smrg	      echo EXPORTS > $output_objdir/$soname.def;
6200aa9e3350Smrg	      cat $export_symbols >> $output_objdir/$soname.def;
6201aa9e3350Smrg	    fi~
6202aa9e3350Smrg	    $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'
6203aa9e3350Smrg	  else
6204aa9e3350Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6205aa9e3350Smrg	  fi
6206aa9e3350Smrg	  ;;
6207aa9e3350Smrg	esac
6208aa9e3350Smrg	;;
62096aec45a7Smrg      darwin* | rhapsody*)
62106aec45a7Smrg        _LT_DARWIN_LINKER_FEATURES($1)
62116aec45a7Smrg	;;
6212ab47cfaaSmrg
62136aec45a7Smrg      dgux*)
62146aec45a7Smrg        case $cc_basename in
62156aec45a7Smrg          ec++*)
62166aec45a7Smrg	    # FIXME: insert proper C++ library support
62176aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62186aec45a7Smrg	    ;;
62196aec45a7Smrg          ghcx*)
62206aec45a7Smrg	    # Green Hills C++ Compiler
62216aec45a7Smrg	    # FIXME: insert proper C++ library support
62226aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62236aec45a7Smrg	    ;;
62246aec45a7Smrg          *)
62256aec45a7Smrg	    # FIXME: insert proper C++ library support
62266aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62276aec45a7Smrg	    ;;
62286aec45a7Smrg        esac
62296aec45a7Smrg        ;;
6230ab47cfaaSmrg
6231aa9e3350Smrg      freebsd2.*)
62326aec45a7Smrg        # C++ shared libraries reported to be fairly broken before
62336aec45a7Smrg	# switch to ELF
62346aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
62356aec45a7Smrg        ;;
6236ab47cfaaSmrg
62376aec45a7Smrg      freebsd-elf*)
62386aec45a7Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
62396aec45a7Smrg        ;;
6240ab47cfaaSmrg
62416aec45a7Smrg      freebsd* | dragonfly*)
62426aec45a7Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
62436aec45a7Smrg        # conventions
62446aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
62456aec45a7Smrg        ;;
6246ab47cfaaSmrg
62476aec45a7Smrg      haiku*)
62486aec45a7Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
62496aec45a7Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
62506aec45a7Smrg        ;;
6251ab47cfaaSmrg
62526aec45a7Smrg      hpux9*)
62536aec45a7Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
62546aec45a7Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
62556aec45a7Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
62566aec45a7Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
62576aec45a7Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
62586aec45a7Smrg				             # but as the default
62596aec45a7Smrg				             # location of the library.
62606aec45a7Smrg
62616aec45a7Smrg        case $cc_basename in
62626aec45a7Smrg          CC*)
62636aec45a7Smrg            # FIXME: insert proper C++ library support
62646aec45a7Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
62656aec45a7Smrg            ;;
62666aec45a7Smrg          aCC*)
62676aec45a7Smrg            _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'
62686aec45a7Smrg            # Commands to make compiler produce verbose output that lists
62696aec45a7Smrg            # what "hidden" libraries, object files and flags are used when
62706aec45a7Smrg            # linking a shared library.
62716aec45a7Smrg            #
62726aec45a7Smrg            # There doesn't appear to be a way to prevent this compiler from
62736aec45a7Smrg            # explicitly linking system object files so we need to strip them
62746aec45a7Smrg            # from the output so that they don't get included in the library
62756aec45a7Smrg            # dependencies.
62766aec45a7Smrg            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
62776aec45a7Smrg            ;;
62786aec45a7Smrg          *)
62796aec45a7Smrg            if test "$GXX" = yes; then
6280aa9e3350Smrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
62816aec45a7Smrg            else
62826aec45a7Smrg              # FIXME: insert proper C++ library support
62836aec45a7Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
62846aec45a7Smrg            fi
62856aec45a7Smrg            ;;
62866aec45a7Smrg        esac
62876aec45a7Smrg        ;;
6288ab47cfaaSmrg
62896aec45a7Smrg      hpux10*|hpux11*)
62906aec45a7Smrg        if test $with_gnu_ld = no; then
62916aec45a7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
62926aec45a7Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
62936aec45a7Smrg
62946aec45a7Smrg          case $host_cpu in
62956aec45a7Smrg            hppa*64*|ia64*)
62966aec45a7Smrg              ;;
62976aec45a7Smrg            *)
62986aec45a7Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
62996aec45a7Smrg              ;;
63006aec45a7Smrg          esac
63016aec45a7Smrg        fi
63026aec45a7Smrg        case $host_cpu in
63036aec45a7Smrg          hppa*64*|ia64*)
63046aec45a7Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
63056aec45a7Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63066aec45a7Smrg            ;;
63076aec45a7Smrg          *)
63086aec45a7Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
63096aec45a7Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
63106aec45a7Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
63116aec45a7Smrg					         # but as the default
63126aec45a7Smrg					         # location of the library.
63136aec45a7Smrg            ;;
63146aec45a7Smrg        esac
63156aec45a7Smrg
63166aec45a7Smrg        case $cc_basename in
63176aec45a7Smrg          CC*)
63186aec45a7Smrg	    # FIXME: insert proper C++ library support
63196aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
63206aec45a7Smrg	    ;;
63216aec45a7Smrg          aCC*)
63226aec45a7Smrg	    case $host_cpu in
63236aec45a7Smrg	      hppa*64*)
63246aec45a7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63256aec45a7Smrg	        ;;
63266aec45a7Smrg	      ia64*)
63276aec45a7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63286aec45a7Smrg	        ;;
63296aec45a7Smrg	      *)
63306aec45a7Smrg	        _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'
63316aec45a7Smrg	        ;;
63326aec45a7Smrg	    esac
63336aec45a7Smrg	    # Commands to make compiler produce verbose output that lists
63346aec45a7Smrg	    # what "hidden" libraries, object files and flags are used when
63356aec45a7Smrg	    # linking a shared library.
63366aec45a7Smrg	    #
63376aec45a7Smrg	    # There doesn't appear to be a way to prevent this compiler from
63386aec45a7Smrg	    # explicitly linking system object files so we need to strip them
63396aec45a7Smrg	    # from the output so that they don't get included in the library
63406aec45a7Smrg	    # dependencies.
63416aec45a7Smrg	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
63426aec45a7Smrg	    ;;
63436aec45a7Smrg          *)
63446aec45a7Smrg	    if test "$GXX" = yes; then
63456aec45a7Smrg	      if test $with_gnu_ld = no; then
63466aec45a7Smrg	        case $host_cpu in
63476aec45a7Smrg	          hppa*64*)
63486aec45a7Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63496aec45a7Smrg	            ;;
63506aec45a7Smrg	          ia64*)
6351aa9e3350Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63526aec45a7Smrg	            ;;
63536aec45a7Smrg	          *)
6354aa9e3350Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63556aec45a7Smrg	            ;;
63566aec45a7Smrg	        esac
63576aec45a7Smrg	      fi
63586aec45a7Smrg	    else
63596aec45a7Smrg	      # FIXME: insert proper C++ library support
63606aec45a7Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
63616aec45a7Smrg	    fi
63626aec45a7Smrg	    ;;
63636aec45a7Smrg        esac
63646aec45a7Smrg        ;;
6365ab47cfaaSmrg
63666aec45a7Smrg      interix[[3-9]]*)
63676aec45a7Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
63686aec45a7Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63696aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
63706aec45a7Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
63716aec45a7Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
63726aec45a7Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
63736aec45a7Smrg	# default) and relocated if they conflict, which is a slow very memory
63746aec45a7Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
63756aec45a7Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
63766aec45a7Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
63776aec45a7Smrg	_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'
63786aec45a7Smrg	_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'
63796aec45a7Smrg	;;
63806aec45a7Smrg      irix5* | irix6*)
63816aec45a7Smrg        case $cc_basename in
63826aec45a7Smrg          CC*)
63836aec45a7Smrg	    # SGI C++
63846aec45a7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
63856aec45a7Smrg
63866aec45a7Smrg	    # Archives containing C++ object files must be created using
63876aec45a7Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
63886aec45a7Smrg	    # necessary to make sure instantiated templates are included
63896aec45a7Smrg	    # in the archive.
63906aec45a7Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
63916aec45a7Smrg	    ;;
63926aec45a7Smrg          *)
63936aec45a7Smrg	    if test "$GXX" = yes; then
63946aec45a7Smrg	      if test "$with_gnu_ld" = no; then
6395aa9e3350Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
63966aec45a7Smrg	      else
6397aa9e3350Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
63986aec45a7Smrg	      fi
63996aec45a7Smrg	    fi
64006aec45a7Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
64016aec45a7Smrg	    ;;
64026aec45a7Smrg        esac
64036aec45a7Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
64046aec45a7Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
64056aec45a7Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
64066aec45a7Smrg        ;;
6407ab47cfaaSmrg
640838770048Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
64096aec45a7Smrg        case $cc_basename in
64106aec45a7Smrg          KCC*)
64116aec45a7Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6412ab47cfaaSmrg
64136aec45a7Smrg	    # KCC will only create a shared library if the output file
64146aec45a7Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
64156aec45a7Smrg	    # to its proper name (with version) after linking.
64166aec45a7Smrg	    _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'
64176aec45a7Smrg	    _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'
64186aec45a7Smrg	    # Commands to make compiler produce verbose output that lists
64196aec45a7Smrg	    # what "hidden" libraries, object files and flags are used when
64206aec45a7Smrg	    # linking a shared library.
64216aec45a7Smrg	    #
64226aec45a7Smrg	    # There doesn't appear to be a way to prevent this compiler from
64236aec45a7Smrg	    # explicitly linking system object files so we need to strip them
64246aec45a7Smrg	    # from the output so that they don't get included in the library
64256aec45a7Smrg	    # dependencies.
64266aec45a7Smrg	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
64276aec45a7Smrg
64286aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64296aec45a7Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64306aec45a7Smrg
64316aec45a7Smrg	    # Archives containing C++ object files must be created using
64326aec45a7Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
64336aec45a7Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
64346aec45a7Smrg	    ;;
64356aec45a7Smrg	  icpc* | ecpc* )
64366aec45a7Smrg	    # Intel C++
64376aec45a7Smrg	    with_gnu_ld=yes
64386aec45a7Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
64396aec45a7Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
64406aec45a7Smrg	    # earlier do not add the objects themselves.
64416aec45a7Smrg	    case `$CC -V 2>&1` in
64426aec45a7Smrg	      *"Version 7."*)
64436aec45a7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
64446aec45a7Smrg		_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'
64456aec45a7Smrg		;;
64466aec45a7Smrg	      *)  # Version 8.0 or newer
64476aec45a7Smrg	        tmp_idyn=
64486aec45a7Smrg	        case $host_cpu in
64496aec45a7Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
64506aec45a7Smrg		esac
64516aec45a7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
64526aec45a7Smrg		_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'
64536aec45a7Smrg		;;
64546aec45a7Smrg	    esac
64556aec45a7Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
64566aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64576aec45a7Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64586aec45a7Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
64596aec45a7Smrg	    ;;
64606aec45a7Smrg          pgCC* | pgcpp*)
64616aec45a7Smrg            # Portland Group C++ compiler
64626aec45a7Smrg	    case `$CC -V` in
64636aec45a7Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
64646aec45a7Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
64656aec45a7Smrg		rm -rf $tpldir~
64666aec45a7Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
64676aec45a7Smrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
64686aec45a7Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
64696aec45a7Smrg		rm -rf $tpldir~
64706aec45a7Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
64716aec45a7Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
64726aec45a7Smrg		$RANLIB $oldlib'
64736aec45a7Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
64746aec45a7Smrg		rm -rf $tpldir~
64756aec45a7Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
64766aec45a7Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
64776aec45a7Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
64786aec45a7Smrg		rm -rf $tpldir~
64796aec45a7Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
64806aec45a7Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
64816aec45a7Smrg	      ;;
64826aec45a7Smrg	    *) # Version 6 and above use weak symbols
64836aec45a7Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
64846aec45a7Smrg	      _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'
64856aec45a7Smrg	      ;;
64866aec45a7Smrg	    esac
6487ab47cfaaSmrg
64886aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
64896aec45a7Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64906aec45a7Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
64916aec45a7Smrg            ;;
64926aec45a7Smrg	  cxx*)
64936aec45a7Smrg	    # Compaq C++
64946aec45a7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
64956aec45a7Smrg	    _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'
6496ab47cfaaSmrg
64976aec45a7Smrg	    runpath_var=LD_RUN_PATH
64986aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
64996aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6500ab47cfaaSmrg
65016aec45a7Smrg	    # Commands to make compiler produce verbose output that lists
65026aec45a7Smrg	    # what "hidden" libraries, object files and flags are used when
65036aec45a7Smrg	    # linking a shared library.
65046aec45a7Smrg	    #
65056aec45a7Smrg	    # There doesn't appear to be a way to prevent this compiler from
65066aec45a7Smrg	    # explicitly linking system object files so we need to strip them
65076aec45a7Smrg	    # from the output so that they don't get included in the library
65086aec45a7Smrg	    # dependencies.
65096aec45a7Smrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
65106aec45a7Smrg	    ;;
65116aec45a7Smrg	  xl* | mpixl* | bgxl*)
65126aec45a7Smrg	    # IBM XL 8.0 on PPC, with GNU ld
65136aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
65146aec45a7Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
65156aec45a7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
65166aec45a7Smrg	    if test "x$supports_anon_versioning" = xyes; then
65176aec45a7Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
65186aec45a7Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
65196aec45a7Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
65206aec45a7Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
65216aec45a7Smrg	    fi
65226aec45a7Smrg	    ;;
65236aec45a7Smrg	  *)
65246aec45a7Smrg	    case `$CC -V 2>&1 | sed 5q` in
65256aec45a7Smrg	    *Sun\ C*)
65266aec45a7Smrg	      # Sun C++ 5.9
65276aec45a7Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
65286aec45a7Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
65296aec45a7Smrg	      _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'
65306aec45a7Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
65316aec45a7Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
65326aec45a7Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
65336aec45a7Smrg
65346aec45a7Smrg	      # Not sure whether something based on
65356aec45a7Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
65366aec45a7Smrg	      # would be better.
65376aec45a7Smrg	      output_verbose_link_cmd='func_echo_all'
65386aec45a7Smrg
65396aec45a7Smrg	      # Archives containing C++ object files must be created using
65406aec45a7Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
65416aec45a7Smrg	      # necessary to make sure instantiated templates are included
65426aec45a7Smrg	      # in the archive.
65436aec45a7Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
65446aec45a7Smrg	      ;;
65456aec45a7Smrg	    esac
65466aec45a7Smrg	    ;;
65476aec45a7Smrg	esac
65486aec45a7Smrg	;;
6549ab47cfaaSmrg
65506aec45a7Smrg      lynxos*)
65516aec45a7Smrg        # FIXME: insert proper C++ library support
65526aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
65536aec45a7Smrg	;;
6554ab47cfaaSmrg
65556aec45a7Smrg      m88k*)
65566aec45a7Smrg        # FIXME: insert proper C++ library support
65576aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
65586aec45a7Smrg	;;
6559ab47cfaaSmrg
65606aec45a7Smrg      mvs*)
65616aec45a7Smrg        case $cc_basename in
65626aec45a7Smrg          cxx*)
65636aec45a7Smrg	    # FIXME: insert proper C++ library support
65646aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
65656aec45a7Smrg	    ;;
65666aec45a7Smrg	  *)
65676aec45a7Smrg	    # FIXME: insert proper C++ library support
65686aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
65696aec45a7Smrg	    ;;
65706aec45a7Smrg	esac
65716aec45a7Smrg	;;
6572ab47cfaaSmrg
65736aec45a7Smrg      netbsd*)
65746aec45a7Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
65756aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
65766aec45a7Smrg	  wlarc=
65776aec45a7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
65786aec45a7Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
65796aec45a7Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65806aec45a7Smrg	fi
65816aec45a7Smrg	# Workaround some broken pre-1.5 toolchains
65826aec45a7Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
65836aec45a7Smrg	;;
6584ab47cfaaSmrg
65856aec45a7Smrg      *nto* | *qnx*)
65866aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
65876aec45a7Smrg	;;
6588ab47cfaaSmrg
65896aec45a7Smrg      openbsd2*)
65906aec45a7Smrg        # C++ shared libraries are fairly broken
65916aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
65926aec45a7Smrg	;;
6593ab47cfaaSmrg
65946aec45a7Smrg      openbsd*)
65956aec45a7Smrg	if test -f /usr/libexec/ld.so; then
65966aec45a7Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
65976aec45a7Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65986aec45a7Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
65996aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
66006aec45a7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
66016aec45a7Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
66026aec45a7Smrg	    _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'
66036aec45a7Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
66046aec45a7Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
66056aec45a7Smrg	  fi
66066aec45a7Smrg	  output_verbose_link_cmd=func_echo_all
66076aec45a7Smrg	else
66086aec45a7Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
66096aec45a7Smrg	fi
66106aec45a7Smrg	;;
6611ab47cfaaSmrg
66126aec45a7Smrg      osf3* | osf4* | osf5*)
66136aec45a7Smrg        case $cc_basename in
66146aec45a7Smrg          KCC*)
66156aec45a7Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
66166aec45a7Smrg
66176aec45a7Smrg	    # KCC will only create a shared library if the output file
66186aec45a7Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
66196aec45a7Smrg	    # to its proper name (with version) after linking.
66206aec45a7Smrg	    _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'
66216aec45a7Smrg
66226aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
66236aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
66246aec45a7Smrg
66256aec45a7Smrg	    # Archives containing C++ object files must be created using
66266aec45a7Smrg	    # the KAI C++ compiler.
66276aec45a7Smrg	    case $host in
66286aec45a7Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
66296aec45a7Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
66306aec45a7Smrg	    esac
66316aec45a7Smrg	    ;;
66326aec45a7Smrg          RCC*)
66336aec45a7Smrg	    # Rational C++ 2.4.1
66346aec45a7Smrg	    # FIXME: insert proper C++ library support
66356aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
66366aec45a7Smrg	    ;;
66376aec45a7Smrg          cxx*)
66386aec45a7Smrg	    case $host in
66396aec45a7Smrg	      osf3*)
66406aec45a7Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
66416aec45a7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
66426aec45a7Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
66436aec45a7Smrg		;;
66446aec45a7Smrg	      *)
66456aec45a7Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
66466aec45a7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
66476aec45a7Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
66486aec45a7Smrg	          echo "-hidden">> $lib.exp~
66496aec45a7Smrg	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
66506aec45a7Smrg	          $RM $lib.exp'
66516aec45a7Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
66526aec45a7Smrg		;;
66536aec45a7Smrg	    esac
6654ab47cfaaSmrg
66556aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6656ab47cfaaSmrg
66576aec45a7Smrg	    # Commands to make compiler produce verbose output that lists
66586aec45a7Smrg	    # what "hidden" libraries, object files and flags are used when
66596aec45a7Smrg	    # linking a shared library.
66606aec45a7Smrg	    #
66616aec45a7Smrg	    # There doesn't appear to be a way to prevent this compiler from
66626aec45a7Smrg	    # explicitly linking system object files so we need to strip them
66636aec45a7Smrg	    # from the output so that they don't get included in the library
66646aec45a7Smrg	    # dependencies.
66656aec45a7Smrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
66666aec45a7Smrg	    ;;
66676aec45a7Smrg	  *)
66686aec45a7Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
66696aec45a7Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
66706aec45a7Smrg	      case $host in
66716aec45a7Smrg	        osf3*)
66726aec45a7Smrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
66736aec45a7Smrg		  ;;
66746aec45a7Smrg	        *)
6675aa9e3350Smrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
66766aec45a7Smrg		  ;;
66776aec45a7Smrg	      esac
66786aec45a7Smrg
66796aec45a7Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
66806aec45a7Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
66816aec45a7Smrg
66826aec45a7Smrg	      # Commands to make compiler produce verbose output that lists
66836aec45a7Smrg	      # what "hidden" libraries, object files and flags are used when
66846aec45a7Smrg	      # linking a shared library.
66856aec45a7Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
66866aec45a7Smrg
66876aec45a7Smrg	    else
66886aec45a7Smrg	      # FIXME: insert proper C++ library support
66896aec45a7Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
66906aec45a7Smrg	    fi
66916aec45a7Smrg	    ;;
66926aec45a7Smrg        esac
66936aec45a7Smrg        ;;
6694ab47cfaaSmrg
66956aec45a7Smrg      psos*)
66966aec45a7Smrg        # FIXME: insert proper C++ library support
66976aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
66986aec45a7Smrg        ;;
6699ab47cfaaSmrg
67006aec45a7Smrg      sunos4*)
67016aec45a7Smrg        case $cc_basename in
67026aec45a7Smrg          CC*)
67036aec45a7Smrg	    # Sun C++ 4.x
67046aec45a7Smrg	    # FIXME: insert proper C++ library support
67056aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67066aec45a7Smrg	    ;;
67076aec45a7Smrg          lcc*)
67086aec45a7Smrg	    # Lucid
67096aec45a7Smrg	    # FIXME: insert proper C++ library support
67106aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67116aec45a7Smrg	    ;;
67126aec45a7Smrg          *)
67136aec45a7Smrg	    # FIXME: insert proper C++ library support
67146aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67156aec45a7Smrg	    ;;
67166aec45a7Smrg        esac
67176aec45a7Smrg        ;;
6718ab47cfaaSmrg
67196aec45a7Smrg      solaris*)
67206aec45a7Smrg        case $cc_basename in
67216aec45a7Smrg          CC* | sunCC*)
67226aec45a7Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
67236aec45a7Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
67246aec45a7Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
67256aec45a7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
67266aec45a7Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
67276aec45a7Smrg	      $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'
67286aec45a7Smrg
67296aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
67306aec45a7Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
67316aec45a7Smrg	    case $host_os in
67326aec45a7Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
67336aec45a7Smrg	      *)
67346aec45a7Smrg		# The compiler driver will combine and reorder linker options,
67356aec45a7Smrg		# but understands `-z linker_flag'.
67366aec45a7Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
67376aec45a7Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
67386aec45a7Smrg	        ;;
67396aec45a7Smrg	    esac
67406aec45a7Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6741ab47cfaaSmrg
67426aec45a7Smrg	    output_verbose_link_cmd='func_echo_all'
6743ab47cfaaSmrg
67446aec45a7Smrg	    # Archives containing C++ object files must be created using
67456aec45a7Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
67466aec45a7Smrg	    # necessary to make sure instantiated templates are included
67476aec45a7Smrg	    # in the archive.
67486aec45a7Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
67496aec45a7Smrg	    ;;
67506aec45a7Smrg          gcx*)
67516aec45a7Smrg	    # Green Hills C++ Compiler
67526aec45a7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6753ab47cfaaSmrg
67546aec45a7Smrg	    # The C++ compiler must be used to create the archive.
67556aec45a7Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
67566aec45a7Smrg	    ;;
67576aec45a7Smrg          *)
67586aec45a7Smrg	    # GNU C++ compiler with Solaris linker
67596aec45a7Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
67606aec45a7Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
67616aec45a7Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6762aa9e3350Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
67636aec45a7Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6764aa9e3350Smrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
67656aec45a7Smrg
67666aec45a7Smrg	        # Commands to make compiler produce verbose output that lists
67676aec45a7Smrg	        # what "hidden" libraries, object files and flags are used when
67686aec45a7Smrg	        # linking a shared library.
67696aec45a7Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
67706aec45a7Smrg	      else
67716aec45a7Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
67726aec45a7Smrg	        # platform.
67736aec45a7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
67746aec45a7Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
67756aec45a7Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
67766aec45a7Smrg
67776aec45a7Smrg	        # Commands to make compiler produce verbose output that lists
67786aec45a7Smrg	        # what "hidden" libraries, object files and flags are used when
67796aec45a7Smrg	        # linking a shared library.
67806aec45a7Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
67816aec45a7Smrg	      fi
67826aec45a7Smrg
67836aec45a7Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
67846aec45a7Smrg	      case $host_os in
67856aec45a7Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
67866aec45a7Smrg		*)
67876aec45a7Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
67886aec45a7Smrg		  ;;
67896aec45a7Smrg	      esac
67906aec45a7Smrg	    fi
67916aec45a7Smrg	    ;;
67926aec45a7Smrg        esac
67936aec45a7Smrg        ;;
6794ab47cfaaSmrg
67956aec45a7Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
67966aec45a7Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
67976aec45a7Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
67986aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
67996aec45a7Smrg      runpath_var='LD_RUN_PATH'
6800ab47cfaaSmrg
68016aec45a7Smrg      case $cc_basename in
68026aec45a7Smrg        CC*)
68036aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68046aec45a7Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68056aec45a7Smrg	  ;;
68066aec45a7Smrg	*)
68076aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68086aec45a7Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68096aec45a7Smrg	  ;;
68106aec45a7Smrg      esac
68116aec45a7Smrg      ;;
6812ab47cfaaSmrg
68136aec45a7Smrg      sysv5* | sco3.2v5* | sco5v6*)
68146aec45a7Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
68156aec45a7Smrg	# link with -lc, and that would cause any symbols used from libc to
68166aec45a7Smrg	# always be unresolved, which means just about no library would
68176aec45a7Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
68186aec45a7Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
68196aec45a7Smrg	# as -z defs.
68206aec45a7Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
68216aec45a7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
68226aec45a7Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
68236aec45a7Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
68246aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
68256aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
68266aec45a7Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
68276aec45a7Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
68286aec45a7Smrg	runpath_var='LD_RUN_PATH'
6829ab47cfaaSmrg
68306aec45a7Smrg	case $cc_basename in
68316aec45a7Smrg          CC*)
68326aec45a7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68336aec45a7Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68346aec45a7Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
68356aec45a7Smrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
68366aec45a7Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
68376aec45a7Smrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
68386aec45a7Smrg	    ;;
68396aec45a7Smrg	  *)
68406aec45a7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68416aec45a7Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68426aec45a7Smrg	    ;;
68436aec45a7Smrg	esac
68446aec45a7Smrg      ;;
6845ab47cfaaSmrg
68466aec45a7Smrg      tandem*)
68476aec45a7Smrg        case $cc_basename in
68486aec45a7Smrg          NCC*)
68496aec45a7Smrg	    # NonStop-UX NCC 3.20
68506aec45a7Smrg	    # FIXME: insert proper C++ library support
68516aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68526aec45a7Smrg	    ;;
68536aec45a7Smrg          *)
68546aec45a7Smrg	    # FIXME: insert proper C++ library support
68556aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68566aec45a7Smrg	    ;;
68576aec45a7Smrg        esac
68586aec45a7Smrg        ;;
6859ab47cfaaSmrg
68606aec45a7Smrg      vxworks*)
68616aec45a7Smrg        # FIXME: insert proper C++ library support
68626aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
68636aec45a7Smrg        ;;
6864ab47cfaaSmrg
68656aec45a7Smrg      *)
68666aec45a7Smrg        # FIXME: insert proper C++ library support
68676aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
68686aec45a7Smrg        ;;
68696aec45a7Smrg    esac
6870ab47cfaaSmrg
68716aec45a7Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
68726aec45a7Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
68736aec45a7Smrg
68746aec45a7Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
68756aec45a7Smrg    _LT_TAGVAR(LD, $1)="$LD"
68766aec45a7Smrg
68776aec45a7Smrg    ## CAVEAT EMPTOR:
68786aec45a7Smrg    ## There is no encapsulation within the following macros, do not change
68796aec45a7Smrg    ## the running order or otherwise move them around unless you know exactly
68806aec45a7Smrg    ## what you are doing...
68816aec45a7Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
68826aec45a7Smrg    _LT_COMPILER_PIC($1)
68836aec45a7Smrg    _LT_COMPILER_C_O($1)
68846aec45a7Smrg    _LT_COMPILER_FILE_LOCKS($1)
68856aec45a7Smrg    _LT_LINKER_SHLIBS($1)
68866aec45a7Smrg    _LT_SYS_DYNAMIC_LINKER($1)
68876aec45a7Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
68886aec45a7Smrg
68896aec45a7Smrg    _LT_CONFIG($1)
68906aec45a7Smrg  fi # test -n "$compiler"
68916aec45a7Smrg
68926aec45a7Smrg  CC=$lt_save_CC
6893aa9e3350Smrg  CFLAGS=$lt_save_CFLAGS
68946aec45a7Smrg  LDCXX=$LD
68956aec45a7Smrg  LD=$lt_save_LD
68966aec45a7Smrg  GCC=$lt_save_GCC
68976aec45a7Smrg  with_gnu_ld=$lt_save_with_gnu_ld
68986aec45a7Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
68996aec45a7Smrg  lt_cv_path_LD=$lt_save_path_LD
69006aec45a7Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
69016aec45a7Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
69026aec45a7Smrgfi # test "$_lt_caught_CXX_error" != yes
6903ab47cfaaSmrg
69046aec45a7SmrgAC_LANG_POP
69056aec45a7Smrg])# _LT_LANG_CXX_CONFIG
6906ab47cfaaSmrg
6907ab47cfaaSmrg
6908aa9e3350Smrg# _LT_FUNC_STRIPNAME_CNF
6909aa9e3350Smrg# ----------------------
6910aa9e3350Smrg# func_stripname_cnf prefix suffix name
6911aa9e3350Smrg# strip PREFIX and SUFFIX off of NAME.
6912aa9e3350Smrg# PREFIX and SUFFIX must not contain globbing or regex special
6913aa9e3350Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
6914aa9e3350Smrg# dot (in which case that matches only a dot).
6915aa9e3350Smrg#
6916aa9e3350Smrg# This function is identical to the (non-XSI) version of func_stripname,
6917aa9e3350Smrg# except this one can be used by m4 code that may be executed by configure,
6918aa9e3350Smrg# rather than the libtool script.
6919aa9e3350Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
6920aa9e3350SmrgAC_REQUIRE([_LT_DECL_SED])
6921aa9e3350SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
6922aa9e3350Smrgfunc_stripname_cnf ()
6923aa9e3350Smrg{
6924aa9e3350Smrg  case ${2} in
6925aa9e3350Smrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
6926aa9e3350Smrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
6927aa9e3350Smrg  esac
6928aa9e3350Smrg} # func_stripname_cnf
6929aa9e3350Smrg])# _LT_FUNC_STRIPNAME_CNF
6930aa9e3350Smrg
69316aec45a7Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
69326aec45a7Smrg# ---------------------------------
69336aec45a7Smrg# Figure out "hidden" library dependencies from verbose
69346aec45a7Smrg# compiler output when linking a shared library.
69356aec45a7Smrg# Parse the compiler output and extract the necessary
69366aec45a7Smrg# objects, libraries and library flags.
69376aec45a7Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
69386aec45a7Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6939aa9e3350SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
69406aec45a7Smrg# Dependencies to place before and after the object being linked:
69416aec45a7Smrg_LT_TAGVAR(predep_objects, $1)=
69426aec45a7Smrg_LT_TAGVAR(postdep_objects, $1)=
69436aec45a7Smrg_LT_TAGVAR(predeps, $1)=
69446aec45a7Smrg_LT_TAGVAR(postdeps, $1)=
69456aec45a7Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
6946ab47cfaaSmrg
69476aec45a7Smrgdnl we can't use the lt_simple_compile_test_code here,
69486aec45a7Smrgdnl because it contains code intended for an executable,
69496aec45a7Smrgdnl not a library.  It's possible we should let each
69506aec45a7Smrgdnl tag define a new lt_????_link_test_code variable,
69516aec45a7Smrgdnl but it's only used here...
69526aec45a7Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
69536aec45a7Smrgint a;
69546aec45a7Smrgvoid foo (void) { a = 0; }
69556aec45a7Smrg_LT_EOF
69566aec45a7Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
69576aec45a7Smrgclass Foo
69586aec45a7Smrg{
69596aec45a7Smrgpublic:
69606aec45a7Smrg  Foo (void) { a = 0; }
69616aec45a7Smrgprivate:
69626aec45a7Smrg  int a;
69636aec45a7Smrg};
69646aec45a7Smrg_LT_EOF
69656aec45a7Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
69666aec45a7Smrg      subroutine foo
69676aec45a7Smrg      implicit none
69686aec45a7Smrg      integer*4 a
69696aec45a7Smrg      a=0
69706aec45a7Smrg      return
69716aec45a7Smrg      end
69726aec45a7Smrg_LT_EOF
69736aec45a7Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
69746aec45a7Smrg      subroutine foo
69756aec45a7Smrg      implicit none
69766aec45a7Smrg      integer a
69776aec45a7Smrg      a=0
69786aec45a7Smrg      return
69796aec45a7Smrg      end
69806aec45a7Smrg_LT_EOF
69816aec45a7Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
69826aec45a7Smrgpublic class foo {
69836aec45a7Smrg  private int a;
69846aec45a7Smrg  public void bar (void) {
69856aec45a7Smrg    a = 0;
69866aec45a7Smrg  }
69876aec45a7Smrg};
69886aec45a7Smrg_LT_EOF
6989aa9e3350Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
6990aa9e3350Smrgpackage foo
6991aa9e3350Smrgfunc foo() {
6992aa9e3350Smrg}
6993aa9e3350Smrg_LT_EOF
69945c42550eSmrg])
6995aa9e3350Smrg
6996aa9e3350Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
6997aa9e3350Smrgcase "$CC $CFLAGS " in #(
6998aa9e3350Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
6999aa9e3350Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7000aa9e3350Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
7001aa9e3350Smrgesac
7002aa9e3350Smrg
70036aec45a7Smrgdnl Parse the compiler output and extract the necessary
70046aec45a7Smrgdnl objects, libraries and library flags.
70056aec45a7Smrgif AC_TRY_EVAL(ac_compile); then
70066aec45a7Smrg  # Parse the compiler output and extract the necessary
70076aec45a7Smrg  # objects, libraries and library flags.
7008ab47cfaaSmrg
70096aec45a7Smrg  # Sentinel used to keep track of whether or not we are before
70106aec45a7Smrg  # the conftest object file.
70116aec45a7Smrg  pre_test_object_deps_done=no
70121473d951Smrg
70136aec45a7Smrg  for p in `eval "$output_verbose_link_cmd"`; do
7014aa9e3350Smrg    case ${prev}${p} in
7015ab47cfaaSmrg
70166aec45a7Smrg    -L* | -R* | -l*)
70176aec45a7Smrg       # Some compilers place space between "-{L,R}" and the path.
70186aec45a7Smrg       # Remove the space.
70196aec45a7Smrg       if test $p = "-L" ||
70206aec45a7Smrg          test $p = "-R"; then
70216aec45a7Smrg	 prev=$p
70226aec45a7Smrg	 continue
70236aec45a7Smrg       fi
7024ab47cfaaSmrg
7025aa9e3350Smrg       # Expand the sysroot to ease extracting the directories later.
7026aa9e3350Smrg       if test -z "$prev"; then
7027aa9e3350Smrg         case $p in
7028aa9e3350Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7029aa9e3350Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7030aa9e3350Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7031aa9e3350Smrg         esac
7032aa9e3350Smrg       fi
7033aa9e3350Smrg       case $p in
7034aa9e3350Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7035aa9e3350Smrg       esac
70366aec45a7Smrg       if test "$pre_test_object_deps_done" = no; then
7037aa9e3350Smrg	 case ${prev} in
7038aa9e3350Smrg	 -L | -R)
70396aec45a7Smrg	   # Internal compiler library paths should come after those
70406aec45a7Smrg	   # provided the user.  The postdeps already come after the
70416aec45a7Smrg	   # user supplied libs so there is no need to process them.
70426aec45a7Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
70436aec45a7Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
70446aec45a7Smrg	   else
70456aec45a7Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
70466aec45a7Smrg	   fi
70476aec45a7Smrg	   ;;
70486aec45a7Smrg	 # The "-l" case would never come before the object being
70496aec45a7Smrg	 # linked, so don't bother handling this case.
70506aec45a7Smrg	 esac
70516aec45a7Smrg       else
70526aec45a7Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
70536aec45a7Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
70546aec45a7Smrg	 else
70556aec45a7Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
70566aec45a7Smrg	 fi
70576aec45a7Smrg       fi
7058aa9e3350Smrg       prev=
70596aec45a7Smrg       ;;
7060ab47cfaaSmrg
7061aa9e3350Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
70626aec45a7Smrg    *.$objext)
70636aec45a7Smrg       # This assumes that the test object file only shows up
70646aec45a7Smrg       # once in the compiler output.
70656aec45a7Smrg       if test "$p" = "conftest.$objext"; then
70666aec45a7Smrg	 pre_test_object_deps_done=yes
70676aec45a7Smrg	 continue
70686aec45a7Smrg       fi
7069ab47cfaaSmrg
70706aec45a7Smrg       if test "$pre_test_object_deps_done" = no; then
70716aec45a7Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
70726aec45a7Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
70736aec45a7Smrg	 else
70746aec45a7Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
70756aec45a7Smrg	 fi
70766aec45a7Smrg       else
70776aec45a7Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
70786aec45a7Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
70796aec45a7Smrg	 else
70806aec45a7Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
70816aec45a7Smrg	 fi
70826aec45a7Smrg       fi
70836aec45a7Smrg       ;;
7084ab47cfaaSmrg
70856aec45a7Smrg    *) ;; # Ignore the rest.
7086ab47cfaaSmrg
70876aec45a7Smrg    esac
70886aec45a7Smrg  done
7089ab47cfaaSmrg
70906aec45a7Smrg  # Clean up.
70916aec45a7Smrg  rm -f a.out a.exe
70926aec45a7Smrgelse
70936aec45a7Smrg  echo "libtool.m4: error: problem compiling $1 test program"
70946aec45a7Smrgfi
70951473d951Smrg
70966aec45a7Smrg$RM -f confest.$objext
7097aa9e3350SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
7098ab47cfaaSmrg
70996aec45a7Smrg# PORTME: override above test on systems where it is broken
71006aec45a7Smrgm4_if([$1], [CXX],
71016aec45a7Smrg[case $host_os in
71026aec45a7Smrginterix[[3-9]]*)
71036aec45a7Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
71046aec45a7Smrg  # hack all around it, let's just trust "g++" to DTRT.
71056aec45a7Smrg  _LT_TAGVAR(predep_objects,$1)=
71066aec45a7Smrg  _LT_TAGVAR(postdep_objects,$1)=
71076aec45a7Smrg  _LT_TAGVAR(postdeps,$1)=
71085c42550eSmrg  ;;
71096aec45a7Smrg
71106aec45a7Smrglinux*)
71116aec45a7Smrg  case `$CC -V 2>&1 | sed 5q` in
71126aec45a7Smrg  *Sun\ C*)
71136aec45a7Smrg    # Sun C++ 5.9
71146aec45a7Smrg
71156aec45a7Smrg    # The more standards-conforming stlport4 library is
71166aec45a7Smrg    # incompatible with the Cstd library. Avoid specifying
71176aec45a7Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
71186aec45a7Smrg    # -library=stlport4 depends on it.
71196aec45a7Smrg    case " $CXX $CXXFLAGS " in
71206aec45a7Smrg    *" -library=stlport4 "*)
71216aec45a7Smrg      solaris_use_stlport4=yes
71226aec45a7Smrg      ;;
71236aec45a7Smrg    esac
71246aec45a7Smrg
71256aec45a7Smrg    if test "$solaris_use_stlport4" != yes; then
71266aec45a7Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
71276aec45a7Smrg    fi
71286aec45a7Smrg    ;;
71296aec45a7Smrg  esac
71305c42550eSmrg  ;;
71316aec45a7Smrg
71325c42550eSmrgsolaris*)
71336aec45a7Smrg  case $cc_basename in
71346aec45a7Smrg  CC* | sunCC*)
71356aec45a7Smrg    # The more standards-conforming stlport4 library is
71366aec45a7Smrg    # incompatible with the Cstd library. Avoid specifying
71376aec45a7Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
71386aec45a7Smrg    # -library=stlport4 depends on it.
71396aec45a7Smrg    case " $CXX $CXXFLAGS " in
71406aec45a7Smrg    *" -library=stlport4 "*)
71416aec45a7Smrg      solaris_use_stlport4=yes
71426aec45a7Smrg      ;;
71436aec45a7Smrg    esac
71441473d951Smrg
71456aec45a7Smrg    # Adding this requires a known-good setup of shared libraries for
71466aec45a7Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
71476aec45a7Smrg    # archive will be linked into the output, leading to subtle bugs.
71486aec45a7Smrg    if test "$solaris_use_stlport4" != yes; then
71496aec45a7Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
71506aec45a7Smrg    fi
71516aec45a7Smrg    ;;
71526aec45a7Smrg  esac
71535c42550eSmrg  ;;
71545c42550eSmrgesac
71556aec45a7Smrg])
71561473d951Smrg
71576aec45a7Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
71586aec45a7Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
71595c42550eSmrgesac
71606aec45a7Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
71616aec45a7Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
71626aec45a7Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
71636aec45a7Smrgfi
71646aec45a7Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
71656aec45a7Smrg    [The directories searched by this compiler when creating a shared library])
71666aec45a7Smrg_LT_TAGDECL([], [predep_objects], [1],
71676aec45a7Smrg    [Dependencies to place before and after the objects being linked to
71686aec45a7Smrg    create a shared library])
71696aec45a7Smrg_LT_TAGDECL([], [postdep_objects], [1])
71706aec45a7Smrg_LT_TAGDECL([], [predeps], [1])
71716aec45a7Smrg_LT_TAGDECL([], [postdeps], [1])
71726aec45a7Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
71736aec45a7Smrg    [The library search path used internally by the compiler when linking
71746aec45a7Smrg    a shared library])
71756aec45a7Smrg])# _LT_SYS_HIDDEN_LIBDEPS
71766aec45a7Smrg
71776aec45a7Smrg
71786aec45a7Smrg# _LT_LANG_F77_CONFIG([TAG])
71796aec45a7Smrg# --------------------------
71806aec45a7Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
71816aec45a7Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
71826aec45a7Smrg# to write the compiler configuration to `libtool'.
71836aec45a7Smrgm4_defun([_LT_LANG_F77_CONFIG],
71846aec45a7Smrg[AC_LANG_PUSH(Fortran 77)
71856aec45a7Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
71866aec45a7Smrg  _lt_disable_F77=yes
71876aec45a7Smrgfi
7188ab47cfaaSmrg
71896aec45a7Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
71906aec45a7Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
71916aec45a7Smrg_LT_TAGVAR(always_export_symbols, $1)=no
71926aec45a7Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
71936aec45a7Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
71946aec45a7Smrg_LT_TAGVAR(hardcode_direct, $1)=no
71956aec45a7Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
71966aec45a7Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
71976aec45a7Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
71986aec45a7Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
71996aec45a7Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
72006aec45a7Smrg_LT_TAGVAR(inherit_rpath, $1)=no
72016aec45a7Smrg_LT_TAGVAR(module_cmds, $1)=
72026aec45a7Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
72036aec45a7Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
72046aec45a7Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
72056aec45a7Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
72066aec45a7Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
72076aec45a7Smrg_LT_TAGVAR(no_undefined_flag, $1)=
72086aec45a7Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
72096aec45a7Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7210ab47cfaaSmrg
72116aec45a7Smrg# Source file extension for f77 test sources.
72126aec45a7Smrgac_ext=f
7213ab47cfaaSmrg
72146aec45a7Smrg# Object file extension for compiled f77 test sources.
72156aec45a7Smrgobjext=o
72166aec45a7Smrg_LT_TAGVAR(objext, $1)=$objext
72176aec45a7Smrg
72186aec45a7Smrg# No sense in running all these tests if we already determined that
72196aec45a7Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
72206aec45a7Smrg# are currently assumed to apply to all compilers on this platform,
72216aec45a7Smrg# and will be corrupted by setting them based on a non-working compiler.
72226aec45a7Smrgif test "$_lt_disable_F77" != yes; then
72236aec45a7Smrg  # Code to be used in simple compile tests
72246aec45a7Smrg  lt_simple_compile_test_code="\
72256aec45a7Smrg      subroutine t
72266aec45a7Smrg      return
72276aec45a7Smrg      end
72286aec45a7Smrg"
72291473d951Smrg
72306aec45a7Smrg  # Code to be used in simple link tests
72316aec45a7Smrg  lt_simple_link_test_code="\
72326aec45a7Smrg      program t
72336aec45a7Smrg      end
72346aec45a7Smrg"
72351473d951Smrg
72366aec45a7Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
72376aec45a7Smrg  _LT_TAG_COMPILER
72381473d951Smrg
72396aec45a7Smrg  # save warnings/boilerplate of simple test code
72406aec45a7Smrg  _LT_COMPILER_BOILERPLATE
72416aec45a7Smrg  _LT_LINKER_BOILERPLATE
7242ab47cfaaSmrg
72436aec45a7Smrg  # Allow CC to be a program name with arguments.
72446aec45a7Smrg  lt_save_CC="$CC"
72456aec45a7Smrg  lt_save_GCC=$GCC
7246aa9e3350Smrg  lt_save_CFLAGS=$CFLAGS
72476aec45a7Smrg  CC=${F77-"f77"}
7248aa9e3350Smrg  CFLAGS=$FFLAGS
72496aec45a7Smrg  compiler=$CC
72506aec45a7Smrg  _LT_TAGVAR(compiler, $1)=$CC
72516aec45a7Smrg  _LT_CC_BASENAME([$compiler])
72526aec45a7Smrg  GCC=$G77
72536aec45a7Smrg  if test -n "$compiler"; then
72546aec45a7Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
72556aec45a7Smrg    AC_MSG_RESULT([$can_build_shared])
72561473d951Smrg
72576aec45a7Smrg    AC_MSG_CHECKING([whether to build shared libraries])
72586aec45a7Smrg    test "$can_build_shared" = "no" && enable_shared=no
72591473d951Smrg
72606aec45a7Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
72616aec45a7Smrg    # are all built from PIC.
72626aec45a7Smrg    case $host_os in
72636aec45a7Smrg      aix3*)
72646aec45a7Smrg        test "$enable_shared" = yes && enable_static=no
72656aec45a7Smrg        if test -n "$RANLIB"; then
72666aec45a7Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
72676aec45a7Smrg          postinstall_cmds='$RANLIB $lib'
72686aec45a7Smrg        fi
72696aec45a7Smrg        ;;
72706aec45a7Smrg      aix[[4-9]]*)
72716aec45a7Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
72726aec45a7Smrg	  test "$enable_shared" = yes && enable_static=no
72736aec45a7Smrg	fi
72746aec45a7Smrg        ;;
72756aec45a7Smrg    esac
72766aec45a7Smrg    AC_MSG_RESULT([$enable_shared])
72776aec45a7Smrg
72786aec45a7Smrg    AC_MSG_CHECKING([whether to build static libraries])
72796aec45a7Smrg    # Make sure either enable_shared or enable_static is yes.
72806aec45a7Smrg    test "$enable_shared" = yes || enable_static=yes
72816aec45a7Smrg    AC_MSG_RESULT([$enable_static])
72826aec45a7Smrg
72836aec45a7Smrg    _LT_TAGVAR(GCC, $1)="$G77"
72846aec45a7Smrg    _LT_TAGVAR(LD, $1)="$LD"
72856aec45a7Smrg
72866aec45a7Smrg    ## CAVEAT EMPTOR:
72876aec45a7Smrg    ## There is no encapsulation within the following macros, do not change
72886aec45a7Smrg    ## the running order or otherwise move them around unless you know exactly
72896aec45a7Smrg    ## what you are doing...
72906aec45a7Smrg    _LT_COMPILER_PIC($1)
72916aec45a7Smrg    _LT_COMPILER_C_O($1)
72926aec45a7Smrg    _LT_COMPILER_FILE_LOCKS($1)
72936aec45a7Smrg    _LT_LINKER_SHLIBS($1)
72946aec45a7Smrg    _LT_SYS_DYNAMIC_LINKER($1)
72956aec45a7Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
72966aec45a7Smrg
72976aec45a7Smrg    _LT_CONFIG($1)
72986aec45a7Smrg  fi # test -n "$compiler"
72996aec45a7Smrg
73006aec45a7Smrg  GCC=$lt_save_GCC
73016aec45a7Smrg  CC="$lt_save_CC"
7302aa9e3350Smrg  CFLAGS="$lt_save_CFLAGS"
73036aec45a7Smrgfi # test "$_lt_disable_F77" != yes
73041473d951Smrg
73056aec45a7SmrgAC_LANG_POP
73066aec45a7Smrg])# _LT_LANG_F77_CONFIG
73071473d951Smrg
7308ab47cfaaSmrg
73096aec45a7Smrg# _LT_LANG_FC_CONFIG([TAG])
73106aec45a7Smrg# -------------------------
73116aec45a7Smrg# Ensure that the configuration variables for a Fortran compiler are
73126aec45a7Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
73136aec45a7Smrg# to write the compiler configuration to `libtool'.
73146aec45a7Smrgm4_defun([_LT_LANG_FC_CONFIG],
73156aec45a7Smrg[AC_LANG_PUSH(Fortran)
73166aec45a7Smrg
73176aec45a7Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
73186aec45a7Smrg  _lt_disable_FC=yes
73195c42550eSmrgfi
7320ab47cfaaSmrg
73216aec45a7Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
73226aec45a7Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
73236aec45a7Smrg_LT_TAGVAR(always_export_symbols, $1)=no
73246aec45a7Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
73256aec45a7Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
73266aec45a7Smrg_LT_TAGVAR(hardcode_direct, $1)=no
73276aec45a7Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
73286aec45a7Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
73296aec45a7Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
73306aec45a7Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
73316aec45a7Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
73326aec45a7Smrg_LT_TAGVAR(inherit_rpath, $1)=no
73336aec45a7Smrg_LT_TAGVAR(module_cmds, $1)=
73346aec45a7Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
73356aec45a7Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
73366aec45a7Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
73376aec45a7Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
73386aec45a7Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
73396aec45a7Smrg_LT_TAGVAR(no_undefined_flag, $1)=
73406aec45a7Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
73416aec45a7Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
73426aec45a7Smrg
73436aec45a7Smrg# Source file extension for fc test sources.
73446aec45a7Smrgac_ext=${ac_fc_srcext-f}
73456aec45a7Smrg
73466aec45a7Smrg# Object file extension for compiled fc test sources.
73476aec45a7Smrgobjext=o
73486aec45a7Smrg_LT_TAGVAR(objext, $1)=$objext
73496aec45a7Smrg
73506aec45a7Smrg# No sense in running all these tests if we already determined that
73516aec45a7Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
73526aec45a7Smrg# are currently assumed to apply to all compilers on this platform,
73536aec45a7Smrg# and will be corrupted by setting them based on a non-working compiler.
73546aec45a7Smrgif test "$_lt_disable_FC" != yes; then
73556aec45a7Smrg  # Code to be used in simple compile tests
73566aec45a7Smrg  lt_simple_compile_test_code="\
73576aec45a7Smrg      subroutine t
73586aec45a7Smrg      return
73596aec45a7Smrg      end
73606aec45a7Smrg"
7361ab47cfaaSmrg
73626aec45a7Smrg  # Code to be used in simple link tests
73636aec45a7Smrg  lt_simple_link_test_code="\
73646aec45a7Smrg      program t
73656aec45a7Smrg      end
73666aec45a7Smrg"
7367ab47cfaaSmrg
73686aec45a7Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
73696aec45a7Smrg  _LT_TAG_COMPILER
7370ab47cfaaSmrg
73716aec45a7Smrg  # save warnings/boilerplate of simple test code
73726aec45a7Smrg  _LT_COMPILER_BOILERPLATE
73736aec45a7Smrg  _LT_LINKER_BOILERPLATE
73746aec45a7Smrg
73756aec45a7Smrg  # Allow CC to be a program name with arguments.
73766aec45a7Smrg  lt_save_CC="$CC"
73776aec45a7Smrg  lt_save_GCC=$GCC
7378aa9e3350Smrg  lt_save_CFLAGS=$CFLAGS
73796aec45a7Smrg  CC=${FC-"f95"}
7380aa9e3350Smrg  CFLAGS=$FCFLAGS
73816aec45a7Smrg  compiler=$CC
73826aec45a7Smrg  GCC=$ac_cv_fc_compiler_gnu
73836aec45a7Smrg
73846aec45a7Smrg  _LT_TAGVAR(compiler, $1)=$CC
73856aec45a7Smrg  _LT_CC_BASENAME([$compiler])
73866aec45a7Smrg
73876aec45a7Smrg  if test -n "$compiler"; then
73886aec45a7Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
73896aec45a7Smrg    AC_MSG_RESULT([$can_build_shared])
73906aec45a7Smrg
73916aec45a7Smrg    AC_MSG_CHECKING([whether to build shared libraries])
73926aec45a7Smrg    test "$can_build_shared" = "no" && enable_shared=no
73936aec45a7Smrg
73946aec45a7Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
73956aec45a7Smrg    # are all built from PIC.
73965c42550eSmrg    case $host_os in
73976aec45a7Smrg      aix3*)
73986aec45a7Smrg        test "$enable_shared" = yes && enable_static=no
73996aec45a7Smrg        if test -n "$RANLIB"; then
74006aec45a7Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
74016aec45a7Smrg          postinstall_cmds='$RANLIB $lib'
74026aec45a7Smrg        fi
74036aec45a7Smrg        ;;
74045c42550eSmrg      aix[[4-9]]*)
74056aec45a7Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
74066aec45a7Smrg	  test "$enable_shared" = yes && enable_static=no
74075c42550eSmrg	fi
74086aec45a7Smrg        ;;
74095c42550eSmrg    esac
74106aec45a7Smrg    AC_MSG_RESULT([$enable_shared])
74116aec45a7Smrg
74126aec45a7Smrg    AC_MSG_CHECKING([whether to build static libraries])
74136aec45a7Smrg    # Make sure either enable_shared or enable_static is yes.
74146aec45a7Smrg    test "$enable_shared" = yes || enable_static=yes
74156aec45a7Smrg    AC_MSG_RESULT([$enable_static])
74166aec45a7Smrg
74176aec45a7Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
74186aec45a7Smrg    _LT_TAGVAR(LD, $1)="$LD"
74196aec45a7Smrg
74206aec45a7Smrg    ## CAVEAT EMPTOR:
74216aec45a7Smrg    ## There is no encapsulation within the following macros, do not change
74226aec45a7Smrg    ## the running order or otherwise move them around unless you know exactly
74236aec45a7Smrg    ## what you are doing...
74246aec45a7Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
74256aec45a7Smrg    _LT_COMPILER_PIC($1)
74266aec45a7Smrg    _LT_COMPILER_C_O($1)
74276aec45a7Smrg    _LT_COMPILER_FILE_LOCKS($1)
74286aec45a7Smrg    _LT_LINKER_SHLIBS($1)
74296aec45a7Smrg    _LT_SYS_DYNAMIC_LINKER($1)
74306aec45a7Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
74316aec45a7Smrg
74326aec45a7Smrg    _LT_CONFIG($1)
74336aec45a7Smrg  fi # test -n "$compiler"
74346aec45a7Smrg
74356aec45a7Smrg  GCC=$lt_save_GCC
7436aa9e3350Smrg  CC=$lt_save_CC
7437aa9e3350Smrg  CFLAGS=$lt_save_CFLAGS
74386aec45a7Smrgfi # test "$_lt_disable_FC" != yes
74391473d951Smrg
74406aec45a7SmrgAC_LANG_POP
74416aec45a7Smrg])# _LT_LANG_FC_CONFIG
74421473d951Smrg
74431473d951Smrg
74446aec45a7Smrg# _LT_LANG_GCJ_CONFIG([TAG])
74456aec45a7Smrg# --------------------------
74466aec45a7Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
74476aec45a7Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
74486aec45a7Smrg# to write the compiler configuration to `libtool'.
74496aec45a7Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
74506aec45a7Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
74516aec45a7SmrgAC_LANG_SAVE
74521473d951Smrg
74536aec45a7Smrg# Source file extension for Java test sources.
74546aec45a7Smrgac_ext=java
74551473d951Smrg
74566aec45a7Smrg# Object file extension for compiled Java test sources.
74576aec45a7Smrgobjext=o
74586aec45a7Smrg_LT_TAGVAR(objext, $1)=$objext
74591473d951Smrg
74606aec45a7Smrg# Code to be used in simple compile tests
74616aec45a7Smrglt_simple_compile_test_code="class foo {}"
74621473d951Smrg
74636aec45a7Smrg# Code to be used in simple link tests
74646aec45a7Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
74656aec45a7Smrg
74666aec45a7Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
74676aec45a7Smrg_LT_TAG_COMPILER
74686aec45a7Smrg
74696aec45a7Smrg# save warnings/boilerplate of simple test code
74706aec45a7Smrg_LT_COMPILER_BOILERPLATE
74716aec45a7Smrg_LT_LINKER_BOILERPLATE
74726aec45a7Smrg
74736aec45a7Smrg# Allow CC to be a program name with arguments.
7474aa9e3350Smrglt_save_CC=$CC
7475aa9e3350Smrglt_save_CFLAGS=$CFLAGS
74766aec45a7Smrglt_save_GCC=$GCC
74776aec45a7SmrgGCC=yes
74786aec45a7SmrgCC=${GCJ-"gcj"}
7479aa9e3350SmrgCFLAGS=$GCJFLAGS
74806aec45a7Smrgcompiler=$CC
74816aec45a7Smrg_LT_TAGVAR(compiler, $1)=$CC
74826aec45a7Smrg_LT_TAGVAR(LD, $1)="$LD"
74836aec45a7Smrg_LT_CC_BASENAME([$compiler])
74846aec45a7Smrg
74856aec45a7Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
74866aec45a7Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
74876aec45a7Smrg
74886aec45a7Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
74896aec45a7Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
74906aec45a7Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
74916aec45a7Smrg
74926aec45a7Smrgif test -n "$compiler"; then
74936aec45a7Smrg  _LT_COMPILER_NO_RTTI($1)
74946aec45a7Smrg  _LT_COMPILER_PIC($1)
74956aec45a7Smrg  _LT_COMPILER_C_O($1)
74966aec45a7Smrg  _LT_COMPILER_FILE_LOCKS($1)
74976aec45a7Smrg  _LT_LINKER_SHLIBS($1)
74986aec45a7Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
74996aec45a7Smrg
75006aec45a7Smrg  _LT_CONFIG($1)
75016aec45a7Smrgfi
75026aec45a7Smrg
75036aec45a7SmrgAC_LANG_RESTORE
75046aec45a7Smrg
75056aec45a7SmrgGCC=$lt_save_GCC
7506aa9e3350SmrgCC=$lt_save_CC
7507aa9e3350SmrgCFLAGS=$lt_save_CFLAGS
75086aec45a7Smrg])# _LT_LANG_GCJ_CONFIG
75096aec45a7Smrg
75106aec45a7Smrg
7511aa9e3350Smrg# _LT_LANG_GO_CONFIG([TAG])
7512aa9e3350Smrg# --------------------------
7513aa9e3350Smrg# Ensure that the configuration variables for the GNU Go compiler
7514aa9e3350Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7515aa9e3350Smrg# to write the compiler configuration to `libtool'.
7516aa9e3350Smrgm4_defun([_LT_LANG_GO_CONFIG],
7517aa9e3350Smrg[AC_REQUIRE([LT_PROG_GO])dnl
7518aa9e3350SmrgAC_LANG_SAVE
7519aa9e3350Smrg
7520aa9e3350Smrg# Source file extension for Go test sources.
7521aa9e3350Smrgac_ext=go
7522aa9e3350Smrg
7523aa9e3350Smrg# Object file extension for compiled Go test sources.
7524aa9e3350Smrgobjext=o
7525aa9e3350Smrg_LT_TAGVAR(objext, $1)=$objext
7526aa9e3350Smrg
7527aa9e3350Smrg# Code to be used in simple compile tests
7528aa9e3350Smrglt_simple_compile_test_code="package main; func main() { }"
7529aa9e3350Smrg
7530aa9e3350Smrg# Code to be used in simple link tests
7531aa9e3350Smrglt_simple_link_test_code='package main; func main() { }'
7532aa9e3350Smrg
7533aa9e3350Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7534aa9e3350Smrg_LT_TAG_COMPILER
7535aa9e3350Smrg
7536aa9e3350Smrg# save warnings/boilerplate of simple test code
7537aa9e3350Smrg_LT_COMPILER_BOILERPLATE
7538aa9e3350Smrg_LT_LINKER_BOILERPLATE
7539aa9e3350Smrg
7540aa9e3350Smrg# Allow CC to be a program name with arguments.
7541aa9e3350Smrglt_save_CC=$CC
7542aa9e3350Smrglt_save_CFLAGS=$CFLAGS
7543aa9e3350Smrglt_save_GCC=$GCC
7544aa9e3350SmrgGCC=yes
7545aa9e3350SmrgCC=${GOC-"gccgo"}
7546aa9e3350SmrgCFLAGS=$GOFLAGS
7547aa9e3350Smrgcompiler=$CC
7548aa9e3350Smrg_LT_TAGVAR(compiler, $1)=$CC
7549aa9e3350Smrg_LT_TAGVAR(LD, $1)="$LD"
7550aa9e3350Smrg_LT_CC_BASENAME([$compiler])
7551aa9e3350Smrg
7552aa9e3350Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
7553aa9e3350Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7554aa9e3350Smrg
7555aa9e3350Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7556aa9e3350Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7557aa9e3350Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7558aa9e3350Smrg
7559aa9e3350Smrgif test -n "$compiler"; then
7560aa9e3350Smrg  _LT_COMPILER_NO_RTTI($1)
7561aa9e3350Smrg  _LT_COMPILER_PIC($1)
7562aa9e3350Smrg  _LT_COMPILER_C_O($1)
7563aa9e3350Smrg  _LT_COMPILER_FILE_LOCKS($1)
7564aa9e3350Smrg  _LT_LINKER_SHLIBS($1)
7565aa9e3350Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7566aa9e3350Smrg
7567aa9e3350Smrg  _LT_CONFIG($1)
7568aa9e3350Smrgfi
7569aa9e3350Smrg
7570aa9e3350SmrgAC_LANG_RESTORE
7571aa9e3350Smrg
7572aa9e3350SmrgGCC=$lt_save_GCC
7573aa9e3350SmrgCC=$lt_save_CC
7574aa9e3350SmrgCFLAGS=$lt_save_CFLAGS
7575aa9e3350Smrg])# _LT_LANG_GO_CONFIG
7576aa9e3350Smrg
7577aa9e3350Smrg
75786aec45a7Smrg# _LT_LANG_RC_CONFIG([TAG])
75796aec45a7Smrg# -------------------------
75806aec45a7Smrg# Ensure that the configuration variables for the Windows resource compiler
75816aec45a7Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
75826aec45a7Smrg# to write the compiler configuration to `libtool'.
75836aec45a7Smrgm4_defun([_LT_LANG_RC_CONFIG],
75846aec45a7Smrg[AC_REQUIRE([LT_PROG_RC])dnl
75856aec45a7SmrgAC_LANG_SAVE
75866aec45a7Smrg
75876aec45a7Smrg# Source file extension for RC test sources.
75886aec45a7Smrgac_ext=rc
75896aec45a7Smrg
75906aec45a7Smrg# Object file extension for compiled RC test sources.
75916aec45a7Smrgobjext=o
75926aec45a7Smrg_LT_TAGVAR(objext, $1)=$objext
75936aec45a7Smrg
75946aec45a7Smrg# Code to be used in simple compile tests
75956aec45a7Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
75966aec45a7Smrg
75976aec45a7Smrg# Code to be used in simple link tests
75986aec45a7Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
75996aec45a7Smrg
76006aec45a7Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
76016aec45a7Smrg_LT_TAG_COMPILER
76026aec45a7Smrg
76036aec45a7Smrg# save warnings/boilerplate of simple test code
76046aec45a7Smrg_LT_COMPILER_BOILERPLATE
76056aec45a7Smrg_LT_LINKER_BOILERPLATE
76066aec45a7Smrg
76076aec45a7Smrg# Allow CC to be a program name with arguments.
76086aec45a7Smrglt_save_CC="$CC"
7609aa9e3350Smrglt_save_CFLAGS=$CFLAGS
76106aec45a7Smrglt_save_GCC=$GCC
76116aec45a7SmrgGCC=
76126aec45a7SmrgCC=${RC-"windres"}
7613aa9e3350SmrgCFLAGS=
76146aec45a7Smrgcompiler=$CC
76156aec45a7Smrg_LT_TAGVAR(compiler, $1)=$CC
76166aec45a7Smrg_LT_CC_BASENAME([$compiler])
76176aec45a7Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
76186aec45a7Smrg
76196aec45a7Smrgif test -n "$compiler"; then
76206aec45a7Smrg  :
76216aec45a7Smrg  _LT_CONFIG($1)
76226aec45a7Smrgfi
76236aec45a7Smrg
76246aec45a7SmrgGCC=$lt_save_GCC
76256aec45a7SmrgAC_LANG_RESTORE
7626aa9e3350SmrgCC=$lt_save_CC
7627aa9e3350SmrgCFLAGS=$lt_save_CFLAGS
76286aec45a7Smrg])# _LT_LANG_RC_CONFIG
76296aec45a7Smrg
76306aec45a7Smrg
76316aec45a7Smrg# LT_PROG_GCJ
76326aec45a7Smrg# -----------
76336aec45a7SmrgAC_DEFUN([LT_PROG_GCJ],
76346aec45a7Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
76356aec45a7Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
76366aec45a7Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
76376aec45a7Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
76386aec45a7Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
76396aec45a7Smrg])
76406aec45a7Smrg
76416aec45a7Smrg# Old name:
76426aec45a7SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
76436aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
76446aec45a7Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
76456aec45a7Smrg
76466aec45a7Smrg
7647aa9e3350Smrg# LT_PROG_GO
7648aa9e3350Smrg# ----------
7649aa9e3350SmrgAC_DEFUN([LT_PROG_GO],
7650aa9e3350Smrg[AC_CHECK_TOOL(GOC, gccgo,)
7651aa9e3350Smrg])
7652aa9e3350Smrg
7653aa9e3350Smrg
76546aec45a7Smrg# LT_PROG_RC
76556aec45a7Smrg# ----------
76566aec45a7SmrgAC_DEFUN([LT_PROG_RC],
76576aec45a7Smrg[AC_CHECK_TOOL(RC, windres,)
76586aec45a7Smrg])
76596aec45a7Smrg
76606aec45a7Smrg# Old name:
76616aec45a7SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
76626aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
76636aec45a7Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
76646aec45a7Smrg
76656aec45a7Smrg
76666aec45a7Smrg# _LT_DECL_EGREP
76676aec45a7Smrg# --------------
76686aec45a7Smrg# If we don't have a new enough Autoconf to choose the best grep
76696aec45a7Smrg# available, choose the one first in the user's PATH.
76706aec45a7Smrgm4_defun([_LT_DECL_EGREP],
76716aec45a7Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
76726aec45a7SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
76736aec45a7Smrgtest -z "$GREP" && GREP=grep
76746aec45a7Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
76756aec45a7Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
76766aec45a7Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
76776aec45a7Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
76786aec45a7SmrgAC_SUBST([GREP])
76796aec45a7Smrg])
76806aec45a7Smrg
76816aec45a7Smrg
76826aec45a7Smrg# _LT_DECL_OBJDUMP
76836aec45a7Smrg# --------------
76846aec45a7Smrg# If we don't have a new enough Autoconf to choose the best objdump
76856aec45a7Smrg# available, choose the one first in the user's PATH.
76866aec45a7Smrgm4_defun([_LT_DECL_OBJDUMP],
76876aec45a7Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
76886aec45a7Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
76896aec45a7Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
76906aec45a7SmrgAC_SUBST([OBJDUMP])
76916aec45a7Smrg])
76926aec45a7Smrg
7693aa9e3350Smrg# _LT_DECL_DLLTOOL
7694aa9e3350Smrg# ----------------
7695aa9e3350Smrg# Ensure DLLTOOL variable is set.
7696aa9e3350Smrgm4_defun([_LT_DECL_DLLTOOL],
7697aa9e3350Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
7698aa9e3350Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
7699aa9e3350Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
7700aa9e3350SmrgAC_SUBST([DLLTOOL])
7701aa9e3350Smrg])
77026aec45a7Smrg
77036aec45a7Smrg# _LT_DECL_SED
77046aec45a7Smrg# ------------
77056aec45a7Smrg# Check for a fully-functional sed program, that truncates
77066aec45a7Smrg# as few characters as possible.  Prefer GNU sed if found.
77076aec45a7Smrgm4_defun([_LT_DECL_SED],
77086aec45a7Smrg[AC_PROG_SED
77096aec45a7Smrgtest -z "$SED" && SED=sed
77106aec45a7SmrgXsed="$SED -e 1s/^X//"
77116aec45a7Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
77126aec45a7Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
77136aec45a7Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
77146aec45a7Smrg])# _LT_DECL_SED
77156aec45a7Smrg
77166aec45a7Smrgm4_ifndef([AC_PROG_SED], [
77176aec45a7Smrg# NOTE: This macro has been submitted for inclusion into   #
77186aec45a7Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
77196aec45a7Smrg#  a released version of Autoconf we should remove this    #
77206aec45a7Smrg#  macro and use it instead.                               #
77216aec45a7Smrg
77226aec45a7Smrgm4_defun([AC_PROG_SED],
77236aec45a7Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
77246aec45a7SmrgAC_CACHE_VAL(lt_cv_path_SED,
77256aec45a7Smrg[# Loop through the user's path and test for sed and gsed.
77266aec45a7Smrg# Then use that list of sed's as ones to test for truncation.
77276aec45a7Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
77286aec45a7Smrgfor as_dir in $PATH
77296aec45a7Smrgdo
77306aec45a7Smrg  IFS=$as_save_IFS
77316aec45a7Smrg  test -z "$as_dir" && as_dir=.
77326aec45a7Smrg  for lt_ac_prog in sed gsed; do
77336aec45a7Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
77346aec45a7Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
77356aec45a7Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
77366aec45a7Smrg      fi
77376aec45a7Smrg    done
77386aec45a7Smrg  done
77396aec45a7Smrgdone
77406aec45a7SmrgIFS=$as_save_IFS
77416aec45a7Smrglt_ac_max=0
77426aec45a7Smrglt_ac_count=0
77436aec45a7Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
77446aec45a7Smrg# along with /bin/sed that truncates output.
77456aec45a7Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
77466aec45a7Smrg  test ! -f $lt_ac_sed && continue
77476aec45a7Smrg  cat /dev/null > conftest.in
77486aec45a7Smrg  lt_ac_count=0
77496aec45a7Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
77506aec45a7Smrg  # Check for GNU sed and select it if it is found.
77516aec45a7Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
77526aec45a7Smrg    lt_cv_path_SED=$lt_ac_sed
77536aec45a7Smrg    break
77546aec45a7Smrg  fi
77556aec45a7Smrg  while true; do
77566aec45a7Smrg    cat conftest.in conftest.in >conftest.tmp
77576aec45a7Smrg    mv conftest.tmp conftest.in
77586aec45a7Smrg    cp conftest.in conftest.nl
77596aec45a7Smrg    echo >>conftest.nl
77606aec45a7Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
77616aec45a7Smrg    cmp -s conftest.out conftest.nl || break
77626aec45a7Smrg    # 10000 chars as input seems more than enough
77636aec45a7Smrg    test $lt_ac_count -gt 10 && break
77646aec45a7Smrg    lt_ac_count=`expr $lt_ac_count + 1`
77656aec45a7Smrg    if test $lt_ac_count -gt $lt_ac_max; then
77666aec45a7Smrg      lt_ac_max=$lt_ac_count
77676aec45a7Smrg      lt_cv_path_SED=$lt_ac_sed
77686aec45a7Smrg    fi
77696aec45a7Smrg  done
77706aec45a7Smrgdone
77716aec45a7Smrg])
77726aec45a7SmrgSED=$lt_cv_path_SED
77736aec45a7SmrgAC_SUBST([SED])
77746aec45a7SmrgAC_MSG_RESULT([$SED])
77756aec45a7Smrg])#AC_PROG_SED
77766aec45a7Smrg])#m4_ifndef
77771473d951Smrg
77786aec45a7Smrg# Old name:
77796aec45a7SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
77806aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
77816aec45a7Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
77821473d951Smrg
77831473d951Smrg
77846aec45a7Smrg# _LT_CHECK_SHELL_FEATURES
77856aec45a7Smrg# ------------------------
77866aec45a7Smrg# Find out whether the shell is Bourne or XSI compatible,
77876aec45a7Smrg# or has some other useful features.
77886aec45a7Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
77896aec45a7Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
77906aec45a7Smrg# Try some XSI features
77916aec45a7Smrgxsi_shell=no
77926aec45a7Smrg( _lt_dummy="a/b/c"
7793aa9e3350Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
7794aa9e3350Smrg      = c,a/b,b/c, \
77956aec45a7Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
77966aec45a7Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
77976aec45a7Smrg  && xsi_shell=yes
77986aec45a7SmrgAC_MSG_RESULT([$xsi_shell])
77996aec45a7Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
78006aec45a7Smrg
78016aec45a7SmrgAC_MSG_CHECKING([whether the shell understands "+="])
78026aec45a7Smrglt_shell_append=no
78036aec45a7Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
78046aec45a7Smrg    >/dev/null 2>&1 \
78056aec45a7Smrg  && lt_shell_append=yes
78066aec45a7SmrgAC_MSG_RESULT([$lt_shell_append])
78076aec45a7Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
78086aec45a7Smrg
78096aec45a7Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
78106aec45a7Smrg  lt_unset=unset
78116aec45a7Smrgelse
78126aec45a7Smrg  lt_unset=false
78136aec45a7Smrgfi
78146aec45a7Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
78156aec45a7Smrg
78166aec45a7Smrg# test EBCDIC or ASCII
78176aec45a7Smrgcase `echo X|tr X '\101'` in
78186aec45a7Smrg A) # ASCII based system
78196aec45a7Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
78206aec45a7Smrg  lt_SP2NL='tr \040 \012'
78216aec45a7Smrg  lt_NL2SP='tr \015\012 \040\040'
78226aec45a7Smrg  ;;
78236aec45a7Smrg *) # EBCDIC based system
78246aec45a7Smrg  lt_SP2NL='tr \100 \n'
78256aec45a7Smrg  lt_NL2SP='tr \r\n \100\100'
78266aec45a7Smrg  ;;
78276aec45a7Smrgesac
78286aec45a7Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
78296aec45a7Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
78306aec45a7Smrg])# _LT_CHECK_SHELL_FEATURES
78311473d951Smrg
78321473d951Smrg
7833aa9e3350Smrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
7834aa9e3350Smrg# ------------------------------------------------------
7835aa9e3350Smrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
7836aa9e3350Smrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
7837aa9e3350Smrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
7838aa9e3350Smrg[dnl {
7839aa9e3350Smrgsed -e '/^$1 ()$/,/^} # $1 /c\
7840aa9e3350Smrg$1 ()\
7841aa9e3350Smrg{\
7842aa9e3350Smrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
7843aa9e3350Smrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
7844aa9e3350Smrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
7845aa9e3350Smrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7846aa9e3350Smrgtest 0 -eq $? || _lt_function_replace_fail=:
7847aa9e3350Smrg])
7848ab47cfaaSmrg
7849ab47cfaaSmrg
7850aa9e3350Smrg# _LT_PROG_REPLACE_SHELLFNS
7851aa9e3350Smrg# -------------------------
7852aa9e3350Smrg# Replace existing portable implementations of several shell functions with
7853aa9e3350Smrg# equivalent extended shell implementations where those features are available..
7854aa9e3350Smrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
7855aa9e3350Smrg[if test x"$xsi_shell" = xyes; then
7856aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
7857aa9e3350Smrg    case ${1} in
7858aa9e3350Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
7859aa9e3350Smrg      *  ) func_dirname_result="${3}" ;;
7860aa9e3350Smrg    esac])
7861aa9e3350Smrg
7862aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
7863aa9e3350Smrg    func_basename_result="${1##*/}"])
7864aa9e3350Smrg
7865aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
7866aa9e3350Smrg    case ${1} in
7867aa9e3350Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
7868aa9e3350Smrg      *  ) func_dirname_result="${3}" ;;
7869aa9e3350Smrg    esac
7870aa9e3350Smrg    func_basename_result="${1##*/}"])
7871ab47cfaaSmrg
7872aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
7873aa9e3350Smrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7874aa9e3350Smrg    # positional parameters, so assign one to ordinary parameter first.
7875aa9e3350Smrg    func_stripname_result=${3}
7876aa9e3350Smrg    func_stripname_result=${func_stripname_result#"${1}"}
7877aa9e3350Smrg    func_stripname_result=${func_stripname_result%"${2}"}])
7878ab47cfaaSmrg
7879aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
7880aa9e3350Smrg    func_split_long_opt_name=${1%%=*}
7881aa9e3350Smrg    func_split_long_opt_arg=${1#*=}])
7882ab47cfaaSmrg
7883aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
7884aa9e3350Smrg    func_split_short_opt_arg=${1#??}
7885aa9e3350Smrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
78866aec45a7Smrg
7887aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
7888aa9e3350Smrg    case ${1} in
7889aa9e3350Smrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7890aa9e3350Smrg      *)    func_lo2o_result=${1} ;;
7891aa9e3350Smrg    esac])
7892ab47cfaaSmrg
7893aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
7894ab47cfaaSmrg
7895aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
7896ab47cfaaSmrg
7897aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
7898aa9e3350Smrgfi
78995c42550eSmrg
7900aa9e3350Smrgif test x"$lt_shell_append" = xyes; then
7901aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
7902ab47cfaaSmrg
7903aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
7904aa9e3350Smrg    func_quote_for_eval "${2}"
7905aa9e3350Smrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
7906aa9e3350Smrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
79075c42550eSmrg
7908aa9e3350Smrg  # Save a `func_append' function call where possible by direct use of '+='
7909aa9e3350Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
7910aa9e3350Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
7911aa9e3350Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7912aa9e3350Smrg  test 0 -eq $? || _lt_function_replace_fail=:
7913aa9e3350Smrgelse
7914aa9e3350Smrg  # Save a `func_append' function call even when '+=' is not available
7915aa9e3350Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
7916aa9e3350Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
7917aa9e3350Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7918aa9e3350Smrg  test 0 -eq $? || _lt_function_replace_fail=:
7919aa9e3350Smrgfi
79205c42550eSmrg
7921aa9e3350Smrgif test x"$_lt_function_replace_fail" = x":"; then
7922aa9e3350Smrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
7923aa9e3350Smrgfi
7924aa9e3350Smrg])
79255c42550eSmrg
7926aa9e3350Smrg# _LT_PATH_CONVERSION_FUNCTIONS
7927aa9e3350Smrg# -----------------------------
7928aa9e3350Smrg# Determine which file name conversion functions should be used by
7929aa9e3350Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
7930aa9e3350Smrg# for certain cross-compile configurations and native mingw.
7931aa9e3350Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
7932aa9e3350Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7933aa9e3350SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
7934aa9e3350SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
7935aa9e3350SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
7936aa9e3350Smrg[case $host in
7937aa9e3350Smrg  *-*-mingw* )
7938aa9e3350Smrg    case $build in
7939aa9e3350Smrg      *-*-mingw* ) # actually msys
7940aa9e3350Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
7941aa9e3350Smrg        ;;
7942aa9e3350Smrg      *-*-cygwin* )
7943aa9e3350Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
7944aa9e3350Smrg        ;;
7945aa9e3350Smrg      * ) # otherwise, assume *nix
7946aa9e3350Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
7947aa9e3350Smrg        ;;
7948aa9e3350Smrg    esac
79496aec45a7Smrg    ;;
7950aa9e3350Smrg  *-*-cygwin* )
7951aa9e3350Smrg    case $build in
7952aa9e3350Smrg      *-*-mingw* ) # actually msys
7953aa9e3350Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
7954aa9e3350Smrg        ;;
7955aa9e3350Smrg      *-*-cygwin* )
7956aa9e3350Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
7957aa9e3350Smrg        ;;
7958aa9e3350Smrg      * ) # otherwise, assume *nix
7959aa9e3350Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
7960aa9e3350Smrg        ;;
7961aa9e3350Smrg    esac
79626aec45a7Smrg    ;;
7963aa9e3350Smrg  * ) # unhandled hosts (and "normal" native builds)
7964aa9e3350Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
7965aa9e3350Smrg    ;;
7966aa9e3350Smrgesac
79676aec45a7Smrg])
7968aa9e3350Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
7969aa9e3350SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
7970aa9e3350Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
7971aa9e3350Smrg         [0], [convert $build file names to $host format])dnl
7972aa9e3350Smrg
7973aa9e3350SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
7974aa9e3350SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
7975aa9e3350Smrg[#assume ordinary cross tools, or native build.
7976aa9e3350Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
7977aa9e3350Smrgcase $host in
7978aa9e3350Smrg  *-*-mingw* )
7979aa9e3350Smrg    case $build in
7980aa9e3350Smrg      *-*-mingw* ) # actually msys
7981aa9e3350Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
7982aa9e3350Smrg        ;;
7983aa9e3350Smrg    esac
7984aa9e3350Smrg    ;;
7985aa9e3350Smrgesac
7986aa9e3350Smrg])
7987aa9e3350Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
7988aa9e3350SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
7989aa9e3350Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
7990aa9e3350Smrg         [0], [convert $build files to toolchain format])dnl
7991aa9e3350Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
7992ab47cfaaSmrg
79936aec45a7Smrg# Helper functions for option handling.                    -*- Autoconf -*-
79946aec45a7Smrg#
79956aec45a7Smrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
79966aec45a7Smrg#   Inc.
79976aec45a7Smrg#   Written by Gary V. Vaughan, 2004
79986aec45a7Smrg#
79996aec45a7Smrg# This file is free software; the Free Software Foundation gives
80006aec45a7Smrg# unlimited permission to copy and/or distribute it, with or without
80016aec45a7Smrg# modifications, as long as this notice is preserved.
8002ab47cfaaSmrg
80036aec45a7Smrg# serial 7 ltoptions.m4
8004ab47cfaaSmrg
80056aec45a7Smrg# This is to help aclocal find these macros, as it can't see m4_define.
80066aec45a7SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8007ab47cfaaSmrg
8008ab47cfaaSmrg
80096aec45a7Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
80106aec45a7Smrg# ------------------------------------------
80116aec45a7Smrgm4_define([_LT_MANGLE_OPTION],
80126aec45a7Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8013ab47cfaaSmrg
8014ab47cfaaSmrg
80156aec45a7Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
80166aec45a7Smrg# ---------------------------------------
80176aec45a7Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
80186aec45a7Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
80196aec45a7Smrg# saved as a flag.
80206aec45a7Smrgm4_define([_LT_SET_OPTION],
80216aec45a7Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
80226aec45a7Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
80236aec45a7Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
80246aec45a7Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
80256aec45a7Smrg])
8026ab47cfaaSmrg
8027ab47cfaaSmrg
80286aec45a7Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
80296aec45a7Smrg# ------------------------------------------------------------
80306aec45a7Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
80316aec45a7Smrgm4_define([_LT_IF_OPTION],
80326aec45a7Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
80336aec45a7Smrg
80346aec45a7Smrg
80356aec45a7Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
80366aec45a7Smrg# -------------------------------------------------------
80376aec45a7Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
80386aec45a7Smrg# are set.
80396aec45a7Smrgm4_define([_LT_UNLESS_OPTIONS],
80406aec45a7Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
80416aec45a7Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
80426aec45a7Smrg		      [m4_define([$0_found])])])[]dnl
80436aec45a7Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
80446aec45a7Smrg])[]dnl
80456aec45a7Smrg])
8046ab47cfaaSmrg
8047ab47cfaaSmrg
80486aec45a7Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
80496aec45a7Smrg# ----------------------------------------
80506aec45a7Smrg# OPTION-LIST is a space-separated list of Libtool options associated
80516aec45a7Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
80526aec45a7Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
80536aec45a7Smrg# the unknown option and exit.
80546aec45a7Smrgm4_defun([_LT_SET_OPTIONS],
80556aec45a7Smrg[# Set options
80566aec45a7Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
80576aec45a7Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
80586aec45a7Smrg
80596aec45a7Smrgm4_if([$1],[LT_INIT],[
80606aec45a7Smrg  dnl
80616aec45a7Smrg  dnl Simply set some default values (i.e off) if boolean options were not
80626aec45a7Smrg  dnl specified:
80636aec45a7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
80646aec45a7Smrg  ])
80656aec45a7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
80666aec45a7Smrg  ])
80676aec45a7Smrg  dnl
80686aec45a7Smrg  dnl If no reference was made to various pairs of opposing options, then
80696aec45a7Smrg  dnl we run the default mode handler for the pair.  For example, if neither
80706aec45a7Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
80716aec45a7Smrg  dnl archives by default:
80726aec45a7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
80736aec45a7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
80746aec45a7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
80756aec45a7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
80766aec45a7Smrg  		   [_LT_ENABLE_FAST_INSTALL])
80776aec45a7Smrg  ])
80786aec45a7Smrg])# _LT_SET_OPTIONS
8079ab47cfaaSmrg
8080ab47cfaaSmrg
8081ab47cfaaSmrg
80826aec45a7Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
80836aec45a7Smrg# -----------------------------------------
80846aec45a7Smrgm4_define([_LT_MANGLE_DEFUN],
80856aec45a7Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8086ab47cfaaSmrg
80871473d951Smrg
80886aec45a7Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
80896aec45a7Smrg# -----------------------------------------------
80906aec45a7Smrgm4_define([LT_OPTION_DEFINE],
80916aec45a7Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
80926aec45a7Smrg])# LT_OPTION_DEFINE
80931473d951Smrg
80941473d951Smrg
80956aec45a7Smrg# dlopen
80966aec45a7Smrg# ------
80976aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
80986aec45a7Smrg])
80991473d951Smrg
81006aec45a7SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
81016aec45a7Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
81026aec45a7SmrgAC_DIAGNOSE([obsolete],
81036aec45a7Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
81046aec45a7Smrgput the `dlopen' option into LT_INIT's first parameter.])
81056aec45a7Smrg])
8106ab47cfaaSmrg
81076aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
81086aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8109ab47cfaaSmrg
8110ab47cfaaSmrg
81116aec45a7Smrg# win32-dll
81126aec45a7Smrg# ---------
81136aec45a7Smrg# Declare package support for building win32 dll's.
81146aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
81156aec45a7Smrg[enable_win32_dll=yes
8116ab47cfaaSmrg
81176aec45a7Smrgcase $host in
81186aec45a7Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
81196aec45a7Smrg  AC_CHECK_TOOL(AS, as, false)
81206aec45a7Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
81216aec45a7Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
81226aec45a7Smrg  ;;
81236aec45a7Smrgesac
8124ab47cfaaSmrg
81256aec45a7Smrgtest -z "$AS" && AS=as
81266aec45a7Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
8127ab47cfaaSmrg
81286aec45a7Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
81296aec45a7Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
8130ab47cfaaSmrg
81316aec45a7Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
81326aec45a7Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
81336aec45a7Smrg])# win32-dll
8134ab47cfaaSmrg
81356aec45a7SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
81366aec45a7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
81376aec45a7Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
81386aec45a7SmrgAC_DIAGNOSE([obsolete],
81396aec45a7Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
81406aec45a7Smrgput the `win32-dll' option into LT_INIT's first parameter.])
81416aec45a7Smrg])
8142ab47cfaaSmrg
81436aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
81446aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8145ab47cfaaSmrg
8146ab47cfaaSmrg
81476aec45a7Smrg# _LT_ENABLE_SHARED([DEFAULT])
81486aec45a7Smrg# ----------------------------
81496aec45a7Smrg# implement the --enable-shared flag, and supports the `shared' and
81506aec45a7Smrg# `disable-shared' LT_INIT options.
81516aec45a7Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
81526aec45a7Smrgm4_define([_LT_ENABLE_SHARED],
81536aec45a7Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
81546aec45a7SmrgAC_ARG_ENABLE([shared],
81556aec45a7Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
81566aec45a7Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
81576aec45a7Smrg    [p=${PACKAGE-default}
81586aec45a7Smrg    case $enableval in
81596aec45a7Smrg    yes) enable_shared=yes ;;
81606aec45a7Smrg    no) enable_shared=no ;;
81616aec45a7Smrg    *)
81626aec45a7Smrg      enable_shared=no
81636aec45a7Smrg      # Look at the argument we got.  We use all the common list separators.
81646aec45a7Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
81656aec45a7Smrg      for pkg in $enableval; do
81666aec45a7Smrg	IFS="$lt_save_ifs"
81676aec45a7Smrg	if test "X$pkg" = "X$p"; then
81686aec45a7Smrg	  enable_shared=yes
81696aec45a7Smrg	fi
81706aec45a7Smrg      done
81716aec45a7Smrg      IFS="$lt_save_ifs"
81725c42550eSmrg      ;;
81736aec45a7Smrg    esac],
81746aec45a7Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8175ab47cfaaSmrg
81766aec45a7Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
81776aec45a7Smrg	[Whether or not to build shared libraries])
81786aec45a7Smrg])# _LT_ENABLE_SHARED
8179ab47cfaaSmrg
81806aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
81816aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8182ab47cfaaSmrg
81836aec45a7Smrg# Old names:
81846aec45a7SmrgAC_DEFUN([AC_ENABLE_SHARED],
81856aec45a7Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
81866aec45a7Smrg])
8187ab47cfaaSmrg
81886aec45a7SmrgAC_DEFUN([AC_DISABLE_SHARED],
81896aec45a7Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
81906aec45a7Smrg])
8191ab47cfaaSmrg
81926aec45a7SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
81936aec45a7SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8194ab47cfaaSmrg
81956aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
81966aec45a7Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
81976aec45a7Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8198ab47cfaaSmrg
8199ab47cfaaSmrg
8200ab47cfaaSmrg
82016aec45a7Smrg# _LT_ENABLE_STATIC([DEFAULT])
82026aec45a7Smrg# ----------------------------
82036aec45a7Smrg# implement the --enable-static flag, and support the `static' and
82046aec45a7Smrg# `disable-static' LT_INIT options.
82056aec45a7Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
82066aec45a7Smrgm4_define([_LT_ENABLE_STATIC],
82076aec45a7Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
82086aec45a7SmrgAC_ARG_ENABLE([static],
82096aec45a7Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
82106aec45a7Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
82116aec45a7Smrg    [p=${PACKAGE-default}
82126aec45a7Smrg    case $enableval in
82136aec45a7Smrg    yes) enable_static=yes ;;
82146aec45a7Smrg    no) enable_static=no ;;
82156aec45a7Smrg    *)
82166aec45a7Smrg     enable_static=no
82176aec45a7Smrg      # Look at the argument we got.  We use all the common list separators.
82186aec45a7Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
82196aec45a7Smrg      for pkg in $enableval; do
82206aec45a7Smrg	IFS="$lt_save_ifs"
82216aec45a7Smrg	if test "X$pkg" = "X$p"; then
82226aec45a7Smrg	  enable_static=yes
82236aec45a7Smrg	fi
82246aec45a7Smrg      done
82256aec45a7Smrg      IFS="$lt_save_ifs"
82265c42550eSmrg      ;;
82276aec45a7Smrg    esac],
82286aec45a7Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8229ab47cfaaSmrg
82306aec45a7Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
82316aec45a7Smrg	[Whether or not to build static libraries])
82326aec45a7Smrg])# _LT_ENABLE_STATIC
8233ab47cfaaSmrg
82346aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
82356aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8236ab47cfaaSmrg
82376aec45a7Smrg# Old names:
82386aec45a7SmrgAC_DEFUN([AC_ENABLE_STATIC],
82396aec45a7Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
82406aec45a7Smrg])
82411473d951Smrg
82426aec45a7SmrgAC_DEFUN([AC_DISABLE_STATIC],
82436aec45a7Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
82446aec45a7Smrg])
8245ab47cfaaSmrg
82466aec45a7SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
82476aec45a7SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8248ab47cfaaSmrg
82496aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
82506aec45a7Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
82516aec45a7Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8252ab47cfaaSmrg
8253ab47cfaaSmrg
8254ab47cfaaSmrg
82556aec45a7Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
82566aec45a7Smrg# ----------------------------------
82576aec45a7Smrg# implement the --enable-fast-install flag, and support the `fast-install'
82586aec45a7Smrg# and `disable-fast-install' LT_INIT options.
82596aec45a7Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
82606aec45a7Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
82616aec45a7Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
82626aec45a7SmrgAC_ARG_ENABLE([fast-install],
82636aec45a7Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
82646aec45a7Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
82656aec45a7Smrg    [p=${PACKAGE-default}
82666aec45a7Smrg    case $enableval in
82676aec45a7Smrg    yes) enable_fast_install=yes ;;
82686aec45a7Smrg    no) enable_fast_install=no ;;
82696aec45a7Smrg    *)
82706aec45a7Smrg      enable_fast_install=no
82716aec45a7Smrg      # Look at the argument we got.  We use all the common list separators.
82726aec45a7Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
82736aec45a7Smrg      for pkg in $enableval; do
82746aec45a7Smrg	IFS="$lt_save_ifs"
82756aec45a7Smrg	if test "X$pkg" = "X$p"; then
82766aec45a7Smrg	  enable_fast_install=yes
82775c42550eSmrg	fi
82786aec45a7Smrg      done
82796aec45a7Smrg      IFS="$lt_save_ifs"
82805c42550eSmrg      ;;
82816aec45a7Smrg    esac],
82826aec45a7Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8283ab47cfaaSmrg
82846aec45a7Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
82856aec45a7Smrg	 [Whether or not to optimize for fast installation])dnl
82866aec45a7Smrg])# _LT_ENABLE_FAST_INSTALL
8287ab47cfaaSmrg
82886aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
82896aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8290ab47cfaaSmrg
82916aec45a7Smrg# Old names:
82926aec45a7SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
82936aec45a7Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
82946aec45a7SmrgAC_DIAGNOSE([obsolete],
82956aec45a7Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
82966aec45a7Smrgthe `fast-install' option into LT_INIT's first parameter.])
82976aec45a7Smrg])
8298ab47cfaaSmrg
82996aec45a7SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
83006aec45a7Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
83016aec45a7SmrgAC_DIAGNOSE([obsolete],
83026aec45a7Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
83036aec45a7Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
83046aec45a7Smrg])
8305ab47cfaaSmrg
83066aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
83076aec45a7Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
83086aec45a7Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
83091473d951Smrg
8310ab47cfaaSmrg
83116aec45a7Smrg# _LT_WITH_PIC([MODE])
83126aec45a7Smrg# --------------------
83136aec45a7Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
83146aec45a7Smrg# LT_INIT options.
83156aec45a7Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
83166aec45a7Smrgm4_define([_LT_WITH_PIC],
83176aec45a7Smrg[AC_ARG_WITH([pic],
8318aa9e3350Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
83196aec45a7Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
8320aa9e3350Smrg    [lt_p=${PACKAGE-default}
8321aa9e3350Smrg    case $withval in
8322aa9e3350Smrg    yes|no) pic_mode=$withval ;;
8323aa9e3350Smrg    *)
8324aa9e3350Smrg      pic_mode=default
8325aa9e3350Smrg      # Look at the argument we got.  We use all the common list separators.
8326aa9e3350Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8327aa9e3350Smrg      for lt_pkg in $withval; do
8328aa9e3350Smrg	IFS="$lt_save_ifs"
8329aa9e3350Smrg	if test "X$lt_pkg" = "X$lt_p"; then
8330aa9e3350Smrg	  pic_mode=yes
8331aa9e3350Smrg	fi
8332aa9e3350Smrg      done
8333aa9e3350Smrg      IFS="$lt_save_ifs"
8334aa9e3350Smrg      ;;
8335aa9e3350Smrg    esac],
83366aec45a7Smrg    [pic_mode=default])
8337ab47cfaaSmrg
83386aec45a7Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
8339ab47cfaaSmrg
83406aec45a7Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
83416aec45a7Smrg])# _LT_WITH_PIC
8342ab47cfaaSmrg
83436aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
83446aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
83456aec45a7Smrg
83466aec45a7Smrg# Old name:
83476aec45a7SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
83486aec45a7Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
83496aec45a7SmrgAC_DIAGNOSE([obsolete],
83506aec45a7Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
83516aec45a7Smrgput the `pic-only' option into LT_INIT's first parameter.])
83525c42550eSmrg])
8353ab47cfaaSmrg
83546aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
83556aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
83561473d951Smrg
83571473d951Smrg
83586aec45a7Smrgm4_define([_LTDL_MODE], [])
83596aec45a7SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
83606aec45a7Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
83616aec45a7SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
83626aec45a7Smrg		 [m4_define([_LTDL_MODE], [recursive])])
83636aec45a7SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
83646aec45a7Smrg		 [m4_define([_LTDL_MODE], [subproject])])
83651473d951Smrg
83666aec45a7Smrgm4_define([_LTDL_TYPE], [])
83676aec45a7SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
83686aec45a7Smrg		 [m4_define([_LTDL_TYPE], [installable])])
83696aec45a7SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
83706aec45a7Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
83716aec45a7Smrg
83726aec45a7Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
83735c42550eSmrg#
83746aec45a7Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
83756aec45a7Smrg# Written by Gary V. Vaughan, 2004
83765c42550eSmrg#
83776aec45a7Smrg# This file is free software; the Free Software Foundation gives
83786aec45a7Smrg# unlimited permission to copy and/or distribute it, with or without
83796aec45a7Smrg# modifications, as long as this notice is preserved.
83806aec45a7Smrg
83816aec45a7Smrg# serial 6 ltsugar.m4
83826aec45a7Smrg
83836aec45a7Smrg# This is to help aclocal find these macros, as it can't see m4_define.
83846aec45a7SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
83856aec45a7Smrg
83866aec45a7Smrg
83876aec45a7Smrg# lt_join(SEP, ARG1, [ARG2...])
83886aec45a7Smrg# -----------------------------
83896aec45a7Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
83906aec45a7Smrg# associated separator.
83916aec45a7Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
83926aec45a7Smrg# versions in m4sugar had bugs.
83936aec45a7Smrgm4_define([lt_join],
83946aec45a7Smrg[m4_if([$#], [1], [],
83956aec45a7Smrg       [$#], [2], [[$2]],
83966aec45a7Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
83976aec45a7Smrgm4_define([_lt_join],
83986aec45a7Smrg[m4_if([$#$2], [2], [],
83996aec45a7Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
84006aec45a7Smrg
84016aec45a7Smrg
84026aec45a7Smrg# lt_car(LIST)
84036aec45a7Smrg# lt_cdr(LIST)
84046aec45a7Smrg# ------------
84056aec45a7Smrg# Manipulate m4 lists.
84066aec45a7Smrg# These macros are necessary as long as will still need to support
84076aec45a7Smrg# Autoconf-2.59 which quotes differently.
84086aec45a7Smrgm4_define([lt_car], [[$1]])
84096aec45a7Smrgm4_define([lt_cdr],
84106aec45a7Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
84116aec45a7Smrg       [$#], 1, [],
84126aec45a7Smrg       [m4_dquote(m4_shift($@))])])
84136aec45a7Smrgm4_define([lt_unquote], $1)
84146aec45a7Smrg
84156aec45a7Smrg
84166aec45a7Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
84176aec45a7Smrg# ------------------------------------------
84186aec45a7Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
84196aec45a7Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
84206aec45a7Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
84216aec45a7Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
84226aec45a7Smrg# than defined and empty).
84235c42550eSmrg#
84246aec45a7Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
84256aec45a7Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
84266aec45a7Smrgm4_define([lt_append],
84276aec45a7Smrg[m4_define([$1],
84286aec45a7Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
84296aec45a7Smrg
84306aec45a7Smrg
84316aec45a7Smrg
84326aec45a7Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
84336aec45a7Smrg# ----------------------------------------------------------
84346aec45a7Smrg# Produce a SEP delimited list of all paired combinations of elements of
84356aec45a7Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
84366aec45a7Smrg# has the form PREFIXmINFIXSUFFIXn.
84376aec45a7Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
84386aec45a7Smrgm4_define([lt_combine],
84396aec45a7Smrg[m4_if(m4_eval([$# > 3]), [1],
84406aec45a7Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
84416aec45a7Smrg[[m4_foreach([_Lt_prefix], [$2],
84426aec45a7Smrg	     [m4_foreach([_Lt_suffix],
84436aec45a7Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
84446aec45a7Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
84456aec45a7Smrg
84466aec45a7Smrg
84476aec45a7Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
84486aec45a7Smrg# -----------------------------------------------------------------------
84496aec45a7Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
84506aec45a7Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
84516aec45a7Smrgm4_define([lt_if_append_uniq],
84526aec45a7Smrg[m4_ifdef([$1],
84536aec45a7Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
84546aec45a7Smrg		 [lt_append([$1], [$2], [$3])$4],
84556aec45a7Smrg		 [$5])],
84566aec45a7Smrg	  [lt_append([$1], [$2], [$3])$4])])
84576aec45a7Smrg
84586aec45a7Smrg
84596aec45a7Smrg# lt_dict_add(DICT, KEY, VALUE)
84606aec45a7Smrg# -----------------------------
84616aec45a7Smrgm4_define([lt_dict_add],
84626aec45a7Smrg[m4_define([$1($2)], [$3])])
8463ab47cfaaSmrg
84641473d951Smrg
84656aec45a7Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
84666aec45a7Smrg# --------------------------------------------
84676aec45a7Smrgm4_define([lt_dict_add_subkey],
84686aec45a7Smrg[m4_define([$1($2:$3)], [$4])])
8469ab47cfaaSmrg
8470ab47cfaaSmrg
84716aec45a7Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
84726aec45a7Smrg# ----------------------------------
84736aec45a7Smrgm4_define([lt_dict_fetch],
84746aec45a7Smrg[m4_ifval([$3],
84756aec45a7Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
84766aec45a7Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8477ab47cfaaSmrg
8478ab47cfaaSmrg
84796aec45a7Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
84806aec45a7Smrg# -----------------------------------------------------------------
84816aec45a7Smrgm4_define([lt_if_dict_fetch],
84826aec45a7Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
84836aec45a7Smrg	[$5],
84846aec45a7Smrg    [$6])])
8485ab47cfaaSmrg
8486ab47cfaaSmrg
84876aec45a7Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
84886aec45a7Smrg# --------------------------------------------------------------
84896aec45a7Smrgm4_define([lt_dict_filter],
84906aec45a7Smrg[m4_if([$5], [], [],
84916aec45a7Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
84926aec45a7Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
84936aec45a7Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
84946aec45a7Smrg])
84958697ee19Smrg
84966aec45a7Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
84976aec45a7Smrg#
84986aec45a7Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
84996aec45a7Smrg#   Written by Scott James Remnant, 2004
85006aec45a7Smrg#
85016aec45a7Smrg# This file is free software; the Free Software Foundation gives
85026aec45a7Smrg# unlimited permission to copy and/or distribute it, with or without
85036aec45a7Smrg# modifications, as long as this notice is preserved.
85048697ee19Smrg
8505aa9e3350Smrg# @configure_input@
85068697ee19Smrg
8507aa9e3350Smrg# serial 3337 ltversion.m4
85086aec45a7Smrg# This file is part of GNU Libtool
85098697ee19Smrg
8510aa9e3350Smrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
8511aa9e3350Smrgm4_define([LT_PACKAGE_REVISION], [1.3337])
85126aec45a7Smrg
85136aec45a7SmrgAC_DEFUN([LTVERSION_VERSION],
8514aa9e3350Smrg[macro_version='2.4.2'
8515aa9e3350Smrgmacro_revision='1.3337'
85166aec45a7Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
85176aec45a7Smrg_LT_DECL(, macro_revision, 0)
8518ab47cfaaSmrg])
85191473d951Smrg
85206aec45a7Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
85216aec45a7Smrg#
85226aec45a7Smrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
85236aec45a7Smrg#   Written by Scott James Remnant, 2004.
85246aec45a7Smrg#
85256aec45a7Smrg# This file is free software; the Free Software Foundation gives
85266aec45a7Smrg# unlimited permission to copy and/or distribute it, with or without
85276aec45a7Smrg# modifications, as long as this notice is preserved.
85286aec45a7Smrg
85296aec45a7Smrg# serial 5 lt~obsolete.m4
85306aec45a7Smrg
85316aec45a7Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
85326aec45a7Smrg#
85336aec45a7Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
85346aec45a7Smrg# which have later been changed to m4_define as they aren't part of the
85356aec45a7Smrg# exported API, or moved to Autoconf or Automake where they belong.
85366aec45a7Smrg#
85376aec45a7Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
85386aec45a7Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
85396aec45a7Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
85406aec45a7Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
85416aec45a7Smrg# and doesn't know about Autoconf macros at all.)
85426aec45a7Smrg#
85436aec45a7Smrg# So we provide this file, which has a silly filename so it's always
85446aec45a7Smrg# included after everything else.  This provides aclocal with the
85456aec45a7Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
85466aec45a7Smrg# because those macros already exist, or will be overwritten later.
85476aec45a7Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
85486aec45a7Smrg#
85496aec45a7Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
85506aec45a7Smrg# Yes, that means every name once taken will need to remain here until
85516aec45a7Smrg# we give up compatibility with versions before 1.7, at which point
85526aec45a7Smrg# we need to keep only those names which we still refer to.
85536aec45a7Smrg
85546aec45a7Smrg# This is to help aclocal find these macros, as it can't see m4_define.
85556aec45a7SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
85566aec45a7Smrg
85576aec45a7Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
85586aec45a7Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
85596aec45a7Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
85606aec45a7Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
85616aec45a7Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
85626aec45a7Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
85636aec45a7Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
85646aec45a7Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
85656aec45a7Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
85666aec45a7Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
85676aec45a7Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
85686aec45a7Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
85696aec45a7Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
85706aec45a7Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
85716aec45a7Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
85726aec45a7Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
85736aec45a7Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
85746aec45a7Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
85756aec45a7Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
85766aec45a7Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
85776aec45a7Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
85786aec45a7Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
85796aec45a7Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
85806aec45a7Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
85816aec45a7Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
85826aec45a7Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
85836aec45a7Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
85846aec45a7Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
85856aec45a7Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
85866aec45a7Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
85876aec45a7Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
85886aec45a7Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
85896aec45a7Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
85906aec45a7Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
85916aec45a7Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
85926aec45a7Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
85936aec45a7Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
85946aec45a7Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
85956aec45a7Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
85966aec45a7Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
85976aec45a7Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
85986aec45a7Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
85996aec45a7Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
86006aec45a7Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
86016aec45a7Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
86026aec45a7Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
86036aec45a7Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
86046aec45a7Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
86056aec45a7Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
86066aec45a7Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
86076aec45a7Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
86086aec45a7Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
86096aec45a7Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
86106aec45a7Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
86116aec45a7Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
86126aec45a7Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
86136aec45a7Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
86146aec45a7Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
86156aec45a7Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
86166aec45a7Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
86176aec45a7Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
86186aec45a7Smrg
8619ab47cfaaSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
86206aec45a7Smrg# serial 1 (pkg-config-0.24)
8621ab47cfaaSmrg# 
8622ab47cfaaSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
8623ab47cfaaSmrg#
8624ab47cfaaSmrg# This program is free software; you can redistribute it and/or modify
8625ab47cfaaSmrg# it under the terms of the GNU General Public License as published by
8626ab47cfaaSmrg# the Free Software Foundation; either version 2 of the License, or
8627ab47cfaaSmrg# (at your option) any later version.
8628ab47cfaaSmrg#
8629ab47cfaaSmrg# This program is distributed in the hope that it will be useful, but
8630ab47cfaaSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
8631ab47cfaaSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8632ab47cfaaSmrg# General Public License for more details.
8633ab47cfaaSmrg#
8634ab47cfaaSmrg# You should have received a copy of the GNU General Public License
8635ab47cfaaSmrg# along with this program; if not, write to the Free Software
8636ab47cfaaSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
8637ab47cfaaSmrg#
8638ab47cfaaSmrg# As a special exception to the GNU General Public License, if you
8639ab47cfaaSmrg# distribute this file as part of a program that contains a
8640ab47cfaaSmrg# configuration script generated by Autoconf, you may include it under
8641ab47cfaaSmrg# the same distribution terms that you use for the rest of that program.
8642ab47cfaaSmrg
8643ab47cfaaSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
8644ab47cfaaSmrg# ----------------------------------
8645ab47cfaaSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
8646ab47cfaaSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
864738770048Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
864838770048Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
86496aec45a7SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
86506aec45a7SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
86516aec45a7SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
86526aec45a7Smrg
8653ab47cfaaSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
8654ab47cfaaSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
8655ab47cfaaSmrgfi
8656ab47cfaaSmrgif test -n "$PKG_CONFIG"; then
8657ab47cfaaSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
8658ab47cfaaSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
8659ab47cfaaSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
8660ab47cfaaSmrg		AC_MSG_RESULT([yes])
8661ab47cfaaSmrg	else
8662ab47cfaaSmrg		AC_MSG_RESULT([no])
8663ab47cfaaSmrg		PKG_CONFIG=""
8664ab47cfaaSmrg	fi
8665ab47cfaaSmrgfi[]dnl
8666ab47cfaaSmrg])# PKG_PROG_PKG_CONFIG
8667ab47cfaaSmrg
8668ab47cfaaSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8669ab47cfaaSmrg#
8670ab47cfaaSmrg# Check to see whether a particular set of modules exists.  Similar
8671ab47cfaaSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
8672ab47cfaaSmrg#
86736aec45a7Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
86746aec45a7Smrg# only at the first occurence in configure.ac, so if the first place
86756aec45a7Smrg# it's called might be skipped (such as if it is within an "if", you
86766aec45a7Smrg# have to call PKG_CHECK_EXISTS manually
8677ab47cfaaSmrg# --------------------------------------------------------------
8678ab47cfaaSmrgAC_DEFUN([PKG_CHECK_EXISTS],
8679ab47cfaaSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8680ab47cfaaSmrgif test -n "$PKG_CONFIG" && \
8681ab47cfaaSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
86826aec45a7Smrg  m4_default([$2], [:])
8683ab47cfaaSmrgm4_ifvaln([$3], [else
8684ab47cfaaSmrg  $3])dnl
8685ab47cfaaSmrgfi])
8686ab47cfaaSmrg
8687ab47cfaaSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8688ab47cfaaSmrg# ---------------------------------------------
8689ab47cfaaSmrgm4_define([_PKG_CONFIG],
86908697ee19Smrg[if test -n "$$1"; then
86918697ee19Smrg    pkg_cv_[]$1="$$1"
86928697ee19Smrg elif test -n "$PKG_CONFIG"; then
86938697ee19Smrg    PKG_CHECK_EXISTS([$3],
869438770048Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
869538770048Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
86968697ee19Smrg		     [pkg_failed=yes])
86978697ee19Smrg else
86988697ee19Smrg    pkg_failed=untried
8699ab47cfaaSmrgfi[]dnl
8700ab47cfaaSmrg])# _PKG_CONFIG
8701ab47cfaaSmrg
8702ab47cfaaSmrg# _PKG_SHORT_ERRORS_SUPPORTED
8703ab47cfaaSmrg# -----------------------------
8704ab47cfaaSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
8705ab47cfaaSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8706ab47cfaaSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
8707ab47cfaaSmrg        _pkg_short_errors_supported=yes
8708ab47cfaaSmrgelse
8709ab47cfaaSmrg        _pkg_short_errors_supported=no
8710ab47cfaaSmrgfi[]dnl
8711ab47cfaaSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
8712ab47cfaaSmrg
8713ab47cfaaSmrg
8714ab47cfaaSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
8715ab47cfaaSmrg# [ACTION-IF-NOT-FOUND])
8716ab47cfaaSmrg#
8717ab47cfaaSmrg#
8718ab47cfaaSmrg# Note that if there is a possibility the first call to
8719ab47cfaaSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
8720ab47cfaaSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
8721ab47cfaaSmrg#
8722ab47cfaaSmrg#
8723ab47cfaaSmrg# --------------------------------------------------------------
8724ab47cfaaSmrgAC_DEFUN([PKG_CHECK_MODULES],
8725ab47cfaaSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8726ab47cfaaSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
8727ab47cfaaSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
8728ab47cfaaSmrg
8729ab47cfaaSmrgpkg_failed=no
8730ab47cfaaSmrgAC_MSG_CHECKING([for $1])
8731ab47cfaaSmrg
8732ab47cfaaSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
8733ab47cfaaSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
8734ab47cfaaSmrg
8735ab47cfaaSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
8736ab47cfaaSmrgand $1[]_LIBS to avoid the need to call pkg-config.
8737ab47cfaaSmrgSee the pkg-config man page for more details.])
8738ab47cfaaSmrg
8739ab47cfaaSmrgif test $pkg_failed = yes; then
87406aec45a7Smrg   	AC_MSG_RESULT([no])
8741ab47cfaaSmrg        _PKG_SHORT_ERRORS_SUPPORTED
8742ab47cfaaSmrg        if test $_pkg_short_errors_supported = yes; then
874338770048Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
8744ab47cfaaSmrg        else 
874538770048Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
8746ab47cfaaSmrg        fi
8747ab47cfaaSmrg	# Put the nasty error message in config.log where it belongs
8748ab47cfaaSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8749ab47cfaaSmrg
87506aec45a7Smrg	m4_default([$4], [AC_MSG_ERROR(
8751ab47cfaaSmrg[Package requirements ($2) were not met:
8752ab47cfaaSmrg
8753ab47cfaaSmrg$$1_PKG_ERRORS
8754ab47cfaaSmrg
8755ab47cfaaSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
8756ab47cfaaSmrginstalled software in a non-standard prefix.
8757ab47cfaaSmrg
875838770048Smrg_PKG_TEXT])[]dnl
87596aec45a7Smrg        ])
8760ab47cfaaSmrgelif test $pkg_failed = untried; then
87616aec45a7Smrg     	AC_MSG_RESULT([no])
87626aec45a7Smrg	m4_default([$4], [AC_MSG_FAILURE(
8763ab47cfaaSmrg[The pkg-config script could not be found or is too old.  Make sure it
8764ab47cfaaSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
8765ab47cfaaSmrgpath to pkg-config.
8766ab47cfaaSmrg
8767ab47cfaaSmrg_PKG_TEXT
8768ab47cfaaSmrg
876938770048SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
87706aec45a7Smrg        ])
8771ab47cfaaSmrgelse
8772ab47cfaaSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
8773ab47cfaaSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
8774ab47cfaaSmrg        AC_MSG_RESULT([yes])
87756aec45a7Smrg	$3
8776ab47cfaaSmrgfi[]dnl
8777ab47cfaaSmrg])# PKG_CHECK_MODULES
8778ab47cfaaSmrg
87791473d951Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
87808697ee19Smrgdnl
87816aec45a7Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
87828697ee19Smrgdnl 
87838697ee19Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
87846aec45a7Smrgdnl copy of this software and associated documentation files (the "Software"),
87856aec45a7Smrgdnl to deal in the Software without restriction, including without limitation
87866aec45a7Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
87876aec45a7Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
87886aec45a7Smrgdnl Software is furnished to do so, subject to the following conditions:
87898697ee19Smrgdnl
87906aec45a7Smrgdnl The above copyright notice and this permission notice (including the next
87916aec45a7Smrgdnl paragraph) shall be included in all copies or substantial portions of the
87926aec45a7Smrgdnl Software.
87938697ee19Smrgdnl
87946aec45a7Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
87956aec45a7Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
87966aec45a7Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
87976aec45a7Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
87986aec45a7Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
87996aec45a7Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
88006aec45a7Smrgdnl DEALINGS IN THE SOFTWARE.
8801ab47cfaaSmrg
88028697ee19Smrg# XORG_MACROS_VERSION(required-version)
88038697ee19Smrg# -------------------------------------
88048697ee19Smrg# Minimum version: 1.1.0
8805ab47cfaaSmrg#
88068697ee19Smrg# If you're using a macro added in Version 1.1 or newer, include this in
88078697ee19Smrg# your configure.ac with the minimum required version, such as:
88088697ee19Smrg# XORG_MACROS_VERSION(1.1)
8809ab47cfaaSmrg#
88106aec45a7Smrg# To ensure that this macro is defined, also add:
88116aec45a7Smrg# m4_ifndef([XORG_MACROS_VERSION],
88126aec45a7Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
8813ab47cfaaSmrg#
8814ab47cfaaSmrg#
88158697ee19Smrg# See the "minimum version" comment for each macro you use to see what 
88168697ee19Smrg# version you require.
88176aec45a7Smrgm4_defun([XORG_MACROS_VERSION],[
8818aa9e3350Smrgm4_define([vers_have], [1.17])
88196aec45a7Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
88206aec45a7Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
88216aec45a7Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
88226aec45a7Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
88236aec45a7Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
88246aec45a7Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
88256aec45a7Smrgm4_undefine([vers_have])
88266aec45a7Smrgm4_undefine([maj_have])
88276aec45a7Smrgm4_undefine([maj_needed])
88288697ee19Smrg]) # XORG_MACROS_VERSION
8829ab47cfaaSmrg
88308697ee19Smrg# XORG_PROG_RAWCPP()
88318697ee19Smrg# ------------------
88328697ee19Smrg# Minimum version: 1.0.0
8833ab47cfaaSmrg#
88348697ee19Smrg# Find cpp program and necessary flags for use in pre-processing text files
88358697ee19Smrg# such as man pages and config files
88368697ee19SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
88378697ee19SmrgAC_REQUIRE([AC_PROG_CPP])
88388697ee19SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
88398697ee19Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
8840ab47cfaaSmrg
88418697ee19Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
88428697ee19Smrg# which is not the best choice for supporting other OS'es, but covers most
88438697ee19Smrg# of the ones we need for now.
88448697ee19SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
8845aa9e3350SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
88468697ee19Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
88478697ee19Smrg	AC_MSG_RESULT([no])
8848ab47cfaaSmrgelse
88498697ee19Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
88508697ee19Smrg		RAWCPPFLAGS=-undef
88518697ee19Smrg		AC_MSG_RESULT([yes])
88521473d951Smrg	# under Cygwin unix is still defined even with -undef
88531473d951Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
88541473d951Smrg		RAWCPPFLAGS="-undef -ansi"
88551473d951Smrg		AC_MSG_RESULT([yes, with -ansi])
88568697ee19Smrg	else
88578697ee19Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
88588697ee19Smrg	fi
8859ab47cfaaSmrgfi
88608697ee19Smrgrm -f conftest.$ac_ext
8861ab47cfaaSmrg
88628697ee19SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
8863aa9e3350SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
88648697ee19Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
88658697ee19Smrg	AC_MSG_RESULT([no])
88668697ee19Smrgelse
88678697ee19Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
88688697ee19Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
88698697ee19Smrg		AC_MSG_RESULT([yes])
88708697ee19Smrg	else
88718697ee19Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
88728697ee19Smrg	fi
88738697ee19Smrgfi
88748697ee19Smrgrm -f conftest.$ac_ext
88758697ee19SmrgAC_SUBST(RAWCPPFLAGS)
88768697ee19Smrg]) # XORG_PROG_RAWCPP
8877ab47cfaaSmrg
88788697ee19Smrg# XORG_MANPAGE_SECTIONS()
88798697ee19Smrg# -----------------------
88808697ee19Smrg# Minimum version: 1.0.0
8881ab47cfaaSmrg#
88828697ee19Smrg# Determine which sections man pages go in for the different man page types
88838697ee19Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
88848697ee19Smrg# Not sure if there's any better way than just hardcoding by OS name.
88858697ee19Smrg# Override default settings by setting environment variables
88866aec45a7Smrg# Added MAN_SUBSTS in version 1.8
88876aec45a7Smrg# Added AC_PROG_SED in version 1.8
8888ab47cfaaSmrg
88898697ee19SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
88908697ee19SmrgAC_REQUIRE([AC_CANONICAL_HOST])
88916aec45a7SmrgAC_REQUIRE([AC_PROG_SED])
8892ab47cfaaSmrg
88938697ee19Smrgif test x$APP_MAN_SUFFIX = x    ; then
88948697ee19Smrg    APP_MAN_SUFFIX=1
88958697ee19Smrgfi
88968697ee19Smrgif test x$APP_MAN_DIR = x    ; then
88978697ee19Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
88988697ee19Smrgfi
8899ab47cfaaSmrg
89008697ee19Smrgif test x$LIB_MAN_SUFFIX = x    ; then
89018697ee19Smrg    LIB_MAN_SUFFIX=3
89028697ee19Smrgfi
89038697ee19Smrgif test x$LIB_MAN_DIR = x    ; then
89048697ee19Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
89058697ee19Smrgfi
8906ab47cfaaSmrg
89078697ee19Smrgif test x$FILE_MAN_SUFFIX = x    ; then
89088697ee19Smrg    case $host_os in
89098697ee19Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
89108697ee19Smrg	*)		FILE_MAN_SUFFIX=5  ;;
8911ab47cfaaSmrg    esac
8912ab47cfaaSmrgfi
89138697ee19Smrgif test x$FILE_MAN_DIR = x    ; then
89148697ee19Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
89158697ee19Smrgfi
8916ab47cfaaSmrg
89178697ee19Smrgif test x$MISC_MAN_SUFFIX = x    ; then
89188697ee19Smrg    case $host_os in
89198697ee19Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
89208697ee19Smrg	*)		MISC_MAN_SUFFIX=7  ;;
89218697ee19Smrg    esac
89228697ee19Smrgfi
89238697ee19Smrgif test x$MISC_MAN_DIR = x    ; then
89248697ee19Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
89258697ee19Smrgfi
8926ab47cfaaSmrg
89278697ee19Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
89288697ee19Smrg    case $host_os in
89298697ee19Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
89308697ee19Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
89318697ee19Smrg    esac
89328697ee19Smrgfi
89338697ee19Smrgif test x$DRIVER_MAN_DIR = x    ; then
89348697ee19Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
89358697ee19Smrgfi
8936ab47cfaaSmrg
89378697ee19Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
89388697ee19Smrg    case $host_os in
89398697ee19Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
89408697ee19Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
89418697ee19Smrg    esac
89428697ee19Smrgfi
89438697ee19Smrgif test x$ADMIN_MAN_DIR = x    ; then
89448697ee19Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
8945ab47cfaaSmrgfi
8946ab47cfaaSmrg
8947ab47cfaaSmrg
89488697ee19SmrgAC_SUBST([APP_MAN_SUFFIX])
89498697ee19SmrgAC_SUBST([LIB_MAN_SUFFIX])
89508697ee19SmrgAC_SUBST([FILE_MAN_SUFFIX])
89518697ee19SmrgAC_SUBST([MISC_MAN_SUFFIX])
89528697ee19SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
89538697ee19SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
89548697ee19SmrgAC_SUBST([APP_MAN_DIR])
89558697ee19SmrgAC_SUBST([LIB_MAN_DIR])
89568697ee19SmrgAC_SUBST([FILE_MAN_DIR])
89578697ee19SmrgAC_SUBST([MISC_MAN_DIR])
89588697ee19SmrgAC_SUBST([DRIVER_MAN_DIR])
89598697ee19SmrgAC_SUBST([ADMIN_MAN_DIR])
89606aec45a7Smrg
89616aec45a7SmrgXORG_MAN_PAGE="X Version 11"
89626aec45a7SmrgAC_SUBST([XORG_MAN_PAGE])
89636aec45a7SmrgMAN_SUBSTS="\
89646aec45a7Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
89656aec45a7Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
89666aec45a7Smrg	-e 's|__xservername__|Xorg|g' \
89676aec45a7Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
89686aec45a7Smrg	-e 's|__projectroot__|\$(prefix)|g' \
89696aec45a7Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
89706aec45a7Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
89716aec45a7Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
89726aec45a7Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
89736aec45a7Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
89746aec45a7Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
89756aec45a7Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
89766aec45a7SmrgAC_SUBST([MAN_SUBSTS])
89776aec45a7Smrg
89788697ee19Smrg]) # XORG_MANPAGE_SECTIONS
8979ab47cfaaSmrg
89806aec45a7Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
89816aec45a7Smrg# ------------------------
89826aec45a7Smrg# Minimum version: 1.7.0
89836aec45a7Smrg#
89846aec45a7Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
89856aec45a7Smrg# provided by xorg-sgml-doctools, if installed.
89866aec45a7SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
89876aec45a7SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
89886aec45a7SmrgXORG_SGML_PATH=
89896aec45a7SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
89906aec45a7Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
89916aec45a7Smrg    [m4_ifval([$1],[:],
89926aec45a7Smrg        [if test x"$cross_compiling" != x"yes" ; then
89936aec45a7Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
89946aec45a7Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
89956aec45a7Smrg         fi])
89966aec45a7Smrg    ])
89976aec45a7Smrg
89986aec45a7Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
89996aec45a7Smrg# the path and the name of the doc stylesheet
90006aec45a7Smrgif test "x$XORG_SGML_PATH" != "x" ; then
90016aec45a7Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
90026aec45a7Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
90036aec45a7Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
90046aec45a7Smrgelse
90056aec45a7Smrg   AC_MSG_RESULT([no])
90066aec45a7Smrgfi
90076aec45a7Smrg
90086aec45a7SmrgAC_SUBST(XORG_SGML_PATH)
90096aec45a7SmrgAC_SUBST(STYLESHEET_SRCDIR)
90106aec45a7SmrgAC_SUBST(XSL_STYLESHEET)
90116aec45a7SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
90126aec45a7Smrg]) # XORG_CHECK_SGML_DOCTOOLS
90136aec45a7Smrg
90148697ee19Smrg# XORG_CHECK_LINUXDOC
90158697ee19Smrg# -------------------
90168697ee19Smrg# Minimum version: 1.0.0
9017ab47cfaaSmrg#
90188697ee19Smrg# Defines the variable MAKE_TEXT if the necessary tools and
90198697ee19Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
90208697ee19Smrg# Whether or not the necessary tools and files are found can be checked
90218697ee19Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
90228697ee19SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
90236aec45a7SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
90246aec45a7SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
9025ab47cfaaSmrg
90268697ee19SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
9027ab47cfaaSmrg
90286aec45a7SmrgAC_MSG_CHECKING([whether to build documentation])
9029ab47cfaaSmrg
90306aec45a7Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
90318697ee19Smrg   BUILDDOC=yes
90328697ee19Smrgelse
90338697ee19Smrg   BUILDDOC=no
90348697ee19Smrgfi
9035ab47cfaaSmrg
90368697ee19SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9037ab47cfaaSmrg
90388697ee19SmrgAC_MSG_RESULT([$BUILDDOC])
9039ab47cfaaSmrg
90406aec45a7SmrgAC_MSG_CHECKING([whether to build pdf documentation])
9041ab47cfaaSmrg
90426aec45a7Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
90438697ee19Smrg   BUILDPDFDOC=yes
90448697ee19Smrgelse
90458697ee19Smrg   BUILDPDFDOC=no
9046ab47cfaaSmrgfi
9047ab47cfaaSmrg
90488697ee19SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9049ab47cfaaSmrg
90508697ee19SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9051ab47cfaaSmrg
90526aec45a7SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
90538697ee19SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
90548697ee19SmrgMAKE_PDF="$PS2PDF"
90558697ee19SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9056ab47cfaaSmrg
90578697ee19SmrgAC_SUBST(MAKE_TEXT)
90588697ee19SmrgAC_SUBST(MAKE_PS)
90598697ee19SmrgAC_SUBST(MAKE_PDF)
90608697ee19SmrgAC_SUBST(MAKE_HTML)
90618697ee19Smrg]) # XORG_CHECK_LINUXDOC
9062ab47cfaaSmrg
90638697ee19Smrg# XORG_CHECK_DOCBOOK
90648697ee19Smrg# -------------------
90658697ee19Smrg# Minimum version: 1.0.0
9066ab47cfaaSmrg#
90678697ee19Smrg# Checks for the ability to build output formats from SGML DocBook source.
90688697ee19Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
90698697ee19Smrg# indicates whether the necessary tools and files are found and, if set,
90708697ee19Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
90718697ee19SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
90726aec45a7SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
90736aec45a7Smrg
90748697ee19SmrgBUILDTXTDOC=no
90758697ee19SmrgBUILDPDFDOC=no
90768697ee19SmrgBUILDPSDOC=no
90778697ee19SmrgBUILDHTMLDOC=no
9078ab47cfaaSmrg
90798697ee19SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
90808697ee19SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
90818697ee19SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
90828697ee19SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9083ab47cfaaSmrg
90846aec45a7SmrgAC_MSG_CHECKING([whether to build text documentation])
90856aec45a7Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
90868697ee19Smrg   test x$BUILD_TXTDOC != xno; then
90878697ee19Smrg	BUILDTXTDOC=yes
90888697ee19Smrgfi
90898697ee19SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
90908697ee19SmrgAC_MSG_RESULT([$BUILDTXTDOC])
9091ab47cfaaSmrg
90926aec45a7SmrgAC_MSG_CHECKING([whether to build PDF documentation])
90936aec45a7Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
90948697ee19Smrg   test x$BUILD_PDFDOC != xno; then
90958697ee19Smrg	BUILDPDFDOC=yes
9096ab47cfaaSmrgfi
90978697ee19SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
90988697ee19SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9099ab47cfaaSmrg
91006aec45a7SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
91016aec45a7Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
91028697ee19Smrg   test x$BUILD_PSDOC != xno; then
91038697ee19Smrg	BUILDPSDOC=yes
91048697ee19Smrgfi
91058697ee19SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
91068697ee19SmrgAC_MSG_RESULT([$BUILDPSDOC])
9107ab47cfaaSmrg
91086aec45a7SmrgAC_MSG_CHECKING([whether to build HTML documentation])
91096aec45a7Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
91108697ee19Smrg   test x$BUILD_HTMLDOC != xno; then
91118697ee19Smrg	BUILDHTMLDOC=yes
91128697ee19Smrgfi
91138697ee19SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
91148697ee19SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
9115ab47cfaaSmrg
91168697ee19SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
91178697ee19SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
91188697ee19SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
91198697ee19SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9120ab47cfaaSmrg
91218697ee19SmrgAC_SUBST(MAKE_TEXT)
91228697ee19SmrgAC_SUBST(MAKE_PS)
91238697ee19SmrgAC_SUBST(MAKE_PDF)
91248697ee19SmrgAC_SUBST(MAKE_HTML)
91258697ee19Smrg]) # XORG_CHECK_DOCBOOK
9126ab47cfaaSmrg
91276aec45a7Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
91286aec45a7Smrg# ----------------
91296aec45a7Smrg# Minimum version: 1.5.0
91306aec45a7Smrg# Minimum version for optional DEFAULT argument: 1.11.0
91316aec45a7Smrg#
91326aec45a7Smrg# Documentation tools are not always available on all platforms and sometimes
91336aec45a7Smrg# not at the appropriate level. This macro enables a module to test for the
91346aec45a7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
91356aec45a7Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
91366aec45a7Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
91376aec45a7Smrg# --with-xmlto assumes 'auto'.
91386aec45a7Smrg#
91396aec45a7Smrg# Interface to module:
91406aec45a7Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
91416aec45a7Smrg# XMLTO:	returns the path of the xmlto program found
91426aec45a7Smrg#		returns the path set by the user in the environment
91436aec45a7Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
91446aec45a7Smrg#		'no' user instructs the module not to use xmlto
91456aec45a7Smrg#
91466aec45a7Smrg# Added in version 1.10.0
91476aec45a7Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
91486aec45a7Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
91496aec45a7Smrg#
91506aec45a7Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
91516aec45a7Smrg#
91526aec45a7SmrgAC_DEFUN([XORG_WITH_XMLTO],[
91536aec45a7SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
91546aec45a7Smrgm4_define([_defopt], m4_default([$2], [auto]))
91556aec45a7SmrgAC_ARG_WITH(xmlto,
91566aec45a7Smrg	AS_HELP_STRING([--with-xmlto],
91576aec45a7Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
91586aec45a7Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
91596aec45a7Smrgm4_undefine([_defopt])
91606aec45a7Smrg
91616aec45a7Smrgif test "x$use_xmlto" = x"auto"; then
91626aec45a7Smrg   AC_PATH_PROG([XMLTO], [xmlto])
91636aec45a7Smrg   if test "x$XMLTO" = "x"; then
91646aec45a7Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
91656aec45a7Smrg	have_xmlto=no
91666aec45a7Smrg   else
91676aec45a7Smrg        have_xmlto=yes
91686aec45a7Smrg   fi
91696aec45a7Smrgelif test "x$use_xmlto" = x"yes" ; then
91706aec45a7Smrg   AC_PATH_PROG([XMLTO], [xmlto])
91716aec45a7Smrg   if test "x$XMLTO" = "x"; then
91726aec45a7Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
91736aec45a7Smrg   fi
91746aec45a7Smrg   have_xmlto=yes
91756aec45a7Smrgelif test "x$use_xmlto" = x"no" ; then
91766aec45a7Smrg   if test "x$XMLTO" != "x"; then
91776aec45a7Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
91786aec45a7Smrg   fi
91796aec45a7Smrg   have_xmlto=no
91806aec45a7Smrgelse
91816aec45a7Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
91826aec45a7Smrgfi
91836aec45a7Smrg
91846aec45a7Smrg# Test for a minimum version of xmlto, if provided.
91856aec45a7Smrgm4_ifval([$1],
91866aec45a7Smrg[if test "$have_xmlto" = yes; then
91876aec45a7Smrg    # scrape the xmlto version
91886aec45a7Smrg    AC_MSG_CHECKING([the xmlto version])
91896aec45a7Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
91906aec45a7Smrg    AC_MSG_RESULT([$xmlto_version])
91916aec45a7Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
91926aec45a7Smrg        [if test "x$use_xmlto" = xauto; then
91936aec45a7Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
91946aec45a7Smrg            have_xmlto=no
91956aec45a7Smrg        else
91966aec45a7Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
91976aec45a7Smrg        fi])
91986aec45a7Smrgfi])
91996aec45a7Smrg
92006aec45a7Smrg# Test for the ability of xmlto to generate a text target
92016aec45a7Smrghave_xmlto_text=no
92026aec45a7Smrgcat > conftest.xml << "EOF"
92036aec45a7SmrgEOF
92046aec45a7SmrgAS_IF([test "$have_xmlto" = yes],
92056aec45a7Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
92066aec45a7Smrg             [have_xmlto_text=yes],
92076aec45a7Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
92086aec45a7Smrgrm -f conftest.xml
92096aec45a7SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
92106aec45a7SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
92116aec45a7Smrg]) # XORG_WITH_XMLTO
92126aec45a7Smrg
9213aa9e3350Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
9214aa9e3350Smrg# --------------------------------------------
9215aa9e3350Smrg# Minimum version: 1.12.0
9216aa9e3350Smrg# Minimum version for optional DEFAULT argument: 1.12.0
9217aa9e3350Smrg#
9218aa9e3350Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
9219aa9e3350Smrg# XML-based language used for the transformation of XML documents.
9220aa9e3350Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
9221aa9e3350Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
9222aa9e3350Smrg# The XSLT processor is often used as a standalone tool for transformations.
9223aa9e3350Smrg# It should not be assumed that this tool is used only to work with documnetation.
9224aa9e3350Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
9225aa9e3350Smrg#
9226aa9e3350Smrg# Interface to module:
9227aa9e3350Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
9228aa9e3350Smrg# XSLTPROC:	 returns the path of the xsltproc program found
9229aa9e3350Smrg#		 returns the path set by the user in the environment
9230aa9e3350Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
9231aa9e3350Smrg#		  'no' user instructs the module not to use xsltproc
9232aa9e3350Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
9233aa9e3350Smrg#
9234aa9e3350Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
9235aa9e3350Smrg#
9236aa9e3350SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
9237aa9e3350SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
9238aa9e3350Smrg# Preserves the interface, should it be implemented later
9239aa9e3350Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
9240aa9e3350Smrgm4_define([_defopt], m4_default([$2], [auto]))
9241aa9e3350SmrgAC_ARG_WITH(xsltproc,
9242aa9e3350Smrg	AS_HELP_STRING([--with-xsltproc],
9243aa9e3350Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
9244aa9e3350Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
9245aa9e3350Smrgm4_undefine([_defopt])
9246aa9e3350Smrg
9247aa9e3350Smrgif test "x$use_xsltproc" = x"auto"; then
9248aa9e3350Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9249aa9e3350Smrg   if test "x$XSLTPROC" = "x"; then
9250aa9e3350Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
9251aa9e3350Smrg	have_xsltproc=no
9252aa9e3350Smrg   else
9253aa9e3350Smrg        have_xsltproc=yes
9254aa9e3350Smrg   fi
9255aa9e3350Smrgelif test "x$use_xsltproc" = x"yes" ; then
9256aa9e3350Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9257aa9e3350Smrg   if test "x$XSLTPROC" = "x"; then
9258aa9e3350Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
9259aa9e3350Smrg   fi
9260aa9e3350Smrg   have_xsltproc=yes
9261aa9e3350Smrgelif test "x$use_xsltproc" = x"no" ; then
9262aa9e3350Smrg   if test "x$XSLTPROC" != "x"; then
9263aa9e3350Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
9264aa9e3350Smrg   fi
9265aa9e3350Smrg   have_xsltproc=no
9266aa9e3350Smrgelse
9267aa9e3350Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
9268aa9e3350Smrgfi
9269aa9e3350Smrg
9270aa9e3350SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
9271aa9e3350Smrg]) # XORG_WITH_XSLTPROC
9272aa9e3350Smrg
9273aa9e3350Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
9274aa9e3350Smrg# ----------------------------------------
9275aa9e3350Smrg# Minimum version: 1.15.0
9276aa9e3350Smrg#
9277aa9e3350Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
9278aa9e3350Smrg# scanning arbitrary text files, extracting information from those text files,
9279aa9e3350Smrg# and printing reports based on that information.
9280aa9e3350Smrg#
9281aa9e3350Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
9282aa9e3350Smrg#
9283aa9e3350Smrg# Interface to module:
9284aa9e3350Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
9285aa9e3350Smrg# PERL:	     returns the path of the perl program found
9286aa9e3350Smrg#	     returns the path set by the user in the environment
9287aa9e3350Smrg# --with-perl: 'yes' user instructs the module to use perl
9288aa9e3350Smrg#	       'no' user instructs the module not to use perl
9289aa9e3350Smrg# have_perl: returns yes if perl found in PATH or no
9290aa9e3350Smrg#
9291aa9e3350Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
9292aa9e3350Smrg#
9293aa9e3350SmrgAC_DEFUN([XORG_WITH_PERL],[
9294aa9e3350SmrgAC_ARG_VAR([PERL], [Path to perl command])
9295aa9e3350Smrg# Preserves the interface, should it be implemented later
9296aa9e3350Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
9297aa9e3350Smrgm4_define([_defopt], m4_default([$2], [auto]))
9298aa9e3350SmrgAC_ARG_WITH(perl,
9299aa9e3350Smrg	AS_HELP_STRING([--with-perl],
9300aa9e3350Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
9301aa9e3350Smrg	   [use_perl=$withval], [use_perl=]_defopt)
9302aa9e3350Smrgm4_undefine([_defopt])
9303aa9e3350Smrg
9304aa9e3350Smrgif test "x$use_perl" = x"auto"; then
9305aa9e3350Smrg   AC_PATH_PROG([PERL], [perl])
9306aa9e3350Smrg   if test "x$PERL" = "x"; then
9307aa9e3350Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
9308aa9e3350Smrg	have_perl=no
9309aa9e3350Smrg   else
9310aa9e3350Smrg        have_perl=yes
9311aa9e3350Smrg   fi
9312aa9e3350Smrgelif test "x$use_perl" = x"yes" ; then
9313aa9e3350Smrg   AC_PATH_PROG([PERL], [perl])
9314aa9e3350Smrg   if test "x$PERL" = "x"; then
9315aa9e3350Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
9316aa9e3350Smrg   fi
9317aa9e3350Smrg   have_perl=yes
9318aa9e3350Smrgelif test "x$use_perl" = x"no" ; then
9319aa9e3350Smrg   if test "x$PERL" != "x"; then
9320aa9e3350Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
9321aa9e3350Smrg   fi
9322aa9e3350Smrg   have_perl=no
9323aa9e3350Smrgelse
9324aa9e3350Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
9325aa9e3350Smrgfi
9326aa9e3350Smrg
9327aa9e3350SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
9328aa9e3350Smrg]) # XORG_WITH_PERL
9329aa9e3350Smrg
93306aec45a7Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
93316aec45a7Smrg# ----------------
93326aec45a7Smrg# Minimum version: 1.5.0
93336aec45a7Smrg# Minimum version for optional DEFAULT argument: 1.11.0
93346aec45a7Smrg#
93356aec45a7Smrg# Documentation tools are not always available on all platforms and sometimes
93366aec45a7Smrg# not at the appropriate level. This macro enables a module to test for the
93376aec45a7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
93386aec45a7Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
93396aec45a7Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
93406aec45a7Smrg# --with-asciidoc assumes 'auto'.
93416aec45a7Smrg#
93426aec45a7Smrg# Interface to module:
93436aec45a7Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
93446aec45a7Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
93456aec45a7Smrg#		 returns the path set by the user in the environment
93466aec45a7Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
93476aec45a7Smrg#		  'no' user instructs the module not to use asciidoc
93486aec45a7Smrg#
93496aec45a7Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
93506aec45a7Smrg#
93516aec45a7SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
93526aec45a7SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
93536aec45a7Smrgm4_define([_defopt], m4_default([$2], [auto]))
93546aec45a7SmrgAC_ARG_WITH(asciidoc,
93556aec45a7Smrg	AS_HELP_STRING([--with-asciidoc],
93566aec45a7Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
93576aec45a7Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
93586aec45a7Smrgm4_undefine([_defopt])
93596aec45a7Smrg
93606aec45a7Smrgif test "x$use_asciidoc" = x"auto"; then
93616aec45a7Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
93626aec45a7Smrg   if test "x$ASCIIDOC" = "x"; then
93636aec45a7Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
93646aec45a7Smrg	have_asciidoc=no
93656aec45a7Smrg   else
93666aec45a7Smrg        have_asciidoc=yes
93676aec45a7Smrg   fi
93686aec45a7Smrgelif test "x$use_asciidoc" = x"yes" ; then
93696aec45a7Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
93706aec45a7Smrg   if test "x$ASCIIDOC" = "x"; then
93716aec45a7Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
93726aec45a7Smrg   fi
93736aec45a7Smrg   have_asciidoc=yes
93746aec45a7Smrgelif test "x$use_asciidoc" = x"no" ; then
93756aec45a7Smrg   if test "x$ASCIIDOC" != "x"; then
93766aec45a7Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
93776aec45a7Smrg   fi
93786aec45a7Smrg   have_asciidoc=no
93796aec45a7Smrgelse
93806aec45a7Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
93816aec45a7Smrgfi
93826aec45a7Smrgm4_ifval([$1],
93836aec45a7Smrg[if test "$have_asciidoc" = yes; then
93846aec45a7Smrg    # scrape the asciidoc version
93856aec45a7Smrg    AC_MSG_CHECKING([the asciidoc version])
93866aec45a7Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
93876aec45a7Smrg    AC_MSG_RESULT([$asciidoc_version])
93886aec45a7Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
93896aec45a7Smrg        [if test "x$use_asciidoc" = xauto; then
93906aec45a7Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
93916aec45a7Smrg            have_asciidoc=no
93926aec45a7Smrg        else
93936aec45a7Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
93946aec45a7Smrg        fi])
93956aec45a7Smrgfi])
93966aec45a7SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
93976aec45a7Smrg]) # XORG_WITH_ASCIIDOC
93986aec45a7Smrg
93996aec45a7Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
94006aec45a7Smrg# --------------------------------
94016aec45a7Smrg# Minimum version: 1.5.0
94026aec45a7Smrg# Minimum version for optional DEFAULT argument: 1.11.0
94036aec45a7Smrg#
94046aec45a7Smrg# Documentation tools are not always available on all platforms and sometimes
94056aec45a7Smrg# not at the appropriate level. This macro enables a module to test for the
94066aec45a7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
94076aec45a7Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
94086aec45a7Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
94096aec45a7Smrg# --with-doxygen assumes 'auto'.
94106aec45a7Smrg#
94116aec45a7Smrg# Interface to module:
94126aec45a7Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
94136aec45a7Smrg# DOXYGEN:	 returns the path of the doxygen program found
94146aec45a7Smrg#		 returns the path set by the user in the environment
94156aec45a7Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
94166aec45a7Smrg#		  'no' user instructs the module not to use doxygen
94176aec45a7Smrg#
94186aec45a7Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
94196aec45a7Smrg#
94206aec45a7SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
94216aec45a7SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
94226aec45a7Smrgm4_define([_defopt], m4_default([$2], [auto]))
94236aec45a7SmrgAC_ARG_WITH(doxygen,
94246aec45a7Smrg	AS_HELP_STRING([--with-doxygen],
94256aec45a7Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
94266aec45a7Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
94276aec45a7Smrgm4_undefine([_defopt])
94286aec45a7Smrg
94296aec45a7Smrgif test "x$use_doxygen" = x"auto"; then
94306aec45a7Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
94316aec45a7Smrg   if test "x$DOXYGEN" = "x"; then
94326aec45a7Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
94336aec45a7Smrg	have_doxygen=no
94346aec45a7Smrg   else
94356aec45a7Smrg        have_doxygen=yes
94366aec45a7Smrg   fi
94376aec45a7Smrgelif test "x$use_doxygen" = x"yes" ; then
94386aec45a7Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
94396aec45a7Smrg   if test "x$DOXYGEN" = "x"; then
94406aec45a7Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
94416aec45a7Smrg   fi
94426aec45a7Smrg   have_doxygen=yes
94436aec45a7Smrgelif test "x$use_doxygen" = x"no" ; then
94446aec45a7Smrg   if test "x$DOXYGEN" != "x"; then
94456aec45a7Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
94466aec45a7Smrg   fi
94476aec45a7Smrg   have_doxygen=no
94486aec45a7Smrgelse
94496aec45a7Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
94506aec45a7Smrgfi
94516aec45a7Smrgm4_ifval([$1],
94526aec45a7Smrg[if test "$have_doxygen" = yes; then
94536aec45a7Smrg    # scrape the doxygen version
94546aec45a7Smrg    AC_MSG_CHECKING([the doxygen version])
94556aec45a7Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
94566aec45a7Smrg    AC_MSG_RESULT([$doxygen_version])
94576aec45a7Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
94586aec45a7Smrg        [if test "x$use_doxygen" = xauto; then
94596aec45a7Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
94606aec45a7Smrg            have_doxygen=no
94616aec45a7Smrg        else
94626aec45a7Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
94636aec45a7Smrg        fi])
94646aec45a7Smrgfi])
94656aec45a7SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
94666aec45a7Smrg]) # XORG_WITH_DOXYGEN
94676aec45a7Smrg
94686aec45a7Smrg# XORG_WITH_GROFF([DEFAULT])
94696aec45a7Smrg# ----------------
94706aec45a7Smrg# Minimum version: 1.6.0
94716aec45a7Smrg# Minimum version for optional DEFAULT argument: 1.11.0
94726aec45a7Smrg#
94736aec45a7Smrg# Documentation tools are not always available on all platforms and sometimes
94746aec45a7Smrg# not at the appropriate level. This macro enables a module to test for the
94756aec45a7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
94766aec45a7Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
94776aec45a7Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
94786aec45a7Smrg# --with-groff assumes 'auto'.
94796aec45a7Smrg#
94806aec45a7Smrg# Interface to module:
94816aec45a7Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
94826aec45a7Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
94836aec45a7Smrg# HAVE_GROFF_MS: the -ms macros package
94846aec45a7Smrg# GROFF:	 returns the path of the groff program found
94856aec45a7Smrg#		 returns the path set by the user in the environment
94866aec45a7Smrg# --with-groff:	 'yes' user instructs the module to use groff
94876aec45a7Smrg#		 'no' user instructs the module not to use groff
94886aec45a7Smrg#
94896aec45a7Smrg# Added in version 1.9.0:
94906aec45a7Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
94916aec45a7Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
94926aec45a7Smrg#		   psselect from the psutils package.
94936aec45a7Smrg#		   the ghostcript package. Refer to the grohtml man pages
94946aec45a7Smrg#
94956aec45a7Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
94966aec45a7Smrg#
94976aec45a7Smrg# OS and distros often splits groff in a basic and full package, the former
94986aec45a7Smrg# having the groff program and the later having devices, fonts and macros
94996aec45a7Smrg# Checking for the groff executable is not enough.
95006aec45a7Smrg#
95016aec45a7Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
95026aec45a7Smrg# unset HAVE_GROFF or GROFF env variables.
95036aec45a7Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
95046aec45a7Smrg#
95056aec45a7SmrgAC_DEFUN([XORG_WITH_GROFF],[
95066aec45a7SmrgAC_ARG_VAR([GROFF], [Path to groff command])
95076aec45a7Smrgm4_define([_defopt], m4_default([$1], [auto]))
95086aec45a7SmrgAC_ARG_WITH(groff,
95096aec45a7Smrg	AS_HELP_STRING([--with-groff],
95106aec45a7Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
95116aec45a7Smrg	   [use_groff=$withval], [use_groff=]_defopt)
95126aec45a7Smrgm4_undefine([_defopt])
95136aec45a7Smrg
95146aec45a7Smrgif test "x$use_groff" = x"auto"; then
95156aec45a7Smrg   AC_PATH_PROG([GROFF], [groff])
95166aec45a7Smrg   if test "x$GROFF" = "x"; then
95176aec45a7Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
95186aec45a7Smrg	have_groff=no
95196aec45a7Smrg   else
95206aec45a7Smrg        have_groff=yes
95216aec45a7Smrg   fi
95226aec45a7Smrgelif test "x$use_groff" = x"yes" ; then
95236aec45a7Smrg   AC_PATH_PROG([GROFF], [groff])
95246aec45a7Smrg   if test "x$GROFF" = "x"; then
95256aec45a7Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
95266aec45a7Smrg   fi
95276aec45a7Smrg   have_groff=yes
95286aec45a7Smrgelif test "x$use_groff" = x"no" ; then
95296aec45a7Smrg   if test "x$GROFF" != "x"; then
95306aec45a7Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
95316aec45a7Smrg   fi
95326aec45a7Smrg   have_groff=no
95336aec45a7Smrgelse
95346aec45a7Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
95356aec45a7Smrgfi
95366aec45a7Smrg
95376aec45a7Smrg# We have groff, test for the presence of the macro packages
95386aec45a7Smrgif test "x$have_groff" = x"yes"; then
95396aec45a7Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
95406aec45a7Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
95416aec45a7Smrg        groff_ms_works=yes
95426aec45a7Smrg    else
95436aec45a7Smrg        groff_ms_works=no
95446aec45a7Smrg    fi
95456aec45a7Smrg    AC_MSG_RESULT([$groff_ms_works])
95466aec45a7Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
95476aec45a7Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
95486aec45a7Smrg        groff_mm_works=yes
95496aec45a7Smrg    else
95506aec45a7Smrg        groff_mm_works=no
95516aec45a7Smrg    fi
95526aec45a7Smrg    AC_MSG_RESULT([$groff_mm_works])
95536aec45a7Smrgfi
95546aec45a7Smrg
95556aec45a7Smrg# We have groff, test for HTML dependencies, one command per package
95566aec45a7Smrgif test "x$have_groff" = x"yes"; then
95576aec45a7Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
95586aec45a7Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
95596aec45a7Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
95606aec45a7Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
95616aec45a7Smrg      have_groff_html=yes
95626aec45a7Smrg   else
95636aec45a7Smrg      have_groff_html=no
95646aec45a7Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
95656aec45a7Smrg   fi
95666aec45a7Smrgfi
95676aec45a7Smrg
95686aec45a7Smrg# Set Automake conditionals for Makefiles
95696aec45a7SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
95706aec45a7SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
95716aec45a7SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
95726aec45a7SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
95736aec45a7Smrg]) # XORG_WITH_GROFF
95746aec45a7Smrg
9575aa9e3350Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
9576aa9e3350Smrg# ---------------------------------------
95776aec45a7Smrg# Minimum version: 1.6.0
95786aec45a7Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9579aa9e3350Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
95806aec45a7Smrg#
95816aec45a7Smrg# Documentation tools are not always available on all platforms and sometimes
95826aec45a7Smrg# not at the appropriate level. This macro enables a module to test for the
95836aec45a7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
95846aec45a7Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
95856aec45a7Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
95866aec45a7Smrg# --with-fop assumes 'auto'.
95876aec45a7Smrg#
95886aec45a7Smrg# Interface to module:
95896aec45a7Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
95906aec45a7Smrg# FOP:	 	returns the path of the fop program found
95916aec45a7Smrg#		returns the path set by the user in the environment
95926aec45a7Smrg# --with-fop: 	'yes' user instructs the module to use fop
95936aec45a7Smrg#		'no' user instructs the module not to use fop
95946aec45a7Smrg#
95956aec45a7Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
95966aec45a7Smrg#
95976aec45a7SmrgAC_DEFUN([XORG_WITH_FOP],[
95986aec45a7SmrgAC_ARG_VAR([FOP], [Path to fop command])
9599aa9e3350Smrgm4_define([_defopt], m4_default([$2], [auto]))
96006aec45a7SmrgAC_ARG_WITH(fop,
96016aec45a7Smrg	AS_HELP_STRING([--with-fop],
96026aec45a7Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
96036aec45a7Smrg	   [use_fop=$withval], [use_fop=]_defopt)
96046aec45a7Smrgm4_undefine([_defopt])
96056aec45a7Smrg
96066aec45a7Smrgif test "x$use_fop" = x"auto"; then
96076aec45a7Smrg   AC_PATH_PROG([FOP], [fop])
96086aec45a7Smrg   if test "x$FOP" = "x"; then
96096aec45a7Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
96106aec45a7Smrg	have_fop=no
96116aec45a7Smrg   else
96126aec45a7Smrg        have_fop=yes
96136aec45a7Smrg   fi
96146aec45a7Smrgelif test "x$use_fop" = x"yes" ; then
96156aec45a7Smrg   AC_PATH_PROG([FOP], [fop])
96166aec45a7Smrg   if test "x$FOP" = "x"; then
96176aec45a7Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
96186aec45a7Smrg   fi
96196aec45a7Smrg   have_fop=yes
96206aec45a7Smrgelif test "x$use_fop" = x"no" ; then
96216aec45a7Smrg   if test "x$FOP" != "x"; then
96226aec45a7Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
96236aec45a7Smrg   fi
96246aec45a7Smrg   have_fop=no
96256aec45a7Smrgelse
96266aec45a7Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
96276aec45a7Smrgfi
9628aa9e3350Smrg
9629aa9e3350Smrg# Test for a minimum version of fop, if provided.
9630aa9e3350Smrgm4_ifval([$1],
9631aa9e3350Smrg[if test "$have_fop" = yes; then
9632aa9e3350Smrg    # scrape the fop version
9633aa9e3350Smrg    AC_MSG_CHECKING([for fop minimum version])
9634aa9e3350Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
9635aa9e3350Smrg    AC_MSG_RESULT([$fop_version])
9636aa9e3350Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
9637aa9e3350Smrg        [if test "x$use_fop" = xauto; then
9638aa9e3350Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
9639aa9e3350Smrg            have_fop=no
9640aa9e3350Smrg        else
9641aa9e3350Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
9642aa9e3350Smrg        fi])
9643aa9e3350Smrgfi])
96446aec45a7SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
96456aec45a7Smrg]) # XORG_WITH_FOP
96466aec45a7Smrg
96476aec45a7Smrg# XORG_WITH_PS2PDF([DEFAULT])
96486aec45a7Smrg# ----------------
96496aec45a7Smrg# Minimum version: 1.6.0
96506aec45a7Smrg# Minimum version for optional DEFAULT argument: 1.11.0
96516aec45a7Smrg#
96526aec45a7Smrg# Documentation tools are not always available on all platforms and sometimes
96536aec45a7Smrg# not at the appropriate level. This macro enables a module to test for the
96546aec45a7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
96556aec45a7Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
96566aec45a7Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
96576aec45a7Smrg# --with-ps2pdf assumes 'auto'.
96586aec45a7Smrg#
96596aec45a7Smrg# Interface to module:
96606aec45a7Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
96616aec45a7Smrg# PS2PDF:	returns the path of the ps2pdf program found
96626aec45a7Smrg#		returns the path set by the user in the environment
96636aec45a7Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
96646aec45a7Smrg#		 'no' user instructs the module not to use ps2pdf
96656aec45a7Smrg#
96666aec45a7Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
96676aec45a7Smrg#
96686aec45a7SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
96696aec45a7SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
96706aec45a7Smrgm4_define([_defopt], m4_default([$1], [auto]))
96716aec45a7SmrgAC_ARG_WITH(ps2pdf,
96726aec45a7Smrg	AS_HELP_STRING([--with-ps2pdf],
96736aec45a7Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
96746aec45a7Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
96756aec45a7Smrgm4_undefine([_defopt])
96766aec45a7Smrg
96776aec45a7Smrgif test "x$use_ps2pdf" = x"auto"; then
96786aec45a7Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
96796aec45a7Smrg   if test "x$PS2PDF" = "x"; then
96806aec45a7Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
96816aec45a7Smrg	have_ps2pdf=no
96826aec45a7Smrg   else
96836aec45a7Smrg        have_ps2pdf=yes
96846aec45a7Smrg   fi
96856aec45a7Smrgelif test "x$use_ps2pdf" = x"yes" ; then
96866aec45a7Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
96876aec45a7Smrg   if test "x$PS2PDF" = "x"; then
96886aec45a7Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
96896aec45a7Smrg   fi
96906aec45a7Smrg   have_ps2pdf=yes
96916aec45a7Smrgelif test "x$use_ps2pdf" = x"no" ; then
96926aec45a7Smrg   if test "x$PS2PDF" != "x"; then
96936aec45a7Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
96946aec45a7Smrg   fi
96956aec45a7Smrg   have_ps2pdf=no
96966aec45a7Smrgelse
96976aec45a7Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
96986aec45a7Smrgfi
96996aec45a7SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
97006aec45a7Smrg]) # XORG_WITH_PS2PDF
97016aec45a7Smrg
97026aec45a7Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
97036aec45a7Smrg# ----------------
97046aec45a7Smrg# Minimum version: 1.6.0
97056aec45a7Smrg#
97066aec45a7Smrg# Documentation tools are not always available on all platforms and sometimes
97076aec45a7Smrg# not at the appropriate level. This macro enables a builder to skip all
97086aec45a7Smrg# documentation targets except traditional man pages.
97096aec45a7Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
97106aec45a7Smrg# maximum flexibilty in controlling documentation building.
97116aec45a7Smrg# Refer to:
97126aec45a7Smrg# XORG_WITH_XMLTO         --with-xmlto
97136aec45a7Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
97146aec45a7Smrg# XORG_WITH_DOXYGEN       --with-doxygen
97156aec45a7Smrg# XORG_WITH_FOP           --with-fop
97166aec45a7Smrg# XORG_WITH_GROFF         --with-groff
97176aec45a7Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
97186aec45a7Smrg#
97196aec45a7Smrg# Interface to module:
97206aec45a7Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
97216aec45a7Smrg# --enable-docs: 'yes' user instructs the module to generate docs
97226aec45a7Smrg#		 'no' user instructs the module not to generate docs
97236aec45a7Smrg# parm1:	specify the default value, yes or no.
97246aec45a7Smrg#
97256aec45a7SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
9726aa9e3350Smrgm4_define([docs_default], m4_default([$1], [yes]))
97276aec45a7SmrgAC_ARG_ENABLE(docs,
97286aec45a7Smrg	AS_HELP_STRING([--enable-docs],
9729aa9e3350Smrg	   [Enable building the documentation (default: ]docs_default[)]),
9730aa9e3350Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
9731aa9e3350Smrgm4_undefine([docs_default])
97326aec45a7SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
97336aec45a7SmrgAC_MSG_CHECKING([whether to build documentation])
97346aec45a7SmrgAC_MSG_RESULT([$build_docs])
97356aec45a7Smrg]) # XORG_ENABLE_DOCS
97366aec45a7Smrg
97376aec45a7Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
97386aec45a7Smrg# ----------------
97396aec45a7Smrg# Minimum version: 1.6.0
97406aec45a7Smrg#
97416aec45a7Smrg# This macro enables a builder to skip all developer documentation.
97426aec45a7Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
97436aec45a7Smrg# maximum flexibilty in controlling documentation building.
97446aec45a7Smrg# Refer to:
97456aec45a7Smrg# XORG_WITH_XMLTO         --with-xmlto
97466aec45a7Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
97476aec45a7Smrg# XORG_WITH_DOXYGEN       --with-doxygen
97486aec45a7Smrg# XORG_WITH_FOP           --with-fop
97496aec45a7Smrg# XORG_WITH_GROFF         --with-groff
97506aec45a7Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
97516aec45a7Smrg#
97526aec45a7Smrg# Interface to module:
97536aec45a7Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
97546aec45a7Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
97556aec45a7Smrg#			'no' user instructs the module not to generate developer docs
97566aec45a7Smrg# parm1:		specify the default value, yes or no.
97576aec45a7Smrg#
97586aec45a7SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
97596aec45a7Smrgm4_define([devel_default], m4_default([$1], [yes]))
97606aec45a7SmrgAC_ARG_ENABLE(devel-docs,
97616aec45a7Smrg	AS_HELP_STRING([--enable-devel-docs],
97626aec45a7Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
97636aec45a7Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
97646aec45a7Smrgm4_undefine([devel_default])
97656aec45a7SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
97666aec45a7SmrgAC_MSG_CHECKING([whether to build developer documentation])
97676aec45a7SmrgAC_MSG_RESULT([$build_devel_docs])
97686aec45a7Smrg]) # XORG_ENABLE_DEVEL_DOCS
97696aec45a7Smrg
97706aec45a7Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
97716aec45a7Smrg# ----------------
97726aec45a7Smrg# Minimum version: 1.6.0
97736aec45a7Smrg#
97746aec45a7Smrg# This macro enables a builder to skip all functional specification targets.
97756aec45a7Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
97766aec45a7Smrg# maximum flexibilty in controlling documentation building.
97776aec45a7Smrg# Refer to:
97786aec45a7Smrg# XORG_WITH_XMLTO         --with-xmlto
97796aec45a7Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
97806aec45a7Smrg# XORG_WITH_DOXYGEN       --with-doxygen
97816aec45a7Smrg# XORG_WITH_FOP           --with-fop
97826aec45a7Smrg# XORG_WITH_GROFF         --with-groff
97836aec45a7Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
97846aec45a7Smrg#
97856aec45a7Smrg# Interface to module:
97866aec45a7Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
97876aec45a7Smrg# --enable-specs:	'yes' user instructs the module to generate specs
97886aec45a7Smrg#			'no' user instructs the module not to generate specs
97896aec45a7Smrg# parm1:		specify the default value, yes or no.
97906aec45a7Smrg#
97916aec45a7SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
97926aec45a7Smrgm4_define([spec_default], m4_default([$1], [yes]))
97936aec45a7SmrgAC_ARG_ENABLE(specs,
97946aec45a7Smrg	AS_HELP_STRING([--enable-specs],
97956aec45a7Smrg	   [Enable building the specs (default: ]spec_default[)]),
97966aec45a7Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
97976aec45a7Smrgm4_undefine([spec_default])
97986aec45a7SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
97996aec45a7SmrgAC_MSG_CHECKING([whether to build functional specifications])
98006aec45a7SmrgAC_MSG_RESULT([$build_specs])
98016aec45a7Smrg]) # XORG_ENABLE_SPECS
98026aec45a7Smrg
9803aa9e3350Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
9804aa9e3350Smrg# ----------------------------------------------
9805aa9e3350Smrg# Minimum version: 1.13.0
9806aa9e3350Smrg#
9807aa9e3350Smrg# This macro enables a builder to enable/disable unit testing
9808aa9e3350Smrg# It makes no assumption about the test cases implementation
9809aa9e3350Smrg# Test cases may or may not use Automake "Support for test suites"
9810aa9e3350Smrg# They may or may not use the software utility library GLib
9811aa9e3350Smrg#
9812aa9e3350Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
9813aa9e3350Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
9814aa9e3350Smrg# The variable enable_unit_tests is used by other macros in this file.
9815aa9e3350Smrg#
9816aa9e3350Smrg# Interface to module:
9817aa9e3350Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
9818aa9e3350Smrg# enable_unit_tests:    used in configure.ac for additional configuration
9819aa9e3350Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
9820aa9e3350Smrg#			'no' user instructs the module not to build tests
9821aa9e3350Smrg# parm1:		specify the default value, yes or no.
9822aa9e3350Smrg#
9823aa9e3350SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
9824aa9e3350SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
9825aa9e3350SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
9826aa9e3350SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
9827aa9e3350Smrgm4_define([_defopt], m4_default([$1], [auto]))
9828aa9e3350SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
9829aa9e3350Smrg	[Enable building unit test cases (default: ]_defopt[)]),
9830aa9e3350Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
9831aa9e3350Smrgm4_undefine([_defopt])
9832aa9e3350SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
9833aa9e3350SmrgAC_MSG_CHECKING([whether to build unit test cases])
9834aa9e3350SmrgAC_MSG_RESULT([$enable_unit_tests])
9835aa9e3350Smrg]) # XORG_ENABLE_UNIT_TESTS
9836aa9e3350Smrg
9837aa9e3350Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
9838aa9e3350Smrg# ------------------------------------------------------
9839aa9e3350Smrg# Minimum version: 1.17.0
9840aa9e3350Smrg#
9841aa9e3350Smrg# This macro enables a builder to enable/disable integration testing
9842aa9e3350Smrg# It makes no assumption about the test cases' implementation
9843aa9e3350Smrg# Test cases may or may not use Automake "Support for test suites"
9844aa9e3350Smrg#
9845aa9e3350Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
9846aa9e3350Smrg# usually requires less dependencies and may be built and run under less
9847aa9e3350Smrg# stringent environments than integration tests.
9848aa9e3350Smrg#
9849aa9e3350Smrg# Interface to module:
9850aa9e3350Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
9851aa9e3350Smrg# enable_integration_tests:   used in configure.ac for additional configuration
9852aa9e3350Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
9853aa9e3350Smrg#                             'no' user instructs the module not to build tests
9854aa9e3350Smrg# parm1:                      specify the default value, yes or no.
9855aa9e3350Smrg#
9856aa9e3350SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
9857aa9e3350SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
9858aa9e3350Smrgm4_define([_defopt], m4_default([$1], [auto]))
9859aa9e3350SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
9860aa9e3350Smrg	[Enable building integration test cases (default: ]_defopt[)]),
9861aa9e3350Smrg	[enable_integration_tests=$enableval],
9862aa9e3350Smrg	[enable_integration_tests=]_defopt)
9863aa9e3350Smrgm4_undefine([_defopt])
9864aa9e3350SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
9865aa9e3350Smrg	[test "x$enable_integration_tests" != xno])
9866aa9e3350SmrgAC_MSG_CHECKING([whether to build unit test cases])
9867aa9e3350SmrgAC_MSG_RESULT([$enable_integration_tests])
9868aa9e3350Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
9869aa9e3350Smrg
9870aa9e3350Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
9871aa9e3350Smrg# ----------------------------------------
9872aa9e3350Smrg# Minimum version: 1.13.0
9873aa9e3350Smrg#
9874aa9e3350Smrg# GLib is a library which provides advanced data structures and functions.
9875aa9e3350Smrg# This macro enables a module to test for the presence of Glib.
9876aa9e3350Smrg#
9877aa9e3350Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
9878aa9e3350Smrg# Otherwise the value of $enable_unit_tests is blank.
9879aa9e3350Smrg#
9880aa9e3350Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
9881aa9e3350Smrg# test support usually requires less dependencies and may be built and run under
9882aa9e3350Smrg# less stringent environments than integration tests.
9883aa9e3350Smrg#
9884aa9e3350Smrg# Interface to module:
9885aa9e3350Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
9886aa9e3350Smrg# with_glib: used in configure.ac to know if GLib has been found
9887aa9e3350Smrg# --with-glib:	'yes' user instructs the module to use glib
9888aa9e3350Smrg#		'no' user instructs the module not to use glib
9889aa9e3350Smrg#
9890aa9e3350SmrgAC_DEFUN([XORG_WITH_GLIB],[
9891aa9e3350SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
9892aa9e3350Smrgm4_define([_defopt], m4_default([$2], [auto]))
9893aa9e3350SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
9894aa9e3350Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
9895aa9e3350Smrg	[with_glib=$withval], [with_glib=]_defopt)
9896aa9e3350Smrgm4_undefine([_defopt])
9897aa9e3350Smrg
9898aa9e3350Smrghave_glib=no
9899aa9e3350Smrg# Do not probe GLib if user explicitly disabled unit testing
9900aa9e3350Smrgif test "x$enable_unit_tests" != x"no"; then
9901aa9e3350Smrg  # Do not probe GLib if user explicitly disabled it
9902aa9e3350Smrg  if test "x$with_glib" != x"no"; then
9903aa9e3350Smrg    m4_ifval(
9904aa9e3350Smrg      [$1],
9905aa9e3350Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
9906aa9e3350Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
9907aa9e3350Smrg    )
9908aa9e3350Smrg  fi
9909aa9e3350Smrgfi
9910aa9e3350Smrg
9911aa9e3350Smrg# Not having GLib when unit testing has been explicitly requested is an error
9912aa9e3350Smrgif test "x$enable_unit_tests" = x"yes"; then
9913aa9e3350Smrg  if test "x$have_glib" = x"no"; then
9914aa9e3350Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
9915aa9e3350Smrg  fi
9916aa9e3350Smrgfi
9917aa9e3350Smrg
9918aa9e3350Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
9919aa9e3350Smrgif test "x$enable_unit_tests" = x"no"; then
9920aa9e3350Smrg  if test "x$with_glib" = x"yes"; then
9921aa9e3350Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
9922aa9e3350Smrg  fi
9923aa9e3350Smrgfi
9924aa9e3350Smrg
9925aa9e3350Smrg# Not having GLib when it has been explicitly requested is an error
9926aa9e3350Smrgif test "x$with_glib" = x"yes"; then
9927aa9e3350Smrg  if test "x$have_glib" = x"no"; then
9928aa9e3350Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
9929aa9e3350Smrg  fi
9930aa9e3350Smrgfi
9931aa9e3350Smrg
9932aa9e3350SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
9933aa9e3350Smrg]) # XORG_WITH_GLIB
9934aa9e3350Smrg
9935aa9e3350Smrg# XORG_LD_WRAP([required|optional])
9936aa9e3350Smrg# ---------------------------------
9937aa9e3350Smrg# Minimum version: 1.13.0
9938aa9e3350Smrg#
9939aa9e3350Smrg# Check if linker supports -wrap, passed via compiler flags
9940aa9e3350Smrg#
9941aa9e3350Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
9942aa9e3350Smrg# Otherwise the value of $enable_unit_tests is blank.
9943aa9e3350Smrg#
9944aa9e3350Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
9945aa9e3350Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
9946aa9e3350Smrg# available, an argument of "optional" allows use when some unit tests require
9947aa9e3350Smrg# ld -wrap and others do not.
9948aa9e3350Smrg#
9949aa9e3350SmrgAC_DEFUN([XORG_LD_WRAP],[
9950aa9e3350SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
9951aa9e3350Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
9952aa9e3350Smrg                      void __wrap_exit(int status) { return; }],
9953aa9e3350Smrg                     [exit(0);])])
9954aa9e3350Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
9955aa9e3350Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
9956aa9e3350Smrg  if test "x$have_ld_wrap" = x"no"; then
9957aa9e3350Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
9958aa9e3350Smrg  fi
9959aa9e3350Smrgfi
9960aa9e3350SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
9961aa9e3350Smrg#
9962aa9e3350Smrg]) # XORG_LD_WRAP
9963aa9e3350Smrg
9964aa9e3350Smrg# XORG_CHECK_LINKER_FLAGS
9965aa9e3350Smrg# -----------------------
9966aa9e3350Smrg# SYNOPSIS
9967aa9e3350Smrg#
9968aa9e3350Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
9969aa9e3350Smrg#
9970aa9e3350Smrg# DESCRIPTION
9971aa9e3350Smrg#
9972aa9e3350Smrg#   Check whether the given linker FLAGS work with the current language's
9973aa9e3350Smrg#   linker, or whether they give an error.
9974aa9e3350Smrg#
9975aa9e3350Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
9976aa9e3350Smrg#   success/failure.
9977aa9e3350Smrg#
9978aa9e3350Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
9979aa9e3350Smrg#
9980aa9e3350Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
9981aa9e3350Smrg#
9982aa9e3350Smrg# LICENSE
9983aa9e3350Smrg#
9984aa9e3350Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
9985aa9e3350Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
9986aa9e3350Smrg#   Copyright (c) 2009 Matteo Frigo
9987aa9e3350Smrg#
9988aa9e3350Smrg#   This program is free software: you can redistribute it and/or modify it
9989aa9e3350Smrg#   under the terms of the GNU General Public License as published by the
9990aa9e3350Smrg#   Free Software Foundation, either version 3 of the License, or (at your
9991aa9e3350Smrg#   option) any later version.
9992aa9e3350Smrg#
9993aa9e3350Smrg#   This program is distributed in the hope that it will be useful, but
9994aa9e3350Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
9995aa9e3350Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
9996aa9e3350Smrg#   Public License for more details.
9997aa9e3350Smrg#
9998aa9e3350Smrg#   You should have received a copy of the GNU General Public License along
9999aa9e3350Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
10000aa9e3350Smrg#
10001aa9e3350Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
10002aa9e3350Smrg#   gives unlimited permission to copy, distribute and modify the configure
10003aa9e3350Smrg#   scripts that are the output of Autoconf when processing the Macro. You
10004aa9e3350Smrg#   need not follow the terms of the GNU General Public License when using
10005aa9e3350Smrg#   or distributing such scripts, even though portions of the text of the
10006aa9e3350Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
10007aa9e3350Smrg#   all other use of the material that constitutes the Autoconf Macro.
10008aa9e3350Smrg#
10009aa9e3350Smrg#   This special exception to the GPL applies to versions of the Autoconf
10010aa9e3350Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
10011aa9e3350Smrg#   modified version of the Autoconf Macro, you may extend this special
10012aa9e3350Smrg#   exception to the GPL to apply to your modified version as well.#
10013aa9e3350SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
10014aa9e3350Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
10015aa9e3350Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
10016aa9e3350SmrgAS_LITERAL_IF([$1],
10017aa9e3350Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
10018aa9e3350Smrg      ax_save_FLAGS=$LDFLAGS
10019aa9e3350Smrg      LDFLAGS="$1"
10020aa9e3350Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
10021aa9e3350Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10022aa9e3350Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10023aa9e3350Smrg      LDFLAGS=$ax_save_FLAGS])],
10024aa9e3350Smrg  [ax_save_FLAGS=$LDFLAGS
10025aa9e3350Smrg   LDFLAGS="$1"
10026aa9e3350Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
10027aa9e3350Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10028aa9e3350Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10029aa9e3350Smrg   LDFLAGS=$ax_save_FLAGS])
10030aa9e3350Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
10031aa9e3350SmrgAC_MSG_RESULT($xorg_check_linker_flags)
10032aa9e3350Smrgif test "x$xorg_check_linker_flags" = xyes; then
10033aa9e3350Smrg	m4_default([$2], :)
10034aa9e3350Smrgelse
10035aa9e3350Smrg	m4_default([$3], :)
10036aa9e3350Smrgfi
10037aa9e3350Smrg]) # XORG_CHECK_LINKER_FLAGS
10038aa9e3350Smrg
10039aa9e3350Smrg# XORG_MEMORY_CHECK_FLAGS
10040aa9e3350Smrg# -----------------------
10041aa9e3350Smrg# Minimum version: 1.16.0
10042aa9e3350Smrg#
10043aa9e3350Smrg# This macro attempts to find appropriate memory checking functionality
10044aa9e3350Smrg# for various platforms which unit testing code may use to catch various
10045aa9e3350Smrg# forms of memory allocation and access errors in testing.
10046aa9e3350Smrg#
10047aa9e3350Smrg# Interface to module:
10048aa9e3350Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
10049aa9e3350Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
10050aa9e3350Smrg#
10051aa9e3350Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
10052aa9e3350Smrg#
10053aa9e3350SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
10054aa9e3350Smrg
10055aa9e3350SmrgAC_REQUIRE([AC_CANONICAL_HOST])
10056aa9e3350SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
10057aa9e3350Smrg           [Environment variables to enable memory checking in tests])
10058aa9e3350Smrg
10059aa9e3350Smrg# Check for different types of support on different platforms
10060aa9e3350Smrgcase $host_os in
10061aa9e3350Smrg    solaris*)
10062aa9e3350Smrg        AC_CHECK_LIB([umem], [umem_alloc],
10063aa9e3350Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
10064aa9e3350Smrg        ;;
10065aa9e3350Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
10066aa9e3350Smrg        # both directly and inverted, so should not be 0 or 255.
10067aa9e3350Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
10068aa9e3350Smrg        ;;
10069aa9e3350Smrg    darwin*)
10070aa9e3350Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
10071aa9e3350Smrg        ;;
10072aa9e3350Smrg    *bsd*)
10073aa9e3350Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
10074aa9e3350Smrg        ;;
10075aa9e3350Smrgesac
10076aa9e3350Smrg
10077aa9e3350Smrg# User supplied flags override default flags
10078aa9e3350Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
10079aa9e3350Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
10080aa9e3350Smrgfi
10081aa9e3350Smrg
10082aa9e3350SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
10083aa9e3350Smrg]) # XORG_WITH_LINT
10084aa9e3350Smrg
100858697ee19Smrg# XORG_CHECK_MALLOC_ZERO
100868697ee19Smrg# ----------------------
100878697ee19Smrg# Minimum version: 1.0.0
10088ab47cfaaSmrg#
100898697ee19Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
100908697ee19Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
100918697ee19Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
100928697ee19SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
100938697ee19SmrgAC_ARG_ENABLE(malloc0returnsnull,
100946aec45a7Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
100958697ee19Smrg		       [malloc(0) returns NULL (default: auto)]),
100968697ee19Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
100978697ee19Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
10098ab47cfaaSmrg
100998697ee19SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
101008697ee19Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
10101aa9e3350Smrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
10102aa9e3350Smrg#include <stdlib.h>
10103aa9e3350Smrg],[
101048697ee19Smrg    char *m0, *r0, *c0, *p;
101058697ee19Smrg    m0 = malloc(0);
101068697ee19Smrg    p = malloc(10);
101078697ee19Smrg    r0 = realloc(p,0);
10108aa9e3350Smrg    c0 = calloc(0,10);
10109aa9e3350Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
10110aa9e3350Smrg])],
101118697ee19Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
101126aec45a7Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
101136aec45a7Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
10114ab47cfaaSmrgfi
101158697ee19SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
101168697ee19Smrg
101178697ee19Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
101188697ee19Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
101198697ee19Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
101208697ee19Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
101218697ee19Smrgelse
101228697ee19Smrg	MALLOC_ZERO_CFLAGS=""
101238697ee19Smrg	XMALLOC_ZERO_CFLAGS=""
101248697ee19Smrg	XTMALLOC_ZERO_CFLAGS=""
10125ab47cfaaSmrgfi
10126ab47cfaaSmrg
101278697ee19SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
101288697ee19SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
101298697ee19SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
101308697ee19Smrg]) # XORG_CHECK_MALLOC_ZERO
10131ab47cfaaSmrg
101328697ee19Smrg# XORG_WITH_LINT()
101338697ee19Smrg# ----------------
101348697ee19Smrg# Minimum version: 1.1.0
10135ab47cfaaSmrg#
101366aec45a7Smrg# This macro enables the use of a tool that flags some suspicious and
101376aec45a7Smrg# non-portable constructs (likely to be bugs) in C language source code.
101386aec45a7Smrg# It will attempt to locate the tool and use appropriate options.
101396aec45a7Smrg# There are various lint type tools on different platforms.
101406aec45a7Smrg#
101416aec45a7Smrg# Interface to module:
101426aec45a7Smrg# LINT:		returns the path to the tool found on the platform
101436aec45a7Smrg#		or the value set to LINT on the configure cmd line
101446aec45a7Smrg#		also an Automake conditional
101456aec45a7Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
101466aec45a7Smrg#
101476aec45a7Smrg# --with-lint:	'yes' user instructs the module to use lint
101486aec45a7Smrg#		'no' user instructs the module not to use lint (default)
101496aec45a7Smrg#
101506aec45a7Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
101516aec45a7Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
101528697ee19Smrg#
101538697ee19SmrgAC_DEFUN([XORG_WITH_LINT],[
10154ab47cfaaSmrg
101556aec45a7SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
101566aec45a7SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
101576aec45a7SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
101588697ee19Smrg		[Use a lint-style source code checker (default: disabled)])],
101598697ee19Smrg		[use_lint=$withval], [use_lint=no])
101606aec45a7Smrg
101616aec45a7Smrg# Obtain platform specific info like program name and options
101626aec45a7Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
101636aec45a7Smrgcase $host_os in
101646aec45a7Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
101656aec45a7Smrg	lint_name=splint
101666aec45a7Smrg	lint_options="-badflag"
101676aec45a7Smrg	;;
101686aec45a7Smrg  *freebsd* | *netbsd*)
101696aec45a7Smrg	lint_name=lint
101706aec45a7Smrg	lint_options="-u -b"
101716aec45a7Smrg	;;
101726aec45a7Smrg  *solaris*)
101736aec45a7Smrg	lint_name=lint
101746aec45a7Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
101756aec45a7Smrg	;;
101766aec45a7Smrgesac
101776aec45a7Smrg
101786aec45a7Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
101796aec45a7Smrgif test "x$use_lint" = x"yes" ; then
101806aec45a7Smrg   AC_PATH_PROG([LINT], [$lint_name])
101816aec45a7Smrg   if test "x$LINT" = "x"; then
101826aec45a7Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
101836aec45a7Smrg   fi
101846aec45a7Smrgelif test "x$use_lint" = x"no" ; then
101856aec45a7Smrg   if test "x$LINT" != "x"; then
101866aec45a7Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
101876aec45a7Smrg   fi
10188ab47cfaaSmrgelse
101896aec45a7Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
101908697ee19Smrgfi
101916aec45a7Smrg
101926aec45a7Smrg# User supplied flags override default flags
101936aec45a7Smrgif test "x$LINT_FLAGS" != "x"; then
101946aec45a7Smrg   lint_options=$LINT_FLAGS
10195ab47cfaaSmrgfi
10196ab47cfaaSmrg
101976aec45a7SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
101986aec45a7SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
10199ab47cfaaSmrg
102008697ee19Smrg]) # XORG_WITH_LINT
102018697ee19Smrg
102028697ee19Smrg# XORG_LINT_LIBRARY(LIBNAME)
102038697ee19Smrg# --------------------------
102048697ee19Smrg# Minimum version: 1.1.0
10205ab47cfaaSmrg#
102068697ee19Smrg# Sets up flags for building lint libraries for checking programs that call
102078697ee19Smrg# functions in the library.
10208ab47cfaaSmrg#
102096aec45a7Smrg# Interface to module:
102106aec45a7Smrg# LINTLIB		- Automake variable with the name of lint library file to make
102116aec45a7Smrg# MAKE_LINT_LIB		- Automake conditional
102126aec45a7Smrg#
102136aec45a7Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
102146aec45a7Smrg#			  - 'no' user instructs the module not to create a lint library (default)
102158697ee19Smrg
102168697ee19SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
102178697ee19SmrgAC_REQUIRE([XORG_WITH_LINT])
102186aec45a7SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
102198697ee19Smrg	[Create lint library (default: disabled)])],
102208697ee19Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
102216aec45a7Smrg
102226aec45a7Smrgif test "x$make_lint_lib" = x"yes" ; then
102236aec45a7Smrg   LINTLIB=llib-l$1.ln
102246aec45a7Smrg   if test "x$LINT" = "x"; then
102256aec45a7Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
102266aec45a7Smrg   fi
102276aec45a7Smrgelif test "x$make_lint_lib" != x"no" ; then
102286aec45a7Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
10229ab47cfaaSmrgfi
102306aec45a7Smrg
102318697ee19SmrgAC_SUBST(LINTLIB)
102328697ee19SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
10233ab47cfaaSmrg
102348697ee19Smrg]) # XORG_LINT_LIBRARY
10235ab47cfaaSmrg
10236aa9e3350Smrg# XORG_COMPILER_BRAND
10237aa9e3350Smrg# -------------------
10238aa9e3350Smrg# Minimum version: 1.14.0
10239aa9e3350Smrg#
10240aa9e3350Smrg# Checks for various brands of compilers and sets flags as appropriate:
10241aa9e3350Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
10242aa9e3350Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
10243aa9e3350Smrg#   clang compiler - sets CLANGCC to "yes"
10244aa9e3350Smrg#   Intel compiler - sets INTELCC to "yes"
10245aa9e3350Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
10246aa9e3350Smrg#
10247aa9e3350SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
10248aa9e3350SmrgAC_LANG_CASE(
10249aa9e3350Smrg	[C], [
10250aa9e3350Smrg		AC_REQUIRE([AC_PROG_CC_C99])
10251aa9e3350Smrg	],
10252aa9e3350Smrg	[C++], [
10253aa9e3350Smrg		AC_REQUIRE([AC_PROG_CXX])
10254aa9e3350Smrg	]
10255aa9e3350Smrg)
10256aa9e3350SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
10257aa9e3350SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
10258aa9e3350SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
10259aa9e3350Smrg]) # XORG_COMPILER_BRAND
10260aa9e3350Smrg
10261aa9e3350Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
10262aa9e3350Smrg# ---------------
10263aa9e3350Smrg# Minimum version: 1.16.0
10264aa9e3350Smrg#
10265aa9e3350Smrg# Test if the compiler works when passed the given flag as a command line argument.
10266aa9e3350Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
10267aa9e3350Smrg# next flag in the list until there are no more options.
10268aa9e3350Smrg#
10269aa9e3350Smrg# Note that this does not guarantee that the compiler supports the flag as some
10270aa9e3350Smrg# compilers will simply ignore arguments that they do not understand, but we do
10271aa9e3350Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
10272aa9e3350Smrg# -Werror=unused-command-line-argument
10273aa9e3350Smrg#
10274aa9e3350SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
10275aa9e3350Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10276aa9e3350Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10277aa9e3350Smrg
10278aa9e3350SmrgAC_LANG_COMPILER_REQUIRE
10279aa9e3350Smrg
10280aa9e3350SmrgAC_LANG_CASE(
10281aa9e3350Smrg	[C], [
10282aa9e3350Smrg		AC_REQUIRE([AC_PROG_CC_C99])
10283aa9e3350Smrg		define([PREFIX], [C])
10284aa9e3350Smrg		define([CACHE_PREFIX], [cc])
10285aa9e3350Smrg		define([COMPILER], [$CC])
10286aa9e3350Smrg	],
10287aa9e3350Smrg	[C++], [
10288aa9e3350Smrg		define([PREFIX], [CXX])
10289aa9e3350Smrg		define([CACHE_PREFIX], [cxx])
10290aa9e3350Smrg		define([COMPILER], [$CXX])
10291aa9e3350Smrg	]
10292aa9e3350Smrg)
10293aa9e3350Smrg
10294aa9e3350Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
10295aa9e3350Smrg
10296aa9e3350Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
10297aa9e3350Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10298aa9e3350Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
10299aa9e3350Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
10300aa9e3350Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10301aa9e3350Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
10302aa9e3350Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
10303aa9e3350Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
10304aa9e3350Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10305aa9e3350Smrgfi
10306aa9e3350Smrg
10307aa9e3350Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
10308aa9e3350Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
10309aa9e3350Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10310aa9e3350Smrg	fi
10311aa9e3350Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10312aa9e3350Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
10313aa9e3350Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
10314aa9e3350Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10315aa9e3350Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
10316aa9e3350Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
10317aa9e3350Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
10318aa9e3350Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10319aa9e3350Smrgfi
10320aa9e3350Smrg
10321aa9e3350Smrgfound="no"
10322aa9e3350Smrgm4_foreach([flag], m4_cdr($@), [
10323aa9e3350Smrg	if test $found = "no" ; then
10324aa9e3350Smrg		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
10325aa9e3350Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10326aa9e3350Smrg		fi
10327aa9e3350Smrg
10328aa9e3350Smrg		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
10329aa9e3350Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10330aa9e3350Smrg		fi
10331aa9e3350Smrg
10332aa9e3350Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
10333aa9e3350Smrg
10334aa9e3350Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
1033538770048Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports]flag[])
10336aa9e3350Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
10337aa9e3350Smrg		AC_CACHE_VAL($cacheid,
10338aa9e3350Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
10339aa9e3350Smrg					     [eval $cacheid=yes],
10340aa9e3350Smrg					     [eval $cacheid=no])])
10341aa9e3350Smrg
10342aa9e3350Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10343aa9e3350Smrg
10344aa9e3350Smrg		eval supported=\$$cacheid
10345aa9e3350Smrg		AC_MSG_RESULT([$supported])
10346aa9e3350Smrg		if test "$supported" = "yes" ; then
10347aa9e3350Smrg			$1="$$1 ]flag["
10348aa9e3350Smrg			found="yes"
10349aa9e3350Smrg		fi
10350aa9e3350Smrg	fi
10351aa9e3350Smrg])
10352aa9e3350Smrg]) # XORG_TESTSET_CFLAG
10353aa9e3350Smrg
10354aa9e3350Smrg# XORG_COMPILER_FLAGS
10355aa9e3350Smrg# ---------------
10356aa9e3350Smrg# Minimum version: 1.16.0
10357aa9e3350Smrg#
10358aa9e3350Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
10359aa9e3350Smrg# arguments supported by the selected compiler which do NOT alter the generated
10360aa9e3350Smrg# code.  These arguments will cause the compiler to print various warnings
10361aa9e3350Smrg# during compilation AND turn a conservative set of warnings into errors.
10362aa9e3350Smrg#
10363aa9e3350Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
10364aa9e3350Smrg# future versions of util-macros as options are added to new compilers.
10365aa9e3350Smrg#
10366aa9e3350SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
10367aa9e3350SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
10368aa9e3350Smrg
10369aa9e3350SmrgAC_ARG_ENABLE(selective-werror,
10370aa9e3350Smrg              AS_HELP_STRING([--disable-selective-werror],
10371aa9e3350Smrg                             [Turn off selective compiler errors. (default: enabled)]),
10372aa9e3350Smrg              [SELECTIVE_WERROR=$enableval],
10373aa9e3350Smrg              [SELECTIVE_WERROR=yes])
10374aa9e3350Smrg
10375aa9e3350SmrgAC_LANG_CASE(
10376aa9e3350Smrg        [C], [
10377aa9e3350Smrg                define([PREFIX], [C])
10378aa9e3350Smrg        ],
10379aa9e3350Smrg        [C++], [
10380aa9e3350Smrg                define([PREFIX], [CXX])
10381aa9e3350Smrg        ]
10382aa9e3350Smrg)
10383aa9e3350Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
10384aa9e3350Smrgif test "x$SUNCC" = "xyes"; then
10385aa9e3350Smrg    [BASE_]PREFIX[FLAGS]="-v"
10386aa9e3350Smrgelse
10387aa9e3350Smrg    [BASE_]PREFIX[FLAGS]=""
10388aa9e3350Smrgfi
10389aa9e3350Smrg
10390aa9e3350Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
10391aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
10392aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
10393aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
10394aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
10395aa9e3350Smrg
10396aa9e3350SmrgAC_LANG_CASE(
10397aa9e3350Smrg	[C], [
10398aa9e3350Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
10399aa9e3350Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
10400aa9e3350Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
10401aa9e3350Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
10402aa9e3350Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
10403aa9e3350Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
10404aa9e3350Smrg	]
10405aa9e3350Smrg)
10406aa9e3350Smrg
10407aa9e3350Smrg# This chunk adds additional warnings that could catch undesired effects.
10408aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
10409aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
10410aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
10411aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
10412aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
10413aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
10414aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
10415aa9e3350Smrg
10416aa9e3350Smrg# These are currently disabled because they are noisy.  They will be enabled
10417aa9e3350Smrg# in the future once the codebase is sufficiently modernized to silence
10418aa9e3350Smrg# them.  For now, I don't want them to drown out the other warnings.
10419aa9e3350Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
10420aa9e3350Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
10421aa9e3350Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
10422aa9e3350Smrg
10423aa9e3350Smrg# Turn some warnings into errors, so we don't accidently get successful builds
10424aa9e3350Smrg# when there are problems that should be fixed.
10425aa9e3350Smrg
10426aa9e3350Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
10427aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
10428aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
10429aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
10430aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
10431aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
10432aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
10433aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
10434aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
10435aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
10436aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
10437aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
10438aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
10439aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
10440aa9e3350Smrgelse
10441aa9e3350SmrgAC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors.  This should not be necessary.  Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
10442aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
10443aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
10444aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
10445aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
10446aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
10447aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
10448aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
10449aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
10450aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
10451aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
10452aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
10453aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
10454aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
10455aa9e3350Smrgfi
10456aa9e3350Smrg
10457aa9e3350SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
10458aa9e3350Smrg]) # XORG_COMPILER_FLAGS
10459aa9e3350Smrg
104601473d951Smrg# XORG_CWARNFLAGS
104611473d951Smrg# ---------------
104621473d951Smrg# Minimum version: 1.2.0
10463aa9e3350Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
104641473d951Smrg#
104651473d951Smrg# Defines CWARNFLAGS to enable C compiler warnings.
104661473d951Smrg#
10467aa9e3350Smrg# This function is deprecated because it defines -fno-strict-aliasing
10468aa9e3350Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
10469aa9e3350Smrg# is needed, then it should be added explicitly in the module when
10470aa9e3350Smrg# it is updated to use BASE_CFLAGS.
10471aa9e3350Smrg#
104721473d951SmrgAC_DEFUN([XORG_CWARNFLAGS], [
10473aa9e3350SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
10474aa9e3350SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
10475aa9e3350SmrgAC_LANG_CASE(
10476aa9e3350Smrg	[C], [
10477aa9e3350Smrg		CWARNFLAGS="$BASE_CFLAGS"
10478aa9e3350Smrg		if  test "x$GCC" = xyes ; then
10479aa9e3350Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
10480aa9e3350Smrg		fi
10481aa9e3350Smrg		AC_SUBST(CWARNFLAGS)
10482aa9e3350Smrg	]
10483aa9e3350Smrg)
104841473d951Smrg]) # XORG_CWARNFLAGS
104856aec45a7Smrg
104866aec45a7Smrg# XORG_STRICT_OPTION
104876aec45a7Smrg# -----------------------
104886aec45a7Smrg# Minimum version: 1.3.0
104896aec45a7Smrg#
10490aa9e3350Smrg# Add configure option to enable strict compilation flags, such as treating
10491aa9e3350Smrg# warnings as fatal errors.
10492aa9e3350Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
10493aa9e3350Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
10494aa9e3350Smrg#
10495aa9e3350Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
10496aa9e3350Smrg# when strict compilation is unconditionally desired.
104976aec45a7SmrgAC_DEFUN([XORG_STRICT_OPTION], [
104986aec45a7SmrgAC_REQUIRE([XORG_CWARNFLAGS])
10499aa9e3350SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
105006aec45a7Smrg
105016aec45a7SmrgAC_ARG_ENABLE(strict-compilation,
105026aec45a7Smrg			  AS_HELP_STRING([--enable-strict-compilation],
105036aec45a7Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
105046aec45a7Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
10505aa9e3350Smrg
10506aa9e3350SmrgAC_LANG_CASE(
10507aa9e3350Smrg        [C], [
10508aa9e3350Smrg                define([PREFIX], [C])
10509aa9e3350Smrg        ],
10510aa9e3350Smrg        [C++], [
10511aa9e3350Smrg                define([PREFIX], [CXX])
10512aa9e3350Smrg        ]
10513aa9e3350Smrg)
10514aa9e3350Smrg
10515aa9e3350Smrg[STRICT_]PREFIX[FLAGS]=""
10516aa9e3350SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
10517aa9e3350SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
10518aa9e3350Smrg
10519aa9e3350Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
10520aa9e3350Smrg# activate it with -Werror, so we add it here explicitly.
10521aa9e3350SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
10522aa9e3350Smrg
105236aec45a7Smrgif test "x$STRICT_COMPILE" = "xyes"; then
10524aa9e3350Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
10525aa9e3350Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
105266aec45a7Smrgfi
10527aa9e3350SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
10528aa9e3350SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
10529aa9e3350SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
105306aec45a7Smrg]) # XORG_STRICT_OPTION
105316aec45a7Smrg
105326aec45a7Smrg# XORG_DEFAULT_OPTIONS
105336aec45a7Smrg# --------------------
105346aec45a7Smrg# Minimum version: 1.3.0
105356aec45a7Smrg#
105366aec45a7Smrg# Defines default options for X.Org modules.
105376aec45a7Smrg#
105386aec45a7SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
105396aec45a7SmrgAC_REQUIRE([AC_PROG_INSTALL])
10540aa9e3350SmrgXORG_COMPILER_FLAGS
105416aec45a7SmrgXORG_CWARNFLAGS
105426aec45a7SmrgXORG_STRICT_OPTION
105436aec45a7SmrgXORG_RELEASE_VERSION
105446aec45a7SmrgXORG_CHANGELOG
105456aec45a7SmrgXORG_INSTALL
105466aec45a7SmrgXORG_MANPAGE_SECTIONS
105476aec45a7Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
105486aec45a7Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
105496aec45a7Smrg]) # XORG_DEFAULT_OPTIONS
105506aec45a7Smrg
105516aec45a7Smrg# XORG_INSTALL()
105526aec45a7Smrg# ----------------
105536aec45a7Smrg# Minimum version: 1.4.0
105546aec45a7Smrg#
105556aec45a7Smrg# Defines the variable INSTALL_CMD as the command to copy
105566aec45a7Smrg# INSTALL from $prefix/share/util-macros.
105576aec45a7Smrg#
105586aec45a7SmrgAC_DEFUN([XORG_INSTALL], [
105596aec45a7SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
105606aec45a7Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
105616aec45a7SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
105626aec45a7Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
105636aec45a7Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
105646aec45a7Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
105656aec45a7SmrgAC_SUBST([INSTALL_CMD])
105666aec45a7Smrg]) # XORG_INSTALL
105678697ee19Smrgdnl Copyright 2005 Red Hat, Inc
105688697ee19Smrgdnl
105698697ee19Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
105708697ee19Smrgdnl documentation for any purpose is hereby granted without fee, provided that
105718697ee19Smrgdnl the above copyright notice appear in all copies and that both that
105728697ee19Smrgdnl copyright notice and this permission notice appear in supporting
105738697ee19Smrgdnl documentation.
105748697ee19Smrgdnl
105758697ee19Smrgdnl The above copyright notice and this permission notice shall be included
105768697ee19Smrgdnl in all copies or substantial portions of the Software.
105778697ee19Smrgdnl
105788697ee19Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
105798697ee19Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
105808697ee19Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
105818697ee19Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
105828697ee19Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
105838697ee19Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
105848697ee19Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
105858697ee19Smrgdnl
105868697ee19Smrgdnl Except as contained in this notice, the name of the copyright holders shall
105878697ee19Smrgdnl not be used in advertising or otherwise to promote the sale, use or
105888697ee19Smrgdnl other dealings in this Software without prior written authorization
105898697ee19Smrgdnl from the copyright holders.
105908697ee19Smrgdnl
10591ab47cfaaSmrg
105928697ee19Smrg# XORG_RELEASE_VERSION
105938697ee19Smrg# --------------------
105946aec45a7Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
105958697ee19Smrg 
105968697ee19SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
105978697ee19Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
105988697ee19Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
105998697ee19Smrg		[Major version of this package])
106008697ee19Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
106018697ee19Smrg	if test "x$PVM" = "x"; then
106028697ee19Smrg		PVM="0"
106038697ee19Smrg	fi
106048697ee19Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
106058697ee19Smrg		[$PVM],
106068697ee19Smrg		[Minor version of this package])
106078697ee19Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
106088697ee19Smrg	if test "x$PVP" = "x"; then
106098697ee19Smrg		PVP="0"
106108697ee19Smrg	fi
106118697ee19Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
106128697ee19Smrg		[$PVP],
106138697ee19Smrg		[Patch version of this package])
106148697ee19Smrg])
10615ab47cfaaSmrg
106161473d951Smrg# XORG_CHANGELOG()
106171473d951Smrg# ----------------
106181473d951Smrg# Minimum version: 1.2.0
106191473d951Smrg#
106201473d951Smrg# Defines the variable CHANGELOG_CMD as the command to generate
106211473d951Smrg# ChangeLog from git.
106221473d951Smrg#
106231473d951Smrg#
106241473d951SmrgAC_DEFUN([XORG_CHANGELOG], [
106256aec45a7SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
106266aec45a7Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
106276aec45a7Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
106281473d951Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
106291473d951SmrgAC_SUBST([CHANGELOG_CMD])
106301473d951Smrg]) # XORG_CHANGELOG
106311473d951Smrg
106321473d951Smrgdnl Copyright 2005 Red Hat, Inc
106331473d951Smrgdnl 
106341473d951Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
106351473d951Smrgdnl documentation for any purpose is hereby granted without fee, provided that
106361473d951Smrgdnl the above copyright notice appear in all copies and that both that
106371473d951Smrgdnl copyright notice and this permission notice appear in supporting
106381473d951Smrgdnl documentation.
106391473d951Smrgdnl 
106401473d951Smrgdnl The above copyright notice and this permission notice shall be included
106411473d951Smrgdnl in all copies or substantial portions of the Software.
106421473d951Smrgdnl 
106431473d951Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
106441473d951Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
106451473d951Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
106461473d951Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
106471473d951Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
106481473d951Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
106491473d951Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
106501473d951Smrgdnl 
106511473d951Smrgdnl Except as contained in this notice, the name of the copyright holders shall
106521473d951Smrgdnl not be used in advertising or otherwise to promote the sale, use or
106531473d951Smrgdnl other dealings in this Software without prior written authorization
106541473d951Smrgdnl from the copyright holders.
106551473d951Smrgdnl 
106561473d951Smrg
106571473d951Smrg# XORG_DRIVER_CHECK_EXT()
106581473d951Smrg# --------------------------
106591473d951Smrg# Checks for the $1 define in xorg-server.h (from the sdk).  If it
106601473d951Smrg# is defined, then add $1 to $REQUIRED_MODULES.
106611473d951Smrg
106621473d951SmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
106636aec45a7Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
106641473d951Smrg	SAVE_CFLAGS="$CFLAGS"
106656aec45a7Smrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
106661473d951Smrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
106671473d951Smrg#include "xorg-server.h"
106681473d951Smrg#if !defined $1
106691473d951Smrg#error $1 not defined
106701473d951Smrg#endif
106711473d951Smrg		]])],
106721473d951Smrg		[_EXT_CHECK=yes],
106731473d951Smrg		[_EXT_CHECK=no])
106741473d951Smrg	CFLAGS="$SAVE_CFLAGS"
106751473d951Smrg	AC_MSG_CHECKING([if $1 is defined])
106761473d951Smrg	AC_MSG_RESULT([$_EXT_CHECK])
106771473d951Smrg	if test "$_EXT_CHECK" != no; then
106781473d951Smrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
106791473d951Smrg	fi
106801473d951Smrg])
106811473d951Smrg
10682aa9e3350Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
10683aa9e3350Smrg# Foundation, Inc.
10684ab47cfaaSmrg#
10685ab47cfaaSmrg# This file is free software; the Free Software Foundation
10686ab47cfaaSmrg# gives unlimited permission to copy and/or distribute it,
10687ab47cfaaSmrg# with or without modifications, as long as this notice is preserved.
10688ab47cfaaSmrg
10689aa9e3350Smrg# serial 1
10690aa9e3350Smrg
106918697ee19Smrg# AM_AUTOMAKE_VERSION(VERSION)
106928697ee19Smrg# ----------------------------
106938697ee19Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
106948697ee19Smrg# generated from the m4 files accompanying Automake X.Y.
106958697ee19Smrg# (This private macro should not be called outside this file.)
106968697ee19SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
106975c42550eSmrg[am__api_version='1.11'
106988697ee19Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
106998697ee19Smrgdnl require some minimum version.  Point them to the right macro.
1070038770048Smrgm4_if([$1], [1.11.6], [],
107018697ee19Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
107028697ee19Smrg])
10703ab47cfaaSmrg
107048697ee19Smrg# _AM_AUTOCONF_VERSION(VERSION)
107058697ee19Smrg# -----------------------------
107068697ee19Smrg# aclocal traces this macro to find the Autoconf version.
107078697ee19Smrg# This is a private macro too.  Using m4_define simplifies
107088697ee19Smrg# the logic in aclocal, which can simply ignore this definition.
107098697ee19Smrgm4_define([_AM_AUTOCONF_VERSION], [])
10710ab47cfaaSmrg
107118697ee19Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
107128697ee19Smrg# -------------------------------
107138697ee19Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
107141473d951Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
107158697ee19SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1071638770048Smrg[AM_AUTOMAKE_VERSION([1.11.6])dnl
107178697ee19Smrgm4_ifndef([AC_AUTOCONF_VERSION],
107188697ee19Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
107191473d951Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
10720ab47cfaaSmrg
107218697ee19Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
10722ab47cfaaSmrg
10723aa9e3350Smrg# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
10724ab47cfaaSmrg#
10725ab47cfaaSmrg# This file is free software; the Free Software Foundation
10726ab47cfaaSmrg# gives unlimited permission to copy and/or distribute it,
10727ab47cfaaSmrg# with or without modifications, as long as this notice is preserved.
10728ab47cfaaSmrg
10729aa9e3350Smrg# serial 1
10730aa9e3350Smrg
107318697ee19Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
107328697ee19Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
107338697ee19Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
107348697ee19Smrg#
107358697ee19Smrg# Of course, Automake must honor this variable whenever it calls a
107368697ee19Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
107378697ee19Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
107388697ee19Smrg# depending on how configure is run.  This is pretty annoying, since
107398697ee19Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
107408697ee19Smrg# source directory, any form will work fine, but in subdirectories a
107418697ee19Smrg# relative path needs to be adjusted first.
107428697ee19Smrg#
107438697ee19Smrg# $ac_aux_dir/missing
107448697ee19Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
107458697ee19Smrg# $top_srcdir/$ac_aux_dir/missing
107468697ee19Smrg#    fails if $ac_aux_dir is absolute,
107478697ee19Smrg#    fails when called from a subdirectory in a VPATH build with
107488697ee19Smrg#          a relative $ac_aux_dir
107498697ee19Smrg#
107508697ee19Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
107518697ee19Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
107528697ee19Smrg# harmless because $srcdir is `.', but things will broke when you
107538697ee19Smrg# start a VPATH build or use an absolute $srcdir.
107548697ee19Smrg#
107558697ee19Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
107568697ee19Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
107578697ee19Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
107588697ee19Smrg# and then we would define $MISSING as
107598697ee19Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
107608697ee19Smrg# This will work as long as MISSING is not called from configure, because
107618697ee19Smrg# unfortunately $(top_srcdir) has no meaning in configure.
107628697ee19Smrg# However there are other variables, like CC, which are often used in
107638697ee19Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
107648697ee19Smrg#
107658697ee19Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
107668697ee19Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
107678697ee19Smrg# configured tree to be moved without reconfiguration.
10768ab47cfaaSmrg
107698697ee19SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
107708697ee19Smrg[dnl Rely on autoconf to set up CDPATH properly.
107718697ee19SmrgAC_PREREQ([2.50])dnl
107728697ee19Smrg# expand $ac_aux_dir to an absolute path
107738697ee19Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
107748697ee19Smrg])
10775ab47cfaaSmrg
107768697ee19Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
107778697ee19Smrg
107785c42550eSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
107798697ee19Smrg# Free Software Foundation, Inc.
10780ab47cfaaSmrg#
10781ab47cfaaSmrg# This file is free software; the Free Software Foundation
10782ab47cfaaSmrg# gives unlimited permission to copy and/or distribute it,
10783ab47cfaaSmrg# with or without modifications, as long as this notice is preserved.
10784ab47cfaaSmrg
107855c42550eSmrg# serial 9
10786ab47cfaaSmrg
107878697ee19Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
107888697ee19Smrg# -------------------------------------
107898697ee19Smrg# Define a conditional.
107908697ee19SmrgAC_DEFUN([AM_CONDITIONAL],
107918697ee19Smrg[AC_PREREQ(2.52)dnl
107928697ee19Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
107938697ee19Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
107948697ee19SmrgAC_SUBST([$1_TRUE])dnl
107958697ee19SmrgAC_SUBST([$1_FALSE])dnl
107968697ee19Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
107978697ee19Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
107985c42550eSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
107998697ee19Smrgif $2; then
108008697ee19Smrg  $1_TRUE=
108018697ee19Smrg  $1_FALSE='#'
108028697ee19Smrgelse
108038697ee19Smrg  $1_TRUE='#'
108048697ee19Smrg  $1_FALSE=
108058697ee19Smrgfi
108068697ee19SmrgAC_CONFIG_COMMANDS_PRE(
108078697ee19Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
108088697ee19Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
108098697ee19SmrgUsually this means the macro was only invoked conditionally.]])
108108697ee19Smrgfi])])
108118697ee19Smrg
10812aa9e3350Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
10813aa9e3350Smrg# 2010, 2011 Free Software Foundation, Inc.
10814ab47cfaaSmrg#
108158697ee19Smrg# This file is free software; the Free Software Foundation
108168697ee19Smrg# gives unlimited permission to copy and/or distribute it,
108178697ee19Smrg# with or without modifications, as long as this notice is preserved.
108188697ee19Smrg
10819aa9e3350Smrg# serial 12
108208697ee19Smrg
108218697ee19Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
108228697ee19Smrg# written in clear, in which case automake, when reading aclocal.m4,
108238697ee19Smrg# will think it sees a *use*, and therefore will trigger all it's
108248697ee19Smrg# C support machinery.  Also note that it means that autoscan, seeing
108258697ee19Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
108268697ee19Smrg
108278697ee19Smrg
108288697ee19Smrg# _AM_DEPENDENCIES(NAME)
108298697ee19Smrg# ----------------------
108308697ee19Smrg# See how the compiler implements dependency checking.
108318697ee19Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
108328697ee19Smrg# We try a few techniques and use that to set a single cache variable.
10833ab47cfaaSmrg#
108348697ee19Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
108358697ee19Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
108368697ee19Smrg# dependency, and given that the user is not expected to run this macro,
108378697ee19Smrg# just rely on AC_PROG_CC.
108388697ee19SmrgAC_DEFUN([_AM_DEPENDENCIES],
108398697ee19Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
108408697ee19SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
108418697ee19SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
108428697ee19SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
10843ab47cfaaSmrg
108448697ee19Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
108458697ee19Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
108468697ee19Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
108478697ee19Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
108488697ee19Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
108498697ee19Smrg                   [depcc="$$1"   am_compiler_list=])
10850ab47cfaaSmrg
108518697ee19SmrgAC_CACHE_CHECK([dependency style of $depcc],
108528697ee19Smrg               [am_cv_$1_dependencies_compiler_type],
108538697ee19Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
108548697ee19Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
108558697ee19Smrg  # making bogus files that we don't know about and never remove.  For
108568697ee19Smrg  # instance it was reported that on HP-UX the gcc test will end up
108578697ee19Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
108588697ee19Smrg  # in D'.
10859aa9e3350Smrg  rm -rf conftest.dir
10860ab47cfaaSmrg  mkdir conftest.dir
108618697ee19Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
108628697ee19Smrg  # using a relative directory.
108638697ee19Smrg  cp "$am_depcomp" conftest.dir
108648697ee19Smrg  cd conftest.dir
108658697ee19Smrg  # We will build objects and dependencies in a subdirectory because
108668697ee19Smrg  # it helps to detect inapplicable dependency modes.  For instance
108678697ee19Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
108688697ee19Smrg  # side effect of compilation, but ICC will put the dependencies in
108698697ee19Smrg  # the current directory while Tru64 will put them in the object
108708697ee19Smrg  # directory.
108718697ee19Smrg  mkdir sub
108728697ee19Smrg
108738697ee19Smrg  am_cv_$1_dependencies_compiler_type=none
108748697ee19Smrg  if test "$am_compiler_list" = ""; then
108758697ee19Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
10876ab47cfaaSmrg  fi
108775c42550eSmrg  am__universal=false
108785c42550eSmrg  m4_case([$1], [CC],
108795c42550eSmrg    [case " $depcc " in #(
108805c42550eSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
108815c42550eSmrg     esac],
108825c42550eSmrg    [CXX],
108835c42550eSmrg    [case " $depcc " in #(
108845c42550eSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
108855c42550eSmrg     esac])
108865c42550eSmrg
108878697ee19Smrg  for depmode in $am_compiler_list; do
108888697ee19Smrg    # Setup a source with many dependencies, because some compilers
108898697ee19Smrg    # like to wrap large dependency lists on column 80 (with \), and
108908697ee19Smrg    # we should not choose a depcomp mode which is confused by this.
108918697ee19Smrg    #
108928697ee19Smrg    # We need to recreate these files for each test, as the compiler may
108938697ee19Smrg    # overwrite some of them when testing with obscure command lines.
108948697ee19Smrg    # This happens at least with the AIX C compiler.
108958697ee19Smrg    : > sub/conftest.c
108968697ee19Smrg    for i in 1 2 3 4 5 6; do
108978697ee19Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
108988697ee19Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
108998697ee19Smrg      # Solaris 8's {/usr,}/bin/sh.
109008697ee19Smrg      touch sub/conftst$i.h
109018697ee19Smrg    done
109028697ee19Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
10903ab47cfaaSmrg
109045c42550eSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
109055c42550eSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
109065c42550eSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
109075c42550eSmrg    # versions had trouble with output in subdirs
109085c42550eSmrg    am__obj=sub/conftest.${OBJEXT-o}
109095c42550eSmrg    am__minus_obj="-o $am__obj"
109108697ee19Smrg    case $depmode in
109115c42550eSmrg    gcc)
109125c42550eSmrg      # This depmode causes a compiler race in universal mode.
109135c42550eSmrg      test "$am__universal" = false || continue
109145c42550eSmrg      ;;
109158697ee19Smrg    nosideeffect)
109168697ee19Smrg      # after this tag, mechanisms are not by side-effect, so they'll
109178697ee19Smrg      # only be used when explicitly requested
109188697ee19Smrg      if test "x$enable_dependency_tracking" = xyes; then
109198697ee19Smrg	continue
109208697ee19Smrg      else
109218697ee19Smrg	break
109228697ee19Smrg      fi
109238697ee19Smrg      ;;
10924aa9e3350Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
109255c42550eSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
109265c42550eSmrg      # not run yet.  These depmodes are late enough in the game, and
109275c42550eSmrg      # so weak that their functioning should not be impacted.
109285c42550eSmrg      am__obj=conftest.${OBJEXT-o}
109295c42550eSmrg      am__minus_obj=
109305c42550eSmrg      ;;
109318697ee19Smrg    none) break ;;
109328697ee19Smrg    esac
109338697ee19Smrg    if depmode=$depmode \
109345c42550eSmrg       source=sub/conftest.c object=$am__obj \
109358697ee19Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
109365c42550eSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
109378697ee19Smrg         >/dev/null 2>conftest.err &&
109388697ee19Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
109398697ee19Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
109405c42550eSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
109418697ee19Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
109428697ee19Smrg      # icc doesn't choke on unknown options, it will just issue warnings
109438697ee19Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
109448697ee19Smrg      # that says an option was ignored or not supported.
109458697ee19Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
109468697ee19Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
109478697ee19Smrg      # The diagnosis changed in icc 8.0:
109488697ee19Smrg      #   icc: Command line remark: option '-MP' not supported
109498697ee19Smrg      if (grep 'ignoring option' conftest.err ||
109508697ee19Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
109518697ee19Smrg        am_cv_$1_dependencies_compiler_type=$depmode
109528697ee19Smrg        break
109538697ee19Smrg      fi
109548697ee19Smrg    fi
109558697ee19Smrg  done
10956ab47cfaaSmrg
109578697ee19Smrg  cd ..
109588697ee19Smrg  rm -rf conftest.dir
109598697ee19Smrgelse
109608697ee19Smrg  am_cv_$1_dependencies_compiler_type=none
109618697ee19Smrgfi
109628697ee19Smrg])
109638697ee19SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
109648697ee19SmrgAM_CONDITIONAL([am__fastdep$1], [
109658697ee19Smrg  test "x$enable_dependency_tracking" != xno \
109668697ee19Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
109678697ee19Smrg])
10968ab47cfaaSmrg
109698697ee19Smrg
109708697ee19Smrg# AM_SET_DEPDIR
109718697ee19Smrg# -------------
109728697ee19Smrg# Choose a directory name for dependency files.
109738697ee19Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
109748697ee19SmrgAC_DEFUN([AM_SET_DEPDIR],
109758697ee19Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
109768697ee19SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
109778697ee19Smrg])
109788697ee19Smrg
109798697ee19Smrg
109808697ee19Smrg# AM_DEP_TRACK
109818697ee19Smrg# ------------
109828697ee19SmrgAC_DEFUN([AM_DEP_TRACK],
109838697ee19Smrg[AC_ARG_ENABLE(dependency-tracking,
109848697ee19Smrg[  --disable-dependency-tracking  speeds up one-time build
109858697ee19Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
109868697ee19Smrgif test "x$enable_dependency_tracking" != xno; then
109878697ee19Smrg  am_depcomp="$ac_aux_dir/depcomp"
109888697ee19Smrg  AMDEPBACKSLASH='\'
10989aa9e3350Smrg  am__nodep='_no'
109908697ee19Smrgfi
109918697ee19SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
109928697ee19SmrgAC_SUBST([AMDEPBACKSLASH])dnl
109938697ee19Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
10994aa9e3350SmrgAC_SUBST([am__nodep])dnl
10995aa9e3350Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
109968697ee19Smrg])
109978697ee19Smrg
109988697ee19Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
109998697ee19Smrg
110001473d951Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
110018697ee19Smrg# Free Software Foundation, Inc.
11002ab47cfaaSmrg#
110038697ee19Smrg# This file is free software; the Free Software Foundation
110048697ee19Smrg# gives unlimited permission to copy and/or distribute it,
110058697ee19Smrg# with or without modifications, as long as this notice is preserved.
110068697ee19Smrg
110075c42550eSmrg#serial 5
110088697ee19Smrg
110098697ee19Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
110108697ee19Smrg# ------------------------------
110118697ee19SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
110125c42550eSmrg[{
110135c42550eSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
110145c42550eSmrg  # are listed without --file.  Let's play safe and only enable the eval
110155c42550eSmrg  # if we detect the quoting.
110165c42550eSmrg  case $CONFIG_FILES in
110175c42550eSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
110185c42550eSmrg  *)   set x $CONFIG_FILES ;;
110195c42550eSmrg  esac
110205c42550eSmrg  shift
110215c42550eSmrg  for mf
110225c42550eSmrg  do
110235c42550eSmrg    # Strip MF so we end up with the name of the file.
110245c42550eSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
110255c42550eSmrg    # Check whether this is an Automake generated Makefile or not.
110265c42550eSmrg    # We used to match only the files named `Makefile.in', but
110275c42550eSmrg    # some people rename them; so instead we look at the file content.
110285c42550eSmrg    # Grep'ing the first line is not enough: some people post-process
110295c42550eSmrg    # each Makefile.in and add a new line on top of each file to say so.
110305c42550eSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
110315c42550eSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
110325c42550eSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
110335c42550eSmrg      dirpart=`AS_DIRNAME("$mf")`
110345c42550eSmrg    else
110355c42550eSmrg      continue
110365c42550eSmrg    fi
110375c42550eSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
110385c42550eSmrg    # from the Makefile without running `make'.
110395c42550eSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
110405c42550eSmrg    test -z "$DEPDIR" && continue
110415c42550eSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
110425c42550eSmrg    test -z "am__include" && continue
110435c42550eSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
110445c42550eSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
110455c42550eSmrg    U=`sed -n 's/^U = //p' < "$mf"`
110465c42550eSmrg    # Find all dependency output files, they are included files with
110475c42550eSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
110485c42550eSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
110495c42550eSmrg    # expansion.
110505c42550eSmrg    for file in `sed -n "
110515c42550eSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
110525c42550eSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
110535c42550eSmrg      # Make sure the directory exists.
110545c42550eSmrg      test -f "$dirpart/$file" && continue
110555c42550eSmrg      fdir=`AS_DIRNAME(["$file"])`
110565c42550eSmrg      AS_MKDIR_P([$dirpart/$fdir])
110575c42550eSmrg      # echo "creating $dirpart/$file"
110585c42550eSmrg      echo '# dummy' > "$dirpart/$file"
110595c42550eSmrg    done
110608697ee19Smrg  done
110615c42550eSmrg}
110628697ee19Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
110638697ee19Smrg
110648697ee19Smrg
110658697ee19Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
110668697ee19Smrg# -----------------------------
110678697ee19Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
11068ab47cfaaSmrg#
110698697ee19Smrg# This code is only required when automatic dependency tracking
110708697ee19Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
110718697ee19Smrg# need in order to bootstrap the dependency handling code.
110728697ee19SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
110738697ee19Smrg[AC_CONFIG_COMMANDS([depfiles],
110748697ee19Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
110758697ee19Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
110768697ee19Smrg])
110778697ee19Smrg
110788697ee19Smrg# Do all the work for Automake.                             -*- Autoconf -*-
110798697ee19Smrg
110808697ee19Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
110815c42550eSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
11082ab47cfaaSmrg#
110838697ee19Smrg# This file is free software; the Free Software Foundation
110848697ee19Smrg# gives unlimited permission to copy and/or distribute it,
110858697ee19Smrg# with or without modifications, as long as this notice is preserved.
110868697ee19Smrg
110875c42550eSmrg# serial 16
110888697ee19Smrg
110898697ee19Smrg# This macro actually does too much.  Some checks are only needed if
110908697ee19Smrg# your package does certain things.  But this isn't really a big deal.
110918697ee19Smrg
110928697ee19Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
110938697ee19Smrg# AM_INIT_AUTOMAKE([OPTIONS])
110948697ee19Smrg# -----------------------------------------------
110958697ee19Smrg# The call with PACKAGE and VERSION arguments is the old style
110968697ee19Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
110978697ee19Smrg# and VERSION should now be passed to AC_INIT and removed from
110988697ee19Smrg# the call to AM_INIT_AUTOMAKE.
110998697ee19Smrg# We support both call styles for the transition.  After
111008697ee19Smrg# the next Automake release, Autoconf can make the AC_INIT
111018697ee19Smrg# arguments mandatory, and then we can depend on a new Autoconf
111028697ee19Smrg# release and drop the old call support.
111038697ee19SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
111045c42550eSmrg[AC_PREREQ([2.62])dnl
111058697ee19Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
111068697ee19Smrgdnl the ones we care about.
111078697ee19Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
111088697ee19SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
111098697ee19SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
111108697ee19Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
111118697ee19Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
111128697ee19Smrg  # is not polluted with repeated "-I."
111138697ee19Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
111148697ee19Smrg  # test to see if srcdir already configured
111158697ee19Smrg  if test -f $srcdir/config.status; then
111168697ee19Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
111178697ee19Smrg  fi
111188697ee19Smrgfi
111198697ee19Smrg
111208697ee19Smrg# test whether we have cygpath
111218697ee19Smrgif test -z "$CYGPATH_W"; then
111228697ee19Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
111238697ee19Smrg    CYGPATH_W='cygpath -w'
111248697ee19Smrg  else
111258697ee19Smrg    CYGPATH_W=echo
111268697ee19Smrg  fi
111278697ee19Smrgfi
111288697ee19SmrgAC_SUBST([CYGPATH_W])
111298697ee19Smrg
111308697ee19Smrg# Define the identity of the package.
111318697ee19Smrgdnl Distinguish between old-style and new-style calls.
111328697ee19Smrgm4_ifval([$2],
111338697ee19Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
111348697ee19Smrg AC_SUBST([PACKAGE], [$1])dnl
111358697ee19Smrg AC_SUBST([VERSION], [$2])],
111368697ee19Smrg[_AM_SET_OPTIONS([$1])dnl
111378697ee19Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
111388697ee19Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
111398697ee19Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
111408697ee19Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
111418697ee19Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
111428697ee19Smrg
111438697ee19Smrg_AM_IF_OPTION([no-define],,
111448697ee19Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
111458697ee19Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
111468697ee19Smrg
111478697ee19Smrg# Some tools Automake needs.
111488697ee19SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
111498697ee19SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
111508697ee19SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
111518697ee19SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
111528697ee19SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
111538697ee19SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
111548697ee19SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
111555c42550eSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
111565c42550eSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
111578697ee19SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
111588697ee19Smrg# We need awk for the "check" target.  The system "awk" is bad on
111598697ee19Smrg# some platforms.
111608697ee19SmrgAC_REQUIRE([AC_PROG_AWK])dnl
111618697ee19SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
111628697ee19SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
111638697ee19Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
111645c42550eSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
111655c42550eSmrg			     [_AM_PROG_TAR([v7])])])
111668697ee19Smrg_AM_IF_OPTION([no-dependencies],,
111678697ee19Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
111685c42550eSmrg		  [_AM_DEPENDENCIES(CC)],
111695c42550eSmrg		  [define([AC_PROG_CC],
111705c42550eSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
111718697ee19SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
111725c42550eSmrg		  [_AM_DEPENDENCIES(CXX)],
111735c42550eSmrg		  [define([AC_PROG_CXX],
111745c42550eSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
111758697ee19SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
111765c42550eSmrg		  [_AM_DEPENDENCIES(OBJC)],
111775c42550eSmrg		  [define([AC_PROG_OBJC],
111785c42550eSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
111798697ee19Smrg])
111805c42550eSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
111815c42550eSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
111825c42550eSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
111835c42550eSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
111845c42550eSmrgAC_CONFIG_COMMANDS_PRE(dnl
111855c42550eSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
111865c42550eSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
111878697ee19Smrg])
11188ab47cfaaSmrg
111895c42550eSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
111905c42550eSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
111915c42550eSmrgdnl mangled by Autoconf and run in a shell conditional statement.
111925c42550eSmrgm4_define([_AC_COMPILER_EXEEXT],
111935c42550eSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
111945c42550eSmrg
11195ab47cfaaSmrg
111968697ee19Smrg# When config.status generates a header, we must update the stamp-h file.
111978697ee19Smrg# This file resides in the same directory as the config header
111988697ee19Smrg# that is generated.  The stamp files are numbered to have different names.
11199ab47cfaaSmrg
112008697ee19Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
112018697ee19Smrg# loop where config.status creates the headers, so we can generate
112028697ee19Smrg# our stamp files there.
112038697ee19SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
112048697ee19Smrg[# Compute $1's index in $config_headers.
112058697ee19Smrg_am_arg=$1
112068697ee19Smrg_am_stamp_count=1
112078697ee19Smrgfor _am_header in $config_headers :; do
112088697ee19Smrg  case $_am_header in
112098697ee19Smrg    $_am_arg | $_am_arg:* )
112108697ee19Smrg      break ;;
112118697ee19Smrg    * )
112128697ee19Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
112138697ee19Smrg  esac
112148697ee19Smrgdone
112158697ee19Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
11216ab47cfaaSmrg
11217aa9e3350Smrg# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
11218aa9e3350Smrg# Inc.
11219ab47cfaaSmrg#
112208697ee19Smrg# This file is free software; the Free Software Foundation
112218697ee19Smrg# gives unlimited permission to copy and/or distribute it,
112228697ee19Smrg# with or without modifications, as long as this notice is preserved.
11223ab47cfaaSmrg
11224aa9e3350Smrg# serial 1
11225aa9e3350Smrg
112268697ee19Smrg# AM_PROG_INSTALL_SH
112278697ee19Smrg# ------------------
112288697ee19Smrg# Define $install_sh.
112298697ee19SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
112308697ee19Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
112315c42550eSmrgif test x"${install_sh}" != xset; then
112325c42550eSmrg  case $am_aux_dir in
112335c42550eSmrg  *\ * | *\	*)
112345c42550eSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
112355c42550eSmrg  *)
112365c42550eSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
112375c42550eSmrg  esac
112385c42550eSmrgfi
112398697ee19SmrgAC_SUBST(install_sh)])
11240ab47cfaaSmrg
112418697ee19Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
112428697ee19Smrg#
112438697ee19Smrg# This file is free software; the Free Software Foundation
112448697ee19Smrg# gives unlimited permission to copy and/or distribute it,
112458697ee19Smrg# with or without modifications, as long as this notice is preserved.
11246ab47cfaaSmrg
112478697ee19Smrg# serial 2
11248ab47cfaaSmrg
112498697ee19Smrg# Check whether the underlying file-system supports filenames
112508697ee19Smrg# with a leading dot.  For instance MS-DOS doesn't.
112518697ee19SmrgAC_DEFUN([AM_SET_LEADING_DOT],
112528697ee19Smrg[rm -rf .tst 2>/dev/null
112538697ee19Smrgmkdir .tst 2>/dev/null
112548697ee19Smrgif test -d .tst; then
112558697ee19Smrg  am__leading_dot=.
112568697ee19Smrgelse
112578697ee19Smrg  am__leading_dot=_
11258ab47cfaaSmrgfi
112598697ee19Smrgrmdir .tst 2>/dev/null
112608697ee19SmrgAC_SUBST([am__leading_dot])])
11261ab47cfaaSmrg
112628697ee19Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
112638697ee19Smrg# From Jim Meyering
11264ab47cfaaSmrg
11265aa9e3350Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
11266aa9e3350Smrg# 2011 Free Software Foundation, Inc.
112678697ee19Smrg#
112688697ee19Smrg# This file is free software; the Free Software Foundation
112698697ee19Smrg# gives unlimited permission to copy and/or distribute it,
112708697ee19Smrg# with or without modifications, as long as this notice is preserved.
11271ab47cfaaSmrg
112725c42550eSmrg# serial 5
11273ab47cfaaSmrg
112745c42550eSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
112755c42550eSmrg# ----------------------------------
112765c42550eSmrg# Control maintainer-specific portions of Makefiles.
112775c42550eSmrg# Default is to disable them, unless `enable' is passed literally.
112785c42550eSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
112795c42550eSmrg# can override the default with the --enable/--disable switch.
112808697ee19SmrgAC_DEFUN([AM_MAINTAINER_MODE],
112815c42550eSmrg[m4_case(m4_default([$1], [disable]),
112825c42550eSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
112835c42550eSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
112845c42550eSmrg       [m4_define([am_maintainer_other], [enable])
112855c42550eSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
11286aa9e3350SmrgAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
112875c42550eSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
112885c42550eSmrg  AC_ARG_ENABLE([maintainer-mode],
112895c42550eSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
112908697ee19Smrg			  (and sometimes confusing) to the casual installer],
112915c42550eSmrg      [USE_MAINTAINER_MODE=$enableval],
112925c42550eSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
112938697ee19Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
112945c42550eSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
112958697ee19Smrg  MAINT=$MAINTAINER_MODE_TRUE
112965c42550eSmrg  AC_SUBST([MAINT])dnl
112978697ee19Smrg]
112988697ee19Smrg)
11299ab47cfaaSmrg
113008697ee19SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
11301ab47cfaaSmrg
113028697ee19Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
11303ab47cfaaSmrg
113045c42550eSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
113058697ee19Smrg#
113068697ee19Smrg# This file is free software; the Free Software Foundation
113078697ee19Smrg# gives unlimited permission to copy and/or distribute it,
113088697ee19Smrg# with or without modifications, as long as this notice is preserved.
11309ab47cfaaSmrg
113105c42550eSmrg# serial 4
11311ab47cfaaSmrg
113128697ee19Smrg# AM_MAKE_INCLUDE()
113138697ee19Smrg# -----------------
113148697ee19Smrg# Check to see how make treats includes.
113158697ee19SmrgAC_DEFUN([AM_MAKE_INCLUDE],
113168697ee19Smrg[am_make=${MAKE-make}
113178697ee19Smrgcat > confinc << 'END'
113188697ee19Smrgam__doit:
113195c42550eSmrg	@echo this is the am__doit target
113208697ee19Smrg.PHONY: am__doit
113218697ee19SmrgEND
113228697ee19Smrg# If we don't find an include directive, just comment out the code.
113238697ee19SmrgAC_MSG_CHECKING([for style of include used by $am_make])
113248697ee19Smrgam__include="#"
113258697ee19Smrgam__quote=
113268697ee19Smrg_am_result=none
113278697ee19Smrg# First try GNU make style include.
113288697ee19Smrgecho "include confinc" > confmf
113295c42550eSmrg# Ignore all kinds of additional output from `make'.
113305c42550eSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
113315c42550eSmrg*the\ am__doit\ target*)
113325c42550eSmrg  am__include=include
113335c42550eSmrg  am__quote=
113345c42550eSmrg  _am_result=GNU
113355c42550eSmrg  ;;
113365c42550eSmrgesac
113378697ee19Smrg# Now try BSD make style include.
113388697ee19Smrgif test "$am__include" = "#"; then
113398697ee19Smrg   echo '.include "confinc"' > confmf
113405c42550eSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
113415c42550eSmrg   *the\ am__doit\ target*)
113425c42550eSmrg     am__include=.include
113435c42550eSmrg     am__quote="\""
113445c42550eSmrg     _am_result=BSD
113455c42550eSmrg     ;;
113465c42550eSmrg   esac
11347ab47cfaaSmrgfi
113488697ee19SmrgAC_SUBST([am__include])
113498697ee19SmrgAC_SUBST([am__quote])
113508697ee19SmrgAC_MSG_RESULT([$_am_result])
113518697ee19Smrgrm -f confinc confmf
113528697ee19Smrg])
113538697ee19Smrg
113548697ee19Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
11355ab47cfaaSmrg
113565c42550eSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
113578697ee19Smrg# Free Software Foundation, Inc.
113588697ee19Smrg#
113598697ee19Smrg# This file is free software; the Free Software Foundation
113608697ee19Smrg# gives unlimited permission to copy and/or distribute it,
113618697ee19Smrg# with or without modifications, as long as this notice is preserved.
11362ab47cfaaSmrg
113635c42550eSmrg# serial 6
11364ab47cfaaSmrg
113658697ee19Smrg# AM_MISSING_PROG(NAME, PROGRAM)
113668697ee19Smrg# ------------------------------
113678697ee19SmrgAC_DEFUN([AM_MISSING_PROG],
113688697ee19Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
113698697ee19Smrg$1=${$1-"${am_missing_run}$2"}
113708697ee19SmrgAC_SUBST($1)])
11371ab47cfaaSmrg
113728697ee19Smrg
113738697ee19Smrg# AM_MISSING_HAS_RUN
113748697ee19Smrg# ------------------
113758697ee19Smrg# Define MISSING if not defined so far and test if it supports --run.
113768697ee19Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
113778697ee19SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
113788697ee19Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
113798697ee19SmrgAC_REQUIRE_AUX_FILE([missing])dnl
113805c42550eSmrgif test x"${MISSING+set}" != xset; then
113815c42550eSmrg  case $am_aux_dir in
113825c42550eSmrg  *\ * | *\	*)
113835c42550eSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
113845c42550eSmrg  *)
113855c42550eSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
113865c42550eSmrg  esac
113875c42550eSmrgfi
113888697ee19Smrg# Use eval to expand $SHELL
113898697ee19Smrgif eval "$MISSING --run true"; then
113908697ee19Smrg  am_missing_run="$MISSING --run "
11391ab47cfaaSmrgelse
113928697ee19Smrg  am_missing_run=
113938697ee19Smrg  AC_MSG_WARN([`missing' script is too old or missing])
11394ab47cfaaSmrgfi
113958697ee19Smrg])
11396ab47cfaaSmrg
11397aa9e3350Smrg# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
11398aa9e3350Smrg# Inc.
113998697ee19Smrg#
114008697ee19Smrg# This file is free software; the Free Software Foundation
114018697ee19Smrg# gives unlimited permission to copy and/or distribute it,
114028697ee19Smrg# with or without modifications, as long as this notice is preserved.
11403ab47cfaaSmrg
11404aa9e3350Smrg# serial 1
11405aa9e3350Smrg
114068697ee19Smrg# AM_PROG_MKDIR_P
114078697ee19Smrg# ---------------
114088697ee19Smrg# Check for `mkdir -p'.
114098697ee19SmrgAC_DEFUN([AM_PROG_MKDIR_P],
114108697ee19Smrg[AC_PREREQ([2.60])dnl
114118697ee19SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
114128697ee19Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
114138697ee19Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
114148697ee19Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
114158697ee19Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
114168697ee19Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
114178697ee19Smrgdnl adjustment using top_builddir (which is defined more often than
114188697ee19Smrgdnl MKDIR_P).
114198697ee19SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
114208697ee19Smrgcase $mkdir_p in
114218697ee19Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
114228697ee19Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
114238697ee19Smrgesac
114248697ee19Smrg])
11425ab47cfaaSmrg
114268697ee19Smrg# Helper functions for option handling.                     -*- Autoconf -*-
11427ab47cfaaSmrg
11428aa9e3350Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
11429aa9e3350Smrg# Foundation, Inc.
11430ab47cfaaSmrg#
114318697ee19Smrg# This file is free software; the Free Software Foundation
114328697ee19Smrg# gives unlimited permission to copy and/or distribute it,
114338697ee19Smrg# with or without modifications, as long as this notice is preserved.
11434ab47cfaaSmrg
11435aa9e3350Smrg# serial 5
11436ab47cfaaSmrg
114378697ee19Smrg# _AM_MANGLE_OPTION(NAME)
114388697ee19Smrg# -----------------------
114398697ee19SmrgAC_DEFUN([_AM_MANGLE_OPTION],
114408697ee19Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
11441ab47cfaaSmrg
114428697ee19Smrg# _AM_SET_OPTION(NAME)
11443aa9e3350Smrg# --------------------
114448697ee19Smrg# Set option NAME.  Presently that only means defining a flag for this option.
114458697ee19SmrgAC_DEFUN([_AM_SET_OPTION],
114468697ee19Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
11447ab47cfaaSmrg
114488697ee19Smrg# _AM_SET_OPTIONS(OPTIONS)
11449aa9e3350Smrg# ------------------------
114508697ee19Smrg# OPTIONS is a space-separated list of Automake options.
114518697ee19SmrgAC_DEFUN([_AM_SET_OPTIONS],
114521473d951Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
11453ab47cfaaSmrg
114548697ee19Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
114558697ee19Smrg# -------------------------------------------
114568697ee19Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
114578697ee19SmrgAC_DEFUN([_AM_IF_OPTION],
114588697ee19Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
11459ab47cfaaSmrg
114608697ee19Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
11461ab47cfaaSmrg
114625c42550eSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
114638697ee19Smrg# Free Software Foundation, Inc.
11464ab47cfaaSmrg#
114658697ee19Smrg# This file is free software; the Free Software Foundation
114668697ee19Smrg# gives unlimited permission to copy and/or distribute it,
114678697ee19Smrg# with or without modifications, as long as this notice is preserved.
11468ab47cfaaSmrg
114695c42550eSmrg# serial 5
11470ab47cfaaSmrg
114718697ee19Smrg# AM_SANITY_CHECK
114728697ee19Smrg# ---------------
114738697ee19SmrgAC_DEFUN([AM_SANITY_CHECK],
114748697ee19Smrg[AC_MSG_CHECKING([whether build environment is sane])
114758697ee19Smrg# Just in case
114768697ee19Smrgsleep 1
114778697ee19Smrgecho timestamp > conftest.file
114785c42550eSmrg# Reject unsafe characters in $srcdir or the absolute working directory
114795c42550eSmrg# name.  Accept space and tab only in the latter.
114805c42550eSmrgam_lf='
114815c42550eSmrg'
114825c42550eSmrgcase `pwd` in
114835c42550eSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
114845c42550eSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
114855c42550eSmrgesac
114865c42550eSmrgcase $srcdir in
114875c42550eSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
114885c42550eSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
114895c42550eSmrgesac
114905c42550eSmrg
114918697ee19Smrg# Do `set' in a subshell so we don't clobber the current shell's
114928697ee19Smrg# arguments.  Must try -L first in case configure is actually a
114938697ee19Smrg# symlink; some systems play weird games with the mod time of symlinks
114948697ee19Smrg# (eg FreeBSD returns the mod time of the symlink's containing
114958697ee19Smrg# directory).
114968697ee19Smrgif (
114975c42550eSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
114988697ee19Smrg   if test "$[*]" = "X"; then
114998697ee19Smrg      # -L didn't work.
115005c42550eSmrg      set X `ls -t "$srcdir/configure" conftest.file`
115018697ee19Smrg   fi
115028697ee19Smrg   rm -f conftest.file
115038697ee19Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
115048697ee19Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
11505ab47cfaaSmrg
115068697ee19Smrg      # If neither matched, then we have a broken ls.  This can happen
115078697ee19Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
115088697ee19Smrg      # broken ls alias from the environment.  This has actually
115098697ee19Smrg      # happened.  Such a system could not be considered "sane".
115108697ee19Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
115118697ee19Smrgalias in your environment])
115128697ee19Smrg   fi
11513ab47cfaaSmrg
115148697ee19Smrg   test "$[2]" = conftest.file
115158697ee19Smrg   )
115168697ee19Smrgthen
115178697ee19Smrg   # Ok.
115188697ee19Smrg   :
115198697ee19Smrgelse
115208697ee19Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
115218697ee19SmrgCheck your system clock])
115228697ee19Smrgfi
115238697ee19SmrgAC_MSG_RESULT(yes)])
11524ab47cfaaSmrg
11525aa9e3350Smrg# Copyright (C) 2009, 2011  Free Software Foundation, Inc.
115266aec45a7Smrg#
115276aec45a7Smrg# This file is free software; the Free Software Foundation
115286aec45a7Smrg# gives unlimited permission to copy and/or distribute it,
115296aec45a7Smrg# with or without modifications, as long as this notice is preserved.
115306aec45a7Smrg
11531aa9e3350Smrg# serial 2
115326aec45a7Smrg
115336aec45a7Smrg# AM_SILENT_RULES([DEFAULT])
115346aec45a7Smrg# --------------------------
115356aec45a7Smrg# Enable less verbose build rules; with the default set to DEFAULT
115366aec45a7Smrg# (`yes' being less verbose, `no' or empty being verbose).
115376aec45a7SmrgAC_DEFUN([AM_SILENT_RULES],
115386aec45a7Smrg[AC_ARG_ENABLE([silent-rules],
115396aec45a7Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
115406aec45a7Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
115416aec45a7Smrgcase $enable_silent_rules in
115426aec45a7Smrgyes) AM_DEFAULT_VERBOSITY=0;;
115436aec45a7Smrgno)  AM_DEFAULT_VERBOSITY=1;;
115446aec45a7Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
115456aec45a7Smrgesac
11546aa9e3350Smrgdnl
11547aa9e3350Smrgdnl A few `make' implementations (e.g., NonStop OS and NextStep)
11548aa9e3350Smrgdnl do not support nested variable expansions.
11549aa9e3350Smrgdnl See automake bug#9928 and bug#10237.
11550aa9e3350Smrgam_make=${MAKE-make}
11551aa9e3350SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
11552aa9e3350Smrg   [am_cv_make_support_nested_variables],
11553aa9e3350Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
11554aa9e3350SmrgBAR0=false
11555aa9e3350SmrgBAR1=true
11556aa9e3350SmrgV=1
11557aa9e3350Smrgam__doit:
11558aa9e3350Smrg	@$(TRUE)
11559aa9e3350Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
11560aa9e3350Smrg  am_cv_make_support_nested_variables=yes
11561aa9e3350Smrgelse
11562aa9e3350Smrg  am_cv_make_support_nested_variables=no
11563aa9e3350Smrgfi])
11564aa9e3350Smrgif test $am_cv_make_support_nested_variables = yes; then
11565aa9e3350Smrg  dnl Using `$V' instead of `$(V)' breaks IRIX make.
11566aa9e3350Smrg  AM_V='$(V)'
11567aa9e3350Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
11568aa9e3350Smrgelse
11569aa9e3350Smrg  AM_V=$AM_DEFAULT_VERBOSITY
11570aa9e3350Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
11571aa9e3350Smrgfi
11572aa9e3350SmrgAC_SUBST([AM_V])dnl
11573aa9e3350SmrgAM_SUBST_NOTMAKE([AM_V])dnl
11574aa9e3350SmrgAC_SUBST([AM_DEFAULT_V])dnl
11575aa9e3350SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
115766aec45a7SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
115776aec45a7SmrgAM_BACKSLASH='\'
115786aec45a7SmrgAC_SUBST([AM_BACKSLASH])dnl
115796aec45a7Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
115806aec45a7Smrg])
115816aec45a7Smrg
11582aa9e3350Smrg# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
11583ab47cfaaSmrg#
115848697ee19Smrg# This file is free software; the Free Software Foundation
115858697ee19Smrg# gives unlimited permission to copy and/or distribute it,
115868697ee19Smrg# with or without modifications, as long as this notice is preserved.
11587ab47cfaaSmrg
11588aa9e3350Smrg# serial 1
11589aa9e3350Smrg
115908697ee19Smrg# AM_PROG_INSTALL_STRIP
115918697ee19Smrg# ---------------------
115928697ee19Smrg# One issue with vendor `install' (even GNU) is that you can't
115938697ee19Smrg# specify the program used to strip binaries.  This is especially
115948697ee19Smrg# annoying in cross-compiling environments, where the build's strip
115958697ee19Smrg# is unlikely to handle the host's binaries.
115968697ee19Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
115978697ee19Smrg# always use install-sh in `make install-strip', and initialize
115988697ee19Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
115998697ee19SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
116008697ee19Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
116018697ee19Smrg# Installed binaries are usually stripped using `strip' when the user
116028697ee19Smrg# run `make install-strip'.  However `strip' might not be the right
116038697ee19Smrg# tool to use in cross-compilation environments, therefore Automake
116048697ee19Smrg# will honor the `STRIP' environment variable to overrule this program.
116058697ee19Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
116068697ee19Smrgif test "$cross_compiling" != no; then
116078697ee19Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
11608ab47cfaaSmrgfi
116098697ee19SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
116108697ee19SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
11611ab47cfaaSmrg
11612aa9e3350Smrg# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
116138697ee19Smrg#
116148697ee19Smrg# This file is free software; the Free Software Foundation
116158697ee19Smrg# gives unlimited permission to copy and/or distribute it,
116168697ee19Smrg# with or without modifications, as long as this notice is preserved.
11617ab47cfaaSmrg
11618aa9e3350Smrg# serial 3
116195c42550eSmrg
116208697ee19Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
116218697ee19Smrg# ---------------------------
116228697ee19Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
116238697ee19Smrg# This macro is traced by Automake.
116248697ee19SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
11625ab47cfaaSmrg
116265c42550eSmrg# AM_SUBST_NOTMAKE(VARIABLE)
11627aa9e3350Smrg# --------------------------
116285c42550eSmrg# Public sister of _AM_SUBST_NOTMAKE.
116295c42550eSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
116305c42550eSmrg
116318697ee19Smrg# Check how to create a tarball.                            -*- Autoconf -*-
11632ab47cfaaSmrg
11633aa9e3350Smrg# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
116348697ee19Smrg#
116358697ee19Smrg# This file is free software; the Free Software Foundation
116368697ee19Smrg# gives unlimited permission to copy and/or distribute it,
116378697ee19Smrg# with or without modifications, as long as this notice is preserved.
11638ab47cfaaSmrg
116398697ee19Smrg# serial 2
11640ab47cfaaSmrg
116418697ee19Smrg# _AM_PROG_TAR(FORMAT)
11642ab47cfaaSmrg# --------------------
116438697ee19Smrg# Check how to create a tarball in format FORMAT.
116448697ee19Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
116458697ee19Smrg#
116468697ee19Smrg# Substitute a variable $(am__tar) that is a command
116478697ee19Smrg# writing to stdout a FORMAT-tarball containing the directory
116488697ee19Smrg# $tardir.
116498697ee19Smrg#     tardir=directory && $(am__tar) > result.tar
116508697ee19Smrg#
116518697ee19Smrg# Substitute a variable $(am__untar) that extract such
116528697ee19Smrg# a tarball read from stdin.
116538697ee19Smrg#     $(am__untar) < result.tar
116548697ee19SmrgAC_DEFUN([_AM_PROG_TAR],
11655aa9e3350Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
11656aa9e3350Smrg# in the wild :-(  We should find a proper way to deprecate it ...
11657aa9e3350SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
116588697ee19Smrgm4_if([$1], [v7],
11659aa9e3350Smrg     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
116608697ee19Smrg     [m4_case([$1], [ustar],, [pax],,
116618697ee19Smrg              [m4_fatal([Unknown tar format])])
116628697ee19SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
116638697ee19Smrg# Loop over all known methods to create a tar archive until one works.
116648697ee19Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
116658697ee19Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
116668697ee19Smrg# Do not fold the above two line into one, because Tru64 sh and
116678697ee19Smrg# Solaris sh will not grok spaces in the rhs of `-'.
116688697ee19Smrgfor _am_tool in $_am_tools
116698697ee19Smrgdo
116708697ee19Smrg  case $_am_tool in
116718697ee19Smrg  gnutar)
116728697ee19Smrg    for _am_tar in tar gnutar gtar;
116738697ee19Smrg    do
116748697ee19Smrg      AM_RUN_LOG([$_am_tar --version]) && break
116758697ee19Smrg    done
116768697ee19Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
116778697ee19Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
116788697ee19Smrg    am__untar="$_am_tar -xf -"
116798697ee19Smrg    ;;
116808697ee19Smrg  plaintar)
116818697ee19Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
116828697ee19Smrg    # ustar tarball either.
116838697ee19Smrg    (tar --version) >/dev/null 2>&1 && continue
116848697ee19Smrg    am__tar='tar chf - "$$tardir"'
116858697ee19Smrg    am__tar_='tar chf - "$tardir"'
116868697ee19Smrg    am__untar='tar xf -'
116878697ee19Smrg    ;;
116888697ee19Smrg  pax)
116898697ee19Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
116908697ee19Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
116918697ee19Smrg    am__untar='pax -r'
116928697ee19Smrg    ;;
116938697ee19Smrg  cpio)
116948697ee19Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
116958697ee19Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
116968697ee19Smrg    am__untar='cpio -i -H $1 -d'
116978697ee19Smrg    ;;
116988697ee19Smrg  none)
116998697ee19Smrg    am__tar=false
117008697ee19Smrg    am__tar_=false
117018697ee19Smrg    am__untar=false
117028697ee19Smrg    ;;
117038697ee19Smrg  esac
117048697ee19Smrg
117058697ee19Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
117068697ee19Smrg  # and am__untar set.
117078697ee19Smrg  test -n "${am_cv_prog_tar_$1}" && break
117088697ee19Smrg
117098697ee19Smrg  # tar/untar a dummy directory, and stop if the command works
117108697ee19Smrg  rm -rf conftest.dir
117118697ee19Smrg  mkdir conftest.dir
117128697ee19Smrg  echo GrepMe > conftest.dir/file
117138697ee19Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
117148697ee19Smrg  rm -rf conftest.dir
117158697ee19Smrg  if test -s conftest.tar; then
117168697ee19Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
117178697ee19Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
117188697ee19Smrg  fi
117198697ee19Smrgdone
117208697ee19Smrgrm -rf conftest.dir
117218697ee19Smrg
117228697ee19SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
117238697ee19SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
117248697ee19SmrgAC_SUBST([am__tar])
117258697ee19SmrgAC_SUBST([am__untar])
117268697ee19Smrg]) # _AM_PROG_TAR
11727ab47cfaaSmrg
11728