aclocal.m4 revision aa9e3350
1aa9e3350Smrg# generated automatically by aclocal 1.11.3 -*- 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
17aa9e3350Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
18aa9e3350Smrg[m4_warning([this file was generated for autoconf 2.68.
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*)
13416aec45a7Smrg	    LD="${LD-ld} -m elf_i386"
13426aec45a7Smrg	    ;;
13436aec45a7Smrg	  ppc64-*linux*|powerpc64-*linux*)
13446aec45a7Smrg	    LD="${LD-ld} -m elf32ppclinux"
13456aec45a7Smrg	    ;;
13466aec45a7Smrg	  s390x-*linux*)
13476aec45a7Smrg	    LD="${LD-ld} -m elf_s390"
13486aec45a7Smrg	    ;;
13496aec45a7Smrg	  sparc64-*linux*)
13506aec45a7Smrg	    LD="${LD-ld} -m elf32_sparc"
13516aec45a7Smrg	    ;;
13526aec45a7Smrg	esac
13536aec45a7Smrg	;;
13546aec45a7Smrg      *64-bit*)
13556aec45a7Smrg	case $host in
13566aec45a7Smrg	  x86_64-*kfreebsd*-gnu)
13576aec45a7Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
13586aec45a7Smrg	    ;;
13596aec45a7Smrg	  x86_64-*linux*)
13606aec45a7Smrg	    LD="${LD-ld} -m elf_x86_64"
13616aec45a7Smrg	    ;;
13626aec45a7Smrg	  ppc*-*linux*|powerpc*-*linux*)
13636aec45a7Smrg	    LD="${LD-ld} -m elf64ppc"
13646aec45a7Smrg	    ;;
13656aec45a7Smrg	  s390*-*linux*|s390*-*tpf*)
13666aec45a7Smrg	    LD="${LD-ld} -m elf64_s390"
13676aec45a7Smrg	    ;;
13686aec45a7Smrg	  sparc*-*linux*)
13696aec45a7Smrg	    LD="${LD-ld} -m elf64_sparc"
13706aec45a7Smrg	    ;;
13716aec45a7Smrg	esac
13726aec45a7Smrg	;;
13736aec45a7Smrg    esac
13746aec45a7Smrg  fi
13756aec45a7Smrg  rm -rf conftest*
13766aec45a7Smrg  ;;
1377ab47cfaaSmrg
13786aec45a7Smrg*-*-sco3.2v5*)
13796aec45a7Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
13806aec45a7Smrg  SAVE_CFLAGS="$CFLAGS"
13816aec45a7Smrg  CFLAGS="$CFLAGS -belf"
13826aec45a7Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
13836aec45a7Smrg    [AC_LANG_PUSH(C)
13846aec45a7Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
13856aec45a7Smrg     AC_LANG_POP])
13866aec45a7Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
13876aec45a7Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
13886aec45a7Smrg    CFLAGS="$SAVE_CFLAGS"
13896aec45a7Smrg  fi
13906aec45a7Smrg  ;;
1391aa9e3350Smrg*-*solaris*)
13926aec45a7Smrg  # Find out which ABI we are using.
13936aec45a7Smrg  echo 'int i;' > conftest.$ac_ext
13946aec45a7Smrg  if AC_TRY_EVAL(ac_compile); then
13956aec45a7Smrg    case `/usr/bin/file conftest.o` in
13966aec45a7Smrg    *64-bit*)
13976aec45a7Smrg      case $lt_cv_prog_gnu_ld in
1398aa9e3350Smrg      yes*)
1399aa9e3350Smrg        case $host in
1400aa9e3350Smrg        i?86-*-solaris*)
1401aa9e3350Smrg          LD="${LD-ld} -m elf_x86_64"
1402aa9e3350Smrg          ;;
1403aa9e3350Smrg        sparc*-*-solaris*)
1404aa9e3350Smrg          LD="${LD-ld} -m elf64_sparc"
1405aa9e3350Smrg          ;;
1406aa9e3350Smrg        esac
1407aa9e3350Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
1408aa9e3350Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1409aa9e3350Smrg          LD="${LD-ld}_sol2"
1410aa9e3350Smrg        fi
1411aa9e3350Smrg        ;;
14126aec45a7Smrg      *)
14136aec45a7Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
14146aec45a7Smrg	  LD="${LD-ld} -64"
14156aec45a7Smrg	fi
14166aec45a7Smrg	;;
14176aec45a7Smrg      esac
14186aec45a7Smrg      ;;
14196aec45a7Smrg    esac
14206aec45a7Smrg  fi
14216aec45a7Smrg  rm -rf conftest*
14226aec45a7Smrg  ;;
14236aec45a7Smrgesac
1424ab47cfaaSmrg
14256aec45a7Smrgneed_locks="$enable_libtool_lock"
14266aec45a7Smrg])# _LT_ENABLE_LOCK
14276aec45a7Smrg
14286aec45a7Smrg
1429aa9e3350Smrg# _LT_PROG_AR
1430aa9e3350Smrg# -----------
1431aa9e3350Smrgm4_defun([_LT_PROG_AR],
1432aa9e3350Smrg[AC_CHECK_TOOLS(AR, [ar], false)
1433aa9e3350Smrg: ${AR=ar}
1434aa9e3350Smrg: ${AR_FLAGS=cru}
1435aa9e3350Smrg_LT_DECL([], [AR], [1], [The archiver])
1436aa9e3350Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1437aa9e3350Smrg
1438aa9e3350SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1439aa9e3350Smrg  [lt_cv_ar_at_file=no
1440aa9e3350Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1441aa9e3350Smrg     [echo conftest.$ac_objext > conftest.lst
1442aa9e3350Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1443aa9e3350Smrg      AC_TRY_EVAL([lt_ar_try])
1444aa9e3350Smrg      if test "$ac_status" -eq 0; then
1445aa9e3350Smrg	# Ensure the archiver fails upon bogus file names.
1446aa9e3350Smrg	rm -f conftest.$ac_objext libconftest.a
1447aa9e3350Smrg	AC_TRY_EVAL([lt_ar_try])
1448aa9e3350Smrg	if test "$ac_status" -ne 0; then
1449aa9e3350Smrg          lt_cv_ar_at_file=@
1450aa9e3350Smrg        fi
1451aa9e3350Smrg      fi
1452aa9e3350Smrg      rm -f conftest.* libconftest.a
1453aa9e3350Smrg     ])
1454aa9e3350Smrg  ])
1455aa9e3350Smrg
1456aa9e3350Smrgif test "x$lt_cv_ar_at_file" = xno; then
1457aa9e3350Smrg  archiver_list_spec=
1458aa9e3350Smrgelse
1459aa9e3350Smrg  archiver_list_spec=$lt_cv_ar_at_file
1460aa9e3350Smrgfi
1461aa9e3350Smrg_LT_DECL([], [archiver_list_spec], [1],
1462aa9e3350Smrg  [How to feed a file listing to the archiver])
1463aa9e3350Smrg])# _LT_PROG_AR
1464aa9e3350Smrg
1465aa9e3350Smrg
14666aec45a7Smrg# _LT_CMD_OLD_ARCHIVE
14676aec45a7Smrg# -------------------
14686aec45a7Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1469aa9e3350Smrg[_LT_PROG_AR
14706aec45a7Smrg
14716aec45a7SmrgAC_CHECK_TOOL(STRIP, strip, :)
14726aec45a7Smrgtest -z "$STRIP" && STRIP=:
14736aec45a7Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
14746aec45a7Smrg
14756aec45a7SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
14766aec45a7Smrgtest -z "$RANLIB" && RANLIB=:
14776aec45a7Smrg_LT_DECL([], [RANLIB], [1],
14786aec45a7Smrg    [Commands used to install an old-style archive])
14796aec45a7Smrg
14806aec45a7Smrg# Determine commands to create old-style static archives.
14816aec45a7Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
14826aec45a7Smrgold_postinstall_cmds='chmod 644 $oldlib'
14836aec45a7Smrgold_postuninstall_cmds=
14846aec45a7Smrg
14856aec45a7Smrgif test -n "$RANLIB"; then
14866aec45a7Smrg  case $host_os in
14876aec45a7Smrg  openbsd*)
1488aa9e3350Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
14896aec45a7Smrg    ;;
14906aec45a7Smrg  *)
1491aa9e3350Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
14926aec45a7Smrg    ;;
1493ab47cfaaSmrg  esac
1494aa9e3350Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1495ab47cfaaSmrgfi
1496ab47cfaaSmrg
14976aec45a7Smrgcase $host_os in
14986aec45a7Smrg  darwin*)
14996aec45a7Smrg    lock_old_archive_extraction=yes ;;
15006aec45a7Smrg  *)
15016aec45a7Smrg    lock_old_archive_extraction=no ;;
15026aec45a7Smrgesac
15036aec45a7Smrg_LT_DECL([], [old_postinstall_cmds], [2])
15046aec45a7Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
15056aec45a7Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
15066aec45a7Smrg    [Commands used to build an old-style archive])
15076aec45a7Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
15086aec45a7Smrg    [Whether to use a lock for old archive extraction])
15096aec45a7Smrg])# _LT_CMD_OLD_ARCHIVE
15101473d951Smrg
1511ab47cfaaSmrg
15126aec45a7Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
15136aec45a7Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
15146aec45a7Smrg# ----------------------------------------------------------------
15156aec45a7Smrg# Check whether the given compiler option works
15166aec45a7SmrgAC_DEFUN([_LT_COMPILER_OPTION],
15176aec45a7Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
15186aec45a7Smrgm4_require([_LT_DECL_SED])dnl
15196aec45a7SmrgAC_CACHE_CHECK([$1], [$2],
15206aec45a7Smrg  [$2=no
15216aec45a7Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
15226aec45a7Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
15236aec45a7Smrg   lt_compiler_flag="$3"
1524ab47cfaaSmrg   # Insert the option either (1) after the last *FLAGS variable, or
1525ab47cfaaSmrg   # (2) before a word containing "conftest.", or (3) at the end.
1526ab47cfaaSmrg   # Note that $ac_compile itself does not contain backslashes and begins
1527ab47cfaaSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
15286aec45a7Smrg   # The option is referenced via a variable to avoid confusing sed.
1529ab47cfaaSmrg   lt_compile=`echo "$ac_compile" | $SED \
1530ab47cfaaSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1531ab47cfaaSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1532ab47cfaaSmrg   -e 's:$: $lt_compiler_flag:'`
15336aec45a7Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
15346aec45a7Smrg   (eval "$lt_compile" 2>conftest.err)
1535ab47cfaaSmrg   ac_status=$?
15366aec45a7Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
15376aec45a7Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
15386aec45a7Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1539ab47cfaaSmrg     # The compiler can only warn and ignore the option if not recognized
15406aec45a7Smrg     # So say no if there are warnings other than the usual output.
15416aec45a7Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
15426aec45a7Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
15436aec45a7Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
15446aec45a7Smrg       $2=yes
1545ab47cfaaSmrg     fi
1546ab47cfaaSmrg   fi
15476aec45a7Smrg   $RM conftest*
1548ab47cfaaSmrg])
1549ab47cfaaSmrg
15506aec45a7Smrgif test x"[$]$2" = xyes; then
15516aec45a7Smrg    m4_if([$5], , :, [$5])
1552ab47cfaaSmrgelse
15536aec45a7Smrg    m4_if([$6], , :, [$6])
1554ab47cfaaSmrgfi
15556aec45a7Smrg])# _LT_COMPILER_OPTION
1556ab47cfaaSmrg
15576aec45a7Smrg# Old name:
15586aec45a7SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
15596aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
15606aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1561ab47cfaaSmrg
1562ab47cfaaSmrg
15636aec45a7Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
15646aec45a7Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
15656aec45a7Smrg# ----------------------------------------------------
15666aec45a7Smrg# Check whether the given linker option works
15676aec45a7SmrgAC_DEFUN([_LT_LINKER_OPTION],
15686aec45a7Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
15696aec45a7Smrgm4_require([_LT_DECL_SED])dnl
15706aec45a7SmrgAC_CACHE_CHECK([$1], [$2],
15716aec45a7Smrg  [$2=no
15726aec45a7Smrg   save_LDFLAGS="$LDFLAGS"
15736aec45a7Smrg   LDFLAGS="$LDFLAGS $3"
15746aec45a7Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
15756aec45a7Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
15766aec45a7Smrg     # The linker can only warn and ignore the option if not recognized
15776aec45a7Smrg     # So say no if there are warnings
15786aec45a7Smrg     if test -s conftest.err; then
15796aec45a7Smrg       # Append any errors to the config.log.
15806aec45a7Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
15816aec45a7Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
15826aec45a7Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
15836aec45a7Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
15846aec45a7Smrg         $2=yes
15856aec45a7Smrg       fi
15866aec45a7Smrg     else
15876aec45a7Smrg       $2=yes
15886aec45a7Smrg     fi
15896aec45a7Smrg   fi
15906aec45a7Smrg   $RM -r conftest*
15916aec45a7Smrg   LDFLAGS="$save_LDFLAGS"
15926aec45a7Smrg])
1593ab47cfaaSmrg
15946aec45a7Smrgif test x"[$]$2" = xyes; then
15956aec45a7Smrg    m4_if([$4], , :, [$4])
1596ab47cfaaSmrgelse
15976aec45a7Smrg    m4_if([$5], , :, [$5])
1598ab47cfaaSmrgfi
15996aec45a7Smrg])# _LT_LINKER_OPTION
1600ab47cfaaSmrg
16016aec45a7Smrg# Old name:
16026aec45a7SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
16036aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
16046aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1605ab47cfaaSmrg
1606ab47cfaaSmrg
16076aec45a7Smrg# LT_CMD_MAX_LEN
16086aec45a7Smrg#---------------
16096aec45a7SmrgAC_DEFUN([LT_CMD_MAX_LEN],
16106aec45a7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
16116aec45a7Smrg# find the maximum length of command line arguments
16126aec45a7SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
16136aec45a7SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
16146aec45a7Smrg  i=0
16156aec45a7Smrg  teststring="ABCD"
1616ab47cfaaSmrg
16176aec45a7Smrg  case $build_os in
16186aec45a7Smrg  msdosdjgpp*)
16196aec45a7Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
16206aec45a7Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
16216aec45a7Smrg    # during glob expansion).  Even if it were fixed, the result of this
16226aec45a7Smrg    # check would be larger than it should be.
16236aec45a7Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
16246aec45a7Smrg    ;;
1625ab47cfaaSmrg
16266aec45a7Smrg  gnu*)
16276aec45a7Smrg    # Under GNU Hurd, this test is not required because there is
16286aec45a7Smrg    # no limit to the length of command line arguments.
16296aec45a7Smrg    # Libtool will interpret -1 as no limit whatsoever
16306aec45a7Smrg    lt_cv_sys_max_cmd_len=-1;
16316aec45a7Smrg    ;;
1632ab47cfaaSmrg
16336aec45a7Smrg  cygwin* | mingw* | cegcc*)
16346aec45a7Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
16356aec45a7Smrg    # about 5 minutes as the teststring grows exponentially.
16366aec45a7Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
16376aec45a7Smrg    # you end up with a "frozen" computer, even though with patience
16386aec45a7Smrg    # the test eventually succeeds (with a max line length of 256k).
16396aec45a7Smrg    # Instead, let's just punt: use the minimum linelength reported by
16406aec45a7Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
16416aec45a7Smrg    lt_cv_sys_max_cmd_len=8192;
16426aec45a7Smrg    ;;
1643ab47cfaaSmrg
16446aec45a7Smrg  mint*)
16456aec45a7Smrg    # On MiNT this can take a long time and run out of memory.
16466aec45a7Smrg    lt_cv_sys_max_cmd_len=8192;
16476aec45a7Smrg    ;;
1648ab47cfaaSmrg
16496aec45a7Smrg  amigaos*)
16506aec45a7Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
16516aec45a7Smrg    # So we just punt and use a minimum line length of 8192.
16526aec45a7Smrg    lt_cv_sys_max_cmd_len=8192;
16536aec45a7Smrg    ;;
1654ab47cfaaSmrg
16556aec45a7Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
16566aec45a7Smrg    # This has been around since 386BSD, at least.  Likely further.
16576aec45a7Smrg    if test -x /sbin/sysctl; then
16586aec45a7Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
16596aec45a7Smrg    elif test -x /usr/sbin/sysctl; then
16606aec45a7Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1661ab47cfaaSmrg    else
16626aec45a7Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1663ab47cfaaSmrg    fi
16646aec45a7Smrg    # And add a safety zone
16656aec45a7Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
16666aec45a7Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
16676aec45a7Smrg    ;;
1668ab47cfaaSmrg
16696aec45a7Smrg  interix*)
16706aec45a7Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
16716aec45a7Smrg    lt_cv_sys_max_cmd_len=196608
16726aec45a7Smrg    ;;
1673ab47cfaaSmrg
1674aa9e3350Smrg  os2*)
1675aa9e3350Smrg    # The test takes a long time on OS/2.
1676aa9e3350Smrg    lt_cv_sys_max_cmd_len=8192
1677aa9e3350Smrg    ;;
1678aa9e3350Smrg
16796aec45a7Smrg  osf*)
16806aec45a7Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
16816aec45a7Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
16826aec45a7Smrg    # nice to cause kernel panics so lets avoid the loop below.
16836aec45a7Smrg    # First set a reasonable default.
16846aec45a7Smrg    lt_cv_sys_max_cmd_len=16384
16856aec45a7Smrg    #
16866aec45a7Smrg    if test -x /sbin/sysconfig; then
16876aec45a7Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
16886aec45a7Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
16896aec45a7Smrg      esac
16906aec45a7Smrg    fi
16916aec45a7Smrg    ;;
16926aec45a7Smrg  sco3.2v5*)
16936aec45a7Smrg    lt_cv_sys_max_cmd_len=102400
16946aec45a7Smrg    ;;
16956aec45a7Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
16966aec45a7Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
16976aec45a7Smrg    if test -n "$kargmax"; then
16986aec45a7Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
16996aec45a7Smrg    else
17006aec45a7Smrg      lt_cv_sys_max_cmd_len=32768
17016aec45a7Smrg    fi
1702ab47cfaaSmrg    ;;
1703ab47cfaaSmrg  *)
17046aec45a7Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
17056aec45a7Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
17066aec45a7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
17076aec45a7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
17086aec45a7Smrg    else
17096aec45a7Smrg      # Make teststring a little bigger before we do anything with it.
17106aec45a7Smrg      # a 1K string should be a reasonable start.
17116aec45a7Smrg      for i in 1 2 3 4 5 6 7 8 ; do
17126aec45a7Smrg        teststring=$teststring$teststring
17136aec45a7Smrg      done
17146aec45a7Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
17156aec45a7Smrg      # If test is not a shell built-in, we'll probably end up computing a
17166aec45a7Smrg      # maximum length that is only half of the actual maximum length, but
17176aec45a7Smrg      # we can't tell.
1718aa9e3350Smrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
17196aec45a7Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
17206aec45a7Smrg	      test $i != 17 # 1/2 MB should be enough
17216aec45a7Smrg      do
17226aec45a7Smrg        i=`expr $i + 1`
17236aec45a7Smrg        teststring=$teststring$teststring
17246aec45a7Smrg      done
17256aec45a7Smrg      # Only check the string length outside the loop.
17266aec45a7Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
17276aec45a7Smrg      teststring=
17286aec45a7Smrg      # Add a significant safety factor because C++ compilers can tack on
17296aec45a7Smrg      # massive amounts of additional arguments before passing them to the
17306aec45a7Smrg      # linker.  It appears as though 1/2 is a usable value.
17316aec45a7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
17326aec45a7Smrg    fi
1733ab47cfaaSmrg    ;;
1734ab47cfaaSmrg  esac
17356aec45a7Smrg])
17366aec45a7Smrgif test -n $lt_cv_sys_max_cmd_len ; then
17376aec45a7Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
17386aec45a7Smrgelse
17396aec45a7Smrg  AC_MSG_RESULT(none)
17406aec45a7Smrgfi
17416aec45a7Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
17426aec45a7Smrg_LT_DECL([], [max_cmd_len], [0],
17436aec45a7Smrg    [What is the maximum length of a command?])
17446aec45a7Smrg])# LT_CMD_MAX_LEN
1745ab47cfaaSmrg
17466aec45a7Smrg# Old name:
17476aec45a7SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
17486aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
17496aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1750ab47cfaaSmrg
1751ab47cfaaSmrg
17526aec45a7Smrg# _LT_HEADER_DLFCN
17536aec45a7Smrg# ----------------
17546aec45a7Smrgm4_defun([_LT_HEADER_DLFCN],
17556aec45a7Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
17566aec45a7Smrg])# _LT_HEADER_DLFCN
1757ab47cfaaSmrg
17586aec45a7Smrg
17596aec45a7Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
17606aec45a7Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
17616aec45a7Smrg# ----------------------------------------------------------------
17626aec45a7Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
17636aec45a7Smrg[m4_require([_LT_HEADER_DLFCN])dnl
17646aec45a7Smrgif test "$cross_compiling" = yes; then :
17656aec45a7Smrg  [$4]
17666aec45a7Smrgelse
17676aec45a7Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
17686aec45a7Smrg  lt_status=$lt_dlunknown
17696aec45a7Smrg  cat > conftest.$ac_ext <<_LT_EOF
17706aec45a7Smrg[#line $LINENO "configure"
17716aec45a7Smrg#include "confdefs.h"
17726aec45a7Smrg
17736aec45a7Smrg#if HAVE_DLFCN_H
17746aec45a7Smrg#include <dlfcn.h>
17756aec45a7Smrg#endif
17766aec45a7Smrg
17776aec45a7Smrg#include <stdio.h>
17786aec45a7Smrg
17796aec45a7Smrg#ifdef RTLD_GLOBAL
17806aec45a7Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
17816aec45a7Smrg#else
17826aec45a7Smrg#  ifdef DL_GLOBAL
17836aec45a7Smrg#    define LT_DLGLOBAL		DL_GLOBAL
17846aec45a7Smrg#  else
17856aec45a7Smrg#    define LT_DLGLOBAL		0
17866aec45a7Smrg#  endif
17876aec45a7Smrg#endif
17886aec45a7Smrg
17896aec45a7Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
17906aec45a7Smrg   find out it does not work in some platform. */
17916aec45a7Smrg#ifndef LT_DLLAZY_OR_NOW
17926aec45a7Smrg#  ifdef RTLD_LAZY
17936aec45a7Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
17946aec45a7Smrg#  else
17956aec45a7Smrg#    ifdef DL_LAZY
17966aec45a7Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
17976aec45a7Smrg#    else
17986aec45a7Smrg#      ifdef RTLD_NOW
17996aec45a7Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
18006aec45a7Smrg#      else
18016aec45a7Smrg#        ifdef DL_NOW
18026aec45a7Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
18036aec45a7Smrg#        else
18046aec45a7Smrg#          define LT_DLLAZY_OR_NOW	0
18056aec45a7Smrg#        endif
18066aec45a7Smrg#      endif
18076aec45a7Smrg#    endif
18086aec45a7Smrg#  endif
18096aec45a7Smrg#endif
18106aec45a7Smrg
18116aec45a7Smrg/* When -fvisbility=hidden is used, assume the code has been annotated
18126aec45a7Smrg   correspondingly for the symbols needed.  */
18136aec45a7Smrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1814aa9e3350Smrgint fnord () __attribute__((visibility("default")));
18156aec45a7Smrg#endif
18166aec45a7Smrg
1817aa9e3350Smrgint fnord () { return 42; }
18186aec45a7Smrgint main ()
18196aec45a7Smrg{
18206aec45a7Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
18216aec45a7Smrg  int status = $lt_dlunknown;
18226aec45a7Smrg
18236aec45a7Smrg  if (self)
18246aec45a7Smrg    {
18256aec45a7Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
18266aec45a7Smrg      else
18276aec45a7Smrg        {
18286aec45a7Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
18296aec45a7Smrg          else puts (dlerror ());
18306aec45a7Smrg	}
18316aec45a7Smrg      /* dlclose (self); */
18326aec45a7Smrg    }
1833ab47cfaaSmrg  else
18346aec45a7Smrg    puts (dlerror ());
18356aec45a7Smrg
18366aec45a7Smrg  return status;
18376aec45a7Smrg}]
18386aec45a7Smrg_LT_EOF
18396aec45a7Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
18406aec45a7Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
18416aec45a7Smrg    lt_status=$?
18426aec45a7Smrg    case x$lt_status in
18436aec45a7Smrg      x$lt_dlno_uscore) $1 ;;
18446aec45a7Smrg      x$lt_dlneed_uscore) $2 ;;
18456aec45a7Smrg      x$lt_dlunknown|x*) $3 ;;
1846ab47cfaaSmrg    esac
18476aec45a7Smrg  else :
18486aec45a7Smrg    # compilation failed
18496aec45a7Smrg    $3
1850ab47cfaaSmrg  fi
18516aec45a7Smrgfi
18526aec45a7Smrgrm -fr conftest*
18536aec45a7Smrg])# _LT_TRY_DLOPEN_SELF
18546aec45a7Smrg
18556aec45a7Smrg
18566aec45a7Smrg# LT_SYS_DLOPEN_SELF
18576aec45a7Smrg# ------------------
18586aec45a7SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
18596aec45a7Smrg[m4_require([_LT_HEADER_DLFCN])dnl
18606aec45a7Smrgif test "x$enable_dlopen" != xyes; then
18616aec45a7Smrg  enable_dlopen=unknown
18626aec45a7Smrg  enable_dlopen_self=unknown
18636aec45a7Smrg  enable_dlopen_self_static=unknown
18646aec45a7Smrgelse
18656aec45a7Smrg  lt_cv_dlopen=no
18666aec45a7Smrg  lt_cv_dlopen_libs=
18676aec45a7Smrg
1868ab47cfaaSmrg  case $host_os in
18696aec45a7Smrg  beos*)
18706aec45a7Smrg    lt_cv_dlopen="load_add_on"
18716aec45a7Smrg    lt_cv_dlopen_libs=
18726aec45a7Smrg    lt_cv_dlopen_self=yes
1873ab47cfaaSmrg    ;;
18746aec45a7Smrg
18756aec45a7Smrg  mingw* | pw32* | cegcc*)
18766aec45a7Smrg    lt_cv_dlopen="LoadLibrary"
18776aec45a7Smrg    lt_cv_dlopen_libs=
1878ab47cfaaSmrg    ;;
18796aec45a7Smrg
18806aec45a7Smrg  cygwin*)
18816aec45a7Smrg    lt_cv_dlopen="dlopen"
18826aec45a7Smrg    lt_cv_dlopen_libs=
1883ab47cfaaSmrg    ;;
18846aec45a7Smrg
18856aec45a7Smrg  darwin*)
18866aec45a7Smrg  # if libdl is installed we need to link against it
18876aec45a7Smrg    AC_CHECK_LIB([dl], [dlopen],
18886aec45a7Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
18896aec45a7Smrg    lt_cv_dlopen="dyld"
18906aec45a7Smrg    lt_cv_dlopen_libs=
18916aec45a7Smrg    lt_cv_dlopen_self=yes
18926aec45a7Smrg    ])
18936aec45a7Smrg    ;;
18946aec45a7Smrg
18956aec45a7Smrg  *)
18966aec45a7Smrg    AC_CHECK_FUNC([shl_load],
18976aec45a7Smrg	  [lt_cv_dlopen="shl_load"],
18986aec45a7Smrg      [AC_CHECK_LIB([dld], [shl_load],
18996aec45a7Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
19006aec45a7Smrg	[AC_CHECK_FUNC([dlopen],
19016aec45a7Smrg	      [lt_cv_dlopen="dlopen"],
19026aec45a7Smrg	  [AC_CHECK_LIB([dl], [dlopen],
19036aec45a7Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
19046aec45a7Smrg	    [AC_CHECK_LIB([svld], [dlopen],
19056aec45a7Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
19066aec45a7Smrg	      [AC_CHECK_LIB([dld], [dld_link],
19076aec45a7Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
19086aec45a7Smrg	      ])
19096aec45a7Smrg	    ])
19106aec45a7Smrg	  ])
19116aec45a7Smrg	])
19126aec45a7Smrg      ])
1913ab47cfaaSmrg    ;;
1914ab47cfaaSmrg  esac
1915ab47cfaaSmrg
19166aec45a7Smrg  if test "x$lt_cv_dlopen" != xno; then
19176aec45a7Smrg    enable_dlopen=yes
19186aec45a7Smrg  else
19196aec45a7Smrg    enable_dlopen=no
19206aec45a7Smrg  fi
1921ab47cfaaSmrg
19226aec45a7Smrg  case $lt_cv_dlopen in
19236aec45a7Smrg  dlopen)
19246aec45a7Smrg    save_CPPFLAGS="$CPPFLAGS"
19256aec45a7Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
19266aec45a7Smrg
19276aec45a7Smrg    save_LDFLAGS="$LDFLAGS"
19286aec45a7Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
19296aec45a7Smrg
19306aec45a7Smrg    save_LIBS="$LIBS"
19316aec45a7Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
19326aec45a7Smrg
19336aec45a7Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
19346aec45a7Smrg	  lt_cv_dlopen_self, [dnl
19356aec45a7Smrg	  _LT_TRY_DLOPEN_SELF(
19366aec45a7Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
19376aec45a7Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
19386aec45a7Smrg    ])
19396aec45a7Smrg
19406aec45a7Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
19416aec45a7Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
19426aec45a7Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
19436aec45a7Smrg	  lt_cv_dlopen_self_static, [dnl
19446aec45a7Smrg	  _LT_TRY_DLOPEN_SELF(
19456aec45a7Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
19466aec45a7Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
19476aec45a7Smrg      ])
1948ab47cfaaSmrg    fi
19496aec45a7Smrg
19506aec45a7Smrg    CPPFLAGS="$save_CPPFLAGS"
19516aec45a7Smrg    LDFLAGS="$save_LDFLAGS"
19526aec45a7Smrg    LIBS="$save_LIBS"
1953ab47cfaaSmrg    ;;
1954ab47cfaaSmrg  esac
1955ab47cfaaSmrg
19566aec45a7Smrg  case $lt_cv_dlopen_self in
19576aec45a7Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
19586aec45a7Smrg  *) enable_dlopen_self=unknown ;;
1959ab47cfaaSmrg  esac
19606aec45a7Smrg
19616aec45a7Smrg  case $lt_cv_dlopen_self_static in
19626aec45a7Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
19636aec45a7Smrg  *) enable_dlopen_self_static=unknown ;;
1964ab47cfaaSmrg  esac
19656aec45a7Smrgfi
19666aec45a7Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
19676aec45a7Smrg	 [Whether dlopen is supported])
19686aec45a7Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
19696aec45a7Smrg	 [Whether dlopen of programs is supported])
19706aec45a7Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
19716aec45a7Smrg	 [Whether dlopen of statically linked programs is supported])
19726aec45a7Smrg])# LT_SYS_DLOPEN_SELF
1973ab47cfaaSmrg
19746aec45a7Smrg# Old name:
19756aec45a7SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
19766aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
19776aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1978ab47cfaaSmrg
1979ab47cfaaSmrg
19806aec45a7Smrg# _LT_COMPILER_C_O([TAGNAME])
19816aec45a7Smrg# ---------------------------
19826aec45a7Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
19836aec45a7Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
19846aec45a7Smrgm4_defun([_LT_COMPILER_C_O],
19856aec45a7Smrg[m4_require([_LT_DECL_SED])dnl
19866aec45a7Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
19876aec45a7Smrgm4_require([_LT_TAG_COMPILER])dnl
19886aec45a7SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
19896aec45a7Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
19906aec45a7Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
19916aec45a7Smrg   $RM -r conftest 2>/dev/null
19926aec45a7Smrg   mkdir conftest
19936aec45a7Smrg   cd conftest
19946aec45a7Smrg   mkdir out
19956aec45a7Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
19966aec45a7Smrg
19976aec45a7Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
19986aec45a7Smrg   # Insert the option either (1) after the last *FLAGS variable, or
19996aec45a7Smrg   # (2) before a word containing "conftest.", or (3) at the end.
20006aec45a7Smrg   # Note that $ac_compile itself does not contain backslashes and begins
20016aec45a7Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
20026aec45a7Smrg   lt_compile=`echo "$ac_compile" | $SED \
20036aec45a7Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
20046aec45a7Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
20056aec45a7Smrg   -e 's:$: $lt_compiler_flag:'`
20066aec45a7Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
20076aec45a7Smrg   (eval "$lt_compile" 2>out/conftest.err)
20086aec45a7Smrg   ac_status=$?
20096aec45a7Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
20106aec45a7Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
20116aec45a7Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
20126aec45a7Smrg   then
20136aec45a7Smrg     # The compiler can only warn and ignore the option if not recognized
20146aec45a7Smrg     # So say no if there are warnings
20156aec45a7Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
20166aec45a7Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
20176aec45a7Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
20186aec45a7Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
20196aec45a7Smrg     fi
20206aec45a7Smrg   fi
20216aec45a7Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
20226aec45a7Smrg   $RM conftest*
20236aec45a7Smrg   # SGI C++ compiler will create directory out/ii_files/ for
20246aec45a7Smrg   # template instantiation
20256aec45a7Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
20266aec45a7Smrg   $RM out/* && rmdir out
20276aec45a7Smrg   cd ..
20286aec45a7Smrg   $RM -r conftest
20296aec45a7Smrg   $RM conftest*
20306aec45a7Smrg])
20316aec45a7Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
20326aec45a7Smrg	[Does compiler simultaneously support -c and -o options?])
20336aec45a7Smrg])# _LT_COMPILER_C_O
20346aec45a7Smrg
20356aec45a7Smrg
20366aec45a7Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
20376aec45a7Smrg# ----------------------------------
20386aec45a7Smrg# Check to see if we can do hard links to lock some files if needed
20396aec45a7Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
20406aec45a7Smrg[m4_require([_LT_ENABLE_LOCK])dnl
20416aec45a7Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
20426aec45a7Smrg_LT_COMPILER_C_O([$1])
20436aec45a7Smrg
20446aec45a7Smrghard_links="nottested"
20456aec45a7Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
20466aec45a7Smrg  # do not overwrite the value of need_locks provided by the user
20476aec45a7Smrg  AC_MSG_CHECKING([if we can lock with hard links])
20486aec45a7Smrg  hard_links=yes
20496aec45a7Smrg  $RM conftest*
20506aec45a7Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
20516aec45a7Smrg  touch conftest.a
20526aec45a7Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
20536aec45a7Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
20546aec45a7Smrg  AC_MSG_RESULT([$hard_links])
20556aec45a7Smrg  if test "$hard_links" = no; then
20566aec45a7Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
20576aec45a7Smrg    need_locks=warn
2058ab47cfaaSmrg  fi
20596aec45a7Smrgelse
20606aec45a7Smrg  need_locks=no
20616aec45a7Smrgfi
20626aec45a7Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
20636aec45a7Smrg])# _LT_COMPILER_FILE_LOCKS
2064ab47cfaaSmrg
2065ab47cfaaSmrg
20666aec45a7Smrg# _LT_CHECK_OBJDIR
20676aec45a7Smrg# ----------------
20686aec45a7Smrgm4_defun([_LT_CHECK_OBJDIR],
20696aec45a7Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
20706aec45a7Smrg[rm -f .libs 2>/dev/null
20716aec45a7Smrgmkdir .libs 2>/dev/null
20726aec45a7Smrgif test -d .libs; then
20736aec45a7Smrg  lt_cv_objdir=.libs
20746aec45a7Smrgelse
20756aec45a7Smrg  # MS-DOS does not allow filenames that begin with a dot.
20766aec45a7Smrg  lt_cv_objdir=_libs
20776aec45a7Smrgfi
20786aec45a7Smrgrmdir .libs 2>/dev/null])
20796aec45a7Smrgobjdir=$lt_cv_objdir
20806aec45a7Smrg_LT_DECL([], [objdir], [0],
20816aec45a7Smrg         [The name of the directory that contains temporary libtool files])dnl
20826aec45a7Smrgm4_pattern_allow([LT_OBJDIR])dnl
20836aec45a7SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
20846aec45a7Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
20856aec45a7Smrg])# _LT_CHECK_OBJDIR
20866aec45a7Smrg
20876aec45a7Smrg
20886aec45a7Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
20896aec45a7Smrg# --------------------------------------
20906aec45a7Smrg# Check hardcoding attributes.
20916aec45a7Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
20926aec45a7Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
20936aec45a7Smrg_LT_TAGVAR(hardcode_action, $1)=
20946aec45a7Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
20956aec45a7Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
20966aec45a7Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
20976aec45a7Smrg
20986aec45a7Smrg  # We can hardcode non-existent directories.
20996aec45a7Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
21006aec45a7Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
21016aec45a7Smrg     # have to relink, otherwise we might link with an installed library
21026aec45a7Smrg     # when we should be linking with a yet-to-be-installed one
21036aec45a7Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
21046aec45a7Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
21056aec45a7Smrg    # Linking always hardcodes the temporary library directory.
21066aec45a7Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
2107ab47cfaaSmrg  else
21086aec45a7Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
21096aec45a7Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
2110ab47cfaaSmrg  fi
21116aec45a7Smrgelse
21126aec45a7Smrg  # We cannot hardcode anything, or else we can only hardcode existing
21136aec45a7Smrg  # directories.
21146aec45a7Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
21156aec45a7Smrgfi
21166aec45a7SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2117ab47cfaaSmrg
21186aec45a7Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
21196aec45a7Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
21206aec45a7Smrg  # Fast installation is not supported
21216aec45a7Smrg  enable_fast_install=no
21226aec45a7Smrgelif test "$shlibpath_overrides_runpath" = yes ||
21236aec45a7Smrg     test "$enable_shared" = no; then
21246aec45a7Smrg  # Fast installation is not necessary
21256aec45a7Smrg  enable_fast_install=needless
21266aec45a7Smrgfi
21276aec45a7Smrg_LT_TAGDECL([], [hardcode_action], [0],
21286aec45a7Smrg    [How to hardcode a shared library path into an executable])
21296aec45a7Smrg])# _LT_LINKER_HARDCODE_LIBPATH
2130ab47cfaaSmrg
21316aec45a7Smrg
21326aec45a7Smrg# _LT_CMD_STRIPLIB
21336aec45a7Smrg# ----------------
21346aec45a7Smrgm4_defun([_LT_CMD_STRIPLIB],
21356aec45a7Smrg[m4_require([_LT_DECL_EGREP])
21366aec45a7Smrgstriplib=
21376aec45a7Smrgold_striplib=
21386aec45a7SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
21396aec45a7Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
21406aec45a7Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
21416aec45a7Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
21426aec45a7Smrg  AC_MSG_RESULT([yes])
21436aec45a7Smrgelse
21446aec45a7Smrg# FIXME - insert some real tests, host_os isn't really good enough
21456aec45a7Smrg  case $host_os in
21466aec45a7Smrg  darwin*)
21476aec45a7Smrg    if test -n "$STRIP" ; then
21486aec45a7Smrg      striplib="$STRIP -x"
21496aec45a7Smrg      old_striplib="$STRIP -S"
21506aec45a7Smrg      AC_MSG_RESULT([yes])
21516aec45a7Smrg    else
21526aec45a7Smrg      AC_MSG_RESULT([no])
21536aec45a7Smrg    fi
21546aec45a7Smrg    ;;
21556aec45a7Smrg  *)
21566aec45a7Smrg    AC_MSG_RESULT([no])
21576aec45a7Smrg    ;;
21586aec45a7Smrg  esac
21596aec45a7Smrgfi
21606aec45a7Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
21616aec45a7Smrg_LT_DECL([], [striplib], [1])
21626aec45a7Smrg])# _LT_CMD_STRIPLIB
21636aec45a7Smrg
21646aec45a7Smrg
21656aec45a7Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
21666aec45a7Smrg# -----------------------------
21676aec45a7Smrg# PORTME Fill in your ld.so characteristics
21686aec45a7Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
21696aec45a7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
21706aec45a7Smrgm4_require([_LT_DECL_EGREP])dnl
21716aec45a7Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
21726aec45a7Smrgm4_require([_LT_DECL_OBJDUMP])dnl
21736aec45a7Smrgm4_require([_LT_DECL_SED])dnl
21746aec45a7Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
21756aec45a7SmrgAC_MSG_CHECKING([dynamic linker characteristics])
21766aec45a7Smrgm4_if([$1],
21776aec45a7Smrg	[], [
21786aec45a7Smrgif test "$GCC" = yes; then
21796aec45a7Smrg  case $host_os in
21806aec45a7Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
21816aec45a7Smrg    *) lt_awk_arg="/^libraries:/" ;;
21826aec45a7Smrg  esac
21836aec45a7Smrg  case $host_os in
21846aec45a7Smrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
21856aec45a7Smrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
21866aec45a7Smrg  esac
21876aec45a7Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
21886aec45a7Smrg  case $lt_search_path_spec in
21896aec45a7Smrg  *\;*)
21906aec45a7Smrg    # if the path contains ";" then we assume it to be the separator
21916aec45a7Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
21926aec45a7Smrg    # assumed that no part of a normal pathname contains ";" but that should
21936aec45a7Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
21946aec45a7Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
21956aec45a7Smrg    ;;
21966aec45a7Smrg  *)
21976aec45a7Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
21986aec45a7Smrg    ;;
21996aec45a7Smrg  esac
22006aec45a7Smrg  # Ok, now we have the path, separated by spaces, we can step through it
22016aec45a7Smrg  # and add multilib dir if necessary.
22026aec45a7Smrg  lt_tmp_lt_search_path_spec=
22036aec45a7Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
22046aec45a7Smrg  for lt_sys_path in $lt_search_path_spec; do
22056aec45a7Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
22066aec45a7Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
22076aec45a7Smrg    else
22086aec45a7Smrg      test -d "$lt_sys_path" && \
22096aec45a7Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
22106aec45a7Smrg    fi
22116aec45a7Smrg  done
22126aec45a7Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
22136aec45a7SmrgBEGIN {RS=" "; FS="/|\n";} {
22146aec45a7Smrg  lt_foo="";
22156aec45a7Smrg  lt_count=0;
22166aec45a7Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
22176aec45a7Smrg    if ($lt_i != "" && $lt_i != ".") {
22186aec45a7Smrg      if ($lt_i == "..") {
22196aec45a7Smrg        lt_count++;
22206aec45a7Smrg      } else {
22216aec45a7Smrg        if (lt_count == 0) {
22226aec45a7Smrg          lt_foo="/" $lt_i lt_foo;
22236aec45a7Smrg        } else {
22246aec45a7Smrg          lt_count--;
22256aec45a7Smrg        }
22266aec45a7Smrg      }
22276aec45a7Smrg    }
22286aec45a7Smrg  }
22296aec45a7Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
22306aec45a7Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
22316aec45a7Smrg}'`
22326aec45a7Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
22336aec45a7Smrg  # for these hosts.
22346aec45a7Smrg  case $host_os in
22356aec45a7Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
22366aec45a7Smrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
22376aec45a7Smrg  esac
22386aec45a7Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
22396aec45a7Smrgelse
22406aec45a7Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
22416aec45a7Smrgfi])
22426aec45a7Smrglibrary_names_spec=
22436aec45a7Smrglibname_spec='lib$name'
22446aec45a7Smrgsoname_spec=
22456aec45a7Smrgshrext_cmds=".so"
22466aec45a7Smrgpostinstall_cmds=
22476aec45a7Smrgpostuninstall_cmds=
22486aec45a7Smrgfinish_cmds=
22496aec45a7Smrgfinish_eval=
22506aec45a7Smrgshlibpath_var=
22516aec45a7Smrgshlibpath_overrides_runpath=unknown
22526aec45a7Smrgversion_type=none
22536aec45a7Smrgdynamic_linker="$host_os ld.so"
22546aec45a7Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
22556aec45a7Smrgneed_lib_prefix=unknown
22566aec45a7Smrghardcode_into_libs=no
22576aec45a7Smrg
22586aec45a7Smrg# when you set need_version to no, make sure it does not cause -set_version
22596aec45a7Smrg# flags to be left without arguments
22606aec45a7Smrgneed_version=unknown
22616aec45a7Smrg
22626aec45a7Smrgcase $host_os in
22636aec45a7Smrgaix3*)
2264aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
22656aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
22666aec45a7Smrg  shlibpath_var=LIBPATH
22676aec45a7Smrg
22686aec45a7Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
2269ab47cfaaSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2270ab47cfaaSmrg  ;;
2271ab47cfaaSmrg
22726aec45a7Smrgaix[[4-9]]*)
2273aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2274ab47cfaaSmrg  need_lib_prefix=no
22756aec45a7Smrg  need_version=no
22766aec45a7Smrg  hardcode_into_libs=yes
22776aec45a7Smrg  if test "$host_cpu" = ia64; then
22786aec45a7Smrg    # AIX 5 supports IA64
22796aec45a7Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
22806aec45a7Smrg    shlibpath_var=LD_LIBRARY_PATH
2281ab47cfaaSmrg  else
22826aec45a7Smrg    # With GCC up to 2.95.x, collect2 would create an import file
22836aec45a7Smrg    # for dependence libraries.  The import file would start with
22846aec45a7Smrg    # the line `#! .'.  This would cause the generated library to
22856aec45a7Smrg    # depend on `.', always an invalid library.  This was fixed in
22866aec45a7Smrg    # development snapshots of GCC prior to 3.0.
22876aec45a7Smrg    case $host_os in
22886aec45a7Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
22896aec45a7Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
22906aec45a7Smrg	   echo ' yes '
22916aec45a7Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
22926aec45a7Smrg	:
22936aec45a7Smrg      else
22946aec45a7Smrg	can_build_shared=no
22956aec45a7Smrg      fi
22966aec45a7Smrg      ;;
22976aec45a7Smrg    esac
22986aec45a7Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
22996aec45a7Smrg    # soname into executable. Probably we can add versioning support to
23006aec45a7Smrg    # collect2, so additional links can be useful in future.
23016aec45a7Smrg    if test "$aix_use_runtimelinking" = yes; then
23026aec45a7Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
23036aec45a7Smrg      # instead of lib<name>.a to let people know that these are not
23046aec45a7Smrg      # typical AIX shared libraries.
23056aec45a7Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23066aec45a7Smrg    else
23076aec45a7Smrg      # We preserve .a as extension for shared libraries through AIX4.2
23086aec45a7Smrg      # and later when we are not doing run time linking.
23096aec45a7Smrg      library_names_spec='${libname}${release}.a $libname.a'
23106aec45a7Smrg      soname_spec='${libname}${release}${shared_ext}$major'
23116aec45a7Smrg    fi
23126aec45a7Smrg    shlibpath_var=LIBPATH
2313ab47cfaaSmrg  fi
2314ab47cfaaSmrg  ;;
2315ab47cfaaSmrg
23166aec45a7Smrgamigaos*)
23176aec45a7Smrg  case $host_cpu in
23186aec45a7Smrg  powerpc)
23196aec45a7Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
23206aec45a7Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
23216aec45a7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23226aec45a7Smrg    ;;
23236aec45a7Smrg  m68k)
23246aec45a7Smrg    library_names_spec='$libname.ixlibrary $libname.a'
23256aec45a7Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
23266aec45a7Smrg    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'
23276aec45a7Smrg    ;;
23286aec45a7Smrg  esac
2329ab47cfaaSmrg  ;;
2330ab47cfaaSmrg
23316aec45a7Smrgbeos*)
23326aec45a7Smrg  library_names_spec='${libname}${shared_ext}'
23336aec45a7Smrg  dynamic_linker="$host_os ld.so"
23346aec45a7Smrg  shlibpath_var=LIBRARY_PATH
23356aec45a7Smrg  ;;
23366aec45a7Smrg
23376aec45a7Smrgbsdi[[45]]*)
2338aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2339ab47cfaaSmrg  need_version=no
2340ab47cfaaSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23416aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
23426aec45a7Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2343ab47cfaaSmrg  shlibpath_var=LD_LIBRARY_PATH
23446aec45a7Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
23456aec45a7Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
23466aec45a7Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
23476aec45a7Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
23486aec45a7Smrg  # libtool to hard-code these into programs
2349ab47cfaaSmrg  ;;
2350ab47cfaaSmrg
23516aec45a7Smrgcygwin* | mingw* | pw32* | cegcc*)
23526aec45a7Smrg  version_type=windows
23536aec45a7Smrg  shrext_cmds=".dll"
23546aec45a7Smrg  need_version=no
23556aec45a7Smrg  need_lib_prefix=no
23566aec45a7Smrg
2357aa9e3350Smrg  case $GCC,$cc_basename in
2358aa9e3350Smrg  yes,*)
2359aa9e3350Smrg    # gcc
23606aec45a7Smrg    library_names_spec='$libname.dll.a'
23616aec45a7Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
23626aec45a7Smrg    postinstall_cmds='base_file=`basename \${file}`~
23636aec45a7Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
23646aec45a7Smrg      dldir=$destdir/`dirname \$dlpath`~
23656aec45a7Smrg      test -d \$dldir || mkdir -p \$dldir~
23666aec45a7Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
23676aec45a7Smrg      chmod a+x \$dldir/$dlname~
23686aec45a7Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
23696aec45a7Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
23706aec45a7Smrg      fi'
23716aec45a7Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
23726aec45a7Smrg      dlpath=$dir/\$dldll~
23736aec45a7Smrg       $RM \$dlpath'
23746aec45a7Smrg    shlibpath_overrides_runpath=yes
23756aec45a7Smrg
23766aec45a7Smrg    case $host_os in
23776aec45a7Smrg    cygwin*)
23786aec45a7Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
23796aec45a7Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
23806aec45a7Smrgm4_if([$1], [],[
23816aec45a7Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
23826aec45a7Smrg      ;;
23836aec45a7Smrg    mingw* | cegcc*)
23846aec45a7Smrg      # MinGW DLLs use traditional 'lib' prefix
23856aec45a7Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
23866aec45a7Smrg      ;;
23876aec45a7Smrg    pw32*)
23886aec45a7Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
23896aec45a7Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
23906aec45a7Smrg      ;;
23916aec45a7Smrg    esac
2392aa9e3350Smrg    dynamic_linker='Win32 ld.exe'
2393aa9e3350Smrg    ;;
2394aa9e3350Smrg
2395aa9e3350Smrg  *,cl*)
2396aa9e3350Smrg    # Native MSVC
2397aa9e3350Smrg    libname_spec='$name'
2398aa9e3350Smrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2399aa9e3350Smrg    library_names_spec='${libname}.dll.lib'
2400aa9e3350Smrg
2401aa9e3350Smrg    case $build_os in
2402aa9e3350Smrg    mingw*)
2403aa9e3350Smrg      sys_lib_search_path_spec=
2404aa9e3350Smrg      lt_save_ifs=$IFS
2405aa9e3350Smrg      IFS=';'
2406aa9e3350Smrg      for lt_path in $LIB
2407aa9e3350Smrg      do
2408aa9e3350Smrg        IFS=$lt_save_ifs
2409aa9e3350Smrg        # Let DOS variable expansion print the short 8.3 style file name.
2410aa9e3350Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2411aa9e3350Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2412aa9e3350Smrg      done
2413aa9e3350Smrg      IFS=$lt_save_ifs
2414aa9e3350Smrg      # Convert to MSYS style.
2415aa9e3350Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2416aa9e3350Smrg      ;;
2417aa9e3350Smrg    cygwin*)
2418aa9e3350Smrg      # Convert to unix form, then to dos form, then back to unix form
2419aa9e3350Smrg      # but this time dos style (no spaces!) so that the unix form looks
2420aa9e3350Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
2421aa9e3350Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2422aa9e3350Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2423aa9e3350Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2424aa9e3350Smrg      ;;
2425aa9e3350Smrg    *)
2426aa9e3350Smrg      sys_lib_search_path_spec="$LIB"
2427aa9e3350Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2428aa9e3350Smrg        # It is most probably a Windows format PATH.
2429aa9e3350Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2430aa9e3350Smrg      else
2431aa9e3350Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2432aa9e3350Smrg      fi
2433aa9e3350Smrg      # FIXME: find the short name or the path components, as spaces are
2434aa9e3350Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
2435aa9e3350Smrg      ;;
2436aa9e3350Smrg    esac
2437aa9e3350Smrg
2438aa9e3350Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2439aa9e3350Smrg    postinstall_cmds='base_file=`basename \${file}`~
2440aa9e3350Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2441aa9e3350Smrg      dldir=$destdir/`dirname \$dlpath`~
2442aa9e3350Smrg      test -d \$dldir || mkdir -p \$dldir~
2443aa9e3350Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
2444aa9e3350Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2445aa9e3350Smrg      dlpath=$dir/\$dldll~
2446aa9e3350Smrg       $RM \$dlpath'
2447aa9e3350Smrg    shlibpath_overrides_runpath=yes
2448aa9e3350Smrg    dynamic_linker='Win32 link.exe'
24496aec45a7Smrg    ;;
24506aec45a7Smrg
24516aec45a7Smrg  *)
2452aa9e3350Smrg    # Assume MSVC wrapper
24536aec45a7Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2454aa9e3350Smrg    dynamic_linker='Win32 ld.exe'
24556aec45a7Smrg    ;;
24566aec45a7Smrg  esac
24576aec45a7Smrg  # FIXME: first we should search . and the directory the executable is in
24586aec45a7Smrg  shlibpath_var=PATH
24598697ee19Smrg  ;;
24608697ee19Smrg
24616aec45a7Smrgdarwin* | rhapsody*)
24626aec45a7Smrg  dynamic_linker="$host_os dyld"
24636aec45a7Smrg  version_type=darwin
24646aec45a7Smrg  need_lib_prefix=no
24656aec45a7Smrg  need_version=no
24666aec45a7Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
24676aec45a7Smrg  soname_spec='${libname}${release}${major}$shared_ext'
24686aec45a7Smrg  shlibpath_overrides_runpath=yes
24696aec45a7Smrg  shlibpath_var=DYLD_LIBRARY_PATH
24706aec45a7Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
24716aec45a7Smrgm4_if([$1], [],[
24726aec45a7Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
24736aec45a7Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
24746aec45a7Smrg  ;;
24756aec45a7Smrg
24766aec45a7Smrgdgux*)
2477aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2478ab47cfaaSmrg  need_lib_prefix=no
2479ab47cfaaSmrg  need_version=no
24806aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2481ab47cfaaSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2482ab47cfaaSmrg  shlibpath_var=LD_LIBRARY_PATH
2483ab47cfaaSmrg  ;;
2484ab47cfaaSmrg
24856aec45a7Smrgfreebsd* | dragonfly*)
24866aec45a7Smrg  # DragonFly does not have aout.  When/if they implement a new
24876aec45a7Smrg  # versioning mechanism, adjust this.
24886aec45a7Smrg  if test -x /usr/bin/objformat; then
24896aec45a7Smrg    objformat=`/usr/bin/objformat`
24906aec45a7Smrg  else
24916aec45a7Smrg    case $host_os in
2492aa9e3350Smrg    freebsd[[23]].*) objformat=aout ;;
24936aec45a7Smrg    *) objformat=elf ;;
24946aec45a7Smrg    esac
24956aec45a7Smrg  fi
24966aec45a7Smrg  version_type=freebsd-$objformat
24976aec45a7Smrg  case $version_type in
24986aec45a7Smrg    freebsd-elf*)
24996aec45a7Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
25006aec45a7Smrg      need_version=no
2501ab47cfaaSmrg      need_lib_prefix=no
2502ab47cfaaSmrg      ;;
25036aec45a7Smrg    freebsd-*)
25046aec45a7Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
25056aec45a7Smrg      need_version=yes
2506ab47cfaaSmrg      ;;
2507ab47cfaaSmrg  esac
25086aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
25096aec45a7Smrg  case $host_os in
2510aa9e3350Smrg  freebsd2.*)
25116aec45a7Smrg    shlibpath_overrides_runpath=yes
25126aec45a7Smrg    ;;
25136aec45a7Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
25146aec45a7Smrg    shlibpath_overrides_runpath=yes
25156aec45a7Smrg    hardcode_into_libs=yes
25166aec45a7Smrg    ;;
25176aec45a7Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
25186aec45a7Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
25196aec45a7Smrg    shlibpath_overrides_runpath=no
25206aec45a7Smrg    hardcode_into_libs=yes
25216aec45a7Smrg    ;;
25226aec45a7Smrg  *) # from 4.6 on, and DragonFly
25236aec45a7Smrg    shlibpath_overrides_runpath=yes
25246aec45a7Smrg    hardcode_into_libs=yes
25256aec45a7Smrg    ;;
25266aec45a7Smrg  esac
2527ab47cfaaSmrg  ;;
2528ab47cfaaSmrg
25296aec45a7Smrggnu*)
2530aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2531ab47cfaaSmrg  need_lib_prefix=no
2532ab47cfaaSmrg  need_version=no
25336aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2534ab47cfaaSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2535ab47cfaaSmrg  shlibpath_var=LD_LIBRARY_PATH
2536aa9e3350Smrg  shlibpath_overrides_runpath=no
2537ab47cfaaSmrg  hardcode_into_libs=yes
2538ab47cfaaSmrg  ;;
2539ab47cfaaSmrg
25406aec45a7Smrghaiku*)
2541aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
25426aec45a7Smrg  need_lib_prefix=no
25436aec45a7Smrg  need_version=no
25446aec45a7Smrg  dynamic_linker="$host_os runtime_loader"
25456aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2546ab47cfaaSmrg  soname_spec='${libname}${release}${shared_ext}$major'
25476aec45a7Smrg  shlibpath_var=LIBRARY_PATH
25486aec45a7Smrg  shlibpath_overrides_runpath=yes
25496aec45a7Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
25506aec45a7Smrg  hardcode_into_libs=yes
2551ab47cfaaSmrg  ;;
25525c42550eSmrg
25536aec45a7Smrghpux9* | hpux10* | hpux11*)
25546aec45a7Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
25556aec45a7Smrg  # link against other versions.
25566aec45a7Smrg  version_type=sunos
25576aec45a7Smrg  need_lib_prefix=no
25586aec45a7Smrg  need_version=no
25596aec45a7Smrg  case $host_cpu in
25606aec45a7Smrg  ia64*)
25616aec45a7Smrg    shrext_cmds='.so'
25626aec45a7Smrg    hardcode_into_libs=yes
25636aec45a7Smrg    dynamic_linker="$host_os dld.so"
25646aec45a7Smrg    shlibpath_var=LD_LIBRARY_PATH
25656aec45a7Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
25666aec45a7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25676aec45a7Smrg    soname_spec='${libname}${release}${shared_ext}$major'
25686aec45a7Smrg    if test "X$HPUX_IA64_MODE" = X32; then
25696aec45a7Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
25705c42550eSmrg    else
25716aec45a7Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
25725c42550eSmrg    fi
25736aec45a7Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
25746aec45a7Smrg    ;;
25756aec45a7Smrg  hppa*64*)
25766aec45a7Smrg    shrext_cmds='.sl'
25776aec45a7Smrg    hardcode_into_libs=yes
25786aec45a7Smrg    dynamic_linker="$host_os dld.sl"
25796aec45a7Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
25806aec45a7Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
25816aec45a7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25826aec45a7Smrg    soname_spec='${libname}${release}${shared_ext}$major'
25836aec45a7Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
25846aec45a7Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
25856aec45a7Smrg    ;;
25866aec45a7Smrg  *)
25876aec45a7Smrg    shrext_cmds='.sl'
25886aec45a7Smrg    dynamic_linker="$host_os dld.sl"
25896aec45a7Smrg    shlibpath_var=SHLIB_PATH
25906aec45a7Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
25916aec45a7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25926aec45a7Smrg    soname_spec='${libname}${release}${shared_ext}$major'
25936aec45a7Smrg    ;;
25946aec45a7Smrg  esac
25956aec45a7Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
25966aec45a7Smrg  postinstall_cmds='chmod 555 $lib'
25976aec45a7Smrg  # or fails outright, so override atomically:
25986aec45a7Smrg  install_override_mode=555
25996aec45a7Smrg  ;;
26005c42550eSmrg
26016aec45a7Smrginterix[[3-9]]*)
2602aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
26036aec45a7Smrg  need_lib_prefix=no
26046aec45a7Smrg  need_version=no
26056aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
26066aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
26076aec45a7Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
26086aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
26096aec45a7Smrg  shlibpath_overrides_runpath=no
26106aec45a7Smrg  hardcode_into_libs=yes
26116aec45a7Smrg  ;;
26125c42550eSmrg
26136aec45a7Smrgirix5* | irix6* | nonstopux*)
26146aec45a7Smrg  case $host_os in
26156aec45a7Smrg    nonstopux*) version_type=nonstopux ;;
26166aec45a7Smrg    *)
26176aec45a7Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
2618aa9e3350Smrg		version_type=linux # correct to gnu/linux during the next big refactor
26196aec45a7Smrg	else
26206aec45a7Smrg		version_type=irix
26216aec45a7Smrg	fi ;;
26226aec45a7Smrg  esac
26236aec45a7Smrg  need_lib_prefix=no
26246aec45a7Smrg  need_version=no
26256aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
26266aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
26276aec45a7Smrg  case $host_os in
26286aec45a7Smrg  irix5* | nonstopux*)
26296aec45a7Smrg    libsuff= shlibsuff=
26306aec45a7Smrg    ;;
26316aec45a7Smrg  *)
26326aec45a7Smrg    case $LD in # libtool.m4 will add one of these switches to LD
26336aec45a7Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
26346aec45a7Smrg      libsuff= shlibsuff= libmagic=32-bit;;
26356aec45a7Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
26366aec45a7Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
26376aec45a7Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
26386aec45a7Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
26396aec45a7Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
26405c42550eSmrg    esac
26416aec45a7Smrg    ;;
26426aec45a7Smrg  esac
26436aec45a7Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
26446aec45a7Smrg  shlibpath_overrides_runpath=no
26456aec45a7Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
26466aec45a7Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
26476aec45a7Smrg  hardcode_into_libs=yes
26486aec45a7Smrg  ;;
26495c42550eSmrg
26506aec45a7Smrg# No shared lib support for Linux oldld, aout, or coff.
26516aec45a7Smrglinux*oldld* | linux*aout* | linux*coff*)
26526aec45a7Smrg  dynamic_linker=no
26536aec45a7Smrg  ;;
26545c42550eSmrg
2655aa9e3350Smrg# This must be glibc/ELF.
26566aec45a7Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
2657aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
26586aec45a7Smrg  need_lib_prefix=no
26596aec45a7Smrg  need_version=no
26606aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
26616aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
26626aec45a7Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
26636aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
26646aec45a7Smrg  shlibpath_overrides_runpath=no
26655c42550eSmrg
26666aec45a7Smrg  # Some binutils ld are patched to set DT_RUNPATH
26676aec45a7Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
26686aec45a7Smrg    [lt_cv_shlibpath_overrides_runpath=no
26696aec45a7Smrg    save_LDFLAGS=$LDFLAGS
26706aec45a7Smrg    save_libdir=$libdir
26716aec45a7Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
26726aec45a7Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
26736aec45a7Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
26746aec45a7Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
26756aec45a7Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
26766aec45a7Smrg    LDFLAGS=$save_LDFLAGS
26776aec45a7Smrg    libdir=$save_libdir
26786aec45a7Smrg    ])
26796aec45a7Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
26805c42550eSmrg
26816aec45a7Smrg  # This implies no fast_install, which is unacceptable.
26826aec45a7Smrg  # Some rework will be needed to allow for fast_install
26836aec45a7Smrg  # before this can be enabled.
26846aec45a7Smrg  hardcode_into_libs=yes
26855c42550eSmrg
26866aec45a7Smrg  # Add ABI-specific directories to the system library path.
26876aec45a7Smrg  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
26885c42550eSmrg
26896aec45a7Smrg  # Append ld.so.conf contents to the search path
26906aec45a7Smrg  if test -f /etc/ld.so.conf; then
26916aec45a7Smrg    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' ' '`
26926aec45a7Smrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
26935c42550eSmrg
26945c42550eSmrg  fi
26955c42550eSmrg
26966aec45a7Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
26976aec45a7Smrg  # powerpc, because MkLinux only supported shared libraries with the
26986aec45a7Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
26996aec45a7Smrg  # most powerpc-linux boxes support dynamic linking these days and
27006aec45a7Smrg  # people can always --disable-shared, the test was removed, and we
27016aec45a7Smrg  # assume the GNU/Linux dynamic linker is in use.
27026aec45a7Smrg  dynamic_linker='GNU/Linux ld.so'
27036aec45a7Smrg  ;;
27045c42550eSmrg
27056aec45a7Smrgnetbsd*)
27066aec45a7Smrg  version_type=sunos
27076aec45a7Smrg  need_lib_prefix=no
27086aec45a7Smrg  need_version=no
27096aec45a7Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
27106aec45a7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
27116aec45a7Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
27126aec45a7Smrg    dynamic_linker='NetBSD (a.out) ld.so'
27136aec45a7Smrg  else
27146aec45a7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
27156aec45a7Smrg    soname_spec='${libname}${release}${shared_ext}$major'
27166aec45a7Smrg    dynamic_linker='NetBSD ld.elf_so'
27176aec45a7Smrg  fi
27186aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
27196aec45a7Smrg  shlibpath_overrides_runpath=yes
27206aec45a7Smrg  hardcode_into_libs=yes
27216aec45a7Smrg  ;;
27225c42550eSmrg
27236aec45a7Smrgnewsos6)
2724aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
27256aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27266aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
27276aec45a7Smrg  shlibpath_overrides_runpath=yes
27286aec45a7Smrg  ;;
27295c42550eSmrg
27306aec45a7Smrg*nto* | *qnx*)
27316aec45a7Smrg  version_type=qnx
27326aec45a7Smrg  need_lib_prefix=no
27336aec45a7Smrg  need_version=no
27346aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27356aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
27366aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
27376aec45a7Smrg  shlibpath_overrides_runpath=no
27386aec45a7Smrg  hardcode_into_libs=yes
27396aec45a7Smrg  dynamic_linker='ldqnx.so'
27406aec45a7Smrg  ;;
27415c42550eSmrg
27426aec45a7Smrgopenbsd*)
27436aec45a7Smrg  version_type=sunos
27446aec45a7Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
27456aec45a7Smrg  need_lib_prefix=no
27466aec45a7Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
27476aec45a7Smrg  case $host_os in
27486aec45a7Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
27496aec45a7Smrg    *)				need_version=no  ;;
27506aec45a7Smrg  esac
27516aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
27526aec45a7Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
27536aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
27546aec45a7Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
27556aec45a7Smrg    case $host_os in
27566aec45a7Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
27576aec45a7Smrg	shlibpath_overrides_runpath=no
27586aec45a7Smrg	;;
27596aec45a7Smrg      *)
27606aec45a7Smrg	shlibpath_overrides_runpath=yes
27616aec45a7Smrg	;;
27626aec45a7Smrg      esac
27636aec45a7Smrg  else
27646aec45a7Smrg    shlibpath_overrides_runpath=yes
27656aec45a7Smrg  fi
27666aec45a7Smrg  ;;
27675c42550eSmrg
27686aec45a7Smrgos2*)
27696aec45a7Smrg  libname_spec='$name'
27706aec45a7Smrg  shrext_cmds=".dll"
27716aec45a7Smrg  need_lib_prefix=no
27726aec45a7Smrg  library_names_spec='$libname${shared_ext} $libname.a'
27736aec45a7Smrg  dynamic_linker='OS/2 ld.exe'
27746aec45a7Smrg  shlibpath_var=LIBPATH
27756aec45a7Smrg  ;;
27765c42550eSmrg
27776aec45a7Smrgosf3* | osf4* | osf5*)
27786aec45a7Smrg  version_type=osf
27796aec45a7Smrg  need_lib_prefix=no
27806aec45a7Smrg  need_version=no
27816aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
27826aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27836aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
27846aec45a7Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
27856aec45a7Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
27866aec45a7Smrg  ;;
27875c42550eSmrg
27886aec45a7Smrgrdos*)
27896aec45a7Smrg  dynamic_linker=no
27906aec45a7Smrg  ;;
27915c42550eSmrg
27926aec45a7Smrgsolaris*)
2793aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
27946aec45a7Smrg  need_lib_prefix=no
27956aec45a7Smrg  need_version=no
27966aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27976aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
27986aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
27996aec45a7Smrg  shlibpath_overrides_runpath=yes
28006aec45a7Smrg  hardcode_into_libs=yes
28016aec45a7Smrg  # ldd complains unless libraries are executable
28026aec45a7Smrg  postinstall_cmds='chmod +x $lib'
28036aec45a7Smrg  ;;
28045c42550eSmrg
28056aec45a7Smrgsunos4*)
28066aec45a7Smrg  version_type=sunos
28076aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
28086aec45a7Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
28096aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
28106aec45a7Smrg  shlibpath_overrides_runpath=yes
28116aec45a7Smrg  if test "$with_gnu_ld" = yes; then
28126aec45a7Smrg    need_lib_prefix=no
28136aec45a7Smrg  fi
28146aec45a7Smrg  need_version=yes
28156aec45a7Smrg  ;;
28165c42550eSmrg
28176aec45a7Smrgsysv4 | sysv4.3*)
2818aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
28196aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28206aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
28216aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
28226aec45a7Smrg  case $host_vendor in
28236aec45a7Smrg    sni)
28246aec45a7Smrg      shlibpath_overrides_runpath=no
28256aec45a7Smrg      need_lib_prefix=no
28266aec45a7Smrg      runpath_var=LD_RUN_PATH
28276aec45a7Smrg      ;;
28286aec45a7Smrg    siemens)
28296aec45a7Smrg      need_lib_prefix=no
28306aec45a7Smrg      ;;
28316aec45a7Smrg    motorola)
28326aec45a7Smrg      need_lib_prefix=no
28336aec45a7Smrg      need_version=no
28346aec45a7Smrg      shlibpath_overrides_runpath=no
28356aec45a7Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
28366aec45a7Smrg      ;;
28376aec45a7Smrg  esac
28386aec45a7Smrg  ;;
28395c42550eSmrg
28406aec45a7Smrgsysv4*MP*)
28416aec45a7Smrg  if test -d /usr/nec ;then
2842aa9e3350Smrg    version_type=linux # correct to gnu/linux during the next big refactor
28436aec45a7Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
28446aec45a7Smrg    soname_spec='$libname${shared_ext}.$major'
28456aec45a7Smrg    shlibpath_var=LD_LIBRARY_PATH
28466aec45a7Smrg  fi
28476aec45a7Smrg  ;;
28485c42550eSmrg
28496aec45a7Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
28506aec45a7Smrg  version_type=freebsd-elf
28516aec45a7Smrg  need_lib_prefix=no
28526aec45a7Smrg  need_version=no
28536aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
28546aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
28556aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
28566aec45a7Smrg  shlibpath_overrides_runpath=yes
28576aec45a7Smrg  hardcode_into_libs=yes
28586aec45a7Smrg  if test "$with_gnu_ld" = yes; then
28596aec45a7Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
28606aec45a7Smrg  else
28616aec45a7Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
28626aec45a7Smrg    case $host_os in
28636aec45a7Smrg      sco3.2v5*)
28646aec45a7Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
28656aec45a7Smrg	;;
28666aec45a7Smrg    esac
28676aec45a7Smrg  fi
28686aec45a7Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
28696aec45a7Smrg  ;;
28705c42550eSmrg
28716aec45a7Smrgtpf*)
28726aec45a7Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
2873aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
28746aec45a7Smrg  need_lib_prefix=no
28756aec45a7Smrg  need_version=no
28766aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28776aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
28786aec45a7Smrg  shlibpath_overrides_runpath=no
28796aec45a7Smrg  hardcode_into_libs=yes
28806aec45a7Smrg  ;;
28815c42550eSmrg
28826aec45a7Smrguts4*)
2883aa9e3350Smrg  version_type=linux # correct to gnu/linux during the next big refactor
28846aec45a7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28856aec45a7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
28866aec45a7Smrg  shlibpath_var=LD_LIBRARY_PATH
28876aec45a7Smrg  ;;
28885c42550eSmrg
28896aec45a7Smrg*)
28906aec45a7Smrg  dynamic_linker=no
28916aec45a7Smrg  ;;
28926aec45a7Smrgesac
28936aec45a7SmrgAC_MSG_RESULT([$dynamic_linker])
28946aec45a7Smrgtest "$dynamic_linker" = no && can_build_shared=no
28955c42550eSmrg
28966aec45a7Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
28976aec45a7Smrgif test "$GCC" = yes; then
28986aec45a7Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
28996aec45a7Smrgfi
29005c42550eSmrg
29016aec45a7Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
29026aec45a7Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
29036aec45a7Smrgfi
29046aec45a7Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
29056aec45a7Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
29066aec45a7Smrgfi
29075c42550eSmrg
29086aec45a7Smrg_LT_DECL([], [variables_saved_for_relink], [1],
29096aec45a7Smrg    [Variables whose values should be saved in libtool wrapper scripts and
29106aec45a7Smrg    restored at link time])
29116aec45a7Smrg_LT_DECL([], [need_lib_prefix], [0],
29126aec45a7Smrg    [Do we need the "lib" prefix for modules?])
29136aec45a7Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
29146aec45a7Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
29156aec45a7Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
29166aec45a7Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
29176aec45a7Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
29186aec45a7Smrg    [Is shlibpath searched before the hard-coded library search path?])
29196aec45a7Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
29206aec45a7Smrg_LT_DECL([], [library_names_spec], [1],
29216aec45a7Smrg    [[List of archive names.  First name is the real one, the rest are links.
29226aec45a7Smrg    The last name is the one that the linker finds with -lNAME]])
29236aec45a7Smrg_LT_DECL([], [soname_spec], [1],
29246aec45a7Smrg    [[The coded name of the library, if different from the real name]])
29256aec45a7Smrg_LT_DECL([], [install_override_mode], [1],
29266aec45a7Smrg    [Permission mode override for installation of shared libraries])
29276aec45a7Smrg_LT_DECL([], [postinstall_cmds], [2],
29286aec45a7Smrg    [Command to use after installation of a shared archive])
29296aec45a7Smrg_LT_DECL([], [postuninstall_cmds], [2],
29306aec45a7Smrg    [Command to use after uninstallation of a shared archive])
29316aec45a7Smrg_LT_DECL([], [finish_cmds], [2],
29326aec45a7Smrg    [Commands used to finish a libtool library installation in a directory])
29336aec45a7Smrg_LT_DECL([], [finish_eval], [1],
29346aec45a7Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
29356aec45a7Smrg    not shown]])
29366aec45a7Smrg_LT_DECL([], [hardcode_into_libs], [0],
29376aec45a7Smrg    [Whether we should hardcode library paths into libraries])
29386aec45a7Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
29396aec45a7Smrg    [Compile-time system search path for libraries])
29406aec45a7Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
29416aec45a7Smrg    [Run-time system search path for libraries])
29426aec45a7Smrg])# _LT_SYS_DYNAMIC_LINKER
29436aec45a7Smrg
29446aec45a7Smrg
29456aec45a7Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
29466aec45a7Smrg# --------------------------
29475c42550eSmrg# find a file program which can recognize shared library
29486aec45a7SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
29496aec45a7Smrg[m4_require([_LT_DECL_EGREP])dnl
29505c42550eSmrgAC_MSG_CHECKING([for $1])
29515c42550eSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
29525c42550eSmrg[case $MAGIC_CMD in
2953ab47cfaaSmrg[[\\/*] |  ?:[\\/]*])
2954ab47cfaaSmrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2955ab47cfaaSmrg  ;;
2956ab47cfaaSmrg*)
2957ab47cfaaSmrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
2958ab47cfaaSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2959ab47cfaaSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
2960ab47cfaaSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
2961ab47cfaaSmrgdnl not every word.  This closes a longstanding sh security hole.
29626aec45a7Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
2963ab47cfaaSmrg  for ac_dir in $ac_dummy; do
2964ab47cfaaSmrg    IFS="$lt_save_ifs"
2965ab47cfaaSmrg    test -z "$ac_dir" && ac_dir=.
2966ab47cfaaSmrg    if test -f $ac_dir/$1; then
2967ab47cfaaSmrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2968ab47cfaaSmrg      if test -n "$file_magic_test_file"; then
2969ab47cfaaSmrg	case $deplibs_check_method in
2970ab47cfaaSmrg	"file_magic "*)
2971ab47cfaaSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2972ab47cfaaSmrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2973ab47cfaaSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2974ab47cfaaSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
2975ab47cfaaSmrg	    :
2976ab47cfaaSmrg	  else
29776aec45a7Smrg	    cat <<_LT_EOF 1>&2
2978ab47cfaaSmrg
2979ab47cfaaSmrg*** Warning: the command libtool uses to detect shared libraries,
2980ab47cfaaSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
2981ab47cfaaSmrg*** The result is that libtool may fail to recognize shared libraries
2982ab47cfaaSmrg*** as such.  This will affect the creation of libtool libraries that
2983ab47cfaaSmrg*** depend on shared libraries, but programs linked with such libtool
2984ab47cfaaSmrg*** libraries will work regardless of this problem.  Nevertheless, you
2985ab47cfaaSmrg*** may want to report the problem to your system manager and/or to
2986ab47cfaaSmrg*** bug-libtool@gnu.org
2987ab47cfaaSmrg
29886aec45a7Smrg_LT_EOF
2989ab47cfaaSmrg	  fi ;;
2990ab47cfaaSmrg	esac
2991ab47cfaaSmrg      fi
2992ab47cfaaSmrg      break
2993ab47cfaaSmrg    fi
2994ab47cfaaSmrg  done
2995ab47cfaaSmrg  IFS="$lt_save_ifs"
2996ab47cfaaSmrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
2997ab47cfaaSmrg  ;;
2998ab47cfaaSmrgesac])
2999ab47cfaaSmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3000ab47cfaaSmrgif test -n "$MAGIC_CMD"; then
3001ab47cfaaSmrg  AC_MSG_RESULT($MAGIC_CMD)
3002ab47cfaaSmrgelse
3003ab47cfaaSmrg  AC_MSG_RESULT(no)
3004ab47cfaaSmrgfi
30056aec45a7Smrg_LT_DECL([], [MAGIC_CMD], [0],
30066aec45a7Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
30076aec45a7Smrg])# _LT_PATH_TOOL_PREFIX
3008ab47cfaaSmrg
30096aec45a7Smrg# Old name:
30106aec45a7SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
30116aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
30126aec45a7Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
30131473d951Smrg
30146aec45a7Smrg
30156aec45a7Smrg# _LT_PATH_MAGIC
30166aec45a7Smrg# --------------
30178697ee19Smrg# find a file program which can recognize a shared library
30186aec45a7Smrgm4_defun([_LT_PATH_MAGIC],
30196aec45a7Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3020ab47cfaaSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
3021ab47cfaaSmrg  if test -n "$ac_tool_prefix"; then
30226aec45a7Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3023ab47cfaaSmrg  else
3024ab47cfaaSmrg    MAGIC_CMD=:
3025ab47cfaaSmrg  fi
3026ab47cfaaSmrgfi
30276aec45a7Smrg])# _LT_PATH_MAGIC
3028ab47cfaaSmrg
3029ab47cfaaSmrg
30306aec45a7Smrg# LT_PATH_LD
3031ab47cfaaSmrg# ----------
3032ab47cfaaSmrg# find the pathname to the GNU or non-GNU linker
30336aec45a7SmrgAC_DEFUN([LT_PATH_LD],
30346aec45a7Smrg[AC_REQUIRE([AC_PROG_CC])dnl
30355c42550eSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
30365c42550eSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
30376aec45a7Smrgm4_require([_LT_DECL_SED])dnl
30386aec45a7Smrgm4_require([_LT_DECL_EGREP])dnl
30396aec45a7Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
30406aec45a7Smrg
30416aec45a7SmrgAC_ARG_WITH([gnu-ld],
30426aec45a7Smrg    [AS_HELP_STRING([--with-gnu-ld],
30436aec45a7Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
30446aec45a7Smrg    [test "$withval" = no || with_gnu_ld=yes],
30456aec45a7Smrg    [with_gnu_ld=no])dnl
30466aec45a7Smrg
3047ab47cfaaSmrgac_prog=ld
3048ab47cfaaSmrgif test "$GCC" = yes; then
3049ab47cfaaSmrg  # Check if gcc -print-prog-name=ld gives a path.
3050ab47cfaaSmrg  AC_MSG_CHECKING([for ld used by $CC])
3051ab47cfaaSmrg  case $host in
3052ab47cfaaSmrg  *-*-mingw*)
3053ab47cfaaSmrg    # gcc leaves a trailing carriage return which upsets mingw
3054ab47cfaaSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3055ab47cfaaSmrg  *)
3056ab47cfaaSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3057ab47cfaaSmrg  esac
3058ab47cfaaSmrg  case $ac_prog in
3059ab47cfaaSmrg    # Accept absolute paths.
3060ab47cfaaSmrg    [[\\/]]* | ?:[[\\/]]*)
3061ab47cfaaSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
3062ab47cfaaSmrg      # Canonicalize the pathname of ld
30636aec45a7Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
30646aec45a7Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
30656aec45a7Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3066ab47cfaaSmrg      done
3067ab47cfaaSmrg      test -z "$LD" && LD="$ac_prog"
3068ab47cfaaSmrg      ;;
3069ab47cfaaSmrg  "")
3070ab47cfaaSmrg    # If it fails, then pretend we aren't using GCC.
3071ab47cfaaSmrg    ac_prog=ld
3072ab47cfaaSmrg    ;;
3073ab47cfaaSmrg  *)
3074ab47cfaaSmrg    # If it is relative, then search for the first ld in PATH.
3075ab47cfaaSmrg    with_gnu_ld=unknown
3076ab47cfaaSmrg    ;;
3077ab47cfaaSmrg  esac
3078ab47cfaaSmrgelif test "$with_gnu_ld" = yes; then
3079ab47cfaaSmrg  AC_MSG_CHECKING([for GNU ld])
3080ab47cfaaSmrgelse
3081ab47cfaaSmrg  AC_MSG_CHECKING([for non-GNU ld])
3082ab47cfaaSmrgfi
3083ab47cfaaSmrgAC_CACHE_VAL(lt_cv_path_LD,
3084ab47cfaaSmrg[if test -z "$LD"; then
3085ab47cfaaSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3086ab47cfaaSmrg  for ac_dir in $PATH; do
3087ab47cfaaSmrg    IFS="$lt_save_ifs"
3088ab47cfaaSmrg    test -z "$ac_dir" && ac_dir=.
3089ab47cfaaSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3090ab47cfaaSmrg      lt_cv_path_LD="$ac_dir/$ac_prog"
3091ab47cfaaSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
3092ab47cfaaSmrg      # but apparently some variants of GNU ld only accept -v.
3093ab47cfaaSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
3094ab47cfaaSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3095ab47cfaaSmrg      *GNU* | *'with BFD'*)
3096ab47cfaaSmrg	test "$with_gnu_ld" != no && break
3097ab47cfaaSmrg	;;
3098ab47cfaaSmrg      *)
3099ab47cfaaSmrg	test "$with_gnu_ld" != yes && break
3100ab47cfaaSmrg	;;
3101ab47cfaaSmrg      esac
3102ab47cfaaSmrg    fi
3103ab47cfaaSmrg  done
3104ab47cfaaSmrg  IFS="$lt_save_ifs"
3105ab47cfaaSmrgelse
3106ab47cfaaSmrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
3107ab47cfaaSmrgfi])
3108ab47cfaaSmrgLD="$lt_cv_path_LD"
3109ab47cfaaSmrgif test -n "$LD"; then
3110ab47cfaaSmrg  AC_MSG_RESULT($LD)
3111ab47cfaaSmrgelse
3112ab47cfaaSmrg  AC_MSG_RESULT(no)
3113ab47cfaaSmrgfi
3114ab47cfaaSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
31156aec45a7Smrg_LT_PATH_LD_GNU
31166aec45a7SmrgAC_SUBST([LD])
3117ab47cfaaSmrg
31186aec45a7Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
31196aec45a7Smrg])# LT_PATH_LD
3120ab47cfaaSmrg
31216aec45a7Smrg# Old names:
31226aec45a7SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
31236aec45a7SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
31246aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
31256aec45a7Smrgdnl AC_DEFUN([AM_PROG_LD], [])
31266aec45a7Smrgdnl AC_DEFUN([AC_PROG_LD], [])
31276aec45a7Smrg
31286aec45a7Smrg
31296aec45a7Smrg# _LT_PATH_LD_GNU
31306aec45a7Smrg#- --------------
31316aec45a7Smrgm4_defun([_LT_PATH_LD_GNU],
31326aec45a7Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3133ab47cfaaSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3134ab47cfaaSmrgcase `$LD -v 2>&1 </dev/null` in
3135ab47cfaaSmrg*GNU* | *'with BFD'*)
3136ab47cfaaSmrg  lt_cv_prog_gnu_ld=yes
3137ab47cfaaSmrg  ;;
3138ab47cfaaSmrg*)
3139ab47cfaaSmrg  lt_cv_prog_gnu_ld=no
3140ab47cfaaSmrg  ;;
3141ab47cfaaSmrgesac])
3142ab47cfaaSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
31436aec45a7Smrg])# _LT_PATH_LD_GNU
3144ab47cfaaSmrg
3145ab47cfaaSmrg
31466aec45a7Smrg# _LT_CMD_RELOAD
31476aec45a7Smrg# --------------
3148ab47cfaaSmrg# find reload flag for linker
3149ab47cfaaSmrg#   -- PORTME Some linkers may need a different reload flag.
31506aec45a7Smrgm4_defun([_LT_CMD_RELOAD],
3151ab47cfaaSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
3152ab47cfaaSmrg  lt_cv_ld_reload_flag,
3153ab47cfaaSmrg  [lt_cv_ld_reload_flag='-r'])
3154ab47cfaaSmrgreload_flag=$lt_cv_ld_reload_flag
3155ab47cfaaSmrgcase $reload_flag in
3156ab47cfaaSmrg"" | " "*) ;;
3157ab47cfaaSmrg*) reload_flag=" $reload_flag" ;;
3158ab47cfaaSmrgesac
3159ab47cfaaSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
3160ab47cfaaSmrgcase $host_os in
3161aa9e3350Smrg  cygwin* | mingw* | pw32* | cegcc*)
3162aa9e3350Smrg    if test "$GCC" != yes; then
3163aa9e3350Smrg      reload_cmds=false
3164aa9e3350Smrg    fi
3165aa9e3350Smrg    ;;
3166ab47cfaaSmrg  darwin*)
3167ab47cfaaSmrg    if test "$GCC" = yes; then
3168ab47cfaaSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
3169ab47cfaaSmrg    else
3170ab47cfaaSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3171ab47cfaaSmrg    fi
3172ab47cfaaSmrg    ;;
3173ab47cfaaSmrgesac
31746aec45a7Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
31756aec45a7Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
31766aec45a7Smrg])# _LT_CMD_RELOAD
3177ab47cfaaSmrg
3178ab47cfaaSmrg
31796aec45a7Smrg# _LT_CHECK_MAGIC_METHOD
31806aec45a7Smrg# ----------------------
3181ab47cfaaSmrg# how to check for library dependencies
3182ab47cfaaSmrg#  -- PORTME fill in with the dynamic library characteristics
31836aec45a7Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
31846aec45a7Smrg[m4_require([_LT_DECL_EGREP])
31856aec45a7Smrgm4_require([_LT_DECL_OBJDUMP])
31866aec45a7SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
3187ab47cfaaSmrglt_cv_deplibs_check_method,
3188ab47cfaaSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
3189ab47cfaaSmrglt_cv_file_magic_test_file=
3190ab47cfaaSmrglt_cv_deplibs_check_method='unknown'
3191ab47cfaaSmrg# Need to set the preceding variable on all platforms that support
3192ab47cfaaSmrg# interlibrary dependencies.
3193ab47cfaaSmrg# 'none' -- dependencies not supported.
3194ab47cfaaSmrg# `unknown' -- same as none, but documents that we really don't know.
3195ab47cfaaSmrg# 'pass_all' -- all dependencies passed with no checks.
3196ab47cfaaSmrg# 'test_compile' -- check by making test program.
3197ab47cfaaSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
3198ab47cfaaSmrg# which responds to the $file_magic_cmd with a given extended regex.
3199ab47cfaaSmrg# If you have `file' or equivalent on your system and you're not sure
3200ab47cfaaSmrg# whether `pass_all' will *always* work, you probably want this one.
3201ab47cfaaSmrg
3202ab47cfaaSmrgcase $host_os in
32031473d951Smrgaix[[4-9]]*)
3204ab47cfaaSmrg  lt_cv_deplibs_check_method=pass_all
3205ab47cfaaSmrg  ;;
3206ab47cfaaSmrg
3207ab47cfaaSmrgbeos*)
3208ab47cfaaSmrg  lt_cv_deplibs_check_method=pass_all
3209ab47cfaaSmrg  ;;
3210ab47cfaaSmrg
3211ab47cfaaSmrgbsdi[[45]]*)
3212ab47cfaaSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3213ab47cfaaSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
3214ab47cfaaSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
3215ab47cfaaSmrg  ;;
3216ab47cfaaSmrg
3217ab47cfaaSmrgcygwin*)
3218ab47cfaaSmrg  # func_win32_libid is a shell function defined in ltmain.sh
3219ab47cfaaSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3220ab47cfaaSmrg  lt_cv_file_magic_cmd='func_win32_libid'
3221ab47cfaaSmrg  ;;
3222ab47cfaaSmrg
3223ab47cfaaSmrgmingw* | pw32*)
3224ab47cfaaSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
32258697ee19Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
32268697ee19Smrg  # unless we find 'file', for example because we are cross-compiling.
32276aec45a7Smrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
32286aec45a7Smrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
32298697ee19Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
32308697ee19Smrg    lt_cv_file_magic_cmd='func_win32_libid'
32318697ee19Smrg  else
32326aec45a7Smrg    # Keep this pattern in sync with the one in func_win32_libid.
32336aec45a7Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
32348697ee19Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
32358697ee19Smrg  fi
3236ab47cfaaSmrg  ;;
3237ab47cfaaSmrg
32386aec45a7Smrgcegcc*)
32396aec45a7Smrg  # use the weaker test based on 'objdump'. See mingw*.
32406aec45a7Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
32416aec45a7Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
32426aec45a7Smrg  ;;
32436aec45a7Smrg
3244ab47cfaaSmrgdarwin* | rhapsody*)
3245ab47cfaaSmrg  lt_cv_deplibs_check_method=pass_all
3246ab47cfaaSmrg  ;;
3247ab47cfaaSmrg
3248ab47cfaaSmrgfreebsd* | dragonfly*)
32496aec45a7Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3250ab47cfaaSmrg    case $host_cpu in
3251ab47cfaaSmrg    i*86 )
3252ab47cfaaSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
3253ab47cfaaSmrg      # Let's accept both of them until this is cleared up.
3254ab47cfaaSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3255ab47cfaaSmrg      lt_cv_file_magic_cmd=/usr/bin/file
3256ab47cfaaSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3257ab47cfaaSmrg      ;;
3258ab47cfaaSmrg    esac
3259ab47cfaaSmrg  else
3260ab47cfaaSmrg    lt_cv_deplibs_check_method=pass_all
3261ab47cfaaSmrg  fi
3262ab47cfaaSmrg  ;;
3263ab47cfaaSmrg
3264ab47cfaaSmrggnu*)
3265ab47cfaaSmrg  lt_cv_deplibs_check_method=pass_all
3266ab47cfaaSmrg  ;;
3267ab47cfaaSmrg
32686aec45a7Smrghaiku*)
32696aec45a7Smrg  lt_cv_deplibs_check_method=pass_all
32706aec45a7Smrg  ;;
32716aec45a7Smrg
3272ab47cfaaSmrghpux10.20* | hpux11*)
3273ab47cfaaSmrg  lt_cv_file_magic_cmd=/usr/bin/file
3274ab47cfaaSmrg  case $host_cpu in
3275ab47cfaaSmrg  ia64*)
3276ab47cfaaSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3277ab47cfaaSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3278ab47cfaaSmrg    ;;
3279ab47cfaaSmrg  hppa*64*)
32806aec45a7Smrg    [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]']
3281ab47cfaaSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3282ab47cfaaSmrg    ;;
3283ab47cfaaSmrg  *)
32846aec45a7Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3285ab47cfaaSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3286ab47cfaaSmrg    ;;
3287ab47cfaaSmrg  esac
3288ab47cfaaSmrg  ;;
3289ab47cfaaSmrg
32908697ee19Smrginterix[[3-9]]*)
3291ab47cfaaSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3292ab47cfaaSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3293ab47cfaaSmrg  ;;
3294ab47cfaaSmrg
3295ab47cfaaSmrgirix5* | irix6* | nonstopux*)
3296ab47cfaaSmrg  case $LD in
3297ab47cfaaSmrg  *-32|*"-32 ") libmagic=32-bit;;
3298ab47cfaaSmrg  *-n32|*"-n32 ") libmagic=N32;;
3299ab47cfaaSmrg  *-64|*"-64 ") libmagic=64-bit;;
3300ab47cfaaSmrg  *) libmagic=never-match;;
3301ab47cfaaSmrg  esac
3302ab47cfaaSmrg  lt_cv_deplibs_check_method=pass_all
3303ab47cfaaSmrg  ;;
3304ab47cfaaSmrg
3305aa9e3350Smrg# This must be glibc/ELF.
33066aec45a7Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
3307ab47cfaaSmrg  lt_cv_deplibs_check_method=pass_all
3308ab47cfaaSmrg  ;;
3309ab47cfaaSmrg
33108697ee19Smrgnetbsd*)
33116aec45a7Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3312ab47cfaaSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3313ab47cfaaSmrg  else
3314ab47cfaaSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3315ab47cfaaSmrg  fi
3316ab47cfaaSmrg  ;;
3317ab47cfaaSmrg
3318ab47cfaaSmrgnewos6*)
3319ab47cfaaSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3320ab47cfaaSmrg  lt_cv_file_magic_cmd=/usr/bin/file
3321ab47cfaaSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3322ab47cfaaSmrg  ;;
3323ab47cfaaSmrg
33246aec45a7Smrg*nto* | *qnx*)
33256aec45a7Smrg  lt_cv_deplibs_check_method=pass_all
3326ab47cfaaSmrg  ;;
3327ab47cfaaSmrg
3328ab47cfaaSmrgopenbsd*)
33296aec45a7Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3330ab47cfaaSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3331ab47cfaaSmrg  else
3332ab47cfaaSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3333ab47cfaaSmrg  fi
3334ab47cfaaSmrg  ;;
3335ab47cfaaSmrg
3336ab47cfaaSmrgosf3* | osf4* | osf5*)
3337ab47cfaaSmrg  lt_cv_deplibs_check_method=pass_all
3338ab47cfaaSmrg  ;;
3339ab47cfaaSmrg
33408697ee19Smrgrdos*)
33418697ee19Smrg  lt_cv_deplibs_check_method=pass_all
33428697ee19Smrg  ;;
33438697ee19Smrg
3344ab47cfaaSmrgsolaris*)
3345ab47cfaaSmrg  lt_cv_deplibs_check_method=pass_all
3346ab47cfaaSmrg  ;;
3347ab47cfaaSmrg
33486aec45a7Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
33496aec45a7Smrg  lt_cv_deplibs_check_method=pass_all
33506aec45a7Smrg  ;;
33516aec45a7Smrg
3352ab47cfaaSmrgsysv4 | sysv4.3*)
3353ab47cfaaSmrg  case $host_vendor in
3354ab47cfaaSmrg  motorola)
3355ab47cfaaSmrg    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]]'
3356ab47cfaaSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3357ab47cfaaSmrg    ;;
3358ab47cfaaSmrg  ncr)
3359ab47cfaaSmrg    lt_cv_deplibs_check_method=pass_all
3360ab47cfaaSmrg    ;;
3361ab47cfaaSmrg  sequent)
3362ab47cfaaSmrg    lt_cv_file_magic_cmd='/bin/file'
3363ab47cfaaSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3364ab47cfaaSmrg    ;;
3365ab47cfaaSmrg  sni)
3366ab47cfaaSmrg    lt_cv_file_magic_cmd='/bin/file'
3367ab47cfaaSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3368ab47cfaaSmrg    lt_cv_file_magic_test_file=/lib/libc.so
3369ab47cfaaSmrg    ;;
3370ab47cfaaSmrg  siemens)
3371ab47cfaaSmrg    lt_cv_deplibs_check_method=pass_all
3372ab47cfaaSmrg    ;;
3373ab47cfaaSmrg  pc)
3374ab47cfaaSmrg    lt_cv_deplibs_check_method=pass_all
3375ab47cfaaSmrg    ;;
3376ab47cfaaSmrg  esac
3377ab47cfaaSmrg  ;;
3378ab47cfaaSmrg
33796aec45a7Smrgtpf*)
3380ab47cfaaSmrg  lt_cv_deplibs_check_method=pass_all
3381ab47cfaaSmrg  ;;
3382ab47cfaaSmrgesac
3383ab47cfaaSmrg])
3384aa9e3350Smrg
3385aa9e3350Smrgfile_magic_glob=
3386aa9e3350Smrgwant_nocaseglob=no
3387aa9e3350Smrgif test "$build" = "$host"; then
3388aa9e3350Smrg  case $host_os in
3389aa9e3350Smrg  mingw* | pw32*)
3390aa9e3350Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3391aa9e3350Smrg      want_nocaseglob=yes
3392aa9e3350Smrg    else
3393aa9e3350Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3394aa9e3350Smrg    fi
3395aa9e3350Smrg    ;;
3396aa9e3350Smrg  esac
3397aa9e3350Smrgfi
3398aa9e3350Smrg
3399ab47cfaaSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
3400ab47cfaaSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
3401ab47cfaaSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
34026aec45a7Smrg
34036aec45a7Smrg_LT_DECL([], [deplibs_check_method], [1],
34046aec45a7Smrg    [Method to check whether dependent libraries are shared objects])
34056aec45a7Smrg_LT_DECL([], [file_magic_cmd], [1],
3406aa9e3350Smrg    [Command to use when deplibs_check_method = "file_magic"])
3407aa9e3350Smrg_LT_DECL([], [file_magic_glob], [1],
3408aa9e3350Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
3409aa9e3350Smrg_LT_DECL([], [want_nocaseglob], [1],
3410aa9e3350Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
34116aec45a7Smrg])# _LT_CHECK_MAGIC_METHOD
3412ab47cfaaSmrg
3413ab47cfaaSmrg
34146aec45a7Smrg# LT_PATH_NM
3415ab47cfaaSmrg# ----------
34166aec45a7Smrg# find the pathname to a BSD- or MS-compatible name lister
34176aec45a7SmrgAC_DEFUN([LT_PATH_NM],
34186aec45a7Smrg[AC_REQUIRE([AC_PROG_CC])dnl
34196aec45a7SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3420ab47cfaaSmrg[if test -n "$NM"; then
3421ab47cfaaSmrg  # Let the user override the test.
3422ab47cfaaSmrg  lt_cv_path_NM="$NM"
3423ab47cfaaSmrgelse
3424ab47cfaaSmrg  lt_nm_to_check="${ac_tool_prefix}nm"
34258697ee19Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3426ab47cfaaSmrg    lt_nm_to_check="$lt_nm_to_check nm"
3427ab47cfaaSmrg  fi
3428ab47cfaaSmrg  for lt_tmp_nm in $lt_nm_to_check; do
3429ab47cfaaSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3430ab47cfaaSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3431ab47cfaaSmrg      IFS="$lt_save_ifs"
3432ab47cfaaSmrg      test -z "$ac_dir" && ac_dir=.
3433ab47cfaaSmrg      tmp_nm="$ac_dir/$lt_tmp_nm"
3434ab47cfaaSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3435ab47cfaaSmrg	# Check to see if the nm accepts a BSD-compat flag.
3436ab47cfaaSmrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
3437ab47cfaaSmrg	#   nm: unknown option "B" ignored
3438ab47cfaaSmrg	# Tru64's nm complains that /dev/null is an invalid object file
3439ab47cfaaSmrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3440ab47cfaaSmrg	*/dev/null* | *'Invalid file or object type'*)
3441ab47cfaaSmrg	  lt_cv_path_NM="$tmp_nm -B"
3442ab47cfaaSmrg	  break
3443ab47cfaaSmrg	  ;;
3444ab47cfaaSmrg	*)
3445ab47cfaaSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3446ab47cfaaSmrg	  */dev/null*)
3447ab47cfaaSmrg	    lt_cv_path_NM="$tmp_nm -p"
3448ab47cfaaSmrg	    break
3449ab47cfaaSmrg	    ;;
3450ab47cfaaSmrg	  *)
3451ab47cfaaSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3452ab47cfaaSmrg	    continue # so that we can try to find one that supports BSD flags
3453ab47cfaaSmrg	    ;;
3454ab47cfaaSmrg	  esac
3455ab47cfaaSmrg	  ;;
3456ab47cfaaSmrg	esac
3457ab47cfaaSmrg      fi
3458ab47cfaaSmrg    done
3459ab47cfaaSmrg    IFS="$lt_save_ifs"
3460ab47cfaaSmrg  done
34616aec45a7Smrg  : ${lt_cv_path_NM=no}
3462ab47cfaaSmrgfi])
34636aec45a7Smrgif test "$lt_cv_path_NM" != "no"; then
34646aec45a7Smrg  NM="$lt_cv_path_NM"
34656aec45a7Smrgelse
34666aec45a7Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
34676aec45a7Smrg  if test -n "$DUMPBIN"; then :
34686aec45a7Smrg    # Let the user override the test.
34696aec45a7Smrg  else
34706aec45a7Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
34716aec45a7Smrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
34726aec45a7Smrg    *COFF*)
34736aec45a7Smrg      DUMPBIN="$DUMPBIN -symbols"
34746aec45a7Smrg      ;;
34756aec45a7Smrg    *)
34766aec45a7Smrg      DUMPBIN=:
34776aec45a7Smrg      ;;
34786aec45a7Smrg    esac
34796aec45a7Smrg  fi
34806aec45a7Smrg  AC_SUBST([DUMPBIN])
34816aec45a7Smrg  if test "$DUMPBIN" != ":"; then
34826aec45a7Smrg    NM="$DUMPBIN"
34836aec45a7Smrg  fi
34846aec45a7Smrgfi
34856aec45a7Smrgtest -z "$NM" && NM=nm
34866aec45a7SmrgAC_SUBST([NM])
34876aec45a7Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
34886aec45a7Smrg
34896aec45a7SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
34906aec45a7Smrg  [lt_cv_nm_interface="BSD nm"
34916aec45a7Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
34926aec45a7Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
34936aec45a7Smrg  (eval "$ac_compile" 2>conftest.err)
34946aec45a7Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
34956aec45a7Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
34966aec45a7Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
34976aec45a7Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
34986aec45a7Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
34996aec45a7Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
35006aec45a7Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
35016aec45a7Smrg    lt_cv_nm_interface="MS dumpbin"
35026aec45a7Smrg  fi
35036aec45a7Smrg  rm -f conftest*])
35046aec45a7Smrg])# LT_PATH_NM
3505ab47cfaaSmrg
35066aec45a7Smrg# Old names:
35076aec45a7SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
35086aec45a7SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
35096aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
35106aec45a7Smrgdnl AC_DEFUN([AM_PROG_NM], [])
35116aec45a7Smrgdnl AC_DEFUN([AC_PROG_NM], [])
35121473d951Smrg
3513aa9e3350Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3514aa9e3350Smrg# --------------------------------
3515aa9e3350Smrg# how to determine the name of the shared library
3516aa9e3350Smrg# associated with a specific link library.
3517aa9e3350Smrg#  -- PORTME fill in with the dynamic library characteristics
3518aa9e3350Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3519aa9e3350Smrg[m4_require([_LT_DECL_EGREP])
3520aa9e3350Smrgm4_require([_LT_DECL_OBJDUMP])
3521aa9e3350Smrgm4_require([_LT_DECL_DLLTOOL])
3522aa9e3350SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
3523aa9e3350Smrglt_cv_sharedlib_from_linklib_cmd,
3524aa9e3350Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3525aa9e3350Smrg
3526aa9e3350Smrgcase $host_os in
3527aa9e3350Smrgcygwin* | mingw* | pw32* | cegcc*)
3528aa9e3350Smrg  # two different shell functions defined in ltmain.sh
3529aa9e3350Smrg  # decide which to use based on capabilities of $DLLTOOL
3530aa9e3350Smrg  case `$DLLTOOL --help 2>&1` in
3531aa9e3350Smrg  *--identify-strict*)
3532aa9e3350Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3533aa9e3350Smrg    ;;
3534aa9e3350Smrg  *)
3535aa9e3350Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3536aa9e3350Smrg    ;;
3537aa9e3350Smrg  esac
3538aa9e3350Smrg  ;;
3539aa9e3350Smrg*)
3540aa9e3350Smrg  # fallback: assume linklib IS sharedlib
3541aa9e3350Smrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
3542aa9e3350Smrg  ;;
3543aa9e3350Smrgesac
3544aa9e3350Smrg])
3545aa9e3350Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3546aa9e3350Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3547aa9e3350Smrg
3548aa9e3350Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3549aa9e3350Smrg    [Command to associate shared and link libraries])
3550aa9e3350Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3551aa9e3350Smrg
3552aa9e3350Smrg
3553aa9e3350Smrg# _LT_PATH_MANIFEST_TOOL
3554aa9e3350Smrg# ----------------------
3555aa9e3350Smrg# locate the manifest tool
3556aa9e3350Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
3557aa9e3350Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3558aa9e3350Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3559aa9e3350SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3560aa9e3350Smrg  [lt_cv_path_mainfest_tool=no
3561aa9e3350Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3562aa9e3350Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3563aa9e3350Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3564aa9e3350Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3565aa9e3350Smrg    lt_cv_path_mainfest_tool=yes
3566aa9e3350Smrg  fi
3567aa9e3350Smrg  rm -f conftest*])
3568aa9e3350Smrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
3569aa9e3350Smrg  MANIFEST_TOOL=:
3570aa9e3350Smrgfi
3571aa9e3350Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3572aa9e3350Smrg])# _LT_PATH_MANIFEST_TOOL
3573aa9e3350Smrg
35746aec45a7Smrg
35756aec45a7Smrg# LT_LIB_M
35766aec45a7Smrg# --------
3577ab47cfaaSmrg# check for math library
35786aec45a7SmrgAC_DEFUN([LT_LIB_M],
3579ab47cfaaSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3580ab47cfaaSmrgLIBM=
3581ab47cfaaSmrgcase $host in
35826aec45a7Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3583ab47cfaaSmrg  # These system don't have libm, or don't need it
3584ab47cfaaSmrg  ;;
3585ab47cfaaSmrg*-ncr-sysv4.3*)
3586ab47cfaaSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3587ab47cfaaSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3588ab47cfaaSmrg  ;;
3589ab47cfaaSmrg*)
3590ab47cfaaSmrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
3591ab47cfaaSmrg  ;;
3592ab47cfaaSmrgesac
35936aec45a7SmrgAC_SUBST([LIBM])
35946aec45a7Smrg])# LT_LIB_M
3595ab47cfaaSmrg
35966aec45a7Smrg# Old name:
35976aec45a7SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
35986aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
35996aec45a7Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3600ab47cfaaSmrg
3601ab47cfaaSmrg
36026aec45a7Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
36036aec45a7Smrg# -------------------------------
36046aec45a7Smrgm4_defun([_LT_COMPILER_NO_RTTI],
36056aec45a7Smrg[m4_require([_LT_TAG_COMPILER])dnl
3606ab47cfaaSmrg
36076aec45a7Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3608ab47cfaaSmrg
36096aec45a7Smrgif test "$GCC" = yes; then
36106aec45a7Smrg  case $cc_basename in
36116aec45a7Smrg  nvcc*)
36126aec45a7Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
36136aec45a7Smrg  *)
36146aec45a7Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
36156aec45a7Smrg  esac
3616ab47cfaaSmrg
36176aec45a7Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
36186aec45a7Smrg    lt_cv_prog_compiler_rtti_exceptions,
36196aec45a7Smrg    [-fno-rtti -fno-exceptions], [],
36206aec45a7Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
36215c42550eSmrgfi
36226aec45a7Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
36236aec45a7Smrg	[Compiler flag to turn off builtin functions])
36246aec45a7Smrg])# _LT_COMPILER_NO_RTTI
3625ab47cfaaSmrg
3626ab47cfaaSmrg
36276aec45a7Smrg# _LT_CMD_GLOBAL_SYMBOLS
36286aec45a7Smrg# ----------------------
36296aec45a7Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
36306aec45a7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
36316aec45a7SmrgAC_REQUIRE([AC_PROG_CC])dnl
36326aec45a7SmrgAC_REQUIRE([AC_PROG_AWK])dnl
36336aec45a7SmrgAC_REQUIRE([LT_PATH_NM])dnl
36346aec45a7SmrgAC_REQUIRE([LT_PATH_LD])dnl
36356aec45a7Smrgm4_require([_LT_DECL_SED])dnl
36366aec45a7Smrgm4_require([_LT_DECL_EGREP])dnl
36376aec45a7Smrgm4_require([_LT_TAG_COMPILER])dnl
36385c42550eSmrg
36396aec45a7Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
36406aec45a7SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
36416aec45a7SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
36426aec45a7Smrg[
36436aec45a7Smrg# These are sane defaults that work on at least a few old systems.
36446aec45a7Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
36455c42550eSmrg
36466aec45a7Smrg# Character class describing NM global symbol codes.
36476aec45a7Smrgsymcode='[[BCDEGRST]]'
36485c42550eSmrg
36496aec45a7Smrg# Regexp to match symbols that can be accessed directly from C.
36506aec45a7Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
36515c42550eSmrg
36526aec45a7Smrg# Define system-specific variables.
36535c42550eSmrgcase $host_os in
36546aec45a7Smrgaix*)
36556aec45a7Smrg  symcode='[[BCDT]]'
36565c42550eSmrg  ;;
36576aec45a7Smrgcygwin* | mingw* | pw32* | cegcc*)
36586aec45a7Smrg  symcode='[[ABCDGISTW]]'
36596aec45a7Smrg  ;;
36606aec45a7Smrghpux*)
36616aec45a7Smrg  if test "$host_cpu" = ia64; then
36626aec45a7Smrg    symcode='[[ABCDEGRST]]'
36635c42550eSmrg  fi
36646aec45a7Smrg  ;;
36656aec45a7Smrgirix* | nonstopux*)
36666aec45a7Smrg  symcode='[[BCDEGRST]]'
36676aec45a7Smrg  ;;
36686aec45a7Smrgosf*)
36696aec45a7Smrg  symcode='[[BCDEGQRST]]'
36706aec45a7Smrg  ;;
36716aec45a7Smrgsolaris*)
36726aec45a7Smrg  symcode='[[BDRT]]'
36736aec45a7Smrg  ;;
36746aec45a7Smrgsco3.2v5*)
36756aec45a7Smrg  symcode='[[DT]]'
36766aec45a7Smrg  ;;
36776aec45a7Smrgsysv4.2uw2*)
36786aec45a7Smrg  symcode='[[DT]]'
36796aec45a7Smrg  ;;
36806aec45a7Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
36816aec45a7Smrg  symcode='[[ABDT]]'
36826aec45a7Smrg  ;;
36836aec45a7Smrgsysv4)
36846aec45a7Smrg  symcode='[[DFNSTU]]'
36856aec45a7Smrg  ;;
36865c42550eSmrgesac
3687ab47cfaaSmrg
36886aec45a7Smrg# If we're using GNU nm, then use its standard symbol codes.
36896aec45a7Smrgcase `$NM -V 2>&1` in
36906aec45a7Smrg*GNU* | *'with BFD'*)
36916aec45a7Smrg  symcode='[[ABCDGIRSTW]]' ;;
36926aec45a7Smrgesac
3693ab47cfaaSmrg
36946aec45a7Smrg# Transform an extracted symbol line into a proper C declaration.
36956aec45a7Smrg# Some systems (esp. on ia64) link data and code symbols differently,
36966aec45a7Smrg# so use this general approach.
36976aec45a7Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3698ab47cfaaSmrg
36996aec45a7Smrg# Transform an extracted symbol line into symbol name and symbol address
3700aa9e3350Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
3701aa9e3350Smrglt_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'"
3702ab47cfaaSmrg
37036aec45a7Smrg# Handle CRLF in mingw tool chain
37046aec45a7Smrgopt_cr=
37056aec45a7Smrgcase $build_os in
37066aec45a7Smrgmingw*)
37076aec45a7Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
37086aec45a7Smrg  ;;
37096aec45a7Smrgesac
37105c42550eSmrg
37116aec45a7Smrg# Try without a prefix underscore, then with it.
37126aec45a7Smrgfor ac_symprfx in "" "_"; do
37135c42550eSmrg
37146aec45a7Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
37156aec45a7Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
37165c42550eSmrg
37176aec45a7Smrg  # Write the raw and C identifiers.
37186aec45a7Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
37196aec45a7Smrg    # Fake it for dumpbin and say T for any non-static function
37206aec45a7Smrg    # and D for any global variable.
37216aec45a7Smrg    # Also find C++ and __fastcall symbols from MSVC++,
37226aec45a7Smrg    # which start with @ or ?.
37236aec45a7Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
37246aec45a7Smrg"     {last_section=section; section=\$ 3};"\
3725aa9e3350Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
37266aec45a7Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
37276aec45a7Smrg"     \$ 0!~/External *\|/{next};"\
37286aec45a7Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
37296aec45a7Smrg"     {if(hide[section]) next};"\
37306aec45a7Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
37316aec45a7Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
37326aec45a7Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
37336aec45a7Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
37346aec45a7Smrg"     ' prfx=^$ac_symprfx]"
37356aec45a7Smrg  else
37366aec45a7Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
37376aec45a7Smrg  fi
3738aa9e3350Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
37395c42550eSmrg
37406aec45a7Smrg  # Check to see that the pipe works correctly.
37416aec45a7Smrg  pipe_works=no
37425c42550eSmrg
37436aec45a7Smrg  rm -f conftest*
37446aec45a7Smrg  cat > conftest.$ac_ext <<_LT_EOF
37456aec45a7Smrg#ifdef __cplusplus
37466aec45a7Smrgextern "C" {
37476aec45a7Smrg#endif
37486aec45a7Smrgchar nm_test_var;
37496aec45a7Smrgvoid nm_test_func(void);
37506aec45a7Smrgvoid nm_test_func(void){}
37516aec45a7Smrg#ifdef __cplusplus
37526aec45a7Smrg}
37536aec45a7Smrg#endif
37546aec45a7Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
37556aec45a7Smrg_LT_EOF
37565c42550eSmrg
37576aec45a7Smrg  if AC_TRY_EVAL(ac_compile); then
37586aec45a7Smrg    # Now try to grab the symbols.
37596aec45a7Smrg    nlist=conftest.nm
37606aec45a7Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
37616aec45a7Smrg      # Try sorting and uniquifying the output.
37626aec45a7Smrg      if sort "$nlist" | uniq > "$nlist"T; then
37636aec45a7Smrg	mv -f "$nlist"T "$nlist"
37646aec45a7Smrg      else
37656aec45a7Smrg	rm -f "$nlist"T
37666aec45a7Smrg      fi
37675c42550eSmrg
37686aec45a7Smrg      # Make sure that we snagged all the symbols we need.
37696aec45a7Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
37706aec45a7Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
37716aec45a7Smrg	  cat <<_LT_EOF > conftest.$ac_ext
3772aa9e3350Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
3773aa9e3350Smrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3774aa9e3350Smrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
3775aa9e3350Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
3776aa9e3350Smrg# define LT@&t@_DLSYM_CONST
3777aa9e3350Smrg#elif defined(__osf__)
3778aa9e3350Smrg/* This system does not cope well with relocations in const data.  */
3779aa9e3350Smrg# define LT@&t@_DLSYM_CONST
3780aa9e3350Smrg#else
3781aa9e3350Smrg# define LT@&t@_DLSYM_CONST const
3782aa9e3350Smrg#endif
3783aa9e3350Smrg
37846aec45a7Smrg#ifdef __cplusplus
37856aec45a7Smrgextern "C" {
37866aec45a7Smrg#endif
37875c42550eSmrg
37886aec45a7Smrg_LT_EOF
37896aec45a7Smrg	  # Now generate the symbol file.
37906aec45a7Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
37915c42550eSmrg
37926aec45a7Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
37935c42550eSmrg
37946aec45a7Smrg/* The mapping between symbol names and symbols.  */
3795aa9e3350SmrgLT@&t@_DLSYM_CONST struct {
37966aec45a7Smrg  const char *name;
37976aec45a7Smrg  void       *address;
37986aec45a7Smrg}
37996aec45a7Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
38006aec45a7Smrg{
38016aec45a7Smrg  { "@PROGRAM@", (void *) 0 },
38026aec45a7Smrg_LT_EOF
38036aec45a7Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
38046aec45a7Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
38056aec45a7Smrg  {0, (void *) 0}
38066aec45a7Smrg};
38075c42550eSmrg
38086aec45a7Smrg/* This works around a problem in FreeBSD linker */
38096aec45a7Smrg#ifdef FREEBSD_WORKAROUND
38106aec45a7Smrgstatic const void *lt_preloaded_setup() {
38116aec45a7Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
38126aec45a7Smrg}
38136aec45a7Smrg#endif
38145c42550eSmrg
38156aec45a7Smrg#ifdef __cplusplus
38166aec45a7Smrg}
38176aec45a7Smrg#endif
38186aec45a7Smrg_LT_EOF
38196aec45a7Smrg	  # Now try linking the two files.
38206aec45a7Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
3821aa9e3350Smrg	  lt_globsym_save_LIBS=$LIBS
3822aa9e3350Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
38236aec45a7Smrg	  LIBS="conftstm.$ac_objext"
38246aec45a7Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
38256aec45a7Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
38266aec45a7Smrg	    pipe_works=yes
38276aec45a7Smrg	  fi
3828aa9e3350Smrg	  LIBS=$lt_globsym_save_LIBS
3829aa9e3350Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
38306aec45a7Smrg	else
38316aec45a7Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
38326aec45a7Smrg	fi
38336aec45a7Smrg      else
38346aec45a7Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
38356aec45a7Smrg      fi
3836ab47cfaaSmrg    else
38376aec45a7Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3838ab47cfaaSmrg    fi
3839ab47cfaaSmrg  else
38406aec45a7Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
38416aec45a7Smrg    cat conftest.$ac_ext >&5
3842ab47cfaaSmrg  fi
38436aec45a7Smrg  rm -rf conftest* conftst*
3844ab47cfaaSmrg
38456aec45a7Smrg  # Do not use the global_symbol_pipe unless it works.
38466aec45a7Smrg  if test "$pipe_works" = yes; then
38476aec45a7Smrg    break
38486aec45a7Smrg  else
38496aec45a7Smrg    lt_cv_sys_global_symbol_pipe=
38506aec45a7Smrg  fi
38516aec45a7Smrgdone
38526aec45a7Smrg])
38536aec45a7Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
38546aec45a7Smrg  lt_cv_sys_global_symbol_to_cdecl=
38556aec45a7Smrgfi
38566aec45a7Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
38576aec45a7Smrg  AC_MSG_RESULT(failed)
3858ab47cfaaSmrgelse
38596aec45a7Smrg  AC_MSG_RESULT(ok)
3860ab47cfaaSmrgfi
3861ab47cfaaSmrg
3862aa9e3350Smrg# Response file support.
3863aa9e3350Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
3864aa9e3350Smrg  nm_file_list_spec='@'
3865aa9e3350Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
3866aa9e3350Smrg  nm_file_list_spec='@'
3867aa9e3350Smrgfi
3868aa9e3350Smrg
38696aec45a7Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
38706aec45a7Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
38716aec45a7Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
38726aec45a7Smrg    [Transform the output of nm in a proper C declaration])
38736aec45a7Smrg_LT_DECL([global_symbol_to_c_name_address],
38746aec45a7Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
38756aec45a7Smrg    [Transform the output of nm in a C name address pair])
38766aec45a7Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
38776aec45a7Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
38786aec45a7Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
3879aa9e3350Smrg_LT_DECL([], [nm_file_list_spec], [1],
3880aa9e3350Smrg    [Specify filename containing input files for $NM])
38816aec45a7Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
3882ab47cfaaSmrg
3883ab47cfaaSmrg
38846aec45a7Smrg# _LT_COMPILER_PIC([TAGNAME])
38856aec45a7Smrg# ---------------------------
38866aec45a7Smrgm4_defun([_LT_COMPILER_PIC],
38876aec45a7Smrg[m4_require([_LT_TAG_COMPILER])dnl
38886aec45a7Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
38896aec45a7Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
38906aec45a7Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
3891ab47cfaaSmrg
38926aec45a7Smrgm4_if([$1], [CXX], [
38936aec45a7Smrg  # C++ specific cases for pic, static, wl, etc.
38946aec45a7Smrg  if test "$GXX" = yes; then
38956aec45a7Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
38966aec45a7Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
38975c42550eSmrg
38986aec45a7Smrg    case $host_os in
38996aec45a7Smrg    aix*)
39006aec45a7Smrg      # All AIX code is PIC.
39015c42550eSmrg      if test "$host_cpu" = ia64; then
39026aec45a7Smrg	# AIX 5 now supports IA64 processor
39036aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
39045c42550eSmrg      fi
39056aec45a7Smrg      ;;
39065c42550eSmrg
39076aec45a7Smrg    amigaos*)
39086aec45a7Smrg      case $host_cpu in
39096aec45a7Smrg      powerpc)
39106aec45a7Smrg            # see comment about AmigaOS4 .so support
39116aec45a7Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39125c42550eSmrg        ;;
39136aec45a7Smrg      m68k)
39146aec45a7Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
39156aec45a7Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
39166aec45a7Smrg            # like `-m68040'.
39176aec45a7Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
39186aec45a7Smrg        ;;
39196aec45a7Smrg      esac
39206aec45a7Smrg      ;;
39215c42550eSmrg
39226aec45a7Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
39236aec45a7Smrg      # PIC is the default for these OSes.
39245c42550eSmrg      ;;
39256aec45a7Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
39266aec45a7Smrg      # This hack is so that the source file can tell whether it is being
39276aec45a7Smrg      # built for inclusion in a dll (and should export symbols for example).
39286aec45a7Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
39296aec45a7Smrg      # (--disable-auto-import) libraries
39306aec45a7Smrg      m4_if([$1], [GCJ], [],
39316aec45a7Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
39325c42550eSmrg      ;;
39336aec45a7Smrg    darwin* | rhapsody*)
39346aec45a7Smrg      # PIC is the default on this platform
39356aec45a7Smrg      # Common symbols not allowed in MH_DYLIB files
39366aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
39376aec45a7Smrg      ;;
39386aec45a7Smrg    *djgpp*)
39396aec45a7Smrg      # DJGPP does not support shared libraries at all
39406aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
39416aec45a7Smrg      ;;
39426aec45a7Smrg    haiku*)
39436aec45a7Smrg      # PIC is the default for Haiku.
39446aec45a7Smrg      # The "-static" flag exists, but is broken.
39456aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
39466aec45a7Smrg      ;;
39476aec45a7Smrg    interix[[3-9]]*)
39486aec45a7Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
39496aec45a7Smrg      # Instead, we relocate shared libraries at runtime.
39506aec45a7Smrg      ;;
39516aec45a7Smrg    sysv4*MP*)
39526aec45a7Smrg      if test -d /usr/nec; then
39536aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3954ab47cfaaSmrg      fi
3955ab47cfaaSmrg      ;;
39566aec45a7Smrg    hpux*)
39576aec45a7Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
39586aec45a7Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
39596aec45a7Smrg      # sets the default TLS model and affects inlining.
3960ab47cfaaSmrg      case $host_cpu in
39616aec45a7Smrg      hppa*64*)
39626aec45a7Smrg	;;
39635c42550eSmrg      *)
39646aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39656aec45a7Smrg	;;
3966ab47cfaaSmrg      esac
39676aec45a7Smrg      ;;
39686aec45a7Smrg    *qnx* | *nto*)
39696aec45a7Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
39706aec45a7Smrg      # it will coredump.
39716aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
39725c42550eSmrg      ;;
39735c42550eSmrg    *)
39746aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3975ab47cfaaSmrg      ;;
39765c42550eSmrg    esac
39776aec45a7Smrg  else
39786aec45a7Smrg    case $host_os in
39796aec45a7Smrg      aix[[4-9]]*)
39806aec45a7Smrg	# All AIX code is PIC.
39816aec45a7Smrg	if test "$host_cpu" = ia64; then
39826aec45a7Smrg	  # AIX 5 now supports IA64 processor
39836aec45a7Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
39846aec45a7Smrg	else
39856aec45a7Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
39866aec45a7Smrg	fi
3987ab47cfaaSmrg	;;
39886aec45a7Smrg      chorus*)
39896aec45a7Smrg	case $cc_basename in
39906aec45a7Smrg	cxch68*)
39916aec45a7Smrg	  # Green Hills C++ Compiler
39926aec45a7Smrg	  # _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"
3993ab47cfaaSmrg	  ;;
3994ab47cfaaSmrg	esac
3995ab47cfaaSmrg	;;
3996aa9e3350Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
3997aa9e3350Smrg	# This hack is so that the source file can tell whether it is being
3998aa9e3350Smrg	# built for inclusion in a dll (and should export symbols for example).
3999aa9e3350Smrg	m4_if([$1], [GCJ], [],
4000aa9e3350Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4001aa9e3350Smrg	;;
40026aec45a7Smrg      dgux*)
40036aec45a7Smrg	case $cc_basename in
40046aec45a7Smrg	  ec++*)
40056aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40066aec45a7Smrg	    ;;
40076aec45a7Smrg	  ghcx*)
40086aec45a7Smrg	    # Green Hills C++ Compiler
40096aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
40106aec45a7Smrg	    ;;
40116aec45a7Smrg	  *)
40126aec45a7Smrg	    ;;
40136aec45a7Smrg	esac
40146aec45a7Smrg	;;
40156aec45a7Smrg      freebsd* | dragonfly*)
40166aec45a7Smrg	# FreeBSD uses GNU C++
40176aec45a7Smrg	;;
40186aec45a7Smrg      hpux9* | hpux10* | hpux11*)
40196aec45a7Smrg	case $cc_basename in
40206aec45a7Smrg	  CC*)
40216aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40226aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
40236aec45a7Smrg	    if test "$host_cpu" != ia64; then
40246aec45a7Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
40256aec45a7Smrg	    fi
40266aec45a7Smrg	    ;;
40276aec45a7Smrg	  aCC*)
40286aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40296aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4030ab47cfaaSmrg	    case $host_cpu in
40316aec45a7Smrg	    hppa*64*|ia64*)
40326aec45a7Smrg	      # +Z the default
4033ab47cfaaSmrg	      ;;
4034ab47cfaaSmrg	    *)
40356aec45a7Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4036ab47cfaaSmrg	      ;;
4037ab47cfaaSmrg	    esac
40386aec45a7Smrg	    ;;
40396aec45a7Smrg	  *)
40406aec45a7Smrg	    ;;
40416aec45a7Smrg	esac
4042ab47cfaaSmrg	;;
40436aec45a7Smrg      interix*)
40446aec45a7Smrg	# This is c89, which is MS Visual C++ (no shared libs)
40456aec45a7Smrg	# Anyone wants to do a port?
40465c42550eSmrg	;;
40476aec45a7Smrg      irix5* | irix6* | nonstopux*)
40486aec45a7Smrg	case $cc_basename in
40496aec45a7Smrg	  CC*)
40506aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40516aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40526aec45a7Smrg	    # CC pic flag -KPIC is the default.
40536aec45a7Smrg	    ;;
40546aec45a7Smrg	  *)
40556aec45a7Smrg	    ;;
40566aec45a7Smrg	esac
40575c42550eSmrg	;;
40586aec45a7Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
40596aec45a7Smrg	case $cc_basename in
40606aec45a7Smrg	  KCC*)
40616aec45a7Smrg	    # KAI C++ Compiler
40626aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
40636aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
40646aec45a7Smrg	    ;;
40656aec45a7Smrg	  ecpc* )
40666aec45a7Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
40676aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40686aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40696aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
40706aec45a7Smrg	    ;;
40716aec45a7Smrg	  icpc* )
40726aec45a7Smrg	    # Intel C++, used to be incompatible with GCC.
40736aec45a7Smrg	    # ICC 10 doesn't accept -KPIC any more.
40746aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40756aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
40766aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
40776aec45a7Smrg	    ;;
40786aec45a7Smrg	  pgCC* | pgcpp*)
40796aec45a7Smrg	    # Portland Group C++ compiler
40806aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40816aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
40826aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
40836aec45a7Smrg	    ;;
40846aec45a7Smrg	  cxx*)
40856aec45a7Smrg	    # Compaq C++
40866aec45a7Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
40876aec45a7Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
40886aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
40896aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40906aec45a7Smrg	    ;;
40916aec45a7Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
40926aec45a7Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
40936aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40946aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
40956aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
40966aec45a7Smrg	    ;;
40976aec45a7Smrg	  *)
40986aec45a7Smrg	    case `$CC -V 2>&1 | sed 5q` in
40996aec45a7Smrg	    *Sun\ C*)
41006aec45a7Smrg	      # Sun C++ 5.9
41016aec45a7Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41026aec45a7Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41036aec45a7Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
41046aec45a7Smrg	      ;;
41056aec45a7Smrg	    esac
41066aec45a7Smrg	    ;;
41078697ee19Smrg	esac
41088697ee19Smrg	;;
41096aec45a7Smrg      lynxos*)
41105c42550eSmrg	;;
41116aec45a7Smrg      m88k*)
41126aec45a7Smrg	;;
41136aec45a7Smrg      mvs*)
41146aec45a7Smrg	case $cc_basename in
41156aec45a7Smrg	  cxx*)
41166aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
41176aec45a7Smrg	    ;;
41186aec45a7Smrg	  *)
41196aec45a7Smrg	    ;;
41201473d951Smrg	esac
4121ab47cfaaSmrg	;;
41226aec45a7Smrg      netbsd*)
4123ab47cfaaSmrg	;;
41246aec45a7Smrg      *qnx* | *nto*)
41256aec45a7Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
41266aec45a7Smrg        # it will coredump.
41276aec45a7Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
41286aec45a7Smrg        ;;
41296aec45a7Smrg      osf3* | osf4* | osf5*)
41306aec45a7Smrg	case $cc_basename in
41316aec45a7Smrg	  KCC*)
41326aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
41336aec45a7Smrg	    ;;
41346aec45a7Smrg	  RCC*)
41356aec45a7Smrg	    # Rational C++ 2.4.1
41366aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
41376aec45a7Smrg	    ;;
41386aec45a7Smrg	  cxx*)
41396aec45a7Smrg	    # Digital/Compaq C++
41406aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41416aec45a7Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
41426aec45a7Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
41436aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
41446aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
41456aec45a7Smrg	    ;;
41466aec45a7Smrg	  *)
41476aec45a7Smrg	    ;;
41486aec45a7Smrg	esac
4149ab47cfaaSmrg	;;
41506aec45a7Smrg      psos*)
41516aec45a7Smrg	;;
41526aec45a7Smrg      solaris*)
41536aec45a7Smrg	case $cc_basename in
41546aec45a7Smrg	  CC* | sunCC*)
41556aec45a7Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
41566aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41576aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41586aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
41596aec45a7Smrg	    ;;
41606aec45a7Smrg	  gcx*)
41616aec45a7Smrg	    # Green Hills C++ Compiler
41626aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
41636aec45a7Smrg	    ;;
41646aec45a7Smrg	  *)
41656aec45a7Smrg	    ;;
41666aec45a7Smrg	esac
41676aec45a7Smrg	;;
41686aec45a7Smrg      sunos4*)
41696aec45a7Smrg	case $cc_basename in
41706aec45a7Smrg	  CC*)
41716aec45a7Smrg	    # Sun C++ 4.x
41726aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
41736aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41746aec45a7Smrg	    ;;
41756aec45a7Smrg	  lcc*)
41766aec45a7Smrg	    # Lucid
41776aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
41786aec45a7Smrg	    ;;
41796aec45a7Smrg	  *)
41806aec45a7Smrg	    ;;
41816aec45a7Smrg	esac
4182ab47cfaaSmrg	;;
41836aec45a7Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
41846aec45a7Smrg	case $cc_basename in
41856aec45a7Smrg	  CC*)
41866aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41876aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41886aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41896aec45a7Smrg	    ;;
41906aec45a7Smrg	esac
41916aec45a7Smrg	;;
41926aec45a7Smrg      tandem*)
41936aec45a7Smrg	case $cc_basename in
41946aec45a7Smrg	  NCC*)
41956aec45a7Smrg	    # NonStop-UX NCC 3.20
41966aec45a7Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41976aec45a7Smrg	    ;;
41986aec45a7Smrg	  *)
41996aec45a7Smrg	    ;;
42006aec45a7Smrg	esac
4201ab47cfaaSmrg	;;
42026aec45a7Smrg      vxworks*)
4203ab47cfaaSmrg	;;
42045c42550eSmrg      *)
42056aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4206ab47cfaaSmrg	;;
42075c42550eSmrg    esac
42086aec45a7Smrg  fi
42096aec45a7Smrg],
42106aec45a7Smrg[
42116aec45a7Smrg  if test "$GCC" = yes; then
42126aec45a7Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
42136aec45a7Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
42146aec45a7Smrg
42156aec45a7Smrg    case $host_os in
42166aec45a7Smrg      aix*)
42176aec45a7Smrg      # All AIX code is PIC.
42186aec45a7Smrg      if test "$host_cpu" = ia64; then
42196aec45a7Smrg	# AIX 5 now supports IA64 processor
42206aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
42216aec45a7Smrg      fi
42226aec45a7Smrg      ;;
42235c42550eSmrg
42246aec45a7Smrg    amigaos*)
42256aec45a7Smrg      case $host_cpu in
42266aec45a7Smrg      powerpc)
42276aec45a7Smrg            # see comment about AmigaOS4 .so support
42286aec45a7Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42296aec45a7Smrg        ;;
42306aec45a7Smrg      m68k)
42316aec45a7Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
42326aec45a7Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
42336aec45a7Smrg            # like `-m68040'.
42346aec45a7Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
42356aec45a7Smrg        ;;
42366aec45a7Smrg      esac
42376aec45a7Smrg      ;;
42385c42550eSmrg
42396aec45a7Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
42406aec45a7Smrg      # PIC is the default for these OSes.
42416aec45a7Smrg      ;;
42425c42550eSmrg
42436aec45a7Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
42446aec45a7Smrg      # This hack is so that the source file can tell whether it is being
42456aec45a7Smrg      # built for inclusion in a dll (and should export symbols for example).
42466aec45a7Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
42476aec45a7Smrg      # (--disable-auto-import) libraries
42486aec45a7Smrg      m4_if([$1], [GCJ], [],
42496aec45a7Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
42506aec45a7Smrg      ;;
42515c42550eSmrg
42526aec45a7Smrg    darwin* | rhapsody*)
42536aec45a7Smrg      # PIC is the default on this platform
42546aec45a7Smrg      # Common symbols not allowed in MH_DYLIB files
42556aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
42566aec45a7Smrg      ;;
42575c42550eSmrg
42586aec45a7Smrg    haiku*)
42596aec45a7Smrg      # PIC is the default for Haiku.
42606aec45a7Smrg      # The "-static" flag exists, but is broken.
42616aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
42626aec45a7Smrg      ;;
42635c42550eSmrg
42646aec45a7Smrg    hpux*)
42656aec45a7Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
42666aec45a7Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
42676aec45a7Smrg      # sets the default TLS model and affects inlining.
42686aec45a7Smrg      case $host_cpu in
42696aec45a7Smrg      hppa*64*)
42706aec45a7Smrg	# +Z the default
42715c42550eSmrg	;;
42725c42550eSmrg      *)
42736aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42745c42550eSmrg	;;
42756aec45a7Smrg      esac
42766aec45a7Smrg      ;;
42775c42550eSmrg
42786aec45a7Smrg    interix[[3-9]]*)
42796aec45a7Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
42806aec45a7Smrg      # Instead, we relocate shared libraries at runtime.
42816aec45a7Smrg      ;;
42825c42550eSmrg
42836aec45a7Smrg    msdosdjgpp*)
42846aec45a7Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
42856aec45a7Smrg      # on systems that don't support them.
42866aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
42876aec45a7Smrg      enable_shared=no
42886aec45a7Smrg      ;;
4289ab47cfaaSmrg
42906aec45a7Smrg    *nto* | *qnx*)
42916aec45a7Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
42926aec45a7Smrg      # it will coredump.
42936aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
42946aec45a7Smrg      ;;
42951473d951Smrg
42966aec45a7Smrg    sysv4*MP*)
42976aec45a7Smrg      if test -d /usr/nec; then
42986aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
42996aec45a7Smrg      fi
43006aec45a7Smrg      ;;
43011473d951Smrg
43026aec45a7Smrg    *)
43036aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
43046aec45a7Smrg      ;;
43055c42550eSmrg    esac
43065c42550eSmrg
43075c42550eSmrg    case $cc_basename in
43086aec45a7Smrg    nvcc*) # Cuda Compiler Driver 2.2
43096aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4310aa9e3350Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4311aa9e3350Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4312aa9e3350Smrg      fi
43136aec45a7Smrg      ;;
4314ab47cfaaSmrg    esac
43156aec45a7Smrg  else
43166aec45a7Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
43176aec45a7Smrg    case $host_os in
43186aec45a7Smrg    aix*)
43196aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43206aec45a7Smrg      if test "$host_cpu" = ia64; then
43216aec45a7Smrg	# AIX 5 now supports IA64 processor
43226aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43236aec45a7Smrg      else
43246aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
43256aec45a7Smrg      fi
43266aec45a7Smrg      ;;
43275c42550eSmrg
43286aec45a7Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
43296aec45a7Smrg      # This hack is so that the source file can tell whether it is being
43306aec45a7Smrg      # built for inclusion in a dll (and should export symbols for example).
43316aec45a7Smrg      m4_if([$1], [GCJ], [],
43326aec45a7Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
43336aec45a7Smrg      ;;
43346aec45a7Smrg
43356aec45a7Smrg    hpux9* | hpux10* | hpux11*)
43366aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43376aec45a7Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
43386aec45a7Smrg      # not for PA HP-UX.
43396aec45a7Smrg      case $host_cpu in
43406aec45a7Smrg      hppa*64*|ia64*)
43416aec45a7Smrg	# +Z the default
4342ab47cfaaSmrg	;;
4343ab47cfaaSmrg      *)
43446aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
43451473d951Smrg	;;
43466aec45a7Smrg      esac
43476aec45a7Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
43486aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
43496aec45a7Smrg      ;;
43506aec45a7Smrg
43516aec45a7Smrg    irix5* | irix6* | nonstopux*)
43526aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43536aec45a7Smrg      # PIC (with -KPIC) is the default.
43546aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
43556aec45a7Smrg      ;;
43566aec45a7Smrg
43576aec45a7Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
43586aec45a7Smrg      case $cc_basename in
43596aec45a7Smrg      # old Intel for x86_64 which still supported -KPIC.
43606aec45a7Smrg      ecc*)
43616aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43626aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
43636aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
43646aec45a7Smrg        ;;
43656aec45a7Smrg      # icc used to be incompatible with GCC.
43666aec45a7Smrg      # ICC 10 doesn't accept -KPIC any more.
43676aec45a7Smrg      icc* | ifort*)
43686aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43696aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
43706aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
43716aec45a7Smrg        ;;
43726aec45a7Smrg      # Lahey Fortran 8.1.
43736aec45a7Smrg      lf95*)
43746aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43756aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
43766aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
43776aec45a7Smrg	;;
4378aa9e3350Smrg      nagfor*)
4379aa9e3350Smrg	# NAG Fortran compiler
4380aa9e3350Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4381aa9e3350Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4382aa9e3350Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4383aa9e3350Smrg	;;
43846aec45a7Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
43856aec45a7Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
43866aec45a7Smrg	# which looks to be a dead project)
43876aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43886aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
43896aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43906aec45a7Smrg        ;;
43916aec45a7Smrg      ccc*)
43926aec45a7Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43936aec45a7Smrg        # All Alpha code is PIC.
43946aec45a7Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
43956aec45a7Smrg        ;;
43966aec45a7Smrg      xl* | bgxl* | bgf* | mpixl*)
43976aec45a7Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
43986aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43996aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
44006aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4401ab47cfaaSmrg	;;
4402ab47cfaaSmrg      *)
44036aec45a7Smrg	case `$CC -V 2>&1 | sed 5q` in
4404aa9e3350Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
44056aec45a7Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
44066aec45a7Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44076aec45a7Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44086aec45a7Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
44096aec45a7Smrg	  ;;
4410aa9e3350Smrg	*Sun\ F* | *Sun*Fortran*)
4411aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4412aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4413aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4414aa9e3350Smrg	  ;;
44156aec45a7Smrg	*Sun\ C*)
44166aec45a7Smrg	  # Sun C 5.9
44176aec45a7Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44186aec45a7Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44196aec45a7Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44206aec45a7Smrg	  ;;
4421aa9e3350Smrg        *Intel*\ [[CF]]*Compiler*)
4422aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4423aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4424aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4425aa9e3350Smrg	  ;;
4426aa9e3350Smrg	*Portland\ Group*)
4427aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4428aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4429aa9e3350Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4430aa9e3350Smrg	  ;;
44316aec45a7Smrg	esac
4432ab47cfaaSmrg	;;
44336aec45a7Smrg      esac
44346aec45a7Smrg      ;;
4435ab47cfaaSmrg
44366aec45a7Smrg    newsos6)
44376aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44386aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44396aec45a7Smrg      ;;
4440ab47cfaaSmrg
44416aec45a7Smrg    *nto* | *qnx*)
44426aec45a7Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
44436aec45a7Smrg      # it will coredump.
44446aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
44456aec45a7Smrg      ;;
4446ab47cfaaSmrg
44476aec45a7Smrg    osf3* | osf4* | osf5*)
44486aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44496aec45a7Smrg      # All OSF/1 code is PIC.
44506aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44516aec45a7Smrg      ;;
4452ab47cfaaSmrg
44536aec45a7Smrg    rdos*)
44546aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44556aec45a7Smrg      ;;
4456ab47cfaaSmrg
44576aec45a7Smrg    solaris*)
44586aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44596aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44606aec45a7Smrg      case $cc_basename in
44616aec45a7Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
44626aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
44636aec45a7Smrg      *)
44646aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
44656aec45a7Smrg      esac
44666aec45a7Smrg      ;;
4467ab47cfaaSmrg
44686aec45a7Smrg    sunos4*)
44696aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44706aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
44716aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44726aec45a7Smrg      ;;
4473ab47cfaaSmrg
44746aec45a7Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
44756aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44766aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44776aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44786aec45a7Smrg      ;;
4479ab47cfaaSmrg
44806aec45a7Smrg    sysv4*MP*)
44816aec45a7Smrg      if test -d /usr/nec ;then
44826aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
44836aec45a7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44846aec45a7Smrg      fi
44856aec45a7Smrg      ;;
4486ab47cfaaSmrg
44876aec45a7Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
44886aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44896aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44906aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44916aec45a7Smrg      ;;
4492ab47cfaaSmrg
44936aec45a7Smrg    unicos*)
44946aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44956aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
44966aec45a7Smrg      ;;
44975c42550eSmrg
44986aec45a7Smrg    uts4*)
44996aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
45006aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
45016aec45a7Smrg      ;;
4502ab47cfaaSmrg
45036aec45a7Smrg    *)
45046aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
45056aec45a7Smrg      ;;
4506ab47cfaaSmrg    esac
45076aec45a7Smrg  fi
45086aec45a7Smrg])
45096aec45a7Smrgcase $host_os in
45106aec45a7Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
45116aec45a7Smrg  *djgpp*)
45126aec45a7Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
45136aec45a7Smrg    ;;
45146aec45a7Smrg  *)
45156aec45a7Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
45166aec45a7Smrg    ;;
45176aec45a7Smrgesac
4518aa9e3350Smrg
4519aa9e3350SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
4520aa9e3350Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4521aa9e3350Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4522aa9e3350Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4523ab47cfaaSmrg
45246aec45a7Smrg#
45256aec45a7Smrg# Check to make sure the PIC flag actually works.
45266aec45a7Smrg#
45276aec45a7Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
45286aec45a7Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
45296aec45a7Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
45306aec45a7Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
45316aec45a7Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
45326aec45a7Smrg     "" | " "*) ;;
45336aec45a7Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
45346aec45a7Smrg     esac],
45356aec45a7Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
45366aec45a7Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
45371473d951Smrgfi
45386aec45a7Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
45396aec45a7Smrg	[Additional compiler flags for building library objects])
4540ab47cfaaSmrg
4541aa9e3350Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4542aa9e3350Smrg	[How to pass a linker flag through the compiler])
45436aec45a7Smrg#
45446aec45a7Smrg# Check to make sure the static flag actually works.
45456aec45a7Smrg#
45466aec45a7Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
45476aec45a7Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
45486aec45a7Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
45496aec45a7Smrg  $lt_tmp_static_flag,
45506aec45a7Smrg  [],
45516aec45a7Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
45526aec45a7Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
45536aec45a7Smrg	[Compiler flag to prevent dynamic linking])
45546aec45a7Smrg])# _LT_COMPILER_PIC
4555ab47cfaaSmrg
45565c42550eSmrg
45576aec45a7Smrg# _LT_LINKER_SHLIBS([TAGNAME])
45586aec45a7Smrg# ----------------------------
45596aec45a7Smrg# See if the linker supports building shared libraries.
45606aec45a7Smrgm4_defun([_LT_LINKER_SHLIBS],
45616aec45a7Smrg[AC_REQUIRE([LT_PATH_LD])dnl
45626aec45a7SmrgAC_REQUIRE([LT_PATH_NM])dnl
4563aa9e3350Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
45646aec45a7Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
45656aec45a7Smrgm4_require([_LT_DECL_EGREP])dnl
45666aec45a7Smrgm4_require([_LT_DECL_SED])dnl
45676aec45a7Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
45686aec45a7Smrgm4_require([_LT_TAG_COMPILER])dnl
45696aec45a7SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
45706aec45a7Smrgm4_if([$1], [CXX], [
45716aec45a7Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4572aa9e3350Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
45736aec45a7Smrg  case $host_os in
45746aec45a7Smrg  aix[[4-9]]*)
45756aec45a7Smrg    # If we're using GNU nm, then we don't want the "-C" option.
45766aec45a7Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
45776aec45a7Smrg    # Also, AIX nm treats weak defined symbols like other global defined
45786aec45a7Smrg    # symbols, whereas GNU nm marks them as "W".
45796aec45a7Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
45806aec45a7Smrg      _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'
45816aec45a7Smrg    else
45826aec45a7Smrg      _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'
45838697ee19Smrg    fi
45848697ee19Smrg    ;;
45856aec45a7Smrg  pw32*)
45866aec45a7Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4587aa9e3350Smrg    ;;
45886aec45a7Smrg  cygwin* | mingw* | cegcc*)
4589aa9e3350Smrg    case $cc_basename in
4590aa9e3350Smrg    cl*)
4591aa9e3350Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4592aa9e3350Smrg      ;;
4593aa9e3350Smrg    *)
4594aa9e3350Smrg      _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'
4595aa9e3350Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4596aa9e3350Smrg      ;;
4597aa9e3350Smrg    esac
4598aa9e3350Smrg    ;;
45996aec45a7Smrg  *)
46006aec45a7Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4601aa9e3350Smrg    ;;
46026aec45a7Smrg  esac
46036aec45a7Smrg], [
46046aec45a7Smrg  runpath_var=
46056aec45a7Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
46066aec45a7Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
46076aec45a7Smrg  _LT_TAGVAR(archive_cmds, $1)=
46086aec45a7Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
46096aec45a7Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
46106aec45a7Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
46116aec45a7Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
46126aec45a7Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
46136aec45a7Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
46146aec45a7Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
46156aec45a7Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
46166aec45a7Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
46176aec45a7Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
46186aec45a7Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
46196aec45a7Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
46206aec45a7Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
46216aec45a7Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
46226aec45a7Smrg  _LT_TAGVAR(module_cmds, $1)=
46236aec45a7Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
46246aec45a7Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
46256aec45a7Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
46266aec45a7Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
46276aec45a7Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
46286aec45a7Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
46296aec45a7Smrg  # included in the symbol list
46306aec45a7Smrg  _LT_TAGVAR(include_expsyms, $1)=
46316aec45a7Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
46326aec45a7Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
46336aec45a7Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
46346aec45a7Smrg  # as well as any symbol that contains `d'.
46356aec45a7Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
46366aec45a7Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
46376aec45a7Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
46386aec45a7Smrg  # the symbol is explicitly referenced.  Since portable code cannot
46396aec45a7Smrg  # rely on this symbol name, it's probably fine to never include it in
46406aec45a7Smrg  # preloaded symbol tables.
46416aec45a7Smrg  # Exclude shared library initialization/finalization symbols.
46426aec45a7Smrgdnl Note also adjust exclude_expsyms for C++ above.
46436aec45a7Smrg  extract_expsyms_cmds=
46448697ee19Smrg
46456aec45a7Smrg  case $host_os in
46466aec45a7Smrg  cygwin* | mingw* | pw32* | cegcc*)
46476aec45a7Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
46486aec45a7Smrg    # When not using gcc, we currently assume that we are using
46496aec45a7Smrg    # Microsoft Visual C++.
46506aec45a7Smrg    if test "$GCC" != yes; then
46516aec45a7Smrg      with_gnu_ld=no
46528697ee19Smrg    fi
4653ab47cfaaSmrg    ;;
46546aec45a7Smrg  interix*)
46556aec45a7Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
46566aec45a7Smrg    with_gnu_ld=yes
46576aec45a7Smrg    ;;
46586aec45a7Smrg  openbsd*)
46596aec45a7Smrg    with_gnu_ld=no
46606aec45a7Smrg    ;;
4661ab47cfaaSmrg  esac
4662ab47cfaaSmrg
46636aec45a7Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
4664ab47cfaaSmrg
46656aec45a7Smrg  # On some targets, GNU ld is compatible enough with the native linker
46666aec45a7Smrg  # that we're better off using the native interface for both.
46676aec45a7Smrg  lt_use_gnu_ld_interface=no
46686aec45a7Smrg  if test "$with_gnu_ld" = yes; then
46696aec45a7Smrg    case $host_os in
46706aec45a7Smrg      aix*)
46716aec45a7Smrg	# The AIX port of GNU ld has always aspired to compatibility
46726aec45a7Smrg	# with the native linker.  However, as the warning in the GNU ld
46736aec45a7Smrg	# block says, versions before 2.19.5* couldn't really create working
46746aec45a7Smrg	# shared libraries, regardless of the interface used.
46756aec45a7Smrg	case `$LD -v 2>&1` in
46766aec45a7Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
46776aec45a7Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
46786aec45a7Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
46796aec45a7Smrg	  *)
46806aec45a7Smrg	    lt_use_gnu_ld_interface=yes
46816aec45a7Smrg	    ;;
46826aec45a7Smrg	esac
46836aec45a7Smrg	;;
46846aec45a7Smrg      *)
46856aec45a7Smrg	lt_use_gnu_ld_interface=yes
46866aec45a7Smrg	;;
46876aec45a7Smrg    esac
46886aec45a7Smrg  fi
4689ab47cfaaSmrg
46906aec45a7Smrg  if test "$lt_use_gnu_ld_interface" = yes; then
46916aec45a7Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
46926aec45a7Smrg    wlarc='${wl}'
4693ab47cfaaSmrg
46946aec45a7Smrg    # Set some defaults for GNU ld with shared library support. These
46956aec45a7Smrg    # are reset later if shared libraries are not supported. Putting them
46966aec45a7Smrg    # here allows them to be overridden if necessary.
46976aec45a7Smrg    runpath_var=LD_RUN_PATH
46986aec45a7Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
46996aec45a7Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
47006aec45a7Smrg    # ancient GNU ld didn't support --whole-archive et. al.
47016aec45a7Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
47026aec45a7Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
47036aec45a7Smrg    else
47046aec45a7Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
47056aec45a7Smrg    fi
47066aec45a7Smrg    supports_anon_versioning=no
47076aec45a7Smrg    case `$LD -v 2>&1` in
47086aec45a7Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
47096aec45a7Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
47106aec45a7Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
47116aec45a7Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
47126aec45a7Smrg      *\ 2.11.*) ;; # other 2.11 versions
47136aec45a7Smrg      *) supports_anon_versioning=yes ;;
47146aec45a7Smrg    esac
4715ab47cfaaSmrg
47166aec45a7Smrg    # See if GNU ld supports shared libraries.
47176aec45a7Smrg    case $host_os in
47186aec45a7Smrg    aix[[3-9]]*)
47196aec45a7Smrg      # On AIX/PPC, the GNU linker is very broken
47206aec45a7Smrg      if test "$host_cpu" != ia64; then
47216aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
47226aec45a7Smrg	cat <<_LT_EOF 1>&2
4723ab47cfaaSmrg
47246aec45a7Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
47256aec45a7Smrg*** to be unable to reliably create shared libraries on AIX.
47266aec45a7Smrg*** Therefore, libtool is disabling shared libraries support.  If you
47276aec45a7Smrg*** really care for shared libraries, you may want to install binutils
47286aec45a7Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
47296aec45a7Smrg*** You will then need to restart the configuration process.
4730ab47cfaaSmrg
47316aec45a7Smrg_LT_EOF
47326aec45a7Smrg      fi
47336aec45a7Smrg      ;;
4734ab47cfaaSmrg
47356aec45a7Smrg    amigaos*)
47366aec45a7Smrg      case $host_cpu in
47376aec45a7Smrg      powerpc)
47386aec45a7Smrg            # see comment about AmigaOS4 .so support
47396aec45a7Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
47406aec45a7Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
47416aec45a7Smrg        ;;
47426aec45a7Smrg      m68k)
47436aec45a7Smrg            _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)'
47446aec45a7Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
47456aec45a7Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
47466aec45a7Smrg        ;;
47476aec45a7Smrg      esac
47486aec45a7Smrg      ;;
4749ab47cfaaSmrg
47506aec45a7Smrg    beos*)
47516aec45a7Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
47526aec45a7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
47536aec45a7Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
47546aec45a7Smrg	# support --undefined.  This deserves some investigation.  FIXME
47556aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
47566aec45a7Smrg      else
47576aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
47586aec45a7Smrg      fi
47596aec45a7Smrg      ;;
4760ab47cfaaSmrg
47616aec45a7Smrg    cygwin* | mingw* | pw32* | cegcc*)
47626aec45a7Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
47636aec45a7Smrg      # as there is no search path for DLLs.
47646aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
47656aec45a7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
47666aec45a7Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
47676aec45a7Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
47686aec45a7Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4769aa9e3350Smrg      _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'
4770aa9e3350Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
47716aec45a7Smrg
47726aec45a7Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
47736aec45a7Smrg        _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'
47746aec45a7Smrg	# If the export-symbols file already is a .def file (1st line
47756aec45a7Smrg	# is EXPORTS), use it as is; otherwise, prepend...
47766aec45a7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
47776aec45a7Smrg	  cp $export_symbols $output_objdir/$soname.def;
47786aec45a7Smrg	else
47796aec45a7Smrg	  echo EXPORTS > $output_objdir/$soname.def;
47806aec45a7Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
47816aec45a7Smrg	fi~
47826aec45a7Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
47836aec45a7Smrg      else
47846aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
47856aec45a7Smrg      fi
47866aec45a7Smrg      ;;
4787ab47cfaaSmrg
47886aec45a7Smrg    haiku*)
47896aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
47906aec45a7Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
47916aec45a7Smrg      ;;
4792ab47cfaaSmrg
47936aec45a7Smrg    interix[[3-9]]*)
47946aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
47956aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
47966aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
47976aec45a7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
47986aec45a7Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
47996aec45a7Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
48006aec45a7Smrg      # default) and relocated if they conflict, which is a slow very memory
48016aec45a7Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
48026aec45a7Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
48036aec45a7Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
48046aec45a7Smrg      _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'
48056aec45a7Smrg      _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'
48066aec45a7Smrg      ;;
4807ab47cfaaSmrg
48086aec45a7Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
48096aec45a7Smrg      tmp_diet=no
48106aec45a7Smrg      if test "$host_os" = linux-dietlibc; then
48116aec45a7Smrg	case $cc_basename in
48126aec45a7Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
48136aec45a7Smrg	esac
48146aec45a7Smrg      fi
48156aec45a7Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
48166aec45a7Smrg	 && test "$tmp_diet" = no
48176aec45a7Smrg      then
4818aa9e3350Smrg	tmp_addflag=' $pic_flag'
48196aec45a7Smrg	tmp_sharedflag='-shared'
48206aec45a7Smrg	case $cc_basename,$host_cpu in
48216aec45a7Smrg        pgcc*)				# Portland Group C compiler
48226aec45a7Smrg	  _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'
48236aec45a7Smrg	  tmp_addflag=' $pic_flag'
48246aec45a7Smrg	  ;;
48256aec45a7Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
48266aec45a7Smrg					# Portland Group f77 and f90 compilers
48276aec45a7Smrg	  _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'
48286aec45a7Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
48296aec45a7Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
48306aec45a7Smrg	  tmp_addflag=' -i_dynamic' ;;
48316aec45a7Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
48326aec45a7Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
48336aec45a7Smrg	ifc* | ifort*)			# Intel Fortran compiler
48346aec45a7Smrg	  tmp_addflag=' -nofor_main' ;;
48356aec45a7Smrg	lf95*)				# Lahey Fortran 8.1
48366aec45a7Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
48376aec45a7Smrg	  tmp_sharedflag='--shared' ;;
48386aec45a7Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
48396aec45a7Smrg	  tmp_sharedflag='-qmkshrobj'
48406aec45a7Smrg	  tmp_addflag= ;;
48416aec45a7Smrg	nvcc*)	# Cuda Compiler Driver 2.2
48426aec45a7Smrg	  _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'
48436aec45a7Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
48446aec45a7Smrg	  ;;
48456aec45a7Smrg	esac
48466aec45a7Smrg	case `$CC -V 2>&1 | sed 5q` in
48476aec45a7Smrg	*Sun\ C*)			# Sun C 5.9
48486aec45a7Smrg	  _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'
48496aec45a7Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
48506aec45a7Smrg	  tmp_sharedflag='-G' ;;
48516aec45a7Smrg	*Sun\ F*)			# Sun Fortran 8.3
48526aec45a7Smrg	  tmp_sharedflag='-G' ;;
48536aec45a7Smrg	esac
48546aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4855ab47cfaaSmrg
48566aec45a7Smrg        if test "x$supports_anon_versioning" = xyes; then
48576aec45a7Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
48586aec45a7Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
48596aec45a7Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
48606aec45a7Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
48616aec45a7Smrg        fi
4862ab47cfaaSmrg
48636aec45a7Smrg	case $cc_basename in
48646aec45a7Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
48656aec45a7Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
48666aec45a7Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4867aa9e3350Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
48686aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
48696aec45a7Smrg	  if test "x$supports_anon_versioning" = xyes; then
48706aec45a7Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
48716aec45a7Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
48726aec45a7Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
48736aec45a7Smrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
48746aec45a7Smrg	  fi
48756aec45a7Smrg	  ;;
48766aec45a7Smrg	esac
48776aec45a7Smrg      else
48786aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
48796aec45a7Smrg      fi
48806aec45a7Smrg      ;;
4881ab47cfaaSmrg
48826aec45a7Smrg    netbsd*)
48836aec45a7Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
48846aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
48856aec45a7Smrg	wlarc=
48866aec45a7Smrg      else
4887aa9e3350Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4888aa9e3350Smrg	_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'
48896aec45a7Smrg      fi
48906aec45a7Smrg      ;;
4891ab47cfaaSmrg
48926aec45a7Smrg    solaris*)
48936aec45a7Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
48946aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
48956aec45a7Smrg	cat <<_LT_EOF 1>&2
4896ab47cfaaSmrg
48976aec45a7Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
48986aec45a7Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
48996aec45a7Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
49006aec45a7Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
49016aec45a7Smrg*** your PATH or compiler configuration so that the native linker is
49026aec45a7Smrg*** used, and then restart.
4903ab47cfaaSmrg
49046aec45a7Smrg_LT_EOF
49056aec45a7Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4906aa9e3350Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4907aa9e3350Smrg	_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'
49086aec45a7Smrg      else
49096aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
49106aec45a7Smrg      fi
49116aec45a7Smrg      ;;
4912ab47cfaaSmrg
49136aec45a7Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
49146aec45a7Smrg      case `$LD -v 2>&1` in
49156aec45a7Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
49166aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
49176aec45a7Smrg	cat <<_LT_EOF 1>&2
4918ab47cfaaSmrg
49196aec45a7Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
49206aec45a7Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
49216aec45a7Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
49226aec45a7Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
49236aec45a7Smrg*** your PATH or compiler configuration so that the native linker is
49246aec45a7Smrg*** used, and then restart.
4925ab47cfaaSmrg
49266aec45a7Smrg_LT_EOF
49276aec45a7Smrg	;;
49286aec45a7Smrg	*)
49296aec45a7Smrg	  # For security reasons, it is highly recommended that you always
49306aec45a7Smrg	  # use absolute paths for naming shared libraries, and exclude the
49316aec45a7Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
49326aec45a7Smrg	  # requires that you compile everything twice, which is a pain.
49336aec45a7Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
49346aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
49356aec45a7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49366aec45a7Smrg	    _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'
49376aec45a7Smrg	  else
49386aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
49396aec45a7Smrg	  fi
49406aec45a7Smrg	;;
49416aec45a7Smrg      esac
49426aec45a7Smrg      ;;
4943ab47cfaaSmrg
49446aec45a7Smrg    sunos4*)
49456aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
49466aec45a7Smrg      wlarc=
49476aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
49486aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
49496aec45a7Smrg      ;;
4950ab47cfaaSmrg
49516aec45a7Smrg    *)
49526aec45a7Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4953aa9e3350Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4954aa9e3350Smrg	_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'
49556aec45a7Smrg      else
49566aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
49576aec45a7Smrg      fi
49586aec45a7Smrg      ;;
49596aec45a7Smrg    esac
4960ab47cfaaSmrg
49616aec45a7Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
49626aec45a7Smrg      runpath_var=
49636aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
49646aec45a7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
49656aec45a7Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
49666aec45a7Smrg    fi
49676aec45a7Smrg  else
49686aec45a7Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
49696aec45a7Smrg    case $host_os in
49706aec45a7Smrg    aix3*)
49716aec45a7Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
49726aec45a7Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
49736aec45a7Smrg      _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'
49746aec45a7Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
49756aec45a7Smrg      # are no directories specified by -L.
49766aec45a7Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
49776aec45a7Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
49786aec45a7Smrg	# Neither direct hardcoding nor static linking is supported with a
49796aec45a7Smrg	# broken collect2.
49806aec45a7Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
49816aec45a7Smrg      fi
49826aec45a7Smrg      ;;
4983ab47cfaaSmrg
49846aec45a7Smrg    aix[[4-9]]*)
49856aec45a7Smrg      if test "$host_cpu" = ia64; then
49866aec45a7Smrg	# On IA64, the linker does run time linking by default, so we don't
49876aec45a7Smrg	# have to do anything special.
49886aec45a7Smrg	aix_use_runtimelinking=no
49896aec45a7Smrg	exp_sym_flag='-Bexport'
49906aec45a7Smrg	no_entry_flag=""
49916aec45a7Smrg      else
49926aec45a7Smrg	# If we're using GNU nm, then we don't want the "-C" option.
49936aec45a7Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
49946aec45a7Smrg	# Also, AIX nm treats weak defined symbols like other global
49956aec45a7Smrg	# defined symbols, whereas GNU nm marks them as "W".
49966aec45a7Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
49976aec45a7Smrg	  _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'
49986aec45a7Smrg	else
49996aec45a7Smrg	  _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'
50006aec45a7Smrg	fi
50016aec45a7Smrg	aix_use_runtimelinking=no
5002ab47cfaaSmrg
50036aec45a7Smrg	# Test if we are trying to use run time linking or normal
50046aec45a7Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
50056aec45a7Smrg	# need to do runtime linking.
50066aec45a7Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
50076aec45a7Smrg	  for ld_flag in $LDFLAGS; do
50086aec45a7Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
50096aec45a7Smrg	    aix_use_runtimelinking=yes
50106aec45a7Smrg	    break
50116aec45a7Smrg	  fi
50126aec45a7Smrg	  done
50136aec45a7Smrg	  ;;
50146aec45a7Smrg	esac
5015ab47cfaaSmrg
50166aec45a7Smrg	exp_sym_flag='-bexport'
50176aec45a7Smrg	no_entry_flag='-bnoentry'
50186aec45a7Smrg      fi
5019ab47cfaaSmrg
50206aec45a7Smrg      # When large executables or shared objects are built, AIX ld can
50216aec45a7Smrg      # have problems creating the table of contents.  If linking a library
50226aec45a7Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
50236aec45a7Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
50246aec45a7Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5025ab47cfaaSmrg
50266aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)=''
50276aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
50286aec45a7Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
50296aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
50306aec45a7Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
50316aec45a7Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5032ab47cfaaSmrg
50336aec45a7Smrg      if test "$GCC" = yes; then
50346aec45a7Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
50356aec45a7Smrg	# We only want to do this on AIX 4.2 and lower, the check
50366aec45a7Smrg	# below for broken collect2 doesn't work under 4.3+
50376aec45a7Smrg	  collect2name=`${CC} -print-prog-name=collect2`
50386aec45a7Smrg	  if test -f "$collect2name" &&
50396aec45a7Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
50406aec45a7Smrg	  then
50416aec45a7Smrg	  # We have reworked collect2
50426aec45a7Smrg	  :
50436aec45a7Smrg	  else
50446aec45a7Smrg	  # We have old collect2
50456aec45a7Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
50466aec45a7Smrg	  # It fails to find uninstalled libraries when the uninstalled
50476aec45a7Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
50486aec45a7Smrg	  # to unsupported forces relinking
50496aec45a7Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
50506aec45a7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
50516aec45a7Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
50526aec45a7Smrg	  fi
50536aec45a7Smrg	  ;;
50546aec45a7Smrg	esac
50556aec45a7Smrg	shared_flag='-shared'
50566aec45a7Smrg	if test "$aix_use_runtimelinking" = yes; then
50576aec45a7Smrg	  shared_flag="$shared_flag "'${wl}-G'
50586aec45a7Smrg	fi
50596aec45a7Smrg      else
50606aec45a7Smrg	# not using gcc
50616aec45a7Smrg	if test "$host_cpu" = ia64; then
50626aec45a7Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
50636aec45a7Smrg	# chokes on -Wl,-G. The following line is correct:
50646aec45a7Smrg	  shared_flag='-G'
50656aec45a7Smrg	else
50666aec45a7Smrg	  if test "$aix_use_runtimelinking" = yes; then
50676aec45a7Smrg	    shared_flag='${wl}-G'
50686aec45a7Smrg	  else
50696aec45a7Smrg	    shared_flag='${wl}-bM:SRE'
50706aec45a7Smrg	  fi
50716aec45a7Smrg	fi
50726aec45a7Smrg      fi
5073ab47cfaaSmrg
50746aec45a7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
50756aec45a7Smrg      # It seems that -bexpall does not export symbols beginning with
50766aec45a7Smrg      # underscore (_), so it is better to generate a list of symbols to export.
50776aec45a7Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
50786aec45a7Smrg      if test "$aix_use_runtimelinking" = yes; then
50796aec45a7Smrg	# Warning - without using the other runtime loading flags (-brtl),
50806aec45a7Smrg	# -berok will link without error, but may produce a broken library.
50816aec45a7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
50826aec45a7Smrg        # Determine the default libpath from the value encoded in an
50836aec45a7Smrg        # empty executable.
5084aa9e3350Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
50856aec45a7Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
50866aec45a7Smrg        _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"
50876aec45a7Smrg      else
50886aec45a7Smrg	if test "$host_cpu" = ia64; then
50896aec45a7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
50906aec45a7Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
50916aec45a7Smrg	  _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"
50926aec45a7Smrg	else
50936aec45a7Smrg	 # Determine the default libpath from the value encoded in an
50946aec45a7Smrg	 # empty executable.
5095aa9e3350Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
50966aec45a7Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
50976aec45a7Smrg	  # Warning - without using the other run time loading flags,
50986aec45a7Smrg	  # -berok will link without error, but may produce a broken library.
50996aec45a7Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
51006aec45a7Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
51016aec45a7Smrg	  if test "$with_gnu_ld" = yes; then
51026aec45a7Smrg	    # We only use this code for GNU lds that support --whole-archive.
51036aec45a7Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
51046aec45a7Smrg	  else
51056aec45a7Smrg	    # Exported symbols can be pulled into shared objects from archives
51066aec45a7Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
51076aec45a7Smrg	  fi
51086aec45a7Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
51096aec45a7Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
51106aec45a7Smrg	  _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'
51116aec45a7Smrg	fi
51126aec45a7Smrg      fi
51136aec45a7Smrg      ;;
5114ab47cfaaSmrg
51156aec45a7Smrg    amigaos*)
51166aec45a7Smrg      case $host_cpu in
51176aec45a7Smrg      powerpc)
51186aec45a7Smrg            # see comment about AmigaOS4 .so support
51196aec45a7Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
51206aec45a7Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
51216aec45a7Smrg        ;;
51226aec45a7Smrg      m68k)
51236aec45a7Smrg            _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)'
51246aec45a7Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
51256aec45a7Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
51266aec45a7Smrg        ;;
51276aec45a7Smrg      esac
51286aec45a7Smrg      ;;
5129ab47cfaaSmrg
51306aec45a7Smrg    bsdi[[45]]*)
51316aec45a7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
51326aec45a7Smrg      ;;
5133ab47cfaaSmrg
51346aec45a7Smrg    cygwin* | mingw* | pw32* | cegcc*)
51356aec45a7Smrg      # When not using gcc, we currently assume that we are using
51366aec45a7Smrg      # Microsoft Visual C++.
51376aec45a7Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
51386aec45a7Smrg      # no search path for DLLs.
5139aa9e3350Smrg      case $cc_basename in
5140aa9e3350Smrg      cl*)
5141aa9e3350Smrg	# Native MSVC
5142aa9e3350Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5143aa9e3350Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5144aa9e3350Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
5145aa9e3350Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
5146aa9e3350Smrg	# Tell ltmain to make .lib files, not .a files.
5147aa9e3350Smrg	libext=lib
5148aa9e3350Smrg	# Tell ltmain to make .dll files, not .so files.
5149aa9e3350Smrg	shrext_cmds=".dll"
5150aa9e3350Smrg	# FIXME: Setting linknames here is a bad hack.
5151aa9e3350Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
5152aa9e3350Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5153aa9e3350Smrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
5154aa9e3350Smrg	  else
5155aa9e3350Smrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
5156aa9e3350Smrg	  fi~
5157aa9e3350Smrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5158aa9e3350Smrg	  linknames='
5159aa9e3350Smrg	# The linker will not automatically build a static lib if we build a DLL.
5160aa9e3350Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5161aa9e3350Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5162aa9e3350Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5163aa9e3350Smrg	_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'
5164aa9e3350Smrg	# Don't use ranlib
5165aa9e3350Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5166aa9e3350Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5167aa9e3350Smrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
5168aa9e3350Smrg	  case $lt_outputfile in
5169aa9e3350Smrg	    *.exe|*.EXE) ;;
5170aa9e3350Smrg	    *)
5171aa9e3350Smrg	      lt_outputfile="$lt_outputfile.exe"
5172aa9e3350Smrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
5173aa9e3350Smrg	      ;;
5174aa9e3350Smrg	  esac~
5175aa9e3350Smrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
5176aa9e3350Smrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5177aa9e3350Smrg	    $RM "$lt_outputfile.manifest";
5178aa9e3350Smrg	  fi'
5179aa9e3350Smrg	;;
5180aa9e3350Smrg      *)
5181aa9e3350Smrg	# Assume MSVC wrapper
5182aa9e3350Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5183aa9e3350Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5184aa9e3350Smrg	# Tell ltmain to make .lib files, not .a files.
5185aa9e3350Smrg	libext=lib
5186aa9e3350Smrg	# Tell ltmain to make .dll files, not .so files.
5187aa9e3350Smrg	shrext_cmds=".dll"
5188aa9e3350Smrg	# FIXME: Setting linknames here is a bad hack.
5189aa9e3350Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5190aa9e3350Smrg	# The linker will automatically build a .lib file if we build a DLL.
5191aa9e3350Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5192aa9e3350Smrg	# FIXME: Should let the user specify the lib program.
5193aa9e3350Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5194aa9e3350Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5195aa9e3350Smrg	;;
5196aa9e3350Smrg      esac
51976aec45a7Smrg      ;;
5198ab47cfaaSmrg
51996aec45a7Smrg    darwin* | rhapsody*)
52006aec45a7Smrg      _LT_DARWIN_LINKER_FEATURES($1)
52016aec45a7Smrg      ;;
5202ab47cfaaSmrg
52036aec45a7Smrg    dgux*)
52046aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
52056aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
52066aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52076aec45a7Smrg      ;;
5208ab47cfaaSmrg
52096aec45a7Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
52106aec45a7Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
52116aec45a7Smrg    # does not break anything, and helps significantly (at the cost of a little
52126aec45a7Smrg    # extra space).
52136aec45a7Smrg    freebsd2.2*)
52146aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
52156aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
52166aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52176aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52181473d951Smrg      ;;
52196aec45a7Smrg
52206aec45a7Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5221aa9e3350Smrg    freebsd2.*)
52226aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
52236aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52246aec45a7Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
52256aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5226ab47cfaaSmrg      ;;
52271473d951Smrg
52286aec45a7Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
52296aec45a7Smrg    freebsd* | dragonfly*)
5230aa9e3350Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
52316aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
52326aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52336aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52346aec45a7Smrg      ;;
5235ab47cfaaSmrg
52366aec45a7Smrg    hpux9*)
52376aec45a7Smrg      if test "$GCC" = yes; then
5238aa9e3350Smrg	_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'
52396aec45a7Smrg      else
52406aec45a7Smrg	_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'
52416aec45a7Smrg      fi
52426aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
52436aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
52446aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5245ab47cfaaSmrg
52466aec45a7Smrg      # hardcode_minus_L: Not really in the search PATH,
52476aec45a7Smrg      # but as the default location of the library.
52486aec45a7Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
52496aec45a7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
52506aec45a7Smrg      ;;
5251ab47cfaaSmrg
52526aec45a7Smrg    hpux10*)
52536aec45a7Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5254aa9e3350Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
52556aec45a7Smrg      else
52566aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
52576aec45a7Smrg      fi
52586aec45a7Smrg      if test "$with_gnu_ld" = no; then
52596aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
52606aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
52616aec45a7Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
52626aec45a7Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
52636aec45a7Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
52646aec45a7Smrg	# hardcode_minus_L: Not really in the search PATH,
52656aec45a7Smrg	# but as the default location of the library.
52666aec45a7Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
52676aec45a7Smrg      fi
52686aec45a7Smrg      ;;
5269ab47cfaaSmrg
52706aec45a7Smrg    hpux11*)
52716aec45a7Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
52726aec45a7Smrg	case $host_cpu in
52736aec45a7Smrg	hppa*64*)
52746aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
52756aec45a7Smrg	  ;;
52766aec45a7Smrg	ia64*)
5277aa9e3350Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
52786aec45a7Smrg	  ;;
52796aec45a7Smrg	*)
5280aa9e3350Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
52816aec45a7Smrg	  ;;
52826aec45a7Smrg	esac
52836aec45a7Smrg      else
52846aec45a7Smrg	case $host_cpu in
52856aec45a7Smrg	hppa*64*)
52866aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
52876aec45a7Smrg	  ;;
52886aec45a7Smrg	ia64*)
52896aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
52906aec45a7Smrg	  ;;
52916aec45a7Smrg	*)
52926aec45a7Smrg	m4_if($1, [], [
52936aec45a7Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
52946aec45a7Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
52956aec45a7Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
52966aec45a7Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
52976aec45a7Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
52986aec45a7Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
52996aec45a7Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
53006aec45a7Smrg	  ;;
53016aec45a7Smrg	esac
53026aec45a7Smrg      fi
53036aec45a7Smrg      if test "$with_gnu_ld" = no; then
53046aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
53056aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5306ab47cfaaSmrg
53076aec45a7Smrg	case $host_cpu in
53086aec45a7Smrg	hppa*64*|ia64*)
53096aec45a7Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
53106aec45a7Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53116aec45a7Smrg	  ;;
53126aec45a7Smrg	*)
53136aec45a7Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
53146aec45a7Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
53156aec45a7Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5316ab47cfaaSmrg
53176aec45a7Smrg	  # hardcode_minus_L: Not really in the search PATH,
53186aec45a7Smrg	  # but as the default location of the library.
53196aec45a7Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
53206aec45a7Smrg	  ;;
53216aec45a7Smrg	esac
53226aec45a7Smrg      fi
53236aec45a7Smrg      ;;
5324ab47cfaaSmrg
53256aec45a7Smrg    irix5* | irix6* | nonstopux*)
53266aec45a7Smrg      if test "$GCC" = yes; then
5327aa9e3350Smrg	_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'
53286aec45a7Smrg	# Try to use the -exported_symbol ld option, if it does not
53296aec45a7Smrg	# work, assume that -exports_file does not work either and
53306aec45a7Smrg	# implicitly export all symbols.
5331aa9e3350Smrg	# This should be the same for all languages, so no per-tag cache variable.
5332aa9e3350Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5333aa9e3350Smrg	  [lt_cv_irix_exported_symbol],
5334aa9e3350Smrg	  [save_LDFLAGS="$LDFLAGS"
5335aa9e3350Smrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
5336aa9e3350Smrg	   AC_LINK_IFELSE(
5337aa9e3350Smrg	     [AC_LANG_SOURCE(
5338aa9e3350Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5339aa9e3350Smrg			      [C++], [[int foo (void) { return 0; }]],
5340aa9e3350Smrg			      [Fortran 77], [[
5341aa9e3350Smrg      subroutine foo
5342aa9e3350Smrg      end]],
5343aa9e3350Smrg			      [Fortran], [[
5344aa9e3350Smrg      subroutine foo
5345aa9e3350Smrg      end]])])],
5346aa9e3350Smrg	      [lt_cv_irix_exported_symbol=yes],
5347aa9e3350Smrg	      [lt_cv_irix_exported_symbol=no])
5348aa9e3350Smrg           LDFLAGS="$save_LDFLAGS"])
5349aa9e3350Smrg	if test "$lt_cv_irix_exported_symbol" = yes; then
5350aa9e3350Smrg          _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'
5351aa9e3350Smrg	fi
53526aec45a7Smrg      else
53536aec45a7Smrg	_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'
53546aec45a7Smrg	_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'
53556aec45a7Smrg      fi
53566aec45a7Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
53576aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
53586aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
53596aec45a7Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
53606aec45a7Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
53616aec45a7Smrg      ;;
5362ab47cfaaSmrg
53636aec45a7Smrg    netbsd*)
53646aec45a7Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
53656aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
53666aec45a7Smrg      else
53676aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
53686aec45a7Smrg      fi
53696aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
53706aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
53716aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53726aec45a7Smrg      ;;
5373ab47cfaaSmrg
53746aec45a7Smrg    newsos6)
53756aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
53766aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
53776aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
53786aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
53796aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53806aec45a7Smrg      ;;
5381ab47cfaaSmrg
53826aec45a7Smrg    *nto* | *qnx*)
53836aec45a7Smrg      ;;
5384ab47cfaaSmrg
53856aec45a7Smrg    openbsd*)
53866aec45a7Smrg      if test -f /usr/libexec/ld.so; then
53876aec45a7Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
53886aec45a7Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53896aec45a7Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
53906aec45a7Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
53916aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
53926aec45a7Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
53936aec45a7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
53946aec45a7Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
53956aec45a7Smrg	else
53966aec45a7Smrg	  case $host_os in
53976aec45a7Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
53986aec45a7Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
53996aec45a7Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
54006aec45a7Smrg	     ;;
54016aec45a7Smrg	   *)
54026aec45a7Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
54036aec45a7Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
54046aec45a7Smrg	     ;;
54056aec45a7Smrg	  esac
54066aec45a7Smrg	fi
54076aec45a7Smrg      else
54086aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
54096aec45a7Smrg      fi
54106aec45a7Smrg      ;;
5411ab47cfaaSmrg
54126aec45a7Smrg    os2*)
54136aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
54146aec45a7Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
54156aec45a7Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
54166aec45a7Smrg      _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'
54176aec45a7Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
54186aec45a7Smrg      ;;
5419ab47cfaaSmrg
54206aec45a7Smrg    osf3*)
54216aec45a7Smrg      if test "$GCC" = yes; then
54226aec45a7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
54236aec45a7Smrg	_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'
54246aec45a7Smrg      else
54256aec45a7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
54266aec45a7Smrg	_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'
54276aec45a7Smrg      fi
54286aec45a7Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
54296aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
54306aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
54316aec45a7Smrg      ;;
5432ab47cfaaSmrg
54336aec45a7Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
54346aec45a7Smrg      if test "$GCC" = yes; then
54356aec45a7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5436aa9e3350Smrg	_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'
54376aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
54386aec45a7Smrg      else
54396aec45a7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
54406aec45a7Smrg	_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'
54416aec45a7Smrg	_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~
54426aec45a7Smrg	$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'
5443ab47cfaaSmrg
54446aec45a7Smrg	# Both c and cxx compiler support -rpath directly
54456aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
54466aec45a7Smrg      fi
54476aec45a7Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
54486aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
54496aec45a7Smrg      ;;
5450ab47cfaaSmrg
54516aec45a7Smrg    solaris*)
54526aec45a7Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
54536aec45a7Smrg      if test "$GCC" = yes; then
54546aec45a7Smrg	wlarc='${wl}'
5455aa9e3350Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
54566aec45a7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5457aa9e3350Smrg	  $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'
54586aec45a7Smrg      else
54596aec45a7Smrg	case `$CC -V 2>&1` in
54606aec45a7Smrg	*"Compilers 5.0"*)
54616aec45a7Smrg	  wlarc=''
54626aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
54636aec45a7Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
54646aec45a7Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
54656aec45a7Smrg	  ;;
54666aec45a7Smrg	*)
54676aec45a7Smrg	  wlarc='${wl}'
54686aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
54696aec45a7Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
54706aec45a7Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
54716aec45a7Smrg	  ;;
54726aec45a7Smrg	esac
54736aec45a7Smrg      fi
54746aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
54756aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
54766aec45a7Smrg      case $host_os in
54776aec45a7Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
54786aec45a7Smrg      *)
54796aec45a7Smrg	# The compiler driver will combine and reorder linker options,
54806aec45a7Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
54816aec45a7Smrg	# but is careful enough not to reorder.
54826aec45a7Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
54836aec45a7Smrg	if test "$GCC" = yes; then
54846aec45a7Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
54856aec45a7Smrg	else
54866aec45a7Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
54876aec45a7Smrg	fi
54886aec45a7Smrg	;;
54896aec45a7Smrg      esac
54906aec45a7Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
54916aec45a7Smrg      ;;
5492ab47cfaaSmrg
54936aec45a7Smrg    sunos4*)
54946aec45a7Smrg      if test "x$host_vendor" = xsequent; then
54956aec45a7Smrg	# Use $CC to link under sequent, because it throws in some extra .o
54966aec45a7Smrg	# files that make .init and .fini sections work.
54976aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
54986aec45a7Smrg      else
54996aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
55006aec45a7Smrg      fi
55016aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
55026aec45a7Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
55036aec45a7Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
55046aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55056aec45a7Smrg      ;;
5506ab47cfaaSmrg
55076aec45a7Smrg    sysv4)
55086aec45a7Smrg      case $host_vendor in
55096aec45a7Smrg	sni)
55106aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55116aec45a7Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
55126aec45a7Smrg	;;
55136aec45a7Smrg	siemens)
55146aec45a7Smrg	  ## LD is ld it makes a PLAMLIB
55156aec45a7Smrg	  ## CC just makes a GrossModule.
55166aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
55176aec45a7Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
55186aec45a7Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
55196aec45a7Smrg        ;;
55206aec45a7Smrg	motorola)
55216aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55226aec45a7Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
55236aec45a7Smrg	;;
55246aec45a7Smrg      esac
55256aec45a7Smrg      runpath_var='LD_RUN_PATH'
55266aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55276aec45a7Smrg      ;;
5528ab47cfaaSmrg
55296aec45a7Smrg    sysv4.3*)
55306aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55316aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55326aec45a7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
55336aec45a7Smrg      ;;
5534ab47cfaaSmrg
55356aec45a7Smrg    sysv4*MP*)
55366aec45a7Smrg      if test -d /usr/nec; then
55376aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55386aec45a7Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55396aec45a7Smrg	runpath_var=LD_RUN_PATH
55406aec45a7Smrg	hardcode_runpath_var=yes
55416aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
55426aec45a7Smrg      fi
55436aec45a7Smrg      ;;
5544ab47cfaaSmrg
55456aec45a7Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
55466aec45a7Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
55476aec45a7Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
55486aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55496aec45a7Smrg      runpath_var='LD_RUN_PATH'
5550ab47cfaaSmrg
55516aec45a7Smrg      if test "$GCC" = yes; then
55526aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55536aec45a7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55546aec45a7Smrg      else
55556aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55566aec45a7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55576aec45a7Smrg      fi
55586aec45a7Smrg      ;;
5559ab47cfaaSmrg
55606aec45a7Smrg    sysv5* | sco3.2v5* | sco5v6*)
55616aec45a7Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
55626aec45a7Smrg      # link with -lc, and that would cause any symbols used from libc to
55636aec45a7Smrg      # always be unresolved, which means just about no library would
55646aec45a7Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
55656aec45a7Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
55666aec45a7Smrg      # as -z defs.
55676aec45a7Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
55686aec45a7Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
55696aec45a7Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
55706aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55716aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
55726aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
55736aec45a7Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
55746aec45a7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
55756aec45a7Smrg      runpath_var='LD_RUN_PATH'
5576ab47cfaaSmrg
55776aec45a7Smrg      if test "$GCC" = yes; then
55786aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55796aec45a7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55806aec45a7Smrg      else
55816aec45a7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55826aec45a7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55836aec45a7Smrg      fi
55846aec45a7Smrg      ;;
5585ab47cfaaSmrg
55866aec45a7Smrg    uts4*)
55876aec45a7Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55886aec45a7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
55896aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55906aec45a7Smrg      ;;
5591ab47cfaaSmrg
55926aec45a7Smrg    *)
55936aec45a7Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
55946aec45a7Smrg      ;;
55956aec45a7Smrg    esac
5596ab47cfaaSmrg
55976aec45a7Smrg    if test x$host_vendor = xsni; then
55986aec45a7Smrg      case $host in
55996aec45a7Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
56006aec45a7Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
56016aec45a7Smrg	;;
56026aec45a7Smrg      esac
56036aec45a7Smrg    fi
56046aec45a7Smrg  fi
56056aec45a7Smrg])
56066aec45a7SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
56076aec45a7Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5608ab47cfaaSmrg
56096aec45a7Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5610ab47cfaaSmrg
56116aec45a7Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
56126aec45a7Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
56136aec45a7Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
56146aec45a7Smrg    [The commands to extract the exported symbol list from a shared archive])
5615ab47cfaaSmrg
56166aec45a7Smrg#
56176aec45a7Smrg# Do we need to explicitly link libc?
56186aec45a7Smrg#
56196aec45a7Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
56206aec45a7Smrgx|xyes)
56216aec45a7Smrg  # Assume -lc should be added
56226aec45a7Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5623ab47cfaaSmrg
56246aec45a7Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
56256aec45a7Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
56266aec45a7Smrg    *'~'*)
56276aec45a7Smrg      # FIXME: we may have to deal with multi-command sequences.
56286aec45a7Smrg      ;;
56296aec45a7Smrg    '$CC '*)
56306aec45a7Smrg      # Test whether the compiler implicitly links with -lc since on some
56316aec45a7Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
56326aec45a7Smrg      # to ld, don't add -lc before -lgcc.
56336aec45a7Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
56346aec45a7Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
56356aec45a7Smrg	[$RM conftest*
56366aec45a7Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
56376aec45a7Smrg
56386aec45a7Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
56396aec45a7Smrg	  soname=conftest
56406aec45a7Smrg	  lib=conftest
56416aec45a7Smrg	  libobjs=conftest.$ac_objext
56426aec45a7Smrg	  deplibs=
56436aec45a7Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
56446aec45a7Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
56456aec45a7Smrg	  compiler_flags=-v
56466aec45a7Smrg	  linker_flags=-v
56476aec45a7Smrg	  verstring=
56486aec45a7Smrg	  output_objdir=.
56496aec45a7Smrg	  libname=conftest
56506aec45a7Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
56516aec45a7Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
56526aec45a7Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
56536aec45a7Smrg	  then
56546aec45a7Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
56556aec45a7Smrg	  else
56566aec45a7Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
56576aec45a7Smrg	  fi
56586aec45a7Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
56596aec45a7Smrg	else
56606aec45a7Smrg	  cat conftest.err 1>&5
56616aec45a7Smrg	fi
56626aec45a7Smrg	$RM conftest*
56636aec45a7Smrg	])
56646aec45a7Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
56656aec45a7Smrg      ;;
56666aec45a7Smrg    esac
56676aec45a7Smrg  fi
56686aec45a7Smrg  ;;
56696aec45a7Smrgesac
5670ab47cfaaSmrg
56716aec45a7Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
56726aec45a7Smrg    [Whether or not to add -lc for building shared libraries])
56736aec45a7Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
56746aec45a7Smrg    [enable_shared_with_static_runtimes], [0],
56756aec45a7Smrg    [Whether or not to disallow shared libs when runtime libs are static])
56766aec45a7Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
56776aec45a7Smrg    [Compiler flag to allow reflexive dlopens])
56786aec45a7Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
56796aec45a7Smrg    [Compiler flag to generate shared objects directly from archives])
56806aec45a7Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
56816aec45a7Smrg    [Whether the compiler copes with passing no objects directly])
56826aec45a7Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
56836aec45a7Smrg    [Create an old-style archive from a shared archive])
56846aec45a7Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
56856aec45a7Smrg    [Create a temporary old-style archive to link instead of a shared archive])
56866aec45a7Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
56876aec45a7Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
56886aec45a7Smrg_LT_TAGDECL([], [module_cmds], [2],
56896aec45a7Smrg    [Commands used to build a loadable module if different from building
56906aec45a7Smrg    a shared archive.])
56916aec45a7Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
56926aec45a7Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
56936aec45a7Smrg    [Whether we are building with GNU ld or not])
56946aec45a7Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
56956aec45a7Smrg    [Flag that allows shared libraries with undefined symbols to be built])
56966aec45a7Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
56976aec45a7Smrg    [Flag that enforces no undefined symbols])
56986aec45a7Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
56996aec45a7Smrg    [Flag to hardcode $libdir into a binary during linking.
57006aec45a7Smrg    This must work even if $libdir does not exist])
57016aec45a7Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
57026aec45a7Smrg    [Whether we need a single "-rpath" flag with a separated argument])
57036aec45a7Smrg_LT_TAGDECL([], [hardcode_direct], [0],
57046aec45a7Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
57056aec45a7Smrg    DIR into the resulting binary])
57066aec45a7Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
57076aec45a7Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
57086aec45a7Smrg    DIR into the resulting binary and the resulting library dependency is
57096aec45a7Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
57106aec45a7Smrg    library is relocated])
57116aec45a7Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
57126aec45a7Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
57136aec45a7Smrg    into the resulting binary])
57146aec45a7Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
57156aec45a7Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
57166aec45a7Smrg    into the resulting binary])
57176aec45a7Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
57186aec45a7Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
57196aec45a7Smrg    into the library and all subsequent libraries and executables linked
57206aec45a7Smrg    against it])
57216aec45a7Smrg_LT_TAGDECL([], [inherit_rpath], [0],
57226aec45a7Smrg    [Set to yes if linker adds runtime paths of dependent libraries
57236aec45a7Smrg    to runtime path list])
57246aec45a7Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
57256aec45a7Smrg    [Whether libtool must link a program against all its dependency libraries])
57266aec45a7Smrg_LT_TAGDECL([], [always_export_symbols], [0],
57276aec45a7Smrg    [Set to "yes" if exported symbols are required])
57286aec45a7Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
57296aec45a7Smrg    [The commands to list exported symbols])
57306aec45a7Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
57316aec45a7Smrg    [Symbols that should not be listed in the preloaded symbols])
57326aec45a7Smrg_LT_TAGDECL([], [include_expsyms], [1],
57336aec45a7Smrg    [Symbols that must always be exported])
57346aec45a7Smrg_LT_TAGDECL([], [prelink_cmds], [2],
57356aec45a7Smrg    [Commands necessary for linking programs (against libraries) with templates])
5736aa9e3350Smrg_LT_TAGDECL([], [postlink_cmds], [2],
5737aa9e3350Smrg    [Commands necessary for finishing linking programs])
57386aec45a7Smrg_LT_TAGDECL([], [file_list_spec], [1],
57396aec45a7Smrg    [Specify filename containing input files])
57406aec45a7Smrgdnl FIXME: Not yet implemented
57416aec45a7Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
57426aec45a7Smrgdnl    [Compiler flag to generate thread safe objects])
57436aec45a7Smrg])# _LT_LINKER_SHLIBS
57446aec45a7Smrg
57456aec45a7Smrg
57466aec45a7Smrg# _LT_LANG_C_CONFIG([TAG])
57476aec45a7Smrg# ------------------------
57486aec45a7Smrg# Ensure that the configuration variables for a C compiler are suitably
57496aec45a7Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
57506aec45a7Smrg# the compiler configuration to `libtool'.
57516aec45a7Smrgm4_defun([_LT_LANG_C_CONFIG],
57526aec45a7Smrg[m4_require([_LT_DECL_EGREP])dnl
57536aec45a7Smrglt_save_CC="$CC"
57546aec45a7SmrgAC_LANG_PUSH(C)
5755ab47cfaaSmrg
57566aec45a7Smrg# Source file extension for C test sources.
57576aec45a7Smrgac_ext=c
5758ab47cfaaSmrg
57596aec45a7Smrg# Object file extension for compiled C test sources.
57606aec45a7Smrgobjext=o
57616aec45a7Smrg_LT_TAGVAR(objext, $1)=$objext
5762ab47cfaaSmrg
57636aec45a7Smrg# Code to be used in simple compile tests
57646aec45a7Smrglt_simple_compile_test_code="int some_variable = 0;"
5765ab47cfaaSmrg
57666aec45a7Smrg# Code to be used in simple link tests
57676aec45a7Smrglt_simple_link_test_code='int main(){return(0);}'
5768ab47cfaaSmrg
57696aec45a7Smrg_LT_TAG_COMPILER
57706aec45a7Smrg# Save the default compiler, since it gets overwritten when the other
57716aec45a7Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
57726aec45a7Smrgcompiler_DEFAULT=$CC
5773ab47cfaaSmrg
57746aec45a7Smrg# save warnings/boilerplate of simple test code
57756aec45a7Smrg_LT_COMPILER_BOILERPLATE
57766aec45a7Smrg_LT_LINKER_BOILERPLATE
5777ab47cfaaSmrg
57786aec45a7Smrgif test -n "$compiler"; then
57796aec45a7Smrg  _LT_COMPILER_NO_RTTI($1)
57806aec45a7Smrg  _LT_COMPILER_PIC($1)
57816aec45a7Smrg  _LT_COMPILER_C_O($1)
57826aec45a7Smrg  _LT_COMPILER_FILE_LOCKS($1)
57836aec45a7Smrg  _LT_LINKER_SHLIBS($1)
57846aec45a7Smrg  _LT_SYS_DYNAMIC_LINKER($1)
57856aec45a7Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
57866aec45a7Smrg  LT_SYS_DLOPEN_SELF
57876aec45a7Smrg  _LT_CMD_STRIPLIB
57886aec45a7Smrg
57896aec45a7Smrg  # Report which library types will actually be built
57906aec45a7Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
57916aec45a7Smrg  AC_MSG_RESULT([$can_build_shared])
57926aec45a7Smrg
57936aec45a7Smrg  AC_MSG_CHECKING([whether to build shared libraries])
57946aec45a7Smrg  test "$can_build_shared" = "no" && enable_shared=no
57956aec45a7Smrg
57966aec45a7Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
57976aec45a7Smrg  # are all built from PIC.
57986aec45a7Smrg  case $host_os in
57996aec45a7Smrg  aix3*)
58006aec45a7Smrg    test "$enable_shared" = yes && enable_static=no
58016aec45a7Smrg    if test -n "$RANLIB"; then
58026aec45a7Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
58036aec45a7Smrg      postinstall_cmds='$RANLIB $lib'
58046aec45a7Smrg    fi
58056aec45a7Smrg    ;;
5806ab47cfaaSmrg
58076aec45a7Smrg  aix[[4-9]]*)
58086aec45a7Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
58096aec45a7Smrg      test "$enable_shared" = yes && enable_static=no
58106aec45a7Smrg    fi
58116aec45a7Smrg    ;;
58126aec45a7Smrg  esac
58136aec45a7Smrg  AC_MSG_RESULT([$enable_shared])
5814ab47cfaaSmrg
58156aec45a7Smrg  AC_MSG_CHECKING([whether to build static libraries])
58166aec45a7Smrg  # Make sure either enable_shared or enable_static is yes.
58176aec45a7Smrg  test "$enable_shared" = yes || enable_static=yes
58186aec45a7Smrg  AC_MSG_RESULT([$enable_static])
5819ab47cfaaSmrg
58206aec45a7Smrg  _LT_CONFIG($1)
58216aec45a7Smrgfi
58226aec45a7SmrgAC_LANG_POP
58236aec45a7SmrgCC="$lt_save_CC"
58246aec45a7Smrg])# _LT_LANG_C_CONFIG
5825ab47cfaaSmrg
5826ab47cfaaSmrg
58276aec45a7Smrg# _LT_LANG_CXX_CONFIG([TAG])
58286aec45a7Smrg# --------------------------
58296aec45a7Smrg# Ensure that the configuration variables for a C++ compiler are suitably
58306aec45a7Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
58316aec45a7Smrg# the compiler configuration to `libtool'.
58326aec45a7Smrgm4_defun([_LT_LANG_CXX_CONFIG],
58336aec45a7Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
58346aec45a7Smrgm4_require([_LT_DECL_EGREP])dnl
5835aa9e3350Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
58366aec45a7Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
58376aec45a7Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
58386aec45a7Smrg    (test "X$CXX" != "Xg++"))) ; then
58396aec45a7Smrg  AC_PROG_CXXCPP
58406aec45a7Smrgelse
58416aec45a7Smrg  _lt_caught_CXX_error=yes
58426aec45a7Smrgfi
5843ab47cfaaSmrg
58446aec45a7SmrgAC_LANG_PUSH(C++)
58456aec45a7Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
58466aec45a7Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
58476aec45a7Smrg_LT_TAGVAR(always_export_symbols, $1)=no
58486aec45a7Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
58496aec45a7Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
58506aec45a7Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
58516aec45a7Smrg_LT_TAGVAR(hardcode_direct, $1)=no
58526aec45a7Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
58536aec45a7Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
58546aec45a7Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
58556aec45a7Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
58566aec45a7Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
58576aec45a7Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
58586aec45a7Smrg_LT_TAGVAR(inherit_rpath, $1)=no
58596aec45a7Smrg_LT_TAGVAR(module_cmds, $1)=
58606aec45a7Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
58616aec45a7Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
58626aec45a7Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
58636aec45a7Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
58646aec45a7Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
58656aec45a7Smrg_LT_TAGVAR(no_undefined_flag, $1)=
58666aec45a7Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
58676aec45a7Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5868ab47cfaaSmrg
58696aec45a7Smrg# Source file extension for C++ test sources.
58706aec45a7Smrgac_ext=cpp
5871ab47cfaaSmrg
58726aec45a7Smrg# Object file extension for compiled C++ test sources.
58736aec45a7Smrgobjext=o
58746aec45a7Smrg_LT_TAGVAR(objext, $1)=$objext
58756aec45a7Smrg
58766aec45a7Smrg# No sense in running all these tests if we already determined that
58776aec45a7Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
58786aec45a7Smrg# are currently assumed to apply to all compilers on this platform,
58796aec45a7Smrg# and will be corrupted by setting them based on a non-working compiler.
58806aec45a7Smrgif test "$_lt_caught_CXX_error" != yes; then
58816aec45a7Smrg  # Code to be used in simple compile tests
58826aec45a7Smrg  lt_simple_compile_test_code="int some_variable = 0;"
58836aec45a7Smrg
58846aec45a7Smrg  # Code to be used in simple link tests
58856aec45a7Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
58866aec45a7Smrg
58876aec45a7Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
58886aec45a7Smrg  _LT_TAG_COMPILER
58896aec45a7Smrg
58906aec45a7Smrg  # save warnings/boilerplate of simple test code
58916aec45a7Smrg  _LT_COMPILER_BOILERPLATE
58926aec45a7Smrg  _LT_LINKER_BOILERPLATE
58936aec45a7Smrg
58946aec45a7Smrg  # Allow CC to be a program name with arguments.
58956aec45a7Smrg  lt_save_CC=$CC
5896aa9e3350Smrg  lt_save_CFLAGS=$CFLAGS
58976aec45a7Smrg  lt_save_LD=$LD
58986aec45a7Smrg  lt_save_GCC=$GCC
58996aec45a7Smrg  GCC=$GXX
59006aec45a7Smrg  lt_save_with_gnu_ld=$with_gnu_ld
59016aec45a7Smrg  lt_save_path_LD=$lt_cv_path_LD
59026aec45a7Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
59036aec45a7Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
59046aec45a7Smrg  else
59056aec45a7Smrg    $as_unset lt_cv_prog_gnu_ld
59066aec45a7Smrg  fi
59076aec45a7Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
59086aec45a7Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
59096aec45a7Smrg  else
59106aec45a7Smrg    $as_unset lt_cv_path_LD
59116aec45a7Smrg  fi
59126aec45a7Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
59136aec45a7Smrg  CC=${CXX-"c++"}
5914aa9e3350Smrg  CFLAGS=$CXXFLAGS
59156aec45a7Smrg  compiler=$CC
59166aec45a7Smrg  _LT_TAGVAR(compiler, $1)=$CC
59176aec45a7Smrg  _LT_CC_BASENAME([$compiler])
5918ab47cfaaSmrg
59196aec45a7Smrg  if test -n "$compiler"; then
59206aec45a7Smrg    # We don't want -fno-exception when compiling C++ code, so set the
59216aec45a7Smrg    # no_builtin_flag separately
59226aec45a7Smrg    if test "$GXX" = yes; then
59236aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
59246aec45a7Smrg    else
59256aec45a7Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
59266aec45a7Smrg    fi
5927ab47cfaaSmrg
59286aec45a7Smrg    if test "$GXX" = yes; then
59296aec45a7Smrg      # Set up default GNU C++ configuration
5930ab47cfaaSmrg
59316aec45a7Smrg      LT_PATH_LD
5932ab47cfaaSmrg
59336aec45a7Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
59346aec45a7Smrg      # archiving commands below assume that GNU ld is being used.
59356aec45a7Smrg      if test "$with_gnu_ld" = yes; then
5936aa9e3350Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5937aa9e3350Smrg        _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'
5938ab47cfaaSmrg
59396aec45a7Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
59406aec45a7Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5941ab47cfaaSmrg
59426aec45a7Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
59436aec45a7Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
59446aec45a7Smrg        #     investigate it a little bit more. (MM)
59456aec45a7Smrg        wlarc='${wl}'
5946ab47cfaaSmrg
59476aec45a7Smrg        # ancient GNU ld didn't support --whole-archive et. al.
59486aec45a7Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
59496aec45a7Smrg	  $GREP 'no-whole-archive' > /dev/null; then
59506aec45a7Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
59516aec45a7Smrg        else
59526aec45a7Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
59536aec45a7Smrg        fi
59546aec45a7Smrg      else
59556aec45a7Smrg        with_gnu_ld=no
59566aec45a7Smrg        wlarc=
59576aec45a7Smrg
59586aec45a7Smrg        # A generic and very simple default shared library creation
59596aec45a7Smrg        # command for GNU C++ for the case where it uses the native
59606aec45a7Smrg        # linker, instead of GNU ld.  If possible, this setting should
59616aec45a7Smrg        # overridden to take advantage of the native linker features on
59626aec45a7Smrg        # the platform it is being used on.
59636aec45a7Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
59646aec45a7Smrg      fi
5965ab47cfaaSmrg
59666aec45a7Smrg      # Commands to make compiler produce verbose output that lists
59676aec45a7Smrg      # what "hidden" libraries, object files and flags are used when
59686aec45a7Smrg      # linking a shared library.
59696aec45a7Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
5970ab47cfaaSmrg
59716aec45a7Smrg    else
59726aec45a7Smrg      GXX=no
59736aec45a7Smrg      with_gnu_ld=no
59746aec45a7Smrg      wlarc=
59756aec45a7Smrg    fi
5976ab47cfaaSmrg
59776aec45a7Smrg    # PORTME: fill in a description of your system's C++ link characteristics
59786aec45a7Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
59796aec45a7Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
59806aec45a7Smrg    case $host_os in
59816aec45a7Smrg      aix3*)
59826aec45a7Smrg        # FIXME: insert proper C++ library support
59836aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
59846aec45a7Smrg        ;;
59856aec45a7Smrg      aix[[4-9]]*)
59866aec45a7Smrg        if test "$host_cpu" = ia64; then
59876aec45a7Smrg          # On IA64, the linker does run time linking by default, so we don't
59886aec45a7Smrg          # have to do anything special.
59896aec45a7Smrg          aix_use_runtimelinking=no
59906aec45a7Smrg          exp_sym_flag='-Bexport'
59916aec45a7Smrg          no_entry_flag=""
59926aec45a7Smrg        else
59936aec45a7Smrg          aix_use_runtimelinking=no
59946aec45a7Smrg
59956aec45a7Smrg          # Test if we are trying to use run time linking or normal
59966aec45a7Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
59976aec45a7Smrg          # need to do runtime linking.
59986aec45a7Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
59996aec45a7Smrg	    for ld_flag in $LDFLAGS; do
60006aec45a7Smrg	      case $ld_flag in
60016aec45a7Smrg	      *-brtl*)
60026aec45a7Smrg	        aix_use_runtimelinking=yes
60036aec45a7Smrg	        break
60046aec45a7Smrg	        ;;
60056aec45a7Smrg	      esac
60066aec45a7Smrg	    done
60076aec45a7Smrg	    ;;
60086aec45a7Smrg          esac
6009ab47cfaaSmrg
60106aec45a7Smrg          exp_sym_flag='-bexport'
60116aec45a7Smrg          no_entry_flag='-bnoentry'
60126aec45a7Smrg        fi
6013ab47cfaaSmrg
60146aec45a7Smrg        # When large executables or shared objects are built, AIX ld can
60156aec45a7Smrg        # have problems creating the table of contents.  If linking a library
60166aec45a7Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
60176aec45a7Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
60186aec45a7Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
60196aec45a7Smrg
60206aec45a7Smrg        _LT_TAGVAR(archive_cmds, $1)=''
60216aec45a7Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
60226aec45a7Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
60236aec45a7Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
60246aec45a7Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
60256aec45a7Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
60266aec45a7Smrg
60276aec45a7Smrg        if test "$GXX" = yes; then
60286aec45a7Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
60296aec45a7Smrg          # We only want to do this on AIX 4.2 and lower, the check
60306aec45a7Smrg          # below for broken collect2 doesn't work under 4.3+
60316aec45a7Smrg	  collect2name=`${CC} -print-prog-name=collect2`
60326aec45a7Smrg	  if test -f "$collect2name" &&
60336aec45a7Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
60346aec45a7Smrg	  then
60356aec45a7Smrg	    # We have reworked collect2
60366aec45a7Smrg	    :
60376aec45a7Smrg	  else
60386aec45a7Smrg	    # We have old collect2
60396aec45a7Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
60406aec45a7Smrg	    # It fails to find uninstalled libraries when the uninstalled
60416aec45a7Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
60426aec45a7Smrg	    # to unsupported forces relinking
60436aec45a7Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
60446aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
60456aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
60466aec45a7Smrg	  fi
60476aec45a7Smrg          esac
60486aec45a7Smrg          shared_flag='-shared'
60496aec45a7Smrg	  if test "$aix_use_runtimelinking" = yes; then
60506aec45a7Smrg	    shared_flag="$shared_flag "'${wl}-G'
60516aec45a7Smrg	  fi
60526aec45a7Smrg        else
60536aec45a7Smrg          # not using gcc
60546aec45a7Smrg          if test "$host_cpu" = ia64; then
60556aec45a7Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
60566aec45a7Smrg	  # chokes on -Wl,-G. The following line is correct:
60576aec45a7Smrg	  shared_flag='-G'
60586aec45a7Smrg          else
60596aec45a7Smrg	    if test "$aix_use_runtimelinking" = yes; then
60606aec45a7Smrg	      shared_flag='${wl}-G'
60616aec45a7Smrg	    else
60626aec45a7Smrg	      shared_flag='${wl}-bM:SRE'
60636aec45a7Smrg	    fi
60646aec45a7Smrg          fi
60656aec45a7Smrg        fi
6066ab47cfaaSmrg
60676aec45a7Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
60686aec45a7Smrg        # It seems that -bexpall does not export symbols beginning with
60696aec45a7Smrg        # underscore (_), so it is better to generate a list of symbols to
60706aec45a7Smrg	# export.
60716aec45a7Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
60726aec45a7Smrg        if test "$aix_use_runtimelinking" = yes; then
60736aec45a7Smrg          # Warning - without using the other runtime loading flags (-brtl),
60746aec45a7Smrg          # -berok will link without error, but may produce a broken library.
60756aec45a7Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
60766aec45a7Smrg          # Determine the default libpath from the value encoded in an empty
60776aec45a7Smrg          # executable.
6078aa9e3350Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
60796aec45a7Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
60806aec45a7Smrg
60816aec45a7Smrg          _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"
60826aec45a7Smrg        else
60836aec45a7Smrg          if test "$host_cpu" = ia64; then
60846aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
60856aec45a7Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
60866aec45a7Smrg	    _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"
60876aec45a7Smrg          else
60886aec45a7Smrg	    # Determine the default libpath from the value encoded in an
60896aec45a7Smrg	    # empty executable.
6090aa9e3350Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
60916aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
60926aec45a7Smrg	    # Warning - without using the other run time loading flags,
60936aec45a7Smrg	    # -berok will link without error, but may produce a broken library.
60946aec45a7Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
60956aec45a7Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
60966aec45a7Smrg	    if test "$with_gnu_ld" = yes; then
60976aec45a7Smrg	      # We only use this code for GNU lds that support --whole-archive.
60986aec45a7Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
60996aec45a7Smrg	    else
61006aec45a7Smrg	      # Exported symbols can be pulled into shared objects from archives
61016aec45a7Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
61026aec45a7Smrg	    fi
61036aec45a7Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
61046aec45a7Smrg	    # This is similar to how AIX traditionally builds its shared
61056aec45a7Smrg	    # libraries.
61066aec45a7Smrg	    _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'
61076aec45a7Smrg          fi
61086aec45a7Smrg        fi
61096aec45a7Smrg        ;;
6110ab47cfaaSmrg
61116aec45a7Smrg      beos*)
61126aec45a7Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
61136aec45a7Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61146aec45a7Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
61156aec45a7Smrg	  # support --undefined.  This deserves some investigation.  FIXME
61166aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
61176aec45a7Smrg	else
61186aec45a7Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
61196aec45a7Smrg	fi
61206aec45a7Smrg	;;
6121ab47cfaaSmrg
61226aec45a7Smrg      chorus*)
61236aec45a7Smrg        case $cc_basename in
61246aec45a7Smrg          *)
61256aec45a7Smrg	  # FIXME: insert proper C++ library support
61266aec45a7Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
61276aec45a7Smrg	  ;;
61286aec45a7Smrg        esac
61296aec45a7Smrg        ;;
6130ab47cfaaSmrg
61316aec45a7Smrg      cygwin* | mingw* | pw32* | cegcc*)
6132aa9e3350Smrg	case $GXX,$cc_basename in
6133aa9e3350Smrg	,cl* | no,cl*)
6134aa9e3350Smrg	  # Native MSVC
6135aa9e3350Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
6136aa9e3350Smrg	  # no search path for DLLs.
6137aa9e3350Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6138aa9e3350Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6139aa9e3350Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
6140aa9e3350Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
6141aa9e3350Smrg	  # Tell ltmain to make .lib files, not .a files.
6142aa9e3350Smrg	  libext=lib
6143aa9e3350Smrg	  # Tell ltmain to make .dll files, not .so files.
6144aa9e3350Smrg	  shrext_cmds=".dll"
6145aa9e3350Smrg	  # FIXME: Setting linknames here is a bad hack.
6146aa9e3350Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6147aa9e3350Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6148aa9e3350Smrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6149aa9e3350Smrg	    else
6150aa9e3350Smrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6151aa9e3350Smrg	    fi~
6152aa9e3350Smrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6153aa9e3350Smrg	    linknames='
6154aa9e3350Smrg	  # The linker will not automatically build a static lib if we build a DLL.
6155aa9e3350Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6156aa9e3350Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6157aa9e3350Smrg	  # Don't use ranlib
6158aa9e3350Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6159aa9e3350Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6160aa9e3350Smrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
6161aa9e3350Smrg	    case $lt_outputfile in
6162aa9e3350Smrg	      *.exe|*.EXE) ;;
6163aa9e3350Smrg	      *)
6164aa9e3350Smrg		lt_outputfile="$lt_outputfile.exe"
6165aa9e3350Smrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
6166aa9e3350Smrg		;;
6167aa9e3350Smrg	    esac~
6168aa9e3350Smrg	    func_to_tool_file "$lt_outputfile"~
6169aa9e3350Smrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6170aa9e3350Smrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6171aa9e3350Smrg	      $RM "$lt_outputfile.manifest";
6172aa9e3350Smrg	    fi'
6173aa9e3350Smrg	  ;;
6174aa9e3350Smrg	*)
6175aa9e3350Smrg	  # g++
6176aa9e3350Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6177aa9e3350Smrg	  # as there is no search path for DLLs.
6178aa9e3350Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6179aa9e3350Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
6180aa9e3350Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6181aa9e3350Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
6182aa9e3350Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6183aa9e3350Smrg
6184aa9e3350Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6185aa9e3350Smrg	    _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'
6186aa9e3350Smrg	    # If the export-symbols file already is a .def file (1st line
6187aa9e3350Smrg	    # is EXPORTS), use it as is; otherwise, prepend...
6188aa9e3350Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6189aa9e3350Smrg	      cp $export_symbols $output_objdir/$soname.def;
6190aa9e3350Smrg	    else
6191aa9e3350Smrg	      echo EXPORTS > $output_objdir/$soname.def;
6192aa9e3350Smrg	      cat $export_symbols >> $output_objdir/$soname.def;
6193aa9e3350Smrg	    fi~
6194aa9e3350Smrg	    $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'
6195aa9e3350Smrg	  else
6196aa9e3350Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6197aa9e3350Smrg	  fi
6198aa9e3350Smrg	  ;;
6199aa9e3350Smrg	esac
6200aa9e3350Smrg	;;
62016aec45a7Smrg      darwin* | rhapsody*)
62026aec45a7Smrg        _LT_DARWIN_LINKER_FEATURES($1)
62036aec45a7Smrg	;;
6204ab47cfaaSmrg
62056aec45a7Smrg      dgux*)
62066aec45a7Smrg        case $cc_basename in
62076aec45a7Smrg          ec++*)
62086aec45a7Smrg	    # FIXME: insert proper C++ library support
62096aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62106aec45a7Smrg	    ;;
62116aec45a7Smrg          ghcx*)
62126aec45a7Smrg	    # Green Hills C++ Compiler
62136aec45a7Smrg	    # FIXME: insert proper C++ library support
62146aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62156aec45a7Smrg	    ;;
62166aec45a7Smrg          *)
62176aec45a7Smrg	    # FIXME: insert proper C++ library support
62186aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62196aec45a7Smrg	    ;;
62206aec45a7Smrg        esac
62216aec45a7Smrg        ;;
6222ab47cfaaSmrg
6223aa9e3350Smrg      freebsd2.*)
62246aec45a7Smrg        # C++ shared libraries reported to be fairly broken before
62256aec45a7Smrg	# switch to ELF
62266aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
62276aec45a7Smrg        ;;
6228ab47cfaaSmrg
62296aec45a7Smrg      freebsd-elf*)
62306aec45a7Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
62316aec45a7Smrg        ;;
6232ab47cfaaSmrg
62336aec45a7Smrg      freebsd* | dragonfly*)
62346aec45a7Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
62356aec45a7Smrg        # conventions
62366aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
62376aec45a7Smrg        ;;
6238ab47cfaaSmrg
62396aec45a7Smrg      gnu*)
62406aec45a7Smrg        ;;
6241ab47cfaaSmrg
62426aec45a7Smrg      haiku*)
62436aec45a7Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
62446aec45a7Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
62456aec45a7Smrg        ;;
6246ab47cfaaSmrg
62476aec45a7Smrg      hpux9*)
62486aec45a7Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
62496aec45a7Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
62506aec45a7Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
62516aec45a7Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
62526aec45a7Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
62536aec45a7Smrg				             # but as the default
62546aec45a7Smrg				             # location of the library.
62556aec45a7Smrg
62566aec45a7Smrg        case $cc_basename in
62576aec45a7Smrg          CC*)
62586aec45a7Smrg            # FIXME: insert proper C++ library support
62596aec45a7Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
62606aec45a7Smrg            ;;
62616aec45a7Smrg          aCC*)
62626aec45a7Smrg            _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'
62636aec45a7Smrg            # Commands to make compiler produce verbose output that lists
62646aec45a7Smrg            # what "hidden" libraries, object files and flags are used when
62656aec45a7Smrg            # linking a shared library.
62666aec45a7Smrg            #
62676aec45a7Smrg            # There doesn't appear to be a way to prevent this compiler from
62686aec45a7Smrg            # explicitly linking system object files so we need to strip them
62696aec45a7Smrg            # from the output so that they don't get included in the library
62706aec45a7Smrg            # dependencies.
62716aec45a7Smrg            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"'
62726aec45a7Smrg            ;;
62736aec45a7Smrg          *)
62746aec45a7Smrg            if test "$GXX" = yes; then
6275aa9e3350Smrg              _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'
62766aec45a7Smrg            else
62776aec45a7Smrg              # FIXME: insert proper C++ library support
62786aec45a7Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
62796aec45a7Smrg            fi
62806aec45a7Smrg            ;;
62816aec45a7Smrg        esac
62826aec45a7Smrg        ;;
6283ab47cfaaSmrg
62846aec45a7Smrg      hpux10*|hpux11*)
62856aec45a7Smrg        if test $with_gnu_ld = no; then
62866aec45a7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
62876aec45a7Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
62886aec45a7Smrg
62896aec45a7Smrg          case $host_cpu in
62906aec45a7Smrg            hppa*64*|ia64*)
62916aec45a7Smrg              ;;
62926aec45a7Smrg            *)
62936aec45a7Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
62946aec45a7Smrg              ;;
62956aec45a7Smrg          esac
62966aec45a7Smrg        fi
62976aec45a7Smrg        case $host_cpu in
62986aec45a7Smrg          hppa*64*|ia64*)
62996aec45a7Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
63006aec45a7Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63016aec45a7Smrg            ;;
63026aec45a7Smrg          *)
63036aec45a7Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
63046aec45a7Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
63056aec45a7Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
63066aec45a7Smrg					         # but as the default
63076aec45a7Smrg					         # location of the library.
63086aec45a7Smrg            ;;
63096aec45a7Smrg        esac
63106aec45a7Smrg
63116aec45a7Smrg        case $cc_basename in
63126aec45a7Smrg          CC*)
63136aec45a7Smrg	    # FIXME: insert proper C++ library support
63146aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
63156aec45a7Smrg	    ;;
63166aec45a7Smrg          aCC*)
63176aec45a7Smrg	    case $host_cpu in
63186aec45a7Smrg	      hppa*64*)
63196aec45a7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63206aec45a7Smrg	        ;;
63216aec45a7Smrg	      ia64*)
63226aec45a7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63236aec45a7Smrg	        ;;
63246aec45a7Smrg	      *)
63256aec45a7Smrg	        _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'
63266aec45a7Smrg	        ;;
63276aec45a7Smrg	    esac
63286aec45a7Smrg	    # Commands to make compiler produce verbose output that lists
63296aec45a7Smrg	    # what "hidden" libraries, object files and flags are used when
63306aec45a7Smrg	    # linking a shared library.
63316aec45a7Smrg	    #
63326aec45a7Smrg	    # There doesn't appear to be a way to prevent this compiler from
63336aec45a7Smrg	    # explicitly linking system object files so we need to strip them
63346aec45a7Smrg	    # from the output so that they don't get included in the library
63356aec45a7Smrg	    # dependencies.
63366aec45a7Smrg	    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"'
63376aec45a7Smrg	    ;;
63386aec45a7Smrg          *)
63396aec45a7Smrg	    if test "$GXX" = yes; then
63406aec45a7Smrg	      if test $with_gnu_ld = no; then
63416aec45a7Smrg	        case $host_cpu in
63426aec45a7Smrg	          hppa*64*)
63436aec45a7Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63446aec45a7Smrg	            ;;
63456aec45a7Smrg	          ia64*)
6346aa9e3350Smrg	            _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'
63476aec45a7Smrg	            ;;
63486aec45a7Smrg	          *)
6349aa9e3350Smrg	            _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'
63506aec45a7Smrg	            ;;
63516aec45a7Smrg	        esac
63526aec45a7Smrg	      fi
63536aec45a7Smrg	    else
63546aec45a7Smrg	      # FIXME: insert proper C++ library support
63556aec45a7Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
63566aec45a7Smrg	    fi
63576aec45a7Smrg	    ;;
63586aec45a7Smrg        esac
63596aec45a7Smrg        ;;
6360ab47cfaaSmrg
63616aec45a7Smrg      interix[[3-9]]*)
63626aec45a7Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
63636aec45a7Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63646aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
63656aec45a7Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
63666aec45a7Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
63676aec45a7Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
63686aec45a7Smrg	# default) and relocated if they conflict, which is a slow very memory
63696aec45a7Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
63706aec45a7Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
63716aec45a7Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
63726aec45a7Smrg	_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'
63736aec45a7Smrg	_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'
63746aec45a7Smrg	;;
63756aec45a7Smrg      irix5* | irix6*)
63766aec45a7Smrg        case $cc_basename in
63776aec45a7Smrg          CC*)
63786aec45a7Smrg	    # SGI C++
63796aec45a7Smrg	    _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'
63806aec45a7Smrg
63816aec45a7Smrg	    # Archives containing C++ object files must be created using
63826aec45a7Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
63836aec45a7Smrg	    # necessary to make sure instantiated templates are included
63846aec45a7Smrg	    # in the archive.
63856aec45a7Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
63866aec45a7Smrg	    ;;
63876aec45a7Smrg          *)
63886aec45a7Smrg	    if test "$GXX" = yes; then
63896aec45a7Smrg	      if test "$with_gnu_ld" = no; then
6390aa9e3350Smrg	        _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'
63916aec45a7Smrg	      else
6392aa9e3350Smrg	        _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'
63936aec45a7Smrg	      fi
63946aec45a7Smrg	    fi
63956aec45a7Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
63966aec45a7Smrg	    ;;
63976aec45a7Smrg        esac
63986aec45a7Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
63996aec45a7Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
64006aec45a7Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
64016aec45a7Smrg        ;;
6402ab47cfaaSmrg
64036aec45a7Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
64046aec45a7Smrg        case $cc_basename in
64056aec45a7Smrg          KCC*)
64066aec45a7Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6407ab47cfaaSmrg
64086aec45a7Smrg	    # KCC will only create a shared library if the output file
64096aec45a7Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
64106aec45a7Smrg	    # to its proper name (with version) after linking.
64116aec45a7Smrg	    _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'
64126aec45a7Smrg	    _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'
64136aec45a7Smrg	    # Commands to make compiler produce verbose output that lists
64146aec45a7Smrg	    # what "hidden" libraries, object files and flags are used when
64156aec45a7Smrg	    # linking a shared library.
64166aec45a7Smrg	    #
64176aec45a7Smrg	    # There doesn't appear to be a way to prevent this compiler from
64186aec45a7Smrg	    # explicitly linking system object files so we need to strip them
64196aec45a7Smrg	    # from the output so that they don't get included in the library
64206aec45a7Smrg	    # dependencies.
64216aec45a7Smrg	    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"'
64226aec45a7Smrg
64236aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64246aec45a7Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64256aec45a7Smrg
64266aec45a7Smrg	    # Archives containing C++ object files must be created using
64276aec45a7Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
64286aec45a7Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
64296aec45a7Smrg	    ;;
64306aec45a7Smrg	  icpc* | ecpc* )
64316aec45a7Smrg	    # Intel C++
64326aec45a7Smrg	    with_gnu_ld=yes
64336aec45a7Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
64346aec45a7Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
64356aec45a7Smrg	    # earlier do not add the objects themselves.
64366aec45a7Smrg	    case `$CC -V 2>&1` in
64376aec45a7Smrg	      *"Version 7."*)
64386aec45a7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
64396aec45a7Smrg		_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'
64406aec45a7Smrg		;;
64416aec45a7Smrg	      *)  # Version 8.0 or newer
64426aec45a7Smrg	        tmp_idyn=
64436aec45a7Smrg	        case $host_cpu in
64446aec45a7Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
64456aec45a7Smrg		esac
64466aec45a7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
64476aec45a7Smrg		_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'
64486aec45a7Smrg		;;
64496aec45a7Smrg	    esac
64506aec45a7Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
64516aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64526aec45a7Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64536aec45a7Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
64546aec45a7Smrg	    ;;
64556aec45a7Smrg          pgCC* | pgcpp*)
64566aec45a7Smrg            # Portland Group C++ compiler
64576aec45a7Smrg	    case `$CC -V` in
64586aec45a7Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
64596aec45a7Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
64606aec45a7Smrg		rm -rf $tpldir~
64616aec45a7Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
64626aec45a7Smrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
64636aec45a7Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
64646aec45a7Smrg		rm -rf $tpldir~
64656aec45a7Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
64666aec45a7Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
64676aec45a7Smrg		$RANLIB $oldlib'
64686aec45a7Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
64696aec45a7Smrg		rm -rf $tpldir~
64706aec45a7Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
64716aec45a7Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
64726aec45a7Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
64736aec45a7Smrg		rm -rf $tpldir~
64746aec45a7Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
64756aec45a7Smrg		$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'
64766aec45a7Smrg	      ;;
64776aec45a7Smrg	    *) # Version 6 and above use weak symbols
64786aec45a7Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
64796aec45a7Smrg	      _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'
64806aec45a7Smrg	      ;;
64816aec45a7Smrg	    esac
6482ab47cfaaSmrg
64836aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
64846aec45a7Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64856aec45a7Smrg	    _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'
64866aec45a7Smrg            ;;
64876aec45a7Smrg	  cxx*)
64886aec45a7Smrg	    # Compaq C++
64896aec45a7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
64906aec45a7Smrg	    _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'
6491ab47cfaaSmrg
64926aec45a7Smrg	    runpath_var=LD_RUN_PATH
64936aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
64946aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6495ab47cfaaSmrg
64966aec45a7Smrg	    # Commands to make compiler produce verbose output that lists
64976aec45a7Smrg	    # what "hidden" libraries, object files and flags are used when
64986aec45a7Smrg	    # linking a shared library.
64996aec45a7Smrg	    #
65006aec45a7Smrg	    # There doesn't appear to be a way to prevent this compiler from
65016aec45a7Smrg	    # explicitly linking system object files so we need to strip them
65026aec45a7Smrg	    # from the output so that they don't get included in the library
65036aec45a7Smrg	    # dependencies.
65046aec45a7Smrg	    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'
65056aec45a7Smrg	    ;;
65066aec45a7Smrg	  xl* | mpixl* | bgxl*)
65076aec45a7Smrg	    # IBM XL 8.0 on PPC, with GNU ld
65086aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
65096aec45a7Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
65106aec45a7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
65116aec45a7Smrg	    if test "x$supports_anon_versioning" = xyes; then
65126aec45a7Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
65136aec45a7Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
65146aec45a7Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
65156aec45a7Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
65166aec45a7Smrg	    fi
65176aec45a7Smrg	    ;;
65186aec45a7Smrg	  *)
65196aec45a7Smrg	    case `$CC -V 2>&1 | sed 5q` in
65206aec45a7Smrg	    *Sun\ C*)
65216aec45a7Smrg	      # Sun C++ 5.9
65226aec45a7Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
65236aec45a7Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
65246aec45a7Smrg	      _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'
65256aec45a7Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
65266aec45a7Smrg	      _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'
65276aec45a7Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
65286aec45a7Smrg
65296aec45a7Smrg	      # Not sure whether something based on
65306aec45a7Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
65316aec45a7Smrg	      # would be better.
65326aec45a7Smrg	      output_verbose_link_cmd='func_echo_all'
65336aec45a7Smrg
65346aec45a7Smrg	      # Archives containing C++ object files must be created using
65356aec45a7Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
65366aec45a7Smrg	      # necessary to make sure instantiated templates are included
65376aec45a7Smrg	      # in the archive.
65386aec45a7Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
65396aec45a7Smrg	      ;;
65406aec45a7Smrg	    esac
65416aec45a7Smrg	    ;;
65426aec45a7Smrg	esac
65436aec45a7Smrg	;;
6544ab47cfaaSmrg
65456aec45a7Smrg      lynxos*)
65466aec45a7Smrg        # FIXME: insert proper C++ library support
65476aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
65486aec45a7Smrg	;;
6549ab47cfaaSmrg
65506aec45a7Smrg      m88k*)
65516aec45a7Smrg        # FIXME: insert proper C++ library support
65526aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
65536aec45a7Smrg	;;
6554ab47cfaaSmrg
65556aec45a7Smrg      mvs*)
65566aec45a7Smrg        case $cc_basename in
65576aec45a7Smrg          cxx*)
65586aec45a7Smrg	    # FIXME: insert proper C++ library support
65596aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
65606aec45a7Smrg	    ;;
65616aec45a7Smrg	  *)
65626aec45a7Smrg	    # FIXME: insert proper C++ library support
65636aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
65646aec45a7Smrg	    ;;
65656aec45a7Smrg	esac
65666aec45a7Smrg	;;
6567ab47cfaaSmrg
65686aec45a7Smrg      netbsd*)
65696aec45a7Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
65706aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
65716aec45a7Smrg	  wlarc=
65726aec45a7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
65736aec45a7Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
65746aec45a7Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65756aec45a7Smrg	fi
65766aec45a7Smrg	# Workaround some broken pre-1.5 toolchains
65776aec45a7Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
65786aec45a7Smrg	;;
6579ab47cfaaSmrg
65806aec45a7Smrg      *nto* | *qnx*)
65816aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
65826aec45a7Smrg	;;
6583ab47cfaaSmrg
65846aec45a7Smrg      openbsd2*)
65856aec45a7Smrg        # C++ shared libraries are fairly broken
65866aec45a7Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
65876aec45a7Smrg	;;
6588ab47cfaaSmrg
65896aec45a7Smrg      openbsd*)
65906aec45a7Smrg	if test -f /usr/libexec/ld.so; then
65916aec45a7Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
65926aec45a7Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65936aec45a7Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
65946aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
65956aec45a7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
65966aec45a7Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
65976aec45a7Smrg	    _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'
65986aec45a7Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
65996aec45a7Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
66006aec45a7Smrg	  fi
66016aec45a7Smrg	  output_verbose_link_cmd=func_echo_all
66026aec45a7Smrg	else
66036aec45a7Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
66046aec45a7Smrg	fi
66056aec45a7Smrg	;;
6606ab47cfaaSmrg
66076aec45a7Smrg      osf3* | osf4* | osf5*)
66086aec45a7Smrg        case $cc_basename in
66096aec45a7Smrg          KCC*)
66106aec45a7Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
66116aec45a7Smrg
66126aec45a7Smrg	    # KCC will only create a shared library if the output file
66136aec45a7Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
66146aec45a7Smrg	    # to its proper name (with version) after linking.
66156aec45a7Smrg	    _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'
66166aec45a7Smrg
66176aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
66186aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
66196aec45a7Smrg
66206aec45a7Smrg	    # Archives containing C++ object files must be created using
66216aec45a7Smrg	    # the KAI C++ compiler.
66226aec45a7Smrg	    case $host in
66236aec45a7Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
66246aec45a7Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
66256aec45a7Smrg	    esac
66266aec45a7Smrg	    ;;
66276aec45a7Smrg          RCC*)
66286aec45a7Smrg	    # Rational C++ 2.4.1
66296aec45a7Smrg	    # FIXME: insert proper C++ library support
66306aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
66316aec45a7Smrg	    ;;
66326aec45a7Smrg          cxx*)
66336aec45a7Smrg	    case $host in
66346aec45a7Smrg	      osf3*)
66356aec45a7Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
66366aec45a7Smrg	        _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'
66376aec45a7Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
66386aec45a7Smrg		;;
66396aec45a7Smrg	      *)
66406aec45a7Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
66416aec45a7Smrg	        _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'
66426aec45a7Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
66436aec45a7Smrg	          echo "-hidden">> $lib.exp~
66446aec45a7Smrg	          $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~
66456aec45a7Smrg	          $RM $lib.exp'
66466aec45a7Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
66476aec45a7Smrg		;;
66486aec45a7Smrg	    esac
6649ab47cfaaSmrg
66506aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6651ab47cfaaSmrg
66526aec45a7Smrg	    # Commands to make compiler produce verbose output that lists
66536aec45a7Smrg	    # what "hidden" libraries, object files and flags are used when
66546aec45a7Smrg	    # linking a shared library.
66556aec45a7Smrg	    #
66566aec45a7Smrg	    # There doesn't appear to be a way to prevent this compiler from
66576aec45a7Smrg	    # explicitly linking system object files so we need to strip them
66586aec45a7Smrg	    # from the output so that they don't get included in the library
66596aec45a7Smrg	    # dependencies.
66606aec45a7Smrg	    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"'
66616aec45a7Smrg	    ;;
66626aec45a7Smrg	  *)
66636aec45a7Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
66646aec45a7Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
66656aec45a7Smrg	      case $host in
66666aec45a7Smrg	        osf3*)
66676aec45a7Smrg	          _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'
66686aec45a7Smrg		  ;;
66696aec45a7Smrg	        *)
6670aa9e3350Smrg	          _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'
66716aec45a7Smrg		  ;;
66726aec45a7Smrg	      esac
66736aec45a7Smrg
66746aec45a7Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
66756aec45a7Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
66766aec45a7Smrg
66776aec45a7Smrg	      # Commands to make compiler produce verbose output that lists
66786aec45a7Smrg	      # what "hidden" libraries, object files and flags are used when
66796aec45a7Smrg	      # linking a shared library.
66806aec45a7Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
66816aec45a7Smrg
66826aec45a7Smrg	    else
66836aec45a7Smrg	      # FIXME: insert proper C++ library support
66846aec45a7Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
66856aec45a7Smrg	    fi
66866aec45a7Smrg	    ;;
66876aec45a7Smrg        esac
66886aec45a7Smrg        ;;
6689ab47cfaaSmrg
66906aec45a7Smrg      psos*)
66916aec45a7Smrg        # FIXME: insert proper C++ library support
66926aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
66936aec45a7Smrg        ;;
6694ab47cfaaSmrg
66956aec45a7Smrg      sunos4*)
66966aec45a7Smrg        case $cc_basename in
66976aec45a7Smrg          CC*)
66986aec45a7Smrg	    # Sun C++ 4.x
66996aec45a7Smrg	    # FIXME: insert proper C++ library support
67006aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67016aec45a7Smrg	    ;;
67026aec45a7Smrg          lcc*)
67036aec45a7Smrg	    # Lucid
67046aec45a7Smrg	    # FIXME: insert proper C++ library support
67056aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67066aec45a7Smrg	    ;;
67076aec45a7Smrg          *)
67086aec45a7Smrg	    # FIXME: insert proper C++ library support
67096aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67106aec45a7Smrg	    ;;
67116aec45a7Smrg        esac
67126aec45a7Smrg        ;;
6713ab47cfaaSmrg
67146aec45a7Smrg      solaris*)
67156aec45a7Smrg        case $cc_basename in
67166aec45a7Smrg          CC* | sunCC*)
67176aec45a7Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
67186aec45a7Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
67196aec45a7Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
67206aec45a7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
67216aec45a7Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
67226aec45a7Smrg	      $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'
67236aec45a7Smrg
67246aec45a7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
67256aec45a7Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
67266aec45a7Smrg	    case $host_os in
67276aec45a7Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
67286aec45a7Smrg	      *)
67296aec45a7Smrg		# The compiler driver will combine and reorder linker options,
67306aec45a7Smrg		# but understands `-z linker_flag'.
67316aec45a7Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
67326aec45a7Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
67336aec45a7Smrg	        ;;
67346aec45a7Smrg	    esac
67356aec45a7Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6736ab47cfaaSmrg
67376aec45a7Smrg	    output_verbose_link_cmd='func_echo_all'
6738ab47cfaaSmrg
67396aec45a7Smrg	    # Archives containing C++ object files must be created using
67406aec45a7Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
67416aec45a7Smrg	    # necessary to make sure instantiated templates are included
67426aec45a7Smrg	    # in the archive.
67436aec45a7Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
67446aec45a7Smrg	    ;;
67456aec45a7Smrg          gcx*)
67466aec45a7Smrg	    # Green Hills C++ Compiler
67476aec45a7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6748ab47cfaaSmrg
67496aec45a7Smrg	    # The C++ compiler must be used to create the archive.
67506aec45a7Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
67516aec45a7Smrg	    ;;
67526aec45a7Smrg          *)
67536aec45a7Smrg	    # GNU C++ compiler with Solaris linker
67546aec45a7Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
67556aec45a7Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
67566aec45a7Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6757aa9e3350Smrg	        _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'
67586aec45a7Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6759aa9e3350Smrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
67606aec45a7Smrg
67616aec45a7Smrg	        # Commands to make compiler produce verbose output that lists
67626aec45a7Smrg	        # what "hidden" libraries, object files and flags are used when
67636aec45a7Smrg	        # linking a shared library.
67646aec45a7Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
67656aec45a7Smrg	      else
67666aec45a7Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
67676aec45a7Smrg	        # platform.
67686aec45a7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
67696aec45a7Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
67706aec45a7Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
67716aec45a7Smrg
67726aec45a7Smrg	        # Commands to make compiler produce verbose output that lists
67736aec45a7Smrg	        # what "hidden" libraries, object files and flags are used when
67746aec45a7Smrg	        # linking a shared library.
67756aec45a7Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
67766aec45a7Smrg	      fi
67776aec45a7Smrg
67786aec45a7Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
67796aec45a7Smrg	      case $host_os in
67806aec45a7Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
67816aec45a7Smrg		*)
67826aec45a7Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
67836aec45a7Smrg		  ;;
67846aec45a7Smrg	      esac
67856aec45a7Smrg	    fi
67866aec45a7Smrg	    ;;
67876aec45a7Smrg        esac
67886aec45a7Smrg        ;;
6789ab47cfaaSmrg
67906aec45a7Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
67916aec45a7Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
67926aec45a7Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
67936aec45a7Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
67946aec45a7Smrg      runpath_var='LD_RUN_PATH'
6795ab47cfaaSmrg
67966aec45a7Smrg      case $cc_basename in
67976aec45a7Smrg        CC*)
67986aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
67996aec45a7Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68006aec45a7Smrg	  ;;
68016aec45a7Smrg	*)
68026aec45a7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68036aec45a7Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68046aec45a7Smrg	  ;;
68056aec45a7Smrg      esac
68066aec45a7Smrg      ;;
6807ab47cfaaSmrg
68086aec45a7Smrg      sysv5* | sco3.2v5* | sco5v6*)
68096aec45a7Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
68106aec45a7Smrg	# link with -lc, and that would cause any symbols used from libc to
68116aec45a7Smrg	# always be unresolved, which means just about no library would
68126aec45a7Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
68136aec45a7Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
68146aec45a7Smrg	# as -z defs.
68156aec45a7Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
68166aec45a7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
68176aec45a7Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
68186aec45a7Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
68196aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
68206aec45a7Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
68216aec45a7Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
68226aec45a7Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
68236aec45a7Smrg	runpath_var='LD_RUN_PATH'
6824ab47cfaaSmrg
68256aec45a7Smrg	case $cc_basename in
68266aec45a7Smrg          CC*)
68276aec45a7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68286aec45a7Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68296aec45a7Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
68306aec45a7Smrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
68316aec45a7Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
68326aec45a7Smrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
68336aec45a7Smrg	    ;;
68346aec45a7Smrg	  *)
68356aec45a7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68366aec45a7Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68376aec45a7Smrg	    ;;
68386aec45a7Smrg	esac
68396aec45a7Smrg      ;;
6840ab47cfaaSmrg
68416aec45a7Smrg      tandem*)
68426aec45a7Smrg        case $cc_basename in
68436aec45a7Smrg          NCC*)
68446aec45a7Smrg	    # NonStop-UX NCC 3.20
68456aec45a7Smrg	    # FIXME: insert proper C++ library support
68466aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68476aec45a7Smrg	    ;;
68486aec45a7Smrg          *)
68496aec45a7Smrg	    # FIXME: insert proper C++ library support
68506aec45a7Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68516aec45a7Smrg	    ;;
68526aec45a7Smrg        esac
68536aec45a7Smrg        ;;
6854ab47cfaaSmrg
68556aec45a7Smrg      vxworks*)
68566aec45a7Smrg        # FIXME: insert proper C++ library support
68576aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
68586aec45a7Smrg        ;;
6859ab47cfaaSmrg
68606aec45a7Smrg      *)
68616aec45a7Smrg        # FIXME: insert proper C++ library support
68626aec45a7Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
68636aec45a7Smrg        ;;
68646aec45a7Smrg    esac
6865ab47cfaaSmrg
68666aec45a7Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
68676aec45a7Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
68686aec45a7Smrg
68696aec45a7Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
68706aec45a7Smrg    _LT_TAGVAR(LD, $1)="$LD"
68716aec45a7Smrg
68726aec45a7Smrg    ## CAVEAT EMPTOR:
68736aec45a7Smrg    ## There is no encapsulation within the following macros, do not change
68746aec45a7Smrg    ## the running order or otherwise move them around unless you know exactly
68756aec45a7Smrg    ## what you are doing...
68766aec45a7Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
68776aec45a7Smrg    _LT_COMPILER_PIC($1)
68786aec45a7Smrg    _LT_COMPILER_C_O($1)
68796aec45a7Smrg    _LT_COMPILER_FILE_LOCKS($1)
68806aec45a7Smrg    _LT_LINKER_SHLIBS($1)
68816aec45a7Smrg    _LT_SYS_DYNAMIC_LINKER($1)
68826aec45a7Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
68836aec45a7Smrg
68846aec45a7Smrg    _LT_CONFIG($1)
68856aec45a7Smrg  fi # test -n "$compiler"
68866aec45a7Smrg
68876aec45a7Smrg  CC=$lt_save_CC
6888aa9e3350Smrg  CFLAGS=$lt_save_CFLAGS
68896aec45a7Smrg  LDCXX=$LD
68906aec45a7Smrg  LD=$lt_save_LD
68916aec45a7Smrg  GCC=$lt_save_GCC
68926aec45a7Smrg  with_gnu_ld=$lt_save_with_gnu_ld
68936aec45a7Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
68946aec45a7Smrg  lt_cv_path_LD=$lt_save_path_LD
68956aec45a7Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
68966aec45a7Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
68976aec45a7Smrgfi # test "$_lt_caught_CXX_error" != yes
6898ab47cfaaSmrg
68996aec45a7SmrgAC_LANG_POP
69006aec45a7Smrg])# _LT_LANG_CXX_CONFIG
6901ab47cfaaSmrg
6902ab47cfaaSmrg
6903aa9e3350Smrg# _LT_FUNC_STRIPNAME_CNF
6904aa9e3350Smrg# ----------------------
6905aa9e3350Smrg# func_stripname_cnf prefix suffix name
6906aa9e3350Smrg# strip PREFIX and SUFFIX off of NAME.
6907aa9e3350Smrg# PREFIX and SUFFIX must not contain globbing or regex special
6908aa9e3350Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
6909aa9e3350Smrg# dot (in which case that matches only a dot).
6910aa9e3350Smrg#
6911aa9e3350Smrg# This function is identical to the (non-XSI) version of func_stripname,
6912aa9e3350Smrg# except this one can be used by m4 code that may be executed by configure,
6913aa9e3350Smrg# rather than the libtool script.
6914aa9e3350Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
6915aa9e3350SmrgAC_REQUIRE([_LT_DECL_SED])
6916aa9e3350SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
6917aa9e3350Smrgfunc_stripname_cnf ()
6918aa9e3350Smrg{
6919aa9e3350Smrg  case ${2} in
6920aa9e3350Smrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
6921aa9e3350Smrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
6922aa9e3350Smrg  esac
6923aa9e3350Smrg} # func_stripname_cnf
6924aa9e3350Smrg])# _LT_FUNC_STRIPNAME_CNF
6925aa9e3350Smrg
69266aec45a7Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
69276aec45a7Smrg# ---------------------------------
69286aec45a7Smrg# Figure out "hidden" library dependencies from verbose
69296aec45a7Smrg# compiler output when linking a shared library.
69306aec45a7Smrg# Parse the compiler output and extract the necessary
69316aec45a7Smrg# objects, libraries and library flags.
69326aec45a7Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
69336aec45a7Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6934aa9e3350SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
69356aec45a7Smrg# Dependencies to place before and after the object being linked:
69366aec45a7Smrg_LT_TAGVAR(predep_objects, $1)=
69376aec45a7Smrg_LT_TAGVAR(postdep_objects, $1)=
69386aec45a7Smrg_LT_TAGVAR(predeps, $1)=
69396aec45a7Smrg_LT_TAGVAR(postdeps, $1)=
69406aec45a7Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
6941ab47cfaaSmrg
69426aec45a7Smrgdnl we can't use the lt_simple_compile_test_code here,
69436aec45a7Smrgdnl because it contains code intended for an executable,
69446aec45a7Smrgdnl not a library.  It's possible we should let each
69456aec45a7Smrgdnl tag define a new lt_????_link_test_code variable,
69466aec45a7Smrgdnl but it's only used here...
69476aec45a7Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
69486aec45a7Smrgint a;
69496aec45a7Smrgvoid foo (void) { a = 0; }
69506aec45a7Smrg_LT_EOF
69516aec45a7Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
69526aec45a7Smrgclass Foo
69536aec45a7Smrg{
69546aec45a7Smrgpublic:
69556aec45a7Smrg  Foo (void) { a = 0; }
69566aec45a7Smrgprivate:
69576aec45a7Smrg  int a;
69586aec45a7Smrg};
69596aec45a7Smrg_LT_EOF
69606aec45a7Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
69616aec45a7Smrg      subroutine foo
69626aec45a7Smrg      implicit none
69636aec45a7Smrg      integer*4 a
69646aec45a7Smrg      a=0
69656aec45a7Smrg      return
69666aec45a7Smrg      end
69676aec45a7Smrg_LT_EOF
69686aec45a7Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
69696aec45a7Smrg      subroutine foo
69706aec45a7Smrg      implicit none
69716aec45a7Smrg      integer a
69726aec45a7Smrg      a=0
69736aec45a7Smrg      return
69746aec45a7Smrg      end
69756aec45a7Smrg_LT_EOF
69766aec45a7Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
69776aec45a7Smrgpublic class foo {
69786aec45a7Smrg  private int a;
69796aec45a7Smrg  public void bar (void) {
69806aec45a7Smrg    a = 0;
69816aec45a7Smrg  }
69826aec45a7Smrg};
69836aec45a7Smrg_LT_EOF
6984aa9e3350Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
6985aa9e3350Smrgpackage foo
6986aa9e3350Smrgfunc foo() {
6987aa9e3350Smrg}
6988aa9e3350Smrg_LT_EOF
69895c42550eSmrg])
6990aa9e3350Smrg
6991aa9e3350Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
6992aa9e3350Smrgcase "$CC $CFLAGS " in #(
6993aa9e3350Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
6994aa9e3350Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
6995aa9e3350Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
6996aa9e3350Smrgesac
6997aa9e3350Smrg
69986aec45a7Smrgdnl Parse the compiler output and extract the necessary
69996aec45a7Smrgdnl objects, libraries and library flags.
70006aec45a7Smrgif AC_TRY_EVAL(ac_compile); then
70016aec45a7Smrg  # Parse the compiler output and extract the necessary
70026aec45a7Smrg  # objects, libraries and library flags.
7003ab47cfaaSmrg
70046aec45a7Smrg  # Sentinel used to keep track of whether or not we are before
70056aec45a7Smrg  # the conftest object file.
70066aec45a7Smrg  pre_test_object_deps_done=no
70071473d951Smrg
70086aec45a7Smrg  for p in `eval "$output_verbose_link_cmd"`; do
7009aa9e3350Smrg    case ${prev}${p} in
7010ab47cfaaSmrg
70116aec45a7Smrg    -L* | -R* | -l*)
70126aec45a7Smrg       # Some compilers place space between "-{L,R}" and the path.
70136aec45a7Smrg       # Remove the space.
70146aec45a7Smrg       if test $p = "-L" ||
70156aec45a7Smrg          test $p = "-R"; then
70166aec45a7Smrg	 prev=$p
70176aec45a7Smrg	 continue
70186aec45a7Smrg       fi
7019ab47cfaaSmrg
7020aa9e3350Smrg       # Expand the sysroot to ease extracting the directories later.
7021aa9e3350Smrg       if test -z "$prev"; then
7022aa9e3350Smrg         case $p in
7023aa9e3350Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7024aa9e3350Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7025aa9e3350Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7026aa9e3350Smrg         esac
7027aa9e3350Smrg       fi
7028aa9e3350Smrg       case $p in
7029aa9e3350Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7030aa9e3350Smrg       esac
70316aec45a7Smrg       if test "$pre_test_object_deps_done" = no; then
7032aa9e3350Smrg	 case ${prev} in
7033aa9e3350Smrg	 -L | -R)
70346aec45a7Smrg	   # Internal compiler library paths should come after those
70356aec45a7Smrg	   # provided the user.  The postdeps already come after the
70366aec45a7Smrg	   # user supplied libs so there is no need to process them.
70376aec45a7Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
70386aec45a7Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
70396aec45a7Smrg	   else
70406aec45a7Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
70416aec45a7Smrg	   fi
70426aec45a7Smrg	   ;;
70436aec45a7Smrg	 # The "-l" case would never come before the object being
70446aec45a7Smrg	 # linked, so don't bother handling this case.
70456aec45a7Smrg	 esac
70466aec45a7Smrg       else
70476aec45a7Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
70486aec45a7Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
70496aec45a7Smrg	 else
70506aec45a7Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
70516aec45a7Smrg	 fi
70526aec45a7Smrg       fi
7053aa9e3350Smrg       prev=
70546aec45a7Smrg       ;;
7055ab47cfaaSmrg
7056aa9e3350Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
70576aec45a7Smrg    *.$objext)
70586aec45a7Smrg       # This assumes that the test object file only shows up
70596aec45a7Smrg       # once in the compiler output.
70606aec45a7Smrg       if test "$p" = "conftest.$objext"; then
70616aec45a7Smrg	 pre_test_object_deps_done=yes
70626aec45a7Smrg	 continue
70636aec45a7Smrg       fi
7064ab47cfaaSmrg
70656aec45a7Smrg       if test "$pre_test_object_deps_done" = no; then
70666aec45a7Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
70676aec45a7Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
70686aec45a7Smrg	 else
70696aec45a7Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
70706aec45a7Smrg	 fi
70716aec45a7Smrg       else
70726aec45a7Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
70736aec45a7Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
70746aec45a7Smrg	 else
70756aec45a7Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
70766aec45a7Smrg	 fi
70776aec45a7Smrg       fi
70786aec45a7Smrg       ;;
7079ab47cfaaSmrg
70806aec45a7Smrg    *) ;; # Ignore the rest.
7081ab47cfaaSmrg
70826aec45a7Smrg    esac
70836aec45a7Smrg  done
7084ab47cfaaSmrg
70856aec45a7Smrg  # Clean up.
70866aec45a7Smrg  rm -f a.out a.exe
70876aec45a7Smrgelse
70886aec45a7Smrg  echo "libtool.m4: error: problem compiling $1 test program"
70896aec45a7Smrgfi
70901473d951Smrg
70916aec45a7Smrg$RM -f confest.$objext
7092aa9e3350SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
7093ab47cfaaSmrg
70946aec45a7Smrg# PORTME: override above test on systems where it is broken
70956aec45a7Smrgm4_if([$1], [CXX],
70966aec45a7Smrg[case $host_os in
70976aec45a7Smrginterix[[3-9]]*)
70986aec45a7Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
70996aec45a7Smrg  # hack all around it, let's just trust "g++" to DTRT.
71006aec45a7Smrg  _LT_TAGVAR(predep_objects,$1)=
71016aec45a7Smrg  _LT_TAGVAR(postdep_objects,$1)=
71026aec45a7Smrg  _LT_TAGVAR(postdeps,$1)=
71035c42550eSmrg  ;;
71046aec45a7Smrg
71056aec45a7Smrglinux*)
71066aec45a7Smrg  case `$CC -V 2>&1 | sed 5q` in
71076aec45a7Smrg  *Sun\ C*)
71086aec45a7Smrg    # Sun C++ 5.9
71096aec45a7Smrg
71106aec45a7Smrg    # The more standards-conforming stlport4 library is
71116aec45a7Smrg    # incompatible with the Cstd library. Avoid specifying
71126aec45a7Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
71136aec45a7Smrg    # -library=stlport4 depends on it.
71146aec45a7Smrg    case " $CXX $CXXFLAGS " in
71156aec45a7Smrg    *" -library=stlport4 "*)
71166aec45a7Smrg      solaris_use_stlport4=yes
71176aec45a7Smrg      ;;
71186aec45a7Smrg    esac
71196aec45a7Smrg
71206aec45a7Smrg    if test "$solaris_use_stlport4" != yes; then
71216aec45a7Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
71226aec45a7Smrg    fi
71236aec45a7Smrg    ;;
71246aec45a7Smrg  esac
71255c42550eSmrg  ;;
71266aec45a7Smrg
71275c42550eSmrgsolaris*)
71286aec45a7Smrg  case $cc_basename in
71296aec45a7Smrg  CC* | sunCC*)
71306aec45a7Smrg    # The more standards-conforming stlport4 library is
71316aec45a7Smrg    # incompatible with the Cstd library. Avoid specifying
71326aec45a7Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
71336aec45a7Smrg    # -library=stlport4 depends on it.
71346aec45a7Smrg    case " $CXX $CXXFLAGS " in
71356aec45a7Smrg    *" -library=stlport4 "*)
71366aec45a7Smrg      solaris_use_stlport4=yes
71376aec45a7Smrg      ;;
71386aec45a7Smrg    esac
71391473d951Smrg
71406aec45a7Smrg    # Adding this requires a known-good setup of shared libraries for
71416aec45a7Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
71426aec45a7Smrg    # archive will be linked into the output, leading to subtle bugs.
71436aec45a7Smrg    if test "$solaris_use_stlport4" != yes; then
71446aec45a7Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
71456aec45a7Smrg    fi
71466aec45a7Smrg    ;;
71476aec45a7Smrg  esac
71485c42550eSmrg  ;;
71495c42550eSmrgesac
71506aec45a7Smrg])
71511473d951Smrg
71526aec45a7Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
71536aec45a7Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
71545c42550eSmrgesac
71556aec45a7Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
71566aec45a7Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
71576aec45a7Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
71586aec45a7Smrgfi
71596aec45a7Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
71606aec45a7Smrg    [The directories searched by this compiler when creating a shared library])
71616aec45a7Smrg_LT_TAGDECL([], [predep_objects], [1],
71626aec45a7Smrg    [Dependencies to place before and after the objects being linked to
71636aec45a7Smrg    create a shared library])
71646aec45a7Smrg_LT_TAGDECL([], [postdep_objects], [1])
71656aec45a7Smrg_LT_TAGDECL([], [predeps], [1])
71666aec45a7Smrg_LT_TAGDECL([], [postdeps], [1])
71676aec45a7Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
71686aec45a7Smrg    [The library search path used internally by the compiler when linking
71696aec45a7Smrg    a shared library])
71706aec45a7Smrg])# _LT_SYS_HIDDEN_LIBDEPS
71716aec45a7Smrg
71726aec45a7Smrg
71736aec45a7Smrg# _LT_LANG_F77_CONFIG([TAG])
71746aec45a7Smrg# --------------------------
71756aec45a7Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
71766aec45a7Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
71776aec45a7Smrg# to write the compiler configuration to `libtool'.
71786aec45a7Smrgm4_defun([_LT_LANG_F77_CONFIG],
71796aec45a7Smrg[AC_LANG_PUSH(Fortran 77)
71806aec45a7Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
71816aec45a7Smrg  _lt_disable_F77=yes
71826aec45a7Smrgfi
7183ab47cfaaSmrg
71846aec45a7Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
71856aec45a7Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
71866aec45a7Smrg_LT_TAGVAR(always_export_symbols, $1)=no
71876aec45a7Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
71886aec45a7Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
71896aec45a7Smrg_LT_TAGVAR(hardcode_direct, $1)=no
71906aec45a7Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
71916aec45a7Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
71926aec45a7Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
71936aec45a7Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
71946aec45a7Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
71956aec45a7Smrg_LT_TAGVAR(inherit_rpath, $1)=no
71966aec45a7Smrg_LT_TAGVAR(module_cmds, $1)=
71976aec45a7Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
71986aec45a7Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
71996aec45a7Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
72006aec45a7Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
72016aec45a7Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
72026aec45a7Smrg_LT_TAGVAR(no_undefined_flag, $1)=
72036aec45a7Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
72046aec45a7Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7205ab47cfaaSmrg
72066aec45a7Smrg# Source file extension for f77 test sources.
72076aec45a7Smrgac_ext=f
7208ab47cfaaSmrg
72096aec45a7Smrg# Object file extension for compiled f77 test sources.
72106aec45a7Smrgobjext=o
72116aec45a7Smrg_LT_TAGVAR(objext, $1)=$objext
72126aec45a7Smrg
72136aec45a7Smrg# No sense in running all these tests if we already determined that
72146aec45a7Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
72156aec45a7Smrg# are currently assumed to apply to all compilers on this platform,
72166aec45a7Smrg# and will be corrupted by setting them based on a non-working compiler.
72176aec45a7Smrgif test "$_lt_disable_F77" != yes; then
72186aec45a7Smrg  # Code to be used in simple compile tests
72196aec45a7Smrg  lt_simple_compile_test_code="\
72206aec45a7Smrg      subroutine t
72216aec45a7Smrg      return
72226aec45a7Smrg      end
72236aec45a7Smrg"
72241473d951Smrg
72256aec45a7Smrg  # Code to be used in simple link tests
72266aec45a7Smrg  lt_simple_link_test_code="\
72276aec45a7Smrg      program t
72286aec45a7Smrg      end
72296aec45a7Smrg"
72301473d951Smrg
72316aec45a7Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
72326aec45a7Smrg  _LT_TAG_COMPILER
72331473d951Smrg
72346aec45a7Smrg  # save warnings/boilerplate of simple test code
72356aec45a7Smrg  _LT_COMPILER_BOILERPLATE
72366aec45a7Smrg  _LT_LINKER_BOILERPLATE
7237ab47cfaaSmrg
72386aec45a7Smrg  # Allow CC to be a program name with arguments.
72396aec45a7Smrg  lt_save_CC="$CC"
72406aec45a7Smrg  lt_save_GCC=$GCC
7241aa9e3350Smrg  lt_save_CFLAGS=$CFLAGS
72426aec45a7Smrg  CC=${F77-"f77"}
7243aa9e3350Smrg  CFLAGS=$FFLAGS
72446aec45a7Smrg  compiler=$CC
72456aec45a7Smrg  _LT_TAGVAR(compiler, $1)=$CC
72466aec45a7Smrg  _LT_CC_BASENAME([$compiler])
72476aec45a7Smrg  GCC=$G77
72486aec45a7Smrg  if test -n "$compiler"; then
72496aec45a7Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
72506aec45a7Smrg    AC_MSG_RESULT([$can_build_shared])
72511473d951Smrg
72526aec45a7Smrg    AC_MSG_CHECKING([whether to build shared libraries])
72536aec45a7Smrg    test "$can_build_shared" = "no" && enable_shared=no
72541473d951Smrg
72556aec45a7Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
72566aec45a7Smrg    # are all built from PIC.
72576aec45a7Smrg    case $host_os in
72586aec45a7Smrg      aix3*)
72596aec45a7Smrg        test "$enable_shared" = yes && enable_static=no
72606aec45a7Smrg        if test -n "$RANLIB"; then
72616aec45a7Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
72626aec45a7Smrg          postinstall_cmds='$RANLIB $lib'
72636aec45a7Smrg        fi
72646aec45a7Smrg        ;;
72656aec45a7Smrg      aix[[4-9]]*)
72666aec45a7Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
72676aec45a7Smrg	  test "$enable_shared" = yes && enable_static=no
72686aec45a7Smrg	fi
72696aec45a7Smrg        ;;
72706aec45a7Smrg    esac
72716aec45a7Smrg    AC_MSG_RESULT([$enable_shared])
72726aec45a7Smrg
72736aec45a7Smrg    AC_MSG_CHECKING([whether to build static libraries])
72746aec45a7Smrg    # Make sure either enable_shared or enable_static is yes.
72756aec45a7Smrg    test "$enable_shared" = yes || enable_static=yes
72766aec45a7Smrg    AC_MSG_RESULT([$enable_static])
72776aec45a7Smrg
72786aec45a7Smrg    _LT_TAGVAR(GCC, $1)="$G77"
72796aec45a7Smrg    _LT_TAGVAR(LD, $1)="$LD"
72806aec45a7Smrg
72816aec45a7Smrg    ## CAVEAT EMPTOR:
72826aec45a7Smrg    ## There is no encapsulation within the following macros, do not change
72836aec45a7Smrg    ## the running order or otherwise move them around unless you know exactly
72846aec45a7Smrg    ## what you are doing...
72856aec45a7Smrg    _LT_COMPILER_PIC($1)
72866aec45a7Smrg    _LT_COMPILER_C_O($1)
72876aec45a7Smrg    _LT_COMPILER_FILE_LOCKS($1)
72886aec45a7Smrg    _LT_LINKER_SHLIBS($1)
72896aec45a7Smrg    _LT_SYS_DYNAMIC_LINKER($1)
72906aec45a7Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
72916aec45a7Smrg
72926aec45a7Smrg    _LT_CONFIG($1)
72936aec45a7Smrg  fi # test -n "$compiler"
72946aec45a7Smrg
72956aec45a7Smrg  GCC=$lt_save_GCC
72966aec45a7Smrg  CC="$lt_save_CC"
7297aa9e3350Smrg  CFLAGS="$lt_save_CFLAGS"
72986aec45a7Smrgfi # test "$_lt_disable_F77" != yes
72991473d951Smrg
73006aec45a7SmrgAC_LANG_POP
73016aec45a7Smrg])# _LT_LANG_F77_CONFIG
73021473d951Smrg
7303ab47cfaaSmrg
73046aec45a7Smrg# _LT_LANG_FC_CONFIG([TAG])
73056aec45a7Smrg# -------------------------
73066aec45a7Smrg# Ensure that the configuration variables for a Fortran compiler are
73076aec45a7Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
73086aec45a7Smrg# to write the compiler configuration to `libtool'.
73096aec45a7Smrgm4_defun([_LT_LANG_FC_CONFIG],
73106aec45a7Smrg[AC_LANG_PUSH(Fortran)
73116aec45a7Smrg
73126aec45a7Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
73136aec45a7Smrg  _lt_disable_FC=yes
73145c42550eSmrgfi
7315ab47cfaaSmrg
73166aec45a7Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
73176aec45a7Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
73186aec45a7Smrg_LT_TAGVAR(always_export_symbols, $1)=no
73196aec45a7Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
73206aec45a7Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
73216aec45a7Smrg_LT_TAGVAR(hardcode_direct, $1)=no
73226aec45a7Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
73236aec45a7Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
73246aec45a7Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
73256aec45a7Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
73266aec45a7Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
73276aec45a7Smrg_LT_TAGVAR(inherit_rpath, $1)=no
73286aec45a7Smrg_LT_TAGVAR(module_cmds, $1)=
73296aec45a7Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
73306aec45a7Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
73316aec45a7Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
73326aec45a7Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
73336aec45a7Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
73346aec45a7Smrg_LT_TAGVAR(no_undefined_flag, $1)=
73356aec45a7Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
73366aec45a7Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
73376aec45a7Smrg
73386aec45a7Smrg# Source file extension for fc test sources.
73396aec45a7Smrgac_ext=${ac_fc_srcext-f}
73406aec45a7Smrg
73416aec45a7Smrg# Object file extension for compiled fc test sources.
73426aec45a7Smrgobjext=o
73436aec45a7Smrg_LT_TAGVAR(objext, $1)=$objext
73446aec45a7Smrg
73456aec45a7Smrg# No sense in running all these tests if we already determined that
73466aec45a7Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
73476aec45a7Smrg# are currently assumed to apply to all compilers on this platform,
73486aec45a7Smrg# and will be corrupted by setting them based on a non-working compiler.
73496aec45a7Smrgif test "$_lt_disable_FC" != yes; then
73506aec45a7Smrg  # Code to be used in simple compile tests
73516aec45a7Smrg  lt_simple_compile_test_code="\
73526aec45a7Smrg      subroutine t
73536aec45a7Smrg      return
73546aec45a7Smrg      end
73556aec45a7Smrg"
7356ab47cfaaSmrg
73576aec45a7Smrg  # Code to be used in simple link tests
73586aec45a7Smrg  lt_simple_link_test_code="\
73596aec45a7Smrg      program t
73606aec45a7Smrg      end
73616aec45a7Smrg"
7362ab47cfaaSmrg
73636aec45a7Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
73646aec45a7Smrg  _LT_TAG_COMPILER
7365ab47cfaaSmrg
73666aec45a7Smrg  # save warnings/boilerplate of simple test code
73676aec45a7Smrg  _LT_COMPILER_BOILERPLATE
73686aec45a7Smrg  _LT_LINKER_BOILERPLATE
73696aec45a7Smrg
73706aec45a7Smrg  # Allow CC to be a program name with arguments.
73716aec45a7Smrg  lt_save_CC="$CC"
73726aec45a7Smrg  lt_save_GCC=$GCC
7373aa9e3350Smrg  lt_save_CFLAGS=$CFLAGS
73746aec45a7Smrg  CC=${FC-"f95"}
7375aa9e3350Smrg  CFLAGS=$FCFLAGS
73766aec45a7Smrg  compiler=$CC
73776aec45a7Smrg  GCC=$ac_cv_fc_compiler_gnu
73786aec45a7Smrg
73796aec45a7Smrg  _LT_TAGVAR(compiler, $1)=$CC
73806aec45a7Smrg  _LT_CC_BASENAME([$compiler])
73816aec45a7Smrg
73826aec45a7Smrg  if test -n "$compiler"; then
73836aec45a7Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
73846aec45a7Smrg    AC_MSG_RESULT([$can_build_shared])
73856aec45a7Smrg
73866aec45a7Smrg    AC_MSG_CHECKING([whether to build shared libraries])
73876aec45a7Smrg    test "$can_build_shared" = "no" && enable_shared=no
73886aec45a7Smrg
73896aec45a7Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
73906aec45a7Smrg    # are all built from PIC.
73915c42550eSmrg    case $host_os in
73926aec45a7Smrg      aix3*)
73936aec45a7Smrg        test "$enable_shared" = yes && enable_static=no
73946aec45a7Smrg        if test -n "$RANLIB"; then
73956aec45a7Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
73966aec45a7Smrg          postinstall_cmds='$RANLIB $lib'
73976aec45a7Smrg        fi
73986aec45a7Smrg        ;;
73995c42550eSmrg      aix[[4-9]]*)
74006aec45a7Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
74016aec45a7Smrg	  test "$enable_shared" = yes && enable_static=no
74025c42550eSmrg	fi
74036aec45a7Smrg        ;;
74045c42550eSmrg    esac
74056aec45a7Smrg    AC_MSG_RESULT([$enable_shared])
74066aec45a7Smrg
74076aec45a7Smrg    AC_MSG_CHECKING([whether to build static libraries])
74086aec45a7Smrg    # Make sure either enable_shared or enable_static is yes.
74096aec45a7Smrg    test "$enable_shared" = yes || enable_static=yes
74106aec45a7Smrg    AC_MSG_RESULT([$enable_static])
74116aec45a7Smrg
74126aec45a7Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
74136aec45a7Smrg    _LT_TAGVAR(LD, $1)="$LD"
74146aec45a7Smrg
74156aec45a7Smrg    ## CAVEAT EMPTOR:
74166aec45a7Smrg    ## There is no encapsulation within the following macros, do not change
74176aec45a7Smrg    ## the running order or otherwise move them around unless you know exactly
74186aec45a7Smrg    ## what you are doing...
74196aec45a7Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
74206aec45a7Smrg    _LT_COMPILER_PIC($1)
74216aec45a7Smrg    _LT_COMPILER_C_O($1)
74226aec45a7Smrg    _LT_COMPILER_FILE_LOCKS($1)
74236aec45a7Smrg    _LT_LINKER_SHLIBS($1)
74246aec45a7Smrg    _LT_SYS_DYNAMIC_LINKER($1)
74256aec45a7Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
74266aec45a7Smrg
74276aec45a7Smrg    _LT_CONFIG($1)
74286aec45a7Smrg  fi # test -n "$compiler"
74296aec45a7Smrg
74306aec45a7Smrg  GCC=$lt_save_GCC
7431aa9e3350Smrg  CC=$lt_save_CC
7432aa9e3350Smrg  CFLAGS=$lt_save_CFLAGS
74336aec45a7Smrgfi # test "$_lt_disable_FC" != yes
74341473d951Smrg
74356aec45a7SmrgAC_LANG_POP
74366aec45a7Smrg])# _LT_LANG_FC_CONFIG
74371473d951Smrg
74381473d951Smrg
74396aec45a7Smrg# _LT_LANG_GCJ_CONFIG([TAG])
74406aec45a7Smrg# --------------------------
74416aec45a7Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
74426aec45a7Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
74436aec45a7Smrg# to write the compiler configuration to `libtool'.
74446aec45a7Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
74456aec45a7Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
74466aec45a7SmrgAC_LANG_SAVE
74471473d951Smrg
74486aec45a7Smrg# Source file extension for Java test sources.
74496aec45a7Smrgac_ext=java
74501473d951Smrg
74516aec45a7Smrg# Object file extension for compiled Java test sources.
74526aec45a7Smrgobjext=o
74536aec45a7Smrg_LT_TAGVAR(objext, $1)=$objext
74541473d951Smrg
74556aec45a7Smrg# Code to be used in simple compile tests
74566aec45a7Smrglt_simple_compile_test_code="class foo {}"
74571473d951Smrg
74586aec45a7Smrg# Code to be used in simple link tests
74596aec45a7Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
74606aec45a7Smrg
74616aec45a7Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
74626aec45a7Smrg_LT_TAG_COMPILER
74636aec45a7Smrg
74646aec45a7Smrg# save warnings/boilerplate of simple test code
74656aec45a7Smrg_LT_COMPILER_BOILERPLATE
74666aec45a7Smrg_LT_LINKER_BOILERPLATE
74676aec45a7Smrg
74686aec45a7Smrg# Allow CC to be a program name with arguments.
7469aa9e3350Smrglt_save_CC=$CC
7470aa9e3350Smrglt_save_CFLAGS=$CFLAGS
74716aec45a7Smrglt_save_GCC=$GCC
74726aec45a7SmrgGCC=yes
74736aec45a7SmrgCC=${GCJ-"gcj"}
7474aa9e3350SmrgCFLAGS=$GCJFLAGS
74756aec45a7Smrgcompiler=$CC
74766aec45a7Smrg_LT_TAGVAR(compiler, $1)=$CC
74776aec45a7Smrg_LT_TAGVAR(LD, $1)="$LD"
74786aec45a7Smrg_LT_CC_BASENAME([$compiler])
74796aec45a7Smrg
74806aec45a7Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
74816aec45a7Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
74826aec45a7Smrg
74836aec45a7Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
74846aec45a7Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
74856aec45a7Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
74866aec45a7Smrg
74876aec45a7Smrgif test -n "$compiler"; then
74886aec45a7Smrg  _LT_COMPILER_NO_RTTI($1)
74896aec45a7Smrg  _LT_COMPILER_PIC($1)
74906aec45a7Smrg  _LT_COMPILER_C_O($1)
74916aec45a7Smrg  _LT_COMPILER_FILE_LOCKS($1)
74926aec45a7Smrg  _LT_LINKER_SHLIBS($1)
74936aec45a7Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
74946aec45a7Smrg
74956aec45a7Smrg  _LT_CONFIG($1)
74966aec45a7Smrgfi
74976aec45a7Smrg
74986aec45a7SmrgAC_LANG_RESTORE
74996aec45a7Smrg
75006aec45a7SmrgGCC=$lt_save_GCC
7501aa9e3350SmrgCC=$lt_save_CC
7502aa9e3350SmrgCFLAGS=$lt_save_CFLAGS
75036aec45a7Smrg])# _LT_LANG_GCJ_CONFIG
75046aec45a7Smrg
75056aec45a7Smrg
7506aa9e3350Smrg# _LT_LANG_GO_CONFIG([TAG])
7507aa9e3350Smrg# --------------------------
7508aa9e3350Smrg# Ensure that the configuration variables for the GNU Go compiler
7509aa9e3350Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7510aa9e3350Smrg# to write the compiler configuration to `libtool'.
7511aa9e3350Smrgm4_defun([_LT_LANG_GO_CONFIG],
7512aa9e3350Smrg[AC_REQUIRE([LT_PROG_GO])dnl
7513aa9e3350SmrgAC_LANG_SAVE
7514aa9e3350Smrg
7515aa9e3350Smrg# Source file extension for Go test sources.
7516aa9e3350Smrgac_ext=go
7517aa9e3350Smrg
7518aa9e3350Smrg# Object file extension for compiled Go test sources.
7519aa9e3350Smrgobjext=o
7520aa9e3350Smrg_LT_TAGVAR(objext, $1)=$objext
7521aa9e3350Smrg
7522aa9e3350Smrg# Code to be used in simple compile tests
7523aa9e3350Smrglt_simple_compile_test_code="package main; func main() { }"
7524aa9e3350Smrg
7525aa9e3350Smrg# Code to be used in simple link tests
7526aa9e3350Smrglt_simple_link_test_code='package main; func main() { }'
7527aa9e3350Smrg
7528aa9e3350Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7529aa9e3350Smrg_LT_TAG_COMPILER
7530aa9e3350Smrg
7531aa9e3350Smrg# save warnings/boilerplate of simple test code
7532aa9e3350Smrg_LT_COMPILER_BOILERPLATE
7533aa9e3350Smrg_LT_LINKER_BOILERPLATE
7534aa9e3350Smrg
7535aa9e3350Smrg# Allow CC to be a program name with arguments.
7536aa9e3350Smrglt_save_CC=$CC
7537aa9e3350Smrglt_save_CFLAGS=$CFLAGS
7538aa9e3350Smrglt_save_GCC=$GCC
7539aa9e3350SmrgGCC=yes
7540aa9e3350SmrgCC=${GOC-"gccgo"}
7541aa9e3350SmrgCFLAGS=$GOFLAGS
7542aa9e3350Smrgcompiler=$CC
7543aa9e3350Smrg_LT_TAGVAR(compiler, $1)=$CC
7544aa9e3350Smrg_LT_TAGVAR(LD, $1)="$LD"
7545aa9e3350Smrg_LT_CC_BASENAME([$compiler])
7546aa9e3350Smrg
7547aa9e3350Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
7548aa9e3350Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7549aa9e3350Smrg
7550aa9e3350Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7551aa9e3350Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7552aa9e3350Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7553aa9e3350Smrg
7554aa9e3350Smrgif test -n "$compiler"; then
7555aa9e3350Smrg  _LT_COMPILER_NO_RTTI($1)
7556aa9e3350Smrg  _LT_COMPILER_PIC($1)
7557aa9e3350Smrg  _LT_COMPILER_C_O($1)
7558aa9e3350Smrg  _LT_COMPILER_FILE_LOCKS($1)
7559aa9e3350Smrg  _LT_LINKER_SHLIBS($1)
7560aa9e3350Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7561aa9e3350Smrg
7562aa9e3350Smrg  _LT_CONFIG($1)
7563aa9e3350Smrgfi
7564aa9e3350Smrg
7565aa9e3350SmrgAC_LANG_RESTORE
7566aa9e3350Smrg
7567aa9e3350SmrgGCC=$lt_save_GCC
7568aa9e3350SmrgCC=$lt_save_CC
7569aa9e3350SmrgCFLAGS=$lt_save_CFLAGS
7570aa9e3350Smrg])# _LT_LANG_GO_CONFIG
7571aa9e3350Smrg
7572aa9e3350Smrg
75736aec45a7Smrg# _LT_LANG_RC_CONFIG([TAG])
75746aec45a7Smrg# -------------------------
75756aec45a7Smrg# Ensure that the configuration variables for the Windows resource compiler
75766aec45a7Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
75776aec45a7Smrg# to write the compiler configuration to `libtool'.
75786aec45a7Smrgm4_defun([_LT_LANG_RC_CONFIG],
75796aec45a7Smrg[AC_REQUIRE([LT_PROG_RC])dnl
75806aec45a7SmrgAC_LANG_SAVE
75816aec45a7Smrg
75826aec45a7Smrg# Source file extension for RC test sources.
75836aec45a7Smrgac_ext=rc
75846aec45a7Smrg
75856aec45a7Smrg# Object file extension for compiled RC test sources.
75866aec45a7Smrgobjext=o
75876aec45a7Smrg_LT_TAGVAR(objext, $1)=$objext
75886aec45a7Smrg
75896aec45a7Smrg# Code to be used in simple compile tests
75906aec45a7Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
75916aec45a7Smrg
75926aec45a7Smrg# Code to be used in simple link tests
75936aec45a7Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
75946aec45a7Smrg
75956aec45a7Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
75966aec45a7Smrg_LT_TAG_COMPILER
75976aec45a7Smrg
75986aec45a7Smrg# save warnings/boilerplate of simple test code
75996aec45a7Smrg_LT_COMPILER_BOILERPLATE
76006aec45a7Smrg_LT_LINKER_BOILERPLATE
76016aec45a7Smrg
76026aec45a7Smrg# Allow CC to be a program name with arguments.
76036aec45a7Smrglt_save_CC="$CC"
7604aa9e3350Smrglt_save_CFLAGS=$CFLAGS
76056aec45a7Smrglt_save_GCC=$GCC
76066aec45a7SmrgGCC=
76076aec45a7SmrgCC=${RC-"windres"}
7608aa9e3350SmrgCFLAGS=
76096aec45a7Smrgcompiler=$CC
76106aec45a7Smrg_LT_TAGVAR(compiler, $1)=$CC
76116aec45a7Smrg_LT_CC_BASENAME([$compiler])
76126aec45a7Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
76136aec45a7Smrg
76146aec45a7Smrgif test -n "$compiler"; then
76156aec45a7Smrg  :
76166aec45a7Smrg  _LT_CONFIG($1)
76176aec45a7Smrgfi
76186aec45a7Smrg
76196aec45a7SmrgGCC=$lt_save_GCC
76206aec45a7SmrgAC_LANG_RESTORE
7621aa9e3350SmrgCC=$lt_save_CC
7622aa9e3350SmrgCFLAGS=$lt_save_CFLAGS
76236aec45a7Smrg])# _LT_LANG_RC_CONFIG
76246aec45a7Smrg
76256aec45a7Smrg
76266aec45a7Smrg# LT_PROG_GCJ
76276aec45a7Smrg# -----------
76286aec45a7SmrgAC_DEFUN([LT_PROG_GCJ],
76296aec45a7Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
76306aec45a7Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
76316aec45a7Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
76326aec45a7Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
76336aec45a7Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
76346aec45a7Smrg])
76356aec45a7Smrg
76366aec45a7Smrg# Old name:
76376aec45a7SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
76386aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
76396aec45a7Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
76406aec45a7Smrg
76416aec45a7Smrg
7642aa9e3350Smrg# LT_PROG_GO
7643aa9e3350Smrg# ----------
7644aa9e3350SmrgAC_DEFUN([LT_PROG_GO],
7645aa9e3350Smrg[AC_CHECK_TOOL(GOC, gccgo,)
7646aa9e3350Smrg])
7647aa9e3350Smrg
7648aa9e3350Smrg
76496aec45a7Smrg# LT_PROG_RC
76506aec45a7Smrg# ----------
76516aec45a7SmrgAC_DEFUN([LT_PROG_RC],
76526aec45a7Smrg[AC_CHECK_TOOL(RC, windres,)
76536aec45a7Smrg])
76546aec45a7Smrg
76556aec45a7Smrg# Old name:
76566aec45a7SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
76576aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
76586aec45a7Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
76596aec45a7Smrg
76606aec45a7Smrg
76616aec45a7Smrg# _LT_DECL_EGREP
76626aec45a7Smrg# --------------
76636aec45a7Smrg# If we don't have a new enough Autoconf to choose the best grep
76646aec45a7Smrg# available, choose the one first in the user's PATH.
76656aec45a7Smrgm4_defun([_LT_DECL_EGREP],
76666aec45a7Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
76676aec45a7SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
76686aec45a7Smrgtest -z "$GREP" && GREP=grep
76696aec45a7Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
76706aec45a7Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
76716aec45a7Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
76726aec45a7Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
76736aec45a7SmrgAC_SUBST([GREP])
76746aec45a7Smrg])
76756aec45a7Smrg
76766aec45a7Smrg
76776aec45a7Smrg# _LT_DECL_OBJDUMP
76786aec45a7Smrg# --------------
76796aec45a7Smrg# If we don't have a new enough Autoconf to choose the best objdump
76806aec45a7Smrg# available, choose the one first in the user's PATH.
76816aec45a7Smrgm4_defun([_LT_DECL_OBJDUMP],
76826aec45a7Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
76836aec45a7Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
76846aec45a7Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
76856aec45a7SmrgAC_SUBST([OBJDUMP])
76866aec45a7Smrg])
76876aec45a7Smrg
7688aa9e3350Smrg# _LT_DECL_DLLTOOL
7689aa9e3350Smrg# ----------------
7690aa9e3350Smrg# Ensure DLLTOOL variable is set.
7691aa9e3350Smrgm4_defun([_LT_DECL_DLLTOOL],
7692aa9e3350Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
7693aa9e3350Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
7694aa9e3350Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
7695aa9e3350SmrgAC_SUBST([DLLTOOL])
7696aa9e3350Smrg])
76976aec45a7Smrg
76986aec45a7Smrg# _LT_DECL_SED
76996aec45a7Smrg# ------------
77006aec45a7Smrg# Check for a fully-functional sed program, that truncates
77016aec45a7Smrg# as few characters as possible.  Prefer GNU sed if found.
77026aec45a7Smrgm4_defun([_LT_DECL_SED],
77036aec45a7Smrg[AC_PROG_SED
77046aec45a7Smrgtest -z "$SED" && SED=sed
77056aec45a7SmrgXsed="$SED -e 1s/^X//"
77066aec45a7Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
77076aec45a7Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
77086aec45a7Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
77096aec45a7Smrg])# _LT_DECL_SED
77106aec45a7Smrg
77116aec45a7Smrgm4_ifndef([AC_PROG_SED], [
77126aec45a7Smrg# NOTE: This macro has been submitted for inclusion into   #
77136aec45a7Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
77146aec45a7Smrg#  a released version of Autoconf we should remove this    #
77156aec45a7Smrg#  macro and use it instead.                               #
77166aec45a7Smrg
77176aec45a7Smrgm4_defun([AC_PROG_SED],
77186aec45a7Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
77196aec45a7SmrgAC_CACHE_VAL(lt_cv_path_SED,
77206aec45a7Smrg[# Loop through the user's path and test for sed and gsed.
77216aec45a7Smrg# Then use that list of sed's as ones to test for truncation.
77226aec45a7Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
77236aec45a7Smrgfor as_dir in $PATH
77246aec45a7Smrgdo
77256aec45a7Smrg  IFS=$as_save_IFS
77266aec45a7Smrg  test -z "$as_dir" && as_dir=.
77276aec45a7Smrg  for lt_ac_prog in sed gsed; do
77286aec45a7Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
77296aec45a7Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
77306aec45a7Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
77316aec45a7Smrg      fi
77326aec45a7Smrg    done
77336aec45a7Smrg  done
77346aec45a7Smrgdone
77356aec45a7SmrgIFS=$as_save_IFS
77366aec45a7Smrglt_ac_max=0
77376aec45a7Smrglt_ac_count=0
77386aec45a7Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
77396aec45a7Smrg# along with /bin/sed that truncates output.
77406aec45a7Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
77416aec45a7Smrg  test ! -f $lt_ac_sed && continue
77426aec45a7Smrg  cat /dev/null > conftest.in
77436aec45a7Smrg  lt_ac_count=0
77446aec45a7Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
77456aec45a7Smrg  # Check for GNU sed and select it if it is found.
77466aec45a7Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
77476aec45a7Smrg    lt_cv_path_SED=$lt_ac_sed
77486aec45a7Smrg    break
77496aec45a7Smrg  fi
77506aec45a7Smrg  while true; do
77516aec45a7Smrg    cat conftest.in conftest.in >conftest.tmp
77526aec45a7Smrg    mv conftest.tmp conftest.in
77536aec45a7Smrg    cp conftest.in conftest.nl
77546aec45a7Smrg    echo >>conftest.nl
77556aec45a7Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
77566aec45a7Smrg    cmp -s conftest.out conftest.nl || break
77576aec45a7Smrg    # 10000 chars as input seems more than enough
77586aec45a7Smrg    test $lt_ac_count -gt 10 && break
77596aec45a7Smrg    lt_ac_count=`expr $lt_ac_count + 1`
77606aec45a7Smrg    if test $lt_ac_count -gt $lt_ac_max; then
77616aec45a7Smrg      lt_ac_max=$lt_ac_count
77626aec45a7Smrg      lt_cv_path_SED=$lt_ac_sed
77636aec45a7Smrg    fi
77646aec45a7Smrg  done
77656aec45a7Smrgdone
77666aec45a7Smrg])
77676aec45a7SmrgSED=$lt_cv_path_SED
77686aec45a7SmrgAC_SUBST([SED])
77696aec45a7SmrgAC_MSG_RESULT([$SED])
77706aec45a7Smrg])#AC_PROG_SED
77716aec45a7Smrg])#m4_ifndef
77721473d951Smrg
77736aec45a7Smrg# Old name:
77746aec45a7SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
77756aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
77766aec45a7Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
77771473d951Smrg
77781473d951Smrg
77796aec45a7Smrg# _LT_CHECK_SHELL_FEATURES
77806aec45a7Smrg# ------------------------
77816aec45a7Smrg# Find out whether the shell is Bourne or XSI compatible,
77826aec45a7Smrg# or has some other useful features.
77836aec45a7Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
77846aec45a7Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
77856aec45a7Smrg# Try some XSI features
77866aec45a7Smrgxsi_shell=no
77876aec45a7Smrg( _lt_dummy="a/b/c"
7788aa9e3350Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
7789aa9e3350Smrg      = c,a/b,b/c, \
77906aec45a7Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
77916aec45a7Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
77926aec45a7Smrg  && xsi_shell=yes
77936aec45a7SmrgAC_MSG_RESULT([$xsi_shell])
77946aec45a7Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
77956aec45a7Smrg
77966aec45a7SmrgAC_MSG_CHECKING([whether the shell understands "+="])
77976aec45a7Smrglt_shell_append=no
77986aec45a7Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
77996aec45a7Smrg    >/dev/null 2>&1 \
78006aec45a7Smrg  && lt_shell_append=yes
78016aec45a7SmrgAC_MSG_RESULT([$lt_shell_append])
78026aec45a7Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
78036aec45a7Smrg
78046aec45a7Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
78056aec45a7Smrg  lt_unset=unset
78066aec45a7Smrgelse
78076aec45a7Smrg  lt_unset=false
78086aec45a7Smrgfi
78096aec45a7Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
78106aec45a7Smrg
78116aec45a7Smrg# test EBCDIC or ASCII
78126aec45a7Smrgcase `echo X|tr X '\101'` in
78136aec45a7Smrg A) # ASCII based system
78146aec45a7Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
78156aec45a7Smrg  lt_SP2NL='tr \040 \012'
78166aec45a7Smrg  lt_NL2SP='tr \015\012 \040\040'
78176aec45a7Smrg  ;;
78186aec45a7Smrg *) # EBCDIC based system
78196aec45a7Smrg  lt_SP2NL='tr \100 \n'
78206aec45a7Smrg  lt_NL2SP='tr \r\n \100\100'
78216aec45a7Smrg  ;;
78226aec45a7Smrgesac
78236aec45a7Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
78246aec45a7Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
78256aec45a7Smrg])# _LT_CHECK_SHELL_FEATURES
78261473d951Smrg
78271473d951Smrg
7828aa9e3350Smrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
7829aa9e3350Smrg# ------------------------------------------------------
7830aa9e3350Smrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
7831aa9e3350Smrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
7832aa9e3350Smrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
7833aa9e3350Smrg[dnl {
7834aa9e3350Smrgsed -e '/^$1 ()$/,/^} # $1 /c\
7835aa9e3350Smrg$1 ()\
7836aa9e3350Smrg{\
7837aa9e3350Smrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
7838aa9e3350Smrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
7839aa9e3350Smrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
7840aa9e3350Smrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7841aa9e3350Smrgtest 0 -eq $? || _lt_function_replace_fail=:
7842aa9e3350Smrg])
7843ab47cfaaSmrg
7844ab47cfaaSmrg
7845aa9e3350Smrg# _LT_PROG_REPLACE_SHELLFNS
7846aa9e3350Smrg# -------------------------
7847aa9e3350Smrg# Replace existing portable implementations of several shell functions with
7848aa9e3350Smrg# equivalent extended shell implementations where those features are available..
7849aa9e3350Smrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
7850aa9e3350Smrg[if test x"$xsi_shell" = xyes; then
7851aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
7852aa9e3350Smrg    case ${1} in
7853aa9e3350Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
7854aa9e3350Smrg      *  ) func_dirname_result="${3}" ;;
7855aa9e3350Smrg    esac])
7856aa9e3350Smrg
7857aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
7858aa9e3350Smrg    func_basename_result="${1##*/}"])
7859aa9e3350Smrg
7860aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
7861aa9e3350Smrg    case ${1} in
7862aa9e3350Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
7863aa9e3350Smrg      *  ) func_dirname_result="${3}" ;;
7864aa9e3350Smrg    esac
7865aa9e3350Smrg    func_basename_result="${1##*/}"])
7866ab47cfaaSmrg
7867aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
7868aa9e3350Smrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7869aa9e3350Smrg    # positional parameters, so assign one to ordinary parameter first.
7870aa9e3350Smrg    func_stripname_result=${3}
7871aa9e3350Smrg    func_stripname_result=${func_stripname_result#"${1}"}
7872aa9e3350Smrg    func_stripname_result=${func_stripname_result%"${2}"}])
7873ab47cfaaSmrg
7874aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
7875aa9e3350Smrg    func_split_long_opt_name=${1%%=*}
7876aa9e3350Smrg    func_split_long_opt_arg=${1#*=}])
7877ab47cfaaSmrg
7878aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
7879aa9e3350Smrg    func_split_short_opt_arg=${1#??}
7880aa9e3350Smrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
78816aec45a7Smrg
7882aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
7883aa9e3350Smrg    case ${1} in
7884aa9e3350Smrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7885aa9e3350Smrg      *)    func_lo2o_result=${1} ;;
7886aa9e3350Smrg    esac])
7887ab47cfaaSmrg
7888aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
7889ab47cfaaSmrg
7890aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
7891ab47cfaaSmrg
7892aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
7893aa9e3350Smrgfi
78945c42550eSmrg
7895aa9e3350Smrgif test x"$lt_shell_append" = xyes; then
7896aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
7897ab47cfaaSmrg
7898aa9e3350Smrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
7899aa9e3350Smrg    func_quote_for_eval "${2}"
7900aa9e3350Smrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
7901aa9e3350Smrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
79025c42550eSmrg
7903aa9e3350Smrg  # Save a `func_append' function call where possible by direct use of '+='
7904aa9e3350Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
7905aa9e3350Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
7906aa9e3350Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7907aa9e3350Smrg  test 0 -eq $? || _lt_function_replace_fail=:
7908aa9e3350Smrgelse
7909aa9e3350Smrg  # Save a `func_append' function call even when '+=' is not available
7910aa9e3350Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
7911aa9e3350Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
7912aa9e3350Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7913aa9e3350Smrg  test 0 -eq $? || _lt_function_replace_fail=:
7914aa9e3350Smrgfi
79155c42550eSmrg
7916aa9e3350Smrgif test x"$_lt_function_replace_fail" = x":"; then
7917aa9e3350Smrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
7918aa9e3350Smrgfi
7919aa9e3350Smrg])
79205c42550eSmrg
7921aa9e3350Smrg# _LT_PATH_CONVERSION_FUNCTIONS
7922aa9e3350Smrg# -----------------------------
7923aa9e3350Smrg# Determine which file name conversion functions should be used by
7924aa9e3350Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
7925aa9e3350Smrg# for certain cross-compile configurations and native mingw.
7926aa9e3350Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
7927aa9e3350Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7928aa9e3350SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
7929aa9e3350SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
7930aa9e3350SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
7931aa9e3350Smrg[case $host in
7932aa9e3350Smrg  *-*-mingw* )
7933aa9e3350Smrg    case $build in
7934aa9e3350Smrg      *-*-mingw* ) # actually msys
7935aa9e3350Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
7936aa9e3350Smrg        ;;
7937aa9e3350Smrg      *-*-cygwin* )
7938aa9e3350Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
7939aa9e3350Smrg        ;;
7940aa9e3350Smrg      * ) # otherwise, assume *nix
7941aa9e3350Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
7942aa9e3350Smrg        ;;
7943aa9e3350Smrg    esac
79446aec45a7Smrg    ;;
7945aa9e3350Smrg  *-*-cygwin* )
7946aa9e3350Smrg    case $build in
7947aa9e3350Smrg      *-*-mingw* ) # actually msys
7948aa9e3350Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
7949aa9e3350Smrg        ;;
7950aa9e3350Smrg      *-*-cygwin* )
7951aa9e3350Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
7952aa9e3350Smrg        ;;
7953aa9e3350Smrg      * ) # otherwise, assume *nix
7954aa9e3350Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
7955aa9e3350Smrg        ;;
7956aa9e3350Smrg    esac
79576aec45a7Smrg    ;;
7958aa9e3350Smrg  * ) # unhandled hosts (and "normal" native builds)
7959aa9e3350Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
7960aa9e3350Smrg    ;;
7961aa9e3350Smrgesac
79626aec45a7Smrg])
7963aa9e3350Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
7964aa9e3350SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
7965aa9e3350Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
7966aa9e3350Smrg         [0], [convert $build file names to $host format])dnl
7967aa9e3350Smrg
7968aa9e3350SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
7969aa9e3350SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
7970aa9e3350Smrg[#assume ordinary cross tools, or native build.
7971aa9e3350Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
7972aa9e3350Smrgcase $host in
7973aa9e3350Smrg  *-*-mingw* )
7974aa9e3350Smrg    case $build in
7975aa9e3350Smrg      *-*-mingw* ) # actually msys
7976aa9e3350Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
7977aa9e3350Smrg        ;;
7978aa9e3350Smrg    esac
7979aa9e3350Smrg    ;;
7980aa9e3350Smrgesac
7981aa9e3350Smrg])
7982aa9e3350Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
7983aa9e3350SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
7984aa9e3350Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
7985aa9e3350Smrg         [0], [convert $build files to toolchain format])dnl
7986aa9e3350Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
7987ab47cfaaSmrg
79886aec45a7Smrg# Helper functions for option handling.                    -*- Autoconf -*-
79896aec45a7Smrg#
79906aec45a7Smrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
79916aec45a7Smrg#   Inc.
79926aec45a7Smrg#   Written by Gary V. Vaughan, 2004
79936aec45a7Smrg#
79946aec45a7Smrg# This file is free software; the Free Software Foundation gives
79956aec45a7Smrg# unlimited permission to copy and/or distribute it, with or without
79966aec45a7Smrg# modifications, as long as this notice is preserved.
7997ab47cfaaSmrg
79986aec45a7Smrg# serial 7 ltoptions.m4
7999ab47cfaaSmrg
80006aec45a7Smrg# This is to help aclocal find these macros, as it can't see m4_define.
80016aec45a7SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8002ab47cfaaSmrg
8003ab47cfaaSmrg
80046aec45a7Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
80056aec45a7Smrg# ------------------------------------------
80066aec45a7Smrgm4_define([_LT_MANGLE_OPTION],
80076aec45a7Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8008ab47cfaaSmrg
8009ab47cfaaSmrg
80106aec45a7Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
80116aec45a7Smrg# ---------------------------------------
80126aec45a7Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
80136aec45a7Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
80146aec45a7Smrg# saved as a flag.
80156aec45a7Smrgm4_define([_LT_SET_OPTION],
80166aec45a7Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
80176aec45a7Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
80186aec45a7Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
80196aec45a7Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
80206aec45a7Smrg])
8021ab47cfaaSmrg
8022ab47cfaaSmrg
80236aec45a7Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
80246aec45a7Smrg# ------------------------------------------------------------
80256aec45a7Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
80266aec45a7Smrgm4_define([_LT_IF_OPTION],
80276aec45a7Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
80286aec45a7Smrg
80296aec45a7Smrg
80306aec45a7Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
80316aec45a7Smrg# -------------------------------------------------------
80326aec45a7Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
80336aec45a7Smrg# are set.
80346aec45a7Smrgm4_define([_LT_UNLESS_OPTIONS],
80356aec45a7Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
80366aec45a7Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
80376aec45a7Smrg		      [m4_define([$0_found])])])[]dnl
80386aec45a7Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
80396aec45a7Smrg])[]dnl
80406aec45a7Smrg])
8041ab47cfaaSmrg
8042ab47cfaaSmrg
80436aec45a7Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
80446aec45a7Smrg# ----------------------------------------
80456aec45a7Smrg# OPTION-LIST is a space-separated list of Libtool options associated
80466aec45a7Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
80476aec45a7Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
80486aec45a7Smrg# the unknown option and exit.
80496aec45a7Smrgm4_defun([_LT_SET_OPTIONS],
80506aec45a7Smrg[# Set options
80516aec45a7Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
80526aec45a7Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
80536aec45a7Smrg
80546aec45a7Smrgm4_if([$1],[LT_INIT],[
80556aec45a7Smrg  dnl
80566aec45a7Smrg  dnl Simply set some default values (i.e off) if boolean options were not
80576aec45a7Smrg  dnl specified:
80586aec45a7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
80596aec45a7Smrg  ])
80606aec45a7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
80616aec45a7Smrg  ])
80626aec45a7Smrg  dnl
80636aec45a7Smrg  dnl If no reference was made to various pairs of opposing options, then
80646aec45a7Smrg  dnl we run the default mode handler for the pair.  For example, if neither
80656aec45a7Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
80666aec45a7Smrg  dnl archives by default:
80676aec45a7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
80686aec45a7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
80696aec45a7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
80706aec45a7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
80716aec45a7Smrg  		   [_LT_ENABLE_FAST_INSTALL])
80726aec45a7Smrg  ])
80736aec45a7Smrg])# _LT_SET_OPTIONS
8074ab47cfaaSmrg
8075ab47cfaaSmrg
8076ab47cfaaSmrg
80776aec45a7Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
80786aec45a7Smrg# -----------------------------------------
80796aec45a7Smrgm4_define([_LT_MANGLE_DEFUN],
80806aec45a7Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8081ab47cfaaSmrg
80821473d951Smrg
80836aec45a7Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
80846aec45a7Smrg# -----------------------------------------------
80856aec45a7Smrgm4_define([LT_OPTION_DEFINE],
80866aec45a7Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
80876aec45a7Smrg])# LT_OPTION_DEFINE
80881473d951Smrg
80891473d951Smrg
80906aec45a7Smrg# dlopen
80916aec45a7Smrg# ------
80926aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
80936aec45a7Smrg])
80941473d951Smrg
80956aec45a7SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
80966aec45a7Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
80976aec45a7SmrgAC_DIAGNOSE([obsolete],
80986aec45a7Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
80996aec45a7Smrgput the `dlopen' option into LT_INIT's first parameter.])
81006aec45a7Smrg])
8101ab47cfaaSmrg
81026aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
81036aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8104ab47cfaaSmrg
8105ab47cfaaSmrg
81066aec45a7Smrg# win32-dll
81076aec45a7Smrg# ---------
81086aec45a7Smrg# Declare package support for building win32 dll's.
81096aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
81106aec45a7Smrg[enable_win32_dll=yes
8111ab47cfaaSmrg
81126aec45a7Smrgcase $host in
81136aec45a7Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
81146aec45a7Smrg  AC_CHECK_TOOL(AS, as, false)
81156aec45a7Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
81166aec45a7Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
81176aec45a7Smrg  ;;
81186aec45a7Smrgesac
8119ab47cfaaSmrg
81206aec45a7Smrgtest -z "$AS" && AS=as
81216aec45a7Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
8122ab47cfaaSmrg
81236aec45a7Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
81246aec45a7Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
8125ab47cfaaSmrg
81266aec45a7Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
81276aec45a7Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
81286aec45a7Smrg])# win32-dll
8129ab47cfaaSmrg
81306aec45a7SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
81316aec45a7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
81326aec45a7Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
81336aec45a7SmrgAC_DIAGNOSE([obsolete],
81346aec45a7Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
81356aec45a7Smrgput the `win32-dll' option into LT_INIT's first parameter.])
81366aec45a7Smrg])
8137ab47cfaaSmrg
81386aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
81396aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8140ab47cfaaSmrg
8141ab47cfaaSmrg
81426aec45a7Smrg# _LT_ENABLE_SHARED([DEFAULT])
81436aec45a7Smrg# ----------------------------
81446aec45a7Smrg# implement the --enable-shared flag, and supports the `shared' and
81456aec45a7Smrg# `disable-shared' LT_INIT options.
81466aec45a7Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
81476aec45a7Smrgm4_define([_LT_ENABLE_SHARED],
81486aec45a7Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
81496aec45a7SmrgAC_ARG_ENABLE([shared],
81506aec45a7Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
81516aec45a7Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
81526aec45a7Smrg    [p=${PACKAGE-default}
81536aec45a7Smrg    case $enableval in
81546aec45a7Smrg    yes) enable_shared=yes ;;
81556aec45a7Smrg    no) enable_shared=no ;;
81566aec45a7Smrg    *)
81576aec45a7Smrg      enable_shared=no
81586aec45a7Smrg      # Look at the argument we got.  We use all the common list separators.
81596aec45a7Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
81606aec45a7Smrg      for pkg in $enableval; do
81616aec45a7Smrg	IFS="$lt_save_ifs"
81626aec45a7Smrg	if test "X$pkg" = "X$p"; then
81636aec45a7Smrg	  enable_shared=yes
81646aec45a7Smrg	fi
81656aec45a7Smrg      done
81666aec45a7Smrg      IFS="$lt_save_ifs"
81675c42550eSmrg      ;;
81686aec45a7Smrg    esac],
81696aec45a7Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8170ab47cfaaSmrg
81716aec45a7Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
81726aec45a7Smrg	[Whether or not to build shared libraries])
81736aec45a7Smrg])# _LT_ENABLE_SHARED
8174ab47cfaaSmrg
81756aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
81766aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8177ab47cfaaSmrg
81786aec45a7Smrg# Old names:
81796aec45a7SmrgAC_DEFUN([AC_ENABLE_SHARED],
81806aec45a7Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
81816aec45a7Smrg])
8182ab47cfaaSmrg
81836aec45a7SmrgAC_DEFUN([AC_DISABLE_SHARED],
81846aec45a7Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
81856aec45a7Smrg])
8186ab47cfaaSmrg
81876aec45a7SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
81886aec45a7SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8189ab47cfaaSmrg
81906aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
81916aec45a7Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
81926aec45a7Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8193ab47cfaaSmrg
8194ab47cfaaSmrg
8195ab47cfaaSmrg
81966aec45a7Smrg# _LT_ENABLE_STATIC([DEFAULT])
81976aec45a7Smrg# ----------------------------
81986aec45a7Smrg# implement the --enable-static flag, and support the `static' and
81996aec45a7Smrg# `disable-static' LT_INIT options.
82006aec45a7Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
82016aec45a7Smrgm4_define([_LT_ENABLE_STATIC],
82026aec45a7Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
82036aec45a7SmrgAC_ARG_ENABLE([static],
82046aec45a7Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
82056aec45a7Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
82066aec45a7Smrg    [p=${PACKAGE-default}
82076aec45a7Smrg    case $enableval in
82086aec45a7Smrg    yes) enable_static=yes ;;
82096aec45a7Smrg    no) enable_static=no ;;
82106aec45a7Smrg    *)
82116aec45a7Smrg     enable_static=no
82126aec45a7Smrg      # Look at the argument we got.  We use all the common list separators.
82136aec45a7Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
82146aec45a7Smrg      for pkg in $enableval; do
82156aec45a7Smrg	IFS="$lt_save_ifs"
82166aec45a7Smrg	if test "X$pkg" = "X$p"; then
82176aec45a7Smrg	  enable_static=yes
82186aec45a7Smrg	fi
82196aec45a7Smrg      done
82206aec45a7Smrg      IFS="$lt_save_ifs"
82215c42550eSmrg      ;;
82226aec45a7Smrg    esac],
82236aec45a7Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8224ab47cfaaSmrg
82256aec45a7Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
82266aec45a7Smrg	[Whether or not to build static libraries])
82276aec45a7Smrg])# _LT_ENABLE_STATIC
8228ab47cfaaSmrg
82296aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
82306aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8231ab47cfaaSmrg
82326aec45a7Smrg# Old names:
82336aec45a7SmrgAC_DEFUN([AC_ENABLE_STATIC],
82346aec45a7Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
82356aec45a7Smrg])
82361473d951Smrg
82376aec45a7SmrgAC_DEFUN([AC_DISABLE_STATIC],
82386aec45a7Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
82396aec45a7Smrg])
8240ab47cfaaSmrg
82416aec45a7SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
82426aec45a7SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8243ab47cfaaSmrg
82446aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
82456aec45a7Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
82466aec45a7Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8247ab47cfaaSmrg
8248ab47cfaaSmrg
8249ab47cfaaSmrg
82506aec45a7Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
82516aec45a7Smrg# ----------------------------------
82526aec45a7Smrg# implement the --enable-fast-install flag, and support the `fast-install'
82536aec45a7Smrg# and `disable-fast-install' LT_INIT options.
82546aec45a7Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
82556aec45a7Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
82566aec45a7Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
82576aec45a7SmrgAC_ARG_ENABLE([fast-install],
82586aec45a7Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
82596aec45a7Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
82606aec45a7Smrg    [p=${PACKAGE-default}
82616aec45a7Smrg    case $enableval in
82626aec45a7Smrg    yes) enable_fast_install=yes ;;
82636aec45a7Smrg    no) enable_fast_install=no ;;
82646aec45a7Smrg    *)
82656aec45a7Smrg      enable_fast_install=no
82666aec45a7Smrg      # Look at the argument we got.  We use all the common list separators.
82676aec45a7Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
82686aec45a7Smrg      for pkg in $enableval; do
82696aec45a7Smrg	IFS="$lt_save_ifs"
82706aec45a7Smrg	if test "X$pkg" = "X$p"; then
82716aec45a7Smrg	  enable_fast_install=yes
82725c42550eSmrg	fi
82736aec45a7Smrg      done
82746aec45a7Smrg      IFS="$lt_save_ifs"
82755c42550eSmrg      ;;
82766aec45a7Smrg    esac],
82776aec45a7Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8278ab47cfaaSmrg
82796aec45a7Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
82806aec45a7Smrg	 [Whether or not to optimize for fast installation])dnl
82816aec45a7Smrg])# _LT_ENABLE_FAST_INSTALL
8282ab47cfaaSmrg
82836aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
82846aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8285ab47cfaaSmrg
82866aec45a7Smrg# Old names:
82876aec45a7SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
82886aec45a7Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
82896aec45a7SmrgAC_DIAGNOSE([obsolete],
82906aec45a7Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
82916aec45a7Smrgthe `fast-install' option into LT_INIT's first parameter.])
82926aec45a7Smrg])
8293ab47cfaaSmrg
82946aec45a7SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
82956aec45a7Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
82966aec45a7SmrgAC_DIAGNOSE([obsolete],
82976aec45a7Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
82986aec45a7Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
82996aec45a7Smrg])
8300ab47cfaaSmrg
83016aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
83026aec45a7Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
83036aec45a7Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
83041473d951Smrg
8305ab47cfaaSmrg
83066aec45a7Smrg# _LT_WITH_PIC([MODE])
83076aec45a7Smrg# --------------------
83086aec45a7Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
83096aec45a7Smrg# LT_INIT options.
83106aec45a7Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
83116aec45a7Smrgm4_define([_LT_WITH_PIC],
83126aec45a7Smrg[AC_ARG_WITH([pic],
8313aa9e3350Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
83146aec45a7Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
8315aa9e3350Smrg    [lt_p=${PACKAGE-default}
8316aa9e3350Smrg    case $withval in
8317aa9e3350Smrg    yes|no) pic_mode=$withval ;;
8318aa9e3350Smrg    *)
8319aa9e3350Smrg      pic_mode=default
8320aa9e3350Smrg      # Look at the argument we got.  We use all the common list separators.
8321aa9e3350Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8322aa9e3350Smrg      for lt_pkg in $withval; do
8323aa9e3350Smrg	IFS="$lt_save_ifs"
8324aa9e3350Smrg	if test "X$lt_pkg" = "X$lt_p"; then
8325aa9e3350Smrg	  pic_mode=yes
8326aa9e3350Smrg	fi
8327aa9e3350Smrg      done
8328aa9e3350Smrg      IFS="$lt_save_ifs"
8329aa9e3350Smrg      ;;
8330aa9e3350Smrg    esac],
83316aec45a7Smrg    [pic_mode=default])
8332ab47cfaaSmrg
83336aec45a7Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
8334ab47cfaaSmrg
83356aec45a7Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
83366aec45a7Smrg])# _LT_WITH_PIC
8337ab47cfaaSmrg
83386aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
83396aec45a7SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
83406aec45a7Smrg
83416aec45a7Smrg# Old name:
83426aec45a7SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
83436aec45a7Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
83446aec45a7SmrgAC_DIAGNOSE([obsolete],
83456aec45a7Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
83466aec45a7Smrgput the `pic-only' option into LT_INIT's first parameter.])
83475c42550eSmrg])
8348ab47cfaaSmrg
83496aec45a7Smrgdnl aclocal-1.4 backwards compatibility:
83506aec45a7Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
83511473d951Smrg
83521473d951Smrg
83536aec45a7Smrgm4_define([_LTDL_MODE], [])
83546aec45a7SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
83556aec45a7Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
83566aec45a7SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
83576aec45a7Smrg		 [m4_define([_LTDL_MODE], [recursive])])
83586aec45a7SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
83596aec45a7Smrg		 [m4_define([_LTDL_MODE], [subproject])])
83601473d951Smrg
83616aec45a7Smrgm4_define([_LTDL_TYPE], [])
83626aec45a7SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
83636aec45a7Smrg		 [m4_define([_LTDL_TYPE], [installable])])
83646aec45a7SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
83656aec45a7Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
83666aec45a7Smrg
83676aec45a7Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
83685c42550eSmrg#
83696aec45a7Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
83706aec45a7Smrg# Written by Gary V. Vaughan, 2004
83715c42550eSmrg#
83726aec45a7Smrg# This file is free software; the Free Software Foundation gives
83736aec45a7Smrg# unlimited permission to copy and/or distribute it, with or without
83746aec45a7Smrg# modifications, as long as this notice is preserved.
83756aec45a7Smrg
83766aec45a7Smrg# serial 6 ltsugar.m4
83776aec45a7Smrg
83786aec45a7Smrg# This is to help aclocal find these macros, as it can't see m4_define.
83796aec45a7SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
83806aec45a7Smrg
83816aec45a7Smrg
83826aec45a7Smrg# lt_join(SEP, ARG1, [ARG2...])
83836aec45a7Smrg# -----------------------------
83846aec45a7Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
83856aec45a7Smrg# associated separator.
83866aec45a7Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
83876aec45a7Smrg# versions in m4sugar had bugs.
83886aec45a7Smrgm4_define([lt_join],
83896aec45a7Smrg[m4_if([$#], [1], [],
83906aec45a7Smrg       [$#], [2], [[$2]],
83916aec45a7Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
83926aec45a7Smrgm4_define([_lt_join],
83936aec45a7Smrg[m4_if([$#$2], [2], [],
83946aec45a7Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
83956aec45a7Smrg
83966aec45a7Smrg
83976aec45a7Smrg# lt_car(LIST)
83986aec45a7Smrg# lt_cdr(LIST)
83996aec45a7Smrg# ------------
84006aec45a7Smrg# Manipulate m4 lists.
84016aec45a7Smrg# These macros are necessary as long as will still need to support
84026aec45a7Smrg# Autoconf-2.59 which quotes differently.
84036aec45a7Smrgm4_define([lt_car], [[$1]])
84046aec45a7Smrgm4_define([lt_cdr],
84056aec45a7Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
84066aec45a7Smrg       [$#], 1, [],
84076aec45a7Smrg       [m4_dquote(m4_shift($@))])])
84086aec45a7Smrgm4_define([lt_unquote], $1)
84096aec45a7Smrg
84106aec45a7Smrg
84116aec45a7Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
84126aec45a7Smrg# ------------------------------------------
84136aec45a7Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
84146aec45a7Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
84156aec45a7Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
84166aec45a7Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
84176aec45a7Smrg# than defined and empty).
84185c42550eSmrg#
84196aec45a7Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
84206aec45a7Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
84216aec45a7Smrgm4_define([lt_append],
84226aec45a7Smrg[m4_define([$1],
84236aec45a7Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
84246aec45a7Smrg
84256aec45a7Smrg
84266aec45a7Smrg
84276aec45a7Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
84286aec45a7Smrg# ----------------------------------------------------------
84296aec45a7Smrg# Produce a SEP delimited list of all paired combinations of elements of
84306aec45a7Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
84316aec45a7Smrg# has the form PREFIXmINFIXSUFFIXn.
84326aec45a7Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
84336aec45a7Smrgm4_define([lt_combine],
84346aec45a7Smrg[m4_if(m4_eval([$# > 3]), [1],
84356aec45a7Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
84366aec45a7Smrg[[m4_foreach([_Lt_prefix], [$2],
84376aec45a7Smrg	     [m4_foreach([_Lt_suffix],
84386aec45a7Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
84396aec45a7Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
84406aec45a7Smrg
84416aec45a7Smrg
84426aec45a7Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
84436aec45a7Smrg# -----------------------------------------------------------------------
84446aec45a7Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
84456aec45a7Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
84466aec45a7Smrgm4_define([lt_if_append_uniq],
84476aec45a7Smrg[m4_ifdef([$1],
84486aec45a7Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
84496aec45a7Smrg		 [lt_append([$1], [$2], [$3])$4],
84506aec45a7Smrg		 [$5])],
84516aec45a7Smrg	  [lt_append([$1], [$2], [$3])$4])])
84526aec45a7Smrg
84536aec45a7Smrg
84546aec45a7Smrg# lt_dict_add(DICT, KEY, VALUE)
84556aec45a7Smrg# -----------------------------
84566aec45a7Smrgm4_define([lt_dict_add],
84576aec45a7Smrg[m4_define([$1($2)], [$3])])
8458ab47cfaaSmrg
84591473d951Smrg
84606aec45a7Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
84616aec45a7Smrg# --------------------------------------------
84626aec45a7Smrgm4_define([lt_dict_add_subkey],
84636aec45a7Smrg[m4_define([$1($2:$3)], [$4])])
8464ab47cfaaSmrg
8465ab47cfaaSmrg
84666aec45a7Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
84676aec45a7Smrg# ----------------------------------
84686aec45a7Smrgm4_define([lt_dict_fetch],
84696aec45a7Smrg[m4_ifval([$3],
84706aec45a7Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
84716aec45a7Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8472ab47cfaaSmrg
8473ab47cfaaSmrg
84746aec45a7Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
84756aec45a7Smrg# -----------------------------------------------------------------
84766aec45a7Smrgm4_define([lt_if_dict_fetch],
84776aec45a7Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
84786aec45a7Smrg	[$5],
84796aec45a7Smrg    [$6])])
8480ab47cfaaSmrg
8481ab47cfaaSmrg
84826aec45a7Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
84836aec45a7Smrg# --------------------------------------------------------------
84846aec45a7Smrgm4_define([lt_dict_filter],
84856aec45a7Smrg[m4_if([$5], [], [],
84866aec45a7Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
84876aec45a7Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
84886aec45a7Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
84896aec45a7Smrg])
84908697ee19Smrg
84916aec45a7Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
84926aec45a7Smrg#
84936aec45a7Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
84946aec45a7Smrg#   Written by Scott James Remnant, 2004
84956aec45a7Smrg#
84966aec45a7Smrg# This file is free software; the Free Software Foundation gives
84976aec45a7Smrg# unlimited permission to copy and/or distribute it, with or without
84986aec45a7Smrg# modifications, as long as this notice is preserved.
84998697ee19Smrg
8500aa9e3350Smrg# @configure_input@
85018697ee19Smrg
8502aa9e3350Smrg# serial 3337 ltversion.m4
85036aec45a7Smrg# This file is part of GNU Libtool
85048697ee19Smrg
8505aa9e3350Smrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
8506aa9e3350Smrgm4_define([LT_PACKAGE_REVISION], [1.3337])
85076aec45a7Smrg
85086aec45a7SmrgAC_DEFUN([LTVERSION_VERSION],
8509aa9e3350Smrg[macro_version='2.4.2'
8510aa9e3350Smrgmacro_revision='1.3337'
85116aec45a7Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
85126aec45a7Smrg_LT_DECL(, macro_revision, 0)
8513ab47cfaaSmrg])
85141473d951Smrg
85156aec45a7Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
85166aec45a7Smrg#
85176aec45a7Smrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
85186aec45a7Smrg#   Written by Scott James Remnant, 2004.
85196aec45a7Smrg#
85206aec45a7Smrg# This file is free software; the Free Software Foundation gives
85216aec45a7Smrg# unlimited permission to copy and/or distribute it, with or without
85226aec45a7Smrg# modifications, as long as this notice is preserved.
85236aec45a7Smrg
85246aec45a7Smrg# serial 5 lt~obsolete.m4
85256aec45a7Smrg
85266aec45a7Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
85276aec45a7Smrg#
85286aec45a7Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
85296aec45a7Smrg# which have later been changed to m4_define as they aren't part of the
85306aec45a7Smrg# exported API, or moved to Autoconf or Automake where they belong.
85316aec45a7Smrg#
85326aec45a7Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
85336aec45a7Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
85346aec45a7Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
85356aec45a7Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
85366aec45a7Smrg# and doesn't know about Autoconf macros at all.)
85376aec45a7Smrg#
85386aec45a7Smrg# So we provide this file, which has a silly filename so it's always
85396aec45a7Smrg# included after everything else.  This provides aclocal with the
85406aec45a7Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
85416aec45a7Smrg# because those macros already exist, or will be overwritten later.
85426aec45a7Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
85436aec45a7Smrg#
85446aec45a7Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
85456aec45a7Smrg# Yes, that means every name once taken will need to remain here until
85466aec45a7Smrg# we give up compatibility with versions before 1.7, at which point
85476aec45a7Smrg# we need to keep only those names which we still refer to.
85486aec45a7Smrg
85496aec45a7Smrg# This is to help aclocal find these macros, as it can't see m4_define.
85506aec45a7SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
85516aec45a7Smrg
85526aec45a7Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
85536aec45a7Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
85546aec45a7Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
85556aec45a7Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
85566aec45a7Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
85576aec45a7Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
85586aec45a7Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
85596aec45a7Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
85606aec45a7Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
85616aec45a7Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
85626aec45a7Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
85636aec45a7Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
85646aec45a7Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
85656aec45a7Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
85666aec45a7Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
85676aec45a7Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
85686aec45a7Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
85696aec45a7Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
85706aec45a7Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
85716aec45a7Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
85726aec45a7Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
85736aec45a7Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
85746aec45a7Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
85756aec45a7Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
85766aec45a7Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
85776aec45a7Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
85786aec45a7Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
85796aec45a7Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
85806aec45a7Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
85816aec45a7Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
85826aec45a7Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
85836aec45a7Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
85846aec45a7Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
85856aec45a7Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
85866aec45a7Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
85876aec45a7Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
85886aec45a7Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
85896aec45a7Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
85906aec45a7Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
85916aec45a7Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
85926aec45a7Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
85936aec45a7Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
85946aec45a7Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
85956aec45a7Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
85966aec45a7Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
85976aec45a7Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
85986aec45a7Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
85996aec45a7Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
86006aec45a7Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
86016aec45a7Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
86026aec45a7Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
86036aec45a7Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
86046aec45a7Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
86056aec45a7Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
86066aec45a7Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
86076aec45a7Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
86086aec45a7Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
86096aec45a7Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
86106aec45a7Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
86116aec45a7Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
86126aec45a7Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
86136aec45a7Smrg
8614ab47cfaaSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
86156aec45a7Smrg# serial 1 (pkg-config-0.24)
8616ab47cfaaSmrg# 
8617ab47cfaaSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
8618ab47cfaaSmrg#
8619ab47cfaaSmrg# This program is free software; you can redistribute it and/or modify
8620ab47cfaaSmrg# it under the terms of the GNU General Public License as published by
8621ab47cfaaSmrg# the Free Software Foundation; either version 2 of the License, or
8622ab47cfaaSmrg# (at your option) any later version.
8623ab47cfaaSmrg#
8624ab47cfaaSmrg# This program is distributed in the hope that it will be useful, but
8625ab47cfaaSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
8626ab47cfaaSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8627ab47cfaaSmrg# General Public License for more details.
8628ab47cfaaSmrg#
8629ab47cfaaSmrg# You should have received a copy of the GNU General Public License
8630ab47cfaaSmrg# along with this program; if not, write to the Free Software
8631ab47cfaaSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
8632ab47cfaaSmrg#
8633ab47cfaaSmrg# As a special exception to the GNU General Public License, if you
8634ab47cfaaSmrg# distribute this file as part of a program that contains a
8635ab47cfaaSmrg# configuration script generated by Autoconf, you may include it under
8636ab47cfaaSmrg# the same distribution terms that you use for the rest of that program.
8637ab47cfaaSmrg
8638ab47cfaaSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
8639ab47cfaaSmrg# ----------------------------------
8640ab47cfaaSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
8641ab47cfaaSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
8642ab47cfaaSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
86436aec45a7SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
86446aec45a7SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
86456aec45a7SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
86466aec45a7Smrg
8647ab47cfaaSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
8648ab47cfaaSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
8649ab47cfaaSmrgfi
8650ab47cfaaSmrgif test -n "$PKG_CONFIG"; then
8651ab47cfaaSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
8652ab47cfaaSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
8653ab47cfaaSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
8654ab47cfaaSmrg		AC_MSG_RESULT([yes])
8655ab47cfaaSmrg	else
8656ab47cfaaSmrg		AC_MSG_RESULT([no])
8657ab47cfaaSmrg		PKG_CONFIG=""
8658ab47cfaaSmrg	fi
8659ab47cfaaSmrgfi[]dnl
8660ab47cfaaSmrg])# PKG_PROG_PKG_CONFIG
8661ab47cfaaSmrg
8662ab47cfaaSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8663ab47cfaaSmrg#
8664ab47cfaaSmrg# Check to see whether a particular set of modules exists.  Similar
8665ab47cfaaSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
8666ab47cfaaSmrg#
86676aec45a7Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
86686aec45a7Smrg# only at the first occurence in configure.ac, so if the first place
86696aec45a7Smrg# it's called might be skipped (such as if it is within an "if", you
86706aec45a7Smrg# have to call PKG_CHECK_EXISTS manually
8671ab47cfaaSmrg# --------------------------------------------------------------
8672ab47cfaaSmrgAC_DEFUN([PKG_CHECK_EXISTS],
8673ab47cfaaSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8674ab47cfaaSmrgif test -n "$PKG_CONFIG" && \
8675ab47cfaaSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
86766aec45a7Smrg  m4_default([$2], [:])
8677ab47cfaaSmrgm4_ifvaln([$3], [else
8678ab47cfaaSmrg  $3])dnl
8679ab47cfaaSmrgfi])
8680ab47cfaaSmrg
8681ab47cfaaSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8682ab47cfaaSmrg# ---------------------------------------------
8683ab47cfaaSmrgm4_define([_PKG_CONFIG],
86848697ee19Smrg[if test -n "$$1"; then
86858697ee19Smrg    pkg_cv_[]$1="$$1"
86868697ee19Smrg elif test -n "$PKG_CONFIG"; then
86878697ee19Smrg    PKG_CHECK_EXISTS([$3],
86888697ee19Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
86898697ee19Smrg		     [pkg_failed=yes])
86908697ee19Smrg else
86918697ee19Smrg    pkg_failed=untried
8692ab47cfaaSmrgfi[]dnl
8693ab47cfaaSmrg])# _PKG_CONFIG
8694ab47cfaaSmrg
8695ab47cfaaSmrg# _PKG_SHORT_ERRORS_SUPPORTED
8696ab47cfaaSmrg# -----------------------------
8697ab47cfaaSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
8698ab47cfaaSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8699ab47cfaaSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
8700ab47cfaaSmrg        _pkg_short_errors_supported=yes
8701ab47cfaaSmrgelse
8702ab47cfaaSmrg        _pkg_short_errors_supported=no
8703ab47cfaaSmrgfi[]dnl
8704ab47cfaaSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
8705ab47cfaaSmrg
8706ab47cfaaSmrg
8707ab47cfaaSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
8708ab47cfaaSmrg# [ACTION-IF-NOT-FOUND])
8709ab47cfaaSmrg#
8710ab47cfaaSmrg#
8711ab47cfaaSmrg# Note that if there is a possibility the first call to
8712ab47cfaaSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
8713ab47cfaaSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
8714ab47cfaaSmrg#
8715ab47cfaaSmrg#
8716ab47cfaaSmrg# --------------------------------------------------------------
8717ab47cfaaSmrgAC_DEFUN([PKG_CHECK_MODULES],
8718ab47cfaaSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8719ab47cfaaSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
8720ab47cfaaSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
8721ab47cfaaSmrg
8722ab47cfaaSmrgpkg_failed=no
8723ab47cfaaSmrgAC_MSG_CHECKING([for $1])
8724ab47cfaaSmrg
8725ab47cfaaSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
8726ab47cfaaSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
8727ab47cfaaSmrg
8728ab47cfaaSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
8729ab47cfaaSmrgand $1[]_LIBS to avoid the need to call pkg-config.
8730ab47cfaaSmrgSee the pkg-config man page for more details.])
8731ab47cfaaSmrg
8732ab47cfaaSmrgif test $pkg_failed = yes; then
87336aec45a7Smrg   	AC_MSG_RESULT([no])
8734ab47cfaaSmrg        _PKG_SHORT_ERRORS_SUPPORTED
8735ab47cfaaSmrg        if test $_pkg_short_errors_supported = yes; then
87368697ee19Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
8737ab47cfaaSmrg        else 
87388697ee19Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
8739ab47cfaaSmrg        fi
8740ab47cfaaSmrg	# Put the nasty error message in config.log where it belongs
8741ab47cfaaSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8742ab47cfaaSmrg
87436aec45a7Smrg	m4_default([$4], [AC_MSG_ERROR(
8744ab47cfaaSmrg[Package requirements ($2) were not met:
8745ab47cfaaSmrg
8746ab47cfaaSmrg$$1_PKG_ERRORS
8747ab47cfaaSmrg
8748ab47cfaaSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
8749ab47cfaaSmrginstalled software in a non-standard prefix.
8750ab47cfaaSmrg
87516aec45a7Smrg_PKG_TEXT])
87526aec45a7Smrg        ])
8753ab47cfaaSmrgelif test $pkg_failed = untried; then
87546aec45a7Smrg     	AC_MSG_RESULT([no])
87556aec45a7Smrg	m4_default([$4], [AC_MSG_FAILURE(
8756ab47cfaaSmrg[The pkg-config script could not be found or is too old.  Make sure it
8757ab47cfaaSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
8758ab47cfaaSmrgpath to pkg-config.
8759ab47cfaaSmrg
8760ab47cfaaSmrg_PKG_TEXT
8761ab47cfaaSmrg
87626aec45a7SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])
87636aec45a7Smrg        ])
8764ab47cfaaSmrgelse
8765ab47cfaaSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
8766ab47cfaaSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
8767ab47cfaaSmrg        AC_MSG_RESULT([yes])
87686aec45a7Smrg	$3
8769ab47cfaaSmrgfi[]dnl
8770ab47cfaaSmrg])# PKG_CHECK_MODULES
8771ab47cfaaSmrg
87721473d951Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
87738697ee19Smrgdnl
87746aec45a7Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
87758697ee19Smrgdnl 
87768697ee19Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
87776aec45a7Smrgdnl copy of this software and associated documentation files (the "Software"),
87786aec45a7Smrgdnl to deal in the Software without restriction, including without limitation
87796aec45a7Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
87806aec45a7Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
87816aec45a7Smrgdnl Software is furnished to do so, subject to the following conditions:
87828697ee19Smrgdnl
87836aec45a7Smrgdnl The above copyright notice and this permission notice (including the next
87846aec45a7Smrgdnl paragraph) shall be included in all copies or substantial portions of the
87856aec45a7Smrgdnl Software.
87868697ee19Smrgdnl
87876aec45a7Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
87886aec45a7Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
87896aec45a7Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
87906aec45a7Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
87916aec45a7Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
87926aec45a7Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
87936aec45a7Smrgdnl DEALINGS IN THE SOFTWARE.
8794ab47cfaaSmrg
87958697ee19Smrg# XORG_MACROS_VERSION(required-version)
87968697ee19Smrg# -------------------------------------
87978697ee19Smrg# Minimum version: 1.1.0
8798ab47cfaaSmrg#
87998697ee19Smrg# If you're using a macro added in Version 1.1 or newer, include this in
88008697ee19Smrg# your configure.ac with the minimum required version, such as:
88018697ee19Smrg# XORG_MACROS_VERSION(1.1)
8802ab47cfaaSmrg#
88036aec45a7Smrg# To ensure that this macro is defined, also add:
88046aec45a7Smrg# m4_ifndef([XORG_MACROS_VERSION],
88056aec45a7Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
8806ab47cfaaSmrg#
8807ab47cfaaSmrg#
88088697ee19Smrg# See the "minimum version" comment for each macro you use to see what 
88098697ee19Smrg# version you require.
88106aec45a7Smrgm4_defun([XORG_MACROS_VERSION],[
8811aa9e3350Smrgm4_define([vers_have], [1.17])
88126aec45a7Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
88136aec45a7Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
88146aec45a7Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
88156aec45a7Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
88166aec45a7Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
88176aec45a7Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
88186aec45a7Smrgm4_undefine([vers_have])
88196aec45a7Smrgm4_undefine([maj_have])
88206aec45a7Smrgm4_undefine([maj_needed])
88218697ee19Smrg]) # XORG_MACROS_VERSION
8822ab47cfaaSmrg
88238697ee19Smrg# XORG_PROG_RAWCPP()
88248697ee19Smrg# ------------------
88258697ee19Smrg# Minimum version: 1.0.0
8826ab47cfaaSmrg#
88278697ee19Smrg# Find cpp program and necessary flags for use in pre-processing text files
88288697ee19Smrg# such as man pages and config files
88298697ee19SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
88308697ee19SmrgAC_REQUIRE([AC_PROG_CPP])
88318697ee19SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
88328697ee19Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
8833ab47cfaaSmrg
88348697ee19Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
88358697ee19Smrg# which is not the best choice for supporting other OS'es, but covers most
88368697ee19Smrg# of the ones we need for now.
88378697ee19SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
8838aa9e3350SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
88398697ee19Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
88408697ee19Smrg	AC_MSG_RESULT([no])
8841ab47cfaaSmrgelse
88428697ee19Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
88438697ee19Smrg		RAWCPPFLAGS=-undef
88448697ee19Smrg		AC_MSG_RESULT([yes])
88451473d951Smrg	# under Cygwin unix is still defined even with -undef
88461473d951Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
88471473d951Smrg		RAWCPPFLAGS="-undef -ansi"
88481473d951Smrg		AC_MSG_RESULT([yes, with -ansi])
88498697ee19Smrg	else
88508697ee19Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
88518697ee19Smrg	fi
8852ab47cfaaSmrgfi
88538697ee19Smrgrm -f conftest.$ac_ext
8854ab47cfaaSmrg
88558697ee19SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
8856aa9e3350SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
88578697ee19Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
88588697ee19Smrg	AC_MSG_RESULT([no])
88598697ee19Smrgelse
88608697ee19Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
88618697ee19Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
88628697ee19Smrg		AC_MSG_RESULT([yes])
88638697ee19Smrg	else
88648697ee19Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
88658697ee19Smrg	fi
88668697ee19Smrgfi
88678697ee19Smrgrm -f conftest.$ac_ext
88688697ee19SmrgAC_SUBST(RAWCPPFLAGS)
88698697ee19Smrg]) # XORG_PROG_RAWCPP
8870ab47cfaaSmrg
88718697ee19Smrg# XORG_MANPAGE_SECTIONS()
88728697ee19Smrg# -----------------------
88738697ee19Smrg# Minimum version: 1.0.0
8874ab47cfaaSmrg#
88758697ee19Smrg# Determine which sections man pages go in for the different man page types
88768697ee19Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
88778697ee19Smrg# Not sure if there's any better way than just hardcoding by OS name.
88788697ee19Smrg# Override default settings by setting environment variables
88796aec45a7Smrg# Added MAN_SUBSTS in version 1.8
88806aec45a7Smrg# Added AC_PROG_SED in version 1.8
8881ab47cfaaSmrg
88828697ee19SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
88838697ee19SmrgAC_REQUIRE([AC_CANONICAL_HOST])
88846aec45a7SmrgAC_REQUIRE([AC_PROG_SED])
8885ab47cfaaSmrg
88868697ee19Smrgif test x$APP_MAN_SUFFIX = x    ; then
88878697ee19Smrg    APP_MAN_SUFFIX=1
88888697ee19Smrgfi
88898697ee19Smrgif test x$APP_MAN_DIR = x    ; then
88908697ee19Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
88918697ee19Smrgfi
8892ab47cfaaSmrg
88938697ee19Smrgif test x$LIB_MAN_SUFFIX = x    ; then
88948697ee19Smrg    LIB_MAN_SUFFIX=3
88958697ee19Smrgfi
88968697ee19Smrgif test x$LIB_MAN_DIR = x    ; then
88978697ee19Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
88988697ee19Smrgfi
8899ab47cfaaSmrg
89008697ee19Smrgif test x$FILE_MAN_SUFFIX = x    ; then
89018697ee19Smrg    case $host_os in
89028697ee19Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
89038697ee19Smrg	*)		FILE_MAN_SUFFIX=5  ;;
8904ab47cfaaSmrg    esac
8905ab47cfaaSmrgfi
89068697ee19Smrgif test x$FILE_MAN_DIR = x    ; then
89078697ee19Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
89088697ee19Smrgfi
8909ab47cfaaSmrg
89108697ee19Smrgif test x$MISC_MAN_SUFFIX = x    ; then
89118697ee19Smrg    case $host_os in
89128697ee19Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
89138697ee19Smrg	*)		MISC_MAN_SUFFIX=7  ;;
89148697ee19Smrg    esac
89158697ee19Smrgfi
89168697ee19Smrgif test x$MISC_MAN_DIR = x    ; then
89178697ee19Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
89188697ee19Smrgfi
8919ab47cfaaSmrg
89208697ee19Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
89218697ee19Smrg    case $host_os in
89228697ee19Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
89238697ee19Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
89248697ee19Smrg    esac
89258697ee19Smrgfi
89268697ee19Smrgif test x$DRIVER_MAN_DIR = x    ; then
89278697ee19Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
89288697ee19Smrgfi
8929ab47cfaaSmrg
89308697ee19Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
89318697ee19Smrg    case $host_os in
89328697ee19Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
89338697ee19Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
89348697ee19Smrg    esac
89358697ee19Smrgfi
89368697ee19Smrgif test x$ADMIN_MAN_DIR = x    ; then
89378697ee19Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
8938ab47cfaaSmrgfi
8939ab47cfaaSmrg
8940ab47cfaaSmrg
89418697ee19SmrgAC_SUBST([APP_MAN_SUFFIX])
89428697ee19SmrgAC_SUBST([LIB_MAN_SUFFIX])
89438697ee19SmrgAC_SUBST([FILE_MAN_SUFFIX])
89448697ee19SmrgAC_SUBST([MISC_MAN_SUFFIX])
89458697ee19SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
89468697ee19SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
89478697ee19SmrgAC_SUBST([APP_MAN_DIR])
89488697ee19SmrgAC_SUBST([LIB_MAN_DIR])
89498697ee19SmrgAC_SUBST([FILE_MAN_DIR])
89508697ee19SmrgAC_SUBST([MISC_MAN_DIR])
89518697ee19SmrgAC_SUBST([DRIVER_MAN_DIR])
89528697ee19SmrgAC_SUBST([ADMIN_MAN_DIR])
89536aec45a7Smrg
89546aec45a7SmrgXORG_MAN_PAGE="X Version 11"
89556aec45a7SmrgAC_SUBST([XORG_MAN_PAGE])
89566aec45a7SmrgMAN_SUBSTS="\
89576aec45a7Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
89586aec45a7Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
89596aec45a7Smrg	-e 's|__xservername__|Xorg|g' \
89606aec45a7Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
89616aec45a7Smrg	-e 's|__projectroot__|\$(prefix)|g' \
89626aec45a7Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
89636aec45a7Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
89646aec45a7Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
89656aec45a7Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
89666aec45a7Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
89676aec45a7Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
89686aec45a7Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
89696aec45a7SmrgAC_SUBST([MAN_SUBSTS])
89706aec45a7Smrg
89718697ee19Smrg]) # XORG_MANPAGE_SECTIONS
8972ab47cfaaSmrg
89736aec45a7Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
89746aec45a7Smrg# ------------------------
89756aec45a7Smrg# Minimum version: 1.7.0
89766aec45a7Smrg#
89776aec45a7Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
89786aec45a7Smrg# provided by xorg-sgml-doctools, if installed.
89796aec45a7SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
89806aec45a7SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
89816aec45a7SmrgXORG_SGML_PATH=
89826aec45a7SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
89836aec45a7Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
89846aec45a7Smrg    [m4_ifval([$1],[:],
89856aec45a7Smrg        [if test x"$cross_compiling" != x"yes" ; then
89866aec45a7Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
89876aec45a7Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
89886aec45a7Smrg         fi])
89896aec45a7Smrg    ])
89906aec45a7Smrg
89916aec45a7Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
89926aec45a7Smrg# the path and the name of the doc stylesheet
89936aec45a7Smrgif test "x$XORG_SGML_PATH" != "x" ; then
89946aec45a7Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
89956aec45a7Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
89966aec45a7Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
89976aec45a7Smrgelse
89986aec45a7Smrg   AC_MSG_RESULT([no])
89996aec45a7Smrgfi
90006aec45a7Smrg
90016aec45a7SmrgAC_SUBST(XORG_SGML_PATH)
90026aec45a7SmrgAC_SUBST(STYLESHEET_SRCDIR)
90036aec45a7SmrgAC_SUBST(XSL_STYLESHEET)
90046aec45a7SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
90056aec45a7Smrg]) # XORG_CHECK_SGML_DOCTOOLS
90066aec45a7Smrg
90078697ee19Smrg# XORG_CHECK_LINUXDOC
90088697ee19Smrg# -------------------
90098697ee19Smrg# Minimum version: 1.0.0
9010ab47cfaaSmrg#
90118697ee19Smrg# Defines the variable MAKE_TEXT if the necessary tools and
90128697ee19Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
90138697ee19Smrg# Whether or not the necessary tools and files are found can be checked
90148697ee19Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
90158697ee19SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
90166aec45a7SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
90176aec45a7SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
9018ab47cfaaSmrg
90198697ee19SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
9020ab47cfaaSmrg
90216aec45a7SmrgAC_MSG_CHECKING([whether to build documentation])
9022ab47cfaaSmrg
90236aec45a7Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
90248697ee19Smrg   BUILDDOC=yes
90258697ee19Smrgelse
90268697ee19Smrg   BUILDDOC=no
90278697ee19Smrgfi
9028ab47cfaaSmrg
90298697ee19SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9030ab47cfaaSmrg
90318697ee19SmrgAC_MSG_RESULT([$BUILDDOC])
9032ab47cfaaSmrg
90336aec45a7SmrgAC_MSG_CHECKING([whether to build pdf documentation])
9034ab47cfaaSmrg
90356aec45a7Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
90368697ee19Smrg   BUILDPDFDOC=yes
90378697ee19Smrgelse
90388697ee19Smrg   BUILDPDFDOC=no
9039ab47cfaaSmrgfi
9040ab47cfaaSmrg
90418697ee19SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9042ab47cfaaSmrg
90438697ee19SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9044ab47cfaaSmrg
90456aec45a7SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
90468697ee19SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
90478697ee19SmrgMAKE_PDF="$PS2PDF"
90488697ee19SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9049ab47cfaaSmrg
90508697ee19SmrgAC_SUBST(MAKE_TEXT)
90518697ee19SmrgAC_SUBST(MAKE_PS)
90528697ee19SmrgAC_SUBST(MAKE_PDF)
90538697ee19SmrgAC_SUBST(MAKE_HTML)
90548697ee19Smrg]) # XORG_CHECK_LINUXDOC
9055ab47cfaaSmrg
90568697ee19Smrg# XORG_CHECK_DOCBOOK
90578697ee19Smrg# -------------------
90588697ee19Smrg# Minimum version: 1.0.0
9059ab47cfaaSmrg#
90608697ee19Smrg# Checks for the ability to build output formats from SGML DocBook source.
90618697ee19Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
90628697ee19Smrg# indicates whether the necessary tools and files are found and, if set,
90638697ee19Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
90648697ee19SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
90656aec45a7SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
90666aec45a7Smrg
90678697ee19SmrgBUILDTXTDOC=no
90688697ee19SmrgBUILDPDFDOC=no
90698697ee19SmrgBUILDPSDOC=no
90708697ee19SmrgBUILDHTMLDOC=no
9071ab47cfaaSmrg
90728697ee19SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
90738697ee19SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
90748697ee19SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
90758697ee19SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9076ab47cfaaSmrg
90776aec45a7SmrgAC_MSG_CHECKING([whether to build text documentation])
90786aec45a7Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
90798697ee19Smrg   test x$BUILD_TXTDOC != xno; then
90808697ee19Smrg	BUILDTXTDOC=yes
90818697ee19Smrgfi
90828697ee19SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
90838697ee19SmrgAC_MSG_RESULT([$BUILDTXTDOC])
9084ab47cfaaSmrg
90856aec45a7SmrgAC_MSG_CHECKING([whether to build PDF documentation])
90866aec45a7Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
90878697ee19Smrg   test x$BUILD_PDFDOC != xno; then
90888697ee19Smrg	BUILDPDFDOC=yes
9089ab47cfaaSmrgfi
90908697ee19SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
90918697ee19SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9092ab47cfaaSmrg
90936aec45a7SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
90946aec45a7Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
90958697ee19Smrg   test x$BUILD_PSDOC != xno; then
90968697ee19Smrg	BUILDPSDOC=yes
90978697ee19Smrgfi
90988697ee19SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
90998697ee19SmrgAC_MSG_RESULT([$BUILDPSDOC])
9100ab47cfaaSmrg
91016aec45a7SmrgAC_MSG_CHECKING([whether to build HTML documentation])
91026aec45a7Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
91038697ee19Smrg   test x$BUILD_HTMLDOC != xno; then
91048697ee19Smrg	BUILDHTMLDOC=yes
91058697ee19Smrgfi
91068697ee19SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
91078697ee19SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
9108ab47cfaaSmrg
91098697ee19SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
91108697ee19SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
91118697ee19SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
91128697ee19SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9113ab47cfaaSmrg
91148697ee19SmrgAC_SUBST(MAKE_TEXT)
91158697ee19SmrgAC_SUBST(MAKE_PS)
91168697ee19SmrgAC_SUBST(MAKE_PDF)
91178697ee19SmrgAC_SUBST(MAKE_HTML)
91188697ee19Smrg]) # XORG_CHECK_DOCBOOK
9119ab47cfaaSmrg
91206aec45a7Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
91216aec45a7Smrg# ----------------
91226aec45a7Smrg# Minimum version: 1.5.0
91236aec45a7Smrg# Minimum version for optional DEFAULT argument: 1.11.0
91246aec45a7Smrg#
91256aec45a7Smrg# Documentation tools are not always available on all platforms and sometimes
91266aec45a7Smrg# not at the appropriate level. This macro enables a module to test for the
91276aec45a7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
91286aec45a7Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
91296aec45a7Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
91306aec45a7Smrg# --with-xmlto assumes 'auto'.
91316aec45a7Smrg#
91326aec45a7Smrg# Interface to module:
91336aec45a7Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
91346aec45a7Smrg# XMLTO:	returns the path of the xmlto program found
91356aec45a7Smrg#		returns the path set by the user in the environment
91366aec45a7Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
91376aec45a7Smrg#		'no' user instructs the module not to use xmlto
91386aec45a7Smrg#
91396aec45a7Smrg# Added in version 1.10.0
91406aec45a7Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
91416aec45a7Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
91426aec45a7Smrg#
91436aec45a7Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
91446aec45a7Smrg#
91456aec45a7SmrgAC_DEFUN([XORG_WITH_XMLTO],[
91466aec45a7SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
91476aec45a7Smrgm4_define([_defopt], m4_default([$2], [auto]))
91486aec45a7SmrgAC_ARG_WITH(xmlto,
91496aec45a7Smrg	AS_HELP_STRING([--with-xmlto],
91506aec45a7Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
91516aec45a7Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
91526aec45a7Smrgm4_undefine([_defopt])
91536aec45a7Smrg
91546aec45a7Smrgif test "x$use_xmlto" = x"auto"; then
91556aec45a7Smrg   AC_PATH_PROG([XMLTO], [xmlto])
91566aec45a7Smrg   if test "x$XMLTO" = "x"; then
91576aec45a7Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
91586aec45a7Smrg	have_xmlto=no
91596aec45a7Smrg   else
91606aec45a7Smrg        have_xmlto=yes
91616aec45a7Smrg   fi
91626aec45a7Smrgelif test "x$use_xmlto" = x"yes" ; then
91636aec45a7Smrg   AC_PATH_PROG([XMLTO], [xmlto])
91646aec45a7Smrg   if test "x$XMLTO" = "x"; then
91656aec45a7Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
91666aec45a7Smrg   fi
91676aec45a7Smrg   have_xmlto=yes
91686aec45a7Smrgelif test "x$use_xmlto" = x"no" ; then
91696aec45a7Smrg   if test "x$XMLTO" != "x"; then
91706aec45a7Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
91716aec45a7Smrg   fi
91726aec45a7Smrg   have_xmlto=no
91736aec45a7Smrgelse
91746aec45a7Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
91756aec45a7Smrgfi
91766aec45a7Smrg
91776aec45a7Smrg# Test for a minimum version of xmlto, if provided.
91786aec45a7Smrgm4_ifval([$1],
91796aec45a7Smrg[if test "$have_xmlto" = yes; then
91806aec45a7Smrg    # scrape the xmlto version
91816aec45a7Smrg    AC_MSG_CHECKING([the xmlto version])
91826aec45a7Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
91836aec45a7Smrg    AC_MSG_RESULT([$xmlto_version])
91846aec45a7Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
91856aec45a7Smrg        [if test "x$use_xmlto" = xauto; then
91866aec45a7Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
91876aec45a7Smrg            have_xmlto=no
91886aec45a7Smrg        else
91896aec45a7Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
91906aec45a7Smrg        fi])
91916aec45a7Smrgfi])
91926aec45a7Smrg
91936aec45a7Smrg# Test for the ability of xmlto to generate a text target
91946aec45a7Smrghave_xmlto_text=no
91956aec45a7Smrgcat > conftest.xml << "EOF"
91966aec45a7SmrgEOF
91976aec45a7SmrgAS_IF([test "$have_xmlto" = yes],
91986aec45a7Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
91996aec45a7Smrg             [have_xmlto_text=yes],
92006aec45a7Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
92016aec45a7Smrgrm -f conftest.xml
92026aec45a7SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
92036aec45a7SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
92046aec45a7Smrg]) # XORG_WITH_XMLTO
92056aec45a7Smrg
9206aa9e3350Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
9207aa9e3350Smrg# --------------------------------------------
9208aa9e3350Smrg# Minimum version: 1.12.0
9209aa9e3350Smrg# Minimum version for optional DEFAULT argument: 1.12.0
9210aa9e3350Smrg#
9211aa9e3350Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
9212aa9e3350Smrg# XML-based language used for the transformation of XML documents.
9213aa9e3350Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
9214aa9e3350Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
9215aa9e3350Smrg# The XSLT processor is often used as a standalone tool for transformations.
9216aa9e3350Smrg# It should not be assumed that this tool is used only to work with documnetation.
9217aa9e3350Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
9218aa9e3350Smrg#
9219aa9e3350Smrg# Interface to module:
9220aa9e3350Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
9221aa9e3350Smrg# XSLTPROC:	 returns the path of the xsltproc program found
9222aa9e3350Smrg#		 returns the path set by the user in the environment
9223aa9e3350Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
9224aa9e3350Smrg#		  'no' user instructs the module not to use xsltproc
9225aa9e3350Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
9226aa9e3350Smrg#
9227aa9e3350Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
9228aa9e3350Smrg#
9229aa9e3350SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
9230aa9e3350SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
9231aa9e3350Smrg# Preserves the interface, should it be implemented later
9232aa9e3350Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
9233aa9e3350Smrgm4_define([_defopt], m4_default([$2], [auto]))
9234aa9e3350SmrgAC_ARG_WITH(xsltproc,
9235aa9e3350Smrg	AS_HELP_STRING([--with-xsltproc],
9236aa9e3350Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
9237aa9e3350Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
9238aa9e3350Smrgm4_undefine([_defopt])
9239aa9e3350Smrg
9240aa9e3350Smrgif test "x$use_xsltproc" = x"auto"; then
9241aa9e3350Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9242aa9e3350Smrg   if test "x$XSLTPROC" = "x"; then
9243aa9e3350Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
9244aa9e3350Smrg	have_xsltproc=no
9245aa9e3350Smrg   else
9246aa9e3350Smrg        have_xsltproc=yes
9247aa9e3350Smrg   fi
9248aa9e3350Smrgelif test "x$use_xsltproc" = x"yes" ; then
9249aa9e3350Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9250aa9e3350Smrg   if test "x$XSLTPROC" = "x"; then
9251aa9e3350Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
9252aa9e3350Smrg   fi
9253aa9e3350Smrg   have_xsltproc=yes
9254aa9e3350Smrgelif test "x$use_xsltproc" = x"no" ; then
9255aa9e3350Smrg   if test "x$XSLTPROC" != "x"; then
9256aa9e3350Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
9257aa9e3350Smrg   fi
9258aa9e3350Smrg   have_xsltproc=no
9259aa9e3350Smrgelse
9260aa9e3350Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
9261aa9e3350Smrgfi
9262aa9e3350Smrg
9263aa9e3350SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
9264aa9e3350Smrg]) # XORG_WITH_XSLTPROC
9265aa9e3350Smrg
9266aa9e3350Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
9267aa9e3350Smrg# ----------------------------------------
9268aa9e3350Smrg# Minimum version: 1.15.0
9269aa9e3350Smrg#
9270aa9e3350Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
9271aa9e3350Smrg# scanning arbitrary text files, extracting information from those text files,
9272aa9e3350Smrg# and printing reports based on that information.
9273aa9e3350Smrg#
9274aa9e3350Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
9275aa9e3350Smrg#
9276aa9e3350Smrg# Interface to module:
9277aa9e3350Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
9278aa9e3350Smrg# PERL:	     returns the path of the perl program found
9279aa9e3350Smrg#	     returns the path set by the user in the environment
9280aa9e3350Smrg# --with-perl: 'yes' user instructs the module to use perl
9281aa9e3350Smrg#	       'no' user instructs the module not to use perl
9282aa9e3350Smrg# have_perl: returns yes if perl found in PATH or no
9283aa9e3350Smrg#
9284aa9e3350Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
9285aa9e3350Smrg#
9286aa9e3350SmrgAC_DEFUN([XORG_WITH_PERL],[
9287aa9e3350SmrgAC_ARG_VAR([PERL], [Path to perl command])
9288aa9e3350Smrg# Preserves the interface, should it be implemented later
9289aa9e3350Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
9290aa9e3350Smrgm4_define([_defopt], m4_default([$2], [auto]))
9291aa9e3350SmrgAC_ARG_WITH(perl,
9292aa9e3350Smrg	AS_HELP_STRING([--with-perl],
9293aa9e3350Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
9294aa9e3350Smrg	   [use_perl=$withval], [use_perl=]_defopt)
9295aa9e3350Smrgm4_undefine([_defopt])
9296aa9e3350Smrg
9297aa9e3350Smrgif test "x$use_perl" = x"auto"; then
9298aa9e3350Smrg   AC_PATH_PROG([PERL], [perl])
9299aa9e3350Smrg   if test "x$PERL" = "x"; then
9300aa9e3350Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
9301aa9e3350Smrg	have_perl=no
9302aa9e3350Smrg   else
9303aa9e3350Smrg        have_perl=yes
9304aa9e3350Smrg   fi
9305aa9e3350Smrgelif test "x$use_perl" = x"yes" ; then
9306aa9e3350Smrg   AC_PATH_PROG([PERL], [perl])
9307aa9e3350Smrg   if test "x$PERL" = "x"; then
9308aa9e3350Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
9309aa9e3350Smrg   fi
9310aa9e3350Smrg   have_perl=yes
9311aa9e3350Smrgelif test "x$use_perl" = x"no" ; then
9312aa9e3350Smrg   if test "x$PERL" != "x"; then
9313aa9e3350Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
9314aa9e3350Smrg   fi
9315aa9e3350Smrg   have_perl=no
9316aa9e3350Smrgelse
9317aa9e3350Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
9318aa9e3350Smrgfi
9319aa9e3350Smrg
9320aa9e3350SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
9321aa9e3350Smrg]) # XORG_WITH_PERL
9322aa9e3350Smrg
93236aec45a7Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
93246aec45a7Smrg# ----------------
93256aec45a7Smrg# Minimum version: 1.5.0
93266aec45a7Smrg# Minimum version for optional DEFAULT argument: 1.11.0
93276aec45a7Smrg#
93286aec45a7Smrg# Documentation tools are not always available on all platforms and sometimes
93296aec45a7Smrg# not at the appropriate level. This macro enables a module to test for the
93306aec45a7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
93316aec45a7Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
93326aec45a7Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
93336aec45a7Smrg# --with-asciidoc assumes 'auto'.
93346aec45a7Smrg#
93356aec45a7Smrg# Interface to module:
93366aec45a7Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
93376aec45a7Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
93386aec45a7Smrg#		 returns the path set by the user in the environment
93396aec45a7Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
93406aec45a7Smrg#		  'no' user instructs the module not to use asciidoc
93416aec45a7Smrg#
93426aec45a7Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
93436aec45a7Smrg#
93446aec45a7SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
93456aec45a7SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
93466aec45a7Smrgm4_define([_defopt], m4_default([$2], [auto]))
93476aec45a7SmrgAC_ARG_WITH(asciidoc,
93486aec45a7Smrg	AS_HELP_STRING([--with-asciidoc],
93496aec45a7Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
93506aec45a7Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
93516aec45a7Smrgm4_undefine([_defopt])
93526aec45a7Smrg
93536aec45a7Smrgif test "x$use_asciidoc" = x"auto"; then
93546aec45a7Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
93556aec45a7Smrg   if test "x$ASCIIDOC" = "x"; then
93566aec45a7Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
93576aec45a7Smrg	have_asciidoc=no
93586aec45a7Smrg   else
93596aec45a7Smrg        have_asciidoc=yes
93606aec45a7Smrg   fi
93616aec45a7Smrgelif test "x$use_asciidoc" = x"yes" ; then
93626aec45a7Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
93636aec45a7Smrg   if test "x$ASCIIDOC" = "x"; then
93646aec45a7Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
93656aec45a7Smrg   fi
93666aec45a7Smrg   have_asciidoc=yes
93676aec45a7Smrgelif test "x$use_asciidoc" = x"no" ; then
93686aec45a7Smrg   if test "x$ASCIIDOC" != "x"; then
93696aec45a7Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
93706aec45a7Smrg   fi
93716aec45a7Smrg   have_asciidoc=no
93726aec45a7Smrgelse
93736aec45a7Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
93746aec45a7Smrgfi
93756aec45a7Smrgm4_ifval([$1],
93766aec45a7Smrg[if test "$have_asciidoc" = yes; then
93776aec45a7Smrg    # scrape the asciidoc version
93786aec45a7Smrg    AC_MSG_CHECKING([the asciidoc version])
93796aec45a7Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
93806aec45a7Smrg    AC_MSG_RESULT([$asciidoc_version])
93816aec45a7Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
93826aec45a7Smrg        [if test "x$use_asciidoc" = xauto; then
93836aec45a7Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
93846aec45a7Smrg            have_asciidoc=no
93856aec45a7Smrg        else
93866aec45a7Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
93876aec45a7Smrg        fi])
93886aec45a7Smrgfi])
93896aec45a7SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
93906aec45a7Smrg]) # XORG_WITH_ASCIIDOC
93916aec45a7Smrg
93926aec45a7Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
93936aec45a7Smrg# --------------------------------
93946aec45a7Smrg# Minimum version: 1.5.0
93956aec45a7Smrg# Minimum version for optional DEFAULT argument: 1.11.0
93966aec45a7Smrg#
93976aec45a7Smrg# Documentation tools are not always available on all platforms and sometimes
93986aec45a7Smrg# not at the appropriate level. This macro enables a module to test for the
93996aec45a7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
94006aec45a7Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
94016aec45a7Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
94026aec45a7Smrg# --with-doxygen assumes 'auto'.
94036aec45a7Smrg#
94046aec45a7Smrg# Interface to module:
94056aec45a7Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
94066aec45a7Smrg# DOXYGEN:	 returns the path of the doxygen program found
94076aec45a7Smrg#		 returns the path set by the user in the environment
94086aec45a7Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
94096aec45a7Smrg#		  'no' user instructs the module not to use doxygen
94106aec45a7Smrg#
94116aec45a7Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
94126aec45a7Smrg#
94136aec45a7SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
94146aec45a7SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
94156aec45a7Smrgm4_define([_defopt], m4_default([$2], [auto]))
94166aec45a7SmrgAC_ARG_WITH(doxygen,
94176aec45a7Smrg	AS_HELP_STRING([--with-doxygen],
94186aec45a7Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
94196aec45a7Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
94206aec45a7Smrgm4_undefine([_defopt])
94216aec45a7Smrg
94226aec45a7Smrgif test "x$use_doxygen" = x"auto"; then
94236aec45a7Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
94246aec45a7Smrg   if test "x$DOXYGEN" = "x"; then
94256aec45a7Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
94266aec45a7Smrg	have_doxygen=no
94276aec45a7Smrg   else
94286aec45a7Smrg        have_doxygen=yes
94296aec45a7Smrg   fi
94306aec45a7Smrgelif test "x$use_doxygen" = x"yes" ; then
94316aec45a7Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
94326aec45a7Smrg   if test "x$DOXYGEN" = "x"; then
94336aec45a7Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
94346aec45a7Smrg   fi
94356aec45a7Smrg   have_doxygen=yes
94366aec45a7Smrgelif test "x$use_doxygen" = x"no" ; then
94376aec45a7Smrg   if test "x$DOXYGEN" != "x"; then
94386aec45a7Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
94396aec45a7Smrg   fi
94406aec45a7Smrg   have_doxygen=no
94416aec45a7Smrgelse
94426aec45a7Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
94436aec45a7Smrgfi
94446aec45a7Smrgm4_ifval([$1],
94456aec45a7Smrg[if test "$have_doxygen" = yes; then
94466aec45a7Smrg    # scrape the doxygen version
94476aec45a7Smrg    AC_MSG_CHECKING([the doxygen version])
94486aec45a7Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
94496aec45a7Smrg    AC_MSG_RESULT([$doxygen_version])
94506aec45a7Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
94516aec45a7Smrg        [if test "x$use_doxygen" = xauto; then
94526aec45a7Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
94536aec45a7Smrg            have_doxygen=no
94546aec45a7Smrg        else
94556aec45a7Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
94566aec45a7Smrg        fi])
94576aec45a7Smrgfi])
94586aec45a7SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
94596aec45a7Smrg]) # XORG_WITH_DOXYGEN
94606aec45a7Smrg
94616aec45a7Smrg# XORG_WITH_GROFF([DEFAULT])
94626aec45a7Smrg# ----------------
94636aec45a7Smrg# Minimum version: 1.6.0
94646aec45a7Smrg# Minimum version for optional DEFAULT argument: 1.11.0
94656aec45a7Smrg#
94666aec45a7Smrg# Documentation tools are not always available on all platforms and sometimes
94676aec45a7Smrg# not at the appropriate level. This macro enables a module to test for the
94686aec45a7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
94696aec45a7Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
94706aec45a7Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
94716aec45a7Smrg# --with-groff assumes 'auto'.
94726aec45a7Smrg#
94736aec45a7Smrg# Interface to module:
94746aec45a7Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
94756aec45a7Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
94766aec45a7Smrg# HAVE_GROFF_MS: the -ms macros package
94776aec45a7Smrg# GROFF:	 returns the path of the groff program found
94786aec45a7Smrg#		 returns the path set by the user in the environment
94796aec45a7Smrg# --with-groff:	 'yes' user instructs the module to use groff
94806aec45a7Smrg#		 'no' user instructs the module not to use groff
94816aec45a7Smrg#
94826aec45a7Smrg# Added in version 1.9.0:
94836aec45a7Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
94846aec45a7Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
94856aec45a7Smrg#		   psselect from the psutils package.
94866aec45a7Smrg#		   the ghostcript package. Refer to the grohtml man pages
94876aec45a7Smrg#
94886aec45a7Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
94896aec45a7Smrg#
94906aec45a7Smrg# OS and distros often splits groff in a basic and full package, the former
94916aec45a7Smrg# having the groff program and the later having devices, fonts and macros
94926aec45a7Smrg# Checking for the groff executable is not enough.
94936aec45a7Smrg#
94946aec45a7Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
94956aec45a7Smrg# unset HAVE_GROFF or GROFF env variables.
94966aec45a7Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
94976aec45a7Smrg#
94986aec45a7SmrgAC_DEFUN([XORG_WITH_GROFF],[
94996aec45a7SmrgAC_ARG_VAR([GROFF], [Path to groff command])
95006aec45a7Smrgm4_define([_defopt], m4_default([$1], [auto]))
95016aec45a7SmrgAC_ARG_WITH(groff,
95026aec45a7Smrg	AS_HELP_STRING([--with-groff],
95036aec45a7Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
95046aec45a7Smrg	   [use_groff=$withval], [use_groff=]_defopt)
95056aec45a7Smrgm4_undefine([_defopt])
95066aec45a7Smrg
95076aec45a7Smrgif test "x$use_groff" = x"auto"; then
95086aec45a7Smrg   AC_PATH_PROG([GROFF], [groff])
95096aec45a7Smrg   if test "x$GROFF" = "x"; then
95106aec45a7Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
95116aec45a7Smrg	have_groff=no
95126aec45a7Smrg   else
95136aec45a7Smrg        have_groff=yes
95146aec45a7Smrg   fi
95156aec45a7Smrgelif test "x$use_groff" = x"yes" ; then
95166aec45a7Smrg   AC_PATH_PROG([GROFF], [groff])
95176aec45a7Smrg   if test "x$GROFF" = "x"; then
95186aec45a7Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
95196aec45a7Smrg   fi
95206aec45a7Smrg   have_groff=yes
95216aec45a7Smrgelif test "x$use_groff" = x"no" ; then
95226aec45a7Smrg   if test "x$GROFF" != "x"; then
95236aec45a7Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
95246aec45a7Smrg   fi
95256aec45a7Smrg   have_groff=no
95266aec45a7Smrgelse
95276aec45a7Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
95286aec45a7Smrgfi
95296aec45a7Smrg
95306aec45a7Smrg# We have groff, test for the presence of the macro packages
95316aec45a7Smrgif test "x$have_groff" = x"yes"; then
95326aec45a7Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
95336aec45a7Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
95346aec45a7Smrg        groff_ms_works=yes
95356aec45a7Smrg    else
95366aec45a7Smrg        groff_ms_works=no
95376aec45a7Smrg    fi
95386aec45a7Smrg    AC_MSG_RESULT([$groff_ms_works])
95396aec45a7Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
95406aec45a7Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
95416aec45a7Smrg        groff_mm_works=yes
95426aec45a7Smrg    else
95436aec45a7Smrg        groff_mm_works=no
95446aec45a7Smrg    fi
95456aec45a7Smrg    AC_MSG_RESULT([$groff_mm_works])
95466aec45a7Smrgfi
95476aec45a7Smrg
95486aec45a7Smrg# We have groff, test for HTML dependencies, one command per package
95496aec45a7Smrgif test "x$have_groff" = x"yes"; then
95506aec45a7Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
95516aec45a7Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
95526aec45a7Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
95536aec45a7Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
95546aec45a7Smrg      have_groff_html=yes
95556aec45a7Smrg   else
95566aec45a7Smrg      have_groff_html=no
95576aec45a7Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
95586aec45a7Smrg   fi
95596aec45a7Smrgfi
95606aec45a7Smrg
95616aec45a7Smrg# Set Automake conditionals for Makefiles
95626aec45a7SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
95636aec45a7SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
95646aec45a7SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
95656aec45a7SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
95666aec45a7Smrg]) # XORG_WITH_GROFF
95676aec45a7Smrg
9568aa9e3350Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
9569aa9e3350Smrg# ---------------------------------------
95706aec45a7Smrg# Minimum version: 1.6.0
95716aec45a7Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9572aa9e3350Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
95736aec45a7Smrg#
95746aec45a7Smrg# Documentation tools are not always available on all platforms and sometimes
95756aec45a7Smrg# not at the appropriate level. This macro enables a module to test for the
95766aec45a7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
95776aec45a7Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
95786aec45a7Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
95796aec45a7Smrg# --with-fop assumes 'auto'.
95806aec45a7Smrg#
95816aec45a7Smrg# Interface to module:
95826aec45a7Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
95836aec45a7Smrg# FOP:	 	returns the path of the fop program found
95846aec45a7Smrg#		returns the path set by the user in the environment
95856aec45a7Smrg# --with-fop: 	'yes' user instructs the module to use fop
95866aec45a7Smrg#		'no' user instructs the module not to use fop
95876aec45a7Smrg#
95886aec45a7Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
95896aec45a7Smrg#
95906aec45a7SmrgAC_DEFUN([XORG_WITH_FOP],[
95916aec45a7SmrgAC_ARG_VAR([FOP], [Path to fop command])
9592aa9e3350Smrgm4_define([_defopt], m4_default([$2], [auto]))
95936aec45a7SmrgAC_ARG_WITH(fop,
95946aec45a7Smrg	AS_HELP_STRING([--with-fop],
95956aec45a7Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
95966aec45a7Smrg	   [use_fop=$withval], [use_fop=]_defopt)
95976aec45a7Smrgm4_undefine([_defopt])
95986aec45a7Smrg
95996aec45a7Smrgif test "x$use_fop" = x"auto"; then
96006aec45a7Smrg   AC_PATH_PROG([FOP], [fop])
96016aec45a7Smrg   if test "x$FOP" = "x"; then
96026aec45a7Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
96036aec45a7Smrg	have_fop=no
96046aec45a7Smrg   else
96056aec45a7Smrg        have_fop=yes
96066aec45a7Smrg   fi
96076aec45a7Smrgelif test "x$use_fop" = x"yes" ; then
96086aec45a7Smrg   AC_PATH_PROG([FOP], [fop])
96096aec45a7Smrg   if test "x$FOP" = "x"; then
96106aec45a7Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
96116aec45a7Smrg   fi
96126aec45a7Smrg   have_fop=yes
96136aec45a7Smrgelif test "x$use_fop" = x"no" ; then
96146aec45a7Smrg   if test "x$FOP" != "x"; then
96156aec45a7Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
96166aec45a7Smrg   fi
96176aec45a7Smrg   have_fop=no
96186aec45a7Smrgelse
96196aec45a7Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
96206aec45a7Smrgfi
9621aa9e3350Smrg
9622aa9e3350Smrg# Test for a minimum version of fop, if provided.
9623aa9e3350Smrgm4_ifval([$1],
9624aa9e3350Smrg[if test "$have_fop" = yes; then
9625aa9e3350Smrg    # scrape the fop version
9626aa9e3350Smrg    AC_MSG_CHECKING([for fop minimum version])
9627aa9e3350Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
9628aa9e3350Smrg    AC_MSG_RESULT([$fop_version])
9629aa9e3350Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
9630aa9e3350Smrg        [if test "x$use_fop" = xauto; then
9631aa9e3350Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
9632aa9e3350Smrg            have_fop=no
9633aa9e3350Smrg        else
9634aa9e3350Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
9635aa9e3350Smrg        fi])
9636aa9e3350Smrgfi])
96376aec45a7SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
96386aec45a7Smrg]) # XORG_WITH_FOP
96396aec45a7Smrg
96406aec45a7Smrg# XORG_WITH_PS2PDF([DEFAULT])
96416aec45a7Smrg# ----------------
96426aec45a7Smrg# Minimum version: 1.6.0
96436aec45a7Smrg# Minimum version for optional DEFAULT argument: 1.11.0
96446aec45a7Smrg#
96456aec45a7Smrg# Documentation tools are not always available on all platforms and sometimes
96466aec45a7Smrg# not at the appropriate level. This macro enables a module to test for the
96476aec45a7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
96486aec45a7Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
96496aec45a7Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
96506aec45a7Smrg# --with-ps2pdf assumes 'auto'.
96516aec45a7Smrg#
96526aec45a7Smrg# Interface to module:
96536aec45a7Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
96546aec45a7Smrg# PS2PDF:	returns the path of the ps2pdf program found
96556aec45a7Smrg#		returns the path set by the user in the environment
96566aec45a7Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
96576aec45a7Smrg#		 'no' user instructs the module not to use ps2pdf
96586aec45a7Smrg#
96596aec45a7Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
96606aec45a7Smrg#
96616aec45a7SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
96626aec45a7SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
96636aec45a7Smrgm4_define([_defopt], m4_default([$1], [auto]))
96646aec45a7SmrgAC_ARG_WITH(ps2pdf,
96656aec45a7Smrg	AS_HELP_STRING([--with-ps2pdf],
96666aec45a7Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
96676aec45a7Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
96686aec45a7Smrgm4_undefine([_defopt])
96696aec45a7Smrg
96706aec45a7Smrgif test "x$use_ps2pdf" = x"auto"; then
96716aec45a7Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
96726aec45a7Smrg   if test "x$PS2PDF" = "x"; then
96736aec45a7Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
96746aec45a7Smrg	have_ps2pdf=no
96756aec45a7Smrg   else
96766aec45a7Smrg        have_ps2pdf=yes
96776aec45a7Smrg   fi
96786aec45a7Smrgelif test "x$use_ps2pdf" = x"yes" ; then
96796aec45a7Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
96806aec45a7Smrg   if test "x$PS2PDF" = "x"; then
96816aec45a7Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
96826aec45a7Smrg   fi
96836aec45a7Smrg   have_ps2pdf=yes
96846aec45a7Smrgelif test "x$use_ps2pdf" = x"no" ; then
96856aec45a7Smrg   if test "x$PS2PDF" != "x"; then
96866aec45a7Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
96876aec45a7Smrg   fi
96886aec45a7Smrg   have_ps2pdf=no
96896aec45a7Smrgelse
96906aec45a7Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
96916aec45a7Smrgfi
96926aec45a7SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
96936aec45a7Smrg]) # XORG_WITH_PS2PDF
96946aec45a7Smrg
96956aec45a7Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
96966aec45a7Smrg# ----------------
96976aec45a7Smrg# Minimum version: 1.6.0
96986aec45a7Smrg#
96996aec45a7Smrg# Documentation tools are not always available on all platforms and sometimes
97006aec45a7Smrg# not at the appropriate level. This macro enables a builder to skip all
97016aec45a7Smrg# documentation targets except traditional man pages.
97026aec45a7Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
97036aec45a7Smrg# maximum flexibilty in controlling documentation building.
97046aec45a7Smrg# Refer to:
97056aec45a7Smrg# XORG_WITH_XMLTO         --with-xmlto
97066aec45a7Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
97076aec45a7Smrg# XORG_WITH_DOXYGEN       --with-doxygen
97086aec45a7Smrg# XORG_WITH_FOP           --with-fop
97096aec45a7Smrg# XORG_WITH_GROFF         --with-groff
97106aec45a7Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
97116aec45a7Smrg#
97126aec45a7Smrg# Interface to module:
97136aec45a7Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
97146aec45a7Smrg# --enable-docs: 'yes' user instructs the module to generate docs
97156aec45a7Smrg#		 'no' user instructs the module not to generate docs
97166aec45a7Smrg# parm1:	specify the default value, yes or no.
97176aec45a7Smrg#
97186aec45a7SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
9719aa9e3350Smrgm4_define([docs_default], m4_default([$1], [yes]))
97206aec45a7SmrgAC_ARG_ENABLE(docs,
97216aec45a7Smrg	AS_HELP_STRING([--enable-docs],
9722aa9e3350Smrg	   [Enable building the documentation (default: ]docs_default[)]),
9723aa9e3350Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
9724aa9e3350Smrgm4_undefine([docs_default])
97256aec45a7SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
97266aec45a7SmrgAC_MSG_CHECKING([whether to build documentation])
97276aec45a7SmrgAC_MSG_RESULT([$build_docs])
97286aec45a7Smrg]) # XORG_ENABLE_DOCS
97296aec45a7Smrg
97306aec45a7Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
97316aec45a7Smrg# ----------------
97326aec45a7Smrg# Minimum version: 1.6.0
97336aec45a7Smrg#
97346aec45a7Smrg# This macro enables a builder to skip all developer documentation.
97356aec45a7Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
97366aec45a7Smrg# maximum flexibilty in controlling documentation building.
97376aec45a7Smrg# Refer to:
97386aec45a7Smrg# XORG_WITH_XMLTO         --with-xmlto
97396aec45a7Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
97406aec45a7Smrg# XORG_WITH_DOXYGEN       --with-doxygen
97416aec45a7Smrg# XORG_WITH_FOP           --with-fop
97426aec45a7Smrg# XORG_WITH_GROFF         --with-groff
97436aec45a7Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
97446aec45a7Smrg#
97456aec45a7Smrg# Interface to module:
97466aec45a7Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
97476aec45a7Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
97486aec45a7Smrg#			'no' user instructs the module not to generate developer docs
97496aec45a7Smrg# parm1:		specify the default value, yes or no.
97506aec45a7Smrg#
97516aec45a7SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
97526aec45a7Smrgm4_define([devel_default], m4_default([$1], [yes]))
97536aec45a7SmrgAC_ARG_ENABLE(devel-docs,
97546aec45a7Smrg	AS_HELP_STRING([--enable-devel-docs],
97556aec45a7Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
97566aec45a7Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
97576aec45a7Smrgm4_undefine([devel_default])
97586aec45a7SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
97596aec45a7SmrgAC_MSG_CHECKING([whether to build developer documentation])
97606aec45a7SmrgAC_MSG_RESULT([$build_devel_docs])
97616aec45a7Smrg]) # XORG_ENABLE_DEVEL_DOCS
97626aec45a7Smrg
97636aec45a7Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
97646aec45a7Smrg# ----------------
97656aec45a7Smrg# Minimum version: 1.6.0
97666aec45a7Smrg#
97676aec45a7Smrg# This macro enables a builder to skip all functional specification targets.
97686aec45a7Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
97696aec45a7Smrg# maximum flexibilty in controlling documentation building.
97706aec45a7Smrg# Refer to:
97716aec45a7Smrg# XORG_WITH_XMLTO         --with-xmlto
97726aec45a7Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
97736aec45a7Smrg# XORG_WITH_DOXYGEN       --with-doxygen
97746aec45a7Smrg# XORG_WITH_FOP           --with-fop
97756aec45a7Smrg# XORG_WITH_GROFF         --with-groff
97766aec45a7Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
97776aec45a7Smrg#
97786aec45a7Smrg# Interface to module:
97796aec45a7Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
97806aec45a7Smrg# --enable-specs:	'yes' user instructs the module to generate specs
97816aec45a7Smrg#			'no' user instructs the module not to generate specs
97826aec45a7Smrg# parm1:		specify the default value, yes or no.
97836aec45a7Smrg#
97846aec45a7SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
97856aec45a7Smrgm4_define([spec_default], m4_default([$1], [yes]))
97866aec45a7SmrgAC_ARG_ENABLE(specs,
97876aec45a7Smrg	AS_HELP_STRING([--enable-specs],
97886aec45a7Smrg	   [Enable building the specs (default: ]spec_default[)]),
97896aec45a7Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
97906aec45a7Smrgm4_undefine([spec_default])
97916aec45a7SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
97926aec45a7SmrgAC_MSG_CHECKING([whether to build functional specifications])
97936aec45a7SmrgAC_MSG_RESULT([$build_specs])
97946aec45a7Smrg]) # XORG_ENABLE_SPECS
97956aec45a7Smrg
9796aa9e3350Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
9797aa9e3350Smrg# ----------------------------------------------
9798aa9e3350Smrg# Minimum version: 1.13.0
9799aa9e3350Smrg#
9800aa9e3350Smrg# This macro enables a builder to enable/disable unit testing
9801aa9e3350Smrg# It makes no assumption about the test cases implementation
9802aa9e3350Smrg# Test cases may or may not use Automake "Support for test suites"
9803aa9e3350Smrg# They may or may not use the software utility library GLib
9804aa9e3350Smrg#
9805aa9e3350Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
9806aa9e3350Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
9807aa9e3350Smrg# The variable enable_unit_tests is used by other macros in this file.
9808aa9e3350Smrg#
9809aa9e3350Smrg# Interface to module:
9810aa9e3350Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
9811aa9e3350Smrg# enable_unit_tests:    used in configure.ac for additional configuration
9812aa9e3350Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
9813aa9e3350Smrg#			'no' user instructs the module not to build tests
9814aa9e3350Smrg# parm1:		specify the default value, yes or no.
9815aa9e3350Smrg#
9816aa9e3350SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
9817aa9e3350SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
9818aa9e3350SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
9819aa9e3350SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
9820aa9e3350Smrgm4_define([_defopt], m4_default([$1], [auto]))
9821aa9e3350SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
9822aa9e3350Smrg	[Enable building unit test cases (default: ]_defopt[)]),
9823aa9e3350Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
9824aa9e3350Smrgm4_undefine([_defopt])
9825aa9e3350SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
9826aa9e3350SmrgAC_MSG_CHECKING([whether to build unit test cases])
9827aa9e3350SmrgAC_MSG_RESULT([$enable_unit_tests])
9828aa9e3350Smrg]) # XORG_ENABLE_UNIT_TESTS
9829aa9e3350Smrg
9830aa9e3350Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
9831aa9e3350Smrg# ------------------------------------------------------
9832aa9e3350Smrg# Minimum version: 1.17.0
9833aa9e3350Smrg#
9834aa9e3350Smrg# This macro enables a builder to enable/disable integration testing
9835aa9e3350Smrg# It makes no assumption about the test cases' implementation
9836aa9e3350Smrg# Test cases may or may not use Automake "Support for test suites"
9837aa9e3350Smrg#
9838aa9e3350Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
9839aa9e3350Smrg# usually requires less dependencies and may be built and run under less
9840aa9e3350Smrg# stringent environments than integration tests.
9841aa9e3350Smrg#
9842aa9e3350Smrg# Interface to module:
9843aa9e3350Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
9844aa9e3350Smrg# enable_integration_tests:   used in configure.ac for additional configuration
9845aa9e3350Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
9846aa9e3350Smrg#                             'no' user instructs the module not to build tests
9847aa9e3350Smrg# parm1:                      specify the default value, yes or no.
9848aa9e3350Smrg#
9849aa9e3350SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
9850aa9e3350SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
9851aa9e3350Smrgm4_define([_defopt], m4_default([$1], [auto]))
9852aa9e3350SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
9853aa9e3350Smrg	[Enable building integration test cases (default: ]_defopt[)]),
9854aa9e3350Smrg	[enable_integration_tests=$enableval],
9855aa9e3350Smrg	[enable_integration_tests=]_defopt)
9856aa9e3350Smrgm4_undefine([_defopt])
9857aa9e3350SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
9858aa9e3350Smrg	[test "x$enable_integration_tests" != xno])
9859aa9e3350SmrgAC_MSG_CHECKING([whether to build unit test cases])
9860aa9e3350SmrgAC_MSG_RESULT([$enable_integration_tests])
9861aa9e3350Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
9862aa9e3350Smrg
9863aa9e3350Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
9864aa9e3350Smrg# ----------------------------------------
9865aa9e3350Smrg# Minimum version: 1.13.0
9866aa9e3350Smrg#
9867aa9e3350Smrg# GLib is a library which provides advanced data structures and functions.
9868aa9e3350Smrg# This macro enables a module to test for the presence of Glib.
9869aa9e3350Smrg#
9870aa9e3350Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
9871aa9e3350Smrg# Otherwise the value of $enable_unit_tests is blank.
9872aa9e3350Smrg#
9873aa9e3350Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
9874aa9e3350Smrg# test support usually requires less dependencies and may be built and run under
9875aa9e3350Smrg# less stringent environments than integration tests.
9876aa9e3350Smrg#
9877aa9e3350Smrg# Interface to module:
9878aa9e3350Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
9879aa9e3350Smrg# with_glib: used in configure.ac to know if GLib has been found
9880aa9e3350Smrg# --with-glib:	'yes' user instructs the module to use glib
9881aa9e3350Smrg#		'no' user instructs the module not to use glib
9882aa9e3350Smrg#
9883aa9e3350SmrgAC_DEFUN([XORG_WITH_GLIB],[
9884aa9e3350SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
9885aa9e3350Smrgm4_define([_defopt], m4_default([$2], [auto]))
9886aa9e3350SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
9887aa9e3350Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
9888aa9e3350Smrg	[with_glib=$withval], [with_glib=]_defopt)
9889aa9e3350Smrgm4_undefine([_defopt])
9890aa9e3350Smrg
9891aa9e3350Smrghave_glib=no
9892aa9e3350Smrg# Do not probe GLib if user explicitly disabled unit testing
9893aa9e3350Smrgif test "x$enable_unit_tests" != x"no"; then
9894aa9e3350Smrg  # Do not probe GLib if user explicitly disabled it
9895aa9e3350Smrg  if test "x$with_glib" != x"no"; then
9896aa9e3350Smrg    m4_ifval(
9897aa9e3350Smrg      [$1],
9898aa9e3350Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
9899aa9e3350Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
9900aa9e3350Smrg    )
9901aa9e3350Smrg  fi
9902aa9e3350Smrgfi
9903aa9e3350Smrg
9904aa9e3350Smrg# Not having GLib when unit testing has been explicitly requested is an error
9905aa9e3350Smrgif test "x$enable_unit_tests" = x"yes"; then
9906aa9e3350Smrg  if test "x$have_glib" = x"no"; then
9907aa9e3350Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
9908aa9e3350Smrg  fi
9909aa9e3350Smrgfi
9910aa9e3350Smrg
9911aa9e3350Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
9912aa9e3350Smrgif test "x$enable_unit_tests" = x"no"; then
9913aa9e3350Smrg  if test "x$with_glib" = x"yes"; then
9914aa9e3350Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
9915aa9e3350Smrg  fi
9916aa9e3350Smrgfi
9917aa9e3350Smrg
9918aa9e3350Smrg# Not having GLib when it has been explicitly requested is an error
9919aa9e3350Smrgif test "x$with_glib" = x"yes"; then
9920aa9e3350Smrg  if test "x$have_glib" = x"no"; then
9921aa9e3350Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
9922aa9e3350Smrg  fi
9923aa9e3350Smrgfi
9924aa9e3350Smrg
9925aa9e3350SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
9926aa9e3350Smrg]) # XORG_WITH_GLIB
9927aa9e3350Smrg
9928aa9e3350Smrg# XORG_LD_WRAP([required|optional])
9929aa9e3350Smrg# ---------------------------------
9930aa9e3350Smrg# Minimum version: 1.13.0
9931aa9e3350Smrg#
9932aa9e3350Smrg# Check if linker supports -wrap, passed via compiler flags
9933aa9e3350Smrg#
9934aa9e3350Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
9935aa9e3350Smrg# Otherwise the value of $enable_unit_tests is blank.
9936aa9e3350Smrg#
9937aa9e3350Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
9938aa9e3350Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
9939aa9e3350Smrg# available, an argument of "optional" allows use when some unit tests require
9940aa9e3350Smrg# ld -wrap and others do not.
9941aa9e3350Smrg#
9942aa9e3350SmrgAC_DEFUN([XORG_LD_WRAP],[
9943aa9e3350SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
9944aa9e3350Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
9945aa9e3350Smrg                      void __wrap_exit(int status) { return; }],
9946aa9e3350Smrg                     [exit(0);])])
9947aa9e3350Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
9948aa9e3350Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
9949aa9e3350Smrg  if test "x$have_ld_wrap" = x"no"; then
9950aa9e3350Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
9951aa9e3350Smrg  fi
9952aa9e3350Smrgfi
9953aa9e3350SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
9954aa9e3350Smrg#
9955aa9e3350Smrg]) # XORG_LD_WRAP
9956aa9e3350Smrg
9957aa9e3350Smrg# XORG_CHECK_LINKER_FLAGS
9958aa9e3350Smrg# -----------------------
9959aa9e3350Smrg# SYNOPSIS
9960aa9e3350Smrg#
9961aa9e3350Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
9962aa9e3350Smrg#
9963aa9e3350Smrg# DESCRIPTION
9964aa9e3350Smrg#
9965aa9e3350Smrg#   Check whether the given linker FLAGS work with the current language's
9966aa9e3350Smrg#   linker, or whether they give an error.
9967aa9e3350Smrg#
9968aa9e3350Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
9969aa9e3350Smrg#   success/failure.
9970aa9e3350Smrg#
9971aa9e3350Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
9972aa9e3350Smrg#
9973aa9e3350Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
9974aa9e3350Smrg#
9975aa9e3350Smrg# LICENSE
9976aa9e3350Smrg#
9977aa9e3350Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
9978aa9e3350Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
9979aa9e3350Smrg#   Copyright (c) 2009 Matteo Frigo
9980aa9e3350Smrg#
9981aa9e3350Smrg#   This program is free software: you can redistribute it and/or modify it
9982aa9e3350Smrg#   under the terms of the GNU General Public License as published by the
9983aa9e3350Smrg#   Free Software Foundation, either version 3 of the License, or (at your
9984aa9e3350Smrg#   option) any later version.
9985aa9e3350Smrg#
9986aa9e3350Smrg#   This program is distributed in the hope that it will be useful, but
9987aa9e3350Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
9988aa9e3350Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
9989aa9e3350Smrg#   Public License for more details.
9990aa9e3350Smrg#
9991aa9e3350Smrg#   You should have received a copy of the GNU General Public License along
9992aa9e3350Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
9993aa9e3350Smrg#
9994aa9e3350Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
9995aa9e3350Smrg#   gives unlimited permission to copy, distribute and modify the configure
9996aa9e3350Smrg#   scripts that are the output of Autoconf when processing the Macro. You
9997aa9e3350Smrg#   need not follow the terms of the GNU General Public License when using
9998aa9e3350Smrg#   or distributing such scripts, even though portions of the text of the
9999aa9e3350Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
10000aa9e3350Smrg#   all other use of the material that constitutes the Autoconf Macro.
10001aa9e3350Smrg#
10002aa9e3350Smrg#   This special exception to the GPL applies to versions of the Autoconf
10003aa9e3350Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
10004aa9e3350Smrg#   modified version of the Autoconf Macro, you may extend this special
10005aa9e3350Smrg#   exception to the GPL to apply to your modified version as well.#
10006aa9e3350SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
10007aa9e3350Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
10008aa9e3350Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
10009aa9e3350SmrgAS_LITERAL_IF([$1],
10010aa9e3350Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
10011aa9e3350Smrg      ax_save_FLAGS=$LDFLAGS
10012aa9e3350Smrg      LDFLAGS="$1"
10013aa9e3350Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
10014aa9e3350Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10015aa9e3350Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10016aa9e3350Smrg      LDFLAGS=$ax_save_FLAGS])],
10017aa9e3350Smrg  [ax_save_FLAGS=$LDFLAGS
10018aa9e3350Smrg   LDFLAGS="$1"
10019aa9e3350Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
10020aa9e3350Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10021aa9e3350Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10022aa9e3350Smrg   LDFLAGS=$ax_save_FLAGS])
10023aa9e3350Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
10024aa9e3350SmrgAC_MSG_RESULT($xorg_check_linker_flags)
10025aa9e3350Smrgif test "x$xorg_check_linker_flags" = xyes; then
10026aa9e3350Smrg	m4_default([$2], :)
10027aa9e3350Smrgelse
10028aa9e3350Smrg	m4_default([$3], :)
10029aa9e3350Smrgfi
10030aa9e3350Smrg]) # XORG_CHECK_LINKER_FLAGS
10031aa9e3350Smrg
10032aa9e3350Smrg# XORG_MEMORY_CHECK_FLAGS
10033aa9e3350Smrg# -----------------------
10034aa9e3350Smrg# Minimum version: 1.16.0
10035aa9e3350Smrg#
10036aa9e3350Smrg# This macro attempts to find appropriate memory checking functionality
10037aa9e3350Smrg# for various platforms which unit testing code may use to catch various
10038aa9e3350Smrg# forms of memory allocation and access errors in testing.
10039aa9e3350Smrg#
10040aa9e3350Smrg# Interface to module:
10041aa9e3350Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
10042aa9e3350Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
10043aa9e3350Smrg#
10044aa9e3350Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
10045aa9e3350Smrg#
10046aa9e3350SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
10047aa9e3350Smrg
10048aa9e3350SmrgAC_REQUIRE([AC_CANONICAL_HOST])
10049aa9e3350SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
10050aa9e3350Smrg           [Environment variables to enable memory checking in tests])
10051aa9e3350Smrg
10052aa9e3350Smrg# Check for different types of support on different platforms
10053aa9e3350Smrgcase $host_os in
10054aa9e3350Smrg    solaris*)
10055aa9e3350Smrg        AC_CHECK_LIB([umem], [umem_alloc],
10056aa9e3350Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
10057aa9e3350Smrg        ;;
10058aa9e3350Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
10059aa9e3350Smrg        # both directly and inverted, so should not be 0 or 255.
10060aa9e3350Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
10061aa9e3350Smrg        ;;
10062aa9e3350Smrg    darwin*)
10063aa9e3350Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
10064aa9e3350Smrg        ;;
10065aa9e3350Smrg    *bsd*)
10066aa9e3350Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
10067aa9e3350Smrg        ;;
10068aa9e3350Smrgesac
10069aa9e3350Smrg
10070aa9e3350Smrg# User supplied flags override default flags
10071aa9e3350Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
10072aa9e3350Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
10073aa9e3350Smrgfi
10074aa9e3350Smrg
10075aa9e3350SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
10076aa9e3350Smrg]) # XORG_WITH_LINT
10077aa9e3350Smrg
100788697ee19Smrg# XORG_CHECK_MALLOC_ZERO
100798697ee19Smrg# ----------------------
100808697ee19Smrg# Minimum version: 1.0.0
10081ab47cfaaSmrg#
100828697ee19Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
100838697ee19Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
100848697ee19Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
100858697ee19SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
100868697ee19SmrgAC_ARG_ENABLE(malloc0returnsnull,
100876aec45a7Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
100888697ee19Smrg		       [malloc(0) returns NULL (default: auto)]),
100898697ee19Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
100908697ee19Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
10091ab47cfaaSmrg
100928697ee19SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
100938697ee19Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
10094aa9e3350Smrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
10095aa9e3350Smrg#include <stdlib.h>
10096aa9e3350Smrg],[
100978697ee19Smrg    char *m0, *r0, *c0, *p;
100988697ee19Smrg    m0 = malloc(0);
100998697ee19Smrg    p = malloc(10);
101008697ee19Smrg    r0 = realloc(p,0);
10101aa9e3350Smrg    c0 = calloc(0,10);
10102aa9e3350Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
10103aa9e3350Smrg])],
101048697ee19Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
101056aec45a7Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
101066aec45a7Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
10107ab47cfaaSmrgfi
101088697ee19SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
101098697ee19Smrg
101108697ee19Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
101118697ee19Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
101128697ee19Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
101138697ee19Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
101148697ee19Smrgelse
101158697ee19Smrg	MALLOC_ZERO_CFLAGS=""
101168697ee19Smrg	XMALLOC_ZERO_CFLAGS=""
101178697ee19Smrg	XTMALLOC_ZERO_CFLAGS=""
10118ab47cfaaSmrgfi
10119ab47cfaaSmrg
101208697ee19SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
101218697ee19SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
101228697ee19SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
101238697ee19Smrg]) # XORG_CHECK_MALLOC_ZERO
10124ab47cfaaSmrg
101258697ee19Smrg# XORG_WITH_LINT()
101268697ee19Smrg# ----------------
101278697ee19Smrg# Minimum version: 1.1.0
10128ab47cfaaSmrg#
101296aec45a7Smrg# This macro enables the use of a tool that flags some suspicious and
101306aec45a7Smrg# non-portable constructs (likely to be bugs) in C language source code.
101316aec45a7Smrg# It will attempt to locate the tool and use appropriate options.
101326aec45a7Smrg# There are various lint type tools on different platforms.
101336aec45a7Smrg#
101346aec45a7Smrg# Interface to module:
101356aec45a7Smrg# LINT:		returns the path to the tool found on the platform
101366aec45a7Smrg#		or the value set to LINT on the configure cmd line
101376aec45a7Smrg#		also an Automake conditional
101386aec45a7Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
101396aec45a7Smrg#
101406aec45a7Smrg# --with-lint:	'yes' user instructs the module to use lint
101416aec45a7Smrg#		'no' user instructs the module not to use lint (default)
101426aec45a7Smrg#
101436aec45a7Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
101446aec45a7Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
101458697ee19Smrg#
101468697ee19SmrgAC_DEFUN([XORG_WITH_LINT],[
10147ab47cfaaSmrg
101486aec45a7SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
101496aec45a7SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
101506aec45a7SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
101518697ee19Smrg		[Use a lint-style source code checker (default: disabled)])],
101528697ee19Smrg		[use_lint=$withval], [use_lint=no])
101536aec45a7Smrg
101546aec45a7Smrg# Obtain platform specific info like program name and options
101556aec45a7Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
101566aec45a7Smrgcase $host_os in
101576aec45a7Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
101586aec45a7Smrg	lint_name=splint
101596aec45a7Smrg	lint_options="-badflag"
101606aec45a7Smrg	;;
101616aec45a7Smrg  *freebsd* | *netbsd*)
101626aec45a7Smrg	lint_name=lint
101636aec45a7Smrg	lint_options="-u -b"
101646aec45a7Smrg	;;
101656aec45a7Smrg  *solaris*)
101666aec45a7Smrg	lint_name=lint
101676aec45a7Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
101686aec45a7Smrg	;;
101696aec45a7Smrgesac
101706aec45a7Smrg
101716aec45a7Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
101726aec45a7Smrgif test "x$use_lint" = x"yes" ; then
101736aec45a7Smrg   AC_PATH_PROG([LINT], [$lint_name])
101746aec45a7Smrg   if test "x$LINT" = "x"; then
101756aec45a7Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
101766aec45a7Smrg   fi
101776aec45a7Smrgelif test "x$use_lint" = x"no" ; then
101786aec45a7Smrg   if test "x$LINT" != "x"; then
101796aec45a7Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
101806aec45a7Smrg   fi
10181ab47cfaaSmrgelse
101826aec45a7Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
101838697ee19Smrgfi
101846aec45a7Smrg
101856aec45a7Smrg# User supplied flags override default flags
101866aec45a7Smrgif test "x$LINT_FLAGS" != "x"; then
101876aec45a7Smrg   lint_options=$LINT_FLAGS
10188ab47cfaaSmrgfi
10189ab47cfaaSmrg
101906aec45a7SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
101916aec45a7SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
10192ab47cfaaSmrg
101938697ee19Smrg]) # XORG_WITH_LINT
101948697ee19Smrg
101958697ee19Smrg# XORG_LINT_LIBRARY(LIBNAME)
101968697ee19Smrg# --------------------------
101978697ee19Smrg# Minimum version: 1.1.0
10198ab47cfaaSmrg#
101998697ee19Smrg# Sets up flags for building lint libraries for checking programs that call
102008697ee19Smrg# functions in the library.
10201ab47cfaaSmrg#
102026aec45a7Smrg# Interface to module:
102036aec45a7Smrg# LINTLIB		- Automake variable with the name of lint library file to make
102046aec45a7Smrg# MAKE_LINT_LIB		- Automake conditional
102056aec45a7Smrg#
102066aec45a7Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
102076aec45a7Smrg#			  - 'no' user instructs the module not to create a lint library (default)
102088697ee19Smrg
102098697ee19SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
102108697ee19SmrgAC_REQUIRE([XORG_WITH_LINT])
102116aec45a7SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
102128697ee19Smrg	[Create lint library (default: disabled)])],
102138697ee19Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
102146aec45a7Smrg
102156aec45a7Smrgif test "x$make_lint_lib" = x"yes" ; then
102166aec45a7Smrg   LINTLIB=llib-l$1.ln
102176aec45a7Smrg   if test "x$LINT" = "x"; then
102186aec45a7Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
102196aec45a7Smrg   fi
102206aec45a7Smrgelif test "x$make_lint_lib" != x"no" ; then
102216aec45a7Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
10222ab47cfaaSmrgfi
102236aec45a7Smrg
102248697ee19SmrgAC_SUBST(LINTLIB)
102258697ee19SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
10226ab47cfaaSmrg
102278697ee19Smrg]) # XORG_LINT_LIBRARY
10228ab47cfaaSmrg
10229aa9e3350Smrg# XORG_COMPILER_BRAND
10230aa9e3350Smrg# -------------------
10231aa9e3350Smrg# Minimum version: 1.14.0
10232aa9e3350Smrg#
10233aa9e3350Smrg# Checks for various brands of compilers and sets flags as appropriate:
10234aa9e3350Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
10235aa9e3350Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
10236aa9e3350Smrg#   clang compiler - sets CLANGCC to "yes"
10237aa9e3350Smrg#   Intel compiler - sets INTELCC to "yes"
10238aa9e3350Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
10239aa9e3350Smrg#
10240aa9e3350SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
10241aa9e3350SmrgAC_LANG_CASE(
10242aa9e3350Smrg	[C], [
10243aa9e3350Smrg		AC_REQUIRE([AC_PROG_CC_C99])
10244aa9e3350Smrg	],
10245aa9e3350Smrg	[C++], [
10246aa9e3350Smrg		AC_REQUIRE([AC_PROG_CXX])
10247aa9e3350Smrg	]
10248aa9e3350Smrg)
10249aa9e3350SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
10250aa9e3350SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
10251aa9e3350SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
10252aa9e3350Smrg]) # XORG_COMPILER_BRAND
10253aa9e3350Smrg
10254aa9e3350Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
10255aa9e3350Smrg# ---------------
10256aa9e3350Smrg# Minimum version: 1.16.0
10257aa9e3350Smrg#
10258aa9e3350Smrg# Test if the compiler works when passed the given flag as a command line argument.
10259aa9e3350Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
10260aa9e3350Smrg# next flag in the list until there are no more options.
10261aa9e3350Smrg#
10262aa9e3350Smrg# Note that this does not guarantee that the compiler supports the flag as some
10263aa9e3350Smrg# compilers will simply ignore arguments that they do not understand, but we do
10264aa9e3350Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
10265aa9e3350Smrg# -Werror=unused-command-line-argument
10266aa9e3350Smrg#
10267aa9e3350SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
10268aa9e3350Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10269aa9e3350Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10270aa9e3350Smrg
10271aa9e3350SmrgAC_LANG_COMPILER_REQUIRE
10272aa9e3350Smrg
10273aa9e3350SmrgAC_LANG_CASE(
10274aa9e3350Smrg	[C], [
10275aa9e3350Smrg		AC_REQUIRE([AC_PROG_CC_C99])
10276aa9e3350Smrg		define([PREFIX], [C])
10277aa9e3350Smrg		define([CACHE_PREFIX], [cc])
10278aa9e3350Smrg		define([COMPILER], [$CC])
10279aa9e3350Smrg	],
10280aa9e3350Smrg	[C++], [
10281aa9e3350Smrg		define([PREFIX], [CXX])
10282aa9e3350Smrg		define([CACHE_PREFIX], [cxx])
10283aa9e3350Smrg		define([COMPILER], [$CXX])
10284aa9e3350Smrg	]
10285aa9e3350Smrg)
10286aa9e3350Smrg
10287aa9e3350Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
10288aa9e3350Smrg
10289aa9e3350Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
10290aa9e3350Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10291aa9e3350Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
10292aa9e3350Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
10293aa9e3350Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10294aa9e3350Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
10295aa9e3350Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
10296aa9e3350Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
10297aa9e3350Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10298aa9e3350Smrgfi
10299aa9e3350Smrg
10300aa9e3350Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
10301aa9e3350Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
10302aa9e3350Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10303aa9e3350Smrg	fi
10304aa9e3350Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10305aa9e3350Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
10306aa9e3350Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
10307aa9e3350Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10308aa9e3350Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
10309aa9e3350Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
10310aa9e3350Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
10311aa9e3350Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10312aa9e3350Smrgfi
10313aa9e3350Smrg
10314aa9e3350Smrgfound="no"
10315aa9e3350Smrgm4_foreach([flag], m4_cdr($@), [
10316aa9e3350Smrg	if test $found = "no" ; then
10317aa9e3350Smrg		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
10318aa9e3350Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10319aa9e3350Smrg		fi
10320aa9e3350Smrg
10321aa9e3350Smrg		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
10322aa9e3350Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10323aa9e3350Smrg		fi
10324aa9e3350Smrg
10325aa9e3350Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
10326aa9e3350Smrg
10327aa9e3350Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
10328aa9e3350Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
10329aa9e3350Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
10330aa9e3350Smrg		AC_CACHE_VAL($cacheid,
10331aa9e3350Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
10332aa9e3350Smrg					     [eval $cacheid=yes],
10333aa9e3350Smrg					     [eval $cacheid=no])])
10334aa9e3350Smrg
10335aa9e3350Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10336aa9e3350Smrg
10337aa9e3350Smrg		eval supported=\$$cacheid
10338aa9e3350Smrg		AC_MSG_RESULT([$supported])
10339aa9e3350Smrg		if test "$supported" = "yes" ; then
10340aa9e3350Smrg			$1="$$1 ]flag["
10341aa9e3350Smrg			found="yes"
10342aa9e3350Smrg		fi
10343aa9e3350Smrg	fi
10344aa9e3350Smrg])
10345aa9e3350Smrg]) # XORG_TESTSET_CFLAG
10346aa9e3350Smrg
10347aa9e3350Smrg# XORG_COMPILER_FLAGS
10348aa9e3350Smrg# ---------------
10349aa9e3350Smrg# Minimum version: 1.16.0
10350aa9e3350Smrg#
10351aa9e3350Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
10352aa9e3350Smrg# arguments supported by the selected compiler which do NOT alter the generated
10353aa9e3350Smrg# code.  These arguments will cause the compiler to print various warnings
10354aa9e3350Smrg# during compilation AND turn a conservative set of warnings into errors.
10355aa9e3350Smrg#
10356aa9e3350Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
10357aa9e3350Smrg# future versions of util-macros as options are added to new compilers.
10358aa9e3350Smrg#
10359aa9e3350SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
10360aa9e3350SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
10361aa9e3350Smrg
10362aa9e3350SmrgAC_ARG_ENABLE(selective-werror,
10363aa9e3350Smrg              AS_HELP_STRING([--disable-selective-werror],
10364aa9e3350Smrg                             [Turn off selective compiler errors. (default: enabled)]),
10365aa9e3350Smrg              [SELECTIVE_WERROR=$enableval],
10366aa9e3350Smrg              [SELECTIVE_WERROR=yes])
10367aa9e3350Smrg
10368aa9e3350SmrgAC_LANG_CASE(
10369aa9e3350Smrg        [C], [
10370aa9e3350Smrg                define([PREFIX], [C])
10371aa9e3350Smrg        ],
10372aa9e3350Smrg        [C++], [
10373aa9e3350Smrg                define([PREFIX], [CXX])
10374aa9e3350Smrg        ]
10375aa9e3350Smrg)
10376aa9e3350Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
10377aa9e3350Smrgif test "x$SUNCC" = "xyes"; then
10378aa9e3350Smrg    [BASE_]PREFIX[FLAGS]="-v"
10379aa9e3350Smrgelse
10380aa9e3350Smrg    [BASE_]PREFIX[FLAGS]=""
10381aa9e3350Smrgfi
10382aa9e3350Smrg
10383aa9e3350Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
10384aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
10385aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
10386aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
10387aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
10388aa9e3350Smrg
10389aa9e3350SmrgAC_LANG_CASE(
10390aa9e3350Smrg	[C], [
10391aa9e3350Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
10392aa9e3350Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
10393aa9e3350Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
10394aa9e3350Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
10395aa9e3350Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
10396aa9e3350Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
10397aa9e3350Smrg	]
10398aa9e3350Smrg)
10399aa9e3350Smrg
10400aa9e3350Smrg# This chunk adds additional warnings that could catch undesired effects.
10401aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
10402aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
10403aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
10404aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
10405aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
10406aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
10407aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
10408aa9e3350Smrg
10409aa9e3350Smrg# These are currently disabled because they are noisy.  They will be enabled
10410aa9e3350Smrg# in the future once the codebase is sufficiently modernized to silence
10411aa9e3350Smrg# them.  For now, I don't want them to drown out the other warnings.
10412aa9e3350Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
10413aa9e3350Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
10414aa9e3350Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
10415aa9e3350Smrg
10416aa9e3350Smrg# Turn some warnings into errors, so we don't accidently get successful builds
10417aa9e3350Smrg# when there are problems that should be fixed.
10418aa9e3350Smrg
10419aa9e3350Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
10420aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
10421aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
10422aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
10423aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
10424aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
10425aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
10426aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
10427aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
10428aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
10429aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
10430aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
10431aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
10432aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
10433aa9e3350Smrgelse
10434aa9e3350SmrgAC_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])
10435aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
10436aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
10437aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
10438aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
10439aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
10440aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
10441aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
10442aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
10443aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
10444aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
10445aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
10446aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
10447aa9e3350SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
10448aa9e3350Smrgfi
10449aa9e3350Smrg
10450aa9e3350SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
10451aa9e3350Smrg]) # XORG_COMPILER_FLAGS
10452aa9e3350Smrg
104531473d951Smrg# XORG_CWARNFLAGS
104541473d951Smrg# ---------------
104551473d951Smrg# Minimum version: 1.2.0
10456aa9e3350Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
104571473d951Smrg#
104581473d951Smrg# Defines CWARNFLAGS to enable C compiler warnings.
104591473d951Smrg#
10460aa9e3350Smrg# This function is deprecated because it defines -fno-strict-aliasing
10461aa9e3350Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
10462aa9e3350Smrg# is needed, then it should be added explicitly in the module when
10463aa9e3350Smrg# it is updated to use BASE_CFLAGS.
10464aa9e3350Smrg#
104651473d951SmrgAC_DEFUN([XORG_CWARNFLAGS], [
10466aa9e3350SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
10467aa9e3350SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
10468aa9e3350SmrgAC_LANG_CASE(
10469aa9e3350Smrg	[C], [
10470aa9e3350Smrg		CWARNFLAGS="$BASE_CFLAGS"
10471aa9e3350Smrg		if  test "x$GCC" = xyes ; then
10472aa9e3350Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
10473aa9e3350Smrg		fi
10474aa9e3350Smrg		AC_SUBST(CWARNFLAGS)
10475aa9e3350Smrg	]
10476aa9e3350Smrg)
104771473d951Smrg]) # XORG_CWARNFLAGS
104786aec45a7Smrg
104796aec45a7Smrg# XORG_STRICT_OPTION
104806aec45a7Smrg# -----------------------
104816aec45a7Smrg# Minimum version: 1.3.0
104826aec45a7Smrg#
10483aa9e3350Smrg# Add configure option to enable strict compilation flags, such as treating
10484aa9e3350Smrg# warnings as fatal errors.
10485aa9e3350Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
10486aa9e3350Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
10487aa9e3350Smrg#
10488aa9e3350Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
10489aa9e3350Smrg# when strict compilation is unconditionally desired.
104906aec45a7SmrgAC_DEFUN([XORG_STRICT_OPTION], [
104916aec45a7SmrgAC_REQUIRE([XORG_CWARNFLAGS])
10492aa9e3350SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
104936aec45a7Smrg
104946aec45a7SmrgAC_ARG_ENABLE(strict-compilation,
104956aec45a7Smrg			  AS_HELP_STRING([--enable-strict-compilation],
104966aec45a7Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
104976aec45a7Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
10498aa9e3350Smrg
10499aa9e3350SmrgAC_LANG_CASE(
10500aa9e3350Smrg        [C], [
10501aa9e3350Smrg                define([PREFIX], [C])
10502aa9e3350Smrg        ],
10503aa9e3350Smrg        [C++], [
10504aa9e3350Smrg                define([PREFIX], [CXX])
10505aa9e3350Smrg        ]
10506aa9e3350Smrg)
10507aa9e3350Smrg
10508aa9e3350Smrg[STRICT_]PREFIX[FLAGS]=""
10509aa9e3350SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
10510aa9e3350SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
10511aa9e3350Smrg
10512aa9e3350Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
10513aa9e3350Smrg# activate it with -Werror, so we add it here explicitly.
10514aa9e3350SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
10515aa9e3350Smrg
105166aec45a7Smrgif test "x$STRICT_COMPILE" = "xyes"; then
10517aa9e3350Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
10518aa9e3350Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
105196aec45a7Smrgfi
10520aa9e3350SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
10521aa9e3350SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
10522aa9e3350SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
105236aec45a7Smrg]) # XORG_STRICT_OPTION
105246aec45a7Smrg
105256aec45a7Smrg# XORG_DEFAULT_OPTIONS
105266aec45a7Smrg# --------------------
105276aec45a7Smrg# Minimum version: 1.3.0
105286aec45a7Smrg#
105296aec45a7Smrg# Defines default options for X.Org modules.
105306aec45a7Smrg#
105316aec45a7SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
105326aec45a7SmrgAC_REQUIRE([AC_PROG_INSTALL])
10533aa9e3350SmrgXORG_COMPILER_FLAGS
105346aec45a7SmrgXORG_CWARNFLAGS
105356aec45a7SmrgXORG_STRICT_OPTION
105366aec45a7SmrgXORG_RELEASE_VERSION
105376aec45a7SmrgXORG_CHANGELOG
105386aec45a7SmrgXORG_INSTALL
105396aec45a7SmrgXORG_MANPAGE_SECTIONS
105406aec45a7Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
105416aec45a7Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
105426aec45a7Smrg]) # XORG_DEFAULT_OPTIONS
105436aec45a7Smrg
105446aec45a7Smrg# XORG_INSTALL()
105456aec45a7Smrg# ----------------
105466aec45a7Smrg# Minimum version: 1.4.0
105476aec45a7Smrg#
105486aec45a7Smrg# Defines the variable INSTALL_CMD as the command to copy
105496aec45a7Smrg# INSTALL from $prefix/share/util-macros.
105506aec45a7Smrg#
105516aec45a7SmrgAC_DEFUN([XORG_INSTALL], [
105526aec45a7SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
105536aec45a7Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
105546aec45a7SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
105556aec45a7Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
105566aec45a7Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
105576aec45a7Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
105586aec45a7SmrgAC_SUBST([INSTALL_CMD])
105596aec45a7Smrg]) # XORG_INSTALL
105608697ee19Smrgdnl Copyright 2005 Red Hat, Inc
105618697ee19Smrgdnl
105628697ee19Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
105638697ee19Smrgdnl documentation for any purpose is hereby granted without fee, provided that
105648697ee19Smrgdnl the above copyright notice appear in all copies and that both that
105658697ee19Smrgdnl copyright notice and this permission notice appear in supporting
105668697ee19Smrgdnl documentation.
105678697ee19Smrgdnl
105688697ee19Smrgdnl The above copyright notice and this permission notice shall be included
105698697ee19Smrgdnl in all copies or substantial portions of the Software.
105708697ee19Smrgdnl
105718697ee19Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
105728697ee19Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
105738697ee19Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
105748697ee19Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
105758697ee19Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
105768697ee19Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
105778697ee19Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
105788697ee19Smrgdnl
105798697ee19Smrgdnl Except as contained in this notice, the name of the copyright holders shall
105808697ee19Smrgdnl not be used in advertising or otherwise to promote the sale, use or
105818697ee19Smrgdnl other dealings in this Software without prior written authorization
105828697ee19Smrgdnl from the copyright holders.
105838697ee19Smrgdnl
10584ab47cfaaSmrg
105858697ee19Smrg# XORG_RELEASE_VERSION
105868697ee19Smrg# --------------------
105876aec45a7Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
105888697ee19Smrg 
105898697ee19SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
105908697ee19Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
105918697ee19Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
105928697ee19Smrg		[Major version of this package])
105938697ee19Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
105948697ee19Smrg	if test "x$PVM" = "x"; then
105958697ee19Smrg		PVM="0"
105968697ee19Smrg	fi
105978697ee19Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
105988697ee19Smrg		[$PVM],
105998697ee19Smrg		[Minor version of this package])
106008697ee19Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
106018697ee19Smrg	if test "x$PVP" = "x"; then
106028697ee19Smrg		PVP="0"
106038697ee19Smrg	fi
106048697ee19Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
106058697ee19Smrg		[$PVP],
106068697ee19Smrg		[Patch version of this package])
106078697ee19Smrg])
10608ab47cfaaSmrg
106091473d951Smrg# XORG_CHANGELOG()
106101473d951Smrg# ----------------
106111473d951Smrg# Minimum version: 1.2.0
106121473d951Smrg#
106131473d951Smrg# Defines the variable CHANGELOG_CMD as the command to generate
106141473d951Smrg# ChangeLog from git.
106151473d951Smrg#
106161473d951Smrg#
106171473d951SmrgAC_DEFUN([XORG_CHANGELOG], [
106186aec45a7SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
106196aec45a7Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
106206aec45a7Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
106211473d951Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
106221473d951SmrgAC_SUBST([CHANGELOG_CMD])
106231473d951Smrg]) # XORG_CHANGELOG
106241473d951Smrg
106251473d951Smrgdnl Copyright 2005 Red Hat, Inc
106261473d951Smrgdnl 
106271473d951Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
106281473d951Smrgdnl documentation for any purpose is hereby granted without fee, provided that
106291473d951Smrgdnl the above copyright notice appear in all copies and that both that
106301473d951Smrgdnl copyright notice and this permission notice appear in supporting
106311473d951Smrgdnl documentation.
106321473d951Smrgdnl 
106331473d951Smrgdnl The above copyright notice and this permission notice shall be included
106341473d951Smrgdnl in all copies or substantial portions of the Software.
106351473d951Smrgdnl 
106361473d951Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
106371473d951Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
106381473d951Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
106391473d951Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
106401473d951Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
106411473d951Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
106421473d951Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
106431473d951Smrgdnl 
106441473d951Smrgdnl Except as contained in this notice, the name of the copyright holders shall
106451473d951Smrgdnl not be used in advertising or otherwise to promote the sale, use or
106461473d951Smrgdnl other dealings in this Software without prior written authorization
106471473d951Smrgdnl from the copyright holders.
106481473d951Smrgdnl 
106491473d951Smrg
106501473d951Smrg# XORG_DRIVER_CHECK_EXT()
106511473d951Smrg# --------------------------
106521473d951Smrg# Checks for the $1 define in xorg-server.h (from the sdk).  If it
106531473d951Smrg# is defined, then add $1 to $REQUIRED_MODULES.
106541473d951Smrg
106551473d951SmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
106566aec45a7Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
106571473d951Smrg	SAVE_CFLAGS="$CFLAGS"
106586aec45a7Smrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
106591473d951Smrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
106601473d951Smrg#include "xorg-server.h"
106611473d951Smrg#if !defined $1
106621473d951Smrg#error $1 not defined
106631473d951Smrg#endif
106641473d951Smrg		]])],
106651473d951Smrg		[_EXT_CHECK=yes],
106661473d951Smrg		[_EXT_CHECK=no])
106671473d951Smrg	CFLAGS="$SAVE_CFLAGS"
106681473d951Smrg	AC_MSG_CHECKING([if $1 is defined])
106691473d951Smrg	AC_MSG_RESULT([$_EXT_CHECK])
106701473d951Smrg	if test "$_EXT_CHECK" != no; then
106711473d951Smrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
106721473d951Smrg	fi
106731473d951Smrg])
106741473d951Smrg
10675aa9e3350Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
10676aa9e3350Smrg# Foundation, Inc.
10677ab47cfaaSmrg#
10678ab47cfaaSmrg# This file is free software; the Free Software Foundation
10679ab47cfaaSmrg# gives unlimited permission to copy and/or distribute it,
10680ab47cfaaSmrg# with or without modifications, as long as this notice is preserved.
10681ab47cfaaSmrg
10682aa9e3350Smrg# serial 1
10683aa9e3350Smrg
106848697ee19Smrg# AM_AUTOMAKE_VERSION(VERSION)
106858697ee19Smrg# ----------------------------
106868697ee19Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
106878697ee19Smrg# generated from the m4 files accompanying Automake X.Y.
106888697ee19Smrg# (This private macro should not be called outside this file.)
106898697ee19SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
106905c42550eSmrg[am__api_version='1.11'
106918697ee19Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
106928697ee19Smrgdnl require some minimum version.  Point them to the right macro.
10693aa9e3350Smrgm4_if([$1], [1.11.3], [],
106948697ee19Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
106958697ee19Smrg])
10696ab47cfaaSmrg
106978697ee19Smrg# _AM_AUTOCONF_VERSION(VERSION)
106988697ee19Smrg# -----------------------------
106998697ee19Smrg# aclocal traces this macro to find the Autoconf version.
107008697ee19Smrg# This is a private macro too.  Using m4_define simplifies
107018697ee19Smrg# the logic in aclocal, which can simply ignore this definition.
107028697ee19Smrgm4_define([_AM_AUTOCONF_VERSION], [])
10703ab47cfaaSmrg
107048697ee19Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
107058697ee19Smrg# -------------------------------
107068697ee19Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
107071473d951Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
107088697ee19SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
10709aa9e3350Smrg[AM_AUTOMAKE_VERSION([1.11.3])dnl
107108697ee19Smrgm4_ifndef([AC_AUTOCONF_VERSION],
107118697ee19Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
107121473d951Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
10713ab47cfaaSmrg
107148697ee19Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
10715ab47cfaaSmrg
10716aa9e3350Smrg# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
10717ab47cfaaSmrg#
10718ab47cfaaSmrg# This file is free software; the Free Software Foundation
10719ab47cfaaSmrg# gives unlimited permission to copy and/or distribute it,
10720ab47cfaaSmrg# with or without modifications, as long as this notice is preserved.
10721ab47cfaaSmrg
10722aa9e3350Smrg# serial 1
10723aa9e3350Smrg
107248697ee19Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
107258697ee19Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
107268697ee19Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
107278697ee19Smrg#
107288697ee19Smrg# Of course, Automake must honor this variable whenever it calls a
107298697ee19Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
107308697ee19Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
107318697ee19Smrg# depending on how configure is run.  This is pretty annoying, since
107328697ee19Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
107338697ee19Smrg# source directory, any form will work fine, but in subdirectories a
107348697ee19Smrg# relative path needs to be adjusted first.
107358697ee19Smrg#
107368697ee19Smrg# $ac_aux_dir/missing
107378697ee19Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
107388697ee19Smrg# $top_srcdir/$ac_aux_dir/missing
107398697ee19Smrg#    fails if $ac_aux_dir is absolute,
107408697ee19Smrg#    fails when called from a subdirectory in a VPATH build with
107418697ee19Smrg#          a relative $ac_aux_dir
107428697ee19Smrg#
107438697ee19Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
107448697ee19Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
107458697ee19Smrg# harmless because $srcdir is `.', but things will broke when you
107468697ee19Smrg# start a VPATH build or use an absolute $srcdir.
107478697ee19Smrg#
107488697ee19Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
107498697ee19Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
107508697ee19Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
107518697ee19Smrg# and then we would define $MISSING as
107528697ee19Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
107538697ee19Smrg# This will work as long as MISSING is not called from configure, because
107548697ee19Smrg# unfortunately $(top_srcdir) has no meaning in configure.
107558697ee19Smrg# However there are other variables, like CC, which are often used in
107568697ee19Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
107578697ee19Smrg#
107588697ee19Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
107598697ee19Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
107608697ee19Smrg# configured tree to be moved without reconfiguration.
10761ab47cfaaSmrg
107628697ee19SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
107638697ee19Smrg[dnl Rely on autoconf to set up CDPATH properly.
107648697ee19SmrgAC_PREREQ([2.50])dnl
107658697ee19Smrg# expand $ac_aux_dir to an absolute path
107668697ee19Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
107678697ee19Smrg])
10768ab47cfaaSmrg
107698697ee19Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
107708697ee19Smrg
107715c42550eSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
107728697ee19Smrg# Free Software Foundation, Inc.
10773ab47cfaaSmrg#
10774ab47cfaaSmrg# This file is free software; the Free Software Foundation
10775ab47cfaaSmrg# gives unlimited permission to copy and/or distribute it,
10776ab47cfaaSmrg# with or without modifications, as long as this notice is preserved.
10777ab47cfaaSmrg
107785c42550eSmrg# serial 9
10779ab47cfaaSmrg
107808697ee19Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
107818697ee19Smrg# -------------------------------------
107828697ee19Smrg# Define a conditional.
107838697ee19SmrgAC_DEFUN([AM_CONDITIONAL],
107848697ee19Smrg[AC_PREREQ(2.52)dnl
107858697ee19Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
107868697ee19Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
107878697ee19SmrgAC_SUBST([$1_TRUE])dnl
107888697ee19SmrgAC_SUBST([$1_FALSE])dnl
107898697ee19Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
107908697ee19Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
107915c42550eSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
107928697ee19Smrgif $2; then
107938697ee19Smrg  $1_TRUE=
107948697ee19Smrg  $1_FALSE='#'
107958697ee19Smrgelse
107968697ee19Smrg  $1_TRUE='#'
107978697ee19Smrg  $1_FALSE=
107988697ee19Smrgfi
107998697ee19SmrgAC_CONFIG_COMMANDS_PRE(
108008697ee19Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
108018697ee19Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
108028697ee19SmrgUsually this means the macro was only invoked conditionally.]])
108038697ee19Smrgfi])])
108048697ee19Smrg
10805aa9e3350Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
10806aa9e3350Smrg# 2010, 2011 Free Software Foundation, Inc.
10807ab47cfaaSmrg#
108088697ee19Smrg# This file is free software; the Free Software Foundation
108098697ee19Smrg# gives unlimited permission to copy and/or distribute it,
108108697ee19Smrg# with or without modifications, as long as this notice is preserved.
108118697ee19Smrg
10812aa9e3350Smrg# serial 12
108138697ee19Smrg
108148697ee19Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
108158697ee19Smrg# written in clear, in which case automake, when reading aclocal.m4,
108168697ee19Smrg# will think it sees a *use*, and therefore will trigger all it's
108178697ee19Smrg# C support machinery.  Also note that it means that autoscan, seeing
108188697ee19Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
108198697ee19Smrg
108208697ee19Smrg
108218697ee19Smrg# _AM_DEPENDENCIES(NAME)
108228697ee19Smrg# ----------------------
108238697ee19Smrg# See how the compiler implements dependency checking.
108248697ee19Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
108258697ee19Smrg# We try a few techniques and use that to set a single cache variable.
10826ab47cfaaSmrg#
108278697ee19Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
108288697ee19Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
108298697ee19Smrg# dependency, and given that the user is not expected to run this macro,
108308697ee19Smrg# just rely on AC_PROG_CC.
108318697ee19SmrgAC_DEFUN([_AM_DEPENDENCIES],
108328697ee19Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
108338697ee19SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
108348697ee19SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
108358697ee19SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
10836ab47cfaaSmrg
108378697ee19Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
108388697ee19Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
108398697ee19Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
108408697ee19Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
108418697ee19Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
108428697ee19Smrg                   [depcc="$$1"   am_compiler_list=])
10843ab47cfaaSmrg
108448697ee19SmrgAC_CACHE_CHECK([dependency style of $depcc],
108458697ee19Smrg               [am_cv_$1_dependencies_compiler_type],
108468697ee19Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
108478697ee19Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
108488697ee19Smrg  # making bogus files that we don't know about and never remove.  For
108498697ee19Smrg  # instance it was reported that on HP-UX the gcc test will end up
108508697ee19Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
108518697ee19Smrg  # in D'.
10852aa9e3350Smrg  rm -rf conftest.dir
10853ab47cfaaSmrg  mkdir conftest.dir
108548697ee19Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
108558697ee19Smrg  # using a relative directory.
108568697ee19Smrg  cp "$am_depcomp" conftest.dir
108578697ee19Smrg  cd conftest.dir
108588697ee19Smrg  # We will build objects and dependencies in a subdirectory because
108598697ee19Smrg  # it helps to detect inapplicable dependency modes.  For instance
108608697ee19Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
108618697ee19Smrg  # side effect of compilation, but ICC will put the dependencies in
108628697ee19Smrg  # the current directory while Tru64 will put them in the object
108638697ee19Smrg  # directory.
108648697ee19Smrg  mkdir sub
108658697ee19Smrg
108668697ee19Smrg  am_cv_$1_dependencies_compiler_type=none
108678697ee19Smrg  if test "$am_compiler_list" = ""; then
108688697ee19Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
10869ab47cfaaSmrg  fi
108705c42550eSmrg  am__universal=false
108715c42550eSmrg  m4_case([$1], [CC],
108725c42550eSmrg    [case " $depcc " in #(
108735c42550eSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
108745c42550eSmrg     esac],
108755c42550eSmrg    [CXX],
108765c42550eSmrg    [case " $depcc " in #(
108775c42550eSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
108785c42550eSmrg     esac])
108795c42550eSmrg
108808697ee19Smrg  for depmode in $am_compiler_list; do
108818697ee19Smrg    # Setup a source with many dependencies, because some compilers
108828697ee19Smrg    # like to wrap large dependency lists on column 80 (with \), and
108838697ee19Smrg    # we should not choose a depcomp mode which is confused by this.
108848697ee19Smrg    #
108858697ee19Smrg    # We need to recreate these files for each test, as the compiler may
108868697ee19Smrg    # overwrite some of them when testing with obscure command lines.
108878697ee19Smrg    # This happens at least with the AIX C compiler.
108888697ee19Smrg    : > sub/conftest.c
108898697ee19Smrg    for i in 1 2 3 4 5 6; do
108908697ee19Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
108918697ee19Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
108928697ee19Smrg      # Solaris 8's {/usr,}/bin/sh.
108938697ee19Smrg      touch sub/conftst$i.h
108948697ee19Smrg    done
108958697ee19Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
10896ab47cfaaSmrg
108975c42550eSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
108985c42550eSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
108995c42550eSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
109005c42550eSmrg    # versions had trouble with output in subdirs
109015c42550eSmrg    am__obj=sub/conftest.${OBJEXT-o}
109025c42550eSmrg    am__minus_obj="-o $am__obj"
109038697ee19Smrg    case $depmode in
109045c42550eSmrg    gcc)
109055c42550eSmrg      # This depmode causes a compiler race in universal mode.
109065c42550eSmrg      test "$am__universal" = false || continue
109075c42550eSmrg      ;;
109088697ee19Smrg    nosideeffect)
109098697ee19Smrg      # after this tag, mechanisms are not by side-effect, so they'll
109108697ee19Smrg      # only be used when explicitly requested
109118697ee19Smrg      if test "x$enable_dependency_tracking" = xyes; then
109128697ee19Smrg	continue
109138697ee19Smrg      else
109148697ee19Smrg	break
109158697ee19Smrg      fi
109168697ee19Smrg      ;;
10917aa9e3350Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
109185c42550eSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
109195c42550eSmrg      # not run yet.  These depmodes are late enough in the game, and
109205c42550eSmrg      # so weak that their functioning should not be impacted.
109215c42550eSmrg      am__obj=conftest.${OBJEXT-o}
109225c42550eSmrg      am__minus_obj=
109235c42550eSmrg      ;;
109248697ee19Smrg    none) break ;;
109258697ee19Smrg    esac
109268697ee19Smrg    if depmode=$depmode \
109275c42550eSmrg       source=sub/conftest.c object=$am__obj \
109288697ee19Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
109295c42550eSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
109308697ee19Smrg         >/dev/null 2>conftest.err &&
109318697ee19Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
109328697ee19Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
109335c42550eSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
109348697ee19Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
109358697ee19Smrg      # icc doesn't choke on unknown options, it will just issue warnings
109368697ee19Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
109378697ee19Smrg      # that says an option was ignored or not supported.
109388697ee19Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
109398697ee19Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
109408697ee19Smrg      # The diagnosis changed in icc 8.0:
109418697ee19Smrg      #   icc: Command line remark: option '-MP' not supported
109428697ee19Smrg      if (grep 'ignoring option' conftest.err ||
109438697ee19Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
109448697ee19Smrg        am_cv_$1_dependencies_compiler_type=$depmode
109458697ee19Smrg        break
109468697ee19Smrg      fi
109478697ee19Smrg    fi
109488697ee19Smrg  done
10949ab47cfaaSmrg
109508697ee19Smrg  cd ..
109518697ee19Smrg  rm -rf conftest.dir
109528697ee19Smrgelse
109538697ee19Smrg  am_cv_$1_dependencies_compiler_type=none
109548697ee19Smrgfi
109558697ee19Smrg])
109568697ee19SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
109578697ee19SmrgAM_CONDITIONAL([am__fastdep$1], [
109588697ee19Smrg  test "x$enable_dependency_tracking" != xno \
109598697ee19Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
109608697ee19Smrg])
10961ab47cfaaSmrg
109628697ee19Smrg
109638697ee19Smrg# AM_SET_DEPDIR
109648697ee19Smrg# -------------
109658697ee19Smrg# Choose a directory name for dependency files.
109668697ee19Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
109678697ee19SmrgAC_DEFUN([AM_SET_DEPDIR],
109688697ee19Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
109698697ee19SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
109708697ee19Smrg])
109718697ee19Smrg
109728697ee19Smrg
109738697ee19Smrg# AM_DEP_TRACK
109748697ee19Smrg# ------------
109758697ee19SmrgAC_DEFUN([AM_DEP_TRACK],
109768697ee19Smrg[AC_ARG_ENABLE(dependency-tracking,
109778697ee19Smrg[  --disable-dependency-tracking  speeds up one-time build
109788697ee19Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
109798697ee19Smrgif test "x$enable_dependency_tracking" != xno; then
109808697ee19Smrg  am_depcomp="$ac_aux_dir/depcomp"
109818697ee19Smrg  AMDEPBACKSLASH='\'
10982aa9e3350Smrg  am__nodep='_no'
109838697ee19Smrgfi
109848697ee19SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
109858697ee19SmrgAC_SUBST([AMDEPBACKSLASH])dnl
109868697ee19Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
10987aa9e3350SmrgAC_SUBST([am__nodep])dnl
10988aa9e3350Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
109898697ee19Smrg])
109908697ee19Smrg
109918697ee19Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
109928697ee19Smrg
109931473d951Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
109948697ee19Smrg# Free Software Foundation, Inc.
10995ab47cfaaSmrg#
109968697ee19Smrg# This file is free software; the Free Software Foundation
109978697ee19Smrg# gives unlimited permission to copy and/or distribute it,
109988697ee19Smrg# with or without modifications, as long as this notice is preserved.
109998697ee19Smrg
110005c42550eSmrg#serial 5
110018697ee19Smrg
110028697ee19Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
110038697ee19Smrg# ------------------------------
110048697ee19SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
110055c42550eSmrg[{
110065c42550eSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
110075c42550eSmrg  # are listed without --file.  Let's play safe and only enable the eval
110085c42550eSmrg  # if we detect the quoting.
110095c42550eSmrg  case $CONFIG_FILES in
110105c42550eSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
110115c42550eSmrg  *)   set x $CONFIG_FILES ;;
110125c42550eSmrg  esac
110135c42550eSmrg  shift
110145c42550eSmrg  for mf
110155c42550eSmrg  do
110165c42550eSmrg    # Strip MF so we end up with the name of the file.
110175c42550eSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
110185c42550eSmrg    # Check whether this is an Automake generated Makefile or not.
110195c42550eSmrg    # We used to match only the files named `Makefile.in', but
110205c42550eSmrg    # some people rename them; so instead we look at the file content.
110215c42550eSmrg    # Grep'ing the first line is not enough: some people post-process
110225c42550eSmrg    # each Makefile.in and add a new line on top of each file to say so.
110235c42550eSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
110245c42550eSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
110255c42550eSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
110265c42550eSmrg      dirpart=`AS_DIRNAME("$mf")`
110275c42550eSmrg    else
110285c42550eSmrg      continue
110295c42550eSmrg    fi
110305c42550eSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
110315c42550eSmrg    # from the Makefile without running `make'.
110325c42550eSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
110335c42550eSmrg    test -z "$DEPDIR" && continue
110345c42550eSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
110355c42550eSmrg    test -z "am__include" && continue
110365c42550eSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
110375c42550eSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
110385c42550eSmrg    U=`sed -n 's/^U = //p' < "$mf"`
110395c42550eSmrg    # Find all dependency output files, they are included files with
110405c42550eSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
110415c42550eSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
110425c42550eSmrg    # expansion.
110435c42550eSmrg    for file in `sed -n "
110445c42550eSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
110455c42550eSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
110465c42550eSmrg      # Make sure the directory exists.
110475c42550eSmrg      test -f "$dirpart/$file" && continue
110485c42550eSmrg      fdir=`AS_DIRNAME(["$file"])`
110495c42550eSmrg      AS_MKDIR_P([$dirpart/$fdir])
110505c42550eSmrg      # echo "creating $dirpart/$file"
110515c42550eSmrg      echo '# dummy' > "$dirpart/$file"
110525c42550eSmrg    done
110538697ee19Smrg  done
110545c42550eSmrg}
110558697ee19Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
110568697ee19Smrg
110578697ee19Smrg
110588697ee19Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
110598697ee19Smrg# -----------------------------
110608697ee19Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
11061ab47cfaaSmrg#
110628697ee19Smrg# This code is only required when automatic dependency tracking
110638697ee19Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
110648697ee19Smrg# need in order to bootstrap the dependency handling code.
110658697ee19SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
110668697ee19Smrg[AC_CONFIG_COMMANDS([depfiles],
110678697ee19Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
110688697ee19Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
110698697ee19Smrg])
110708697ee19Smrg
110718697ee19Smrg# Do all the work for Automake.                             -*- Autoconf -*-
110728697ee19Smrg
110738697ee19Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
110745c42550eSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
11075ab47cfaaSmrg#
110768697ee19Smrg# This file is free software; the Free Software Foundation
110778697ee19Smrg# gives unlimited permission to copy and/or distribute it,
110788697ee19Smrg# with or without modifications, as long as this notice is preserved.
110798697ee19Smrg
110805c42550eSmrg# serial 16
110818697ee19Smrg
110828697ee19Smrg# This macro actually does too much.  Some checks are only needed if
110838697ee19Smrg# your package does certain things.  But this isn't really a big deal.
110848697ee19Smrg
110858697ee19Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
110868697ee19Smrg# AM_INIT_AUTOMAKE([OPTIONS])
110878697ee19Smrg# -----------------------------------------------
110888697ee19Smrg# The call with PACKAGE and VERSION arguments is the old style
110898697ee19Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
110908697ee19Smrg# and VERSION should now be passed to AC_INIT and removed from
110918697ee19Smrg# the call to AM_INIT_AUTOMAKE.
110928697ee19Smrg# We support both call styles for the transition.  After
110938697ee19Smrg# the next Automake release, Autoconf can make the AC_INIT
110948697ee19Smrg# arguments mandatory, and then we can depend on a new Autoconf
110958697ee19Smrg# release and drop the old call support.
110968697ee19SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
110975c42550eSmrg[AC_PREREQ([2.62])dnl
110988697ee19Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
110998697ee19Smrgdnl the ones we care about.
111008697ee19Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
111018697ee19SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
111028697ee19SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
111038697ee19Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
111048697ee19Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
111058697ee19Smrg  # is not polluted with repeated "-I."
111068697ee19Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
111078697ee19Smrg  # test to see if srcdir already configured
111088697ee19Smrg  if test -f $srcdir/config.status; then
111098697ee19Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
111108697ee19Smrg  fi
111118697ee19Smrgfi
111128697ee19Smrg
111138697ee19Smrg# test whether we have cygpath
111148697ee19Smrgif test -z "$CYGPATH_W"; then
111158697ee19Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
111168697ee19Smrg    CYGPATH_W='cygpath -w'
111178697ee19Smrg  else
111188697ee19Smrg    CYGPATH_W=echo
111198697ee19Smrg  fi
111208697ee19Smrgfi
111218697ee19SmrgAC_SUBST([CYGPATH_W])
111228697ee19Smrg
111238697ee19Smrg# Define the identity of the package.
111248697ee19Smrgdnl Distinguish between old-style and new-style calls.
111258697ee19Smrgm4_ifval([$2],
111268697ee19Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
111278697ee19Smrg AC_SUBST([PACKAGE], [$1])dnl
111288697ee19Smrg AC_SUBST([VERSION], [$2])],
111298697ee19Smrg[_AM_SET_OPTIONS([$1])dnl
111308697ee19Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
111318697ee19Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
111328697ee19Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
111338697ee19Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
111348697ee19Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
111358697ee19Smrg
111368697ee19Smrg_AM_IF_OPTION([no-define],,
111378697ee19Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
111388697ee19Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
111398697ee19Smrg
111408697ee19Smrg# Some tools Automake needs.
111418697ee19SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
111428697ee19SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
111438697ee19SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
111448697ee19SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
111458697ee19SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
111468697ee19SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
111478697ee19SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
111485c42550eSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
111495c42550eSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
111508697ee19SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
111518697ee19Smrg# We need awk for the "check" target.  The system "awk" is bad on
111528697ee19Smrg# some platforms.
111538697ee19SmrgAC_REQUIRE([AC_PROG_AWK])dnl
111548697ee19SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
111558697ee19SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
111568697ee19Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
111575c42550eSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
111585c42550eSmrg			     [_AM_PROG_TAR([v7])])])
111598697ee19Smrg_AM_IF_OPTION([no-dependencies],,
111608697ee19Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
111615c42550eSmrg		  [_AM_DEPENDENCIES(CC)],
111625c42550eSmrg		  [define([AC_PROG_CC],
111635c42550eSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
111648697ee19SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
111655c42550eSmrg		  [_AM_DEPENDENCIES(CXX)],
111665c42550eSmrg		  [define([AC_PROG_CXX],
111675c42550eSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
111688697ee19SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
111695c42550eSmrg		  [_AM_DEPENDENCIES(OBJC)],
111705c42550eSmrg		  [define([AC_PROG_OBJC],
111715c42550eSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
111728697ee19Smrg])
111735c42550eSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
111745c42550eSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
111755c42550eSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
111765c42550eSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
111775c42550eSmrgAC_CONFIG_COMMANDS_PRE(dnl
111785c42550eSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
111795c42550eSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
111808697ee19Smrg])
11181ab47cfaaSmrg
111825c42550eSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
111835c42550eSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
111845c42550eSmrgdnl mangled by Autoconf and run in a shell conditional statement.
111855c42550eSmrgm4_define([_AC_COMPILER_EXEEXT],
111865c42550eSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
111875c42550eSmrg
11188ab47cfaaSmrg
111898697ee19Smrg# When config.status generates a header, we must update the stamp-h file.
111908697ee19Smrg# This file resides in the same directory as the config header
111918697ee19Smrg# that is generated.  The stamp files are numbered to have different names.
11192ab47cfaaSmrg
111938697ee19Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
111948697ee19Smrg# loop where config.status creates the headers, so we can generate
111958697ee19Smrg# our stamp files there.
111968697ee19SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
111978697ee19Smrg[# Compute $1's index in $config_headers.
111988697ee19Smrg_am_arg=$1
111998697ee19Smrg_am_stamp_count=1
112008697ee19Smrgfor _am_header in $config_headers :; do
112018697ee19Smrg  case $_am_header in
112028697ee19Smrg    $_am_arg | $_am_arg:* )
112038697ee19Smrg      break ;;
112048697ee19Smrg    * )
112058697ee19Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
112068697ee19Smrg  esac
112078697ee19Smrgdone
112088697ee19Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
11209ab47cfaaSmrg
11210aa9e3350Smrg# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
11211aa9e3350Smrg# Inc.
11212ab47cfaaSmrg#
112138697ee19Smrg# This file is free software; the Free Software Foundation
112148697ee19Smrg# gives unlimited permission to copy and/or distribute it,
112158697ee19Smrg# with or without modifications, as long as this notice is preserved.
11216ab47cfaaSmrg
11217aa9e3350Smrg# serial 1
11218aa9e3350Smrg
112198697ee19Smrg# AM_PROG_INSTALL_SH
112208697ee19Smrg# ------------------
112218697ee19Smrg# Define $install_sh.
112228697ee19SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
112238697ee19Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
112245c42550eSmrgif test x"${install_sh}" != xset; then
112255c42550eSmrg  case $am_aux_dir in
112265c42550eSmrg  *\ * | *\	*)
112275c42550eSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
112285c42550eSmrg  *)
112295c42550eSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
112305c42550eSmrg  esac
112315c42550eSmrgfi
112328697ee19SmrgAC_SUBST(install_sh)])
11233ab47cfaaSmrg
112348697ee19Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
112358697ee19Smrg#
112368697ee19Smrg# This file is free software; the Free Software Foundation
112378697ee19Smrg# gives unlimited permission to copy and/or distribute it,
112388697ee19Smrg# with or without modifications, as long as this notice is preserved.
11239ab47cfaaSmrg
112408697ee19Smrg# serial 2
11241ab47cfaaSmrg
112428697ee19Smrg# Check whether the underlying file-system supports filenames
112438697ee19Smrg# with a leading dot.  For instance MS-DOS doesn't.
112448697ee19SmrgAC_DEFUN([AM_SET_LEADING_DOT],
112458697ee19Smrg[rm -rf .tst 2>/dev/null
112468697ee19Smrgmkdir .tst 2>/dev/null
112478697ee19Smrgif test -d .tst; then
112488697ee19Smrg  am__leading_dot=.
112498697ee19Smrgelse
112508697ee19Smrg  am__leading_dot=_
11251ab47cfaaSmrgfi
112528697ee19Smrgrmdir .tst 2>/dev/null
112538697ee19SmrgAC_SUBST([am__leading_dot])])
11254ab47cfaaSmrg
112558697ee19Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
112568697ee19Smrg# From Jim Meyering
11257ab47cfaaSmrg
11258aa9e3350Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
11259aa9e3350Smrg# 2011 Free Software Foundation, Inc.
112608697ee19Smrg#
112618697ee19Smrg# This file is free software; the Free Software Foundation
112628697ee19Smrg# gives unlimited permission to copy and/or distribute it,
112638697ee19Smrg# with or without modifications, as long as this notice is preserved.
11264ab47cfaaSmrg
112655c42550eSmrg# serial 5
11266ab47cfaaSmrg
112675c42550eSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
112685c42550eSmrg# ----------------------------------
112695c42550eSmrg# Control maintainer-specific portions of Makefiles.
112705c42550eSmrg# Default is to disable them, unless `enable' is passed literally.
112715c42550eSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
112725c42550eSmrg# can override the default with the --enable/--disable switch.
112738697ee19SmrgAC_DEFUN([AM_MAINTAINER_MODE],
112745c42550eSmrg[m4_case(m4_default([$1], [disable]),
112755c42550eSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
112765c42550eSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
112775c42550eSmrg       [m4_define([am_maintainer_other], [enable])
112785c42550eSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
11279aa9e3350SmrgAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
112805c42550eSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
112815c42550eSmrg  AC_ARG_ENABLE([maintainer-mode],
112825c42550eSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
112838697ee19Smrg			  (and sometimes confusing) to the casual installer],
112845c42550eSmrg      [USE_MAINTAINER_MODE=$enableval],
112855c42550eSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
112868697ee19Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
112875c42550eSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
112888697ee19Smrg  MAINT=$MAINTAINER_MODE_TRUE
112895c42550eSmrg  AC_SUBST([MAINT])dnl
112908697ee19Smrg]
112918697ee19Smrg)
11292ab47cfaaSmrg
112938697ee19SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
11294ab47cfaaSmrg
112958697ee19Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
11296ab47cfaaSmrg
112975c42550eSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
112988697ee19Smrg#
112998697ee19Smrg# This file is free software; the Free Software Foundation
113008697ee19Smrg# gives unlimited permission to copy and/or distribute it,
113018697ee19Smrg# with or without modifications, as long as this notice is preserved.
11302ab47cfaaSmrg
113035c42550eSmrg# serial 4
11304ab47cfaaSmrg
113058697ee19Smrg# AM_MAKE_INCLUDE()
113068697ee19Smrg# -----------------
113078697ee19Smrg# Check to see how make treats includes.
113088697ee19SmrgAC_DEFUN([AM_MAKE_INCLUDE],
113098697ee19Smrg[am_make=${MAKE-make}
113108697ee19Smrgcat > confinc << 'END'
113118697ee19Smrgam__doit:
113125c42550eSmrg	@echo this is the am__doit target
113138697ee19Smrg.PHONY: am__doit
113148697ee19SmrgEND
113158697ee19Smrg# If we don't find an include directive, just comment out the code.
113168697ee19SmrgAC_MSG_CHECKING([for style of include used by $am_make])
113178697ee19Smrgam__include="#"
113188697ee19Smrgam__quote=
113198697ee19Smrg_am_result=none
113208697ee19Smrg# First try GNU make style include.
113218697ee19Smrgecho "include confinc" > confmf
113225c42550eSmrg# Ignore all kinds of additional output from `make'.
113235c42550eSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
113245c42550eSmrg*the\ am__doit\ target*)
113255c42550eSmrg  am__include=include
113265c42550eSmrg  am__quote=
113275c42550eSmrg  _am_result=GNU
113285c42550eSmrg  ;;
113295c42550eSmrgesac
113308697ee19Smrg# Now try BSD make style include.
113318697ee19Smrgif test "$am__include" = "#"; then
113328697ee19Smrg   echo '.include "confinc"' > confmf
113335c42550eSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
113345c42550eSmrg   *the\ am__doit\ target*)
113355c42550eSmrg     am__include=.include
113365c42550eSmrg     am__quote="\""
113375c42550eSmrg     _am_result=BSD
113385c42550eSmrg     ;;
113395c42550eSmrg   esac
11340ab47cfaaSmrgfi
113418697ee19SmrgAC_SUBST([am__include])
113428697ee19SmrgAC_SUBST([am__quote])
113438697ee19SmrgAC_MSG_RESULT([$_am_result])
113448697ee19Smrgrm -f confinc confmf
113458697ee19Smrg])
113468697ee19Smrg
113478697ee19Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
11348ab47cfaaSmrg
113495c42550eSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
113508697ee19Smrg# Free Software Foundation, Inc.
113518697ee19Smrg#
113528697ee19Smrg# This file is free software; the Free Software Foundation
113538697ee19Smrg# gives unlimited permission to copy and/or distribute it,
113548697ee19Smrg# with or without modifications, as long as this notice is preserved.
11355ab47cfaaSmrg
113565c42550eSmrg# serial 6
11357ab47cfaaSmrg
113588697ee19Smrg# AM_MISSING_PROG(NAME, PROGRAM)
113598697ee19Smrg# ------------------------------
113608697ee19SmrgAC_DEFUN([AM_MISSING_PROG],
113618697ee19Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
113628697ee19Smrg$1=${$1-"${am_missing_run}$2"}
113638697ee19SmrgAC_SUBST($1)])
11364ab47cfaaSmrg
113658697ee19Smrg
113668697ee19Smrg# AM_MISSING_HAS_RUN
113678697ee19Smrg# ------------------
113688697ee19Smrg# Define MISSING if not defined so far and test if it supports --run.
113698697ee19Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
113708697ee19SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
113718697ee19Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
113728697ee19SmrgAC_REQUIRE_AUX_FILE([missing])dnl
113735c42550eSmrgif test x"${MISSING+set}" != xset; then
113745c42550eSmrg  case $am_aux_dir in
113755c42550eSmrg  *\ * | *\	*)
113765c42550eSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
113775c42550eSmrg  *)
113785c42550eSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
113795c42550eSmrg  esac
113805c42550eSmrgfi
113818697ee19Smrg# Use eval to expand $SHELL
113828697ee19Smrgif eval "$MISSING --run true"; then
113838697ee19Smrg  am_missing_run="$MISSING --run "
11384ab47cfaaSmrgelse
113858697ee19Smrg  am_missing_run=
113868697ee19Smrg  AC_MSG_WARN([`missing' script is too old or missing])
11387ab47cfaaSmrgfi
113888697ee19Smrg])
11389ab47cfaaSmrg
11390aa9e3350Smrg# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
11391aa9e3350Smrg# Inc.
113928697ee19Smrg#
113938697ee19Smrg# This file is free software; the Free Software Foundation
113948697ee19Smrg# gives unlimited permission to copy and/or distribute it,
113958697ee19Smrg# with or without modifications, as long as this notice is preserved.
11396ab47cfaaSmrg
11397aa9e3350Smrg# serial 1
11398aa9e3350Smrg
113998697ee19Smrg# AM_PROG_MKDIR_P
114008697ee19Smrg# ---------------
114018697ee19Smrg# Check for `mkdir -p'.
114028697ee19SmrgAC_DEFUN([AM_PROG_MKDIR_P],
114038697ee19Smrg[AC_PREREQ([2.60])dnl
114048697ee19SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
114058697ee19Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
114068697ee19Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
114078697ee19Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
114088697ee19Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
114098697ee19Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
114108697ee19Smrgdnl adjustment using top_builddir (which is defined more often than
114118697ee19Smrgdnl MKDIR_P).
114128697ee19SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
114138697ee19Smrgcase $mkdir_p in
114148697ee19Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
114158697ee19Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
114168697ee19Smrgesac
114178697ee19Smrg])
11418ab47cfaaSmrg
114198697ee19Smrg# Helper functions for option handling.                     -*- Autoconf -*-
11420ab47cfaaSmrg
11421aa9e3350Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
11422aa9e3350Smrg# Foundation, Inc.
11423ab47cfaaSmrg#
114248697ee19Smrg# This file is free software; the Free Software Foundation
114258697ee19Smrg# gives unlimited permission to copy and/or distribute it,
114268697ee19Smrg# with or without modifications, as long as this notice is preserved.
11427ab47cfaaSmrg
11428aa9e3350Smrg# serial 5
11429ab47cfaaSmrg
114308697ee19Smrg# _AM_MANGLE_OPTION(NAME)
114318697ee19Smrg# -----------------------
114328697ee19SmrgAC_DEFUN([_AM_MANGLE_OPTION],
114338697ee19Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
11434ab47cfaaSmrg
114358697ee19Smrg# _AM_SET_OPTION(NAME)
11436aa9e3350Smrg# --------------------
114378697ee19Smrg# Set option NAME.  Presently that only means defining a flag for this option.
114388697ee19SmrgAC_DEFUN([_AM_SET_OPTION],
114398697ee19Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
11440ab47cfaaSmrg
114418697ee19Smrg# _AM_SET_OPTIONS(OPTIONS)
11442aa9e3350Smrg# ------------------------
114438697ee19Smrg# OPTIONS is a space-separated list of Automake options.
114448697ee19SmrgAC_DEFUN([_AM_SET_OPTIONS],
114451473d951Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
11446ab47cfaaSmrg
114478697ee19Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
114488697ee19Smrg# -------------------------------------------
114498697ee19Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
114508697ee19SmrgAC_DEFUN([_AM_IF_OPTION],
114518697ee19Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
11452ab47cfaaSmrg
114538697ee19Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
11454ab47cfaaSmrg
114555c42550eSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
114568697ee19Smrg# Free Software Foundation, Inc.
11457ab47cfaaSmrg#
114588697ee19Smrg# This file is free software; the Free Software Foundation
114598697ee19Smrg# gives unlimited permission to copy and/or distribute it,
114608697ee19Smrg# with or without modifications, as long as this notice is preserved.
11461ab47cfaaSmrg
114625c42550eSmrg# serial 5
11463ab47cfaaSmrg
114648697ee19Smrg# AM_SANITY_CHECK
114658697ee19Smrg# ---------------
114668697ee19SmrgAC_DEFUN([AM_SANITY_CHECK],
114678697ee19Smrg[AC_MSG_CHECKING([whether build environment is sane])
114688697ee19Smrg# Just in case
114698697ee19Smrgsleep 1
114708697ee19Smrgecho timestamp > conftest.file
114715c42550eSmrg# Reject unsafe characters in $srcdir or the absolute working directory
114725c42550eSmrg# name.  Accept space and tab only in the latter.
114735c42550eSmrgam_lf='
114745c42550eSmrg'
114755c42550eSmrgcase `pwd` in
114765c42550eSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
114775c42550eSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
114785c42550eSmrgesac
114795c42550eSmrgcase $srcdir in
114805c42550eSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
114815c42550eSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
114825c42550eSmrgesac
114835c42550eSmrg
114848697ee19Smrg# Do `set' in a subshell so we don't clobber the current shell's
114858697ee19Smrg# arguments.  Must try -L first in case configure is actually a
114868697ee19Smrg# symlink; some systems play weird games with the mod time of symlinks
114878697ee19Smrg# (eg FreeBSD returns the mod time of the symlink's containing
114888697ee19Smrg# directory).
114898697ee19Smrgif (
114905c42550eSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
114918697ee19Smrg   if test "$[*]" = "X"; then
114928697ee19Smrg      # -L didn't work.
114935c42550eSmrg      set X `ls -t "$srcdir/configure" conftest.file`
114948697ee19Smrg   fi
114958697ee19Smrg   rm -f conftest.file
114968697ee19Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
114978697ee19Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
11498ab47cfaaSmrg
114998697ee19Smrg      # If neither matched, then we have a broken ls.  This can happen
115008697ee19Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
115018697ee19Smrg      # broken ls alias from the environment.  This has actually
115028697ee19Smrg      # happened.  Such a system could not be considered "sane".
115038697ee19Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
115048697ee19Smrgalias in your environment])
115058697ee19Smrg   fi
11506ab47cfaaSmrg
115078697ee19Smrg   test "$[2]" = conftest.file
115088697ee19Smrg   )
115098697ee19Smrgthen
115108697ee19Smrg   # Ok.
115118697ee19Smrg   :
115128697ee19Smrgelse
115138697ee19Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
115148697ee19SmrgCheck your system clock])
115158697ee19Smrgfi
115168697ee19SmrgAC_MSG_RESULT(yes)])
11517ab47cfaaSmrg
11518aa9e3350Smrg# Copyright (C) 2009, 2011  Free Software Foundation, Inc.
115196aec45a7Smrg#
115206aec45a7Smrg# This file is free software; the Free Software Foundation
115216aec45a7Smrg# gives unlimited permission to copy and/or distribute it,
115226aec45a7Smrg# with or without modifications, as long as this notice is preserved.
115236aec45a7Smrg
11524aa9e3350Smrg# serial 2
115256aec45a7Smrg
115266aec45a7Smrg# AM_SILENT_RULES([DEFAULT])
115276aec45a7Smrg# --------------------------
115286aec45a7Smrg# Enable less verbose build rules; with the default set to DEFAULT
115296aec45a7Smrg# (`yes' being less verbose, `no' or empty being verbose).
115306aec45a7SmrgAC_DEFUN([AM_SILENT_RULES],
115316aec45a7Smrg[AC_ARG_ENABLE([silent-rules],
115326aec45a7Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
115336aec45a7Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
115346aec45a7Smrgcase $enable_silent_rules in
115356aec45a7Smrgyes) AM_DEFAULT_VERBOSITY=0;;
115366aec45a7Smrgno)  AM_DEFAULT_VERBOSITY=1;;
115376aec45a7Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
115386aec45a7Smrgesac
11539aa9e3350Smrgdnl
11540aa9e3350Smrgdnl A few `make' implementations (e.g., NonStop OS and NextStep)
11541aa9e3350Smrgdnl do not support nested variable expansions.
11542aa9e3350Smrgdnl See automake bug#9928 and bug#10237.
11543aa9e3350Smrgam_make=${MAKE-make}
11544aa9e3350SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
11545aa9e3350Smrg   [am_cv_make_support_nested_variables],
11546aa9e3350Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
11547aa9e3350SmrgBAR0=false
11548aa9e3350SmrgBAR1=true
11549aa9e3350SmrgV=1
11550aa9e3350Smrgam__doit:
11551aa9e3350Smrg	@$(TRUE)
11552aa9e3350Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
11553aa9e3350Smrg  am_cv_make_support_nested_variables=yes
11554aa9e3350Smrgelse
11555aa9e3350Smrg  am_cv_make_support_nested_variables=no
11556aa9e3350Smrgfi])
11557aa9e3350Smrgif test $am_cv_make_support_nested_variables = yes; then
11558aa9e3350Smrg  dnl Using `$V' instead of `$(V)' breaks IRIX make.
11559aa9e3350Smrg  AM_V='$(V)'
11560aa9e3350Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
11561aa9e3350Smrgelse
11562aa9e3350Smrg  AM_V=$AM_DEFAULT_VERBOSITY
11563aa9e3350Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
11564aa9e3350Smrgfi
11565aa9e3350SmrgAC_SUBST([AM_V])dnl
11566aa9e3350SmrgAM_SUBST_NOTMAKE([AM_V])dnl
11567aa9e3350SmrgAC_SUBST([AM_DEFAULT_V])dnl
11568aa9e3350SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
115696aec45a7SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
115706aec45a7SmrgAM_BACKSLASH='\'
115716aec45a7SmrgAC_SUBST([AM_BACKSLASH])dnl
115726aec45a7Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
115736aec45a7Smrg])
115746aec45a7Smrg
11575aa9e3350Smrg# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
11576ab47cfaaSmrg#
115778697ee19Smrg# This file is free software; the Free Software Foundation
115788697ee19Smrg# gives unlimited permission to copy and/or distribute it,
115798697ee19Smrg# with or without modifications, as long as this notice is preserved.
11580ab47cfaaSmrg
11581aa9e3350Smrg# serial 1
11582aa9e3350Smrg
115838697ee19Smrg# AM_PROG_INSTALL_STRIP
115848697ee19Smrg# ---------------------
115858697ee19Smrg# One issue with vendor `install' (even GNU) is that you can't
115868697ee19Smrg# specify the program used to strip binaries.  This is especially
115878697ee19Smrg# annoying in cross-compiling environments, where the build's strip
115888697ee19Smrg# is unlikely to handle the host's binaries.
115898697ee19Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
115908697ee19Smrg# always use install-sh in `make install-strip', and initialize
115918697ee19Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
115928697ee19SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
115938697ee19Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
115948697ee19Smrg# Installed binaries are usually stripped using `strip' when the user
115958697ee19Smrg# run `make install-strip'.  However `strip' might not be the right
115968697ee19Smrg# tool to use in cross-compilation environments, therefore Automake
115978697ee19Smrg# will honor the `STRIP' environment variable to overrule this program.
115988697ee19Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
115998697ee19Smrgif test "$cross_compiling" != no; then
116008697ee19Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
11601ab47cfaaSmrgfi
116028697ee19SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
116038697ee19SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
11604ab47cfaaSmrg
11605aa9e3350Smrg# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
116068697ee19Smrg#
116078697ee19Smrg# This file is free software; the Free Software Foundation
116088697ee19Smrg# gives unlimited permission to copy and/or distribute it,
116098697ee19Smrg# with or without modifications, as long as this notice is preserved.
11610ab47cfaaSmrg
11611aa9e3350Smrg# serial 3
116125c42550eSmrg
116138697ee19Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
116148697ee19Smrg# ---------------------------
116158697ee19Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
116168697ee19Smrg# This macro is traced by Automake.
116178697ee19SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
11618ab47cfaaSmrg
116195c42550eSmrg# AM_SUBST_NOTMAKE(VARIABLE)
11620aa9e3350Smrg# --------------------------
116215c42550eSmrg# Public sister of _AM_SUBST_NOTMAKE.
116225c42550eSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
116235c42550eSmrg
116248697ee19Smrg# Check how to create a tarball.                            -*- Autoconf -*-
11625ab47cfaaSmrg
11626aa9e3350Smrg# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
116278697ee19Smrg#
116288697ee19Smrg# This file is free software; the Free Software Foundation
116298697ee19Smrg# gives unlimited permission to copy and/or distribute it,
116308697ee19Smrg# with or without modifications, as long as this notice is preserved.
11631ab47cfaaSmrg
116328697ee19Smrg# serial 2
11633ab47cfaaSmrg
116348697ee19Smrg# _AM_PROG_TAR(FORMAT)
11635ab47cfaaSmrg# --------------------
116368697ee19Smrg# Check how to create a tarball in format FORMAT.
116378697ee19Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
116388697ee19Smrg#
116398697ee19Smrg# Substitute a variable $(am__tar) that is a command
116408697ee19Smrg# writing to stdout a FORMAT-tarball containing the directory
116418697ee19Smrg# $tardir.
116428697ee19Smrg#     tardir=directory && $(am__tar) > result.tar
116438697ee19Smrg#
116448697ee19Smrg# Substitute a variable $(am__untar) that extract such
116458697ee19Smrg# a tarball read from stdin.
116468697ee19Smrg#     $(am__untar) < result.tar
116478697ee19SmrgAC_DEFUN([_AM_PROG_TAR],
11648aa9e3350Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
11649aa9e3350Smrg# in the wild :-(  We should find a proper way to deprecate it ...
11650aa9e3350SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
116518697ee19Smrgm4_if([$1], [v7],
11652aa9e3350Smrg     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
116538697ee19Smrg     [m4_case([$1], [ustar],, [pax],,
116548697ee19Smrg              [m4_fatal([Unknown tar format])])
116558697ee19SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
116568697ee19Smrg# Loop over all known methods to create a tar archive until one works.
116578697ee19Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
116588697ee19Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
116598697ee19Smrg# Do not fold the above two line into one, because Tru64 sh and
116608697ee19Smrg# Solaris sh will not grok spaces in the rhs of `-'.
116618697ee19Smrgfor _am_tool in $_am_tools
116628697ee19Smrgdo
116638697ee19Smrg  case $_am_tool in
116648697ee19Smrg  gnutar)
116658697ee19Smrg    for _am_tar in tar gnutar gtar;
116668697ee19Smrg    do
116678697ee19Smrg      AM_RUN_LOG([$_am_tar --version]) && break
116688697ee19Smrg    done
116698697ee19Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
116708697ee19Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
116718697ee19Smrg    am__untar="$_am_tar -xf -"
116728697ee19Smrg    ;;
116738697ee19Smrg  plaintar)
116748697ee19Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
116758697ee19Smrg    # ustar tarball either.
116768697ee19Smrg    (tar --version) >/dev/null 2>&1 && continue
116778697ee19Smrg    am__tar='tar chf - "$$tardir"'
116788697ee19Smrg    am__tar_='tar chf - "$tardir"'
116798697ee19Smrg    am__untar='tar xf -'
116808697ee19Smrg    ;;
116818697ee19Smrg  pax)
116828697ee19Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
116838697ee19Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
116848697ee19Smrg    am__untar='pax -r'
116858697ee19Smrg    ;;
116868697ee19Smrg  cpio)
116878697ee19Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
116888697ee19Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
116898697ee19Smrg    am__untar='cpio -i -H $1 -d'
116908697ee19Smrg    ;;
116918697ee19Smrg  none)
116928697ee19Smrg    am__tar=false
116938697ee19Smrg    am__tar_=false
116948697ee19Smrg    am__untar=false
116958697ee19Smrg    ;;
116968697ee19Smrg  esac
116978697ee19Smrg
116988697ee19Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
116998697ee19Smrg  # and am__untar set.
117008697ee19Smrg  test -n "${am_cv_prog_tar_$1}" && break
117018697ee19Smrg
117028697ee19Smrg  # tar/untar a dummy directory, and stop if the command works
117038697ee19Smrg  rm -rf conftest.dir
117048697ee19Smrg  mkdir conftest.dir
117058697ee19Smrg  echo GrepMe > conftest.dir/file
117068697ee19Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
117078697ee19Smrg  rm -rf conftest.dir
117088697ee19Smrg  if test -s conftest.tar; then
117098697ee19Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
117108697ee19Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
117118697ee19Smrg  fi
117128697ee19Smrgdone
117138697ee19Smrgrm -rf conftest.dir
117148697ee19Smrg
117158697ee19SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
117168697ee19SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
117178697ee19SmrgAC_SUBST([am__tar])
117188697ee19SmrgAC_SUBST([am__untar])
117198697ee19Smrg]) # _AM_PROG_TAR
11720ab47cfaaSmrg
11721