aclocal.m4 revision 1b12faf6
11b12faf6Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
232b578d3Smrg
332b578d3Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
42a51b5beSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
532b578d3Smrg# This file is free software; the Free Software Foundation
632b578d3Smrg# gives unlimited permission to copy and/or distribute it,
732b578d3Smrg# with or without modifications, as long as this notice is preserved.
832b578d3Smrg
932b578d3Smrg# This program is distributed in the hope that it will be useful,
1032b578d3Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1132b578d3Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1232b578d3Smrg# PARTICULAR PURPOSE.
1332b578d3Smrg
142a51b5beSmrgm4_ifndef([AC_AUTOCONF_VERSION],
152a51b5beSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
161b12faf6Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
171b12faf6Smrg[m4_warning([this file was generated for autoconf 2.67.
182a51b5beSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
192a51b5beSmrgIf you have problems, you may need to regenerate the build system entirely.
202a51b5beSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
2132b578d3Smrg
222a51b5beSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
231b12faf6Smrg#
241b12faf6Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
251b12faf6Smrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
261b12faf6Smrg#   Written by Gordon Matzigkeit, 1996
271b12faf6Smrg#
281b12faf6Smrg# This file is free software; the Free Software Foundation gives
291b12faf6Smrg# unlimited permission to copy and/or distribute it, with or without
301b12faf6Smrg# modifications, as long as this notice is preserved.
311b12faf6Smrg
321b12faf6Smrgm4_define([_LT_COPYING], [dnl
331b12faf6Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
341b12faf6Smrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
351b12faf6Smrg#   Written by Gordon Matzigkeit, 1996
361b12faf6Smrg#
371b12faf6Smrg#   This file is part of GNU Libtool.
381b12faf6Smrg#
391b12faf6Smrg# GNU Libtool is free software; you can redistribute it and/or
401b12faf6Smrg# modify it under the terms of the GNU General Public License as
411b12faf6Smrg# published by the Free Software Foundation; either version 2 of
421b12faf6Smrg# the License, or (at your option) any later version.
431b12faf6Smrg#
441b12faf6Smrg# As a special exception to the GNU General Public License,
451b12faf6Smrg# if you distribute this file as part of a program or library that
461b12faf6Smrg# is built using GNU Libtool, you may include this file under the
471b12faf6Smrg# same distribution terms that you use for the rest of that program.
481b12faf6Smrg#
491b12faf6Smrg# GNU Libtool is distributed in the hope that it will be useful,
501b12faf6Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
511b12faf6Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
521b12faf6Smrg# GNU General Public License for more details.
531b12faf6Smrg#
541b12faf6Smrg# You should have received a copy of the GNU General Public License
551b12faf6Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
561b12faf6Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
571b12faf6Smrg# obtained by writing to the Free Software Foundation, Inc.,
581b12faf6Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
591b12faf6Smrg])
6032b578d3Smrg
611b12faf6Smrg# serial 56 LT_INIT
6232b578d3Smrg
6332b578d3Smrg
641b12faf6Smrg# LT_PREREQ(VERSION)
651b12faf6Smrg# ------------------
661b12faf6Smrg# Complain and exit if this libtool version is less that VERSION.
671b12faf6Smrgm4_defun([LT_PREREQ],
681b12faf6Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
691b12faf6Smrg       [m4_default([$3],
701b12faf6Smrg		   [m4_fatal([Libtool version $1 or higher is required],
711b12faf6Smrg		             63)])],
721b12faf6Smrg       [$2])])
7332b578d3Smrg
7432b578d3Smrg
751b12faf6Smrg# _LT_CHECK_BUILDDIR
761b12faf6Smrg# ------------------
771b12faf6Smrg# Complain if the absolute build directory name contains unusual characters
781b12faf6Smrgm4_defun([_LT_CHECK_BUILDDIR],
791b12faf6Smrg[case `pwd` in
801b12faf6Smrg  *\ * | *\	*)
811b12faf6Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
821b12faf6Smrgesac
831b12faf6Smrg])
841b12faf6Smrg
851b12faf6Smrg
861b12faf6Smrg# LT_INIT([OPTIONS])
871b12faf6Smrg# ------------------
881b12faf6SmrgAC_DEFUN([LT_INIT],
891b12faf6Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
901b12faf6SmrgAC_BEFORE([$0], [LT_LANG])dnl
911b12faf6SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
921b12faf6SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
931b12faf6Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
941b12faf6Smrg
951b12faf6Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
961b12faf6Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
971b12faf6Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
981b12faf6Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
991b12faf6Smrgdnl unless we require an AC_DEFUNed macro:
1001b12faf6SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
1011b12faf6SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
1021b12faf6SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
1031b12faf6SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
1041b12faf6Smrgm4_require([_LT_PROG_LTMAIN])dnl
1051b12faf6Smrg
1061b12faf6Smrgdnl Parse OPTIONS
1071b12faf6Smrg_LT_SET_OPTIONS([$0], [$1])
10832b578d3Smrg
1092a51b5beSmrg# This can be used to rebuild libtool when needed
1101b12faf6SmrgLIBTOOL_DEPS="$ltmain"
11132b578d3Smrg
1122a51b5beSmrg# Always use our own libtool.
1132a51b5beSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
1142a51b5beSmrgAC_SUBST(LIBTOOL)dnl
11532b578d3Smrg
1161b12faf6Smrg_LT_SETUP
11732b578d3Smrg
1181b12faf6Smrg# Only expand once:
1191b12faf6Smrgm4_define([LT_INIT])
1201b12faf6Smrg])# LT_INIT
12132b578d3Smrg
1221b12faf6Smrg# Old names:
1231b12faf6SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1241b12faf6SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1251b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
1261b12faf6Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1271b12faf6Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1281b12faf6Smrg
1291b12faf6Smrg
1301b12faf6Smrg# _LT_CC_BASENAME(CC)
1311b12faf6Smrg# -------------------
1321b12faf6Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1331b12faf6Smrgm4_defun([_LT_CC_BASENAME],
1341b12faf6Smrg[for cc_temp in $1""; do
1351b12faf6Smrg  case $cc_temp in
1361b12faf6Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1371b12faf6Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1381b12faf6Smrg    \-*) ;;
1391b12faf6Smrg    *) break;;
1401b12faf6Smrg  esac
1411b12faf6Smrgdone
1421b12faf6Smrgcc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
1431b12faf6Smrg])
1441b12faf6Smrg
1451b12faf6Smrg
1461b12faf6Smrg# _LT_FILEUTILS_DEFAULTS
1471b12faf6Smrg# ----------------------
1481b12faf6Smrg# It is okay to use these file commands and assume they have been set
1491b12faf6Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
1501b12faf6Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
1511b12faf6Smrg[: ${CP="cp -f"}
1521b12faf6Smrg: ${MV="mv -f"}
1531b12faf6Smrg: ${RM="rm -f"}
1541b12faf6Smrg])# _LT_FILEUTILS_DEFAULTS
1551b12faf6Smrg
1561b12faf6Smrg
1571b12faf6Smrg# _LT_SETUP
1581b12faf6Smrg# ---------
1591b12faf6Smrgm4_defun([_LT_SETUP],
1601b12faf6Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1612a51b5beSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
1621b12faf6Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
1631b12faf6Smrg_LT_DECL([], [host], [0])dnl
1641b12faf6Smrg_LT_DECL([], [host_os], [0])dnl
1651b12faf6Smrgdnl
1661b12faf6Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
1671b12faf6Smrg_LT_DECL([], [build], [0])dnl
1681b12faf6Smrg_LT_DECL([], [build_os], [0])dnl
1691b12faf6Smrgdnl
1702a51b5beSmrgAC_REQUIRE([AC_PROG_CC])dnl
1711b12faf6SmrgAC_REQUIRE([LT_PATH_LD])dnl
1721b12faf6SmrgAC_REQUIRE([LT_PATH_NM])dnl
1731b12faf6Smrgdnl
1742a51b5beSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
1751b12faf6Smrgtest -z "$LN_S" && LN_S="ln -s"
1761b12faf6Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1772a51b5beSmrgdnl
1781b12faf6SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
1791b12faf6Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
1801b12faf6Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1811b12faf6Smrgdnl
1821b12faf6Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1831b12faf6Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
1841b12faf6Smrgm4_require([_LT_CMD_RELOAD])dnl
1851b12faf6Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
1861b12faf6Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
1871b12faf6Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
1881b12faf6Smrg
1891b12faf6Smrg_LT_CONFIG_LIBTOOL_INIT([
1901b12faf6Smrg# See if we are running on zsh, and set the options which allow our
1911b12faf6Smrg# commands through without removal of \ escapes INIT.
1921b12faf6Smrgif test -n "\${ZSH_VERSION+set}" ; then
1931b12faf6Smrg   setopt NO_GLOB_SUBST
1941b12faf6Smrgfi
1951b12faf6Smrg])
1961b12faf6Smrgif test -n "${ZSH_VERSION+set}" ; then
1971b12faf6Smrg   setopt NO_GLOB_SUBST
1981b12faf6Smrgfi
19932b578d3Smrg
2001b12faf6Smrg_LT_CHECK_OBJDIR
2011b12faf6Smrg
2021b12faf6Smrgm4_require([_LT_TAG_COMPILER])dnl
2031b12faf6Smrg_LT_PROG_ECHO_BACKSLASH
20432b578d3Smrg
2052a51b5beSmrgcase $host_os in
2062a51b5beSmrgaix3*)
2072a51b5beSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
2082a51b5beSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
2092a51b5beSmrg  # vanish in a puff of smoke.
2102a51b5beSmrg  if test "X${COLLECT_NAMES+set}" != Xset; then
2112a51b5beSmrg    COLLECT_NAMES=
2122a51b5beSmrg    export COLLECT_NAMES
2132a51b5beSmrg  fi
2142a51b5beSmrg  ;;
2152a51b5beSmrgesac
21632b578d3Smrg
2172a51b5beSmrg# Sed substitution that helps us do robust quoting.  It backslashifies
2182a51b5beSmrg# metacharacters that are still active within double-quoted strings.
2191b12faf6Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
22032b578d3Smrg
2212a51b5beSmrg# Same as above, but do not quote variable references.
2221b12faf6Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
22332b578d3Smrg
2242a51b5beSmrg# Sed substitution to delay expansion of an escaped shell variable in a
2252a51b5beSmrg# double_quote_subst'ed string.
2262a51b5beSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
22732b578d3Smrg
2281b12faf6Smrg# Sed substitution to delay expansion of an escaped single quote.
2291b12faf6Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
2301b12faf6Smrg
2312a51b5beSmrg# Sed substitution to avoid accidental globbing in evaled expressions
2322a51b5beSmrgno_glob_subst='s/\*/\\\*/g'
23332b578d3Smrg
2342a51b5beSmrg# Global variables:
2351b12faf6Smrgofile=libtool
2362a51b5beSmrgcan_build_shared=yes
23732b578d3Smrg
2382a51b5beSmrg# All known linkers require a `.a' archive for static linking (except MSVC,
2392a51b5beSmrg# which needs '.lib').
2402a51b5beSmrglibext=a
24132b578d3Smrg
2421b12faf6Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
24332b578d3Smrg
2442a51b5beSmrgold_CC="$CC"
2452a51b5beSmrgold_CFLAGS="$CFLAGS"
24632b578d3Smrg
2472a51b5beSmrg# Set sane defaults for various variables
2482a51b5beSmrgtest -z "$CC" && CC=cc
2492a51b5beSmrgtest -z "$LTCC" && LTCC=$CC
2502a51b5beSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
2512a51b5beSmrgtest -z "$LD" && LD=ld
2522a51b5beSmrgtest -z "$ac_objext" && ac_objext=o
25332b578d3Smrg
2542a51b5beSmrg_LT_CC_BASENAME([$compiler])
25532b578d3Smrg
2562a51b5beSmrg# Only perform the check for file, if the check method requires it
2571b12faf6Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
2582a51b5beSmrgcase $deplibs_check_method in
2592a51b5beSmrgfile_magic*)
2602a51b5beSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
2611b12faf6Smrg    _LT_PATH_MAGIC
2622a51b5beSmrg  fi
2632a51b5beSmrg  ;;
2642a51b5beSmrgesac
26532b578d3Smrg
2661b12faf6Smrg# Use C for the default configuration in the libtool script
2671b12faf6SmrgLT_SUPPORTED_TAG([CC])
2681b12faf6Smrg_LT_LANG_C_CONFIG
2691b12faf6Smrg_LT_LANG_DEFAULT_CONFIG
2701b12faf6Smrg_LT_CONFIG_COMMANDS
2711b12faf6Smrg])# _LT_SETUP
27232b578d3Smrg
27332b578d3Smrg
2741b12faf6Smrg# _LT_PROG_LTMAIN
2751b12faf6Smrg# ---------------
2761b12faf6Smrg# Note that this code is called both from `configure', and `config.status'
2771b12faf6Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
2781b12faf6Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
2791b12faf6Smrg# so we pass a copy along to make sure it has a sensible value anyway.
2801b12faf6Smrgm4_defun([_LT_PROG_LTMAIN],
2811b12faf6Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
2821b12faf6Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
2831b12faf6Smrgltmain="$ac_aux_dir/ltmain.sh"
2841b12faf6Smrg])# _LT_PROG_LTMAIN
28532b578d3Smrg
28632b578d3Smrg
2871b12faf6Smrg
2881b12faf6Smrg# So that we can recreate a full libtool script including additional
2891b12faf6Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
2901b12faf6Smrg# in macros and then make a single call at the end using the `libtool'
2911b12faf6Smrg# label.
2921b12faf6Smrg
2931b12faf6Smrg
2941b12faf6Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
2951b12faf6Smrg# ----------------------------------------
2961b12faf6Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
2971b12faf6Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
2981b12faf6Smrg[m4_ifval([$1],
2991b12faf6Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
3001b12faf6Smrg                     [$1
3011b12faf6Smrg])])])
3021b12faf6Smrg
3031b12faf6Smrg# Initialize.
3041b12faf6Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
3051b12faf6Smrg
3061b12faf6Smrg
3071b12faf6Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
3081b12faf6Smrg# ------------------------------
3091b12faf6Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3101b12faf6Smrgm4_define([_LT_CONFIG_LIBTOOL],
3111b12faf6Smrg[m4_ifval([$1],
3121b12faf6Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
3131b12faf6Smrg                     [$1
3141b12faf6Smrg])])])
3151b12faf6Smrg
3161b12faf6Smrg# Initialize.
3171b12faf6Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
3181b12faf6Smrg
3191b12faf6Smrg
3201b12faf6Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
3211b12faf6Smrg# -----------------------------------------------------
3221b12faf6Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
3231b12faf6Smrg[_LT_CONFIG_LIBTOOL([$1])
3241b12faf6Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
3251b12faf6Smrg])
3261b12faf6Smrg
3271b12faf6Smrg
3281b12faf6Smrg# _LT_FORMAT_COMMENT([COMMENT])
3291b12faf6Smrg# -----------------------------
3301b12faf6Smrg# Add leading comment marks to the start of each line, and a trailing
3311b12faf6Smrg# full-stop to the whole comment if one is not present already.
3321b12faf6Smrgm4_define([_LT_FORMAT_COMMENT],
3331b12faf6Smrg[m4_ifval([$1], [
3341b12faf6Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
3351b12faf6Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
3361b12faf6Smrg)])
3371b12faf6Smrg
3381b12faf6Smrg
3391b12faf6Smrg
3401b12faf6Smrg
3411b12faf6Smrg
3421b12faf6Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
3431b12faf6Smrg# -------------------------------------------------------------------
3441b12faf6Smrg# CONFIGNAME is the name given to the value in the libtool script.
3451b12faf6Smrg# VARNAME is the (base) name used in the configure script.
3461b12faf6Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
3471b12faf6Smrg# VARNAME.  Any other value will be used directly.
3481b12faf6Smrgm4_define([_LT_DECL],
3491b12faf6Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
3501b12faf6Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
3511b12faf6Smrg	[m4_ifval([$1], [$1], [$2])])
3521b12faf6Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
3531b12faf6Smrg    m4_ifval([$4],
3541b12faf6Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
3551b12faf6Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
3561b12faf6Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
3571b12faf6Smrg])
3581b12faf6Smrg
3591b12faf6Smrg
3601b12faf6Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
3611b12faf6Smrg# --------------------------------------------------------
3621b12faf6Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
3631b12faf6Smrg
3641b12faf6Smrg
3651b12faf6Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
3661b12faf6Smrg# ------------------------------------------------
3671b12faf6Smrgm4_define([lt_decl_tag_varnames],
3681b12faf6Smrg[_lt_decl_filter([tagged?], [yes], $@)])
3691b12faf6Smrg
3701b12faf6Smrg
3711b12faf6Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
3721b12faf6Smrg# ---------------------------------------------------------
3731b12faf6Smrgm4_define([_lt_decl_filter],
3741b12faf6Smrg[m4_case([$#],
3751b12faf6Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
3761b12faf6Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
3771b12faf6Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
3781b12faf6Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
3791b12faf6Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
3801b12faf6Smrg])
3811b12faf6Smrg
3821b12faf6Smrg
3831b12faf6Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
3841b12faf6Smrg# --------------------------------------------------
3851b12faf6Smrgm4_define([lt_decl_quote_varnames],
3861b12faf6Smrg[_lt_decl_filter([value], [1], $@)])
3871b12faf6Smrg
3881b12faf6Smrg
3891b12faf6Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
3901b12faf6Smrg# ---------------------------------------------------
3911b12faf6Smrgm4_define([lt_decl_dquote_varnames],
3921b12faf6Smrg[_lt_decl_filter([value], [2], $@)])
3931b12faf6Smrg
3941b12faf6Smrg
3951b12faf6Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
3961b12faf6Smrg# ---------------------------------------------------
3971b12faf6Smrgm4_define([lt_decl_varnames_tagged],
3981b12faf6Smrg[m4_assert([$# <= 2])dnl
3991b12faf6Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
4001b12faf6Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
4011b12faf6Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
4021b12faf6Smrgm4_define([_lt_decl_varnames_tagged],
4031b12faf6Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
4041b12faf6Smrg
4051b12faf6Smrg
4061b12faf6Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
4071b12faf6Smrg# ------------------------------------------------
4081b12faf6Smrgm4_define([lt_decl_all_varnames],
4091b12faf6Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
4101b12faf6Smrg     m4_if([$2], [],
4111b12faf6Smrg	   m4_quote(lt_decl_varnames),
4121b12faf6Smrg	m4_quote(m4_shift($@))))[]dnl
4131b12faf6Smrg])
4141b12faf6Smrgm4_define([_lt_decl_all_varnames],
4151b12faf6Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
4161b12faf6Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
4171b12faf6Smrg])
4181b12faf6Smrg
4191b12faf6Smrg
4201b12faf6Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
4211b12faf6Smrg# ------------------------------------
4221b12faf6Smrg# Quote a variable value, and forward it to `config.status' so that its
4231b12faf6Smrg# declaration there will have the same value as in `configure'.  VARNAME
4241b12faf6Smrg# must have a single quote delimited value for this to work.
4251b12faf6Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
4261b12faf6Smrg[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
4271b12faf6Smrg
4281b12faf6Smrg
4291b12faf6Smrg# _LT_CONFIG_STATUS_DECLARATIONS
4301b12faf6Smrg# ------------------------------
4311b12faf6Smrg# We delimit libtool config variables with single quotes, so when
4321b12faf6Smrg# we write them to config.status, we have to be sure to quote all
4331b12faf6Smrg# embedded single quotes properly.  In configure, this macro expands
4341b12faf6Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
4351b12faf6Smrg#
4361b12faf6Smrg#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
4371b12faf6Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
4381b12faf6Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
4391b12faf6Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
4401b12faf6Smrg
4411b12faf6Smrg
4421b12faf6Smrg# _LT_LIBTOOL_TAGS
4431b12faf6Smrg# ----------------
4441b12faf6Smrg# Output comment and list of tags supported by the script
4451b12faf6Smrgm4_defun([_LT_LIBTOOL_TAGS],
4461b12faf6Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
4471b12faf6Smrgavailable_tags="_LT_TAGS"dnl
4481b12faf6Smrg])
4491b12faf6Smrg
4501b12faf6Smrg
4511b12faf6Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
4521b12faf6Smrg# -----------------------------------
4531b12faf6Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
4541b12faf6Smrg# expand to a commented shell variable setting:
4551b12faf6Smrg#
4561b12faf6Smrg#    # Some comment about what VAR is for.
4571b12faf6Smrg#    visible_name=$lt_internal_name
4581b12faf6Smrgm4_define([_LT_LIBTOOL_DECLARE],
4591b12faf6Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
4601b12faf6Smrg					   [description])))[]dnl
4611b12faf6Smrgm4_pushdef([_libtool_name],
4621b12faf6Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
4631b12faf6Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
4641b12faf6Smrg    [0], [_libtool_name=[$]$1],
4651b12faf6Smrg    [1], [_libtool_name=$lt_[]$1],
4661b12faf6Smrg    [2], [_libtool_name=$lt_[]$1],
4671b12faf6Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
4681b12faf6Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
4691b12faf6Smrg])
4701b12faf6Smrg
4711b12faf6Smrg
4721b12faf6Smrg# _LT_LIBTOOL_CONFIG_VARS
4731b12faf6Smrg# -----------------------
4741b12faf6Smrg# Produce commented declarations of non-tagged libtool config variables
4751b12faf6Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
4761b12faf6Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
4771b12faf6Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
4781b12faf6Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
4791b12faf6Smrg[m4_foreach([_lt_var],
4801b12faf6Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
4811b12faf6Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
4821b12faf6Smrg
4831b12faf6Smrg
4841b12faf6Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
4851b12faf6Smrg# -------------------------
4861b12faf6Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
4871b12faf6Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
4881b12faf6Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
48932b578d3Smrg
49032b578d3Smrg
4911b12faf6Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
4921b12faf6Smrg# ------------------------------
4931b12faf6Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
4941b12faf6Smrg
4951b12faf6Smrg
4961b12faf6Smrg# _LT_CONFIG_COMMANDS
4972a51b5beSmrg# -------------------
4981b12faf6Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
4991b12faf6Smrg# variables for single and double quote escaping we saved from calls
5001b12faf6Smrg# to _LT_DECL, we can put quote escaped variables declarations
5011b12faf6Smrg# into `config.status', and then the shell code to quote escape them in
5021b12faf6Smrg# for loops in `config.status'.  Finally, any additional code accumulated
5031b12faf6Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
5041b12faf6Smrgm4_defun([_LT_CONFIG_COMMANDS],
5051b12faf6Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
5061b12faf6Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
5071b12faf6Smrg	dnl instead of duplicating it all over again into config.status,
5081b12faf6Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
5091b12faf6Smrg	dnl needs to know what name is stored there:
5101b12faf6Smrg        [AC_CONFIG_COMMANDS([libtool],
5111b12faf6Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
5121b12faf6Smrg    dnl If the libtool generation code is destined for config.status,
5131b12faf6Smrg    dnl expand the accumulated commands and init code now:
5141b12faf6Smrg    [AC_CONFIG_COMMANDS([libtool],
5151b12faf6Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
5161b12faf6Smrg])#_LT_CONFIG_COMMANDS
5171b12faf6Smrg
5181b12faf6Smrg
5191b12faf6Smrg# Initialize.
5201b12faf6Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
5211b12faf6Smrg[
5221b12faf6Smrg
5231b12faf6Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
5241b12faf6Smrg# if CDPATH is set.
5251b12faf6Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5261b12faf6Smrg
5271b12faf6Smrgsed_quote_subst='$sed_quote_subst'
5281b12faf6Smrgdouble_quote_subst='$double_quote_subst'
5291b12faf6Smrgdelay_variable_subst='$delay_variable_subst'
5301b12faf6Smrg_LT_CONFIG_STATUS_DECLARATIONS
5311b12faf6SmrgLTCC='$LTCC'
5321b12faf6SmrgLTCFLAGS='$LTCFLAGS'
5331b12faf6Smrgcompiler='$compiler_DEFAULT'
5341b12faf6Smrg
5351b12faf6Smrg# Quote evaled strings.
5361b12faf6Smrgfor var in lt_decl_all_varnames([[ \
5371b12faf6Smrg]], lt_decl_quote_varnames); do
5381b12faf6Smrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
5391b12faf6Smrg    *[[\\\\\\\`\\"\\\$]]*)
5401b12faf6Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
5411b12faf6Smrg      ;;
5421b12faf6Smrg    *)
5431b12faf6Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5441b12faf6Smrg      ;;
5451b12faf6Smrg    esac
5461b12faf6Smrgdone
5471b12faf6Smrg
5481b12faf6Smrg# Double-quote double-evaled strings.
5491b12faf6Smrgfor var in lt_decl_all_varnames([[ \
5501b12faf6Smrg]], lt_decl_dquote_varnames); do
5511b12faf6Smrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
5521b12faf6Smrg    *[[\\\\\\\`\\"\\\$]]*)
5531b12faf6Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
5541b12faf6Smrg      ;;
5551b12faf6Smrg    *)
5561b12faf6Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5571b12faf6Smrg      ;;
5581b12faf6Smrg    esac
5591b12faf6Smrgdone
5601b12faf6Smrg
5611b12faf6Smrg# Fix-up fallback echo if it was mangled by the above quoting rules.
5621b12faf6Smrgcase \$lt_ECHO in
5631b12faf6Smrg*'\\\[$]0 --fallback-echo"')dnl "
5641b12faf6Smrg  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
5651b12faf6Smrg  ;;
5661b12faf6Smrgesac
5671b12faf6Smrg
5681b12faf6Smrg_LT_OUTPUT_LIBTOOL_INIT
5691b12faf6Smrg])
5701b12faf6Smrg
5711b12faf6Smrg
5721b12faf6Smrg# LT_OUTPUT
5731b12faf6Smrg# ---------
5741b12faf6Smrg# This macro allows early generation of the libtool script (before
5751b12faf6Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
5761b12faf6Smrg# tests.
5771b12faf6SmrgAC_DEFUN([LT_OUTPUT],
5781b12faf6Smrg[: ${CONFIG_LT=./config.lt}
5791b12faf6SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
5801b12faf6Smrgcat >"$CONFIG_LT" <<_LTEOF
5811b12faf6Smrg#! $SHELL
5821b12faf6Smrg# Generated by $as_me.
5831b12faf6Smrg# Run this file to recreate a libtool stub with the current configuration.
5841b12faf6Smrg
5851b12faf6Smrglt_cl_silent=false
5861b12faf6SmrgSHELL=\${CONFIG_SHELL-$SHELL}
5871b12faf6Smrg_LTEOF
5881b12faf6Smrg
5891b12faf6Smrgcat >>"$CONFIG_LT" <<\_LTEOF
5901b12faf6SmrgAS_SHELL_SANITIZE
5911b12faf6Smrg_AS_PREPARE
5921b12faf6Smrg
5931b12faf6Smrgexec AS_MESSAGE_FD>&1
5941b12faf6Smrgexec AS_MESSAGE_LOG_FD>>config.log
5951b12faf6Smrg{
5961b12faf6Smrg  echo
5971b12faf6Smrg  AS_BOX([Running $as_me.])
5981b12faf6Smrg} >&AS_MESSAGE_LOG_FD
5991b12faf6Smrg
6001b12faf6Smrglt_cl_help="\
6011b12faf6Smrg\`$as_me' creates a local libtool stub from the current configuration,
6021b12faf6Smrgfor use in further configure time tests before the real libtool is
6031b12faf6Smrggenerated.
6041b12faf6Smrg
6051b12faf6SmrgUsage: $[0] [[OPTIONS]]
6061b12faf6Smrg
6071b12faf6Smrg  -h, --help      print this help, then exit
6081b12faf6Smrg  -V, --version   print version number, then exit
6091b12faf6Smrg  -q, --quiet     do not print progress messages
6101b12faf6Smrg  -d, --debug     don't remove temporary files
6111b12faf6Smrg
6121b12faf6SmrgReport bugs to <bug-libtool@gnu.org>."
6131b12faf6Smrg
6141b12faf6Smrglt_cl_version="\
6151b12faf6Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
6161b12faf6Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
6171b12faf6Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
6181b12faf6Smrg
6191b12faf6SmrgCopyright (C) 2008 Free Software Foundation, Inc.
6201b12faf6SmrgThis config.lt script is free software; the Free Software Foundation
6211b12faf6Smrggives unlimited permision to copy, distribute and modify it."
6221b12faf6Smrg
6231b12faf6Smrgwhile test $[#] != 0
6241b12faf6Smrgdo
6251b12faf6Smrg  case $[1] in
6261b12faf6Smrg    --version | --v* | -V )
6271b12faf6Smrg      echo "$lt_cl_version"; exit 0 ;;
6281b12faf6Smrg    --help | --h* | -h )
6291b12faf6Smrg      echo "$lt_cl_help"; exit 0 ;;
6301b12faf6Smrg    --debug | --d* | -d )
6311b12faf6Smrg      debug=: ;;
6321b12faf6Smrg    --quiet | --q* | --silent | --s* | -q )
6331b12faf6Smrg      lt_cl_silent=: ;;
6341b12faf6Smrg
6351b12faf6Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
6361b12faf6SmrgTry \`$[0] --help' for more information.]) ;;
6371b12faf6Smrg
6381b12faf6Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
6391b12faf6SmrgTry \`$[0] --help' for more information.]) ;;
6401b12faf6Smrg  esac
6411b12faf6Smrg  shift
6421b12faf6Smrgdone
6431b12faf6Smrg
6441b12faf6Smrgif $lt_cl_silent; then
6451b12faf6Smrg  exec AS_MESSAGE_FD>/dev/null
6461b12faf6Smrgfi
6471b12faf6Smrg_LTEOF
6481b12faf6Smrg
6491b12faf6Smrgcat >>"$CONFIG_LT" <<_LTEOF
6501b12faf6Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
6511b12faf6Smrg_LTEOF
6521b12faf6Smrg
6531b12faf6Smrgcat >>"$CONFIG_LT" <<\_LTEOF
6541b12faf6SmrgAC_MSG_NOTICE([creating $ofile])
6551b12faf6Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
6561b12faf6SmrgAS_EXIT(0)
6571b12faf6Smrg_LTEOF
6581b12faf6Smrgchmod +x "$CONFIG_LT"
6591b12faf6Smrg
6601b12faf6Smrg# configure is writing to config.log, but config.lt does its own redirection,
6611b12faf6Smrg# appending to config.log, which fails on DOS, as config.log is still kept
6621b12faf6Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
6631b12faf6Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
6641b12faf6Smrgif test "$no_create" != yes; then
6651b12faf6Smrg  lt_cl_success=:
6661b12faf6Smrg  test "$silent" = yes &&
6671b12faf6Smrg    lt_config_lt_args="$lt_config_lt_args --quiet"
6681b12faf6Smrg  exec AS_MESSAGE_LOG_FD>/dev/null
6691b12faf6Smrg  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
6701b12faf6Smrg  exec AS_MESSAGE_LOG_FD>>config.log
6711b12faf6Smrg  $lt_cl_success || AS_EXIT(1)
6721b12faf6Smrgfi
6731b12faf6Smrg])# LT_OUTPUT
6741b12faf6Smrg
6751b12faf6Smrg
6761b12faf6Smrg# _LT_CONFIG(TAG)
6771b12faf6Smrg# ---------------
6781b12faf6Smrg# If TAG is the built-in tag, create an initial libtool script with a
6791b12faf6Smrg# default configuration from the untagged config vars.  Otherwise add code
6801b12faf6Smrg# to config.status for appending the configuration named by TAG from the
6811b12faf6Smrg# matching tagged config vars.
6821b12faf6Smrgm4_defun([_LT_CONFIG],
6831b12faf6Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6841b12faf6Smrg_LT_CONFIG_SAVE_COMMANDS([
6851b12faf6Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
6861b12faf6Smrg  m4_if(_LT_TAG, [C], [
6871b12faf6Smrg    # See if we are running on zsh, and set the options which allow our
6881b12faf6Smrg    # commands through without removal of \ escapes.
6891b12faf6Smrg    if test -n "${ZSH_VERSION+set}" ; then
6901b12faf6Smrg      setopt NO_GLOB_SUBST
6911b12faf6Smrg    fi
6921b12faf6Smrg
6931b12faf6Smrg    cfgfile="${ofile}T"
6941b12faf6Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
6951b12faf6Smrg    $RM "$cfgfile"
6961b12faf6Smrg
6971b12faf6Smrg    cat <<_LT_EOF >> "$cfgfile"
6981b12faf6Smrg#! $SHELL
6991b12faf6Smrg
7001b12faf6Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
7011b12faf6Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
7021b12faf6Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7031b12faf6Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
7041b12faf6Smrg#
7051b12faf6Smrg_LT_COPYING
7061b12faf6Smrg_LT_LIBTOOL_TAGS
7071b12faf6Smrg
7081b12faf6Smrg# ### BEGIN LIBTOOL CONFIG
7091b12faf6Smrg_LT_LIBTOOL_CONFIG_VARS
7101b12faf6Smrg_LT_LIBTOOL_TAG_VARS
7111b12faf6Smrg# ### END LIBTOOL CONFIG
7121b12faf6Smrg
7131b12faf6Smrg_LT_EOF
7141b12faf6Smrg
7151b12faf6Smrg  case $host_os in
7161b12faf6Smrg  aix3*)
7171b12faf6Smrg    cat <<\_LT_EOF >> "$cfgfile"
7181b12faf6Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
7191b12faf6Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
7201b12faf6Smrg# vanish in a puff of smoke.
7211b12faf6Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
7221b12faf6Smrg  COLLECT_NAMES=
7231b12faf6Smrg  export COLLECT_NAMES
7241b12faf6Smrgfi
7251b12faf6Smrg_LT_EOF
7261b12faf6Smrg    ;;
7271b12faf6Smrg  esac
7281b12faf6Smrg
7291b12faf6Smrg  _LT_PROG_LTMAIN
7301b12faf6Smrg
7311b12faf6Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
7321b12faf6Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
7331b12faf6Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
7341b12faf6Smrg  # is reportedly fixed, but why not run on old versions too?
7351b12faf6Smrg  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
7361b12faf6Smrg    || (rm -f "$cfgfile"; exit 1)
7371b12faf6Smrg
7381b12faf6Smrg  _LT_PROG_XSI_SHELLFNS
7391b12faf6Smrg
7401b12faf6Smrg  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
7411b12faf6Smrg    || (rm -f "$cfgfile"; exit 1)
7421b12faf6Smrg
7431b12faf6Smrg  mv -f "$cfgfile" "$ofile" ||
7441b12faf6Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
7451b12faf6Smrg  chmod +x "$ofile"
7461b12faf6Smrg],
7471b12faf6Smrg[cat <<_LT_EOF >> "$ofile"
7481b12faf6Smrg
7491b12faf6Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
7501b12faf6Smrgdnl in a comment (ie after a #).
7511b12faf6Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
7521b12faf6Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
7531b12faf6Smrg# ### END LIBTOOL TAG CONFIG: $1
7541b12faf6Smrg_LT_EOF
7551b12faf6Smrg])dnl /m4_if
7561b12faf6Smrg],
7571b12faf6Smrg[m4_if([$1], [], [
7581b12faf6Smrg    PACKAGE='$PACKAGE'
7591b12faf6Smrg    VERSION='$VERSION'
7601b12faf6Smrg    TIMESTAMP='$TIMESTAMP'
7611b12faf6Smrg    RM='$RM'
7621b12faf6Smrg    ofile='$ofile'], [])
7631b12faf6Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
7641b12faf6Smrg])# _LT_CONFIG
7651b12faf6Smrg
7661b12faf6Smrg
7671b12faf6Smrg# LT_SUPPORTED_TAG(TAG)
7681b12faf6Smrg# ---------------------
7691b12faf6Smrg# Trace this macro to discover what tags are supported by the libtool
7701b12faf6Smrg# --tag option, using:
7711b12faf6Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
7721b12faf6SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
7731b12faf6Smrg
7741b12faf6Smrg
7751b12faf6Smrg# C support is built-in for now
7761b12faf6Smrgm4_define([_LT_LANG_C_enabled], [])
7771b12faf6Smrgm4_define([_LT_TAGS], [])
7781b12faf6Smrg
7791b12faf6Smrg
7801b12faf6Smrg# LT_LANG(LANG)
7811b12faf6Smrg# -------------
7821b12faf6Smrg# Enable libtool support for the given language if not already enabled.
7831b12faf6SmrgAC_DEFUN([LT_LANG],
7841b12faf6Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
7851b12faf6Smrgm4_case([$1],
7861b12faf6Smrg  [C],			[_LT_LANG(C)],
7871b12faf6Smrg  [C++],		[_LT_LANG(CXX)],
7881b12faf6Smrg  [Java],		[_LT_LANG(GCJ)],
7891b12faf6Smrg  [Fortran 77],		[_LT_LANG(F77)],
7901b12faf6Smrg  [Fortran],		[_LT_LANG(FC)],
7911b12faf6Smrg  [Windows Resource],	[_LT_LANG(RC)],
7921b12faf6Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
7931b12faf6Smrg    [_LT_LANG($1)],
7941b12faf6Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
7951b12faf6Smrg])# LT_LANG
7961b12faf6Smrg
7971b12faf6Smrg
7981b12faf6Smrg# _LT_LANG(LANGNAME)
7991b12faf6Smrg# ------------------
8001b12faf6Smrgm4_defun([_LT_LANG],
8011b12faf6Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
8021b12faf6Smrg  [LT_SUPPORTED_TAG([$1])dnl
8031b12faf6Smrg  m4_append([_LT_TAGS], [$1 ])dnl
8041b12faf6Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
8051b12faf6Smrg  _LT_LANG_$1_CONFIG($1)])dnl
8061b12faf6Smrg])# _LT_LANG
8071b12faf6Smrg
8081b12faf6Smrg
8091b12faf6Smrg# _LT_LANG_DEFAULT_CONFIG
8101b12faf6Smrg# -----------------------
8111b12faf6Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
8121b12faf6Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
8131b12faf6Smrg  [LT_LANG(CXX)],
8141b12faf6Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
8151b12faf6Smrg
8161b12faf6SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
8171b12faf6Smrg  [LT_LANG(F77)],
8181b12faf6Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
8191b12faf6Smrg
8201b12faf6SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
8211b12faf6Smrg  [LT_LANG(FC)],
8221b12faf6Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
8231b12faf6Smrg
8241b12faf6Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
8251b12faf6Smrgdnl pulling things in needlessly.
8261b12faf6SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
8271b12faf6Smrg  [LT_LANG(GCJ)],
8281b12faf6Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
8291b12faf6Smrg    [LT_LANG(GCJ)],
8301b12faf6Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
8311b12faf6Smrg      [LT_LANG(GCJ)],
8321b12faf6Smrg      [m4_ifdef([AC_PROG_GCJ],
8331b12faf6Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
8341b12faf6Smrg       m4_ifdef([A][M_PROG_GCJ],
8351b12faf6Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
8361b12faf6Smrg       m4_ifdef([LT_PROG_GCJ],
8371b12faf6Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
8381b12faf6Smrg
8391b12faf6SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
8401b12faf6Smrg  [LT_LANG(RC)],
8411b12faf6Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
8421b12faf6Smrg])# _LT_LANG_DEFAULT_CONFIG
8431b12faf6Smrg
8441b12faf6Smrg# Obsolete macros:
8451b12faf6SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
8461b12faf6SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
8471b12faf6SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
8481b12faf6SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
8491b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
8501b12faf6Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
8511b12faf6Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
8521b12faf6Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
8531b12faf6Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
8541b12faf6Smrg
8551b12faf6Smrg
8561b12faf6Smrg# _LT_TAG_COMPILER
8571b12faf6Smrg# ----------------
8581b12faf6Smrgm4_defun([_LT_TAG_COMPILER],
8592a51b5beSmrg[AC_REQUIRE([AC_PROG_CC])dnl
86032b578d3Smrg
8611b12faf6Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
8621b12faf6Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
8631b12faf6Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
8641b12faf6Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
8651b12faf6Smrg
8662a51b5beSmrg# If no C compiler was specified, use CC.
8672a51b5beSmrgLTCC=${LTCC-"$CC"}
86832b578d3Smrg
8692a51b5beSmrg# If no C compiler flags were specified, use CFLAGS.
8702a51b5beSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
87132b578d3Smrg
8722a51b5beSmrg# Allow CC to be a program name with arguments.
8732a51b5beSmrgcompiler=$CC
8741b12faf6Smrg])# _LT_TAG_COMPILER
87532b578d3Smrg
87632b578d3Smrg
8772a51b5beSmrg# _LT_COMPILER_BOILERPLATE
8782a51b5beSmrg# ------------------------
8792a51b5beSmrg# Check for compiler boilerplate output or warnings with
8802a51b5beSmrg# the simple compiler test code.
8811b12faf6Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
8821b12faf6Smrg[m4_require([_LT_DECL_SED])dnl
8832a51b5beSmrgac_outfile=conftest.$ac_objext
8842a51b5beSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
8852a51b5beSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
8862a51b5beSmrg_lt_compiler_boilerplate=`cat conftest.err`
8871b12faf6Smrg$RM conftest*
8882a51b5beSmrg])# _LT_COMPILER_BOILERPLATE
88932b578d3Smrg
89032b578d3Smrg
8912a51b5beSmrg# _LT_LINKER_BOILERPLATE
8922a51b5beSmrg# ----------------------
8932a51b5beSmrg# Check for linker boilerplate output or warnings with
8942a51b5beSmrg# the simple link test code.
8951b12faf6Smrgm4_defun([_LT_LINKER_BOILERPLATE],
8961b12faf6Smrg[m4_require([_LT_DECL_SED])dnl
8972a51b5beSmrgac_outfile=conftest.$ac_objext
8982a51b5beSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
8992a51b5beSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
9002a51b5beSmrg_lt_linker_boilerplate=`cat conftest.err`
9011b12faf6Smrg$RM -r conftest*
9022a51b5beSmrg])# _LT_LINKER_BOILERPLATE
90332b578d3Smrg
9042a51b5beSmrg# _LT_REQUIRED_DARWIN_CHECKS
9051b12faf6Smrg# -------------------------
9061b12faf6Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
9072a51b5beSmrg  case $host_os in
9082a51b5beSmrg    rhapsody* | darwin*)
9092a51b5beSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
9102a51b5beSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
9111b12faf6Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
9121b12faf6Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
9131b12faf6Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
9141b12faf6Smrg    _LT_DECL([], [DSYMUTIL], [1],
9151b12faf6Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
9161b12faf6Smrg    _LT_DECL([], [NMEDIT], [1],
9171b12faf6Smrg      [Tool to change global to local symbols on Mac OS X])
9181b12faf6Smrg    _LT_DECL([], [LIPO], [1],
9191b12faf6Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
9201b12faf6Smrg    _LT_DECL([], [OTOOL], [1],
9211b12faf6Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
9221b12faf6Smrg    _LT_DECL([], [OTOOL64], [1],
9231b12faf6Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
9242a51b5beSmrg
9252a51b5beSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
9262a51b5beSmrg      [lt_cv_apple_cc_single_mod=no
9272a51b5beSmrg      if test -z "${LT_MULTI_MODULE}"; then
9281b12faf6Smrg	# By default we will add the -single_module flag. You can override
9291b12faf6Smrg	# by either setting the environment variable LT_MULTI_MODULE
9301b12faf6Smrg	# non-empty at configure time, or by adding -multi_module to the
9311b12faf6Smrg	# link flags.
9321b12faf6Smrg	rm -rf libconftest.dylib*
9331b12faf6Smrg	echo "int foo(void){return 1;}" > conftest.c
9341b12faf6Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
9351b12faf6Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
9361b12faf6Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
9371b12faf6Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
9381b12faf6Smrg        _lt_result=$?
9391b12faf6Smrg	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
9401b12faf6Smrg	  lt_cv_apple_cc_single_mod=yes
9411b12faf6Smrg	else
9421b12faf6Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
9431b12faf6Smrg	fi
9441b12faf6Smrg	rm -rf libconftest.dylib*
9451b12faf6Smrg	rm -f conftest.*
9462a51b5beSmrg      fi])
9472a51b5beSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
9482a51b5beSmrg      [lt_cv_ld_exported_symbols_list],
9492a51b5beSmrg      [lt_cv_ld_exported_symbols_list=no
9502a51b5beSmrg      save_LDFLAGS=$LDFLAGS
9512a51b5beSmrg      echo "_main" > conftest.sym
9522a51b5beSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
9532a51b5beSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
9541b12faf6Smrg	[lt_cv_ld_exported_symbols_list=yes],
9551b12faf6Smrg	[lt_cv_ld_exported_symbols_list=no])
9561b12faf6Smrg	LDFLAGS="$save_LDFLAGS"
9572a51b5beSmrg    ])
9582a51b5beSmrg    case $host_os in
9591b12faf6Smrg    rhapsody* | darwin1.[[012]])
9602a51b5beSmrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
9612a51b5beSmrg    darwin1.*)
9621b12faf6Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
9631b12faf6Smrg    darwin*) # darwin 5.x on
9642a51b5beSmrg      # if running on 10.5 or later, the deployment target defaults
9652a51b5beSmrg      # to the OS version, if on x86, and 10.4, the deployment
9662a51b5beSmrg      # target defaults to 10.4. Don't you love it?
9672a51b5beSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
9681b12faf6Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
9691b12faf6Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
9701b12faf6Smrg	10.[[012]]*)
9711b12faf6Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
9721b12faf6Smrg	10.*)
9731b12faf6Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
9742a51b5beSmrg      esac
9752a51b5beSmrg    ;;
9762a51b5beSmrg  esac
9772a51b5beSmrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
9782a51b5beSmrg      _lt_dar_single_mod='$single_module'
979d31dbc53Smrg    fi
9802a51b5beSmrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
9812a51b5beSmrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
9822a51b5beSmrg    else
9831b12faf6Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
9842a51b5beSmrg    fi
9852a51b5beSmrg    if test "$DSYMUTIL" != ":"; then
9861b12faf6Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
9872a51b5beSmrg    else
9882a51b5beSmrg      _lt_dsymutil=
9892a51b5beSmrg    fi
9902a51b5beSmrg    ;;
9912a51b5beSmrg  esac
992d31dbc53Smrg])
99332b578d3Smrg
9941b12faf6Smrg
9951b12faf6Smrg# _LT_DARWIN_LINKER_FEATURES
9961b12faf6Smrg# --------------------------
9971b12faf6Smrg# Checks for linker and compiler features on darwin
9981b12faf6Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
9991b12faf6Smrg[
10001b12faf6Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
10011b12faf6Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10021b12faf6Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
10031b12faf6Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
10041b12faf6Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
10051b12faf6Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
10061b12faf6Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
10071b12faf6Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
10081b12faf6Smrg  case $cc_basename in
10091b12faf6Smrg     ifort*) _lt_dar_can_shared=yes ;;
10101b12faf6Smrg     *) _lt_dar_can_shared=$GCC ;;
10111b12faf6Smrg  esac
10121b12faf6Smrg  if test "$_lt_dar_can_shared" = "yes"; then
10131b12faf6Smrg    output_verbose_link_cmd=echo
10141b12faf6Smrg    _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}"
10151b12faf6Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
10161b12faf6Smrg    _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}"
10171b12faf6Smrg    _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}"
10181b12faf6Smrg    m4_if([$1], [CXX],
10191b12faf6Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
10201b12faf6Smrg      _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}"
10211b12faf6Smrg      _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}"
10221b12faf6Smrg    fi
10231b12faf6Smrg],[])
10241b12faf6Smrg  else
10251b12faf6Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
10261b12faf6Smrg  fi
10271b12faf6Smrg])
10281b12faf6Smrg
10291b12faf6Smrg# _LT_SYS_MODULE_PATH_AIX
10301b12faf6Smrg# -----------------------
10312a51b5beSmrg# Links a minimal program and checks the executable
10322a51b5beSmrg# for the system default hardcoded library path. In most cases,
10332a51b5beSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
10342a51b5beSmrg# the location of the communication and MPI libs are included too.
10352a51b5beSmrg# If we don't find anything, use the default library path according
10362a51b5beSmrg# to the aix ld manual.
10371b12faf6Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
10381b12faf6Smrg[m4_require([_LT_DECL_SED])dnl
10392a51b5beSmrgAC_LINK_IFELSE(AC_LANG_PROGRAM,[
10402a51b5beSmrglt_aix_libpath_sed='
10412a51b5beSmrg    /Import File Strings/,/^$/ {
10422a51b5beSmrg	/^0/ {
10432a51b5beSmrg	    s/^0  *\(.*\)$/\1/
10442a51b5beSmrg	    p
10452a51b5beSmrg	}
10462a51b5beSmrg    }'
10472a51b5beSmrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
10482a51b5beSmrg# Check for a 64-bit object if we didn't find anything.
10492a51b5beSmrgif test -z "$aix_libpath"; then
10502a51b5beSmrg  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
10512a51b5beSmrgfi],[])
10522a51b5beSmrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
10531b12faf6Smrg])# _LT_SYS_MODULE_PATH_AIX
105432b578d3Smrg
105532b578d3Smrg
10561b12faf6Smrg# _LT_SHELL_INIT(ARG)
10571b12faf6Smrg# -------------------
10581b12faf6Smrgm4_define([_LT_SHELL_INIT],
10592a51b5beSmrg[ifdef([AC_DIVERSION_NOTICE],
10602a51b5beSmrg	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
10612a51b5beSmrg	 [AC_DIVERT_PUSH(NOTICE)])
10622a51b5beSmrg$1
10632a51b5beSmrgAC_DIVERT_POP
10641b12faf6Smrg])# _LT_SHELL_INIT
106532b578d3Smrg
106632b578d3Smrg
10671b12faf6Smrg# _LT_PROG_ECHO_BACKSLASH
10681b12faf6Smrg# -----------------------
10692a51b5beSmrg# Add some code to the start of the generated configure script which
10702a51b5beSmrg# will find an echo command which doesn't interpret backslashes.
10711b12faf6Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
10721b12faf6Smrg[_LT_SHELL_INIT([
10732a51b5beSmrg# Check that we are running under the correct shell.
10742a51b5beSmrgSHELL=${CONFIG_SHELL-/bin/sh}
1075d31dbc53Smrg
10761b12faf6Smrgcase X$lt_ECHO in
10772a51b5beSmrgX*--fallback-echo)
10782a51b5beSmrg  # Remove one level of quotation (which was required for Make).
10791b12faf6Smrg  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
10802a51b5beSmrg  ;;
10812a51b5beSmrgesac
1082d31dbc53Smrg
10831b12faf6SmrgECHO=${lt_ECHO-echo}
10842a51b5beSmrgif test "X[$]1" = X--no-reexec; then
10852a51b5beSmrg  # Discard the --no-reexec flag, and continue.
10862a51b5beSmrg  shift
10872a51b5beSmrgelif test "X[$]1" = X--fallback-echo; then
10882a51b5beSmrg  # Avoid inline document here, it may be left over
10892a51b5beSmrg  :
10901b12faf6Smrgelif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
10911b12faf6Smrg  # Yippee, $ECHO works!
10922a51b5beSmrg  :
10932a51b5beSmrgelse
10942a51b5beSmrg  # Restart under the correct shell.
10952a51b5beSmrg  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
10962a51b5beSmrgfi
109732b578d3Smrg
10982a51b5beSmrgif test "X[$]1" = X--fallback-echo; then
10992a51b5beSmrg  # used as fallback echo
11002a51b5beSmrg  shift
11011b12faf6Smrg  cat <<_LT_EOF
11022a51b5beSmrg[$]*
11031b12faf6Smrg_LT_EOF
11042a51b5beSmrg  exit 0
11052a51b5beSmrgfi
110632b578d3Smrg
11072a51b5beSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
11082a51b5beSmrg# if CDPATH is set.
11092a51b5beSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
111032b578d3Smrg
11111b12faf6Smrgif test -z "$lt_ECHO"; then
11121b12faf6Smrg  if test "X${echo_test_string+set}" != Xset; then
11131b12faf6Smrg    # find a string as large as possible, as long as the shell can cope with it
11141b12faf6Smrg    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
11151b12faf6Smrg      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
11161b12faf6Smrg      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
11171b12faf6Smrg	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
11181b12faf6Smrg      then
11191b12faf6Smrg        break
11201b12faf6Smrg      fi
11211b12faf6Smrg    done
11221b12faf6Smrg  fi
112332b578d3Smrg
11241b12faf6Smrg  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
11251b12faf6Smrg     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
11261b12faf6Smrg     test "X$echo_testing_string" = "X$echo_test_string"; then
11271b12faf6Smrg    :
11281b12faf6Smrg  else
11291b12faf6Smrg    # The Solaris, AIX, and Digital Unix default echo programs unquote
11301b12faf6Smrg    # backslashes.  This makes it impossible to quote backslashes using
11311b12faf6Smrg    #   echo "$something" | sed 's/\\/\\\\/g'
11321b12faf6Smrg    #
11331b12faf6Smrg    # So, first we look for a working echo in the user's PATH.
113432b578d3Smrg
11351b12faf6Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
11361b12faf6Smrg    for dir in $PATH /usr/ucb; do
11371b12faf6Smrg      IFS="$lt_save_ifs"
11381b12faf6Smrg      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
11391b12faf6Smrg         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
11401b12faf6Smrg         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
11411b12faf6Smrg         test "X$echo_testing_string" = "X$echo_test_string"; then
11421b12faf6Smrg        ECHO="$dir/echo"
11431b12faf6Smrg        break
11441b12faf6Smrg      fi
11451b12faf6Smrg    done
11462a51b5beSmrg    IFS="$lt_save_ifs"
114732b578d3Smrg
11481b12faf6Smrg    if test "X$ECHO" = Xecho; then
11491b12faf6Smrg      # We didn't find a better echo, so look for alternatives.
11501b12faf6Smrg      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
11511b12faf6Smrg         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
11521b12faf6Smrg         test "X$echo_testing_string" = "X$echo_test_string"; then
11531b12faf6Smrg        # This shell has a builtin print -r that does the trick.
11541b12faf6Smrg        ECHO='print -r'
11551b12faf6Smrg      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
11561b12faf6Smrg	   test "X$CONFIG_SHELL" != X/bin/ksh; then
11571b12faf6Smrg        # If we have ksh, try running configure again with it.
11581b12faf6Smrg        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
11591b12faf6Smrg        export ORIGINAL_CONFIG_SHELL
11601b12faf6Smrg        CONFIG_SHELL=/bin/ksh
11611b12faf6Smrg        export CONFIG_SHELL
11621b12faf6Smrg        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
11632a51b5beSmrg      else
11641b12faf6Smrg        # Try using printf.
11651b12faf6Smrg        ECHO='printf %s\n'
11661b12faf6Smrg        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
11671b12faf6Smrg	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
11681b12faf6Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
11691b12faf6Smrg	  # Cool, printf works
11701b12faf6Smrg	  :
11711b12faf6Smrg        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
11721b12faf6Smrg	     test "X$echo_testing_string" = 'X\t' &&
11731b12faf6Smrg	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
11741b12faf6Smrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
11751b12faf6Smrg	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
11761b12faf6Smrg	  export CONFIG_SHELL
11771b12faf6Smrg	  SHELL="$CONFIG_SHELL"
11781b12faf6Smrg	  export SHELL
11791b12faf6Smrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
11801b12faf6Smrg        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
11811b12faf6Smrg	     test "X$echo_testing_string" = 'X\t' &&
11821b12faf6Smrg	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
11831b12faf6Smrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
11841b12faf6Smrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
11851b12faf6Smrg        else
11861b12faf6Smrg	  # maybe with a smaller string...
11871b12faf6Smrg	  prev=:
118832b578d3Smrg
11891b12faf6Smrg	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
11901b12faf6Smrg	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
11911b12faf6Smrg	    then
11921b12faf6Smrg	      break
11931b12faf6Smrg	    fi
11941b12faf6Smrg	    prev="$cmd"
11951b12faf6Smrg	  done
119632b578d3Smrg
11971b12faf6Smrg	  if test "$prev" != 'sed 50q "[$]0"'; then
11981b12faf6Smrg	    echo_test_string=`eval $prev`
11991b12faf6Smrg	    export echo_test_string
12001b12faf6Smrg	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
12011b12faf6Smrg	  else
12021b12faf6Smrg	    # Oops.  We lost completely, so just stick with echo.
12031b12faf6Smrg	    ECHO=echo
12041b12faf6Smrg	  fi
12051b12faf6Smrg        fi
12062a51b5beSmrg      fi
12072a51b5beSmrg    fi
12082a51b5beSmrg  fi
12092a51b5beSmrgfi
121032b578d3Smrg
12112a51b5beSmrg# Copy echo and quote the copy suitably for passing to libtool from
12122a51b5beSmrg# the Makefile, instead of quoting the original, which is used later.
12131b12faf6Smrglt_ECHO=$ECHO
12141b12faf6Smrgif test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
12151b12faf6Smrg   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
12162a51b5beSmrgfi
121732b578d3Smrg
12181b12faf6SmrgAC_SUBST(lt_ECHO)
12191b12faf6Smrg])
12201b12faf6Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
12211b12faf6Smrg_LT_DECL([], [ECHO], [1],
12221b12faf6Smrg    [An echo program that does not interpret backslashes])
12231b12faf6Smrg])# _LT_PROG_ECHO_BACKSLASH
122432b578d3Smrg
122532b578d3Smrg
12261b12faf6Smrg# _LT_ENABLE_LOCK
12271b12faf6Smrg# ---------------
12281b12faf6Smrgm4_defun([_LT_ENABLE_LOCK],
12292a51b5beSmrg[AC_ARG_ENABLE([libtool-lock],
12301b12faf6Smrg  [AS_HELP_STRING([--disable-libtool-lock],
12311b12faf6Smrg    [avoid locking (might break parallel builds)])])
12322a51b5beSmrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1233d31dbc53Smrg
12342a51b5beSmrg# Some flags need to be propagated to the compiler or linker for good
12352a51b5beSmrg# libtool support.
12362a51b5beSmrgcase $host in
12372a51b5beSmrgia64-*-hpux*)
12382a51b5beSmrg  # Find out which ABI we are using.
12392a51b5beSmrg  echo 'int i;' > conftest.$ac_ext
12402a51b5beSmrg  if AC_TRY_EVAL(ac_compile); then
12412a51b5beSmrg    case `/usr/bin/file conftest.$ac_objext` in
12421b12faf6Smrg      *ELF-32*)
12431b12faf6Smrg	HPUX_IA64_MODE="32"
12441b12faf6Smrg	;;
12451b12faf6Smrg      *ELF-64*)
12461b12faf6Smrg	HPUX_IA64_MODE="64"
12471b12faf6Smrg	;;
1248d31dbc53Smrg    esac
12492a51b5beSmrg  fi
12502a51b5beSmrg  rm -rf conftest*
12512a51b5beSmrg  ;;
12522a51b5beSmrg*-*-irix6*)
12532a51b5beSmrg  # Find out which ABI we are using.
12542a51b5beSmrg  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
12552a51b5beSmrg  if AC_TRY_EVAL(ac_compile); then
12561b12faf6Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
12571b12faf6Smrg      case `/usr/bin/file conftest.$ac_objext` in
12581b12faf6Smrg	*32-bit*)
12591b12faf6Smrg	  LD="${LD-ld} -melf32bsmip"
12601b12faf6Smrg	  ;;
12611b12faf6Smrg	*N32*)
12621b12faf6Smrg	  LD="${LD-ld} -melf32bmipn32"
12631b12faf6Smrg	  ;;
12641b12faf6Smrg	*64-bit*)
12651b12faf6Smrg	  LD="${LD-ld} -melf64bmip"
12661b12faf6Smrg	;;
12671b12faf6Smrg      esac
12681b12faf6Smrg    else
12691b12faf6Smrg      case `/usr/bin/file conftest.$ac_objext` in
12701b12faf6Smrg	*32-bit*)
12711b12faf6Smrg	  LD="${LD-ld} -32"
12721b12faf6Smrg	  ;;
12731b12faf6Smrg	*N32*)
12741b12faf6Smrg	  LD="${LD-ld} -n32"
12751b12faf6Smrg	  ;;
12761b12faf6Smrg	*64-bit*)
12771b12faf6Smrg	  LD="${LD-ld} -64"
12781b12faf6Smrg	  ;;
12791b12faf6Smrg      esac
12801b12faf6Smrg    fi
12812a51b5beSmrg  fi
12822a51b5beSmrg  rm -rf conftest*
12832a51b5beSmrg  ;;
128432b578d3Smrg
12852a51b5beSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
12861b12faf6Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
12872a51b5beSmrg  # Find out which ABI we are using.
12882a51b5beSmrg  echo 'int i;' > conftest.$ac_ext
12892a51b5beSmrg  if AC_TRY_EVAL(ac_compile); then
12902a51b5beSmrg    case `/usr/bin/file conftest.o` in
12911b12faf6Smrg      *32-bit*)
12921b12faf6Smrg	case $host in
12931b12faf6Smrg	  x86_64-*kfreebsd*-gnu)
12941b12faf6Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
12951b12faf6Smrg	    ;;
12961b12faf6Smrg	  x86_64-*linux*)
12971b12faf6Smrg	    LD="${LD-ld} -m elf_i386"
12981b12faf6Smrg	    ;;
12991b12faf6Smrg	  ppc64-*linux*|powerpc64-*linux*)
13001b12faf6Smrg	    LD="${LD-ld} -m elf32ppclinux"
13011b12faf6Smrg	    ;;
13021b12faf6Smrg	  s390x-*linux*)
13031b12faf6Smrg	    LD="${LD-ld} -m elf_s390"
13041b12faf6Smrg	    ;;
13051b12faf6Smrg	  sparc64-*linux*)
13061b12faf6Smrg	    LD="${LD-ld} -m elf32_sparc"
13071b12faf6Smrg	    ;;
13081b12faf6Smrg	esac
13091b12faf6Smrg	;;
13101b12faf6Smrg      *64-bit*)
13111b12faf6Smrg	case $host in
13121b12faf6Smrg	  x86_64-*kfreebsd*-gnu)
13131b12faf6Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
13141b12faf6Smrg	    ;;
13151b12faf6Smrg	  x86_64-*linux*)
13161b12faf6Smrg	    LD="${LD-ld} -m elf_x86_64"
13171b12faf6Smrg	    ;;
13181b12faf6Smrg	  ppc*-*linux*|powerpc*-*linux*)
13191b12faf6Smrg	    LD="${LD-ld} -m elf64ppc"
13201b12faf6Smrg	    ;;
13211b12faf6Smrg	  s390*-*linux*|s390*-*tpf*)
13221b12faf6Smrg	    LD="${LD-ld} -m elf64_s390"
13231b12faf6Smrg	    ;;
13241b12faf6Smrg	  sparc*-*linux*)
13251b12faf6Smrg	    LD="${LD-ld} -m elf64_sparc"
13261b12faf6Smrg	    ;;
13271b12faf6Smrg	esac
13281b12faf6Smrg	;;
13292a51b5beSmrg    esac
13302a51b5beSmrg  fi
13312a51b5beSmrg  rm -rf conftest*
13322a51b5beSmrg  ;;
133332b578d3Smrg
13342a51b5beSmrg*-*-sco3.2v5*)
13352a51b5beSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
13362a51b5beSmrg  SAVE_CFLAGS="$CFLAGS"
13372a51b5beSmrg  CFLAGS="$CFLAGS -belf"
13382a51b5beSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
13392a51b5beSmrg    [AC_LANG_PUSH(C)
13401b12faf6Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
13412a51b5beSmrg     AC_LANG_POP])
13422a51b5beSmrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
13432a51b5beSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
13442a51b5beSmrg    CFLAGS="$SAVE_CFLAGS"
13452a51b5beSmrg  fi
13462a51b5beSmrg  ;;
13472a51b5beSmrgsparc*-*solaris*)
13482a51b5beSmrg  # Find out which ABI we are using.
13492a51b5beSmrg  echo 'int i;' > conftest.$ac_ext
13502a51b5beSmrg  if AC_TRY_EVAL(ac_compile); then
13512a51b5beSmrg    case `/usr/bin/file conftest.o` in
13522a51b5beSmrg    *64-bit*)
13532a51b5beSmrg      case $lt_cv_prog_gnu_ld in
13542a51b5beSmrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
13552a51b5beSmrg      *)
13561b12faf6Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
13572a51b5beSmrg	  LD="${LD-ld} -64"
13582a51b5beSmrg	fi
13592a51b5beSmrg	;;
13602a51b5beSmrg      esac
13612a51b5beSmrg      ;;
13622a51b5beSmrg    esac
13632a51b5beSmrg  fi
13642a51b5beSmrg  rm -rf conftest*
13652a51b5beSmrg  ;;
13662a51b5beSmrgesac
136732b578d3Smrg
13682a51b5beSmrgneed_locks="$enable_libtool_lock"
13691b12faf6Smrg])# _LT_ENABLE_LOCK
13701b12faf6Smrg
13711b12faf6Smrg
13721b12faf6Smrg# _LT_CMD_OLD_ARCHIVE
13731b12faf6Smrg# -------------------
13741b12faf6Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
13751b12faf6Smrg[AC_CHECK_TOOL(AR, ar, false)
13761b12faf6Smrgtest -z "$AR" && AR=ar
13771b12faf6Smrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
13781b12faf6Smrg_LT_DECL([], [AR], [1], [The archiver])
13791b12faf6Smrg_LT_DECL([], [AR_FLAGS], [1])
13801b12faf6Smrg
13811b12faf6SmrgAC_CHECK_TOOL(STRIP, strip, :)
13821b12faf6Smrgtest -z "$STRIP" && STRIP=:
13831b12faf6Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
13841b12faf6Smrg
13851b12faf6SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
13861b12faf6Smrgtest -z "$RANLIB" && RANLIB=:
13871b12faf6Smrg_LT_DECL([], [RANLIB], [1],
13881b12faf6Smrg    [Commands used to install an old-style archive])
13891b12faf6Smrg
13901b12faf6Smrg# Determine commands to create old-style static archives.
13911b12faf6Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
13921b12faf6Smrgold_postinstall_cmds='chmod 644 $oldlib'
13931b12faf6Smrgold_postuninstall_cmds=
139432b578d3Smrg
13951b12faf6Smrgif test -n "$RANLIB"; then
13961b12faf6Smrg  case $host_os in
13971b12faf6Smrg  openbsd*)
13981b12faf6Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
13991b12faf6Smrg    ;;
14001b12faf6Smrg  *)
14011b12faf6Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
14021b12faf6Smrg    ;;
14031b12faf6Smrg  esac
14041b12faf6Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
14051b12faf6Smrgfi
14061b12faf6Smrg_LT_DECL([], [old_postinstall_cmds], [2])
14071b12faf6Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
14081b12faf6Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
14091b12faf6Smrg    [Commands used to build an old-style archive])
14101b12faf6Smrg])# _LT_CMD_OLD_ARCHIVE
141132b578d3Smrg
141232b578d3Smrg
14131b12faf6Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
14142a51b5beSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
14152a51b5beSmrg# ----------------------------------------------------------------
14162a51b5beSmrg# Check whether the given compiler option works
14171b12faf6SmrgAC_DEFUN([_LT_COMPILER_OPTION],
14181b12faf6Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
14191b12faf6Smrgm4_require([_LT_DECL_SED])dnl
14202a51b5beSmrgAC_CACHE_CHECK([$1], [$2],
14212a51b5beSmrg  [$2=no
14221b12faf6Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
14232a51b5beSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
14242a51b5beSmrg   lt_compiler_flag="$3"
14252a51b5beSmrg   # Insert the option either (1) after the last *FLAGS variable, or
14262a51b5beSmrg   # (2) before a word containing "conftest.", or (3) at the end.
14272a51b5beSmrg   # Note that $ac_compile itself does not contain backslashes and begins
14282a51b5beSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
14292a51b5beSmrg   # The option is referenced via a variable to avoid confusing sed.
14302a51b5beSmrg   lt_compile=`echo "$ac_compile" | $SED \
14312a51b5beSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
14322a51b5beSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
14332a51b5beSmrg   -e 's:$: $lt_compiler_flag:'`
14342a51b5beSmrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
14352a51b5beSmrg   (eval "$lt_compile" 2>conftest.err)
14362a51b5beSmrg   ac_status=$?
14372a51b5beSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
14382a51b5beSmrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
14392a51b5beSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
14402a51b5beSmrg     # The compiler can only warn and ignore the option if not recognized
14412a51b5beSmrg     # So say no if there are warnings other than the usual output.
14421b12faf6Smrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
14432a51b5beSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
14442a51b5beSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
14452a51b5beSmrg       $2=yes
14462a51b5beSmrg     fi
14472a51b5beSmrg   fi
14481b12faf6Smrg   $RM conftest*
1449d31dbc53Smrg])
145032b578d3Smrg
14512a51b5beSmrgif test x"[$]$2" = xyes; then
14521b12faf6Smrg    m4_if([$5], , :, [$5])
14532a51b5beSmrgelse
14541b12faf6Smrg    m4_if([$6], , :, [$6])
14552a51b5beSmrgfi
14561b12faf6Smrg])# _LT_COMPILER_OPTION
145732b578d3Smrg
14581b12faf6Smrg# Old name:
14591b12faf6SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
14601b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
14611b12faf6Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
146232b578d3Smrg
14631b12faf6Smrg
14641b12faf6Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
14651b12faf6Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
14661b12faf6Smrg# ----------------------------------------------------
14671b12faf6Smrg# Check whether the given linker option works
14681b12faf6SmrgAC_DEFUN([_LT_LINKER_OPTION],
14691b12faf6Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
14701b12faf6Smrgm4_require([_LT_DECL_SED])dnl
14712a51b5beSmrgAC_CACHE_CHECK([$1], [$2],
14722a51b5beSmrg  [$2=no
14732a51b5beSmrg   save_LDFLAGS="$LDFLAGS"
14742a51b5beSmrg   LDFLAGS="$LDFLAGS $3"
14752a51b5beSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
14762a51b5beSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
14772a51b5beSmrg     # The linker can only warn and ignore the option if not recognized
14782a51b5beSmrg     # So say no if there are warnings
14792a51b5beSmrg     if test -s conftest.err; then
14802a51b5beSmrg       # Append any errors to the config.log.
14812a51b5beSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
14821b12faf6Smrg       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
14832a51b5beSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
14842a51b5beSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
14852a51b5beSmrg         $2=yes
14862a51b5beSmrg       fi
14872a51b5beSmrg     else
14882a51b5beSmrg       $2=yes
14892a51b5beSmrg     fi
14902a51b5beSmrg   fi
14911b12faf6Smrg   $RM -r conftest*
14922a51b5beSmrg   LDFLAGS="$save_LDFLAGS"
14932a51b5beSmrg])
149432b578d3Smrg
14952a51b5beSmrgif test x"[$]$2" = xyes; then
14961b12faf6Smrg    m4_if([$4], , :, [$4])
14972a51b5beSmrgelse
14981b12faf6Smrg    m4_if([$5], , :, [$5])
1499d31dbc53Smrgfi
15001b12faf6Smrg])# _LT_LINKER_OPTION
150132b578d3Smrg
15021b12faf6Smrg# Old name:
15031b12faf6SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
15041b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
15051b12faf6Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
150632b578d3Smrg
15071b12faf6Smrg
15081b12faf6Smrg# LT_CMD_MAX_LEN
15091b12faf6Smrg#---------------
15101b12faf6SmrgAC_DEFUN([LT_CMD_MAX_LEN],
15111b12faf6Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
15121b12faf6Smrg# find the maximum length of command line arguments
15132a51b5beSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
15142a51b5beSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
15152a51b5beSmrg  i=0
15162a51b5beSmrg  teststring="ABCD"
151732b578d3Smrg
15182a51b5beSmrg  case $build_os in
15192a51b5beSmrg  msdosdjgpp*)
15202a51b5beSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
15212a51b5beSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
15222a51b5beSmrg    # during glob expansion).  Even if it were fixed, the result of this
15232a51b5beSmrg    # check would be larger than it should be.
15242a51b5beSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
15252a51b5beSmrg    ;;
152632b578d3Smrg
15272a51b5beSmrg  gnu*)
15282a51b5beSmrg    # Under GNU Hurd, this test is not required because there is
15292a51b5beSmrg    # no limit to the length of command line arguments.
15302a51b5beSmrg    # Libtool will interpret -1 as no limit whatsoever
15312a51b5beSmrg    lt_cv_sys_max_cmd_len=-1;
15322a51b5beSmrg    ;;
153332b578d3Smrg
15341b12faf6Smrg  cygwin* | mingw* | cegcc*)
15352a51b5beSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
15362a51b5beSmrg    # about 5 minutes as the teststring grows exponentially.
15372a51b5beSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
15382a51b5beSmrg    # you end up with a "frozen" computer, even though with patience
15392a51b5beSmrg    # the test eventually succeeds (with a max line length of 256k).
15402a51b5beSmrg    # Instead, let's just punt: use the minimum linelength reported by
15412a51b5beSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
15422a51b5beSmrg    lt_cv_sys_max_cmd_len=8192;
15432a51b5beSmrg    ;;
154432b578d3Smrg
15452a51b5beSmrg  amigaos*)
15462a51b5beSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
15472a51b5beSmrg    # So we just punt and use a minimum line length of 8192.
15482a51b5beSmrg    lt_cv_sys_max_cmd_len=8192;
15492a51b5beSmrg    ;;
155032b578d3Smrg
15512a51b5beSmrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
15522a51b5beSmrg    # This has been around since 386BSD, at least.  Likely further.
15532a51b5beSmrg    if test -x /sbin/sysctl; then
15542a51b5beSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
15552a51b5beSmrg    elif test -x /usr/sbin/sysctl; then
15562a51b5beSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
15572a51b5beSmrg    else
15582a51b5beSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
15592a51b5beSmrg    fi
15602a51b5beSmrg    # And add a safety zone
15612a51b5beSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
15622a51b5beSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
15632a51b5beSmrg    ;;
156432b578d3Smrg
15652a51b5beSmrg  interix*)
15662a51b5beSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
15672a51b5beSmrg    lt_cv_sys_max_cmd_len=196608
15682a51b5beSmrg    ;;
1569d31dbc53Smrg
15702a51b5beSmrg  osf*)
15712a51b5beSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
15722a51b5beSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
15732a51b5beSmrg    # nice to cause kernel panics so lets avoid the loop below.
15742a51b5beSmrg    # First set a reasonable default.
15752a51b5beSmrg    lt_cv_sys_max_cmd_len=16384
15762a51b5beSmrg    #
15772a51b5beSmrg    if test -x /sbin/sysconfig; then
15782a51b5beSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
15792a51b5beSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
15802a51b5beSmrg      esac
15812a51b5beSmrg    fi
15822a51b5beSmrg    ;;
15832a51b5beSmrg  sco3.2v5*)
15842a51b5beSmrg    lt_cv_sys_max_cmd_len=102400
15852a51b5beSmrg    ;;
15862a51b5beSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
15872a51b5beSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
15882a51b5beSmrg    if test -n "$kargmax"; then
15891b12faf6Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
15902a51b5beSmrg    else
15912a51b5beSmrg      lt_cv_sys_max_cmd_len=32768
15922a51b5beSmrg    fi
15932a51b5beSmrg    ;;
15942a51b5beSmrg  *)
15952a51b5beSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
15962a51b5beSmrg    if test -n "$lt_cv_sys_max_cmd_len"; then
15972a51b5beSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
15982a51b5beSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
15992a51b5beSmrg    else
16001b12faf6Smrg      # Make teststring a little bigger before we do anything with it.
16011b12faf6Smrg      # a 1K string should be a reasonable start.
16021b12faf6Smrg      for i in 1 2 3 4 5 6 7 8 ; do
16031b12faf6Smrg        teststring=$teststring$teststring
16041b12faf6Smrg      done
16052a51b5beSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
16061b12faf6Smrg      # If test is not a shell built-in, we'll probably end up computing a
16071b12faf6Smrg      # maximum length that is only half of the actual maximum length, but
16081b12faf6Smrg      # we can't tell.
16091b12faf6Smrg      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
16101b12faf6Smrg	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
16112a51b5beSmrg	      test $i != 17 # 1/2 MB should be enough
16122a51b5beSmrg      do
16132a51b5beSmrg        i=`expr $i + 1`
16142a51b5beSmrg        teststring=$teststring$teststring
16152a51b5beSmrg      done
16161b12faf6Smrg      # Only check the string length outside the loop.
16171b12faf6Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
16182a51b5beSmrg      teststring=
16191b12faf6Smrg      # Add a significant safety factor because C++ compilers can tack on
16201b12faf6Smrg      # massive amounts of additional arguments before passing them to the
16211b12faf6Smrg      # linker.  It appears as though 1/2 is a usable value.
16222a51b5beSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
16232a51b5beSmrg    fi
16242a51b5beSmrg    ;;
16252a51b5beSmrg  esac
16262a51b5beSmrg])
16272a51b5beSmrgif test -n $lt_cv_sys_max_cmd_len ; then
16282a51b5beSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1629d31dbc53Smrgelse
16302a51b5beSmrg  AC_MSG_RESULT(none)
163132b578d3Smrgfi
16321b12faf6Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
16331b12faf6Smrg_LT_DECL([], [max_cmd_len], [0],
16341b12faf6Smrg    [What is the maximum length of a command?])
16351b12faf6Smrg])# LT_CMD_MAX_LEN
163632b578d3Smrg
16371b12faf6Smrg# Old name:
16381b12faf6SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
16391b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
16401b12faf6Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
164132b578d3Smrg
16421b12faf6Smrg
16431b12faf6Smrg# _LT_HEADER_DLFCN
16441b12faf6Smrg# ----------------
16451b12faf6Smrgm4_defun([_LT_HEADER_DLFCN],
16461b12faf6Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
16471b12faf6Smrg])# _LT_HEADER_DLFCN
164832b578d3Smrg
164932b578d3Smrg
16501b12faf6Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
16511b12faf6Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
16521b12faf6Smrg# ----------------------------------------------------------------
16531b12faf6Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
16541b12faf6Smrg[m4_require([_LT_HEADER_DLFCN])dnl
16552a51b5beSmrgif test "$cross_compiling" = yes; then :
16562a51b5beSmrg  [$4]
16572a51b5beSmrgelse
16582a51b5beSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
16592a51b5beSmrg  lt_status=$lt_dlunknown
16601b12faf6Smrg  cat > conftest.$ac_ext <<_LT_EOF
16612a51b5beSmrg[#line __oline__ "configure"
16622a51b5beSmrg#include "confdefs.h"
166332b578d3Smrg
16642a51b5beSmrg#if HAVE_DLFCN_H
16652a51b5beSmrg#include <dlfcn.h>
16662a51b5beSmrg#endif
1667d31dbc53Smrg
16682a51b5beSmrg#include <stdio.h>
166932b578d3Smrg
16702a51b5beSmrg#ifdef RTLD_GLOBAL
16712a51b5beSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
16722a51b5beSmrg#else
16732a51b5beSmrg#  ifdef DL_GLOBAL
16742a51b5beSmrg#    define LT_DLGLOBAL		DL_GLOBAL
16752a51b5beSmrg#  else
16762a51b5beSmrg#    define LT_DLGLOBAL		0
16772a51b5beSmrg#  endif
16782a51b5beSmrg#endif
167932b578d3Smrg
16802a51b5beSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
16812a51b5beSmrg   find out it does not work in some platform. */
16822a51b5beSmrg#ifndef LT_DLLAZY_OR_NOW
16832a51b5beSmrg#  ifdef RTLD_LAZY
16842a51b5beSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
16852a51b5beSmrg#  else
16862a51b5beSmrg#    ifdef DL_LAZY
16872a51b5beSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
16882a51b5beSmrg#    else
16892a51b5beSmrg#      ifdef RTLD_NOW
16902a51b5beSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
16912a51b5beSmrg#      else
16922a51b5beSmrg#        ifdef DL_NOW
16932a51b5beSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
16942a51b5beSmrg#        else
16952a51b5beSmrg#          define LT_DLLAZY_OR_NOW	0
16962a51b5beSmrg#        endif
16972a51b5beSmrg#      endif
16982a51b5beSmrg#    endif
16992a51b5beSmrg#  endif
17002a51b5beSmrg#endif
170132b578d3Smrg
17022a51b5beSmrgvoid fnord() { int i=42;}
17032a51b5beSmrgint main ()
17042a51b5beSmrg{
17052a51b5beSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
17062a51b5beSmrg  int status = $lt_dlunknown;
170732b578d3Smrg
17082a51b5beSmrg  if (self)
17092a51b5beSmrg    {
17102a51b5beSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
17112a51b5beSmrg      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
17122a51b5beSmrg      /* dlclose (self); */
17132a51b5beSmrg    }
17142a51b5beSmrg  else
17152a51b5beSmrg    puts (dlerror ());
171632b578d3Smrg
17171b12faf6Smrg  return status;
17182a51b5beSmrg}]
17191b12faf6Smrg_LT_EOF
17202a51b5beSmrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
17212a51b5beSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
17222a51b5beSmrg    lt_status=$?
17232a51b5beSmrg    case x$lt_status in
17242a51b5beSmrg      x$lt_dlno_uscore) $1 ;;
17252a51b5beSmrg      x$lt_dlneed_uscore) $2 ;;
17262a51b5beSmrg      x$lt_dlunknown|x*) $3 ;;
17272a51b5beSmrg    esac
17282a51b5beSmrg  else :
17292a51b5beSmrg    # compilation failed
17302a51b5beSmrg    $3
17312a51b5beSmrg  fi
17322a51b5beSmrgfi
17332a51b5beSmrgrm -fr conftest*
17341b12faf6Smrg])# _LT_TRY_DLOPEN_SELF
173532b578d3Smrg
173632b578d3Smrg
17371b12faf6Smrg# LT_SYS_DLOPEN_SELF
17381b12faf6Smrg# ------------------
17391b12faf6SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
17401b12faf6Smrg[m4_require([_LT_HEADER_DLFCN])dnl
17412a51b5beSmrgif test "x$enable_dlopen" != xyes; then
17422a51b5beSmrg  enable_dlopen=unknown
17432a51b5beSmrg  enable_dlopen_self=unknown
17442a51b5beSmrg  enable_dlopen_self_static=unknown
174532b578d3Smrgelse
17462a51b5beSmrg  lt_cv_dlopen=no
17472a51b5beSmrg  lt_cv_dlopen_libs=
174832b578d3Smrg
17492a51b5beSmrg  case $host_os in
17502a51b5beSmrg  beos*)
17512a51b5beSmrg    lt_cv_dlopen="load_add_on"
17522a51b5beSmrg    lt_cv_dlopen_libs=
17532a51b5beSmrg    lt_cv_dlopen_self=yes
17542a51b5beSmrg    ;;
175532b578d3Smrg
17561b12faf6Smrg  mingw* | pw32* | cegcc*)
17572a51b5beSmrg    lt_cv_dlopen="LoadLibrary"
17582a51b5beSmrg    lt_cv_dlopen_libs=
17591b12faf6Smrg    ;;
176032b578d3Smrg
17612a51b5beSmrg  cygwin*)
17622a51b5beSmrg    lt_cv_dlopen="dlopen"
17632a51b5beSmrg    lt_cv_dlopen_libs=
17641b12faf6Smrg    ;;
176532b578d3Smrg
17662a51b5beSmrg  darwin*)
17672a51b5beSmrg  # if libdl is installed we need to link against it
17682a51b5beSmrg    AC_CHECK_LIB([dl], [dlopen],
17692a51b5beSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
17702a51b5beSmrg    lt_cv_dlopen="dyld"
17712a51b5beSmrg    lt_cv_dlopen_libs=
17722a51b5beSmrg    lt_cv_dlopen_self=yes
17732a51b5beSmrg    ])
17741b12faf6Smrg    ;;
177532b578d3Smrg
17762a51b5beSmrg  *)
17772a51b5beSmrg    AC_CHECK_FUNC([shl_load],
17782a51b5beSmrg	  [lt_cv_dlopen="shl_load"],
17792a51b5beSmrg      [AC_CHECK_LIB([dld], [shl_load],
17802a51b5beSmrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
17812a51b5beSmrg	[AC_CHECK_FUNC([dlopen],
17822a51b5beSmrg	      [lt_cv_dlopen="dlopen"],
17832a51b5beSmrg	  [AC_CHECK_LIB([dl], [dlopen],
17842a51b5beSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
17852a51b5beSmrg	    [AC_CHECK_LIB([svld], [dlopen],
17862a51b5beSmrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
17872a51b5beSmrg	      [AC_CHECK_LIB([dld], [dld_link],
17882a51b5beSmrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
17892a51b5beSmrg	      ])
17902a51b5beSmrg	    ])
17912a51b5beSmrg	  ])
17922a51b5beSmrg	])
17932a51b5beSmrg      ])
17942a51b5beSmrg    ;;
17952a51b5beSmrg  esac
179632b578d3Smrg
17972a51b5beSmrg  if test "x$lt_cv_dlopen" != xno; then
17982a51b5beSmrg    enable_dlopen=yes
17992a51b5beSmrg  else
18002a51b5beSmrg    enable_dlopen=no
18012a51b5beSmrg  fi
180232b578d3Smrg
18032a51b5beSmrg  case $lt_cv_dlopen in
18042a51b5beSmrg  dlopen)
18052a51b5beSmrg    save_CPPFLAGS="$CPPFLAGS"
18062a51b5beSmrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
180732b578d3Smrg
18082a51b5beSmrg    save_LDFLAGS="$LDFLAGS"
18092a51b5beSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
181032b578d3Smrg
18112a51b5beSmrg    save_LIBS="$LIBS"
18122a51b5beSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
181332b578d3Smrg
18142a51b5beSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
18152a51b5beSmrg	  lt_cv_dlopen_self, [dnl
18161b12faf6Smrg	  _LT_TRY_DLOPEN_SELF(
18172a51b5beSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
18182a51b5beSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
18192a51b5beSmrg    ])
182032b578d3Smrg
18212a51b5beSmrg    if test "x$lt_cv_dlopen_self" = xyes; then
18222a51b5beSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
18232a51b5beSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
18241b12faf6Smrg	  lt_cv_dlopen_self_static, [dnl
18251b12faf6Smrg	  _LT_TRY_DLOPEN_SELF(
18262a51b5beSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
18272a51b5beSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
18282a51b5beSmrg      ])
18292a51b5beSmrg    fi
183032b578d3Smrg
18312a51b5beSmrg    CPPFLAGS="$save_CPPFLAGS"
18322a51b5beSmrg    LDFLAGS="$save_LDFLAGS"
18332a51b5beSmrg    LIBS="$save_LIBS"
18342a51b5beSmrg    ;;
18352a51b5beSmrg  esac
183632b578d3Smrg
18372a51b5beSmrg  case $lt_cv_dlopen_self in
18382a51b5beSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
18392a51b5beSmrg  *) enable_dlopen_self=unknown ;;
18402a51b5beSmrg  esac
184132b578d3Smrg
18422a51b5beSmrg  case $lt_cv_dlopen_self_static in
18432a51b5beSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
18442a51b5beSmrg  *) enable_dlopen_self_static=unknown ;;
18452a51b5beSmrg  esac
1846d31dbc53Smrgfi
18471b12faf6Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
18481b12faf6Smrg	 [Whether dlopen is supported])
18491b12faf6Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
18501b12faf6Smrg	 [Whether dlopen of programs is supported])
18511b12faf6Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
18521b12faf6Smrg	 [Whether dlopen of statically linked programs is supported])
18531b12faf6Smrg])# LT_SYS_DLOPEN_SELF
185432b578d3Smrg
18551b12faf6Smrg# Old name:
18561b12faf6SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
18571b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
18581b12faf6Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
185932b578d3Smrg
18601b12faf6Smrg
18611b12faf6Smrg# _LT_COMPILER_C_O([TAGNAME])
18621b12faf6Smrg# ---------------------------
18631b12faf6Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
18641b12faf6Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
18651b12faf6Smrgm4_defun([_LT_COMPILER_C_O],
18661b12faf6Smrg[m4_require([_LT_DECL_SED])dnl
18671b12faf6Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
18681b12faf6Smrgm4_require([_LT_TAG_COMPILER])dnl
18692a51b5beSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
18701b12faf6Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
18711b12faf6Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
18721b12faf6Smrg   $RM -r conftest 2>/dev/null
18732a51b5beSmrg   mkdir conftest
18742a51b5beSmrg   cd conftest
18752a51b5beSmrg   mkdir out
18762a51b5beSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
187732b578d3Smrg
18782a51b5beSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
18792a51b5beSmrg   # Insert the option either (1) after the last *FLAGS variable, or
18802a51b5beSmrg   # (2) before a word containing "conftest.", or (3) at the end.
18812a51b5beSmrg   # Note that $ac_compile itself does not contain backslashes and begins
18822a51b5beSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
18832a51b5beSmrg   lt_compile=`echo "$ac_compile" | $SED \
18842a51b5beSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
18852a51b5beSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
18862a51b5beSmrg   -e 's:$: $lt_compiler_flag:'`
18872a51b5beSmrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
18882a51b5beSmrg   (eval "$lt_compile" 2>out/conftest.err)
18892a51b5beSmrg   ac_status=$?
18902a51b5beSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
18912a51b5beSmrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
18922a51b5beSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
18932a51b5beSmrg   then
18942a51b5beSmrg     # The compiler can only warn and ignore the option if not recognized
18952a51b5beSmrg     # So say no if there are warnings
18961b12faf6Smrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
18972a51b5beSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
18982a51b5beSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
18991b12faf6Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
19002a51b5beSmrg     fi
19012a51b5beSmrg   fi
19022a51b5beSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
19031b12faf6Smrg   $RM conftest*
19042a51b5beSmrg   # SGI C++ compiler will create directory out/ii_files/ for
19052a51b5beSmrg   # template instantiation
19061b12faf6Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
19071b12faf6Smrg   $RM out/* && rmdir out
19082a51b5beSmrg   cd ..
19091b12faf6Smrg   $RM -r conftest
19101b12faf6Smrg   $RM conftest*
19112a51b5beSmrg])
19121b12faf6Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
19131b12faf6Smrg	[Does compiler simultaneously support -c and -o options?])
19141b12faf6Smrg])# _LT_COMPILER_C_O
191532b578d3Smrg
191632b578d3Smrg
19171b12faf6Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
19181b12faf6Smrg# ----------------------------------
19192a51b5beSmrg# Check to see if we can do hard links to lock some files if needed
19201b12faf6Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
19211b12faf6Smrg[m4_require([_LT_ENABLE_LOCK])dnl
19221b12faf6Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
19231b12faf6Smrg_LT_COMPILER_C_O([$1])
192432b578d3Smrg
19252a51b5beSmrghard_links="nottested"
19261b12faf6Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
19272a51b5beSmrg  # do not overwrite the value of need_locks provided by the user
19282a51b5beSmrg  AC_MSG_CHECKING([if we can lock with hard links])
19292a51b5beSmrg  hard_links=yes
19301b12faf6Smrg  $RM conftest*
19312a51b5beSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
19322a51b5beSmrg  touch conftest.a
19332a51b5beSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
19342a51b5beSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
19352a51b5beSmrg  AC_MSG_RESULT([$hard_links])
19362a51b5beSmrg  if test "$hard_links" = no; then
19372a51b5beSmrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
19382a51b5beSmrg    need_locks=warn
19392a51b5beSmrg  fi
19402a51b5beSmrgelse
19412a51b5beSmrg  need_locks=no
19422a51b5beSmrgfi
19431b12faf6Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
19441b12faf6Smrg])# _LT_COMPILER_FILE_LOCKS
1945d31dbc53Smrg
1946d31dbc53Smrg
19471b12faf6Smrg# _LT_CHECK_OBJDIR
19481b12faf6Smrg# ----------------
19491b12faf6Smrgm4_defun([_LT_CHECK_OBJDIR],
19502a51b5beSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
19512a51b5beSmrg[rm -f .libs 2>/dev/null
19522a51b5beSmrgmkdir .libs 2>/dev/null
19532a51b5beSmrgif test -d .libs; then
19542a51b5beSmrg  lt_cv_objdir=.libs
19552a51b5beSmrgelse
19562a51b5beSmrg  # MS-DOS does not allow filenames that begin with a dot.
19572a51b5beSmrg  lt_cv_objdir=_libs
19582a51b5beSmrgfi
19592a51b5beSmrgrmdir .libs 2>/dev/null])
19602a51b5beSmrgobjdir=$lt_cv_objdir
19611b12faf6Smrg_LT_DECL([], [objdir], [0],
19621b12faf6Smrg         [The name of the directory that contains temporary libtool files])dnl
19631b12faf6Smrgm4_pattern_allow([LT_OBJDIR])dnl
19641b12faf6SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
19651b12faf6Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
19661b12faf6Smrg])# _LT_CHECK_OBJDIR
196732b578d3Smrg
196832b578d3Smrg
19691b12faf6Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
19701b12faf6Smrg# --------------------------------------
19712a51b5beSmrg# Check hardcoding attributes.
19721b12faf6Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
19732a51b5beSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
19741b12faf6Smrg_LT_TAGVAR(hardcode_action, $1)=
19751b12faf6Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
19761b12faf6Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
19771b12faf6Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
197832b578d3Smrg
19791b12faf6Smrg  # We can hardcode non-existent directories.
19801b12faf6Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
19812a51b5beSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
19822a51b5beSmrg     # have to relink, otherwise we might link with an installed library
19832a51b5beSmrg     # when we should be linking with a yet-to-be-installed one
19841b12faf6Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
19851b12faf6Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
19862a51b5beSmrg    # Linking always hardcodes the temporary library directory.
19871b12faf6Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
19882a51b5beSmrg  else
19892a51b5beSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
19901b12faf6Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
19912a51b5beSmrg  fi
1992d31dbc53Smrgelse
19932a51b5beSmrg  # We cannot hardcode anything, or else we can only hardcode existing
19942a51b5beSmrg  # directories.
19951b12faf6Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
1996d31dbc53Smrgfi
19971b12faf6SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
199832b578d3Smrg
19991b12faf6Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
20001b12faf6Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
20012a51b5beSmrg  # Fast installation is not supported
20022a51b5beSmrg  enable_fast_install=no
20032a51b5beSmrgelif test "$shlibpath_overrides_runpath" = yes ||
20042a51b5beSmrg     test "$enable_shared" = no; then
20052a51b5beSmrg  # Fast installation is not necessary
20062a51b5beSmrg  enable_fast_install=needless
2007d31dbc53Smrgfi
20081b12faf6Smrg_LT_TAGDECL([], [hardcode_action], [0],
20091b12faf6Smrg    [How to hardcode a shared library path into an executable])
20101b12faf6Smrg])# _LT_LINKER_HARDCODE_LIBPATH
201132b578d3Smrg
201232b578d3Smrg
20131b12faf6Smrg# _LT_CMD_STRIPLIB
20141b12faf6Smrg# ----------------
20151b12faf6Smrgm4_defun([_LT_CMD_STRIPLIB],
20161b12faf6Smrg[m4_require([_LT_DECL_EGREP])
20171b12faf6Smrgstriplib=
20182a51b5beSmrgold_striplib=
20192a51b5beSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
20201b12faf6Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
20212a51b5beSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
20222a51b5beSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
20232a51b5beSmrg  AC_MSG_RESULT([yes])
20242a51b5beSmrgelse
20252a51b5beSmrg# FIXME - insert some real tests, host_os isn't really good enough
20262a51b5beSmrg  case $host_os in
20271b12faf6Smrg  darwin*)
20281b12faf6Smrg    if test -n "$STRIP" ; then
20291b12faf6Smrg      striplib="$STRIP -x"
20301b12faf6Smrg      old_striplib="$STRIP -S"
20311b12faf6Smrg      AC_MSG_RESULT([yes])
20321b12faf6Smrg    else
20331b12faf6Smrg      AC_MSG_RESULT([no])
20341b12faf6Smrg    fi
20351b12faf6Smrg    ;;
20361b12faf6Smrg  *)
20371b12faf6Smrg    AC_MSG_RESULT([no])
20382a51b5beSmrg    ;;
20392a51b5beSmrg  esac
2040d31dbc53Smrgfi
20411b12faf6Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
20421b12faf6Smrg_LT_DECL([], [striplib], [1])
20431b12faf6Smrg])# _LT_CMD_STRIPLIB
204432b578d3Smrg
204532b578d3Smrg
20461b12faf6Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
20472a51b5beSmrg# -----------------------------
20482a51b5beSmrg# PORTME Fill in your ld.so characteristics
20491b12faf6Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
20501b12faf6Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
20511b12faf6Smrgm4_require([_LT_DECL_EGREP])dnl
20521b12faf6Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
20531b12faf6Smrgm4_require([_LT_DECL_OBJDUMP])dnl
20541b12faf6Smrgm4_require([_LT_DECL_SED])dnl
20552a51b5beSmrgAC_MSG_CHECKING([dynamic linker characteristics])
20561b12faf6Smrgm4_if([$1],
20571b12faf6Smrg	[], [
20582a51b5beSmrgif test "$GCC" = yes; then
20592a51b5beSmrg  case $host_os in
20602a51b5beSmrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
20612a51b5beSmrg    *) lt_awk_arg="/^libraries:/" ;;
20622a51b5beSmrg  esac
20632a51b5beSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
20641b12faf6Smrg  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
20652a51b5beSmrg    # if the path contains ";" then we assume it to be the separator
20662a51b5beSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
20672a51b5beSmrg    # assumed that no part of a normal pathname contains ";" but that should
20682a51b5beSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
20691b12faf6Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
20702a51b5beSmrg  else
20711b12faf6Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
20722a51b5beSmrg  fi
20732a51b5beSmrg  # Ok, now we have the path, separated by spaces, we can step through it
20742a51b5beSmrg  # and add multilib dir if necessary.
20752a51b5beSmrg  lt_tmp_lt_search_path_spec=
20762a51b5beSmrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
20772a51b5beSmrg  for lt_sys_path in $lt_search_path_spec; do
20782a51b5beSmrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
20792a51b5beSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
20802a51b5beSmrg    else
20812a51b5beSmrg      test -d "$lt_sys_path" && \
20822a51b5beSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
20832a51b5beSmrg    fi
20842a51b5beSmrg  done
20851b12faf6Smrg  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
20862a51b5beSmrgBEGIN {RS=" "; FS="/|\n";} {
20872a51b5beSmrg  lt_foo="";
20882a51b5beSmrg  lt_count=0;
20892a51b5beSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
20902a51b5beSmrg    if ($lt_i != "" && $lt_i != ".") {
20912a51b5beSmrg      if ($lt_i == "..") {
20922a51b5beSmrg        lt_count++;
20932a51b5beSmrg      } else {
20942a51b5beSmrg        if (lt_count == 0) {
20952a51b5beSmrg          lt_foo="/" $lt_i lt_foo;
20962a51b5beSmrg        } else {
20972a51b5beSmrg          lt_count--;
20982a51b5beSmrg        }
20992a51b5beSmrg      }
21002a51b5beSmrg    }
21012a51b5beSmrg  }
21022a51b5beSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
21032a51b5beSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
21042a51b5beSmrg}'`
21051b12faf6Smrg  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
21062a51b5beSmrgelse
21072a51b5beSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
21082a51b5beSmrgfi])
21091b12faf6Smrglibrary_names_spec=
21101b12faf6Smrglibname_spec='lib$name'
21111b12faf6Smrgsoname_spec=
21121b12faf6Smrgshrext_cmds=".so"
21131b12faf6Smrgpostinstall_cmds=
21141b12faf6Smrgpostuninstall_cmds=
21151b12faf6Smrgfinish_cmds=
21161b12faf6Smrgfinish_eval=
21171b12faf6Smrgshlibpath_var=
21181b12faf6Smrgshlibpath_overrides_runpath=unknown
21191b12faf6Smrgversion_type=none
21201b12faf6Smrgdynamic_linker="$host_os ld.so"
21211b12faf6Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
21222a51b5beSmrgneed_lib_prefix=unknown
21232a51b5beSmrghardcode_into_libs=no
212432b578d3Smrg
21252a51b5beSmrg# when you set need_version to no, make sure it does not cause -set_version
21262a51b5beSmrg# flags to be left without arguments
21272a51b5beSmrgneed_version=unknown
212832b578d3Smrg
21292a51b5beSmrgcase $host_os in
21302a51b5beSmrgaix3*)
21312a51b5beSmrg  version_type=linux
21322a51b5beSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
21332a51b5beSmrg  shlibpath_var=LIBPATH
213432b578d3Smrg
21352a51b5beSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
21362a51b5beSmrg  soname_spec='${libname}${release}${shared_ext}$major'
21372a51b5beSmrg  ;;
21382a51b5beSmrg
21392a51b5beSmrgaix[[4-9]]*)
21402a51b5beSmrg  version_type=linux
21412a51b5beSmrg  need_lib_prefix=no
21422a51b5beSmrg  need_version=no
21432a51b5beSmrg  hardcode_into_libs=yes
21442a51b5beSmrg  if test "$host_cpu" = ia64; then
21452a51b5beSmrg    # AIX 5 supports IA64
21462a51b5beSmrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
21472a51b5beSmrg    shlibpath_var=LD_LIBRARY_PATH
21482a51b5beSmrg  else
21492a51b5beSmrg    # With GCC up to 2.95.x, collect2 would create an import file
21502a51b5beSmrg    # for dependence libraries.  The import file would start with
21512a51b5beSmrg    # the line `#! .'.  This would cause the generated library to
21522a51b5beSmrg    # depend on `.', always an invalid library.  This was fixed in
21532a51b5beSmrg    # development snapshots of GCC prior to 3.0.
2154d31dbc53Smrg    case $host_os in
21552a51b5beSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
21562a51b5beSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
21572a51b5beSmrg	   echo ' yes '
21581b12faf6Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
21592a51b5beSmrg	:
21602a51b5beSmrg      else
21612a51b5beSmrg	can_build_shared=no
21622a51b5beSmrg      fi
21632a51b5beSmrg      ;;
2164d31dbc53Smrg    esac
21652a51b5beSmrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
21662a51b5beSmrg    # soname into executable. Probably we can add versioning support to
21672a51b5beSmrg    # collect2, so additional links can be useful in future.
21682a51b5beSmrg    if test "$aix_use_runtimelinking" = yes; then
21692a51b5beSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
21702a51b5beSmrg      # instead of lib<name>.a to let people know that these are not
21712a51b5beSmrg      # typical AIX shared libraries.
21722a51b5beSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
21732a51b5beSmrg    else
21742a51b5beSmrg      # We preserve .a as extension for shared libraries through AIX4.2
21752a51b5beSmrg      # and later when we are not doing run time linking.
21762a51b5beSmrg      library_names_spec='${libname}${release}.a $libname.a'
21772a51b5beSmrg      soname_spec='${libname}${release}${shared_ext}$major'
21782a51b5beSmrg    fi
21792a51b5beSmrg    shlibpath_var=LIBPATH
21802a51b5beSmrg  fi
21812a51b5beSmrg  ;;
218232b578d3Smrg
21832a51b5beSmrgamigaos*)
21841b12faf6Smrg  case $host_cpu in
21851b12faf6Smrg  powerpc)
21861b12faf6Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
21871b12faf6Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
21881b12faf6Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
21891b12faf6Smrg    ;;
21901b12faf6Smrg  m68k)
21911b12faf6Smrg    library_names_spec='$libname.ixlibrary $libname.a'
21921b12faf6Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
21931b12faf6Smrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
21941b12faf6Smrg    ;;
21951b12faf6Smrg  esac
21962a51b5beSmrg  ;;
219732b578d3Smrg
21982a51b5beSmrgbeos*)
21992a51b5beSmrg  library_names_spec='${libname}${shared_ext}'
22002a51b5beSmrg  dynamic_linker="$host_os ld.so"
22012a51b5beSmrg  shlibpath_var=LIBRARY_PATH
22022a51b5beSmrg  ;;
220332b578d3Smrg
22042a51b5beSmrgbsdi[[45]]*)
22052a51b5beSmrg  version_type=linux
22062a51b5beSmrg  need_version=no
22072a51b5beSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
22082a51b5beSmrg  soname_spec='${libname}${release}${shared_ext}$major'
22092a51b5beSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
22102a51b5beSmrg  shlibpath_var=LD_LIBRARY_PATH
22112a51b5beSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
22122a51b5beSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
22132a51b5beSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
22142a51b5beSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
22152a51b5beSmrg  # libtool to hard-code these into programs
22162a51b5beSmrg  ;;
221732b578d3Smrg
22181b12faf6Smrgcygwin* | mingw* | pw32* | cegcc*)
22192a51b5beSmrg  version_type=windows
22202a51b5beSmrg  shrext_cmds=".dll"
22212a51b5beSmrg  need_version=no
22222a51b5beSmrg  need_lib_prefix=no
222332b578d3Smrg
22242a51b5beSmrg  case $GCC,$host_os in
22251b12faf6Smrg  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
22262a51b5beSmrg    library_names_spec='$libname.dll.a'
22272a51b5beSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
22282a51b5beSmrg    postinstall_cmds='base_file=`basename \${file}`~
22291b12faf6Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
22302a51b5beSmrg      dldir=$destdir/`dirname \$dlpath`~
22312a51b5beSmrg      test -d \$dldir || mkdir -p \$dldir~
22322a51b5beSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
22331b12faf6Smrg      chmod a+x \$dldir/$dlname~
22341b12faf6Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
22351b12faf6Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
22361b12faf6Smrg      fi'
22372a51b5beSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
22382a51b5beSmrg      dlpath=$dir/\$dldll~
22391b12faf6Smrg       $RM \$dlpath'
22402a51b5beSmrg    shlibpath_overrides_runpath=yes
224132b578d3Smrg
22422a51b5beSmrg    case $host_os in
22432a51b5beSmrg    cygwin*)
22442a51b5beSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
22452a51b5beSmrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
22462a51b5beSmrg      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
22472a51b5beSmrg      ;;
22481b12faf6Smrg    mingw* | cegcc*)
22492a51b5beSmrg      # MinGW DLLs use traditional 'lib' prefix
22502a51b5beSmrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
22511b12faf6Smrg      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
22521b12faf6Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
22532a51b5beSmrg        # It is most probably a Windows format PATH printed by
22542a51b5beSmrg        # mingw gcc, but we are running on Cygwin. Gcc prints its search
22552a51b5beSmrg        # path with ; separators, and with drive letters. We can handle the
22562a51b5beSmrg        # drive letters (cygwin fileutils understands them), so leave them,
22572a51b5beSmrg        # especially as we might pass files found there to a mingw objdump,
22582a51b5beSmrg        # which wouldn't understand a cygwinified path. Ahh.
22591b12faf6Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
22602a51b5beSmrg      else
22611b12faf6Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
22622a51b5beSmrg      fi
22632a51b5beSmrg      ;;
22642a51b5beSmrg    pw32*)
22652a51b5beSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
22662a51b5beSmrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
22672a51b5beSmrg      ;;
22682a51b5beSmrg    esac
22692a51b5beSmrg    ;;
227032b578d3Smrg
22712a51b5beSmrg  *)
22722a51b5beSmrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
22732a51b5beSmrg    ;;
22742a51b5beSmrg  esac
22752a51b5beSmrg  dynamic_linker='Win32 ld.exe'
22762a51b5beSmrg  # FIXME: first we should search . and the directory the executable is in
22772a51b5beSmrg  shlibpath_var=PATH
22782a51b5beSmrg  ;;
227932b578d3Smrg
22802a51b5beSmrgdarwin* | rhapsody*)
22812a51b5beSmrg  dynamic_linker="$host_os dyld"
22822a51b5beSmrg  version_type=darwin
22832a51b5beSmrg  need_lib_prefix=no
22842a51b5beSmrg  need_version=no
22851b12faf6Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
22862a51b5beSmrg  soname_spec='${libname}${release}${major}$shared_ext'
22872a51b5beSmrg  shlibpath_overrides_runpath=yes
22882a51b5beSmrg  shlibpath_var=DYLD_LIBRARY_PATH
22892a51b5beSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
22901b12faf6Smrgm4_if([$1], [],[
22911b12faf6Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
22922a51b5beSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
22932a51b5beSmrg  ;;
229432b578d3Smrg
22952a51b5beSmrgdgux*)
22962a51b5beSmrg  version_type=linux
22972a51b5beSmrg  need_lib_prefix=no
22982a51b5beSmrg  need_version=no
22992a51b5beSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
23002a51b5beSmrg  soname_spec='${libname}${release}${shared_ext}$major'
23012a51b5beSmrg  shlibpath_var=LD_LIBRARY_PATH
23022a51b5beSmrg  ;;
230332b578d3Smrg
23042a51b5beSmrgfreebsd1*)
23052a51b5beSmrg  dynamic_linker=no
23062a51b5beSmrg  ;;
2307d31dbc53Smrg
23082a51b5beSmrgfreebsd* | dragonfly*)
23092a51b5beSmrg  # DragonFly does not have aout.  When/if they implement a new
23102a51b5beSmrg  # versioning mechanism, adjust this.
23112a51b5beSmrg  if test -x /usr/bin/objformat; then
23122a51b5beSmrg    objformat=`/usr/bin/objformat`
23132a51b5beSmrg  else
23142a51b5beSmrg    case $host_os in
23152a51b5beSmrg    freebsd[[123]]*) objformat=aout ;;
23162a51b5beSmrg    *) objformat=elf ;;
23172a51b5beSmrg    esac
23182a51b5beSmrg  fi
23192a51b5beSmrg  version_type=freebsd-$objformat
23202a51b5beSmrg  case $version_type in
23212a51b5beSmrg    freebsd-elf*)
23222a51b5beSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
23232a51b5beSmrg      need_version=no
23242a51b5beSmrg      need_lib_prefix=no
23252a51b5beSmrg      ;;
23262a51b5beSmrg    freebsd-*)
23272a51b5beSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
23282a51b5beSmrg      need_version=yes
23292a51b5beSmrg      ;;
23302a51b5beSmrg  esac
23312a51b5beSmrg  shlibpath_var=LD_LIBRARY_PATH
23322a51b5beSmrg  case $host_os in
23332a51b5beSmrg  freebsd2*)
23342a51b5beSmrg    shlibpath_overrides_runpath=yes
23352a51b5beSmrg    ;;
23362a51b5beSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
23372a51b5beSmrg    shlibpath_overrides_runpath=yes
23382a51b5beSmrg    hardcode_into_libs=yes
23392a51b5beSmrg    ;;
23402a51b5beSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
23412a51b5beSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
23422a51b5beSmrg    shlibpath_overrides_runpath=no
23432a51b5beSmrg    hardcode_into_libs=yes
23442a51b5beSmrg    ;;
23452a51b5beSmrg  *) # from 4.6 on, and DragonFly
23462a51b5beSmrg    shlibpath_overrides_runpath=yes
23472a51b5beSmrg    hardcode_into_libs=yes
23482a51b5beSmrg    ;;
23492a51b5beSmrg  esac
23502a51b5beSmrg  ;;
235132b578d3Smrg
23522a51b5beSmrggnu*)
23532a51b5beSmrg  version_type=linux
23542a51b5beSmrg  need_lib_prefix=no
23552a51b5beSmrg  need_version=no
23562a51b5beSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
23572a51b5beSmrg  soname_spec='${libname}${release}${shared_ext}$major'
23582a51b5beSmrg  shlibpath_var=LD_LIBRARY_PATH
23592a51b5beSmrg  hardcode_into_libs=yes
23602a51b5beSmrg  ;;
236132b578d3Smrg
23622a51b5beSmrghpux9* | hpux10* | hpux11*)
23632a51b5beSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
23642a51b5beSmrg  # link against other versions.
23652a51b5beSmrg  version_type=sunos
23662a51b5beSmrg  need_lib_prefix=no
23672a51b5beSmrg  need_version=no
23682a51b5beSmrg  case $host_cpu in
23692a51b5beSmrg  ia64*)
23702a51b5beSmrg    shrext_cmds='.so'
23712a51b5beSmrg    hardcode_into_libs=yes
23722a51b5beSmrg    dynamic_linker="$host_os dld.so"
23732a51b5beSmrg    shlibpath_var=LD_LIBRARY_PATH
23742a51b5beSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
23752a51b5beSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23762a51b5beSmrg    soname_spec='${libname}${release}${shared_ext}$major'
23772a51b5beSmrg    if test "X$HPUX_IA64_MODE" = X32; then
23782a51b5beSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
23792a51b5beSmrg    else
23802a51b5beSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
23812a51b5beSmrg    fi
23822a51b5beSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
23832a51b5beSmrg    ;;
23841b12faf6Smrg  hppa*64*)
23851b12faf6Smrg    shrext_cmds='.sl'
23861b12faf6Smrg    hardcode_into_libs=yes
23871b12faf6Smrg    dynamic_linker="$host_os dld.sl"
23881b12faf6Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
23891b12faf6Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
23901b12faf6Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23911b12faf6Smrg    soname_spec='${libname}${release}${shared_ext}$major'
23921b12faf6Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
23931b12faf6Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
23941b12faf6Smrg    ;;
23951b12faf6Smrg  *)
23962a51b5beSmrg    shrext_cmds='.sl'
23972a51b5beSmrg    dynamic_linker="$host_os dld.sl"
23982a51b5beSmrg    shlibpath_var=SHLIB_PATH
23992a51b5beSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
24002a51b5beSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
24012a51b5beSmrg    soname_spec='${libname}${release}${shared_ext}$major'
24022a51b5beSmrg    ;;
24032a51b5beSmrg  esac
24042a51b5beSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555.
24052a51b5beSmrg  postinstall_cmds='chmod 555 $lib'
24062a51b5beSmrg  ;;
240732b578d3Smrg
24082a51b5beSmrginterix[[3-9]]*)
24092a51b5beSmrg  version_type=linux
24102a51b5beSmrg  need_lib_prefix=no
24112a51b5beSmrg  need_version=no
24122a51b5beSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
24132a51b5beSmrg  soname_spec='${libname}${release}${shared_ext}$major'
24142a51b5beSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
24152a51b5beSmrg  shlibpath_var=LD_LIBRARY_PATH
24162a51b5beSmrg  shlibpath_overrides_runpath=no
24172a51b5beSmrg  hardcode_into_libs=yes
24182a51b5beSmrg  ;;
241932b578d3Smrg
24202a51b5beSmrgirix5* | irix6* | nonstopux*)
24212a51b5beSmrg  case $host_os in
24222a51b5beSmrg    nonstopux*) version_type=nonstopux ;;
24232a51b5beSmrg    *)
24242a51b5beSmrg	if test "$lt_cv_prog_gnu_ld" = yes; then
24252a51b5beSmrg		version_type=linux
24262a51b5beSmrg	else
24272a51b5beSmrg		version_type=irix
24282a51b5beSmrg	fi ;;
24292a51b5beSmrg  esac
24302a51b5beSmrg  need_lib_prefix=no
24312a51b5beSmrg  need_version=no
24322a51b5beSmrg  soname_spec='${libname}${release}${shared_ext}$major'
24332a51b5beSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
24342a51b5beSmrg  case $host_os in
24352a51b5beSmrg  irix5* | nonstopux*)
24362a51b5beSmrg    libsuff= shlibsuff=
24372a51b5beSmrg    ;;
24382a51b5beSmrg  *)
24392a51b5beSmrg    case $LD in # libtool.m4 will add one of these switches to LD
24402a51b5beSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
24412a51b5beSmrg      libsuff= shlibsuff= libmagic=32-bit;;
24422a51b5beSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
24432a51b5beSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
24442a51b5beSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
24452a51b5beSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
24462a51b5beSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
24472a51b5beSmrg    esac
24482a51b5beSmrg    ;;
24492a51b5beSmrg  esac
24502a51b5beSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
24512a51b5beSmrg  shlibpath_overrides_runpath=no
24522a51b5beSmrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
24532a51b5beSmrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
24542a51b5beSmrg  hardcode_into_libs=yes
24552a51b5beSmrg  ;;
245632b578d3Smrg
24572a51b5beSmrg# No shared lib support for Linux oldld, aout, or coff.
24582a51b5beSmrglinux*oldld* | linux*aout* | linux*coff*)
24592a51b5beSmrg  dynamic_linker=no
24602a51b5beSmrg  ;;
246132b578d3Smrg
24622a51b5beSmrg# This must be Linux ELF.
24631b12faf6Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
24642a51b5beSmrg  version_type=linux
24652a51b5beSmrg  need_lib_prefix=no
24662a51b5beSmrg  need_version=no
24672a51b5beSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
24682a51b5beSmrg  soname_spec='${libname}${release}${shared_ext}$major'
24692a51b5beSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
24702a51b5beSmrg  shlibpath_var=LD_LIBRARY_PATH
24712a51b5beSmrg  shlibpath_overrides_runpath=no
24721b12faf6Smrg  # Some binutils ld are patched to set DT_RUNPATH
24731b12faf6Smrg  save_LDFLAGS=$LDFLAGS
24741b12faf6Smrg  save_libdir=$libdir
24751b12faf6Smrg  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
24761b12faf6Smrg       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
24771b12faf6Smrg  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
24781b12faf6Smrg    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
24791b12faf6Smrg       [shlibpath_overrides_runpath=yes])])
24801b12faf6Smrg  LDFLAGS=$save_LDFLAGS
24811b12faf6Smrg  libdir=$save_libdir
24821b12faf6Smrg
24832a51b5beSmrg  # This implies no fast_install, which is unacceptable.
24842a51b5beSmrg  # Some rework will be needed to allow for fast_install
24852a51b5beSmrg  # before this can be enabled.
24862a51b5beSmrg  hardcode_into_libs=yes
248732b578d3Smrg
24882a51b5beSmrg  # Append ld.so.conf contents to the search path
24892a51b5beSmrg  if test -f /etc/ld.so.conf; then
24901b12faf6Smrg    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
24911b12faf6Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
24922a51b5beSmrg  fi
249332b578d3Smrg
24942a51b5beSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
24952a51b5beSmrg  # powerpc, because MkLinux only supported shared libraries with the
24962a51b5beSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
24972a51b5beSmrg  # most powerpc-linux boxes support dynamic linking these days and
24982a51b5beSmrg  # people can always --disable-shared, the test was removed, and we
24992a51b5beSmrg  # assume the GNU/Linux dynamic linker is in use.
25002a51b5beSmrg  dynamic_linker='GNU/Linux ld.so'
25012a51b5beSmrg  ;;
250232b578d3Smrg
25031b12faf6Smrgnetbsdelf*-gnu)
25041b12faf6Smrg  version_type=linux
25051b12faf6Smrg  need_lib_prefix=no
25061b12faf6Smrg  need_version=no
25071b12faf6Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
25081b12faf6Smrg  soname_spec='${libname}${release}${shared_ext}$major'
25091b12faf6Smrg  shlibpath_var=LD_LIBRARY_PATH
25101b12faf6Smrg  shlibpath_overrides_runpath=no
25111b12faf6Smrg  hardcode_into_libs=yes
25121b12faf6Smrg  dynamic_linker='NetBSD ld.elf_so'
25131b12faf6Smrg  ;;
25141b12faf6Smrg
25152a51b5beSmrgnetbsd*)
25162a51b5beSmrg  version_type=sunos
25172a51b5beSmrg  need_lib_prefix=no
25182a51b5beSmrg  need_version=no
25191b12faf6Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
25202a51b5beSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
25212a51b5beSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
25222a51b5beSmrg    dynamic_linker='NetBSD (a.out) ld.so'
25232a51b5beSmrg  else
25242a51b5beSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
25252a51b5beSmrg    soname_spec='${libname}${release}${shared_ext}$major'
25262a51b5beSmrg    dynamic_linker='NetBSD ld.elf_so'
25272a51b5beSmrg  fi
25282a51b5beSmrg  shlibpath_var=LD_LIBRARY_PATH
25292a51b5beSmrg  shlibpath_overrides_runpath=yes
25302a51b5beSmrg  hardcode_into_libs=yes
25312a51b5beSmrg  ;;
253232b578d3Smrg
25332a51b5beSmrgnewsos6)
25342a51b5beSmrg  version_type=linux
25352a51b5beSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25362a51b5beSmrg  shlibpath_var=LD_LIBRARY_PATH
25372a51b5beSmrg  shlibpath_overrides_runpath=yes
25382a51b5beSmrg  ;;
253932b578d3Smrg
25401b12faf6Smrg*nto* | *qnx*)
25411b12faf6Smrg  version_type=qnx
25422a51b5beSmrg  need_lib_prefix=no
25432a51b5beSmrg  need_version=no
25442a51b5beSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25452a51b5beSmrg  soname_spec='${libname}${release}${shared_ext}$major'
25462a51b5beSmrg  shlibpath_var=LD_LIBRARY_PATH
25471b12faf6Smrg  shlibpath_overrides_runpath=no
25481b12faf6Smrg  hardcode_into_libs=yes
25491b12faf6Smrg  dynamic_linker='ldqnx.so'
25502a51b5beSmrg  ;;
255132b578d3Smrg
25522a51b5beSmrgopenbsd*)
25532a51b5beSmrg  version_type=sunos
25542a51b5beSmrg  sys_lib_dlsearch_path_spec="/usr/lib"
25552a51b5beSmrg  need_lib_prefix=no
25562a51b5beSmrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
25572a51b5beSmrg  case $host_os in
25581b12faf6Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
25591b12faf6Smrg    *)				need_version=no  ;;
25602a51b5beSmrg  esac
25612a51b5beSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
25622a51b5beSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
25632a51b5beSmrg  shlibpath_var=LD_LIBRARY_PATH
25641b12faf6Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
25652a51b5beSmrg    case $host_os in
25662a51b5beSmrg      openbsd2.[[89]] | openbsd2.[[89]].*)
25672a51b5beSmrg	shlibpath_overrides_runpath=no
25682a51b5beSmrg	;;
25692a51b5beSmrg      *)
25702a51b5beSmrg	shlibpath_overrides_runpath=yes
25712a51b5beSmrg	;;
25722a51b5beSmrg      esac
25732a51b5beSmrg  else
25742a51b5beSmrg    shlibpath_overrides_runpath=yes
25752a51b5beSmrg  fi
25762a51b5beSmrg  ;;
257732b578d3Smrg
25782a51b5beSmrgos2*)
25792a51b5beSmrg  libname_spec='$name'
25802a51b5beSmrg  shrext_cmds=".dll"
25812a51b5beSmrg  need_lib_prefix=no
25822a51b5beSmrg  library_names_spec='$libname${shared_ext} $libname.a'
25832a51b5beSmrg  dynamic_linker='OS/2 ld.exe'
25842a51b5beSmrg  shlibpath_var=LIBPATH
25852a51b5beSmrg  ;;
258632b578d3Smrg
25872a51b5beSmrgosf3* | osf4* | osf5*)
25882a51b5beSmrg  version_type=osf
25892a51b5beSmrg  need_lib_prefix=no
25902a51b5beSmrg  need_version=no
25912a51b5beSmrg  soname_spec='${libname}${release}${shared_ext}$major'
25922a51b5beSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25932a51b5beSmrg  shlibpath_var=LD_LIBRARY_PATH
25942a51b5beSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
25952a51b5beSmrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
25962a51b5beSmrg  ;;
259732b578d3Smrg
25982a51b5beSmrgrdos*)
25992a51b5beSmrg  dynamic_linker=no
26002a51b5beSmrg  ;;
260132b578d3Smrg
26022a51b5beSmrgsolaris*)
26032a51b5beSmrg  version_type=linux
26042a51b5beSmrg  need_lib_prefix=no
26052a51b5beSmrg  need_version=no
26062a51b5beSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
26072a51b5beSmrg  soname_spec='${libname}${release}${shared_ext}$major'
26082a51b5beSmrg  shlibpath_var=LD_LIBRARY_PATH
26092a51b5beSmrg  shlibpath_overrides_runpath=yes
26102a51b5beSmrg  hardcode_into_libs=yes
26112a51b5beSmrg  # ldd complains unless libraries are executable
26122a51b5beSmrg  postinstall_cmds='chmod +x $lib'
26132a51b5beSmrg  ;;
261432b578d3Smrg
26152a51b5beSmrgsunos4*)
26162a51b5beSmrg  version_type=sunos
26172a51b5beSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
26182a51b5beSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
26192a51b5beSmrg  shlibpath_var=LD_LIBRARY_PATH
26202a51b5beSmrg  shlibpath_overrides_runpath=yes
26212a51b5beSmrg  if test "$with_gnu_ld" = yes; then
26222a51b5beSmrg    need_lib_prefix=no
26232a51b5beSmrg  fi
26242a51b5beSmrg  need_version=yes
26252a51b5beSmrg  ;;
262632b578d3Smrg
26272a51b5beSmrgsysv4 | sysv4.3*)
26282a51b5beSmrg  version_type=linux
26292a51b5beSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
26302a51b5beSmrg  soname_spec='${libname}${release}${shared_ext}$major'
26312a51b5beSmrg  shlibpath_var=LD_LIBRARY_PATH
26322a51b5beSmrg  case $host_vendor in
26332a51b5beSmrg    sni)
26342a51b5beSmrg      shlibpath_overrides_runpath=no
26352a51b5beSmrg      need_lib_prefix=no
26362a51b5beSmrg      runpath_var=LD_RUN_PATH
26372a51b5beSmrg      ;;
26382a51b5beSmrg    siemens)
26392a51b5beSmrg      need_lib_prefix=no
26402a51b5beSmrg      ;;
26412a51b5beSmrg    motorola)
26422a51b5beSmrg      need_lib_prefix=no
26432a51b5beSmrg      need_version=no
26442a51b5beSmrg      shlibpath_overrides_runpath=no
26452a51b5beSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
26462a51b5beSmrg      ;;
26472a51b5beSmrg  esac
26482a51b5beSmrg  ;;
264932b578d3Smrg
26502a51b5beSmrgsysv4*MP*)
26512a51b5beSmrg  if test -d /usr/nec ;then
26522a51b5beSmrg    version_type=linux
26532a51b5beSmrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
26542a51b5beSmrg    soname_spec='$libname${shared_ext}.$major'
26552a51b5beSmrg    shlibpath_var=LD_LIBRARY_PATH
26562a51b5beSmrg  fi
26572a51b5beSmrg  ;;
265832b578d3Smrg
26592a51b5beSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
26602a51b5beSmrg  version_type=freebsd-elf
26612a51b5beSmrg  need_lib_prefix=no
26622a51b5beSmrg  need_version=no
26632a51b5beSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
26642a51b5beSmrg  soname_spec='${libname}${release}${shared_ext}$major'
26652a51b5beSmrg  shlibpath_var=LD_LIBRARY_PATH
26661b12faf6Smrg  shlibpath_overrides_runpath=yes
26672a51b5beSmrg  hardcode_into_libs=yes
26682a51b5beSmrg  if test "$with_gnu_ld" = yes; then
26692a51b5beSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
26702a51b5beSmrg  else
26712a51b5beSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
26722a51b5beSmrg    case $host_os in
26732a51b5beSmrg      sco3.2v5*)
26742a51b5beSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2675d31dbc53Smrg	;;
2676d31dbc53Smrg    esac
26772a51b5beSmrg  fi
26782a51b5beSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
26792a51b5beSmrg  ;;
268032b578d3Smrg
26811b12faf6Smrgtpf*)
26821b12faf6Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
26832a51b5beSmrg  version_type=linux
26841b12faf6Smrg  need_lib_prefix=no
26851b12faf6Smrg  need_version=no
26862a51b5beSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
26871b12faf6Smrg  shlibpath_var=LD_LIBRARY_PATH
26881b12faf6Smrg  shlibpath_overrides_runpath=no
26891b12faf6Smrg  hardcode_into_libs=yes
26901b12faf6Smrg  ;;
26911b12faf6Smrg
26921b12faf6Smrguts4*)
26931b12faf6Smrg  version_type=linux
26941b12faf6Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
26951b12faf6Smrg  soname_spec='${libname}${release}${shared_ext}$major'
26962a51b5beSmrg  shlibpath_var=LD_LIBRARY_PATH
26972a51b5beSmrg  ;;
269832b578d3Smrg
26992a51b5beSmrg*)
27002a51b5beSmrg  dynamic_linker=no
27012a51b5beSmrg  ;;
27022a51b5beSmrgesac
27032a51b5beSmrgAC_MSG_RESULT([$dynamic_linker])
27042a51b5beSmrgtest "$dynamic_linker" = no && can_build_shared=no
270532b578d3Smrg
27062a51b5beSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
27072a51b5beSmrgif test "$GCC" = yes; then
27082a51b5beSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
27092a51b5beSmrgfi
271032b578d3Smrg
27111b12faf6Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
27121b12faf6Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
27131b12faf6Smrgfi
27141b12faf6Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
27151b12faf6Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
27162a51b5beSmrgfi
2717d31dbc53Smrg
27181b12faf6Smrg_LT_DECL([], [variables_saved_for_relink], [1],
27191b12faf6Smrg    [Variables whose values should be saved in libtool wrapper scripts and
27201b12faf6Smrg    restored at link time])
27211b12faf6Smrg_LT_DECL([], [need_lib_prefix], [0],
27221b12faf6Smrg    [Do we need the "lib" prefix for modules?])
27231b12faf6Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
27241b12faf6Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
27251b12faf6Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
27261b12faf6Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
27271b12faf6Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
27281b12faf6Smrg    [Is shlibpath searched before the hard-coded library search path?])
27291b12faf6Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
27301b12faf6Smrg_LT_DECL([], [library_names_spec], [1],
27311b12faf6Smrg    [[List of archive names.  First name is the real one, the rest are links.
27321b12faf6Smrg    The last name is the one that the linker finds with -lNAME]])
27331b12faf6Smrg_LT_DECL([], [soname_spec], [1],
27341b12faf6Smrg    [[The coded name of the library, if different from the real name]])
27351b12faf6Smrg_LT_DECL([], [postinstall_cmds], [2],
27361b12faf6Smrg    [Command to use after installation of a shared archive])
27371b12faf6Smrg_LT_DECL([], [postuninstall_cmds], [2],
27381b12faf6Smrg    [Command to use after uninstallation of a shared archive])
27391b12faf6Smrg_LT_DECL([], [finish_cmds], [2],
27401b12faf6Smrg    [Commands used to finish a libtool library installation in a directory])
27411b12faf6Smrg_LT_DECL([], [finish_eval], [1],
27421b12faf6Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
27431b12faf6Smrg    not shown]])
27441b12faf6Smrg_LT_DECL([], [hardcode_into_libs], [0],
27451b12faf6Smrg    [Whether we should hardcode library paths into libraries])
27461b12faf6Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
27471b12faf6Smrg    [Compile-time system search path for libraries])
27481b12faf6Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
27491b12faf6Smrg    [Run-time system search path for libraries])
27501b12faf6Smrg])# _LT_SYS_DYNAMIC_LINKER
27511b12faf6Smrg
27521b12faf6Smrg
27531b12faf6Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
27542a51b5beSmrg# --------------------------
27552a51b5beSmrg# find a file program which can recognize shared library
27561b12faf6SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
27571b12faf6Smrg[m4_require([_LT_DECL_EGREP])dnl
27582a51b5beSmrgAC_MSG_CHECKING([for $1])
27592a51b5beSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
27602a51b5beSmrg[case $MAGIC_CMD in
27612a51b5beSmrg[[\\/*] |  ?:[\\/]*])
27622a51b5beSmrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
276332b578d3Smrg  ;;
27642a51b5beSmrg*)
27652a51b5beSmrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
27662a51b5beSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
27672a51b5beSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
27682a51b5beSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
27692a51b5beSmrgdnl not every word.  This closes a longstanding sh security hole.
27701b12faf6Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
27712a51b5beSmrg  for ac_dir in $ac_dummy; do
27722a51b5beSmrg    IFS="$lt_save_ifs"
27732a51b5beSmrg    test -z "$ac_dir" && ac_dir=.
27742a51b5beSmrg    if test -f $ac_dir/$1; then
27752a51b5beSmrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
27762a51b5beSmrg      if test -n "$file_magic_test_file"; then
27772a51b5beSmrg	case $deplibs_check_method in
27782a51b5beSmrg	"file_magic "*)
27792a51b5beSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
27802a51b5beSmrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
27812a51b5beSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
27822a51b5beSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
27832a51b5beSmrg	    :
27842a51b5beSmrg	  else
27851b12faf6Smrg	    cat <<_LT_EOF 1>&2
278632b578d3Smrg
27872a51b5beSmrg*** Warning: the command libtool uses to detect shared libraries,
27882a51b5beSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
27892a51b5beSmrg*** The result is that libtool may fail to recognize shared libraries
27902a51b5beSmrg*** as such.  This will affect the creation of libtool libraries that
27912a51b5beSmrg*** depend on shared libraries, but programs linked with such libtool
27922a51b5beSmrg*** libraries will work regardless of this problem.  Nevertheless, you
27932a51b5beSmrg*** may want to report the problem to your system manager and/or to
27942a51b5beSmrg*** bug-libtool@gnu.org
279532b578d3Smrg
27961b12faf6Smrg_LT_EOF
27972a51b5beSmrg	  fi ;;
27982a51b5beSmrg	esac
27992a51b5beSmrg      fi
2800d31dbc53Smrg      break
2801d31dbc53Smrg    fi
2802d31dbc53Smrg  done
28032a51b5beSmrg  IFS="$lt_save_ifs"
28042a51b5beSmrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
28052a51b5beSmrg  ;;
28062a51b5beSmrgesac])
28072a51b5beSmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
28082a51b5beSmrgif test -n "$MAGIC_CMD"; then
28092a51b5beSmrg  AC_MSG_RESULT($MAGIC_CMD)
28102a51b5beSmrgelse
28112a51b5beSmrg  AC_MSG_RESULT(no)
2812d31dbc53Smrgfi
28131b12faf6Smrg_LT_DECL([], [MAGIC_CMD], [0],
28141b12faf6Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
28151b12faf6Smrg])# _LT_PATH_TOOL_PREFIX
281632b578d3Smrg
28171b12faf6Smrg# Old name:
28181b12faf6SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
28191b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
28201b12faf6Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
282132b578d3Smrg
28221b12faf6Smrg
28231b12faf6Smrg# _LT_PATH_MAGIC
28241b12faf6Smrg# --------------
28252a51b5beSmrg# find a file program which can recognize a shared library
28261b12faf6Smrgm4_defun([_LT_PATH_MAGIC],
28271b12faf6Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
28282a51b5beSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
28292a51b5beSmrg  if test -n "$ac_tool_prefix"; then
28301b12faf6Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
28312a51b5beSmrg  else
28322a51b5beSmrg    MAGIC_CMD=:
28332a51b5beSmrg  fi
28342a51b5beSmrgfi
28351b12faf6Smrg])# _LT_PATH_MAGIC
28362a51b5beSmrg
28372a51b5beSmrg
28381b12faf6Smrg# LT_PATH_LD
28392a51b5beSmrg# ----------
28402a51b5beSmrg# find the pathname to the GNU or non-GNU linker
28411b12faf6SmrgAC_DEFUN([LT_PATH_LD],
28421b12faf6Smrg[AC_REQUIRE([AC_PROG_CC])dnl
28432a51b5beSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
28442a51b5beSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
28451b12faf6Smrgm4_require([_LT_DECL_SED])dnl
28461b12faf6Smrgm4_require([_LT_DECL_EGREP])dnl
28471b12faf6Smrg
28481b12faf6SmrgAC_ARG_WITH([gnu-ld],
28491b12faf6Smrg    [AS_HELP_STRING([--with-gnu-ld],
28501b12faf6Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
28511b12faf6Smrg    [test "$withval" = no || with_gnu_ld=yes],
28521b12faf6Smrg    [with_gnu_ld=no])dnl
28531b12faf6Smrg
28542a51b5beSmrgac_prog=ld
28552a51b5beSmrgif test "$GCC" = yes; then
28562a51b5beSmrg  # Check if gcc -print-prog-name=ld gives a path.
28572a51b5beSmrg  AC_MSG_CHECKING([for ld used by $CC])
28582a51b5beSmrg  case $host in
28592a51b5beSmrg  *-*-mingw*)
28602a51b5beSmrg    # gcc leaves a trailing carriage return which upsets mingw
28612a51b5beSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
28622a51b5beSmrg  *)
28632a51b5beSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
28642a51b5beSmrg  esac
28652a51b5beSmrg  case $ac_prog in
28662a51b5beSmrg    # Accept absolute paths.
28672a51b5beSmrg    [[\\/]]* | ?:[[\\/]]*)
28682a51b5beSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
28692a51b5beSmrg      # Canonicalize the pathname of ld
28701b12faf6Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
28711b12faf6Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
28721b12faf6Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
28732a51b5beSmrg      done
28742a51b5beSmrg      test -z "$LD" && LD="$ac_prog"
28752a51b5beSmrg      ;;
28762a51b5beSmrg  "")
28772a51b5beSmrg    # If it fails, then pretend we aren't using GCC.
28782a51b5beSmrg    ac_prog=ld
28792a51b5beSmrg    ;;
28802a51b5beSmrg  *)
28812a51b5beSmrg    # If it is relative, then search for the first ld in PATH.
28822a51b5beSmrg    with_gnu_ld=unknown
28832a51b5beSmrg    ;;
28842a51b5beSmrg  esac
28852a51b5beSmrgelif test "$with_gnu_ld" = yes; then
28862a51b5beSmrg  AC_MSG_CHECKING([for GNU ld])
28872a51b5beSmrgelse
28882a51b5beSmrg  AC_MSG_CHECKING([for non-GNU ld])
28892a51b5beSmrgfi
28902a51b5beSmrgAC_CACHE_VAL(lt_cv_path_LD,
28912a51b5beSmrg[if test -z "$LD"; then
2892d31dbc53Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
28932a51b5beSmrg  for ac_dir in $PATH; do
2894d31dbc53Smrg    IFS="$lt_save_ifs"
28952a51b5beSmrg    test -z "$ac_dir" && ac_dir=.
28962a51b5beSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
28972a51b5beSmrg      lt_cv_path_LD="$ac_dir/$ac_prog"
28982a51b5beSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
28992a51b5beSmrg      # but apparently some variants of GNU ld only accept -v.
29002a51b5beSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
29012a51b5beSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
29022a51b5beSmrg      *GNU* | *'with BFD'*)
29032a51b5beSmrg	test "$with_gnu_ld" != no && break
29042a51b5beSmrg	;;
29052a51b5beSmrg      *)
29062a51b5beSmrg	test "$with_gnu_ld" != yes && break
29072a51b5beSmrg	;;
29082a51b5beSmrg      esac
2909d31dbc53Smrg    fi
2910d31dbc53Smrg  done
2911d31dbc53Smrg  IFS="$lt_save_ifs"
29122a51b5beSmrgelse
29132a51b5beSmrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
29142a51b5beSmrgfi])
29152a51b5beSmrgLD="$lt_cv_path_LD"
29162a51b5beSmrgif test -n "$LD"; then
29172a51b5beSmrg  AC_MSG_RESULT($LD)
29182a51b5beSmrgelse
29192a51b5beSmrg  AC_MSG_RESULT(no)
29202a51b5beSmrgfi
29212a51b5beSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
29221b12faf6Smrg_LT_PATH_LD_GNU
29231b12faf6SmrgAC_SUBST([LD])
292432b578d3Smrg
29251b12faf6Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
29261b12faf6Smrg])# LT_PATH_LD
292732b578d3Smrg
29281b12faf6Smrg# Old names:
29291b12faf6SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
29301b12faf6SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
29311b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
29321b12faf6Smrgdnl AC_DEFUN([AM_PROG_LD], [])
29331b12faf6Smrgdnl AC_DEFUN([AC_PROG_LD], [])
29341b12faf6Smrg
29351b12faf6Smrg
29361b12faf6Smrg# _LT_PATH_LD_GNU
29371b12faf6Smrg#- --------------
29381b12faf6Smrgm4_defun([_LT_PATH_LD_GNU],
29391b12faf6Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
29402a51b5beSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
29412a51b5beSmrgcase `$LD -v 2>&1 </dev/null` in
29422a51b5beSmrg*GNU* | *'with BFD'*)
29432a51b5beSmrg  lt_cv_prog_gnu_ld=yes
29442a51b5beSmrg  ;;
29452a51b5beSmrg*)
29462a51b5beSmrg  lt_cv_prog_gnu_ld=no
29472a51b5beSmrg  ;;
29482a51b5beSmrgesac])
29492a51b5beSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
29501b12faf6Smrg])# _LT_PATH_LD_GNU
295132b578d3Smrg
295232b578d3Smrg
29531b12faf6Smrg# _LT_CMD_RELOAD
29541b12faf6Smrg# --------------
29552a51b5beSmrg# find reload flag for linker
29562a51b5beSmrg#   -- PORTME Some linkers may need a different reload flag.
29571b12faf6Smrgm4_defun([_LT_CMD_RELOAD],
29582a51b5beSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
29592a51b5beSmrg  lt_cv_ld_reload_flag,
29602a51b5beSmrg  [lt_cv_ld_reload_flag='-r'])
29612a51b5beSmrgreload_flag=$lt_cv_ld_reload_flag
29622a51b5beSmrgcase $reload_flag in
29632a51b5beSmrg"" | " "*) ;;
29642a51b5beSmrg*) reload_flag=" $reload_flag" ;;
29652a51b5beSmrgesac
29662a51b5beSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
29672a51b5beSmrgcase $host_os in
29682a51b5beSmrg  darwin*)
29692a51b5beSmrg    if test "$GCC" = yes; then
29702a51b5beSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
29712a51b5beSmrg    else
29722a51b5beSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
29732a51b5beSmrg    fi
29742a51b5beSmrg    ;;
29752a51b5beSmrgesac
29761b12faf6Smrg_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
29771b12faf6Smrg_LT_DECL([], [reload_cmds], [2])dnl
29781b12faf6Smrg])# _LT_CMD_RELOAD
297932b578d3Smrg
298032b578d3Smrg
29811b12faf6Smrg# _LT_CHECK_MAGIC_METHOD
29821b12faf6Smrg# ----------------------
29832a51b5beSmrg# how to check for library dependencies
29842a51b5beSmrg#  -- PORTME fill in with the dynamic library characteristics
29851b12faf6Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
29861b12faf6Smrg[m4_require([_LT_DECL_EGREP])
29871b12faf6Smrgm4_require([_LT_DECL_OBJDUMP])
29881b12faf6SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
29892a51b5beSmrglt_cv_deplibs_check_method,
29902a51b5beSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
29912a51b5beSmrglt_cv_file_magic_test_file=
29922a51b5beSmrglt_cv_deplibs_check_method='unknown'
29932a51b5beSmrg# Need to set the preceding variable on all platforms that support
29942a51b5beSmrg# interlibrary dependencies.
29952a51b5beSmrg# 'none' -- dependencies not supported.
29962a51b5beSmrg# `unknown' -- same as none, but documents that we really don't know.
29972a51b5beSmrg# 'pass_all' -- all dependencies passed with no checks.
29982a51b5beSmrg# 'test_compile' -- check by making test program.
29992a51b5beSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
30002a51b5beSmrg# which responds to the $file_magic_cmd with a given extended regex.
30012a51b5beSmrg# If you have `file' or equivalent on your system and you're not sure
30022a51b5beSmrg# whether `pass_all' will *always* work, you probably want this one.
300332b578d3Smrg
30042a51b5beSmrgcase $host_os in
30052a51b5beSmrgaix[[4-9]]*)
30062a51b5beSmrg  lt_cv_deplibs_check_method=pass_all
30072a51b5beSmrg  ;;
300832b578d3Smrg
30092a51b5beSmrgbeos*)
30102a51b5beSmrg  lt_cv_deplibs_check_method=pass_all
3011d31dbc53Smrg  ;;
30122a51b5beSmrg
30132a51b5beSmrgbsdi[[45]]*)
30142a51b5beSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
30152a51b5beSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
30162a51b5beSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
3017d31dbc53Smrg  ;;
301832b578d3Smrg
30192a51b5beSmrgcygwin*)
30202a51b5beSmrg  # func_win32_libid is a shell function defined in ltmain.sh
30212a51b5beSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
30222a51b5beSmrg  lt_cv_file_magic_cmd='func_win32_libid'
3023d31dbc53Smrg  ;;
302432b578d3Smrg
30252a51b5beSmrgmingw* | pw32*)
30262a51b5beSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
30272a51b5beSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
30282a51b5beSmrg  # unless we find 'file', for example because we are cross-compiling.
30292a51b5beSmrg  if ( file / ) >/dev/null 2>&1; then
30302a51b5beSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
30312a51b5beSmrg    lt_cv_file_magic_cmd='func_win32_libid'
30322a51b5beSmrg  else
30332a51b5beSmrg    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
30342a51b5beSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
3035d31dbc53Smrg  fi
3036d31dbc53Smrg  ;;
30372a51b5beSmrg
30381b12faf6Smrgcegcc)
30391b12faf6Smrg  # use the weaker test based on 'objdump'. See mingw*.
30401b12faf6Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
30411b12faf6Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
30421b12faf6Smrg  ;;
30431b12faf6Smrg
30442a51b5beSmrgdarwin* | rhapsody*)
30452a51b5beSmrg  lt_cv_deplibs_check_method=pass_all
30462a51b5beSmrg  ;;
30472a51b5beSmrg
30482a51b5beSmrgfreebsd* | dragonfly*)
30491b12faf6Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
30502a51b5beSmrg    case $host_cpu in
30512a51b5beSmrg    i*86 )
30522a51b5beSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
30532a51b5beSmrg      # Let's accept both of them until this is cleared up.
30542a51b5beSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
30552a51b5beSmrg      lt_cv_file_magic_cmd=/usr/bin/file
30562a51b5beSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3057d31dbc53Smrg      ;;
3058d31dbc53Smrg    esac
30592a51b5beSmrg  else
30602a51b5beSmrg    lt_cv_deplibs_check_method=pass_all
3061d31dbc53Smrg  fi
3062d31dbc53Smrg  ;;
306332b578d3Smrg
30642a51b5beSmrggnu*)
30652a51b5beSmrg  lt_cv_deplibs_check_method=pass_all
3066d31dbc53Smrg  ;;
306732b578d3Smrg
30682a51b5beSmrghpux10.20* | hpux11*)
30692a51b5beSmrg  lt_cv_file_magic_cmd=/usr/bin/file
30702a51b5beSmrg  case $host_cpu in
30712a51b5beSmrg  ia64*)
30722a51b5beSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
30732a51b5beSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
30742a51b5beSmrg    ;;
30752a51b5beSmrg  hppa*64*)
30762a51b5beSmrg    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
30772a51b5beSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
30782a51b5beSmrg    ;;
30792a51b5beSmrg  *)
30802a51b5beSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
30812a51b5beSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
30822a51b5beSmrg    ;;
30832a51b5beSmrg  esac
30842a51b5beSmrg  ;;
308532b578d3Smrg
30862a51b5beSmrginterix[[3-9]]*)
30872a51b5beSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
30882a51b5beSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
30892a51b5beSmrg  ;;
309032b578d3Smrg
30912a51b5beSmrgirix5* | irix6* | nonstopux*)
30922a51b5beSmrg  case $LD in
30932a51b5beSmrg  *-32|*"-32 ") libmagic=32-bit;;
30942a51b5beSmrg  *-n32|*"-n32 ") libmagic=N32;;
30952a51b5beSmrg  *-64|*"-64 ") libmagic=64-bit;;
30962a51b5beSmrg  *) libmagic=never-match;;
30972a51b5beSmrg  esac
30982a51b5beSmrg  lt_cv_deplibs_check_method=pass_all
30992a51b5beSmrg  ;;
310032b578d3Smrg
31012a51b5beSmrg# This must be Linux ELF.
31021b12faf6Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
31032a51b5beSmrg  lt_cv_deplibs_check_method=pass_all
31042a51b5beSmrg  ;;
310532b578d3Smrg
31061b12faf6Smrgnetbsd* | netbsdelf*-gnu)
31071b12faf6Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
31082a51b5beSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
31092a51b5beSmrg  else
31102a51b5beSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
31112a51b5beSmrg  fi
31122a51b5beSmrg  ;;
311332b578d3Smrg
31142a51b5beSmrgnewos6*)
31152a51b5beSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
31162a51b5beSmrg  lt_cv_file_magic_cmd=/usr/bin/file
31172a51b5beSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
31182a51b5beSmrg  ;;
311932b578d3Smrg
31201b12faf6Smrg*nto* | *qnx*)
31211b12faf6Smrg  lt_cv_deplibs_check_method=pass_all
31222a51b5beSmrg  ;;
312332b578d3Smrg
31242a51b5beSmrgopenbsd*)
31251b12faf6Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
31262a51b5beSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
31272a51b5beSmrg  else
31282a51b5beSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
31292a51b5beSmrg  fi
31302a51b5beSmrg  ;;
313132b578d3Smrg
31322a51b5beSmrgosf3* | osf4* | osf5*)
31332a51b5beSmrg  lt_cv_deplibs_check_method=pass_all
31342a51b5beSmrg  ;;
313532b578d3Smrg
31362a51b5beSmrgrdos*)
31372a51b5beSmrg  lt_cv_deplibs_check_method=pass_all
31382a51b5beSmrg  ;;
3139d31dbc53Smrg
31402a51b5beSmrgsolaris*)
31412a51b5beSmrg  lt_cv_deplibs_check_method=pass_all
31422a51b5beSmrg  ;;
3143d31dbc53Smrg
31441b12faf6Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
31451b12faf6Smrg  lt_cv_deplibs_check_method=pass_all
31461b12faf6Smrg  ;;
31471b12faf6Smrg
31482a51b5beSmrgsysv4 | sysv4.3*)
31492a51b5beSmrg  case $host_vendor in
31502a51b5beSmrg  motorola)
31512a51b5beSmrg    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]]'
31522a51b5beSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
315332b578d3Smrg    ;;
31542a51b5beSmrg  ncr)
31552a51b5beSmrg    lt_cv_deplibs_check_method=pass_all
315632b578d3Smrg    ;;
31572a51b5beSmrg  sequent)
31582a51b5beSmrg    lt_cv_file_magic_cmd='/bin/file'
31592a51b5beSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
316032b578d3Smrg    ;;
31612a51b5beSmrg  sni)
31622a51b5beSmrg    lt_cv_file_magic_cmd='/bin/file'
31632a51b5beSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
31642a51b5beSmrg    lt_cv_file_magic_test_file=/lib/libc.so
316532b578d3Smrg    ;;
31662a51b5beSmrg  siemens)
31672a51b5beSmrg    lt_cv_deplibs_check_method=pass_all
316832b578d3Smrg    ;;
31692a51b5beSmrg  pc)
31702a51b5beSmrg    lt_cv_deplibs_check_method=pass_all
3171d31dbc53Smrg    ;;
3172d31dbc53Smrg  esac
31732a51b5beSmrg  ;;
31742a51b5beSmrg
31751b12faf6Smrgtpf*)
31762a51b5beSmrg  lt_cv_deplibs_check_method=pass_all
31772a51b5beSmrg  ;;
31782a51b5beSmrgesac
3179d31dbc53Smrg])
31802a51b5beSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
31812a51b5beSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
31822a51b5beSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
31831b12faf6Smrg
31841b12faf6Smrg_LT_DECL([], [deplibs_check_method], [1],
31851b12faf6Smrg    [Method to check whether dependent libraries are shared objects])
31861b12faf6Smrg_LT_DECL([], [file_magic_cmd], [1],
31871b12faf6Smrg    [Command to use when deplibs_check_method == "file_magic"])
31881b12faf6Smrg])# _LT_CHECK_MAGIC_METHOD
318932b578d3Smrg
319032b578d3Smrg
31911b12faf6Smrg# LT_PATH_NM
31922a51b5beSmrg# ----------
31931b12faf6Smrg# find the pathname to a BSD- or MS-compatible name lister
31941b12faf6SmrgAC_DEFUN([LT_PATH_NM],
31951b12faf6Smrg[AC_REQUIRE([AC_PROG_CC])dnl
31961b12faf6SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
31972a51b5beSmrg[if test -n "$NM"; then
31982a51b5beSmrg  # Let the user override the test.
31992a51b5beSmrg  lt_cv_path_NM="$NM"
32002a51b5beSmrgelse
32012a51b5beSmrg  lt_nm_to_check="${ac_tool_prefix}nm"
32022a51b5beSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
32032a51b5beSmrg    lt_nm_to_check="$lt_nm_to_check nm"
32042a51b5beSmrg  fi
32052a51b5beSmrg  for lt_tmp_nm in $lt_nm_to_check; do
32062a51b5beSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
32072a51b5beSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
32082a51b5beSmrg      IFS="$lt_save_ifs"
32092a51b5beSmrg      test -z "$ac_dir" && ac_dir=.
32102a51b5beSmrg      tmp_nm="$ac_dir/$lt_tmp_nm"
32112a51b5beSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
32122a51b5beSmrg	# Check to see if the nm accepts a BSD-compat flag.
32132a51b5beSmrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
32142a51b5beSmrg	#   nm: unknown option "B" ignored
32152a51b5beSmrg	# Tru64's nm complains that /dev/null is an invalid object file
32162a51b5beSmrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
32172a51b5beSmrg	*/dev/null* | *'Invalid file or object type'*)
32182a51b5beSmrg	  lt_cv_path_NM="$tmp_nm -B"
32192a51b5beSmrg	  break
32202a51b5beSmrg	  ;;
32212a51b5beSmrg	*)
32222a51b5beSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
32232a51b5beSmrg	  */dev/null*)
32242a51b5beSmrg	    lt_cv_path_NM="$tmp_nm -p"
32252a51b5beSmrg	    break
32262a51b5beSmrg	    ;;
32272a51b5beSmrg	  *)
32282a51b5beSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
32292a51b5beSmrg	    continue # so that we can try to find one that supports BSD flags
32302a51b5beSmrg	    ;;
32312a51b5beSmrg	  esac
32322a51b5beSmrg	  ;;
32332a51b5beSmrg	esac
32342a51b5beSmrg      fi
32352a51b5beSmrg    done
32362a51b5beSmrg    IFS="$lt_save_ifs"
32372a51b5beSmrg  done
32381b12faf6Smrg  : ${lt_cv_path_NM=no}
32392a51b5beSmrgfi])
32401b12faf6Smrgif test "$lt_cv_path_NM" != "no"; then
32411b12faf6Smrg  NM="$lt_cv_path_NM"
32421b12faf6Smrgelse
32431b12faf6Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
32441b12faf6Smrg  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
32451b12faf6Smrg  AC_SUBST([DUMPBIN])
32461b12faf6Smrg  if test "$DUMPBIN" != ":"; then
32471b12faf6Smrg    NM="$DUMPBIN"
32481b12faf6Smrg  fi
32491b12faf6Smrgfi
32501b12faf6Smrgtest -z "$NM" && NM=nm
32511b12faf6SmrgAC_SUBST([NM])
32521b12faf6Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
32531b12faf6Smrg
32541b12faf6SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
32551b12faf6Smrg  [lt_cv_nm_interface="BSD nm"
32561b12faf6Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
32571b12faf6Smrg  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
32581b12faf6Smrg  (eval "$ac_compile" 2>conftest.err)
32591b12faf6Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
32601b12faf6Smrg  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
32611b12faf6Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
32621b12faf6Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
32631b12faf6Smrg  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
32641b12faf6Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
32651b12faf6Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
32661b12faf6Smrg    lt_cv_nm_interface="MS dumpbin"
32671b12faf6Smrg  fi
32681b12faf6Smrg  rm -f conftest*])
32691b12faf6Smrg])# LT_PATH_NM
327032b578d3Smrg
32711b12faf6Smrg# Old names:
32721b12faf6SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
32731b12faf6SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
32741b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
32751b12faf6Smrgdnl AC_DEFUN([AM_PROG_NM], [])
32761b12faf6Smrgdnl AC_DEFUN([AC_PROG_NM], [])
327732b578d3Smrg
32781b12faf6Smrg
32791b12faf6Smrg# LT_LIB_M
32801b12faf6Smrg# --------
32812a51b5beSmrg# check for math library
32821b12faf6SmrgAC_DEFUN([LT_LIB_M],
32832a51b5beSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
32842a51b5beSmrgLIBM=
32852a51b5beSmrgcase $host in
32862a51b5beSmrg*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
32872a51b5beSmrg  # These system don't have libm, or don't need it
32882a51b5beSmrg  ;;
32892a51b5beSmrg*-ncr-sysv4.3*)
32902a51b5beSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
32912a51b5beSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
32922a51b5beSmrg  ;;
32932a51b5beSmrg*)
32942a51b5beSmrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
32952a51b5beSmrg  ;;
32962a51b5beSmrgesac
32971b12faf6SmrgAC_SUBST([LIBM])
32981b12faf6Smrg])# LT_LIB_M
329932b578d3Smrg
33001b12faf6Smrg# Old name:
33011b12faf6SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
33021b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
33031b12faf6Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
330432b578d3Smrg
330532b578d3Smrg
33061b12faf6Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
33071b12faf6Smrg# -------------------------------
33081b12faf6Smrgm4_defun([_LT_COMPILER_NO_RTTI],
33091b12faf6Smrg[m4_require([_LT_TAG_COMPILER])dnl
331032b578d3Smrg
33111b12faf6Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
331232b578d3Smrg
33131b12faf6Smrgif test "$GCC" = yes; then
33141b12faf6Smrg  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
33152a51b5beSmrg
33161b12faf6Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
33171b12faf6Smrg    lt_cv_prog_compiler_rtti_exceptions,
33181b12faf6Smrg    [-fno-rtti -fno-exceptions], [],
33191b12faf6Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3320d31dbc53Smrgfi
33211b12faf6Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
33221b12faf6Smrg	[Compiler flag to turn off builtin functions])
33231b12faf6Smrg])# _LT_COMPILER_NO_RTTI
332432b578d3Smrg
332532b578d3Smrg
33261b12faf6Smrg# _LT_CMD_GLOBAL_SYMBOLS
33271b12faf6Smrg# ----------------------
33281b12faf6Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
33291b12faf6Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
33301b12faf6SmrgAC_REQUIRE([AC_PROG_CC])dnl
33311b12faf6SmrgAC_REQUIRE([LT_PATH_NM])dnl
33321b12faf6SmrgAC_REQUIRE([LT_PATH_LD])dnl
33331b12faf6Smrgm4_require([_LT_DECL_SED])dnl
33341b12faf6Smrgm4_require([_LT_DECL_EGREP])dnl
33351b12faf6Smrgm4_require([_LT_TAG_COMPILER])dnl
333632b578d3Smrg
33371b12faf6Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
33381b12faf6SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
33391b12faf6SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
33401b12faf6Smrg[
33411b12faf6Smrg# These are sane defaults that work on at least a few old systems.
33421b12faf6Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
334332b578d3Smrg
33441b12faf6Smrg# Character class describing NM global symbol codes.
33451b12faf6Smrgsymcode='[[BCDEGRST]]'
334632b578d3Smrg
33471b12faf6Smrg# Regexp to match symbols that can be accessed directly from C.
33481b12faf6Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
334932b578d3Smrg
33501b12faf6Smrg# Define system-specific variables.
33512a51b5beSmrgcase $host_os in
33521b12faf6Smrgaix*)
33531b12faf6Smrg  symcode='[[BCDT]]'
33542a51b5beSmrg  ;;
33551b12faf6Smrgcygwin* | mingw* | pw32* | cegcc*)
33561b12faf6Smrg  symcode='[[ABCDGISTW]]'
33571b12faf6Smrg  ;;
33581b12faf6Smrghpux*)
33591b12faf6Smrg  if test "$host_cpu" = ia64; then
33601b12faf6Smrg    symcode='[[ABCDEGRST]]'
3361d31dbc53Smrg  fi
33621b12faf6Smrg  ;;
33631b12faf6Smrgirix* | nonstopux*)
33641b12faf6Smrg  symcode='[[BCDEGRST]]'
33651b12faf6Smrg  ;;
33661b12faf6Smrgosf*)
33671b12faf6Smrg  symcode='[[BCDEGQRST]]'
33681b12faf6Smrg  ;;
33691b12faf6Smrgsolaris*)
33701b12faf6Smrg  symcode='[[BDRT]]'
33711b12faf6Smrg  ;;
33721b12faf6Smrgsco3.2v5*)
33731b12faf6Smrg  symcode='[[DT]]'
33741b12faf6Smrg  ;;
33751b12faf6Smrgsysv4.2uw2*)
33761b12faf6Smrg  symcode='[[DT]]'
33771b12faf6Smrg  ;;
33781b12faf6Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
33791b12faf6Smrg  symcode='[[ABDT]]'
33801b12faf6Smrg  ;;
33811b12faf6Smrgsysv4)
33821b12faf6Smrg  symcode='[[DFNSTU]]'
33831b12faf6Smrg  ;;
33842a51b5beSmrgesac
338532b578d3Smrg
33861b12faf6Smrg# If we're using GNU nm, then use its standard symbol codes.
33871b12faf6Smrgcase `$NM -V 2>&1` in
33881b12faf6Smrg*GNU* | *'with BFD'*)
33891b12faf6Smrg  symcode='[[ABCDGIRSTW]]' ;;
33901b12faf6Smrgesac
339132b578d3Smrg
33921b12faf6Smrg# Transform an extracted symbol line into a proper C declaration.
33931b12faf6Smrg# Some systems (esp. on ia64) link data and code symbols differently,
33941b12faf6Smrg# so use this general approach.
33951b12faf6Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3396d31dbc53Smrg
33971b12faf6Smrg# Transform an extracted symbol line into symbol name and symbol address
33981b12faf6Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
33991b12faf6Smrglt_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'"
34002a51b5beSmrg
34011b12faf6Smrg# Handle CRLF in mingw tool chain
34021b12faf6Smrgopt_cr=
34031b12faf6Smrgcase $build_os in
34041b12faf6Smrgmingw*)
34051b12faf6Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
34061b12faf6Smrg  ;;
34071b12faf6Smrgesac
34082a51b5beSmrg
34091b12faf6Smrg# Try without a prefix underscore, then with it.
34101b12faf6Smrgfor ac_symprfx in "" "_"; do
34112a51b5beSmrg
34121b12faf6Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
34131b12faf6Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
34142a51b5beSmrg
34151b12faf6Smrg  # Write the raw and C identifiers.
34161b12faf6Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
34171b12faf6Smrg    # Fake it for dumpbin and say T for any non-static function
34181b12faf6Smrg    # and D for any global variable.
34191b12faf6Smrg    # Also find C++ and __fastcall symbols from MSVC++,
34201b12faf6Smrg    # which start with @ or ?.
34211b12faf6Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
34221b12faf6Smrg"     {last_section=section; section=\$ 3};"\
34231b12faf6Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
34241b12faf6Smrg"     \$ 0!~/External *\|/{next};"\
34251b12faf6Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
34261b12faf6Smrg"     {if(hide[section]) next};"\
34271b12faf6Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
34281b12faf6Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
34291b12faf6Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
34301b12faf6Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
34311b12faf6Smrg"     ' prfx=^$ac_symprfx]"
34321b12faf6Smrg  else
34331b12faf6Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
34341b12faf6Smrg  fi
34352a51b5beSmrg
34361b12faf6Smrg  # Check to see that the pipe works correctly.
34371b12faf6Smrg  pipe_works=no
34382a51b5beSmrg
34391b12faf6Smrg  rm -f conftest*
34401b12faf6Smrg  cat > conftest.$ac_ext <<_LT_EOF
34411b12faf6Smrg#ifdef __cplusplus
34421b12faf6Smrgextern "C" {
34431b12faf6Smrg#endif
34441b12faf6Smrgchar nm_test_var;
34451b12faf6Smrgvoid nm_test_func(void);
34461b12faf6Smrgvoid nm_test_func(void){}
34471b12faf6Smrg#ifdef __cplusplus
34481b12faf6Smrg}
34491b12faf6Smrg#endif
34501b12faf6Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
34511b12faf6Smrg_LT_EOF
345232b578d3Smrg
34531b12faf6Smrg  if AC_TRY_EVAL(ac_compile); then
34541b12faf6Smrg    # Now try to grab the symbols.
34551b12faf6Smrg    nlist=conftest.nm
34561b12faf6Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
34571b12faf6Smrg      # Try sorting and uniquifying the output.
34581b12faf6Smrg      if sort "$nlist" | uniq > "$nlist"T; then
34591b12faf6Smrg	mv -f "$nlist"T "$nlist"
34601b12faf6Smrg      else
34611b12faf6Smrg	rm -f "$nlist"T
34621b12faf6Smrg      fi
346332b578d3Smrg
34641b12faf6Smrg      # Make sure that we snagged all the symbols we need.
34651b12faf6Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
34661b12faf6Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
34671b12faf6Smrg	  cat <<_LT_EOF > conftest.$ac_ext
34681b12faf6Smrg#ifdef __cplusplus
34691b12faf6Smrgextern "C" {
34701b12faf6Smrg#endif
347132b578d3Smrg
34721b12faf6Smrg_LT_EOF
34731b12faf6Smrg	  # Now generate the symbol file.
34741b12faf6Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3475d31dbc53Smrg
34761b12faf6Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
3477d31dbc53Smrg
34781b12faf6Smrg/* The mapping between symbol names and symbols.  */
34791b12faf6Smrgconst struct {
34801b12faf6Smrg  const char *name;
34811b12faf6Smrg  void       *address;
34821b12faf6Smrg}
34831b12faf6Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
34841b12faf6Smrg{
34851b12faf6Smrg  { "@PROGRAM@", (void *) 0 },
34861b12faf6Smrg_LT_EOF
34871b12faf6Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
34881b12faf6Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
34891b12faf6Smrg  {0, (void *) 0}
34901b12faf6Smrg};
34912a51b5beSmrg
34921b12faf6Smrg/* This works around a problem in FreeBSD linker */
34931b12faf6Smrg#ifdef FREEBSD_WORKAROUND
34941b12faf6Smrgstatic const void *lt_preloaded_setup() {
34951b12faf6Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
34961b12faf6Smrg}
34971b12faf6Smrg#endif
34982a51b5beSmrg
34991b12faf6Smrg#ifdef __cplusplus
35001b12faf6Smrg}
35011b12faf6Smrg#endif
35021b12faf6Smrg_LT_EOF
35031b12faf6Smrg	  # Now try linking the two files.
35041b12faf6Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
35051b12faf6Smrg	  lt_save_LIBS="$LIBS"
35061b12faf6Smrg	  lt_save_CFLAGS="$CFLAGS"
35071b12faf6Smrg	  LIBS="conftstm.$ac_objext"
35081b12faf6Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
35091b12faf6Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
35101b12faf6Smrg	    pipe_works=yes
35111b12faf6Smrg	  fi
35121b12faf6Smrg	  LIBS="$lt_save_LIBS"
35131b12faf6Smrg	  CFLAGS="$lt_save_CFLAGS"
35141b12faf6Smrg	else
35151b12faf6Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
35161b12faf6Smrg	fi
35171b12faf6Smrg      else
35181b12faf6Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
35191b12faf6Smrg      fi
3520d31dbc53Smrg    else
35211b12faf6Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3522d31dbc53Smrg    fi
35232a51b5beSmrg  else
35241b12faf6Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
35251b12faf6Smrg    cat conftest.$ac_ext >&5
35262a51b5beSmrg  fi
35271b12faf6Smrg  rm -rf conftest* conftst*
352832b578d3Smrg
35291b12faf6Smrg  # Do not use the global_symbol_pipe unless it works.
35301b12faf6Smrg  if test "$pipe_works" = yes; then
35311b12faf6Smrg    break
35321b12faf6Smrg  else
35331b12faf6Smrg    lt_cv_sys_global_symbol_pipe=
35341b12faf6Smrg  fi
35351b12faf6Smrgdone
35361b12faf6Smrg])
35371b12faf6Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
35381b12faf6Smrg  lt_cv_sys_global_symbol_to_cdecl=
35391b12faf6Smrgfi
35401b12faf6Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
35411b12faf6Smrg  AC_MSG_RESULT(failed)
35422a51b5beSmrgelse
35431b12faf6Smrg  AC_MSG_RESULT(ok)
35442a51b5beSmrgfi
354532b578d3Smrg
35461b12faf6Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
35471b12faf6Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
35481b12faf6Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
35491b12faf6Smrg    [Transform the output of nm in a proper C declaration])
35501b12faf6Smrg_LT_DECL([global_symbol_to_c_name_address],
35511b12faf6Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
35521b12faf6Smrg    [Transform the output of nm in a C name address pair])
35531b12faf6Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
35541b12faf6Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
35551b12faf6Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
35561b12faf6Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
355732b578d3Smrg
355832b578d3Smrg
35591b12faf6Smrg# _LT_COMPILER_PIC([TAGNAME])
35601b12faf6Smrg# ---------------------------
35611b12faf6Smrgm4_defun([_LT_COMPILER_PIC],
35621b12faf6Smrg[m4_require([_LT_TAG_COMPILER])dnl
35631b12faf6Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
35641b12faf6Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
35651b12faf6Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
356632b578d3Smrg
35671b12faf6SmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
35681b12faf6Smrgm4_if([$1], [CXX], [
35691b12faf6Smrg  # C++ specific cases for pic, static, wl, etc.
35701b12faf6Smrg  if test "$GXX" = yes; then
35711b12faf6Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
35721b12faf6Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
357332b578d3Smrg
35741b12faf6Smrg    case $host_os in
35751b12faf6Smrg    aix*)
35761b12faf6Smrg      # All AIX code is PIC.
35772a51b5beSmrg      if test "$host_cpu" = ia64; then
35781b12faf6Smrg	# AIX 5 now supports IA64 processor
35791b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
35802a51b5beSmrg      fi
358132b578d3Smrg      ;;
358232b578d3Smrg
35831b12faf6Smrg    amigaos*)
35842a51b5beSmrg      case $host_cpu in
35851b12faf6Smrg      powerpc)
35861b12faf6Smrg            # see comment about AmigaOS4 .so support
35871b12faf6Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
35881b12faf6Smrg        ;;
35891b12faf6Smrg      m68k)
35901b12faf6Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
35911b12faf6Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
35921b12faf6Smrg            # like `-m68040'.
35931b12faf6Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
35942a51b5beSmrg        ;;
35952a51b5beSmrg      esac
35962a51b5beSmrg      ;;
35971b12faf6Smrg
35981b12faf6Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
35991b12faf6Smrg      # PIC is the default for these OSes.
36001b12faf6Smrg      ;;
36011b12faf6Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
36021b12faf6Smrg      # This hack is so that the source file can tell whether it is being
36031b12faf6Smrg      # built for inclusion in a dll (and should export symbols for example).
36041b12faf6Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
36051b12faf6Smrg      # (--disable-auto-import) libraries
36061b12faf6Smrg      m4_if([$1], [GCJ], [],
36071b12faf6Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
36081b12faf6Smrg      ;;
36091b12faf6Smrg    darwin* | rhapsody*)
36101b12faf6Smrg      # PIC is the default on this platform
36111b12faf6Smrg      # Common symbols not allowed in MH_DYLIB files
36121b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
36131b12faf6Smrg      ;;
36141b12faf6Smrg    *djgpp*)
36151b12faf6Smrg      # DJGPP does not support shared libraries at all
36161b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
36171b12faf6Smrg      ;;
36181b12faf6Smrg    interix[[3-9]]*)
36191b12faf6Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
36201b12faf6Smrg      # Instead, we relocate shared libraries at runtime.
36211b12faf6Smrg      ;;
36221b12faf6Smrg    sysv4*MP*)
36231b12faf6Smrg      if test -d /usr/nec; then
36241b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
36251b12faf6Smrg      fi
36261b12faf6Smrg      ;;
36271b12faf6Smrg    hpux*)
36281b12faf6Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
36291b12faf6Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
36301b12faf6Smrg      # sets the default TLS model and affects inlining.
36311b12faf6Smrg      case $host_cpu in
36321b12faf6Smrg      hppa*64*)
36331b12faf6Smrg	;;
36341b12faf6Smrg      *)
36351b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
36361b12faf6Smrg	;;
36371b12faf6Smrg      esac
36381b12faf6Smrg      ;;
36391b12faf6Smrg    *qnx* | *nto*)
36401b12faf6Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
36411b12faf6Smrg      # it will coredump.
36421b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
36431b12faf6Smrg      ;;
36441b12faf6Smrg    *)
36451b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
36462a51b5beSmrg      ;;
3647d31dbc53Smrg    esac
36481b12faf6Smrg  else
36491b12faf6Smrg    case $host_os in
36501b12faf6Smrg      aix[[4-9]]*)
36511b12faf6Smrg	# All AIX code is PIC.
36521b12faf6Smrg	if test "$host_cpu" = ia64; then
36531b12faf6Smrg	  # AIX 5 now supports IA64 processor
36541b12faf6Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
36551b12faf6Smrg	else
36561b12faf6Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
36571b12faf6Smrg	fi
3658d31dbc53Smrg	;;
36591b12faf6Smrg      chorus*)
36601b12faf6Smrg	case $cc_basename in
36611b12faf6Smrg	cxch68*)
36621b12faf6Smrg	  # Green Hills C++ Compiler
36631b12faf6Smrg	  # _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"
36642a51b5beSmrg	  ;;
36652a51b5beSmrg	esac
3666d31dbc53Smrg	;;
36671b12faf6Smrg      dgux*)
36681b12faf6Smrg	case $cc_basename in
36691b12faf6Smrg	  ec++*)
36701b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
36711b12faf6Smrg	    ;;
36721b12faf6Smrg	  ghcx*)
36731b12faf6Smrg	    # Green Hills C++ Compiler
36741b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
36751b12faf6Smrg	    ;;
36761b12faf6Smrg	  *)
36771b12faf6Smrg	    ;;
36781b12faf6Smrg	esac
36791b12faf6Smrg	;;
36801b12faf6Smrg      freebsd* | dragonfly*)
36811b12faf6Smrg	# FreeBSD uses GNU C++
36821b12faf6Smrg	;;
36831b12faf6Smrg      hpux9* | hpux10* | hpux11*)
36841b12faf6Smrg	case $cc_basename in
36851b12faf6Smrg	  CC*)
36861b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
36871b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
36881b12faf6Smrg	    if test "$host_cpu" != ia64; then
36891b12faf6Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
36901b12faf6Smrg	    fi
36911b12faf6Smrg	    ;;
36921b12faf6Smrg	  aCC*)
36931b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
36941b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
36952a51b5beSmrg	    case $host_cpu in
36961b12faf6Smrg	    hppa*64*|ia64*)
36971b12faf6Smrg	      # +Z the default
36982a51b5beSmrg	      ;;
36992a51b5beSmrg	    *)
37001b12faf6Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
37012a51b5beSmrg	      ;;
37022a51b5beSmrg	    esac
37031b12faf6Smrg	    ;;
37041b12faf6Smrg	  *)
37051b12faf6Smrg	    ;;
37062a51b5beSmrg	esac
37072a51b5beSmrg	;;
37081b12faf6Smrg      interix*)
37091b12faf6Smrg	# This is c89, which is MS Visual C++ (no shared libs)
37101b12faf6Smrg	# Anyone wants to do a port?
37112a51b5beSmrg	;;
37121b12faf6Smrg      irix5* | irix6* | nonstopux*)
37131b12faf6Smrg	case $cc_basename in
37141b12faf6Smrg	  CC*)
37151b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37161b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
37171b12faf6Smrg	    # CC pic flag -KPIC is the default.
37181b12faf6Smrg	    ;;
37191b12faf6Smrg	  *)
37201b12faf6Smrg	    ;;
37212a51b5beSmrg	esac
37222a51b5beSmrg	;;
37231b12faf6Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
37241b12faf6Smrg	case $cc_basename in
37251b12faf6Smrg	  KCC*)
37261b12faf6Smrg	    # KAI C++ Compiler
37271b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
37281b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
37291b12faf6Smrg	    ;;
37301b12faf6Smrg	  ecpc* )
37311b12faf6Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
37321b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37331b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37341b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
37351b12faf6Smrg	    ;;
37361b12faf6Smrg	  icpc* )
37371b12faf6Smrg	    # Intel C++, used to be incompatible with GCC.
37381b12faf6Smrg	    # ICC 10 doesn't accept -KPIC any more.
37391b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37401b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
37411b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
37421b12faf6Smrg	    ;;
37431b12faf6Smrg	  pgCC* | pgcpp*)
37441b12faf6Smrg	    # Portland Group C++ compiler
37451b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37461b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
37471b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37481b12faf6Smrg	    ;;
37491b12faf6Smrg	  cxx*)
37501b12faf6Smrg	    # Compaq C++
37511b12faf6Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
37521b12faf6Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
37531b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
37541b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
37551b12faf6Smrg	    ;;
37561b12faf6Smrg	  xlc* | xlC*)
37571b12faf6Smrg	    # IBM XL 8.0 on PPC
37581b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37591b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
37601b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
37611b12faf6Smrg	    ;;
37621b12faf6Smrg	  *)
37631b12faf6Smrg	    case `$CC -V 2>&1 | sed 5q` in
37641b12faf6Smrg	    *Sun\ C*)
37651b12faf6Smrg	      # Sun C++ 5.9
37661b12faf6Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37671b12faf6Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37681b12faf6Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
37691b12faf6Smrg	      ;;
37701b12faf6Smrg	    esac
37711b12faf6Smrg	    ;;
37721b12faf6Smrg	esac
37732a51b5beSmrg	;;
37741b12faf6Smrg      lynxos*)
37752a51b5beSmrg	;;
37761b12faf6Smrg      m88k*)
37772a51b5beSmrg	;;
37781b12faf6Smrg      mvs*)
37791b12faf6Smrg	case $cc_basename in
37801b12faf6Smrg	  cxx*)
37811b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
37821b12faf6Smrg	    ;;
37831b12faf6Smrg	  *)
37841b12faf6Smrg	    ;;
37851b12faf6Smrg	esac
37862a51b5beSmrg	;;
37871b12faf6Smrg      netbsd* | netbsdelf*-gnu)
37882a51b5beSmrg	;;
37891b12faf6Smrg      *qnx* | *nto*)
37901b12faf6Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
37911b12faf6Smrg        # it will coredump.
37921b12faf6Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
37931b12faf6Smrg        ;;
37941b12faf6Smrg      osf3* | osf4* | osf5*)
37951b12faf6Smrg	case $cc_basename in
37961b12faf6Smrg	  KCC*)
37971b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
37981b12faf6Smrg	    ;;
37991b12faf6Smrg	  RCC*)
38001b12faf6Smrg	    # Rational C++ 2.4.1
38011b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
38021b12faf6Smrg	    ;;
38031b12faf6Smrg	  cxx*)
38041b12faf6Smrg	    # Digital/Compaq C++
38051b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
38061b12faf6Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
38071b12faf6Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
38081b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
38091b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
38101b12faf6Smrg	    ;;
38111b12faf6Smrg	  *)
38121b12faf6Smrg	    ;;
38131b12faf6Smrg	esac
38142a51b5beSmrg	;;
38151b12faf6Smrg      psos*)
38162a51b5beSmrg	;;
38171b12faf6Smrg      solaris*)
38181b12faf6Smrg	case $cc_basename in
38191b12faf6Smrg	  CC*)
38201b12faf6Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
38211b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
38221b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
38231b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
38241b12faf6Smrg	    ;;
38251b12faf6Smrg	  gcx*)
38261b12faf6Smrg	    # Green Hills C++ Compiler
38271b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
38281b12faf6Smrg	    ;;
38291b12faf6Smrg	  *)
38301b12faf6Smrg	    ;;
38311b12faf6Smrg	esac
38322a51b5beSmrg	;;
38331b12faf6Smrg      sunos4*)
38341b12faf6Smrg	case $cc_basename in
38351b12faf6Smrg	  CC*)
38361b12faf6Smrg	    # Sun C++ 4.x
38371b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
38381b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
38391b12faf6Smrg	    ;;
38401b12faf6Smrg	  lcc*)
38411b12faf6Smrg	    # Lucid
38421b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
38431b12faf6Smrg	    ;;
38441b12faf6Smrg	  *)
38451b12faf6Smrg	    ;;
38461b12faf6Smrg	esac
38472a51b5beSmrg	;;
38481b12faf6Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
38491b12faf6Smrg	case $cc_basename in
38501b12faf6Smrg	  CC*)
38511b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
38521b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
38531b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
38541b12faf6Smrg	    ;;
38551b12faf6Smrg	esac
38562a51b5beSmrg	;;
38571b12faf6Smrg      tandem*)
38581b12faf6Smrg	case $cc_basename in
38591b12faf6Smrg	  NCC*)
38601b12faf6Smrg	    # NonStop-UX NCC 3.20
38611b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
38621b12faf6Smrg	    ;;
38632a51b5beSmrg	  *)
38642a51b5beSmrg	    ;;
3865d31dbc53Smrg	esac
38662a51b5beSmrg	;;
38671b12faf6Smrg      vxworks*)
38682a51b5beSmrg	;;
38692a51b5beSmrg      *)
38701b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
38711b12faf6Smrg	;;
38721b12faf6Smrg    esac
38731b12faf6Smrg  fi
38741b12faf6Smrg],
38751b12faf6Smrg[
38761b12faf6Smrg  if test "$GCC" = yes; then
38771b12faf6Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
38781b12faf6Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
387932b578d3Smrg
38801b12faf6Smrg    case $host_os in
38811b12faf6Smrg      aix*)
38821b12faf6Smrg      # All AIX code is PIC.
38831b12faf6Smrg      if test "$host_cpu" = ia64; then
38841b12faf6Smrg	# AIX 5 now supports IA64 processor
38851b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
38861b12faf6Smrg      fi
38871b12faf6Smrg      ;;
38882a51b5beSmrg
38891b12faf6Smrg    amigaos*)
38901b12faf6Smrg      case $host_cpu in
38911b12faf6Smrg      powerpc)
38921b12faf6Smrg            # see comment about AmigaOS4 .so support
38931b12faf6Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
38941b12faf6Smrg        ;;
38951b12faf6Smrg      m68k)
38961b12faf6Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
38971b12faf6Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
38981b12faf6Smrg            # like `-m68040'.
38991b12faf6Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
39001b12faf6Smrg        ;;
39011b12faf6Smrg      esac
39021b12faf6Smrg      ;;
39032a51b5beSmrg
39041b12faf6Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
39051b12faf6Smrg      # PIC is the default for these OSes.
39061b12faf6Smrg      ;;
39071b12faf6Smrg
39081b12faf6Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
39091b12faf6Smrg      # This hack is so that the source file can tell whether it is being
39101b12faf6Smrg      # built for inclusion in a dll (and should export symbols for example).
39111b12faf6Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
39121b12faf6Smrg      # (--disable-auto-import) libraries
39131b12faf6Smrg      m4_if([$1], [GCJ], [],
39141b12faf6Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
39151b12faf6Smrg      ;;
39161b12faf6Smrg
39171b12faf6Smrg    darwin* | rhapsody*)
39181b12faf6Smrg      # PIC is the default on this platform
39191b12faf6Smrg      # Common symbols not allowed in MH_DYLIB files
39201b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
39211b12faf6Smrg      ;;
39221b12faf6Smrg
39231b12faf6Smrg    hpux*)
39241b12faf6Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
39251b12faf6Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
39261b12faf6Smrg      # sets the default TLS model and affects inlining.
39271b12faf6Smrg      case $host_cpu in
39281b12faf6Smrg      hppa*64*)
39291b12faf6Smrg	# +Z the default
3930d31dbc53Smrg	;;
3931d31dbc53Smrg      *)
39321b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3933d31dbc53Smrg	;;
39341b12faf6Smrg      esac
39351b12faf6Smrg      ;;
39361b12faf6Smrg
39371b12faf6Smrg    interix[[3-9]]*)
39381b12faf6Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
39391b12faf6Smrg      # Instead, we relocate shared libraries at runtime.
39401b12faf6Smrg      ;;
39411b12faf6Smrg
39421b12faf6Smrg    msdosdjgpp*)
39431b12faf6Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
39441b12faf6Smrg      # on systems that don't support them.
39451b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
39461b12faf6Smrg      enable_shared=no
39471b12faf6Smrg      ;;
39481b12faf6Smrg
39491b12faf6Smrg    *nto* | *qnx*)
39501b12faf6Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
39511b12faf6Smrg      # it will coredump.
39521b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
39531b12faf6Smrg      ;;
39541b12faf6Smrg
39551b12faf6Smrg    sysv4*MP*)
39561b12faf6Smrg      if test -d /usr/nec; then
39571b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
39581b12faf6Smrg      fi
39591b12faf6Smrg      ;;
39601b12faf6Smrg
39611b12faf6Smrg    *)
39621b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39631b12faf6Smrg      ;;
39642a51b5beSmrg    esac
39651b12faf6Smrg  else
39661b12faf6Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
39671b12faf6Smrg    case $host_os in
39681b12faf6Smrg    aix*)
39691b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
39701b12faf6Smrg      if test "$host_cpu" = ia64; then
39711b12faf6Smrg	# AIX 5 now supports IA64 processor
39721b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
39731b12faf6Smrg      else
39741b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
39751b12faf6Smrg      fi
39761b12faf6Smrg      ;;
39771b12faf6Smrg
39781b12faf6Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
39791b12faf6Smrg      # This hack is so that the source file can tell whether it is being
39801b12faf6Smrg      # built for inclusion in a dll (and should export symbols for example).
39811b12faf6Smrg      m4_if([$1], [GCJ], [],
39821b12faf6Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
39831b12faf6Smrg      ;;
39841b12faf6Smrg
39851b12faf6Smrg    hpux9* | hpux10* | hpux11*)
39861b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
39871b12faf6Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
39881b12faf6Smrg      # not for PA HP-UX.
39891b12faf6Smrg      case $host_cpu in
39901b12faf6Smrg      hppa*64*|ia64*)
39911b12faf6Smrg	# +Z the default
39922a51b5beSmrg	;;
39932a51b5beSmrg      *)
39941b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
39952a51b5beSmrg	;;
39961b12faf6Smrg      esac
39971b12faf6Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
39981b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
39991b12faf6Smrg      ;;
40001b12faf6Smrg
40011b12faf6Smrg    irix5* | irix6* | nonstopux*)
40021b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40031b12faf6Smrg      # PIC (with -KPIC) is the default.
40041b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40051b12faf6Smrg      ;;
40061b12faf6Smrg
40071b12faf6Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
40081b12faf6Smrg      case $cc_basename in
40091b12faf6Smrg      # old Intel for x86_64 which still supported -KPIC.
40101b12faf6Smrg      ecc*)
40111b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40121b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40131b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
40141b12faf6Smrg        ;;
40151b12faf6Smrg      # icc used to be incompatible with GCC.
40161b12faf6Smrg      # ICC 10 doesn't accept -KPIC any more.
40171b12faf6Smrg      icc* | ifort*)
40181b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40191b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
40201b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
40211b12faf6Smrg        ;;
40221b12faf6Smrg      # Lahey Fortran 8.1.
40231b12faf6Smrg      lf95*)
40241b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40251b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
40261b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
40271b12faf6Smrg	;;
40281b12faf6Smrg      pgcc* | pgf77* | pgf90* | pgf95*)
40291b12faf6Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
40301b12faf6Smrg	# which looks to be a dead project)
40311b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40321b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
40331b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
40341b12faf6Smrg        ;;
40351b12faf6Smrg      ccc*)
40361b12faf6Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40371b12faf6Smrg        # All Alpha code is PIC.
40381b12faf6Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40391b12faf6Smrg        ;;
40401b12faf6Smrg      xl*)
40411b12faf6Smrg	# IBM XL C 8.0/Fortran 10.1 on PPC
40421b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40431b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
40441b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
40452a51b5beSmrg	;;
40462a51b5beSmrg      *)
40471b12faf6Smrg	case `$CC -V 2>&1 | sed 5q` in
40481b12faf6Smrg	*Sun\ C*)
40491b12faf6Smrg	  # Sun C 5.9
40501b12faf6Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40511b12faf6Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
40521b12faf6Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40531b12faf6Smrg	  ;;
40541b12faf6Smrg	*Sun\ F*)
40551b12faf6Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
40561b12faf6Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40571b12faf6Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
40581b12faf6Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
40591b12faf6Smrg	  ;;
40601b12faf6Smrg	esac
40612a51b5beSmrg	;;
40621b12faf6Smrg      esac
40631b12faf6Smrg      ;;
406432b578d3Smrg
40651b12faf6Smrg    newsos6)
40661b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40671b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
40681b12faf6Smrg      ;;
406932b578d3Smrg
40701b12faf6Smrg    *nto* | *qnx*)
40711b12faf6Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
40721b12faf6Smrg      # it will coredump.
40731b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
40741b12faf6Smrg      ;;
407532b578d3Smrg
40761b12faf6Smrg    osf3* | osf4* | osf5*)
40771b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40781b12faf6Smrg      # All OSF/1 code is PIC.
40791b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40801b12faf6Smrg      ;;
408132b578d3Smrg
40821b12faf6Smrg    rdos*)
40831b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40841b12faf6Smrg      ;;
408532b578d3Smrg
40861b12faf6Smrg    solaris*)
40871b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40881b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
40891b12faf6Smrg      case $cc_basename in
40901b12faf6Smrg      f77* | f90* | f95*)
40911b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
40921b12faf6Smrg      *)
40931b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
40941b12faf6Smrg      esac
40951b12faf6Smrg      ;;
409632b578d3Smrg
40971b12faf6Smrg    sunos4*)
40981b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
40991b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
41001b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41011b12faf6Smrg      ;;
410232b578d3Smrg
41031b12faf6Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
41041b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41051b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41061b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41071b12faf6Smrg      ;;
410832b578d3Smrg
41091b12faf6Smrg    sysv4*MP*)
41101b12faf6Smrg      if test -d /usr/nec ;then
41111b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
41121b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41131b12faf6Smrg      fi
41141b12faf6Smrg      ;;
411532b578d3Smrg
41161b12faf6Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
41171b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41181b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41191b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41201b12faf6Smrg      ;;
412132b578d3Smrg
41221b12faf6Smrg    unicos*)
41231b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41241b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
41251b12faf6Smrg      ;;
412632b578d3Smrg
41271b12faf6Smrg    uts4*)
41281b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
41291b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41301b12faf6Smrg      ;;
413132b578d3Smrg
41321b12faf6Smrg    *)
41331b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
41341b12faf6Smrg      ;;
41352a51b5beSmrg    esac
41361b12faf6Smrg  fi
41371b12faf6Smrg])
41381b12faf6Smrgcase $host_os in
41391b12faf6Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
41401b12faf6Smrg  *djgpp*)
41411b12faf6Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
41421b12faf6Smrg    ;;
41431b12faf6Smrg  *)
41441b12faf6Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
41451b12faf6Smrg    ;;
41461b12faf6Smrgesac
41471b12faf6SmrgAC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
41481b12faf6Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
41491b12faf6Smrg	[How to pass a linker flag through the compiler])
41502a51b5beSmrg
41511b12faf6Smrg#
41521b12faf6Smrg# Check to make sure the PIC flag actually works.
41531b12faf6Smrg#
41541b12faf6Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
41551b12faf6Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
41561b12faf6Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
41571b12faf6Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
41581b12faf6Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
41591b12faf6Smrg     "" | " "*) ;;
41601b12faf6Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
41611b12faf6Smrg     esac],
41621b12faf6Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
41631b12faf6Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
41642a51b5beSmrgfi
41651b12faf6Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
41661b12faf6Smrg	[Additional compiler flags for building library objects])
41672a51b5beSmrg
41681b12faf6Smrg#
41691b12faf6Smrg# Check to make sure the static flag actually works.
41701b12faf6Smrg#
41711b12faf6Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
41721b12faf6Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
41731b12faf6Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
41741b12faf6Smrg  $lt_tmp_static_flag,
41751b12faf6Smrg  [],
41761b12faf6Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
41771b12faf6Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
41781b12faf6Smrg	[Compiler flag to prevent dynamic linking])
41791b12faf6Smrg])# _LT_COMPILER_PIC
418032b578d3Smrg
41811b12faf6Smrg
41821b12faf6Smrg# _LT_LINKER_SHLIBS([TAGNAME])
41831b12faf6Smrg# ----------------------------
41841b12faf6Smrg# See if the linker supports building shared libraries.
41851b12faf6Smrgm4_defun([_LT_LINKER_SHLIBS],
41861b12faf6Smrg[AC_REQUIRE([LT_PATH_LD])dnl
41871b12faf6SmrgAC_REQUIRE([LT_PATH_NM])dnl
41881b12faf6Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
41891b12faf6Smrgm4_require([_LT_DECL_EGREP])dnl
41901b12faf6Smrgm4_require([_LT_DECL_SED])dnl
41911b12faf6Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
41921b12faf6Smrgm4_require([_LT_TAG_COMPILER])dnl
41931b12faf6SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
41941b12faf6Smrgm4_if([$1], [CXX], [
41951b12faf6Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
41961b12faf6Smrg  case $host_os in
41971b12faf6Smrg  aix[[4-9]]*)
41981b12faf6Smrg    # If we're using GNU nm, then we don't want the "-C" option.
41991b12faf6Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
42001b12faf6Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
42011b12faf6Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
42021b12faf6Smrg    else
42031b12faf6Smrg      _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'
42042a51b5beSmrg    fi
4205d31dbc53Smrg    ;;
42061b12faf6Smrg  pw32*)
42071b12faf6Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4208d31dbc53Smrg  ;;
42091b12faf6Smrg  cygwin* | mingw* | cegcc*)
42101b12faf6Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
42111b12faf6Smrg  ;;
42121b12faf6Smrg  linux* | k*bsd*-gnu)
42131b12faf6Smrg    _LT_TAGVAR(link_all_deplibs, $1)=no
42141b12faf6Smrg  ;;
42151b12faf6Smrg  *)
42161b12faf6Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
42171b12faf6Smrg  ;;
42181b12faf6Smrg  esac
42191b12faf6Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
42201b12faf6Smrg], [
42211b12faf6Smrg  runpath_var=
42221b12faf6Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
42231b12faf6Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
42241b12faf6Smrg  _LT_TAGVAR(archive_cmds, $1)=
42251b12faf6Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
42261b12faf6Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
42271b12faf6Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
42281b12faf6Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
42291b12faf6Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
42301b12faf6Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
42311b12faf6Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
42321b12faf6Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
42331b12faf6Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
42341b12faf6Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
42351b12faf6Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
42361b12faf6Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
42371b12faf6Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
42381b12faf6Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
42391b12faf6Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
42401b12faf6Smrg  _LT_TAGVAR(module_cmds, $1)=
42411b12faf6Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
42421b12faf6Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
42431b12faf6Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
42441b12faf6Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
42451b12faf6Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
42461b12faf6Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
42471b12faf6Smrg  # included in the symbol list
42481b12faf6Smrg  _LT_TAGVAR(include_expsyms, $1)=
42491b12faf6Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
42501b12faf6Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
42511b12faf6Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
42521b12faf6Smrg  # as well as any symbol that contains `d'.
42531b12faf6Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
42541b12faf6Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
42551b12faf6Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
42561b12faf6Smrg  # the symbol is explicitly referenced.  Since portable code cannot
42571b12faf6Smrg  # rely on this symbol name, it's probably fine to never include it in
42581b12faf6Smrg  # preloaded symbol tables.
42591b12faf6Smrg  # Exclude shared library initialization/finalization symbols.
42601b12faf6Smrgdnl Note also adjust exclude_expsyms for C++ above.
42611b12faf6Smrg  extract_expsyms_cmds=
426232b578d3Smrg
42631b12faf6Smrg  case $host_os in
42641b12faf6Smrg  cygwin* | mingw* | pw32* | cegcc*)
42651b12faf6Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
42661b12faf6Smrg    # When not using gcc, we currently assume that we are using
42671b12faf6Smrg    # Microsoft Visual C++.
42681b12faf6Smrg    if test "$GCC" != yes; then
42691b12faf6Smrg      with_gnu_ld=no
42702a51b5beSmrg    fi
42712a51b5beSmrg    ;;
42721b12faf6Smrg  interix*)
42731b12faf6Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
42741b12faf6Smrg    with_gnu_ld=yes
42751b12faf6Smrg    ;;
42761b12faf6Smrg  openbsd*)
42771b12faf6Smrg    with_gnu_ld=no
42781b12faf6Smrg    ;;
42791b12faf6Smrg  linux* | k*bsd*-gnu)
42801b12faf6Smrg    _LT_TAGVAR(link_all_deplibs, $1)=no
42811b12faf6Smrg    ;;
42822a51b5beSmrg  esac
428332b578d3Smrg
42841b12faf6Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
42851b12faf6Smrg  if test "$with_gnu_ld" = yes; then
42861b12faf6Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
42871b12faf6Smrg    wlarc='${wl}'
428832b578d3Smrg
42891b12faf6Smrg    # Set some defaults for GNU ld with shared library support. These
42901b12faf6Smrg    # are reset later if shared libraries are not supported. Putting them
42911b12faf6Smrg    # here allows them to be overridden if necessary.
42921b12faf6Smrg    runpath_var=LD_RUN_PATH
42931b12faf6Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
42941b12faf6Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
42951b12faf6Smrg    # ancient GNU ld didn't support --whole-archive et. al.
42961b12faf6Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
42971b12faf6Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
42981b12faf6Smrg    else
42991b12faf6Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
43001b12faf6Smrg    fi
43011b12faf6Smrg    supports_anon_versioning=no
43021b12faf6Smrg    case `$LD -v 2>&1` in
43031b12faf6Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
43041b12faf6Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
43051b12faf6Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
43061b12faf6Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
43071b12faf6Smrg      *\ 2.11.*) ;; # other 2.11 versions
43081b12faf6Smrg      *) supports_anon_versioning=yes ;;
43091b12faf6Smrg    esac
431032b578d3Smrg
43111b12faf6Smrg    # See if GNU ld supports shared libraries.
43121b12faf6Smrg    case $host_os in
43131b12faf6Smrg    aix[[3-9]]*)
43141b12faf6Smrg      # On AIX/PPC, the GNU linker is very broken
43151b12faf6Smrg      if test "$host_cpu" != ia64; then
43161b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
43171b12faf6Smrg	cat <<_LT_EOF 1>&2
431832b578d3Smrg
43191b12faf6Smrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
43201b12faf6Smrg*** to be unable to reliably create shared libraries on AIX.
43211b12faf6Smrg*** Therefore, libtool is disabling shared libraries support.  If you
43221b12faf6Smrg*** really care for shared libraries, you may want to modify your PATH
43231b12faf6Smrg*** so that a non-GNU linker is found, and then restart.
432432b578d3Smrg
43251b12faf6Smrg_LT_EOF
43261b12faf6Smrg      fi
43271b12faf6Smrg      ;;
432832b578d3Smrg
43291b12faf6Smrg    amigaos*)
43301b12faf6Smrg      case $host_cpu in
43311b12faf6Smrg      powerpc)
43321b12faf6Smrg            # see comment about AmigaOS4 .so support
43331b12faf6Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
43341b12faf6Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
43351b12faf6Smrg        ;;
43361b12faf6Smrg      m68k)
43371b12faf6Smrg            _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)'
43381b12faf6Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
43391b12faf6Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
43401b12faf6Smrg        ;;
43411b12faf6Smrg      esac
43421b12faf6Smrg      ;;
434332b578d3Smrg
43441b12faf6Smrg    beos*)
43451b12faf6Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
43461b12faf6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
43471b12faf6Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
43481b12faf6Smrg	# support --undefined.  This deserves some investigation.  FIXME
43491b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
43501b12faf6Smrg      else
43511b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
43521b12faf6Smrg      fi
43531b12faf6Smrg      ;;
435432b578d3Smrg
43551b12faf6Smrg    cygwin* | mingw* | pw32* | cegcc*)
43561b12faf6Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
43571b12faf6Smrg      # as there is no search path for DLLs.
43581b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
43591b12faf6Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
43601b12faf6Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
43611b12faf6Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
43621b12faf6Smrg      _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'
43631b12faf6Smrg
43641b12faf6Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
43651b12faf6Smrg        _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'
43661b12faf6Smrg	# If the export-symbols file already is a .def file (1st line
43671b12faf6Smrg	# is EXPORTS), use it as is; otherwise, prepend...
43681b12faf6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
43691b12faf6Smrg	  cp $export_symbols $output_objdir/$soname.def;
43701b12faf6Smrg	else
43711b12faf6Smrg	  echo EXPORTS > $output_objdir/$soname.def;
43721b12faf6Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
43731b12faf6Smrg	fi~
43741b12faf6Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
43751b12faf6Smrg      else
43761b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
43771b12faf6Smrg      fi
43781b12faf6Smrg      ;;
437932b578d3Smrg
43801b12faf6Smrg    interix[[3-9]]*)
43811b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
43821b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
43831b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
43841b12faf6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
43851b12faf6Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
43861b12faf6Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
43871b12faf6Smrg      # default) and relocated if they conflict, which is a slow very memory
43881b12faf6Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
43891b12faf6Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
43901b12faf6Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
43911b12faf6Smrg      _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'
43921b12faf6Smrg      _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'
43931b12faf6Smrg      ;;
439432b578d3Smrg
43951b12faf6Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
43961b12faf6Smrg      tmp_diet=no
43971b12faf6Smrg      if test "$host_os" = linux-dietlibc; then
43981b12faf6Smrg	case $cc_basename in
43991b12faf6Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
44001b12faf6Smrg	esac
44011b12faf6Smrg      fi
44021b12faf6Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
44031b12faf6Smrg	 && test "$tmp_diet" = no
44041b12faf6Smrg      then
44051b12faf6Smrg	tmp_addflag=
44061b12faf6Smrg	tmp_sharedflag='-shared'
44071b12faf6Smrg	case $cc_basename,$host_cpu in
44081b12faf6Smrg        pgcc*)				# Portland Group C compiler
44091b12faf6Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
44101b12faf6Smrg	  tmp_addflag=' $pic_flag'
44111b12faf6Smrg	  ;;
44121b12faf6Smrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
44131b12faf6Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
44141b12faf6Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
44151b12faf6Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
44161b12faf6Smrg	  tmp_addflag=' -i_dynamic' ;;
44171b12faf6Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
44181b12faf6Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
44191b12faf6Smrg	ifc* | ifort*)			# Intel Fortran compiler
44201b12faf6Smrg	  tmp_addflag=' -nofor_main' ;;
44211b12faf6Smrg	lf95*)				# Lahey Fortran 8.1
44221b12faf6Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
44231b12faf6Smrg	  tmp_sharedflag='--shared' ;;
44241b12faf6Smrg	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
44251b12faf6Smrg	  tmp_sharedflag='-qmkshrobj'
44261b12faf6Smrg	  tmp_addflag= ;;
44271b12faf6Smrg	esac
44281b12faf6Smrg	case `$CC -V 2>&1 | sed 5q` in
44291b12faf6Smrg	*Sun\ C*)			# Sun C 5.9
44301b12faf6Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
44311b12faf6Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
44321b12faf6Smrg	  tmp_sharedflag='-G' ;;
44331b12faf6Smrg	*Sun\ F*)			# Sun Fortran 8.3
44341b12faf6Smrg	  tmp_sharedflag='-G' ;;
44351b12faf6Smrg	esac
44361b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
443732b578d3Smrg
44381b12faf6Smrg        if test "x$supports_anon_versioning" = xyes; then
44391b12faf6Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
44401b12faf6Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
44411b12faf6Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
44421b12faf6Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
44431b12faf6Smrg        fi
444432b578d3Smrg
44451b12faf6Smrg	case $cc_basename in
44461b12faf6Smrg	xlf*)
44471b12faf6Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
44481b12faf6Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
44491b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
44501b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
44511b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
44521b12faf6Smrg	  if test "x$supports_anon_versioning" = xyes; then
44531b12faf6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
44541b12faf6Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
44551b12faf6Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
44561b12faf6Smrg	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
44571b12faf6Smrg	  fi
44581b12faf6Smrg	  ;;
44591b12faf6Smrg	esac
44601b12faf6Smrg      else
44611b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
44621b12faf6Smrg      fi
44631b12faf6Smrg      ;;
446432b578d3Smrg
44651b12faf6Smrg    netbsd* | netbsdelf*-gnu)
44661b12faf6Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
44671b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
44681b12faf6Smrg	wlarc=
44691b12faf6Smrg      else
44701b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
44711b12faf6Smrg	_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'
44721b12faf6Smrg      fi
44731b12faf6Smrg      ;;
447432b578d3Smrg
44751b12faf6Smrg    solaris*)
44761b12faf6Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
44771b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
44781b12faf6Smrg	cat <<_LT_EOF 1>&2
447932b578d3Smrg
44801b12faf6Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
44811b12faf6Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
44821b12faf6Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
44831b12faf6Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
44841b12faf6Smrg*** your PATH or compiler configuration so that the native linker is
44851b12faf6Smrg*** used, and then restart.
448632b578d3Smrg
44871b12faf6Smrg_LT_EOF
44881b12faf6Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
44891b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
44901b12faf6Smrg	_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'
44911b12faf6Smrg      else
44921b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
44931b12faf6Smrg      fi
44941b12faf6Smrg      ;;
449532b578d3Smrg
44961b12faf6Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
44971b12faf6Smrg      case `$LD -v 2>&1` in
44981b12faf6Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
44991b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
45001b12faf6Smrg	cat <<_LT_EOF 1>&2
450132b578d3Smrg
45021b12faf6Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
45031b12faf6Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
45041b12faf6Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
45051b12faf6Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
45061b12faf6Smrg*** your PATH or compiler configuration so that the native linker is
45071b12faf6Smrg*** used, and then restart.
450832b578d3Smrg
45091b12faf6Smrg_LT_EOF
45101b12faf6Smrg	;;
45111b12faf6Smrg	*)
45121b12faf6Smrg	  # For security reasons, it is highly recommended that you always
45131b12faf6Smrg	  # use absolute paths for naming shared libraries, and exclude the
45141b12faf6Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
45151b12faf6Smrg	  # requires that you compile everything twice, which is a pain.
45161b12faf6Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
45171b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
45181b12faf6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
45191b12faf6Smrg	    _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'
45201b12faf6Smrg	  else
45211b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
45221b12faf6Smrg	  fi
45231b12faf6Smrg	;;
45241b12faf6Smrg      esac
45251b12faf6Smrg      ;;
452632b578d3Smrg
45271b12faf6Smrg    sunos4*)
45281b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
45291b12faf6Smrg      wlarc=
45301b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
45311b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
45321b12faf6Smrg      ;;
453332b578d3Smrg
45341b12faf6Smrg    *)
45351b12faf6Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
45361b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
45371b12faf6Smrg	_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'
45381b12faf6Smrg      else
45391b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
45401b12faf6Smrg      fi
45411b12faf6Smrg      ;;
45421b12faf6Smrg    esac
454332b578d3Smrg
45441b12faf6Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
45451b12faf6Smrg      runpath_var=
45461b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
45471b12faf6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
45481b12faf6Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
45491b12faf6Smrg    fi
45501b12faf6Smrg  else
45511b12faf6Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
45521b12faf6Smrg    case $host_os in
45531b12faf6Smrg    aix3*)
45541b12faf6Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
45551b12faf6Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
45561b12faf6Smrg      _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'
45571b12faf6Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
45581b12faf6Smrg      # are no directories specified by -L.
45591b12faf6Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
45601b12faf6Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
45611b12faf6Smrg	# Neither direct hardcoding nor static linking is supported with a
45621b12faf6Smrg	# broken collect2.
45631b12faf6Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
45641b12faf6Smrg      fi
45651b12faf6Smrg      ;;
456632b578d3Smrg
45671b12faf6Smrg    aix[[4-9]]*)
45681b12faf6Smrg      if test "$host_cpu" = ia64; then
45691b12faf6Smrg	# On IA64, the linker does run time linking by default, so we don't
45701b12faf6Smrg	# have to do anything special.
45711b12faf6Smrg	aix_use_runtimelinking=no
45721b12faf6Smrg	exp_sym_flag='-Bexport'
45731b12faf6Smrg	no_entry_flag=""
45741b12faf6Smrg      else
45751b12faf6Smrg	# If we're using GNU nm, then we don't want the "-C" option.
45761b12faf6Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
45771b12faf6Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
45781b12faf6Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
45791b12faf6Smrg	else
45801b12faf6Smrg	  _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'
45811b12faf6Smrg	fi
45821b12faf6Smrg	aix_use_runtimelinking=no
458332b578d3Smrg
45841b12faf6Smrg	# Test if we are trying to use run time linking or normal
45851b12faf6Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
45861b12faf6Smrg	# need to do runtime linking.
45871b12faf6Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
45881b12faf6Smrg	  for ld_flag in $LDFLAGS; do
45891b12faf6Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
45901b12faf6Smrg	    aix_use_runtimelinking=yes
45911b12faf6Smrg	    break
45921b12faf6Smrg	  fi
45931b12faf6Smrg	  done
45941b12faf6Smrg	  ;;
45951b12faf6Smrg	esac
459632b578d3Smrg
45971b12faf6Smrg	exp_sym_flag='-bexport'
45981b12faf6Smrg	no_entry_flag='-bnoentry'
45991b12faf6Smrg      fi
46002a51b5beSmrg
46011b12faf6Smrg      # When large executables or shared objects are built, AIX ld can
46021b12faf6Smrg      # have problems creating the table of contents.  If linking a library
46031b12faf6Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
46041b12faf6Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
46051b12faf6Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
46061b12faf6Smrg
46071b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)=''
46081b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
46091b12faf6Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
46101b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
46111b12faf6Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
46121b12faf6Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
46132a51b5beSmrg
46141b12faf6Smrg      if test "$GCC" = yes; then
46151b12faf6Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
46161b12faf6Smrg	# We only want to do this on AIX 4.2 and lower, the check
46171b12faf6Smrg	# below for broken collect2 doesn't work under 4.3+
46181b12faf6Smrg	  collect2name=`${CC} -print-prog-name=collect2`
46191b12faf6Smrg	  if test -f "$collect2name" &&
46201b12faf6Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
46211b12faf6Smrg	  then
46221b12faf6Smrg	  # We have reworked collect2
46231b12faf6Smrg	  :
46241b12faf6Smrg	  else
46251b12faf6Smrg	  # We have old collect2
46261b12faf6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
46271b12faf6Smrg	  # It fails to find uninstalled libraries when the uninstalled
46281b12faf6Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
46291b12faf6Smrg	  # to unsupported forces relinking
46301b12faf6Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
46311b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
46321b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
46331b12faf6Smrg	  fi
46341b12faf6Smrg	  ;;
46351b12faf6Smrg	esac
46361b12faf6Smrg	shared_flag='-shared'
46371b12faf6Smrg	if test "$aix_use_runtimelinking" = yes; then
46381b12faf6Smrg	  shared_flag="$shared_flag "'${wl}-G'
46391b12faf6Smrg	fi
46401b12faf6Smrg	_LT_TAGVAR(link_all_deplibs, $1)=no
46411b12faf6Smrg      else
46421b12faf6Smrg	# not using gcc
46431b12faf6Smrg	if test "$host_cpu" = ia64; then
46441b12faf6Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
46451b12faf6Smrg	# chokes on -Wl,-G. The following line is correct:
46461b12faf6Smrg	  shared_flag='-G'
46471b12faf6Smrg	else
46481b12faf6Smrg	  if test "$aix_use_runtimelinking" = yes; then
46491b12faf6Smrg	    shared_flag='${wl}-G'
46501b12faf6Smrg	  else
46511b12faf6Smrg	    shared_flag='${wl}-bM:SRE'
46521b12faf6Smrg	  fi
46531b12faf6Smrg	fi
46541b12faf6Smrg      fi
46552a51b5beSmrg
46561b12faf6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
46571b12faf6Smrg      # It seems that -bexpall does not export symbols beginning with
46581b12faf6Smrg      # underscore (_), so it is better to generate a list of symbols to export.
46591b12faf6Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
46601b12faf6Smrg      if test "$aix_use_runtimelinking" = yes; then
46611b12faf6Smrg	# Warning - without using the other runtime loading flags (-brtl),
46621b12faf6Smrg	# -berok will link without error, but may produce a broken library.
46631b12faf6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
46641b12faf6Smrg        # Determine the default libpath from the value encoded in an
46651b12faf6Smrg        # empty executable.
46661b12faf6Smrg        _LT_SYS_MODULE_PATH_AIX
46671b12faf6Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
46681b12faf6Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
46691b12faf6Smrg      else
46701b12faf6Smrg	if test "$host_cpu" = ia64; then
46711b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
46721b12faf6Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
46731b12faf6Smrg	  _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"
46741b12faf6Smrg	else
46751b12faf6Smrg	 # Determine the default libpath from the value encoded in an
46761b12faf6Smrg	 # empty executable.
46771b12faf6Smrg	 _LT_SYS_MODULE_PATH_AIX
46781b12faf6Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
46791b12faf6Smrg	  # Warning - without using the other run time loading flags,
46801b12faf6Smrg	  # -berok will link without error, but may produce a broken library.
46811b12faf6Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
46821b12faf6Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
46831b12faf6Smrg	  # Exported symbols can be pulled into shared objects from archives
46841b12faf6Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
46851b12faf6Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
46861b12faf6Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
46871b12faf6Smrg	  _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'
46881b12faf6Smrg	fi
46891b12faf6Smrg      fi
46901b12faf6Smrg      ;;
4691d31dbc53Smrg
46921b12faf6Smrg    amigaos*)
46931b12faf6Smrg      case $host_cpu in
46941b12faf6Smrg      powerpc)
46951b12faf6Smrg            # see comment about AmigaOS4 .so support
46961b12faf6Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
46971b12faf6Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
46981b12faf6Smrg        ;;
46991b12faf6Smrg      m68k)
47001b12faf6Smrg            _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)'
47011b12faf6Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
47021b12faf6Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
47031b12faf6Smrg        ;;
47041b12faf6Smrg      esac
47051b12faf6Smrg      ;;
4706d31dbc53Smrg
47071b12faf6Smrg    bsdi[[45]]*)
47081b12faf6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
47091b12faf6Smrg      ;;
4710d31dbc53Smrg
47111b12faf6Smrg    cygwin* | mingw* | pw32* | cegcc*)
47121b12faf6Smrg      # When not using gcc, we currently assume that we are using
47131b12faf6Smrg      # Microsoft Visual C++.
47141b12faf6Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
47151b12faf6Smrg      # no search path for DLLs.
47161b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
47171b12faf6Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
47181b12faf6Smrg      # Tell ltmain to make .lib files, not .a files.
47191b12faf6Smrg      libext=lib
47201b12faf6Smrg      # Tell ltmain to make .dll files, not .so files.
47211b12faf6Smrg      shrext_cmds=".dll"
47221b12faf6Smrg      # FIXME: Setting linknames here is a bad hack.
47231b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
47241b12faf6Smrg      # The linker will automatically build a .lib file if we build a DLL.
47251b12faf6Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
47261b12faf6Smrg      # FIXME: Should let the user specify the lib program.
47271b12faf6Smrg      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
47281b12faf6Smrg      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
47291b12faf6Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
47301b12faf6Smrg      ;;
4731d31dbc53Smrg
47321b12faf6Smrg    darwin* | rhapsody*)
47331b12faf6Smrg      _LT_DARWIN_LINKER_FEATURES($1)
47341b12faf6Smrg      ;;
4735d31dbc53Smrg
47361b12faf6Smrg    dgux*)
47371b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
47381b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
47391b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
47401b12faf6Smrg      ;;
4741d31dbc53Smrg
47421b12faf6Smrg    freebsd1*)
47431b12faf6Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
47441b12faf6Smrg      ;;
4745d31dbc53Smrg
47461b12faf6Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
47471b12faf6Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
47481b12faf6Smrg    # does not break anything, and helps significantly (at the cost of a little
47491b12faf6Smrg    # extra space).
47501b12faf6Smrg    freebsd2.2*)
47511b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
47521b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
47531b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
47541b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
47551b12faf6Smrg      ;;
4756d31dbc53Smrg
47571b12faf6Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
47581b12faf6Smrg    freebsd2*)
47591b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
47601b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
47611b12faf6Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
47621b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
47631b12faf6Smrg      ;;
4764d31dbc53Smrg
47651b12faf6Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
47661b12faf6Smrg    freebsd* | dragonfly*)
47671b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
47681b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
47691b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
47701b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
47711b12faf6Smrg      ;;
4772d31dbc53Smrg
47731b12faf6Smrg    hpux9*)
47741b12faf6Smrg      if test "$GCC" = yes; then
47751b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
47761b12faf6Smrg      else
47771b12faf6Smrg	_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'
47781b12faf6Smrg      fi
47791b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
47801b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
47811b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4782d31dbc53Smrg
47831b12faf6Smrg      # hardcode_minus_L: Not really in the search PATH,
47841b12faf6Smrg      # but as the default location of the library.
47851b12faf6Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
47861b12faf6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
47871b12faf6Smrg      ;;
478832b578d3Smrg
47891b12faf6Smrg    hpux10*)
47901b12faf6Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
47911b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
47921b12faf6Smrg      else
47931b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
47941b12faf6Smrg      fi
47951b12faf6Smrg      if test "$with_gnu_ld" = no; then
47961b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
47971b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
47981b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
47991b12faf6Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
48001b12faf6Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
48011b12faf6Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
48021b12faf6Smrg	# hardcode_minus_L: Not really in the search PATH,
48031b12faf6Smrg	# but as the default location of the library.
48041b12faf6Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
48051b12faf6Smrg      fi
48061b12faf6Smrg      ;;
480732b578d3Smrg
48081b12faf6Smrg    hpux11*)
48091b12faf6Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
48101b12faf6Smrg	case $host_cpu in
48111b12faf6Smrg	hppa*64*)
48121b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
48131b12faf6Smrg	  ;;
48141b12faf6Smrg	ia64*)
48151b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
48161b12faf6Smrg	  ;;
48171b12faf6Smrg	*)
48181b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
48191b12faf6Smrg	  ;;
48201b12faf6Smrg	esac
48211b12faf6Smrg      else
48221b12faf6Smrg	case $host_cpu in
48231b12faf6Smrg	hppa*64*)
48241b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
48251b12faf6Smrg	  ;;
48261b12faf6Smrg	ia64*)
48271b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
48281b12faf6Smrg	  ;;
48291b12faf6Smrg	*)
48301b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
48311b12faf6Smrg	  ;;
48321b12faf6Smrg	esac
48331b12faf6Smrg      fi
48341b12faf6Smrg      if test "$with_gnu_ld" = no; then
48351b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
48361b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
483732b578d3Smrg
48381b12faf6Smrg	case $host_cpu in
48391b12faf6Smrg	hppa*64*|ia64*)
48401b12faf6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
48411b12faf6Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
48421b12faf6Smrg	  ;;
48431b12faf6Smrg	*)
48441b12faf6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
48451b12faf6Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
48461b12faf6Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
484732b578d3Smrg
48481b12faf6Smrg	  # hardcode_minus_L: Not really in the search PATH,
48491b12faf6Smrg	  # but as the default location of the library.
48501b12faf6Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
48511b12faf6Smrg	  ;;
48521b12faf6Smrg	esac
48531b12faf6Smrg      fi
48542a51b5beSmrg      ;;
48551b12faf6Smrg
48561b12faf6Smrg    irix5* | irix6* | nonstopux*)
48571b12faf6Smrg      if test "$GCC" = yes; then
48581b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
48591b12faf6Smrg	# Try to use the -exported_symbol ld option, if it does not
48601b12faf6Smrg	# work, assume that -exports_file does not work either and
48611b12faf6Smrg	# implicitly export all symbols.
48621b12faf6Smrg        save_LDFLAGS="$LDFLAGS"
48631b12faf6Smrg        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
48641b12faf6Smrg        AC_LINK_IFELSE(int foo(void) {},
48651b12faf6Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
48661b12faf6Smrg        )
48671b12faf6Smrg        LDFLAGS="$save_LDFLAGS"
48681b12faf6Smrg      else
48691b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
48701b12faf6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
48711b12faf6Smrg      fi
48721b12faf6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
48731b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
48741b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
48751b12faf6Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
48761b12faf6Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
48772a51b5beSmrg      ;;
4878d31dbc53Smrg
48791b12faf6Smrg    netbsd* | netbsdelf*-gnu)
48801b12faf6Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
48811b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
48821b12faf6Smrg      else
48831b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
48841b12faf6Smrg      fi
48851b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
48861b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
48871b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
48881b12faf6Smrg      ;;
4889d31dbc53Smrg
48901b12faf6Smrg    newsos6)
48911b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
48921b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
48931b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
48941b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
48951b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
48961b12faf6Smrg      ;;
489732b578d3Smrg
48981b12faf6Smrg    *nto* | *qnx*)
48991b12faf6Smrg      ;;
490032b578d3Smrg
49011b12faf6Smrg    openbsd*)
49021b12faf6Smrg      if test -f /usr/libexec/ld.so; then
49031b12faf6Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
49041b12faf6Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
49051b12faf6Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
49061b12faf6Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
49071b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
49081b12faf6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
49091b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
49101b12faf6Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
49111b12faf6Smrg	else
49121b12faf6Smrg	  case $host_os in
49131b12faf6Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
49141b12faf6Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
49151b12faf6Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
49161b12faf6Smrg	     ;;
49171b12faf6Smrg	   *)
49181b12faf6Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
49191b12faf6Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
49201b12faf6Smrg	     ;;
49211b12faf6Smrg	  esac
49221b12faf6Smrg	fi
49231b12faf6Smrg      else
49241b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
49251b12faf6Smrg      fi
49261b12faf6Smrg      ;;
492732b578d3Smrg
49281b12faf6Smrg    os2*)
49291b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
49301b12faf6Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
49311b12faf6Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
49321b12faf6Smrg      _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'
49331b12faf6Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
49341b12faf6Smrg      ;;
493532b578d3Smrg
49361b12faf6Smrg    osf3*)
49371b12faf6Smrg      if test "$GCC" = yes; then
49381b12faf6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
49391b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
49401b12faf6Smrg      else
49411b12faf6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
49421b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
49431b12faf6Smrg      fi
49441b12faf6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
49451b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
49461b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
49471b12faf6Smrg      ;;
494832b578d3Smrg
49491b12faf6Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
49501b12faf6Smrg      if test "$GCC" = yes; then
49511b12faf6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
49521b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
49531b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
49541b12faf6Smrg      else
49551b12faf6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
49561b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
49571b12faf6Smrg	_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~
49581b12faf6Smrg	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
495932b578d3Smrg
49601b12faf6Smrg	# Both c and cxx compiler support -rpath directly
49611b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
49621b12faf6Smrg      fi
49631b12faf6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
49641b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
49651b12faf6Smrg      ;;
496632b578d3Smrg
49671b12faf6Smrg    solaris*)
49681b12faf6Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
49691b12faf6Smrg      if test "$GCC" = yes; then
49701b12faf6Smrg	wlarc='${wl}'
49711b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
49721b12faf6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
49731b12faf6Smrg	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
49741b12faf6Smrg      else
49751b12faf6Smrg	case `$CC -V 2>&1` in
49761b12faf6Smrg	*"Compilers 5.0"*)
49771b12faf6Smrg	  wlarc=''
49781b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
49791b12faf6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
49801b12faf6Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
49811b12faf6Smrg	  ;;
49821b12faf6Smrg	*)
49831b12faf6Smrg	  wlarc='${wl}'
49841b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
49851b12faf6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
49861b12faf6Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
49871b12faf6Smrg	  ;;
49881b12faf6Smrg	esac
49891b12faf6Smrg      fi
49901b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
49911b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
49921b12faf6Smrg      case $host_os in
49931b12faf6Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
49941b12faf6Smrg      *)
49951b12faf6Smrg	# The compiler driver will combine and reorder linker options,
49961b12faf6Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
49971b12faf6Smrg	# but is careful enough not to reorder.
49981b12faf6Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
49991b12faf6Smrg	if test "$GCC" = yes; then
50001b12faf6Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
50011b12faf6Smrg	else
50021b12faf6Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
50031b12faf6Smrg	fi
50041b12faf6Smrg	;;
50051b12faf6Smrg      esac
50061b12faf6Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
50071b12faf6Smrg      ;;
500832b578d3Smrg
50091b12faf6Smrg    sunos4*)
50101b12faf6Smrg      if test "x$host_vendor" = xsequent; then
50111b12faf6Smrg	# Use $CC to link under sequent, because it throws in some extra .o
50121b12faf6Smrg	# files that make .init and .fini sections work.
50131b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
50141b12faf6Smrg      else
50151b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
50161b12faf6Smrg      fi
50171b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
50181b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
50191b12faf6Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
50201b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
50211b12faf6Smrg      ;;
502232b578d3Smrg
50231b12faf6Smrg    sysv4)
50241b12faf6Smrg      case $host_vendor in
50251b12faf6Smrg	sni)
50261b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
50271b12faf6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
50281b12faf6Smrg	;;
50291b12faf6Smrg	siemens)
50301b12faf6Smrg	  ## LD is ld it makes a PLAMLIB
50311b12faf6Smrg	  ## CC just makes a GrossModule.
50321b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
50331b12faf6Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
50341b12faf6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
50351b12faf6Smrg        ;;
50361b12faf6Smrg	motorola)
50371b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
50381b12faf6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
50391b12faf6Smrg	;;
50401b12faf6Smrg      esac
50411b12faf6Smrg      runpath_var='LD_RUN_PATH'
50421b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
50431b12faf6Smrg      ;;
5044d31dbc53Smrg
50451b12faf6Smrg    sysv4.3*)
50461b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
50471b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
50481b12faf6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
50491b12faf6Smrg      ;;
505032b578d3Smrg
50511b12faf6Smrg    sysv4*MP*)
50521b12faf6Smrg      if test -d /usr/nec; then
50531b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
50541b12faf6Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
50551b12faf6Smrg	runpath_var=LD_RUN_PATH
50561b12faf6Smrg	hardcode_runpath_var=yes
50571b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
50581b12faf6Smrg      fi
50591b12faf6Smrg      ;;
506032b578d3Smrg
50611b12faf6Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
50621b12faf6Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
50631b12faf6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
50641b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
50651b12faf6Smrg      runpath_var='LD_RUN_PATH'
506632b578d3Smrg
50671b12faf6Smrg      if test "$GCC" = yes; then
50681b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
50691b12faf6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
50701b12faf6Smrg      else
50711b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
50721b12faf6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
50731b12faf6Smrg      fi
50741b12faf6Smrg      ;;
507532b578d3Smrg
50761b12faf6Smrg    sysv5* | sco3.2v5* | sco5v6*)
50771b12faf6Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
50781b12faf6Smrg      # link with -lc, and that would cause any symbols used from libc to
50791b12faf6Smrg      # always be unresolved, which means just about no library would
50801b12faf6Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
50811b12faf6Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
50821b12faf6Smrg      # as -z defs.
50831b12faf6Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
50841b12faf6Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
50851b12faf6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
50861b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
50871b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
50881b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
50891b12faf6Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
50901b12faf6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
50911b12faf6Smrg      runpath_var='LD_RUN_PATH'
509232b578d3Smrg
50931b12faf6Smrg      if test "$GCC" = yes; then
50941b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
50951b12faf6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
50961b12faf6Smrg      else
50971b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
50981b12faf6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
50991b12faf6Smrg      fi
51001b12faf6Smrg      ;;
510132b578d3Smrg
51021b12faf6Smrg    uts4*)
51031b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
51041b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
51051b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
51061b12faf6Smrg      ;;
510732b578d3Smrg
51081b12faf6Smrg    *)
51091b12faf6Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
51101b12faf6Smrg      ;;
51111b12faf6Smrg    esac
511232b578d3Smrg
51131b12faf6Smrg    if test x$host_vendor = xsni; then
51141b12faf6Smrg      case $host in
51151b12faf6Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
51161b12faf6Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
51171b12faf6Smrg	;;
51181b12faf6Smrg      esac
51191b12faf6Smrg    fi
51201b12faf6Smrg  fi
51211b12faf6Smrg])
51221b12faf6SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
51231b12faf6Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
512432b578d3Smrg
51251b12faf6Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
512632b578d3Smrg
51271b12faf6Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
51281b12faf6Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
51291b12faf6Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
51301b12faf6Smrg    [The commands to extract the exported symbol list from a shared archive])
5131d31dbc53Smrg
51321b12faf6Smrg#
51331b12faf6Smrg# Do we need to explicitly link libc?
51341b12faf6Smrg#
51351b12faf6Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
51361b12faf6Smrgx|xyes)
51371b12faf6Smrg  # Assume -lc should be added
51381b12faf6Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5139d31dbc53Smrg
51401b12faf6Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
51411b12faf6Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
51421b12faf6Smrg    *'~'*)
51431b12faf6Smrg      # FIXME: we may have to deal with multi-command sequences.
51441b12faf6Smrg      ;;
51451b12faf6Smrg    '$CC '*)
51461b12faf6Smrg      # Test whether the compiler implicitly links with -lc since on some
51471b12faf6Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
51481b12faf6Smrg      # to ld, don't add -lc before -lgcc.
51491b12faf6Smrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
51501b12faf6Smrg      $RM conftest*
51511b12faf6Smrg      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5152d31dbc53Smrg
51531b12faf6Smrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
51541b12faf6Smrg        soname=conftest
51551b12faf6Smrg        lib=conftest
51561b12faf6Smrg        libobjs=conftest.$ac_objext
51571b12faf6Smrg        deplibs=
51581b12faf6Smrg        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
51591b12faf6Smrg	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
51601b12faf6Smrg        compiler_flags=-v
51611b12faf6Smrg        linker_flags=-v
51621b12faf6Smrg        verstring=
51631b12faf6Smrg        output_objdir=.
51641b12faf6Smrg        libname=conftest
51651b12faf6Smrg        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
51661b12faf6Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=
51671b12faf6Smrg        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
51681b12faf6Smrg        then
51691b12faf6Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
51701b12faf6Smrg        else
51711b12faf6Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
51721b12faf6Smrg        fi
51731b12faf6Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
51741b12faf6Smrg      else
51751b12faf6Smrg        cat conftest.err 1>&5
51761b12faf6Smrg      fi
51771b12faf6Smrg      $RM conftest*
51781b12faf6Smrg      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
51791b12faf6Smrg      ;;
51801b12faf6Smrg    esac
51811b12faf6Smrg  fi
51821b12faf6Smrg  ;;
51831b12faf6Smrgesac
5184d31dbc53Smrg
51851b12faf6Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
51861b12faf6Smrg    [Whether or not to add -lc for building shared libraries])
51871b12faf6Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
51881b12faf6Smrg    [enable_shared_with_static_runtimes], [0],
51891b12faf6Smrg    [Whether or not to disallow shared libs when runtime libs are static])
51901b12faf6Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
51911b12faf6Smrg    [Compiler flag to allow reflexive dlopens])
51921b12faf6Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
51931b12faf6Smrg    [Compiler flag to generate shared objects directly from archives])
51941b12faf6Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
51951b12faf6Smrg    [Whether the compiler copes with passing no objects directly])
51961b12faf6Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
51971b12faf6Smrg    [Create an old-style archive from a shared archive])
51981b12faf6Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
51991b12faf6Smrg    [Create a temporary old-style archive to link instead of a shared archive])
52001b12faf6Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
52011b12faf6Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
52021b12faf6Smrg_LT_TAGDECL([], [module_cmds], [2],
52031b12faf6Smrg    [Commands used to build a loadable module if different from building
52041b12faf6Smrg    a shared archive.])
52051b12faf6Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
52061b12faf6Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
52071b12faf6Smrg    [Whether we are building with GNU ld or not])
52081b12faf6Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
52091b12faf6Smrg    [Flag that allows shared libraries with undefined symbols to be built])
52101b12faf6Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
52111b12faf6Smrg    [Flag that enforces no undefined symbols])
52121b12faf6Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
52131b12faf6Smrg    [Flag to hardcode $libdir into a binary during linking.
52141b12faf6Smrg    This must work even if $libdir does not exist])
52151b12faf6Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
52161b12faf6Smrg    [[If ld is used when linking, flag to hardcode $libdir into a binary
52171b12faf6Smrg    during linking.  This must work even if $libdir does not exist]])
52181b12faf6Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
52191b12faf6Smrg    [Whether we need a single "-rpath" flag with a separated argument])
52201b12faf6Smrg_LT_TAGDECL([], [hardcode_direct], [0],
52211b12faf6Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
52221b12faf6Smrg    DIR into the resulting binary])
52231b12faf6Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
52241b12faf6Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
52251b12faf6Smrg    DIR into the resulting binary and the resulting library dependency is
52261b12faf6Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
52271b12faf6Smrg    library is relocated])
52281b12faf6Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
52291b12faf6Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
52301b12faf6Smrg    into the resulting binary])
52311b12faf6Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
52321b12faf6Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
52331b12faf6Smrg    into the resulting binary])
52341b12faf6Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
52351b12faf6Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
52361b12faf6Smrg    into the library and all subsequent libraries and executables linked
52371b12faf6Smrg    against it])
52381b12faf6Smrg_LT_TAGDECL([], [inherit_rpath], [0],
52391b12faf6Smrg    [Set to yes if linker adds runtime paths of dependent libraries
52401b12faf6Smrg    to runtime path list])
52411b12faf6Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
52421b12faf6Smrg    [Whether libtool must link a program against all its dependency libraries])
52431b12faf6Smrg_LT_TAGDECL([], [fix_srcfile_path], [1],
52441b12faf6Smrg    [Fix the shell variable $srcfile for the compiler])
52451b12faf6Smrg_LT_TAGDECL([], [always_export_symbols], [0],
52461b12faf6Smrg    [Set to "yes" if exported symbols are required])
52471b12faf6Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
52481b12faf6Smrg    [The commands to list exported symbols])
52491b12faf6Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
52501b12faf6Smrg    [Symbols that should not be listed in the preloaded symbols])
52511b12faf6Smrg_LT_TAGDECL([], [include_expsyms], [1],
52521b12faf6Smrg    [Symbols that must always be exported])
52531b12faf6Smrg_LT_TAGDECL([], [prelink_cmds], [2],
52541b12faf6Smrg    [Commands necessary for linking programs (against libraries) with templates])
52551b12faf6Smrg_LT_TAGDECL([], [file_list_spec], [1],
52561b12faf6Smrg    [Specify filename containing input files])
52571b12faf6Smrgdnl FIXME: Not yet implemented
52581b12faf6Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
52591b12faf6Smrgdnl    [Compiler flag to generate thread safe objects])
52601b12faf6Smrg])# _LT_LINKER_SHLIBS
52611b12faf6Smrg
52621b12faf6Smrg
52631b12faf6Smrg# _LT_LANG_C_CONFIG([TAG])
52641b12faf6Smrg# ------------------------
52651b12faf6Smrg# Ensure that the configuration variables for a C compiler are suitably
52661b12faf6Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
52671b12faf6Smrg# the compiler configuration to `libtool'.
52681b12faf6Smrgm4_defun([_LT_LANG_C_CONFIG],
52691b12faf6Smrg[m4_require([_LT_DECL_EGREP])dnl
52701b12faf6Smrglt_save_CC="$CC"
52711b12faf6SmrgAC_LANG_PUSH(C)
5272d31dbc53Smrg
52731b12faf6Smrg# Source file extension for C test sources.
52741b12faf6Smrgac_ext=c
5275d31dbc53Smrg
52761b12faf6Smrg# Object file extension for compiled C test sources.
52771b12faf6Smrgobjext=o
52781b12faf6Smrg_LT_TAGVAR(objext, $1)=$objext
527932b578d3Smrg
52801b12faf6Smrg# Code to be used in simple compile tests
52811b12faf6Smrglt_simple_compile_test_code="int some_variable = 0;"
528232b578d3Smrg
52831b12faf6Smrg# Code to be used in simple link tests
52841b12faf6Smrglt_simple_link_test_code='int main(){return(0);}'
528532b578d3Smrg
52861b12faf6Smrg_LT_TAG_COMPILER
52871b12faf6Smrg# Save the default compiler, since it gets overwritten when the other
52881b12faf6Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
52891b12faf6Smrgcompiler_DEFAULT=$CC
529032b578d3Smrg
52911b12faf6Smrg# save warnings/boilerplate of simple test code
52921b12faf6Smrg_LT_COMPILER_BOILERPLATE
52931b12faf6Smrg_LT_LINKER_BOILERPLATE
529432b578d3Smrg
52951b12faf6Smrgif test -n "$compiler"; then
52961b12faf6Smrg  _LT_COMPILER_NO_RTTI($1)
52971b12faf6Smrg  _LT_COMPILER_PIC($1)
52981b12faf6Smrg  _LT_COMPILER_C_O($1)
52991b12faf6Smrg  _LT_COMPILER_FILE_LOCKS($1)
53001b12faf6Smrg  _LT_LINKER_SHLIBS($1)
53011b12faf6Smrg  _LT_SYS_DYNAMIC_LINKER($1)
53021b12faf6Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
53031b12faf6Smrg  LT_SYS_DLOPEN_SELF
53041b12faf6Smrg  _LT_CMD_STRIPLIB
53051b12faf6Smrg
53061b12faf6Smrg  # Report which library types will actually be built
53071b12faf6Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
53081b12faf6Smrg  AC_MSG_RESULT([$can_build_shared])
53091b12faf6Smrg
53101b12faf6Smrg  AC_MSG_CHECKING([whether to build shared libraries])
53111b12faf6Smrg  test "$can_build_shared" = "no" && enable_shared=no
53121b12faf6Smrg
53131b12faf6Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
53141b12faf6Smrg  # are all built from PIC.
53151b12faf6Smrg  case $host_os in
53161b12faf6Smrg  aix3*)
53171b12faf6Smrg    test "$enable_shared" = yes && enable_static=no
53181b12faf6Smrg    if test -n "$RANLIB"; then
53191b12faf6Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
53201b12faf6Smrg      postinstall_cmds='$RANLIB $lib'
53211b12faf6Smrg    fi
53221b12faf6Smrg    ;;
532332b578d3Smrg
53241b12faf6Smrg  aix[[4-9]]*)
53251b12faf6Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
53261b12faf6Smrg      test "$enable_shared" = yes && enable_static=no
53271b12faf6Smrg    fi
53281b12faf6Smrg    ;;
53291b12faf6Smrg  esac
53301b12faf6Smrg  AC_MSG_RESULT([$enable_shared])
533132b578d3Smrg
53321b12faf6Smrg  AC_MSG_CHECKING([whether to build static libraries])
53331b12faf6Smrg  # Make sure either enable_shared or enable_static is yes.
53341b12faf6Smrg  test "$enable_shared" = yes || enable_static=yes
53351b12faf6Smrg  AC_MSG_RESULT([$enable_static])
533632b578d3Smrg
53371b12faf6Smrg  _LT_CONFIG($1)
53381b12faf6Smrgfi
53391b12faf6SmrgAC_LANG_POP
53401b12faf6SmrgCC="$lt_save_CC"
53411b12faf6Smrg])# _LT_LANG_C_CONFIG
534232b578d3Smrg
534332b578d3Smrg
53441b12faf6Smrg# _LT_PROG_CXX
53451b12faf6Smrg# ------------
53461b12faf6Smrg# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
53471b12faf6Smrg# compiler, we have our own version here.
53481b12faf6Smrgm4_defun([_LT_PROG_CXX],
53491b12faf6Smrg[
53501b12faf6Smrgpushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
53511b12faf6SmrgAC_PROG_CXX
53521b12faf6Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
53531b12faf6Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
53541b12faf6Smrg    (test "X$CXX" != "Xg++"))) ; then
53551b12faf6Smrg  AC_PROG_CXXCPP
53561b12faf6Smrgelse
53571b12faf6Smrg  _lt_caught_CXX_error=yes
53581b12faf6Smrgfi
53591b12faf6Smrgpopdef([AC_MSG_ERROR])
53601b12faf6Smrg])# _LT_PROG_CXX
536132b578d3Smrg
53621b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
53631b12faf6Smrgdnl AC_DEFUN([_LT_PROG_CXX], [])
536432b578d3Smrg
536532b578d3Smrg
53661b12faf6Smrg# _LT_LANG_CXX_CONFIG([TAG])
53671b12faf6Smrg# --------------------------
53681b12faf6Smrg# Ensure that the configuration variables for a C++ compiler are suitably
53691b12faf6Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
53701b12faf6Smrg# the compiler configuration to `libtool'.
53711b12faf6Smrgm4_defun([_LT_LANG_CXX_CONFIG],
53721b12faf6Smrg[AC_REQUIRE([_LT_PROG_CXX])dnl
53731b12faf6Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
53741b12faf6Smrgm4_require([_LT_DECL_EGREP])dnl
53751b12faf6Smrg
53761b12faf6SmrgAC_LANG_PUSH(C++)
53771b12faf6Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
53781b12faf6Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
53791b12faf6Smrg_LT_TAGVAR(always_export_symbols, $1)=no
53801b12faf6Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
53811b12faf6Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
53821b12faf6Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
53831b12faf6Smrg_LT_TAGVAR(hardcode_direct, $1)=no
53841b12faf6Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
53851b12faf6Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
53861b12faf6Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
53871b12faf6Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
53881b12faf6Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
53891b12faf6Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
53901b12faf6Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
53911b12faf6Smrg_LT_TAGVAR(inherit_rpath, $1)=no
53921b12faf6Smrg_LT_TAGVAR(module_cmds, $1)=
53931b12faf6Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
53941b12faf6Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
53951b12faf6Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
53961b12faf6Smrg_LT_TAGVAR(no_undefined_flag, $1)=
53971b12faf6Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
53981b12faf6Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
539932b578d3Smrg
54001b12faf6Smrg# Source file extension for C++ test sources.
54011b12faf6Smrgac_ext=cpp
540232b578d3Smrg
54031b12faf6Smrg# Object file extension for compiled C++ test sources.
54041b12faf6Smrgobjext=o
54051b12faf6Smrg_LT_TAGVAR(objext, $1)=$objext
54061b12faf6Smrg
54071b12faf6Smrg# No sense in running all these tests if we already determined that
54081b12faf6Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
54091b12faf6Smrg# are currently assumed to apply to all compilers on this platform,
54101b12faf6Smrg# and will be corrupted by setting them based on a non-working compiler.
54111b12faf6Smrgif test "$_lt_caught_CXX_error" != yes; then
54121b12faf6Smrg  # Code to be used in simple compile tests
54131b12faf6Smrg  lt_simple_compile_test_code="int some_variable = 0;"
54141b12faf6Smrg
54151b12faf6Smrg  # Code to be used in simple link tests
54161b12faf6Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
54171b12faf6Smrg
54181b12faf6Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
54191b12faf6Smrg  _LT_TAG_COMPILER
54201b12faf6Smrg
54211b12faf6Smrg  # save warnings/boilerplate of simple test code
54221b12faf6Smrg  _LT_COMPILER_BOILERPLATE
54231b12faf6Smrg  _LT_LINKER_BOILERPLATE
54241b12faf6Smrg
54251b12faf6Smrg  # Allow CC to be a program name with arguments.
54261b12faf6Smrg  lt_save_CC=$CC
54271b12faf6Smrg  lt_save_LD=$LD
54281b12faf6Smrg  lt_save_GCC=$GCC
54291b12faf6Smrg  GCC=$GXX
54301b12faf6Smrg  lt_save_with_gnu_ld=$with_gnu_ld
54311b12faf6Smrg  lt_save_path_LD=$lt_cv_path_LD
54321b12faf6Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
54331b12faf6Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
54341b12faf6Smrg  else
54351b12faf6Smrg    $as_unset lt_cv_prog_gnu_ld
54361b12faf6Smrg  fi
54371b12faf6Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
54381b12faf6Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
54391b12faf6Smrg  else
54401b12faf6Smrg    $as_unset lt_cv_path_LD
54411b12faf6Smrg  fi
54421b12faf6Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
54431b12faf6Smrg  CC=${CXX-"c++"}
54441b12faf6Smrg  compiler=$CC
54451b12faf6Smrg  _LT_TAGVAR(compiler, $1)=$CC
54461b12faf6Smrg  _LT_CC_BASENAME([$compiler])
544732b578d3Smrg
54481b12faf6Smrg  if test -n "$compiler"; then
54491b12faf6Smrg    # We don't want -fno-exception when compiling C++ code, so set the
54501b12faf6Smrg    # no_builtin_flag separately
54511b12faf6Smrg    if test "$GXX" = yes; then
54521b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
54531b12faf6Smrg    else
54541b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
54551b12faf6Smrg    fi
545632b578d3Smrg
54571b12faf6Smrg    if test "$GXX" = yes; then
54581b12faf6Smrg      # Set up default GNU C++ configuration
545932b578d3Smrg
54601b12faf6Smrg      LT_PATH_LD
546132b578d3Smrg
54621b12faf6Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
54631b12faf6Smrg      # archiving commands below assume that GNU ld is being used.
54641b12faf6Smrg      if test "$with_gnu_ld" = yes; then
54651b12faf6Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
54661b12faf6Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
546732b578d3Smrg
54681b12faf6Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
54691b12faf6Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
547032b578d3Smrg
54711b12faf6Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
54721b12faf6Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
54731b12faf6Smrg        #     investigate it a little bit more. (MM)
54741b12faf6Smrg        wlarc='${wl}'
5475d31dbc53Smrg
54761b12faf6Smrg        # ancient GNU ld didn't support --whole-archive et. al.
54771b12faf6Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
54781b12faf6Smrg	  $GREP 'no-whole-archive' > /dev/null; then
54791b12faf6Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
54801b12faf6Smrg        else
54811b12faf6Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
54821b12faf6Smrg        fi
54831b12faf6Smrg      else
54841b12faf6Smrg        with_gnu_ld=no
54851b12faf6Smrg        wlarc=
54861b12faf6Smrg
54871b12faf6Smrg        # A generic and very simple default shared library creation
54881b12faf6Smrg        # command for GNU C++ for the case where it uses the native
54891b12faf6Smrg        # linker, instead of GNU ld.  If possible, this setting should
54901b12faf6Smrg        # overridden to take advantage of the native linker features on
54911b12faf6Smrg        # the platform it is being used on.
54921b12faf6Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
54931b12faf6Smrg      fi
549432b578d3Smrg
54951b12faf6Smrg      # Commands to make compiler produce verbose output that lists
54961b12faf6Smrg      # what "hidden" libraries, object files and flags are used when
54971b12faf6Smrg      # linking a shared library.
54981b12faf6Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
549932b578d3Smrg
55001b12faf6Smrg    else
55011b12faf6Smrg      GXX=no
55021b12faf6Smrg      with_gnu_ld=no
55031b12faf6Smrg      wlarc=
55041b12faf6Smrg    fi
550532b578d3Smrg
55061b12faf6Smrg    # PORTME: fill in a description of your system's C++ link characteristics
55071b12faf6Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
55081b12faf6Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
55091b12faf6Smrg    case $host_os in
55101b12faf6Smrg      aix3*)
55111b12faf6Smrg        # FIXME: insert proper C++ library support
55121b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
55131b12faf6Smrg        ;;
55141b12faf6Smrg      aix[[4-9]]*)
55151b12faf6Smrg        if test "$host_cpu" = ia64; then
55161b12faf6Smrg          # On IA64, the linker does run time linking by default, so we don't
55171b12faf6Smrg          # have to do anything special.
55181b12faf6Smrg          aix_use_runtimelinking=no
55191b12faf6Smrg          exp_sym_flag='-Bexport'
55201b12faf6Smrg          no_entry_flag=""
55211b12faf6Smrg        else
55221b12faf6Smrg          aix_use_runtimelinking=no
55231b12faf6Smrg
55241b12faf6Smrg          # Test if we are trying to use run time linking or normal
55251b12faf6Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
55261b12faf6Smrg          # need to do runtime linking.
55271b12faf6Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
55281b12faf6Smrg	    for ld_flag in $LDFLAGS; do
55291b12faf6Smrg	      case $ld_flag in
55301b12faf6Smrg	      *-brtl*)
55311b12faf6Smrg	        aix_use_runtimelinking=yes
55321b12faf6Smrg	        break
55331b12faf6Smrg	        ;;
55341b12faf6Smrg	      esac
55351b12faf6Smrg	    done
55361b12faf6Smrg	    ;;
55371b12faf6Smrg          esac
553832b578d3Smrg
55391b12faf6Smrg          exp_sym_flag='-bexport'
55401b12faf6Smrg          no_entry_flag='-bnoentry'
55411b12faf6Smrg        fi
554232b578d3Smrg
55431b12faf6Smrg        # When large executables or shared objects are built, AIX ld can
55441b12faf6Smrg        # have problems creating the table of contents.  If linking a library
55451b12faf6Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
55461b12faf6Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
55471b12faf6Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
55481b12faf6Smrg
55491b12faf6Smrg        _LT_TAGVAR(archive_cmds, $1)=''
55501b12faf6Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
55511b12faf6Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
55521b12faf6Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
55531b12faf6Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
55541b12faf6Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
55551b12faf6Smrg
55561b12faf6Smrg        if test "$GXX" = yes; then
55571b12faf6Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
55581b12faf6Smrg          # We only want to do this on AIX 4.2 and lower, the check
55591b12faf6Smrg          # below for broken collect2 doesn't work under 4.3+
55601b12faf6Smrg	  collect2name=`${CC} -print-prog-name=collect2`
55611b12faf6Smrg	  if test -f "$collect2name" &&
55621b12faf6Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
55631b12faf6Smrg	  then
55641b12faf6Smrg	    # We have reworked collect2
55651b12faf6Smrg	    :
55661b12faf6Smrg	  else
55671b12faf6Smrg	    # We have old collect2
55681b12faf6Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
55691b12faf6Smrg	    # It fails to find uninstalled libraries when the uninstalled
55701b12faf6Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
55711b12faf6Smrg	    # to unsupported forces relinking
55721b12faf6Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
55731b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
55741b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
55751b12faf6Smrg	  fi
55761b12faf6Smrg          esac
55771b12faf6Smrg          shared_flag='-shared'
55781b12faf6Smrg	  if test "$aix_use_runtimelinking" = yes; then
55791b12faf6Smrg	    shared_flag="$shared_flag "'${wl}-G'
55801b12faf6Smrg	  fi
55811b12faf6Smrg        else
55821b12faf6Smrg          # not using gcc
55831b12faf6Smrg          if test "$host_cpu" = ia64; then
55841b12faf6Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
55851b12faf6Smrg	  # chokes on -Wl,-G. The following line is correct:
55861b12faf6Smrg	  shared_flag='-G'
55871b12faf6Smrg          else
55881b12faf6Smrg	    if test "$aix_use_runtimelinking" = yes; then
55891b12faf6Smrg	      shared_flag='${wl}-G'
55901b12faf6Smrg	    else
55911b12faf6Smrg	      shared_flag='${wl}-bM:SRE'
55921b12faf6Smrg	    fi
55931b12faf6Smrg          fi
55941b12faf6Smrg        fi
559532b578d3Smrg
55961b12faf6Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
55971b12faf6Smrg        # It seems that -bexpall does not export symbols beginning with
55981b12faf6Smrg        # underscore (_), so it is better to generate a list of symbols to
55991b12faf6Smrg	# export.
56001b12faf6Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
56011b12faf6Smrg        if test "$aix_use_runtimelinking" = yes; then
56021b12faf6Smrg          # Warning - without using the other runtime loading flags (-brtl),
56031b12faf6Smrg          # -berok will link without error, but may produce a broken library.
56041b12faf6Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
56051b12faf6Smrg          # Determine the default libpath from the value encoded in an empty
56061b12faf6Smrg          # executable.
56071b12faf6Smrg          _LT_SYS_MODULE_PATH_AIX
56081b12faf6Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
56091b12faf6Smrg
56101b12faf6Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
56111b12faf6Smrg        else
56121b12faf6Smrg          if test "$host_cpu" = ia64; then
56131b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
56141b12faf6Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
56151b12faf6Smrg	    _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"
56161b12faf6Smrg          else
56171b12faf6Smrg	    # Determine the default libpath from the value encoded in an
56181b12faf6Smrg	    # empty executable.
56191b12faf6Smrg	    _LT_SYS_MODULE_PATH_AIX
56201b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
56211b12faf6Smrg	    # Warning - without using the other run time loading flags,
56221b12faf6Smrg	    # -berok will link without error, but may produce a broken library.
56231b12faf6Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
56241b12faf6Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
56251b12faf6Smrg	    # Exported symbols can be pulled into shared objects from archives
56261b12faf6Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
56271b12faf6Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
56281b12faf6Smrg	    # This is similar to how AIX traditionally builds its shared
56291b12faf6Smrg	    # libraries.
56301b12faf6Smrg	    _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'
56311b12faf6Smrg          fi
56321b12faf6Smrg        fi
56331b12faf6Smrg        ;;
563432b578d3Smrg
56351b12faf6Smrg      beos*)
56361b12faf6Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
56371b12faf6Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
56381b12faf6Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
56391b12faf6Smrg	  # support --undefined.  This deserves some investigation.  FIXME
56401b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
56411b12faf6Smrg	else
56421b12faf6Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
56431b12faf6Smrg	fi
56441b12faf6Smrg	;;
564532b578d3Smrg
56461b12faf6Smrg      chorus*)
56471b12faf6Smrg        case $cc_basename in
56481b12faf6Smrg          *)
56491b12faf6Smrg	  # FIXME: insert proper C++ library support
56501b12faf6Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
56511b12faf6Smrg	  ;;
56521b12faf6Smrg        esac
56531b12faf6Smrg        ;;
565432b578d3Smrg
56551b12faf6Smrg      cygwin* | mingw* | pw32* | cegcc*)
56561b12faf6Smrg        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
56571b12faf6Smrg        # as there is no search path for DLLs.
56581b12faf6Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
56591b12faf6Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
56601b12faf6Smrg        _LT_TAGVAR(always_export_symbols, $1)=no
56611b12faf6Smrg        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
56621b12faf6Smrg
56631b12faf6Smrg        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
56641b12faf6Smrg          _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'
56651b12faf6Smrg          # If the export-symbols file already is a .def file (1st line
56661b12faf6Smrg          # is EXPORTS), use it as is; otherwise, prepend...
56671b12faf6Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
56681b12faf6Smrg	    cp $export_symbols $output_objdir/$soname.def;
56691b12faf6Smrg          else
56701b12faf6Smrg	    echo EXPORTS > $output_objdir/$soname.def;
56711b12faf6Smrg	    cat $export_symbols >> $output_objdir/$soname.def;
56721b12faf6Smrg          fi~
56731b12faf6Smrg          $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'
56741b12faf6Smrg        else
56751b12faf6Smrg          _LT_TAGVAR(ld_shlibs, $1)=no
56761b12faf6Smrg        fi
56771b12faf6Smrg        ;;
56781b12faf6Smrg      darwin* | rhapsody*)
56791b12faf6Smrg        _LT_DARWIN_LINKER_FEATURES($1)
56801b12faf6Smrg	;;
568132b578d3Smrg
56821b12faf6Smrg      dgux*)
56831b12faf6Smrg        case $cc_basename in
56841b12faf6Smrg          ec++*)
56851b12faf6Smrg	    # FIXME: insert proper C++ library support
56861b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
56871b12faf6Smrg	    ;;
56881b12faf6Smrg          ghcx*)
56891b12faf6Smrg	    # Green Hills C++ Compiler
56901b12faf6Smrg	    # FIXME: insert proper C++ library support
56911b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
56921b12faf6Smrg	    ;;
56931b12faf6Smrg          *)
56941b12faf6Smrg	    # FIXME: insert proper C++ library support
56951b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
56961b12faf6Smrg	    ;;
56971b12faf6Smrg        esac
56981b12faf6Smrg        ;;
569932b578d3Smrg
57001b12faf6Smrg      freebsd[[12]]*)
57011b12faf6Smrg        # C++ shared libraries reported to be fairly broken before
57021b12faf6Smrg	# switch to ELF
57031b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
57041b12faf6Smrg        ;;
570532b578d3Smrg
57061b12faf6Smrg      freebsd-elf*)
57071b12faf6Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
57081b12faf6Smrg        ;;
570932b578d3Smrg
57101b12faf6Smrg      freebsd* | dragonfly*)
57111b12faf6Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
57121b12faf6Smrg        # conventions
57131b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
57141b12faf6Smrg        ;;
571532b578d3Smrg
57161b12faf6Smrg      gnu*)
57171b12faf6Smrg        ;;
571832b578d3Smrg
57191b12faf6Smrg      hpux9*)
57201b12faf6Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
57211b12faf6Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
57221b12faf6Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
57231b12faf6Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
57241b12faf6Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
57251b12faf6Smrg				             # but as the default
57261b12faf6Smrg				             # location of the library.
57271b12faf6Smrg
57281b12faf6Smrg        case $cc_basename in
57291b12faf6Smrg          CC*)
57301b12faf6Smrg            # FIXME: insert proper C++ library support
57311b12faf6Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
57321b12faf6Smrg            ;;
57331b12faf6Smrg          aCC*)
57341b12faf6Smrg            _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'
57351b12faf6Smrg            # Commands to make compiler produce verbose output that lists
57361b12faf6Smrg            # what "hidden" libraries, object files and flags are used when
57371b12faf6Smrg            # linking a shared library.
57381b12faf6Smrg            #
57391b12faf6Smrg            # There doesn't appear to be a way to prevent this compiler from
57401b12faf6Smrg            # explicitly linking system object files so we need to strip them
57411b12faf6Smrg            # from the output so that they don't get included in the library
57421b12faf6Smrg            # dependencies.
57431b12faf6Smrg            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
57441b12faf6Smrg            ;;
57451b12faf6Smrg          *)
57461b12faf6Smrg            if test "$GXX" = yes; then
57471b12faf6Smrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
57481b12faf6Smrg            else
57491b12faf6Smrg              # FIXME: insert proper C++ library support
57501b12faf6Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
57511b12faf6Smrg            fi
57521b12faf6Smrg            ;;
57531b12faf6Smrg        esac
57541b12faf6Smrg        ;;
575532b578d3Smrg
57561b12faf6Smrg      hpux10*|hpux11*)
57571b12faf6Smrg        if test $with_gnu_ld = no; then
57581b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
57591b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
57601b12faf6Smrg
57611b12faf6Smrg          case $host_cpu in
57621b12faf6Smrg            hppa*64*|ia64*)
57631b12faf6Smrg              ;;
57641b12faf6Smrg            *)
57651b12faf6Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
57661b12faf6Smrg              ;;
57671b12faf6Smrg          esac
57681b12faf6Smrg        fi
57691b12faf6Smrg        case $host_cpu in
57701b12faf6Smrg          hppa*64*|ia64*)
57711b12faf6Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
57721b12faf6Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
57731b12faf6Smrg            ;;
57741b12faf6Smrg          *)
57751b12faf6Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
57761b12faf6Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
57771b12faf6Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
57781b12faf6Smrg					         # but as the default
57791b12faf6Smrg					         # location of the library.
57801b12faf6Smrg            ;;
57811b12faf6Smrg        esac
57821b12faf6Smrg
57831b12faf6Smrg        case $cc_basename in
57841b12faf6Smrg          CC*)
57851b12faf6Smrg	    # FIXME: insert proper C++ library support
57861b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
57871b12faf6Smrg	    ;;
57881b12faf6Smrg          aCC*)
57891b12faf6Smrg	    case $host_cpu in
57901b12faf6Smrg	      hppa*64*)
57911b12faf6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
57921b12faf6Smrg	        ;;
57931b12faf6Smrg	      ia64*)
57941b12faf6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
57951b12faf6Smrg	        ;;
57961b12faf6Smrg	      *)
57971b12faf6Smrg	        _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'
57981b12faf6Smrg	        ;;
57991b12faf6Smrg	    esac
58001b12faf6Smrg	    # Commands to make compiler produce verbose output that lists
58011b12faf6Smrg	    # what "hidden" libraries, object files and flags are used when
58021b12faf6Smrg	    # linking a shared library.
58031b12faf6Smrg	    #
58041b12faf6Smrg	    # There doesn't appear to be a way to prevent this compiler from
58051b12faf6Smrg	    # explicitly linking system object files so we need to strip them
58061b12faf6Smrg	    # from the output so that they don't get included in the library
58071b12faf6Smrg	    # dependencies.
58081b12faf6Smrg	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
58091b12faf6Smrg	    ;;
58101b12faf6Smrg          *)
58111b12faf6Smrg	    if test "$GXX" = yes; then
58121b12faf6Smrg	      if test $with_gnu_ld = no; then
58131b12faf6Smrg	        case $host_cpu in
58141b12faf6Smrg	          hppa*64*)
58151b12faf6Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
58161b12faf6Smrg	            ;;
58171b12faf6Smrg	          ia64*)
58181b12faf6Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
58191b12faf6Smrg	            ;;
58201b12faf6Smrg	          *)
58211b12faf6Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
58221b12faf6Smrg	            ;;
58231b12faf6Smrg	        esac
58241b12faf6Smrg	      fi
58251b12faf6Smrg	    else
58261b12faf6Smrg	      # FIXME: insert proper C++ library support
58271b12faf6Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
58281b12faf6Smrg	    fi
58291b12faf6Smrg	    ;;
58301b12faf6Smrg        esac
58311b12faf6Smrg        ;;
583232b578d3Smrg
58331b12faf6Smrg      interix[[3-9]]*)
58341b12faf6Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
58351b12faf6Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58361b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
58371b12faf6Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
58381b12faf6Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
58391b12faf6Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
58401b12faf6Smrg	# default) and relocated if they conflict, which is a slow very memory
58411b12faf6Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
58421b12faf6Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
58431b12faf6Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
58441b12faf6Smrg	_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'
58451b12faf6Smrg	_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'
58461b12faf6Smrg	;;
58471b12faf6Smrg      irix5* | irix6*)
58481b12faf6Smrg        case $cc_basename in
58491b12faf6Smrg          CC*)
58501b12faf6Smrg	    # SGI C++
58511b12faf6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
58521b12faf6Smrg
58531b12faf6Smrg	    # Archives containing C++ object files must be created using
58541b12faf6Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
58551b12faf6Smrg	    # necessary to make sure instantiated templates are included
58561b12faf6Smrg	    # in the archive.
58571b12faf6Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
58581b12faf6Smrg	    ;;
58591b12faf6Smrg          *)
58601b12faf6Smrg	    if test "$GXX" = yes; then
58611b12faf6Smrg	      if test "$with_gnu_ld" = no; then
58621b12faf6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
58631b12faf6Smrg	      else
58641b12faf6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
58651b12faf6Smrg	      fi
58661b12faf6Smrg	    fi
58671b12faf6Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
58681b12faf6Smrg	    ;;
58691b12faf6Smrg        esac
58701b12faf6Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
58711b12faf6Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
58721b12faf6Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
58731b12faf6Smrg        ;;
587432b578d3Smrg
58751b12faf6Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
58761b12faf6Smrg        case $cc_basename in
58771b12faf6Smrg          KCC*)
58781b12faf6Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
587932b578d3Smrg
58801b12faf6Smrg	    # KCC will only create a shared library if the output file
58811b12faf6Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
58821b12faf6Smrg	    # to its proper name (with version) after linking.
58831b12faf6Smrg	    _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'
58841b12faf6Smrg	    _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'
58851b12faf6Smrg	    # Commands to make compiler produce verbose output that lists
58861b12faf6Smrg	    # what "hidden" libraries, object files and flags are used when
58871b12faf6Smrg	    # linking a shared library.
58881b12faf6Smrg	    #
58891b12faf6Smrg	    # There doesn't appear to be a way to prevent this compiler from
58901b12faf6Smrg	    # explicitly linking system object files so we need to strip them
58911b12faf6Smrg	    # from the output so that they don't get included in the library
58921b12faf6Smrg	    # dependencies.
58931b12faf6Smrg	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
58941b12faf6Smrg
58951b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
58961b12faf6Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
58971b12faf6Smrg
58981b12faf6Smrg	    # Archives containing C++ object files must be created using
58991b12faf6Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
59001b12faf6Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
59011b12faf6Smrg	    ;;
59021b12faf6Smrg	  icpc* | ecpc* )
59031b12faf6Smrg	    # Intel C++
59041b12faf6Smrg	    with_gnu_ld=yes
59051b12faf6Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
59061b12faf6Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
59071b12faf6Smrg	    # earlier do not add the objects themselves.
59081b12faf6Smrg	    case `$CC -V 2>&1` in
59091b12faf6Smrg	      *"Version 7."*)
59101b12faf6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
59111b12faf6Smrg		_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'
59121b12faf6Smrg		;;
59131b12faf6Smrg	      *)  # Version 8.0 or newer
59141b12faf6Smrg	        tmp_idyn=
59151b12faf6Smrg	        case $host_cpu in
59161b12faf6Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
59171b12faf6Smrg		esac
59181b12faf6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
59191b12faf6Smrg		_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'
59201b12faf6Smrg		;;
59211b12faf6Smrg	    esac
59221b12faf6Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
59231b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
59241b12faf6Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
59251b12faf6Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
59261b12faf6Smrg	    ;;
59271b12faf6Smrg          pgCC* | pgcpp*)
59281b12faf6Smrg            # Portland Group C++ compiler
59291b12faf6Smrg	    case `$CC -V` in
59301b12faf6Smrg	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
59311b12faf6Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
59321b12faf6Smrg		rm -rf $tpldir~
59331b12faf6Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
59341b12faf6Smrg		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
59351b12faf6Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
59361b12faf6Smrg		rm -rf $tpldir~
59371b12faf6Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
59381b12faf6Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
59391b12faf6Smrg		$RANLIB $oldlib'
59401b12faf6Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
59411b12faf6Smrg		rm -rf $tpldir~
59421b12faf6Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
59431b12faf6Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
59441b12faf6Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
59451b12faf6Smrg		rm -rf $tpldir~
59461b12faf6Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
59471b12faf6Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
59481b12faf6Smrg	      ;;
59491b12faf6Smrg	    *) # Version 6 will use weak symbols
59501b12faf6Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
59511b12faf6Smrg	      _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'
59521b12faf6Smrg	      ;;
59531b12faf6Smrg	    esac
595432b578d3Smrg
59551b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
59561b12faf6Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
59571b12faf6Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
59581b12faf6Smrg            ;;
59591b12faf6Smrg	  cxx*)
59601b12faf6Smrg	    # Compaq C++
59611b12faf6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
59621b12faf6Smrg	    _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'
596332b578d3Smrg
59641b12faf6Smrg	    runpath_var=LD_RUN_PATH
59651b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
59661b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
596732b578d3Smrg
59681b12faf6Smrg	    # Commands to make compiler produce verbose output that lists
59691b12faf6Smrg	    # what "hidden" libraries, object files and flags are used when
59701b12faf6Smrg	    # linking a shared library.
59711b12faf6Smrg	    #
59721b12faf6Smrg	    # There doesn't appear to be a way to prevent this compiler from
59731b12faf6Smrg	    # explicitly linking system object files so we need to strip them
59741b12faf6Smrg	    # from the output so that they don't get included in the library
59751b12faf6Smrg	    # dependencies.
59761b12faf6Smrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
59771b12faf6Smrg	    ;;
59781b12faf6Smrg	  xl*)
59791b12faf6Smrg	    # IBM XL 8.0 on PPC, with GNU ld
59801b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
59811b12faf6Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
59821b12faf6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
59831b12faf6Smrg	    if test "x$supports_anon_versioning" = xyes; then
59841b12faf6Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
59851b12faf6Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
59861b12faf6Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
59871b12faf6Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
59881b12faf6Smrg	    fi
59891b12faf6Smrg	    ;;
59901b12faf6Smrg	  *)
59911b12faf6Smrg	    case `$CC -V 2>&1 | sed 5q` in
59921b12faf6Smrg	    *Sun\ C*)
59931b12faf6Smrg	      # Sun C++ 5.9
59941b12faf6Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
59951b12faf6Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
59961b12faf6Smrg	      _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'
59971b12faf6Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
59981b12faf6Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
59991b12faf6Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
60001b12faf6Smrg
60011b12faf6Smrg	      # Not sure whether something based on
60021b12faf6Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
60031b12faf6Smrg	      # would be better.
60041b12faf6Smrg	      output_verbose_link_cmd='echo'
60051b12faf6Smrg
60061b12faf6Smrg	      # Archives containing C++ object files must be created using
60071b12faf6Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
60081b12faf6Smrg	      # necessary to make sure instantiated templates are included
60091b12faf6Smrg	      # in the archive.
60101b12faf6Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
60111b12faf6Smrg	      ;;
60121b12faf6Smrg	    esac
60131b12faf6Smrg	    ;;
60141b12faf6Smrg	esac
60151b12faf6Smrg	;;
601632b578d3Smrg
60171b12faf6Smrg      lynxos*)
60181b12faf6Smrg        # FIXME: insert proper C++ library support
60191b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
60201b12faf6Smrg	;;
602132b578d3Smrg
60221b12faf6Smrg      m88k*)
60231b12faf6Smrg        # FIXME: insert proper C++ library support
60241b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
60251b12faf6Smrg	;;
602632b578d3Smrg
60271b12faf6Smrg      mvs*)
60281b12faf6Smrg        case $cc_basename in
60291b12faf6Smrg          cxx*)
60301b12faf6Smrg	    # FIXME: insert proper C++ library support
60311b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
60321b12faf6Smrg	    ;;
60331b12faf6Smrg	  *)
60341b12faf6Smrg	    # FIXME: insert proper C++ library support
60351b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
60361b12faf6Smrg	    ;;
60371b12faf6Smrg	esac
60381b12faf6Smrg	;;
603932b578d3Smrg
60401b12faf6Smrg      netbsd*)
60411b12faf6Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
60421b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
60431b12faf6Smrg	  wlarc=
60441b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
60451b12faf6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
60461b12faf6Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60471b12faf6Smrg	fi
60481b12faf6Smrg	# Workaround some broken pre-1.5 toolchains
60491b12faf6Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
60501b12faf6Smrg	;;
605132b578d3Smrg
60521b12faf6Smrg      *nto* | *qnx*)
60531b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
60541b12faf6Smrg	;;
605532b578d3Smrg
60561b12faf6Smrg      openbsd2*)
60571b12faf6Smrg        # C++ shared libraries are fairly broken
60581b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
60591b12faf6Smrg	;;
606032b578d3Smrg
60611b12faf6Smrg      openbsd*)
60621b12faf6Smrg	if test -f /usr/libexec/ld.so; then
60631b12faf6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
60641b12faf6Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60651b12faf6Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
60661b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
60671b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
60681b12faf6Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
60691b12faf6Smrg	    _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'
60701b12faf6Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
60711b12faf6Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
60721b12faf6Smrg	  fi
60731b12faf6Smrg	  output_verbose_link_cmd=echo
60741b12faf6Smrg	else
60751b12faf6Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
60761b12faf6Smrg	fi
60771b12faf6Smrg	;;
607832b578d3Smrg
60791b12faf6Smrg      osf3* | osf4* | osf5*)
60801b12faf6Smrg        case $cc_basename in
60811b12faf6Smrg          KCC*)
60821b12faf6Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
60831b12faf6Smrg
60841b12faf6Smrg	    # KCC will only create a shared library if the output file
60851b12faf6Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
60861b12faf6Smrg	    # to its proper name (with version) after linking.
60871b12faf6Smrg	    _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'
60881b12faf6Smrg
60891b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
60901b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
60911b12faf6Smrg
60921b12faf6Smrg	    # Archives containing C++ object files must be created using
60931b12faf6Smrg	    # the KAI C++ compiler.
60941b12faf6Smrg	    case $host in
60951b12faf6Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
60961b12faf6Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
60971b12faf6Smrg	    esac
60981b12faf6Smrg	    ;;
60991b12faf6Smrg          RCC*)
61001b12faf6Smrg	    # Rational C++ 2.4.1
61011b12faf6Smrg	    # FIXME: insert proper C++ library support
61021b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
61031b12faf6Smrg	    ;;
61041b12faf6Smrg          cxx*)
61051b12faf6Smrg	    case $host in
61061b12faf6Smrg	      osf3*)
61071b12faf6Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
61081b12faf6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
61091b12faf6Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
61101b12faf6Smrg		;;
61111b12faf6Smrg	      *)
61121b12faf6Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
61131b12faf6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
61141b12faf6Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
61151b12faf6Smrg	          echo "-hidden">> $lib.exp~
61161b12faf6Smrg	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
61171b12faf6Smrg	          $RM $lib.exp'
61181b12faf6Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
61191b12faf6Smrg		;;
61201b12faf6Smrg	    esac
612132b578d3Smrg
61221b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
612332b578d3Smrg
61241b12faf6Smrg	    # Commands to make compiler produce verbose output that lists
61251b12faf6Smrg	    # what "hidden" libraries, object files and flags are used when
61261b12faf6Smrg	    # linking a shared library.
61271b12faf6Smrg	    #
61281b12faf6Smrg	    # There doesn't appear to be a way to prevent this compiler from
61291b12faf6Smrg	    # explicitly linking system object files so we need to strip them
61301b12faf6Smrg	    # from the output so that they don't get included in the library
61311b12faf6Smrg	    # dependencies.
61321b12faf6Smrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
61331b12faf6Smrg	    ;;
61341b12faf6Smrg	  *)
61351b12faf6Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
61361b12faf6Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
61371b12faf6Smrg	      case $host in
61381b12faf6Smrg	        osf3*)
61391b12faf6Smrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
61401b12faf6Smrg		  ;;
61411b12faf6Smrg	        *)
61421b12faf6Smrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
61431b12faf6Smrg		  ;;
61441b12faf6Smrg	      esac
61451b12faf6Smrg
61461b12faf6Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
61471b12faf6Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
61481b12faf6Smrg
61491b12faf6Smrg	      # Commands to make compiler produce verbose output that lists
61501b12faf6Smrg	      # what "hidden" libraries, object files and flags are used when
61511b12faf6Smrg	      # linking a shared library.
61521b12faf6Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
61531b12faf6Smrg
61541b12faf6Smrg	    else
61551b12faf6Smrg	      # FIXME: insert proper C++ library support
61561b12faf6Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
61571b12faf6Smrg	    fi
61581b12faf6Smrg	    ;;
61591b12faf6Smrg        esac
61601b12faf6Smrg        ;;
616132b578d3Smrg
61621b12faf6Smrg      psos*)
61631b12faf6Smrg        # FIXME: insert proper C++ library support
61641b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
61651b12faf6Smrg        ;;
616632b578d3Smrg
61671b12faf6Smrg      sunos4*)
61681b12faf6Smrg        case $cc_basename in
61691b12faf6Smrg          CC*)
61701b12faf6Smrg	    # Sun C++ 4.x
61711b12faf6Smrg	    # FIXME: insert proper C++ library support
61721b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
61731b12faf6Smrg	    ;;
61741b12faf6Smrg          lcc*)
61751b12faf6Smrg	    # Lucid
61761b12faf6Smrg	    # FIXME: insert proper C++ library support
61771b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
61781b12faf6Smrg	    ;;
61791b12faf6Smrg          *)
61801b12faf6Smrg	    # FIXME: insert proper C++ library support
61811b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
61821b12faf6Smrg	    ;;
61831b12faf6Smrg        esac
61841b12faf6Smrg        ;;
618532b578d3Smrg
61861b12faf6Smrg      solaris*)
61871b12faf6Smrg        case $cc_basename in
61881b12faf6Smrg          CC*)
61891b12faf6Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
61901b12faf6Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
61911b12faf6Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
61921b12faf6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
61931b12faf6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
61941b12faf6Smrg	      $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'
61951b12faf6Smrg
61961b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
61971b12faf6Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
61981b12faf6Smrg	    case $host_os in
61991b12faf6Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
62001b12faf6Smrg	      *)
62011b12faf6Smrg		# The compiler driver will combine and reorder linker options,
62021b12faf6Smrg		# but understands `-z linker_flag'.
62031b12faf6Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
62041b12faf6Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
62051b12faf6Smrg	        ;;
62061b12faf6Smrg	    esac
62071b12faf6Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
620832b578d3Smrg
62091b12faf6Smrg	    output_verbose_link_cmd='echo'
621032b578d3Smrg
62111b12faf6Smrg	    # Archives containing C++ object files must be created using
62121b12faf6Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
62131b12faf6Smrg	    # necessary to make sure instantiated templates are included
62141b12faf6Smrg	    # in the archive.
62151b12faf6Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
62161b12faf6Smrg	    ;;
62171b12faf6Smrg          gcx*)
62181b12faf6Smrg	    # Green Hills C++ Compiler
62191b12faf6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
622032b578d3Smrg
62211b12faf6Smrg	    # The C++ compiler must be used to create the archive.
62221b12faf6Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
62231b12faf6Smrg	    ;;
62241b12faf6Smrg          *)
62251b12faf6Smrg	    # GNU C++ compiler with Solaris linker
62261b12faf6Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
62271b12faf6Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
62281b12faf6Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
62291b12faf6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
62301b12faf6Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
62311b12faf6Smrg		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
62321b12faf6Smrg
62331b12faf6Smrg	        # Commands to make compiler produce verbose output that lists
62341b12faf6Smrg	        # what "hidden" libraries, object files and flags are used when
62351b12faf6Smrg	        # linking a shared library.
62361b12faf6Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
62371b12faf6Smrg	      else
62381b12faf6Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
62391b12faf6Smrg	        # platform.
62401b12faf6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
62411b12faf6Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
62421b12faf6Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
62431b12faf6Smrg
62441b12faf6Smrg	        # Commands to make compiler produce verbose output that lists
62451b12faf6Smrg	        # what "hidden" libraries, object files and flags are used when
62461b12faf6Smrg	        # linking a shared library.
62471b12faf6Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
62481b12faf6Smrg	      fi
62491b12faf6Smrg
62501b12faf6Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
62511b12faf6Smrg	      case $host_os in
62521b12faf6Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
62531b12faf6Smrg		*)
62541b12faf6Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
62551b12faf6Smrg		  ;;
62561b12faf6Smrg	      esac
62571b12faf6Smrg	    fi
62581b12faf6Smrg	    ;;
62591b12faf6Smrg        esac
62601b12faf6Smrg        ;;
626132b578d3Smrg
62621b12faf6Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
62631b12faf6Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
62641b12faf6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
62651b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
62661b12faf6Smrg      runpath_var='LD_RUN_PATH'
6267d31dbc53Smrg
62681b12faf6Smrg      case $cc_basename in
62691b12faf6Smrg        CC*)
62701b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
62711b12faf6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
62721b12faf6Smrg	  ;;
62731b12faf6Smrg	*)
62741b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
62751b12faf6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
62761b12faf6Smrg	  ;;
62771b12faf6Smrg      esac
62781b12faf6Smrg      ;;
6279d31dbc53Smrg
62801b12faf6Smrg      sysv5* | sco3.2v5* | sco5v6*)
62811b12faf6Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
62821b12faf6Smrg	# link with -lc, and that would cause any symbols used from libc to
62831b12faf6Smrg	# always be unresolved, which means just about no library would
62841b12faf6Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
62851b12faf6Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
62861b12faf6Smrg	# as -z defs.
62871b12faf6Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
62881b12faf6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
62891b12faf6Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
62901b12faf6Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
62911b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
62921b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
62931b12faf6Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
62941b12faf6Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
62951b12faf6Smrg	runpath_var='LD_RUN_PATH'
6296d31dbc53Smrg
62971b12faf6Smrg	case $cc_basename in
62981b12faf6Smrg          CC*)
62991b12faf6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
63001b12faf6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
63011b12faf6Smrg	    ;;
63021b12faf6Smrg	  *)
63031b12faf6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
63041b12faf6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
63051b12faf6Smrg	    ;;
63061b12faf6Smrg	esac
63071b12faf6Smrg      ;;
6308d31dbc53Smrg
63091b12faf6Smrg      tandem*)
63101b12faf6Smrg        case $cc_basename in
63111b12faf6Smrg          NCC*)
63121b12faf6Smrg	    # NonStop-UX NCC 3.20
63131b12faf6Smrg	    # FIXME: insert proper C++ library support
63141b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
63151b12faf6Smrg	    ;;
63161b12faf6Smrg          *)
63171b12faf6Smrg	    # FIXME: insert proper C++ library support
63181b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
63191b12faf6Smrg	    ;;
63201b12faf6Smrg        esac
63211b12faf6Smrg        ;;
6322d31dbc53Smrg
63231b12faf6Smrg      vxworks*)
63241b12faf6Smrg        # FIXME: insert proper C++ library support
63251b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
63261b12faf6Smrg        ;;
6327d31dbc53Smrg
63281b12faf6Smrg      *)
63291b12faf6Smrg        # FIXME: insert proper C++ library support
63301b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
63311b12faf6Smrg        ;;
63321b12faf6Smrg    esac
6333d31dbc53Smrg
63341b12faf6Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
63351b12faf6Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
63361b12faf6Smrg
63371b12faf6Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
63381b12faf6Smrg    _LT_TAGVAR(LD, $1)="$LD"
63391b12faf6Smrg
63401b12faf6Smrg    ## CAVEAT EMPTOR:
63411b12faf6Smrg    ## There is no encapsulation within the following macros, do not change
63421b12faf6Smrg    ## the running order or otherwise move them around unless you know exactly
63431b12faf6Smrg    ## what you are doing...
63441b12faf6Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
63451b12faf6Smrg    _LT_COMPILER_PIC($1)
63461b12faf6Smrg    _LT_COMPILER_C_O($1)
63471b12faf6Smrg    _LT_COMPILER_FILE_LOCKS($1)
63481b12faf6Smrg    _LT_LINKER_SHLIBS($1)
63491b12faf6Smrg    _LT_SYS_DYNAMIC_LINKER($1)
63501b12faf6Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
63511b12faf6Smrg
63521b12faf6Smrg    _LT_CONFIG($1)
63531b12faf6Smrg  fi # test -n "$compiler"
63541b12faf6Smrg
63551b12faf6Smrg  CC=$lt_save_CC
63561b12faf6Smrg  LDCXX=$LD
63571b12faf6Smrg  LD=$lt_save_LD
63581b12faf6Smrg  GCC=$lt_save_GCC
63591b12faf6Smrg  with_gnu_ld=$lt_save_with_gnu_ld
63601b12faf6Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
63611b12faf6Smrg  lt_cv_path_LD=$lt_save_path_LD
63621b12faf6Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
63631b12faf6Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
63641b12faf6Smrgfi # test "$_lt_caught_CXX_error" != yes
6365d31dbc53Smrg
63661b12faf6SmrgAC_LANG_POP
63671b12faf6Smrg])# _LT_LANG_CXX_CONFIG
6368d31dbc53Smrg
6369d31dbc53Smrg
63701b12faf6Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
63711b12faf6Smrg# ---------------------------------
63721b12faf6Smrg# Figure out "hidden" library dependencies from verbose
63731b12faf6Smrg# compiler output when linking a shared library.
63741b12faf6Smrg# Parse the compiler output and extract the necessary
63751b12faf6Smrg# objects, libraries and library flags.
63761b12faf6Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
63771b12faf6Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
63781b12faf6Smrg# Dependencies to place before and after the object being linked:
63791b12faf6Smrg_LT_TAGVAR(predep_objects, $1)=
63801b12faf6Smrg_LT_TAGVAR(postdep_objects, $1)=
63811b12faf6Smrg_LT_TAGVAR(predeps, $1)=
63821b12faf6Smrg_LT_TAGVAR(postdeps, $1)=
63831b12faf6Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
6384d31dbc53Smrg
63851b12faf6Smrgdnl we can't use the lt_simple_compile_test_code here,
63861b12faf6Smrgdnl because it contains code intended for an executable,
63871b12faf6Smrgdnl not a library.  It's possible we should let each
63881b12faf6Smrgdnl tag define a new lt_????_link_test_code variable,
63891b12faf6Smrgdnl but it's only used here...
63901b12faf6Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
63911b12faf6Smrgint a;
63921b12faf6Smrgvoid foo (void) { a = 0; }
63931b12faf6Smrg_LT_EOF
63941b12faf6Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
63951b12faf6Smrgclass Foo
63961b12faf6Smrg{
63971b12faf6Smrgpublic:
63981b12faf6Smrg  Foo (void) { a = 0; }
63991b12faf6Smrgprivate:
64001b12faf6Smrg  int a;
64011b12faf6Smrg};
64021b12faf6Smrg_LT_EOF
64031b12faf6Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
64041b12faf6Smrg      subroutine foo
64051b12faf6Smrg      implicit none
64061b12faf6Smrg      integer*4 a
64071b12faf6Smrg      a=0
64081b12faf6Smrg      return
64091b12faf6Smrg      end
64101b12faf6Smrg_LT_EOF
64111b12faf6Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
64121b12faf6Smrg      subroutine foo
64131b12faf6Smrg      implicit none
64141b12faf6Smrg      integer a
64151b12faf6Smrg      a=0
64161b12faf6Smrg      return
64171b12faf6Smrg      end
64181b12faf6Smrg_LT_EOF
64191b12faf6Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
64201b12faf6Smrgpublic class foo {
64211b12faf6Smrg  private int a;
64221b12faf6Smrg  public void bar (void) {
64231b12faf6Smrg    a = 0;
64241b12faf6Smrg  }
64251b12faf6Smrg};
64261b12faf6Smrg_LT_EOF
64272a51b5beSmrg])
64281b12faf6Smrgdnl Parse the compiler output and extract the necessary
64291b12faf6Smrgdnl objects, libraries and library flags.
64301b12faf6Smrgif AC_TRY_EVAL(ac_compile); then
64311b12faf6Smrg  # Parse the compiler output and extract the necessary
64321b12faf6Smrg  # objects, libraries and library flags.
6433d31dbc53Smrg
64341b12faf6Smrg  # Sentinel used to keep track of whether or not we are before
64351b12faf6Smrg  # the conftest object file.
64361b12faf6Smrg  pre_test_object_deps_done=no
6437d31dbc53Smrg
64381b12faf6Smrg  for p in `eval "$output_verbose_link_cmd"`; do
64391b12faf6Smrg    case $p in
6440d31dbc53Smrg
64411b12faf6Smrg    -L* | -R* | -l*)
64421b12faf6Smrg       # Some compilers place space between "-{L,R}" and the path.
64431b12faf6Smrg       # Remove the space.
64441b12faf6Smrg       if test $p = "-L" ||
64451b12faf6Smrg          test $p = "-R"; then
64461b12faf6Smrg	 prev=$p
64471b12faf6Smrg	 continue
64481b12faf6Smrg       else
64491b12faf6Smrg	 prev=
64501b12faf6Smrg       fi
6451d31dbc53Smrg
64521b12faf6Smrg       if test "$pre_test_object_deps_done" = no; then
64531b12faf6Smrg	 case $p in
64541b12faf6Smrg	 -L* | -R*)
64551b12faf6Smrg	   # Internal compiler library paths should come after those
64561b12faf6Smrg	   # provided the user.  The postdeps already come after the
64571b12faf6Smrg	   # user supplied libs so there is no need to process them.
64581b12faf6Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
64591b12faf6Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
64601b12faf6Smrg	   else
64611b12faf6Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
64621b12faf6Smrg	   fi
64631b12faf6Smrg	   ;;
64641b12faf6Smrg	 # The "-l" case would never come before the object being
64651b12faf6Smrg	 # linked, so don't bother handling this case.
64661b12faf6Smrg	 esac
64671b12faf6Smrg       else
64681b12faf6Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
64691b12faf6Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
64701b12faf6Smrg	 else
64711b12faf6Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
64721b12faf6Smrg	 fi
64731b12faf6Smrg       fi
64741b12faf6Smrg       ;;
6475d31dbc53Smrg
64761b12faf6Smrg    *.$objext)
64771b12faf6Smrg       # This assumes that the test object file only shows up
64781b12faf6Smrg       # once in the compiler output.
64791b12faf6Smrg       if test "$p" = "conftest.$objext"; then
64801b12faf6Smrg	 pre_test_object_deps_done=yes
64811b12faf6Smrg	 continue
64821b12faf6Smrg       fi
6483d31dbc53Smrg
64841b12faf6Smrg       if test "$pre_test_object_deps_done" = no; then
64851b12faf6Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
64861b12faf6Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
64871b12faf6Smrg	 else
64881b12faf6Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
64891b12faf6Smrg	 fi
64901b12faf6Smrg       else
64911b12faf6Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
64921b12faf6Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
64931b12faf6Smrg	 else
64941b12faf6Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
64951b12faf6Smrg	 fi
64961b12faf6Smrg       fi
64971b12faf6Smrg       ;;
649832b578d3Smrg
64991b12faf6Smrg    *) ;; # Ignore the rest.
6500d31dbc53Smrg
65011b12faf6Smrg    esac
65021b12faf6Smrg  done
6503d31dbc53Smrg
65041b12faf6Smrg  # Clean up.
65051b12faf6Smrg  rm -f a.out a.exe
65061b12faf6Smrgelse
65071b12faf6Smrg  echo "libtool.m4: error: problem compiling $1 test program"
65081b12faf6Smrgfi
6509d31dbc53Smrg
65101b12faf6Smrg$RM -f confest.$objext
65111b12faf6Smrg
65121b12faf6Smrg# PORTME: override above test on systems where it is broken
65131b12faf6Smrgm4_if([$1], [CXX],
65141b12faf6Smrg[case $host_os in
65151b12faf6Smrginterix[[3-9]]*)
65161b12faf6Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
65171b12faf6Smrg  # hack all around it, let's just trust "g++" to DTRT.
65181b12faf6Smrg  _LT_TAGVAR(predep_objects,$1)=
65191b12faf6Smrg  _LT_TAGVAR(postdep_objects,$1)=
65201b12faf6Smrg  _LT_TAGVAR(postdeps,$1)=
65212a51b5beSmrg  ;;
65221b12faf6Smrg
65231b12faf6Smrglinux*)
65241b12faf6Smrg  case `$CC -V 2>&1 | sed 5q` in
65251b12faf6Smrg  *Sun\ C*)
65261b12faf6Smrg    # Sun C++ 5.9
65271b12faf6Smrg
65281b12faf6Smrg    # The more standards-conforming stlport4 library is
65291b12faf6Smrg    # incompatible with the Cstd library. Avoid specifying
65301b12faf6Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
65311b12faf6Smrg    # -library=stlport4 depends on it.
65321b12faf6Smrg    case " $CXX $CXXFLAGS " in
65331b12faf6Smrg    *" -library=stlport4 "*)
65341b12faf6Smrg      solaris_use_stlport4=yes
65351b12faf6Smrg      ;;
65361b12faf6Smrg    esac
65371b12faf6Smrg
65381b12faf6Smrg    if test "$solaris_use_stlport4" != yes; then
65391b12faf6Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
65401b12faf6Smrg    fi
65411b12faf6Smrg    ;;
65421b12faf6Smrg  esac
65432a51b5beSmrg  ;;
65441b12faf6Smrg
65452a51b5beSmrgsolaris*)
65461b12faf6Smrg  case $cc_basename in
65471b12faf6Smrg  CC*)
65481b12faf6Smrg    # The more standards-conforming stlport4 library is
65491b12faf6Smrg    # incompatible with the Cstd library. Avoid specifying
65501b12faf6Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
65511b12faf6Smrg    # -library=stlport4 depends on it.
65521b12faf6Smrg    case " $CXX $CXXFLAGS " in
65531b12faf6Smrg    *" -library=stlport4 "*)
65541b12faf6Smrg      solaris_use_stlport4=yes
65551b12faf6Smrg      ;;
65561b12faf6Smrg    esac
655732b578d3Smrg
65581b12faf6Smrg    # Adding this requires a known-good setup of shared libraries for
65591b12faf6Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
65601b12faf6Smrg    # archive will be linked into the output, leading to subtle bugs.
65611b12faf6Smrg    if test "$solaris_use_stlport4" != yes; then
65621b12faf6Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
65631b12faf6Smrg    fi
65641b12faf6Smrg    ;;
65651b12faf6Smrg  esac
65662a51b5beSmrg  ;;
65672a51b5beSmrgesac
65681b12faf6Smrg])
656932b578d3Smrg
65701b12faf6Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
65711b12faf6Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
65722a51b5beSmrgesac
65731b12faf6Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
65741b12faf6Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
65751b12faf6Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
65761b12faf6Smrgfi
65771b12faf6Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
65781b12faf6Smrg    [The directories searched by this compiler when creating a shared library])
65791b12faf6Smrg_LT_TAGDECL([], [predep_objects], [1],
65801b12faf6Smrg    [Dependencies to place before and after the objects being linked to
65811b12faf6Smrg    create a shared library])
65821b12faf6Smrg_LT_TAGDECL([], [postdep_objects], [1])
65831b12faf6Smrg_LT_TAGDECL([], [predeps], [1])
65841b12faf6Smrg_LT_TAGDECL([], [postdeps], [1])
65851b12faf6Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
65861b12faf6Smrg    [The library search path used internally by the compiler when linking
65871b12faf6Smrg    a shared library])
65881b12faf6Smrg])# _LT_SYS_HIDDEN_LIBDEPS
65891b12faf6Smrg
65901b12faf6Smrg
65911b12faf6Smrg# _LT_PROG_F77
65921b12faf6Smrg# ------------
65931b12faf6Smrg# Since AC_PROG_F77 is broken, in that it returns the empty string
65941b12faf6Smrg# if there is no fortran compiler, we have our own version here.
65951b12faf6Smrgm4_defun([_LT_PROG_F77],
65961b12faf6Smrg[
65971b12faf6Smrgpushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
65981b12faf6SmrgAC_PROG_F77
65991b12faf6Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
66001b12faf6Smrg  _lt_disable_F77=yes
66011b12faf6Smrgfi
66021b12faf6Smrgpopdef([AC_MSG_ERROR])
66031b12faf6Smrg])# _LT_PROG_F77
660432b578d3Smrg
66051b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
66061b12faf6Smrgdnl AC_DEFUN([_LT_PROG_F77], [])
660732b578d3Smrg
660832b578d3Smrg
66091b12faf6Smrg# _LT_LANG_F77_CONFIG([TAG])
66101b12faf6Smrg# --------------------------
66111b12faf6Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
66121b12faf6Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
66131b12faf6Smrg# to write the compiler configuration to `libtool'.
66141b12faf6Smrgm4_defun([_LT_LANG_F77_CONFIG],
66151b12faf6Smrg[AC_REQUIRE([_LT_PROG_F77])dnl
66161b12faf6SmrgAC_LANG_PUSH(Fortran 77)
661732b578d3Smrg
66181b12faf6Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
66191b12faf6Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
66201b12faf6Smrg_LT_TAGVAR(always_export_symbols, $1)=no
66211b12faf6Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
66221b12faf6Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
66231b12faf6Smrg_LT_TAGVAR(hardcode_direct, $1)=no
66241b12faf6Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
66251b12faf6Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
66261b12faf6Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
66271b12faf6Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
66281b12faf6Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
66291b12faf6Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
66301b12faf6Smrg_LT_TAGVAR(inherit_rpath, $1)=no
66311b12faf6Smrg_LT_TAGVAR(module_cmds, $1)=
66321b12faf6Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
66331b12faf6Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
66341b12faf6Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
66351b12faf6Smrg_LT_TAGVAR(no_undefined_flag, $1)=
66361b12faf6Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
66371b12faf6Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
663832b578d3Smrg
66391b12faf6Smrg# Source file extension for f77 test sources.
66401b12faf6Smrgac_ext=f
664132b578d3Smrg
66421b12faf6Smrg# Object file extension for compiled f77 test sources.
66431b12faf6Smrgobjext=o
66441b12faf6Smrg_LT_TAGVAR(objext, $1)=$objext
66451b12faf6Smrg
66461b12faf6Smrg# No sense in running all these tests if we already determined that
66471b12faf6Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
66481b12faf6Smrg# are currently assumed to apply to all compilers on this platform,
66491b12faf6Smrg# and will be corrupted by setting them based on a non-working compiler.
66501b12faf6Smrgif test "$_lt_disable_F77" != yes; then
66511b12faf6Smrg  # Code to be used in simple compile tests
66521b12faf6Smrg  lt_simple_compile_test_code="\
66531b12faf6Smrg      subroutine t
66541b12faf6Smrg      return
66551b12faf6Smrg      end
66561b12faf6Smrg"
665732b578d3Smrg
66581b12faf6Smrg  # Code to be used in simple link tests
66591b12faf6Smrg  lt_simple_link_test_code="\
66601b12faf6Smrg      program t
66611b12faf6Smrg      end
66621b12faf6Smrg"
666332b578d3Smrg
66641b12faf6Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
66651b12faf6Smrg  _LT_TAG_COMPILER
666632b578d3Smrg
66671b12faf6Smrg  # save warnings/boilerplate of simple test code
66681b12faf6Smrg  _LT_COMPILER_BOILERPLATE
66691b12faf6Smrg  _LT_LINKER_BOILERPLATE
667032b578d3Smrg
66711b12faf6Smrg  # Allow CC to be a program name with arguments.
66721b12faf6Smrg  lt_save_CC="$CC"
66731b12faf6Smrg  lt_save_GCC=$GCC
66741b12faf6Smrg  CC=${F77-"f77"}
66751b12faf6Smrg  compiler=$CC
66761b12faf6Smrg  _LT_TAGVAR(compiler, $1)=$CC
66771b12faf6Smrg  _LT_CC_BASENAME([$compiler])
66781b12faf6Smrg  GCC=$G77
66791b12faf6Smrg  if test -n "$compiler"; then
66801b12faf6Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
66811b12faf6Smrg    AC_MSG_RESULT([$can_build_shared])
668232b578d3Smrg
66831b12faf6Smrg    AC_MSG_CHECKING([whether to build shared libraries])
66841b12faf6Smrg    test "$can_build_shared" = "no" && enable_shared=no
66851b12faf6Smrg
66861b12faf6Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
66871b12faf6Smrg    # are all built from PIC.
66881b12faf6Smrg    case $host_os in
66891b12faf6Smrg      aix3*)
66901b12faf6Smrg        test "$enable_shared" = yes && enable_static=no
66911b12faf6Smrg        if test -n "$RANLIB"; then
66921b12faf6Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
66931b12faf6Smrg          postinstall_cmds='$RANLIB $lib'
66941b12faf6Smrg        fi
66951b12faf6Smrg        ;;
66961b12faf6Smrg      aix[[4-9]]*)
66971b12faf6Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
66981b12faf6Smrg	  test "$enable_shared" = yes && enable_static=no
66992a51b5beSmrg	fi
67001b12faf6Smrg        ;;
67011b12faf6Smrg    esac
67021b12faf6Smrg    AC_MSG_RESULT([$enable_shared])
67031b12faf6Smrg
67041b12faf6Smrg    AC_MSG_CHECKING([whether to build static libraries])
67051b12faf6Smrg    # Make sure either enable_shared or enable_static is yes.
67061b12faf6Smrg    test "$enable_shared" = yes || enable_static=yes
67071b12faf6Smrg    AC_MSG_RESULT([$enable_static])
67081b12faf6Smrg
67091b12faf6Smrg    _LT_TAGVAR(GCC, $1)="$G77"
67101b12faf6Smrg    _LT_TAGVAR(LD, $1)="$LD"
67111b12faf6Smrg
67121b12faf6Smrg    ## CAVEAT EMPTOR:
67131b12faf6Smrg    ## There is no encapsulation within the following macros, do not change
67141b12faf6Smrg    ## the running order or otherwise move them around unless you know exactly
67151b12faf6Smrg    ## what you are doing...
67161b12faf6Smrg    _LT_COMPILER_PIC($1)
67171b12faf6Smrg    _LT_COMPILER_C_O($1)
67181b12faf6Smrg    _LT_COMPILER_FILE_LOCKS($1)
67191b12faf6Smrg    _LT_LINKER_SHLIBS($1)
67201b12faf6Smrg    _LT_SYS_DYNAMIC_LINKER($1)
67211b12faf6Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
67221b12faf6Smrg
67231b12faf6Smrg    _LT_CONFIG($1)
67241b12faf6Smrg  fi # test -n "$compiler"
67251b12faf6Smrg
67261b12faf6Smrg  GCC=$lt_save_GCC
67271b12faf6Smrg  CC="$lt_save_CC"
67281b12faf6Smrgfi # test "$_lt_disable_F77" != yes
672932b578d3Smrg
67301b12faf6SmrgAC_LANG_POP
67311b12faf6Smrg])# _LT_LANG_F77_CONFIG
67321b12faf6Smrg
67331b12faf6Smrg
67341b12faf6Smrg# _LT_PROG_FC
67351b12faf6Smrg# -----------
67361b12faf6Smrg# Since AC_PROG_FC is broken, in that it returns the empty string
67371b12faf6Smrg# if there is no fortran compiler, we have our own version here.
67381b12faf6Smrgm4_defun([_LT_PROG_FC],
67391b12faf6Smrg[
67401b12faf6Smrgpushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
67411b12faf6SmrgAC_PROG_FC
67421b12faf6Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
67431b12faf6Smrg  _lt_disable_FC=yes
67442a51b5beSmrgfi
67451b12faf6Smrgpopdef([AC_MSG_ERROR])
67461b12faf6Smrg])# _LT_PROG_FC
674732b578d3Smrg
67481b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
67491b12faf6Smrgdnl AC_DEFUN([_LT_PROG_FC], [])
675032b578d3Smrg
675132b578d3Smrg
67521b12faf6Smrg# _LT_LANG_FC_CONFIG([TAG])
67531b12faf6Smrg# -------------------------
67541b12faf6Smrg# Ensure that the configuration variables for a Fortran compiler are
67551b12faf6Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
67561b12faf6Smrg# to write the compiler configuration to `libtool'.
67571b12faf6Smrgm4_defun([_LT_LANG_FC_CONFIG],
67581b12faf6Smrg[AC_REQUIRE([_LT_PROG_FC])dnl
67591b12faf6SmrgAC_LANG_PUSH(Fortran)
67601b12faf6Smrg
67611b12faf6Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
67621b12faf6Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
67631b12faf6Smrg_LT_TAGVAR(always_export_symbols, $1)=no
67641b12faf6Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
67651b12faf6Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
67661b12faf6Smrg_LT_TAGVAR(hardcode_direct, $1)=no
67671b12faf6Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
67681b12faf6Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
67691b12faf6Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
67701b12faf6Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
67711b12faf6Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
67721b12faf6Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
67731b12faf6Smrg_LT_TAGVAR(inherit_rpath, $1)=no
67741b12faf6Smrg_LT_TAGVAR(module_cmds, $1)=
67751b12faf6Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
67761b12faf6Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
67771b12faf6Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
67781b12faf6Smrg_LT_TAGVAR(no_undefined_flag, $1)=
67791b12faf6Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
67801b12faf6Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
67811b12faf6Smrg
67821b12faf6Smrg# Source file extension for fc test sources.
67831b12faf6Smrgac_ext=${ac_fc_srcext-f}
67841b12faf6Smrg
67851b12faf6Smrg# Object file extension for compiled fc test sources.
67861b12faf6Smrgobjext=o
67871b12faf6Smrg_LT_TAGVAR(objext, $1)=$objext
67881b12faf6Smrg
67891b12faf6Smrg# No sense in running all these tests if we already determined that
67901b12faf6Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
67911b12faf6Smrg# are currently assumed to apply to all compilers on this platform,
67921b12faf6Smrg# and will be corrupted by setting them based on a non-working compiler.
67931b12faf6Smrgif test "$_lt_disable_FC" != yes; then
67941b12faf6Smrg  # Code to be used in simple compile tests
67951b12faf6Smrg  lt_simple_compile_test_code="\
67961b12faf6Smrg      subroutine t
67971b12faf6Smrg      return
67981b12faf6Smrg      end
67991b12faf6Smrg"
68001b12faf6Smrg
68011b12faf6Smrg  # Code to be used in simple link tests
68021b12faf6Smrg  lt_simple_link_test_code="\
68031b12faf6Smrg      program t
68041b12faf6Smrg      end
68051b12faf6Smrg"
680632b578d3Smrg
68071b12faf6Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
68081b12faf6Smrg  _LT_TAG_COMPILER
68091b12faf6Smrg
68101b12faf6Smrg  # save warnings/boilerplate of simple test code
68111b12faf6Smrg  _LT_COMPILER_BOILERPLATE
68121b12faf6Smrg  _LT_LINKER_BOILERPLATE
68131b12faf6Smrg
68141b12faf6Smrg  # Allow CC to be a program name with arguments.
68151b12faf6Smrg  lt_save_CC="$CC"
68161b12faf6Smrg  lt_save_GCC=$GCC
68171b12faf6Smrg  CC=${FC-"f95"}
68181b12faf6Smrg  compiler=$CC
68191b12faf6Smrg  GCC=$ac_cv_fc_compiler_gnu
68201b12faf6Smrg
68211b12faf6Smrg  _LT_TAGVAR(compiler, $1)=$CC
68221b12faf6Smrg  _LT_CC_BASENAME([$compiler])
68231b12faf6Smrg
68241b12faf6Smrg  if test -n "$compiler"; then
68251b12faf6Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
68261b12faf6Smrg    AC_MSG_RESULT([$can_build_shared])
68271b12faf6Smrg
68281b12faf6Smrg    AC_MSG_CHECKING([whether to build shared libraries])
68291b12faf6Smrg    test "$can_build_shared" = "no" && enable_shared=no
68301b12faf6Smrg
68311b12faf6Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
68321b12faf6Smrg    # are all built from PIC.
68332a51b5beSmrg    case $host_os in
68341b12faf6Smrg      aix3*)
68351b12faf6Smrg        test "$enable_shared" = yes && enable_static=no
68361b12faf6Smrg        if test -n "$RANLIB"; then
68371b12faf6Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
68381b12faf6Smrg          postinstall_cmds='$RANLIB $lib'
68391b12faf6Smrg        fi
68401b12faf6Smrg        ;;
68412a51b5beSmrg      aix[[4-9]]*)
68421b12faf6Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
68431b12faf6Smrg	  test "$enable_shared" = yes && enable_static=no
68442a51b5beSmrg	fi
68451b12faf6Smrg        ;;
68462a51b5beSmrg    esac
68471b12faf6Smrg    AC_MSG_RESULT([$enable_shared])
68481b12faf6Smrg
68491b12faf6Smrg    AC_MSG_CHECKING([whether to build static libraries])
68501b12faf6Smrg    # Make sure either enable_shared or enable_static is yes.
68511b12faf6Smrg    test "$enable_shared" = yes || enable_static=yes
68521b12faf6Smrg    AC_MSG_RESULT([$enable_static])
68531b12faf6Smrg
68541b12faf6Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
68551b12faf6Smrg    _LT_TAGVAR(LD, $1)="$LD"
68561b12faf6Smrg
68571b12faf6Smrg    ## CAVEAT EMPTOR:
68581b12faf6Smrg    ## There is no encapsulation within the following macros, do not change
68591b12faf6Smrg    ## the running order or otherwise move them around unless you know exactly
68601b12faf6Smrg    ## what you are doing...
68611b12faf6Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
68621b12faf6Smrg    _LT_COMPILER_PIC($1)
68631b12faf6Smrg    _LT_COMPILER_C_O($1)
68641b12faf6Smrg    _LT_COMPILER_FILE_LOCKS($1)
68651b12faf6Smrg    _LT_LINKER_SHLIBS($1)
68661b12faf6Smrg    _LT_SYS_DYNAMIC_LINKER($1)
68671b12faf6Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
68681b12faf6Smrg
68691b12faf6Smrg    _LT_CONFIG($1)
68701b12faf6Smrg  fi # test -n "$compiler"
68711b12faf6Smrg
68721b12faf6Smrg  GCC=$lt_save_GCC
68731b12faf6Smrg  CC="$lt_save_CC"
68741b12faf6Smrgfi # test "$_lt_disable_FC" != yes
68752a51b5beSmrg
68761b12faf6SmrgAC_LANG_POP
68771b12faf6Smrg])# _LT_LANG_FC_CONFIG
68782a51b5beSmrg
68792a51b5beSmrg
68801b12faf6Smrg# _LT_LANG_GCJ_CONFIG([TAG])
68811b12faf6Smrg# --------------------------
68821b12faf6Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
68831b12faf6Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
68841b12faf6Smrg# to write the compiler configuration to `libtool'.
68851b12faf6Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
68861b12faf6Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
68871b12faf6SmrgAC_LANG_SAVE
68882a51b5beSmrg
68891b12faf6Smrg# Source file extension for Java test sources.
68901b12faf6Smrgac_ext=java
68912a51b5beSmrg
68921b12faf6Smrg# Object file extension for compiled Java test sources.
68931b12faf6Smrgobjext=o
68941b12faf6Smrg_LT_TAGVAR(objext, $1)=$objext
68952a51b5beSmrg
68961b12faf6Smrg# Code to be used in simple compile tests
68971b12faf6Smrglt_simple_compile_test_code="class foo {}"
68982a51b5beSmrg
68991b12faf6Smrg# Code to be used in simple link tests
69001b12faf6Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
69012a51b5beSmrg
69021b12faf6Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
69031b12faf6Smrg_LT_TAG_COMPILER
69042a51b5beSmrg
69051b12faf6Smrg# save warnings/boilerplate of simple test code
69061b12faf6Smrg_LT_COMPILER_BOILERPLATE
69071b12faf6Smrg_LT_LINKER_BOILERPLATE
69082a51b5beSmrg
69091b12faf6Smrg# Allow CC to be a program name with arguments.
69101b12faf6Smrglt_save_CC="$CC"
69111b12faf6Smrglt_save_GCC=$GCC
69121b12faf6SmrgGCC=yes
69131b12faf6SmrgCC=${GCJ-"gcj"}
69141b12faf6Smrgcompiler=$CC
69151b12faf6Smrg_LT_TAGVAR(compiler, $1)=$CC
69161b12faf6Smrg_LT_TAGVAR(LD, $1)="$LD"
69171b12faf6Smrg_LT_CC_BASENAME([$compiler])
69182a51b5beSmrg
69191b12faf6Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
69201b12faf6Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
69212a51b5beSmrg
69221b12faf6Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
69232a51b5beSmrg
69241b12faf6Smrgif test -n "$compiler"; then
69251b12faf6Smrg  _LT_COMPILER_NO_RTTI($1)
69261b12faf6Smrg  _LT_COMPILER_PIC($1)
69271b12faf6Smrg  _LT_COMPILER_C_O($1)
69281b12faf6Smrg  _LT_COMPILER_FILE_LOCKS($1)
69291b12faf6Smrg  _LT_LINKER_SHLIBS($1)
69301b12faf6Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
69312a51b5beSmrg
69321b12faf6Smrg  _LT_CONFIG($1)
69331b12faf6Smrgfi
69342a51b5beSmrg
69351b12faf6SmrgAC_LANG_RESTORE
69362a51b5beSmrg
69371b12faf6SmrgGCC=$lt_save_GCC
69381b12faf6SmrgCC="$lt_save_CC"
69391b12faf6Smrg])# _LT_LANG_GCJ_CONFIG
69402a51b5beSmrg
69412a51b5beSmrg
69421b12faf6Smrg# _LT_LANG_RC_CONFIG([TAG])
69431b12faf6Smrg# -------------------------
69441b12faf6Smrg# Ensure that the configuration variables for the Windows resource compiler
69451b12faf6Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
69461b12faf6Smrg# to write the compiler configuration to `libtool'.
69471b12faf6Smrgm4_defun([_LT_LANG_RC_CONFIG],
69481b12faf6Smrg[AC_REQUIRE([LT_PROG_RC])dnl
69491b12faf6SmrgAC_LANG_SAVE
69501b12faf6Smrg
69511b12faf6Smrg# Source file extension for RC test sources.
69521b12faf6Smrgac_ext=rc
69531b12faf6Smrg
69541b12faf6Smrg# Object file extension for compiled RC test sources.
69551b12faf6Smrgobjext=o
69561b12faf6Smrg_LT_TAGVAR(objext, $1)=$objext
69571b12faf6Smrg
69581b12faf6Smrg# Code to be used in simple compile tests
69591b12faf6Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
69601b12faf6Smrg
69611b12faf6Smrg# Code to be used in simple link tests
69621b12faf6Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
69632a51b5beSmrg
69641b12faf6Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
69651b12faf6Smrg_LT_TAG_COMPILER
69662a51b5beSmrg
69671b12faf6Smrg# save warnings/boilerplate of simple test code
69681b12faf6Smrg_LT_COMPILER_BOILERPLATE
69691b12faf6Smrg_LT_LINKER_BOILERPLATE
69702a51b5beSmrg
69711b12faf6Smrg# Allow CC to be a program name with arguments.
69721b12faf6Smrglt_save_CC="$CC"
69731b12faf6Smrglt_save_GCC=$GCC
69741b12faf6SmrgGCC=
69751b12faf6SmrgCC=${RC-"windres"}
69761b12faf6Smrgcompiler=$CC
69771b12faf6Smrg_LT_TAGVAR(compiler, $1)=$CC
69781b12faf6Smrg_LT_CC_BASENAME([$compiler])
69791b12faf6Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
69802a51b5beSmrg
69811b12faf6Smrgif test -n "$compiler"; then
69821b12faf6Smrg  :
69831b12faf6Smrg  _LT_CONFIG($1)
69841b12faf6Smrgfi
69852a51b5beSmrg
69861b12faf6SmrgGCC=$lt_save_GCC
69871b12faf6SmrgAC_LANG_RESTORE
69881b12faf6SmrgCC="$lt_save_CC"
69891b12faf6Smrg])# _LT_LANG_RC_CONFIG
69902a51b5beSmrg
69912a51b5beSmrg
69921b12faf6Smrg# LT_PROG_GCJ
69931b12faf6Smrg# -----------
69941b12faf6SmrgAC_DEFUN([LT_PROG_GCJ],
69951b12faf6Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
69961b12faf6Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
69971b12faf6Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
69981b12faf6Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
69991b12faf6Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
70002a51b5beSmrg])
70012a51b5beSmrg
70021b12faf6Smrg# Old name:
70031b12faf6SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
70041b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
70051b12faf6Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
70062a51b5beSmrg
70071b12faf6Smrg
70081b12faf6Smrg# LT_PROG_RC
70091b12faf6Smrg# ----------
70101b12faf6SmrgAC_DEFUN([LT_PROG_RC],
70111b12faf6Smrg[AC_CHECK_TOOL(RC, windres,)
70122a51b5beSmrg])
70132a51b5beSmrg
70141b12faf6Smrg# Old name:
70151b12faf6SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
70161b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
70171b12faf6Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
70182a51b5beSmrg
70192a51b5beSmrg
70201b12faf6Smrg# _LT_DECL_EGREP
70211b12faf6Smrg# --------------
70221b12faf6Smrg# If we don't have a new enough Autoconf to choose the best grep
70231b12faf6Smrg# available, choose the one first in the user's PATH.
70241b12faf6Smrgm4_defun([_LT_DECL_EGREP],
70251b12faf6Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
70261b12faf6SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
70271b12faf6Smrgtest -z "$GREP" && GREP=grep
70281b12faf6Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
70291b12faf6Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
70301b12faf6Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
70311b12faf6Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
70321b12faf6SmrgAC_SUBST([GREP])
70331b12faf6Smrg])
70342a51b5beSmrg
703532b578d3Smrg
70361b12faf6Smrg# _LT_DECL_OBJDUMP
70371b12faf6Smrg# --------------
70381b12faf6Smrg# If we don't have a new enough Autoconf to choose the best objdump
70391b12faf6Smrg# available, choose the one first in the user's PATH.
70401b12faf6Smrgm4_defun([_LT_DECL_OBJDUMP],
70411b12faf6Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
70421b12faf6Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
70431b12faf6Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
70441b12faf6SmrgAC_SUBST([OBJDUMP])
70451b12faf6Smrg])
704632b578d3Smrg
704732b578d3Smrg
70481b12faf6Smrg# _LT_DECL_SED
70491b12faf6Smrg# ------------
70501b12faf6Smrg# Check for a fully-functional sed program, that truncates
70511b12faf6Smrg# as few characters as possible.  Prefer GNU sed if found.
70521b12faf6Smrgm4_defun([_LT_DECL_SED],
70531b12faf6Smrg[AC_PROG_SED
70541b12faf6Smrgtest -z "$SED" && SED=sed
70551b12faf6SmrgXsed="$SED -e 1s/^X//"
70561b12faf6Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
70571b12faf6Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
70581b12faf6Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
70591b12faf6Smrg])# _LT_DECL_SED
706032b578d3Smrg
70611b12faf6Smrgm4_ifndef([AC_PROG_SED], [
70621b12faf6Smrg# NOTE: This macro has been submitted for inclusion into   #
70631b12faf6Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
70641b12faf6Smrg#  a released version of Autoconf we should remove this    #
70651b12faf6Smrg#  macro and use it instead.                               #
706632b578d3Smrg
70671b12faf6Smrgm4_defun([AC_PROG_SED],
70681b12faf6Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
70691b12faf6SmrgAC_CACHE_VAL(lt_cv_path_SED,
70701b12faf6Smrg[# Loop through the user's path and test for sed and gsed.
70711b12faf6Smrg# Then use that list of sed's as ones to test for truncation.
70721b12faf6Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
70731b12faf6Smrgfor as_dir in $PATH
70741b12faf6Smrgdo
70751b12faf6Smrg  IFS=$as_save_IFS
70761b12faf6Smrg  test -z "$as_dir" && as_dir=.
70771b12faf6Smrg  for lt_ac_prog in sed gsed; do
70781b12faf6Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
70791b12faf6Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
70801b12faf6Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
70812a51b5beSmrg      fi
70821b12faf6Smrg    done
70831b12faf6Smrg  done
70841b12faf6Smrgdone
70851b12faf6SmrgIFS=$as_save_IFS
70861b12faf6Smrglt_ac_max=0
70871b12faf6Smrglt_ac_count=0
70881b12faf6Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
70891b12faf6Smrg# along with /bin/sed that truncates output.
70901b12faf6Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
70911b12faf6Smrg  test ! -f $lt_ac_sed && continue
70921b12faf6Smrg  cat /dev/null > conftest.in
70931b12faf6Smrg  lt_ac_count=0
70941b12faf6Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
70951b12faf6Smrg  # Check for GNU sed and select it if it is found.
70961b12faf6Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
70971b12faf6Smrg    lt_cv_path_SED=$lt_ac_sed
70981b12faf6Smrg    break
70991b12faf6Smrg  fi
71001b12faf6Smrg  while true; do
71011b12faf6Smrg    cat conftest.in conftest.in >conftest.tmp
71021b12faf6Smrg    mv conftest.tmp conftest.in
71031b12faf6Smrg    cp conftest.in conftest.nl
71041b12faf6Smrg    echo >>conftest.nl
71051b12faf6Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
71061b12faf6Smrg    cmp -s conftest.out conftest.nl || break
71071b12faf6Smrg    # 10000 chars as input seems more than enough
71081b12faf6Smrg    test $lt_ac_count -gt 10 && break
71091b12faf6Smrg    lt_ac_count=`expr $lt_ac_count + 1`
71101b12faf6Smrg    if test $lt_ac_count -gt $lt_ac_max; then
71111b12faf6Smrg      lt_ac_max=$lt_ac_count
71121b12faf6Smrg      lt_cv_path_SED=$lt_ac_sed
71131b12faf6Smrg    fi
71141b12faf6Smrg  done
71151b12faf6Smrgdone
71161b12faf6Smrg])
71171b12faf6SmrgSED=$lt_cv_path_SED
71181b12faf6SmrgAC_SUBST([SED])
71191b12faf6SmrgAC_MSG_RESULT([$SED])
71201b12faf6Smrg])#AC_PROG_SED
71211b12faf6Smrg])#m4_ifndef
712232b578d3Smrg
71231b12faf6Smrg# Old name:
71241b12faf6SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
71251b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
71261b12faf6Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
712732b578d3Smrg
712832b578d3Smrg
71291b12faf6Smrg# _LT_CHECK_SHELL_FEATURES
71301b12faf6Smrg# ------------------------
71311b12faf6Smrg# Find out whether the shell is Bourne or XSI compatible,
71321b12faf6Smrg# or has some other useful features.
71331b12faf6Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
71341b12faf6Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
71351b12faf6Smrg# Try some XSI features
71361b12faf6Smrgxsi_shell=no
71371b12faf6Smrg( _lt_dummy="a/b/c"
71381b12faf6Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
71391b12faf6Smrg      = c,a/b,, \
71401b12faf6Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
71411b12faf6Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
71421b12faf6Smrg  && xsi_shell=yes
71431b12faf6SmrgAC_MSG_RESULT([$xsi_shell])
71441b12faf6Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
71451b12faf6Smrg
71461b12faf6SmrgAC_MSG_CHECKING([whether the shell understands "+="])
71471b12faf6Smrglt_shell_append=no
71481b12faf6Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
71491b12faf6Smrg    >/dev/null 2>&1 \
71501b12faf6Smrg  && lt_shell_append=yes
71511b12faf6SmrgAC_MSG_RESULT([$lt_shell_append])
71521b12faf6Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
71531b12faf6Smrg
71541b12faf6Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
71551b12faf6Smrg  lt_unset=unset
71561b12faf6Smrgelse
71571b12faf6Smrg  lt_unset=false
71581b12faf6Smrgfi
71591b12faf6Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
71601b12faf6Smrg
71611b12faf6Smrg# test EBCDIC or ASCII
71621b12faf6Smrgcase `echo X|tr X '\101'` in
71631b12faf6Smrg A) # ASCII based system
71641b12faf6Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
71651b12faf6Smrg  lt_SP2NL='tr \040 \012'
71661b12faf6Smrg  lt_NL2SP='tr \015\012 \040\040'
71671b12faf6Smrg  ;;
71681b12faf6Smrg *) # EBCDIC based system
71691b12faf6Smrg  lt_SP2NL='tr \100 \n'
71701b12faf6Smrg  lt_NL2SP='tr \r\n \100\100'
71711b12faf6Smrg  ;;
71721b12faf6Smrgesac
71731b12faf6Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
71741b12faf6Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
71751b12faf6Smrg])# _LT_CHECK_SHELL_FEATURES
717632b578d3Smrg
717732b578d3Smrg
71781b12faf6Smrg# _LT_PROG_XSI_SHELLFNS
71791b12faf6Smrg# ---------------------
71801b12faf6Smrg# Bourne and XSI compatible variants of some useful shell functions.
71811b12faf6Smrgm4_defun([_LT_PROG_XSI_SHELLFNS],
71821b12faf6Smrg[case $xsi_shell in
71831b12faf6Smrg  yes)
71841b12faf6Smrg    cat << \_LT_EOF >> "$cfgfile"
71851b12faf6Smrg
71861b12faf6Smrg# func_dirname file append nondir_replacement
71871b12faf6Smrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
71881b12faf6Smrg# otherwise set result to NONDIR_REPLACEMENT.
71891b12faf6Smrgfunc_dirname ()
71901b12faf6Smrg{
71911b12faf6Smrg  case ${1} in
71921b12faf6Smrg    */*) func_dirname_result="${1%/*}${2}" ;;
71931b12faf6Smrg    *  ) func_dirname_result="${3}" ;;
71941b12faf6Smrg  esac
71951b12faf6Smrg}
719632b578d3Smrg
71971b12faf6Smrg# func_basename file
71981b12faf6Smrgfunc_basename ()
71991b12faf6Smrg{
72001b12faf6Smrg  func_basename_result="${1##*/}"
72011b12faf6Smrg}
720232b578d3Smrg
72031b12faf6Smrg# func_dirname_and_basename file append nondir_replacement
72041b12faf6Smrg# perform func_basename and func_dirname in a single function
72051b12faf6Smrg# call:
72061b12faf6Smrg#   dirname:  Compute the dirname of FILE.  If nonempty,
72071b12faf6Smrg#             add APPEND to the result, otherwise set result
72081b12faf6Smrg#             to NONDIR_REPLACEMENT.
72091b12faf6Smrg#             value returned in "$func_dirname_result"
72101b12faf6Smrg#   basename: Compute filename of FILE.
72111b12faf6Smrg#             value retuned in "$func_basename_result"
72121b12faf6Smrg# Implementation must be kept synchronized with func_dirname
72131b12faf6Smrg# and func_basename. For efficiency, we do not delegate to
72141b12faf6Smrg# those functions but instead duplicate the functionality here.
72151b12faf6Smrgfunc_dirname_and_basename ()
72161b12faf6Smrg{
72171b12faf6Smrg  case ${1} in
72181b12faf6Smrg    */*) func_dirname_result="${1%/*}${2}" ;;
72191b12faf6Smrg    *  ) func_dirname_result="${3}" ;;
72201b12faf6Smrg  esac
72211b12faf6Smrg  func_basename_result="${1##*/}"
72221b12faf6Smrg}
7223d31dbc53Smrg
72241b12faf6Smrg# func_stripname prefix suffix name
72251b12faf6Smrg# strip PREFIX and SUFFIX off of NAME.
72261b12faf6Smrg# PREFIX and SUFFIX must not contain globbing or regex special
72271b12faf6Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
72281b12faf6Smrg# dot (in which case that matches only a dot).
72291b12faf6Smrgfunc_stripname ()
72301b12faf6Smrg{
72311b12faf6Smrg  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
72321b12faf6Smrg  # positional parameters, so assign one to ordinary parameter first.
72331b12faf6Smrg  func_stripname_result=${3}
72341b12faf6Smrg  func_stripname_result=${func_stripname_result#"${1}"}
72351b12faf6Smrg  func_stripname_result=${func_stripname_result%"${2}"}
72361b12faf6Smrg}
7237d31dbc53Smrg
72381b12faf6Smrg# func_opt_split
72391b12faf6Smrgfunc_opt_split ()
72401b12faf6Smrg{
72411b12faf6Smrg  func_opt_split_opt=${1%%=*}
72421b12faf6Smrg  func_opt_split_arg=${1#*=}
72431b12faf6Smrg}
7244d31dbc53Smrg
72451b12faf6Smrg# func_lo2o object
72461b12faf6Smrgfunc_lo2o ()
72471b12faf6Smrg{
72481b12faf6Smrg  case ${1} in
72491b12faf6Smrg    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
72501b12faf6Smrg    *)    func_lo2o_result=${1} ;;
72511b12faf6Smrg  esac
72521b12faf6Smrg}
7253d31dbc53Smrg
72541b12faf6Smrg# func_xform libobj-or-source
72551b12faf6Smrgfunc_xform ()
72561b12faf6Smrg{
72571b12faf6Smrg  func_xform_result=${1%.*}.lo
72581b12faf6Smrg}
72592a51b5beSmrg
72601b12faf6Smrg# func_arith arithmetic-term...
72611b12faf6Smrgfunc_arith ()
72621b12faf6Smrg{
72631b12faf6Smrg  func_arith_result=$(( $[*] ))
72641b12faf6Smrg}
72652a51b5beSmrg
72661b12faf6Smrg# func_len string
72671b12faf6Smrg# STRING may not start with a hyphen.
72681b12faf6Smrgfunc_len ()
72691b12faf6Smrg{
72701b12faf6Smrg  func_len_result=${#1}
72711b12faf6Smrg}
72722a51b5beSmrg
72731b12faf6Smrg_LT_EOF
72741b12faf6Smrg    ;;
72751b12faf6Smrg  *) # Bourne compatible functions.
72761b12faf6Smrg    cat << \_LT_EOF >> "$cfgfile"
72771b12faf6Smrg
72781b12faf6Smrg# func_dirname file append nondir_replacement
72791b12faf6Smrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
72801b12faf6Smrg# otherwise set result to NONDIR_REPLACEMENT.
72811b12faf6Smrgfunc_dirname ()
72821b12faf6Smrg{
72831b12faf6Smrg  # Extract subdirectory from the argument.
72841b12faf6Smrg  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
72851b12faf6Smrg  if test "X$func_dirname_result" = "X${1}"; then
72861b12faf6Smrg    func_dirname_result="${3}"
72872a51b5beSmrg  else
72881b12faf6Smrg    func_dirname_result="$func_dirname_result${2}"
72891b12faf6Smrg  fi
72901b12faf6Smrg}
72912a51b5beSmrg
72921b12faf6Smrg# func_basename file
72931b12faf6Smrgfunc_basename ()
72941b12faf6Smrg{
72951b12faf6Smrg  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
72961b12faf6Smrg}
7297d31dbc53Smrg
72981b12faf6Smrgdnl func_dirname_and_basename
72991b12faf6Smrgdnl A portable version of this function is already defined in general.m4sh
73001b12faf6Smrgdnl so there is no need for it here.
73011b12faf6Smrg
73021b12faf6Smrg# func_stripname prefix suffix name
73031b12faf6Smrg# strip PREFIX and SUFFIX off of NAME.
73041b12faf6Smrg# PREFIX and SUFFIX must not contain globbing or regex special
73051b12faf6Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
73061b12faf6Smrg# dot (in which case that matches only a dot).
73071b12faf6Smrg# func_strip_suffix prefix name
73081b12faf6Smrgfunc_stripname ()
73091b12faf6Smrg{
73101b12faf6Smrg  case ${2} in
73111b12faf6Smrg    .*) func_stripname_result=`$ECHO "X${3}" \
73121b12faf6Smrg           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
73131b12faf6Smrg    *)  func_stripname_result=`$ECHO "X${3}" \
73141b12faf6Smrg           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
73151b12faf6Smrg  esac
73161b12faf6Smrg}
7317d31dbc53Smrg
73181b12faf6Smrg# sed scripts:
73191b12faf6Smrgmy_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
73201b12faf6Smrgmy_sed_long_arg='1s/^-[[^=]]*=//'
7321d31dbc53Smrg
73221b12faf6Smrg# func_opt_split
73231b12faf6Smrgfunc_opt_split ()
73241b12faf6Smrg{
73251b12faf6Smrg  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
73261b12faf6Smrg  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
73271b12faf6Smrg}
7328d31dbc53Smrg
73291b12faf6Smrg# func_lo2o object
73301b12faf6Smrgfunc_lo2o ()
73311b12faf6Smrg{
73321b12faf6Smrg  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
73331b12faf6Smrg}
7334d31dbc53Smrg
73351b12faf6Smrg# func_xform libobj-or-source
73361b12faf6Smrgfunc_xform ()
73371b12faf6Smrg{
73381b12faf6Smrg  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
73391b12faf6Smrg}
7340d31dbc53Smrg
73411b12faf6Smrg# func_arith arithmetic-term...
73421b12faf6Smrgfunc_arith ()
73431b12faf6Smrg{
73441b12faf6Smrg  func_arith_result=`expr "$[@]"`
73451b12faf6Smrg}
7346d31dbc53Smrg
73471b12faf6Smrg# func_len string
73481b12faf6Smrg# STRING may not start with a hyphen.
73491b12faf6Smrgfunc_len ()
73501b12faf6Smrg{
73511b12faf6Smrg  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
73521b12faf6Smrg}
7353d31dbc53Smrg
73541b12faf6Smrg_LT_EOF
73551b12faf6Smrgesac
7356d31dbc53Smrg
73571b12faf6Smrgcase $lt_shell_append in
73581b12faf6Smrg  yes)
73591b12faf6Smrg    cat << \_LT_EOF >> "$cfgfile"
7360d31dbc53Smrg
73611b12faf6Smrg# func_append var value
73621b12faf6Smrg# Append VALUE to the end of shell variable VAR.
73631b12faf6Smrgfunc_append ()
73641b12faf6Smrg{
73651b12faf6Smrg  eval "$[1]+=\$[2]"
73661b12faf6Smrg}
73671b12faf6Smrg_LT_EOF
73681b12faf6Smrg    ;;
73691b12faf6Smrg  *)
73701b12faf6Smrg    cat << \_LT_EOF >> "$cfgfile"
7371d31dbc53Smrg
73721b12faf6Smrg# func_append var value
73731b12faf6Smrg# Append VALUE to the end of shell variable VAR.
73741b12faf6Smrgfunc_append ()
73751b12faf6Smrg{
73761b12faf6Smrg  eval "$[1]=\$$[1]\$[2]"
73771b12faf6Smrg}
7378d31dbc53Smrg
73791b12faf6Smrg_LT_EOF
73801b12faf6Smrg    ;;
73811b12faf6Smrg  esac
73821b12faf6Smrg])
7383d31dbc53Smrg
73841b12faf6Smrg# Helper functions for option handling.                    -*- Autoconf -*-
73851b12faf6Smrg#
73861b12faf6Smrg#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
73871b12faf6Smrg#   Written by Gary V. Vaughan, 2004
73881b12faf6Smrg#
73891b12faf6Smrg# This file is free software; the Free Software Foundation gives
73901b12faf6Smrg# unlimited permission to copy and/or distribute it, with or without
73911b12faf6Smrg# modifications, as long as this notice is preserved.
7392d31dbc53Smrg
73931b12faf6Smrg# serial 6 ltoptions.m4
7394d31dbc53Smrg
73951b12faf6Smrg# This is to help aclocal find these macros, as it can't see m4_define.
73961b12faf6SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
7397d31dbc53Smrg
7398d31dbc53Smrg
73991b12faf6Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
74001b12faf6Smrg# ------------------------------------------
74011b12faf6Smrgm4_define([_LT_MANGLE_OPTION],
74021b12faf6Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
7403d31dbc53Smrg
7404d31dbc53Smrg
74051b12faf6Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
74061b12faf6Smrg# ---------------------------------------
74071b12faf6Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
74081b12faf6Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
74091b12faf6Smrg# saved as a flag.
74101b12faf6Smrgm4_define([_LT_SET_OPTION],
74111b12faf6Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
74121b12faf6Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
74131b12faf6Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
74141b12faf6Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
74151b12faf6Smrg])
74161b12faf6Smrg
74171b12faf6Smrg
74181b12faf6Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
74191b12faf6Smrg# ------------------------------------------------------------
74201b12faf6Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
74211b12faf6Smrgm4_define([_LT_IF_OPTION],
74221b12faf6Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
74231b12faf6Smrg
74241b12faf6Smrg
74251b12faf6Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
74261b12faf6Smrg# -------------------------------------------------------
74271b12faf6Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
74281b12faf6Smrg# are set.
74291b12faf6Smrgm4_define([_LT_UNLESS_OPTIONS],
74301b12faf6Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
74311b12faf6Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
74321b12faf6Smrg		      [m4_define([$0_found])])])[]dnl
74331b12faf6Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
74341b12faf6Smrg])[]dnl
74351b12faf6Smrg])
74361b12faf6Smrg
74371b12faf6Smrg
74381b12faf6Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
74391b12faf6Smrg# ----------------------------------------
74401b12faf6Smrg# OPTION-LIST is a space-separated list of Libtool options associated
74411b12faf6Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
74421b12faf6Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
74431b12faf6Smrg# the unknown option and exit.
74441b12faf6Smrgm4_defun([_LT_SET_OPTIONS],
74451b12faf6Smrg[# Set options
74461b12faf6Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
74471b12faf6Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
74481b12faf6Smrg
74491b12faf6Smrgm4_if([$1],[LT_INIT],[
74501b12faf6Smrg  dnl
74511b12faf6Smrg  dnl Simply set some default values (i.e off) if boolean options were not
74521b12faf6Smrg  dnl specified:
74531b12faf6Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
74541b12faf6Smrg  ])
74551b12faf6Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
74561b12faf6Smrg  ])
74571b12faf6Smrg  dnl
74581b12faf6Smrg  dnl If no reference was made to various pairs of opposing options, then
74591b12faf6Smrg  dnl we run the default mode handler for the pair.  For example, if neither
74601b12faf6Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
74611b12faf6Smrg  dnl archives by default:
74621b12faf6Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
74631b12faf6Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
74641b12faf6Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
74651b12faf6Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
74661b12faf6Smrg  		   [_LT_ENABLE_FAST_INSTALL])
74671b12faf6Smrg  ])
74681b12faf6Smrg])# _LT_SET_OPTIONS
74691b12faf6Smrg
74701b12faf6Smrg
74711b12faf6Smrg
74721b12faf6Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
74731b12faf6Smrg# -----------------------------------------
74741b12faf6Smrgm4_define([_LT_MANGLE_DEFUN],
74751b12faf6Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
74761b12faf6Smrg
7477d31dbc53Smrg
74781b12faf6Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
74791b12faf6Smrg# -----------------------------------------------
74801b12faf6Smrgm4_define([LT_OPTION_DEFINE],
74811b12faf6Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
74821b12faf6Smrg])# LT_OPTION_DEFINE
7483d31dbc53Smrg
7484d31dbc53Smrg
74851b12faf6Smrg# dlopen
74861b12faf6Smrg# ------
74871b12faf6SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
74881b12faf6Smrg])
7489d31dbc53Smrg
74901b12faf6SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
74911b12faf6Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
74921b12faf6SmrgAC_DIAGNOSE([obsolete],
74931b12faf6Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
74941b12faf6Smrgput the `dlopen' option into LT_INIT's first parameter.])
74951b12faf6Smrg])
7496d31dbc53Smrg
74971b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
74981b12faf6Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
7499d31dbc53Smrg
7500d31dbc53Smrg
75011b12faf6Smrg# win32-dll
75021b12faf6Smrg# ---------
75031b12faf6Smrg# Declare package support for building win32 dll's.
75041b12faf6SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
75051b12faf6Smrg[enable_win32_dll=yes
7506d31dbc53Smrg
75071b12faf6Smrgcase $host in
75081b12faf6Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
75091b12faf6Smrg  AC_CHECK_TOOL(AS, as, false)
75101b12faf6Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
75111b12faf6Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
75121b12faf6Smrg  ;;
75131b12faf6Smrgesac
7514d31dbc53Smrg
75151b12faf6Smrgtest -z "$AS" && AS=as
75161b12faf6Smrg_LT_DECL([], [AS],      [0], [Assembler program])dnl
7517d31dbc53Smrg
75181b12faf6Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
75191b12faf6Smrg_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
7520d31dbc53Smrg
75211b12faf6Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
75221b12faf6Smrg_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
75231b12faf6Smrg])# win32-dll
7524d31dbc53Smrg
75251b12faf6SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
75261b12faf6Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
75271b12faf6Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
75281b12faf6SmrgAC_DIAGNOSE([obsolete],
75291b12faf6Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
75301b12faf6Smrgput the `win32-dll' option into LT_INIT's first parameter.])
75311b12faf6Smrg])
7532d31dbc53Smrg
75331b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
75341b12faf6Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
7535d31dbc53Smrg
7536d31dbc53Smrg
75371b12faf6Smrg# _LT_ENABLE_SHARED([DEFAULT])
75381b12faf6Smrg# ----------------------------
75391b12faf6Smrg# implement the --enable-shared flag, and supports the `shared' and
75401b12faf6Smrg# `disable-shared' LT_INIT options.
75411b12faf6Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
75421b12faf6Smrgm4_define([_LT_ENABLE_SHARED],
75431b12faf6Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
75441b12faf6SmrgAC_ARG_ENABLE([shared],
75451b12faf6Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
75461b12faf6Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
75471b12faf6Smrg    [p=${PACKAGE-default}
75481b12faf6Smrg    case $enableval in
75491b12faf6Smrg    yes) enable_shared=yes ;;
75501b12faf6Smrg    no) enable_shared=no ;;
75511b12faf6Smrg    *)
75521b12faf6Smrg      enable_shared=no
75531b12faf6Smrg      # Look at the argument we got.  We use all the common list separators.
75541b12faf6Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
75551b12faf6Smrg      for pkg in $enableval; do
75561b12faf6Smrg	IFS="$lt_save_ifs"
75571b12faf6Smrg	if test "X$pkg" = "X$p"; then
75581b12faf6Smrg	  enable_shared=yes
75591b12faf6Smrg	fi
75601b12faf6Smrg      done
75611b12faf6Smrg      IFS="$lt_save_ifs"
75622a51b5beSmrg      ;;
75631b12faf6Smrg    esac],
75641b12faf6Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
7565d31dbc53Smrg
75661b12faf6Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
75671b12faf6Smrg	[Whether or not to build shared libraries])
75681b12faf6Smrg])# _LT_ENABLE_SHARED
7569d31dbc53Smrg
75701b12faf6SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
75711b12faf6SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
7572d31dbc53Smrg
75731b12faf6Smrg# Old names:
75741b12faf6SmrgAC_DEFUN([AC_ENABLE_SHARED],
75751b12faf6Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
75761b12faf6Smrg])
7577d31dbc53Smrg
75781b12faf6SmrgAC_DEFUN([AC_DISABLE_SHARED],
75791b12faf6Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
75801b12faf6Smrg])
7581d31dbc53Smrg
75821b12faf6SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
75831b12faf6SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
75841b12faf6Smrg
75851b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
75861b12faf6Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
75871b12faf6Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
7588d31dbc53Smrg
7589d31dbc53Smrg
7590d31dbc53Smrg
75911b12faf6Smrg# _LT_ENABLE_STATIC([DEFAULT])
75921b12faf6Smrg# ----------------------------
75931b12faf6Smrg# implement the --enable-static flag, and support the `static' and
75941b12faf6Smrg# `disable-static' LT_INIT options.
75951b12faf6Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
75961b12faf6Smrgm4_define([_LT_ENABLE_STATIC],
75971b12faf6Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
75981b12faf6SmrgAC_ARG_ENABLE([static],
75991b12faf6Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
76001b12faf6Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
76011b12faf6Smrg    [p=${PACKAGE-default}
76021b12faf6Smrg    case $enableval in
76031b12faf6Smrg    yes) enable_static=yes ;;
76041b12faf6Smrg    no) enable_static=no ;;
76052a51b5beSmrg    *)
76061b12faf6Smrg     enable_static=no
76071b12faf6Smrg      # Look at the argument we got.  We use all the common list separators.
76081b12faf6Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
76091b12faf6Smrg      for pkg in $enableval; do
76101b12faf6Smrg	IFS="$lt_save_ifs"
76111b12faf6Smrg	if test "X$pkg" = "X$p"; then
76121b12faf6Smrg	  enable_static=yes
76131b12faf6Smrg	fi
76141b12faf6Smrg      done
76151b12faf6Smrg      IFS="$lt_save_ifs"
76162a51b5beSmrg      ;;
76171b12faf6Smrg    esac],
76181b12faf6Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
76191b12faf6Smrg
76201b12faf6Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
76211b12faf6Smrg	[Whether or not to build static libraries])
76221b12faf6Smrg])# _LT_ENABLE_STATIC
76231b12faf6Smrg
76241b12faf6SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
76251b12faf6SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
76261b12faf6Smrg
76271b12faf6Smrg# Old names:
76281b12faf6SmrgAC_DEFUN([AC_ENABLE_STATIC],
76291b12faf6Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
76302a51b5beSmrg])
7631d31dbc53Smrg
76321b12faf6SmrgAC_DEFUN([AC_DISABLE_STATIC],
76331b12faf6Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
76341b12faf6Smrg])
7635d31dbc53Smrg
76361b12faf6SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
76371b12faf6SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
7638d31dbc53Smrg
76391b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
76401b12faf6Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
76411b12faf6Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
76421b12faf6Smrg
76431b12faf6Smrg
76441b12faf6Smrg
76451b12faf6Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
76461b12faf6Smrg# ----------------------------------
76471b12faf6Smrg# implement the --enable-fast-install flag, and support the `fast-install'
76481b12faf6Smrg# and `disable-fast-install' LT_INIT options.
76491b12faf6Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
76501b12faf6Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
76511b12faf6Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
76521b12faf6SmrgAC_ARG_ENABLE([fast-install],
76531b12faf6Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
76541b12faf6Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
76551b12faf6Smrg    [p=${PACKAGE-default}
76561b12faf6Smrg    case $enableval in
76571b12faf6Smrg    yes) enable_fast_install=yes ;;
76581b12faf6Smrg    no) enable_fast_install=no ;;
76591b12faf6Smrg    *)
76601b12faf6Smrg      enable_fast_install=no
76611b12faf6Smrg      # Look at the argument we got.  We use all the common list separators.
76621b12faf6Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
76631b12faf6Smrg      for pkg in $enableval; do
76641b12faf6Smrg	IFS="$lt_save_ifs"
76651b12faf6Smrg	if test "X$pkg" = "X$p"; then
76661b12faf6Smrg	  enable_fast_install=yes
76671b12faf6Smrg	fi
76681b12faf6Smrg      done
76691b12faf6Smrg      IFS="$lt_save_ifs"
76702a51b5beSmrg      ;;
76711b12faf6Smrg    esac],
76721b12faf6Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
7673d31dbc53Smrg
76741b12faf6Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
76751b12faf6Smrg	 [Whether or not to optimize for fast installation])dnl
76761b12faf6Smrg])# _LT_ENABLE_FAST_INSTALL
7677d31dbc53Smrg
76781b12faf6SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
76791b12faf6SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
76801b12faf6Smrg
76811b12faf6Smrg# Old names:
76821b12faf6SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
76831b12faf6Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
76841b12faf6SmrgAC_DIAGNOSE([obsolete],
76851b12faf6Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
76861b12faf6Smrgthe `fast-install' option into LT_INIT's first parameter.])
76871b12faf6Smrg])
7688d31dbc53Smrg
76891b12faf6SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
76901b12faf6Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
76911b12faf6SmrgAC_DIAGNOSE([obsolete],
76921b12faf6Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
76931b12faf6Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
76941b12faf6Smrg])
7695d31dbc53Smrg
76961b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
76971b12faf6Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
76981b12faf6Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
7699d31dbc53Smrg
7700d31dbc53Smrg
77011b12faf6Smrg# _LT_WITH_PIC([MODE])
77021b12faf6Smrg# --------------------
77031b12faf6Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
77041b12faf6Smrg# LT_INIT options.
77051b12faf6Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
77061b12faf6Smrgm4_define([_LT_WITH_PIC],
77071b12faf6Smrg[AC_ARG_WITH([pic],
77081b12faf6Smrg    [AS_HELP_STRING([--with-pic],
77091b12faf6Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
77101b12faf6Smrg    [pic_mode="$withval"],
77111b12faf6Smrg    [pic_mode=default])
7712d31dbc53Smrg
77131b12faf6Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
77141b12faf6Smrg
77151b12faf6Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
77161b12faf6Smrg])# _LT_WITH_PIC
77171b12faf6Smrg
77181b12faf6SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
77191b12faf6SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
77201b12faf6Smrg
77211b12faf6Smrg# Old name:
77221b12faf6SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
77231b12faf6Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
77241b12faf6SmrgAC_DIAGNOSE([obsolete],
77251b12faf6Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
77261b12faf6Smrgput the `pic-only' option into LT_INIT's first parameter.])
77272a51b5beSmrg])
7728d31dbc53Smrg
77291b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
77301b12faf6Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
7731d31dbc53Smrg
7732d31dbc53Smrg
77331b12faf6Smrgm4_define([_LTDL_MODE], [])
77341b12faf6SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
77351b12faf6Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
77361b12faf6SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
77371b12faf6Smrg		 [m4_define([_LTDL_MODE], [recursive])])
77381b12faf6SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
77391b12faf6Smrg		 [m4_define([_LTDL_MODE], [subproject])])
7740d31dbc53Smrg
77411b12faf6Smrgm4_define([_LTDL_TYPE], [])
77421b12faf6SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
77431b12faf6Smrg		 [m4_define([_LTDL_TYPE], [installable])])
77441b12faf6SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
77451b12faf6Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
7746d31dbc53Smrg
77471b12faf6Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
77481b12faf6Smrg#
77491b12faf6Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
77501b12faf6Smrg# Written by Gary V. Vaughan, 2004
77511b12faf6Smrg#
77521b12faf6Smrg# This file is free software; the Free Software Foundation gives
77531b12faf6Smrg# unlimited permission to copy and/or distribute it, with or without
77541b12faf6Smrg# modifications, as long as this notice is preserved.
77551b12faf6Smrg
77561b12faf6Smrg# serial 6 ltsugar.m4
77571b12faf6Smrg
77581b12faf6Smrg# This is to help aclocal find these macros, as it can't see m4_define.
77591b12faf6SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
77601b12faf6Smrg
77611b12faf6Smrg
77621b12faf6Smrg# lt_join(SEP, ARG1, [ARG2...])
77631b12faf6Smrg# -----------------------------
77641b12faf6Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
77651b12faf6Smrg# associated separator.
77661b12faf6Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
77671b12faf6Smrg# versions in m4sugar had bugs.
77681b12faf6Smrgm4_define([lt_join],
77691b12faf6Smrg[m4_if([$#], [1], [],
77701b12faf6Smrg       [$#], [2], [[$2]],
77711b12faf6Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
77721b12faf6Smrgm4_define([_lt_join],
77731b12faf6Smrg[m4_if([$#$2], [2], [],
77741b12faf6Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
77751b12faf6Smrg
77761b12faf6Smrg
77771b12faf6Smrg# lt_car(LIST)
77781b12faf6Smrg# lt_cdr(LIST)
77791b12faf6Smrg# ------------
77801b12faf6Smrg# Manipulate m4 lists.
77811b12faf6Smrg# These macros are necessary as long as will still need to support
77821b12faf6Smrg# Autoconf-2.59 which quotes differently.
77831b12faf6Smrgm4_define([lt_car], [[$1]])
77841b12faf6Smrgm4_define([lt_cdr],
77851b12faf6Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
77861b12faf6Smrg       [$#], 1, [],
77871b12faf6Smrg       [m4_dquote(m4_shift($@))])])
77881b12faf6Smrgm4_define([lt_unquote], $1)
77891b12faf6Smrg
77901b12faf6Smrg
77911b12faf6Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
77921b12faf6Smrg# ------------------------------------------
77931b12faf6Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
77941b12faf6Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
77951b12faf6Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
77961b12faf6Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
77971b12faf6Smrg# than defined and empty).
77981b12faf6Smrg#
77991b12faf6Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
78001b12faf6Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
78011b12faf6Smrgm4_define([lt_append],
78021b12faf6Smrg[m4_define([$1],
78031b12faf6Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
78041b12faf6Smrg
78051b12faf6Smrg
78061b12faf6Smrg
78071b12faf6Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
78081b12faf6Smrg# ----------------------------------------------------------
78091b12faf6Smrg# Produce a SEP delimited list of all paired combinations of elements of
78101b12faf6Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
78111b12faf6Smrg# has the form PREFIXmINFIXSUFFIXn.
78121b12faf6Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
78131b12faf6Smrgm4_define([lt_combine],
78141b12faf6Smrg[m4_if(m4_eval([$# > 3]), [1],
78151b12faf6Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
78161b12faf6Smrg[[m4_foreach([_Lt_prefix], [$2],
78171b12faf6Smrg	     [m4_foreach([_Lt_suffix],
78181b12faf6Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
78191b12faf6Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
78201b12faf6Smrg
78211b12faf6Smrg
78221b12faf6Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
78231b12faf6Smrg# -----------------------------------------------------------------------
78241b12faf6Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
78251b12faf6Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
78261b12faf6Smrgm4_define([lt_if_append_uniq],
78271b12faf6Smrg[m4_ifdef([$1],
78281b12faf6Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
78291b12faf6Smrg		 [lt_append([$1], [$2], [$3])$4],
78301b12faf6Smrg		 [$5])],
78311b12faf6Smrg	  [lt_append([$1], [$2], [$3])$4])])
78321b12faf6Smrg
78331b12faf6Smrg
78341b12faf6Smrg# lt_dict_add(DICT, KEY, VALUE)
78351b12faf6Smrg# -----------------------------
78361b12faf6Smrgm4_define([lt_dict_add],
78371b12faf6Smrg[m4_define([$1($2)], [$3])])
78381b12faf6Smrg
78391b12faf6Smrg
78401b12faf6Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
78411b12faf6Smrg# --------------------------------------------
78421b12faf6Smrgm4_define([lt_dict_add_subkey],
78431b12faf6Smrg[m4_define([$1($2:$3)], [$4])])
78441b12faf6Smrg
78451b12faf6Smrg
78461b12faf6Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
78471b12faf6Smrg# ----------------------------------
78481b12faf6Smrgm4_define([lt_dict_fetch],
78491b12faf6Smrg[m4_ifval([$3],
78501b12faf6Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
78511b12faf6Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
78521b12faf6Smrg
78531b12faf6Smrg
78541b12faf6Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
78551b12faf6Smrg# -----------------------------------------------------------------
78561b12faf6Smrgm4_define([lt_if_dict_fetch],
78571b12faf6Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
78581b12faf6Smrg	[$5],
78591b12faf6Smrg    [$6])])
78601b12faf6Smrg
78611b12faf6Smrg
78621b12faf6Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
78631b12faf6Smrg# --------------------------------------------------------------
78641b12faf6Smrgm4_define([lt_dict_filter],
78651b12faf6Smrg[m4_if([$5], [], [],
78661b12faf6Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
78671b12faf6Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
78681b12faf6Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
78692a51b5beSmrg])
78701b12faf6Smrg
78711b12faf6Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
78721b12faf6Smrg#
78731b12faf6Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
78741b12faf6Smrg#   Written by Scott James Remnant, 2004
78751b12faf6Smrg#
78761b12faf6Smrg# This file is free software; the Free Software Foundation gives
78771b12faf6Smrg# unlimited permission to copy and/or distribute it, with or without
78781b12faf6Smrg# modifications, as long as this notice is preserved.
78791b12faf6Smrg
78801b12faf6Smrg# Generated from ltversion.in.
78811b12faf6Smrg
78821b12faf6Smrg# serial 3017 ltversion.m4
78831b12faf6Smrg# This file is part of GNU Libtool
78841b12faf6Smrg
78851b12faf6Smrgm4_define([LT_PACKAGE_VERSION], [2.2.6b])
78861b12faf6Smrgm4_define([LT_PACKAGE_REVISION], [1.3017])
78871b12faf6Smrg
78881b12faf6SmrgAC_DEFUN([LTVERSION_VERSION],
78891b12faf6Smrg[macro_version='2.2.6b'
78901b12faf6Smrgmacro_revision='1.3017'
78911b12faf6Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
78921b12faf6Smrg_LT_DECL(, macro_revision, 0)
78932a51b5beSmrg])
7894d31dbc53Smrg
78951b12faf6Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
78961b12faf6Smrg#
78971b12faf6Smrg#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
78981b12faf6Smrg#   Written by Scott James Remnant, 2004.
78991b12faf6Smrg#
79001b12faf6Smrg# This file is free software; the Free Software Foundation gives
79011b12faf6Smrg# unlimited permission to copy and/or distribute it, with or without
79021b12faf6Smrg# modifications, as long as this notice is preserved.
79031b12faf6Smrg
79041b12faf6Smrg# serial 4 lt~obsolete.m4
79051b12faf6Smrg
79061b12faf6Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
79071b12faf6Smrg#
79081b12faf6Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
79091b12faf6Smrg# which have later been changed to m4_define as they aren't part of the
79101b12faf6Smrg# exported API, or moved to Autoconf or Automake where they belong.
79111b12faf6Smrg#
79121b12faf6Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
79131b12faf6Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
79141b12faf6Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
79151b12faf6Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
79161b12faf6Smrg# and doesn't know about Autoconf macros at all.)
79171b12faf6Smrg#
79181b12faf6Smrg# So we provide this file, which has a silly filename so it's always
79191b12faf6Smrg# included after everything else.  This provides aclocal with the
79201b12faf6Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
79211b12faf6Smrg# because those macros already exist, or will be overwritten later.
79221b12faf6Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
79231b12faf6Smrg#
79241b12faf6Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
79251b12faf6Smrg# Yes, that means every name once taken will need to remain here until
79261b12faf6Smrg# we give up compatibility with versions before 1.7, at which point
79271b12faf6Smrg# we need to keep only those names which we still refer to.
79281b12faf6Smrg
79291b12faf6Smrg# This is to help aclocal find these macros, as it can't see m4_define.
79301b12faf6SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
79311b12faf6Smrg
79321b12faf6Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
79331b12faf6Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
79341b12faf6Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
79351b12faf6Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
79361b12faf6Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
79371b12faf6Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
79381b12faf6Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
79391b12faf6Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
79401b12faf6Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
79411b12faf6Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
79421b12faf6Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
79431b12faf6Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
79441b12faf6Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
79451b12faf6Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
79461b12faf6Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
79471b12faf6Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
79481b12faf6Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
79491b12faf6Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
79501b12faf6Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
79511b12faf6Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
79521b12faf6Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
79531b12faf6Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
79541b12faf6Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
79551b12faf6Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
79561b12faf6Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
79571b12faf6Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
79581b12faf6Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
79591b12faf6Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
79601b12faf6Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
79611b12faf6Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
79621b12faf6Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
79631b12faf6Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
79641b12faf6Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
79651b12faf6Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
79661b12faf6Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
79671b12faf6Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
79681b12faf6Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
79691b12faf6Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
79701b12faf6Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
79711b12faf6Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
79721b12faf6Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
79731b12faf6Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
79741b12faf6Smrgm4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
79751b12faf6Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
79761b12faf6Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
79771b12faf6Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
79781b12faf6Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
79791b12faf6Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
79801b12faf6Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
79811b12faf6Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
79821b12faf6Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
79831b12faf6Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
79841b12faf6Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
79851b12faf6Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
79861b12faf6Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
79871b12faf6Smrg
79882a51b5beSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
79891b12faf6Smrg# serial 1 (pkg-config-0.24)
79902a51b5beSmrg# 
79912a51b5beSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
79922a51b5beSmrg#
79932a51b5beSmrg# This program is free software; you can redistribute it and/or modify
79942a51b5beSmrg# it under the terms of the GNU General Public License as published by
79952a51b5beSmrg# the Free Software Foundation; either version 2 of the License, or
79962a51b5beSmrg# (at your option) any later version.
79972a51b5beSmrg#
79982a51b5beSmrg# This program is distributed in the hope that it will be useful, but
79992a51b5beSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
80002a51b5beSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
80012a51b5beSmrg# General Public License for more details.
80022a51b5beSmrg#
80032a51b5beSmrg# You should have received a copy of the GNU General Public License
80042a51b5beSmrg# along with this program; if not, write to the Free Software
80052a51b5beSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
80062a51b5beSmrg#
80072a51b5beSmrg# As a special exception to the GNU General Public License, if you
80082a51b5beSmrg# distribute this file as part of a program that contains a
80092a51b5beSmrg# configuration script generated by Autoconf, you may include it under
80102a51b5beSmrg# the same distribution terms that you use for the rest of that program.
8011d31dbc53Smrg
80122a51b5beSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
80132a51b5beSmrg# ----------------------------------
80142a51b5beSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
80152a51b5beSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
80162a51b5beSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
80171b12faf6SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
80181b12faf6SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
80191b12faf6SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
80201b12faf6Smrg
80212a51b5beSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
80222a51b5beSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
8023d31dbc53Smrgfi
80242a51b5beSmrgif test -n "$PKG_CONFIG"; then
80252a51b5beSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
80262a51b5beSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
80272a51b5beSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
80282a51b5beSmrg		AC_MSG_RESULT([yes])
80292a51b5beSmrg	else
80302a51b5beSmrg		AC_MSG_RESULT([no])
80312a51b5beSmrg		PKG_CONFIG=""
80322a51b5beSmrg	fi
80332a51b5beSmrgfi[]dnl
80342a51b5beSmrg])# PKG_PROG_PKG_CONFIG
8035d31dbc53Smrg
80362a51b5beSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
80372a51b5beSmrg#
80382a51b5beSmrg# Check to see whether a particular set of modules exists.  Similar
80392a51b5beSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
80402a51b5beSmrg#
80411b12faf6Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
80421b12faf6Smrg# only at the first occurence in configure.ac, so if the first place
80431b12faf6Smrg# it's called might be skipped (such as if it is within an "if", you
80441b12faf6Smrg# have to call PKG_CHECK_EXISTS manually
80452a51b5beSmrg# --------------------------------------------------------------
80462a51b5beSmrgAC_DEFUN([PKG_CHECK_EXISTS],
80472a51b5beSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
80482a51b5beSmrgif test -n "$PKG_CONFIG" && \
80492a51b5beSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
80501b12faf6Smrg  m4_default([$2], [:])
80512a51b5beSmrgm4_ifvaln([$3], [else
80522a51b5beSmrg  $3])dnl
80532a51b5beSmrgfi])
8054d31dbc53Smrg
80552a51b5beSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
80562a51b5beSmrg# ---------------------------------------------
80572a51b5beSmrgm4_define([_PKG_CONFIG],
80582a51b5beSmrg[if test -n "$$1"; then
80592a51b5beSmrg    pkg_cv_[]$1="$$1"
80602a51b5beSmrg elif test -n "$PKG_CONFIG"; then
80612a51b5beSmrg    PKG_CHECK_EXISTS([$3],
80622a51b5beSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
80632a51b5beSmrg		     [pkg_failed=yes])
80642a51b5beSmrg else
80652a51b5beSmrg    pkg_failed=untried
80662a51b5beSmrgfi[]dnl
80672a51b5beSmrg])# _PKG_CONFIG
8068d31dbc53Smrg
80692a51b5beSmrg# _PKG_SHORT_ERRORS_SUPPORTED
80702a51b5beSmrg# -----------------------------
80712a51b5beSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
80722a51b5beSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
80732a51b5beSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
80742a51b5beSmrg        _pkg_short_errors_supported=yes
80752a51b5beSmrgelse
80762a51b5beSmrg        _pkg_short_errors_supported=no
80772a51b5beSmrgfi[]dnl
80782a51b5beSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
8079d31dbc53Smrg
8080d31dbc53Smrg
80812a51b5beSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
80822a51b5beSmrg# [ACTION-IF-NOT-FOUND])
80832a51b5beSmrg#
80842a51b5beSmrg#
80852a51b5beSmrg# Note that if there is a possibility the first call to
80862a51b5beSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
80872a51b5beSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
80882a51b5beSmrg#
80892a51b5beSmrg#
80902a51b5beSmrg# --------------------------------------------------------------
80912a51b5beSmrgAC_DEFUN([PKG_CHECK_MODULES],
80922a51b5beSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
80932a51b5beSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
80942a51b5beSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
8095d31dbc53Smrg
80962a51b5beSmrgpkg_failed=no
80972a51b5beSmrgAC_MSG_CHECKING([for $1])
8098d31dbc53Smrg
80992a51b5beSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
81002a51b5beSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
8101d31dbc53Smrg
81022a51b5beSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
81032a51b5beSmrgand $1[]_LIBS to avoid the need to call pkg-config.
81042a51b5beSmrgSee the pkg-config man page for more details.])
8105d31dbc53Smrg
81062a51b5beSmrgif test $pkg_failed = yes; then
81071b12faf6Smrg   	AC_MSG_RESULT([no])
81082a51b5beSmrg        _PKG_SHORT_ERRORS_SUPPORTED
81092a51b5beSmrg        if test $_pkg_short_errors_supported = yes; then
81102a51b5beSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
81112a51b5beSmrg        else 
81122a51b5beSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
81132a51b5beSmrg        fi
81142a51b5beSmrg	# Put the nasty error message in config.log where it belongs
81152a51b5beSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8116d31dbc53Smrg
81171b12faf6Smrg	m4_default([$4], [AC_MSG_ERROR(
81182a51b5beSmrg[Package requirements ($2) were not met:
8119d31dbc53Smrg
81202a51b5beSmrg$$1_PKG_ERRORS
8121d31dbc53Smrg
81222a51b5beSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
81232a51b5beSmrginstalled software in a non-standard prefix.
8124d31dbc53Smrg
81251b12faf6Smrg_PKG_TEXT])[]dnl
81261b12faf6Smrg        ])
81272a51b5beSmrgelif test $pkg_failed = untried; then
81281b12faf6Smrg     	AC_MSG_RESULT([no])
81291b12faf6Smrg	m4_default([$4], [AC_MSG_FAILURE(
81302a51b5beSmrg[The pkg-config script could not be found or is too old.  Make sure it
81312a51b5beSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
81322a51b5beSmrgpath to pkg-config.
8133d31dbc53Smrg
81342a51b5beSmrg_PKG_TEXT
8135d31dbc53Smrg
81361b12faf6SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
81371b12faf6Smrg        ])
81382a51b5beSmrgelse
81392a51b5beSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
81402a51b5beSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
81412a51b5beSmrg        AC_MSG_RESULT([yes])
81421b12faf6Smrg	$3
81432a51b5beSmrgfi[]dnl
81442a51b5beSmrg])# PKG_CHECK_MODULES
8145d31dbc53Smrg
81462a51b5beSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
81472a51b5beSmrgdnl
81482a51b5beSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
81492a51b5beSmrgdnl 
81502a51b5beSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
81511b12faf6Smrgdnl copy of this software and associated documentation files (the "Software"),
81521b12faf6Smrgdnl to deal in the Software without restriction, including without limitation
81531b12faf6Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
81541b12faf6Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
81551b12faf6Smrgdnl Software is furnished to do so, subject to the following conditions:
81562a51b5beSmrgdnl
81571b12faf6Smrgdnl The above copyright notice and this permission notice (including the next
81581b12faf6Smrgdnl paragraph) shall be included in all copies or substantial portions of the
81591b12faf6Smrgdnl Software.
81602a51b5beSmrgdnl
81611b12faf6Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
81621b12faf6Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
81631b12faf6Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
81641b12faf6Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
81651b12faf6Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
81661b12faf6Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
81671b12faf6Smrgdnl DEALINGS IN THE SOFTWARE.
8168d31dbc53Smrg
81692a51b5beSmrg# XORG_MACROS_VERSION(required-version)
81702a51b5beSmrg# -------------------------------------
81712a51b5beSmrg# Minimum version: 1.1.0
81722a51b5beSmrg#
81732a51b5beSmrg# If you're using a macro added in Version 1.1 or newer, include this in
81742a51b5beSmrg# your configure.ac with the minimum required version, such as:
81752a51b5beSmrg# XORG_MACROS_VERSION(1.1)
81762a51b5beSmrg#
81771b12faf6Smrg# To ensure that this macro is defined, also add:
81781b12faf6Smrg# m4_ifndef([XORG_MACROS_VERSION],
81791b12faf6Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
81802a51b5beSmrg#
81812a51b5beSmrg#
81822a51b5beSmrg# See the "minimum version" comment for each macro you use to see what 
81832a51b5beSmrg# version you require.
81841b12faf6Smrgm4_defun([XORG_MACROS_VERSION],[
81851b12faf6Smrgm4_define([vers_have], [1.10.0])
81861b12faf6Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
81871b12faf6Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
81881b12faf6Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
81891b12faf6Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
81901b12faf6Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
81911b12faf6Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
81921b12faf6Smrgm4_undefine([vers_have])
81931b12faf6Smrgm4_undefine([maj_have])
81941b12faf6Smrgm4_undefine([maj_needed])
81952a51b5beSmrg]) # XORG_MACROS_VERSION
8196d31dbc53Smrg
81972a51b5beSmrg# XORG_PROG_RAWCPP()
81982a51b5beSmrg# ------------------
81992a51b5beSmrg# Minimum version: 1.0.0
82002a51b5beSmrg#
82012a51b5beSmrg# Find cpp program and necessary flags for use in pre-processing text files
82022a51b5beSmrg# such as man pages and config files
82032a51b5beSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
82042a51b5beSmrgAC_REQUIRE([AC_PROG_CPP])
82052a51b5beSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
82062a51b5beSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
82072a51b5beSmrg
82082a51b5beSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
82092a51b5beSmrg# which is not the best choice for supporting other OS'es, but covers most
82102a51b5beSmrg# of the ones we need for now.
82112a51b5beSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
82122a51b5beSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
82132a51b5beSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
82142a51b5beSmrg	AC_MSG_RESULT([no])
82152a51b5beSmrgelse
82162a51b5beSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
82172a51b5beSmrg		RAWCPPFLAGS=-undef
82182a51b5beSmrg		AC_MSG_RESULT([yes])
82192a51b5beSmrg	# under Cygwin unix is still defined even with -undef
82202a51b5beSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
82212a51b5beSmrg		RAWCPPFLAGS="-undef -ansi"
82222a51b5beSmrg		AC_MSG_RESULT([yes, with -ansi])
82232a51b5beSmrg	else
82242a51b5beSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
82252a51b5beSmrg	fi
8226d31dbc53Smrgfi
82272a51b5beSmrgrm -f conftest.$ac_ext
82282a51b5beSmrg
82292a51b5beSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
82302a51b5beSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
82312a51b5beSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
82322a51b5beSmrg	AC_MSG_RESULT([no])
8233d31dbc53Smrgelse
82342a51b5beSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
82352a51b5beSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
82362a51b5beSmrg		AC_MSG_RESULT([yes])
82372a51b5beSmrg	else
82382a51b5beSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
82392a51b5beSmrg	fi
8240d31dbc53Smrgfi
82412a51b5beSmrgrm -f conftest.$ac_ext
82422a51b5beSmrgAC_SUBST(RAWCPPFLAGS)
82432a51b5beSmrg]) # XORG_PROG_RAWCPP
8244d31dbc53Smrg
82452a51b5beSmrg# XORG_MANPAGE_SECTIONS()
82462a51b5beSmrg# -----------------------
82472a51b5beSmrg# Minimum version: 1.0.0
82482a51b5beSmrg#
82492a51b5beSmrg# Determine which sections man pages go in for the different man page types
82502a51b5beSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
82512a51b5beSmrg# Not sure if there's any better way than just hardcoding by OS name.
82522a51b5beSmrg# Override default settings by setting environment variables
82531b12faf6Smrg# Added MAN_SUBSTS in version 1.8
82541b12faf6Smrg# Added AC_PROG_SED in version 1.8
8255d31dbc53Smrg
82562a51b5beSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
82572a51b5beSmrgAC_REQUIRE([AC_CANONICAL_HOST])
82581b12faf6SmrgAC_REQUIRE([AC_PROG_SED])
8259d31dbc53Smrg
82602a51b5beSmrgif test x$APP_MAN_SUFFIX = x    ; then
82612a51b5beSmrg    APP_MAN_SUFFIX=1
82622a51b5beSmrgfi
82632a51b5beSmrgif test x$APP_MAN_DIR = x    ; then
82642a51b5beSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
82652a51b5beSmrgfi
8266d31dbc53Smrg
82672a51b5beSmrgif test x$LIB_MAN_SUFFIX = x    ; then
82682a51b5beSmrg    LIB_MAN_SUFFIX=3
82692a51b5beSmrgfi
82702a51b5beSmrgif test x$LIB_MAN_DIR = x    ; then
82712a51b5beSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
82722a51b5beSmrgfi
82732a51b5beSmrg
82742a51b5beSmrgif test x$FILE_MAN_SUFFIX = x    ; then
82752a51b5beSmrg    case $host_os in
82762a51b5beSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
82772a51b5beSmrg	*)		FILE_MAN_SUFFIX=5  ;;
8278d31dbc53Smrg    esac
82792a51b5beSmrgfi
82802a51b5beSmrgif test x$FILE_MAN_DIR = x    ; then
82812a51b5beSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
82822a51b5beSmrgfi
82832a51b5beSmrg
82842a51b5beSmrgif test x$MISC_MAN_SUFFIX = x    ; then
8285d31dbc53Smrg    case $host_os in
82862a51b5beSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
82872a51b5beSmrg	*)		MISC_MAN_SUFFIX=7  ;;
8288d31dbc53Smrg    esac
82892a51b5beSmrgfi
82902a51b5beSmrgif test x$MISC_MAN_DIR = x    ; then
82912a51b5beSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
82922a51b5beSmrgfi
8293d31dbc53Smrg
82942a51b5beSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
8295d31dbc53Smrg    case $host_os in
82962a51b5beSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
82972a51b5beSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
82982a51b5beSmrg    esac
82992a51b5beSmrgfi
83002a51b5beSmrgif test x$DRIVER_MAN_DIR = x    ; then
83012a51b5beSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
83022a51b5beSmrgfi
830332b578d3Smrg
83042a51b5beSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
83052a51b5beSmrg    case $host_os in
83062a51b5beSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
83072a51b5beSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
83082a51b5beSmrg    esac
83092a51b5beSmrgfi
83102a51b5beSmrgif test x$ADMIN_MAN_DIR = x    ; then
83112a51b5beSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
83122a51b5beSmrgfi
831332b578d3Smrg
831432b578d3Smrg
83152a51b5beSmrgAC_SUBST([APP_MAN_SUFFIX])
83162a51b5beSmrgAC_SUBST([LIB_MAN_SUFFIX])
83172a51b5beSmrgAC_SUBST([FILE_MAN_SUFFIX])
83182a51b5beSmrgAC_SUBST([MISC_MAN_SUFFIX])
83192a51b5beSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
83202a51b5beSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
83212a51b5beSmrgAC_SUBST([APP_MAN_DIR])
83222a51b5beSmrgAC_SUBST([LIB_MAN_DIR])
83232a51b5beSmrgAC_SUBST([FILE_MAN_DIR])
83242a51b5beSmrgAC_SUBST([MISC_MAN_DIR])
83252a51b5beSmrgAC_SUBST([DRIVER_MAN_DIR])
83262a51b5beSmrgAC_SUBST([ADMIN_MAN_DIR])
83271b12faf6Smrg
83281b12faf6SmrgXORG_MAN_PAGE="X Version 11"
83291b12faf6SmrgAC_SUBST([XORG_MAN_PAGE])
83301b12faf6SmrgMAN_SUBSTS="\
83311b12faf6Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
83321b12faf6Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
83331b12faf6Smrg	-e 's|__xservername__|Xorg|g' \
83341b12faf6Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
83351b12faf6Smrg	-e 's|__projectroot__|\$(prefix)|g' \
83361b12faf6Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
83371b12faf6Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
83381b12faf6Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
83391b12faf6Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
83401b12faf6Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
83411b12faf6Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
83421b12faf6SmrgAC_SUBST([MAN_SUBSTS])
83431b12faf6Smrg
83442a51b5beSmrg]) # XORG_MANPAGE_SECTIONS
834532b578d3Smrg
83461b12faf6Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
83471b12faf6Smrg# ------------------------
83481b12faf6Smrg# Minimum version: 1.7.0
83491b12faf6Smrg#
83501b12faf6Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
83511b12faf6Smrg# provided by xorg-sgml-doctools, if installed.
83521b12faf6SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
83531b12faf6SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
83541b12faf6SmrgXORG_SGML_PATH=
83551b12faf6SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
83561b12faf6Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
83571b12faf6Smrg    [m4_ifval([$1],[:],
83581b12faf6Smrg        [if test x"$cross_compiling" != x"yes" ; then
83591b12faf6Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
83601b12faf6Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
83611b12faf6Smrg         fi])
83621b12faf6Smrg    ])
83631b12faf6Smrg
83641b12faf6Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
83651b12faf6Smrg# the path and the name of the doc stylesheet
83661b12faf6Smrgif test "x$XORG_SGML_PATH" != "x" ; then
83671b12faf6Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
83681b12faf6Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
83691b12faf6Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
83701b12faf6Smrgelse
83711b12faf6Smrg   AC_MSG_RESULT([no])
83721b12faf6Smrgfi
83731b12faf6Smrg
83741b12faf6SmrgAC_SUBST(XORG_SGML_PATH)
83751b12faf6SmrgAC_SUBST(STYLESHEET_SRCDIR)
83761b12faf6SmrgAC_SUBST(XSL_STYLESHEET)
83771b12faf6SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
83781b12faf6Smrg]) # XORG_CHECK_SGML_DOCTOOLS
83791b12faf6Smrg
83802a51b5beSmrg# XORG_CHECK_LINUXDOC
83812a51b5beSmrg# -------------------
83822a51b5beSmrg# Minimum version: 1.0.0
83832a51b5beSmrg#
83842a51b5beSmrg# Defines the variable MAKE_TEXT if the necessary tools and
83852a51b5beSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
83862a51b5beSmrg# Whether or not the necessary tools and files are found can be checked
83872a51b5beSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
83882a51b5beSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
83891b12faf6SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
83901b12faf6SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
839132b578d3Smrg
83922a51b5beSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
839332b578d3Smrg
83941b12faf6SmrgAC_MSG_CHECKING([whether to build documentation])
839532b578d3Smrg
83961b12faf6Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
83972a51b5beSmrg   BUILDDOC=yes
83982a51b5beSmrgelse
83992a51b5beSmrg   BUILDDOC=no
84002a51b5beSmrgfi
840132b578d3Smrg
84022a51b5beSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
840332b578d3Smrg
84042a51b5beSmrgAC_MSG_RESULT([$BUILDDOC])
840532b578d3Smrg
84061b12faf6SmrgAC_MSG_CHECKING([whether to build pdf documentation])
840732b578d3Smrg
84081b12faf6Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
84092a51b5beSmrg   BUILDPDFDOC=yes
84102a51b5beSmrgelse
84111b12faf6Smrg   BUILDPDFDOC=no
84121b12faf6Smrgfi
84131b12faf6Smrg
84141b12faf6SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
84151b12faf6Smrg
84161b12faf6SmrgAC_MSG_RESULT([$BUILDPDFDOC])
84171b12faf6Smrg
84181b12faf6SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
84191b12faf6SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
84201b12faf6SmrgMAKE_PDF="$PS2PDF"
84211b12faf6SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
84221b12faf6Smrg
84231b12faf6SmrgAC_SUBST(MAKE_TEXT)
84241b12faf6SmrgAC_SUBST(MAKE_PS)
84251b12faf6SmrgAC_SUBST(MAKE_PDF)
84261b12faf6SmrgAC_SUBST(MAKE_HTML)
84271b12faf6Smrg]) # XORG_CHECK_LINUXDOC
84281b12faf6Smrg
84291b12faf6Smrg# XORG_CHECK_DOCBOOK
84301b12faf6Smrg# -------------------
84311b12faf6Smrg# Minimum version: 1.0.0
84321b12faf6Smrg#
84331b12faf6Smrg# Checks for the ability to build output formats from SGML DocBook source.
84341b12faf6Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
84351b12faf6Smrg# indicates whether the necessary tools and files are found and, if set,
84361b12faf6Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
84371b12faf6SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
84381b12faf6SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
84391b12faf6Smrg
84401b12faf6SmrgBUILDTXTDOC=no
84411b12faf6SmrgBUILDPDFDOC=no
84421b12faf6SmrgBUILDPSDOC=no
84431b12faf6SmrgBUILDHTMLDOC=no
84441b12faf6Smrg
84451b12faf6SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
84461b12faf6SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
84471b12faf6SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
84481b12faf6SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
84491b12faf6Smrg
84501b12faf6SmrgAC_MSG_CHECKING([whether to build text documentation])
84511b12faf6Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
84521b12faf6Smrg   test x$BUILD_TXTDOC != xno; then
84531b12faf6Smrg	BUILDTXTDOC=yes
84541b12faf6Smrgfi
84551b12faf6SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
84561b12faf6SmrgAC_MSG_RESULT([$BUILDTXTDOC])
84571b12faf6Smrg
84581b12faf6SmrgAC_MSG_CHECKING([whether to build PDF documentation])
84591b12faf6Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
84601b12faf6Smrg   test x$BUILD_PDFDOC != xno; then
84611b12faf6Smrg	BUILDPDFDOC=yes
84621b12faf6Smrgfi
84631b12faf6SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
84641b12faf6SmrgAC_MSG_RESULT([$BUILDPDFDOC])
84651b12faf6Smrg
84661b12faf6SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
84671b12faf6Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
84681b12faf6Smrg   test x$BUILD_PSDOC != xno; then
84691b12faf6Smrg	BUILDPSDOC=yes
84701b12faf6Smrgfi
84711b12faf6SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
84721b12faf6SmrgAC_MSG_RESULT([$BUILDPSDOC])
84731b12faf6Smrg
84741b12faf6SmrgAC_MSG_CHECKING([whether to build HTML documentation])
84751b12faf6Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
84761b12faf6Smrg   test x$BUILD_HTMLDOC != xno; then
84771b12faf6Smrg	BUILDHTMLDOC=yes
84781b12faf6Smrgfi
84791b12faf6SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
84801b12faf6SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
84811b12faf6Smrg
84821b12faf6SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
84831b12faf6SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
84841b12faf6SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
84851b12faf6SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
84861b12faf6Smrg
84871b12faf6SmrgAC_SUBST(MAKE_TEXT)
84881b12faf6SmrgAC_SUBST(MAKE_PS)
84891b12faf6SmrgAC_SUBST(MAKE_PDF)
84901b12faf6SmrgAC_SUBST(MAKE_HTML)
84911b12faf6Smrg]) # XORG_CHECK_DOCBOOK
84921b12faf6Smrg
84931b12faf6Smrg# XORG_WITH_XMLTO([MIN-VERSION])
84941b12faf6Smrg# ----------------
84951b12faf6Smrg# Minimum version: 1.5.0
84961b12faf6Smrg#
84971b12faf6Smrg# Documentation tools are not always available on all platforms and sometimes
84981b12faf6Smrg# not at the appropriate level. This macro enables a module to test for the
84991b12faf6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
85001b12faf6Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
85011b12faf6Smrg# as whether or not to use the xmlto package.
85021b12faf6Smrg#
85031b12faf6Smrg# Interface to module:
85041b12faf6Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
85051b12faf6Smrg# XMLTO:	returns the path of the xmlto program found
85061b12faf6Smrg#		returns the path set by the user in the environment
85071b12faf6Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
85081b12faf6Smrg#		'no' user instructs the module not to use xmlto
85091b12faf6Smrg#
85101b12faf6Smrg# Added in version 1.10.0
85111b12faf6Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
85121b12faf6Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
85131b12faf6Smrg#
85141b12faf6Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
85151b12faf6Smrg#
85161b12faf6SmrgAC_DEFUN([XORG_WITH_XMLTO],[
85171b12faf6SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
85181b12faf6SmrgAC_ARG_WITH(xmlto,
85191b12faf6Smrg	AS_HELP_STRING([--with-xmlto],
85201b12faf6Smrg	   [Use xmlto to regenerate documentation (default: yes, if installed)]),
85211b12faf6Smrg	   [use_xmlto=$withval], [use_xmlto=auto])
85221b12faf6Smrg
85231b12faf6Smrgif test "x$use_xmlto" = x"auto"; then
85241b12faf6Smrg   AC_PATH_PROG([XMLTO], [xmlto])
85251b12faf6Smrg   if test "x$XMLTO" = "x"; then
85261b12faf6Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
85271b12faf6Smrg	have_xmlto=no
85281b12faf6Smrg   else
85291b12faf6Smrg        have_xmlto=yes
85301b12faf6Smrg   fi
85311b12faf6Smrgelif test "x$use_xmlto" = x"yes" ; then
85321b12faf6Smrg   AC_PATH_PROG([XMLTO], [xmlto])
85331b12faf6Smrg   if test "x$XMLTO" = "x"; then
85341b12faf6Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
85351b12faf6Smrg   fi
85361b12faf6Smrg   have_xmlto=yes
85371b12faf6Smrgelif test "x$use_xmlto" = x"no" ; then
85381b12faf6Smrg   if test "x$XMLTO" != "x"; then
85391b12faf6Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
85401b12faf6Smrg   fi
85411b12faf6Smrg   have_xmlto=no
85421b12faf6Smrgelse
85431b12faf6Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
85441b12faf6Smrgfi
85451b12faf6Smrg
85461b12faf6Smrg# Test for a minimum version of xmlto, if provided.
85471b12faf6Smrgm4_ifval([$1],
85481b12faf6Smrg[if test "$have_xmlto" = yes; then
85491b12faf6Smrg    # scrape the xmlto version
85501b12faf6Smrg    AC_MSG_CHECKING([the xmlto version])
85511b12faf6Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
85521b12faf6Smrg    AC_MSG_RESULT([$xmlto_version])
85531b12faf6Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
85541b12faf6Smrg        [if test "x$use_xmlto" = xauto; then
85551b12faf6Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
85561b12faf6Smrg            have_xmlto=no
85571b12faf6Smrg        else
85581b12faf6Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
85591b12faf6Smrg        fi])
85601b12faf6Smrgfi])
85611b12faf6Smrg
85621b12faf6Smrg# Test for the ability of xmlto to generate a text target
85631b12faf6Smrghave_xmlto_text=no
85641b12faf6Smrgcat > conftest.xml << "EOF"
85651b12faf6SmrgEOF
85661b12faf6SmrgAS_IF([test "$have_xmlto" = yes],
85671b12faf6Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
85681b12faf6Smrg             [have_xmlto_text=yes],
85691b12faf6Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
85701b12faf6Smrgrm -f conftest.xml
85711b12faf6SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
85721b12faf6SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
85731b12faf6Smrg]) # XORG_WITH_XMLTO
85741b12faf6Smrg
85751b12faf6Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION])
85761b12faf6Smrg# ----------------
85771b12faf6Smrg# Minimum version: 1.5.0
85781b12faf6Smrg#
85791b12faf6Smrg# Documentation tools are not always available on all platforms and sometimes
85801b12faf6Smrg# not at the appropriate level. This macro enables a module to test for the
85811b12faf6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
85821b12faf6Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
85831b12faf6Smrg# as whether or not to use the asciidoc package.
85841b12faf6Smrg#
85851b12faf6Smrg# Interface to module:
85861b12faf6Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
85871b12faf6Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
85881b12faf6Smrg#		 returns the path set by the user in the environment
85891b12faf6Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
85901b12faf6Smrg#		  'no' user instructs the module not to use asciidoc
85911b12faf6Smrg#
85921b12faf6Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
85931b12faf6Smrg#
85941b12faf6SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
85951b12faf6SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
85961b12faf6SmrgAC_ARG_WITH(asciidoc,
85971b12faf6Smrg	AS_HELP_STRING([--with-asciidoc],
85981b12faf6Smrg	   [Use asciidoc to regenerate documentation (default: yes, if installed)]),
85991b12faf6Smrg	   [use_asciidoc=$withval], [use_asciidoc=auto])
86001b12faf6Smrg
86011b12faf6Smrgif test "x$use_asciidoc" = x"auto"; then
86021b12faf6Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
86031b12faf6Smrg   if test "x$ASCIIDOC" = "x"; then
86041b12faf6Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
86051b12faf6Smrg	have_asciidoc=no
86061b12faf6Smrg   else
86071b12faf6Smrg        have_asciidoc=yes
86081b12faf6Smrg   fi
86091b12faf6Smrgelif test "x$use_asciidoc" = x"yes" ; then
86101b12faf6Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
86111b12faf6Smrg   if test "x$ASCIIDOC" = "x"; then
86121b12faf6Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
86131b12faf6Smrg   fi
86141b12faf6Smrg   have_asciidoc=yes
86151b12faf6Smrgelif test "x$use_asciidoc" = x"no" ; then
86161b12faf6Smrg   if test "x$ASCIIDOC" != "x"; then
86171b12faf6Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
86181b12faf6Smrg   fi
86191b12faf6Smrg   have_asciidoc=no
86201b12faf6Smrgelse
86211b12faf6Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
86221b12faf6Smrgfi
86231b12faf6Smrgm4_ifval([$1],
86241b12faf6Smrg[if test "$have_asciidoc" = yes; then
86251b12faf6Smrg    # scrape the asciidoc version
86261b12faf6Smrg    AC_MSG_CHECKING([the asciidoc version])
86271b12faf6Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
86281b12faf6Smrg    AC_MSG_RESULT([$asciidoc_version])
86291b12faf6Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
86301b12faf6Smrg        [if test "x$use_asciidoc" = xauto; then
86311b12faf6Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
86321b12faf6Smrg            have_asciidoc=no
86331b12faf6Smrg        else
86341b12faf6Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
86351b12faf6Smrg        fi])
86361b12faf6Smrgfi])
86371b12faf6SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
86381b12faf6Smrg]) # XORG_WITH_ASCIIDOC
86391b12faf6Smrg
86401b12faf6Smrg# XORG_WITH_DOXYGEN([MIN-VERSION])
86411b12faf6Smrg# --------------------------------
86421b12faf6Smrg# Minimum version: 1.5.0
86431b12faf6Smrg#
86441b12faf6Smrg# Documentation tools are not always available on all platforms and sometimes
86451b12faf6Smrg# not at the appropriate level. This macro enables a module to test for the
86461b12faf6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
86471b12faf6Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
86481b12faf6Smrg# as whether or not to use the doxygen package.
86491b12faf6Smrg#
86501b12faf6Smrg# Interface to module:
86511b12faf6Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
86521b12faf6Smrg# DOXYGEN:	 returns the path of the doxygen program found
86531b12faf6Smrg#		 returns the path set by the user in the environment
86541b12faf6Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
86551b12faf6Smrg#		  'no' user instructs the module not to use doxygen
86561b12faf6Smrg#
86571b12faf6Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
86581b12faf6Smrg#
86591b12faf6SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
86601b12faf6SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
86611b12faf6SmrgAC_ARG_WITH(doxygen,
86621b12faf6Smrg	AS_HELP_STRING([--with-doxygen],
86631b12faf6Smrg	   [Use doxygen to regenerate documentation (default: yes, if installed)]),
86641b12faf6Smrg	   [use_doxygen=$withval], [use_doxygen=auto])
86651b12faf6Smrg
86661b12faf6Smrgif test "x$use_doxygen" = x"auto"; then
86671b12faf6Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
86681b12faf6Smrg   if test "x$DOXYGEN" = "x"; then
86691b12faf6Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
86701b12faf6Smrg	have_doxygen=no
86711b12faf6Smrg   else
86721b12faf6Smrg        have_doxygen=yes
86731b12faf6Smrg   fi
86741b12faf6Smrgelif test "x$use_doxygen" = x"yes" ; then
86751b12faf6Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
86761b12faf6Smrg   if test "x$DOXYGEN" = "x"; then
86771b12faf6Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
86781b12faf6Smrg   fi
86791b12faf6Smrg   have_doxygen=yes
86801b12faf6Smrgelif test "x$use_doxygen" = x"no" ; then
86811b12faf6Smrg   if test "x$DOXYGEN" != "x"; then
86821b12faf6Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
86831b12faf6Smrg   fi
86841b12faf6Smrg   have_doxygen=no
86851b12faf6Smrgelse
86861b12faf6Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
86871b12faf6Smrgfi
86881b12faf6Smrgm4_ifval([$1],
86891b12faf6Smrg[if test "$have_doxygen" = yes; then
86901b12faf6Smrg    # scrape the doxygen version
86911b12faf6Smrg    AC_MSG_CHECKING([the doxygen version])
86921b12faf6Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
86931b12faf6Smrg    AC_MSG_RESULT([$doxygen_version])
86941b12faf6Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
86951b12faf6Smrg        [if test "x$use_doxygen" = xauto; then
86961b12faf6Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
86971b12faf6Smrg            have_doxygen=no
86981b12faf6Smrg        else
86991b12faf6Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
87001b12faf6Smrg        fi])
87011b12faf6Smrgfi])
87021b12faf6SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
87031b12faf6Smrg]) # XORG_WITH_DOXYGEN
87041b12faf6Smrg
87051b12faf6Smrg# XORG_WITH_GROFF
87061b12faf6Smrg# ----------------
87071b12faf6Smrg# Minimum version: 1.6.0
87081b12faf6Smrg#
87091b12faf6Smrg# Documentation tools are not always available on all platforms and sometimes
87101b12faf6Smrg# not at the appropriate level. This macro enables a module to test for the
87111b12faf6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
87121b12faf6Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
87131b12faf6Smrg# as whether or not to use the groff package.
87141b12faf6Smrg#
87151b12faf6Smrg# Interface to module:
87161b12faf6Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
87171b12faf6Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
87181b12faf6Smrg# HAVE_GROFF_MS: the -ms macros package
87191b12faf6Smrg# GROFF:	 returns the path of the groff program found
87201b12faf6Smrg#		 returns the path set by the user in the environment
87211b12faf6Smrg# --with-groff:	 'yes' user instructs the module to use groff
87221b12faf6Smrg#		 'no' user instructs the module not to use groff
87231b12faf6Smrg#
87241b12faf6Smrg# Added in version 1.9.0:
87251b12faf6Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
87261b12faf6Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
87271b12faf6Smrg#		   psselect from the psutils package.
87281b12faf6Smrg#		   the ghostcript package. Refer to the grohtml man pages
87291b12faf6Smrg#
87301b12faf6Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
87311b12faf6Smrg#
87321b12faf6Smrg# OS and distros often splits groff in a basic and full package, the former
87331b12faf6Smrg# having the groff program and the later having devices, fonts and macros
87341b12faf6Smrg# Checking for the groff executable is not enough.
87351b12faf6Smrg#
87361b12faf6Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
87371b12faf6Smrg# unset HAVE_GROFF or GROFF env variables.
87381b12faf6Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
87391b12faf6Smrg#
87401b12faf6SmrgAC_DEFUN([XORG_WITH_GROFF],[
87411b12faf6SmrgAC_ARG_VAR([GROFF], [Path to groff command])
87421b12faf6SmrgAC_ARG_WITH(groff,
87431b12faf6Smrg	AS_HELP_STRING([--with-groff],
87441b12faf6Smrg	   [Use groff to regenerate documentation (default: yes, if installed)]),
87451b12faf6Smrg	   [use_groff=$withval], [use_groff=auto])
87461b12faf6Smrg
87471b12faf6Smrgif test "x$use_groff" = x"auto"; then
87481b12faf6Smrg   AC_PATH_PROG([GROFF], [groff])
87491b12faf6Smrg   if test "x$GROFF" = "x"; then
87501b12faf6Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
87511b12faf6Smrg	have_groff=no
87521b12faf6Smrg   else
87531b12faf6Smrg        have_groff=yes
87541b12faf6Smrg   fi
87551b12faf6Smrgelif test "x$use_groff" = x"yes" ; then
87561b12faf6Smrg   AC_PATH_PROG([GROFF], [groff])
87571b12faf6Smrg   if test "x$GROFF" = "x"; then
87581b12faf6Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
87591b12faf6Smrg   fi
87601b12faf6Smrg   have_groff=yes
87611b12faf6Smrgelif test "x$use_groff" = x"no" ; then
87621b12faf6Smrg   if test "x$GROFF" != "x"; then
87631b12faf6Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
87641b12faf6Smrg   fi
87651b12faf6Smrg   have_groff=no
87661b12faf6Smrgelse
87671b12faf6Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
87682a51b5beSmrgfi
876932b578d3Smrg
87701b12faf6Smrg# We have groff, test for the presence of the macro packages
87711b12faf6Smrgif test "x$have_groff" = x"yes"; then
87721b12faf6Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
87731b12faf6Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
87741b12faf6Smrg        groff_ms_works=yes
87751b12faf6Smrg    else
87761b12faf6Smrg        groff_ms_works=no
87771b12faf6Smrg    fi
87781b12faf6Smrg    AC_MSG_RESULT([$groff_ms_works])
87791b12faf6Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
87801b12faf6Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
87811b12faf6Smrg        groff_mm_works=yes
87821b12faf6Smrg    else
87831b12faf6Smrg        groff_mm_works=no
87841b12faf6Smrg    fi
87851b12faf6Smrg    AC_MSG_RESULT([$groff_mm_works])
87861b12faf6Smrgfi
878732b578d3Smrg
87881b12faf6Smrg# We have groff, test for HTML dependencies, one command per package
87891b12faf6Smrgif test "x$have_groff" = x"yes"; then
87901b12faf6Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
87911b12faf6Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
87921b12faf6Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
87931b12faf6Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
87941b12faf6Smrg      have_groff_html=yes
87951b12faf6Smrg   else
87961b12faf6Smrg      have_groff_html=no
87971b12faf6Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
87981b12faf6Smrg   fi
87991b12faf6Smrgfi
880032b578d3Smrg
88011b12faf6Smrg# Set Automake conditionals for Makefiles
88021b12faf6SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
88031b12faf6SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
88041b12faf6SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
88051b12faf6SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
88061b12faf6Smrg]) # XORG_WITH_GROFF
880732b578d3Smrg
88081b12faf6Smrg# XORG_WITH_FOP
88091b12faf6Smrg# ----------------
88101b12faf6Smrg# Minimum version: 1.6.0
88112a51b5beSmrg#
88121b12faf6Smrg# Documentation tools are not always available on all platforms and sometimes
88131b12faf6Smrg# not at the appropriate level. This macro enables a module to test for the
88141b12faf6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
88151b12faf6Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
88161b12faf6Smrg# as whether or not to use the fop package.
88171b12faf6Smrg#
88181b12faf6Smrg# Interface to module:
88191b12faf6Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
88201b12faf6Smrg# FOP:	 	returns the path of the fop program found
88211b12faf6Smrg#		returns the path set by the user in the environment
88221b12faf6Smrg# --with-fop: 	'yes' user instructs the module to use fop
88231b12faf6Smrg#		'no' user instructs the module not to use fop
88241b12faf6Smrg#
88251b12faf6Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
88261b12faf6Smrg#
88271b12faf6SmrgAC_DEFUN([XORG_WITH_FOP],[
88281b12faf6SmrgAC_ARG_VAR([FOP], [Path to fop command])
88291b12faf6SmrgAC_ARG_WITH(fop,
88301b12faf6Smrg	AS_HELP_STRING([--with-fop],
88311b12faf6Smrg	   [Use fop to regenerate documentation (default: yes, if installed)]),
88321b12faf6Smrg	   [use_fop=$withval], [use_fop=auto])
88331b12faf6Smrg
88341b12faf6Smrgif test "x$use_fop" = x"auto"; then
88351b12faf6Smrg   AC_PATH_PROG([FOP], [fop])
88361b12faf6Smrg   if test "x$FOP" = "x"; then
88371b12faf6Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
88381b12faf6Smrg	have_fop=no
88391b12faf6Smrg   else
88401b12faf6Smrg        have_fop=yes
88411b12faf6Smrg   fi
88421b12faf6Smrgelif test "x$use_fop" = x"yes" ; then
88431b12faf6Smrg   AC_PATH_PROG([FOP], [fop])
88441b12faf6Smrg   if test "x$FOP" = "x"; then
88451b12faf6Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
88461b12faf6Smrg   fi
88471b12faf6Smrg   have_fop=yes
88481b12faf6Smrgelif test "x$use_fop" = x"no" ; then
88491b12faf6Smrg   if test "x$FOP" != "x"; then
88501b12faf6Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
88511b12faf6Smrg   fi
88521b12faf6Smrg   have_fop=no
88531b12faf6Smrgelse
88541b12faf6Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
88552a51b5beSmrgfi
88561b12faf6SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
88571b12faf6Smrg]) # XORG_WITH_FOP
885832b578d3Smrg
88591b12faf6Smrg# XORG_WITH_PS2PDF
88601b12faf6Smrg# ----------------
88611b12faf6Smrg# Minimum version: 1.6.0
88621b12faf6Smrg#
88631b12faf6Smrg# Documentation tools are not always available on all platforms and sometimes
88641b12faf6Smrg# not at the appropriate level. This macro enables a module to test for the
88651b12faf6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
88661b12faf6Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
88671b12faf6Smrg# as whether or not to use the ps2pdf package.
88681b12faf6Smrg#
88691b12faf6Smrg# Interface to module:
88701b12faf6Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
88711b12faf6Smrg# PS2PDF:	returns the path of the ps2pdf program found
88721b12faf6Smrg#		returns the path set by the user in the environment
88731b12faf6Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
88741b12faf6Smrg#		 'no' user instructs the module not to use ps2pdf
88751b12faf6Smrg#
88761b12faf6Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
88771b12faf6Smrg#
88781b12faf6SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
88791b12faf6SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
88801b12faf6SmrgAC_ARG_WITH(ps2pdf,
88811b12faf6Smrg	AS_HELP_STRING([--with-ps2pdf],
88821b12faf6Smrg	   [Use ps2pdf to regenerate documentation (default: yes, if installed)]),
88831b12faf6Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=auto])
88841b12faf6Smrg
88851b12faf6Smrgif test "x$use_ps2pdf" = x"auto"; then
88861b12faf6Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
88871b12faf6Smrg   if test "x$PS2PDF" = "x"; then
88881b12faf6Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
88891b12faf6Smrg	have_ps2pdf=no
88901b12faf6Smrg   else
88911b12faf6Smrg        have_ps2pdf=yes
88921b12faf6Smrg   fi
88931b12faf6Smrgelif test "x$use_ps2pdf" = x"yes" ; then
88941b12faf6Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
88951b12faf6Smrg   if test "x$PS2PDF" = "x"; then
88961b12faf6Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
88971b12faf6Smrg   fi
88981b12faf6Smrg   have_ps2pdf=yes
88991b12faf6Smrgelif test "x$use_ps2pdf" = x"no" ; then
89001b12faf6Smrg   if test "x$PS2PDF" != "x"; then
89011b12faf6Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
89021b12faf6Smrg   fi
89031b12faf6Smrg   have_ps2pdf=no
89041b12faf6Smrgelse
89051b12faf6Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
89062a51b5beSmrgfi
89071b12faf6SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
89081b12faf6Smrg]) # XORG_WITH_PS2PDF
890932b578d3Smrg
89101b12faf6Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
89111b12faf6Smrg# ----------------
89121b12faf6Smrg# Minimum version: 1.6.0
89131b12faf6Smrg#
89141b12faf6Smrg# Documentation tools are not always available on all platforms and sometimes
89151b12faf6Smrg# not at the appropriate level. This macro enables a builder to skip all
89161b12faf6Smrg# documentation targets except traditional man pages.
89171b12faf6Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
89181b12faf6Smrg# maximum flexibilty in controlling documentation building.
89191b12faf6Smrg# Refer to:
89201b12faf6Smrg# XORG_WITH_XMLTO         --with-xmlto
89211b12faf6Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
89221b12faf6Smrg# XORG_WITH_DOXYGEN       --with-doxygen
89231b12faf6Smrg# XORG_WITH_FOP           --with-fop
89241b12faf6Smrg# XORG_WITH_GROFF         --with-groff
89251b12faf6Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
89261b12faf6Smrg#
89271b12faf6Smrg# Interface to module:
89281b12faf6Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
89291b12faf6Smrg# --enable-docs: 'yes' user instructs the module to generate docs
89301b12faf6Smrg#		 'no' user instructs the module not to generate docs
89311b12faf6Smrg# parm1:	specify the default value, yes or no.
89321b12faf6Smrg#
89331b12faf6SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
89341b12faf6Smrgdefault=$1
89351b12faf6Smrgif test "x$default" = x ; then
89361b12faf6Smrg  default="yes"
89372a51b5beSmrgfi
89381b12faf6SmrgAC_ARG_ENABLE(docs,
89391b12faf6Smrg	AS_HELP_STRING([--enable-docs],
89401b12faf6Smrg	   [Enable building the documentation (default: yes)]),
89411b12faf6Smrg	   [build_docs=$enableval], [build_docs=$default])
89421b12faf6SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
89431b12faf6SmrgAC_MSG_CHECKING([whether to build documentation])
89441b12faf6SmrgAC_MSG_RESULT([$build_docs])
89451b12faf6Smrg]) # XORG_ENABLE_DOCS
89461b12faf6Smrg
89471b12faf6Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
89481b12faf6Smrg# ----------------
89491b12faf6Smrg# Minimum version: 1.6.0
89501b12faf6Smrg#
89511b12faf6Smrg# This macro enables a builder to skip all developer documentation.
89521b12faf6Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
89531b12faf6Smrg# maximum flexibilty in controlling documentation building.
89541b12faf6Smrg# Refer to:
89551b12faf6Smrg# XORG_WITH_XMLTO         --with-xmlto
89561b12faf6Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
89571b12faf6Smrg# XORG_WITH_DOXYGEN       --with-doxygen
89581b12faf6Smrg# XORG_WITH_FOP           --with-fop
89591b12faf6Smrg# XORG_WITH_GROFF         --with-groff
89601b12faf6Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
89611b12faf6Smrg#
89621b12faf6Smrg# Interface to module:
89631b12faf6Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
89641b12faf6Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
89651b12faf6Smrg#			'no' user instructs the module not to generate developer docs
89661b12faf6Smrg# parm1:		specify the default value, yes or no.
89671b12faf6Smrg#
89681b12faf6SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
89691b12faf6Smrgdevel_default=$1
89701b12faf6Smrgif test "x$devel_default" = x ; then
89711b12faf6Smrg  devel_default="yes"
89722a51b5beSmrgfi
89731b12faf6SmrgAC_ARG_ENABLE(devel-docs,
89741b12faf6Smrg	AS_HELP_STRING([--enable-devel-docs],
89751b12faf6Smrg	   [Enable building the developer documentation (default: yes)]),
89761b12faf6Smrg	   [build_devel_docs=$enableval], [build_devel_docs=$devel_default])
89771b12faf6SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
89781b12faf6SmrgAC_MSG_CHECKING([whether to build developer documentation])
89791b12faf6SmrgAC_MSG_RESULT([$build_devel_docs])
89801b12faf6Smrg]) # XORG_ENABLE_DEVEL_DOCS
89811b12faf6Smrg
89821b12faf6Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
89831b12faf6Smrg# ----------------
89841b12faf6Smrg# Minimum version: 1.6.0
89851b12faf6Smrg#
89861b12faf6Smrg# This macro enables a builder to skip all functional specification targets.
89871b12faf6Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
89881b12faf6Smrg# maximum flexibilty in controlling documentation building.
89891b12faf6Smrg# Refer to:
89901b12faf6Smrg# XORG_WITH_XMLTO         --with-xmlto
89911b12faf6Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
89921b12faf6Smrg# XORG_WITH_DOXYGEN       --with-doxygen
89931b12faf6Smrg# XORG_WITH_FOP           --with-fop
89941b12faf6Smrg# XORG_WITH_GROFF         --with-groff
89951b12faf6Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
89961b12faf6Smrg#
89971b12faf6Smrg# Interface to module:
89981b12faf6Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
89991b12faf6Smrg# --enable-specs:	'yes' user instructs the module to generate specs
90001b12faf6Smrg#			'no' user instructs the module not to generate specs
90011b12faf6Smrg# parm1:		specify the default value, yes or no.
90021b12faf6Smrg#
90031b12faf6SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
90041b12faf6Smrgspec_default=$1
90051b12faf6Smrgif test "x$spec_default" = x ; then
90061b12faf6Smrg  spec_default="yes"
90072a51b5beSmrgfi
90081b12faf6SmrgAC_ARG_ENABLE(specs,
90091b12faf6Smrg	AS_HELP_STRING([--enable-specs],
90101b12faf6Smrg	   [Enable building the specs (default: yes)]),
90111b12faf6Smrg	   [build_specs=$enableval], [build_specs=$spec_default])
90121b12faf6SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
90131b12faf6SmrgAC_MSG_CHECKING([whether to build functional specifications])
90141b12faf6SmrgAC_MSG_RESULT([$build_specs])
90151b12faf6Smrg]) # XORG_ENABLE_SPECS
901632b578d3Smrg
90172a51b5beSmrg# XORG_CHECK_MALLOC_ZERO
90182a51b5beSmrg# ----------------------
90192a51b5beSmrg# Minimum version: 1.0.0
902032b578d3Smrg#
90212a51b5beSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
90222a51b5beSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
90232a51b5beSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
90242a51b5beSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
90252a51b5beSmrgAC_ARG_ENABLE(malloc0returnsnull,
90261b12faf6Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
90272a51b5beSmrg		       [malloc(0) returns NULL (default: auto)]),
90282a51b5beSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
90292a51b5beSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
90302a51b5beSmrg
90312a51b5beSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
90322a51b5beSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
90332a51b5beSmrg	AC_RUN_IFELSE([
90342a51b5beSmrgchar *malloc();
90352a51b5beSmrgchar *realloc();
90362a51b5beSmrgchar *calloc();
90372a51b5beSmrgmain() {
90382a51b5beSmrg    char *m0, *r0, *c0, *p;
90392a51b5beSmrg    m0 = malloc(0);
90402a51b5beSmrg    p = malloc(10);
90412a51b5beSmrg    r0 = realloc(p,0);
90422a51b5beSmrg    c0 = calloc(0);
90432a51b5beSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
90442a51b5beSmrg}],
90452a51b5beSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
90461b12faf6Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
90471b12faf6Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
904832b578d3Smrgfi
90492a51b5beSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
90502a51b5beSmrg
90512a51b5beSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
90522a51b5beSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
90532a51b5beSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
90542a51b5beSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
90552a51b5beSmrgelse
90562a51b5beSmrg	MALLOC_ZERO_CFLAGS=""
90572a51b5beSmrg	XMALLOC_ZERO_CFLAGS=""
90582a51b5beSmrg	XTMALLOC_ZERO_CFLAGS=""
90592a51b5beSmrgfi
90602a51b5beSmrg
90612a51b5beSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
90622a51b5beSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
90632a51b5beSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
90642a51b5beSmrg]) # XORG_CHECK_MALLOC_ZERO
906532b578d3Smrg
90662a51b5beSmrg# XORG_WITH_LINT()
90672a51b5beSmrg# ----------------
90682a51b5beSmrg# Minimum version: 1.1.0
9069d31dbc53Smrg#
90701b12faf6Smrg# This macro enables the use of a tool that flags some suspicious and
90711b12faf6Smrg# non-portable constructs (likely to be bugs) in C language source code.
90721b12faf6Smrg# It will attempt to locate the tool and use appropriate options.
90731b12faf6Smrg# There are various lint type tools on different platforms.
90741b12faf6Smrg#
90751b12faf6Smrg# Interface to module:
90761b12faf6Smrg# LINT:		returns the path to the tool found on the platform
90771b12faf6Smrg#		or the value set to LINT on the configure cmd line
90781b12faf6Smrg#		also an Automake conditional
90791b12faf6Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
90801b12faf6Smrg#
90811b12faf6Smrg# --with-lint:	'yes' user instructs the module to use lint
90821b12faf6Smrg#		'no' user instructs the module not to use lint (default)
90831b12faf6Smrg#
90841b12faf6Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
90851b12faf6Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
9086d31dbc53Smrg#
90872a51b5beSmrgAC_DEFUN([XORG_WITH_LINT],[
908832b578d3Smrg
90891b12faf6SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
90901b12faf6SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
90911b12faf6SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
90922a51b5beSmrg		[Use a lint-style source code checker (default: disabled)])],
90932a51b5beSmrg		[use_lint=$withval], [use_lint=no])
90941b12faf6Smrg
90951b12faf6Smrg# Obtain platform specific info like program name and options
90961b12faf6Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
90971b12faf6Smrgcase $host_os in
90981b12faf6Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
90991b12faf6Smrg	lint_name=splint
91001b12faf6Smrg	lint_options="-badflag"
91011b12faf6Smrg	;;
91021b12faf6Smrg  *freebsd* | *netbsd*)
91031b12faf6Smrg	lint_name=lint
91041b12faf6Smrg	lint_options="-u -b"
91051b12faf6Smrg	;;
91061b12faf6Smrg  *solaris*)
91071b12faf6Smrg	lint_name=lint
91081b12faf6Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
91091b12faf6Smrg	;;
91101b12faf6Smrgesac
91111b12faf6Smrg
91121b12faf6Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
91131b12faf6Smrgif test "x$use_lint" = x"yes" ; then
91141b12faf6Smrg   AC_PATH_PROG([LINT], [$lint_name])
91151b12faf6Smrg   if test "x$LINT" = "x"; then
91161b12faf6Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
91171b12faf6Smrg   fi
91181b12faf6Smrgelif test "x$use_lint" = x"no" ; then
91191b12faf6Smrg   if test "x$LINT" != "x"; then
91201b12faf6Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
91211b12faf6Smrg   fi
91222a51b5beSmrgelse
91231b12faf6Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
91242a51b5beSmrgfi
91251b12faf6Smrg
91261b12faf6Smrg# User supplied flags override default flags
91271b12faf6Smrgif test "x$LINT_FLAGS" != "x"; then
91281b12faf6Smrg   lint_options=$LINT_FLAGS
91292a51b5beSmrgfi
913032b578d3Smrg
91311b12faf6SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
91321b12faf6SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
9133d31dbc53Smrg
91342a51b5beSmrg]) # XORG_WITH_LINT
913532b578d3Smrg
91362a51b5beSmrg# XORG_LINT_LIBRARY(LIBNAME)
91372a51b5beSmrg# --------------------------
91382a51b5beSmrg# Minimum version: 1.1.0
91392a51b5beSmrg#
91402a51b5beSmrg# Sets up flags for building lint libraries for checking programs that call
91412a51b5beSmrg# functions in the library.
91422a51b5beSmrg#
91431b12faf6Smrg# Interface to module:
91441b12faf6Smrg# LINTLIB		- Automake variable with the name of lint library file to make
91451b12faf6Smrg# MAKE_LINT_LIB		- Automake conditional
91461b12faf6Smrg#
91471b12faf6Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
91481b12faf6Smrg#			  - 'no' user instructs the module not to create a lint library (default)
91492a51b5beSmrg
91502a51b5beSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
91512a51b5beSmrgAC_REQUIRE([XORG_WITH_LINT])
91521b12faf6SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
91532a51b5beSmrg	[Create lint library (default: disabled)])],
91542a51b5beSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
91551b12faf6Smrg
91561b12faf6Smrgif test "x$make_lint_lib" = x"yes" ; then
91571b12faf6Smrg   LINTLIB=llib-l$1.ln
91581b12faf6Smrg   if test "x$LINT" = "x"; then
91591b12faf6Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
91601b12faf6Smrg   fi
91611b12faf6Smrgelif test "x$make_lint_lib" != x"no" ; then
91621b12faf6Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
91632a51b5beSmrgfi
91641b12faf6Smrg
91652a51b5beSmrgAC_SUBST(LINTLIB)
91662a51b5beSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
916732b578d3Smrg
91682a51b5beSmrg]) # XORG_LINT_LIBRARY
916932b578d3Smrg
91702a51b5beSmrg# XORG_CWARNFLAGS
91712a51b5beSmrg# ---------------
91722a51b5beSmrg# Minimum version: 1.2.0
91732a51b5beSmrg#
91742a51b5beSmrg# Defines CWARNFLAGS to enable C compiler warnings.
91752a51b5beSmrg#
91762a51b5beSmrgAC_DEFUN([XORG_CWARNFLAGS], [
91771b12faf6SmrgAC_REQUIRE([AC_PROG_CC_C99])
91782a51b5beSmrgif  test "x$GCC" = xyes ; then
91792a51b5beSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
91802a51b5beSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
91811b12faf6Smrg-Wbad-function-cast -Wformat=2"
91821b12faf6Smrg    case `$CC -dumpversion` in
91832a51b5beSmrg    3.4.* | 4.*)
91841b12faf6Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
91852a51b5beSmrg	;;
91862a51b5beSmrg    esac
91872a51b5beSmrgelse
91882a51b5beSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
91892a51b5beSmrg    if test "x$SUNCC" = "xyes"; then
91902a51b5beSmrg	CWARNFLAGS="-v"
91912a51b5beSmrg    fi
91922a51b5beSmrgfi
91932a51b5beSmrgAC_SUBST(CWARNFLAGS)
91942a51b5beSmrg]) # XORG_CWARNFLAGS
91951b12faf6Smrg
91961b12faf6Smrg# XORG_STRICT_OPTION
91971b12faf6Smrg# -----------------------
91981b12faf6Smrg# Minimum version: 1.3.0
91991b12faf6Smrg#
92001b12faf6Smrg# Add configure option to enable strict compilation
92011b12faf6SmrgAC_DEFUN([XORG_STRICT_OPTION], [
92021b12faf6Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
92031b12faf6SmrgAC_REQUIRE([AC_PROG_CC_C99])
92041b12faf6SmrgAC_REQUIRE([XORG_CWARNFLAGS])
92051b12faf6Smrg
92061b12faf6SmrgAC_ARG_ENABLE(strict-compilation,
92071b12faf6Smrg			  AS_HELP_STRING([--enable-strict-compilation],
92081b12faf6Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
92091b12faf6Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
92101b12faf6Smrgif test "x$STRICT_COMPILE" = "xyes"; then
92111b12faf6Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
92121b12faf6Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
92131b12faf6Smrg	if test "x$GCC" = xyes ; then
92141b12faf6Smrg		STRICT_CFLAGS="-pedantic -Werror"
92151b12faf6Smrg	elif test "x$SUNCC" = "xyes"; then
92161b12faf6Smrg		STRICT_CFLAGS="-errwarn"
92171b12faf6Smrg    elif test "x$INTELCC" = "xyes"; then
92181b12faf6Smrg		STRICT_CFLAGS="-Werror"
92191b12faf6Smrg	fi
92201b12faf6Smrgfi
92211b12faf6SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
92221b12faf6SmrgAC_SUBST([CWARNFLAGS])
92231b12faf6Smrg]) # XORG_STRICT_OPTION
92241b12faf6Smrg
92251b12faf6Smrg# XORG_DEFAULT_OPTIONS
92261b12faf6Smrg# --------------------
92271b12faf6Smrg# Minimum version: 1.3.0
92281b12faf6Smrg#
92291b12faf6Smrg# Defines default options for X.Org modules.
92301b12faf6Smrg#
92311b12faf6SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
92321b12faf6SmrgAC_REQUIRE([AC_PROG_INSTALL])
92331b12faf6SmrgXORG_CWARNFLAGS
92341b12faf6SmrgXORG_STRICT_OPTION
92351b12faf6SmrgXORG_RELEASE_VERSION
92361b12faf6SmrgXORG_CHANGELOG
92371b12faf6SmrgXORG_INSTALL
92381b12faf6SmrgXORG_MANPAGE_SECTIONS
92391b12faf6Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
92401b12faf6Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
92411b12faf6Smrg]) # XORG_DEFAULT_OPTIONS
92421b12faf6Smrg
92431b12faf6Smrg# XORG_INSTALL()
92441b12faf6Smrg# ----------------
92451b12faf6Smrg# Minimum version: 1.4.0
92461b12faf6Smrg#
92471b12faf6Smrg# Defines the variable INSTALL_CMD as the command to copy
92481b12faf6Smrg# INSTALL from $prefix/share/util-macros.
92491b12faf6Smrg#
92501b12faf6SmrgAC_DEFUN([XORG_INSTALL], [
92511b12faf6SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
92521b12faf6Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
92531b12faf6SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
92541b12faf6Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
92551b12faf6Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
92561b12faf6Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
92571b12faf6SmrgAC_SUBST([INSTALL_CMD])
92581b12faf6Smrg]) # XORG_INSTALL
92592a51b5beSmrgdnl Copyright 2005 Red Hat, Inc
92602a51b5beSmrgdnl
92612a51b5beSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
92622a51b5beSmrgdnl documentation for any purpose is hereby granted without fee, provided that
92632a51b5beSmrgdnl the above copyright notice appear in all copies and that both that
92642a51b5beSmrgdnl copyright notice and this permission notice appear in supporting
92652a51b5beSmrgdnl documentation.
92662a51b5beSmrgdnl
92672a51b5beSmrgdnl The above copyright notice and this permission notice shall be included
92682a51b5beSmrgdnl in all copies or substantial portions of the Software.
92692a51b5beSmrgdnl
92702a51b5beSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
92712a51b5beSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
92722a51b5beSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
92732a51b5beSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
92742a51b5beSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
92752a51b5beSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
92762a51b5beSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
92772a51b5beSmrgdnl
92782a51b5beSmrgdnl Except as contained in this notice, the name of the copyright holders shall
92792a51b5beSmrgdnl not be used in advertising or otherwise to promote the sale, use or
92802a51b5beSmrgdnl other dealings in this Software without prior written authorization
92812a51b5beSmrgdnl from the copyright holders.
92822a51b5beSmrgdnl
928332b578d3Smrg
92842a51b5beSmrg# XORG_RELEASE_VERSION
92852a51b5beSmrg# --------------------
92861b12faf6Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
92872a51b5beSmrg 
92882a51b5beSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
92892a51b5beSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
92902a51b5beSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
92912a51b5beSmrg		[Major version of this package])
92922a51b5beSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
92932a51b5beSmrg	if test "x$PVM" = "x"; then
92942a51b5beSmrg		PVM="0"
92952a51b5beSmrg	fi
92962a51b5beSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
92972a51b5beSmrg		[$PVM],
92982a51b5beSmrg		[Minor version of this package])
92992a51b5beSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
93002a51b5beSmrg	if test "x$PVP" = "x"; then
93012a51b5beSmrg		PVP="0"
93022a51b5beSmrg	fi
93032a51b5beSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
93042a51b5beSmrg		[$PVP],
93052a51b5beSmrg		[Patch version of this package])
93062a51b5beSmrg])
930732b578d3Smrg
93082a51b5beSmrg# XORG_CHANGELOG()
93092a51b5beSmrg# ----------------
93102a51b5beSmrg# Minimum version: 1.2.0
93112a51b5beSmrg#
93122a51b5beSmrg# Defines the variable CHANGELOG_CMD as the command to generate
93132a51b5beSmrg# ChangeLog from git.
93142a51b5beSmrg#
93152a51b5beSmrg#
93162a51b5beSmrgAC_DEFUN([XORG_CHANGELOG], [
93171b12faf6SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
93181b12faf6Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
93191b12faf6Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
93202a51b5beSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
93212a51b5beSmrgAC_SUBST([CHANGELOG_CMD])
93222a51b5beSmrg]) # XORG_CHANGELOG
932332b578d3Smrg
93241b12faf6Smrgdnl Copyright 2005 Red Hat, Inc
93251b12faf6Smrgdnl 
93261b12faf6Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
93271b12faf6Smrgdnl documentation for any purpose is hereby granted without fee, provided that
93281b12faf6Smrgdnl the above copyright notice appear in all copies and that both that
93291b12faf6Smrgdnl copyright notice and this permission notice appear in supporting
93301b12faf6Smrgdnl documentation.
93311b12faf6Smrgdnl 
93321b12faf6Smrgdnl The above copyright notice and this permission notice shall be included
93331b12faf6Smrgdnl in all copies or substantial portions of the Software.
93341b12faf6Smrgdnl 
93351b12faf6Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
93361b12faf6Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
93371b12faf6Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
93381b12faf6Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
93391b12faf6Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
93401b12faf6Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
93411b12faf6Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
93421b12faf6Smrgdnl 
93431b12faf6Smrgdnl Except as contained in this notice, the name of the copyright holders shall
93441b12faf6Smrgdnl not be used in advertising or otherwise to promote the sale, use or
93451b12faf6Smrgdnl other dealings in this Software without prior written authorization
93461b12faf6Smrgdnl from the copyright holders.
93471b12faf6Smrgdnl 
93481b12faf6Smrg
93491b12faf6Smrg# XORG_DRIVER_CHECK_EXT()
93501b12faf6Smrg# --------------------------
93511b12faf6Smrg# Checks for the $1 define in xorg-server.h (from the sdk).  If it
93521b12faf6Smrg# is defined, then add $1 to $REQUIRED_MODULES.
93531b12faf6Smrg
93541b12faf6SmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
93551b12faf6Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
93561b12faf6Smrg	SAVE_CFLAGS="$CFLAGS"
93571b12faf6Smrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
93581b12faf6Smrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
93591b12faf6Smrg#include "xorg-server.h"
93601b12faf6Smrg#if !defined $1
93611b12faf6Smrg#error $1 not defined
93621b12faf6Smrg#endif
93631b12faf6Smrg		]])],
93641b12faf6Smrg		[_EXT_CHECK=yes],
93651b12faf6Smrg		[_EXT_CHECK=no])
93661b12faf6Smrg	CFLAGS="$SAVE_CFLAGS"
93671b12faf6Smrg	AC_MSG_CHECKING([if $1 is defined])
93681b12faf6Smrg	AC_MSG_RESULT([$_EXT_CHECK])
93691b12faf6Smrg	if test "$_EXT_CHECK" != no; then
93701b12faf6Smrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
93711b12faf6Smrg	fi
93721b12faf6Smrg])
93731b12faf6Smrg
93742a51b5beSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
93752a51b5beSmrg#
93762a51b5beSmrg# This file is free software; the Free Software Foundation
93772a51b5beSmrg# gives unlimited permission to copy and/or distribute it,
93782a51b5beSmrg# with or without modifications, as long as this notice is preserved.
937932b578d3Smrg
93802a51b5beSmrg# AM_AUTOMAKE_VERSION(VERSION)
93812a51b5beSmrg# ----------------------------
93822a51b5beSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
93832a51b5beSmrg# generated from the m4 files accompanying Automake X.Y.
93842a51b5beSmrg# (This private macro should not be called outside this file.)
93852a51b5beSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
93862a51b5beSmrg[am__api_version='1.11'
93872a51b5beSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
93882a51b5beSmrgdnl require some minimum version.  Point them to the right macro.
93891b12faf6Smrgm4_if([$1], [1.11.1], [],
93902a51b5beSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
93912a51b5beSmrg])
939232b578d3Smrg
93932a51b5beSmrg# _AM_AUTOCONF_VERSION(VERSION)
93942a51b5beSmrg# -----------------------------
93952a51b5beSmrg# aclocal traces this macro to find the Autoconf version.
93962a51b5beSmrg# This is a private macro too.  Using m4_define simplifies
93972a51b5beSmrg# the logic in aclocal, which can simply ignore this definition.
93982a51b5beSmrgm4_define([_AM_AUTOCONF_VERSION], [])
939932b578d3Smrg
94002a51b5beSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
94012a51b5beSmrg# -------------------------------
94022a51b5beSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
94032a51b5beSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
94042a51b5beSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
94051b12faf6Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
94062a51b5beSmrgm4_ifndef([AC_AUTOCONF_VERSION],
94072a51b5beSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
94082a51b5beSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
940932b578d3Smrg
94102a51b5beSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
941132b578d3Smrg
94122a51b5beSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
94132a51b5beSmrg#
94142a51b5beSmrg# This file is free software; the Free Software Foundation
94152a51b5beSmrg# gives unlimited permission to copy and/or distribute it,
94162a51b5beSmrg# with or without modifications, as long as this notice is preserved.
94172a51b5beSmrg
94182a51b5beSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
94192a51b5beSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
94202a51b5beSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
94212a51b5beSmrg#
94222a51b5beSmrg# Of course, Automake must honor this variable whenever it calls a
94232a51b5beSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
94242a51b5beSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
94252a51b5beSmrg# depending on how configure is run.  This is pretty annoying, since
94262a51b5beSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
94272a51b5beSmrg# source directory, any form will work fine, but in subdirectories a
94282a51b5beSmrg# relative path needs to be adjusted first.
94292a51b5beSmrg#
94302a51b5beSmrg# $ac_aux_dir/missing
94312a51b5beSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
94322a51b5beSmrg# $top_srcdir/$ac_aux_dir/missing
94332a51b5beSmrg#    fails if $ac_aux_dir is absolute,
94342a51b5beSmrg#    fails when called from a subdirectory in a VPATH build with
94352a51b5beSmrg#          a relative $ac_aux_dir
94362a51b5beSmrg#
94372a51b5beSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
94382a51b5beSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
94392a51b5beSmrg# harmless because $srcdir is `.', but things will broke when you
94402a51b5beSmrg# start a VPATH build or use an absolute $srcdir.
94412a51b5beSmrg#
94422a51b5beSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
94432a51b5beSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
94442a51b5beSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
94452a51b5beSmrg# and then we would define $MISSING as
94462a51b5beSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
94472a51b5beSmrg# This will work as long as MISSING is not called from configure, because
94482a51b5beSmrg# unfortunately $(top_srcdir) has no meaning in configure.
94492a51b5beSmrg# However there are other variables, like CC, which are often used in
94502a51b5beSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
94512a51b5beSmrg#
94522a51b5beSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
94532a51b5beSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
94542a51b5beSmrg# configured tree to be moved without reconfiguration.
945532b578d3Smrg
94562a51b5beSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
94572a51b5beSmrg[dnl Rely on autoconf to set up CDPATH properly.
94582a51b5beSmrgAC_PREREQ([2.50])dnl
94592a51b5beSmrg# expand $ac_aux_dir to an absolute path
94602a51b5beSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
94612a51b5beSmrg])
946232b578d3Smrg
94632a51b5beSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
946432b578d3Smrg
94652a51b5beSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
94662a51b5beSmrg# Free Software Foundation, Inc.
94672a51b5beSmrg#
94682a51b5beSmrg# This file is free software; the Free Software Foundation
94692a51b5beSmrg# gives unlimited permission to copy and/or distribute it,
94702a51b5beSmrg# with or without modifications, as long as this notice is preserved.
947132b578d3Smrg
94722a51b5beSmrg# serial 9
947332b578d3Smrg
94742a51b5beSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
94752a51b5beSmrg# -------------------------------------
94762a51b5beSmrg# Define a conditional.
94772a51b5beSmrgAC_DEFUN([AM_CONDITIONAL],
94782a51b5beSmrg[AC_PREREQ(2.52)dnl
94792a51b5beSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
94802a51b5beSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
94812a51b5beSmrgAC_SUBST([$1_TRUE])dnl
94822a51b5beSmrgAC_SUBST([$1_FALSE])dnl
94832a51b5beSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
94842a51b5beSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
94852a51b5beSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
94862a51b5beSmrgif $2; then
94872a51b5beSmrg  $1_TRUE=
94882a51b5beSmrg  $1_FALSE='#'
94892a51b5beSmrgelse
94902a51b5beSmrg  $1_TRUE='#'
94912a51b5beSmrg  $1_FALSE=
94922a51b5beSmrgfi
94932a51b5beSmrgAC_CONFIG_COMMANDS_PRE(
94942a51b5beSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
94952a51b5beSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
94962a51b5beSmrgUsually this means the macro was only invoked conditionally.]])
94972a51b5beSmrgfi])])
949832b578d3Smrg
94992a51b5beSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
95002a51b5beSmrg# Free Software Foundation, Inc.
95012a51b5beSmrg#
95022a51b5beSmrg# This file is free software; the Free Software Foundation
95032a51b5beSmrg# gives unlimited permission to copy and/or distribute it,
95042a51b5beSmrg# with or without modifications, as long as this notice is preserved.
950532b578d3Smrg
95062a51b5beSmrg# serial 10
950732b578d3Smrg
95082a51b5beSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
95092a51b5beSmrg# written in clear, in which case automake, when reading aclocal.m4,
95102a51b5beSmrg# will think it sees a *use*, and therefore will trigger all it's
95112a51b5beSmrg# C support machinery.  Also note that it means that autoscan, seeing
95122a51b5beSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
951332b578d3Smrg
951432b578d3Smrg
95152a51b5beSmrg# _AM_DEPENDENCIES(NAME)
95162a51b5beSmrg# ----------------------
95172a51b5beSmrg# See how the compiler implements dependency checking.
95182a51b5beSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
95192a51b5beSmrg# We try a few techniques and use that to set a single cache variable.
95202a51b5beSmrg#
95212a51b5beSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
95222a51b5beSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
95232a51b5beSmrg# dependency, and given that the user is not expected to run this macro,
95242a51b5beSmrg# just rely on AC_PROG_CC.
95252a51b5beSmrgAC_DEFUN([_AM_DEPENDENCIES],
95262a51b5beSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
95272a51b5beSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
95282a51b5beSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
95292a51b5beSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
953032b578d3Smrg
95312a51b5beSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
95322a51b5beSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
95332a51b5beSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
95342a51b5beSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
95352a51b5beSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
95362a51b5beSmrg                   [depcc="$$1"   am_compiler_list=])
953732b578d3Smrg
95382a51b5beSmrgAC_CACHE_CHECK([dependency style of $depcc],
95392a51b5beSmrg               [am_cv_$1_dependencies_compiler_type],
95402a51b5beSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
95412a51b5beSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
95422a51b5beSmrg  # making bogus files that we don't know about and never remove.  For
95432a51b5beSmrg  # instance it was reported that on HP-UX the gcc test will end up
95442a51b5beSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
95452a51b5beSmrg  # in D'.
95462a51b5beSmrg  mkdir conftest.dir
95472a51b5beSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
95482a51b5beSmrg  # using a relative directory.
95492a51b5beSmrg  cp "$am_depcomp" conftest.dir
95502a51b5beSmrg  cd conftest.dir
95512a51b5beSmrg  # We will build objects and dependencies in a subdirectory because
95522a51b5beSmrg  # it helps to detect inapplicable dependency modes.  For instance
95532a51b5beSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
95542a51b5beSmrg  # side effect of compilation, but ICC will put the dependencies in
95552a51b5beSmrg  # the current directory while Tru64 will put them in the object
95562a51b5beSmrg  # directory.
95572a51b5beSmrg  mkdir sub
955832b578d3Smrg
95592a51b5beSmrg  am_cv_$1_dependencies_compiler_type=none
95602a51b5beSmrg  if test "$am_compiler_list" = ""; then
95612a51b5beSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
95622a51b5beSmrg  fi
95632a51b5beSmrg  am__universal=false
95642a51b5beSmrg  m4_case([$1], [CC],
95652a51b5beSmrg    [case " $depcc " in #(
95662a51b5beSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
95672a51b5beSmrg     esac],
95682a51b5beSmrg    [CXX],
95692a51b5beSmrg    [case " $depcc " in #(
95702a51b5beSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
95712a51b5beSmrg     esac])
957232b578d3Smrg
95732a51b5beSmrg  for depmode in $am_compiler_list; do
95742a51b5beSmrg    # Setup a source with many dependencies, because some compilers
95752a51b5beSmrg    # like to wrap large dependency lists on column 80 (with \), and
95762a51b5beSmrg    # we should not choose a depcomp mode which is confused by this.
95772a51b5beSmrg    #
95782a51b5beSmrg    # We need to recreate these files for each test, as the compiler may
95792a51b5beSmrg    # overwrite some of them when testing with obscure command lines.
95802a51b5beSmrg    # This happens at least with the AIX C compiler.
95812a51b5beSmrg    : > sub/conftest.c
95822a51b5beSmrg    for i in 1 2 3 4 5 6; do
95832a51b5beSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
95842a51b5beSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
95852a51b5beSmrg      # Solaris 8's {/usr,}/bin/sh.
95862a51b5beSmrg      touch sub/conftst$i.h
95872a51b5beSmrg    done
95882a51b5beSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
95892a51b5beSmrg
95902a51b5beSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
95912a51b5beSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
95922a51b5beSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
95932a51b5beSmrg    # versions had trouble with output in subdirs
95942a51b5beSmrg    am__obj=sub/conftest.${OBJEXT-o}
95952a51b5beSmrg    am__minus_obj="-o $am__obj"
95962a51b5beSmrg    case $depmode in
95972a51b5beSmrg    gcc)
95982a51b5beSmrg      # This depmode causes a compiler race in universal mode.
95992a51b5beSmrg      test "$am__universal" = false || continue
96002a51b5beSmrg      ;;
96012a51b5beSmrg    nosideeffect)
96022a51b5beSmrg      # after this tag, mechanisms are not by side-effect, so they'll
96032a51b5beSmrg      # only be used when explicitly requested
96042a51b5beSmrg      if test "x$enable_dependency_tracking" = xyes; then
96052a51b5beSmrg	continue
96062a51b5beSmrg      else
96072a51b5beSmrg	break
96082a51b5beSmrg      fi
96092a51b5beSmrg      ;;
96102a51b5beSmrg    msvisualcpp | msvcmsys)
96112a51b5beSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
96122a51b5beSmrg      # not run yet.  These depmodes are late enough in the game, and
96132a51b5beSmrg      # so weak that their functioning should not be impacted.
96142a51b5beSmrg      am__obj=conftest.${OBJEXT-o}
96152a51b5beSmrg      am__minus_obj=
96162a51b5beSmrg      ;;
96172a51b5beSmrg    none) break ;;
96182a51b5beSmrg    esac
96192a51b5beSmrg    if depmode=$depmode \
96202a51b5beSmrg       source=sub/conftest.c object=$am__obj \
96212a51b5beSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
96222a51b5beSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
96232a51b5beSmrg         >/dev/null 2>conftest.err &&
96242a51b5beSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
96252a51b5beSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
96262a51b5beSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
96272a51b5beSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
96282a51b5beSmrg      # icc doesn't choke on unknown options, it will just issue warnings
96292a51b5beSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
96302a51b5beSmrg      # that says an option was ignored or not supported.
96312a51b5beSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
96322a51b5beSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
96332a51b5beSmrg      # The diagnosis changed in icc 8.0:
96342a51b5beSmrg      #   icc: Command line remark: option '-MP' not supported
96352a51b5beSmrg      if (grep 'ignoring option' conftest.err ||
96362a51b5beSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
96372a51b5beSmrg        am_cv_$1_dependencies_compiler_type=$depmode
96382a51b5beSmrg        break
9639d31dbc53Smrg      fi
96402a51b5beSmrg    fi
96412a51b5beSmrg  done
964232b578d3Smrg
96432a51b5beSmrg  cd ..
96442a51b5beSmrg  rm -rf conftest.dir
96452a51b5beSmrgelse
96462a51b5beSmrg  am_cv_$1_dependencies_compiler_type=none
96472a51b5beSmrgfi
96482a51b5beSmrg])
96492a51b5beSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
96502a51b5beSmrgAM_CONDITIONAL([am__fastdep$1], [
96512a51b5beSmrg  test "x$enable_dependency_tracking" != xno \
96522a51b5beSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
96532a51b5beSmrg])
965432b578d3Smrg
965532b578d3Smrg
96562a51b5beSmrg# AM_SET_DEPDIR
96572a51b5beSmrg# -------------
96582a51b5beSmrg# Choose a directory name for dependency files.
96592a51b5beSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
96602a51b5beSmrgAC_DEFUN([AM_SET_DEPDIR],
96612a51b5beSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
96622a51b5beSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
96632a51b5beSmrg])
966432b578d3Smrg
966532b578d3Smrg
96662a51b5beSmrg# AM_DEP_TRACK
96672a51b5beSmrg# ------------
96682a51b5beSmrgAC_DEFUN([AM_DEP_TRACK],
96692a51b5beSmrg[AC_ARG_ENABLE(dependency-tracking,
96702a51b5beSmrg[  --disable-dependency-tracking  speeds up one-time build
96712a51b5beSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
96722a51b5beSmrgif test "x$enable_dependency_tracking" != xno; then
96732a51b5beSmrg  am_depcomp="$ac_aux_dir/depcomp"
96742a51b5beSmrg  AMDEPBACKSLASH='\'
96752a51b5beSmrgfi
96762a51b5beSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
96772a51b5beSmrgAC_SUBST([AMDEPBACKSLASH])dnl
96782a51b5beSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
96792a51b5beSmrg])
968032b578d3Smrg
96812a51b5beSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
968232b578d3Smrg
96832a51b5beSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
96842a51b5beSmrg# Free Software Foundation, Inc.
96852a51b5beSmrg#
96862a51b5beSmrg# This file is free software; the Free Software Foundation
96872a51b5beSmrg# gives unlimited permission to copy and/or distribute it,
96882a51b5beSmrg# with or without modifications, as long as this notice is preserved.
968932b578d3Smrg
96902a51b5beSmrg#serial 5
96912a51b5beSmrg
96922a51b5beSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
96932a51b5beSmrg# ------------------------------
96942a51b5beSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
96952a51b5beSmrg[{
96962a51b5beSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
96972a51b5beSmrg  # are listed without --file.  Let's play safe and only enable the eval
96982a51b5beSmrg  # if we detect the quoting.
96992a51b5beSmrg  case $CONFIG_FILES in
97002a51b5beSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
97012a51b5beSmrg  *)   set x $CONFIG_FILES ;;
97022a51b5beSmrg  esac
97032a51b5beSmrg  shift
97042a51b5beSmrg  for mf
97052a51b5beSmrg  do
97062a51b5beSmrg    # Strip MF so we end up with the name of the file.
97072a51b5beSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
97082a51b5beSmrg    # Check whether this is an Automake generated Makefile or not.
97092a51b5beSmrg    # We used to match only the files named `Makefile.in', but
97102a51b5beSmrg    # some people rename them; so instead we look at the file content.
97112a51b5beSmrg    # Grep'ing the first line is not enough: some people post-process
97122a51b5beSmrg    # each Makefile.in and add a new line on top of each file to say so.
97132a51b5beSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
97142a51b5beSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
97152a51b5beSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
97162a51b5beSmrg      dirpart=`AS_DIRNAME("$mf")`
9717d31dbc53Smrg    else
97182a51b5beSmrg      continue
9719d31dbc53Smrg    fi
97202a51b5beSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
97212a51b5beSmrg    # from the Makefile without running `make'.
97222a51b5beSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
97232a51b5beSmrg    test -z "$DEPDIR" && continue
97242a51b5beSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
97252a51b5beSmrg    test -z "am__include" && continue
97262a51b5beSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
97272a51b5beSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
97282a51b5beSmrg    U=`sed -n 's/^U = //p' < "$mf"`
97292a51b5beSmrg    # Find all dependency output files, they are included files with
97302a51b5beSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
97312a51b5beSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
97322a51b5beSmrg    # expansion.
97332a51b5beSmrg    for file in `sed -n "
97342a51b5beSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
97352a51b5beSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
97362a51b5beSmrg      # Make sure the directory exists.
97372a51b5beSmrg      test -f "$dirpart/$file" && continue
97382a51b5beSmrg      fdir=`AS_DIRNAME(["$file"])`
97392a51b5beSmrg      AS_MKDIR_P([$dirpart/$fdir])
97402a51b5beSmrg      # echo "creating $dirpart/$file"
97412a51b5beSmrg      echo '# dummy' > "$dirpart/$file"
97422a51b5beSmrg    done
97432a51b5beSmrg  done
97442a51b5beSmrg}
97452a51b5beSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
974632b578d3Smrg
974732b578d3Smrg
97482a51b5beSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
97492a51b5beSmrg# -----------------------------
97502a51b5beSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
97512a51b5beSmrg#
97522a51b5beSmrg# This code is only required when automatic dependency tracking
97532a51b5beSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
97542a51b5beSmrg# need in order to bootstrap the dependency handling code.
97552a51b5beSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
97562a51b5beSmrg[AC_CONFIG_COMMANDS([depfiles],
97572a51b5beSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
97582a51b5beSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
97592a51b5beSmrg])
97602a51b5beSmrg
97612a51b5beSmrg# Do all the work for Automake.                             -*- Autoconf -*-
97622a51b5beSmrg
97632a51b5beSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
97642a51b5beSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
97652a51b5beSmrg#
97662a51b5beSmrg# This file is free software; the Free Software Foundation
97672a51b5beSmrg# gives unlimited permission to copy and/or distribute it,
97682a51b5beSmrg# with or without modifications, as long as this notice is preserved.
97692a51b5beSmrg
97702a51b5beSmrg# serial 16
977132b578d3Smrg
97722a51b5beSmrg# This macro actually does too much.  Some checks are only needed if
97732a51b5beSmrg# your package does certain things.  But this isn't really a big deal.
977432b578d3Smrg
97752a51b5beSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
97762a51b5beSmrg# AM_INIT_AUTOMAKE([OPTIONS])
97772a51b5beSmrg# -----------------------------------------------
97782a51b5beSmrg# The call with PACKAGE and VERSION arguments is the old style
97792a51b5beSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
97802a51b5beSmrg# and VERSION should now be passed to AC_INIT and removed from
97812a51b5beSmrg# the call to AM_INIT_AUTOMAKE.
97822a51b5beSmrg# We support both call styles for the transition.  After
97832a51b5beSmrg# the next Automake release, Autoconf can make the AC_INIT
97842a51b5beSmrg# arguments mandatory, and then we can depend on a new Autoconf
97852a51b5beSmrg# release and drop the old call support.
97862a51b5beSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
97872a51b5beSmrg[AC_PREREQ([2.62])dnl
97882a51b5beSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
97892a51b5beSmrgdnl the ones we care about.
97902a51b5beSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
97912a51b5beSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
97922a51b5beSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
97932a51b5beSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
97942a51b5beSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
97952a51b5beSmrg  # is not polluted with repeated "-I."
97962a51b5beSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
97972a51b5beSmrg  # test to see if srcdir already configured
97982a51b5beSmrg  if test -f $srcdir/config.status; then
97992a51b5beSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
98002a51b5beSmrg  fi
98012a51b5beSmrgfi
980232b578d3Smrg
98032a51b5beSmrg# test whether we have cygpath
98042a51b5beSmrgif test -z "$CYGPATH_W"; then
98052a51b5beSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
98062a51b5beSmrg    CYGPATH_W='cygpath -w'
98072a51b5beSmrg  else
98082a51b5beSmrg    CYGPATH_W=echo
98092a51b5beSmrg  fi
98102a51b5beSmrgfi
98112a51b5beSmrgAC_SUBST([CYGPATH_W])
981232b578d3Smrg
98132a51b5beSmrg# Define the identity of the package.
98142a51b5beSmrgdnl Distinguish between old-style and new-style calls.
98152a51b5beSmrgm4_ifval([$2],
98162a51b5beSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
98172a51b5beSmrg AC_SUBST([PACKAGE], [$1])dnl
98182a51b5beSmrg AC_SUBST([VERSION], [$2])],
98192a51b5beSmrg[_AM_SET_OPTIONS([$1])dnl
98202a51b5beSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
98212a51b5beSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
98222a51b5beSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
98232a51b5beSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
98242a51b5beSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
982532b578d3Smrg
98262a51b5beSmrg_AM_IF_OPTION([no-define],,
98272a51b5beSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
98282a51b5beSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
982932b578d3Smrg
98302a51b5beSmrg# Some tools Automake needs.
98312a51b5beSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
98322a51b5beSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
98332a51b5beSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
98342a51b5beSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
98352a51b5beSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
98362a51b5beSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
98372a51b5beSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
98382a51b5beSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
98392a51b5beSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
98402a51b5beSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
98412a51b5beSmrg# We need awk for the "check" target.  The system "awk" is bad on
98422a51b5beSmrg# some platforms.
98432a51b5beSmrgAC_REQUIRE([AC_PROG_AWK])dnl
98442a51b5beSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
98452a51b5beSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
98462a51b5beSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
98472a51b5beSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
98482a51b5beSmrg			     [_AM_PROG_TAR([v7])])])
98492a51b5beSmrg_AM_IF_OPTION([no-dependencies],,
98502a51b5beSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
98512a51b5beSmrg		  [_AM_DEPENDENCIES(CC)],
98522a51b5beSmrg		  [define([AC_PROG_CC],
98532a51b5beSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
98542a51b5beSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
98552a51b5beSmrg		  [_AM_DEPENDENCIES(CXX)],
98562a51b5beSmrg		  [define([AC_PROG_CXX],
98572a51b5beSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
98582a51b5beSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
98592a51b5beSmrg		  [_AM_DEPENDENCIES(OBJC)],
98602a51b5beSmrg		  [define([AC_PROG_OBJC],
98612a51b5beSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
98622a51b5beSmrg])
98632a51b5beSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
98642a51b5beSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
98652a51b5beSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
98662a51b5beSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
98672a51b5beSmrgAC_CONFIG_COMMANDS_PRE(dnl
98682a51b5beSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
98692a51b5beSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
98702a51b5beSmrg])
987132b578d3Smrg
98722a51b5beSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
98732a51b5beSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
98742a51b5beSmrgdnl mangled by Autoconf and run in a shell conditional statement.
98752a51b5beSmrgm4_define([_AC_COMPILER_EXEEXT],
98762a51b5beSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
987732b578d3Smrg
987832b578d3Smrg
98792a51b5beSmrg# When config.status generates a header, we must update the stamp-h file.
98802a51b5beSmrg# This file resides in the same directory as the config header
98812a51b5beSmrg# that is generated.  The stamp files are numbered to have different names.
988232b578d3Smrg
98832a51b5beSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
98842a51b5beSmrg# loop where config.status creates the headers, so we can generate
98852a51b5beSmrg# our stamp files there.
98862a51b5beSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
98872a51b5beSmrg[# Compute $1's index in $config_headers.
98882a51b5beSmrg_am_arg=$1
98892a51b5beSmrg_am_stamp_count=1
98902a51b5beSmrgfor _am_header in $config_headers :; do
98912a51b5beSmrg  case $_am_header in
98922a51b5beSmrg    $_am_arg | $_am_arg:* )
98932a51b5beSmrg      break ;;
98942a51b5beSmrg    * )
98952a51b5beSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
98962a51b5beSmrg  esac
98972a51b5beSmrgdone
98982a51b5beSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
989932b578d3Smrg
99002a51b5beSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
99012a51b5beSmrg#
99022a51b5beSmrg# This file is free software; the Free Software Foundation
99032a51b5beSmrg# gives unlimited permission to copy and/or distribute it,
99042a51b5beSmrg# with or without modifications, as long as this notice is preserved.
990532b578d3Smrg
99062a51b5beSmrg# AM_PROG_INSTALL_SH
99072a51b5beSmrg# ------------------
99082a51b5beSmrg# Define $install_sh.
99092a51b5beSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
99102a51b5beSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
99112a51b5beSmrgif test x"${install_sh}" != xset; then
99122a51b5beSmrg  case $am_aux_dir in
99132a51b5beSmrg  *\ * | *\	*)
99142a51b5beSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
99152a51b5beSmrg  *)
99162a51b5beSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
99172a51b5beSmrg  esac
99182a51b5beSmrgfi
99192a51b5beSmrgAC_SUBST(install_sh)])
992032b578d3Smrg
99212a51b5beSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
99222a51b5beSmrg#
99232a51b5beSmrg# This file is free software; the Free Software Foundation
99242a51b5beSmrg# gives unlimited permission to copy and/or distribute it,
99252a51b5beSmrg# with or without modifications, as long as this notice is preserved.
992632b578d3Smrg
99272a51b5beSmrg# serial 2
992832b578d3Smrg
99292a51b5beSmrg# Check whether the underlying file-system supports filenames
99302a51b5beSmrg# with a leading dot.  For instance MS-DOS doesn't.
99312a51b5beSmrgAC_DEFUN([AM_SET_LEADING_DOT],
99322a51b5beSmrg[rm -rf .tst 2>/dev/null
99332a51b5beSmrgmkdir .tst 2>/dev/null
99342a51b5beSmrgif test -d .tst; then
99352a51b5beSmrg  am__leading_dot=.
99362a51b5beSmrgelse
99372a51b5beSmrg  am__leading_dot=_
99382a51b5beSmrgfi
99392a51b5beSmrgrmdir .tst 2>/dev/null
99402a51b5beSmrgAC_SUBST([am__leading_dot])])
994132b578d3Smrg
99422a51b5beSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
99432a51b5beSmrg# From Jim Meyering
994432b578d3Smrg
99452a51b5beSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
99462a51b5beSmrg# Free Software Foundation, Inc.
99472a51b5beSmrg#
99482a51b5beSmrg# This file is free software; the Free Software Foundation
99492a51b5beSmrg# gives unlimited permission to copy and/or distribute it,
99502a51b5beSmrg# with or without modifications, as long as this notice is preserved.
995132b578d3Smrg
99522a51b5beSmrg# serial 5
995332b578d3Smrg
99542a51b5beSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
99552a51b5beSmrg# ----------------------------------
99562a51b5beSmrg# Control maintainer-specific portions of Makefiles.
99572a51b5beSmrg# Default is to disable them, unless `enable' is passed literally.
99582a51b5beSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
99592a51b5beSmrg# can override the default with the --enable/--disable switch.
99602a51b5beSmrgAC_DEFUN([AM_MAINTAINER_MODE],
99612a51b5beSmrg[m4_case(m4_default([$1], [disable]),
99622a51b5beSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
99632a51b5beSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
99642a51b5beSmrg       [m4_define([am_maintainer_other], [enable])
99652a51b5beSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
99662a51b5beSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
99672a51b5beSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
99682a51b5beSmrg  AC_ARG_ENABLE([maintainer-mode],
99692a51b5beSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
99702a51b5beSmrg			  (and sometimes confusing) to the casual installer],
99712a51b5beSmrg      [USE_MAINTAINER_MODE=$enableval],
99722a51b5beSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
99732a51b5beSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
99742a51b5beSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
99752a51b5beSmrg  MAINT=$MAINTAINER_MODE_TRUE
99762a51b5beSmrg  AC_SUBST([MAINT])dnl
99772a51b5beSmrg]
99782a51b5beSmrg)
997932b578d3Smrg
99802a51b5beSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
998132b578d3Smrg
99822a51b5beSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
998332b578d3Smrg
99842a51b5beSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
99852a51b5beSmrg#
99862a51b5beSmrg# This file is free software; the Free Software Foundation
99872a51b5beSmrg# gives unlimited permission to copy and/or distribute it,
99882a51b5beSmrg# with or without modifications, as long as this notice is preserved.
998932b578d3Smrg
99902a51b5beSmrg# serial 4
999132b578d3Smrg
99922a51b5beSmrg# AM_MAKE_INCLUDE()
99932a51b5beSmrg# -----------------
99942a51b5beSmrg# Check to see how make treats includes.
99952a51b5beSmrgAC_DEFUN([AM_MAKE_INCLUDE],
99962a51b5beSmrg[am_make=${MAKE-make}
99972a51b5beSmrgcat > confinc << 'END'
99982a51b5beSmrgam__doit:
99992a51b5beSmrg	@echo this is the am__doit target
100002a51b5beSmrg.PHONY: am__doit
100012a51b5beSmrgEND
100022a51b5beSmrg# If we don't find an include directive, just comment out the code.
100032a51b5beSmrgAC_MSG_CHECKING([for style of include used by $am_make])
100042a51b5beSmrgam__include="#"
100052a51b5beSmrgam__quote=
100062a51b5beSmrg_am_result=none
100072a51b5beSmrg# First try GNU make style include.
100082a51b5beSmrgecho "include confinc" > confmf
100092a51b5beSmrg# Ignore all kinds of additional output from `make'.
100102a51b5beSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
100112a51b5beSmrg*the\ am__doit\ target*)
100122a51b5beSmrg  am__include=include
100132a51b5beSmrg  am__quote=
100142a51b5beSmrg  _am_result=GNU
100152a51b5beSmrg  ;;
100162a51b5beSmrgesac
100172a51b5beSmrg# Now try BSD make style include.
100182a51b5beSmrgif test "$am__include" = "#"; then
100192a51b5beSmrg   echo '.include "confinc"' > confmf
100202a51b5beSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
100212a51b5beSmrg   *the\ am__doit\ target*)
100222a51b5beSmrg     am__include=.include
100232a51b5beSmrg     am__quote="\""
100242a51b5beSmrg     _am_result=BSD
100252a51b5beSmrg     ;;
100262a51b5beSmrg   esac
100272a51b5beSmrgfi
100282a51b5beSmrgAC_SUBST([am__include])
100292a51b5beSmrgAC_SUBST([am__quote])
100302a51b5beSmrgAC_MSG_RESULT([$_am_result])
100312a51b5beSmrgrm -f confinc confmf
100322a51b5beSmrg])
1003332b578d3Smrg
100342a51b5beSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1003532b578d3Smrg
100362a51b5beSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
100372a51b5beSmrg# Free Software Foundation, Inc.
100382a51b5beSmrg#
100392a51b5beSmrg# This file is free software; the Free Software Foundation
100402a51b5beSmrg# gives unlimited permission to copy and/or distribute it,
100412a51b5beSmrg# with or without modifications, as long as this notice is preserved.
1004232b578d3Smrg
100432a51b5beSmrg# serial 6
1004432b578d3Smrg
100452a51b5beSmrg# AM_MISSING_PROG(NAME, PROGRAM)
100462a51b5beSmrg# ------------------------------
100472a51b5beSmrgAC_DEFUN([AM_MISSING_PROG],
100482a51b5beSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
100492a51b5beSmrg$1=${$1-"${am_missing_run}$2"}
100502a51b5beSmrgAC_SUBST($1)])
1005132b578d3Smrg
1005232b578d3Smrg
100532a51b5beSmrg# AM_MISSING_HAS_RUN
100542a51b5beSmrg# ------------------
100552a51b5beSmrg# Define MISSING if not defined so far and test if it supports --run.
100562a51b5beSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
100572a51b5beSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
100582a51b5beSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
100592a51b5beSmrgAC_REQUIRE_AUX_FILE([missing])dnl
100602a51b5beSmrgif test x"${MISSING+set}" != xset; then
100612a51b5beSmrg  case $am_aux_dir in
100622a51b5beSmrg  *\ * | *\	*)
100632a51b5beSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
100642a51b5beSmrg  *)
100652a51b5beSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
100662a51b5beSmrg  esac
100672a51b5beSmrgfi
100682a51b5beSmrg# Use eval to expand $SHELL
100692a51b5beSmrgif eval "$MISSING --run true"; then
100702a51b5beSmrg  am_missing_run="$MISSING --run "
100712a51b5beSmrgelse
100722a51b5beSmrg  am_missing_run=
100732a51b5beSmrg  AC_MSG_WARN([`missing' script is too old or missing])
100742a51b5beSmrgfi
100752a51b5beSmrg])
100762a51b5beSmrg
100772a51b5beSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
100782a51b5beSmrg#
100792a51b5beSmrg# This file is free software; the Free Software Foundation
100802a51b5beSmrg# gives unlimited permission to copy and/or distribute it,
100812a51b5beSmrg# with or without modifications, as long as this notice is preserved.
100822a51b5beSmrg
100832a51b5beSmrg# AM_PROG_MKDIR_P
100842a51b5beSmrg# ---------------
100852a51b5beSmrg# Check for `mkdir -p'.
100862a51b5beSmrgAC_DEFUN([AM_PROG_MKDIR_P],
100872a51b5beSmrg[AC_PREREQ([2.60])dnl
100882a51b5beSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
100892a51b5beSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
100902a51b5beSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
100912a51b5beSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
100922a51b5beSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
100932a51b5beSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
100942a51b5beSmrgdnl adjustment using top_builddir (which is defined more often than
100952a51b5beSmrgdnl MKDIR_P).
100962a51b5beSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
100972a51b5beSmrgcase $mkdir_p in
100982a51b5beSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
100992a51b5beSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
101002a51b5beSmrgesac
1010132b578d3Smrg])
1010232b578d3Smrg
101032a51b5beSmrg# Helper functions for option handling.                     -*- Autoconf -*-
1010432b578d3Smrg
101052a51b5beSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
101062a51b5beSmrg#
101072a51b5beSmrg# This file is free software; the Free Software Foundation
101082a51b5beSmrg# gives unlimited permission to copy and/or distribute it,
101092a51b5beSmrg# with or without modifications, as long as this notice is preserved.
10110d31dbc53Smrg
101112a51b5beSmrg# serial 4
1011232b578d3Smrg
101132a51b5beSmrg# _AM_MANGLE_OPTION(NAME)
101142a51b5beSmrg# -----------------------
101152a51b5beSmrgAC_DEFUN([_AM_MANGLE_OPTION],
101162a51b5beSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1011732b578d3Smrg
101182a51b5beSmrg# _AM_SET_OPTION(NAME)
101192a51b5beSmrg# ------------------------------
101202a51b5beSmrg# Set option NAME.  Presently that only means defining a flag for this option.
101212a51b5beSmrgAC_DEFUN([_AM_SET_OPTION],
101222a51b5beSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1012332b578d3Smrg
101242a51b5beSmrg# _AM_SET_OPTIONS(OPTIONS)
101252a51b5beSmrg# ----------------------------------
101262a51b5beSmrg# OPTIONS is a space-separated list of Automake options.
101272a51b5beSmrgAC_DEFUN([_AM_SET_OPTIONS],
101282a51b5beSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1012932b578d3Smrg
101302a51b5beSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
101312a51b5beSmrg# -------------------------------------------
101322a51b5beSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
101332a51b5beSmrgAC_DEFUN([_AM_IF_OPTION],
101342a51b5beSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1013532b578d3Smrg
101362a51b5beSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
1013732b578d3Smrg
101382a51b5beSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
101392a51b5beSmrg# Free Software Foundation, Inc.
101402a51b5beSmrg#
101412a51b5beSmrg# This file is free software; the Free Software Foundation
101422a51b5beSmrg# gives unlimited permission to copy and/or distribute it,
101432a51b5beSmrg# with or without modifications, as long as this notice is preserved.
1014432b578d3Smrg
101452a51b5beSmrg# serial 5
1014632b578d3Smrg
101472a51b5beSmrg# AM_SANITY_CHECK
101482a51b5beSmrg# ---------------
101492a51b5beSmrgAC_DEFUN([AM_SANITY_CHECK],
101502a51b5beSmrg[AC_MSG_CHECKING([whether build environment is sane])
101512a51b5beSmrg# Just in case
101522a51b5beSmrgsleep 1
101532a51b5beSmrgecho timestamp > conftest.file
101542a51b5beSmrg# Reject unsafe characters in $srcdir or the absolute working directory
101552a51b5beSmrg# name.  Accept space and tab only in the latter.
101562a51b5beSmrgam_lf='
101572a51b5beSmrg'
101582a51b5beSmrgcase `pwd` in
101592a51b5beSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
101602a51b5beSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
101612a51b5beSmrgesac
101622a51b5beSmrgcase $srcdir in
101632a51b5beSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
101642a51b5beSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
101652a51b5beSmrgesac
1016632b578d3Smrg
101672a51b5beSmrg# Do `set' in a subshell so we don't clobber the current shell's
101682a51b5beSmrg# arguments.  Must try -L first in case configure is actually a
101692a51b5beSmrg# symlink; some systems play weird games with the mod time of symlinks
101702a51b5beSmrg# (eg FreeBSD returns the mod time of the symlink's containing
101712a51b5beSmrg# directory).
101722a51b5beSmrgif (
101732a51b5beSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
101742a51b5beSmrg   if test "$[*]" = "X"; then
101752a51b5beSmrg      # -L didn't work.
101762a51b5beSmrg      set X `ls -t "$srcdir/configure" conftest.file`
101772a51b5beSmrg   fi
101782a51b5beSmrg   rm -f conftest.file
101792a51b5beSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
101802a51b5beSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
10181d31dbc53Smrg
101822a51b5beSmrg      # If neither matched, then we have a broken ls.  This can happen
101832a51b5beSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
101842a51b5beSmrg      # broken ls alias from the environment.  This has actually
101852a51b5beSmrg      # happened.  Such a system could not be considered "sane".
101862a51b5beSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
101872a51b5beSmrgalias in your environment])
101882a51b5beSmrg   fi
10189d31dbc53Smrg
101902a51b5beSmrg   test "$[2]" = conftest.file
101912a51b5beSmrg   )
101922a51b5beSmrgthen
101932a51b5beSmrg   # Ok.
101942a51b5beSmrg   :
101952a51b5beSmrgelse
101962a51b5beSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
101972a51b5beSmrgCheck your system clock])
101982a51b5beSmrgfi
101992a51b5beSmrgAC_MSG_RESULT(yes)])
102002a51b5beSmrg
102011b12faf6Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
102021b12faf6Smrg#
102031b12faf6Smrg# This file is free software; the Free Software Foundation
102041b12faf6Smrg# gives unlimited permission to copy and/or distribute it,
102051b12faf6Smrg# with or without modifications, as long as this notice is preserved.
102061b12faf6Smrg
102071b12faf6Smrg# serial 1
102081b12faf6Smrg
102091b12faf6Smrg# AM_SILENT_RULES([DEFAULT])
102101b12faf6Smrg# --------------------------
102111b12faf6Smrg# Enable less verbose build rules; with the default set to DEFAULT
102121b12faf6Smrg# (`yes' being less verbose, `no' or empty being verbose).
102131b12faf6SmrgAC_DEFUN([AM_SILENT_RULES],
102141b12faf6Smrg[AC_ARG_ENABLE([silent-rules],
102151b12faf6Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
102161b12faf6Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
102171b12faf6Smrgcase $enable_silent_rules in
102181b12faf6Smrgyes) AM_DEFAULT_VERBOSITY=0;;
102191b12faf6Smrgno)  AM_DEFAULT_VERBOSITY=1;;
102201b12faf6Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
102211b12faf6Smrgesac
102221b12faf6SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
102231b12faf6SmrgAM_BACKSLASH='\'
102241b12faf6SmrgAC_SUBST([AM_BACKSLASH])dnl
102251b12faf6Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
102261b12faf6Smrg])
102271b12faf6Smrg
102282a51b5beSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
10229d31dbc53Smrg#
102302a51b5beSmrg# This file is free software; the Free Software Foundation
102312a51b5beSmrg# gives unlimited permission to copy and/or distribute it,
102322a51b5beSmrg# with or without modifications, as long as this notice is preserved.
1023332b578d3Smrg
102342a51b5beSmrg# AM_PROG_INSTALL_STRIP
102352a51b5beSmrg# ---------------------
102362a51b5beSmrg# One issue with vendor `install' (even GNU) is that you can't
102372a51b5beSmrg# specify the program used to strip binaries.  This is especially
102382a51b5beSmrg# annoying in cross-compiling environments, where the build's strip
102392a51b5beSmrg# is unlikely to handle the host's binaries.
102402a51b5beSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
102412a51b5beSmrg# always use install-sh in `make install-strip', and initialize
102422a51b5beSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
102432a51b5beSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
102442a51b5beSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
102452a51b5beSmrg# Installed binaries are usually stripped using `strip' when the user
102462a51b5beSmrg# run `make install-strip'.  However `strip' might not be the right
102472a51b5beSmrg# tool to use in cross-compilation environments, therefore Automake
102482a51b5beSmrg# will honor the `STRIP' environment variable to overrule this program.
102492a51b5beSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
102502a51b5beSmrgif test "$cross_compiling" != no; then
102512a51b5beSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
10252d31dbc53Smrgfi
102532a51b5beSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
102542a51b5beSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
1025532b578d3Smrg
102562a51b5beSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
10257d31dbc53Smrg#
102582a51b5beSmrg# This file is free software; the Free Software Foundation
102592a51b5beSmrg# gives unlimited permission to copy and/or distribute it,
102602a51b5beSmrg# with or without modifications, as long as this notice is preserved.
1026132b578d3Smrg
102622a51b5beSmrg# serial 2
1026332b578d3Smrg
102642a51b5beSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
102652a51b5beSmrg# ---------------------------
102662a51b5beSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
102672a51b5beSmrg# This macro is traced by Automake.
102682a51b5beSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1026932b578d3Smrg
102702a51b5beSmrg# AM_SUBST_NOTMAKE(VARIABLE)
102712a51b5beSmrg# ---------------------------
102722a51b5beSmrg# Public sister of _AM_SUBST_NOTMAKE.
102732a51b5beSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
102742a51b5beSmrg
102752a51b5beSmrg# Check how to create a tarball.                            -*- Autoconf -*-
102762a51b5beSmrg
102772a51b5beSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
1027832b578d3Smrg#
102792a51b5beSmrg# This file is free software; the Free Software Foundation
102802a51b5beSmrg# gives unlimited permission to copy and/or distribute it,
102812a51b5beSmrg# with or without modifications, as long as this notice is preserved.
102822a51b5beSmrg
102832a51b5beSmrg# serial 2
102842a51b5beSmrg
102852a51b5beSmrg# _AM_PROG_TAR(FORMAT)
102862a51b5beSmrg# --------------------
102872a51b5beSmrg# Check how to create a tarball in format FORMAT.
102882a51b5beSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
10289d31dbc53Smrg#
102902a51b5beSmrg# Substitute a variable $(am__tar) that is a command
102912a51b5beSmrg# writing to stdout a FORMAT-tarball containing the directory
102922a51b5beSmrg# $tardir.
102932a51b5beSmrg#     tardir=directory && $(am__tar) > result.tar
10294d31dbc53Smrg#
102952a51b5beSmrg# Substitute a variable $(am__untar) that extract such
102962a51b5beSmrg# a tarball read from stdin.
102972a51b5beSmrg#     $(am__untar) < result.tar
102982a51b5beSmrgAC_DEFUN([_AM_PROG_TAR],
102992a51b5beSmrg[# Always define AMTAR for backward compatibility.
103002a51b5beSmrgAM_MISSING_PROG([AMTAR], [tar])
103012a51b5beSmrgm4_if([$1], [v7],
103022a51b5beSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
103032a51b5beSmrg     [m4_case([$1], [ustar],, [pax],,
103042a51b5beSmrg              [m4_fatal([Unknown tar format])])
103052a51b5beSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
103062a51b5beSmrg# Loop over all known methods to create a tar archive until one works.
103072a51b5beSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
103082a51b5beSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
103092a51b5beSmrg# Do not fold the above two line into one, because Tru64 sh and
103102a51b5beSmrg# Solaris sh will not grok spaces in the rhs of `-'.
103112a51b5beSmrgfor _am_tool in $_am_tools
103122a51b5beSmrgdo
103132a51b5beSmrg  case $_am_tool in
103142a51b5beSmrg  gnutar)
103152a51b5beSmrg    for _am_tar in tar gnutar gtar;
103162a51b5beSmrg    do
103172a51b5beSmrg      AM_RUN_LOG([$_am_tar --version]) && break
103182a51b5beSmrg    done
103192a51b5beSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
103202a51b5beSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
103212a51b5beSmrg    am__untar="$_am_tar -xf -"
103222a51b5beSmrg    ;;
103232a51b5beSmrg  plaintar)
103242a51b5beSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
103252a51b5beSmrg    # ustar tarball either.
103262a51b5beSmrg    (tar --version) >/dev/null 2>&1 && continue
103272a51b5beSmrg    am__tar='tar chf - "$$tardir"'
103282a51b5beSmrg    am__tar_='tar chf - "$tardir"'
103292a51b5beSmrg    am__untar='tar xf -'
103302a51b5beSmrg    ;;
103312a51b5beSmrg  pax)
103322a51b5beSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
103332a51b5beSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
103342a51b5beSmrg    am__untar='pax -r'
103352a51b5beSmrg    ;;
103362a51b5beSmrg  cpio)
103372a51b5beSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
103382a51b5beSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
103392a51b5beSmrg    am__untar='cpio -i -H $1 -d'
103402a51b5beSmrg    ;;
103412a51b5beSmrg  none)
103422a51b5beSmrg    am__tar=false
103432a51b5beSmrg    am__tar_=false
103442a51b5beSmrg    am__untar=false
103452a51b5beSmrg    ;;
103462a51b5beSmrg  esac
1034732b578d3Smrg
103482a51b5beSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
103492a51b5beSmrg  # and am__untar set.
103502a51b5beSmrg  test -n "${am_cv_prog_tar_$1}" && break
1035132b578d3Smrg
103522a51b5beSmrg  # tar/untar a dummy directory, and stop if the command works
103532a51b5beSmrg  rm -rf conftest.dir
103542a51b5beSmrg  mkdir conftest.dir
103552a51b5beSmrg  echo GrepMe > conftest.dir/file
103562a51b5beSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
103572a51b5beSmrg  rm -rf conftest.dir
103582a51b5beSmrg  if test -s conftest.tar; then
103592a51b5beSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
103602a51b5beSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
103612a51b5beSmrg  fi
103622a51b5beSmrgdone
103632a51b5beSmrgrm -rf conftest.dir
1036432b578d3Smrg
103652a51b5beSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
103662a51b5beSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
103672a51b5beSmrgAC_SUBST([am__tar])
103682a51b5beSmrgAC_SUBST([am__untar])
103692a51b5beSmrg]) # _AM_PROG_TAR
1037032b578d3Smrg
10371