aclocal.m4 revision 6fc0178d
1fc544a13Smrg# generated automatically by aclocal 1.15 -*- Autoconf -*-
2fc544a13Smrg
3fc544a13Smrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
4ff559fabSmrg
5ff559fabSmrg# This file is free software; the Free Software Foundation
6ff559fabSmrg# gives unlimited permission to copy and/or distribute it,
7ff559fabSmrg# with or without modifications, as long as this notice is preserved.
8ff559fabSmrg
9ff559fabSmrg# This program is distributed in the hope that it will be useful,
10ff559fabSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11ff559fabSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12ff559fabSmrg# PARTICULAR PURPOSE.
13ff559fabSmrg
14fc544a13Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
157a3b38f7Smrgm4_ifndef([AC_AUTOCONF_VERSION],
167a3b38f7Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17fc544a13Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18fc544a13Smrg[m4_warning([this file was generated for autoconf 2.69.
197a3b38f7SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
207a3b38f7SmrgIf you have problems, you may need to regenerate the build system entirely.
21fc544a13SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22ff559fabSmrg
236fc0178dSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24ff559fabSmrg#
256fc0178dSmrg#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
266fc0178dSmrg#   Written by Gordon Matzigkeit, 1996
276fc0178dSmrg#
286fc0178dSmrg# This file is free software; the Free Software Foundation gives
296fc0178dSmrg# unlimited permission to copy and/or distribute it, with or without
306fc0178dSmrg# modifications, as long as this notice is preserved.
3144dda7b2Smrg
326fc0178dSmrgm4_define([_LT_COPYING], [dnl
336fc0178dSmrg# Copyright (C) 2014 Free Software Foundation, Inc.
346fc0178dSmrg# This is free software; see the source for copying conditions.  There is NO
356fc0178dSmrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3644dda7b2Smrg
376fc0178dSmrg# GNU Libtool is free software; you can redistribute it and/or modify
386fc0178dSmrg# it under the terms of the GNU General Public License as published by
396fc0178dSmrg# the Free Software Foundation; either version 2 of of the License, or
406fc0178dSmrg# (at your option) any later version.
416fc0178dSmrg#
426fc0178dSmrg# As a special exception to the GNU General Public License, if you
436fc0178dSmrg# distribute this file as part of a program or library that is built
446fc0178dSmrg# using GNU Libtool, you may include this file under the  same
456fc0178dSmrg# distribution terms that you use for the rest of that program.
466fc0178dSmrg#
476fc0178dSmrg# GNU Libtool is distributed in the hope that it will be useful, but
486fc0178dSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
496fc0178dSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
506fc0178dSmrg# GNU General Public License for more details.
516fc0178dSmrg#
526fc0178dSmrg# You should have received a copy of the GNU General Public License
536fc0178dSmrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
546fc0178dSmrg])
5544dda7b2Smrg
566fc0178dSmrg# serial 58 LT_INIT
5744dda7b2Smrg
5844dda7b2Smrg
596fc0178dSmrg# LT_PREREQ(VERSION)
606fc0178dSmrg# ------------------
616fc0178dSmrg# Complain and exit if this libtool version is less that VERSION.
626fc0178dSmrgm4_defun([LT_PREREQ],
636fc0178dSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
646fc0178dSmrg       [m4_default([$3],
656fc0178dSmrg		   [m4_fatal([Libtool version $1 or higher is required],
666fc0178dSmrg		             63)])],
676fc0178dSmrg       [$2])])
687a3b38f7Smrg
69ff559fabSmrg
706fc0178dSmrg# _LT_CHECK_BUILDDIR
716fc0178dSmrg# ------------------
726fc0178dSmrg# Complain if the absolute build directory name contains unusual characters
736fc0178dSmrgm4_defun([_LT_CHECK_BUILDDIR],
746fc0178dSmrg[case `pwd` in
756fc0178dSmrg  *\ * | *\	*)
766fc0178dSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
776fc0178dSmrgesac
787a3b38f7Smrg])
79ff559fabSmrg
80ff559fabSmrg
816fc0178dSmrg# LT_INIT([OPTIONS])
826fc0178dSmrg# ------------------
836fc0178dSmrgAC_DEFUN([LT_INIT],
846fc0178dSmrg[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
856fc0178dSmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
866fc0178dSmrgAC_BEFORE([$0], [LT_LANG])dnl
876fc0178dSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
886fc0178dSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
896fc0178dSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
90ff559fabSmrg
916fc0178dSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
926fc0178dSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
936fc0178dSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
946fc0178dSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
956fc0178dSmrgdnl unless we require an AC_DEFUNed macro:
966fc0178dSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
976fc0178dSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
986fc0178dSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
996fc0178dSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
1006fc0178dSmrgm4_require([_LT_PROG_LTMAIN])dnl
101ff559fabSmrg
1026fc0178dSmrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
103ff559fabSmrg
1046fc0178dSmrgdnl Parse OPTIONS
1056fc0178dSmrg_LT_SET_OPTIONS([$0], [$1])
106ff559fabSmrg
1076fc0178dSmrg# This can be used to rebuild libtool when needed
1086fc0178dSmrgLIBTOOL_DEPS=$ltmain
109ff559fabSmrg
1106fc0178dSmrg# Always use our own libtool.
1116fc0178dSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
1126fc0178dSmrgAC_SUBST(LIBTOOL)dnl
113ff559fabSmrg
1146fc0178dSmrg_LT_SETUP
1157a3b38f7Smrg
1166fc0178dSmrg# Only expand once:
1176fc0178dSmrgm4_define([LT_INIT])
1186fc0178dSmrg])# LT_INIT
1197a3b38f7Smrg
1206fc0178dSmrg# Old names:
1216fc0178dSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1226fc0178dSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1236fc0178dSmrgdnl aclocal-1.4 backwards compatibility:
1246fc0178dSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1256fc0178dSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
126ff559fabSmrg
127ff559fabSmrg
1286fc0178dSmrg# _LT_PREPARE_CC_BASENAME
1296fc0178dSmrg# -----------------------
1306fc0178dSmrgm4_defun([_LT_PREPARE_CC_BASENAME], [
1316fc0178dSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1326fc0178dSmrgfunc_cc_basename ()
1336fc0178dSmrg{
1346fc0178dSmrg    for cc_temp in @S|@*""; do
1356fc0178dSmrg      case $cc_temp in
1366fc0178dSmrg        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1376fc0178dSmrg        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1386fc0178dSmrg        \-*) ;;
1396fc0178dSmrg        *) break;;
1406fc0178dSmrg      esac
14144dda7b2Smrg    done
1426fc0178dSmrg    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
1436fc0178dSmrg}
1446fc0178dSmrg])# _LT_PREPARE_CC_BASENAME
145ff559fabSmrg
1467a3b38f7Smrg
1476fc0178dSmrg# _LT_CC_BASENAME(CC)
1486fc0178dSmrg# -------------------
1496fc0178dSmrg# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
1506fc0178dSmrg# but that macro is also expanded into generated libtool script, which
1516fc0178dSmrg# arranges for $SED and $ECHO to be set by different means.
1526fc0178dSmrgm4_defun([_LT_CC_BASENAME],
1536fc0178dSmrg[m4_require([_LT_PREPARE_CC_BASENAME])dnl
1546fc0178dSmrgAC_REQUIRE([_LT_DECL_SED])dnl
1556fc0178dSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1566fc0178dSmrgfunc_cc_basename $1
1576fc0178dSmrgcc_basename=$func_cc_basename_result
15844dda7b2Smrg])
159ff559fabSmrg
160ff559fabSmrg
1616fc0178dSmrg# _LT_FILEUTILS_DEFAULTS
1626fc0178dSmrg# ----------------------
1636fc0178dSmrg# It is okay to use these file commands and assume they have been set
1646fc0178dSmrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
1656fc0178dSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
1666fc0178dSmrg[: ${CP="cp -f"}
1676fc0178dSmrg: ${MV="mv -f"}
1686fc0178dSmrg: ${RM="rm -f"}
1696fc0178dSmrg])# _LT_FILEUTILS_DEFAULTS
170ff559fabSmrg
1717a3b38f7Smrg
1726fc0178dSmrg# _LT_SETUP
1736fc0178dSmrg# ---------
1746fc0178dSmrgm4_defun([_LT_SETUP],
1756fc0178dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1766fc0178dSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
1776fc0178dSmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1786fc0178dSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1796fc0178dSmrg
1806fc0178dSmrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
1816fc0178dSmrgdnl
1826fc0178dSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
1836fc0178dSmrg_LT_DECL([], [host], [0])dnl
1846fc0178dSmrg_LT_DECL([], [host_os], [0])dnl
1856fc0178dSmrgdnl
1866fc0178dSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
1876fc0178dSmrg_LT_DECL([], [build], [0])dnl
1886fc0178dSmrg_LT_DECL([], [build_os], [0])dnl
1896fc0178dSmrgdnl
1906fc0178dSmrgAC_REQUIRE([AC_PROG_CC])dnl
1916fc0178dSmrgAC_REQUIRE([LT_PATH_LD])dnl
1926fc0178dSmrgAC_REQUIRE([LT_PATH_NM])dnl
1936fc0178dSmrgdnl
1946fc0178dSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
1956fc0178dSmrgtest -z "$LN_S" && LN_S="ln -s"
1966fc0178dSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1976fc0178dSmrgdnl
1986fc0178dSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
1996fc0178dSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
2006fc0178dSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
2016fc0178dSmrgdnl
2026fc0178dSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2036fc0178dSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2046fc0178dSmrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
2056fc0178dSmrgm4_require([_LT_CMD_RELOAD])dnl
2066fc0178dSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
2076fc0178dSmrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
2086fc0178dSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
2096fc0178dSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
2106fc0178dSmrgm4_require([_LT_WITH_SYSROOT])dnl
2116fc0178dSmrgm4_require([_LT_CMD_TRUNCATE])dnl
2126fc0178dSmrg
2136fc0178dSmrg_LT_CONFIG_LIBTOOL_INIT([
2146fc0178dSmrg# See if we are running on zsh, and set the options that allow our
2156fc0178dSmrg# commands through without removal of \ escapes INIT.
2166fc0178dSmrgif test -n "\${ZSH_VERSION+set}"; then
2176fc0178dSmrg   setopt NO_GLOB_SUBST
21844dda7b2Smrgfi
21944dda7b2Smrg])
2206fc0178dSmrgif test -n "${ZSH_VERSION+set}"; then
2216fc0178dSmrg   setopt NO_GLOB_SUBST
2226fc0178dSmrgfi
2237a3b38f7Smrg
2246fc0178dSmrg_LT_CHECK_OBJDIR
2257a3b38f7Smrg
2266fc0178dSmrgm4_require([_LT_TAG_COMPILER])dnl
2277a3b38f7Smrg
2286fc0178dSmrgcase $host_os in
2296fc0178dSmrgaix3*)
2306fc0178dSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
2316fc0178dSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
2326fc0178dSmrg  # vanish in a puff of smoke.
2336fc0178dSmrg  if test set != "${COLLECT_NAMES+set}"; then
2346fc0178dSmrg    COLLECT_NAMES=
2356fc0178dSmrg    export COLLECT_NAMES
2366fc0178dSmrg  fi
2376fc0178dSmrg  ;;
2386fc0178dSmrgesac
2397a3b38f7Smrg
2406fc0178dSmrg# Global variables:
2416fc0178dSmrgofile=libtool
2426fc0178dSmrgcan_build_shared=yes
2437a3b38f7Smrg
2446fc0178dSmrg# All known linkers require a '.a' archive for static linking (except MSVC,
2456fc0178dSmrg# which needs '.lib').
2466fc0178dSmrglibext=a
2477a3b38f7Smrg
2486fc0178dSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
2497a3b38f7Smrg
2506fc0178dSmrgold_CC=$CC
2516fc0178dSmrgold_CFLAGS=$CFLAGS
2527a3b38f7Smrg
2536fc0178dSmrg# Set sane defaults for various variables
2546fc0178dSmrgtest -z "$CC" && CC=cc
2556fc0178dSmrgtest -z "$LTCC" && LTCC=$CC
2566fc0178dSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
2576fc0178dSmrgtest -z "$LD" && LD=ld
2586fc0178dSmrgtest -z "$ac_objext" && ac_objext=o
2597a3b38f7Smrg
2606fc0178dSmrg_LT_CC_BASENAME([$compiler])
261fc544a13Smrg
2626fc0178dSmrg# Only perform the check for file, if the check method requires it
2636fc0178dSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
2646fc0178dSmrgcase $deplibs_check_method in
2656fc0178dSmrgfile_magic*)
2666fc0178dSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
2676fc0178dSmrg    _LT_PATH_MAGIC
26844dda7b2Smrg  fi
2696fc0178dSmrg  ;;
2706fc0178dSmrgesac
271ff559fabSmrg
2726fc0178dSmrg# Use C for the default configuration in the libtool script
2736fc0178dSmrgLT_SUPPORTED_TAG([CC])
2746fc0178dSmrg_LT_LANG_C_CONFIG
2756fc0178dSmrg_LT_LANG_DEFAULT_CONFIG
2766fc0178dSmrg_LT_CONFIG_COMMANDS
2776fc0178dSmrg])# _LT_SETUP
278ff559fabSmrg
279ff559fabSmrg
2806fc0178dSmrg# _LT_PREPARE_SED_QUOTE_VARS
2816fc0178dSmrg# --------------------------
2826fc0178dSmrg# Define a few sed substitution that help us do robust quoting.
2836fc0178dSmrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
2846fc0178dSmrg[# Backslashify metacharacters that are still active within
2856fc0178dSmrg# double-quoted strings.
2866fc0178dSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
287ff559fabSmrg
2886fc0178dSmrg# Same as above, but do not quote variable references.
2896fc0178dSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
290fc544a13Smrg
2916fc0178dSmrg# Sed substitution to delay expansion of an escaped shell variable in a
2926fc0178dSmrg# double_quote_subst'ed string.
2936fc0178dSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
294fc544a13Smrg
2956fc0178dSmrg# Sed substitution to delay expansion of an escaped single quote.
2966fc0178dSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
297fc544a13Smrg
2986fc0178dSmrg# Sed substitution to avoid accidental globbing in evaled expressions
2996fc0178dSmrgno_glob_subst='s/\*/\\\*/g'
3006fc0178dSmrg])
301fc544a13Smrg
3026fc0178dSmrg# _LT_PROG_LTMAIN
3036fc0178dSmrg# ---------------
3046fc0178dSmrg# Note that this code is called both from 'configure', and 'config.status'
3056fc0178dSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
3066fc0178dSmrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
3076fc0178dSmrg# so we pass a copy along to make sure it has a sensible value anyway.
3086fc0178dSmrgm4_defun([_LT_PROG_LTMAIN],
3096fc0178dSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
3106fc0178dSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
3116fc0178dSmrgltmain=$ac_aux_dir/ltmain.sh
3126fc0178dSmrg])# _LT_PROG_LTMAIN
313fc544a13Smrg
314fc544a13Smrg
315fc544a13Smrg
3166fc0178dSmrg# So that we can recreate a full libtool script including additional
3176fc0178dSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
3186fc0178dSmrg# in macros and then make a single call at the end using the 'libtool'
3196fc0178dSmrg# label.
320ff559fabSmrg
321ff559fabSmrg
3226fc0178dSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
3236fc0178dSmrg# ----------------------------------------
3246fc0178dSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3256fc0178dSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
3266fc0178dSmrg[m4_ifval([$1],
3276fc0178dSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
3286fc0178dSmrg                     [$1
3296fc0178dSmrg])])])
330ff559fabSmrg
3316fc0178dSmrg# Initialize.
3326fc0178dSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
333ff559fabSmrg
334ff559fabSmrg
3356fc0178dSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
3366fc0178dSmrg# ------------------------------
3376fc0178dSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3386fc0178dSmrgm4_define([_LT_CONFIG_LIBTOOL],
3396fc0178dSmrg[m4_ifval([$1],
3406fc0178dSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
3416fc0178dSmrg                     [$1
3426fc0178dSmrg])])])
343ff559fabSmrg
3446fc0178dSmrg# Initialize.
3456fc0178dSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
346ff559fabSmrg
3477a3b38f7Smrg
3486fc0178dSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
3496fc0178dSmrg# -----------------------------------------------------
3506fc0178dSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
3516fc0178dSmrg[_LT_CONFIG_LIBTOOL([$1])
3526fc0178dSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
3536fc0178dSmrg])
35444dda7b2Smrg
355ff559fabSmrg
3566fc0178dSmrg# _LT_FORMAT_COMMENT([COMMENT])
3576fc0178dSmrg# -----------------------------
3586fc0178dSmrg# Add leading comment marks to the start of each line, and a trailing
3596fc0178dSmrg# full-stop to the whole comment if one is not present already.
3606fc0178dSmrgm4_define([_LT_FORMAT_COMMENT],
3616fc0178dSmrg[m4_ifval([$1], [
3626fc0178dSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
3636fc0178dSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
3646fc0178dSmrg)])
3657a3b38f7Smrg
3667a3b38f7Smrg
3677a3b38f7Smrg
3687a3b38f7Smrg
3696fc0178dSmrg
3706fc0178dSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
3716fc0178dSmrg# -------------------------------------------------------------------
3726fc0178dSmrg# CONFIGNAME is the name given to the value in the libtool script.
3736fc0178dSmrg# VARNAME is the (base) name used in the configure script.
3746fc0178dSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
3756fc0178dSmrg# VARNAME.  Any other value will be used directly.
3766fc0178dSmrgm4_define([_LT_DECL],
3776fc0178dSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
3786fc0178dSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
3796fc0178dSmrg	[m4_ifval([$1], [$1], [$2])])
3806fc0178dSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
3816fc0178dSmrg    m4_ifval([$4],
3826fc0178dSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
3836fc0178dSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
3846fc0178dSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
38544dda7b2Smrg])
386ff559fabSmrg
387ff559fabSmrg
3886fc0178dSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
3896fc0178dSmrg# --------------------------------------------------------
3906fc0178dSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
3917a3b38f7Smrg
392ff559fabSmrg
3936fc0178dSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
3946fc0178dSmrg# ------------------------------------------------
3956fc0178dSmrgm4_define([lt_decl_tag_varnames],
3966fc0178dSmrg[_lt_decl_filter([tagged?], [yes], $@)])
397ff559fabSmrg
398ff559fabSmrg
3996fc0178dSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
4006fc0178dSmrg# ---------------------------------------------------------
4016fc0178dSmrgm4_define([_lt_decl_filter],
4026fc0178dSmrg[m4_case([$#],
4036fc0178dSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
4046fc0178dSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
4056fc0178dSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
4066fc0178dSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
4076fc0178dSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
4086fc0178dSmrg])
409ff559fabSmrg
410fc544a13Smrg
4116fc0178dSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
4126fc0178dSmrg# --------------------------------------------------
4136fc0178dSmrgm4_define([lt_decl_quote_varnames],
4146fc0178dSmrg[_lt_decl_filter([value], [1], $@)])
415ff559fabSmrg
416fc544a13Smrg
4176fc0178dSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
4186fc0178dSmrg# ---------------------------------------------------
4196fc0178dSmrgm4_define([lt_decl_dquote_varnames],
4206fc0178dSmrg[_lt_decl_filter([value], [2], $@)])
421ff559fabSmrg
422fc544a13Smrg
4236fc0178dSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
4246fc0178dSmrg# ---------------------------------------------------
4256fc0178dSmrgm4_define([lt_decl_varnames_tagged],
4266fc0178dSmrg[m4_assert([$# <= 2])dnl
4276fc0178dSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
4286fc0178dSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
4296fc0178dSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
4306fc0178dSmrgm4_define([_lt_decl_varnames_tagged],
4316fc0178dSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
432fc544a13Smrg
433ff559fabSmrg
4346fc0178dSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
4356fc0178dSmrg# ------------------------------------------------
4366fc0178dSmrgm4_define([lt_decl_all_varnames],
4376fc0178dSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
4386fc0178dSmrg     m4_if([$2], [],
4396fc0178dSmrg	   m4_quote(lt_decl_varnames),
4406fc0178dSmrg	m4_quote(m4_shift($@))))[]dnl
4416fc0178dSmrg])
4426fc0178dSmrgm4_define([_lt_decl_all_varnames],
4436fc0178dSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
4446fc0178dSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
4456fc0178dSmrg])
4467a3b38f7Smrg
447fc544a13Smrg
4486fc0178dSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
4496fc0178dSmrg# ------------------------------------
4506fc0178dSmrg# Quote a variable value, and forward it to 'config.status' so that its
4516fc0178dSmrg# declaration there will have the same value as in 'configure'.  VARNAME
4526fc0178dSmrg# must have a single quote delimited value for this to work.
4536fc0178dSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
4546fc0178dSmrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
4557a3b38f7Smrg
4566fc0178dSmrg
4576fc0178dSmrg# _LT_CONFIG_STATUS_DECLARATIONS
4586fc0178dSmrg# ------------------------------
4596fc0178dSmrg# We delimit libtool config variables with single quotes, so when
4606fc0178dSmrg# we write them to config.status, we have to be sure to quote all
4616fc0178dSmrg# embedded single quotes properly.  In configure, this macro expands
4626fc0178dSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
46344dda7b2Smrg#
4646fc0178dSmrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
4656fc0178dSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
4666fc0178dSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
4676fc0178dSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
468ff559fabSmrg
4696fc0178dSmrg
4706fc0178dSmrg# _LT_LIBTOOL_TAGS
4716fc0178dSmrg# ----------------
4726fc0178dSmrg# Output comment and list of tags supported by the script
4736fc0178dSmrgm4_defun([_LT_LIBTOOL_TAGS],
4746fc0178dSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
4756fc0178dSmrgavailable_tags='_LT_TAGS'dnl
47644dda7b2Smrg])
4777a3b38f7Smrg
4786fc0178dSmrg
4796fc0178dSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
4806fc0178dSmrg# -----------------------------------
4816fc0178dSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
4826fc0178dSmrg# expand to a commented shell variable setting:
483ff559fabSmrg#
4846fc0178dSmrg#    # Some comment about what VAR is for.
4856fc0178dSmrg#    visible_name=$lt_internal_name
4866fc0178dSmrgm4_define([_LT_LIBTOOL_DECLARE],
4876fc0178dSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
4886fc0178dSmrg					   [description])))[]dnl
4896fc0178dSmrgm4_pushdef([_libtool_name],
4906fc0178dSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
4916fc0178dSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
4926fc0178dSmrg    [0], [_libtool_name=[$]$1],
4936fc0178dSmrg    [1], [_libtool_name=$lt_[]$1],
4946fc0178dSmrg    [2], [_libtool_name=$lt_[]$1],
4956fc0178dSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
4966fc0178dSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
4976fc0178dSmrg])
4987a3b38f7Smrg
499ff559fabSmrg
5006fc0178dSmrg# _LT_LIBTOOL_CONFIG_VARS
5016fc0178dSmrg# -----------------------
5026fc0178dSmrg# Produce commented declarations of non-tagged libtool config variables
5036fc0178dSmrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
5046fc0178dSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
5056fc0178dSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
5066fc0178dSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
5076fc0178dSmrg[m4_foreach([_lt_var],
5086fc0178dSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
5096fc0178dSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
510ff559fabSmrg
511ff559fabSmrg
5126fc0178dSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
5136fc0178dSmrg# -------------------------
5146fc0178dSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
5156fc0178dSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
5166fc0178dSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
517ff559fabSmrg
518ff559fabSmrg
5196fc0178dSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
5206fc0178dSmrg# ------------------------------
5216fc0178dSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
522ff559fabSmrg
523ff559fabSmrg
5246fc0178dSmrg# _LT_CONFIG_COMMANDS
5256fc0178dSmrg# -------------------
5266fc0178dSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
5276fc0178dSmrg# variables for single and double quote escaping we saved from calls
5286fc0178dSmrg# to _LT_DECL, we can put quote escaped variables declarations
5296fc0178dSmrg# into 'config.status', and then the shell code to quote escape them in
5306fc0178dSmrg# for loops in 'config.status'.  Finally, any additional code accumulated
5316fc0178dSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
5326fc0178dSmrgm4_defun([_LT_CONFIG_COMMANDS],
5336fc0178dSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
5346fc0178dSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
5356fc0178dSmrg	dnl instead of duplicating it all over again into config.status,
5366fc0178dSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
5376fc0178dSmrg	dnl needs to know what name is stored there:
5386fc0178dSmrg        [AC_CONFIG_COMMANDS([libtool],
5396fc0178dSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
5406fc0178dSmrg    dnl If the libtool generation code is destined for config.status,
5416fc0178dSmrg    dnl expand the accumulated commands and init code now:
5426fc0178dSmrg    [AC_CONFIG_COMMANDS([libtool],
5436fc0178dSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
5446fc0178dSmrg])#_LT_CONFIG_COMMANDS
545fc544a13Smrg
546ff559fabSmrg
5476fc0178dSmrg# Initialize.
5486fc0178dSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
5496fc0178dSmrg[
550ff559fabSmrg
5516fc0178dSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
5526fc0178dSmrg# if CDPATH is set.
5536fc0178dSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
554ff559fabSmrg
5556fc0178dSmrgsed_quote_subst='$sed_quote_subst'
5566fc0178dSmrgdouble_quote_subst='$double_quote_subst'
5576fc0178dSmrgdelay_variable_subst='$delay_variable_subst'
5586fc0178dSmrg_LT_CONFIG_STATUS_DECLARATIONS
5596fc0178dSmrgLTCC='$LTCC'
5606fc0178dSmrgLTCFLAGS='$LTCFLAGS'
5616fc0178dSmrgcompiler='$compiler_DEFAULT'
562ff559fabSmrg
5636fc0178dSmrg# A function that is used when there is no print builtin or printf.
5646fc0178dSmrgfunc_fallback_echo ()
5656fc0178dSmrg{
5666fc0178dSmrg  eval 'cat <<_LTECHO_EOF
5676fc0178dSmrg\$[]1
5686fc0178dSmrg_LTECHO_EOF'
5696fc0178dSmrg}
57044dda7b2Smrg
5716fc0178dSmrg# Quote evaled strings.
5726fc0178dSmrgfor var in lt_decl_all_varnames([[ \
5736fc0178dSmrg]], lt_decl_quote_varnames); do
5746fc0178dSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
5756fc0178dSmrg    *[[\\\\\\\`\\"\\\$]]*)
5766fc0178dSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
577fc544a13Smrg      ;;
5786fc0178dSmrg    *)
5796fc0178dSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
580fc544a13Smrg      ;;
5816fc0178dSmrg    esac
5826fc0178dSmrgdone
5836fc0178dSmrg
5846fc0178dSmrg# Double-quote double-evaled strings.
5856fc0178dSmrgfor var in lt_decl_all_varnames([[ \
5866fc0178dSmrg]], lt_decl_dquote_varnames); do
5876fc0178dSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
5886fc0178dSmrg    *[[\\\\\\\`\\"\\\$]]*)
5896fc0178dSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
590fc544a13Smrg      ;;
5916fc0178dSmrg    *)
5926fc0178dSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
593fc544a13Smrg      ;;
594fc544a13Smrg    esac
5956fc0178dSmrgdone
596ff559fabSmrg
5976fc0178dSmrg_LT_OUTPUT_LIBTOOL_INIT
5986fc0178dSmrg])
599fc544a13Smrg
6006fc0178dSmrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
6016fc0178dSmrg# ------------------------------------
6026fc0178dSmrg# Generate a child script FILE with all initialization necessary to
6036fc0178dSmrg# reuse the environment learned by the parent script, and make the
6046fc0178dSmrg# file executable.  If COMMENT is supplied, it is inserted after the
6056fc0178dSmrg# '#!' sequence but before initialization text begins.  After this
6066fc0178dSmrg# macro, additional text can be appended to FILE to form the body of
6076fc0178dSmrg# the child script.  The macro ends with non-zero status if the
6086fc0178dSmrg# file could not be fully written (such as if the disk is full).
6096fc0178dSmrgm4_ifdef([AS_INIT_GENERATED],
6106fc0178dSmrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
6116fc0178dSmrg[m4_defun([_LT_GENERATED_FILE_INIT],
6126fc0178dSmrg[m4_require([AS_PREPARE])]dnl
6136fc0178dSmrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
6146fc0178dSmrg[lt_write_fail=0
6156fc0178dSmrgcat >$1 <<_ASEOF || lt_write_fail=1
6166fc0178dSmrg#! $SHELL
6176fc0178dSmrg# Generated by $as_me.
6186fc0178dSmrg$2
6196fc0178dSmrgSHELL=\${CONFIG_SHELL-$SHELL}
6206fc0178dSmrgexport SHELL
6216fc0178dSmrg_ASEOF
6226fc0178dSmrgcat >>$1 <<\_ASEOF || lt_write_fail=1
6236fc0178dSmrgAS_SHELL_SANITIZE
6246fc0178dSmrg_AS_PREPARE
6256fc0178dSmrgexec AS_MESSAGE_FD>&1
6266fc0178dSmrg_ASEOF
6276fc0178dSmrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
6286fc0178dSmrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
629862f5301Smrg
6306fc0178dSmrg# LT_OUTPUT
6316fc0178dSmrg# ---------
6326fc0178dSmrg# This macro allows early generation of the libtool script (before
6336fc0178dSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
6346fc0178dSmrg# tests.
6356fc0178dSmrgAC_DEFUN([LT_OUTPUT],
6366fc0178dSmrg[: ${CONFIG_LT=./config.lt}
6376fc0178dSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
6386fc0178dSmrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
6396fc0178dSmrg[# Run this file to recreate a libtool stub with the current configuration.])
640862f5301Smrg
6416fc0178dSmrgcat >>"$CONFIG_LT" <<\_LTEOF
6426fc0178dSmrglt_cl_silent=false
6436fc0178dSmrgexec AS_MESSAGE_LOG_FD>>config.log
6446fc0178dSmrg{
6456fc0178dSmrg  echo
6466fc0178dSmrg  AS_BOX([Running $as_me.])
6476fc0178dSmrg} >&AS_MESSAGE_LOG_FD
648ff559fabSmrg
6496fc0178dSmrglt_cl_help="\
6506fc0178dSmrg'$as_me' creates a local libtool stub from the current configuration,
6516fc0178dSmrgfor use in further configure time tests before the real libtool is
6526fc0178dSmrggenerated.
653ff559fabSmrg
6546fc0178dSmrgUsage: $[0] [[OPTIONS]]
6557a3b38f7Smrg
6566fc0178dSmrg  -h, --help      print this help, then exit
6576fc0178dSmrg  -V, --version   print version number, then exit
6586fc0178dSmrg  -q, --quiet     do not print progress messages
6596fc0178dSmrg  -d, --debug     don't remove temporary files
660ff559fabSmrg
6616fc0178dSmrgReport bugs to <bug-libtool@gnu.org>."
662ff559fabSmrg
6636fc0178dSmrglt_cl_version="\
6646fc0178dSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
6656fc0178dSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
6666fc0178dSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
667ff559fabSmrg
6686fc0178dSmrgCopyright (C) 2011 Free Software Foundation, Inc.
6696fc0178dSmrgThis config.lt script is free software; the Free Software Foundation
6706fc0178dSmrggives unlimited permision to copy, distribute and modify it."
671ff559fabSmrg
6726fc0178dSmrgwhile test 0 != $[#]
6736fc0178dSmrgdo
6746fc0178dSmrg  case $[1] in
6756fc0178dSmrg    --version | --v* | -V )
6766fc0178dSmrg      echo "$lt_cl_version"; exit 0 ;;
6776fc0178dSmrg    --help | --h* | -h )
6786fc0178dSmrg      echo "$lt_cl_help"; exit 0 ;;
6796fc0178dSmrg    --debug | --d* | -d )
6806fc0178dSmrg      debug=: ;;
6816fc0178dSmrg    --quiet | --q* | --silent | --s* | -q )
6826fc0178dSmrg      lt_cl_silent=: ;;
683ff559fabSmrg
6846fc0178dSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
6856fc0178dSmrgTry '$[0] --help' for more information.]) ;;
686ff559fabSmrg
6876fc0178dSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
6886fc0178dSmrgTry '$[0] --help' for more information.]) ;;
6896fc0178dSmrg  esac
6906fc0178dSmrg  shift
6916fc0178dSmrgdone
692ff559fabSmrg
6936fc0178dSmrgif $lt_cl_silent; then
6946fc0178dSmrg  exec AS_MESSAGE_FD>/dev/null
6956fc0178dSmrgfi
6966fc0178dSmrg_LTEOF
697ff559fabSmrg
6986fc0178dSmrgcat >>"$CONFIG_LT" <<_LTEOF
6996fc0178dSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
7006fc0178dSmrg_LTEOF
701ff559fabSmrg
7026fc0178dSmrgcat >>"$CONFIG_LT" <<\_LTEOF
7036fc0178dSmrgAC_MSG_NOTICE([creating $ofile])
7046fc0178dSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
7056fc0178dSmrgAS_EXIT(0)
7066fc0178dSmrg_LTEOF
7076fc0178dSmrgchmod +x "$CONFIG_LT"
708ff559fabSmrg
7096fc0178dSmrg# configure is writing to config.log, but config.lt does its own redirection,
7106fc0178dSmrg# appending to config.log, which fails on DOS, as config.log is still kept
7116fc0178dSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
7126fc0178dSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
7136fc0178dSmrglt_cl_success=:
7146fc0178dSmrgtest yes = "$silent" &&
7156fc0178dSmrg  lt_config_lt_args="$lt_config_lt_args --quiet"
7166fc0178dSmrgexec AS_MESSAGE_LOG_FD>/dev/null
7176fc0178dSmrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
7186fc0178dSmrgexec AS_MESSAGE_LOG_FD>>config.log
7196fc0178dSmrg$lt_cl_success || AS_EXIT(1)
7206fc0178dSmrg])# LT_OUTPUT
721ff559fabSmrg
722ff559fabSmrg
7236fc0178dSmrg# _LT_CONFIG(TAG)
7246fc0178dSmrg# ---------------
7256fc0178dSmrg# If TAG is the built-in tag, create an initial libtool script with a
7266fc0178dSmrg# default configuration from the untagged config vars.  Otherwise add code
7276fc0178dSmrg# to config.status for appending the configuration named by TAG from the
7286fc0178dSmrg# matching tagged config vars.
7296fc0178dSmrgm4_defun([_LT_CONFIG],
7306fc0178dSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7316fc0178dSmrg_LT_CONFIG_SAVE_COMMANDS([
7326fc0178dSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
7336fc0178dSmrg  m4_if(_LT_TAG, [C], [
7346fc0178dSmrg    # See if we are running on zsh, and set the options that allow our
7356fc0178dSmrg    # commands through without removal of \ escapes.
7366fc0178dSmrg    if test -n "${ZSH_VERSION+set}"; then
7376fc0178dSmrg      setopt NO_GLOB_SUBST
7386fc0178dSmrg    fi
739ff559fabSmrg
7406fc0178dSmrg    cfgfile=${ofile}T
7416fc0178dSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
7426fc0178dSmrg    $RM "$cfgfile"
743ff559fabSmrg
7446fc0178dSmrg    cat <<_LT_EOF >> "$cfgfile"
7456fc0178dSmrg#! $SHELL
7466fc0178dSmrg# Generated automatically by $as_me ($PACKAGE) $VERSION
7476fc0178dSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7486fc0178dSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
749ff559fabSmrg
7506fc0178dSmrg# Provide generalized library-building support services.
7516fc0178dSmrg# Written by Gordon Matzigkeit, 1996
752ff559fabSmrg
7536fc0178dSmrg_LT_COPYING
7546fc0178dSmrg_LT_LIBTOOL_TAGS
75544dda7b2Smrg
7566fc0178dSmrg# Configured defaults for sys_lib_dlsearch_path munging.
7576fc0178dSmrg: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
758862f5301Smrg
7596fc0178dSmrg# ### BEGIN LIBTOOL CONFIG
7606fc0178dSmrg_LT_LIBTOOL_CONFIG_VARS
7616fc0178dSmrg_LT_LIBTOOL_TAG_VARS
7626fc0178dSmrg# ### END LIBTOOL CONFIG
763ff559fabSmrg
7646fc0178dSmrg_LT_EOF
765ff559fabSmrg
7666fc0178dSmrg    cat <<'_LT_EOF' >> "$cfgfile"
76744dda7b2Smrg
7686fc0178dSmrg# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
76944dda7b2Smrg
7706fc0178dSmrg_LT_PREPARE_MUNGE_PATH_LIST
7716fc0178dSmrg_LT_PREPARE_CC_BASENAME
772ff559fabSmrg
7736fc0178dSmrg# ### END FUNCTIONS SHARED WITH CONFIGURE
77444dda7b2Smrg
7756fc0178dSmrg_LT_EOF
776ff559fabSmrg
7776fc0178dSmrg  case $host_os in
7786fc0178dSmrg  aix3*)
7796fc0178dSmrg    cat <<\_LT_EOF >> "$cfgfile"
7806fc0178dSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
7816fc0178dSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
7826fc0178dSmrg# vanish in a puff of smoke.
7836fc0178dSmrgif test set != "${COLLECT_NAMES+set}"; then
7846fc0178dSmrg  COLLECT_NAMES=
7856fc0178dSmrg  export COLLECT_NAMES
7866fc0178dSmrgfi
7876fc0178dSmrg_LT_EOF
7886fc0178dSmrg    ;;
7896fc0178dSmrg  esac
79044dda7b2Smrg
7916fc0178dSmrg  _LT_PROG_LTMAIN
792ff559fabSmrg
7936fc0178dSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
7946fc0178dSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
7956fc0178dSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
7966fc0178dSmrg  # is reportedly fixed, but why not run on old versions too?
7976fc0178dSmrg  sed '$q' "$ltmain" >> "$cfgfile" \
7986fc0178dSmrg     || (rm -f "$cfgfile"; exit 1)
799ff559fabSmrg
8006fc0178dSmrg   mv -f "$cfgfile" "$ofile" ||
8016fc0178dSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
8026fc0178dSmrg  chmod +x "$ofile"
8036fc0178dSmrg],
8046fc0178dSmrg[cat <<_LT_EOF >> "$ofile"
805ff559fabSmrg
8066fc0178dSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
8076fc0178dSmrgdnl in a comment (ie after a #).
8086fc0178dSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
8096fc0178dSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
8106fc0178dSmrg# ### END LIBTOOL TAG CONFIG: $1
8116fc0178dSmrg_LT_EOF
8126fc0178dSmrg])dnl /m4_if
8136fc0178dSmrg],
8146fc0178dSmrg[m4_if([$1], [], [
8156fc0178dSmrg    PACKAGE='$PACKAGE'
8166fc0178dSmrg    VERSION='$VERSION'
8176fc0178dSmrg    RM='$RM'
8186fc0178dSmrg    ofile='$ofile'], [])
8196fc0178dSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
8206fc0178dSmrg])# _LT_CONFIG
821ff559fabSmrg
82244dda7b2Smrg
8236fc0178dSmrg# LT_SUPPORTED_TAG(TAG)
8246fc0178dSmrg# ---------------------
8256fc0178dSmrg# Trace this macro to discover what tags are supported by the libtool
8266fc0178dSmrg# --tag option, using:
8276fc0178dSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
8286fc0178dSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
829ff559fabSmrg
83044dda7b2Smrg
8316fc0178dSmrg# C support is built-in for now
8326fc0178dSmrgm4_define([_LT_LANG_C_enabled], [])
8336fc0178dSmrgm4_define([_LT_TAGS], [])
834ff559fabSmrg
83544dda7b2Smrg
8366fc0178dSmrg# LT_LANG(LANG)
8376fc0178dSmrg# -------------
8386fc0178dSmrg# Enable libtool support for the given language if not already enabled.
8396fc0178dSmrgAC_DEFUN([LT_LANG],
8406fc0178dSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
8416fc0178dSmrgm4_case([$1],
8426fc0178dSmrg  [C],			[_LT_LANG(C)],
8436fc0178dSmrg  [C++],		[_LT_LANG(CXX)],
8446fc0178dSmrg  [Go],			[_LT_LANG(GO)],
8456fc0178dSmrg  [Java],		[_LT_LANG(GCJ)],
8466fc0178dSmrg  [Fortran 77],		[_LT_LANG(F77)],
8476fc0178dSmrg  [Fortran],		[_LT_LANG(FC)],
8486fc0178dSmrg  [Windows Resource],	[_LT_LANG(RC)],
8496fc0178dSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
8506fc0178dSmrg    [_LT_LANG($1)],
8516fc0178dSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
8526fc0178dSmrg])# LT_LANG
85344dda7b2Smrg
854ff559fabSmrg
8556fc0178dSmrg# _LT_LANG(LANGNAME)
8566fc0178dSmrg# ------------------
8576fc0178dSmrgm4_defun([_LT_LANG],
8586fc0178dSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
8596fc0178dSmrg  [LT_SUPPORTED_TAG([$1])dnl
8606fc0178dSmrg  m4_append([_LT_TAGS], [$1 ])dnl
8616fc0178dSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
8626fc0178dSmrg  _LT_LANG_$1_CONFIG($1)])dnl
8636fc0178dSmrg])# _LT_LANG
864ff559fabSmrg
865ff559fabSmrg
8666fc0178dSmrgm4_ifndef([AC_PROG_GO], [
8676fc0178dSmrg# NOTE: This macro has been submitted for inclusion into   #
8686fc0178dSmrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
8696fc0178dSmrg#  a released version of Autoconf we should remove this    #
8706fc0178dSmrg#  macro and use it instead.                               #
8716fc0178dSmrgm4_defun([AC_PROG_GO],
8726fc0178dSmrg[AC_LANG_PUSH(Go)dnl
8736fc0178dSmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
8746fc0178dSmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
8756fc0178dSmrg_AC_ARG_VAR_LDFLAGS()dnl
8766fc0178dSmrgAC_CHECK_TOOL(GOC, gccgo)
8776fc0178dSmrgif test -z "$GOC"; then
8786fc0178dSmrg  if test -n "$ac_tool_prefix"; then
8796fc0178dSmrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
8806fc0178dSmrg  fi
8816fc0178dSmrgfi
8826fc0178dSmrgif test -z "$GOC"; then
8836fc0178dSmrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
8846fc0178dSmrgfi
8856fc0178dSmrg])#m4_defun
8866fc0178dSmrg])#m4_ifndef
887ff559fabSmrg
888ff559fabSmrg
8896fc0178dSmrg# _LT_LANG_DEFAULT_CONFIG
8906fc0178dSmrg# -----------------------
8916fc0178dSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
8926fc0178dSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
8936fc0178dSmrg  [LT_LANG(CXX)],
8946fc0178dSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
895ff559fabSmrg
8966fc0178dSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
8976fc0178dSmrg  [LT_LANG(F77)],
8986fc0178dSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
899ff559fabSmrg
9006fc0178dSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
9016fc0178dSmrg  [LT_LANG(FC)],
9026fc0178dSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
903ff559fabSmrg
9046fc0178dSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
9056fc0178dSmrgdnl pulling things in needlessly.
9066fc0178dSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
9076fc0178dSmrg  [LT_LANG(GCJ)],
9086fc0178dSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
9096fc0178dSmrg    [LT_LANG(GCJ)],
9106fc0178dSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
9116fc0178dSmrg      [LT_LANG(GCJ)],
9126fc0178dSmrg      [m4_ifdef([AC_PROG_GCJ],
9136fc0178dSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
9146fc0178dSmrg       m4_ifdef([A][M_PROG_GCJ],
9156fc0178dSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
9166fc0178dSmrg       m4_ifdef([LT_PROG_GCJ],
9176fc0178dSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
918ff559fabSmrg
9196fc0178dSmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
9206fc0178dSmrg  [LT_LANG(GO)],
9216fc0178dSmrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
922ff559fabSmrg
9236fc0178dSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
9246fc0178dSmrg  [LT_LANG(RC)],
9256fc0178dSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
9266fc0178dSmrg])# _LT_LANG_DEFAULT_CONFIG
927ff559fabSmrg
9286fc0178dSmrg# Obsolete macros:
9296fc0178dSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
9306fc0178dSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
9316fc0178dSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
9326fc0178dSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
9336fc0178dSmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
9346fc0178dSmrgdnl aclocal-1.4 backwards compatibility:
9356fc0178dSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
9366fc0178dSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
9376fc0178dSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
9386fc0178dSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
9396fc0178dSmrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
940ff559fabSmrg
941ff559fabSmrg
9426fc0178dSmrg# _LT_TAG_COMPILER
9436fc0178dSmrg# ----------------
9446fc0178dSmrgm4_defun([_LT_TAG_COMPILER],
9456fc0178dSmrg[AC_REQUIRE([AC_PROG_CC])dnl
946ff559fabSmrg
9476fc0178dSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
9486fc0178dSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
9496fc0178dSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
9506fc0178dSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
951ff559fabSmrg
9526fc0178dSmrg# If no C compiler was specified, use CC.
9536fc0178dSmrgLTCC=${LTCC-"$CC"}
954ff559fabSmrg
9556fc0178dSmrg# If no C compiler flags were specified, use CFLAGS.
9566fc0178dSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
957ff559fabSmrg
9586fc0178dSmrg# Allow CC to be a program name with arguments.
9596fc0178dSmrgcompiler=$CC
9606fc0178dSmrg])# _LT_TAG_COMPILER
961ff559fabSmrg
962ff559fabSmrg
9636fc0178dSmrg# _LT_COMPILER_BOILERPLATE
9646fc0178dSmrg# ------------------------
9656fc0178dSmrg# Check for compiler boilerplate output or warnings with
9666fc0178dSmrg# the simple compiler test code.
9676fc0178dSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
9686fc0178dSmrg[m4_require([_LT_DECL_SED])dnl
9696fc0178dSmrgac_outfile=conftest.$ac_objext
9706fc0178dSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
9716fc0178dSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
9726fc0178dSmrg_lt_compiler_boilerplate=`cat conftest.err`
9736fc0178dSmrg$RM conftest*
9746fc0178dSmrg])# _LT_COMPILER_BOILERPLATE
975ff559fabSmrg
976ff559fabSmrg
9776fc0178dSmrg# _LT_LINKER_BOILERPLATE
9786fc0178dSmrg# ----------------------
9796fc0178dSmrg# Check for linker boilerplate output or warnings with
9806fc0178dSmrg# the simple link test code.
9816fc0178dSmrgm4_defun([_LT_LINKER_BOILERPLATE],
9826fc0178dSmrg[m4_require([_LT_DECL_SED])dnl
9836fc0178dSmrgac_outfile=conftest.$ac_objext
9846fc0178dSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
9856fc0178dSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
9866fc0178dSmrg_lt_linker_boilerplate=`cat conftest.err`
9876fc0178dSmrg$RM -r conftest*
9886fc0178dSmrg])# _LT_LINKER_BOILERPLATE
989ff559fabSmrg
9906fc0178dSmrg# _LT_REQUIRED_DARWIN_CHECKS
9916fc0178dSmrg# -------------------------
9926fc0178dSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
9936fc0178dSmrg  case $host_os in
9946fc0178dSmrg    rhapsody* | darwin*)
9956fc0178dSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
9966fc0178dSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
9976fc0178dSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
9986fc0178dSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
9996fc0178dSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
10006fc0178dSmrg    _LT_DECL([], [DSYMUTIL], [1],
10016fc0178dSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
10026fc0178dSmrg    _LT_DECL([], [NMEDIT], [1],
10036fc0178dSmrg      [Tool to change global to local symbols on Mac OS X])
10046fc0178dSmrg    _LT_DECL([], [LIPO], [1],
10056fc0178dSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
10066fc0178dSmrg    _LT_DECL([], [OTOOL], [1],
10076fc0178dSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
10086fc0178dSmrg    _LT_DECL([], [OTOOL64], [1],
10096fc0178dSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
1010862f5301Smrg
10116fc0178dSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
10126fc0178dSmrg      [lt_cv_apple_cc_single_mod=no
10136fc0178dSmrg      if test -z "$LT_MULTI_MODULE"; then
10146fc0178dSmrg	# By default we will add the -single_module flag. You can override
10156fc0178dSmrg	# by either setting the environment variable LT_MULTI_MODULE
10166fc0178dSmrg	# non-empty at configure time, or by adding -multi_module to the
10176fc0178dSmrg	# link flags.
10186fc0178dSmrg	rm -rf libconftest.dylib*
10196fc0178dSmrg	echo "int foo(void){return 1;}" > conftest.c
10206fc0178dSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
10216fc0178dSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
10226fc0178dSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
10236fc0178dSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
10246fc0178dSmrg        _lt_result=$?
10256fc0178dSmrg	# If there is a non-empty error log, and "single_module"
10266fc0178dSmrg	# appears in it, assume the flag caused a linker warning
10276fc0178dSmrg        if test -s conftest.err && $GREP single_module conftest.err; then
10286fc0178dSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
10296fc0178dSmrg	# Otherwise, if the output was created with a 0 exit code from
10306fc0178dSmrg	# the compiler, it worked.
10316fc0178dSmrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
10326fc0178dSmrg	  lt_cv_apple_cc_single_mod=yes
10336fc0178dSmrg	else
10346fc0178dSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
10356fc0178dSmrg	fi
10366fc0178dSmrg	rm -rf libconftest.dylib*
10376fc0178dSmrg	rm -f conftest.*
10386fc0178dSmrg      fi])
1039862f5301Smrg
10406fc0178dSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
10416fc0178dSmrg      [lt_cv_ld_exported_symbols_list],
10426fc0178dSmrg      [lt_cv_ld_exported_symbols_list=no
10436fc0178dSmrg      save_LDFLAGS=$LDFLAGS
10446fc0178dSmrg      echo "_main" > conftest.sym
10456fc0178dSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
10466fc0178dSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
10476fc0178dSmrg	[lt_cv_ld_exported_symbols_list=yes],
10486fc0178dSmrg	[lt_cv_ld_exported_symbols_list=no])
10496fc0178dSmrg	LDFLAGS=$save_LDFLAGS
10506fc0178dSmrg    ])
10516fc0178dSmrg
10526fc0178dSmrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
10536fc0178dSmrg      [lt_cv_ld_force_load=no
10546fc0178dSmrg      cat > conftest.c << _LT_EOF
10556fc0178dSmrgint forced_loaded() { return 2;}
10566fc0178dSmrg_LT_EOF
10576fc0178dSmrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
10586fc0178dSmrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
10596fc0178dSmrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
10606fc0178dSmrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
10616fc0178dSmrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
10626fc0178dSmrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
10636fc0178dSmrg      cat > conftest.c << _LT_EOF
10646fc0178dSmrgint main() { return 0;}
10656fc0178dSmrg_LT_EOF
10666fc0178dSmrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
10676fc0178dSmrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
10686fc0178dSmrg      _lt_result=$?
10696fc0178dSmrg      if test -s conftest.err && $GREP force_load conftest.err; then
10706fc0178dSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
10716fc0178dSmrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
10726fc0178dSmrg	lt_cv_ld_force_load=yes
10736fc0178dSmrg      else
10746fc0178dSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
10756fc0178dSmrg      fi
10766fc0178dSmrg        rm -f conftest.err libconftest.a conftest conftest.c
10776fc0178dSmrg        rm -rf conftest.dSYM
10786fc0178dSmrg    ])
10796fc0178dSmrg    case $host_os in
10806fc0178dSmrg    rhapsody* | darwin1.[[012]])
10816fc0178dSmrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
10826fc0178dSmrg    darwin1.*)
10836fc0178dSmrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
10846fc0178dSmrg    darwin*) # darwin 5.x on
10856fc0178dSmrg      # if running on 10.5 or later, the deployment target defaults
10866fc0178dSmrg      # to the OS version, if on x86, and 10.4, the deployment
10876fc0178dSmrg      # target defaults to 10.4. Don't you love it?
10886fc0178dSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10896fc0178dSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
10906fc0178dSmrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10916fc0178dSmrg	10.[[012]][[,.]]*)
10926fc0178dSmrg	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
10936fc0178dSmrg	10.*)
10946fc0178dSmrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10956fc0178dSmrg      esac
10966fc0178dSmrg    ;;
10976fc0178dSmrg  esac
10986fc0178dSmrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
10996fc0178dSmrg      _lt_dar_single_mod='$single_module'
11006fc0178dSmrg    fi
11016fc0178dSmrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
11026fc0178dSmrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
11036fc0178dSmrg    else
11046fc0178dSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
11056fc0178dSmrg    fi
11066fc0178dSmrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
11076fc0178dSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
11086fc0178dSmrg    else
11096fc0178dSmrg      _lt_dsymutil=
11106fc0178dSmrg    fi
11116fc0178dSmrg    ;;
11126fc0178dSmrg  esac
111344dda7b2Smrg])
1114ff559fabSmrg
1115ff559fabSmrg
11166fc0178dSmrg# _LT_DARWIN_LINKER_FEATURES([TAG])
11176fc0178dSmrg# ---------------------------------
11186fc0178dSmrg# Checks for linker and compiler features on darwin
11196fc0178dSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
11206fc0178dSmrg[
11216fc0178dSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
11226fc0178dSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
11236fc0178dSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
11246fc0178dSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
11256fc0178dSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
11266fc0178dSmrg  if test yes = "$lt_cv_ld_force_load"; then
11276fc0178dSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
11286fc0178dSmrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
11296fc0178dSmrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
11306fc0178dSmrg  else
11316fc0178dSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
11326fc0178dSmrg  fi
11336fc0178dSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
11346fc0178dSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
11356fc0178dSmrg  case $cc_basename in
11366fc0178dSmrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
11376fc0178dSmrg     *) _lt_dar_can_shared=$GCC ;;
11386fc0178dSmrg  esac
11396fc0178dSmrg  if test yes = "$_lt_dar_can_shared"; then
11406fc0178dSmrg    output_verbose_link_cmd=func_echo_all
11416fc0178dSmrg    _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"
11426fc0178dSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
11436fc0178dSmrg    _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"
11446fc0178dSmrg    _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"
11456fc0178dSmrg    m4_if([$1], [CXX],
11466fc0178dSmrg[   if test yes != "$lt_cv_apple_cc_single_mod"; then
11476fc0178dSmrg      _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"
11486fc0178dSmrg      _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"
11496fc0178dSmrg    fi
11506fc0178dSmrg],[])
11516fc0178dSmrg  else
11526fc0178dSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
11536fc0178dSmrg  fi
11546fc0178dSmrg])
11557a3b38f7Smrg
11566fc0178dSmrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
11576fc0178dSmrg# ----------------------------------
11586fc0178dSmrg# Links a minimal program and checks the executable
11596fc0178dSmrg# for the system default hardcoded library path. In most cases,
11606fc0178dSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
11616fc0178dSmrg# the location of the communication and MPI libs are included too.
11626fc0178dSmrg# If we don't find anything, use the default library path according
11636fc0178dSmrg# to the aix ld manual.
11646fc0178dSmrg# Store the results from the different compilers for each TAGNAME.
11656fc0178dSmrg# Allow to override them for all tags through lt_cv_aix_libpath.
11666fc0178dSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
11676fc0178dSmrg[m4_require([_LT_DECL_SED])dnl
11686fc0178dSmrgif test set = "${lt_cv_aix_libpath+set}"; then
11696fc0178dSmrg  aix_libpath=$lt_cv_aix_libpath
11706fc0178dSmrgelse
11716fc0178dSmrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
11726fc0178dSmrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
11736fc0178dSmrg  lt_aix_libpath_sed='[
11746fc0178dSmrg      /Import File Strings/,/^$/ {
11756fc0178dSmrg	  /^0/ {
11766fc0178dSmrg	      s/^0  *\([^ ]*\) *$/\1/
11776fc0178dSmrg	      p
11786fc0178dSmrg	  }
11796fc0178dSmrg      }]'
11806fc0178dSmrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11816fc0178dSmrg  # Check for a 64-bit object if we didn't find anything.
11826fc0178dSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
11836fc0178dSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11846fc0178dSmrg  fi],[])
11856fc0178dSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
11866fc0178dSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
11876fc0178dSmrg  fi
11886fc0178dSmrg  ])
11896fc0178dSmrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
11906fc0178dSmrgfi
11916fc0178dSmrg])# _LT_SYS_MODULE_PATH_AIX
1192ff559fabSmrg
1193ff559fabSmrg
11946fc0178dSmrg# _LT_SHELL_INIT(ARG)
11956fc0178dSmrg# -------------------
11966fc0178dSmrgm4_define([_LT_SHELL_INIT],
11976fc0178dSmrg[m4_divert_text([M4SH-INIT], [$1
11986fc0178dSmrg])])# _LT_SHELL_INIT
1199ff559fabSmrg
12007a3b38f7Smrg
12017a3b38f7Smrg
12026fc0178dSmrg# _LT_PROG_ECHO_BACKSLASH
12036fc0178dSmrg# -----------------------
12046fc0178dSmrg# Find how we can fake an echo command that does not interpret backslash.
12056fc0178dSmrg# In particular, with Autoconf 2.60 or later we add some code to the start
12066fc0178dSmrg# of the generated configure script that will find a shell with a builtin
12076fc0178dSmrg# printf (that we can use as an echo command).
12086fc0178dSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
12096fc0178dSmrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
12106fc0178dSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
12116fc0178dSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
12127a3b38f7Smrg
12136fc0178dSmrgAC_MSG_CHECKING([how to print strings])
12146fc0178dSmrg# Test print first, because it will be a builtin if present.
12156fc0178dSmrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
12166fc0178dSmrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
12176fc0178dSmrg  ECHO='print -r --'
12186fc0178dSmrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
12196fc0178dSmrg  ECHO='printf %s\n'
12206fc0178dSmrgelse
12216fc0178dSmrg  # Use this function as a fallback that always works.
12226fc0178dSmrg  func_fallback_echo ()
12236fc0178dSmrg  {
12246fc0178dSmrg    eval 'cat <<_LTECHO_EOF
12256fc0178dSmrg$[]1
12266fc0178dSmrg_LTECHO_EOF'
12276fc0178dSmrg  }
12286fc0178dSmrg  ECHO='func_fallback_echo'
12296fc0178dSmrgfi
12307a3b38f7Smrg
12316fc0178dSmrg# func_echo_all arg...
12326fc0178dSmrg# Invoke $ECHO with all args, space-separated.
12336fc0178dSmrgfunc_echo_all ()
12346fc0178dSmrg{
12356fc0178dSmrg    $ECHO "$*"
12366fc0178dSmrg}
1237ff559fabSmrg
12386fc0178dSmrgcase $ECHO in
12396fc0178dSmrg  printf*) AC_MSG_RESULT([printf]) ;;
12406fc0178dSmrg  print*) AC_MSG_RESULT([print -r]) ;;
12416fc0178dSmrg  *) AC_MSG_RESULT([cat]) ;;
12426fc0178dSmrgesac
12437a3b38f7Smrg
12446fc0178dSmrgm4_ifdef([_AS_DETECT_SUGGESTED],
12456fc0178dSmrg[_AS_DETECT_SUGGESTED([
12466fc0178dSmrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
12476fc0178dSmrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
12486fc0178dSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
12496fc0178dSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
12506fc0178dSmrg    PATH=/empty FPATH=/empty; export PATH FPATH
12516fc0178dSmrg    test "X`printf %s $ECHO`" = "X$ECHO" \
12526fc0178dSmrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
12537a3b38f7Smrg
12546fc0178dSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
12556fc0178dSmrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
12566fc0178dSmrg])# _LT_PROG_ECHO_BACKSLASH
125744dda7b2Smrg
12586fc0178dSmrg
12596fc0178dSmrg# _LT_WITH_SYSROOT
1260862f5301Smrg# ----------------
12616fc0178dSmrgAC_DEFUN([_LT_WITH_SYSROOT],
12626fc0178dSmrg[AC_MSG_CHECKING([for sysroot])
12636fc0178dSmrgAC_ARG_WITH([sysroot],
12646fc0178dSmrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
12656fc0178dSmrg  [Search for dependent libraries within DIR (or the compiler's sysroot
12666fc0178dSmrg   if not specified).])],
12676fc0178dSmrg[], [with_sysroot=no])
1268ff559fabSmrg
12696fc0178dSmrgdnl lt_sysroot will always be passed unquoted.  We quote it here
12706fc0178dSmrgdnl in case the user passed a directory name.
12716fc0178dSmrglt_sysroot=
12726fc0178dSmrgcase $with_sysroot in #(
12736fc0178dSmrg yes)
12746fc0178dSmrg   if test yes = "$GCC"; then
12756fc0178dSmrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
12766fc0178dSmrg   fi
12776fc0178dSmrg   ;; #(
12786fc0178dSmrg /*)
12796fc0178dSmrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
12806fc0178dSmrg   ;; #(
12816fc0178dSmrg no|'')
12826fc0178dSmrg   ;; #(
12836fc0178dSmrg *)
12846fc0178dSmrg   AC_MSG_RESULT([$with_sysroot])
12856fc0178dSmrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
12866fc0178dSmrg   ;;
12876fc0178dSmrgesac
1288ff559fabSmrg
12896fc0178dSmrg AC_MSG_RESULT([${lt_sysroot:-no}])
12906fc0178dSmrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
12916fc0178dSmrg[dependent libraries, and where our libraries should be installed.])])
1292ff559fabSmrg
12936fc0178dSmrg# _LT_ENABLE_LOCK
12946fc0178dSmrg# ---------------
12956fc0178dSmrgm4_defun([_LT_ENABLE_LOCK],
12966fc0178dSmrg[AC_ARG_ENABLE([libtool-lock],
12976fc0178dSmrg  [AS_HELP_STRING([--disable-libtool-lock],
12986fc0178dSmrg    [avoid locking (might break parallel builds)])])
12996fc0178dSmrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
1300ff559fabSmrg
13016fc0178dSmrg# Some flags need to be propagated to the compiler or linker for good
13026fc0178dSmrg# libtool support.
13036fc0178dSmrgcase $host in
13046fc0178dSmrgia64-*-hpux*)
13056fc0178dSmrg  # Find out what ABI is being produced by ac_compile, and set mode
13066fc0178dSmrg  # options accordingly.
13076fc0178dSmrg  echo 'int i;' > conftest.$ac_ext
13086fc0178dSmrg  if AC_TRY_EVAL(ac_compile); then
13096fc0178dSmrg    case `/usr/bin/file conftest.$ac_objext` in
13106fc0178dSmrg      *ELF-32*)
13116fc0178dSmrg	HPUX_IA64_MODE=32
13126fc0178dSmrg	;;
13136fc0178dSmrg      *ELF-64*)
13146fc0178dSmrg	HPUX_IA64_MODE=64
13156fc0178dSmrg	;;
13166fc0178dSmrg    esac
13176fc0178dSmrg  fi
13186fc0178dSmrg  rm -rf conftest*
13196fc0178dSmrg  ;;
13206fc0178dSmrg*-*-irix6*)
13216fc0178dSmrg  # Find out what ABI is being produced by ac_compile, and set linker
13226fc0178dSmrg  # options accordingly.
13236fc0178dSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
13246fc0178dSmrg  if AC_TRY_EVAL(ac_compile); then
13256fc0178dSmrg    if test yes = "$lt_cv_prog_gnu_ld"; then
13266fc0178dSmrg      case `/usr/bin/file conftest.$ac_objext` in
13276fc0178dSmrg	*32-bit*)
13286fc0178dSmrg	  LD="${LD-ld} -melf32bsmip"
13296fc0178dSmrg	  ;;
13306fc0178dSmrg	*N32*)
13316fc0178dSmrg	  LD="${LD-ld} -melf32bmipn32"
13326fc0178dSmrg	  ;;
13336fc0178dSmrg	*64-bit*)
13346fc0178dSmrg	  LD="${LD-ld} -melf64bmip"
13356fc0178dSmrg	;;
13366fc0178dSmrg      esac
13376fc0178dSmrg    else
13386fc0178dSmrg      case `/usr/bin/file conftest.$ac_objext` in
13396fc0178dSmrg	*32-bit*)
13406fc0178dSmrg	  LD="${LD-ld} -32"
13416fc0178dSmrg	  ;;
13426fc0178dSmrg	*N32*)
13436fc0178dSmrg	  LD="${LD-ld} -n32"
13446fc0178dSmrg	  ;;
13456fc0178dSmrg	*64-bit*)
13466fc0178dSmrg	  LD="${LD-ld} -64"
13476fc0178dSmrg	  ;;
13486fc0178dSmrg      esac
13496fc0178dSmrg    fi
13506fc0178dSmrg  fi
13516fc0178dSmrg  rm -rf conftest*
13526fc0178dSmrg  ;;
1353ff559fabSmrg
13546fc0178dSmrgmips64*-*linux*)
13556fc0178dSmrg  # Find out what ABI is being produced by ac_compile, and set linker
13566fc0178dSmrg  # options accordingly.
13576fc0178dSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
13586fc0178dSmrg  if AC_TRY_EVAL(ac_compile); then
13596fc0178dSmrg    emul=elf
13606fc0178dSmrg    case `/usr/bin/file conftest.$ac_objext` in
13616fc0178dSmrg      *32-bit*)
13626fc0178dSmrg	emul="${emul}32"
13636fc0178dSmrg	;;
13646fc0178dSmrg      *64-bit*)
13656fc0178dSmrg	emul="${emul}64"
13666fc0178dSmrg	;;
13676fc0178dSmrg    esac
13686fc0178dSmrg    case `/usr/bin/file conftest.$ac_objext` in
13696fc0178dSmrg      *MSB*)
13706fc0178dSmrg	emul="${emul}btsmip"
13716fc0178dSmrg	;;
13726fc0178dSmrg      *LSB*)
13736fc0178dSmrg	emul="${emul}ltsmip"
13746fc0178dSmrg	;;
13756fc0178dSmrg    esac
13766fc0178dSmrg    case `/usr/bin/file conftest.$ac_objext` in
13776fc0178dSmrg      *N32*)
13786fc0178dSmrg	emul="${emul}n32"
13796fc0178dSmrg	;;
13806fc0178dSmrg    esac
13816fc0178dSmrg    LD="${LD-ld} -m $emul"
13826fc0178dSmrg  fi
13836fc0178dSmrg  rm -rf conftest*
13846fc0178dSmrg  ;;
1385ff559fabSmrg
13866fc0178dSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
13876fc0178dSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
13886fc0178dSmrg  # Find out what ABI is being produced by ac_compile, and set linker
13896fc0178dSmrg  # options accordingly.  Note that the listed cases only cover the
13906fc0178dSmrg  # situations where additional linker options are needed (such as when
13916fc0178dSmrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
13926fc0178dSmrg  # vice versa); the common cases where no linker options are needed do
13936fc0178dSmrg  # not appear in the list.
13946fc0178dSmrg  echo 'int i;' > conftest.$ac_ext
13956fc0178dSmrg  if AC_TRY_EVAL(ac_compile); then
13966fc0178dSmrg    case `/usr/bin/file conftest.o` in
13976fc0178dSmrg      *32-bit*)
13986fc0178dSmrg	case $host in
13996fc0178dSmrg	  x86_64-*kfreebsd*-gnu)
14006fc0178dSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
14016fc0178dSmrg	    ;;
14026fc0178dSmrg	  x86_64-*linux*)
14036fc0178dSmrg	    case `/usr/bin/file conftest.o` in
14046fc0178dSmrg	      *x86-64*)
14056fc0178dSmrg		LD="${LD-ld} -m elf32_x86_64"
14066fc0178dSmrg		;;
14076fc0178dSmrg	      *)
14086fc0178dSmrg		LD="${LD-ld} -m elf_i386"
14096fc0178dSmrg		;;
14106fc0178dSmrg	    esac
14116fc0178dSmrg	    ;;
14126fc0178dSmrg	  powerpc64le-*linux*)
14136fc0178dSmrg	    LD="${LD-ld} -m elf32lppclinux"
14146fc0178dSmrg	    ;;
14156fc0178dSmrg	  powerpc64-*linux*)
14166fc0178dSmrg	    LD="${LD-ld} -m elf32ppclinux"
14176fc0178dSmrg	    ;;
14186fc0178dSmrg	  s390x-*linux*)
14196fc0178dSmrg	    LD="${LD-ld} -m elf_s390"
14206fc0178dSmrg	    ;;
14216fc0178dSmrg	  sparc64-*linux*)
14226fc0178dSmrg	    LD="${LD-ld} -m elf32_sparc"
14236fc0178dSmrg	    ;;
14246fc0178dSmrg	esac
14256fc0178dSmrg	;;
14266fc0178dSmrg      *64-bit*)
14276fc0178dSmrg	case $host in
14286fc0178dSmrg	  x86_64-*kfreebsd*-gnu)
14296fc0178dSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
14306fc0178dSmrg	    ;;
14316fc0178dSmrg	  x86_64-*linux*)
14326fc0178dSmrg	    LD="${LD-ld} -m elf_x86_64"
14336fc0178dSmrg	    ;;
14346fc0178dSmrg	  powerpcle-*linux*)
14356fc0178dSmrg	    LD="${LD-ld} -m elf64lppc"
14366fc0178dSmrg	    ;;
14376fc0178dSmrg	  powerpc-*linux*)
14386fc0178dSmrg	    LD="${LD-ld} -m elf64ppc"
14396fc0178dSmrg	    ;;
14406fc0178dSmrg	  s390*-*linux*|s390*-*tpf*)
14416fc0178dSmrg	    LD="${LD-ld} -m elf64_s390"
14426fc0178dSmrg	    ;;
14436fc0178dSmrg	  sparc*-*linux*)
14446fc0178dSmrg	    LD="${LD-ld} -m elf64_sparc"
14456fc0178dSmrg	    ;;
14466fc0178dSmrg	esac
14476fc0178dSmrg	;;
14486fc0178dSmrg    esac
14496fc0178dSmrg  fi
14506fc0178dSmrg  rm -rf conftest*
14516fc0178dSmrg  ;;
1452ff559fabSmrg
14536fc0178dSmrg*-*-sco3.2v5*)
14546fc0178dSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
14556fc0178dSmrg  SAVE_CFLAGS=$CFLAGS
14566fc0178dSmrg  CFLAGS="$CFLAGS -belf"
14576fc0178dSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
14586fc0178dSmrg    [AC_LANG_PUSH(C)
14596fc0178dSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
14606fc0178dSmrg     AC_LANG_POP])
14616fc0178dSmrg  if test yes != "$lt_cv_cc_needs_belf"; then
14626fc0178dSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
14636fc0178dSmrg    CFLAGS=$SAVE_CFLAGS
14646fc0178dSmrg  fi
14656fc0178dSmrg  ;;
14666fc0178dSmrg*-*solaris*)
14676fc0178dSmrg  # Find out what ABI is being produced by ac_compile, and set linker
14686fc0178dSmrg  # options accordingly.
14696fc0178dSmrg  echo 'int i;' > conftest.$ac_ext
14706fc0178dSmrg  if AC_TRY_EVAL(ac_compile); then
14716fc0178dSmrg    case `/usr/bin/file conftest.o` in
14726fc0178dSmrg    *64-bit*)
14736fc0178dSmrg      case $lt_cv_prog_gnu_ld in
14746fc0178dSmrg      yes*)
14756fc0178dSmrg        case $host in
14766fc0178dSmrg        i?86-*-solaris*|x86_64-*-solaris*)
14776fc0178dSmrg          LD="${LD-ld} -m elf_x86_64"
14786fc0178dSmrg          ;;
14796fc0178dSmrg        sparc*-*-solaris*)
14806fc0178dSmrg          LD="${LD-ld} -m elf64_sparc"
14816fc0178dSmrg          ;;
14826fc0178dSmrg        esac
14836fc0178dSmrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
14846fc0178dSmrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
14856fc0178dSmrg          LD=${LD-ld}_sol2
14866fc0178dSmrg        fi
14876fc0178dSmrg        ;;
14886fc0178dSmrg      *)
14896fc0178dSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
14906fc0178dSmrg	  LD="${LD-ld} -64"
14916fc0178dSmrg	fi
14926fc0178dSmrg	;;
14936fc0178dSmrg      esac
14946fc0178dSmrg      ;;
14956fc0178dSmrg    esac
14966fc0178dSmrg  fi
14976fc0178dSmrg  rm -rf conftest*
14986fc0178dSmrg  ;;
14996fc0178dSmrgesac
1500ff559fabSmrg
15016fc0178dSmrgneed_locks=$enable_libtool_lock
15026fc0178dSmrg])# _LT_ENABLE_LOCK
1503ff559fabSmrg
1504ff559fabSmrg
15056fc0178dSmrg# _LT_PROG_AR
15066fc0178dSmrg# -----------
15076fc0178dSmrgm4_defun([_LT_PROG_AR],
15086fc0178dSmrg[AC_CHECK_TOOLS(AR, [ar], false)
15096fc0178dSmrg: ${AR=ar}
15106fc0178dSmrg: ${AR_FLAGS=cru}
15116fc0178dSmrg_LT_DECL([], [AR], [1], [The archiver])
15126fc0178dSmrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1513ff559fabSmrg
15146fc0178dSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
15156fc0178dSmrg  [lt_cv_ar_at_file=no
15166fc0178dSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
15176fc0178dSmrg     [echo conftest.$ac_objext > conftest.lst
15186fc0178dSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
15196fc0178dSmrg      AC_TRY_EVAL([lt_ar_try])
15206fc0178dSmrg      if test 0 -eq "$ac_status"; then
15216fc0178dSmrg	# Ensure the archiver fails upon bogus file names.
15226fc0178dSmrg	rm -f conftest.$ac_objext libconftest.a
15236fc0178dSmrg	AC_TRY_EVAL([lt_ar_try])
15246fc0178dSmrg	if test 0 -ne "$ac_status"; then
15256fc0178dSmrg          lt_cv_ar_at_file=@
15266fc0178dSmrg        fi
15276fc0178dSmrg      fi
15286fc0178dSmrg      rm -f conftest.* libconftest.a
15296fc0178dSmrg     ])
15306fc0178dSmrg  ])
1531ff559fabSmrg
15326fc0178dSmrgif test no = "$lt_cv_ar_at_file"; then
15336fc0178dSmrg  archiver_list_spec=
15346fc0178dSmrgelse
15356fc0178dSmrg  archiver_list_spec=$lt_cv_ar_at_file
15366fc0178dSmrgfi
15376fc0178dSmrg_LT_DECL([], [archiver_list_spec], [1],
15386fc0178dSmrg  [How to feed a file listing to the archiver])
15396fc0178dSmrg])# _LT_PROG_AR
154044dda7b2Smrg
154144dda7b2Smrg
15426fc0178dSmrg# _LT_CMD_OLD_ARCHIVE
15436fc0178dSmrg# -------------------
15446fc0178dSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
15456fc0178dSmrg[_LT_PROG_AR
154644dda7b2Smrg
15476fc0178dSmrgAC_CHECK_TOOL(STRIP, strip, :)
15486fc0178dSmrgtest -z "$STRIP" && STRIP=:
15496fc0178dSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1550ff559fabSmrg
15516fc0178dSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
15526fc0178dSmrgtest -z "$RANLIB" && RANLIB=:
15536fc0178dSmrg_LT_DECL([], [RANLIB], [1],
15546fc0178dSmrg    [Commands used to install an old-style archive])
15557a3b38f7Smrg
15566fc0178dSmrg# Determine commands to create old-style static archives.
15576fc0178dSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
15586fc0178dSmrgold_postinstall_cmds='chmod 644 $oldlib'
15596fc0178dSmrgold_postuninstall_cmds=
15607a3b38f7Smrg
15616fc0178dSmrgif test -n "$RANLIB"; then
15626fc0178dSmrg  case $host_os in
15636fc0178dSmrg  bitrig* | openbsd*)
15646fc0178dSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
15656fc0178dSmrg    ;;
15666fc0178dSmrg  *)
15676fc0178dSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
15686fc0178dSmrg    ;;
15696fc0178dSmrg  esac
15706fc0178dSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
15716fc0178dSmrgfi
1572ff559fabSmrg
15736fc0178dSmrgcase $host_os in
15746fc0178dSmrg  darwin*)
15756fc0178dSmrg    lock_old_archive_extraction=yes ;;
15766fc0178dSmrg  *)
15776fc0178dSmrg    lock_old_archive_extraction=no ;;
15786fc0178dSmrgesac
15796fc0178dSmrg_LT_DECL([], [old_postinstall_cmds], [2])
15806fc0178dSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
15816fc0178dSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
15826fc0178dSmrg    [Commands used to build an old-style archive])
15836fc0178dSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
15846fc0178dSmrg    [Whether to use a lock for old archive extraction])
15856fc0178dSmrg])# _LT_CMD_OLD_ARCHIVE
1586ff559fabSmrg
1587ff559fabSmrg
15886fc0178dSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
15896fc0178dSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
15906fc0178dSmrg# ----------------------------------------------------------------
15916fc0178dSmrg# Check whether the given compiler option works
15926fc0178dSmrgAC_DEFUN([_LT_COMPILER_OPTION],
15936fc0178dSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
15946fc0178dSmrgm4_require([_LT_DECL_SED])dnl
15956fc0178dSmrgAC_CACHE_CHECK([$1], [$2],
15966fc0178dSmrg  [$2=no
15976fc0178dSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
15986fc0178dSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
15996fc0178dSmrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
16006fc0178dSmrg   # Insert the option either (1) after the last *FLAGS variable, or
16016fc0178dSmrg   # (2) before a word containing "conftest.", or (3) at the end.
16026fc0178dSmrg   # Note that $ac_compile itself does not contain backslashes and begins
16036fc0178dSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
16046fc0178dSmrg   # The option is referenced via a variable to avoid confusing sed.
16056fc0178dSmrg   lt_compile=`echo "$ac_compile" | $SED \
16066fc0178dSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
16076fc0178dSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
16086fc0178dSmrg   -e 's:$: $lt_compiler_flag:'`
16096fc0178dSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
16106fc0178dSmrg   (eval "$lt_compile" 2>conftest.err)
16116fc0178dSmrg   ac_status=$?
16126fc0178dSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
16136fc0178dSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
16146fc0178dSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
16156fc0178dSmrg     # The compiler can only warn and ignore the option if not recognized
16166fc0178dSmrg     # So say no if there are warnings other than the usual output.
16176fc0178dSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
16186fc0178dSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
16196fc0178dSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
16206fc0178dSmrg       $2=yes
16216fc0178dSmrg     fi
16226fc0178dSmrg   fi
16236fc0178dSmrg   $RM conftest*
16246fc0178dSmrg])
1625ff559fabSmrg
16266fc0178dSmrgif test yes = "[$]$2"; then
16276fc0178dSmrg    m4_if([$5], , :, [$5])
16286fc0178dSmrgelse
16296fc0178dSmrg    m4_if([$6], , :, [$6])
16306fc0178dSmrgfi
16316fc0178dSmrg])# _LT_COMPILER_OPTION
1632ff559fabSmrg
16336fc0178dSmrg# Old name:
16346fc0178dSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
16356fc0178dSmrgdnl aclocal-1.4 backwards compatibility:
16366fc0178dSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1637ff559fabSmrg
1638ff559fabSmrg
16396fc0178dSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
16406fc0178dSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
16416fc0178dSmrg# ----------------------------------------------------
16426fc0178dSmrg# Check whether the given linker option works
16436fc0178dSmrgAC_DEFUN([_LT_LINKER_OPTION],
16446fc0178dSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
16456fc0178dSmrgm4_require([_LT_DECL_SED])dnl
16466fc0178dSmrgAC_CACHE_CHECK([$1], [$2],
16476fc0178dSmrg  [$2=no
16486fc0178dSmrg   save_LDFLAGS=$LDFLAGS
16496fc0178dSmrg   LDFLAGS="$LDFLAGS $3"
16506fc0178dSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
16516fc0178dSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
16526fc0178dSmrg     # The linker can only warn and ignore the option if not recognized
16536fc0178dSmrg     # So say no if there are warnings
16546fc0178dSmrg     if test -s conftest.err; then
16556fc0178dSmrg       # Append any errors to the config.log.
16566fc0178dSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
16576fc0178dSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
16586fc0178dSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
16596fc0178dSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
16606fc0178dSmrg         $2=yes
16616fc0178dSmrg       fi
16626fc0178dSmrg     else
16636fc0178dSmrg       $2=yes
16646fc0178dSmrg     fi
16656fc0178dSmrg   fi
16666fc0178dSmrg   $RM -r conftest*
16676fc0178dSmrg   LDFLAGS=$save_LDFLAGS
16686fc0178dSmrg])
1669ff559fabSmrg
16706fc0178dSmrgif test yes = "[$]$2"; then
16716fc0178dSmrg    m4_if([$4], , :, [$4])
16726fc0178dSmrgelse
16736fc0178dSmrg    m4_if([$5], , :, [$5])
16746fc0178dSmrgfi
16756fc0178dSmrg])# _LT_LINKER_OPTION
1676ff559fabSmrg
16776fc0178dSmrg# Old name:
16786fc0178dSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
16796fc0178dSmrgdnl aclocal-1.4 backwards compatibility:
16806fc0178dSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1681ff559fabSmrg
1682ff559fabSmrg
16836fc0178dSmrg# LT_CMD_MAX_LEN
16846fc0178dSmrg#---------------
16856fc0178dSmrgAC_DEFUN([LT_CMD_MAX_LEN],
16866fc0178dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
16876fc0178dSmrg# find the maximum length of command line arguments
16886fc0178dSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
16896fc0178dSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
16906fc0178dSmrg  i=0
16916fc0178dSmrg  teststring=ABCD
1692ff559fabSmrg
16936fc0178dSmrg  case $build_os in
16946fc0178dSmrg  msdosdjgpp*)
16956fc0178dSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
16966fc0178dSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
16976fc0178dSmrg    # during glob expansion).  Even if it were fixed, the result of this
16986fc0178dSmrg    # check would be larger than it should be.
16996fc0178dSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
17006fc0178dSmrg    ;;
1701ff559fabSmrg
17026fc0178dSmrg  gnu*)
17036fc0178dSmrg    # Under GNU Hurd, this test is not required because there is
17046fc0178dSmrg    # no limit to the length of command line arguments.
17056fc0178dSmrg    # Libtool will interpret -1 as no limit whatsoever
17066fc0178dSmrg    lt_cv_sys_max_cmd_len=-1;
17076fc0178dSmrg    ;;
1708ff559fabSmrg
17096fc0178dSmrg  cygwin* | mingw* | cegcc*)
17106fc0178dSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
17116fc0178dSmrg    # about 5 minutes as the teststring grows exponentially.
17126fc0178dSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
17136fc0178dSmrg    # you end up with a "frozen" computer, even though with patience
17146fc0178dSmrg    # the test eventually succeeds (with a max line length of 256k).
17156fc0178dSmrg    # Instead, let's just punt: use the minimum linelength reported by
17166fc0178dSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
17176fc0178dSmrg    lt_cv_sys_max_cmd_len=8192;
17186fc0178dSmrg    ;;
1719ff559fabSmrg
17206fc0178dSmrg  mint*)
17216fc0178dSmrg    # On MiNT this can take a long time and run out of memory.
17226fc0178dSmrg    lt_cv_sys_max_cmd_len=8192;
17236fc0178dSmrg    ;;
1724ff559fabSmrg
17256fc0178dSmrg  amigaos*)
17266fc0178dSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
17276fc0178dSmrg    # So we just punt and use a minimum line length of 8192.
17286fc0178dSmrg    lt_cv_sys_max_cmd_len=8192;
17296fc0178dSmrg    ;;
17307a3b38f7Smrg
17316fc0178dSmrg  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
17326fc0178dSmrg    # This has been around since 386BSD, at least.  Likely further.
17336fc0178dSmrg    if test -x /sbin/sysctl; then
17346fc0178dSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
17356fc0178dSmrg    elif test -x /usr/sbin/sysctl; then
17366fc0178dSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
17376fc0178dSmrg    else
17386fc0178dSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
17396fc0178dSmrg    fi
17406fc0178dSmrg    # And add a safety zone
17416fc0178dSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
17426fc0178dSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
17436fc0178dSmrg    ;;
1744ff559fabSmrg
17456fc0178dSmrg  interix*)
17466fc0178dSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
17476fc0178dSmrg    lt_cv_sys_max_cmd_len=196608
17486fc0178dSmrg    ;;
1749ff559fabSmrg
17506fc0178dSmrg  os2*)
17516fc0178dSmrg    # The test takes a long time on OS/2.
17526fc0178dSmrg    lt_cv_sys_max_cmd_len=8192
17536fc0178dSmrg    ;;
1754ff559fabSmrg
17556fc0178dSmrg  osf*)
17566fc0178dSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
17576fc0178dSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
17586fc0178dSmrg    # nice to cause kernel panics so lets avoid the loop below.
17596fc0178dSmrg    # First set a reasonable default.
17606fc0178dSmrg    lt_cv_sys_max_cmd_len=16384
17616fc0178dSmrg    #
17626fc0178dSmrg    if test -x /sbin/sysconfig; then
17636fc0178dSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
17646fc0178dSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
17656fc0178dSmrg      esac
17666fc0178dSmrg    fi
17676fc0178dSmrg    ;;
17686fc0178dSmrg  sco3.2v5*)
17696fc0178dSmrg    lt_cv_sys_max_cmd_len=102400
17706fc0178dSmrg    ;;
17716fc0178dSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
17726fc0178dSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
17736fc0178dSmrg    if test -n "$kargmax"; then
17746fc0178dSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
17756fc0178dSmrg    else
17766fc0178dSmrg      lt_cv_sys_max_cmd_len=32768
17776fc0178dSmrg    fi
17786fc0178dSmrg    ;;
17796fc0178dSmrg  *)
17806fc0178dSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
17816fc0178dSmrg    if test -n "$lt_cv_sys_max_cmd_len" && \
17826fc0178dSmrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
17836fc0178dSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
17846fc0178dSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
17856fc0178dSmrg    else
17866fc0178dSmrg      # Make teststring a little bigger before we do anything with it.
17876fc0178dSmrg      # a 1K string should be a reasonable start.
17886fc0178dSmrg      for i in 1 2 3 4 5 6 7 8; do
17896fc0178dSmrg        teststring=$teststring$teststring
17906fc0178dSmrg      done
17916fc0178dSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
17926fc0178dSmrg      # If test is not a shell built-in, we'll probably end up computing a
17936fc0178dSmrg      # maximum length that is only half of the actual maximum length, but
17946fc0178dSmrg      # we can't tell.
17956fc0178dSmrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
17966fc0178dSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
17976fc0178dSmrg	      test 17 != "$i" # 1/2 MB should be enough
17986fc0178dSmrg      do
17996fc0178dSmrg        i=`expr $i + 1`
18006fc0178dSmrg        teststring=$teststring$teststring
18016fc0178dSmrg      done
18026fc0178dSmrg      # Only check the string length outside the loop.
18036fc0178dSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
18046fc0178dSmrg      teststring=
18056fc0178dSmrg      # Add a significant safety factor because C++ compilers can tack on
18066fc0178dSmrg      # massive amounts of additional arguments before passing them to the
18076fc0178dSmrg      # linker.  It appears as though 1/2 is a usable value.
18086fc0178dSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
18096fc0178dSmrg    fi
1810862f5301Smrg    ;;
1811862f5301Smrg  esac
18126fc0178dSmrg])
18136fc0178dSmrgif test -n "$lt_cv_sys_max_cmd_len"; then
18146fc0178dSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
18156fc0178dSmrgelse
18166fc0178dSmrg  AC_MSG_RESULT(none)
18176fc0178dSmrgfi
18186fc0178dSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
18196fc0178dSmrg_LT_DECL([], [max_cmd_len], [0],
18206fc0178dSmrg    [What is the maximum length of a command?])
18216fc0178dSmrg])# LT_CMD_MAX_LEN
1822ff559fabSmrg
18236fc0178dSmrg# Old name:
18246fc0178dSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
18256fc0178dSmrgdnl aclocal-1.4 backwards compatibility:
18266fc0178dSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1827ff559fabSmrg
1828ff559fabSmrg
18296fc0178dSmrg# _LT_HEADER_DLFCN
18306fc0178dSmrg# ----------------
18316fc0178dSmrgm4_defun([_LT_HEADER_DLFCN],
18326fc0178dSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
18336fc0178dSmrg])# _LT_HEADER_DLFCN
1834ff559fabSmrg
1835ff559fabSmrg
18366fc0178dSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
18376fc0178dSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
18386fc0178dSmrg# ----------------------------------------------------------------
18396fc0178dSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
18406fc0178dSmrg[m4_require([_LT_HEADER_DLFCN])dnl
18416fc0178dSmrgif test yes = "$cross_compiling"; then :
18426fc0178dSmrg  [$4]
18436fc0178dSmrgelse
18446fc0178dSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
18456fc0178dSmrg  lt_status=$lt_dlunknown
18466fc0178dSmrg  cat > conftest.$ac_ext <<_LT_EOF
18476fc0178dSmrg[#line $LINENO "configure"
18486fc0178dSmrg#include "confdefs.h"
1849ff559fabSmrg
18506fc0178dSmrg#if HAVE_DLFCN_H
18516fc0178dSmrg#include <dlfcn.h>
18526fc0178dSmrg#endif
1853ff559fabSmrg
18546fc0178dSmrg#include <stdio.h>
1855ff559fabSmrg
18566fc0178dSmrg#ifdef RTLD_GLOBAL
18576fc0178dSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
18586fc0178dSmrg#else
18596fc0178dSmrg#  ifdef DL_GLOBAL
18606fc0178dSmrg#    define LT_DLGLOBAL		DL_GLOBAL
18616fc0178dSmrg#  else
18626fc0178dSmrg#    define LT_DLGLOBAL		0
18636fc0178dSmrg#  endif
18646fc0178dSmrg#endif
18657a3b38f7Smrg
18666fc0178dSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
18676fc0178dSmrg   find out it does not work in some platform. */
18686fc0178dSmrg#ifndef LT_DLLAZY_OR_NOW
18696fc0178dSmrg#  ifdef RTLD_LAZY
18706fc0178dSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
18716fc0178dSmrg#  else
18726fc0178dSmrg#    ifdef DL_LAZY
18736fc0178dSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
18746fc0178dSmrg#    else
18756fc0178dSmrg#      ifdef RTLD_NOW
18766fc0178dSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
18776fc0178dSmrg#      else
18786fc0178dSmrg#        ifdef DL_NOW
18796fc0178dSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
18806fc0178dSmrg#        else
18816fc0178dSmrg#          define LT_DLLAZY_OR_NOW	0
18826fc0178dSmrg#        endif
18836fc0178dSmrg#      endif
18846fc0178dSmrg#    endif
18856fc0178dSmrg#  endif
18866fc0178dSmrg#endif
18877a3b38f7Smrg
18886fc0178dSmrg/* When -fvisibility=hidden is used, assume the code has been annotated
18896fc0178dSmrg   correspondingly for the symbols needed.  */
18906fc0178dSmrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
18916fc0178dSmrgint fnord () __attribute__((visibility("default")));
18926fc0178dSmrg#endif
1893ff559fabSmrg
18946fc0178dSmrgint fnord () { return 42; }
18956fc0178dSmrgint main ()
18966fc0178dSmrg{
18976fc0178dSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
18986fc0178dSmrg  int status = $lt_dlunknown;
18997a3b38f7Smrg
19006fc0178dSmrg  if (self)
19016fc0178dSmrg    {
19026fc0178dSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
19036fc0178dSmrg      else
19046fc0178dSmrg        {
19056fc0178dSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
19066fc0178dSmrg          else puts (dlerror ());
19076fc0178dSmrg	}
19086fc0178dSmrg      /* dlclose (self); */
19096fc0178dSmrg    }
19106fc0178dSmrg  else
19116fc0178dSmrg    puts (dlerror ());
1912ff559fabSmrg
19136fc0178dSmrg  return status;
19146fc0178dSmrg}]
19156fc0178dSmrg_LT_EOF
19166fc0178dSmrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
19176fc0178dSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
19186fc0178dSmrg    lt_status=$?
19196fc0178dSmrg    case x$lt_status in
19206fc0178dSmrg      x$lt_dlno_uscore) $1 ;;
19216fc0178dSmrg      x$lt_dlneed_uscore) $2 ;;
19226fc0178dSmrg      x$lt_dlunknown|x*) $3 ;;
19236fc0178dSmrg    esac
19246fc0178dSmrg  else :
19256fc0178dSmrg    # compilation failed
19266fc0178dSmrg    $3
1927fc544a13Smrg  fi
1928fc544a13Smrgfi
19296fc0178dSmrgrm -fr conftest*
19306fc0178dSmrg])# _LT_TRY_DLOPEN_SELF
1931fc544a13Smrg
1932fc544a13Smrg
19336fc0178dSmrg# LT_SYS_DLOPEN_SELF
19346fc0178dSmrg# ------------------
19356fc0178dSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
19366fc0178dSmrg[m4_require([_LT_HEADER_DLFCN])dnl
19376fc0178dSmrgif test yes != "$enable_dlopen"; then
19386fc0178dSmrg  enable_dlopen=unknown
19396fc0178dSmrg  enable_dlopen_self=unknown
19406fc0178dSmrg  enable_dlopen_self_static=unknown
19416fc0178dSmrgelse
19426fc0178dSmrg  lt_cv_dlopen=no
19436fc0178dSmrg  lt_cv_dlopen_libs=
19447a3b38f7Smrg
19456fc0178dSmrg  case $host_os in
19466fc0178dSmrg  beos*)
19476fc0178dSmrg    lt_cv_dlopen=load_add_on
19486fc0178dSmrg    lt_cv_dlopen_libs=
19496fc0178dSmrg    lt_cv_dlopen_self=yes
19506fc0178dSmrg    ;;
19517a3b38f7Smrg
19526fc0178dSmrg  mingw* | pw32* | cegcc*)
19536fc0178dSmrg    lt_cv_dlopen=LoadLibrary
19546fc0178dSmrg    lt_cv_dlopen_libs=
19556fc0178dSmrg    ;;
19567a3b38f7Smrg
19576fc0178dSmrg  cygwin*)
19586fc0178dSmrg    lt_cv_dlopen=dlopen
19596fc0178dSmrg    lt_cv_dlopen_libs=
19606fc0178dSmrg    ;;
1961ff559fabSmrg
19626fc0178dSmrg  darwin*)
19636fc0178dSmrg    # if libdl is installed we need to link against it
19646fc0178dSmrg    AC_CHECK_LIB([dl], [dlopen],
19656fc0178dSmrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
19666fc0178dSmrg    lt_cv_dlopen=dyld
19676fc0178dSmrg    lt_cv_dlopen_libs=
19686fc0178dSmrg    lt_cv_dlopen_self=yes
19696fc0178dSmrg    ])
19706fc0178dSmrg    ;;
1971fc544a13Smrg
19726fc0178dSmrg  tpf*)
19736fc0178dSmrg    # Don't try to run any link tests for TPF.  We know it's impossible
19746fc0178dSmrg    # because TPF is a cross-compiler, and we know how we open DSOs.
19756fc0178dSmrg    lt_cv_dlopen=dlopen
19766fc0178dSmrg    lt_cv_dlopen_libs=
19776fc0178dSmrg    lt_cv_dlopen_self=no
19786fc0178dSmrg    ;;
1979ff559fabSmrg
19806fc0178dSmrg  *)
19816fc0178dSmrg    AC_CHECK_FUNC([shl_load],
19826fc0178dSmrg	  [lt_cv_dlopen=shl_load],
19836fc0178dSmrg      [AC_CHECK_LIB([dld], [shl_load],
19846fc0178dSmrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
19856fc0178dSmrg	[AC_CHECK_FUNC([dlopen],
19866fc0178dSmrg	      [lt_cv_dlopen=dlopen],
19876fc0178dSmrg	  [AC_CHECK_LIB([dl], [dlopen],
19886fc0178dSmrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
19896fc0178dSmrg	    [AC_CHECK_LIB([svld], [dlopen],
19906fc0178dSmrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
19916fc0178dSmrg	      [AC_CHECK_LIB([dld], [dld_link],
19926fc0178dSmrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
19936fc0178dSmrg	      ])
19946fc0178dSmrg	    ])
19956fc0178dSmrg	  ])
19966fc0178dSmrg	])
19976fc0178dSmrg      ])
19986fc0178dSmrg    ;;
19996fc0178dSmrg  esac
2000ff559fabSmrg
20016fc0178dSmrg  if test no = "$lt_cv_dlopen"; then
20026fc0178dSmrg    enable_dlopen=no
20036fc0178dSmrg  else
20046fc0178dSmrg    enable_dlopen=yes
20056fc0178dSmrg  fi
2006ff559fabSmrg
20076fc0178dSmrg  case $lt_cv_dlopen in
20086fc0178dSmrg  dlopen)
20096fc0178dSmrg    save_CPPFLAGS=$CPPFLAGS
20106fc0178dSmrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2011ff559fabSmrg
20126fc0178dSmrg    save_LDFLAGS=$LDFLAGS
20136fc0178dSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2014ff559fabSmrg
20156fc0178dSmrg    save_LIBS=$LIBS
20166fc0178dSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
2017ff559fabSmrg
20186fc0178dSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
20196fc0178dSmrg	  lt_cv_dlopen_self, [dnl
20206fc0178dSmrg	  _LT_TRY_DLOPEN_SELF(
20216fc0178dSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
20226fc0178dSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
20236fc0178dSmrg    ])
2024ff559fabSmrg
20256fc0178dSmrg    if test yes = "$lt_cv_dlopen_self"; then
20266fc0178dSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
20276fc0178dSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
20286fc0178dSmrg	  lt_cv_dlopen_self_static, [dnl
20296fc0178dSmrg	  _LT_TRY_DLOPEN_SELF(
20306fc0178dSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
20316fc0178dSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
20326fc0178dSmrg      ])
20336fc0178dSmrg    fi
2034ff559fabSmrg
20356fc0178dSmrg    CPPFLAGS=$save_CPPFLAGS
20366fc0178dSmrg    LDFLAGS=$save_LDFLAGS
20376fc0178dSmrg    LIBS=$save_LIBS
20386fc0178dSmrg    ;;
20396fc0178dSmrg  esac
2040ff559fabSmrg
20416fc0178dSmrg  case $lt_cv_dlopen_self in
20426fc0178dSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
20436fc0178dSmrg  *) enable_dlopen_self=unknown ;;
20446fc0178dSmrg  esac
2045ff559fabSmrg
20466fc0178dSmrg  case $lt_cv_dlopen_self_static in
20476fc0178dSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
20486fc0178dSmrg  *) enable_dlopen_self_static=unknown ;;
20496fc0178dSmrg  esac
20506fc0178dSmrgfi
20516fc0178dSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
20526fc0178dSmrg	 [Whether dlopen is supported])
20536fc0178dSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
20546fc0178dSmrg	 [Whether dlopen of programs is supported])
20556fc0178dSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
20566fc0178dSmrg	 [Whether dlopen of statically linked programs is supported])
20576fc0178dSmrg])# LT_SYS_DLOPEN_SELF
2058ff559fabSmrg
20596fc0178dSmrg# Old name:
20606fc0178dSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
20616fc0178dSmrgdnl aclocal-1.4 backwards compatibility:
20626fc0178dSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
20636fc0178dSmrg
20646fc0178dSmrg
20656fc0178dSmrg# _LT_COMPILER_C_O([TAGNAME])
20666fc0178dSmrg# ---------------------------
20676fc0178dSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
20686fc0178dSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
20696fc0178dSmrgm4_defun([_LT_COMPILER_C_O],
2070862f5301Smrg[m4_require([_LT_DECL_SED])dnl
20716fc0178dSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
20726fc0178dSmrgm4_require([_LT_TAG_COMPILER])dnl
20736fc0178dSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
20746fc0178dSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
20756fc0178dSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
20766fc0178dSmrg   $RM -r conftest 2>/dev/null
20776fc0178dSmrg   mkdir conftest
20786fc0178dSmrg   cd conftest
20796fc0178dSmrg   mkdir out
20806fc0178dSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2081ff559fabSmrg
20826fc0178dSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
20836fc0178dSmrg   # Insert the option either (1) after the last *FLAGS variable, or
20846fc0178dSmrg   # (2) before a word containing "conftest.", or (3) at the end.
20856fc0178dSmrg   # Note that $ac_compile itself does not contain backslashes and begins
20866fc0178dSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
20876fc0178dSmrg   lt_compile=`echo "$ac_compile" | $SED \
20886fc0178dSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
20896fc0178dSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
20906fc0178dSmrg   -e 's:$: $lt_compiler_flag:'`
20916fc0178dSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
20926fc0178dSmrg   (eval "$lt_compile" 2>out/conftest.err)
20936fc0178dSmrg   ac_status=$?
20946fc0178dSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
20956fc0178dSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
20966fc0178dSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
20976fc0178dSmrg   then
20986fc0178dSmrg     # The compiler can only warn and ignore the option if not recognized
20996fc0178dSmrg     # So say no if there are warnings
21006fc0178dSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
21016fc0178dSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
21026fc0178dSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
21036fc0178dSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
21046fc0178dSmrg     fi
21056fc0178dSmrg   fi
21066fc0178dSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
21076fc0178dSmrg   $RM conftest*
21086fc0178dSmrg   # SGI C++ compiler will create directory out/ii_files/ for
21096fc0178dSmrg   # template instantiation
21106fc0178dSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
21116fc0178dSmrg   $RM out/* && rmdir out
21126fc0178dSmrg   cd ..
21136fc0178dSmrg   $RM -r conftest
21146fc0178dSmrg   $RM conftest*
2115862f5301Smrg])
21166fc0178dSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
21176fc0178dSmrg	[Does compiler simultaneously support -c and -o options?])
21186fc0178dSmrg])# _LT_COMPILER_C_O
2119ff559fabSmrg
2120ff559fabSmrg
21216fc0178dSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2122862f5301Smrg# ----------------------------------
21236fc0178dSmrg# Check to see if we can do hard links to lock some files if needed
21246fc0178dSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
21256fc0178dSmrg[m4_require([_LT_ENABLE_LOCK])dnl
21266fc0178dSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
21276fc0178dSmrg_LT_COMPILER_C_O([$1])
21286fc0178dSmrg
21296fc0178dSmrghard_links=nottested
21306fc0178dSmrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
21316fc0178dSmrg  # do not overwrite the value of need_locks provided by the user
21326fc0178dSmrg  AC_MSG_CHECKING([if we can lock with hard links])
21336fc0178dSmrg  hard_links=yes
21346fc0178dSmrg  $RM conftest*
21356fc0178dSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
21366fc0178dSmrg  touch conftest.a
21376fc0178dSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
21386fc0178dSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
21396fc0178dSmrg  AC_MSG_RESULT([$hard_links])
21406fc0178dSmrg  if test no = "$hard_links"; then
21416fc0178dSmrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
21426fc0178dSmrg    need_locks=warn
2143862f5301Smrg  fi
21446fc0178dSmrgelse
21456fc0178dSmrg  need_locks=no
2146862f5301Smrgfi
21476fc0178dSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
21486fc0178dSmrg])# _LT_COMPILER_FILE_LOCKS
2149ff559fabSmrg
2150ff559fabSmrg
21516fc0178dSmrg# _LT_CHECK_OBJDIR
21526fc0178dSmrg# ----------------
21536fc0178dSmrgm4_defun([_LT_CHECK_OBJDIR],
21546fc0178dSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
21556fc0178dSmrg[rm -f .libs 2>/dev/null
21566fc0178dSmrgmkdir .libs 2>/dev/null
21576fc0178dSmrgif test -d .libs; then
21586fc0178dSmrg  lt_cv_objdir=.libs
21596fc0178dSmrgelse
21606fc0178dSmrg  # MS-DOS does not allow filenames that begin with a dot.
21616fc0178dSmrg  lt_cv_objdir=_libs
21626fc0178dSmrgfi
21636fc0178dSmrgrmdir .libs 2>/dev/null])
21646fc0178dSmrgobjdir=$lt_cv_objdir
21656fc0178dSmrg_LT_DECL([], [objdir], [0],
21666fc0178dSmrg         [The name of the directory that contains temporary libtool files])dnl
21676fc0178dSmrgm4_pattern_allow([LT_OBJDIR])dnl
21686fc0178dSmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
21696fc0178dSmrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
21706fc0178dSmrg])# _LT_CHECK_OBJDIR
21717a3b38f7Smrg
2172ff559fabSmrg
21736fc0178dSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
21746fc0178dSmrg# --------------------------------------
21756fc0178dSmrg# Check hardcoding attributes.
21766fc0178dSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
21776fc0178dSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
21786fc0178dSmrg_LT_TAGVAR(hardcode_action, $1)=
21796fc0178dSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
21806fc0178dSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
21816fc0178dSmrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
2182ff559fabSmrg
21836fc0178dSmrg  # We can hardcode non-existent directories.
21846fc0178dSmrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
21856fc0178dSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
21866fc0178dSmrg     # have to relink, otherwise we might link with an installed library
21876fc0178dSmrg     # when we should be linking with a yet-to-be-installed one
21886fc0178dSmrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
21896fc0178dSmrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
21906fc0178dSmrg    # Linking always hardcodes the temporary library directory.
21916fc0178dSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
21926fc0178dSmrg  else
21936fc0178dSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
21946fc0178dSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
21956fc0178dSmrg  fi
21966fc0178dSmrgelse
21976fc0178dSmrg  # We cannot hardcode anything, or else we can only hardcode existing
21986fc0178dSmrg  # directories.
21996fc0178dSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
22006fc0178dSmrgfi
22016fc0178dSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2202ff559fabSmrg
22036fc0178dSmrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
22046fc0178dSmrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
22056fc0178dSmrg  # Fast installation is not supported
22066fc0178dSmrg  enable_fast_install=no
22076fc0178dSmrgelif test yes = "$shlibpath_overrides_runpath" ||
22086fc0178dSmrg     test no = "$enable_shared"; then
22096fc0178dSmrg  # Fast installation is not necessary
22106fc0178dSmrg  enable_fast_install=needless
22116fc0178dSmrgfi
22126fc0178dSmrg_LT_TAGDECL([], [hardcode_action], [0],
22136fc0178dSmrg    [How to hardcode a shared library path into an executable])
22146fc0178dSmrg])# _LT_LINKER_HARDCODE_LIBPATH
22156fc0178dSmrg
22166fc0178dSmrg
22176fc0178dSmrg# _LT_CMD_STRIPLIB
22186fc0178dSmrg# ----------------
22196fc0178dSmrgm4_defun([_LT_CMD_STRIPLIB],
22206fc0178dSmrg[m4_require([_LT_DECL_EGREP])
22216fc0178dSmrgstriplib=
22226fc0178dSmrgold_striplib=
22236fc0178dSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
22246fc0178dSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
22256fc0178dSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
22266fc0178dSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
22276fc0178dSmrg  AC_MSG_RESULT([yes])
2228862f5301Smrgelse
22296fc0178dSmrg# FIXME - insert some real tests, host_os isn't really good enough
22306fc0178dSmrg  case $host_os in
22316fc0178dSmrg  darwin*)
22326fc0178dSmrg    if test -n "$STRIP"; then
22336fc0178dSmrg      striplib="$STRIP -x"
22346fc0178dSmrg      old_striplib="$STRIP -S"
22356fc0178dSmrg      AC_MSG_RESULT([yes])
22366fc0178dSmrg    else
22376fc0178dSmrg      AC_MSG_RESULT([no])
22386fc0178dSmrg    fi
22396fc0178dSmrg    ;;
22406fc0178dSmrg  *)
22416fc0178dSmrg    AC_MSG_RESULT([no])
22426fc0178dSmrg    ;;
22436fc0178dSmrg  esac
2244862f5301Smrgfi
22456fc0178dSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
22466fc0178dSmrg_LT_DECL([], [striplib], [1])
22476fc0178dSmrg])# _LT_CMD_STRIPLIB
2248ff559fabSmrg
22496fc0178dSmrg
22506fc0178dSmrg# _LT_PREPARE_MUNGE_PATH_LIST
22516fc0178dSmrg# ---------------------------
22526fc0178dSmrg# Make sure func_munge_path_list() is defined correctly.
22536fc0178dSmrgm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
22546fc0178dSmrg[[# func_munge_path_list VARIABLE PATH
22556fc0178dSmrg# -----------------------------------
22566fc0178dSmrg# VARIABLE is name of variable containing _space_ separated list of
22576fc0178dSmrg# directories to be munged by the contents of PATH, which is string
22586fc0178dSmrg# having a format:
22596fc0178dSmrg# "DIR[:DIR]:"
22606fc0178dSmrg#       string "DIR[ DIR]" will be prepended to VARIABLE
22616fc0178dSmrg# ":DIR[:DIR]"
22626fc0178dSmrg#       string "DIR[ DIR]" will be appended to VARIABLE
22636fc0178dSmrg# "DIRP[:DIRP]::[DIRA:]DIRA"
22646fc0178dSmrg#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
22656fc0178dSmrg#       "DIRA[ DIRA]" will be appended to VARIABLE
22666fc0178dSmrg# "DIR[:DIR]"
22676fc0178dSmrg#       VARIABLE will be replaced by "DIR[ DIR]"
22686fc0178dSmrgfunc_munge_path_list ()
2269862f5301Smrg{
22706fc0178dSmrg    case x@S|@2 in
22716fc0178dSmrg    x)
22726fc0178dSmrg        ;;
22736fc0178dSmrg    *:)
22746fc0178dSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
22756fc0178dSmrg        ;;
22766fc0178dSmrg    x:*)
22776fc0178dSmrg        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
22786fc0178dSmrg        ;;
22796fc0178dSmrg    *::*)
22806fc0178dSmrg        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
22816fc0178dSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
22826fc0178dSmrg        ;;
22836fc0178dSmrg    *)
22846fc0178dSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
22856fc0178dSmrg        ;;
22866fc0178dSmrg    esac
2287862f5301Smrg}
22886fc0178dSmrg]])# _LT_PREPARE_PATH_LIST
2289ff559fabSmrg
2290ff559fabSmrg
22916fc0178dSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
22926fc0178dSmrg# -----------------------------
22936fc0178dSmrg# PORTME Fill in your ld.so characteristics
22946fc0178dSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
22956fc0178dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
22966fc0178dSmrgm4_require([_LT_DECL_EGREP])dnl
22976fc0178dSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
22986fc0178dSmrgm4_require([_LT_DECL_OBJDUMP])dnl
22996fc0178dSmrgm4_require([_LT_DECL_SED])dnl
23006fc0178dSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
23016fc0178dSmrgm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
23026fc0178dSmrgAC_MSG_CHECKING([dynamic linker characteristics])
23036fc0178dSmrgm4_if([$1],
23046fc0178dSmrg	[], [
23056fc0178dSmrgif test yes = "$GCC"; then
23066fc0178dSmrg  case $host_os in
23076fc0178dSmrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
23086fc0178dSmrg    *) lt_awk_arg='/^libraries:/' ;;
23096fc0178dSmrg  esac
23106fc0178dSmrg  case $host_os in
23116fc0178dSmrg    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
23126fc0178dSmrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
23136fc0178dSmrg  esac
23146fc0178dSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
23156fc0178dSmrg  case $lt_search_path_spec in
23166fc0178dSmrg  *\;*)
23176fc0178dSmrg    # if the path contains ";" then we assume it to be the separator
23186fc0178dSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
23196fc0178dSmrg    # assumed that no part of a normal pathname contains ";" but that should
23206fc0178dSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
23216fc0178dSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
23226fc0178dSmrg    ;;
23236fc0178dSmrg  *)
23246fc0178dSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
23256fc0178dSmrg    ;;
23266fc0178dSmrg  esac
23276fc0178dSmrg  # Ok, now we have the path, separated by spaces, we can step through it
23286fc0178dSmrg  # and add multilib dir if necessary...
23296fc0178dSmrg  lt_tmp_lt_search_path_spec=
23306fc0178dSmrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
23316fc0178dSmrg  # ...but if some path component already ends with the multilib dir we assume
23326fc0178dSmrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
23336fc0178dSmrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
23346fc0178dSmrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
23356fc0178dSmrg    lt_multi_os_dir=
23366fc0178dSmrg    ;;
23376fc0178dSmrg  esac
23386fc0178dSmrg  for lt_sys_path in $lt_search_path_spec; do
23396fc0178dSmrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
23406fc0178dSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
23416fc0178dSmrg    elif test -n "$lt_multi_os_dir"; then
23426fc0178dSmrg      test -d "$lt_sys_path" && \
23436fc0178dSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
23446fc0178dSmrg    fi
23456fc0178dSmrg  done
23466fc0178dSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
23476fc0178dSmrgBEGIN {RS = " "; FS = "/|\n";} {
23486fc0178dSmrg  lt_foo = "";
23496fc0178dSmrg  lt_count = 0;
23506fc0178dSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
23516fc0178dSmrg    if ($lt_i != "" && $lt_i != ".") {
23526fc0178dSmrg      if ($lt_i == "..") {
23536fc0178dSmrg        lt_count++;
23546fc0178dSmrg      } else {
23556fc0178dSmrg        if (lt_count == 0) {
23566fc0178dSmrg          lt_foo = "/" $lt_i lt_foo;
23576fc0178dSmrg        } else {
23586fc0178dSmrg          lt_count--;
23596fc0178dSmrg        }
23606fc0178dSmrg      }
23616fc0178dSmrg    }
23626fc0178dSmrg  }
23636fc0178dSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
23646fc0178dSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
23656fc0178dSmrg}'`
23666fc0178dSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
23676fc0178dSmrg  # for these hosts.
23686fc0178dSmrg  case $host_os in
23696fc0178dSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
23706fc0178dSmrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
23716fc0178dSmrg  esac
23726fc0178dSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
23736fc0178dSmrgelse
23746fc0178dSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
23756fc0178dSmrgfi])
23766fc0178dSmrglibrary_names_spec=
23776fc0178dSmrglibname_spec='lib$name'
23786fc0178dSmrgsoname_spec=
23796fc0178dSmrgshrext_cmds=.so
23806fc0178dSmrgpostinstall_cmds=
23816fc0178dSmrgpostuninstall_cmds=
23826fc0178dSmrgfinish_cmds=
23836fc0178dSmrgfinish_eval=
23846fc0178dSmrgshlibpath_var=
23856fc0178dSmrgshlibpath_overrides_runpath=unknown
23866fc0178dSmrgversion_type=none
23876fc0178dSmrgdynamic_linker="$host_os ld.so"
23886fc0178dSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
23896fc0178dSmrgneed_lib_prefix=unknown
23906fc0178dSmrghardcode_into_libs=no
2391ff559fabSmrg
23926fc0178dSmrg# when you set need_version to no, make sure it does not cause -set_version
23936fc0178dSmrg# flags to be left without arguments
23946fc0178dSmrgneed_version=unknown
2395862f5301Smrg
23966fc0178dSmrgAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
23976fc0178dSmrg[User-defined run-time library search path.])
2398ff559fabSmrg
23996fc0178dSmrgcase $host_os in
24006fc0178dSmrgaix3*)
24016fc0178dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
24026fc0178dSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
24036fc0178dSmrg  shlibpath_var=LIBPATH
2404ff559fabSmrg
24056fc0178dSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
24066fc0178dSmrg  soname_spec='$libname$release$shared_ext$major'
24076fc0178dSmrg  ;;
2408ff559fabSmrg
24096fc0178dSmrgaix[[4-9]]*)
24106fc0178dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
24116fc0178dSmrg  need_lib_prefix=no
24126fc0178dSmrg  need_version=no
24136fc0178dSmrg  hardcode_into_libs=yes
24146fc0178dSmrg  if test ia64 = "$host_cpu"; then
24156fc0178dSmrg    # AIX 5 supports IA64
24166fc0178dSmrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
24176fc0178dSmrg    shlibpath_var=LD_LIBRARY_PATH
24186fc0178dSmrg  else
24196fc0178dSmrg    # With GCC up to 2.95.x, collect2 would create an import file
24206fc0178dSmrg    # for dependence libraries.  The import file would start with
24216fc0178dSmrg    # the line '#! .'.  This would cause the generated library to
24226fc0178dSmrg    # depend on '.', always an invalid library.  This was fixed in
24236fc0178dSmrg    # development snapshots of GCC prior to 3.0.
24246fc0178dSmrg    case $host_os in
24256fc0178dSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
24266fc0178dSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
24276fc0178dSmrg	   echo ' yes '
24286fc0178dSmrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
24296fc0178dSmrg	:
24306fc0178dSmrg      else
24316fc0178dSmrg	can_build_shared=no
24326fc0178dSmrg      fi
24336fc0178dSmrg      ;;
2434862f5301Smrg    esac
24356fc0178dSmrg    # Using Import Files as archive members, it is possible to support
24366fc0178dSmrg    # filename-based versioning of shared library archives on AIX. While
24376fc0178dSmrg    # this would work for both with and without runtime linking, it will
24386fc0178dSmrg    # prevent static linking of such archives. So we do filename-based
24396fc0178dSmrg    # shared library versioning with .so extension only, which is used
24406fc0178dSmrg    # when both runtime linking and shared linking is enabled.
24416fc0178dSmrg    # Unfortunately, runtime linking may impact performance, so we do
24426fc0178dSmrg    # not want this to be the default eventually. Also, we use the
24436fc0178dSmrg    # versioned .so libs for executables only if there is the -brtl
24446fc0178dSmrg    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
24456fc0178dSmrg    # To allow for filename-based versioning support, we need to create
24466fc0178dSmrg    # libNAME.so.V as an archive file, containing:
24476fc0178dSmrg    # *) an Import File, referring to the versioned filename of the
24486fc0178dSmrg    #    archive as well as the shared archive member, telling the
24496fc0178dSmrg    #    bitwidth (32 or 64) of that shared object, and providing the
24506fc0178dSmrg    #    list of exported symbols of that shared object, eventually
24516fc0178dSmrg    #    decorated with the 'weak' keyword
24526fc0178dSmrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
24536fc0178dSmrg    #    it being seen by the linker.
24546fc0178dSmrg    # At run time we better use the real file rather than another symlink,
24556fc0178dSmrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
24566fc0178dSmrg
24576fc0178dSmrg    case $with_aix_soname,$aix_use_runtimelinking in
24586fc0178dSmrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
24596fc0178dSmrg    # soname into executable. Probably we can add versioning support to
24606fc0178dSmrg    # collect2, so additional links can be useful in future.
24616fc0178dSmrg    aix,yes) # traditional libtool
24626fc0178dSmrg      dynamic_linker='AIX unversionable lib.so'
24636fc0178dSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
24646fc0178dSmrg      # instead of lib<name>.a to let people know that these are not
24656fc0178dSmrg      # typical AIX shared libraries.
24666fc0178dSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
24676fc0178dSmrg      ;;
24686fc0178dSmrg    aix,no) # traditional AIX only
24696fc0178dSmrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
24706fc0178dSmrg      # We preserve .a as extension for shared libraries through AIX4.2
24716fc0178dSmrg      # and later when we are not doing run time linking.
24726fc0178dSmrg      library_names_spec='$libname$release.a $libname.a'
24736fc0178dSmrg      soname_spec='$libname$release$shared_ext$major'
24746fc0178dSmrg      ;;
24756fc0178dSmrg    svr4,*) # full svr4 only
24766fc0178dSmrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
24776fc0178dSmrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
24786fc0178dSmrg      # We do not specify a path in Import Files, so LIBPATH fires.
24796fc0178dSmrg      shlibpath_overrides_runpath=yes
24806fc0178dSmrg      ;;
24816fc0178dSmrg    *,yes) # both, prefer svr4
24826fc0178dSmrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
24836fc0178dSmrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
24846fc0178dSmrg      # unpreferred sharedlib libNAME.a needs extra handling
24856fc0178dSmrg      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
24866fc0178dSmrg      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
24876fc0178dSmrg      # We do not specify a path in Import Files, so LIBPATH fires.
24886fc0178dSmrg      shlibpath_overrides_runpath=yes
24896fc0178dSmrg      ;;
24906fc0178dSmrg    *,no) # both, prefer aix
24916fc0178dSmrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
24926fc0178dSmrg      library_names_spec='$libname$release.a $libname.a'
24936fc0178dSmrg      soname_spec='$libname$release$shared_ext$major'
24946fc0178dSmrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
24956fc0178dSmrg      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
24966fc0178dSmrg      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
24976fc0178dSmrg      ;;
2498862f5301Smrg    esac
24996fc0178dSmrg    shlibpath_var=LIBPATH
2500862f5301Smrg  fi
2501862f5301Smrg  ;;
2502ff559fabSmrg
25036fc0178dSmrgamigaos*)
25046fc0178dSmrg  case $host_cpu in
25056fc0178dSmrg  powerpc)
25066fc0178dSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
25076fc0178dSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
25086fc0178dSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
25096fc0178dSmrg    ;;
25106fc0178dSmrg  m68k)
25116fc0178dSmrg    library_names_spec='$libname.ixlibrary $libname.a'
25126fc0178dSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
25136fc0178dSmrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $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'
25146fc0178dSmrg    ;;
25156fc0178dSmrg  esac
2516862f5301Smrg  ;;
25176fc0178dSmrg
25186fc0178dSmrgbeos*)
25196fc0178dSmrg  library_names_spec='$libname$shared_ext'
25206fc0178dSmrg  dynamic_linker="$host_os ld.so"
25216fc0178dSmrg  shlibpath_var=LIBRARY_PATH
2522862f5301Smrg  ;;
2523ff559fabSmrg
25246fc0178dSmrgbsdi[[45]]*)
25256fc0178dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
25266fc0178dSmrg  need_version=no
25276fc0178dSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
25286fc0178dSmrg  soname_spec='$libname$release$shared_ext$major'
25296fc0178dSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
25306fc0178dSmrg  shlibpath_var=LD_LIBRARY_PATH
25316fc0178dSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
25326fc0178dSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
25336fc0178dSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
25346fc0178dSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
25356fc0178dSmrg  # libtool to hard-code these into programs
25366fc0178dSmrg  ;;
2537ff559fabSmrg
25386fc0178dSmrgcygwin* | mingw* | pw32* | cegcc*)
25396fc0178dSmrg  version_type=windows
25406fc0178dSmrg  shrext_cmds=.dll
25416fc0178dSmrg  need_version=no
25426fc0178dSmrg  need_lib_prefix=no
2543ff559fabSmrg
25446fc0178dSmrg  case $GCC,$cc_basename in
25456fc0178dSmrg  yes,*)
25466fc0178dSmrg    # gcc
25476fc0178dSmrg    library_names_spec='$libname.dll.a'
25486fc0178dSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
25496fc0178dSmrg    postinstall_cmds='base_file=`basename \$file`~
25506fc0178dSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
25516fc0178dSmrg      dldir=$destdir/`dirname \$dlpath`~
25526fc0178dSmrg      test -d \$dldir || mkdir -p \$dldir~
25536fc0178dSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
25546fc0178dSmrg      chmod a+x \$dldir/$dlname~
25556fc0178dSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
25566fc0178dSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
25576fc0178dSmrg      fi'
25586fc0178dSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
25596fc0178dSmrg      dlpath=$dir/\$dldll~
25606fc0178dSmrg       $RM \$dlpath'
25616fc0178dSmrg    shlibpath_overrides_runpath=yes
2562862f5301Smrg
25636fc0178dSmrg    case $host_os in
25646fc0178dSmrg    cygwin*)
25656fc0178dSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
25666fc0178dSmrg      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
25676fc0178dSmrgm4_if([$1], [],[
25686fc0178dSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
25696fc0178dSmrg      ;;
25706fc0178dSmrg    mingw* | cegcc*)
25716fc0178dSmrg      # MinGW DLLs use traditional 'lib' prefix
25726fc0178dSmrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
25736fc0178dSmrg      ;;
25746fc0178dSmrg    pw32*)
25756fc0178dSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
25766fc0178dSmrg      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
25776fc0178dSmrg      ;;
25786fc0178dSmrg    esac
25796fc0178dSmrg    dynamic_linker='Win32 ld.exe'
25806fc0178dSmrg    ;;
2581ff559fabSmrg
25826fc0178dSmrg  *,cl*)
25836fc0178dSmrg    # Native MSVC
25846fc0178dSmrg    libname_spec='$name'
25856fc0178dSmrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
25866fc0178dSmrg    library_names_spec='$libname.dll.lib'
2587ff559fabSmrg
25886fc0178dSmrg    case $build_os in
25896fc0178dSmrg    mingw*)
25906fc0178dSmrg      sys_lib_search_path_spec=
25916fc0178dSmrg      lt_save_ifs=$IFS
25926fc0178dSmrg      IFS=';'
25936fc0178dSmrg      for lt_path in $LIB
25946fc0178dSmrg      do
25956fc0178dSmrg        IFS=$lt_save_ifs
25966fc0178dSmrg        # Let DOS variable expansion print the short 8.3 style file name.
25976fc0178dSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
25986fc0178dSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
25996fc0178dSmrg      done
26006fc0178dSmrg      IFS=$lt_save_ifs
26016fc0178dSmrg      # Convert to MSYS style.
26026fc0178dSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
26036fc0178dSmrg      ;;
26046fc0178dSmrg    cygwin*)
26056fc0178dSmrg      # Convert to unix form, then to dos form, then back to unix form
26066fc0178dSmrg      # but this time dos style (no spaces!) so that the unix form looks
26076fc0178dSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
26086fc0178dSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
26096fc0178dSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
26106fc0178dSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
26116fc0178dSmrg      ;;
26126fc0178dSmrg    *)
26136fc0178dSmrg      sys_lib_search_path_spec=$LIB
26146fc0178dSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
26156fc0178dSmrg        # It is most probably a Windows format PATH.
26166fc0178dSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
26176fc0178dSmrg      else
26186fc0178dSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
26196fc0178dSmrg      fi
26206fc0178dSmrg      # FIXME: find the short name or the path components, as spaces are
26216fc0178dSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
26226fc0178dSmrg      ;;
26236fc0178dSmrg    esac
2624ff559fabSmrg
26256fc0178dSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
26266fc0178dSmrg    postinstall_cmds='base_file=`basename \$file`~
26276fc0178dSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
26286fc0178dSmrg      dldir=$destdir/`dirname \$dlpath`~
26296fc0178dSmrg      test -d \$dldir || mkdir -p \$dldir~
26306fc0178dSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
26316fc0178dSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
26326fc0178dSmrg      dlpath=$dir/\$dldll~
26336fc0178dSmrg       $RM \$dlpath'
26346fc0178dSmrg    shlibpath_overrides_runpath=yes
26356fc0178dSmrg    dynamic_linker='Win32 link.exe'
26366fc0178dSmrg    ;;
2637ff559fabSmrg
26386fc0178dSmrg  *)
26396fc0178dSmrg    # Assume MSVC wrapper
26406fc0178dSmrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
26416fc0178dSmrg    dynamic_linker='Win32 ld.exe'
26426fc0178dSmrg    ;;
26436fc0178dSmrg  esac
26446fc0178dSmrg  # FIXME: first we should search . and the directory the executable is in
26456fc0178dSmrg  shlibpath_var=PATH
26466fc0178dSmrg  ;;
2647ff559fabSmrg
26486fc0178dSmrgdarwin* | rhapsody*)
26496fc0178dSmrg  dynamic_linker="$host_os dyld"
26506fc0178dSmrg  version_type=darwin
26516fc0178dSmrg  need_lib_prefix=no
26526fc0178dSmrg  need_version=no
26536fc0178dSmrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
26546fc0178dSmrg  soname_spec='$libname$release$major$shared_ext'
26556fc0178dSmrg  shlibpath_overrides_runpath=yes
26566fc0178dSmrg  shlibpath_var=DYLD_LIBRARY_PATH
26576fc0178dSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
26586fc0178dSmrgm4_if([$1], [],[
26596fc0178dSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
26606fc0178dSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
26616fc0178dSmrg  ;;
2662ff559fabSmrg
26636fc0178dSmrgdgux*)
26646fc0178dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
26656fc0178dSmrg  need_lib_prefix=no
26666fc0178dSmrg  need_version=no
26676fc0178dSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
26686fc0178dSmrg  soname_spec='$libname$release$shared_ext$major'
26696fc0178dSmrg  shlibpath_var=LD_LIBRARY_PATH
26706fc0178dSmrg  ;;
2671ff559fabSmrg
26726fc0178dSmrgfreebsd* | dragonfly*)
26736fc0178dSmrg  # DragonFly does not have aout.  When/if they implement a new
26746fc0178dSmrg  # versioning mechanism, adjust this.
26756fc0178dSmrg  if test -x /usr/bin/objformat; then
26766fc0178dSmrg    objformat=`/usr/bin/objformat`
26776fc0178dSmrg  else
26786fc0178dSmrg    case $host_os in
26796fc0178dSmrg    freebsd[[23]].*) objformat=aout ;;
26806fc0178dSmrg    *) objformat=elf ;;
26816fc0178dSmrg    esac
26826fc0178dSmrg  fi
26836fc0178dSmrg  version_type=freebsd-$objformat
26846fc0178dSmrg  case $version_type in
26856fc0178dSmrg    freebsd-elf*)
26866fc0178dSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
26876fc0178dSmrg      soname_spec='$libname$release$shared_ext$major'
26886fc0178dSmrg      need_version=no
26896fc0178dSmrg      need_lib_prefix=no
26906fc0178dSmrg      ;;
26916fc0178dSmrg    freebsd-*)
26926fc0178dSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
26936fc0178dSmrg      need_version=yes
26946fc0178dSmrg      ;;
26956fc0178dSmrg  esac
26966fc0178dSmrg  shlibpath_var=LD_LIBRARY_PATH
2697862f5301Smrg  case $host_os in
26986fc0178dSmrg  freebsd2.*)
26996fc0178dSmrg    shlibpath_overrides_runpath=yes
2700862f5301Smrg    ;;
27016fc0178dSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
27026fc0178dSmrg    shlibpath_overrides_runpath=yes
27036fc0178dSmrg    hardcode_into_libs=yes
27046fc0178dSmrg    ;;
27056fc0178dSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
27066fc0178dSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
27076fc0178dSmrg    shlibpath_overrides_runpath=no
27086fc0178dSmrg    hardcode_into_libs=yes
27096fc0178dSmrg    ;;
27106fc0178dSmrg  *) # from 4.6 on, and DragonFly
27116fc0178dSmrg    shlibpath_overrides_runpath=yes
27126fc0178dSmrg    hardcode_into_libs=yes
2713862f5301Smrg    ;;
2714862f5301Smrg  esac
27156fc0178dSmrg  ;;
2716ff559fabSmrg
27176fc0178dSmrghaiku*)
27186fc0178dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
27196fc0178dSmrg  need_lib_prefix=no
27206fc0178dSmrg  need_version=no
27216fc0178dSmrg  dynamic_linker="$host_os runtime_loader"
27226fc0178dSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27236fc0178dSmrg  soname_spec='$libname$release$shared_ext$major'
27246fc0178dSmrg  shlibpath_var=LIBRARY_PATH
27256fc0178dSmrg  shlibpath_overrides_runpath=no
27266fc0178dSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
27276fc0178dSmrg  hardcode_into_libs=yes
27286fc0178dSmrg  ;;
27296fc0178dSmrg
27306fc0178dSmrghpux9* | hpux10* | hpux11*)
27316fc0178dSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
27326fc0178dSmrg  # link against other versions.
27336fc0178dSmrg  version_type=sunos
27346fc0178dSmrg  need_lib_prefix=no
27356fc0178dSmrg  need_version=no
27366fc0178dSmrg  case $host_cpu in
27376fc0178dSmrg  ia64*)
27386fc0178dSmrg    shrext_cmds='.so'
27396fc0178dSmrg    hardcode_into_libs=yes
27406fc0178dSmrg    dynamic_linker="$host_os dld.so"
27416fc0178dSmrg    shlibpath_var=LD_LIBRARY_PATH
27426fc0178dSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
27436fc0178dSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27446fc0178dSmrg    soname_spec='$libname$release$shared_ext$major'
27456fc0178dSmrg    if test 32 = "$HPUX_IA64_MODE"; then
27466fc0178dSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
27476fc0178dSmrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
27486fc0178dSmrg    else
27496fc0178dSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
27506fc0178dSmrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
27516fc0178dSmrg    fi
27526fc0178dSmrg    ;;
27536fc0178dSmrg  hppa*64*)
27546fc0178dSmrg    shrext_cmds='.sl'
27556fc0178dSmrg    hardcode_into_libs=yes
27566fc0178dSmrg    dynamic_linker="$host_os dld.sl"
27576fc0178dSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
27586fc0178dSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
27596fc0178dSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27606fc0178dSmrg    soname_spec='$libname$release$shared_ext$major'
27616fc0178dSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
27626fc0178dSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
27636fc0178dSmrg    ;;
2764862f5301Smrg  *)
27656fc0178dSmrg    shrext_cmds='.sl'
27666fc0178dSmrg    dynamic_linker="$host_os dld.sl"
27676fc0178dSmrg    shlibpath_var=SHLIB_PATH
27686fc0178dSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
27696fc0178dSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27706fc0178dSmrg    soname_spec='$libname$release$shared_ext$major'
27716fc0178dSmrg    ;;
27726fc0178dSmrg  esac
27736fc0178dSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
27746fc0178dSmrg  postinstall_cmds='chmod 555 $lib'
27756fc0178dSmrg  # or fails outright, so override atomically:
27766fc0178dSmrg  install_override_mode=555
27776fc0178dSmrg  ;;
2778ff559fabSmrg
27796fc0178dSmrginterix[[3-9]]*)
27806fc0178dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
27816fc0178dSmrg  need_lib_prefix=no
27826fc0178dSmrg  need_version=no
27836fc0178dSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27846fc0178dSmrg  soname_spec='$libname$release$shared_ext$major'
27856fc0178dSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
27866fc0178dSmrg  shlibpath_var=LD_LIBRARY_PATH
27876fc0178dSmrg  shlibpath_overrides_runpath=no
27886fc0178dSmrg  hardcode_into_libs=yes
27896fc0178dSmrg  ;;
2790ff559fabSmrg
27916fc0178dSmrgirix5* | irix6* | nonstopux*)
27926fc0178dSmrg  case $host_os in
27936fc0178dSmrg    nonstopux*) version_type=nonstopux ;;
27946fc0178dSmrg    *)
27956fc0178dSmrg	if test yes = "$lt_cv_prog_gnu_ld"; then
27966fc0178dSmrg		version_type=linux # correct to gnu/linux during the next big refactor
27976fc0178dSmrg	else
27986fc0178dSmrg		version_type=irix
27996fc0178dSmrg	fi ;;
28006fc0178dSmrg  esac
28016fc0178dSmrg  need_lib_prefix=no
28026fc0178dSmrg  need_version=no
28036fc0178dSmrg  soname_spec='$libname$release$shared_ext$major'
28046fc0178dSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
28056fc0178dSmrg  case $host_os in
28066fc0178dSmrg  irix5* | nonstopux*)
28076fc0178dSmrg    libsuff= shlibsuff=
28086fc0178dSmrg    ;;
28096fc0178dSmrg  *)
28106fc0178dSmrg    case $LD in # libtool.m4 will add one of these switches to LD
28116fc0178dSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
28126fc0178dSmrg      libsuff= shlibsuff= libmagic=32-bit;;
28136fc0178dSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
28146fc0178dSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
28156fc0178dSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
28166fc0178dSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
28176fc0178dSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
28186fc0178dSmrg    esac
28196fc0178dSmrg    ;;
28206fc0178dSmrg  esac
28216fc0178dSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
28226fc0178dSmrg  shlibpath_overrides_runpath=no
28236fc0178dSmrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
28246fc0178dSmrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
28256fc0178dSmrg  hardcode_into_libs=yes
28266fc0178dSmrg  ;;
2827ff559fabSmrg
28286fc0178dSmrg# No shared lib support for Linux oldld, aout, or coff.
28296fc0178dSmrglinux*oldld* | linux*aout* | linux*coff*)
28306fc0178dSmrg  dynamic_linker=no
28316fc0178dSmrg  ;;
2832ff559fabSmrg
28336fc0178dSmrglinux*android*)
28346fc0178dSmrg  version_type=none # Android doesn't support versioned libraries.
28356fc0178dSmrg  need_lib_prefix=no
28366fc0178dSmrg  need_version=no
28376fc0178dSmrg  library_names_spec='$libname$release$shared_ext'
28386fc0178dSmrg  soname_spec='$libname$release$shared_ext'
28396fc0178dSmrg  finish_cmds=
28406fc0178dSmrg  shlibpath_var=LD_LIBRARY_PATH
28416fc0178dSmrg  shlibpath_overrides_runpath=yes
2842ff559fabSmrg
28436fc0178dSmrg  # This implies no fast_install, which is unacceptable.
28446fc0178dSmrg  # Some rework will be needed to allow for fast_install
28456fc0178dSmrg  # before this can be enabled.
28466fc0178dSmrg  hardcode_into_libs=yes
2847ff559fabSmrg
28486fc0178dSmrg  dynamic_linker='Android linker'
28496fc0178dSmrg  # Don't embed -rpath directories since the linker doesn't support them.
28506fc0178dSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
28516fc0178dSmrg  ;;
2852ff559fabSmrg
28536fc0178dSmrg# This must be glibc/ELF.
28546fc0178dSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
28556fc0178dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
28566fc0178dSmrg  need_lib_prefix=no
28576fc0178dSmrg  need_version=no
28586fc0178dSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
28596fc0178dSmrg  soname_spec='$libname$release$shared_ext$major'
28606fc0178dSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
28616fc0178dSmrg  shlibpath_var=LD_LIBRARY_PATH
28626fc0178dSmrg  shlibpath_overrides_runpath=no
2863ff559fabSmrg
28646fc0178dSmrg  # Some binutils ld are patched to set DT_RUNPATH
28656fc0178dSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
28666fc0178dSmrg    [lt_cv_shlibpath_overrides_runpath=no
28676fc0178dSmrg    save_LDFLAGS=$LDFLAGS
28686fc0178dSmrg    save_libdir=$libdir
28696fc0178dSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
28706fc0178dSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
28716fc0178dSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
28726fc0178dSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
28736fc0178dSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
28746fc0178dSmrg    LDFLAGS=$save_LDFLAGS
28756fc0178dSmrg    libdir=$save_libdir
28766fc0178dSmrg    ])
28776fc0178dSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2878ff559fabSmrg
28796fc0178dSmrg  # This implies no fast_install, which is unacceptable.
28806fc0178dSmrg  # Some rework will be needed to allow for fast_install
28816fc0178dSmrg  # before this can be enabled.
28826fc0178dSmrg  hardcode_into_libs=yes
2883ff559fabSmrg
28846fc0178dSmrg  # Ideally, we could use ldconfig to report *all* directores which are
28856fc0178dSmrg  # searched for libraries, however this is still not possible.  Aside from not
28866fc0178dSmrg  # being certain /sbin/ldconfig is available, command
28876fc0178dSmrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
28886fc0178dSmrg  # even though it is searched at run-time.  Try to do the best guess by
28896fc0178dSmrg  # appending ld.so.conf contents (and includes) to the search path.
28906fc0178dSmrg  if test -f /etc/ld.so.conf; then
28916fc0178dSmrg    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
28926fc0178dSmrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
28936fc0178dSmrg  fi
2894ff559fabSmrg
28956fc0178dSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
28966fc0178dSmrg  # powerpc, because MkLinux only supported shared libraries with the
28976fc0178dSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
28986fc0178dSmrg  # most powerpc-linux boxes support dynamic linking these days and
28996fc0178dSmrg  # people can always --disable-shared, the test was removed, and we
29006fc0178dSmrg  # assume the GNU/Linux dynamic linker is in use.
29016fc0178dSmrg  dynamic_linker='GNU/Linux ld.so'
29026fc0178dSmrg  ;;
2903ff559fabSmrg
29046fc0178dSmrgnetbsd*)
29056fc0178dSmrg  version_type=sunos
29066fc0178dSmrg  need_lib_prefix=no
29076fc0178dSmrg  need_version=no
29086fc0178dSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
29096fc0178dSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
29106fc0178dSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
29116fc0178dSmrg    dynamic_linker='NetBSD (a.out) ld.so'
29126fc0178dSmrg  else
29136fc0178dSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
29146fc0178dSmrg    soname_spec='$libname$release$shared_ext$major'
29156fc0178dSmrg    dynamic_linker='NetBSD ld.elf_so'
29166fc0178dSmrg  fi
29176fc0178dSmrg  shlibpath_var=LD_LIBRARY_PATH
29186fc0178dSmrg  shlibpath_overrides_runpath=yes
29196fc0178dSmrg  hardcode_into_libs=yes
29206fc0178dSmrg  ;;
292144dda7b2Smrg
29226fc0178dSmrgnewsos6)
29236fc0178dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
29246fc0178dSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
29256fc0178dSmrg  shlibpath_var=LD_LIBRARY_PATH
29266fc0178dSmrg  shlibpath_overrides_runpath=yes
29276fc0178dSmrg  ;;
292844dda7b2Smrg
29296fc0178dSmrg*nto* | *qnx*)
29306fc0178dSmrg  version_type=qnx
29316fc0178dSmrg  need_lib_prefix=no
29326fc0178dSmrg  need_version=no
29336fc0178dSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
29346fc0178dSmrg  soname_spec='$libname$release$shared_ext$major'
29356fc0178dSmrg  shlibpath_var=LD_LIBRARY_PATH
29366fc0178dSmrg  shlibpath_overrides_runpath=no
29376fc0178dSmrg  hardcode_into_libs=yes
29386fc0178dSmrg  dynamic_linker='ldqnx.so'
29396fc0178dSmrg  ;;
294044dda7b2Smrg
29416fc0178dSmrgopenbsd* | bitrig*)
29426fc0178dSmrg  version_type=sunos
29436fc0178dSmrg  sys_lib_dlsearch_path_spec=/usr/lib
29446fc0178dSmrg  need_lib_prefix=no
29456fc0178dSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
29466fc0178dSmrg    need_version=no
29476fc0178dSmrg  else
29486fc0178dSmrg    need_version=yes
29496fc0178dSmrg  fi
29506fc0178dSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
29516fc0178dSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
29526fc0178dSmrg  shlibpath_var=LD_LIBRARY_PATH
29536fc0178dSmrg  shlibpath_overrides_runpath=yes
29546fc0178dSmrg  ;;
295544dda7b2Smrg
29566fc0178dSmrgos2*)
29576fc0178dSmrg  libname_spec='$name'
29586fc0178dSmrg  version_type=windows
29596fc0178dSmrg  shrext_cmds=.dll
29606fc0178dSmrg  need_version=no
29616fc0178dSmrg  need_lib_prefix=no
29626fc0178dSmrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
29636fc0178dSmrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
29646fc0178dSmrg    v=$($ECHO $release$versuffix | tr -d .-);
29656fc0178dSmrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
29666fc0178dSmrg    $ECHO $n$v`$shared_ext'
29676fc0178dSmrg  library_names_spec='${libname}_dll.$libext'
29686fc0178dSmrg  dynamic_linker='OS/2 ld.exe'
29696fc0178dSmrg  shlibpath_var=BEGINLIBPATH
29706fc0178dSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
29716fc0178dSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
29726fc0178dSmrg  postinstall_cmds='base_file=`basename \$file`~
29736fc0178dSmrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
29746fc0178dSmrg    dldir=$destdir/`dirname \$dlpath`~
29756fc0178dSmrg    test -d \$dldir || mkdir -p \$dldir~
29766fc0178dSmrg    $install_prog $dir/$dlname \$dldir/$dlname~
29776fc0178dSmrg    chmod a+x \$dldir/$dlname~
29786fc0178dSmrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
29796fc0178dSmrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
29806fc0178dSmrg    fi'
29816fc0178dSmrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
29826fc0178dSmrg    dlpath=$dir/\$dldll~
29836fc0178dSmrg    $RM \$dlpath'
29846fc0178dSmrg  ;;
298544dda7b2Smrg
29866fc0178dSmrgosf3* | osf4* | osf5*)
29876fc0178dSmrg  version_type=osf
29886fc0178dSmrg  need_lib_prefix=no
29896fc0178dSmrg  need_version=no
29906fc0178dSmrg  soname_spec='$libname$release$shared_ext$major'
29916fc0178dSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
29926fc0178dSmrg  shlibpath_var=LD_LIBRARY_PATH
29936fc0178dSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
29946fc0178dSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
29956fc0178dSmrg  ;;
299644dda7b2Smrg
29976fc0178dSmrgrdos*)
29986fc0178dSmrg  dynamic_linker=no
29996fc0178dSmrg  ;;
3000fc544a13Smrg
30016fc0178dSmrgsolaris*)
30026fc0178dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
30036fc0178dSmrg  need_lib_prefix=no
30046fc0178dSmrg  need_version=no
30056fc0178dSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
30066fc0178dSmrg  soname_spec='$libname$release$shared_ext$major'
30076fc0178dSmrg  shlibpath_var=LD_LIBRARY_PATH
30086fc0178dSmrg  shlibpath_overrides_runpath=yes
30096fc0178dSmrg  hardcode_into_libs=yes
30106fc0178dSmrg  # ldd complains unless libraries are executable
30116fc0178dSmrg  postinstall_cmds='chmod +x $lib'
30126fc0178dSmrg  ;;
301344dda7b2Smrg
30146fc0178dSmrgsunos4*)
30156fc0178dSmrg  version_type=sunos
30166fc0178dSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
30176fc0178dSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
30186fc0178dSmrg  shlibpath_var=LD_LIBRARY_PATH
30196fc0178dSmrg  shlibpath_overrides_runpath=yes
30206fc0178dSmrg  if test yes = "$with_gnu_ld"; then
30216fc0178dSmrg    need_lib_prefix=no
30226fc0178dSmrg  fi
30236fc0178dSmrg  need_version=yes
30246fc0178dSmrg  ;;
302544dda7b2Smrg
30266fc0178dSmrgsysv4 | sysv4.3*)
30276fc0178dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
30286fc0178dSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
30296fc0178dSmrg  soname_spec='$libname$release$shared_ext$major'
30306fc0178dSmrg  shlibpath_var=LD_LIBRARY_PATH
30316fc0178dSmrg  case $host_vendor in
30326fc0178dSmrg    sni)
30336fc0178dSmrg      shlibpath_overrides_runpath=no
30346fc0178dSmrg      need_lib_prefix=no
30356fc0178dSmrg      runpath_var=LD_RUN_PATH
30366fc0178dSmrg      ;;
30376fc0178dSmrg    siemens)
30386fc0178dSmrg      need_lib_prefix=no
30396fc0178dSmrg      ;;
30406fc0178dSmrg    motorola)
30416fc0178dSmrg      need_lib_prefix=no
30426fc0178dSmrg      need_version=no
30436fc0178dSmrg      shlibpath_overrides_runpath=no
30446fc0178dSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
30456fc0178dSmrg      ;;
30466fc0178dSmrg  esac
30476fc0178dSmrg  ;;
3048862f5301Smrg
30496fc0178dSmrgsysv4*MP*)
30506fc0178dSmrg  if test -d /usr/nec; then
30516fc0178dSmrg    version_type=linux # correct to gnu/linux during the next big refactor
30526fc0178dSmrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
30536fc0178dSmrg    soname_spec='$libname$shared_ext.$major'
30546fc0178dSmrg    shlibpath_var=LD_LIBRARY_PATH
30556fc0178dSmrg  fi
30566fc0178dSmrg  ;;
305744dda7b2Smrg
30586fc0178dSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
30596fc0178dSmrg  version_type=sco
30606fc0178dSmrg  need_lib_prefix=no
30616fc0178dSmrg  need_version=no
30626fc0178dSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
30636fc0178dSmrg  soname_spec='$libname$release$shared_ext$major'
30646fc0178dSmrg  shlibpath_var=LD_LIBRARY_PATH
30656fc0178dSmrg  shlibpath_overrides_runpath=yes
30666fc0178dSmrg  hardcode_into_libs=yes
30676fc0178dSmrg  if test yes = "$with_gnu_ld"; then
30686fc0178dSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3069862f5301Smrg  else
30706fc0178dSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
30716fc0178dSmrg    case $host_os in
30726fc0178dSmrg      sco3.2v5*)
30736fc0178dSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
30746fc0178dSmrg	;;
3075862f5301Smrg    esac
3076862f5301Smrg  fi
30776fc0178dSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
30786fc0178dSmrg  ;;
307944dda7b2Smrg
30806fc0178dSmrgtpf*)
30816fc0178dSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
30826fc0178dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
30836fc0178dSmrg  need_lib_prefix=no
30846fc0178dSmrg  need_version=no
30856fc0178dSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
30866fc0178dSmrg  shlibpath_var=LD_LIBRARY_PATH
30876fc0178dSmrg  shlibpath_overrides_runpath=no
30886fc0178dSmrg  hardcode_into_libs=yes
30896fc0178dSmrg  ;;
309044dda7b2Smrg
30916fc0178dSmrguts4*)
30926fc0178dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
30936fc0178dSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
30946fc0178dSmrg  soname_spec='$libname$release$shared_ext$major'
30956fc0178dSmrg  shlibpath_var=LD_LIBRARY_PATH
30966fc0178dSmrg  ;;
309744dda7b2Smrg
30986fc0178dSmrg*)
30996fc0178dSmrg  dynamic_linker=no
31006fc0178dSmrg  ;;
31016fc0178dSmrgesac
31026fc0178dSmrgAC_MSG_RESULT([$dynamic_linker])
31036fc0178dSmrgtest no = "$dynamic_linker" && can_build_shared=no
310444dda7b2Smrg
31056fc0178dSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
31066fc0178dSmrgif test yes = "$GCC"; then
31076fc0178dSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
31086fc0178dSmrgfi
310944dda7b2Smrg
31106fc0178dSmrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
31116fc0178dSmrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
31126fc0178dSmrgfi
311344dda7b2Smrg
31146fc0178dSmrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
31156fc0178dSmrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
31166fc0178dSmrgfi
311744dda7b2Smrg
31186fc0178dSmrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
31196fc0178dSmrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
312044dda7b2Smrg
31216fc0178dSmrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
31226fc0178dSmrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
312344dda7b2Smrg
31246fc0178dSmrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
31256fc0178dSmrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
312644dda7b2Smrg
31276fc0178dSmrg_LT_DECL([], [variables_saved_for_relink], [1],
31286fc0178dSmrg    [Variables whose values should be saved in libtool wrapper scripts and
31296fc0178dSmrg    restored at link time])
31306fc0178dSmrg_LT_DECL([], [need_lib_prefix], [0],
31316fc0178dSmrg    [Do we need the "lib" prefix for modules?])
31326fc0178dSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
31336fc0178dSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
31346fc0178dSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
31356fc0178dSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
31366fc0178dSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
31376fc0178dSmrg    [Is shlibpath searched before the hard-coded library search path?])
31386fc0178dSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
31396fc0178dSmrg_LT_DECL([], [library_names_spec], [1],
31406fc0178dSmrg    [[List of archive names.  First name is the real one, the rest are links.
31416fc0178dSmrg    The last name is the one that the linker finds with -lNAME]])
31426fc0178dSmrg_LT_DECL([], [soname_spec], [1],
31436fc0178dSmrg    [[The coded name of the library, if different from the real name]])
31446fc0178dSmrg_LT_DECL([], [install_override_mode], [1],
31456fc0178dSmrg    [Permission mode override for installation of shared libraries])
31466fc0178dSmrg_LT_DECL([], [postinstall_cmds], [2],
31476fc0178dSmrg    [Command to use after installation of a shared archive])
31486fc0178dSmrg_LT_DECL([], [postuninstall_cmds], [2],
31496fc0178dSmrg    [Command to use after uninstallation of a shared archive])
31506fc0178dSmrg_LT_DECL([], [finish_cmds], [2],
31516fc0178dSmrg    [Commands used to finish a libtool library installation in a directory])
31526fc0178dSmrg_LT_DECL([], [finish_eval], [1],
31536fc0178dSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
31546fc0178dSmrg    not shown]])
31556fc0178dSmrg_LT_DECL([], [hardcode_into_libs], [0],
31566fc0178dSmrg    [Whether we should hardcode library paths into libraries])
31576fc0178dSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
31586fc0178dSmrg    [Compile-time system search path for libraries])
31596fc0178dSmrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
31606fc0178dSmrg    [Detected run-time system search path for libraries])
31616fc0178dSmrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
31626fc0178dSmrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
31636fc0178dSmrg])# _LT_SYS_DYNAMIC_LINKER
316444dda7b2Smrg
316544dda7b2Smrg
31666fc0178dSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
31676fc0178dSmrg# --------------------------
31686fc0178dSmrg# find a file program that can recognize shared library
31696fc0178dSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
31706fc0178dSmrg[m4_require([_LT_DECL_EGREP])dnl
31716fc0178dSmrgAC_MSG_CHECKING([for $1])
31726fc0178dSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
31736fc0178dSmrg[case $MAGIC_CMD in
31746fc0178dSmrg[[\\/*] |  ?:[\\/]*])
31756fc0178dSmrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
31766fc0178dSmrg  ;;
31776fc0178dSmrg*)
31786fc0178dSmrg  lt_save_MAGIC_CMD=$MAGIC_CMD
31796fc0178dSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
31806fc0178dSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
31816fc0178dSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
31826fc0178dSmrgdnl not every word.  This closes a longstanding sh security hole.
31836fc0178dSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
31846fc0178dSmrg  for ac_dir in $ac_dummy; do
31856fc0178dSmrg    IFS=$lt_save_ifs
31866fc0178dSmrg    test -z "$ac_dir" && ac_dir=.
31876fc0178dSmrg    if test -f "$ac_dir/$1"; then
31886fc0178dSmrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
31896fc0178dSmrg      if test -n "$file_magic_test_file"; then
31906fc0178dSmrg	case $deplibs_check_method in
31916fc0178dSmrg	"file_magic "*)
31926fc0178dSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
31936fc0178dSmrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
31946fc0178dSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
31956fc0178dSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
31966fc0178dSmrg	    :
31976fc0178dSmrg	  else
31986fc0178dSmrg	    cat <<_LT_EOF 1>&2
3199862f5301Smrg
32006fc0178dSmrg*** Warning: the command libtool uses to detect shared libraries,
32016fc0178dSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
32026fc0178dSmrg*** The result is that libtool may fail to recognize shared libraries
32036fc0178dSmrg*** as such.  This will affect the creation of libtool libraries that
32046fc0178dSmrg*** depend on shared libraries, but programs linked with such libtool
32056fc0178dSmrg*** libraries will work regardless of this problem.  Nevertheless, you
32066fc0178dSmrg*** may want to report the problem to your system manager and/or to
32076fc0178dSmrg*** bug-libtool@gnu.org
3208862f5301Smrg
32096fc0178dSmrg_LT_EOF
32106fc0178dSmrg	  fi ;;
32116fc0178dSmrg	esac
32126fc0178dSmrg      fi
32136fc0178dSmrg      break
32146fc0178dSmrg    fi
32156fc0178dSmrg  done
32166fc0178dSmrg  IFS=$lt_save_ifs
32176fc0178dSmrg  MAGIC_CMD=$lt_save_MAGIC_CMD
32186fc0178dSmrg  ;;
32196fc0178dSmrgesac])
32206fc0178dSmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
32216fc0178dSmrgif test -n "$MAGIC_CMD"; then
32226fc0178dSmrg  AC_MSG_RESULT($MAGIC_CMD)
32236fc0178dSmrgelse
32246fc0178dSmrg  AC_MSG_RESULT(no)
322544dda7b2Smrgfi
32266fc0178dSmrg_LT_DECL([], [MAGIC_CMD], [0],
32276fc0178dSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
32286fc0178dSmrg])# _LT_PATH_TOOL_PREFIX
322944dda7b2Smrg
3230862f5301Smrg# Old name:
32316fc0178dSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3232862f5301Smrgdnl aclocal-1.4 backwards compatibility:
32336fc0178dSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
323444dda7b2Smrg
323544dda7b2Smrg
32366fc0178dSmrg# _LT_PATH_MAGIC
32376fc0178dSmrg# --------------
32386fc0178dSmrg# find a file program that can recognize a shared library
32396fc0178dSmrgm4_defun([_LT_PATH_MAGIC],
32406fc0178dSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
32416fc0178dSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
32426fc0178dSmrg  if test -n "$ac_tool_prefix"; then
32436fc0178dSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
32446fc0178dSmrg  else
32456fc0178dSmrg    MAGIC_CMD=:
32466fc0178dSmrg  fi
32476fc0178dSmrgfi
32486fc0178dSmrg])# _LT_PATH_MAGIC
3249862f5301Smrg
325044dda7b2Smrg
32516fc0178dSmrg# LT_PATH_LD
32526fc0178dSmrg# ----------
32536fc0178dSmrg# find the pathname to the GNU or non-GNU linker
32546fc0178dSmrgAC_DEFUN([LT_PATH_LD],
32556fc0178dSmrg[AC_REQUIRE([AC_PROG_CC])dnl
32566fc0178dSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
32576fc0178dSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
32586fc0178dSmrgm4_require([_LT_DECL_SED])dnl
32596fc0178dSmrgm4_require([_LT_DECL_EGREP])dnl
32606fc0178dSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
326144dda7b2Smrg
32626fc0178dSmrgAC_ARG_WITH([gnu-ld],
32636fc0178dSmrg    [AS_HELP_STRING([--with-gnu-ld],
32646fc0178dSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
32656fc0178dSmrg    [test no = "$withval" || with_gnu_ld=yes],
32666fc0178dSmrg    [with_gnu_ld=no])dnl
326744dda7b2Smrg
32686fc0178dSmrgac_prog=ld
32696fc0178dSmrgif test yes = "$GCC"; then
32706fc0178dSmrg  # Check if gcc -print-prog-name=ld gives a path.
32716fc0178dSmrg  AC_MSG_CHECKING([for ld used by $CC])
32726fc0178dSmrg  case $host in
32736fc0178dSmrg  *-*-mingw*)
32746fc0178dSmrg    # gcc leaves a trailing carriage return, which upsets mingw
32756fc0178dSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
32766fc0178dSmrg  *)
32776fc0178dSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
32786fc0178dSmrg  esac
32796fc0178dSmrg  case $ac_prog in
32806fc0178dSmrg    # Accept absolute paths.
32816fc0178dSmrg    [[\\/]]* | ?:[[\\/]]*)
32826fc0178dSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
32836fc0178dSmrg      # Canonicalize the pathname of ld
32846fc0178dSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
32856fc0178dSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
32866fc0178dSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
32876fc0178dSmrg      done
32886fc0178dSmrg      test -z "$LD" && LD=$ac_prog
32896fc0178dSmrg      ;;
32906fc0178dSmrg  "")
32916fc0178dSmrg    # If it fails, then pretend we aren't using GCC.
32926fc0178dSmrg    ac_prog=ld
32936fc0178dSmrg    ;;
32946fc0178dSmrg  *)
32956fc0178dSmrg    # If it is relative, then search for the first ld in PATH.
32966fc0178dSmrg    with_gnu_ld=unknown
32976fc0178dSmrg    ;;
32986fc0178dSmrg  esac
32996fc0178dSmrgelif test yes = "$with_gnu_ld"; then
33006fc0178dSmrg  AC_MSG_CHECKING([for GNU ld])
330144dda7b2Smrgelse
33026fc0178dSmrg  AC_MSG_CHECKING([for non-GNU ld])
330344dda7b2Smrgfi
33046fc0178dSmrgAC_CACHE_VAL(lt_cv_path_LD,
33056fc0178dSmrg[if test -z "$LD"; then
33066fc0178dSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
33076fc0178dSmrg  for ac_dir in $PATH; do
33086fc0178dSmrg    IFS=$lt_save_ifs
33096fc0178dSmrg    test -z "$ac_dir" && ac_dir=.
33106fc0178dSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
33116fc0178dSmrg      lt_cv_path_LD=$ac_dir/$ac_prog
33126fc0178dSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
33136fc0178dSmrg      # but apparently some variants of GNU ld only accept -v.
33146fc0178dSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
33156fc0178dSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
33166fc0178dSmrg      *GNU* | *'with BFD'*)
33176fc0178dSmrg	test no != "$with_gnu_ld" && break
33186fc0178dSmrg	;;
33196fc0178dSmrg      *)
33206fc0178dSmrg	test yes != "$with_gnu_ld" && break
33216fc0178dSmrg	;;
33226fc0178dSmrg      esac
33236fc0178dSmrg    fi
33246fc0178dSmrg  done
33256fc0178dSmrg  IFS=$lt_save_ifs
3326862f5301Smrgelse
33276fc0178dSmrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
33286fc0178dSmrgfi])
33296fc0178dSmrgLD=$lt_cv_path_LD
33306fc0178dSmrgif test -n "$LD"; then
33316fc0178dSmrg  AC_MSG_RESULT($LD)
33326fc0178dSmrgelse
33336fc0178dSmrg  AC_MSG_RESULT(no)
3334862f5301Smrgfi
33356fc0178dSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
33366fc0178dSmrg_LT_PATH_LD_GNU
33376fc0178dSmrgAC_SUBST([LD])
333844dda7b2Smrg
33396fc0178dSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
33406fc0178dSmrg])# LT_PATH_LD
334144dda7b2Smrg
33426fc0178dSmrg# Old names:
33436fc0178dSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
33446fc0178dSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
33456fc0178dSmrgdnl aclocal-1.4 backwards compatibility:
33466fc0178dSmrgdnl AC_DEFUN([AM_PROG_LD], [])
33476fc0178dSmrgdnl AC_DEFUN([AC_PROG_LD], [])
334844dda7b2Smrg
334944dda7b2Smrg
33506fc0178dSmrg# _LT_PATH_LD_GNU
33516fc0178dSmrg#- --------------
33526fc0178dSmrgm4_defun([_LT_PATH_LD_GNU],
33536fc0178dSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
33546fc0178dSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
33556fc0178dSmrgcase `$LD -v 2>&1 </dev/null` in
33566fc0178dSmrg*GNU* | *'with BFD'*)
33576fc0178dSmrg  lt_cv_prog_gnu_ld=yes
33586fc0178dSmrg  ;;
33596fc0178dSmrg*)
33606fc0178dSmrg  lt_cv_prog_gnu_ld=no
33616fc0178dSmrg  ;;
33626fc0178dSmrgesac])
33636fc0178dSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
33646fc0178dSmrg])# _LT_PATH_LD_GNU
336544dda7b2Smrg
336644dda7b2Smrg
33676fc0178dSmrg# _LT_CMD_RELOAD
33686fc0178dSmrg# --------------
33696fc0178dSmrg# find reload flag for linker
33706fc0178dSmrg#   -- PORTME Some linkers may need a different reload flag.
33716fc0178dSmrgm4_defun([_LT_CMD_RELOAD],
33726fc0178dSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
33736fc0178dSmrg  lt_cv_ld_reload_flag,
33746fc0178dSmrg  [lt_cv_ld_reload_flag='-r'])
33756fc0178dSmrgreload_flag=$lt_cv_ld_reload_flag
33766fc0178dSmrgcase $reload_flag in
33776fc0178dSmrg"" | " "*) ;;
33786fc0178dSmrg*) reload_flag=" $reload_flag" ;;
33796fc0178dSmrgesac
33806fc0178dSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
33816fc0178dSmrgcase $host_os in
33826fc0178dSmrg  cygwin* | mingw* | pw32* | cegcc*)
33836fc0178dSmrg    if test yes != "$GCC"; then
33846fc0178dSmrg      reload_cmds=false
33856fc0178dSmrg    fi
33866fc0178dSmrg    ;;
3387862f5301Smrg  darwin*)
33886fc0178dSmrg    if test yes = "$GCC"; then
33896fc0178dSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
339044dda7b2Smrg    else
33916fc0178dSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
339244dda7b2Smrg    fi
339344dda7b2Smrg    ;;
33946fc0178dSmrgesac
33956fc0178dSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
33966fc0178dSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
33976fc0178dSmrg])# _LT_CMD_RELOAD
339844dda7b2Smrg
3399862f5301Smrg
34006fc0178dSmrg# _LT_PATH_DD
34016fc0178dSmrg# -----------
34026fc0178dSmrg# find a working dd
34036fc0178dSmrgm4_defun([_LT_PATH_DD],
34046fc0178dSmrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
34056fc0178dSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
34066fc0178dSmrgcat conftest.i conftest.i >conftest2.i
34076fc0178dSmrg: ${lt_DD:=$DD}
34086fc0178dSmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
34096fc0178dSmrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
34106fc0178dSmrg  cmp -s conftest.i conftest.out \
34116fc0178dSmrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
3412862f5301Smrgfi])
34136fc0178dSmrgrm -f conftest.i conftest2.i conftest.out])
34146fc0178dSmrg])# _LT_PATH_DD
341544dda7b2Smrg
341644dda7b2Smrg
34176fc0178dSmrg# _LT_CMD_TRUNCATE
34186fc0178dSmrg# ----------------
34196fc0178dSmrg# find command to truncate a binary pipe
34206fc0178dSmrgm4_defun([_LT_CMD_TRUNCATE],
34216fc0178dSmrg[m4_require([_LT_PATH_DD])
34226fc0178dSmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
34236fc0178dSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
34246fc0178dSmrgcat conftest.i conftest.i >conftest2.i
34256fc0178dSmrglt_cv_truncate_bin=
34266fc0178dSmrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
34276fc0178dSmrg  cmp -s conftest.i conftest.out \
34286fc0178dSmrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
34296fc0178dSmrgfi
34306fc0178dSmrgrm -f conftest.i conftest2.i conftest.out
34316fc0178dSmrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
34326fc0178dSmrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
34336fc0178dSmrg  [Command to truncate a binary pipe])
34346fc0178dSmrg])# _LT_CMD_TRUNCATE
343544dda7b2Smrg
343644dda7b2Smrg
34376fc0178dSmrg# _LT_CHECK_MAGIC_METHOD
34386fc0178dSmrg# ----------------------
34396fc0178dSmrg# how to check for library dependencies
34406fc0178dSmrg#  -- PORTME fill in with the dynamic library characteristics
34416fc0178dSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
34426fc0178dSmrg[m4_require([_LT_DECL_EGREP])
34436fc0178dSmrgm4_require([_LT_DECL_OBJDUMP])
34446fc0178dSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
34456fc0178dSmrglt_cv_deplibs_check_method,
34466fc0178dSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
34476fc0178dSmrglt_cv_file_magic_test_file=
34486fc0178dSmrglt_cv_deplibs_check_method='unknown'
34496fc0178dSmrg# Need to set the preceding variable on all platforms that support
34506fc0178dSmrg# interlibrary dependencies.
34516fc0178dSmrg# 'none' -- dependencies not supported.
34526fc0178dSmrg# 'unknown' -- same as none, but documents that we really don't know.
34536fc0178dSmrg# 'pass_all' -- all dependencies passed with no checks.
34546fc0178dSmrg# 'test_compile' -- check by making test program.
34556fc0178dSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
34566fc0178dSmrg# that responds to the $file_magic_cmd with a given extended regex.
34576fc0178dSmrg# If you have 'file' or equivalent on your system and you're not sure
34586fc0178dSmrg# whether 'pass_all' will *always* work, you probably want this one.
345944dda7b2Smrg
34606fc0178dSmrgcase $host_os in
34616fc0178dSmrgaix[[4-9]]*)
34626fc0178dSmrg  lt_cv_deplibs_check_method=pass_all
3463862f5301Smrg  ;;
346444dda7b2Smrg
3465862f5301Smrgbeos*)
34666fc0178dSmrg  lt_cv_deplibs_check_method=pass_all
3467862f5301Smrg  ;;
346844dda7b2Smrg
3469862f5301Smrgbsdi[[45]]*)
34706fc0178dSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
34716fc0178dSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
34726fc0178dSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
3473862f5301Smrg  ;;
347444dda7b2Smrg
34756fc0178dSmrgcygwin*)
34766fc0178dSmrg  # func_win32_libid is a shell function defined in ltmain.sh
34776fc0178dSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
34786fc0178dSmrg  lt_cv_file_magic_cmd='func_win32_libid'
34796fc0178dSmrg  ;;
3480ff559fabSmrg
34816fc0178dSmrgmingw* | pw32*)
34826fc0178dSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
34836fc0178dSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
34846fc0178dSmrg  # unless we find 'file', for example because we are cross-compiling.
34856fc0178dSmrg  if ( file / ) >/dev/null 2>&1; then
34866fc0178dSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
34876fc0178dSmrg    lt_cv_file_magic_cmd='func_win32_libid'
34886fc0178dSmrg  else
34896fc0178dSmrg    # Keep this pattern in sync with the one in func_win32_libid.
34906fc0178dSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
34916fc0178dSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
34926fc0178dSmrg  fi
3493862f5301Smrg  ;;
3494ff559fabSmrg
34956fc0178dSmrgcegcc*)
34966fc0178dSmrg  # use the weaker test based on 'objdump'. See mingw*.
34976fc0178dSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
34986fc0178dSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3499862f5301Smrg  ;;
3500ff559fabSmrg
35016fc0178dSmrgdarwin* | rhapsody*)
35026fc0178dSmrg  lt_cv_deplibs_check_method=pass_all
3503862f5301Smrg  ;;
35047a3b38f7Smrg
3505862f5301Smrgfreebsd* | dragonfly*)
35066fc0178dSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
35076fc0178dSmrg    case $host_cpu in
35086fc0178dSmrg    i*86 )
35096fc0178dSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
35106fc0178dSmrg      # Let's accept both of them until this is cleared up.
35116fc0178dSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
35126fc0178dSmrg      lt_cv_file_magic_cmd=/usr/bin/file
35136fc0178dSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
35146fc0178dSmrg      ;;
3515862f5301Smrg    esac
35166fc0178dSmrg  else
35176fc0178dSmrg    lt_cv_deplibs_check_method=pass_all
351844dda7b2Smrg  fi
3519862f5301Smrg  ;;
35207a3b38f7Smrg
3521862f5301Smrghaiku*)
35226fc0178dSmrg  lt_cv_deplibs_check_method=pass_all
3523862f5301Smrg  ;;
35247a3b38f7Smrg
35256fc0178dSmrghpux10.20* | hpux11*)
35266fc0178dSmrg  lt_cv_file_magic_cmd=/usr/bin/file
3527862f5301Smrg  case $host_cpu in
3528862f5301Smrg  ia64*)
35296fc0178dSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
35306fc0178dSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3531862f5301Smrg    ;;
3532862f5301Smrg  hppa*64*)
35336fc0178dSmrg    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
35346fc0178dSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3535862f5301Smrg    ;;
3536862f5301Smrg  *)
35376fc0178dSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
35386fc0178dSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
353944dda7b2Smrg    ;;
354044dda7b2Smrg  esac
3541862f5301Smrg  ;;
35427a3b38f7Smrg
3543862f5301Smrginterix[[3-9]]*)
35446fc0178dSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
35456fc0178dSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3546862f5301Smrg  ;;
35477a3b38f7Smrg
3548862f5301Smrgirix5* | irix6* | nonstopux*)
35496fc0178dSmrg  case $LD in
35506fc0178dSmrg  *-32|*"-32 ") libmagic=32-bit;;
35516fc0178dSmrg  *-n32|*"-n32 ") libmagic=N32;;
35526fc0178dSmrg  *-64|*"-64 ") libmagic=64-bit;;
35536fc0178dSmrg  *) libmagic=never-match;;
3554862f5301Smrg  esac
35556fc0178dSmrg  lt_cv_deplibs_check_method=pass_all
3556862f5301Smrg  ;;
35577a3b38f7Smrg
3558fc544a13Smrg# This must be glibc/ELF.
35596fc0178dSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
35606fc0178dSmrg  lt_cv_deplibs_check_method=pass_all
3561862f5301Smrg  ;;
35627a3b38f7Smrg
3563862f5301Smrgnetbsd*)
35646fc0178dSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
35656fc0178dSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
356644dda7b2Smrg  else
35676fc0178dSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
356844dda7b2Smrg  fi
3569862f5301Smrg  ;;
3570ff559fabSmrg
35716fc0178dSmrgnewos6*)
35726fc0178dSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
35736fc0178dSmrg  lt_cv_file_magic_cmd=/usr/bin/file
35746fc0178dSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3575862f5301Smrg  ;;
3576ff559fabSmrg
3577862f5301Smrg*nto* | *qnx*)
35786fc0178dSmrg  lt_cv_deplibs_check_method=pass_all
3579862f5301Smrg  ;;
3580ff559fabSmrg
35816fc0178dSmrgopenbsd* | bitrig*)
35826fc0178dSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
35836fc0178dSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3584862f5301Smrg  else
35856fc0178dSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3586862f5301Smrg  fi
3587862f5301Smrg  ;;
3588ff559fabSmrg
3589862f5301Smrgosf3* | osf4* | osf5*)
35906fc0178dSmrg  lt_cv_deplibs_check_method=pass_all
3591862f5301Smrg  ;;
3592862f5301Smrg
3593862f5301Smrgrdos*)
35946fc0178dSmrg  lt_cv_deplibs_check_method=pass_all
3595862f5301Smrg  ;;
3596862f5301Smrg
3597862f5301Smrgsolaris*)
35986fc0178dSmrg  lt_cv_deplibs_check_method=pass_all
3599862f5301Smrg  ;;
3600862f5301Smrg
36016fc0178dSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
36026fc0178dSmrg  lt_cv_deplibs_check_method=pass_all
3603862f5301Smrg  ;;
3604862f5301Smrg
3605862f5301Smrgsysv4 | sysv4.3*)
3606862f5301Smrg  case $host_vendor in
36076fc0178dSmrg  motorola)
36086fc0178dSmrg    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]]'
36096fc0178dSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
36106fc0178dSmrg    ;;
36116fc0178dSmrg  ncr)
36126fc0178dSmrg    lt_cv_deplibs_check_method=pass_all
36136fc0178dSmrg    ;;
36146fc0178dSmrg  sequent)
36156fc0178dSmrg    lt_cv_file_magic_cmd='/bin/file'
36166fc0178dSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
36176fc0178dSmrg    ;;
36186fc0178dSmrg  sni)
36196fc0178dSmrg    lt_cv_file_magic_cmd='/bin/file'
36206fc0178dSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
36216fc0178dSmrg    lt_cv_file_magic_test_file=/lib/libc.so
36226fc0178dSmrg    ;;
36236fc0178dSmrg  siemens)
36246fc0178dSmrg    lt_cv_deplibs_check_method=pass_all
36256fc0178dSmrg    ;;
36266fc0178dSmrg  pc)
36276fc0178dSmrg    lt_cv_deplibs_check_method=pass_all
36286fc0178dSmrg    ;;
362944dda7b2Smrg  esac
3630862f5301Smrg  ;;
363144dda7b2Smrg
3632862f5301Smrgtpf*)
36336fc0178dSmrg  lt_cv_deplibs_check_method=pass_all
363444dda7b2Smrg  ;;
36356fc0178dSmrgos2*)
36366fc0178dSmrg  lt_cv_deplibs_check_method=pass_all
363744dda7b2Smrg  ;;
3638862f5301Smrgesac
36396fc0178dSmrg])
364044dda7b2Smrg
36416fc0178dSmrgfile_magic_glob=
36426fc0178dSmrgwant_nocaseglob=no
36436fc0178dSmrgif test "$build" = "$host"; then
36446fc0178dSmrg  case $host_os in
36456fc0178dSmrg  mingw* | pw32*)
36466fc0178dSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
36476fc0178dSmrg      want_nocaseglob=yes
36486fc0178dSmrg    else
36496fc0178dSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
36506fc0178dSmrg    fi
36516fc0178dSmrg    ;;
36526fc0178dSmrg  esac
3653862f5301Smrgfi
365444dda7b2Smrg
36556fc0178dSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
36566fc0178dSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
36576fc0178dSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
365844dda7b2Smrg
36596fc0178dSmrg_LT_DECL([], [deplibs_check_method], [1],
36606fc0178dSmrg    [Method to check whether dependent libraries are shared objects])
36616fc0178dSmrg_LT_DECL([], [file_magic_cmd], [1],
36626fc0178dSmrg    [Command to use when deplibs_check_method = "file_magic"])
36636fc0178dSmrg_LT_DECL([], [file_magic_glob], [1],
36646fc0178dSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
36656fc0178dSmrg_LT_DECL([], [want_nocaseglob], [1],
36666fc0178dSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
36676fc0178dSmrg])# _LT_CHECK_MAGIC_METHOD
3668ff559fabSmrg
3669ff559fabSmrg
36706fc0178dSmrg# LT_PATH_NM
36716fc0178dSmrg# ----------
36726fc0178dSmrg# find the pathname to a BSD- or MS-compatible name lister
36736fc0178dSmrgAC_DEFUN([LT_PATH_NM],
36746fc0178dSmrg[AC_REQUIRE([AC_PROG_CC])dnl
36756fc0178dSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
36766fc0178dSmrg[if test -n "$NM"; then
36776fc0178dSmrg  # Let the user override the test.
36786fc0178dSmrg  lt_cv_path_NM=$NM
36796fc0178dSmrgelse
36806fc0178dSmrg  lt_nm_to_check=${ac_tool_prefix}nm
36816fc0178dSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
36826fc0178dSmrg    lt_nm_to_check="$lt_nm_to_check nm"
36836fc0178dSmrg  fi
36846fc0178dSmrg  for lt_tmp_nm in $lt_nm_to_check; do
36856fc0178dSmrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
36866fc0178dSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
36876fc0178dSmrg      IFS=$lt_save_ifs
36886fc0178dSmrg      test -z "$ac_dir" && ac_dir=.
36896fc0178dSmrg      tmp_nm=$ac_dir/$lt_tmp_nm
36906fc0178dSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
36916fc0178dSmrg	# Check to see if the nm accepts a BSD-compat flag.
36926fc0178dSmrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
36936fc0178dSmrg	#   nm: unknown option "B" ignored
36946fc0178dSmrg	# Tru64's nm complains that /dev/null is an invalid object file
36956fc0178dSmrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
36966fc0178dSmrg	case $build_os in
36976fc0178dSmrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
36986fc0178dSmrg	*) lt_bad_file=/dev/null ;;
36996fc0178dSmrg	esac
37006fc0178dSmrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
37016fc0178dSmrg	*$lt_bad_file* | *'Invalid file or object type'*)
37026fc0178dSmrg	  lt_cv_path_NM="$tmp_nm -B"
37036fc0178dSmrg	  break 2
37046fc0178dSmrg	  ;;
37056fc0178dSmrg	*)
37066fc0178dSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
37076fc0178dSmrg	  */dev/null*)
37086fc0178dSmrg	    lt_cv_path_NM="$tmp_nm -p"
37096fc0178dSmrg	    break 2
37106fc0178dSmrg	    ;;
37116fc0178dSmrg	  *)
37126fc0178dSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
37136fc0178dSmrg	    continue # so that we can try to find one that supports BSD flags
37146fc0178dSmrg	    ;;
37156fc0178dSmrg	  esac
37166fc0178dSmrg	  ;;
3717862f5301Smrg	esac
3718862f5301Smrg      fi
37196fc0178dSmrg    done
37206fc0178dSmrg    IFS=$lt_save_ifs
3721862f5301Smrg  done
37226fc0178dSmrg  : ${lt_cv_path_NM=no}
37236fc0178dSmrgfi])
37246fc0178dSmrgif test no != "$lt_cv_path_NM"; then
37256fc0178dSmrg  NM=$lt_cv_path_NM
3726862f5301Smrgelse
37276fc0178dSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
37286fc0178dSmrg  if test -n "$DUMPBIN"; then :
37296fc0178dSmrg    # Let the user override the test.
373044dda7b2Smrg  else
37316fc0178dSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
37326fc0178dSmrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
37336fc0178dSmrg    *COFF*)
37346fc0178dSmrg      DUMPBIN="$DUMPBIN -symbols -headers"
37356fc0178dSmrg      ;;
37366fc0178dSmrg    *)
37376fc0178dSmrg      DUMPBIN=:
37386fc0178dSmrg      ;;
37396fc0178dSmrg    esac
37406fc0178dSmrg  fi
37416fc0178dSmrg  AC_SUBST([DUMPBIN])
37426fc0178dSmrg  if test : != "$DUMPBIN"; then
37436fc0178dSmrg    NM=$DUMPBIN
374444dda7b2Smrg  fi
3745862f5301Smrgfi
37466fc0178dSmrgtest -z "$NM" && NM=nm
37476fc0178dSmrgAC_SUBST([NM])
37486fc0178dSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3749ff559fabSmrg
37506fc0178dSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
37516fc0178dSmrg  [lt_cv_nm_interface="BSD nm"
37526fc0178dSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
37536fc0178dSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
37546fc0178dSmrg  (eval "$ac_compile" 2>conftest.err)
37556fc0178dSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
37566fc0178dSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
37576fc0178dSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
37586fc0178dSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
37596fc0178dSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
37606fc0178dSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
37616fc0178dSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
37626fc0178dSmrg    lt_cv_nm_interface="MS dumpbin"
37636fc0178dSmrg  fi
37646fc0178dSmrg  rm -f conftest*])
37656fc0178dSmrg])# LT_PATH_NM
3766ff559fabSmrg
37676fc0178dSmrg# Old names:
37686fc0178dSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
37696fc0178dSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
37706fc0178dSmrgdnl aclocal-1.4 backwards compatibility:
37716fc0178dSmrgdnl AC_DEFUN([AM_PROG_NM], [])
37726fc0178dSmrgdnl AC_DEFUN([AC_PROG_NM], [])
377344dda7b2Smrg
37746fc0178dSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
37756fc0178dSmrg# --------------------------------
37766fc0178dSmrg# how to determine the name of the shared library
37776fc0178dSmrg# associated with a specific link library.
37786fc0178dSmrg#  -- PORTME fill in with the dynamic library characteristics
37796fc0178dSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
37806fc0178dSmrg[m4_require([_LT_DECL_EGREP])
37816fc0178dSmrgm4_require([_LT_DECL_OBJDUMP])
37826fc0178dSmrgm4_require([_LT_DECL_DLLTOOL])
37836fc0178dSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
37846fc0178dSmrglt_cv_sharedlib_from_linklib_cmd,
37856fc0178dSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3786862f5301Smrg
37876fc0178dSmrgcase $host_os in
37886fc0178dSmrgcygwin* | mingw* | pw32* | cegcc*)
37896fc0178dSmrg  # two different shell functions defined in ltmain.sh;
37906fc0178dSmrg  # decide which one to use based on capabilities of $DLLTOOL
37916fc0178dSmrg  case `$DLLTOOL --help 2>&1` in
37926fc0178dSmrg  *--identify-strict*)
37936fc0178dSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3794862f5301Smrg    ;;
3795862f5301Smrg  *)
37966fc0178dSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3797862f5301Smrg    ;;
3798862f5301Smrg  esac
379944dda7b2Smrg  ;;
3800862f5301Smrg*)
38016fc0178dSmrg  # fallback: assume linklib IS sharedlib
38026fc0178dSmrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
380344dda7b2Smrg  ;;
3804862f5301Smrgesac
38056fc0178dSmrg])
38066fc0178dSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
38076fc0178dSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
38086fc0178dSmrg
38096fc0178dSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
38106fc0178dSmrg    [Command to associate shared and link libraries])
38116fc0178dSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3812862f5301Smrg
3813862f5301Smrg
38146fc0178dSmrg# _LT_PATH_MANIFEST_TOOL
3815862f5301Smrg# ----------------------
38166fc0178dSmrg# locate the manifest tool
38176fc0178dSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
38186fc0178dSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
38196fc0178dSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
38206fc0178dSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
38216fc0178dSmrg  [lt_cv_path_mainfest_tool=no
38226fc0178dSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
38236fc0178dSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
38246fc0178dSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
38256fc0178dSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
38266fc0178dSmrg    lt_cv_path_mainfest_tool=yes
38276fc0178dSmrg  fi
38286fc0178dSmrg  rm -f conftest*])
38296fc0178dSmrgif test yes != "$lt_cv_path_mainfest_tool"; then
38306fc0178dSmrg  MANIFEST_TOOL=:
38316fc0178dSmrgfi
38326fc0178dSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
38336fc0178dSmrg])# _LT_PATH_MANIFEST_TOOL
3834862f5301Smrg
3835ff559fabSmrg
38366fc0178dSmrg# _LT_DLL_DEF_P([FILE])
38376fc0178dSmrg# ---------------------
38386fc0178dSmrg# True iff FILE is a Windows DLL '.def' file.
38396fc0178dSmrg# Keep in sync with func_dll_def_p in the libtool script
38406fc0178dSmrgAC_DEFUN([_LT_DLL_DEF_P],
38416fc0178dSmrg[dnl
38426fc0178dSmrg  test DEF = "`$SED -n dnl
38436fc0178dSmrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
38446fc0178dSmrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
38456fc0178dSmrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
38466fc0178dSmrg    -e q dnl                          Only consider the first "real" line
38476fc0178dSmrg    $1`" dnl
38486fc0178dSmrg])# _LT_DLL_DEF_P
3849ff559fabSmrg
3850862f5301Smrg
38516fc0178dSmrg# LT_LIB_M
38526fc0178dSmrg# --------
38536fc0178dSmrg# check for math library
38546fc0178dSmrgAC_DEFUN([LT_LIB_M],
38556fc0178dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
38566fc0178dSmrgLIBM=
38576fc0178dSmrgcase $host in
38586fc0178dSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
38596fc0178dSmrg  # These system don't have libm, or don't need it
3860862f5301Smrg  ;;
38616fc0178dSmrg*-ncr-sysv4.3*)
38626fc0178dSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
38636fc0178dSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
386444dda7b2Smrg  ;;
38656fc0178dSmrg*)
38666fc0178dSmrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
386744dda7b2Smrg  ;;
38686fc0178dSmrgesac
38696fc0178dSmrgAC_SUBST([LIBM])
38706fc0178dSmrg])# LT_LIB_M
3871ff559fabSmrg
38726fc0178dSmrg# Old name:
38736fc0178dSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
38746fc0178dSmrgdnl aclocal-1.4 backwards compatibility:
38756fc0178dSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3876ff559fabSmrg
3877ff559fabSmrg
38786fc0178dSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
38796fc0178dSmrg# -------------------------------
38806fc0178dSmrgm4_defun([_LT_COMPILER_NO_RTTI],
38816fc0178dSmrg[m4_require([_LT_TAG_COMPILER])dnl
3882ff559fabSmrg
38836fc0178dSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3884ff559fabSmrg
38856fc0178dSmrgif test yes = "$GCC"; then
38866fc0178dSmrg  case $cc_basename in
38876fc0178dSmrg  nvcc*)
38886fc0178dSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3889862f5301Smrg  *)
38906fc0178dSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
3891862f5301Smrg  esac
3892ff559fabSmrg
38936fc0178dSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
38946fc0178dSmrg    lt_cv_prog_compiler_rtti_exceptions,
38956fc0178dSmrg    [-fno-rtti -fno-exceptions], [],
38966fc0178dSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
38976fc0178dSmrgfi
38986fc0178dSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
38996fc0178dSmrg	[Compiler flag to turn off builtin functions])
39006fc0178dSmrg])# _LT_COMPILER_NO_RTTI
3901ff559fabSmrg
390244dda7b2Smrg
39036fc0178dSmrg# _LT_CMD_GLOBAL_SYMBOLS
39046fc0178dSmrg# ----------------------
39056fc0178dSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
39066fc0178dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
39076fc0178dSmrgAC_REQUIRE([AC_PROG_CC])dnl
39086fc0178dSmrgAC_REQUIRE([AC_PROG_AWK])dnl
39096fc0178dSmrgAC_REQUIRE([LT_PATH_NM])dnl
39106fc0178dSmrgAC_REQUIRE([LT_PATH_LD])dnl
39116fc0178dSmrgm4_require([_LT_DECL_SED])dnl
39126fc0178dSmrgm4_require([_LT_DECL_EGREP])dnl
39136fc0178dSmrgm4_require([_LT_TAG_COMPILER])dnl
391444dda7b2Smrg
39156fc0178dSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
39166fc0178dSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
39176fc0178dSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
39186fc0178dSmrg[
39196fc0178dSmrg# These are sane defaults that work on at least a few old systems.
39206fc0178dSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3921ff559fabSmrg
39226fc0178dSmrg# Character class describing NM global symbol codes.
39236fc0178dSmrgsymcode='[[BCDEGRST]]'
3924ff559fabSmrg
39256fc0178dSmrg# Regexp to match symbols that can be accessed directly from C.
39266fc0178dSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3927862f5301Smrg
39286fc0178dSmrg# Define system-specific variables.
39296fc0178dSmrgcase $host_os in
39306fc0178dSmrgaix*)
39316fc0178dSmrg  symcode='[[BCDT]]'
39326fc0178dSmrg  ;;
39336fc0178dSmrgcygwin* | mingw* | pw32* | cegcc*)
39346fc0178dSmrg  symcode='[[ABCDGISTW]]'
39356fc0178dSmrg  ;;
39366fc0178dSmrghpux*)
39376fc0178dSmrg  if test ia64 = "$host_cpu"; then
39386fc0178dSmrg    symcode='[[ABCDEGRST]]'
393944dda7b2Smrg  fi
3940862f5301Smrg  ;;
39416fc0178dSmrgirix* | nonstopux*)
39426fc0178dSmrg  symcode='[[BCDEGRST]]'
3943862f5301Smrg  ;;
39446fc0178dSmrgosf*)
39456fc0178dSmrg  symcode='[[BCDEGQRST]]'
3946862f5301Smrg  ;;
3947862f5301Smrgsolaris*)
39486fc0178dSmrg  symcode='[[BDRT]]'
3949862f5301Smrg  ;;
39506fc0178dSmrgsco3.2v5*)
39516fc0178dSmrg  symcode='[[DT]]'
3952862f5301Smrg  ;;
39536fc0178dSmrgsysv4.2uw2*)
39546fc0178dSmrg  symcode='[[DT]]'
395544dda7b2Smrg  ;;
39566fc0178dSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
39576fc0178dSmrg  symcode='[[ABDT]]'
39586fc0178dSmrg  ;;
39596fc0178dSmrgsysv4)
39606fc0178dSmrg  symcode='[[DFNSTU]]'
3961862f5301Smrg  ;;
396244dda7b2Smrgesac
3963ff559fabSmrg
39646fc0178dSmrg# If we're using GNU nm, then use its standard symbol codes.
39656fc0178dSmrgcase `$NM -V 2>&1` in
39666fc0178dSmrg*GNU* | *'with BFD'*)
39676fc0178dSmrg  symcode='[[ABCDGIRSTW]]' ;;
39686fc0178dSmrgesac
3969ff559fabSmrg
39706fc0178dSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
39716fc0178dSmrg  # Gets list of data symbols to import.
39726fc0178dSmrg  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
39736fc0178dSmrg  # Adjust the below global symbol transforms to fixup imported variables.
39746fc0178dSmrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
39756fc0178dSmrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
39766fc0178dSmrg  lt_c_name_lib_hook="\
39776fc0178dSmrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
39786fc0178dSmrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
397944dda7b2Smrgelse
39806fc0178dSmrg  # Disable hooks by default.
39816fc0178dSmrg  lt_cv_sys_global_symbol_to_import=
39826fc0178dSmrg  lt_cdecl_hook=
39836fc0178dSmrg  lt_c_name_hook=
39846fc0178dSmrg  lt_c_name_lib_hook=
39857a3b38f7Smrgfi
3986ff559fabSmrg
39876fc0178dSmrg# Transform an extracted symbol line into a proper C declaration.
39886fc0178dSmrg# Some systems (esp. on ia64) link data and code symbols differently,
39896fc0178dSmrg# so use this general approach.
39906fc0178dSmrglt_cv_sys_global_symbol_to_cdecl="sed -n"\
39916fc0178dSmrg$lt_cdecl_hook\
39926fc0178dSmrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
39936fc0178dSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
3994ff559fabSmrg
39956fc0178dSmrg# Transform an extracted symbol line into symbol name and symbol address
39966fc0178dSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n"\
39976fc0178dSmrg$lt_c_name_hook\
39986fc0178dSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
39996fc0178dSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
40006fc0178dSmrg
40016fc0178dSmrg# Transform an extracted symbol line into symbol name with lib prefix and
40026fc0178dSmrg# symbol address.
40036fc0178dSmrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
40046fc0178dSmrg$lt_c_name_lib_hook\
40056fc0178dSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
40066fc0178dSmrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
40076fc0178dSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
4008862f5301Smrg
40096fc0178dSmrg# Handle CRLF in mingw tool chain
40106fc0178dSmrgopt_cr=
40116fc0178dSmrgcase $build_os in
40126fc0178dSmrgmingw*)
40136fc0178dSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4014862f5301Smrg  ;;
4015862f5301Smrgesac
4016862f5301Smrg
40176fc0178dSmrg# Try without a prefix underscore, then with it.
40186fc0178dSmrgfor ac_symprfx in "" "_"; do
4019862f5301Smrg
40206fc0178dSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
40216fc0178dSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
4022ff559fabSmrg
402344dda7b2Smrg  # Write the raw and C identifiers.
402444dda7b2Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
40256fc0178dSmrg    # Fake it for dumpbin and say T for any non-static function,
40266fc0178dSmrg    # D for any global variable and I for any imported variable.
402744dda7b2Smrg    # Also find C++ and __fastcall symbols from MSVC++,
402844dda7b2Smrg    # which start with @ or ?.
402944dda7b2Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
403044dda7b2Smrg"     {last_section=section; section=\$ 3};"\
4031fc544a13Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
403244dda7b2Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
40336fc0178dSmrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
40346fc0178dSmrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
40356fc0178dSmrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
403644dda7b2Smrg"     \$ 0!~/External *\|/{next};"\
403744dda7b2Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
403844dda7b2Smrg"     {if(hide[section]) next};"\
40396fc0178dSmrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
40406fc0178dSmrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
40416fc0178dSmrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
40426fc0178dSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
404344dda7b2Smrg"     ' prfx=^$ac_symprfx]"
404444dda7b2Smrg  else
404544dda7b2Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
404644dda7b2Smrg  fi
4047862f5301Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4048ff559fabSmrg
404944dda7b2Smrg  # Check to see that the pipe works correctly.
405044dda7b2Smrg  pipe_works=no
40517a3b38f7Smrg
405244dda7b2Smrg  rm -f conftest*
405344dda7b2Smrg  cat > conftest.$ac_ext <<_LT_EOF
405444dda7b2Smrg#ifdef __cplusplus
405544dda7b2Smrgextern "C" {
405644dda7b2Smrg#endif
405744dda7b2Smrgchar nm_test_var;
405844dda7b2Smrgvoid nm_test_func(void);
405944dda7b2Smrgvoid nm_test_func(void){}
406044dda7b2Smrg#ifdef __cplusplus
406144dda7b2Smrg}
406244dda7b2Smrg#endif
406344dda7b2Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
406444dda7b2Smrg_LT_EOF
4065ff559fabSmrg
406644dda7b2Smrg  if AC_TRY_EVAL(ac_compile); then
406744dda7b2Smrg    # Now try to grab the symbols.
406844dda7b2Smrg    nlist=conftest.nm
406944dda7b2Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
407044dda7b2Smrg      # Try sorting and uniquifying the output.
407144dda7b2Smrg      if sort "$nlist" | uniq > "$nlist"T; then
407244dda7b2Smrg	mv -f "$nlist"T "$nlist"
407344dda7b2Smrg      else
407444dda7b2Smrg	rm -f "$nlist"T
407544dda7b2Smrg      fi
4076ff559fabSmrg
407744dda7b2Smrg      # Make sure that we snagged all the symbols we need.
407844dda7b2Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
407944dda7b2Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
408044dda7b2Smrg	  cat <<_LT_EOF > conftest.$ac_ext
4081862f5301Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
40826fc0178dSmrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
40836fc0178dSmrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
4084862f5301Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4085862f5301Smrg# define LT@&t@_DLSYM_CONST
40866fc0178dSmrg#elif defined __osf__
4087862f5301Smrg/* This system does not cope well with relocations in const data.  */
4088862f5301Smrg# define LT@&t@_DLSYM_CONST
4089862f5301Smrg#else
4090862f5301Smrg# define LT@&t@_DLSYM_CONST const
4091862f5301Smrg#endif
4092862f5301Smrg
409344dda7b2Smrg#ifdef __cplusplus
409444dda7b2Smrgextern "C" {
409544dda7b2Smrg#endif
40967a3b38f7Smrg
409744dda7b2Smrg_LT_EOF
409844dda7b2Smrg	  # Now generate the symbol file.
409944dda7b2Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
41007a3b38f7Smrg
410144dda7b2Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
4102ff559fabSmrg
410344dda7b2Smrg/* The mapping between symbol names and symbols.  */
4104862f5301SmrgLT@&t@_DLSYM_CONST struct {
410544dda7b2Smrg  const char *name;
410644dda7b2Smrg  void       *address;
410744dda7b2Smrg}
410844dda7b2Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
410944dda7b2Smrg{
411044dda7b2Smrg  { "@PROGRAM@", (void *) 0 },
411144dda7b2Smrg_LT_EOF
41126fc0178dSmrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
411344dda7b2Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
411444dda7b2Smrg  {0, (void *) 0}
411544dda7b2Smrg};
41167a3b38f7Smrg
411744dda7b2Smrg/* This works around a problem in FreeBSD linker */
411844dda7b2Smrg#ifdef FREEBSD_WORKAROUND
411944dda7b2Smrgstatic const void *lt_preloaded_setup() {
412044dda7b2Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
412144dda7b2Smrg}
412244dda7b2Smrg#endif
4123ff559fabSmrg
412444dda7b2Smrg#ifdef __cplusplus
412544dda7b2Smrg}
412644dda7b2Smrg#endif
412744dda7b2Smrg_LT_EOF
412844dda7b2Smrg	  # Now try linking the two files.
412944dda7b2Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
4130862f5301Smrg	  lt_globsym_save_LIBS=$LIBS
4131862f5301Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
41326fc0178dSmrg	  LIBS=conftstm.$ac_objext
413344dda7b2Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
41346fc0178dSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
413544dda7b2Smrg	    pipe_works=yes
413644dda7b2Smrg	  fi
4137862f5301Smrg	  LIBS=$lt_globsym_save_LIBS
4138862f5301Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
41397a3b38f7Smrg	else
414044dda7b2Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
41417a3b38f7Smrg	fi
414244dda7b2Smrg      else
414344dda7b2Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
414444dda7b2Smrg      fi
414544dda7b2Smrg    else
414644dda7b2Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
414744dda7b2Smrg    fi
414844dda7b2Smrg  else
414944dda7b2Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
415044dda7b2Smrg    cat conftest.$ac_ext >&5
415144dda7b2Smrg  fi
415244dda7b2Smrg  rm -rf conftest* conftst*
4153ff559fabSmrg
415444dda7b2Smrg  # Do not use the global_symbol_pipe unless it works.
41556fc0178dSmrg  if test yes = "$pipe_works"; then
415644dda7b2Smrg    break
415744dda7b2Smrg  else
415844dda7b2Smrg    lt_cv_sys_global_symbol_pipe=
415944dda7b2Smrg  fi
416044dda7b2Smrgdone
416144dda7b2Smrg])
416244dda7b2Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
416344dda7b2Smrg  lt_cv_sys_global_symbol_to_cdecl=
416444dda7b2Smrgfi
416544dda7b2Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
416644dda7b2Smrg  AC_MSG_RESULT(failed)
416744dda7b2Smrgelse
416844dda7b2Smrg  AC_MSG_RESULT(ok)
416944dda7b2Smrgfi
4170ff559fabSmrg
4171862f5301Smrg# Response file support.
4172862f5301Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
4173862f5301Smrg  nm_file_list_spec='@'
4174862f5301Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4175862f5301Smrg  nm_file_list_spec='@'
4176862f5301Smrgfi
4177862f5301Smrg
417844dda7b2Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
417944dda7b2Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
418044dda7b2Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
418144dda7b2Smrg    [Transform the output of nm in a proper C declaration])
41826fc0178dSmrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
41836fc0178dSmrg    [Transform the output of nm into a list of symbols to manually relocate])
418444dda7b2Smrg_LT_DECL([global_symbol_to_c_name_address],
418544dda7b2Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
418644dda7b2Smrg    [Transform the output of nm in a C name address pair])
418744dda7b2Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
418844dda7b2Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
418944dda7b2Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
41906fc0178dSmrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
41916fc0178dSmrg    [The name lister interface])
4192862f5301Smrg_LT_DECL([], [nm_file_list_spec], [1],
4193862f5301Smrg    [Specify filename containing input files for $NM])
419444dda7b2Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
4195ff559fabSmrg
4196ff559fabSmrg
419744dda7b2Smrg# _LT_COMPILER_PIC([TAGNAME])
419844dda7b2Smrg# ---------------------------
419944dda7b2Smrgm4_defun([_LT_COMPILER_PIC],
420044dda7b2Smrg[m4_require([_LT_TAG_COMPILER])dnl
420144dda7b2Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
420244dda7b2Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
420344dda7b2Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
4204ff559fabSmrg
420544dda7b2Smrgm4_if([$1], [CXX], [
420644dda7b2Smrg  # C++ specific cases for pic, static, wl, etc.
42076fc0178dSmrg  if test yes = "$GXX"; then
420844dda7b2Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
420944dda7b2Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4210ff559fabSmrg
421144dda7b2Smrg    case $host_os in
421244dda7b2Smrg    aix*)
421344dda7b2Smrg      # All AIX code is PIC.
42146fc0178dSmrg      if test ia64 = "$host_cpu"; then
421544dda7b2Smrg	# AIX 5 now supports IA64 processor
421644dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
421744dda7b2Smrg      fi
42186fc0178dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
421944dda7b2Smrg      ;;
42207a3b38f7Smrg
422144dda7b2Smrg    amigaos*)
422244dda7b2Smrg      case $host_cpu in
422344dda7b2Smrg      powerpc)
422444dda7b2Smrg            # see comment about AmigaOS4 .so support
422544dda7b2Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42267a3b38f7Smrg        ;;
422744dda7b2Smrg      m68k)
422844dda7b2Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
42296fc0178dSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
42306fc0178dSmrg            # like '-m68040'.
423144dda7b2Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
42327a3b38f7Smrg        ;;
423344dda7b2Smrg      esac
423444dda7b2Smrg      ;;
4235ff559fabSmrg
423644dda7b2Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
423744dda7b2Smrg      # PIC is the default for these OSes.
423844dda7b2Smrg      ;;
423944dda7b2Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
424044dda7b2Smrg      # This hack is so that the source file can tell whether it is being
424144dda7b2Smrg      # built for inclusion in a dll (and should export symbols for example).
424244dda7b2Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
424344dda7b2Smrg      # (--disable-auto-import) libraries
424444dda7b2Smrg      m4_if([$1], [GCJ], [],
424544dda7b2Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
42466fc0178dSmrg      case $host_os in
42476fc0178dSmrg      os2*)
42486fc0178dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
42496fc0178dSmrg	;;
42506fc0178dSmrg      esac
425144dda7b2Smrg      ;;
425244dda7b2Smrg    darwin* | rhapsody*)
425344dda7b2Smrg      # PIC is the default on this platform
425444dda7b2Smrg      # Common symbols not allowed in MH_DYLIB files
425544dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
425644dda7b2Smrg      ;;
425744dda7b2Smrg    *djgpp*)
425844dda7b2Smrg      # DJGPP does not support shared libraries at all
425944dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
426044dda7b2Smrg      ;;
426144dda7b2Smrg    haiku*)
426244dda7b2Smrg      # PIC is the default for Haiku.
426344dda7b2Smrg      # The "-static" flag exists, but is broken.
426444dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
426544dda7b2Smrg      ;;
426644dda7b2Smrg    interix[[3-9]]*)
426744dda7b2Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
426844dda7b2Smrg      # Instead, we relocate shared libraries at runtime.
426944dda7b2Smrg      ;;
427044dda7b2Smrg    sysv4*MP*)
427144dda7b2Smrg      if test -d /usr/nec; then
427244dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
427344dda7b2Smrg      fi
427444dda7b2Smrg      ;;
427544dda7b2Smrg    hpux*)
427644dda7b2Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
427744dda7b2Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
427844dda7b2Smrg      # sets the default TLS model and affects inlining.
427944dda7b2Smrg      case $host_cpu in
428044dda7b2Smrg      hppa*64*)
42817a3b38f7Smrg	;;
428244dda7b2Smrg      *)
428344dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
428444dda7b2Smrg	;;
428544dda7b2Smrg      esac
428644dda7b2Smrg      ;;
428744dda7b2Smrg    *qnx* | *nto*)
428844dda7b2Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
428944dda7b2Smrg      # it will coredump.
429044dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
429144dda7b2Smrg      ;;
429244dda7b2Smrg    *)
429344dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
429444dda7b2Smrg      ;;
429544dda7b2Smrg    esac
429644dda7b2Smrg  else
429744dda7b2Smrg    case $host_os in
429844dda7b2Smrg      aix[[4-9]]*)
429944dda7b2Smrg	# All AIX code is PIC.
43006fc0178dSmrg	if test ia64 = "$host_cpu"; then
430144dda7b2Smrg	  # AIX 5 now supports IA64 processor
430244dda7b2Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
430344dda7b2Smrg	else
430444dda7b2Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
430544dda7b2Smrg	fi
430644dda7b2Smrg	;;
430744dda7b2Smrg      chorus*)
430844dda7b2Smrg	case $cc_basename in
430944dda7b2Smrg	cxch68*)
431044dda7b2Smrg	  # Green Hills C++ Compiler
431144dda7b2Smrg	  # _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"
431244dda7b2Smrg	  ;;
431344dda7b2Smrg	esac
431444dda7b2Smrg	;;
4315862f5301Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
4316862f5301Smrg	# This hack is so that the source file can tell whether it is being
4317862f5301Smrg	# built for inclusion in a dll (and should export symbols for example).
4318862f5301Smrg	m4_if([$1], [GCJ], [],
4319862f5301Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4320862f5301Smrg	;;
432144dda7b2Smrg      dgux*)
432244dda7b2Smrg	case $cc_basename in
432344dda7b2Smrg	  ec++*)
432444dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
43257a3b38f7Smrg	    ;;
432644dda7b2Smrg	  ghcx*)
432744dda7b2Smrg	    # Green Hills C++ Compiler
432844dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
43297a3b38f7Smrg	    ;;
433044dda7b2Smrg	  *)
43317a3b38f7Smrg	    ;;
433244dda7b2Smrg	esac
433344dda7b2Smrg	;;
433444dda7b2Smrg      freebsd* | dragonfly*)
433544dda7b2Smrg	# FreeBSD uses GNU C++
433644dda7b2Smrg	;;
433744dda7b2Smrg      hpux9* | hpux10* | hpux11*)
433844dda7b2Smrg	case $cc_basename in
433944dda7b2Smrg	  CC*)
434044dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43416fc0178dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
43426fc0178dSmrg	    if test ia64 != "$host_cpu"; then
434344dda7b2Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
434444dda7b2Smrg	    fi
43457a3b38f7Smrg	    ;;
434644dda7b2Smrg	  aCC*)
434744dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43486fc0178dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
434944dda7b2Smrg	    case $host_cpu in
435044dda7b2Smrg	    hppa*64*|ia64*)
435144dda7b2Smrg	      # +Z the default
43527a3b38f7Smrg	      ;;
435344dda7b2Smrg	    *)
435444dda7b2Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
43557a3b38f7Smrg	      ;;
43567a3b38f7Smrg	    esac
435744dda7b2Smrg	    ;;
435844dda7b2Smrg	  *)
435944dda7b2Smrg	    ;;
436044dda7b2Smrg	esac
436144dda7b2Smrg	;;
436244dda7b2Smrg      interix*)
436344dda7b2Smrg	# This is c89, which is MS Visual C++ (no shared libs)
436444dda7b2Smrg	# Anyone wants to do a port?
436544dda7b2Smrg	;;
436644dda7b2Smrg      irix5* | irix6* | nonstopux*)
436744dda7b2Smrg	case $cc_basename in
436844dda7b2Smrg	  CC*)
436944dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
437044dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
437144dda7b2Smrg	    # CC pic flag -KPIC is the default.
437244dda7b2Smrg	    ;;
437344dda7b2Smrg	  *)
437444dda7b2Smrg	    ;;
437544dda7b2Smrg	esac
437644dda7b2Smrg	;;
43776fc0178dSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
437844dda7b2Smrg	case $cc_basename in
437944dda7b2Smrg	  KCC*)
438044dda7b2Smrg	    # KAI C++ Compiler
438144dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
438244dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
438344dda7b2Smrg	    ;;
438444dda7b2Smrg	  ecpc* )
43856fc0178dSmrg	    # old Intel C++ for x86_64, which still supported -KPIC.
438644dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
438744dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
438844dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
438944dda7b2Smrg	    ;;
439044dda7b2Smrg	  icpc* )
439144dda7b2Smrg	    # Intel C++, used to be incompatible with GCC.
439244dda7b2Smrg	    # ICC 10 doesn't accept -KPIC any more.
439344dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
439444dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
439544dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
439644dda7b2Smrg	    ;;
439744dda7b2Smrg	  pgCC* | pgcpp*)
439844dda7b2Smrg	    # Portland Group C++ compiler
439944dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
440044dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
440144dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
440244dda7b2Smrg	    ;;
44037a3b38f7Smrg	  cxx*)
44047a3b38f7Smrg	    # Compaq C++
440544dda7b2Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
440644dda7b2Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
440744dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
440844dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44097a3b38f7Smrg	    ;;
441044dda7b2Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
441144dda7b2Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
441244dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
441344dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
441444dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
44157a3b38f7Smrg	    ;;
44167a3b38f7Smrg	  *)
44177a3b38f7Smrg	    case `$CC -V 2>&1 | sed 5q` in
44187a3b38f7Smrg	    *Sun\ C*)
44197a3b38f7Smrg	      # Sun C++ 5.9
442044dda7b2Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
442144dda7b2Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
442244dda7b2Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44237a3b38f7Smrg	      ;;
44247a3b38f7Smrg	    esac
44257a3b38f7Smrg	    ;;
44267a3b38f7Smrg	esac
44277a3b38f7Smrg	;;
442844dda7b2Smrg      lynxos*)
442944dda7b2Smrg	;;
443044dda7b2Smrg      m88k*)
443144dda7b2Smrg	;;
443244dda7b2Smrg      mvs*)
443344dda7b2Smrg	case $cc_basename in
443444dda7b2Smrg	  cxx*)
443544dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
443644dda7b2Smrg	    ;;
443744dda7b2Smrg	  *)
443844dda7b2Smrg	    ;;
443944dda7b2Smrg	esac
444044dda7b2Smrg	;;
444144dda7b2Smrg      netbsd*)
444244dda7b2Smrg	;;
444344dda7b2Smrg      *qnx* | *nto*)
444444dda7b2Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
444544dda7b2Smrg        # it will coredump.
444644dda7b2Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
444744dda7b2Smrg        ;;
444844dda7b2Smrg      osf3* | osf4* | osf5*)
444944dda7b2Smrg	case $cc_basename in
445044dda7b2Smrg	  KCC*)
445144dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
445244dda7b2Smrg	    ;;
445344dda7b2Smrg	  RCC*)
445444dda7b2Smrg	    # Rational C++ 2.4.1
445544dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
445644dda7b2Smrg	    ;;
445744dda7b2Smrg	  cxx*)
445844dda7b2Smrg	    # Digital/Compaq C++
445944dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
446044dda7b2Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
446144dda7b2Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
446244dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
446344dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
446444dda7b2Smrg	    ;;
446544dda7b2Smrg	  *)
446644dda7b2Smrg	    ;;
446744dda7b2Smrg	esac
446844dda7b2Smrg	;;
446944dda7b2Smrg      psos*)
44707a3b38f7Smrg	;;
447144dda7b2Smrg      solaris*)
447244dda7b2Smrg	case $cc_basename in
447344dda7b2Smrg	  CC* | sunCC*)
447444dda7b2Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
447544dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
447644dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
447744dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
447844dda7b2Smrg	    ;;
447944dda7b2Smrg	  gcx*)
448044dda7b2Smrg	    # Green Hills C++ Compiler
448144dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
448244dda7b2Smrg	    ;;
448344dda7b2Smrg	  *)
448444dda7b2Smrg	    ;;
448544dda7b2Smrg	esac
44867a3b38f7Smrg	;;
448744dda7b2Smrg      sunos4*)
448844dda7b2Smrg	case $cc_basename in
448944dda7b2Smrg	  CC*)
449044dda7b2Smrg	    # Sun C++ 4.x
449144dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
449244dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
449344dda7b2Smrg	    ;;
449444dda7b2Smrg	  lcc*)
449544dda7b2Smrg	    # Lucid
449644dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
44977a3b38f7Smrg	    ;;
44987a3b38f7Smrg	  *)
44997a3b38f7Smrg	    ;;
45007a3b38f7Smrg	esac
45017a3b38f7Smrg	;;
450244dda7b2Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
450344dda7b2Smrg	case $cc_basename in
450444dda7b2Smrg	  CC*)
450544dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
450644dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
450744dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
450844dda7b2Smrg	    ;;
450944dda7b2Smrg	esac
45107a3b38f7Smrg	;;
451144dda7b2Smrg      tandem*)
451244dda7b2Smrg	case $cc_basename in
451344dda7b2Smrg	  NCC*)
451444dda7b2Smrg	    # NonStop-UX NCC 3.20
451544dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
451644dda7b2Smrg	    ;;
451744dda7b2Smrg	  *)
451844dda7b2Smrg	    ;;
451944dda7b2Smrg	esac
45207a3b38f7Smrg	;;
452144dda7b2Smrg      vxworks*)
45227a3b38f7Smrg	;;
452344dda7b2Smrg      *)
452444dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
45257a3b38f7Smrg	;;
452644dda7b2Smrg    esac
452744dda7b2Smrg  fi
452844dda7b2Smrg],
452944dda7b2Smrg[
45306fc0178dSmrg  if test yes = "$GCC"; then
453144dda7b2Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
453244dda7b2Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4533ff559fabSmrg
453444dda7b2Smrg    case $host_os in
453544dda7b2Smrg      aix*)
453644dda7b2Smrg      # All AIX code is PIC.
45376fc0178dSmrg      if test ia64 = "$host_cpu"; then
453844dda7b2Smrg	# AIX 5 now supports IA64 processor
453944dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
454044dda7b2Smrg      fi
45416fc0178dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
454244dda7b2Smrg      ;;
4543ff559fabSmrg
454444dda7b2Smrg    amigaos*)
454544dda7b2Smrg      case $host_cpu in
454644dda7b2Smrg      powerpc)
454744dda7b2Smrg            # see comment about AmigaOS4 .so support
454844dda7b2Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
454944dda7b2Smrg        ;;
455044dda7b2Smrg      m68k)
455144dda7b2Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
45526fc0178dSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
45536fc0178dSmrg            # like '-m68040'.
455444dda7b2Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
455544dda7b2Smrg        ;;
455644dda7b2Smrg      esac
455744dda7b2Smrg      ;;
45587a3b38f7Smrg
455944dda7b2Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
456044dda7b2Smrg      # PIC is the default for these OSes.
456144dda7b2Smrg      ;;
45627a3b38f7Smrg
456344dda7b2Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
456444dda7b2Smrg      # This hack is so that the source file can tell whether it is being
456544dda7b2Smrg      # built for inclusion in a dll (and should export symbols for example).
456644dda7b2Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
456744dda7b2Smrg      # (--disable-auto-import) libraries
456844dda7b2Smrg      m4_if([$1], [GCJ], [],
456944dda7b2Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
45706fc0178dSmrg      case $host_os in
45716fc0178dSmrg      os2*)
45726fc0178dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
45736fc0178dSmrg	;;
45746fc0178dSmrg      esac
457544dda7b2Smrg      ;;
45767a3b38f7Smrg
457744dda7b2Smrg    darwin* | rhapsody*)
457844dda7b2Smrg      # PIC is the default on this platform
457944dda7b2Smrg      # Common symbols not allowed in MH_DYLIB files
458044dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
458144dda7b2Smrg      ;;
4582ff559fabSmrg
458344dda7b2Smrg    haiku*)
458444dda7b2Smrg      # PIC is the default for Haiku.
458544dda7b2Smrg      # The "-static" flag exists, but is broken.
458644dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
458744dda7b2Smrg      ;;
4588ff559fabSmrg
458944dda7b2Smrg    hpux*)
459044dda7b2Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
459144dda7b2Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
459244dda7b2Smrg      # sets the default TLS model and affects inlining.
459344dda7b2Smrg      case $host_cpu in
459444dda7b2Smrg      hppa*64*)
459544dda7b2Smrg	# +Z the default
459644dda7b2Smrg	;;
459744dda7b2Smrg      *)
459844dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
459944dda7b2Smrg	;;
460044dda7b2Smrg      esac
460144dda7b2Smrg      ;;
4602ff559fabSmrg
460344dda7b2Smrg    interix[[3-9]]*)
460444dda7b2Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
460544dda7b2Smrg      # Instead, we relocate shared libraries at runtime.
460644dda7b2Smrg      ;;
46077a3b38f7Smrg
460844dda7b2Smrg    msdosdjgpp*)
460944dda7b2Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
461044dda7b2Smrg      # on systems that don't support them.
461144dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
461244dda7b2Smrg      enable_shared=no
461344dda7b2Smrg      ;;
4614ff559fabSmrg
461544dda7b2Smrg    *nto* | *qnx*)
461644dda7b2Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
461744dda7b2Smrg      # it will coredump.
461844dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
461944dda7b2Smrg      ;;
4620ff559fabSmrg
462144dda7b2Smrg    sysv4*MP*)
462244dda7b2Smrg      if test -d /usr/nec; then
462344dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
462444dda7b2Smrg      fi
462544dda7b2Smrg      ;;
4626ff559fabSmrg
462744dda7b2Smrg    *)
462844dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
462944dda7b2Smrg      ;;
463044dda7b2Smrg    esac
46317a3b38f7Smrg
463244dda7b2Smrg    case $cc_basename in
463344dda7b2Smrg    nvcc*) # Cuda Compiler Driver 2.2
463444dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4635fc544a13Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4636fc544a13Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4637fc544a13Smrg      fi
463844dda7b2Smrg      ;;
463944dda7b2Smrg    esac
464044dda7b2Smrg  else
464144dda7b2Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
464244dda7b2Smrg    case $host_os in
464344dda7b2Smrg    aix*)
464444dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
46456fc0178dSmrg      if test ia64 = "$host_cpu"; then
464644dda7b2Smrg	# AIX 5 now supports IA64 processor
464744dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
464844dda7b2Smrg      else
464944dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
465044dda7b2Smrg      fi
465144dda7b2Smrg      ;;
46527a3b38f7Smrg
46536fc0178dSmrg    darwin* | rhapsody*)
46546fc0178dSmrg      # PIC is the default on this platform
46556fc0178dSmrg      # Common symbols not allowed in MH_DYLIB files
46566fc0178dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
46576fc0178dSmrg      case $cc_basename in
46586fc0178dSmrg      nagfor*)
46596fc0178dSmrg        # NAG Fortran compiler
46606fc0178dSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
46616fc0178dSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
46626fc0178dSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
46636fc0178dSmrg        ;;
46646fc0178dSmrg      esac
46656fc0178dSmrg      ;;
46666fc0178dSmrg
466744dda7b2Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
466844dda7b2Smrg      # This hack is so that the source file can tell whether it is being
466944dda7b2Smrg      # built for inclusion in a dll (and should export symbols for example).
467044dda7b2Smrg      m4_if([$1], [GCJ], [],
467144dda7b2Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
46726fc0178dSmrg      case $host_os in
46736fc0178dSmrg      os2*)
46746fc0178dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
46756fc0178dSmrg	;;
46766fc0178dSmrg      esac
467744dda7b2Smrg      ;;
46787a3b38f7Smrg
467944dda7b2Smrg    hpux9* | hpux10* | hpux11*)
468044dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
468144dda7b2Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
468244dda7b2Smrg      # not for PA HP-UX.
468344dda7b2Smrg      case $host_cpu in
468444dda7b2Smrg      hppa*64*|ia64*)
468544dda7b2Smrg	# +Z the default
468644dda7b2Smrg	;;
468744dda7b2Smrg      *)
468844dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
468944dda7b2Smrg	;;
469044dda7b2Smrg      esac
469144dda7b2Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
46926fc0178dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
469344dda7b2Smrg      ;;
4694ff559fabSmrg
469544dda7b2Smrg    irix5* | irix6* | nonstopux*)
469644dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
469744dda7b2Smrg      # PIC (with -KPIC) is the default.
469844dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
469944dda7b2Smrg      ;;
4700ff559fabSmrg
47016fc0178dSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
47027a3b38f7Smrg      case $cc_basename in
47036fc0178dSmrg      # old Intel for x86_64, which still supported -KPIC.
470444dda7b2Smrg      ecc*)
470544dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
470644dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
470744dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
470844dda7b2Smrg        ;;
470944dda7b2Smrg      # icc used to be incompatible with GCC.
471044dda7b2Smrg      # ICC 10 doesn't accept -KPIC any more.
471144dda7b2Smrg      icc* | ifort*)
471244dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
471344dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
471444dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
471544dda7b2Smrg        ;;
471644dda7b2Smrg      # Lahey Fortran 8.1.
471744dda7b2Smrg      lf95*)
471844dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
471944dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
472044dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
472144dda7b2Smrg	;;
4722862f5301Smrg      nagfor*)
4723862f5301Smrg	# NAG Fortran compiler
4724862f5301Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4725862f5301Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4726862f5301Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4727862f5301Smrg	;;
47286fc0178dSmrg      tcc*)
47296fc0178dSmrg	# Fabrice Bellard et al's Tiny C Compiler
47306fc0178dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47316fc0178dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
47326fc0178dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
47336fc0178dSmrg	;;
473444dda7b2Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
473544dda7b2Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
473644dda7b2Smrg	# which looks to be a dead project)
473744dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
473844dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
473944dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
474044dda7b2Smrg        ;;
474144dda7b2Smrg      ccc*)
474244dda7b2Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
474344dda7b2Smrg        # All Alpha code is PIC.
474444dda7b2Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
474544dda7b2Smrg        ;;
474644dda7b2Smrg      xl* | bgxl* | bgf* | mpixl*)
474744dda7b2Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
474844dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
474944dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
475044dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
475144dda7b2Smrg	;;
475244dda7b2Smrg      *)
475344dda7b2Smrg	case `$CC -V 2>&1 | sed 5q` in
4754fc544a13Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
475544dda7b2Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
475644dda7b2Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
475744dda7b2Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
475844dda7b2Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
47597a3b38f7Smrg	  ;;
4760fc544a13Smrg	*Sun\ F* | *Sun*Fortran*)
4761fc544a13Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4762fc544a13Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4763fc544a13Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4764fc544a13Smrg	  ;;
476544dda7b2Smrg	*Sun\ C*)
476644dda7b2Smrg	  # Sun C 5.9
476744dda7b2Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
476844dda7b2Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
476944dda7b2Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47707a3b38f7Smrg	  ;;
4771fc544a13Smrg        *Intel*\ [[CF]]*Compiler*)
4772fc544a13Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4773fc544a13Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4774fc544a13Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4775fc544a13Smrg	  ;;
4776fc544a13Smrg	*Portland\ Group*)
4777fc544a13Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4778fc544a13Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4779fc544a13Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4780fc544a13Smrg	  ;;
478144dda7b2Smrg	esac
478244dda7b2Smrg	;;
47837a3b38f7Smrg      esac
47847a3b38f7Smrg      ;;
4785ff559fabSmrg
478644dda7b2Smrg    newsos6)
478744dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
478844dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
478944dda7b2Smrg      ;;
4790ff559fabSmrg
479144dda7b2Smrg    *nto* | *qnx*)
479244dda7b2Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
479344dda7b2Smrg      # it will coredump.
479444dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
47957a3b38f7Smrg      ;;
4796ff559fabSmrg
479744dda7b2Smrg    osf3* | osf4* | osf5*)
479844dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
479944dda7b2Smrg      # All OSF/1 code is PIC.
480044dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
480144dda7b2Smrg      ;;
4802ff559fabSmrg
480344dda7b2Smrg    rdos*)
480444dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
480544dda7b2Smrg      ;;
4806ff559fabSmrg
480744dda7b2Smrg    solaris*)
480844dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
480944dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
481044dda7b2Smrg      case $cc_basename in
481144dda7b2Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
481244dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
48137a3b38f7Smrg      *)
481444dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
481544dda7b2Smrg      esac
481644dda7b2Smrg      ;;
4817ff559fabSmrg
481844dda7b2Smrg    sunos4*)
481944dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
482044dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
482144dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
482244dda7b2Smrg      ;;
48237a3b38f7Smrg
482444dda7b2Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
482544dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
482644dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
482744dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
482844dda7b2Smrg      ;;
48297a3b38f7Smrg
483044dda7b2Smrg    sysv4*MP*)
48316fc0178dSmrg      if test -d /usr/nec; then
483244dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
483344dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
483444dda7b2Smrg      fi
483544dda7b2Smrg      ;;
48367a3b38f7Smrg
483744dda7b2Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
483844dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
483944dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
484044dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
484144dda7b2Smrg      ;;
48427a3b38f7Smrg
484344dda7b2Smrg    unicos*)
484444dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
484544dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
484644dda7b2Smrg      ;;
4847ff559fabSmrg
484844dda7b2Smrg    uts4*)
484944dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
485044dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
485144dda7b2Smrg      ;;
4852ff559fabSmrg
485344dda7b2Smrg    *)
485444dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
485544dda7b2Smrg      ;;
485644dda7b2Smrg    esac
485744dda7b2Smrg  fi
485844dda7b2Smrg])
485944dda7b2Smrgcase $host_os in
48606fc0178dSmrg  # For platforms that do not support PIC, -DPIC is meaningless:
486144dda7b2Smrg  *djgpp*)
486244dda7b2Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
486344dda7b2Smrg    ;;
486444dda7b2Smrg  *)
486544dda7b2Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
486644dda7b2Smrg    ;;
486744dda7b2Smrgesac
4868862f5301Smrg
4869862f5301SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
4870862f5301Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4871862f5301Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4872862f5301Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4873ff559fabSmrg
487444dda7b2Smrg#
487544dda7b2Smrg# Check to make sure the PIC flag actually works.
487644dda7b2Smrg#
487744dda7b2Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
487844dda7b2Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
487944dda7b2Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
488044dda7b2Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
488144dda7b2Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
488244dda7b2Smrg     "" | " "*) ;;
488344dda7b2Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
488444dda7b2Smrg     esac],
488544dda7b2Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
488644dda7b2Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
488744dda7b2Smrgfi
488844dda7b2Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
488944dda7b2Smrg	[Additional compiler flags for building library objects])
4890ff559fabSmrg
4891862f5301Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4892862f5301Smrg	[How to pass a linker flag through the compiler])
489344dda7b2Smrg#
489444dda7b2Smrg# Check to make sure the static flag actually works.
489544dda7b2Smrg#
489644dda7b2Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
489744dda7b2Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
489844dda7b2Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
489944dda7b2Smrg  $lt_tmp_static_flag,
490044dda7b2Smrg  [],
490144dda7b2Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
490244dda7b2Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
490344dda7b2Smrg	[Compiler flag to prevent dynamic linking])
490444dda7b2Smrg])# _LT_COMPILER_PIC
49057a3b38f7Smrg
49067a3b38f7Smrg
490744dda7b2Smrg# _LT_LINKER_SHLIBS([TAGNAME])
490844dda7b2Smrg# ----------------------------
490944dda7b2Smrg# See if the linker supports building shared libraries.
491044dda7b2Smrgm4_defun([_LT_LINKER_SHLIBS],
491144dda7b2Smrg[AC_REQUIRE([LT_PATH_LD])dnl
491244dda7b2SmrgAC_REQUIRE([LT_PATH_NM])dnl
4913862f5301Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
491444dda7b2Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
491544dda7b2Smrgm4_require([_LT_DECL_EGREP])dnl
491644dda7b2Smrgm4_require([_LT_DECL_SED])dnl
491744dda7b2Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
491844dda7b2Smrgm4_require([_LT_TAG_COMPILER])dnl
491944dda7b2SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
492044dda7b2Smrgm4_if([$1], [CXX], [
492144dda7b2Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4922862f5301Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
492344dda7b2Smrg  case $host_os in
492444dda7b2Smrg  aix[[4-9]]*)
492544dda7b2Smrg    # If we're using GNU nm, then we don't want the "-C" option.
49266fc0178dSmrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
49276fc0178dSmrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
49286fc0178dSmrg    # weak defined symbols like other global defined symbols, whereas
49296fc0178dSmrg    # GNU nm marks them as "W".
49306fc0178dSmrg    # While the 'weak' keyword is ignored in the Export File, we need
49316fc0178dSmrg    # it in the Import File for the 'aix-soname' feature, so we have
49326fc0178dSmrg    # to replace the "-B" option with "-P" for AIX nm.
493344dda7b2Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
49346fc0178dSmrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
493544dda7b2Smrg    else
49366fc0178dSmrg      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
493744dda7b2Smrg    fi
493844dda7b2Smrg    ;;
493944dda7b2Smrg  pw32*)
49406fc0178dSmrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
4941862f5301Smrg    ;;
494244dda7b2Smrg  cygwin* | mingw* | cegcc*)
4943862f5301Smrg    case $cc_basename in
4944fc544a13Smrg    cl*)
4945fc544a13Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4946fc544a13Smrg      ;;
4947862f5301Smrg    *)
4948862f5301Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4949862f5301Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4950862f5301Smrg      ;;
4951862f5301Smrg    esac
4952862f5301Smrg    ;;
495344dda7b2Smrg  *)
495444dda7b2Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4955862f5301Smrg    ;;
495644dda7b2Smrg  esac
495744dda7b2Smrg], [
495844dda7b2Smrg  runpath_var=
495944dda7b2Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
496044dda7b2Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
496144dda7b2Smrg  _LT_TAGVAR(archive_cmds, $1)=
496244dda7b2Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
496344dda7b2Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
496444dda7b2Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
496544dda7b2Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
496644dda7b2Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
496744dda7b2Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
496844dda7b2Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
496944dda7b2Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
497044dda7b2Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
497144dda7b2Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
497244dda7b2Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
497344dda7b2Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
497444dda7b2Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
497544dda7b2Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
497644dda7b2Smrg  _LT_TAGVAR(module_cmds, $1)=
497744dda7b2Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
497844dda7b2Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
497944dda7b2Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
498044dda7b2Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
498144dda7b2Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
498244dda7b2Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
498344dda7b2Smrg  # included in the symbol list
498444dda7b2Smrg  _LT_TAGVAR(include_expsyms, $1)=
498544dda7b2Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
49866fc0178dSmrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
49876fc0178dSmrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
49886fc0178dSmrg  # as well as any symbol that contains 'd'.
498944dda7b2Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
499044dda7b2Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
499144dda7b2Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
499244dda7b2Smrg  # the symbol is explicitly referenced.  Since portable code cannot
499344dda7b2Smrg  # rely on this symbol name, it's probably fine to never include it in
499444dda7b2Smrg  # preloaded symbol tables.
499544dda7b2Smrg  # Exclude shared library initialization/finalization symbols.
499644dda7b2Smrgdnl Note also adjust exclude_expsyms for C++ above.
499744dda7b2Smrg  extract_expsyms_cmds=
499844dda7b2Smrg
499944dda7b2Smrg  case $host_os in
500044dda7b2Smrg  cygwin* | mingw* | pw32* | cegcc*)
500144dda7b2Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
500244dda7b2Smrg    # When not using gcc, we currently assume that we are using
500344dda7b2Smrg    # Microsoft Visual C++.
50046fc0178dSmrg    if test yes != "$GCC"; then
500544dda7b2Smrg      with_gnu_ld=no
500644dda7b2Smrg    fi
500744dda7b2Smrg    ;;
500844dda7b2Smrg  interix*)
500944dda7b2Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
501044dda7b2Smrg    with_gnu_ld=yes
501144dda7b2Smrg    ;;
50126fc0178dSmrg  openbsd* | bitrig*)
501344dda7b2Smrg    with_gnu_ld=no
501444dda7b2Smrg    ;;
501544dda7b2Smrg  esac
50167a3b38f7Smrg
501744dda7b2Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
50187a3b38f7Smrg
501944dda7b2Smrg  # On some targets, GNU ld is compatible enough with the native linker
502044dda7b2Smrg  # that we're better off using the native interface for both.
502144dda7b2Smrg  lt_use_gnu_ld_interface=no
50226fc0178dSmrg  if test yes = "$with_gnu_ld"; then
502344dda7b2Smrg    case $host_os in
502444dda7b2Smrg      aix*)
502544dda7b2Smrg	# The AIX port of GNU ld has always aspired to compatibility
502644dda7b2Smrg	# with the native linker.  However, as the warning in the GNU ld
502744dda7b2Smrg	# block says, versions before 2.19.5* couldn't really create working
502844dda7b2Smrg	# shared libraries, regardless of the interface used.
502944dda7b2Smrg	case `$LD -v 2>&1` in
503044dda7b2Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
503144dda7b2Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
503244dda7b2Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
503344dda7b2Smrg	  *)
503444dda7b2Smrg	    lt_use_gnu_ld_interface=yes
503544dda7b2Smrg	    ;;
503644dda7b2Smrg	esac
503744dda7b2Smrg	;;
503844dda7b2Smrg      *)
503944dda7b2Smrg	lt_use_gnu_ld_interface=yes
504044dda7b2Smrg	;;
504144dda7b2Smrg    esac
504244dda7b2Smrg  fi
50437a3b38f7Smrg
50446fc0178dSmrg  if test yes = "$lt_use_gnu_ld_interface"; then
504544dda7b2Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
50466fc0178dSmrg    wlarc='$wl'
50477a3b38f7Smrg
504844dda7b2Smrg    # Set some defaults for GNU ld with shared library support. These
504944dda7b2Smrg    # are reset later if shared libraries are not supported. Putting them
505044dda7b2Smrg    # here allows them to be overridden if necessary.
505144dda7b2Smrg    runpath_var=LD_RUN_PATH
50526fc0178dSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
50536fc0178dSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
505444dda7b2Smrg    # ancient GNU ld didn't support --whole-archive et. al.
505544dda7b2Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
50566fc0178dSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
505744dda7b2Smrg    else
505844dda7b2Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
505944dda7b2Smrg    fi
506044dda7b2Smrg    supports_anon_versioning=no
50616fc0178dSmrg    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
506244dda7b2Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
506344dda7b2Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
506444dda7b2Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
506544dda7b2Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
506644dda7b2Smrg      *\ 2.11.*) ;; # other 2.11 versions
506744dda7b2Smrg      *) supports_anon_versioning=yes ;;
506844dda7b2Smrg    esac
50697a3b38f7Smrg
507044dda7b2Smrg    # See if GNU ld supports shared libraries.
507144dda7b2Smrg    case $host_os in
507244dda7b2Smrg    aix[[3-9]]*)
507344dda7b2Smrg      # On AIX/PPC, the GNU linker is very broken
50746fc0178dSmrg      if test ia64 != "$host_cpu"; then
507544dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
507644dda7b2Smrg	cat <<_LT_EOF 1>&2
50777a3b38f7Smrg
507844dda7b2Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
507944dda7b2Smrg*** to be unable to reliably create shared libraries on AIX.
508044dda7b2Smrg*** Therefore, libtool is disabling shared libraries support.  If you
508144dda7b2Smrg*** really care for shared libraries, you may want to install binutils
508244dda7b2Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
508344dda7b2Smrg*** You will then need to restart the configuration process.
50847a3b38f7Smrg
508544dda7b2Smrg_LT_EOF
508644dda7b2Smrg      fi
508744dda7b2Smrg      ;;
50887a3b38f7Smrg
508944dda7b2Smrg    amigaos*)
509044dda7b2Smrg      case $host_cpu in
509144dda7b2Smrg      powerpc)
509244dda7b2Smrg            # see comment about AmigaOS4 .so support
50936fc0178dSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
509444dda7b2Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
509544dda7b2Smrg        ;;
509644dda7b2Smrg      m68k)
509744dda7b2Smrg            _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)'
509844dda7b2Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
509944dda7b2Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
510044dda7b2Smrg        ;;
510144dda7b2Smrg      esac
510244dda7b2Smrg      ;;
51037a3b38f7Smrg
510444dda7b2Smrg    beos*)
510544dda7b2Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
510644dda7b2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
510744dda7b2Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
510844dda7b2Smrg	# support --undefined.  This deserves some investigation.  FIXME
51096fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
511044dda7b2Smrg      else
511144dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
511244dda7b2Smrg      fi
511344dda7b2Smrg      ;;
51147a3b38f7Smrg
511544dda7b2Smrg    cygwin* | mingw* | pw32* | cegcc*)
511644dda7b2Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
511744dda7b2Smrg      # as there is no search path for DLLs.
511844dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
51196fc0178dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
512044dda7b2Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
512144dda7b2Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
512244dda7b2Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5123862f5301Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
5124862f5301Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
51257a3b38f7Smrg
512644dda7b2Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
51276fc0178dSmrg        _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'
51286fc0178dSmrg	# If the export-symbols file already is a .def file, use it as
51296fc0178dSmrg	# is; otherwise, prepend EXPORTS...
51306fc0178dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
51316fc0178dSmrg          cp $export_symbols $output_objdir/$soname.def;
51326fc0178dSmrg        else
51336fc0178dSmrg          echo EXPORTS > $output_objdir/$soname.def;
51346fc0178dSmrg          cat $export_symbols >> $output_objdir/$soname.def;
51356fc0178dSmrg        fi~
51366fc0178dSmrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
513744dda7b2Smrg      else
513844dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
513944dda7b2Smrg      fi
51407a3b38f7Smrg      ;;
51417a3b38f7Smrg
514244dda7b2Smrg    haiku*)
51436fc0178dSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
514444dda7b2Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
514544dda7b2Smrg      ;;
5146ff559fabSmrg
51476fc0178dSmrg    os2*)
51486fc0178dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
51496fc0178dSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
51506fc0178dSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51516fc0178dSmrg      shrext_cmds=.dll
51526fc0178dSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
51536fc0178dSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
51546fc0178dSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
51556fc0178dSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
51566fc0178dSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
51576fc0178dSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
51586fc0178dSmrg	emximp -o $lib $output_objdir/$libname.def'
51596fc0178dSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
51606fc0178dSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
51616fc0178dSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
51626fc0178dSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
51636fc0178dSmrg	prefix_cmds="$SED"~
51646fc0178dSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
51656fc0178dSmrg	  prefix_cmds="$prefix_cmds -e 1d";
51666fc0178dSmrg	fi~
51676fc0178dSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
51686fc0178dSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
51696fc0178dSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
51706fc0178dSmrg	emximp -o $lib $output_objdir/$libname.def'
51716fc0178dSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
51726fc0178dSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
51736fc0178dSmrg      ;;
51746fc0178dSmrg
517544dda7b2Smrg    interix[[3-9]]*)
517644dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
517744dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
51786fc0178dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
51796fc0178dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
518044dda7b2Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
518144dda7b2Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
518244dda7b2Smrg      # default) and relocated if they conflict, which is a slow very memory
518344dda7b2Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
518444dda7b2Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
518544dda7b2Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
51866fc0178dSmrg      _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'
51876fc0178dSmrg      _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'
51887a3b38f7Smrg      ;;
51897a3b38f7Smrg
519044dda7b2Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
519144dda7b2Smrg      tmp_diet=no
51926fc0178dSmrg      if test linux-dietlibc = "$host_os"; then
519344dda7b2Smrg	case $cc_basename in
519444dda7b2Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
519544dda7b2Smrg	esac
519644dda7b2Smrg      fi
519744dda7b2Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
51986fc0178dSmrg	 && test no = "$tmp_diet"
519944dda7b2Smrg      then
5200862f5301Smrg	tmp_addflag=' $pic_flag'
520144dda7b2Smrg	tmp_sharedflag='-shared'
520244dda7b2Smrg	case $cc_basename,$host_cpu in
520344dda7b2Smrg        pgcc*)				# Portland Group C compiler
52046fc0178dSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
520544dda7b2Smrg	  tmp_addflag=' $pic_flag'
520644dda7b2Smrg	  ;;
520744dda7b2Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
520844dda7b2Smrg					# Portland Group f77 and f90 compilers
52096fc0178dSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
521044dda7b2Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
521144dda7b2Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
521244dda7b2Smrg	  tmp_addflag=' -i_dynamic' ;;
521344dda7b2Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
521444dda7b2Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
521544dda7b2Smrg	ifc* | ifort*)			# Intel Fortran compiler
521644dda7b2Smrg	  tmp_addflag=' -nofor_main' ;;
521744dda7b2Smrg	lf95*)				# Lahey Fortran 8.1
521844dda7b2Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
521944dda7b2Smrg	  tmp_sharedflag='--shared' ;;
52206fc0178dSmrg        nagfor*)                        # NAGFOR 5.3
52216fc0178dSmrg          tmp_sharedflag='-Wl,-shared' ;;
522244dda7b2Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
522344dda7b2Smrg	  tmp_sharedflag='-qmkshrobj'
522444dda7b2Smrg	  tmp_addflag= ;;
522544dda7b2Smrg	nvcc*)	# Cuda Compiler Driver 2.2
52266fc0178dSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
522744dda7b2Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
522844dda7b2Smrg	  ;;
522944dda7b2Smrg	esac
523044dda7b2Smrg	case `$CC -V 2>&1 | sed 5q` in
523144dda7b2Smrg	*Sun\ C*)			# Sun C 5.9
52326fc0178dSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
523344dda7b2Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
523444dda7b2Smrg	  tmp_sharedflag='-G' ;;
523544dda7b2Smrg	*Sun\ F*)			# Sun Fortran 8.3
523644dda7b2Smrg	  tmp_sharedflag='-G' ;;
523744dda7b2Smrg	esac
52386fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5239ff559fabSmrg
52406fc0178dSmrg        if test yes = "$supports_anon_versioning"; then
524144dda7b2Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
52426fc0178dSmrg            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
52436fc0178dSmrg            echo "local: *; };" >> $output_objdir/$libname.ver~
52446fc0178dSmrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
524544dda7b2Smrg        fi
52467a3b38f7Smrg
524744dda7b2Smrg	case $cc_basename in
52486fc0178dSmrg	tcc*)
52496fc0178dSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
52506fc0178dSmrg	  ;;
525144dda7b2Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
525244dda7b2Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
525344dda7b2Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
52546fc0178dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
525544dda7b2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
52566fc0178dSmrg	  if test yes = "$supports_anon_versioning"; then
525744dda7b2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
52586fc0178dSmrg              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
52596fc0178dSmrg              echo "local: *; };" >> $output_objdir/$libname.ver~
52606fc0178dSmrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
526144dda7b2Smrg	  fi
526244dda7b2Smrg	  ;;
526344dda7b2Smrg	esac
526444dda7b2Smrg      else
526544dda7b2Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
526644dda7b2Smrg      fi
526744dda7b2Smrg      ;;
52687a3b38f7Smrg
526944dda7b2Smrg    netbsd*)
527044dda7b2Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
527144dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
527244dda7b2Smrg	wlarc=
527344dda7b2Smrg      else
52746fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
52756fc0178dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
527644dda7b2Smrg      fi
527744dda7b2Smrg      ;;
5278ff559fabSmrg
527944dda7b2Smrg    solaris*)
528044dda7b2Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
528144dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
528244dda7b2Smrg	cat <<_LT_EOF 1>&2
5283ff559fabSmrg
528444dda7b2Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
528544dda7b2Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
528644dda7b2Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
528744dda7b2Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
528844dda7b2Smrg*** your PATH or compiler configuration so that the native linker is
528944dda7b2Smrg*** used, and then restart.
5290ff559fabSmrg
529144dda7b2Smrg_LT_EOF
529244dda7b2Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
52936fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
52946fc0178dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
529544dda7b2Smrg      else
529644dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
529744dda7b2Smrg      fi
529844dda7b2Smrg      ;;
5299ff559fabSmrg
530044dda7b2Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
530144dda7b2Smrg      case `$LD -v 2>&1` in
530244dda7b2Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
530344dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
530444dda7b2Smrg	cat <<_LT_EOF 1>&2
5305ff559fabSmrg
53066fc0178dSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
530744dda7b2Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
530844dda7b2Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
530944dda7b2Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
531044dda7b2Smrg*** your PATH or compiler configuration so that the native linker is
531144dda7b2Smrg*** used, and then restart.
5312ff559fabSmrg
531344dda7b2Smrg_LT_EOF
531444dda7b2Smrg	;;
531544dda7b2Smrg	*)
531644dda7b2Smrg	  # For security reasons, it is highly recommended that you always
531744dda7b2Smrg	  # use absolute paths for naming shared libraries, and exclude the
531844dda7b2Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
531944dda7b2Smrg	  # requires that you compile everything twice, which is a pain.
532044dda7b2Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
53216fc0178dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
53226fc0178dSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
53236fc0178dSmrg	    _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'
532444dda7b2Smrg	  else
532544dda7b2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
532644dda7b2Smrg	  fi
532744dda7b2Smrg	;;
532844dda7b2Smrg      esac
532944dda7b2Smrg      ;;
53307a3b38f7Smrg
533144dda7b2Smrg    sunos4*)
533244dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
533344dda7b2Smrg      wlarc=
533444dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
533544dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
533644dda7b2Smrg      ;;
5337ff559fabSmrg
533844dda7b2Smrg    *)
533944dda7b2Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
53406fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
53416fc0178dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
534244dda7b2Smrg      else
534344dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
534444dda7b2Smrg      fi
534544dda7b2Smrg      ;;
534644dda7b2Smrg    esac
5347ff559fabSmrg
53486fc0178dSmrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
534944dda7b2Smrg      runpath_var=
535044dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
535144dda7b2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
535244dda7b2Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
535344dda7b2Smrg    fi
535444dda7b2Smrg  else
535544dda7b2Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
535644dda7b2Smrg    case $host_os in
535744dda7b2Smrg    aix3*)
535844dda7b2Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
535944dda7b2Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
536044dda7b2Smrg      _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'
536144dda7b2Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
536244dda7b2Smrg      # are no directories specified by -L.
536344dda7b2Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
53646fc0178dSmrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
536544dda7b2Smrg	# Neither direct hardcoding nor static linking is supported with a
536644dda7b2Smrg	# broken collect2.
536744dda7b2Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
536844dda7b2Smrg      fi
536944dda7b2Smrg      ;;
5370ff559fabSmrg
537144dda7b2Smrg    aix[[4-9]]*)
53726fc0178dSmrg      if test ia64 = "$host_cpu"; then
537344dda7b2Smrg	# On IA64, the linker does run time linking by default, so we don't
537444dda7b2Smrg	# have to do anything special.
537544dda7b2Smrg	aix_use_runtimelinking=no
537644dda7b2Smrg	exp_sym_flag='-Bexport'
53776fc0178dSmrg	no_entry_flag=
537844dda7b2Smrg      else
537944dda7b2Smrg	# If we're using GNU nm, then we don't want the "-C" option.
53806fc0178dSmrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
53816fc0178dSmrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
53826fc0178dSmrg	# weak defined symbols like other global defined symbols, whereas
53836fc0178dSmrg	# GNU nm marks them as "W".
53846fc0178dSmrg	# While the 'weak' keyword is ignored in the Export File, we need
53856fc0178dSmrg	# it in the Import File for the 'aix-soname' feature, so we have
53866fc0178dSmrg	# to replace the "-B" option with "-P" for AIX nm.
538744dda7b2Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
53886fc0178dSmrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
538944dda7b2Smrg	else
53906fc0178dSmrg	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
539144dda7b2Smrg	fi
539244dda7b2Smrg	aix_use_runtimelinking=no
5393ff559fabSmrg
539444dda7b2Smrg	# Test if we are trying to use run time linking or normal
539544dda7b2Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
53966fc0178dSmrg	# have runtime linking enabled, and use it for executables.
53976fc0178dSmrg	# For shared libraries, we enable/disable runtime linking
53986fc0178dSmrg	# depending on the kind of the shared library created -
53996fc0178dSmrg	# when "with_aix_soname,aix_use_runtimelinking" is:
54006fc0178dSmrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
54016fc0178dSmrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
54026fc0178dSmrg	#            lib.a           static archive
54036fc0178dSmrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
54046fc0178dSmrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
54056fc0178dSmrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
54066fc0178dSmrg	#            lib.a(lib.so.V) shared, rtl:no
54076fc0178dSmrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
54086fc0178dSmrg	#            lib.a           static archive
540944dda7b2Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
541044dda7b2Smrg	  for ld_flag in $LDFLAGS; do
54116fc0178dSmrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
541244dda7b2Smrg	    aix_use_runtimelinking=yes
541344dda7b2Smrg	    break
541444dda7b2Smrg	  fi
541544dda7b2Smrg	  done
54166fc0178dSmrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
54176fc0178dSmrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
54186fc0178dSmrg	    # so we don't have lib.a shared libs to link our executables.
54196fc0178dSmrg	    # We have to force runtime linking in this case.
54206fc0178dSmrg	    aix_use_runtimelinking=yes
54216fc0178dSmrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
54226fc0178dSmrg	  fi
542344dda7b2Smrg	  ;;
542444dda7b2Smrg	esac
5425ff559fabSmrg
542644dda7b2Smrg	exp_sym_flag='-bexport'
542744dda7b2Smrg	no_entry_flag='-bnoentry'
542844dda7b2Smrg      fi
54297a3b38f7Smrg
543044dda7b2Smrg      # When large executables or shared objects are built, AIX ld can
543144dda7b2Smrg      # have problems creating the table of contents.  If linking a library
543244dda7b2Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
543344dda7b2Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
543444dda7b2Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
54357a3b38f7Smrg
543644dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)=''
543744dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
543844dda7b2Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
543944dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
544044dda7b2Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
54416fc0178dSmrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
54426fc0178dSmrg      case $with_aix_soname,$aix_use_runtimelinking in
54436fc0178dSmrg      aix,*) ;; # traditional, no import file
54446fc0178dSmrg      svr4,* | *,yes) # use import file
54456fc0178dSmrg	# The Import File defines what to hardcode.
54466fc0178dSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
54476fc0178dSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
54486fc0178dSmrg	;;
54496fc0178dSmrg      esac
54507a3b38f7Smrg
54516fc0178dSmrg      if test yes = "$GCC"; then
545244dda7b2Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
545344dda7b2Smrg	# We only want to do this on AIX 4.2 and lower, the check
545444dda7b2Smrg	# below for broken collect2 doesn't work under 4.3+
54556fc0178dSmrg	  collect2name=`$CC -print-prog-name=collect2`
545644dda7b2Smrg	  if test -f "$collect2name" &&
545744dda7b2Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
545844dda7b2Smrg	  then
545944dda7b2Smrg	  # We have reworked collect2
546044dda7b2Smrg	  :
546144dda7b2Smrg	  else
546244dda7b2Smrg	  # We have old collect2
546344dda7b2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
546444dda7b2Smrg	  # It fails to find uninstalled libraries when the uninstalled
546544dda7b2Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
546644dda7b2Smrg	  # to unsupported forces relinking
546744dda7b2Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
546844dda7b2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
546944dda7b2Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
547044dda7b2Smrg	  fi
547144dda7b2Smrg	  ;;
547244dda7b2Smrg	esac
547344dda7b2Smrg	shared_flag='-shared'
54746fc0178dSmrg	if test yes = "$aix_use_runtimelinking"; then
54756fc0178dSmrg	  shared_flag="$shared_flag "'$wl-G'
547644dda7b2Smrg	fi
54776fc0178dSmrg	# Need to ensure runtime linking is disabled for the traditional
54786fc0178dSmrg	# shared library, or the linker may eventually find shared libraries
54796fc0178dSmrg	# /with/ Import File - we do not want to mix them.
54806fc0178dSmrg	shared_flag_aix='-shared'
54816fc0178dSmrg	shared_flag_svr4='-shared $wl-G'
548244dda7b2Smrg      else
548344dda7b2Smrg	# not using gcc
54846fc0178dSmrg	if test ia64 = "$host_cpu"; then
548544dda7b2Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
548644dda7b2Smrg	# chokes on -Wl,-G. The following line is correct:
548744dda7b2Smrg	  shared_flag='-G'
548844dda7b2Smrg	else
54896fc0178dSmrg	  if test yes = "$aix_use_runtimelinking"; then
54906fc0178dSmrg	    shared_flag='$wl-G'
549144dda7b2Smrg	  else
54926fc0178dSmrg	    shared_flag='$wl-bM:SRE'
549344dda7b2Smrg	  fi
54946fc0178dSmrg	  shared_flag_aix='$wl-bM:SRE'
54956fc0178dSmrg	  shared_flag_svr4='$wl-G'
549644dda7b2Smrg	fi
549744dda7b2Smrg      fi
54987a3b38f7Smrg
54996fc0178dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
550044dda7b2Smrg      # It seems that -bexpall does not export symbols beginning with
550144dda7b2Smrg      # underscore (_), so it is better to generate a list of symbols to export.
550244dda7b2Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
55036fc0178dSmrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
550444dda7b2Smrg	# Warning - without using the other runtime loading flags (-brtl),
550544dda7b2Smrg	# -berok will link without error, but may produce a broken library.
550644dda7b2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
550744dda7b2Smrg        # Determine the default libpath from the value encoded in an
550844dda7b2Smrg        # empty executable.
5509862f5301Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
55106fc0178dSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
55116fc0178dSmrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
551244dda7b2Smrg      else
55136fc0178dSmrg	if test ia64 = "$host_cpu"; then
55146fc0178dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
551544dda7b2Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
55166fc0178dSmrg	  _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"
551744dda7b2Smrg	else
551844dda7b2Smrg	 # Determine the default libpath from the value encoded in an
551944dda7b2Smrg	 # empty executable.
5520862f5301Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
55216fc0178dSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
552244dda7b2Smrg	  # Warning - without using the other run time loading flags,
552344dda7b2Smrg	  # -berok will link without error, but may produce a broken library.
55246fc0178dSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
55256fc0178dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
55266fc0178dSmrg	  if test yes = "$with_gnu_ld"; then
552744dda7b2Smrg	    # We only use this code for GNU lds that support --whole-archive.
55286fc0178dSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
552944dda7b2Smrg	  else
553044dda7b2Smrg	    # Exported symbols can be pulled into shared objects from archives
553144dda7b2Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
553244dda7b2Smrg	  fi
553344dda7b2Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
55346fc0178dSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
55356fc0178dSmrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
55366fc0178dSmrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
55376fc0178dSmrg	  if test svr4 != "$with_aix_soname"; then
55386fc0178dSmrg	    # This is similar to how AIX traditionally builds its shared libraries.
55396fc0178dSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
55406fc0178dSmrg	  fi
55416fc0178dSmrg	  if test aix != "$with_aix_soname"; then
55426fc0178dSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
55436fc0178dSmrg	  else
55446fc0178dSmrg	    # used by -dlpreopen to get the symbols
55456fc0178dSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
55466fc0178dSmrg	  fi
55476fc0178dSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
554844dda7b2Smrg	fi
554944dda7b2Smrg      fi
555044dda7b2Smrg      ;;
55517a3b38f7Smrg
555244dda7b2Smrg    amigaos*)
555344dda7b2Smrg      case $host_cpu in
555444dda7b2Smrg      powerpc)
555544dda7b2Smrg            # see comment about AmigaOS4 .so support
55566fc0178dSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
555744dda7b2Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
555844dda7b2Smrg        ;;
555944dda7b2Smrg      m68k)
556044dda7b2Smrg            _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)'
556144dda7b2Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
556244dda7b2Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
556344dda7b2Smrg        ;;
556444dda7b2Smrg      esac
556544dda7b2Smrg      ;;
55667a3b38f7Smrg
556744dda7b2Smrg    bsdi[[45]]*)
556844dda7b2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
556944dda7b2Smrg      ;;
5570ff559fabSmrg
557144dda7b2Smrg    cygwin* | mingw* | pw32* | cegcc*)
557244dda7b2Smrg      # When not using gcc, we currently assume that we are using
557344dda7b2Smrg      # Microsoft Visual C++.
557444dda7b2Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
557544dda7b2Smrg      # no search path for DLLs.
5576862f5301Smrg      case $cc_basename in
5577862f5301Smrg      cl*)
5578862f5301Smrg	# Native MSVC
5579862f5301Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5580862f5301Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5581862f5301Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
5582862f5301Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
5583862f5301Smrg	# Tell ltmain to make .lib files, not .a files.
5584862f5301Smrg	libext=lib
5585862f5301Smrg	# Tell ltmain to make .dll files, not .so files.
55866fc0178dSmrg	shrext_cmds=.dll
5587862f5301Smrg	# FIXME: Setting linknames here is a bad hack.
55886fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
55896fc0178dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
55906fc0178dSmrg            cp "$export_symbols" "$output_objdir/$soname.def";
55916fc0178dSmrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
55926fc0178dSmrg          else
55936fc0178dSmrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
55946fc0178dSmrg          fi~
55956fc0178dSmrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
55966fc0178dSmrg          linknames='
5597862f5301Smrg	# The linker will not automatically build a static lib if we build a DLL.
5598862f5301Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5599862f5301Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5600fc544a13Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5601862f5301Smrg	_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'
5602862f5301Smrg	# Don't use ranlib
5603862f5301Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5604862f5301Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
56056fc0178dSmrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
56066fc0178dSmrg          case $lt_outputfile in
56076fc0178dSmrg            *.exe|*.EXE) ;;
56086fc0178dSmrg            *)
56096fc0178dSmrg              lt_outputfile=$lt_outputfile.exe
56106fc0178dSmrg              lt_tool_outputfile=$lt_tool_outputfile.exe
56116fc0178dSmrg              ;;
56126fc0178dSmrg          esac~
56136fc0178dSmrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
56146fc0178dSmrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
56156fc0178dSmrg            $RM "$lt_outputfile.manifest";
56166fc0178dSmrg          fi'
5617862f5301Smrg	;;
5618862f5301Smrg      *)
5619862f5301Smrg	# Assume MSVC wrapper
5620862f5301Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5621862f5301Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5622862f5301Smrg	# Tell ltmain to make .lib files, not .a files.
5623862f5301Smrg	libext=lib
5624862f5301Smrg	# Tell ltmain to make .dll files, not .so files.
56256fc0178dSmrg	shrext_cmds=.dll
5626862f5301Smrg	# FIXME: Setting linknames here is a bad hack.
5627862f5301Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5628862f5301Smrg	# The linker will automatically build a .lib file if we build a DLL.
5629862f5301Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5630862f5301Smrg	# FIXME: Should let the user specify the lib program.
5631862f5301Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5632862f5301Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5633862f5301Smrg	;;
5634862f5301Smrg      esac
563544dda7b2Smrg      ;;
56367a3b38f7Smrg
563744dda7b2Smrg    darwin* | rhapsody*)
563844dda7b2Smrg      _LT_DARWIN_LINKER_FEATURES($1)
563944dda7b2Smrg      ;;
56407a3b38f7Smrg
564144dda7b2Smrg    dgux*)
564244dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5643fc544a13Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5644fc544a13Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
564544dda7b2Smrg      ;;
5646ff559fabSmrg
564744dda7b2Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
564844dda7b2Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
564944dda7b2Smrg    # does not break anything, and helps significantly (at the cost of a little
565044dda7b2Smrg    # extra space).
565144dda7b2Smrg    freebsd2.2*)
565244dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
565344dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
565444dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
565544dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
565644dda7b2Smrg      ;;
5657ff559fabSmrg
565844dda7b2Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5659fc544a13Smrg    freebsd2.*)
566044dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
566144dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
566244dda7b2Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
566344dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
566444dda7b2Smrg      ;;
56657a3b38f7Smrg
566644dda7b2Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
566744dda7b2Smrg    freebsd* | dragonfly*)
5668862f5301Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
566944dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
567044dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
567144dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
567244dda7b2Smrg      ;;
56737a3b38f7Smrg
567444dda7b2Smrg    hpux9*)
56756fc0178dSmrg      if test yes = "$GCC"; then
56766fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
567744dda7b2Smrg      else
56786fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
567944dda7b2Smrg      fi
56806fc0178dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
568144dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
568244dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56837a3b38f7Smrg
568444dda7b2Smrg      # hardcode_minus_L: Not really in the search PATH,
568544dda7b2Smrg      # but as the default location of the library.
568644dda7b2Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
56876fc0178dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
568844dda7b2Smrg      ;;
56897a3b38f7Smrg
569044dda7b2Smrg    hpux10*)
56916fc0178dSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
56926fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
569344dda7b2Smrg      else
569444dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
569544dda7b2Smrg      fi
56966fc0178dSmrg      if test no = "$with_gnu_ld"; then
56976fc0178dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
569844dda7b2Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
569944dda7b2Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
570044dda7b2Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
57016fc0178dSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
570244dda7b2Smrg	# hardcode_minus_L: Not really in the search PATH,
570344dda7b2Smrg	# but as the default location of the library.
570444dda7b2Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
570544dda7b2Smrg      fi
570644dda7b2Smrg      ;;
5707ff559fabSmrg
570844dda7b2Smrg    hpux11*)
57096fc0178dSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
571044dda7b2Smrg	case $host_cpu in
571144dda7b2Smrg	hppa*64*)
57126fc0178dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
571344dda7b2Smrg	  ;;
571444dda7b2Smrg	ia64*)
57156fc0178dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
571644dda7b2Smrg	  ;;
571744dda7b2Smrg	*)
57186fc0178dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
571944dda7b2Smrg	  ;;
572044dda7b2Smrg	esac
572144dda7b2Smrg      else
572244dda7b2Smrg	case $host_cpu in
572344dda7b2Smrg	hppa*64*)
57246fc0178dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
572544dda7b2Smrg	  ;;
572644dda7b2Smrg	ia64*)
57276fc0178dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
572844dda7b2Smrg	  ;;
572944dda7b2Smrg	*)
573044dda7b2Smrg	m4_if($1, [], [
573144dda7b2Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
573244dda7b2Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
573344dda7b2Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
573444dda7b2Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
57356fc0178dSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
573644dda7b2Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
57376fc0178dSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
573844dda7b2Smrg	  ;;
573944dda7b2Smrg	esac
574044dda7b2Smrg      fi
57416fc0178dSmrg      if test no = "$with_gnu_ld"; then
57426fc0178dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
574344dda7b2Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
57447a3b38f7Smrg
574544dda7b2Smrg	case $host_cpu in
574644dda7b2Smrg	hppa*64*|ia64*)
574744dda7b2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
574844dda7b2Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
574944dda7b2Smrg	  ;;
575044dda7b2Smrg	*)
575144dda7b2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
575244dda7b2Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
57536fc0178dSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
57547a3b38f7Smrg
575544dda7b2Smrg	  # hardcode_minus_L: Not really in the search PATH,
575644dda7b2Smrg	  # but as the default location of the library.
575744dda7b2Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
575844dda7b2Smrg	  ;;
575944dda7b2Smrg	esac
576044dda7b2Smrg      fi
576144dda7b2Smrg      ;;
57627a3b38f7Smrg
576344dda7b2Smrg    irix5* | irix6* | nonstopux*)
57646fc0178dSmrg      if test yes = "$GCC"; then
57656fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
576644dda7b2Smrg	# Try to use the -exported_symbol ld option, if it does not
576744dda7b2Smrg	# work, assume that -exports_file does not work either and
576844dda7b2Smrg	# implicitly export all symbols.
5769862f5301Smrg	# This should be the same for all languages, so no per-tag cache variable.
5770862f5301Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5771862f5301Smrg	  [lt_cv_irix_exported_symbol],
57726fc0178dSmrg	  [save_LDFLAGS=$LDFLAGS
57736fc0178dSmrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
5774862f5301Smrg	   AC_LINK_IFELSE(
5775862f5301Smrg	     [AC_LANG_SOURCE(
5776862f5301Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5777862f5301Smrg			      [C++], [[int foo (void) { return 0; }]],
5778862f5301Smrg			      [Fortran 77], [[
5779862f5301Smrg      subroutine foo
5780862f5301Smrg      end]],
5781862f5301Smrg			      [Fortran], [[
5782862f5301Smrg      subroutine foo
5783862f5301Smrg      end]])])],
5784862f5301Smrg	      [lt_cv_irix_exported_symbol=yes],
5785862f5301Smrg	      [lt_cv_irix_exported_symbol=no])
57866fc0178dSmrg           LDFLAGS=$save_LDFLAGS])
57876fc0178dSmrg	if test yes = "$lt_cv_irix_exported_symbol"; then
57886fc0178dSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
5789862f5301Smrg	fi
579044dda7b2Smrg      else
57916fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
57926fc0178dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
579344dda7b2Smrg      fi
579444dda7b2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
57956fc0178dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
579644dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
579744dda7b2Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
579844dda7b2Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
579944dda7b2Smrg      ;;
58007a3b38f7Smrg
58016fc0178dSmrg    linux*)
58026fc0178dSmrg      case $cc_basename in
58036fc0178dSmrg      tcc*)
58046fc0178dSmrg	# Fabrice Bellard et al's Tiny C Compiler
58056fc0178dSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
58066fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
58076fc0178dSmrg	;;
58086fc0178dSmrg      esac
58096fc0178dSmrg      ;;
58106fc0178dSmrg
581144dda7b2Smrg    netbsd*)
581244dda7b2Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
581344dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
581444dda7b2Smrg      else
581544dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
581644dda7b2Smrg      fi
581744dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
581844dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
581944dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
582044dda7b2Smrg      ;;
58217a3b38f7Smrg
582244dda7b2Smrg    newsos6)
582344dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
582444dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
58256fc0178dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
582644dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
582744dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
582844dda7b2Smrg      ;;
58297a3b38f7Smrg
583044dda7b2Smrg    *nto* | *qnx*)
583144dda7b2Smrg      ;;
58327a3b38f7Smrg
58336fc0178dSmrg    openbsd* | bitrig*)
583444dda7b2Smrg      if test -f /usr/libexec/ld.so; then
583544dda7b2Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
583644dda7b2Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
583744dda7b2Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
58386fc0178dSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
583944dda7b2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
58406fc0178dSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
58416fc0178dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
58426fc0178dSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
584344dda7b2Smrg	else
58446fc0178dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
58456fc0178dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5846ff559fabSmrg	fi
584744dda7b2Smrg      else
584844dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
584944dda7b2Smrg      fi
585044dda7b2Smrg      ;;
58517a3b38f7Smrg
585244dda7b2Smrg    os2*)
585344dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
585444dda7b2Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
585544dda7b2Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
58566fc0178dSmrg      shrext_cmds=.dll
58576fc0178dSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
58586fc0178dSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
58596fc0178dSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
58606fc0178dSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
58616fc0178dSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
58626fc0178dSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
58636fc0178dSmrg	emximp -o $lib $output_objdir/$libname.def'
58646fc0178dSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
58656fc0178dSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
58666fc0178dSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
58676fc0178dSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
58686fc0178dSmrg	prefix_cmds="$SED"~
58696fc0178dSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
58706fc0178dSmrg	  prefix_cmds="$prefix_cmds -e 1d";
58716fc0178dSmrg	fi~
58726fc0178dSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
58736fc0178dSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
58746fc0178dSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
58756fc0178dSmrg	emximp -o $lib $output_objdir/$libname.def'
58766fc0178dSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
58776fc0178dSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
587844dda7b2Smrg      ;;
58797a3b38f7Smrg
588044dda7b2Smrg    osf3*)
58816fc0178dSmrg      if test yes = "$GCC"; then
58826fc0178dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
58836fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
588444dda7b2Smrg      else
588544dda7b2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
58866fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
588744dda7b2Smrg      fi
588844dda7b2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
58896fc0178dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
589044dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
589144dda7b2Smrg      ;;
58927a3b38f7Smrg
589344dda7b2Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
58946fc0178dSmrg      if test yes = "$GCC"; then
58956fc0178dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
58966fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
58976fc0178dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
589844dda7b2Smrg      else
589944dda7b2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
59006fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
590144dda7b2Smrg	_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~
59026fc0178dSmrg          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
59037a3b38f7Smrg
590444dda7b2Smrg	# Both c and cxx compiler support -rpath directly
590544dda7b2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
590644dda7b2Smrg      fi
590744dda7b2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
590844dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
590944dda7b2Smrg      ;;
59107a3b38f7Smrg
591144dda7b2Smrg    solaris*)
591244dda7b2Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
59136fc0178dSmrg      if test yes = "$GCC"; then
59146fc0178dSmrg	wlarc='$wl'
59156fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
591644dda7b2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
59176fc0178dSmrg          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
591844dda7b2Smrg      else
591944dda7b2Smrg	case `$CC -V 2>&1` in
592044dda7b2Smrg	*"Compilers 5.0"*)
592144dda7b2Smrg	  wlarc=''
59226fc0178dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
592344dda7b2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
59246fc0178dSmrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
592544dda7b2Smrg	  ;;
592644dda7b2Smrg	*)
59276fc0178dSmrg	  wlarc='$wl'
59286fc0178dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
592944dda7b2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
59306fc0178dSmrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
593144dda7b2Smrg	  ;;
593244dda7b2Smrg	esac
593344dda7b2Smrg      fi
593444dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
593544dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
593644dda7b2Smrg      case $host_os in
593744dda7b2Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
593844dda7b2Smrg      *)
593944dda7b2Smrg	# The compiler driver will combine and reorder linker options,
59406fc0178dSmrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
594144dda7b2Smrg	# but is careful enough not to reorder.
594244dda7b2Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
59436fc0178dSmrg	if test yes = "$GCC"; then
59446fc0178dSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
594544dda7b2Smrg	else
594644dda7b2Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
594744dda7b2Smrg	fi
594844dda7b2Smrg	;;
594944dda7b2Smrg      esac
595044dda7b2Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
595144dda7b2Smrg      ;;
5952ff559fabSmrg
595344dda7b2Smrg    sunos4*)
59546fc0178dSmrg      if test sequent = "$host_vendor"; then
595544dda7b2Smrg	# Use $CC to link under sequent, because it throws in some extra .o
595644dda7b2Smrg	# files that make .init and .fini sections work.
59576fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
595844dda7b2Smrg      else
595944dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
596044dda7b2Smrg      fi
596144dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
596244dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
596344dda7b2Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
596444dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
596544dda7b2Smrg      ;;
5966ff559fabSmrg
596744dda7b2Smrg    sysv4)
596844dda7b2Smrg      case $host_vendor in
596944dda7b2Smrg	sni)
597044dda7b2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
597144dda7b2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
597244dda7b2Smrg	;;
597344dda7b2Smrg	siemens)
597444dda7b2Smrg	  ## LD is ld it makes a PLAMLIB
597544dda7b2Smrg	  ## CC just makes a GrossModule.
597644dda7b2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
597744dda7b2Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
597844dda7b2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
597944dda7b2Smrg        ;;
598044dda7b2Smrg	motorola)
598144dda7b2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
598244dda7b2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
598344dda7b2Smrg	;;
598444dda7b2Smrg      esac
598544dda7b2Smrg      runpath_var='LD_RUN_PATH'
598644dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
598744dda7b2Smrg      ;;
5988ff559fabSmrg
598944dda7b2Smrg    sysv4.3*)
599044dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
599144dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
599244dda7b2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
599344dda7b2Smrg      ;;
5994ff559fabSmrg
599544dda7b2Smrg    sysv4*MP*)
599644dda7b2Smrg      if test -d /usr/nec; then
599744dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
599844dda7b2Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
599944dda7b2Smrg	runpath_var=LD_RUN_PATH
600044dda7b2Smrg	hardcode_runpath_var=yes
600144dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
600244dda7b2Smrg      fi
600344dda7b2Smrg      ;;
6004ff559fabSmrg
600544dda7b2Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
60066fc0178dSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
600744dda7b2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
600844dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
600944dda7b2Smrg      runpath_var='LD_RUN_PATH'
6010ff559fabSmrg
60116fc0178dSmrg      if test yes = "$GCC"; then
60126fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60136fc0178dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
601444dda7b2Smrg      else
60156fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60166fc0178dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
601744dda7b2Smrg      fi
601844dda7b2Smrg      ;;
6019ff559fabSmrg
602044dda7b2Smrg    sysv5* | sco3.2v5* | sco5v6*)
60216fc0178dSmrg      # Note: We CANNOT use -z defs as we might desire, because we do not
602244dda7b2Smrg      # link with -lc, and that would cause any symbols used from libc to
602344dda7b2Smrg      # always be unresolved, which means just about no library would
602444dda7b2Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
602544dda7b2Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
602644dda7b2Smrg      # as -z defs.
60276fc0178dSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
60286fc0178dSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
602944dda7b2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
603044dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60316fc0178dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
603244dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
603344dda7b2Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
60346fc0178dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
603544dda7b2Smrg      runpath_var='LD_RUN_PATH'
60367a3b38f7Smrg
60376fc0178dSmrg      if test yes = "$GCC"; then
60386fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60396fc0178dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
604044dda7b2Smrg      else
60416fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60426fc0178dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
604344dda7b2Smrg      fi
604444dda7b2Smrg      ;;
60457a3b38f7Smrg
604644dda7b2Smrg    uts4*)
604744dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
604844dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
604944dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
605044dda7b2Smrg      ;;
60517a3b38f7Smrg
605244dda7b2Smrg    *)
605344dda7b2Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
605444dda7b2Smrg      ;;
605544dda7b2Smrg    esac
60567a3b38f7Smrg
60576fc0178dSmrg    if test sni = "$host_vendor"; then
605844dda7b2Smrg      case $host in
605944dda7b2Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
60606fc0178dSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
606144dda7b2Smrg	;;
606244dda7b2Smrg      esac
606344dda7b2Smrg    fi
606444dda7b2Smrg  fi
606544dda7b2Smrg])
606644dda7b2SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
60676fc0178dSmrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
60687a3b38f7Smrg
606944dda7b2Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
60707a3b38f7Smrg
607144dda7b2Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
607244dda7b2Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
607344dda7b2Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
607444dda7b2Smrg    [The commands to extract the exported symbol list from a shared archive])
60757a3b38f7Smrg
607644dda7b2Smrg#
607744dda7b2Smrg# Do we need to explicitly link libc?
607844dda7b2Smrg#
607944dda7b2Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
608044dda7b2Smrgx|xyes)
608144dda7b2Smrg  # Assume -lc should be added
608244dda7b2Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
60837a3b38f7Smrg
60846fc0178dSmrg  if test yes,yes = "$GCC,$enable_shared"; then
608544dda7b2Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
608644dda7b2Smrg    *'~'*)
608744dda7b2Smrg      # FIXME: we may have to deal with multi-command sequences.
608844dda7b2Smrg      ;;
608944dda7b2Smrg    '$CC '*)
609044dda7b2Smrg      # Test whether the compiler implicitly links with -lc since on some
609144dda7b2Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
609244dda7b2Smrg      # to ld, don't add -lc before -lgcc.
609344dda7b2Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
609444dda7b2Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
609544dda7b2Smrg	[$RM conftest*
609644dda7b2Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
609744dda7b2Smrg
609844dda7b2Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
609944dda7b2Smrg	  soname=conftest
610044dda7b2Smrg	  lib=conftest
610144dda7b2Smrg	  libobjs=conftest.$ac_objext
610244dda7b2Smrg	  deplibs=
610344dda7b2Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
610444dda7b2Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
610544dda7b2Smrg	  compiler_flags=-v
610644dda7b2Smrg	  linker_flags=-v
610744dda7b2Smrg	  verstring=
610844dda7b2Smrg	  output_objdir=.
610944dda7b2Smrg	  libname=conftest
611044dda7b2Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
611144dda7b2Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
611244dda7b2Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
611344dda7b2Smrg	  then
611444dda7b2Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
611544dda7b2Smrg	  else
611644dda7b2Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
611744dda7b2Smrg	  fi
611844dda7b2Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
611944dda7b2Smrg	else
612044dda7b2Smrg	  cat conftest.err 1>&5
612144dda7b2Smrg	fi
612244dda7b2Smrg	$RM conftest*
612344dda7b2Smrg	])
612444dda7b2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
612544dda7b2Smrg      ;;
612644dda7b2Smrg    esac
612744dda7b2Smrg  fi
612844dda7b2Smrg  ;;
612944dda7b2Smrgesac
61307a3b38f7Smrg
613144dda7b2Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
613244dda7b2Smrg    [Whether or not to add -lc for building shared libraries])
613344dda7b2Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
613444dda7b2Smrg    [enable_shared_with_static_runtimes], [0],
613544dda7b2Smrg    [Whether or not to disallow shared libs when runtime libs are static])
613644dda7b2Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
613744dda7b2Smrg    [Compiler flag to allow reflexive dlopens])
613844dda7b2Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
613944dda7b2Smrg    [Compiler flag to generate shared objects directly from archives])
614044dda7b2Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
614144dda7b2Smrg    [Whether the compiler copes with passing no objects directly])
614244dda7b2Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
614344dda7b2Smrg    [Create an old-style archive from a shared archive])
614444dda7b2Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
614544dda7b2Smrg    [Create a temporary old-style archive to link instead of a shared archive])
614644dda7b2Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
614744dda7b2Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
614844dda7b2Smrg_LT_TAGDECL([], [module_cmds], [2],
614944dda7b2Smrg    [Commands used to build a loadable module if different from building
615044dda7b2Smrg    a shared archive.])
615144dda7b2Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
615244dda7b2Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
615344dda7b2Smrg    [Whether we are building with GNU ld or not])
615444dda7b2Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
615544dda7b2Smrg    [Flag that allows shared libraries with undefined symbols to be built])
615644dda7b2Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
615744dda7b2Smrg    [Flag that enforces no undefined symbols])
615844dda7b2Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
615944dda7b2Smrg    [Flag to hardcode $libdir into a binary during linking.
616044dda7b2Smrg    This must work even if $libdir does not exist])
616144dda7b2Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
616244dda7b2Smrg    [Whether we need a single "-rpath" flag with a separated argument])
616344dda7b2Smrg_LT_TAGDECL([], [hardcode_direct], [0],
61646fc0178dSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
616544dda7b2Smrg    DIR into the resulting binary])
616644dda7b2Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
61676fc0178dSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
616844dda7b2Smrg    DIR into the resulting binary and the resulting library dependency is
61696fc0178dSmrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
617044dda7b2Smrg    library is relocated])
617144dda7b2Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
617244dda7b2Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
617344dda7b2Smrg    into the resulting binary])
617444dda7b2Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
617544dda7b2Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
617644dda7b2Smrg    into the resulting binary])
617744dda7b2Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
617844dda7b2Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
617944dda7b2Smrg    into the library and all subsequent libraries and executables linked
618044dda7b2Smrg    against it])
618144dda7b2Smrg_LT_TAGDECL([], [inherit_rpath], [0],
618244dda7b2Smrg    [Set to yes if linker adds runtime paths of dependent libraries
618344dda7b2Smrg    to runtime path list])
618444dda7b2Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
618544dda7b2Smrg    [Whether libtool must link a program against all its dependency libraries])
618644dda7b2Smrg_LT_TAGDECL([], [always_export_symbols], [0],
618744dda7b2Smrg    [Set to "yes" if exported symbols are required])
618844dda7b2Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
618944dda7b2Smrg    [The commands to list exported symbols])
619044dda7b2Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
619144dda7b2Smrg    [Symbols that should not be listed in the preloaded symbols])
619244dda7b2Smrg_LT_TAGDECL([], [include_expsyms], [1],
619344dda7b2Smrg    [Symbols that must always be exported])
619444dda7b2Smrg_LT_TAGDECL([], [prelink_cmds], [2],
619544dda7b2Smrg    [Commands necessary for linking programs (against libraries) with templates])
6196862f5301Smrg_LT_TAGDECL([], [postlink_cmds], [2],
6197862f5301Smrg    [Commands necessary for finishing linking programs])
619844dda7b2Smrg_LT_TAGDECL([], [file_list_spec], [1],
619944dda7b2Smrg    [Specify filename containing input files])
620044dda7b2Smrgdnl FIXME: Not yet implemented
620144dda7b2Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
620244dda7b2Smrgdnl    [Compiler flag to generate thread safe objects])
620344dda7b2Smrg])# _LT_LINKER_SHLIBS
62047a3b38f7Smrg
62057a3b38f7Smrg
620644dda7b2Smrg# _LT_LANG_C_CONFIG([TAG])
620744dda7b2Smrg# ------------------------
620844dda7b2Smrg# Ensure that the configuration variables for a C compiler are suitably
620944dda7b2Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
62106fc0178dSmrg# the compiler configuration to 'libtool'.
621144dda7b2Smrgm4_defun([_LT_LANG_C_CONFIG],
621244dda7b2Smrg[m4_require([_LT_DECL_EGREP])dnl
62136fc0178dSmrglt_save_CC=$CC
621444dda7b2SmrgAC_LANG_PUSH(C)
62157a3b38f7Smrg
621644dda7b2Smrg# Source file extension for C test sources.
621744dda7b2Smrgac_ext=c
62187a3b38f7Smrg
621944dda7b2Smrg# Object file extension for compiled C test sources.
62207a3b38f7Smrgobjext=o
62217a3b38f7Smrg_LT_TAGVAR(objext, $1)=$objext
62227a3b38f7Smrg
62237a3b38f7Smrg# Code to be used in simple compile tests
622444dda7b2Smrglt_simple_compile_test_code="int some_variable = 0;"
62257a3b38f7Smrg
62267a3b38f7Smrg# Code to be used in simple link tests
622744dda7b2Smrglt_simple_link_test_code='int main(){return(0);}'
62287a3b38f7Smrg
62297a3b38f7Smrg_LT_TAG_COMPILER
623044dda7b2Smrg# Save the default compiler, since it gets overwritten when the other
623144dda7b2Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
623244dda7b2Smrgcompiler_DEFAULT=$CC
62337a3b38f7Smrg
62347a3b38f7Smrg# save warnings/boilerplate of simple test code
62357a3b38f7Smrg_LT_COMPILER_BOILERPLATE
62367a3b38f7Smrg_LT_LINKER_BOILERPLATE
62377a3b38f7Smrg
62387a3b38f7Smrgif test -n "$compiler"; then
623944dda7b2Smrg  _LT_COMPILER_NO_RTTI($1)
624044dda7b2Smrg  _LT_COMPILER_PIC($1)
624144dda7b2Smrg  _LT_COMPILER_C_O($1)
624244dda7b2Smrg  _LT_COMPILER_FILE_LOCKS($1)
624344dda7b2Smrg  _LT_LINKER_SHLIBS($1)
624444dda7b2Smrg  _LT_SYS_DYNAMIC_LINKER($1)
624544dda7b2Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
624644dda7b2Smrg  LT_SYS_DLOPEN_SELF
624744dda7b2Smrg  _LT_CMD_STRIPLIB
62487a3b38f7Smrg
62496fc0178dSmrg  # Report what library types will actually be built
625044dda7b2Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
625144dda7b2Smrg  AC_MSG_RESULT([$can_build_shared])
62527a3b38f7Smrg
625344dda7b2Smrg  AC_MSG_CHECKING([whether to build shared libraries])
62546fc0178dSmrg  test no = "$can_build_shared" && enable_shared=no
62557a3b38f7Smrg
625644dda7b2Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
625744dda7b2Smrg  # are all built from PIC.
625844dda7b2Smrg  case $host_os in
625944dda7b2Smrg  aix3*)
62606fc0178dSmrg    test yes = "$enable_shared" && enable_static=no
626144dda7b2Smrg    if test -n "$RANLIB"; then
626244dda7b2Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
626344dda7b2Smrg      postinstall_cmds='$RANLIB $lib'
626444dda7b2Smrg    fi
626544dda7b2Smrg    ;;
62667a3b38f7Smrg
626744dda7b2Smrg  aix[[4-9]]*)
62686fc0178dSmrg    if test ia64 != "$host_cpu"; then
62696fc0178dSmrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
62706fc0178dSmrg      yes,aix,yes) ;;			# shared object as lib.so file only
62716fc0178dSmrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
62726fc0178dSmrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
62736fc0178dSmrg      esac
627444dda7b2Smrg    fi
627544dda7b2Smrg    ;;
62767a3b38f7Smrg  esac
627744dda7b2Smrg  AC_MSG_RESULT([$enable_shared])
62787a3b38f7Smrg
627944dda7b2Smrg  AC_MSG_CHECKING([whether to build static libraries])
628044dda7b2Smrg  # Make sure either enable_shared or enable_static is yes.
62816fc0178dSmrg  test yes = "$enable_shared" || enable_static=yes
628244dda7b2Smrg  AC_MSG_RESULT([$enable_static])
62837a3b38f7Smrg
628444dda7b2Smrg  _LT_CONFIG($1)
628544dda7b2Smrgfi
628644dda7b2SmrgAC_LANG_POP
62876fc0178dSmrgCC=$lt_save_CC
628844dda7b2Smrg])# _LT_LANG_C_CONFIG
62897a3b38f7Smrg
62907a3b38f7Smrg
629144dda7b2Smrg# _LT_LANG_CXX_CONFIG([TAG])
629244dda7b2Smrg# --------------------------
629344dda7b2Smrg# Ensure that the configuration variables for a C++ compiler are suitably
629444dda7b2Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
62956fc0178dSmrg# the compiler configuration to 'libtool'.
629644dda7b2Smrgm4_defun([_LT_LANG_CXX_CONFIG],
629744dda7b2Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
629844dda7b2Smrgm4_require([_LT_DECL_EGREP])dnl
6299862f5301Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
63006fc0178dSmrgif test -n "$CXX" && ( test no != "$CXX" &&
63016fc0178dSmrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
63026fc0178dSmrg    (test g++ != "$CXX"))); then
630344dda7b2Smrg  AC_PROG_CXXCPP
630444dda7b2Smrgelse
630544dda7b2Smrg  _lt_caught_CXX_error=yes
630644dda7b2Smrgfi
63077a3b38f7Smrg
630844dda7b2SmrgAC_LANG_PUSH(C++)
630944dda7b2Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
631044dda7b2Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
631144dda7b2Smrg_LT_TAGVAR(always_export_symbols, $1)=no
631244dda7b2Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
631344dda7b2Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
631444dda7b2Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
631544dda7b2Smrg_LT_TAGVAR(hardcode_direct, $1)=no
631644dda7b2Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
631744dda7b2Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
631844dda7b2Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
631944dda7b2Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
632044dda7b2Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
632144dda7b2Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
632244dda7b2Smrg_LT_TAGVAR(inherit_rpath, $1)=no
632344dda7b2Smrg_LT_TAGVAR(module_cmds, $1)=
632444dda7b2Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
632544dda7b2Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
632644dda7b2Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
632744dda7b2Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
632844dda7b2Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
632944dda7b2Smrg_LT_TAGVAR(no_undefined_flag, $1)=
633044dda7b2Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
633144dda7b2Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
63327a3b38f7Smrg
633344dda7b2Smrg# Source file extension for C++ test sources.
633444dda7b2Smrgac_ext=cpp
63357a3b38f7Smrg
633644dda7b2Smrg# Object file extension for compiled C++ test sources.
633744dda7b2Smrgobjext=o
633844dda7b2Smrg_LT_TAGVAR(objext, $1)=$objext
63397a3b38f7Smrg
634044dda7b2Smrg# No sense in running all these tests if we already determined that
634144dda7b2Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
634244dda7b2Smrg# are currently assumed to apply to all compilers on this platform,
634344dda7b2Smrg# and will be corrupted by setting them based on a non-working compiler.
63446fc0178dSmrgif test yes != "$_lt_caught_CXX_error"; then
634544dda7b2Smrg  # Code to be used in simple compile tests
634644dda7b2Smrg  lt_simple_compile_test_code="int some_variable = 0;"
63477a3b38f7Smrg
634844dda7b2Smrg  # Code to be used in simple link tests
634944dda7b2Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
63507a3b38f7Smrg
635144dda7b2Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
635244dda7b2Smrg  _LT_TAG_COMPILER
63537a3b38f7Smrg
635444dda7b2Smrg  # save warnings/boilerplate of simple test code
635544dda7b2Smrg  _LT_COMPILER_BOILERPLATE
635644dda7b2Smrg  _LT_LINKER_BOILERPLATE
63577a3b38f7Smrg
635844dda7b2Smrg  # Allow CC to be a program name with arguments.
635944dda7b2Smrg  lt_save_CC=$CC
6360862f5301Smrg  lt_save_CFLAGS=$CFLAGS
636144dda7b2Smrg  lt_save_LD=$LD
636244dda7b2Smrg  lt_save_GCC=$GCC
636344dda7b2Smrg  GCC=$GXX
636444dda7b2Smrg  lt_save_with_gnu_ld=$with_gnu_ld
636544dda7b2Smrg  lt_save_path_LD=$lt_cv_path_LD
636644dda7b2Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
636744dda7b2Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
636844dda7b2Smrg  else
636944dda7b2Smrg    $as_unset lt_cv_prog_gnu_ld
637044dda7b2Smrg  fi
637144dda7b2Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
637244dda7b2Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
637344dda7b2Smrg  else
637444dda7b2Smrg    $as_unset lt_cv_path_LD
637544dda7b2Smrg  fi
637644dda7b2Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
637744dda7b2Smrg  CC=${CXX-"c++"}
6378862f5301Smrg  CFLAGS=$CXXFLAGS
637944dda7b2Smrg  compiler=$CC
638044dda7b2Smrg  _LT_TAGVAR(compiler, $1)=$CC
638144dda7b2Smrg  _LT_CC_BASENAME([$compiler])
63827a3b38f7Smrg
638344dda7b2Smrg  if test -n "$compiler"; then
638444dda7b2Smrg    # We don't want -fno-exception when compiling C++ code, so set the
638544dda7b2Smrg    # no_builtin_flag separately
63866fc0178dSmrg    if test yes = "$GXX"; then
638744dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
638844dda7b2Smrg    else
638944dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
639044dda7b2Smrg    fi
63917a3b38f7Smrg
63926fc0178dSmrg    if test yes = "$GXX"; then
639344dda7b2Smrg      # Set up default GNU C++ configuration
63947a3b38f7Smrg
639544dda7b2Smrg      LT_PATH_LD
63967a3b38f7Smrg
639744dda7b2Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
639844dda7b2Smrg      # archiving commands below assume that GNU ld is being used.
63996fc0178dSmrg      if test yes = "$with_gnu_ld"; then
64006fc0178dSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
64016fc0178dSmrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
64027a3b38f7Smrg
64036fc0178dSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
64046fc0178dSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
64057a3b38f7Smrg
640644dda7b2Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
640744dda7b2Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
640844dda7b2Smrg        #     investigate it a little bit more. (MM)
64096fc0178dSmrg        wlarc='$wl'
64107a3b38f7Smrg
641144dda7b2Smrg        # ancient GNU ld didn't support --whole-archive et. al.
641244dda7b2Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
641344dda7b2Smrg	  $GREP 'no-whole-archive' > /dev/null; then
64146fc0178dSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
641544dda7b2Smrg        else
641644dda7b2Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
641744dda7b2Smrg        fi
641844dda7b2Smrg      else
641944dda7b2Smrg        with_gnu_ld=no
642044dda7b2Smrg        wlarc=
64217a3b38f7Smrg
642244dda7b2Smrg        # A generic and very simple default shared library creation
642344dda7b2Smrg        # command for GNU C++ for the case where it uses the native
642444dda7b2Smrg        # linker, instead of GNU ld.  If possible, this setting should
642544dda7b2Smrg        # overridden to take advantage of the native linker features on
642644dda7b2Smrg        # the platform it is being used on.
642744dda7b2Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
642844dda7b2Smrg      fi
64297a3b38f7Smrg
643044dda7b2Smrg      # Commands to make compiler produce verbose output that lists
643144dda7b2Smrg      # what "hidden" libraries, object files and flags are used when
643244dda7b2Smrg      # linking a shared library.
643344dda7b2Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
64347a3b38f7Smrg
643544dda7b2Smrg    else
643644dda7b2Smrg      GXX=no
643744dda7b2Smrg      with_gnu_ld=no
643844dda7b2Smrg      wlarc=
643944dda7b2Smrg    fi
64407a3b38f7Smrg
644144dda7b2Smrg    # PORTME: fill in a description of your system's C++ link characteristics
644244dda7b2Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
644344dda7b2Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
644444dda7b2Smrg    case $host_os in
644544dda7b2Smrg      aix3*)
644644dda7b2Smrg        # FIXME: insert proper C++ library support
644744dda7b2Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
644844dda7b2Smrg        ;;
644944dda7b2Smrg      aix[[4-9]]*)
64506fc0178dSmrg        if test ia64 = "$host_cpu"; then
645144dda7b2Smrg          # On IA64, the linker does run time linking by default, so we don't
645244dda7b2Smrg          # have to do anything special.
645344dda7b2Smrg          aix_use_runtimelinking=no
645444dda7b2Smrg          exp_sym_flag='-Bexport'
64556fc0178dSmrg          no_entry_flag=
645644dda7b2Smrg        else
645744dda7b2Smrg          aix_use_runtimelinking=no
64587a3b38f7Smrg
645944dda7b2Smrg          # Test if we are trying to use run time linking or normal
646044dda7b2Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
64616fc0178dSmrg          # have runtime linking enabled, and use it for executables.
64626fc0178dSmrg          # For shared libraries, we enable/disable runtime linking
64636fc0178dSmrg          # depending on the kind of the shared library created -
64646fc0178dSmrg          # when "with_aix_soname,aix_use_runtimelinking" is:
64656fc0178dSmrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
64666fc0178dSmrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
64676fc0178dSmrg          #            lib.a           static archive
64686fc0178dSmrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
64696fc0178dSmrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
64706fc0178dSmrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
64716fc0178dSmrg          #            lib.a(lib.so.V) shared, rtl:no
64726fc0178dSmrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
64736fc0178dSmrg          #            lib.a           static archive
647444dda7b2Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
647544dda7b2Smrg	    for ld_flag in $LDFLAGS; do
647644dda7b2Smrg	      case $ld_flag in
647744dda7b2Smrg	      *-brtl*)
647844dda7b2Smrg	        aix_use_runtimelinking=yes
647944dda7b2Smrg	        break
648044dda7b2Smrg	        ;;
648144dda7b2Smrg	      esac
648244dda7b2Smrg	    done
64836fc0178dSmrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
64846fc0178dSmrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
64856fc0178dSmrg	      # so we don't have lib.a shared libs to link our executables.
64866fc0178dSmrg	      # We have to force runtime linking in this case.
64876fc0178dSmrg	      aix_use_runtimelinking=yes
64886fc0178dSmrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
64896fc0178dSmrg	    fi
649044dda7b2Smrg	    ;;
649144dda7b2Smrg          esac
64927a3b38f7Smrg
649344dda7b2Smrg          exp_sym_flag='-bexport'
649444dda7b2Smrg          no_entry_flag='-bnoentry'
649544dda7b2Smrg        fi
64967a3b38f7Smrg
649744dda7b2Smrg        # When large executables or shared objects are built, AIX ld can
649844dda7b2Smrg        # have problems creating the table of contents.  If linking a library
649944dda7b2Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
650044dda7b2Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
650144dda7b2Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
65027a3b38f7Smrg
650344dda7b2Smrg        _LT_TAGVAR(archive_cmds, $1)=''
650444dda7b2Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
650544dda7b2Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
650644dda7b2Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
650744dda7b2Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
65086fc0178dSmrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
65096fc0178dSmrg        case $with_aix_soname,$aix_use_runtimelinking in
65106fc0178dSmrg        aix,*) ;;	# no import file
65116fc0178dSmrg        svr4,* | *,yes) # use import file
65126fc0178dSmrg          # The Import File defines what to hardcode.
65136fc0178dSmrg          _LT_TAGVAR(hardcode_direct, $1)=no
65146fc0178dSmrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
65156fc0178dSmrg          ;;
65166fc0178dSmrg        esac
65177a3b38f7Smrg
65186fc0178dSmrg        if test yes = "$GXX"; then
651944dda7b2Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
652044dda7b2Smrg          # We only want to do this on AIX 4.2 and lower, the check
652144dda7b2Smrg          # below for broken collect2 doesn't work under 4.3+
65226fc0178dSmrg	  collect2name=`$CC -print-prog-name=collect2`
652344dda7b2Smrg	  if test -f "$collect2name" &&
652444dda7b2Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
652544dda7b2Smrg	  then
652644dda7b2Smrg	    # We have reworked collect2
652744dda7b2Smrg	    :
652844dda7b2Smrg	  else
652944dda7b2Smrg	    # We have old collect2
653044dda7b2Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
653144dda7b2Smrg	    # It fails to find uninstalled libraries when the uninstalled
653244dda7b2Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
653344dda7b2Smrg	    # to unsupported forces relinking
653444dda7b2Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
653544dda7b2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
653644dda7b2Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
653744dda7b2Smrg	  fi
653844dda7b2Smrg          esac
653944dda7b2Smrg          shared_flag='-shared'
65406fc0178dSmrg	  if test yes = "$aix_use_runtimelinking"; then
65416fc0178dSmrg	    shared_flag=$shared_flag' $wl-G'
654244dda7b2Smrg	  fi
65436fc0178dSmrg	  # Need to ensure runtime linking is disabled for the traditional
65446fc0178dSmrg	  # shared library, or the linker may eventually find shared libraries
65456fc0178dSmrg	  # /with/ Import File - we do not want to mix them.
65466fc0178dSmrg	  shared_flag_aix='-shared'
65476fc0178dSmrg	  shared_flag_svr4='-shared $wl-G'
654844dda7b2Smrg        else
654944dda7b2Smrg          # not using gcc
65506fc0178dSmrg          if test ia64 = "$host_cpu"; then
655144dda7b2Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
655244dda7b2Smrg	  # chokes on -Wl,-G. The following line is correct:
655344dda7b2Smrg	  shared_flag='-G'
655444dda7b2Smrg          else
65556fc0178dSmrg	    if test yes = "$aix_use_runtimelinking"; then
65566fc0178dSmrg	      shared_flag='$wl-G'
655744dda7b2Smrg	    else
65586fc0178dSmrg	      shared_flag='$wl-bM:SRE'
655944dda7b2Smrg	    fi
65606fc0178dSmrg	    shared_flag_aix='$wl-bM:SRE'
65616fc0178dSmrg	    shared_flag_svr4='$wl-G'
656244dda7b2Smrg          fi
656344dda7b2Smrg        fi
65647a3b38f7Smrg
65656fc0178dSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
656644dda7b2Smrg        # It seems that -bexpall does not export symbols beginning with
656744dda7b2Smrg        # underscore (_), so it is better to generate a list of symbols to
656844dda7b2Smrg	# export.
656944dda7b2Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
65706fc0178dSmrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
657144dda7b2Smrg          # Warning - without using the other runtime loading flags (-brtl),
657244dda7b2Smrg          # -berok will link without error, but may produce a broken library.
65736fc0178dSmrg          # The "-G" linker flag allows undefined symbols.
65746fc0178dSmrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
657544dda7b2Smrg          # Determine the default libpath from the value encoded in an empty
657644dda7b2Smrg          # executable.
6577862f5301Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
65786fc0178dSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
65797a3b38f7Smrg
65806fc0178dSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
658144dda7b2Smrg        else
65826fc0178dSmrg          if test ia64 = "$host_cpu"; then
65836fc0178dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
658444dda7b2Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
65856fc0178dSmrg	    _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"
658644dda7b2Smrg          else
658744dda7b2Smrg	    # Determine the default libpath from the value encoded in an
658844dda7b2Smrg	    # empty executable.
6589862f5301Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
65906fc0178dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
659144dda7b2Smrg	    # Warning - without using the other run time loading flags,
659244dda7b2Smrg	    # -berok will link without error, but may produce a broken library.
65936fc0178dSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
65946fc0178dSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
65956fc0178dSmrg	    if test yes = "$with_gnu_ld"; then
659644dda7b2Smrg	      # We only use this code for GNU lds that support --whole-archive.
65976fc0178dSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
659844dda7b2Smrg	    else
659944dda7b2Smrg	      # Exported symbols can be pulled into shared objects from archives
660044dda7b2Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
660144dda7b2Smrg	    fi
660244dda7b2Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
66036fc0178dSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
66046fc0178dSmrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
66056fc0178dSmrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
66066fc0178dSmrg	    if test svr4 != "$with_aix_soname"; then
66076fc0178dSmrg	      # This is similar to how AIX traditionally builds its shared
66086fc0178dSmrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
66096fc0178dSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
66106fc0178dSmrg	    fi
66116fc0178dSmrg	    if test aix != "$with_aix_soname"; then
66126fc0178dSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
66136fc0178dSmrg	    else
66146fc0178dSmrg	      # used by -dlpreopen to get the symbols
66156fc0178dSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
66166fc0178dSmrg	    fi
66176fc0178dSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
661844dda7b2Smrg          fi
661944dda7b2Smrg        fi
662044dda7b2Smrg        ;;
66217a3b38f7Smrg
662244dda7b2Smrg      beos*)
662344dda7b2Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
662444dda7b2Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
662544dda7b2Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
662644dda7b2Smrg	  # support --undefined.  This deserves some investigation.  FIXME
66276fc0178dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
662844dda7b2Smrg	else
662944dda7b2Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
663044dda7b2Smrg	fi
663144dda7b2Smrg	;;
66327a3b38f7Smrg
663344dda7b2Smrg      chorus*)
663444dda7b2Smrg        case $cc_basename in
663544dda7b2Smrg          *)
663644dda7b2Smrg	  # FIXME: insert proper C++ library support
663744dda7b2Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
663844dda7b2Smrg	  ;;
663944dda7b2Smrg        esac
664044dda7b2Smrg        ;;
66417a3b38f7Smrg
664244dda7b2Smrg      cygwin* | mingw* | pw32* | cegcc*)
6643862f5301Smrg	case $GXX,$cc_basename in
6644862f5301Smrg	,cl* | no,cl*)
6645862f5301Smrg	  # Native MSVC
6646862f5301Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
6647862f5301Smrg	  # no search path for DLLs.
6648862f5301Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6649862f5301Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6650862f5301Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
6651862f5301Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
6652862f5301Smrg	  # Tell ltmain to make .lib files, not .a files.
6653862f5301Smrg	  libext=lib
6654862f5301Smrg	  # Tell ltmain to make .dll files, not .so files.
66556fc0178dSmrg	  shrext_cmds=.dll
6656862f5301Smrg	  # FIXME: Setting linknames here is a bad hack.
66576fc0178dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
66586fc0178dSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
66596fc0178dSmrg              cp "$export_symbols" "$output_objdir/$soname.def";
66606fc0178dSmrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
66616fc0178dSmrg            else
66626fc0178dSmrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
66636fc0178dSmrg            fi~
66646fc0178dSmrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
66656fc0178dSmrg            linknames='
6666862f5301Smrg	  # The linker will not automatically build a static lib if we build a DLL.
6667862f5301Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6668862f5301Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6669862f5301Smrg	  # Don't use ranlib
6670862f5301Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6671862f5301Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
66726fc0178dSmrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
66736fc0178dSmrg            case $lt_outputfile in
66746fc0178dSmrg              *.exe|*.EXE) ;;
66756fc0178dSmrg              *)
66766fc0178dSmrg                lt_outputfile=$lt_outputfile.exe
66776fc0178dSmrg                lt_tool_outputfile=$lt_tool_outputfile.exe
66786fc0178dSmrg                ;;
66796fc0178dSmrg            esac~
66806fc0178dSmrg            func_to_tool_file "$lt_outputfile"~
66816fc0178dSmrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
66826fc0178dSmrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
66836fc0178dSmrg              $RM "$lt_outputfile.manifest";
66846fc0178dSmrg            fi'
6685862f5301Smrg	  ;;
6686862f5301Smrg	*)
6687862f5301Smrg	  # g++
6688862f5301Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6689862f5301Smrg	  # as there is no search path for DLLs.
6690862f5301Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
66916fc0178dSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
6692862f5301Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6693862f5301Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
6694862f5301Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6695862f5301Smrg
6696862f5301Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
66976fc0178dSmrg	    _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'
66986fc0178dSmrg	    # If the export-symbols file already is a .def file, use it as
66996fc0178dSmrg	    # is; otherwise, prepend EXPORTS...
67006fc0178dSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
67016fc0178dSmrg              cp $export_symbols $output_objdir/$soname.def;
67026fc0178dSmrg            else
67036fc0178dSmrg              echo EXPORTS > $output_objdir/$soname.def;
67046fc0178dSmrg              cat $export_symbols >> $output_objdir/$soname.def;
67056fc0178dSmrg            fi~
67066fc0178dSmrg            $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'
6707862f5301Smrg	  else
6708862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6709862f5301Smrg	  fi
6710862f5301Smrg	  ;;
6711862f5301Smrg	esac
6712862f5301Smrg	;;
671344dda7b2Smrg      darwin* | rhapsody*)
671444dda7b2Smrg        _LT_DARWIN_LINKER_FEATURES($1)
671544dda7b2Smrg	;;
67167a3b38f7Smrg
67176fc0178dSmrg      os2*)
67186fc0178dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
67196fc0178dSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
67206fc0178dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
67216fc0178dSmrg	shrext_cmds=.dll
67226fc0178dSmrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
67236fc0178dSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
67246fc0178dSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
67256fc0178dSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
67266fc0178dSmrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
67276fc0178dSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
67286fc0178dSmrg	  emximp -o $lib $output_objdir/$libname.def'
67296fc0178dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
67306fc0178dSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
67316fc0178dSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
67326fc0178dSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
67336fc0178dSmrg	  prefix_cmds="$SED"~
67346fc0178dSmrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
67356fc0178dSmrg	    prefix_cmds="$prefix_cmds -e 1d";
67366fc0178dSmrg	  fi~
67376fc0178dSmrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
67386fc0178dSmrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
67396fc0178dSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
67406fc0178dSmrg	  emximp -o $lib $output_objdir/$libname.def'
67416fc0178dSmrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
67426fc0178dSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
67436fc0178dSmrg	;;
67446fc0178dSmrg
674544dda7b2Smrg      dgux*)
674644dda7b2Smrg        case $cc_basename in
674744dda7b2Smrg          ec++*)
674844dda7b2Smrg	    # FIXME: insert proper C++ library support
674944dda7b2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
675044dda7b2Smrg	    ;;
675144dda7b2Smrg          ghcx*)
675244dda7b2Smrg	    # Green Hills C++ Compiler
675344dda7b2Smrg	    # FIXME: insert proper C++ library support
675444dda7b2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
675544dda7b2Smrg	    ;;
675644dda7b2Smrg          *)
675744dda7b2Smrg	    # FIXME: insert proper C++ library support
675844dda7b2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
675944dda7b2Smrg	    ;;
676044dda7b2Smrg        esac
676144dda7b2Smrg        ;;
67627a3b38f7Smrg
6763fc544a13Smrg      freebsd2.*)
676444dda7b2Smrg        # C++ shared libraries reported to be fairly broken before
676544dda7b2Smrg	# switch to ELF
676644dda7b2Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
676744dda7b2Smrg        ;;
67687a3b38f7Smrg
676944dda7b2Smrg      freebsd-elf*)
677044dda7b2Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
677144dda7b2Smrg        ;;
67727a3b38f7Smrg
677344dda7b2Smrg      freebsd* | dragonfly*)
677444dda7b2Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
677544dda7b2Smrg        # conventions
677644dda7b2Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
677744dda7b2Smrg        ;;
67787a3b38f7Smrg
677944dda7b2Smrg      haiku*)
67806fc0178dSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
678144dda7b2Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
678244dda7b2Smrg        ;;
67837a3b38f7Smrg
678444dda7b2Smrg      hpux9*)
67856fc0178dSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
678644dda7b2Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
67876fc0178dSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
678844dda7b2Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
678944dda7b2Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
679044dda7b2Smrg				             # but as the default
679144dda7b2Smrg				             # location of the library.
67927a3b38f7Smrg
679344dda7b2Smrg        case $cc_basename in
679444dda7b2Smrg          CC*)
679544dda7b2Smrg            # FIXME: insert proper C++ library support
679644dda7b2Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
679744dda7b2Smrg            ;;
679844dda7b2Smrg          aCC*)
67996fc0178dSmrg            _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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
680044dda7b2Smrg            # Commands to make compiler produce verbose output that lists
680144dda7b2Smrg            # what "hidden" libraries, object files and flags are used when
680244dda7b2Smrg            # linking a shared library.
680344dda7b2Smrg            #
680444dda7b2Smrg            # There doesn't appear to be a way to prevent this compiler from
680544dda7b2Smrg            # explicitly linking system object files so we need to strip them
680644dda7b2Smrg            # from the output so that they don't get included in the library
680744dda7b2Smrg            # dependencies.
68086fc0178dSmrg            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
680944dda7b2Smrg            ;;
681044dda7b2Smrg          *)
68116fc0178dSmrg            if test yes = "$GXX"; then
68126fc0178dSmrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
681344dda7b2Smrg            else
681444dda7b2Smrg              # FIXME: insert proper C++ library support
681544dda7b2Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
681644dda7b2Smrg            fi
681744dda7b2Smrg            ;;
681844dda7b2Smrg        esac
681944dda7b2Smrg        ;;
68207a3b38f7Smrg
682144dda7b2Smrg      hpux10*|hpux11*)
68226fc0178dSmrg        if test no = "$with_gnu_ld"; then
68236fc0178dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
682444dda7b2Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
68257a3b38f7Smrg
682644dda7b2Smrg          case $host_cpu in
682744dda7b2Smrg            hppa*64*|ia64*)
682844dda7b2Smrg              ;;
682944dda7b2Smrg            *)
68306fc0178dSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
683144dda7b2Smrg              ;;
683244dda7b2Smrg          esac
683344dda7b2Smrg        fi
683444dda7b2Smrg        case $host_cpu in
683544dda7b2Smrg          hppa*64*|ia64*)
683644dda7b2Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
683744dda7b2Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
683844dda7b2Smrg            ;;
683944dda7b2Smrg          *)
684044dda7b2Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
684144dda7b2Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
684244dda7b2Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
684344dda7b2Smrg					         # but as the default
684444dda7b2Smrg					         # location of the library.
684544dda7b2Smrg            ;;
684644dda7b2Smrg        esac
68477a3b38f7Smrg
684844dda7b2Smrg        case $cc_basename in
684944dda7b2Smrg          CC*)
685044dda7b2Smrg	    # FIXME: insert proper C++ library support
685144dda7b2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
685244dda7b2Smrg	    ;;
685344dda7b2Smrg          aCC*)
685444dda7b2Smrg	    case $host_cpu in
685544dda7b2Smrg	      hppa*64*)
68566fc0178dSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
685744dda7b2Smrg	        ;;
685844dda7b2Smrg	      ia64*)
68596fc0178dSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
686044dda7b2Smrg	        ;;
686144dda7b2Smrg	      *)
68626fc0178dSmrg	        _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'
686344dda7b2Smrg	        ;;
686444dda7b2Smrg	    esac
686544dda7b2Smrg	    # Commands to make compiler produce verbose output that lists
686644dda7b2Smrg	    # what "hidden" libraries, object files and flags are used when
686744dda7b2Smrg	    # linking a shared library.
686844dda7b2Smrg	    #
686944dda7b2Smrg	    # There doesn't appear to be a way to prevent this compiler from
687044dda7b2Smrg	    # explicitly linking system object files so we need to strip them
687144dda7b2Smrg	    # from the output so that they don't get included in the library
687244dda7b2Smrg	    # dependencies.
68736fc0178dSmrg	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
687444dda7b2Smrg	    ;;
687544dda7b2Smrg          *)
68766fc0178dSmrg	    if test yes = "$GXX"; then
68776fc0178dSmrg	      if test no = "$with_gnu_ld"; then
687844dda7b2Smrg	        case $host_cpu in
687944dda7b2Smrg	          hppa*64*)
68806fc0178dSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
688144dda7b2Smrg	            ;;
688244dda7b2Smrg	          ia64*)
68836fc0178dSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
688444dda7b2Smrg	            ;;
688544dda7b2Smrg	          *)
68866fc0178dSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
688744dda7b2Smrg	            ;;
688844dda7b2Smrg	        esac
688944dda7b2Smrg	      fi
689044dda7b2Smrg	    else
689144dda7b2Smrg	      # FIXME: insert proper C++ library support
689244dda7b2Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
689344dda7b2Smrg	    fi
689444dda7b2Smrg	    ;;
689544dda7b2Smrg        esac
689644dda7b2Smrg        ;;
68977a3b38f7Smrg
689844dda7b2Smrg      interix[[3-9]]*)
689944dda7b2Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
690044dda7b2Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
69016fc0178dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
69026fc0178dSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
690344dda7b2Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
690444dda7b2Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
690544dda7b2Smrg	# default) and relocated if they conflict, which is a slow very memory
690644dda7b2Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
690744dda7b2Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
690844dda7b2Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
69096fc0178dSmrg	_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'
69106fc0178dSmrg	_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'
691144dda7b2Smrg	;;
691244dda7b2Smrg      irix5* | irix6*)
691344dda7b2Smrg        case $cc_basename in
691444dda7b2Smrg          CC*)
691544dda7b2Smrg	    # SGI C++
69166fc0178dSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
69177a3b38f7Smrg
691844dda7b2Smrg	    # Archives containing C++ object files must be created using
691944dda7b2Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
692044dda7b2Smrg	    # necessary to make sure instantiated templates are included
692144dda7b2Smrg	    # in the archive.
692244dda7b2Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
692344dda7b2Smrg	    ;;
692444dda7b2Smrg          *)
69256fc0178dSmrg	    if test yes = "$GXX"; then
69266fc0178dSmrg	      if test no = "$with_gnu_ld"; then
69276fc0178dSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
692844dda7b2Smrg	      else
69296fc0178dSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
693044dda7b2Smrg	      fi
693144dda7b2Smrg	    fi
693244dda7b2Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
693344dda7b2Smrg	    ;;
693444dda7b2Smrg        esac
69356fc0178dSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
693644dda7b2Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
693744dda7b2Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
693844dda7b2Smrg        ;;
69397a3b38f7Smrg
69406fc0178dSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
694144dda7b2Smrg        case $cc_basename in
694244dda7b2Smrg          KCC*)
694344dda7b2Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
69447a3b38f7Smrg
694544dda7b2Smrg	    # KCC will only create a shared library if the output file
694644dda7b2Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
694744dda7b2Smrg	    # to its proper name (with version) after linking.
69486fc0178dSmrg	    _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'
69496fc0178dSmrg	    _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'
695044dda7b2Smrg	    # Commands to make compiler produce verbose output that lists
695144dda7b2Smrg	    # what "hidden" libraries, object files and flags are used when
695244dda7b2Smrg	    # linking a shared library.
695344dda7b2Smrg	    #
695444dda7b2Smrg	    # There doesn't appear to be a way to prevent this compiler from
695544dda7b2Smrg	    # explicitly linking system object files so we need to strip them
695644dda7b2Smrg	    # from the output so that they don't get included in the library
695744dda7b2Smrg	    # dependencies.
69586fc0178dSmrg	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
69597a3b38f7Smrg
69606fc0178dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
69616fc0178dSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
69627a3b38f7Smrg
696344dda7b2Smrg	    # Archives containing C++ object files must be created using
696444dda7b2Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
696544dda7b2Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
696644dda7b2Smrg	    ;;
696744dda7b2Smrg	  icpc* | ecpc* )
696844dda7b2Smrg	    # Intel C++
696944dda7b2Smrg	    with_gnu_ld=yes
697044dda7b2Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
697144dda7b2Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
697244dda7b2Smrg	    # earlier do not add the objects themselves.
697344dda7b2Smrg	    case `$CC -V 2>&1` in
697444dda7b2Smrg	      *"Version 7."*)
69756fc0178dSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
69766fc0178dSmrg		_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'
697744dda7b2Smrg		;;
697844dda7b2Smrg	      *)  # Version 8.0 or newer
697944dda7b2Smrg	        tmp_idyn=
698044dda7b2Smrg	        case $host_cpu in
698144dda7b2Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
698244dda7b2Smrg		esac
69836fc0178dSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
69846fc0178dSmrg		_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'
698544dda7b2Smrg		;;
698644dda7b2Smrg	    esac
698744dda7b2Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
69886fc0178dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
69896fc0178dSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
69906fc0178dSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
699144dda7b2Smrg	    ;;
699244dda7b2Smrg          pgCC* | pgcpp*)
699344dda7b2Smrg            # Portland Group C++ compiler
699444dda7b2Smrg	    case `$CC -V` in
699544dda7b2Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
699644dda7b2Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
69976fc0178dSmrg               rm -rf $tpldir~
69986fc0178dSmrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
69996fc0178dSmrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
700044dda7b2Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
70016fc0178dSmrg                rm -rf $tpldir~
70026fc0178dSmrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
70036fc0178dSmrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
70046fc0178dSmrg                $RANLIB $oldlib'
700544dda7b2Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
70066fc0178dSmrg                rm -rf $tpldir~
70076fc0178dSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
70086fc0178dSmrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
700944dda7b2Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
70106fc0178dSmrg                rm -rf $tpldir~
70116fc0178dSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
70126fc0178dSmrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
701344dda7b2Smrg	      ;;
701444dda7b2Smrg	    *) # Version 6 and above use weak symbols
70156fc0178dSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
70166fc0178dSmrg	      _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'
701744dda7b2Smrg	      ;;
701844dda7b2Smrg	    esac
70197a3b38f7Smrg
70206fc0178dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
70216fc0178dSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
70226fc0178dSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
702344dda7b2Smrg            ;;
702444dda7b2Smrg	  cxx*)
702544dda7b2Smrg	    # Compaq C++
70266fc0178dSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
70276fc0178dSmrg	    _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'
70287a3b38f7Smrg
702944dda7b2Smrg	    runpath_var=LD_RUN_PATH
703044dda7b2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
703144dda7b2Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
70327a3b38f7Smrg
703344dda7b2Smrg	    # Commands to make compiler produce verbose output that lists
703444dda7b2Smrg	    # what "hidden" libraries, object files and flags are used when
703544dda7b2Smrg	    # linking a shared library.
703644dda7b2Smrg	    #
703744dda7b2Smrg	    # There doesn't appear to be a way to prevent this compiler from
703844dda7b2Smrg	    # explicitly linking system object files so we need to strip them
703944dda7b2Smrg	    # from the output so that they don't get included in the library
704044dda7b2Smrg	    # dependencies.
70416fc0178dSmrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
704244dda7b2Smrg	    ;;
704344dda7b2Smrg	  xl* | mpixl* | bgxl*)
704444dda7b2Smrg	    # IBM XL 8.0 on PPC, with GNU ld
70456fc0178dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
70466fc0178dSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
70476fc0178dSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
70486fc0178dSmrg	    if test yes = "$supports_anon_versioning"; then
704944dda7b2Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
70506fc0178dSmrg                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
70516fc0178dSmrg                echo "local: *; };" >> $output_objdir/$libname.ver~
70526fc0178dSmrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
705344dda7b2Smrg	    fi
705444dda7b2Smrg	    ;;
705544dda7b2Smrg	  *)
705644dda7b2Smrg	    case `$CC -V 2>&1 | sed 5q` in
705744dda7b2Smrg	    *Sun\ C*)
705844dda7b2Smrg	      # Sun C++ 5.9
705944dda7b2Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
70606fc0178dSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
70616fc0178dSmrg	      _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'
706244dda7b2Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
70636fc0178dSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
706444dda7b2Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
70657a3b38f7Smrg
7066862f5301Smrg	      # Not sure whether something based on
7067862f5301Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7068862f5301Smrg	      # would be better.
7069862f5301Smrg	      output_verbose_link_cmd='func_echo_all'
7070862f5301Smrg
7071862f5301Smrg	      # Archives containing C++ object files must be created using
7072862f5301Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7073862f5301Smrg	      # necessary to make sure instantiated templates are included
7074862f5301Smrg	      # in the archive.
7075862f5301Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7076862f5301Smrg	      ;;
7077862f5301Smrg	    esac
7078862f5301Smrg	    ;;
7079862f5301Smrg	esac
7080862f5301Smrg	;;
7081862f5301Smrg
7082862f5301Smrg      lynxos*)
7083862f5301Smrg        # FIXME: insert proper C++ library support
7084862f5301Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
7085862f5301Smrg	;;
7086862f5301Smrg
7087862f5301Smrg      m88k*)
7088862f5301Smrg        # FIXME: insert proper C++ library support
7089862f5301Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
7090862f5301Smrg	;;
7091862f5301Smrg
7092862f5301Smrg      mvs*)
7093862f5301Smrg        case $cc_basename in
7094862f5301Smrg          cxx*)
7095862f5301Smrg	    # FIXME: insert proper C++ library support
7096862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7097862f5301Smrg	    ;;
7098862f5301Smrg	  *)
7099862f5301Smrg	    # FIXME: insert proper C++ library support
7100862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7101862f5301Smrg	    ;;
7102862f5301Smrg	esac
7103862f5301Smrg	;;
7104862f5301Smrg
7105862f5301Smrg      netbsd*)
7106862f5301Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7107862f5301Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7108862f5301Smrg	  wlarc=
7109862f5301Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7110862f5301Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7111862f5301Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7112862f5301Smrg	fi
7113862f5301Smrg	# Workaround some broken pre-1.5 toolchains
7114862f5301Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7115862f5301Smrg	;;
7116862f5301Smrg
7117862f5301Smrg      *nto* | *qnx*)
7118862f5301Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
7119862f5301Smrg	;;
7120862f5301Smrg
71216fc0178dSmrg      openbsd* | bitrig*)
7122862f5301Smrg	if test -f /usr/libexec/ld.so; then
7123862f5301Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7124862f5301Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7125862f5301Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7126862f5301Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
71276fc0178dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
71286fc0178dSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
71296fc0178dSmrg	    _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'
71306fc0178dSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
71316fc0178dSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
7132862f5301Smrg	  fi
7133862f5301Smrg	  output_verbose_link_cmd=func_echo_all
7134862f5301Smrg	else
7135862f5301Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
7136862f5301Smrg	fi
7137862f5301Smrg	;;
7138862f5301Smrg
7139862f5301Smrg      osf3* | osf4* | osf5*)
7140862f5301Smrg        case $cc_basename in
7141862f5301Smrg          KCC*)
7142862f5301Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7143862f5301Smrg
7144862f5301Smrg	    # KCC will only create a shared library if the output file
7145862f5301Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7146862f5301Smrg	    # to its proper name (with version) after linking.
71476fc0178dSmrg	    _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'
7148862f5301Smrg
71496fc0178dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7150862f5301Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7151862f5301Smrg
7152862f5301Smrg	    # Archives containing C++ object files must be created using
7153862f5301Smrg	    # the KAI C++ compiler.
7154862f5301Smrg	    case $host in
7155862f5301Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7156862f5301Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7157862f5301Smrg	    esac
7158862f5301Smrg	    ;;
7159862f5301Smrg          RCC*)
7160862f5301Smrg	    # Rational C++ 2.4.1
7161862f5301Smrg	    # FIXME: insert proper C++ library support
7162862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7163862f5301Smrg	    ;;
7164862f5301Smrg          cxx*)
7165862f5301Smrg	    case $host in
7166862f5301Smrg	      osf3*)
71676fc0178dSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
71686fc0178dSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
71696fc0178dSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7170862f5301Smrg		;;
7171862f5301Smrg	      *)
7172862f5301Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
71736fc0178dSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
7174862f5301Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
71756fc0178dSmrg                  echo "-hidden">> $lib.exp~
71766fc0178dSmrg                  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
71776fc0178dSmrg                  $RM $lib.exp'
7178862f5301Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7179862f5301Smrg		;;
7180862f5301Smrg	    esac
7181862f5301Smrg
7182862f5301Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7183862f5301Smrg
7184862f5301Smrg	    # Commands to make compiler produce verbose output that lists
7185862f5301Smrg	    # what "hidden" libraries, object files and flags are used when
7186862f5301Smrg	    # linking a shared library.
7187862f5301Smrg	    #
7188862f5301Smrg	    # There doesn't appear to be a way to prevent this compiler from
7189862f5301Smrg	    # explicitly linking system object files so we need to strip them
7190862f5301Smrg	    # from the output so that they don't get included in the library
7191862f5301Smrg	    # dependencies.
71926fc0178dSmrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
7193862f5301Smrg	    ;;
7194862f5301Smrg	  *)
71956fc0178dSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
71966fc0178dSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7197862f5301Smrg	      case $host in
7198862f5301Smrg	        osf3*)
71996fc0178dSmrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
7200862f5301Smrg		  ;;
7201862f5301Smrg	        *)
72026fc0178dSmrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
7203862f5301Smrg		  ;;
7204862f5301Smrg	      esac
7205862f5301Smrg
72066fc0178dSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7207862f5301Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7208862f5301Smrg
7209862f5301Smrg	      # Commands to make compiler produce verbose output that lists
7210862f5301Smrg	      # what "hidden" libraries, object files and flags are used when
7211862f5301Smrg	      # linking a shared library.
7212862f5301Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7213862f5301Smrg
7214862f5301Smrg	    else
7215862f5301Smrg	      # FIXME: insert proper C++ library support
7216862f5301Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
7217862f5301Smrg	    fi
7218862f5301Smrg	    ;;
7219862f5301Smrg        esac
7220862f5301Smrg        ;;
7221862f5301Smrg
7222862f5301Smrg      psos*)
7223862f5301Smrg        # FIXME: insert proper C++ library support
7224862f5301Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
7225862f5301Smrg        ;;
7226862f5301Smrg
7227862f5301Smrg      sunos4*)
7228862f5301Smrg        case $cc_basename in
7229862f5301Smrg          CC*)
7230862f5301Smrg	    # Sun C++ 4.x
7231862f5301Smrg	    # FIXME: insert proper C++ library support
7232862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7233862f5301Smrg	    ;;
7234862f5301Smrg          lcc*)
7235862f5301Smrg	    # Lucid
7236862f5301Smrg	    # FIXME: insert proper C++ library support
7237862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7238862f5301Smrg	    ;;
7239862f5301Smrg          *)
7240862f5301Smrg	    # FIXME: insert proper C++ library support
7241862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7242862f5301Smrg	    ;;
7243862f5301Smrg        esac
7244862f5301Smrg        ;;
7245862f5301Smrg
7246862f5301Smrg      solaris*)
7247862f5301Smrg        case $cc_basename in
7248862f5301Smrg          CC* | sunCC*)
7249862f5301Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
7250862f5301Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7251862f5301Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
72526fc0178dSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7253862f5301Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
72546fc0178dSmrg              $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'
7255862f5301Smrg
7256862f5301Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7257862f5301Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7258862f5301Smrg	    case $host_os in
7259862f5301Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7260862f5301Smrg	      *)
7261862f5301Smrg		# The compiler driver will combine and reorder linker options,
72626fc0178dSmrg		# but understands '-z linker_flag'.
7263862f5301Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7264862f5301Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7265862f5301Smrg	        ;;
7266862f5301Smrg	    esac
7267862f5301Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7268862f5301Smrg
7269862f5301Smrg	    output_verbose_link_cmd='func_echo_all'
7270862f5301Smrg
7271862f5301Smrg	    # Archives containing C++ object files must be created using
7272862f5301Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7273862f5301Smrg	    # necessary to make sure instantiated templates are included
7274862f5301Smrg	    # in the archive.
7275862f5301Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7276862f5301Smrg	    ;;
7277862f5301Smrg          gcx*)
7278862f5301Smrg	    # Green Hills C++ Compiler
72796fc0178dSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7280862f5301Smrg
7281862f5301Smrg	    # The C++ compiler must be used to create the archive.
7282862f5301Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7283862f5301Smrg	    ;;
7284862f5301Smrg          *)
7285862f5301Smrg	    # GNU C++ compiler with Solaris linker
72866fc0178dSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
72876fc0178dSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
7288862f5301Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
72896fc0178dSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7290862f5301Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
72916fc0178dSmrg                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7292862f5301Smrg
7293862f5301Smrg	        # Commands to make compiler produce verbose output that lists
7294862f5301Smrg	        # what "hidden" libraries, object files and flags are used when
7295862f5301Smrg	        # linking a shared library.
7296862f5301Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7297862f5301Smrg	      else
72986fc0178dSmrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
7299862f5301Smrg	        # platform.
73006fc0178dSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7301862f5301Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
73026fc0178dSmrg                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7303862f5301Smrg
7304862f5301Smrg	        # Commands to make compiler produce verbose output that lists
7305862f5301Smrg	        # what "hidden" libraries, object files and flags are used when
7306862f5301Smrg	        # linking a shared library.
7307862f5301Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7308862f5301Smrg	      fi
7309862f5301Smrg
73106fc0178dSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
7311862f5301Smrg	      case $host_os in
7312862f5301Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7313862f5301Smrg		*)
73146fc0178dSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
7315862f5301Smrg		  ;;
7316862f5301Smrg	      esac
7317862f5301Smrg	    fi
7318862f5301Smrg	    ;;
7319862f5301Smrg        esac
7320862f5301Smrg        ;;
7321862f5301Smrg
7322862f5301Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
73236fc0178dSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7324862f5301Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7325862f5301Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7326862f5301Smrg      runpath_var='LD_RUN_PATH'
7327862f5301Smrg
7328862f5301Smrg      case $cc_basename in
7329862f5301Smrg        CC*)
73306fc0178dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73316fc0178dSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7332862f5301Smrg	  ;;
7333862f5301Smrg	*)
73346fc0178dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73356fc0178dSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7336862f5301Smrg	  ;;
7337862f5301Smrg      esac
7338862f5301Smrg      ;;
7339862f5301Smrg
7340862f5301Smrg      sysv5* | sco3.2v5* | sco5v6*)
73416fc0178dSmrg	# Note: We CANNOT use -z defs as we might desire, because we do not
7342862f5301Smrg	# link with -lc, and that would cause any symbols used from libc to
7343862f5301Smrg	# always be unresolved, which means just about no library would
7344862f5301Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
7345862f5301Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
7346862f5301Smrg	# as -z defs.
73476fc0178dSmrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
73486fc0178dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
7349862f5301Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7350862f5301Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
73516fc0178dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
7352862f5301Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7353862f5301Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
73546fc0178dSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
7355862f5301Smrg	runpath_var='LD_RUN_PATH'
7356862f5301Smrg
7357862f5301Smrg	case $cc_basename in
7358862f5301Smrg          CC*)
73596fc0178dSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73606fc0178dSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7361862f5301Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
73626fc0178dSmrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
7363862f5301Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
73646fc0178dSmrg              '"$_LT_TAGVAR(reload_cmds, $1)"
7365862f5301Smrg	    ;;
7366862f5301Smrg	  *)
73676fc0178dSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73686fc0178dSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7369862f5301Smrg	    ;;
7370862f5301Smrg	esac
7371862f5301Smrg      ;;
7372862f5301Smrg
7373862f5301Smrg      tandem*)
7374862f5301Smrg        case $cc_basename in
7375862f5301Smrg          NCC*)
7376862f5301Smrg	    # NonStop-UX NCC 3.20
7377862f5301Smrg	    # FIXME: insert proper C++ library support
7378862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7379862f5301Smrg	    ;;
7380862f5301Smrg          *)
7381862f5301Smrg	    # FIXME: insert proper C++ library support
7382862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7383862f5301Smrg	    ;;
7384862f5301Smrg        esac
7385862f5301Smrg        ;;
7386862f5301Smrg
7387862f5301Smrg      vxworks*)
7388862f5301Smrg        # FIXME: insert proper C++ library support
7389862f5301Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
7390862f5301Smrg        ;;
7391862f5301Smrg
7392862f5301Smrg      *)
7393862f5301Smrg        # FIXME: insert proper C++ library support
7394862f5301Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
7395862f5301Smrg        ;;
7396862f5301Smrg    esac
7397862f5301Smrg
7398862f5301Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
73996fc0178dSmrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
7400862f5301Smrg
74016fc0178dSmrg    _LT_TAGVAR(GCC, $1)=$GXX
74026fc0178dSmrg    _LT_TAGVAR(LD, $1)=$LD
7403862f5301Smrg
7404862f5301Smrg    ## CAVEAT EMPTOR:
7405862f5301Smrg    ## There is no encapsulation within the following macros, do not change
7406862f5301Smrg    ## the running order or otherwise move them around unless you know exactly
7407862f5301Smrg    ## what you are doing...
7408862f5301Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7409862f5301Smrg    _LT_COMPILER_PIC($1)
7410862f5301Smrg    _LT_COMPILER_C_O($1)
7411862f5301Smrg    _LT_COMPILER_FILE_LOCKS($1)
7412862f5301Smrg    _LT_LINKER_SHLIBS($1)
7413862f5301Smrg    _LT_SYS_DYNAMIC_LINKER($1)
7414862f5301Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7415862f5301Smrg
7416862f5301Smrg    _LT_CONFIG($1)
7417862f5301Smrg  fi # test -n "$compiler"
7418862f5301Smrg
7419862f5301Smrg  CC=$lt_save_CC
7420862f5301Smrg  CFLAGS=$lt_save_CFLAGS
7421862f5301Smrg  LDCXX=$LD
7422862f5301Smrg  LD=$lt_save_LD
7423862f5301Smrg  GCC=$lt_save_GCC
7424862f5301Smrg  with_gnu_ld=$lt_save_with_gnu_ld
7425862f5301Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
7426862f5301Smrg  lt_cv_path_LD=$lt_save_path_LD
7427862f5301Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7428862f5301Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
74296fc0178dSmrgfi # test yes != "$_lt_caught_CXX_error"
7430862f5301Smrg
7431862f5301SmrgAC_LANG_POP
7432862f5301Smrg])# _LT_LANG_CXX_CONFIG
7433862f5301Smrg
7434862f5301Smrg
7435862f5301Smrg# _LT_FUNC_STRIPNAME_CNF
7436862f5301Smrg# ----------------------
7437862f5301Smrg# func_stripname_cnf prefix suffix name
7438862f5301Smrg# strip PREFIX and SUFFIX off of NAME.
7439862f5301Smrg# PREFIX and SUFFIX must not contain globbing or regex special
7440862f5301Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7441862f5301Smrg# dot (in which case that matches only a dot).
7442862f5301Smrg#
7443862f5301Smrg# This function is identical to the (non-XSI) version of func_stripname,
7444862f5301Smrg# except this one can be used by m4 code that may be executed by configure,
7445862f5301Smrg# rather than the libtool script.
7446862f5301Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7447862f5301SmrgAC_REQUIRE([_LT_DECL_SED])
7448862f5301SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7449862f5301Smrgfunc_stripname_cnf ()
7450862f5301Smrg{
74516fc0178dSmrg  case @S|@2 in
74526fc0178dSmrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
74536fc0178dSmrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
7454862f5301Smrg  esac
7455862f5301Smrg} # func_stripname_cnf
7456862f5301Smrg])# _LT_FUNC_STRIPNAME_CNF
7457862f5301Smrg
74586fc0178dSmrg
7459862f5301Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7460862f5301Smrg# ---------------------------------
7461862f5301Smrg# Figure out "hidden" library dependencies from verbose
7462862f5301Smrg# compiler output when linking a shared library.
7463862f5301Smrg# Parse the compiler output and extract the necessary
7464862f5301Smrg# objects, libraries and library flags.
7465862f5301Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7466862f5301Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7467862f5301SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7468862f5301Smrg# Dependencies to place before and after the object being linked:
7469862f5301Smrg_LT_TAGVAR(predep_objects, $1)=
7470862f5301Smrg_LT_TAGVAR(postdep_objects, $1)=
7471862f5301Smrg_LT_TAGVAR(predeps, $1)=
7472862f5301Smrg_LT_TAGVAR(postdeps, $1)=
7473862f5301Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
7474862f5301Smrg
7475862f5301Smrgdnl we can't use the lt_simple_compile_test_code here,
7476862f5301Smrgdnl because it contains code intended for an executable,
7477862f5301Smrgdnl not a library.  It's possible we should let each
7478862f5301Smrgdnl tag define a new lt_????_link_test_code variable,
7479862f5301Smrgdnl but it's only used here...
7480862f5301Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7481862f5301Smrgint a;
7482862f5301Smrgvoid foo (void) { a = 0; }
7483862f5301Smrg_LT_EOF
7484862f5301Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7485862f5301Smrgclass Foo
7486862f5301Smrg{
7487862f5301Smrgpublic:
7488862f5301Smrg  Foo (void) { a = 0; }
7489862f5301Smrgprivate:
7490862f5301Smrg  int a;
7491862f5301Smrg};
7492862f5301Smrg_LT_EOF
7493862f5301Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7494862f5301Smrg      subroutine foo
7495862f5301Smrg      implicit none
7496862f5301Smrg      integer*4 a
7497862f5301Smrg      a=0
7498862f5301Smrg      return
7499862f5301Smrg      end
7500862f5301Smrg_LT_EOF
7501862f5301Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7502862f5301Smrg      subroutine foo
7503862f5301Smrg      implicit none
7504862f5301Smrg      integer a
7505862f5301Smrg      a=0
7506862f5301Smrg      return
7507862f5301Smrg      end
7508862f5301Smrg_LT_EOF
7509862f5301Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7510862f5301Smrgpublic class foo {
7511862f5301Smrg  private int a;
7512862f5301Smrg  public void bar (void) {
7513862f5301Smrg    a = 0;
7514862f5301Smrg  }
7515862f5301Smrg};
7516862f5301Smrg_LT_EOF
7517fc544a13Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7518fc544a13Smrgpackage foo
7519fc544a13Smrgfunc foo() {
7520fc544a13Smrg}
7521fc544a13Smrg_LT_EOF
7522862f5301Smrg])
7523862f5301Smrg
7524862f5301Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
7525862f5301Smrgcase "$CC $CFLAGS " in #(
7526862f5301Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
7527862f5301Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7528fc544a13Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
7529862f5301Smrgesac
7530862f5301Smrg
7531862f5301Smrgdnl Parse the compiler output and extract the necessary
7532862f5301Smrgdnl objects, libraries and library flags.
7533862f5301Smrgif AC_TRY_EVAL(ac_compile); then
7534862f5301Smrg  # Parse the compiler output and extract the necessary
7535862f5301Smrg  # objects, libraries and library flags.
7536862f5301Smrg
7537862f5301Smrg  # Sentinel used to keep track of whether or not we are before
7538862f5301Smrg  # the conftest object file.
7539862f5301Smrg  pre_test_object_deps_done=no
7540862f5301Smrg
7541862f5301Smrg  for p in `eval "$output_verbose_link_cmd"`; do
75426fc0178dSmrg    case $prev$p in
7543862f5301Smrg
7544862f5301Smrg    -L* | -R* | -l*)
7545862f5301Smrg       # Some compilers place space between "-{L,R}" and the path.
7546862f5301Smrg       # Remove the space.
75476fc0178dSmrg       if test x-L = "$p" ||
75486fc0178dSmrg          test x-R = "$p"; then
7549862f5301Smrg	 prev=$p
7550862f5301Smrg	 continue
7551862f5301Smrg       fi
7552862f5301Smrg
7553862f5301Smrg       # Expand the sysroot to ease extracting the directories later.
7554862f5301Smrg       if test -z "$prev"; then
7555862f5301Smrg         case $p in
7556862f5301Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7557862f5301Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7558862f5301Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7559862f5301Smrg         esac
7560862f5301Smrg       fi
7561862f5301Smrg       case $p in
7562862f5301Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7563862f5301Smrg       esac
75646fc0178dSmrg       if test no = "$pre_test_object_deps_done"; then
75656fc0178dSmrg	 case $prev in
7566862f5301Smrg	 -L | -R)
7567862f5301Smrg	   # Internal compiler library paths should come after those
7568862f5301Smrg	   # provided the user.  The postdeps already come after the
7569862f5301Smrg	   # user supplied libs so there is no need to process them.
7570862f5301Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
75716fc0178dSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
7572862f5301Smrg	   else
75736fc0178dSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
7574862f5301Smrg	   fi
7575862f5301Smrg	   ;;
7576862f5301Smrg	 # The "-l" case would never come before the object being
7577862f5301Smrg	 # linked, so don't bother handling this case.
7578862f5301Smrg	 esac
7579862f5301Smrg       else
7580862f5301Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
75816fc0178dSmrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
7582862f5301Smrg	 else
75836fc0178dSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
7584862f5301Smrg	 fi
7585862f5301Smrg       fi
7586862f5301Smrg       prev=
7587862f5301Smrg       ;;
7588862f5301Smrg
7589862f5301Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
7590862f5301Smrg    *.$objext)
7591862f5301Smrg       # This assumes that the test object file only shows up
7592862f5301Smrg       # once in the compiler output.
7593862f5301Smrg       if test "$p" = "conftest.$objext"; then
7594862f5301Smrg	 pre_test_object_deps_done=yes
7595862f5301Smrg	 continue
7596862f5301Smrg       fi
7597862f5301Smrg
75986fc0178dSmrg       if test no = "$pre_test_object_deps_done"; then
7599862f5301Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
76006fc0178dSmrg	   _LT_TAGVAR(predep_objects, $1)=$p
7601862f5301Smrg	 else
7602862f5301Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7603862f5301Smrg	 fi
7604862f5301Smrg       else
7605862f5301Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
76066fc0178dSmrg	   _LT_TAGVAR(postdep_objects, $1)=$p
7607862f5301Smrg	 else
7608862f5301Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7609862f5301Smrg	 fi
7610862f5301Smrg       fi
7611862f5301Smrg       ;;
76127a3b38f7Smrg
7613862f5301Smrg    *) ;; # Ignore the rest.
76147a3b38f7Smrg
7615862f5301Smrg    esac
7616862f5301Smrg  done
76177a3b38f7Smrg
7618862f5301Smrg  # Clean up.
7619862f5301Smrg  rm -f a.out a.exe
7620862f5301Smrgelse
7621862f5301Smrg  echo "libtool.m4: error: problem compiling $1 test program"
7622862f5301Smrgfi
76237a3b38f7Smrg
7624862f5301Smrg$RM -f confest.$objext
7625862f5301SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
76267a3b38f7Smrg
7627862f5301Smrg# PORTME: override above test on systems where it is broken
7628862f5301Smrgm4_if([$1], [CXX],
7629862f5301Smrg[case $host_os in
7630862f5301Smrginterix[[3-9]]*)
7631862f5301Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7632862f5301Smrg  # hack all around it, let's just trust "g++" to DTRT.
7633862f5301Smrg  _LT_TAGVAR(predep_objects,$1)=
7634862f5301Smrg  _LT_TAGVAR(postdep_objects,$1)=
7635862f5301Smrg  _LT_TAGVAR(postdeps,$1)=
7636862f5301Smrg  ;;
7637862f5301Smrgesac
7638862f5301Smrg])
76397a3b38f7Smrg
7640862f5301Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
7641862f5301Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7642862f5301Smrgesac
7643862f5301Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7644862f5301Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
76456fc0178dSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
7646862f5301Smrgfi
7647862f5301Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7648862f5301Smrg    [The directories searched by this compiler when creating a shared library])
7649862f5301Smrg_LT_TAGDECL([], [predep_objects], [1],
7650862f5301Smrg    [Dependencies to place before and after the objects being linked to
7651862f5301Smrg    create a shared library])
7652862f5301Smrg_LT_TAGDECL([], [postdep_objects], [1])
7653862f5301Smrg_LT_TAGDECL([], [predeps], [1])
7654862f5301Smrg_LT_TAGDECL([], [postdeps], [1])
7655862f5301Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
7656862f5301Smrg    [The library search path used internally by the compiler when linking
7657862f5301Smrg    a shared library])
7658862f5301Smrg])# _LT_SYS_HIDDEN_LIBDEPS
76597a3b38f7Smrg
76607a3b38f7Smrg
7661862f5301Smrg# _LT_LANG_F77_CONFIG([TAG])
7662862f5301Smrg# --------------------------
7663862f5301Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
7664862f5301Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
76656fc0178dSmrg# to write the compiler configuration to 'libtool'.
7666862f5301Smrgm4_defun([_LT_LANG_F77_CONFIG],
7667862f5301Smrg[AC_LANG_PUSH(Fortran 77)
76686fc0178dSmrgif test -z "$F77" || test no = "$F77"; then
7669862f5301Smrg  _lt_disable_F77=yes
7670862f5301Smrgfi
7671862f5301Smrg
7672862f5301Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7673862f5301Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
7674862f5301Smrg_LT_TAGVAR(always_export_symbols, $1)=no
7675862f5301Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7676862f5301Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7677862f5301Smrg_LT_TAGVAR(hardcode_direct, $1)=no
7678862f5301Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7679862f5301Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7680862f5301Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7681862f5301Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7682862f5301Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
7683862f5301Smrg_LT_TAGVAR(inherit_rpath, $1)=no
7684862f5301Smrg_LT_TAGVAR(module_cmds, $1)=
7685862f5301Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
7686862f5301Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7687862f5301Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7688862f5301Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7689862f5301Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7690862f5301Smrg_LT_TAGVAR(no_undefined_flag, $1)=
7691862f5301Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7692862f5301Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7693862f5301Smrg
7694862f5301Smrg# Source file extension for f77 test sources.
7695862f5301Smrgac_ext=f
7696862f5301Smrg
7697862f5301Smrg# Object file extension for compiled f77 test sources.
7698862f5301Smrgobjext=o
7699862f5301Smrg_LT_TAGVAR(objext, $1)=$objext
7700862f5301Smrg
7701862f5301Smrg# No sense in running all these tests if we already determined that
7702862f5301Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
7703862f5301Smrg# are currently assumed to apply to all compilers on this platform,
7704862f5301Smrg# and will be corrupted by setting them based on a non-working compiler.
77056fc0178dSmrgif test yes != "$_lt_disable_F77"; then
7706862f5301Smrg  # Code to be used in simple compile tests
7707862f5301Smrg  lt_simple_compile_test_code="\
7708862f5301Smrg      subroutine t
7709862f5301Smrg      return
7710862f5301Smrg      end
7711862f5301Smrg"
7712862f5301Smrg
7713862f5301Smrg  # Code to be used in simple link tests
7714862f5301Smrg  lt_simple_link_test_code="\
7715862f5301Smrg      program t
7716862f5301Smrg      end
7717862f5301Smrg"
77187a3b38f7Smrg
7719862f5301Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7720862f5301Smrg  _LT_TAG_COMPILER
77217a3b38f7Smrg
7722862f5301Smrg  # save warnings/boilerplate of simple test code
7723862f5301Smrg  _LT_COMPILER_BOILERPLATE
7724862f5301Smrg  _LT_LINKER_BOILERPLATE
77257a3b38f7Smrg
7726862f5301Smrg  # Allow CC to be a program name with arguments.
77276fc0178dSmrg  lt_save_CC=$CC
7728862f5301Smrg  lt_save_GCC=$GCC
7729862f5301Smrg  lt_save_CFLAGS=$CFLAGS
7730862f5301Smrg  CC=${F77-"f77"}
7731862f5301Smrg  CFLAGS=$FFLAGS
7732862f5301Smrg  compiler=$CC
7733862f5301Smrg  _LT_TAGVAR(compiler, $1)=$CC
7734862f5301Smrg  _LT_CC_BASENAME([$compiler])
7735862f5301Smrg  GCC=$G77
7736862f5301Smrg  if test -n "$compiler"; then
7737862f5301Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7738862f5301Smrg    AC_MSG_RESULT([$can_build_shared])
77397a3b38f7Smrg
7740862f5301Smrg    AC_MSG_CHECKING([whether to build shared libraries])
77416fc0178dSmrg    test no = "$can_build_shared" && enable_shared=no
77427a3b38f7Smrg
7743862f5301Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
7744862f5301Smrg    # are all built from PIC.
7745862f5301Smrg    case $host_os in
7746862f5301Smrg      aix3*)
77476fc0178dSmrg        test yes = "$enable_shared" && enable_static=no
7748862f5301Smrg        if test -n "$RANLIB"; then
7749862f5301Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7750862f5301Smrg          postinstall_cmds='$RANLIB $lib'
7751862f5301Smrg        fi
775244dda7b2Smrg        ;;
7753862f5301Smrg      aix[[4-9]]*)
77546fc0178dSmrg	if test ia64 != "$host_cpu"; then
77556fc0178dSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
77566fc0178dSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
77576fc0178dSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
77586fc0178dSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
77596fc0178dSmrg	  esac
7760862f5301Smrg	fi
776144dda7b2Smrg        ;;
7762862f5301Smrg    esac
7763862f5301Smrg    AC_MSG_RESULT([$enable_shared])
77647a3b38f7Smrg
7765862f5301Smrg    AC_MSG_CHECKING([whether to build static libraries])
7766862f5301Smrg    # Make sure either enable_shared or enable_static is yes.
77676fc0178dSmrg    test yes = "$enable_shared" || enable_static=yes
7768862f5301Smrg    AC_MSG_RESULT([$enable_static])
77697a3b38f7Smrg
77706fc0178dSmrg    _LT_TAGVAR(GCC, $1)=$G77
77716fc0178dSmrg    _LT_TAGVAR(LD, $1)=$LD
77727a3b38f7Smrg
7773862f5301Smrg    ## CAVEAT EMPTOR:
7774862f5301Smrg    ## There is no encapsulation within the following macros, do not change
7775862f5301Smrg    ## the running order or otherwise move them around unless you know exactly
7776862f5301Smrg    ## what you are doing...
7777862f5301Smrg    _LT_COMPILER_PIC($1)
7778862f5301Smrg    _LT_COMPILER_C_O($1)
7779862f5301Smrg    _LT_COMPILER_FILE_LOCKS($1)
7780862f5301Smrg    _LT_LINKER_SHLIBS($1)
7781862f5301Smrg    _LT_SYS_DYNAMIC_LINKER($1)
7782862f5301Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
77837a3b38f7Smrg
7784862f5301Smrg    _LT_CONFIG($1)
7785862f5301Smrg  fi # test -n "$compiler"
77867a3b38f7Smrg
7787862f5301Smrg  GCC=$lt_save_GCC
77886fc0178dSmrg  CC=$lt_save_CC
77896fc0178dSmrg  CFLAGS=$lt_save_CFLAGS
77906fc0178dSmrgfi # test yes != "$_lt_disable_F77"
77917a3b38f7Smrg
7792862f5301SmrgAC_LANG_POP
7793862f5301Smrg])# _LT_LANG_F77_CONFIG
77947a3b38f7Smrg
77957a3b38f7Smrg
7796862f5301Smrg# _LT_LANG_FC_CONFIG([TAG])
7797862f5301Smrg# -------------------------
7798862f5301Smrg# Ensure that the configuration variables for a Fortran compiler are
7799862f5301Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
78006fc0178dSmrg# to write the compiler configuration to 'libtool'.
7801862f5301Smrgm4_defun([_LT_LANG_FC_CONFIG],
7802862f5301Smrg[AC_LANG_PUSH(Fortran)
78037a3b38f7Smrg
78046fc0178dSmrgif test -z "$FC" || test no = "$FC"; then
7805862f5301Smrg  _lt_disable_FC=yes
7806862f5301Smrgfi
78077a3b38f7Smrg
7808862f5301Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7809862f5301Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
7810862f5301Smrg_LT_TAGVAR(always_export_symbols, $1)=no
7811862f5301Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7812862f5301Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7813862f5301Smrg_LT_TAGVAR(hardcode_direct, $1)=no
7814862f5301Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7815862f5301Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7816862f5301Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7817862f5301Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7818862f5301Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
7819862f5301Smrg_LT_TAGVAR(inherit_rpath, $1)=no
7820862f5301Smrg_LT_TAGVAR(module_cmds, $1)=
7821862f5301Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
7822862f5301Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7823862f5301Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7824862f5301Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7825862f5301Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7826862f5301Smrg_LT_TAGVAR(no_undefined_flag, $1)=
7827862f5301Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7828862f5301Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7829862f5301Smrg
7830862f5301Smrg# Source file extension for fc test sources.
7831862f5301Smrgac_ext=${ac_fc_srcext-f}
7832862f5301Smrg
7833862f5301Smrg# Object file extension for compiled fc test sources.
7834862f5301Smrgobjext=o
7835862f5301Smrg_LT_TAGVAR(objext, $1)=$objext
7836862f5301Smrg
7837862f5301Smrg# No sense in running all these tests if we already determined that
7838862f5301Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
7839862f5301Smrg# are currently assumed to apply to all compilers on this platform,
7840862f5301Smrg# and will be corrupted by setting them based on a non-working compiler.
78416fc0178dSmrgif test yes != "$_lt_disable_FC"; then
7842862f5301Smrg  # Code to be used in simple compile tests
7843862f5301Smrg  lt_simple_compile_test_code="\
7844862f5301Smrg      subroutine t
7845862f5301Smrg      return
7846862f5301Smrg      end
7847862f5301Smrg"
7848862f5301Smrg
7849862f5301Smrg  # Code to be used in simple link tests
7850862f5301Smrg  lt_simple_link_test_code="\
7851862f5301Smrg      program t
7852862f5301Smrg      end
7853862f5301Smrg"
7854862f5301Smrg
7855862f5301Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7856862f5301Smrg  _LT_TAG_COMPILER
78577a3b38f7Smrg
7858862f5301Smrg  # save warnings/boilerplate of simple test code
7859862f5301Smrg  _LT_COMPILER_BOILERPLATE
7860862f5301Smrg  _LT_LINKER_BOILERPLATE
78617a3b38f7Smrg
7862862f5301Smrg  # Allow CC to be a program name with arguments.
78636fc0178dSmrg  lt_save_CC=$CC
7864862f5301Smrg  lt_save_GCC=$GCC
7865862f5301Smrg  lt_save_CFLAGS=$CFLAGS
7866862f5301Smrg  CC=${FC-"f95"}
7867862f5301Smrg  CFLAGS=$FCFLAGS
7868862f5301Smrg  compiler=$CC
7869862f5301Smrg  GCC=$ac_cv_fc_compiler_gnu
78707a3b38f7Smrg
7871862f5301Smrg  _LT_TAGVAR(compiler, $1)=$CC
7872862f5301Smrg  _LT_CC_BASENAME([$compiler])
78737a3b38f7Smrg
7874862f5301Smrg  if test -n "$compiler"; then
7875862f5301Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7876862f5301Smrg    AC_MSG_RESULT([$can_build_shared])
78777a3b38f7Smrg
7878862f5301Smrg    AC_MSG_CHECKING([whether to build shared libraries])
78796fc0178dSmrg    test no = "$can_build_shared" && enable_shared=no
7880862f5301Smrg
7881862f5301Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
7882862f5301Smrg    # are all built from PIC.
7883862f5301Smrg    case $host_os in
7884862f5301Smrg      aix3*)
78856fc0178dSmrg        test yes = "$enable_shared" && enable_static=no
7886862f5301Smrg        if test -n "$RANLIB"; then
7887862f5301Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7888862f5301Smrg          postinstall_cmds='$RANLIB $lib'
7889862f5301Smrg        fi
7890862f5301Smrg        ;;
7891862f5301Smrg      aix[[4-9]]*)
78926fc0178dSmrg	if test ia64 != "$host_cpu"; then
78936fc0178dSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
78946fc0178dSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
78956fc0178dSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
78966fc0178dSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
78976fc0178dSmrg	  esac
7898862f5301Smrg	fi
789944dda7b2Smrg        ;;
790044dda7b2Smrg    esac
7901862f5301Smrg    AC_MSG_RESULT([$enable_shared])
79027a3b38f7Smrg
7903862f5301Smrg    AC_MSG_CHECKING([whether to build static libraries])
7904862f5301Smrg    # Make sure either enable_shared or enable_static is yes.
79056fc0178dSmrg    test yes = "$enable_shared" || enable_static=yes
7906862f5301Smrg    AC_MSG_RESULT([$enable_static])
79077a3b38f7Smrg
79086fc0178dSmrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
79096fc0178dSmrg    _LT_TAGVAR(LD, $1)=$LD
79107a3b38f7Smrg
791144dda7b2Smrg    ## CAVEAT EMPTOR:
791244dda7b2Smrg    ## There is no encapsulation within the following macros, do not change
791344dda7b2Smrg    ## the running order or otherwise move them around unless you know exactly
791444dda7b2Smrg    ## what you are doing...
791544dda7b2Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
791644dda7b2Smrg    _LT_COMPILER_PIC($1)
791744dda7b2Smrg    _LT_COMPILER_C_O($1)
791844dda7b2Smrg    _LT_COMPILER_FILE_LOCKS($1)
791944dda7b2Smrg    _LT_LINKER_SHLIBS($1)
792044dda7b2Smrg    _LT_SYS_DYNAMIC_LINKER($1)
792144dda7b2Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
79227a3b38f7Smrg
7923862f5301Smrg    _LT_CONFIG($1)
7924862f5301Smrg  fi # test -n "$compiler"
7925862f5301Smrg
7926862f5301Smrg  GCC=$lt_save_GCC
7927862f5301Smrg  CC=$lt_save_CC
7928862f5301Smrg  CFLAGS=$lt_save_CFLAGS
79296fc0178dSmrgfi # test yes != "$_lt_disable_FC"
7930862f5301Smrg
7931862f5301SmrgAC_LANG_POP
7932862f5301Smrg])# _LT_LANG_FC_CONFIG
7933862f5301Smrg
7934862f5301Smrg
7935862f5301Smrg# _LT_LANG_GCJ_CONFIG([TAG])
7936862f5301Smrg# --------------------------
7937862f5301Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
7938862f5301Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
79396fc0178dSmrg# to write the compiler configuration to 'libtool'.
7940862f5301Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
7941862f5301Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
7942862f5301SmrgAC_LANG_SAVE
7943862f5301Smrg
7944862f5301Smrg# Source file extension for Java test sources.
7945862f5301Smrgac_ext=java
7946862f5301Smrg
7947862f5301Smrg# Object file extension for compiled Java test sources.
7948862f5301Smrgobjext=o
7949862f5301Smrg_LT_TAGVAR(objext, $1)=$objext
7950862f5301Smrg
7951862f5301Smrg# Code to be used in simple compile tests
7952862f5301Smrglt_simple_compile_test_code="class foo {}"
7953862f5301Smrg
7954862f5301Smrg# Code to be used in simple link tests
7955862f5301Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7956862f5301Smrg
7957862f5301Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7958862f5301Smrg_LT_TAG_COMPILER
7959862f5301Smrg
7960862f5301Smrg# save warnings/boilerplate of simple test code
7961862f5301Smrg_LT_COMPILER_BOILERPLATE
7962862f5301Smrg_LT_LINKER_BOILERPLATE
7963862f5301Smrg
7964862f5301Smrg# Allow CC to be a program name with arguments.
7965862f5301Smrglt_save_CC=$CC
7966862f5301Smrglt_save_CFLAGS=$CFLAGS
7967862f5301Smrglt_save_GCC=$GCC
7968862f5301SmrgGCC=yes
7969862f5301SmrgCC=${GCJ-"gcj"}
7970862f5301SmrgCFLAGS=$GCJFLAGS
7971862f5301Smrgcompiler=$CC
7972862f5301Smrg_LT_TAGVAR(compiler, $1)=$CC
79736fc0178dSmrg_LT_TAGVAR(LD, $1)=$LD
7974862f5301Smrg_LT_CC_BASENAME([$compiler])
7975862f5301Smrg
7976862f5301Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
7977862f5301Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7978862f5301Smrg
7979862f5301Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7980862f5301Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7981862f5301Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7982862f5301Smrg
7983862f5301Smrgif test -n "$compiler"; then
7984862f5301Smrg  _LT_COMPILER_NO_RTTI($1)
7985862f5301Smrg  _LT_COMPILER_PIC($1)
7986862f5301Smrg  _LT_COMPILER_C_O($1)
7987862f5301Smrg  _LT_COMPILER_FILE_LOCKS($1)
7988862f5301Smrg  _LT_LINKER_SHLIBS($1)
7989862f5301Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7990862f5301Smrg
7991862f5301Smrg  _LT_CONFIG($1)
7992862f5301Smrgfi
7993862f5301Smrg
7994862f5301SmrgAC_LANG_RESTORE
7995862f5301Smrg
7996862f5301SmrgGCC=$lt_save_GCC
7997862f5301SmrgCC=$lt_save_CC
7998862f5301SmrgCFLAGS=$lt_save_CFLAGS
7999862f5301Smrg])# _LT_LANG_GCJ_CONFIG
8000862f5301Smrg
8001862f5301Smrg
8002fc544a13Smrg# _LT_LANG_GO_CONFIG([TAG])
8003fc544a13Smrg# --------------------------
8004fc544a13Smrg# Ensure that the configuration variables for the GNU Go compiler
8005fc544a13Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
80066fc0178dSmrg# to write the compiler configuration to 'libtool'.
8007fc544a13Smrgm4_defun([_LT_LANG_GO_CONFIG],
8008fc544a13Smrg[AC_REQUIRE([LT_PROG_GO])dnl
8009fc544a13SmrgAC_LANG_SAVE
8010fc544a13Smrg
8011fc544a13Smrg# Source file extension for Go test sources.
8012fc544a13Smrgac_ext=go
8013fc544a13Smrg
8014fc544a13Smrg# Object file extension for compiled Go test sources.
8015fc544a13Smrgobjext=o
8016fc544a13Smrg_LT_TAGVAR(objext, $1)=$objext
8017fc544a13Smrg
8018fc544a13Smrg# Code to be used in simple compile tests
8019fc544a13Smrglt_simple_compile_test_code="package main; func main() { }"
8020fc544a13Smrg
8021fc544a13Smrg# Code to be used in simple link tests
8022fc544a13Smrglt_simple_link_test_code='package main; func main() { }'
8023fc544a13Smrg
8024fc544a13Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8025fc544a13Smrg_LT_TAG_COMPILER
8026fc544a13Smrg
8027fc544a13Smrg# save warnings/boilerplate of simple test code
8028fc544a13Smrg_LT_COMPILER_BOILERPLATE
8029fc544a13Smrg_LT_LINKER_BOILERPLATE
8030fc544a13Smrg
8031fc544a13Smrg# Allow CC to be a program name with arguments.
8032fc544a13Smrglt_save_CC=$CC
8033fc544a13Smrglt_save_CFLAGS=$CFLAGS
8034fc544a13Smrglt_save_GCC=$GCC
8035fc544a13SmrgGCC=yes
8036fc544a13SmrgCC=${GOC-"gccgo"}
8037fc544a13SmrgCFLAGS=$GOFLAGS
8038fc544a13Smrgcompiler=$CC
8039fc544a13Smrg_LT_TAGVAR(compiler, $1)=$CC
80406fc0178dSmrg_LT_TAGVAR(LD, $1)=$LD
8041fc544a13Smrg_LT_CC_BASENAME([$compiler])
8042fc544a13Smrg
8043fc544a13Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
8044fc544a13Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8045fc544a13Smrg
8046fc544a13Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8047fc544a13Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8048fc544a13Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8049fc544a13Smrg
8050fc544a13Smrgif test -n "$compiler"; then
8051fc544a13Smrg  _LT_COMPILER_NO_RTTI($1)
8052fc544a13Smrg  _LT_COMPILER_PIC($1)
8053fc544a13Smrg  _LT_COMPILER_C_O($1)
8054fc544a13Smrg  _LT_COMPILER_FILE_LOCKS($1)
8055fc544a13Smrg  _LT_LINKER_SHLIBS($1)
8056fc544a13Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8057fc544a13Smrg
8058fc544a13Smrg  _LT_CONFIG($1)
8059fc544a13Smrgfi
8060fc544a13Smrg
8061fc544a13SmrgAC_LANG_RESTORE
8062fc544a13Smrg
8063fc544a13SmrgGCC=$lt_save_GCC
8064fc544a13SmrgCC=$lt_save_CC
8065fc544a13SmrgCFLAGS=$lt_save_CFLAGS
8066fc544a13Smrg])# _LT_LANG_GO_CONFIG
8067fc544a13Smrg
8068fc544a13Smrg
8069862f5301Smrg# _LT_LANG_RC_CONFIG([TAG])
8070862f5301Smrg# -------------------------
8071862f5301Smrg# Ensure that the configuration variables for the Windows resource compiler
8072862f5301Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
80736fc0178dSmrg# to write the compiler configuration to 'libtool'.
8074862f5301Smrgm4_defun([_LT_LANG_RC_CONFIG],
8075862f5301Smrg[AC_REQUIRE([LT_PROG_RC])dnl
8076862f5301SmrgAC_LANG_SAVE
8077862f5301Smrg
8078862f5301Smrg# Source file extension for RC test sources.
8079862f5301Smrgac_ext=rc
8080862f5301Smrg
8081862f5301Smrg# Object file extension for compiled RC test sources.
8082862f5301Smrgobjext=o
8083862f5301Smrg_LT_TAGVAR(objext, $1)=$objext
8084862f5301Smrg
8085862f5301Smrg# Code to be used in simple compile tests
8086862f5301Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8087862f5301Smrg
8088862f5301Smrg# Code to be used in simple link tests
80896fc0178dSmrglt_simple_link_test_code=$lt_simple_compile_test_code
8090862f5301Smrg
8091862f5301Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8092862f5301Smrg_LT_TAG_COMPILER
8093862f5301Smrg
8094862f5301Smrg# save warnings/boilerplate of simple test code
8095862f5301Smrg_LT_COMPILER_BOILERPLATE
8096862f5301Smrg_LT_LINKER_BOILERPLATE
8097862f5301Smrg
8098862f5301Smrg# Allow CC to be a program name with arguments.
80996fc0178dSmrglt_save_CC=$CC
8100862f5301Smrglt_save_CFLAGS=$CFLAGS
8101862f5301Smrglt_save_GCC=$GCC
8102862f5301SmrgGCC=
8103862f5301SmrgCC=${RC-"windres"}
8104862f5301SmrgCFLAGS=
8105862f5301Smrgcompiler=$CC
8106862f5301Smrg_LT_TAGVAR(compiler, $1)=$CC
8107862f5301Smrg_LT_CC_BASENAME([$compiler])
8108862f5301Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8109862f5301Smrg
8110862f5301Smrgif test -n "$compiler"; then
8111862f5301Smrg  :
8112862f5301Smrg  _LT_CONFIG($1)
8113862f5301Smrgfi
8114862f5301Smrg
8115862f5301SmrgGCC=$lt_save_GCC
8116862f5301SmrgAC_LANG_RESTORE
8117862f5301SmrgCC=$lt_save_CC
8118862f5301SmrgCFLAGS=$lt_save_CFLAGS
8119862f5301Smrg])# _LT_LANG_RC_CONFIG
8120862f5301Smrg
8121862f5301Smrg
8122862f5301Smrg# LT_PROG_GCJ
8123862f5301Smrg# -----------
8124862f5301SmrgAC_DEFUN([LT_PROG_GCJ],
8125862f5301Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8126862f5301Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8127862f5301Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
81286fc0178dSmrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
8129862f5301Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
8130862f5301Smrg])
8131862f5301Smrg
8132862f5301Smrg# Old name:
8133862f5301SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8134862f5301Smrgdnl aclocal-1.4 backwards compatibility:
8135862f5301Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8136862f5301Smrg
8137862f5301Smrg
8138fc544a13Smrg# LT_PROG_GO
8139fc544a13Smrg# ----------
8140fc544a13SmrgAC_DEFUN([LT_PROG_GO],
8141fc544a13Smrg[AC_CHECK_TOOL(GOC, gccgo,)
8142fc544a13Smrg])
8143fc544a13Smrg
8144fc544a13Smrg
8145862f5301Smrg# LT_PROG_RC
8146862f5301Smrg# ----------
8147862f5301SmrgAC_DEFUN([LT_PROG_RC],
8148862f5301Smrg[AC_CHECK_TOOL(RC, windres,)
8149862f5301Smrg])
8150862f5301Smrg
8151862f5301Smrg# Old name:
8152862f5301SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8153862f5301Smrgdnl aclocal-1.4 backwards compatibility:
8154862f5301Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8155862f5301Smrg
8156862f5301Smrg
8157862f5301Smrg# _LT_DECL_EGREP
8158862f5301Smrg# --------------
8159862f5301Smrg# If we don't have a new enough Autoconf to choose the best grep
8160862f5301Smrg# available, choose the one first in the user's PATH.
8161862f5301Smrgm4_defun([_LT_DECL_EGREP],
8162862f5301Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
8163862f5301SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
8164862f5301Smrgtest -z "$GREP" && GREP=grep
8165862f5301Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8166862f5301Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
8167862f5301Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
8168862f5301Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8169862f5301SmrgAC_SUBST([GREP])
8170862f5301Smrg])
8171862f5301Smrg
81727a3b38f7Smrg
8173862f5301Smrg# _LT_DECL_OBJDUMP
8174862f5301Smrg# --------------
8175862f5301Smrg# If we don't have a new enough Autoconf to choose the best objdump
8176862f5301Smrg# available, choose the one first in the user's PATH.
8177862f5301Smrgm4_defun([_LT_DECL_OBJDUMP],
8178862f5301Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8179862f5301Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8180862f5301Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8181862f5301SmrgAC_SUBST([OBJDUMP])
8182862f5301Smrg])
81837a3b38f7Smrg
8184862f5301Smrg# _LT_DECL_DLLTOOL
8185862f5301Smrg# ----------------
8186862f5301Smrg# Ensure DLLTOOL variable is set.
8187862f5301Smrgm4_defun([_LT_DECL_DLLTOOL],
8188862f5301Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8189862f5301Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8190862f5301Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8191862f5301SmrgAC_SUBST([DLLTOOL])
8192862f5301Smrg])
81937a3b38f7Smrg
8194862f5301Smrg# _LT_DECL_SED
8195862f5301Smrg# ------------
8196862f5301Smrg# Check for a fully-functional sed program, that truncates
8197862f5301Smrg# as few characters as possible.  Prefer GNU sed if found.
8198862f5301Smrgm4_defun([_LT_DECL_SED],
8199862f5301Smrg[AC_PROG_SED
8200862f5301Smrgtest -z "$SED" && SED=sed
8201862f5301SmrgXsed="$SED -e 1s/^X//"
8202862f5301Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8203862f5301Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8204862f5301Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8205862f5301Smrg])# _LT_DECL_SED
82067a3b38f7Smrg
8207862f5301Smrgm4_ifndef([AC_PROG_SED], [
8208862f5301Smrg# NOTE: This macro has been submitted for inclusion into   #
8209862f5301Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8210862f5301Smrg#  a released version of Autoconf we should remove this    #
8211862f5301Smrg#  macro and use it instead.                               #
82127a3b38f7Smrg
8213862f5301Smrgm4_defun([AC_PROG_SED],
8214862f5301Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
8215862f5301SmrgAC_CACHE_VAL(lt_cv_path_SED,
8216862f5301Smrg[# Loop through the user's path and test for sed and gsed.
8217862f5301Smrg# Then use that list of sed's as ones to test for truncation.
8218862f5301Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8219862f5301Smrgfor as_dir in $PATH
8220862f5301Smrgdo
8221862f5301Smrg  IFS=$as_save_IFS
8222862f5301Smrg  test -z "$as_dir" && as_dir=.
8223862f5301Smrg  for lt_ac_prog in sed gsed; do
8224862f5301Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
8225862f5301Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8226862f5301Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8227862f5301Smrg      fi
8228862f5301Smrg    done
8229862f5301Smrg  done
8230862f5301Smrgdone
8231862f5301SmrgIFS=$as_save_IFS
8232862f5301Smrglt_ac_max=0
8233862f5301Smrglt_ac_count=0
8234862f5301Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8235862f5301Smrg# along with /bin/sed that truncates output.
8236862f5301Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
82376fc0178dSmrg  test ! -f "$lt_ac_sed" && continue
8238862f5301Smrg  cat /dev/null > conftest.in
8239862f5301Smrg  lt_ac_count=0
8240862f5301Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8241862f5301Smrg  # Check for GNU sed and select it if it is found.
8242862f5301Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8243862f5301Smrg    lt_cv_path_SED=$lt_ac_sed
8244862f5301Smrg    break
8245862f5301Smrg  fi
8246862f5301Smrg  while true; do
8247862f5301Smrg    cat conftest.in conftest.in >conftest.tmp
8248862f5301Smrg    mv conftest.tmp conftest.in
8249862f5301Smrg    cp conftest.in conftest.nl
8250862f5301Smrg    echo >>conftest.nl
8251862f5301Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8252862f5301Smrg    cmp -s conftest.out conftest.nl || break
8253862f5301Smrg    # 10000 chars as input seems more than enough
82546fc0178dSmrg    test 10 -lt "$lt_ac_count" && break
8255862f5301Smrg    lt_ac_count=`expr $lt_ac_count + 1`
82566fc0178dSmrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
8257862f5301Smrg      lt_ac_max=$lt_ac_count
8258862f5301Smrg      lt_cv_path_SED=$lt_ac_sed
8259862f5301Smrg    fi
8260862f5301Smrg  done
8261862f5301Smrgdone
826244dda7b2Smrg])
8263862f5301SmrgSED=$lt_cv_path_SED
8264862f5301SmrgAC_SUBST([SED])
8265862f5301SmrgAC_MSG_RESULT([$SED])
8266862f5301Smrg])#AC_PROG_SED
8267862f5301Smrg])#m4_ifndef
82687a3b38f7Smrg
8269862f5301Smrg# Old name:
8270862f5301SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8271862f5301Smrgdnl aclocal-1.4 backwards compatibility:
8272862f5301Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
82737a3b38f7Smrg
82747a3b38f7Smrg
8275862f5301Smrg# _LT_CHECK_SHELL_FEATURES
8276862f5301Smrg# ------------------------
8277862f5301Smrg# Find out whether the shell is Bourne or XSI compatible,
8278862f5301Smrg# or has some other useful features.
8279862f5301Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
82806fc0178dSmrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8281862f5301Smrg  lt_unset=unset
8282862f5301Smrgelse
8283862f5301Smrg  lt_unset=false
8284862f5301Smrgfi
8285862f5301Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
82867a3b38f7Smrg
8287862f5301Smrg# test EBCDIC or ASCII
8288862f5301Smrgcase `echo X|tr X '\101'` in
8289862f5301Smrg A) # ASCII based system
8290862f5301Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8291862f5301Smrg  lt_SP2NL='tr \040 \012'
8292862f5301Smrg  lt_NL2SP='tr \015\012 \040\040'
8293862f5301Smrg  ;;
8294862f5301Smrg *) # EBCDIC based system
8295862f5301Smrg  lt_SP2NL='tr \100 \n'
8296862f5301Smrg  lt_NL2SP='tr \r\n \100\100'
8297862f5301Smrg  ;;
8298862f5301Smrgesac
8299862f5301Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8300862f5301Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8301862f5301Smrg])# _LT_CHECK_SHELL_FEATURES
8302862f5301Smrg
8303862f5301Smrg
8304862f5301Smrg# _LT_PATH_CONVERSION_FUNCTIONS
8305862f5301Smrg# -----------------------------
83066fc0178dSmrg# Determine what file name conversion functions should be used by
8307862f5301Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8308862f5301Smrg# for certain cross-compile configurations and native mingw.
8309862f5301Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8310862f5301Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8311862f5301SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
8312862f5301SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
8313862f5301SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
8314862f5301Smrg[case $host in
8315862f5301Smrg  *-*-mingw* )
8316862f5301Smrg    case $build in
8317862f5301Smrg      *-*-mingw* ) # actually msys
8318862f5301Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8319862f5301Smrg        ;;
8320862f5301Smrg      *-*-cygwin* )
8321862f5301Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8322862f5301Smrg        ;;
8323862f5301Smrg      * ) # otherwise, assume *nix
8324862f5301Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8325862f5301Smrg        ;;
8326862f5301Smrg    esac
832744dda7b2Smrg    ;;
8328862f5301Smrg  *-*-cygwin* )
8329862f5301Smrg    case $build in
8330862f5301Smrg      *-*-mingw* ) # actually msys
8331862f5301Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8332862f5301Smrg        ;;
8333862f5301Smrg      *-*-cygwin* )
8334862f5301Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
8335862f5301Smrg        ;;
8336862f5301Smrg      * ) # otherwise, assume *nix
8337862f5301Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8338862f5301Smrg        ;;
833944dda7b2Smrg    esac
834044dda7b2Smrg    ;;
8341862f5301Smrg  * ) # unhandled hosts (and "normal" native builds)
8342862f5301Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
8343862f5301Smrg    ;;
834444dda7b2Smrgesac
834544dda7b2Smrg])
8346862f5301Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
8347862f5301SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8348862f5301Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8349862f5301Smrg         [0], [convert $build file names to $host format])dnl
8350862f5301Smrg
8351862f5301SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
8352862f5301SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8353862f5301Smrg[#assume ordinary cross tools, or native build.
8354862f5301Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
8355862f5301Smrgcase $host in
8356862f5301Smrg  *-*-mingw* )
8357862f5301Smrg    case $build in
8358862f5301Smrg      *-*-mingw* ) # actually msys
8359862f5301Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8360862f5301Smrg        ;;
8361862f5301Smrg    esac
8362862f5301Smrg    ;;
836344dda7b2Smrgesac
8364862f5301Smrg])
8365862f5301Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
8366862f5301SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8367862f5301Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8368862f5301Smrg         [0], [convert $build files to toolchain format])dnl
8369862f5301Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
83707a3b38f7Smrg
8371862f5301Smrg# Helper functions for option handling.                    -*- Autoconf -*-
8372862f5301Smrg#
83736fc0178dSmrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
83746fc0178dSmrg#   Foundation, Inc.
8375862f5301Smrg#   Written by Gary V. Vaughan, 2004
8376862f5301Smrg#
8377862f5301Smrg# This file is free software; the Free Software Foundation gives
8378862f5301Smrg# unlimited permission to copy and/or distribute it, with or without
8379862f5301Smrg# modifications, as long as this notice is preserved.
83807a3b38f7Smrg
83816fc0178dSmrg# serial 8 ltoptions.m4
83827a3b38f7Smrg
8383862f5301Smrg# This is to help aclocal find these macros, as it can't see m4_define.
8384862f5301SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
83857a3b38f7Smrg
83867a3b38f7Smrg
8387862f5301Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
8388862f5301Smrg# ------------------------------------------
8389862f5301Smrgm4_define([_LT_MANGLE_OPTION],
8390862f5301Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
83917a3b38f7Smrg
83927a3b38f7Smrg
8393862f5301Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
8394862f5301Smrg# ---------------------------------------
8395862f5301Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
8396862f5301Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
8397862f5301Smrg# saved as a flag.
8398862f5301Smrgm4_define([_LT_SET_OPTION],
8399862f5301Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
8400862f5301Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
8401862f5301Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
84026fc0178dSmrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
8403862f5301Smrg])
84047a3b38f7Smrg
840544dda7b2Smrg
8406862f5301Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
8407862f5301Smrg# ------------------------------------------------------------
8408862f5301Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8409862f5301Smrgm4_define([_LT_IF_OPTION],
8410862f5301Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
841144dda7b2Smrg
841244dda7b2Smrg
8413862f5301Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
8414862f5301Smrg# -------------------------------------------------------
8415862f5301Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
8416862f5301Smrg# are set.
8417862f5301Smrgm4_define([_LT_UNLESS_OPTIONS],
8418862f5301Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8419862f5301Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
8420862f5301Smrg		      [m4_define([$0_found])])])[]dnl
8421862f5301Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
8422862f5301Smrg])[]dnl
8423862f5301Smrg])
8424862f5301Smrg
8425862f5301Smrg
8426862f5301Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
8427862f5301Smrg# ----------------------------------------
8428862f5301Smrg# OPTION-LIST is a space-separated list of Libtool options associated
8429862f5301Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
8430862f5301Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
8431862f5301Smrg# the unknown option and exit.
8432862f5301Smrgm4_defun([_LT_SET_OPTIONS],
8433862f5301Smrg[# Set options
8434862f5301Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8435862f5301Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
8436862f5301Smrg
8437862f5301Smrgm4_if([$1],[LT_INIT],[
8438862f5301Smrg  dnl
8439862f5301Smrg  dnl Simply set some default values (i.e off) if boolean options were not
8440862f5301Smrg  dnl specified:
8441862f5301Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
8442862f5301Smrg  ])
8443862f5301Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
8444862f5301Smrg  ])
8445862f5301Smrg  dnl
8446862f5301Smrg  dnl If no reference was made to various pairs of opposing options, then
8447862f5301Smrg  dnl we run the default mode handler for the pair.  For example, if neither
84486fc0178dSmrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
8449862f5301Smrg  dnl archives by default:
8450862f5301Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
8451862f5301Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
8452862f5301Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
8453862f5301Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
84546fc0178dSmrg		   [_LT_ENABLE_FAST_INSTALL])
84556fc0178dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
84566fc0178dSmrg		   [_LT_WITH_AIX_SONAME([aix])])
8457862f5301Smrg  ])
8458862f5301Smrg])# _LT_SET_OPTIONS
8459862f5301Smrg
846044dda7b2Smrg
84617a3b38f7Smrg
8462862f5301Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
8463862f5301Smrg# -----------------------------------------
8464862f5301Smrgm4_define([_LT_MANGLE_DEFUN],
8465862f5301Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
84667a3b38f7Smrg
84677a3b38f7Smrg
8468862f5301Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
8469862f5301Smrg# -----------------------------------------------
8470862f5301Smrgm4_define([LT_OPTION_DEFINE],
8471862f5301Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
8472862f5301Smrg])# LT_OPTION_DEFINE
84737a3b38f7Smrg
84747a3b38f7Smrg
8475862f5301Smrg# dlopen
8476862f5301Smrg# ------
8477862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
8478862f5301Smrg])
84797a3b38f7Smrg
8480862f5301SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
8481862f5301Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
8482862f5301SmrgAC_DIAGNOSE([obsolete],
8483862f5301Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
84846fc0178dSmrgput the 'dlopen' option into LT_INIT's first parameter.])
8485862f5301Smrg])
84867a3b38f7Smrg
8487862f5301Smrgdnl aclocal-1.4 backwards compatibility:
8488862f5301Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
84897a3b38f7Smrg
84907a3b38f7Smrg
8491862f5301Smrg# win32-dll
8492862f5301Smrg# ---------
8493862f5301Smrg# Declare package support for building win32 dll's.
8494862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
8495862f5301Smrg[enable_win32_dll=yes
84967a3b38f7Smrg
8497862f5301Smrgcase $host in
8498862f5301Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
8499862f5301Smrg  AC_CHECK_TOOL(AS, as, false)
8500862f5301Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8501862f5301Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
8502862f5301Smrg  ;;
8503862f5301Smrgesac
85047a3b38f7Smrg
8505862f5301Smrgtest -z "$AS" && AS=as
8506862f5301Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
85077a3b38f7Smrg
8508862f5301Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8509862f5301Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
85107a3b38f7Smrg
8511862f5301Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8512862f5301Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
8513862f5301Smrg])# win32-dll
85147a3b38f7Smrg
8515862f5301SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
8516862f5301Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8517862f5301Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
8518862f5301SmrgAC_DIAGNOSE([obsolete],
8519862f5301Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
85206fc0178dSmrgput the 'win32-dll' option into LT_INIT's first parameter.])
8521862f5301Smrg])
85227a3b38f7Smrg
8523862f5301Smrgdnl aclocal-1.4 backwards compatibility:
8524862f5301Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
852544dda7b2Smrg
85267a3b38f7Smrg
8527862f5301Smrg# _LT_ENABLE_SHARED([DEFAULT])
8528862f5301Smrg# ----------------------------
85296fc0178dSmrg# implement the --enable-shared flag, and supports the 'shared' and
85306fc0178dSmrg# 'disable-shared' LT_INIT options.
85316fc0178dSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8532862f5301Smrgm4_define([_LT_ENABLE_SHARED],
8533862f5301Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
8534862f5301SmrgAC_ARG_ENABLE([shared],
8535862f5301Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
8536862f5301Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
8537862f5301Smrg    [p=${PACKAGE-default}
8538862f5301Smrg    case $enableval in
8539862f5301Smrg    yes) enable_shared=yes ;;
8540862f5301Smrg    no) enable_shared=no ;;
8541862f5301Smrg    *)
8542862f5301Smrg      enable_shared=no
8543862f5301Smrg      # Look at the argument we got.  We use all the common list separators.
85446fc0178dSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8545862f5301Smrg      for pkg in $enableval; do
85466fc0178dSmrg	IFS=$lt_save_ifs
8547862f5301Smrg	if test "X$pkg" = "X$p"; then
8548862f5301Smrg	  enable_shared=yes
8549862f5301Smrg	fi
8550862f5301Smrg      done
85516fc0178dSmrg      IFS=$lt_save_ifs
8552862f5301Smrg      ;;
8553862f5301Smrg    esac],
8554862f5301Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
85557a3b38f7Smrg
8556862f5301Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
8557862f5301Smrg	[Whether or not to build shared libraries])
8558862f5301Smrg])# _LT_ENABLE_SHARED
85597a3b38f7Smrg
8560862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
8561862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
85627a3b38f7Smrg
8563862f5301Smrg# Old names:
8564862f5301SmrgAC_DEFUN([AC_ENABLE_SHARED],
8565862f5301Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
8566862f5301Smrg])
85677a3b38f7Smrg
8568862f5301SmrgAC_DEFUN([AC_DISABLE_SHARED],
8569862f5301Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
8570862f5301Smrg])
85717a3b38f7Smrg
8572862f5301SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
8573862f5301SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
85747a3b38f7Smrg
8575862f5301Smrgdnl aclocal-1.4 backwards compatibility:
8576862f5301Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
8577862f5301Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
85787a3b38f7Smrg
85797a3b38f7Smrg
85807a3b38f7Smrg
8581862f5301Smrg# _LT_ENABLE_STATIC([DEFAULT])
8582862f5301Smrg# ----------------------------
85836fc0178dSmrg# implement the --enable-static flag, and support the 'static' and
85846fc0178dSmrg# 'disable-static' LT_INIT options.
85856fc0178dSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8586862f5301Smrgm4_define([_LT_ENABLE_STATIC],
8587862f5301Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
8588862f5301SmrgAC_ARG_ENABLE([static],
8589862f5301Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
8590862f5301Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
8591862f5301Smrg    [p=${PACKAGE-default}
8592862f5301Smrg    case $enableval in
8593862f5301Smrg    yes) enable_static=yes ;;
8594862f5301Smrg    no) enable_static=no ;;
8595862f5301Smrg    *)
8596862f5301Smrg     enable_static=no
8597862f5301Smrg      # Look at the argument we got.  We use all the common list separators.
85986fc0178dSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8599862f5301Smrg      for pkg in $enableval; do
86006fc0178dSmrg	IFS=$lt_save_ifs
8601862f5301Smrg	if test "X$pkg" = "X$p"; then
8602862f5301Smrg	  enable_static=yes
8603862f5301Smrg	fi
8604862f5301Smrg      done
86056fc0178dSmrg      IFS=$lt_save_ifs
8606862f5301Smrg      ;;
8607862f5301Smrg    esac],
8608862f5301Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8609862f5301Smrg
8610862f5301Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
8611862f5301Smrg	[Whether or not to build static libraries])
8612862f5301Smrg])# _LT_ENABLE_STATIC
8613862f5301Smrg
8614862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
8615862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
86167a3b38f7Smrg
8617862f5301Smrg# Old names:
8618862f5301SmrgAC_DEFUN([AC_ENABLE_STATIC],
8619862f5301Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
8620862f5301Smrg])
86217a3b38f7Smrg
8622862f5301SmrgAC_DEFUN([AC_DISABLE_STATIC],
8623862f5301Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
8624862f5301Smrg])
86257a3b38f7Smrg
8626862f5301SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
8627862f5301SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
86287a3b38f7Smrg
8629862f5301Smrgdnl aclocal-1.4 backwards compatibility:
8630862f5301Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
8631862f5301Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
86327a3b38f7Smrg
86337a3b38f7Smrg
86347a3b38f7Smrg
8635862f5301Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
8636862f5301Smrg# ----------------------------------
86376fc0178dSmrg# implement the --enable-fast-install flag, and support the 'fast-install'
86386fc0178dSmrg# and 'disable-fast-install' LT_INIT options.
86396fc0178dSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8640862f5301Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
8641862f5301Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
8642862f5301SmrgAC_ARG_ENABLE([fast-install],
8643862f5301Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
8644862f5301Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
8645862f5301Smrg    [p=${PACKAGE-default}
8646862f5301Smrg    case $enableval in
8647862f5301Smrg    yes) enable_fast_install=yes ;;
8648862f5301Smrg    no) enable_fast_install=no ;;
8649862f5301Smrg    *)
8650862f5301Smrg      enable_fast_install=no
8651862f5301Smrg      # Look at the argument we got.  We use all the common list separators.
86526fc0178dSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8653862f5301Smrg      for pkg in $enableval; do
86546fc0178dSmrg	IFS=$lt_save_ifs
8655862f5301Smrg	if test "X$pkg" = "X$p"; then
8656862f5301Smrg	  enable_fast_install=yes
8657862f5301Smrg	fi
8658862f5301Smrg      done
86596fc0178dSmrg      IFS=$lt_save_ifs
8660862f5301Smrg      ;;
8661862f5301Smrg    esac],
8662862f5301Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
86637a3b38f7Smrg
8664862f5301Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
8665862f5301Smrg	 [Whether or not to optimize for fast installation])dnl
8666862f5301Smrg])# _LT_ENABLE_FAST_INSTALL
86677a3b38f7Smrg
8668862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
8669862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
86707a3b38f7Smrg
8671862f5301Smrg# Old names:
8672862f5301SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
8673862f5301Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
8674862f5301SmrgAC_DIAGNOSE([obsolete],
8675862f5301Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
86766fc0178dSmrgthe 'fast-install' option into LT_INIT's first parameter.])
8677862f5301Smrg])
86787a3b38f7Smrg
8679862f5301SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
8680862f5301Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
8681862f5301SmrgAC_DIAGNOSE([obsolete],
8682862f5301Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
86836fc0178dSmrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
8684862f5301Smrg])
86857a3b38f7Smrg
8686862f5301Smrgdnl aclocal-1.4 backwards compatibility:
8687862f5301Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
8688862f5301Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
86897a3b38f7Smrg
86907a3b38f7Smrg
86916fc0178dSmrg# _LT_WITH_AIX_SONAME([DEFAULT])
86926fc0178dSmrg# ----------------------------------
86936fc0178dSmrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
86946fc0178dSmrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
86956fc0178dSmrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
86966fc0178dSmrgm4_define([_LT_WITH_AIX_SONAME],
86976fc0178dSmrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
86986fc0178dSmrgshared_archive_member_spec=
86996fc0178dSmrgcase $host,$enable_shared in
87006fc0178dSmrgpower*-*-aix[[5-9]]*,yes)
87016fc0178dSmrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
87026fc0178dSmrg  AC_ARG_WITH([aix-soname],
87036fc0178dSmrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
87046fc0178dSmrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
87056fc0178dSmrg    [case $withval in
87066fc0178dSmrg    aix|svr4|both)
87076fc0178dSmrg      ;;
87086fc0178dSmrg    *)
87096fc0178dSmrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
87106fc0178dSmrg      ;;
87116fc0178dSmrg    esac
87126fc0178dSmrg    lt_cv_with_aix_soname=$with_aix_soname],
87136fc0178dSmrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
87146fc0178dSmrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
87156fc0178dSmrg    with_aix_soname=$lt_cv_with_aix_soname])
87166fc0178dSmrg  AC_MSG_RESULT([$with_aix_soname])
87176fc0178dSmrg  if test aix != "$with_aix_soname"; then
87186fc0178dSmrg    # For the AIX way of multilib, we name the shared archive member
87196fc0178dSmrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
87206fc0178dSmrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
87216fc0178dSmrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
87226fc0178dSmrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
87236fc0178dSmrg    if test 64 = "${OBJECT_MODE-32}"; then
87246fc0178dSmrg      shared_archive_member_spec=shr_64
87256fc0178dSmrg    else
87266fc0178dSmrg      shared_archive_member_spec=shr
87276fc0178dSmrg    fi
87286fc0178dSmrg  fi
87296fc0178dSmrg  ;;
87306fc0178dSmrg*)
87316fc0178dSmrg  with_aix_soname=aix
87326fc0178dSmrg  ;;
87336fc0178dSmrgesac
87346fc0178dSmrg
87356fc0178dSmrg_LT_DECL([], [shared_archive_member_spec], [0],
87366fc0178dSmrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
87376fc0178dSmrg])# _LT_WITH_AIX_SONAME
87386fc0178dSmrg
87396fc0178dSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
87406fc0178dSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
87416fc0178dSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
87426fc0178dSmrg
87436fc0178dSmrg
8744862f5301Smrg# _LT_WITH_PIC([MODE])
8745862f5301Smrg# --------------------
87466fc0178dSmrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
8747862f5301Smrg# LT_INIT options.
87486fc0178dSmrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
8749862f5301Smrgm4_define([_LT_WITH_PIC],
8750862f5301Smrg[AC_ARG_WITH([pic],
8751fc544a13Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
8752862f5301Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
8753fc544a13Smrg    [lt_p=${PACKAGE-default}
8754fc544a13Smrg    case $withval in
8755fc544a13Smrg    yes|no) pic_mode=$withval ;;
8756fc544a13Smrg    *)
8757fc544a13Smrg      pic_mode=default
8758fc544a13Smrg      # Look at the argument we got.  We use all the common list separators.
87596fc0178dSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8760fc544a13Smrg      for lt_pkg in $withval; do
87616fc0178dSmrg	IFS=$lt_save_ifs
8762fc544a13Smrg	if test "X$lt_pkg" = "X$lt_p"; then
8763fc544a13Smrg	  pic_mode=yes
8764fc544a13Smrg	fi
8765fc544a13Smrg      done
87666fc0178dSmrg      IFS=$lt_save_ifs
8767fc544a13Smrg      ;;
8768fc544a13Smrg    esac],
87696fc0178dSmrg    [pic_mode=m4_default([$1], [default])])
8770ff559fabSmrg
8771862f5301Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
8772862f5301Smrg])# _LT_WITH_PIC
8773ff559fabSmrg
8774862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
8775862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8776ff559fabSmrg
8777862f5301Smrg# Old name:
8778862f5301SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
8779862f5301Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
8780862f5301SmrgAC_DIAGNOSE([obsolete],
8781862f5301Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
87826fc0178dSmrgput the 'pic-only' option into LT_INIT's first parameter.])
8783862f5301Smrg])
8784ff559fabSmrg
8785862f5301Smrgdnl aclocal-1.4 backwards compatibility:
8786862f5301Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8787ff559fabSmrg
8788ff559fabSmrg
8789862f5301Smrgm4_define([_LTDL_MODE], [])
8790862f5301SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
8791862f5301Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
8792862f5301SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
8793862f5301Smrg		 [m4_define([_LTDL_MODE], [recursive])])
8794862f5301SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
8795862f5301Smrg		 [m4_define([_LTDL_MODE], [subproject])])
8796ff559fabSmrg
8797862f5301Smrgm4_define([_LTDL_TYPE], [])
8798862f5301SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
8799862f5301Smrg		 [m4_define([_LTDL_TYPE], [installable])])
8800862f5301SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
8801862f5301Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
8802ff559fabSmrg
8803862f5301Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
8804862f5301Smrg#
88056fc0178dSmrg# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
88066fc0178dSmrg# Foundation, Inc.
8807862f5301Smrg# Written by Gary V. Vaughan, 2004
8808862f5301Smrg#
8809862f5301Smrg# This file is free software; the Free Software Foundation gives
8810862f5301Smrg# unlimited permission to copy and/or distribute it, with or without
8811862f5301Smrg# modifications, as long as this notice is preserved.
8812ff559fabSmrg
8813862f5301Smrg# serial 6 ltsugar.m4
881444dda7b2Smrg
8815862f5301Smrg# This is to help aclocal find these macros, as it can't see m4_define.
8816862f5301SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
881744dda7b2Smrg
881844dda7b2Smrg
8819862f5301Smrg# lt_join(SEP, ARG1, [ARG2...])
8820862f5301Smrg# -----------------------------
8821862f5301Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
8822862f5301Smrg# associated separator.
8823862f5301Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
8824862f5301Smrg# versions in m4sugar had bugs.
8825862f5301Smrgm4_define([lt_join],
8826862f5301Smrg[m4_if([$#], [1], [],
8827862f5301Smrg       [$#], [2], [[$2]],
8828862f5301Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
8829862f5301Smrgm4_define([_lt_join],
8830862f5301Smrg[m4_if([$#$2], [2], [],
8831862f5301Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
883244dda7b2Smrg
883344dda7b2Smrg
8834862f5301Smrg# lt_car(LIST)
8835862f5301Smrg# lt_cdr(LIST)
8836862f5301Smrg# ------------
8837862f5301Smrg# Manipulate m4 lists.
8838862f5301Smrg# These macros are necessary as long as will still need to support
88396fc0178dSmrg# Autoconf-2.59, which quotes differently.
8840862f5301Smrgm4_define([lt_car], [[$1]])
8841862f5301Smrgm4_define([lt_cdr],
8842862f5301Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
8843862f5301Smrg       [$#], 1, [],
8844862f5301Smrg       [m4_dquote(m4_shift($@))])])
8845862f5301Smrgm4_define([lt_unquote], $1)
8846ff559fabSmrg
8847ff559fabSmrg
8848862f5301Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
8849862f5301Smrg# ------------------------------------------
88506fc0178dSmrg# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
8851862f5301Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
8852862f5301Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
8853862f5301Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
8854862f5301Smrg# than defined and empty).
8855862f5301Smrg#
8856862f5301Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
8857862f5301Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
8858862f5301Smrgm4_define([lt_append],
8859862f5301Smrg[m4_define([$1],
8860862f5301Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8861ff559fabSmrg
8862ff559fabSmrg
8863ff559fabSmrg
8864862f5301Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
8865862f5301Smrg# ----------------------------------------------------------
8866862f5301Smrg# Produce a SEP delimited list of all paired combinations of elements of
8867862f5301Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
8868862f5301Smrg# has the form PREFIXmINFIXSUFFIXn.
8869862f5301Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
8870862f5301Smrgm4_define([lt_combine],
8871862f5301Smrg[m4_if(m4_eval([$# > 3]), [1],
8872862f5301Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
8873862f5301Smrg[[m4_foreach([_Lt_prefix], [$2],
8874862f5301Smrg	     [m4_foreach([_Lt_suffix],
8875862f5301Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
8876862f5301Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8877ff559fabSmrg
8878ff559fabSmrg
8879862f5301Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
8880862f5301Smrg# -----------------------------------------------------------------------
8881862f5301Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
8882862f5301Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
8883862f5301Smrgm4_define([lt_if_append_uniq],
8884862f5301Smrg[m4_ifdef([$1],
8885862f5301Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
8886862f5301Smrg		 [lt_append([$1], [$2], [$3])$4],
8887862f5301Smrg		 [$5])],
8888862f5301Smrg	  [lt_append([$1], [$2], [$3])$4])])
88897a3b38f7Smrg
8890ff559fabSmrg
8891862f5301Smrg# lt_dict_add(DICT, KEY, VALUE)
8892862f5301Smrg# -----------------------------
8893862f5301Smrgm4_define([lt_dict_add],
8894862f5301Smrg[m4_define([$1($2)], [$3])])
8895ff559fabSmrg
8896ff559fabSmrg
8897862f5301Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
8898862f5301Smrg# --------------------------------------------
8899862f5301Smrgm4_define([lt_dict_add_subkey],
8900862f5301Smrg[m4_define([$1($2:$3)], [$4])])
8901ff559fabSmrg
8902ff559fabSmrg
8903862f5301Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
8904862f5301Smrg# ----------------------------------
8905862f5301Smrgm4_define([lt_dict_fetch],
8906862f5301Smrg[m4_ifval([$3],
8907862f5301Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
8908862f5301Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8909ff559fabSmrg
8910ff559fabSmrg
8911862f5301Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
8912862f5301Smrg# -----------------------------------------------------------------
8913862f5301Smrgm4_define([lt_if_dict_fetch],
8914862f5301Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
8915862f5301Smrg	[$5],
8916862f5301Smrg    [$6])])
8917ff559fabSmrg
8918ff559fabSmrg
8919862f5301Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
8920862f5301Smrg# --------------------------------------------------------------
8921862f5301Smrgm4_define([lt_dict_filter],
8922862f5301Smrg[m4_if([$5], [], [],
8923862f5301Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
8924862f5301Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
8925862f5301Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
8926862f5301Smrg])
8927ff559fabSmrg
8928862f5301Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
8929862f5301Smrg#
89306fc0178dSmrg#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
8931862f5301Smrg#   Written by Scott James Remnant, 2004
8932862f5301Smrg#
8933862f5301Smrg# This file is free software; the Free Software Foundation gives
8934862f5301Smrg# unlimited permission to copy and/or distribute it, with or without
8935862f5301Smrg# modifications, as long as this notice is preserved.
8936ff559fabSmrg
8937862f5301Smrg# @configure_input@
8938ff559fabSmrg
89396fc0178dSmrg# serial 4179 ltversion.m4
8940862f5301Smrg# This file is part of GNU Libtool
8941ff559fabSmrg
89426fc0178dSmrgm4_define([LT_PACKAGE_VERSION], [2.4.6])
89436fc0178dSmrgm4_define([LT_PACKAGE_REVISION], [2.4.6])
8944ff559fabSmrg
8945862f5301SmrgAC_DEFUN([LTVERSION_VERSION],
89466fc0178dSmrg[macro_version='2.4.6'
89476fc0178dSmrgmacro_revision='2.4.6'
8948862f5301Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
8949862f5301Smrg_LT_DECL(, macro_revision, 0)
8950862f5301Smrg])
8951ff559fabSmrg
8952862f5301Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
8953862f5301Smrg#
89546fc0178dSmrg#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
89556fc0178dSmrg#   Foundation, Inc.
8956862f5301Smrg#   Written by Scott James Remnant, 2004.
8957862f5301Smrg#
8958862f5301Smrg# This file is free software; the Free Software Foundation gives
8959862f5301Smrg# unlimited permission to copy and/or distribute it, with or without
8960862f5301Smrg# modifications, as long as this notice is preserved.
8961ff559fabSmrg
8962862f5301Smrg# serial 5 lt~obsolete.m4
8963ff559fabSmrg
8964862f5301Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
8965862f5301Smrg#
89666fc0178dSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
8967862f5301Smrg# which have later been changed to m4_define as they aren't part of the
8968862f5301Smrg# exported API, or moved to Autoconf or Automake where they belong.
8969862f5301Smrg#
8970862f5301Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
8971862f5301Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
8972862f5301Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
8973862f5301Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
8974862f5301Smrg# and doesn't know about Autoconf macros at all.)
8975862f5301Smrg#
8976862f5301Smrg# So we provide this file, which has a silly filename so it's always
8977862f5301Smrg# included after everything else.  This provides aclocal with the
8978862f5301Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
8979862f5301Smrg# because those macros already exist, or will be overwritten later.
89806fc0178dSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
8981862f5301Smrg#
8982862f5301Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
8983862f5301Smrg# Yes, that means every name once taken will need to remain here until
8984862f5301Smrg# we give up compatibility with versions before 1.7, at which point
8985862f5301Smrg# we need to keep only those names which we still refer to.
8986ff559fabSmrg
8987862f5301Smrg# This is to help aclocal find these macros, as it can't see m4_define.
8988862f5301SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
8989ff559fabSmrg
8990862f5301Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
8991862f5301Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
8992862f5301Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
8993862f5301Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
8994862f5301Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
8995862f5301Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
8996862f5301Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
8997862f5301Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
8998862f5301Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
8999862f5301Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
9000862f5301Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
9001862f5301Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9002862f5301Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9003862f5301Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9004862f5301Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9005862f5301Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9006862f5301Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
9007862f5301Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9008862f5301Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9009862f5301Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
9010862f5301Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
9011862f5301Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9012862f5301Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9013862f5301Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9014862f5301Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9015862f5301Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9016862f5301Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9017862f5301Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9018862f5301Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
9019862f5301Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
9020862f5301Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
9021862f5301Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9022862f5301Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9023862f5301Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
9024862f5301Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
9025862f5301Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9026862f5301Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9027862f5301Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
9028862f5301Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9029862f5301Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
9030862f5301Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
9031862f5301Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
9032862f5301Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9033862f5301Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9034862f5301Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9035862f5301Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9036862f5301Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9037862f5301Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9038862f5301Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9039862f5301Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9040862f5301Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9041862f5301Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9042862f5301Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9043862f5301Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9044862f5301Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9045862f5301Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9046862f5301Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9047862f5301Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9048862f5301Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
9049862f5301Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
9050862f5301Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9051ff559fabSmrg
90526fc0178dSmrgdnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
90536fc0178dSmrgdnl serial 11 (pkg-config-0.29)
90546fc0178dSmrgdnl
90556fc0178dSmrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
90566fc0178dSmrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
90576fc0178dSmrgdnl
90586fc0178dSmrgdnl This program is free software; you can redistribute it and/or modify
90596fc0178dSmrgdnl it under the terms of the GNU General Public License as published by
90606fc0178dSmrgdnl the Free Software Foundation; either version 2 of the License, or
90616fc0178dSmrgdnl (at your option) any later version.
90626fc0178dSmrgdnl
90636fc0178dSmrgdnl This program is distributed in the hope that it will be useful, but
90646fc0178dSmrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of
90656fc0178dSmrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
90666fc0178dSmrgdnl General Public License for more details.
90676fc0178dSmrgdnl
90686fc0178dSmrgdnl You should have received a copy of the GNU General Public License
90696fc0178dSmrgdnl along with this program; if not, write to the Free Software
90706fc0178dSmrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
90716fc0178dSmrgdnl 02111-1307, USA.
90726fc0178dSmrgdnl
90736fc0178dSmrgdnl As a special exception to the GNU General Public License, if you
90746fc0178dSmrgdnl distribute this file as part of a program that contains a
90756fc0178dSmrgdnl configuration script generated by Autoconf, you may include it under
90766fc0178dSmrgdnl the same distribution terms that you use for the rest of that
90776fc0178dSmrgdnl program.
90786fc0178dSmrg
90796fc0178dSmrgdnl PKG_PREREQ(MIN-VERSION)
90806fc0178dSmrgdnl -----------------------
90816fc0178dSmrgdnl Since: 0.29
90826fc0178dSmrgdnl
90836fc0178dSmrgdnl Verify that the version of the pkg-config macros are at least
90846fc0178dSmrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
90856fc0178dSmrgdnl installed version of pkg-config, this checks the developer's version
90866fc0178dSmrgdnl of pkg.m4 when generating configure.
90876fc0178dSmrgdnl
90886fc0178dSmrgdnl To ensure that this macro is defined, also add:
90896fc0178dSmrgdnl m4_ifndef([PKG_PREREQ],
90906fc0178dSmrgdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
90916fc0178dSmrgdnl
90926fc0178dSmrgdnl See the "Since" comment for each macro you use to see what version
90936fc0178dSmrgdnl of the macros you require.
90946fc0178dSmrgm4_defun([PKG_PREREQ],
90956fc0178dSmrg[m4_define([PKG_MACROS_VERSION], [0.29])
90966fc0178dSmrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
90976fc0178dSmrg    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
90986fc0178dSmrg])dnl PKG_PREREQ
90996fc0178dSmrg
91006fc0178dSmrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
91016fc0178dSmrgdnl ----------------------------------
91026fc0178dSmrgdnl Since: 0.16
91036fc0178dSmrgdnl
91046fc0178dSmrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
91056fc0178dSmrgdnl first found in the path. Checks that the version of pkg-config found
91066fc0178dSmrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
91076fc0178dSmrgdnl used since that's the first version where most current features of
91086fc0178dSmrgdnl pkg-config existed.
9109fc544a13SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
9110fc544a13Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
91116fc0178dSmrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
91126fc0178dSmrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
91136fc0178dSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
91146fc0178dSmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
91156fc0178dSmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
91166fc0178dSmrg
9117fc544a13Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9118fc544a13Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9119fc544a13Smrgfi
9120fc544a13Smrgif test -n "$PKG_CONFIG"; then
9121fc544a13Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
9122fc544a13Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9123fc544a13Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9124fc544a13Smrg		AC_MSG_RESULT([yes])
9125fc544a13Smrg	else
9126fc544a13Smrg		AC_MSG_RESULT([no])
9127fc544a13Smrg		PKG_CONFIG=""
9128fc544a13Smrg	fi
9129fc544a13Smrgfi[]dnl
91306fc0178dSmrg])dnl PKG_PROG_PKG_CONFIG
9131fc544a13Smrg
91326fc0178dSmrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
91336fc0178dSmrgdnl -------------------------------------------------------------------
91346fc0178dSmrgdnl Since: 0.18
91356fc0178dSmrgdnl
91366fc0178dSmrgdnl Check to see whether a particular set of modules exists. Similar to
91376fc0178dSmrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
91386fc0178dSmrgdnl
91396fc0178dSmrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
91406fc0178dSmrgdnl only at the first occurence in configure.ac, so if the first place
91416fc0178dSmrgdnl it's called might be skipped (such as if it is within an "if", you
91426fc0178dSmrgdnl have to call PKG_CHECK_EXISTS manually
9143fc544a13SmrgAC_DEFUN([PKG_CHECK_EXISTS],
9144fc544a13Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9145fc544a13Smrgif test -n "$PKG_CONFIG" && \
9146fc544a13Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
91476fc0178dSmrg  m4_default([$2], [:])
9148fc544a13Smrgm4_ifvaln([$3], [else
9149fc544a13Smrg  $3])dnl
9150fc544a13Smrgfi])
9151fc544a13Smrg
91526fc0178dSmrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
91536fc0178dSmrgdnl ---------------------------------------------
91546fc0178dSmrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
91556fc0178dSmrgdnl pkg_failed based on the result.
9156fc544a13Smrgm4_define([_PKG_CONFIG],
9157fc544a13Smrg[if test -n "$$1"; then
9158fc544a13Smrg    pkg_cv_[]$1="$$1"
9159fc544a13Smrg elif test -n "$PKG_CONFIG"; then
9160fc544a13Smrg    PKG_CHECK_EXISTS([$3],
91616fc0178dSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
91626fc0178dSmrg		      test "x$?" != "x0" && pkg_failed=yes ],
9163fc544a13Smrg		     [pkg_failed=yes])
9164fc544a13Smrg else
9165fc544a13Smrg    pkg_failed=untried
9166fc544a13Smrgfi[]dnl
91676fc0178dSmrg])dnl _PKG_CONFIG
9168fc544a13Smrg
91696fc0178dSmrgdnl _PKG_SHORT_ERRORS_SUPPORTED
91706fc0178dSmrgdnl ---------------------------
91716fc0178dSmrgdnl Internal check to see if pkg-config supports short errors.
9172fc544a13SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9173fc544a13Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9174fc544a13Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9175fc544a13Smrg        _pkg_short_errors_supported=yes
9176fc544a13Smrgelse
9177fc544a13Smrg        _pkg_short_errors_supported=no
9178fc544a13Smrgfi[]dnl
91796fc0178dSmrg])dnl _PKG_SHORT_ERRORS_SUPPORTED
9180fc544a13Smrg
9181fc544a13Smrg
91826fc0178dSmrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
91836fc0178dSmrgdnl   [ACTION-IF-NOT-FOUND])
91846fc0178dSmrgdnl --------------------------------------------------------------
91856fc0178dSmrgdnl Since: 0.4.0
91866fc0178dSmrgdnl
91876fc0178dSmrgdnl Note that if there is a possibility the first call to
91886fc0178dSmrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
91896fc0178dSmrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9190fc544a13SmrgAC_DEFUN([PKG_CHECK_MODULES],
9191fc544a13Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9192fc544a13SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9193fc544a13SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9194fc544a13Smrg
9195fc544a13Smrgpkg_failed=no
9196fc544a13SmrgAC_MSG_CHECKING([for $1])
9197fc544a13Smrg
9198fc544a13Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9199fc544a13Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9200fc544a13Smrg
9201fc544a13Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9202fc544a13Smrgand $1[]_LIBS to avoid the need to call pkg-config.
9203fc544a13SmrgSee the pkg-config man page for more details.])
9204fc544a13Smrg
9205fc544a13Smrgif test $pkg_failed = yes; then
92066fc0178dSmrg   	AC_MSG_RESULT([no])
9207fc544a13Smrg        _PKG_SHORT_ERRORS_SUPPORTED
9208fc544a13Smrg        if test $_pkg_short_errors_supported = yes; then
92096fc0178dSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
9210fc544a13Smrg        else 
92116fc0178dSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
9212fc544a13Smrg        fi
9213fc544a13Smrg	# Put the nasty error message in config.log where it belongs
9214fc544a13Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9215fc544a13Smrg
92166fc0178dSmrg	m4_default([$4], [AC_MSG_ERROR(
9217fc544a13Smrg[Package requirements ($2) were not met:
9218fc544a13Smrg
9219fc544a13Smrg$$1_PKG_ERRORS
9220fc544a13Smrg
9221fc544a13SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
9222fc544a13Smrginstalled software in a non-standard prefix.
9223fc544a13Smrg
92246fc0178dSmrg_PKG_TEXT])[]dnl
92256fc0178dSmrg        ])
9226fc544a13Smrgelif test $pkg_failed = untried; then
92276fc0178dSmrg     	AC_MSG_RESULT([no])
92286fc0178dSmrg	m4_default([$4], [AC_MSG_FAILURE(
9229fc544a13Smrg[The pkg-config script could not be found or is too old.  Make sure it
9230fc544a13Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
9231fc544a13Smrgpath to pkg-config.
9232fc544a13Smrg
9233fc544a13Smrg_PKG_TEXT
9234fc544a13Smrg
92356fc0178dSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
92366fc0178dSmrg        ])
9237fc544a13Smrgelse
9238fc544a13Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9239fc544a13Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9240fc544a13Smrg        AC_MSG_RESULT([yes])
92416fc0178dSmrg	$3
9242fc544a13Smrgfi[]dnl
92436fc0178dSmrg])dnl PKG_CHECK_MODULES
92446fc0178dSmrg
92456fc0178dSmrg
92466fc0178dSmrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
92476fc0178dSmrgdnl   [ACTION-IF-NOT-FOUND])
92486fc0178dSmrgdnl ---------------------------------------------------------------------
92496fc0178dSmrgdnl Since: 0.29
92506fc0178dSmrgdnl
92516fc0178dSmrgdnl Checks for existence of MODULES and gathers its build flags with
92526fc0178dSmrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
92536fc0178dSmrgdnl and VARIABLE-PREFIX_LIBS from --libs.
92546fc0178dSmrgdnl
92556fc0178dSmrgdnl Note that if there is a possibility the first call to
92566fc0178dSmrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
92576fc0178dSmrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
92586fc0178dSmrgdnl configure.ac.
92596fc0178dSmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC],
92606fc0178dSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
92616fc0178dSmrg_save_PKG_CONFIG=$PKG_CONFIG
92626fc0178dSmrgPKG_CONFIG="$PKG_CONFIG --static"
92636fc0178dSmrgPKG_CHECK_MODULES($@)
92646fc0178dSmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl
92656fc0178dSmrg])dnl PKG_CHECK_MODULES_STATIC
92666fc0178dSmrg
92676fc0178dSmrg
92686fc0178dSmrgdnl PKG_INSTALLDIR([DIRECTORY])
92696fc0178dSmrgdnl -------------------------
92706fc0178dSmrgdnl Since: 0.27
92716fc0178dSmrgdnl
92726fc0178dSmrgdnl Substitutes the variable pkgconfigdir as the location where a module
92736fc0178dSmrgdnl should install pkg-config .pc files. By default the directory is
92746fc0178dSmrgdnl $libdir/pkgconfig, but the default can be changed by passing
92756fc0178dSmrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir
92766fc0178dSmrgdnl parameter.
92776fc0178dSmrgAC_DEFUN([PKG_INSTALLDIR],
92786fc0178dSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
92796fc0178dSmrgm4_pushdef([pkg_description],
92806fc0178dSmrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
92816fc0178dSmrgAC_ARG_WITH([pkgconfigdir],
92826fc0178dSmrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
92836fc0178dSmrg    [with_pkgconfigdir=]pkg_default)
92846fc0178dSmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
92856fc0178dSmrgm4_popdef([pkg_default])
92866fc0178dSmrgm4_popdef([pkg_description])
92876fc0178dSmrg])dnl PKG_INSTALLDIR
92886fc0178dSmrg
92896fc0178dSmrg
92906fc0178dSmrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
92916fc0178dSmrgdnl --------------------------------
92926fc0178dSmrgdnl Since: 0.27
92936fc0178dSmrgdnl
92946fc0178dSmrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a
92956fc0178dSmrgdnl module should install arch-independent pkg-config .pc files. By
92966fc0178dSmrgdnl default the directory is $datadir/pkgconfig, but the default can be
92976fc0178dSmrgdnl changed by passing DIRECTORY. The user can override through the
92986fc0178dSmrgdnl --with-noarch-pkgconfigdir parameter.
92996fc0178dSmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
93006fc0178dSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
93016fc0178dSmrgm4_pushdef([pkg_description],
93026fc0178dSmrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
93036fc0178dSmrgAC_ARG_WITH([noarch-pkgconfigdir],
93046fc0178dSmrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
93056fc0178dSmrg    [with_noarch_pkgconfigdir=]pkg_default)
93066fc0178dSmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
93076fc0178dSmrgm4_popdef([pkg_default])
93086fc0178dSmrgm4_popdef([pkg_description])
93096fc0178dSmrg])dnl PKG_NOARCH_INSTALLDIR
93106fc0178dSmrg
93116fc0178dSmrg
93126fc0178dSmrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
93136fc0178dSmrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
93146fc0178dSmrgdnl -------------------------------------------
93156fc0178dSmrgdnl Since: 0.28
93166fc0178dSmrgdnl
93176fc0178dSmrgdnl Retrieves the value of the pkg-config variable for the given module.
93186fc0178dSmrgAC_DEFUN([PKG_CHECK_VAR],
93196fc0178dSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
93206fc0178dSmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
93216fc0178dSmrg
93226fc0178dSmrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
93236fc0178dSmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
93246fc0178dSmrg
93256fc0178dSmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
93266fc0178dSmrg])dnl PKG_CHECK_VAR
9327fc544a13Smrg
9328862f5301Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9329862f5301Smrgdnl
93306fc0178dSmrgdnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
9331fc544a13Smrgdnl
9332862f5301Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
9333862f5301Smrgdnl copy of this software and associated documentation files (the "Software"),
9334862f5301Smrgdnl to deal in the Software without restriction, including without limitation
9335862f5301Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9336862f5301Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
9337862f5301Smrgdnl Software is furnished to do so, subject to the following conditions:
9338862f5301Smrgdnl
9339862f5301Smrgdnl The above copyright notice and this permission notice (including the next
9340862f5301Smrgdnl paragraph) shall be included in all copies or substantial portions of the
9341862f5301Smrgdnl Software.
9342862f5301Smrgdnl
9343862f5301Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9344862f5301Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9345862f5301Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9346862f5301Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9347862f5301Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9348862f5301Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9349862f5301Smrgdnl DEALINGS IN THE SOFTWARE.
935044dda7b2Smrg
9351862f5301Smrg# XORG_MACROS_VERSION(required-version)
9352862f5301Smrg# -------------------------------------
9353862f5301Smrg# Minimum version: 1.1.0
9354862f5301Smrg#
9355862f5301Smrg# If you're using a macro added in Version 1.1 or newer, include this in
9356862f5301Smrg# your configure.ac with the minimum required version, such as:
9357862f5301Smrg# XORG_MACROS_VERSION(1.1)
9358862f5301Smrg#
9359862f5301Smrg# To ensure that this macro is defined, also add:
9360862f5301Smrg# m4_ifndef([XORG_MACROS_VERSION],
9361862f5301Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9362862f5301Smrg#
9363862f5301Smrg#
9364fc544a13Smrg# See the "minimum version" comment for each macro you use to see what
9365862f5301Smrg# version you require.
9366862f5301Smrgm4_defun([XORG_MACROS_VERSION],[
9367fc544a13Smrgm4_define([vers_have], [1.19.0])
9368862f5301Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9369862f5301Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9370862f5301Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
9371862f5301Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9372862f5301Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
9373862f5301Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9374862f5301Smrgm4_undefine([vers_have])
9375862f5301Smrgm4_undefine([maj_have])
9376862f5301Smrgm4_undefine([maj_needed])
9377862f5301Smrg]) # XORG_MACROS_VERSION
937844dda7b2Smrg
9379862f5301Smrg# XORG_PROG_RAWCPP()
9380862f5301Smrg# ------------------
9381862f5301Smrg# Minimum version: 1.0.0
9382862f5301Smrg#
9383862f5301Smrg# Find cpp program and necessary flags for use in pre-processing text files
9384862f5301Smrg# such as man pages and config files
9385862f5301SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
9386862f5301SmrgAC_REQUIRE([AC_PROG_CPP])
9387fc544a13SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
9388862f5301Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9389ff559fabSmrg
9390862f5301Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
9391862f5301Smrg# which is not the best choice for supporting other OS'es, but covers most
9392862f5301Smrg# of the ones we need for now.
9393862f5301SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
9394862f5301SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9395862f5301Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9396862f5301Smrg	AC_MSG_RESULT([no])
9397862f5301Smrgelse
9398862f5301Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9399862f5301Smrg		RAWCPPFLAGS=-undef
9400862f5301Smrg		AC_MSG_RESULT([yes])
9401862f5301Smrg	# under Cygwin unix is still defined even with -undef
9402862f5301Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9403862f5301Smrg		RAWCPPFLAGS="-undef -ansi"
9404862f5301Smrg		AC_MSG_RESULT([yes, with -ansi])
9405862f5301Smrg	else
9406862f5301Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9407862f5301Smrg	fi
9408862f5301Smrgfi
9409862f5301Smrgrm -f conftest.$ac_ext
9410ff559fabSmrg
9411862f5301SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
9412862f5301SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9413862f5301Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9414862f5301Smrg	AC_MSG_RESULT([no])
9415862f5301Smrgelse
9416862f5301Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9417fc544a13Smrg		TRADITIONALCPPFLAGS="-traditional"
9418862f5301Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9419862f5301Smrg		AC_MSG_RESULT([yes])
9420862f5301Smrg	else
9421862f5301Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9422862f5301Smrg	fi
9423862f5301Smrgfi
9424862f5301Smrgrm -f conftest.$ac_ext
9425862f5301SmrgAC_SUBST(RAWCPPFLAGS)
9426fc544a13SmrgAC_SUBST(TRADITIONALCPPFLAGS)
9427862f5301Smrg]) # XORG_PROG_RAWCPP
9428ff559fabSmrg
9429862f5301Smrg# XORG_MANPAGE_SECTIONS()
9430862f5301Smrg# -----------------------
9431862f5301Smrg# Minimum version: 1.0.0
9432862f5301Smrg#
9433862f5301Smrg# Determine which sections man pages go in for the different man page types
9434862f5301Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9435862f5301Smrg# Not sure if there's any better way than just hardcoding by OS name.
9436862f5301Smrg# Override default settings by setting environment variables
9437862f5301Smrg# Added MAN_SUBSTS in version 1.8
9438862f5301Smrg# Added AC_PROG_SED in version 1.8
9439ff559fabSmrg
9440862f5301SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
9441862f5301SmrgAC_REQUIRE([AC_CANONICAL_HOST])
9442862f5301SmrgAC_REQUIRE([AC_PROG_SED])
9443ff559fabSmrg
9444862f5301Smrgif test x$APP_MAN_SUFFIX = x    ; then
9445862f5301Smrg    APP_MAN_SUFFIX=1
9446862f5301Smrgfi
9447862f5301Smrgif test x$APP_MAN_DIR = x    ; then
9448862f5301Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9449862f5301Smrgfi
9450ff559fabSmrg
9451862f5301Smrgif test x$LIB_MAN_SUFFIX = x    ; then
9452862f5301Smrg    LIB_MAN_SUFFIX=3
9453862f5301Smrgfi
9454862f5301Smrgif test x$LIB_MAN_DIR = x    ; then
9455862f5301Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9456862f5301Smrgfi
945744dda7b2Smrg
9458862f5301Smrgif test x$FILE_MAN_SUFFIX = x    ; then
9459862f5301Smrg    case $host_os in
94606fc0178dSmrg	# Solaris 2.0 - 11 use SysV man page sections
94616fc0178dSmrg	solaris2.?|solaris2.1[[01]])	FILE_MAN_SUFFIX=4  ;;
94626fc0178dSmrg	*)				FILE_MAN_SUFFIX=5  ;;
9463862f5301Smrg    esac
9464862f5301Smrgfi
9465862f5301Smrgif test x$FILE_MAN_DIR = x    ; then
9466862f5301Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9467862f5301Smrgfi
946844dda7b2Smrg
9469862f5301Smrgif test x$MISC_MAN_SUFFIX = x    ; then
9470862f5301Smrg    case $host_os in
94716fc0178dSmrg	# Solaris 2.0 - 11 use SysV man page sections
94726fc0178dSmrg	solaris2.?|solaris2.1[[01]])	MISC_MAN_SUFFIX=5  ;;
94736fc0178dSmrg	*)				MISC_MAN_SUFFIX=7  ;;
9474862f5301Smrg    esac
9475862f5301Smrgfi
9476862f5301Smrgif test x$MISC_MAN_DIR = x    ; then
9477862f5301Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
9478862f5301Smrgfi
947944dda7b2Smrg
9480862f5301Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
9481862f5301Smrg    case $host_os in
94826fc0178dSmrg	# Solaris 2.0 - 11 use SysV man page sections
94836fc0178dSmrg	solaris2.?|solaris2.1[[01]])	DRIVER_MAN_SUFFIX=7  ;;
94846fc0178dSmrg	*)				DRIVER_MAN_SUFFIX=4  ;;
9485862f5301Smrg    esac
9486862f5301Smrgfi
9487862f5301Smrgif test x$DRIVER_MAN_DIR = x    ; then
9488862f5301Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
9489862f5301Smrgfi
949044dda7b2Smrg
9491862f5301Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
9492862f5301Smrg    case $host_os in
94936fc0178dSmrg	# Solaris 2.0 - 11 use SysV man page sections
94946fc0178dSmrg	solaris2.?|solaris2.1[[01]])	ADMIN_MAN_SUFFIX=1m ;;
94956fc0178dSmrg	*)				ADMIN_MAN_SUFFIX=8  ;;
9496862f5301Smrg    esac
9497862f5301Smrgfi
9498862f5301Smrgif test x$ADMIN_MAN_DIR = x    ; then
9499862f5301Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
9500862f5301Smrgfi
950144dda7b2Smrg
950244dda7b2Smrg
9503862f5301SmrgAC_SUBST([APP_MAN_SUFFIX])
9504862f5301SmrgAC_SUBST([LIB_MAN_SUFFIX])
9505862f5301SmrgAC_SUBST([FILE_MAN_SUFFIX])
9506862f5301SmrgAC_SUBST([MISC_MAN_SUFFIX])
9507862f5301SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
9508862f5301SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
9509862f5301SmrgAC_SUBST([APP_MAN_DIR])
9510862f5301SmrgAC_SUBST([LIB_MAN_DIR])
9511862f5301SmrgAC_SUBST([FILE_MAN_DIR])
9512862f5301SmrgAC_SUBST([MISC_MAN_DIR])
9513862f5301SmrgAC_SUBST([DRIVER_MAN_DIR])
9514862f5301SmrgAC_SUBST([ADMIN_MAN_DIR])
951544dda7b2Smrg
9516862f5301SmrgXORG_MAN_PAGE="X Version 11"
9517862f5301SmrgAC_SUBST([XORG_MAN_PAGE])
9518862f5301SmrgMAN_SUBSTS="\
9519862f5301Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9520862f5301Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9521862f5301Smrg	-e 's|__xservername__|Xorg|g' \
9522862f5301Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
9523862f5301Smrg	-e 's|__projectroot__|\$(prefix)|g' \
9524862f5301Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
9525862f5301Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
9526862f5301Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
9527862f5301Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
9528862f5301Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
9529862f5301Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
9530862f5301Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
9531862f5301SmrgAC_SUBST([MAN_SUBSTS])
953244dda7b2Smrg
9533862f5301Smrg]) # XORG_MANPAGE_SECTIONS
9534ff559fabSmrg
9535862f5301Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
9536862f5301Smrg# ------------------------
9537862f5301Smrg# Minimum version: 1.7.0
953844dda7b2Smrg#
9539862f5301Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
9540862f5301Smrg# provided by xorg-sgml-doctools, if installed.
9541862f5301SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
9542862f5301SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
9543862f5301SmrgXORG_SGML_PATH=
9544862f5301SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
9545862f5301Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
9546862f5301Smrg    [m4_ifval([$1],[:],
9547862f5301Smrg        [if test x"$cross_compiling" != x"yes" ; then
9548862f5301Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
9549862f5301Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
9550862f5301Smrg         fi])
9551862f5301Smrg    ])
9552ff559fabSmrg
9553862f5301Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
9554862f5301Smrg# the path and the name of the doc stylesheet
9555862f5301Smrgif test "x$XORG_SGML_PATH" != "x" ; then
9556862f5301Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
9557862f5301Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
9558862f5301Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
9559862f5301Smrgelse
9560862f5301Smrg   AC_MSG_RESULT([no])
9561862f5301Smrgfi
9562ff559fabSmrg
9563862f5301SmrgAC_SUBST(XORG_SGML_PATH)
9564862f5301SmrgAC_SUBST(STYLESHEET_SRCDIR)
9565862f5301SmrgAC_SUBST(XSL_STYLESHEET)
9566862f5301SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
9567862f5301Smrg]) # XORG_CHECK_SGML_DOCTOOLS
9568ff559fabSmrg
9569862f5301Smrg# XORG_CHECK_LINUXDOC
9570862f5301Smrg# -------------------
9571862f5301Smrg# Minimum version: 1.0.0
9572862f5301Smrg#
9573862f5301Smrg# Defines the variable MAKE_TEXT if the necessary tools and
9574862f5301Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
9575862f5301Smrg# Whether or not the necessary tools and files are found can be checked
9576862f5301Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
9577862f5301SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
9578862f5301SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9579862f5301SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
9580ff559fabSmrg
9581862f5301SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
9582ff559fabSmrg
9583862f5301SmrgAC_MSG_CHECKING([whether to build documentation])
9584ff559fabSmrg
9585862f5301Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
9586862f5301Smrg   BUILDDOC=yes
9587862f5301Smrgelse
9588862f5301Smrg   BUILDDOC=no
9589862f5301Smrgfi
9590ff559fabSmrg
9591862f5301SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9592ff559fabSmrg
9593862f5301SmrgAC_MSG_RESULT([$BUILDDOC])
9594ff559fabSmrg
9595862f5301SmrgAC_MSG_CHECKING([whether to build pdf documentation])
9596ff559fabSmrg
9597862f5301Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
9598862f5301Smrg   BUILDPDFDOC=yes
9599862f5301Smrgelse
9600862f5301Smrg   BUILDPDFDOC=no
9601862f5301Smrgfi
9602ff559fabSmrg
9603862f5301SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9604ff559fabSmrg
9605862f5301SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9606ff559fabSmrg
9607862f5301SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
9608862f5301SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
9609862f5301SmrgMAKE_PDF="$PS2PDF"
9610862f5301SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9611ff559fabSmrg
9612862f5301SmrgAC_SUBST(MAKE_TEXT)
9613862f5301SmrgAC_SUBST(MAKE_PS)
9614862f5301SmrgAC_SUBST(MAKE_PDF)
9615862f5301SmrgAC_SUBST(MAKE_HTML)
9616862f5301Smrg]) # XORG_CHECK_LINUXDOC
9617ff559fabSmrg
9618862f5301Smrg# XORG_CHECK_DOCBOOK
9619862f5301Smrg# -------------------
9620862f5301Smrg# Minimum version: 1.0.0
9621862f5301Smrg#
9622862f5301Smrg# Checks for the ability to build output formats from SGML DocBook source.
9623862f5301Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
9624862f5301Smrg# indicates whether the necessary tools and files are found and, if set,
9625862f5301Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
9626862f5301SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
9627862f5301SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9628ff559fabSmrg
9629862f5301SmrgBUILDTXTDOC=no
9630862f5301SmrgBUILDPDFDOC=no
9631862f5301SmrgBUILDPSDOC=no
9632862f5301SmrgBUILDHTMLDOC=no
9633ff559fabSmrg
9634862f5301SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
9635862f5301SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
9636862f5301SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
9637862f5301SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
963844dda7b2Smrg
9639862f5301SmrgAC_MSG_CHECKING([whether to build text documentation])
9640862f5301Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
9641862f5301Smrg   test x$BUILD_TXTDOC != xno; then
9642862f5301Smrg	BUILDTXTDOC=yes
9643862f5301Smrgfi
9644862f5301SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
9645862f5301SmrgAC_MSG_RESULT([$BUILDTXTDOC])
964644dda7b2Smrg
9647862f5301SmrgAC_MSG_CHECKING([whether to build PDF documentation])
9648862f5301Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
9649862f5301Smrg   test x$BUILD_PDFDOC != xno; then
9650862f5301Smrg	BUILDPDFDOC=yes
9651862f5301Smrgfi
9652862f5301SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9653862f5301SmrgAC_MSG_RESULT([$BUILDPDFDOC])
96547a3b38f7Smrg
9655862f5301SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
9656862f5301Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
9657862f5301Smrg   test x$BUILD_PSDOC != xno; then
9658862f5301Smrg	BUILDPSDOC=yes
9659862f5301Smrgfi
9660862f5301SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
9661862f5301SmrgAC_MSG_RESULT([$BUILDPSDOC])
96627a3b38f7Smrg
9663862f5301SmrgAC_MSG_CHECKING([whether to build HTML documentation])
9664862f5301Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
9665862f5301Smrg   test x$BUILD_HTMLDOC != xno; then
9666862f5301Smrg	BUILDHTMLDOC=yes
9667862f5301Smrgfi
9668862f5301SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
9669862f5301SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
9670ff559fabSmrg
9671862f5301SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
9672862f5301SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
9673862f5301SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
9674862f5301SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9675ff559fabSmrg
9676862f5301SmrgAC_SUBST(MAKE_TEXT)
9677862f5301SmrgAC_SUBST(MAKE_PS)
9678862f5301SmrgAC_SUBST(MAKE_PDF)
9679862f5301SmrgAC_SUBST(MAKE_HTML)
9680862f5301Smrg]) # XORG_CHECK_DOCBOOK
9681ff559fabSmrg
9682862f5301Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
9683862f5301Smrg# ----------------
9684862f5301Smrg# Minimum version: 1.5.0
9685862f5301Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9686862f5301Smrg#
9687862f5301Smrg# Documentation tools are not always available on all platforms and sometimes
9688862f5301Smrg# not at the appropriate level. This macro enables a module to test for the
9689862f5301Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9690862f5301Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
9691862f5301Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
9692862f5301Smrg# --with-xmlto assumes 'auto'.
9693862f5301Smrg#
9694862f5301Smrg# Interface to module:
9695862f5301Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
9696862f5301Smrg# XMLTO:	returns the path of the xmlto program found
9697862f5301Smrg#		returns the path set by the user in the environment
9698862f5301Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
9699862f5301Smrg#		'no' user instructs the module not to use xmlto
9700862f5301Smrg#
9701862f5301Smrg# Added in version 1.10.0
9702862f5301Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
9703862f5301Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
9704862f5301Smrg#
9705862f5301Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
9706862f5301Smrg#
9707862f5301SmrgAC_DEFUN([XORG_WITH_XMLTO],[
9708862f5301SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
9709862f5301Smrgm4_define([_defopt], m4_default([$2], [auto]))
9710862f5301SmrgAC_ARG_WITH(xmlto,
9711862f5301Smrg	AS_HELP_STRING([--with-xmlto],
9712862f5301Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
9713862f5301Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
9714862f5301Smrgm4_undefine([_defopt])
9715ff559fabSmrg
9716862f5301Smrgif test "x$use_xmlto" = x"auto"; then
9717862f5301Smrg   AC_PATH_PROG([XMLTO], [xmlto])
9718862f5301Smrg   if test "x$XMLTO" = "x"; then
9719862f5301Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
9720862f5301Smrg	have_xmlto=no
9721862f5301Smrg   else
9722862f5301Smrg        have_xmlto=yes
9723862f5301Smrg   fi
9724862f5301Smrgelif test "x$use_xmlto" = x"yes" ; then
9725862f5301Smrg   AC_PATH_PROG([XMLTO], [xmlto])
9726862f5301Smrg   if test "x$XMLTO" = "x"; then
9727862f5301Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
9728862f5301Smrg   fi
9729862f5301Smrg   have_xmlto=yes
9730862f5301Smrgelif test "x$use_xmlto" = x"no" ; then
9731862f5301Smrg   if test "x$XMLTO" != "x"; then
9732862f5301Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
9733862f5301Smrg   fi
9734862f5301Smrg   have_xmlto=no
9735862f5301Smrgelse
9736862f5301Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
9737862f5301Smrgfi
9738ff559fabSmrg
9739862f5301Smrg# Test for a minimum version of xmlto, if provided.
9740862f5301Smrgm4_ifval([$1],
9741862f5301Smrg[if test "$have_xmlto" = yes; then
9742862f5301Smrg    # scrape the xmlto version
9743862f5301Smrg    AC_MSG_CHECKING([the xmlto version])
9744862f5301Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
9745862f5301Smrg    AC_MSG_RESULT([$xmlto_version])
9746862f5301Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
9747862f5301Smrg        [if test "x$use_xmlto" = xauto; then
9748862f5301Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
9749862f5301Smrg            have_xmlto=no
9750862f5301Smrg        else
9751862f5301Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
9752862f5301Smrg        fi])
9753862f5301Smrgfi])
9754ff559fabSmrg
9755862f5301Smrg# Test for the ability of xmlto to generate a text target
97566fc0178dSmrg#
97576fc0178dSmrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
97586fc0178dSmrg# following test for empty XML docbook files.
97596fc0178dSmrg# For compatibility reasons use the following empty XML docbook file and if
97606fc0178dSmrg# it fails try it again with a non-empty XML file.
9761862f5301Smrghave_xmlto_text=no
9762862f5301Smrgcat > conftest.xml << "EOF"
9763862f5301SmrgEOF
9764862f5301SmrgAS_IF([test "$have_xmlto" = yes],
9765862f5301Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
9766862f5301Smrg             [have_xmlto_text=yes],
97676fc0178dSmrg             [# Try it again with a non-empty XML file.
97686fc0178dSmrg              cat > conftest.xml << "EOF"
97696fc0178dSmrg<x></x>
97706fc0178dSmrgEOF
97716fc0178dSmrg              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
97726fc0178dSmrg                    [have_xmlto_text=yes],
97736fc0178dSmrg                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
9774862f5301Smrgrm -f conftest.xml
9775862f5301SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
9776862f5301SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
9777862f5301Smrg]) # XORG_WITH_XMLTO
9778ff559fabSmrg
9779862f5301Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
9780862f5301Smrg# --------------------------------------------
9781862f5301Smrg# Minimum version: 1.12.0
9782862f5301Smrg# Minimum version for optional DEFAULT argument: 1.12.0
9783862f5301Smrg#
9784862f5301Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
9785862f5301Smrg# XML-based language used for the transformation of XML documents.
9786862f5301Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
9787862f5301Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
9788862f5301Smrg# The XSLT processor is often used as a standalone tool for transformations.
9789862f5301Smrg# It should not be assumed that this tool is used only to work with documnetation.
9790862f5301Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
9791862f5301Smrg#
9792862f5301Smrg# Interface to module:
9793862f5301Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
9794862f5301Smrg# XSLTPROC:	 returns the path of the xsltproc program found
9795862f5301Smrg#		 returns the path set by the user in the environment
9796862f5301Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
9797862f5301Smrg#		  'no' user instructs the module not to use xsltproc
9798862f5301Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
9799862f5301Smrg#
9800862f5301Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
9801862f5301Smrg#
9802862f5301SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
9803862f5301SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
9804862f5301Smrg# Preserves the interface, should it be implemented later
9805862f5301Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
9806862f5301Smrgm4_define([_defopt], m4_default([$2], [auto]))
9807862f5301SmrgAC_ARG_WITH(xsltproc,
9808862f5301Smrg	AS_HELP_STRING([--with-xsltproc],
9809862f5301Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
9810862f5301Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
9811862f5301Smrgm4_undefine([_defopt])
9812ff559fabSmrg
9813862f5301Smrgif test "x$use_xsltproc" = x"auto"; then
9814862f5301Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9815862f5301Smrg   if test "x$XSLTPROC" = "x"; then
9816862f5301Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
9817862f5301Smrg	have_xsltproc=no
9818862f5301Smrg   else
9819862f5301Smrg        have_xsltproc=yes
9820862f5301Smrg   fi
9821862f5301Smrgelif test "x$use_xsltproc" = x"yes" ; then
9822862f5301Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9823862f5301Smrg   if test "x$XSLTPROC" = "x"; then
9824862f5301Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
9825862f5301Smrg   fi
9826862f5301Smrg   have_xsltproc=yes
9827862f5301Smrgelif test "x$use_xsltproc" = x"no" ; then
9828862f5301Smrg   if test "x$XSLTPROC" != "x"; then
9829862f5301Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
9830862f5301Smrg   fi
9831862f5301Smrg   have_xsltproc=no
9832862f5301Smrgelse
9833862f5301Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
9834862f5301Smrgfi
9835ff559fabSmrg
9836862f5301SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
9837862f5301Smrg]) # XORG_WITH_XSLTPROC
9838ff559fabSmrg
9839862f5301Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
9840862f5301Smrg# ----------------------------------------
9841862f5301Smrg# Minimum version: 1.15.0
9842862f5301Smrg#
9843862f5301Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
9844862f5301Smrg# scanning arbitrary text files, extracting information from those text files,
9845862f5301Smrg# and printing reports based on that information.
9846862f5301Smrg#
9847862f5301Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
9848862f5301Smrg#
9849862f5301Smrg# Interface to module:
9850862f5301Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
9851862f5301Smrg# PERL:	     returns the path of the perl program found
9852862f5301Smrg#	     returns the path set by the user in the environment
9853862f5301Smrg# --with-perl: 'yes' user instructs the module to use perl
9854862f5301Smrg#	       'no' user instructs the module not to use perl
9855862f5301Smrg# have_perl: returns yes if perl found in PATH or no
9856862f5301Smrg#
9857862f5301Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
9858862f5301Smrg#
9859862f5301SmrgAC_DEFUN([XORG_WITH_PERL],[
9860862f5301SmrgAC_ARG_VAR([PERL], [Path to perl command])
9861862f5301Smrg# Preserves the interface, should it be implemented later
9862862f5301Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
9863862f5301Smrgm4_define([_defopt], m4_default([$2], [auto]))
9864862f5301SmrgAC_ARG_WITH(perl,
9865862f5301Smrg	AS_HELP_STRING([--with-perl],
9866862f5301Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
9867862f5301Smrg	   [use_perl=$withval], [use_perl=]_defopt)
9868862f5301Smrgm4_undefine([_defopt])
986944dda7b2Smrg
9870862f5301Smrgif test "x$use_perl" = x"auto"; then
9871862f5301Smrg   AC_PATH_PROG([PERL], [perl])
9872862f5301Smrg   if test "x$PERL" = "x"; then
9873862f5301Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
9874862f5301Smrg	have_perl=no
9875862f5301Smrg   else
9876862f5301Smrg        have_perl=yes
9877862f5301Smrg   fi
9878862f5301Smrgelif test "x$use_perl" = x"yes" ; then
9879862f5301Smrg   AC_PATH_PROG([PERL], [perl])
9880862f5301Smrg   if test "x$PERL" = "x"; then
9881862f5301Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
9882862f5301Smrg   fi
9883862f5301Smrg   have_perl=yes
9884862f5301Smrgelif test "x$use_perl" = x"no" ; then
9885862f5301Smrg   if test "x$PERL" != "x"; then
9886862f5301Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
9887862f5301Smrg   fi
9888862f5301Smrg   have_perl=no
9889862f5301Smrgelse
9890862f5301Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
9891862f5301Smrgfi
989244dda7b2Smrg
9893862f5301SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
9894862f5301Smrg]) # XORG_WITH_PERL
989544dda7b2Smrg
9896862f5301Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
9897862f5301Smrg# ----------------
9898862f5301Smrg# Minimum version: 1.5.0
9899862f5301Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9900862f5301Smrg#
9901862f5301Smrg# Documentation tools are not always available on all platforms and sometimes
9902862f5301Smrg# not at the appropriate level. This macro enables a module to test for the
9903862f5301Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9904862f5301Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
9905862f5301Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
9906862f5301Smrg# --with-asciidoc assumes 'auto'.
9907862f5301Smrg#
9908862f5301Smrg# Interface to module:
9909862f5301Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
9910862f5301Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
9911862f5301Smrg#		 returns the path set by the user in the environment
9912862f5301Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
9913862f5301Smrg#		  'no' user instructs the module not to use asciidoc
9914862f5301Smrg#
9915862f5301Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
9916862f5301Smrg#
9917862f5301SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
9918862f5301SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
9919862f5301Smrgm4_define([_defopt], m4_default([$2], [auto]))
9920862f5301SmrgAC_ARG_WITH(asciidoc,
9921862f5301Smrg	AS_HELP_STRING([--with-asciidoc],
9922862f5301Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
9923862f5301Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
9924862f5301Smrgm4_undefine([_defopt])
9925ff559fabSmrg
9926862f5301Smrgif test "x$use_asciidoc" = x"auto"; then
9927862f5301Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9928862f5301Smrg   if test "x$ASCIIDOC" = "x"; then
9929862f5301Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
9930862f5301Smrg	have_asciidoc=no
9931862f5301Smrg   else
9932862f5301Smrg        have_asciidoc=yes
9933862f5301Smrg   fi
9934862f5301Smrgelif test "x$use_asciidoc" = x"yes" ; then
9935862f5301Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9936862f5301Smrg   if test "x$ASCIIDOC" = "x"; then
9937862f5301Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
9938862f5301Smrg   fi
9939862f5301Smrg   have_asciidoc=yes
9940862f5301Smrgelif test "x$use_asciidoc" = x"no" ; then
9941862f5301Smrg   if test "x$ASCIIDOC" != "x"; then
9942862f5301Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
9943862f5301Smrg   fi
9944862f5301Smrg   have_asciidoc=no
9945862f5301Smrgelse
9946862f5301Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
9947862f5301Smrgfi
9948862f5301Smrgm4_ifval([$1],
9949862f5301Smrg[if test "$have_asciidoc" = yes; then
9950862f5301Smrg    # scrape the asciidoc version
9951862f5301Smrg    AC_MSG_CHECKING([the asciidoc version])
9952862f5301Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
9953862f5301Smrg    AC_MSG_RESULT([$asciidoc_version])
9954862f5301Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
9955862f5301Smrg        [if test "x$use_asciidoc" = xauto; then
9956862f5301Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
9957862f5301Smrg            have_asciidoc=no
9958862f5301Smrg        else
9959862f5301Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
9960862f5301Smrg        fi])
9961862f5301Smrgfi])
9962862f5301SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
9963862f5301Smrg]) # XORG_WITH_ASCIIDOC
9964ff559fabSmrg
9965862f5301Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
9966fc544a13Smrg# -------------------------------------------
9967862f5301Smrg# Minimum version: 1.5.0
9968862f5301Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9969fc544a13Smrg# Minimum version for optional DOT checking: 1.18.0
9970862f5301Smrg#
9971862f5301Smrg# Documentation tools are not always available on all platforms and sometimes
9972862f5301Smrg# not at the appropriate level. This macro enables a module to test for the
9973862f5301Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9974862f5301Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
9975862f5301Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
9976862f5301Smrg# --with-doxygen assumes 'auto'.
9977862f5301Smrg#
9978862f5301Smrg# Interface to module:
9979862f5301Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
9980862f5301Smrg# DOXYGEN:	 returns the path of the doxygen program found
9981862f5301Smrg#		 returns the path set by the user in the environment
9982862f5301Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
9983862f5301Smrg#		  'no' user instructs the module not to use doxygen
9984862f5301Smrg#
9985862f5301Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
9986862f5301Smrg#
9987862f5301SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
9988862f5301SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
9989fc544a13SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
9990862f5301Smrgm4_define([_defopt], m4_default([$2], [auto]))
9991862f5301SmrgAC_ARG_WITH(doxygen,
9992862f5301Smrg	AS_HELP_STRING([--with-doxygen],
9993862f5301Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
9994862f5301Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
9995862f5301Smrgm4_undefine([_defopt])
9996ff559fabSmrg
9997862f5301Smrgif test "x$use_doxygen" = x"auto"; then
9998862f5301Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
9999862f5301Smrg   if test "x$DOXYGEN" = "x"; then
10000862f5301Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10001862f5301Smrg	have_doxygen=no
10002862f5301Smrg   else
10003862f5301Smrg        have_doxygen=yes
10004862f5301Smrg   fi
10005862f5301Smrgelif test "x$use_doxygen" = x"yes" ; then
10006862f5301Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10007862f5301Smrg   if test "x$DOXYGEN" = "x"; then
10008862f5301Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10009862f5301Smrg   fi
10010862f5301Smrg   have_doxygen=yes
10011862f5301Smrgelif test "x$use_doxygen" = x"no" ; then
10012862f5301Smrg   if test "x$DOXYGEN" != "x"; then
10013862f5301Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10014862f5301Smrg   fi
10015862f5301Smrg   have_doxygen=no
10016862f5301Smrgelse
10017862f5301Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10018862f5301Smrgfi
10019862f5301Smrgm4_ifval([$1],
10020862f5301Smrg[if test "$have_doxygen" = yes; then
10021862f5301Smrg    # scrape the doxygen version
10022862f5301Smrg    AC_MSG_CHECKING([the doxygen version])
10023862f5301Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
10024862f5301Smrg    AC_MSG_RESULT([$doxygen_version])
10025862f5301Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
10026862f5301Smrg        [if test "x$use_doxygen" = xauto; then
10027862f5301Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
10028862f5301Smrg            have_doxygen=no
10029862f5301Smrg        else
10030862f5301Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
10031862f5301Smrg        fi])
10032862f5301Smrgfi])
10033fc544a13Smrg
10034fc544a13Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
10035fc544a13Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
10036fc544a13Smrgdnl 	HAVE_DOT = @HAVE_DOT@
10037fc544a13SmrgHAVE_DOT=no
10038fc544a13Smrgif test "x$have_doxygen" = "xyes"; then
10039fc544a13Smrg  AC_PATH_PROG([DOT], [dot])
10040fc544a13Smrg    if test "x$DOT" != "x"; then
10041fc544a13Smrg      HAVE_DOT=yes
10042fc544a13Smrg    fi
10043fc544a13Smrgfi
10044fc544a13Smrg
10045fc544a13SmrgAC_SUBST([HAVE_DOT])
10046fc544a13SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
10047862f5301SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
10048862f5301Smrg]) # XORG_WITH_DOXYGEN
100497a3b38f7Smrg
10050862f5301Smrg# XORG_WITH_GROFF([DEFAULT])
10051862f5301Smrg# ----------------
10052862f5301Smrg# Minimum version: 1.6.0
10053862f5301Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10054862f5301Smrg#
10055862f5301Smrg# Documentation tools are not always available on all platforms and sometimes
10056862f5301Smrg# not at the appropriate level. This macro enables a module to test for the
10057862f5301Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10058862f5301Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
10059862f5301Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
10060862f5301Smrg# --with-groff assumes 'auto'.
10061862f5301Smrg#
10062862f5301Smrg# Interface to module:
10063862f5301Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
10064862f5301Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
10065862f5301Smrg# HAVE_GROFF_MS: the -ms macros package
10066862f5301Smrg# GROFF:	 returns the path of the groff program found
10067862f5301Smrg#		 returns the path set by the user in the environment
10068862f5301Smrg# --with-groff:	 'yes' user instructs the module to use groff
10069862f5301Smrg#		 'no' user instructs the module not to use groff
10070862f5301Smrg#
10071862f5301Smrg# Added in version 1.9.0:
10072862f5301Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10073862f5301Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10074862f5301Smrg#		   psselect from the psutils package.
10075862f5301Smrg#		   the ghostcript package. Refer to the grohtml man pages
10076862f5301Smrg#
10077862f5301Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10078862f5301Smrg#
10079862f5301Smrg# OS and distros often splits groff in a basic and full package, the former
10080862f5301Smrg# having the groff program and the later having devices, fonts and macros
10081862f5301Smrg# Checking for the groff executable is not enough.
10082862f5301Smrg#
10083862f5301Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
10084862f5301Smrg# unset HAVE_GROFF or GROFF env variables.
10085862f5301Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10086862f5301Smrg#
10087862f5301SmrgAC_DEFUN([XORG_WITH_GROFF],[
10088862f5301SmrgAC_ARG_VAR([GROFF], [Path to groff command])
10089862f5301Smrgm4_define([_defopt], m4_default([$1], [auto]))
10090862f5301SmrgAC_ARG_WITH(groff,
10091862f5301Smrg	AS_HELP_STRING([--with-groff],
10092862f5301Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10093862f5301Smrg	   [use_groff=$withval], [use_groff=]_defopt)
10094862f5301Smrgm4_undefine([_defopt])
100957a3b38f7Smrg
10096862f5301Smrgif test "x$use_groff" = x"auto"; then
10097862f5301Smrg   AC_PATH_PROG([GROFF], [groff])
10098862f5301Smrg   if test "x$GROFF" = "x"; then
10099862f5301Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
10100862f5301Smrg	have_groff=no
10101862f5301Smrg   else
10102862f5301Smrg        have_groff=yes
10103862f5301Smrg   fi
10104862f5301Smrgelif test "x$use_groff" = x"yes" ; then
10105862f5301Smrg   AC_PATH_PROG([GROFF], [groff])
10106862f5301Smrg   if test "x$GROFF" = "x"; then
10107862f5301Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10108862f5301Smrg   fi
10109862f5301Smrg   have_groff=yes
10110862f5301Smrgelif test "x$use_groff" = x"no" ; then
10111862f5301Smrg   if test "x$GROFF" != "x"; then
10112862f5301Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10113862f5301Smrg   fi
10114862f5301Smrg   have_groff=no
10115862f5301Smrgelse
10116862f5301Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10117862f5301Smrgfi
101187a3b38f7Smrg
10119862f5301Smrg# We have groff, test for the presence of the macro packages
10120862f5301Smrgif test "x$have_groff" = x"yes"; then
10121862f5301Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10122862f5301Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10123862f5301Smrg        groff_ms_works=yes
10124862f5301Smrg    else
10125862f5301Smrg        groff_ms_works=no
10126862f5301Smrg    fi
10127862f5301Smrg    AC_MSG_RESULT([$groff_ms_works])
10128862f5301Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10129862f5301Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10130862f5301Smrg        groff_mm_works=yes
10131862f5301Smrg    else
10132862f5301Smrg        groff_mm_works=no
10133862f5301Smrg    fi
10134862f5301Smrg    AC_MSG_RESULT([$groff_mm_works])
10135862f5301Smrgfi
10136ff559fabSmrg
10137862f5301Smrg# We have groff, test for HTML dependencies, one command per package
10138862f5301Smrgif test "x$have_groff" = x"yes"; then
10139862f5301Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10140862f5301Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10141862f5301Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10142862f5301Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10143862f5301Smrg      have_groff_html=yes
10144862f5301Smrg   else
10145862f5301Smrg      have_groff_html=no
10146862f5301Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10147862f5301Smrg   fi
10148862f5301Smrgfi
10149ff559fabSmrg
10150862f5301Smrg# Set Automake conditionals for Makefiles
10151862f5301SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10152862f5301SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10153862f5301SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10154862f5301SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10155862f5301Smrg]) # XORG_WITH_GROFF
10156ff559fabSmrg
10157862f5301Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10158862f5301Smrg# ---------------------------------------
10159862f5301Smrg# Minimum version: 1.6.0
10160862f5301Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10161862f5301Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
10162862f5301Smrg#
10163862f5301Smrg# Documentation tools are not always available on all platforms and sometimes
10164862f5301Smrg# not at the appropriate level. This macro enables a module to test for the
10165862f5301Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10166862f5301Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
10167862f5301Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
10168862f5301Smrg# --with-fop assumes 'auto'.
10169862f5301Smrg#
10170862f5301Smrg# Interface to module:
10171862f5301Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10172862f5301Smrg# FOP:	 	returns the path of the fop program found
10173862f5301Smrg#		returns the path set by the user in the environment
10174862f5301Smrg# --with-fop: 	'yes' user instructs the module to use fop
10175862f5301Smrg#		'no' user instructs the module not to use fop
10176862f5301Smrg#
10177862f5301Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10178862f5301Smrg#
10179862f5301SmrgAC_DEFUN([XORG_WITH_FOP],[
10180862f5301SmrgAC_ARG_VAR([FOP], [Path to fop command])
10181862f5301Smrgm4_define([_defopt], m4_default([$2], [auto]))
10182862f5301SmrgAC_ARG_WITH(fop,
10183862f5301Smrg	AS_HELP_STRING([--with-fop],
10184862f5301Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10185862f5301Smrg	   [use_fop=$withval], [use_fop=]_defopt)
10186862f5301Smrgm4_undefine([_defopt])
10187ff559fabSmrg
10188862f5301Smrgif test "x$use_fop" = x"auto"; then
10189862f5301Smrg   AC_PATH_PROG([FOP], [fop])
10190862f5301Smrg   if test "x$FOP" = "x"; then
10191862f5301Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10192862f5301Smrg	have_fop=no
10193862f5301Smrg   else
10194862f5301Smrg        have_fop=yes
10195862f5301Smrg   fi
10196862f5301Smrgelif test "x$use_fop" = x"yes" ; then
10197862f5301Smrg   AC_PATH_PROG([FOP], [fop])
10198862f5301Smrg   if test "x$FOP" = "x"; then
10199862f5301Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10200862f5301Smrg   fi
10201862f5301Smrg   have_fop=yes
10202862f5301Smrgelif test "x$use_fop" = x"no" ; then
10203862f5301Smrg   if test "x$FOP" != "x"; then
10204862f5301Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10205862f5301Smrg   fi
10206862f5301Smrg   have_fop=no
10207862f5301Smrgelse
10208862f5301Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10209862f5301Smrgfi
10210ff559fabSmrg
10211862f5301Smrg# Test for a minimum version of fop, if provided.
10212862f5301Smrgm4_ifval([$1],
10213862f5301Smrg[if test "$have_fop" = yes; then
10214862f5301Smrg    # scrape the fop version
10215862f5301Smrg    AC_MSG_CHECKING([for fop minimum version])
10216862f5301Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10217862f5301Smrg    AC_MSG_RESULT([$fop_version])
10218862f5301Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
10219862f5301Smrg        [if test "x$use_fop" = xauto; then
10220862f5301Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10221862f5301Smrg            have_fop=no
10222862f5301Smrg        else
10223862f5301Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10224862f5301Smrg        fi])
10225862f5301Smrgfi])
10226862f5301SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10227862f5301Smrg]) # XORG_WITH_FOP
10228ff559fabSmrg
10229fc544a13Smrg# XORG_WITH_M4([MIN-VERSION])
10230fc544a13Smrg# ---------------------------
10231fc544a13Smrg# Minimum version: 1.19.0
10232fc544a13Smrg#
10233fc544a13Smrg# This macro attempts to locate an m4 macro processor which supports
10234fc544a13Smrg# -I option and is only useful for modules relying on M4 in order to
10235fc544a13Smrg# expand macros in source code files.
10236fc544a13Smrg#
10237fc544a13Smrg# Interface to module:
10238fc544a13Smrg# M4:	 	returns the path of the m4 program found
10239fc544a13Smrg#		returns the path set by the user in the environment
10240fc544a13Smrg#
10241fc544a13SmrgAC_DEFUN([XORG_WITH_M4], [
10242fc544a13SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
10243fc544a13Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
10244fc544a13Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
10245fc544a13Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
10246fc544a13Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
10247fc544a13Smrg   [$PATH:/usr/gnu/bin])])
10248fc544a13Smrg
10249fc544a13SmrgAC_SUBST([M4], [$ac_cv_path_M4])
10250fc544a13Smrg]) # XORG_WITH_M4
10251fc544a13Smrg
10252862f5301Smrg# XORG_WITH_PS2PDF([DEFAULT])
10253862f5301Smrg# ----------------
10254862f5301Smrg# Minimum version: 1.6.0
10255862f5301Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10256862f5301Smrg#
10257862f5301Smrg# Documentation tools are not always available on all platforms and sometimes
10258862f5301Smrg# not at the appropriate level. This macro enables a module to test for the
10259862f5301Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10260862f5301Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10261862f5301Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10262862f5301Smrg# --with-ps2pdf assumes 'auto'.
10263862f5301Smrg#
10264862f5301Smrg# Interface to module:
10265862f5301Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10266862f5301Smrg# PS2PDF:	returns the path of the ps2pdf program found
10267862f5301Smrg#		returns the path set by the user in the environment
10268862f5301Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10269862f5301Smrg#		 'no' user instructs the module not to use ps2pdf
10270862f5301Smrg#
10271862f5301Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10272862f5301Smrg#
10273862f5301SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
10274862f5301SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10275862f5301Smrgm4_define([_defopt], m4_default([$1], [auto]))
10276862f5301SmrgAC_ARG_WITH(ps2pdf,
10277862f5301Smrg	AS_HELP_STRING([--with-ps2pdf],
10278862f5301Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10279862f5301Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10280862f5301Smrgm4_undefine([_defopt])
10281ff559fabSmrg
10282862f5301Smrgif test "x$use_ps2pdf" = x"auto"; then
10283862f5301Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10284862f5301Smrg   if test "x$PS2PDF" = "x"; then
10285862f5301Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10286862f5301Smrg	have_ps2pdf=no
10287862f5301Smrg   else
10288862f5301Smrg        have_ps2pdf=yes
10289862f5301Smrg   fi
10290862f5301Smrgelif test "x$use_ps2pdf" = x"yes" ; then
10291862f5301Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10292862f5301Smrg   if test "x$PS2PDF" = "x"; then
10293862f5301Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10294862f5301Smrg   fi
10295862f5301Smrg   have_ps2pdf=yes
10296862f5301Smrgelif test "x$use_ps2pdf" = x"no" ; then
10297862f5301Smrg   if test "x$PS2PDF" != "x"; then
10298862f5301Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10299862f5301Smrg   fi
10300862f5301Smrg   have_ps2pdf=no
10301862f5301Smrgelse
10302862f5301Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10303862f5301Smrgfi
10304862f5301SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10305862f5301Smrg]) # XORG_WITH_PS2PDF
10306ff559fabSmrg
10307862f5301Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
10308862f5301Smrg# ----------------
10309862f5301Smrg# Minimum version: 1.6.0
10310862f5301Smrg#
10311862f5301Smrg# Documentation tools are not always available on all platforms and sometimes
10312862f5301Smrg# not at the appropriate level. This macro enables a builder to skip all
10313862f5301Smrg# documentation targets except traditional man pages.
10314862f5301Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10315862f5301Smrg# maximum flexibilty in controlling documentation building.
10316862f5301Smrg# Refer to:
10317862f5301Smrg# XORG_WITH_XMLTO         --with-xmlto
10318862f5301Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10319862f5301Smrg# XORG_WITH_DOXYGEN       --with-doxygen
10320862f5301Smrg# XORG_WITH_FOP           --with-fop
10321862f5301Smrg# XORG_WITH_GROFF         --with-groff
10322862f5301Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
10323862f5301Smrg#
10324862f5301Smrg# Interface to module:
10325862f5301Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
10326862f5301Smrg# --enable-docs: 'yes' user instructs the module to generate docs
10327862f5301Smrg#		 'no' user instructs the module not to generate docs
10328862f5301Smrg# parm1:	specify the default value, yes or no.
10329862f5301Smrg#
10330862f5301SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
10331862f5301Smrgm4_define([docs_default], m4_default([$1], [yes]))
10332862f5301SmrgAC_ARG_ENABLE(docs,
10333862f5301Smrg	AS_HELP_STRING([--enable-docs],
10334862f5301Smrg	   [Enable building the documentation (default: ]docs_default[)]),
10335862f5301Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
10336862f5301Smrgm4_undefine([docs_default])
10337862f5301SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10338862f5301SmrgAC_MSG_CHECKING([whether to build documentation])
10339862f5301SmrgAC_MSG_RESULT([$build_docs])
10340862f5301Smrg]) # XORG_ENABLE_DOCS
10341ff559fabSmrg
10342862f5301Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10343862f5301Smrg# ----------------
10344862f5301Smrg# Minimum version: 1.6.0
10345862f5301Smrg#
10346862f5301Smrg# This macro enables a builder to skip all developer documentation.
10347862f5301Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10348862f5301Smrg# maximum flexibilty in controlling documentation building.
10349862f5301Smrg# Refer to:
10350862f5301Smrg# XORG_WITH_XMLTO         --with-xmlto
10351862f5301Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10352862f5301Smrg# XORG_WITH_DOXYGEN       --with-doxygen
10353862f5301Smrg# XORG_WITH_FOP           --with-fop
10354862f5301Smrg# XORG_WITH_GROFF         --with-groff
10355862f5301Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
10356862f5301Smrg#
10357862f5301Smrg# Interface to module:
10358862f5301Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
10359862f5301Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
10360862f5301Smrg#			'no' user instructs the module not to generate developer docs
10361862f5301Smrg# parm1:		specify the default value, yes or no.
10362862f5301Smrg#
10363862f5301SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10364862f5301Smrgm4_define([devel_default], m4_default([$1], [yes]))
10365862f5301SmrgAC_ARG_ENABLE(devel-docs,
10366862f5301Smrg	AS_HELP_STRING([--enable-devel-docs],
10367862f5301Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
10368862f5301Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10369862f5301Smrgm4_undefine([devel_default])
10370862f5301SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10371862f5301SmrgAC_MSG_CHECKING([whether to build developer documentation])
10372862f5301SmrgAC_MSG_RESULT([$build_devel_docs])
10373862f5301Smrg]) # XORG_ENABLE_DEVEL_DOCS
1037444dda7b2Smrg
10375862f5301Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
10376862f5301Smrg# ----------------
10377862f5301Smrg# Minimum version: 1.6.0
10378862f5301Smrg#
10379862f5301Smrg# This macro enables a builder to skip all functional specification targets.
10380862f5301Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10381862f5301Smrg# maximum flexibilty in controlling documentation building.
10382862f5301Smrg# Refer to:
10383862f5301Smrg# XORG_WITH_XMLTO         --with-xmlto
10384862f5301Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10385862f5301Smrg# XORG_WITH_DOXYGEN       --with-doxygen
10386862f5301Smrg# XORG_WITH_FOP           --with-fop
10387862f5301Smrg# XORG_WITH_GROFF         --with-groff
10388862f5301Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
10389862f5301Smrg#
10390862f5301Smrg# Interface to module:
10391862f5301Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
10392862f5301Smrg# --enable-specs:	'yes' user instructs the module to generate specs
10393862f5301Smrg#			'no' user instructs the module not to generate specs
10394862f5301Smrg# parm1:		specify the default value, yes or no.
10395862f5301Smrg#
10396862f5301SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
10397862f5301Smrgm4_define([spec_default], m4_default([$1], [yes]))
10398862f5301SmrgAC_ARG_ENABLE(specs,
10399862f5301Smrg	AS_HELP_STRING([--enable-specs],
10400862f5301Smrg	   [Enable building the specs (default: ]spec_default[)]),
10401862f5301Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
10402862f5301Smrgm4_undefine([spec_default])
10403862f5301SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10404862f5301SmrgAC_MSG_CHECKING([whether to build functional specifications])
10405862f5301SmrgAC_MSG_RESULT([$build_specs])
10406862f5301Smrg]) # XORG_ENABLE_SPECS
104077a3b38f7Smrg
10408862f5301Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10409862f5301Smrg# ----------------------------------------------
10410862f5301Smrg# Minimum version: 1.13.0
10411862f5301Smrg#
10412862f5301Smrg# This macro enables a builder to enable/disable unit testing
10413862f5301Smrg# It makes no assumption about the test cases implementation
10414862f5301Smrg# Test cases may or may not use Automake "Support for test suites"
10415862f5301Smrg# They may or may not use the software utility library GLib
10416862f5301Smrg#
10417862f5301Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10418862f5301Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10419862f5301Smrg# The variable enable_unit_tests is used by other macros in this file.
10420862f5301Smrg#
10421862f5301Smrg# Interface to module:
10422862f5301Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
10423862f5301Smrg# enable_unit_tests:    used in configure.ac for additional configuration
10424862f5301Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
10425862f5301Smrg#			'no' user instructs the module not to build tests
10426862f5301Smrg# parm1:		specify the default value, yes or no.
10427862f5301Smrg#
10428862f5301SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10429862f5301SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
10430862f5301SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
10431862f5301SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10432862f5301Smrgm4_define([_defopt], m4_default([$1], [auto]))
10433862f5301SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10434862f5301Smrg	[Enable building unit test cases (default: ]_defopt[)]),
10435862f5301Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
10436862f5301Smrgm4_undefine([_defopt])
10437862f5301SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10438862f5301SmrgAC_MSG_CHECKING([whether to build unit test cases])
10439862f5301SmrgAC_MSG_RESULT([$enable_unit_tests])
10440862f5301Smrg]) # XORG_ENABLE_UNIT_TESTS
104417a3b38f7Smrg
10442fc544a13Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
10443fc544a13Smrg# ------------------------------------------------------
10444fc544a13Smrg# Minimum version: 1.17.0
10445fc544a13Smrg#
10446fc544a13Smrg# This macro enables a builder to enable/disable integration testing
10447fc544a13Smrg# It makes no assumption about the test cases' implementation
10448fc544a13Smrg# Test cases may or may not use Automake "Support for test suites"
10449fc544a13Smrg#
10450fc544a13Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
10451fc544a13Smrg# usually requires less dependencies and may be built and run under less
10452fc544a13Smrg# stringent environments than integration tests.
10453fc544a13Smrg#
10454fc544a13Smrg# Interface to module:
10455fc544a13Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
10456fc544a13Smrg# enable_integration_tests:   used in configure.ac for additional configuration
10457fc544a13Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
10458fc544a13Smrg#                             'no' user instructs the module not to build tests
10459fc544a13Smrg# parm1:                      specify the default value, yes or no.
10460fc544a13Smrg#
10461fc544a13SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
10462fc544a13SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10463fc544a13Smrgm4_define([_defopt], m4_default([$1], [auto]))
10464fc544a13SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
10465fc544a13Smrg	[Enable building integration test cases (default: ]_defopt[)]),
10466fc544a13Smrg	[enable_integration_tests=$enableval],
10467fc544a13Smrg	[enable_integration_tests=]_defopt)
10468fc544a13Smrgm4_undefine([_defopt])
10469fc544a13SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
10470fc544a13Smrg	[test "x$enable_integration_tests" != xno])
10471fc544a13SmrgAC_MSG_CHECKING([whether to build unit test cases])
10472fc544a13SmrgAC_MSG_RESULT([$enable_integration_tests])
10473fc544a13Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
10474fc544a13Smrg
10475862f5301Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
10476862f5301Smrg# ----------------------------------------
10477862f5301Smrg# Minimum version: 1.13.0
10478862f5301Smrg#
10479862f5301Smrg# GLib is a library which provides advanced data structures and functions.
10480862f5301Smrg# This macro enables a module to test for the presence of Glib.
10481862f5301Smrg#
10482862f5301Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
10483862f5301Smrg# Otherwise the value of $enable_unit_tests is blank.
10484862f5301Smrg#
10485fc544a13Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
10486fc544a13Smrg# test support usually requires less dependencies and may be built and run under
10487fc544a13Smrg# less stringent environments than integration tests.
10488fc544a13Smrg#
10489862f5301Smrg# Interface to module:
10490862f5301Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
10491862f5301Smrg# with_glib: used in configure.ac to know if GLib has been found
10492862f5301Smrg# --with-glib:	'yes' user instructs the module to use glib
10493862f5301Smrg#		'no' user instructs the module not to use glib
10494862f5301Smrg#
10495862f5301SmrgAC_DEFUN([XORG_WITH_GLIB],[
10496862f5301SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
10497862f5301Smrgm4_define([_defopt], m4_default([$2], [auto]))
10498862f5301SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
10499862f5301Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
10500862f5301Smrg	[with_glib=$withval], [with_glib=]_defopt)
10501862f5301Smrgm4_undefine([_defopt])
10502ff559fabSmrg
10503862f5301Smrghave_glib=no
10504862f5301Smrg# Do not probe GLib if user explicitly disabled unit testing
10505862f5301Smrgif test "x$enable_unit_tests" != x"no"; then
10506862f5301Smrg  # Do not probe GLib if user explicitly disabled it
10507862f5301Smrg  if test "x$with_glib" != x"no"; then
10508862f5301Smrg    m4_ifval(
10509862f5301Smrg      [$1],
10510862f5301Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
10511862f5301Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
10512862f5301Smrg    )
10513862f5301Smrg  fi
10514862f5301Smrgfi
10515ff559fabSmrg
10516862f5301Smrg# Not having GLib when unit testing has been explicitly requested is an error
10517862f5301Smrgif test "x$enable_unit_tests" = x"yes"; then
10518862f5301Smrg  if test "x$have_glib" = x"no"; then
10519862f5301Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10520862f5301Smrg  fi
10521862f5301Smrgfi
10522ff559fabSmrg
10523862f5301Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
10524862f5301Smrgif test "x$enable_unit_tests" = x"no"; then
10525862f5301Smrg  if test "x$with_glib" = x"yes"; then
10526862f5301Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10527862f5301Smrg  fi
10528862f5301Smrgfi
10529ff559fabSmrg
105306fc0178dSmrg# Not having GLib when it has been explicitly requested is an error
105316fc0178dSmrgif test "x$with_glib" = x"yes"; then
105326fc0178dSmrg  if test "x$have_glib" = x"no"; then
105336fc0178dSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
105346fc0178dSmrg  fi
105356fc0178dSmrgfi
105366fc0178dSmrg
105376fc0178dSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
105386fc0178dSmrg]) # XORG_WITH_GLIB
105396fc0178dSmrg
105406fc0178dSmrg# XORG_LD_WRAP([required|optional])
105416fc0178dSmrg# ---------------------------------
105426fc0178dSmrg# Minimum version: 1.13.0
105436fc0178dSmrg#
105446fc0178dSmrg# Check if linker supports -wrap, passed via compiler flags
105456fc0178dSmrg#
105466fc0178dSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
105476fc0178dSmrg# Otherwise the value of $enable_unit_tests is blank.
105486fc0178dSmrg#
105496fc0178dSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
105506fc0178dSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
105516fc0178dSmrg# available, an argument of "optional" allows use when some unit tests require
105526fc0178dSmrg# ld -wrap and others do not.
105536fc0178dSmrg#
105546fc0178dSmrgAC_DEFUN([XORG_LD_WRAP],[
105556fc0178dSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
105566fc0178dSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
105576fc0178dSmrg                      void __wrap_exit(int status) { return; }],
105586fc0178dSmrg                     [exit(0);])])
105596fc0178dSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
105606fc0178dSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
105616fc0178dSmrg  if test "x$have_ld_wrap" = x"no"; then
105626fc0178dSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
105636fc0178dSmrg  fi
105646fc0178dSmrgfi
105656fc0178dSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
105666fc0178dSmrg#
105676fc0178dSmrg]) # XORG_LD_WRAP
105686fc0178dSmrg
105696fc0178dSmrg# XORG_CHECK_LINKER_FLAGS
105706fc0178dSmrg# -----------------------
105716fc0178dSmrg# SYNOPSIS
105726fc0178dSmrg#
105736fc0178dSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
105746fc0178dSmrg#
105756fc0178dSmrg# DESCRIPTION
105766fc0178dSmrg#
105776fc0178dSmrg#   Check whether the given linker FLAGS work with the current language's
105786fc0178dSmrg#   linker, or whether they give an error.
105796fc0178dSmrg#
105806fc0178dSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
105816fc0178dSmrg#   success/failure.
105826fc0178dSmrg#
105836fc0178dSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
105846fc0178dSmrg#
105856fc0178dSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
105866fc0178dSmrg#
105876fc0178dSmrg# LICENSE
105886fc0178dSmrg#
105896fc0178dSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
105906fc0178dSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
105916fc0178dSmrg#   Copyright (c) 2009 Matteo Frigo
105926fc0178dSmrg#
105936fc0178dSmrg#   This program is free software: you can redistribute it and/or modify it
105946fc0178dSmrg#   under the terms of the GNU General Public License as published by the
105956fc0178dSmrg#   Free Software Foundation, either version 3 of the License, or (at your
105966fc0178dSmrg#   option) any later version.
105976fc0178dSmrg#
105986fc0178dSmrg#   This program is distributed in the hope that it will be useful, but
105996fc0178dSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
106006fc0178dSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
106016fc0178dSmrg#   Public License for more details.
106026fc0178dSmrg#
106036fc0178dSmrg#   You should have received a copy of the GNU General Public License along
106046fc0178dSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
106056fc0178dSmrg#
106066fc0178dSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
106076fc0178dSmrg#   gives unlimited permission to copy, distribute and modify the configure
106086fc0178dSmrg#   scripts that are the output of Autoconf when processing the Macro. You
106096fc0178dSmrg#   need not follow the terms of the GNU General Public License when using
106106fc0178dSmrg#   or distributing such scripts, even though portions of the text of the
106116fc0178dSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
106126fc0178dSmrg#   all other use of the material that constitutes the Autoconf Macro.
106136fc0178dSmrg#
106146fc0178dSmrg#   This special exception to the GPL applies to versions of the Autoconf
106156fc0178dSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
106166fc0178dSmrg#   modified version of the Autoconf Macro, you may extend this special
106176fc0178dSmrg#   exception to the GPL to apply to your modified version as well.#
106186fc0178dSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
106196fc0178dSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
106206fc0178dSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
106216fc0178dSmrgAS_LITERAL_IF([$1],
106226fc0178dSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
106236fc0178dSmrg      ax_save_FLAGS=$LDFLAGS
106246fc0178dSmrg      LDFLAGS="$1"
106256fc0178dSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
106266fc0178dSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
106276fc0178dSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
106286fc0178dSmrg      LDFLAGS=$ax_save_FLAGS])],
106296fc0178dSmrg  [ax_save_FLAGS=$LDFLAGS
106306fc0178dSmrg   LDFLAGS="$1"
106316fc0178dSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
106326fc0178dSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
106336fc0178dSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
106346fc0178dSmrg   LDFLAGS=$ax_save_FLAGS])
106356fc0178dSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
106366fc0178dSmrgAC_MSG_RESULT($xorg_check_linker_flags)
106376fc0178dSmrgif test "x$xorg_check_linker_flags" = xyes; then
106386fc0178dSmrg	m4_default([$2], :)
106396fc0178dSmrgelse
106406fc0178dSmrg	m4_default([$3], :)
106416fc0178dSmrgfi
106426fc0178dSmrg]) # XORG_CHECK_LINKER_FLAGS
106436fc0178dSmrg
106446fc0178dSmrg# XORG_MEMORY_CHECK_FLAGS
106456fc0178dSmrg# -----------------------
106466fc0178dSmrg# Minimum version: 1.16.0
106476fc0178dSmrg#
106486fc0178dSmrg# This macro attempts to find appropriate memory checking functionality
106496fc0178dSmrg# for various platforms which unit testing code may use to catch various
106506fc0178dSmrg# forms of memory allocation and access errors in testing.
106516fc0178dSmrg#
106526fc0178dSmrg# Interface to module:
106536fc0178dSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
106546fc0178dSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
106556fc0178dSmrg#
106566fc0178dSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
106576fc0178dSmrg#
106586fc0178dSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
106596fc0178dSmrg
106606fc0178dSmrgAC_REQUIRE([AC_CANONICAL_HOST])
106616fc0178dSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
106626fc0178dSmrg           [Environment variables to enable memory checking in tests])
106636fc0178dSmrg
106646fc0178dSmrg# Check for different types of support on different platforms
106656fc0178dSmrgcase $host_os in
106666fc0178dSmrg    solaris*)
106676fc0178dSmrg        AC_CHECK_LIB([umem], [umem_alloc],
106686fc0178dSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
106696fc0178dSmrg        ;;
106706fc0178dSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
106716fc0178dSmrg        # both directly and inverted, so should not be 0 or 255.
106726fc0178dSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
106736fc0178dSmrg        ;;
106746fc0178dSmrg    darwin*)
106756fc0178dSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
106766fc0178dSmrg        ;;
106776fc0178dSmrg    *bsd*)
106786fc0178dSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
106796fc0178dSmrg        ;;
106806fc0178dSmrgesac
106816fc0178dSmrg
106826fc0178dSmrg# User supplied flags override default flags
106836fc0178dSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
106846fc0178dSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
106856fc0178dSmrgfi
106866fc0178dSmrg
106876fc0178dSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
106886fc0178dSmrg]) # XORG_WITH_LINT
106896fc0178dSmrg
106906fc0178dSmrg# XORG_CHECK_MALLOC_ZERO
106916fc0178dSmrg# ----------------------
106926fc0178dSmrg# Minimum version: 1.0.0
106936fc0178dSmrg#
106946fc0178dSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
106956fc0178dSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
106966fc0178dSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
106976fc0178dSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
106986fc0178dSmrgAC_ARG_ENABLE(malloc0returnsnull,
106996fc0178dSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
107006fc0178dSmrg		       [malloc(0) returns NULL (default: auto)]),
107016fc0178dSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
107026fc0178dSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
107036fc0178dSmrg
107046fc0178dSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
107056fc0178dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
107066fc0178dSmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
107076fc0178dSmrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
107086fc0178dSmrg#include <stdlib.h>
107096fc0178dSmrg],[
107106fc0178dSmrg    char *m0, *r0, *c0, *p;
107116fc0178dSmrg    m0 = malloc(0);
107126fc0178dSmrg    p = malloc(10);
107136fc0178dSmrg    r0 = realloc(p,0);
107146fc0178dSmrg    c0 = calloc(0,10);
107156fc0178dSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
107166fc0178dSmrg])],
107176fc0178dSmrg		[xorg_cv_malloc0_returns_null=yes],
107186fc0178dSmrg		[xorg_cv_malloc0_returns_null=no])])
107196fc0178dSmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
107206fc0178dSmrgfi
107216fc0178dSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
107226fc0178dSmrg
107236fc0178dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
107246fc0178dSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
107256fc0178dSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
107266fc0178dSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
107276fc0178dSmrgelse
107286fc0178dSmrg	MALLOC_ZERO_CFLAGS=""
107296fc0178dSmrg	XMALLOC_ZERO_CFLAGS=""
107306fc0178dSmrg	XTMALLOC_ZERO_CFLAGS=""
107316fc0178dSmrgfi
107326fc0178dSmrg
107336fc0178dSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
107346fc0178dSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
107356fc0178dSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
107366fc0178dSmrg]) # XORG_CHECK_MALLOC_ZERO
107376fc0178dSmrg
107386fc0178dSmrg# XORG_WITH_LINT()
107396fc0178dSmrg# ----------------
107406fc0178dSmrg# Minimum version: 1.1.0
107416fc0178dSmrg#
107426fc0178dSmrg# This macro enables the use of a tool that flags some suspicious and
107436fc0178dSmrg# non-portable constructs (likely to be bugs) in C language source code.
107446fc0178dSmrg# It will attempt to locate the tool and use appropriate options.
107456fc0178dSmrg# There are various lint type tools on different platforms.
107466fc0178dSmrg#
107476fc0178dSmrg# Interface to module:
107486fc0178dSmrg# LINT:		returns the path to the tool found on the platform
107496fc0178dSmrg#		or the value set to LINT on the configure cmd line
107506fc0178dSmrg#		also an Automake conditional
107516fc0178dSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
107526fc0178dSmrg#
107536fc0178dSmrg# --with-lint:	'yes' user instructs the module to use lint
107546fc0178dSmrg#		'no' user instructs the module not to use lint (default)
107556fc0178dSmrg#
107566fc0178dSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
107576fc0178dSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
107586fc0178dSmrg#
107596fc0178dSmrgAC_DEFUN([XORG_WITH_LINT],[
107606fc0178dSmrg
107616fc0178dSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
107626fc0178dSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
107636fc0178dSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
107646fc0178dSmrg		[Use a lint-style source code checker (default: disabled)])],
107656fc0178dSmrg		[use_lint=$withval], [use_lint=no])
107666fc0178dSmrg
107676fc0178dSmrg# Obtain platform specific info like program name and options
107686fc0178dSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
107696fc0178dSmrgcase $host_os in
107706fc0178dSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
107716fc0178dSmrg	lint_name=splint
107726fc0178dSmrg	lint_options="-badflag"
107736fc0178dSmrg	;;
107746fc0178dSmrg  *freebsd* | *netbsd*)
107756fc0178dSmrg	lint_name=lint
107766fc0178dSmrg	lint_options="-u -b"
107776fc0178dSmrg	;;
107786fc0178dSmrg  *solaris*)
107796fc0178dSmrg	lint_name=lint
107806fc0178dSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
107816fc0178dSmrg	;;
107826fc0178dSmrgesac
107836fc0178dSmrg
107846fc0178dSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
107856fc0178dSmrgif test "x$use_lint" = x"yes" ; then
107866fc0178dSmrg   AC_PATH_PROG([LINT], [$lint_name])
107876fc0178dSmrg   if test "x$LINT" = "x"; then
107886fc0178dSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
107896fc0178dSmrg   fi
107906fc0178dSmrgelif test "x$use_lint" = x"no" ; then
107916fc0178dSmrg   if test "x$LINT" != "x"; then
107926fc0178dSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
107936fc0178dSmrg   fi
107946fc0178dSmrgelse
107956fc0178dSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
107966fc0178dSmrgfi
107976fc0178dSmrg
107986fc0178dSmrg# User supplied flags override default flags
107996fc0178dSmrgif test "x$LINT_FLAGS" != "x"; then
108006fc0178dSmrg   lint_options=$LINT_FLAGS
108016fc0178dSmrgfi
108026fc0178dSmrg
108036fc0178dSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
108046fc0178dSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
108056fc0178dSmrg
108066fc0178dSmrg]) # XORG_WITH_LINT
108076fc0178dSmrg
108086fc0178dSmrg# XORG_LINT_LIBRARY(LIBNAME)
108096fc0178dSmrg# --------------------------
108106fc0178dSmrg# Minimum version: 1.1.0
108116fc0178dSmrg#
108126fc0178dSmrg# Sets up flags for building lint libraries for checking programs that call
108136fc0178dSmrg# functions in the library.
108146fc0178dSmrg#
108156fc0178dSmrg# Interface to module:
108166fc0178dSmrg# LINTLIB		- Automake variable with the name of lint library file to make
108176fc0178dSmrg# MAKE_LINT_LIB		- Automake conditional
108186fc0178dSmrg#
108196fc0178dSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
108206fc0178dSmrg#			  - 'no' user instructs the module not to create a lint library (default)
108216fc0178dSmrg
108226fc0178dSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
108236fc0178dSmrgAC_REQUIRE([XORG_WITH_LINT])
108246fc0178dSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
108256fc0178dSmrg	[Create lint library (default: disabled)])],
108266fc0178dSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
108276fc0178dSmrg
108286fc0178dSmrgif test "x$make_lint_lib" = x"yes" ; then
108296fc0178dSmrg   LINTLIB=llib-l$1.ln
108306fc0178dSmrg   if test "x$LINT" = "x"; then
108316fc0178dSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
108326fc0178dSmrg   fi
108336fc0178dSmrgelif test "x$make_lint_lib" != x"no" ; then
108346fc0178dSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
108356fc0178dSmrgfi
108366fc0178dSmrg
108376fc0178dSmrgAC_SUBST(LINTLIB)
108386fc0178dSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
108396fc0178dSmrg
108406fc0178dSmrg]) # XORG_LINT_LIBRARY
108416fc0178dSmrg
108426fc0178dSmrg# XORG_COMPILER_BRAND
108436fc0178dSmrg# -------------------
108446fc0178dSmrg# Minimum version: 1.14.0
108456fc0178dSmrg#
108466fc0178dSmrg# Checks for various brands of compilers and sets flags as appropriate:
108476fc0178dSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
108486fc0178dSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
108496fc0178dSmrg#   clang compiler - sets CLANGCC to "yes"
108506fc0178dSmrg#   Intel compiler - sets INTELCC to "yes"
108516fc0178dSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
108526fc0178dSmrg#
108536fc0178dSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
108546fc0178dSmrgAC_LANG_CASE(
108556fc0178dSmrg	[C], [
108566fc0178dSmrg		AC_REQUIRE([AC_PROG_CC_C99])
108576fc0178dSmrg	],
108586fc0178dSmrg	[C++], [
108596fc0178dSmrg		AC_REQUIRE([AC_PROG_CXX])
108606fc0178dSmrg	]
108616fc0178dSmrg)
108626fc0178dSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
108636fc0178dSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
108646fc0178dSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
108656fc0178dSmrg]) # XORG_COMPILER_BRAND
108666fc0178dSmrg
108676fc0178dSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
108686fc0178dSmrg# ---------------
108696fc0178dSmrg# Minimum version: 1.16.0
108706fc0178dSmrg#
108716fc0178dSmrg# Test if the compiler works when passed the given flag as a command line argument.
108726fc0178dSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
108736fc0178dSmrg# next flag in the list until there are no more options.
108746fc0178dSmrg#
108756fc0178dSmrg# Note that this does not guarantee that the compiler supports the flag as some
108766fc0178dSmrg# compilers will simply ignore arguments that they do not understand, but we do
108776fc0178dSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
108786fc0178dSmrg# -Werror=unused-command-line-argument
108796fc0178dSmrg#
108806fc0178dSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
108816fc0178dSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
108826fc0178dSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
108836fc0178dSmrg
108846fc0178dSmrgAC_LANG_COMPILER_REQUIRE
108856fc0178dSmrg
108866fc0178dSmrgAC_LANG_CASE(
108876fc0178dSmrg	[C], [
108886fc0178dSmrg		AC_REQUIRE([AC_PROG_CC_C99])
108896fc0178dSmrg		define([PREFIX], [C])
108906fc0178dSmrg		define([CACHE_PREFIX], [cc])
108916fc0178dSmrg		define([COMPILER], [$CC])
108926fc0178dSmrg	],
108936fc0178dSmrg	[C++], [
108946fc0178dSmrg		define([PREFIX], [CXX])
108956fc0178dSmrg		define([CACHE_PREFIX], [cxx])
108966fc0178dSmrg		define([COMPILER], [$CXX])
108976fc0178dSmrg	]
108986fc0178dSmrg)
108996fc0178dSmrg
109006fc0178dSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
109016fc0178dSmrg
109026fc0178dSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
109036fc0178dSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
109046fc0178dSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
109056fc0178dSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
109066fc0178dSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
109076fc0178dSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
109086fc0178dSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
109096fc0178dSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
109106fc0178dSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
109116fc0178dSmrgfi
109126fc0178dSmrg
109136fc0178dSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
109146fc0178dSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
109156fc0178dSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
109166fc0178dSmrg	fi
109176fc0178dSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
109186fc0178dSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
109196fc0178dSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
109206fc0178dSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
109216fc0178dSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
109226fc0178dSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
109236fc0178dSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
109246fc0178dSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
109256fc0178dSmrgfi
109266fc0178dSmrg
109276fc0178dSmrgfound="no"
109286fc0178dSmrgm4_foreach([flag], m4_cdr($@), [
109296fc0178dSmrg	if test $found = "no" ; then
109306fc0178dSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
109316fc0178dSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
109326fc0178dSmrg		fi
109336fc0178dSmrg
109346fc0178dSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
109356fc0178dSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
109366fc0178dSmrg		fi
109376fc0178dSmrg
109386fc0178dSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
109396fc0178dSmrg
109406fc0178dSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
109416fc0178dSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
109426fc0178dSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
109436fc0178dSmrg		AC_CACHE_VAL($cacheid,
109446fc0178dSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
109456fc0178dSmrg					     [eval $cacheid=yes],
109466fc0178dSmrg					     [eval $cacheid=no])])
109476fc0178dSmrg
109486fc0178dSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
109496fc0178dSmrg
109506fc0178dSmrg		eval supported=\$$cacheid
109516fc0178dSmrg		AC_MSG_RESULT([$supported])
109526fc0178dSmrg		if test "$supported" = "yes" ; then
109536fc0178dSmrg			$1="$$1 ]flag["
109546fc0178dSmrg			found="yes"
109556fc0178dSmrg		fi
109566fc0178dSmrg	fi
109576fc0178dSmrg])
109586fc0178dSmrg]) # XORG_TESTSET_CFLAG
109596fc0178dSmrg
109606fc0178dSmrg# XORG_COMPILER_FLAGS
109616fc0178dSmrg# ---------------
109626fc0178dSmrg# Minimum version: 1.16.0
109636fc0178dSmrg#
109646fc0178dSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
109656fc0178dSmrg# arguments supported by the selected compiler which do NOT alter the generated
109666fc0178dSmrg# code.  These arguments will cause the compiler to print various warnings
109676fc0178dSmrg# during compilation AND turn a conservative set of warnings into errors.
109686fc0178dSmrg#
109696fc0178dSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
109706fc0178dSmrg# future versions of util-macros as options are added to new compilers.
109716fc0178dSmrg#
109726fc0178dSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
109736fc0178dSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
109746fc0178dSmrg
109756fc0178dSmrgAC_ARG_ENABLE(selective-werror,
109766fc0178dSmrg              AS_HELP_STRING([--disable-selective-werror],
109776fc0178dSmrg                             [Turn off selective compiler errors. (default: enabled)]),
109786fc0178dSmrg              [SELECTIVE_WERROR=$enableval],
109796fc0178dSmrg              [SELECTIVE_WERROR=yes])
109806fc0178dSmrg
109816fc0178dSmrgAC_LANG_CASE(
109826fc0178dSmrg        [C], [
109836fc0178dSmrg                define([PREFIX], [C])
109846fc0178dSmrg        ],
109856fc0178dSmrg        [C++], [
109866fc0178dSmrg                define([PREFIX], [CXX])
109876fc0178dSmrg        ]
109886fc0178dSmrg)
109896fc0178dSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
109906fc0178dSmrgif test "x$SUNCC" = "xyes"; then
109916fc0178dSmrg    [BASE_]PREFIX[FLAGS]="-v"
109926fc0178dSmrgelse
109936fc0178dSmrg    [BASE_]PREFIX[FLAGS]=""
109946fc0178dSmrgfi
109956fc0178dSmrg
109966fc0178dSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
109976fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
109986fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
109996fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
110006fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
110016fc0178dSmrg
110026fc0178dSmrgAC_LANG_CASE(
110036fc0178dSmrg	[C], [
110046fc0178dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
110056fc0178dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
110066fc0178dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
110076fc0178dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
110086fc0178dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
110096fc0178dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
110106fc0178dSmrg	]
110116fc0178dSmrg)
110126fc0178dSmrg
110136fc0178dSmrg# This chunk adds additional warnings that could catch undesired effects.
110146fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
110156fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
110166fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
110176fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
110186fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
110196fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
110206fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
110216fc0178dSmrg
110226fc0178dSmrg# These are currently disabled because they are noisy.  They will be enabled
110236fc0178dSmrg# in the future once the codebase is sufficiently modernized to silence
110246fc0178dSmrg# them.  For now, I don't want them to drown out the other warnings.
110256fc0178dSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
110266fc0178dSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
110276fc0178dSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
110286fc0178dSmrg
110296fc0178dSmrg# Turn some warnings into errors, so we don't accidently get successful builds
110306fc0178dSmrg# when there are problems that should be fixed.
110316fc0178dSmrg
110326fc0178dSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
110336fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
110346fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
110356fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
110366fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
110376fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
110386fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
110396fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
110406fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
110416fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
110426fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
110436fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
110446fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
110456fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
110466fc0178dSmrgelse
110476fc0178dSmrgAC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors.  This should not be necessary.  Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
110486fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
110496fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
110506fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
110516fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
110526fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
110536fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
110546fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
110556fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
110566fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
110576fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
110586fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
110596fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
110606fc0178dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
110616fc0178dSmrgfi
110626fc0178dSmrg
110636fc0178dSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
110646fc0178dSmrg]) # XORG_COMPILER_FLAGS
110656fc0178dSmrg
110666fc0178dSmrg# XORG_CWARNFLAGS
110676fc0178dSmrg# ---------------
110686fc0178dSmrg# Minimum version: 1.2.0
110696fc0178dSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
110706fc0178dSmrg#
110716fc0178dSmrg# Defines CWARNFLAGS to enable C compiler warnings.
110726fc0178dSmrg#
110736fc0178dSmrg# This function is deprecated because it defines -fno-strict-aliasing
110746fc0178dSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
110756fc0178dSmrg# is needed, then it should be added explicitly in the module when
110766fc0178dSmrg# it is updated to use BASE_CFLAGS.
110776fc0178dSmrg#
110786fc0178dSmrgAC_DEFUN([XORG_CWARNFLAGS], [
110796fc0178dSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
110806fc0178dSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
110816fc0178dSmrgAC_LANG_CASE(
110826fc0178dSmrg	[C], [
110836fc0178dSmrg		CWARNFLAGS="$BASE_CFLAGS"
110846fc0178dSmrg		if  test "x$GCC" = xyes ; then
110856fc0178dSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
110866fc0178dSmrg		fi
110876fc0178dSmrg		AC_SUBST(CWARNFLAGS)
110886fc0178dSmrg	]
110896fc0178dSmrg)
110906fc0178dSmrg]) # XORG_CWARNFLAGS
110916fc0178dSmrg
110926fc0178dSmrg# XORG_STRICT_OPTION
110936fc0178dSmrg# -----------------------
110946fc0178dSmrg# Minimum version: 1.3.0
110956fc0178dSmrg#
110966fc0178dSmrg# Add configure option to enable strict compilation flags, such as treating
110976fc0178dSmrg# warnings as fatal errors.
110986fc0178dSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
110996fc0178dSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
111006fc0178dSmrg#
111016fc0178dSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
111026fc0178dSmrg# when strict compilation is unconditionally desired.
111036fc0178dSmrgAC_DEFUN([XORG_STRICT_OPTION], [
111046fc0178dSmrgAC_REQUIRE([XORG_CWARNFLAGS])
111056fc0178dSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
111066fc0178dSmrg
111076fc0178dSmrgAC_ARG_ENABLE(strict-compilation,
111086fc0178dSmrg			  AS_HELP_STRING([--enable-strict-compilation],
111096fc0178dSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
111106fc0178dSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
111116fc0178dSmrg
111126fc0178dSmrgAC_LANG_CASE(
111136fc0178dSmrg        [C], [
111146fc0178dSmrg                define([PREFIX], [C])
111156fc0178dSmrg        ],
111166fc0178dSmrg        [C++], [
111176fc0178dSmrg                define([PREFIX], [CXX])
111186fc0178dSmrg        ]
111196fc0178dSmrg)
111206fc0178dSmrg
111216fc0178dSmrg[STRICT_]PREFIX[FLAGS]=""
111226fc0178dSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
111236fc0178dSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
111246fc0178dSmrg
111256fc0178dSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
111266fc0178dSmrg# activate it with -Werror, so we add it here explicitly.
111276fc0178dSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
111286fc0178dSmrg
111296fc0178dSmrgif test "x$STRICT_COMPILE" = "xyes"; then
111306fc0178dSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
111316fc0178dSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
111326fc0178dSmrgfi
111336fc0178dSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
111346fc0178dSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
111356fc0178dSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
111366fc0178dSmrg]) # XORG_STRICT_OPTION
111376fc0178dSmrg
111386fc0178dSmrg# XORG_DEFAULT_OPTIONS
111396fc0178dSmrg# --------------------
111406fc0178dSmrg# Minimum version: 1.3.0
111416fc0178dSmrg#
111426fc0178dSmrg# Defines default options for X.Org modules.
111436fc0178dSmrg#
111446fc0178dSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
111456fc0178dSmrgAC_REQUIRE([AC_PROG_INSTALL])
111466fc0178dSmrgXORG_COMPILER_FLAGS
111476fc0178dSmrgXORG_CWARNFLAGS
111486fc0178dSmrgXORG_STRICT_OPTION
111496fc0178dSmrgXORG_RELEASE_VERSION
111506fc0178dSmrgXORG_CHANGELOG
111516fc0178dSmrgXORG_INSTALL
111526fc0178dSmrgXORG_MANPAGE_SECTIONS
111536fc0178dSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
111546fc0178dSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
111556fc0178dSmrg]) # XORG_DEFAULT_OPTIONS
111566fc0178dSmrg
111576fc0178dSmrg# XORG_INSTALL()
111586fc0178dSmrg# ----------------
111596fc0178dSmrg# Minimum version: 1.4.0
111606fc0178dSmrg#
111616fc0178dSmrg# Defines the variable INSTALL_CMD as the command to copy
111626fc0178dSmrg# INSTALL from $prefix/share/util-macros.
111636fc0178dSmrg#
111646fc0178dSmrgAC_DEFUN([XORG_INSTALL], [
111656fc0178dSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
111666fc0178dSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
111676fc0178dSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
111686fc0178dSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
111696fc0178dSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
111706fc0178dSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
111716fc0178dSmrgAC_SUBST([INSTALL_CMD])
111726fc0178dSmrg]) # XORG_INSTALL
111736fc0178dSmrgdnl Copyright 2005 Red Hat, Inc
111746fc0178dSmrgdnl
111756fc0178dSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
111766fc0178dSmrgdnl documentation for any purpose is hereby granted without fee, provided that
111776fc0178dSmrgdnl the above copyright notice appear in all copies and that both that
111786fc0178dSmrgdnl copyright notice and this permission notice appear in supporting
111796fc0178dSmrgdnl documentation.
111806fc0178dSmrgdnl
111816fc0178dSmrgdnl The above copyright notice and this permission notice shall be included
111826fc0178dSmrgdnl in all copies or substantial portions of the Software.
111836fc0178dSmrgdnl
111846fc0178dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
111856fc0178dSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
111866fc0178dSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
111876fc0178dSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
111886fc0178dSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
111896fc0178dSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
111906fc0178dSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
111916fc0178dSmrgdnl
111926fc0178dSmrgdnl Except as contained in this notice, the name of the copyright holders shall
111936fc0178dSmrgdnl not be used in advertising or otherwise to promote the sale, use or
111946fc0178dSmrgdnl other dealings in this Software without prior written authorization
111956fc0178dSmrgdnl from the copyright holders.
111966fc0178dSmrgdnl
111976fc0178dSmrg
111986fc0178dSmrg# XORG_RELEASE_VERSION
111996fc0178dSmrg# --------------------
112006fc0178dSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
112016fc0178dSmrg
112026fc0178dSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
112036fc0178dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
112046fc0178dSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
112056fc0178dSmrg		[Major version of this package])
112066fc0178dSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
112076fc0178dSmrg	if test "x$PVM" = "x"; then
112086fc0178dSmrg		PVM="0"
112096fc0178dSmrg	fi
112106fc0178dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
112116fc0178dSmrg		[$PVM],
112126fc0178dSmrg		[Minor version of this package])
112136fc0178dSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
112146fc0178dSmrg	if test "x$PVP" = "x"; then
112156fc0178dSmrg		PVP="0"
112166fc0178dSmrg	fi
112176fc0178dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
112186fc0178dSmrg		[$PVP],
112196fc0178dSmrg		[Patch version of this package])
112206fc0178dSmrg])
112216fc0178dSmrg
112226fc0178dSmrg# XORG_CHANGELOG()
112236fc0178dSmrg# ----------------
112246fc0178dSmrg# Minimum version: 1.2.0
112256fc0178dSmrg#
112266fc0178dSmrg# Defines the variable CHANGELOG_CMD as the command to generate
112276fc0178dSmrg# ChangeLog from git.
112286fc0178dSmrg#
112296fc0178dSmrg#
112306fc0178dSmrgAC_DEFUN([XORG_CHANGELOG], [
112316fc0178dSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
112326fc0178dSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
112336fc0178dSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
112346fc0178dSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
112356fc0178dSmrgAC_SUBST([CHANGELOG_CMD])
112366fc0178dSmrg]) # XORG_CHANGELOG
112376fc0178dSmrg
112386fc0178dSmrg# Copyright (C) 2002-2014 Free Software Foundation, Inc.
112396fc0178dSmrg#
112406fc0178dSmrg# This file is free software; the Free Software Foundation
112416fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
112426fc0178dSmrg# with or without modifications, as long as this notice is preserved.
112436fc0178dSmrg
112446fc0178dSmrg# AM_AUTOMAKE_VERSION(VERSION)
112456fc0178dSmrg# ----------------------------
112466fc0178dSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
112476fc0178dSmrg# generated from the m4 files accompanying Automake X.Y.
112486fc0178dSmrg# (This private macro should not be called outside this file.)
112496fc0178dSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
112506fc0178dSmrg[am__api_version='1.15'
112516fc0178dSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
112526fc0178dSmrgdnl require some minimum version.  Point them to the right macro.
112536fc0178dSmrgm4_if([$1], [1.15], [],
112546fc0178dSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
112556fc0178dSmrg])
112566fc0178dSmrg
112576fc0178dSmrg# _AM_AUTOCONF_VERSION(VERSION)
112586fc0178dSmrg# -----------------------------
112596fc0178dSmrg# aclocal traces this macro to find the Autoconf version.
112606fc0178dSmrg# This is a private macro too.  Using m4_define simplifies
112616fc0178dSmrg# the logic in aclocal, which can simply ignore this definition.
112626fc0178dSmrgm4_define([_AM_AUTOCONF_VERSION], [])
112636fc0178dSmrg
112646fc0178dSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
112656fc0178dSmrg# -------------------------------
112666fc0178dSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
112676fc0178dSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
112686fc0178dSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
112696fc0178dSmrg[AM_AUTOMAKE_VERSION([1.15])dnl
112706fc0178dSmrgm4_ifndef([AC_AUTOCONF_VERSION],
112716fc0178dSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
112726fc0178dSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
112736fc0178dSmrg
112746fc0178dSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
112756fc0178dSmrg
112766fc0178dSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
112776fc0178dSmrg#
112786fc0178dSmrg# This file is free software; the Free Software Foundation
112796fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
112806fc0178dSmrg# with or without modifications, as long as this notice is preserved.
112816fc0178dSmrg
112826fc0178dSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
112836fc0178dSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
112846fc0178dSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
112856fc0178dSmrg#
112866fc0178dSmrg# Of course, Automake must honor this variable whenever it calls a
112876fc0178dSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
112886fc0178dSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
112896fc0178dSmrg# depending on how configure is run.  This is pretty annoying, since
112906fc0178dSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
112916fc0178dSmrg# source directory, any form will work fine, but in subdirectories a
112926fc0178dSmrg# relative path needs to be adjusted first.
112936fc0178dSmrg#
112946fc0178dSmrg# $ac_aux_dir/missing
112956fc0178dSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
112966fc0178dSmrg# $top_srcdir/$ac_aux_dir/missing
112976fc0178dSmrg#    fails if $ac_aux_dir is absolute,
112986fc0178dSmrg#    fails when called from a subdirectory in a VPATH build with
112996fc0178dSmrg#          a relative $ac_aux_dir
113006fc0178dSmrg#
113016fc0178dSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
113026fc0178dSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
113036fc0178dSmrg# harmless because $srcdir is '.', but things will broke when you
113046fc0178dSmrg# start a VPATH build or use an absolute $srcdir.
113056fc0178dSmrg#
113066fc0178dSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
113076fc0178dSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
113086fc0178dSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
113096fc0178dSmrg# and then we would define $MISSING as
113106fc0178dSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
113116fc0178dSmrg# This will work as long as MISSING is not called from configure, because
113126fc0178dSmrg# unfortunately $(top_srcdir) has no meaning in configure.
113136fc0178dSmrg# However there are other variables, like CC, which are often used in
113146fc0178dSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
113156fc0178dSmrg#
113166fc0178dSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
113176fc0178dSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
113186fc0178dSmrg# configured tree to be moved without reconfiguration.
113196fc0178dSmrg
113206fc0178dSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
113216fc0178dSmrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
113226fc0178dSmrg# Expand $ac_aux_dir to an absolute path.
113236fc0178dSmrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
113246fc0178dSmrg])
113256fc0178dSmrg
113266fc0178dSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
113276fc0178dSmrg
113286fc0178dSmrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
113296fc0178dSmrg#
113306fc0178dSmrg# This file is free software; the Free Software Foundation
113316fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
113326fc0178dSmrg# with or without modifications, as long as this notice is preserved.
113336fc0178dSmrg
113346fc0178dSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
113356fc0178dSmrg# -------------------------------------
113366fc0178dSmrg# Define a conditional.
113376fc0178dSmrgAC_DEFUN([AM_CONDITIONAL],
113386fc0178dSmrg[AC_PREREQ([2.52])dnl
113396fc0178dSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
113406fc0178dSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
113416fc0178dSmrgAC_SUBST([$1_TRUE])dnl
113426fc0178dSmrgAC_SUBST([$1_FALSE])dnl
113436fc0178dSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
113446fc0178dSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
113456fc0178dSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
113466fc0178dSmrgif $2; then
113476fc0178dSmrg  $1_TRUE=
113486fc0178dSmrg  $1_FALSE='#'
113496fc0178dSmrgelse
113506fc0178dSmrg  $1_TRUE='#'
113516fc0178dSmrg  $1_FALSE=
113526fc0178dSmrgfi
113536fc0178dSmrgAC_CONFIG_COMMANDS_PRE(
113546fc0178dSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
113556fc0178dSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
113566fc0178dSmrgUsually this means the macro was only invoked conditionally.]])
113576fc0178dSmrgfi])])
113586fc0178dSmrg
113596fc0178dSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
113606fc0178dSmrg#
113616fc0178dSmrg# This file is free software; the Free Software Foundation
113626fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
113636fc0178dSmrg# with or without modifications, as long as this notice is preserved.
113646fc0178dSmrg
113656fc0178dSmrg
113666fc0178dSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
113676fc0178dSmrg# written in clear, in which case automake, when reading aclocal.m4,
113686fc0178dSmrg# will think it sees a *use*, and therefore will trigger all it's
113696fc0178dSmrg# C support machinery.  Also note that it means that autoscan, seeing
113706fc0178dSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
113716fc0178dSmrg
113726fc0178dSmrg
113736fc0178dSmrg# _AM_DEPENDENCIES(NAME)
113746fc0178dSmrg# ----------------------
113756fc0178dSmrg# See how the compiler implements dependency checking.
113766fc0178dSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
113776fc0178dSmrg# We try a few techniques and use that to set a single cache variable.
113786fc0178dSmrg#
113796fc0178dSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
113806fc0178dSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
113816fc0178dSmrg# dependency, and given that the user is not expected to run this macro,
113826fc0178dSmrg# just rely on AC_PROG_CC.
113836fc0178dSmrgAC_DEFUN([_AM_DEPENDENCIES],
113846fc0178dSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
113856fc0178dSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
113866fc0178dSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
113876fc0178dSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
113886fc0178dSmrg
113896fc0178dSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
113906fc0178dSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
113916fc0178dSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
113926fc0178dSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
113936fc0178dSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
113946fc0178dSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
113956fc0178dSmrg                    [depcc="$$1"   am_compiler_list=])
113966fc0178dSmrg
113976fc0178dSmrgAC_CACHE_CHECK([dependency style of $depcc],
113986fc0178dSmrg               [am_cv_$1_dependencies_compiler_type],
113996fc0178dSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
114006fc0178dSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
114016fc0178dSmrg  # making bogus files that we don't know about and never remove.  For
114026fc0178dSmrg  # instance it was reported that on HP-UX the gcc test will end up
114036fc0178dSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
114046fc0178dSmrg  # in D".
114056fc0178dSmrg  rm -rf conftest.dir
114066fc0178dSmrg  mkdir conftest.dir
114076fc0178dSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
114086fc0178dSmrg  # using a relative directory.
114096fc0178dSmrg  cp "$am_depcomp" conftest.dir
114106fc0178dSmrg  cd conftest.dir
114116fc0178dSmrg  # We will build objects and dependencies in a subdirectory because
114126fc0178dSmrg  # it helps to detect inapplicable dependency modes.  For instance
114136fc0178dSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
114146fc0178dSmrg  # side effect of compilation, but ICC will put the dependencies in
114156fc0178dSmrg  # the current directory while Tru64 will put them in the object
114166fc0178dSmrg  # directory.
114176fc0178dSmrg  mkdir sub
114186fc0178dSmrg
114196fc0178dSmrg  am_cv_$1_dependencies_compiler_type=none
114206fc0178dSmrg  if test "$am_compiler_list" = ""; then
114216fc0178dSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
114226fc0178dSmrg  fi
114236fc0178dSmrg  am__universal=false
114246fc0178dSmrg  m4_case([$1], [CC],
114256fc0178dSmrg    [case " $depcc " in #(
114266fc0178dSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
114276fc0178dSmrg     esac],
114286fc0178dSmrg    [CXX],
114296fc0178dSmrg    [case " $depcc " in #(
114306fc0178dSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
114316fc0178dSmrg     esac])
114326fc0178dSmrg
114336fc0178dSmrg  for depmode in $am_compiler_list; do
114346fc0178dSmrg    # Setup a source with many dependencies, because some compilers
114356fc0178dSmrg    # like to wrap large dependency lists on column 80 (with \), and
114366fc0178dSmrg    # we should not choose a depcomp mode which is confused by this.
114376fc0178dSmrg    #
114386fc0178dSmrg    # We need to recreate these files for each test, as the compiler may
114396fc0178dSmrg    # overwrite some of them when testing with obscure command lines.
114406fc0178dSmrg    # This happens at least with the AIX C compiler.
114416fc0178dSmrg    : > sub/conftest.c
114426fc0178dSmrg    for i in 1 2 3 4 5 6; do
114436fc0178dSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
114446fc0178dSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
114456fc0178dSmrg      # Solaris 10 /bin/sh.
114466fc0178dSmrg      echo '/* dummy */' > sub/conftst$i.h
114476fc0178dSmrg    done
114486fc0178dSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
114496fc0178dSmrg
114506fc0178dSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
114516fc0178dSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
114526fc0178dSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
114536fc0178dSmrg    # versions had trouble with output in subdirs.
114546fc0178dSmrg    am__obj=sub/conftest.${OBJEXT-o}
114556fc0178dSmrg    am__minus_obj="-o $am__obj"
114566fc0178dSmrg    case $depmode in
114576fc0178dSmrg    gcc)
114586fc0178dSmrg      # This depmode causes a compiler race in universal mode.
114596fc0178dSmrg      test "$am__universal" = false || continue
114606fc0178dSmrg      ;;
114616fc0178dSmrg    nosideeffect)
114626fc0178dSmrg      # After this tag, mechanisms are not by side-effect, so they'll
114636fc0178dSmrg      # only be used when explicitly requested.
114646fc0178dSmrg      if test "x$enable_dependency_tracking" = xyes; then
114656fc0178dSmrg	continue
114666fc0178dSmrg      else
114676fc0178dSmrg	break
114686fc0178dSmrg      fi
114696fc0178dSmrg      ;;
114706fc0178dSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
114716fc0178dSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
114726fc0178dSmrg      # not run yet.  These depmodes are late enough in the game, and
114736fc0178dSmrg      # so weak that their functioning should not be impacted.
114746fc0178dSmrg      am__obj=conftest.${OBJEXT-o}
114756fc0178dSmrg      am__minus_obj=
114766fc0178dSmrg      ;;
114776fc0178dSmrg    none) break ;;
114786fc0178dSmrg    esac
114796fc0178dSmrg    if depmode=$depmode \
114806fc0178dSmrg       source=sub/conftest.c object=$am__obj \
114816fc0178dSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
114826fc0178dSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
114836fc0178dSmrg         >/dev/null 2>conftest.err &&
114846fc0178dSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
114856fc0178dSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
114866fc0178dSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
114876fc0178dSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
114886fc0178dSmrg      # icc doesn't choke on unknown options, it will just issue warnings
114896fc0178dSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
114906fc0178dSmrg      # that says an option was ignored or not supported.
114916fc0178dSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
114926fc0178dSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
114936fc0178dSmrg      # The diagnosis changed in icc 8.0:
114946fc0178dSmrg      #   icc: Command line remark: option '-MP' not supported
114956fc0178dSmrg      if (grep 'ignoring option' conftest.err ||
114966fc0178dSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
114976fc0178dSmrg        am_cv_$1_dependencies_compiler_type=$depmode
114986fc0178dSmrg        break
114996fc0178dSmrg      fi
115006fc0178dSmrg    fi
115016fc0178dSmrg  done
115026fc0178dSmrg
115036fc0178dSmrg  cd ..
115046fc0178dSmrg  rm -rf conftest.dir
115056fc0178dSmrgelse
115066fc0178dSmrg  am_cv_$1_dependencies_compiler_type=none
115076fc0178dSmrgfi
115086fc0178dSmrg])
115096fc0178dSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
115106fc0178dSmrgAM_CONDITIONAL([am__fastdep$1], [
115116fc0178dSmrg  test "x$enable_dependency_tracking" != xno \
115126fc0178dSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
115136fc0178dSmrg])
115146fc0178dSmrg
115156fc0178dSmrg
115166fc0178dSmrg# AM_SET_DEPDIR
115176fc0178dSmrg# -------------
115186fc0178dSmrg# Choose a directory name for dependency files.
115196fc0178dSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
115206fc0178dSmrgAC_DEFUN([AM_SET_DEPDIR],
115216fc0178dSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
115226fc0178dSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
115236fc0178dSmrg])
115246fc0178dSmrg
115256fc0178dSmrg
115266fc0178dSmrg# AM_DEP_TRACK
115276fc0178dSmrg# ------------
115286fc0178dSmrgAC_DEFUN([AM_DEP_TRACK],
115296fc0178dSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
115306fc0178dSmrgAS_HELP_STRING(
115316fc0178dSmrg  [--enable-dependency-tracking],
115326fc0178dSmrg  [do not reject slow dependency extractors])
115336fc0178dSmrgAS_HELP_STRING(
115346fc0178dSmrg  [--disable-dependency-tracking],
115356fc0178dSmrg  [speeds up one-time build])])
115366fc0178dSmrgif test "x$enable_dependency_tracking" != xno; then
115376fc0178dSmrg  am_depcomp="$ac_aux_dir/depcomp"
115386fc0178dSmrg  AMDEPBACKSLASH='\'
115396fc0178dSmrg  am__nodep='_no'
115406fc0178dSmrgfi
115416fc0178dSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
115426fc0178dSmrgAC_SUBST([AMDEPBACKSLASH])dnl
115436fc0178dSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
115446fc0178dSmrgAC_SUBST([am__nodep])dnl
115456fc0178dSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
115466fc0178dSmrg])
115476fc0178dSmrg
115486fc0178dSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
115496fc0178dSmrg
115506fc0178dSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
115516fc0178dSmrg#
115526fc0178dSmrg# This file is free software; the Free Software Foundation
115536fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
115546fc0178dSmrg# with or without modifications, as long as this notice is preserved.
115556fc0178dSmrg
115566fc0178dSmrg
115576fc0178dSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
115586fc0178dSmrg# ------------------------------
115596fc0178dSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
115606fc0178dSmrg[{
115616fc0178dSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
115626fc0178dSmrg  # are listed without --file.  Let's play safe and only enable the eval
115636fc0178dSmrg  # if we detect the quoting.
115646fc0178dSmrg  case $CONFIG_FILES in
115656fc0178dSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
115666fc0178dSmrg  *)   set x $CONFIG_FILES ;;
115676fc0178dSmrg  esac
115686fc0178dSmrg  shift
115696fc0178dSmrg  for mf
115706fc0178dSmrg  do
115716fc0178dSmrg    # Strip MF so we end up with the name of the file.
115726fc0178dSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
115736fc0178dSmrg    # Check whether this is an Automake generated Makefile or not.
115746fc0178dSmrg    # We used to match only the files named 'Makefile.in', but
115756fc0178dSmrg    # some people rename them; so instead we look at the file content.
115766fc0178dSmrg    # Grep'ing the first line is not enough: some people post-process
115776fc0178dSmrg    # each Makefile.in and add a new line on top of each file to say so.
115786fc0178dSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
115796fc0178dSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
115806fc0178dSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
115816fc0178dSmrg      dirpart=`AS_DIRNAME("$mf")`
115826fc0178dSmrg    else
115836fc0178dSmrg      continue
115846fc0178dSmrg    fi
115856fc0178dSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
115866fc0178dSmrg    # from the Makefile without running 'make'.
115876fc0178dSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
115886fc0178dSmrg    test -z "$DEPDIR" && continue
115896fc0178dSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
115906fc0178dSmrg    test -z "$am__include" && continue
115916fc0178dSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
115926fc0178dSmrg    # Find all dependency output files, they are included files with
115936fc0178dSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
115946fc0178dSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
115956fc0178dSmrg    # expansion.
115966fc0178dSmrg    for file in `sed -n "
115976fc0178dSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
115986fc0178dSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
115996fc0178dSmrg      # Make sure the directory exists.
116006fc0178dSmrg      test -f "$dirpart/$file" && continue
116016fc0178dSmrg      fdir=`AS_DIRNAME(["$file"])`
116026fc0178dSmrg      AS_MKDIR_P([$dirpart/$fdir])
116036fc0178dSmrg      # echo "creating $dirpart/$file"
116046fc0178dSmrg      echo '# dummy' > "$dirpart/$file"
116056fc0178dSmrg    done
116066fc0178dSmrg  done
116076fc0178dSmrg}
116086fc0178dSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
116096fc0178dSmrg
116106fc0178dSmrg
116116fc0178dSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
116126fc0178dSmrg# -----------------------------
116136fc0178dSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
116146fc0178dSmrg#
116156fc0178dSmrg# This code is only required when automatic dependency tracking
116166fc0178dSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
116176fc0178dSmrg# need in order to bootstrap the dependency handling code.
116186fc0178dSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
116196fc0178dSmrg[AC_CONFIG_COMMANDS([depfiles],
116206fc0178dSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
116216fc0178dSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
116226fc0178dSmrg])
116236fc0178dSmrg
116246fc0178dSmrg# Do all the work for Automake.                             -*- Autoconf -*-
116256fc0178dSmrg
116266fc0178dSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
116276fc0178dSmrg#
116286fc0178dSmrg# This file is free software; the Free Software Foundation
116296fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
116306fc0178dSmrg# with or without modifications, as long as this notice is preserved.
116316fc0178dSmrg
116326fc0178dSmrg# This macro actually does too much.  Some checks are only needed if
116336fc0178dSmrg# your package does certain things.  But this isn't really a big deal.
116346fc0178dSmrg
116356fc0178dSmrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
116366fc0178dSmrgm4_define([AC_PROG_CC],
116376fc0178dSmrgm4_defn([AC_PROG_CC])
116386fc0178dSmrg[_AM_PROG_CC_C_O
116396fc0178dSmrg])
116406fc0178dSmrg
116416fc0178dSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
116426fc0178dSmrg# AM_INIT_AUTOMAKE([OPTIONS])
116436fc0178dSmrg# -----------------------------------------------
116446fc0178dSmrg# The call with PACKAGE and VERSION arguments is the old style
116456fc0178dSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
116466fc0178dSmrg# and VERSION should now be passed to AC_INIT and removed from
116476fc0178dSmrg# the call to AM_INIT_AUTOMAKE.
116486fc0178dSmrg# We support both call styles for the transition.  After
116496fc0178dSmrg# the next Automake release, Autoconf can make the AC_INIT
116506fc0178dSmrg# arguments mandatory, and then we can depend on a new Autoconf
116516fc0178dSmrg# release and drop the old call support.
116526fc0178dSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
116536fc0178dSmrg[AC_PREREQ([2.65])dnl
116546fc0178dSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
116556fc0178dSmrgdnl the ones we care about.
116566fc0178dSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
116576fc0178dSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
116586fc0178dSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
116596fc0178dSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
116606fc0178dSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
116616fc0178dSmrg  # is not polluted with repeated "-I."
116626fc0178dSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
116636fc0178dSmrg  # test to see if srcdir already configured
116646fc0178dSmrg  if test -f $srcdir/config.status; then
116656fc0178dSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
116666fc0178dSmrg  fi
116676fc0178dSmrgfi
116686fc0178dSmrg
116696fc0178dSmrg# test whether we have cygpath
116706fc0178dSmrgif test -z "$CYGPATH_W"; then
116716fc0178dSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
116726fc0178dSmrg    CYGPATH_W='cygpath -w'
116736fc0178dSmrg  else
116746fc0178dSmrg    CYGPATH_W=echo
11675862f5301Smrg  fi
11676862f5301Smrgfi
116776fc0178dSmrgAC_SUBST([CYGPATH_W])
11678ff559fabSmrg
116796fc0178dSmrg# Define the identity of the package.
116806fc0178dSmrgdnl Distinguish between old-style and new-style calls.
116816fc0178dSmrgm4_ifval([$2],
116826fc0178dSmrg[AC_DIAGNOSE([obsolete],
116836fc0178dSmrg             [$0: two- and three-arguments forms are deprecated.])
116846fc0178dSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
116856fc0178dSmrg AC_SUBST([PACKAGE], [$1])dnl
116866fc0178dSmrg AC_SUBST([VERSION], [$2])],
116876fc0178dSmrg[_AM_SET_OPTIONS([$1])dnl
116886fc0178dSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
116896fc0178dSmrgm4_if(
116906fc0178dSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
116916fc0178dSmrg  [ok:ok],,
116926fc0178dSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
116936fc0178dSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
116946fc0178dSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
11695ff559fabSmrg
116966fc0178dSmrg_AM_IF_OPTION([no-define],,
116976fc0178dSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
116986fc0178dSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
11699ff559fabSmrg
117006fc0178dSmrg# Some tools Automake needs.
117016fc0178dSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
117026fc0178dSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
117036fc0178dSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
117046fc0178dSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
117056fc0178dSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
117066fc0178dSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
117076fc0178dSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
117086fc0178dSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
117096fc0178dSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
117106fc0178dSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
117116fc0178dSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
117126fc0178dSmrg# dies out for good.  For more background, see:
117136fc0178dSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
117146fc0178dSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
117156fc0178dSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
117166fc0178dSmrg# We need awk for the "check" target (and possibly the TAP driver).  The
117176fc0178dSmrg# system "awk" is bad on some platforms.
117186fc0178dSmrgAC_REQUIRE([AC_PROG_AWK])dnl
117196fc0178dSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
117206fc0178dSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
117216fc0178dSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
117226fc0178dSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
117236fc0178dSmrg			     [_AM_PROG_TAR([v7])])])
117246fc0178dSmrg_AM_IF_OPTION([no-dependencies],,
117256fc0178dSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
117266fc0178dSmrg		  [_AM_DEPENDENCIES([CC])],
117276fc0178dSmrg		  [m4_define([AC_PROG_CC],
117286fc0178dSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
117296fc0178dSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
117306fc0178dSmrg		  [_AM_DEPENDENCIES([CXX])],
117316fc0178dSmrg		  [m4_define([AC_PROG_CXX],
117326fc0178dSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
117336fc0178dSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
117346fc0178dSmrg		  [_AM_DEPENDENCIES([OBJC])],
117356fc0178dSmrg		  [m4_define([AC_PROG_OBJC],
117366fc0178dSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
117376fc0178dSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
117386fc0178dSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
117396fc0178dSmrg		  [m4_define([AC_PROG_OBJCXX],
117406fc0178dSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
117416fc0178dSmrg])
117426fc0178dSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
117436fc0178dSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
117446fc0178dSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
117456fc0178dSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
117466fc0178dSmrgAC_CONFIG_COMMANDS_PRE(dnl
117476fc0178dSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
117486fc0178dSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
11749ff559fabSmrg
117506fc0178dSmrg# POSIX will say in a future version that running "rm -f" with no argument
117516fc0178dSmrg# is OK; and we want to be able to make that assumption in our Makefile
117526fc0178dSmrg# recipes.  So use an aggressive probe to check that the usage we want is
117536fc0178dSmrg# actually supported "in the wild" to an acceptable degree.
117546fc0178dSmrg# See automake bug#10828.
117556fc0178dSmrg# To make any issue more visible, cause the running configure to be aborted
117566fc0178dSmrg# by default if the 'rm' program in use doesn't match our expectations; the
117576fc0178dSmrg# user can still override this though.
117586fc0178dSmrgif rm -f && rm -fr && rm -rf; then : OK; else
117596fc0178dSmrg  cat >&2 <<'END'
117606fc0178dSmrgOops!
11761ff559fabSmrg
117626fc0178dSmrgYour 'rm' program seems unable to run without file operands specified
117636fc0178dSmrgon the command line, even when the '-f' option is present.  This is contrary
117646fc0178dSmrgto the behaviour of most rm programs out there, and not conforming with
117656fc0178dSmrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
11766ff559fabSmrg
117676fc0178dSmrgPlease tell bug-automake@gnu.org about your system, including the value
117686fc0178dSmrgof your $PATH and any error possibly output before this message.  This
117696fc0178dSmrgcan help us improve future automake versions.
11770ff559fabSmrg
117716fc0178dSmrgEND
117726fc0178dSmrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
117736fc0178dSmrg    echo 'Configuration will proceed anyway, since you have set the' >&2
117746fc0178dSmrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
117756fc0178dSmrg    echo >&2
117766fc0178dSmrg  else
117776fc0178dSmrg    cat >&2 <<'END'
117786fc0178dSmrgAborting the configuration process, to ensure you take notice of the issue.
11779ff559fabSmrg
117806fc0178dSmrgYou can download and install GNU coreutils to get an 'rm' implementation
117816fc0178dSmrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
11782ff559fabSmrg
117836fc0178dSmrgIf you want to complete the configuration process using your problematic
117846fc0178dSmrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
117856fc0178dSmrgto "yes", and re-run configure.
117867a3b38f7Smrg
117876fc0178dSmrgEND
117886fc0178dSmrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
117896fc0178dSmrg  fi
11790862f5301Smrgfi
117916fc0178dSmrgdnl The trailing newline in this macro's definition is deliberate, for
117926fc0178dSmrgdnl backward compatibility and to allow trailing 'dnl'-style comments
117936fc0178dSmrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
117946fc0178dSmrg])
117957a3b38f7Smrg
117966fc0178dSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
117976fc0178dSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
117986fc0178dSmrgdnl mangled by Autoconf and run in a shell conditional statement.
117996fc0178dSmrgm4_define([_AC_COMPILER_EXEEXT],
118006fc0178dSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
11801ff559fabSmrg
118026fc0178dSmrg# When config.status generates a header, we must update the stamp-h file.
118036fc0178dSmrg# This file resides in the same directory as the config header
118046fc0178dSmrg# that is generated.  The stamp files are numbered to have different names.
11805ff559fabSmrg
118066fc0178dSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
118076fc0178dSmrg# loop where config.status creates the headers, so we can generate
118086fc0178dSmrg# our stamp files there.
118096fc0178dSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
118106fc0178dSmrg[# Compute $1's index in $config_headers.
118116fc0178dSmrg_am_arg=$1
118126fc0178dSmrg_am_stamp_count=1
118136fc0178dSmrgfor _am_header in $config_headers :; do
118146fc0178dSmrg  case $_am_header in
118156fc0178dSmrg    $_am_arg | $_am_arg:* )
118166fc0178dSmrg      break ;;
118176fc0178dSmrg    * )
118186fc0178dSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
118196fc0178dSmrg  esac
118206fc0178dSmrgdone
118216fc0178dSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
118226fc0178dSmrg
118236fc0178dSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
11824862f5301Smrg#
118256fc0178dSmrg# This file is free software; the Free Software Foundation
118266fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
118276fc0178dSmrg# with or without modifications, as long as this notice is preserved.
118287a3b38f7Smrg
118296fc0178dSmrg# AM_PROG_INSTALL_SH
118306fc0178dSmrg# ------------------
118316fc0178dSmrg# Define $install_sh.
118326fc0178dSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
118336fc0178dSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
118346fc0178dSmrgif test x"${install_sh+set}" != xset; then
118356fc0178dSmrg  case $am_aux_dir in
118366fc0178dSmrg  *\ * | *\	*)
118376fc0178dSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
118386fc0178dSmrg  *)
118396fc0178dSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
118406fc0178dSmrg  esac
118416fc0178dSmrgfi
118426fc0178dSmrgAC_SUBST([install_sh])])
118437a3b38f7Smrg
118446fc0178dSmrg# Copyright (C) 2003-2014 Free Software Foundation, Inc.
118456fc0178dSmrg#
118466fc0178dSmrg# This file is free software; the Free Software Foundation
118476fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
118486fc0178dSmrg# with or without modifications, as long as this notice is preserved.
118497a3b38f7Smrg
118506fc0178dSmrg# Check whether the underlying file-system supports filenames
118516fc0178dSmrg# with a leading dot.  For instance MS-DOS doesn't.
118526fc0178dSmrgAC_DEFUN([AM_SET_LEADING_DOT],
118536fc0178dSmrg[rm -rf .tst 2>/dev/null
118546fc0178dSmrgmkdir .tst 2>/dev/null
118556fc0178dSmrgif test -d .tst; then
118566fc0178dSmrg  am__leading_dot=.
11857862f5301Smrgelse
118586fc0178dSmrg  am__leading_dot=_
11859862f5301Smrgfi
118606fc0178dSmrgrmdir .tst 2>/dev/null
118616fc0178dSmrgAC_SUBST([am__leading_dot])])
11862ff559fabSmrg
118636fc0178dSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
11864ff559fabSmrg
118656fc0178dSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
11866862f5301Smrg#
118676fc0178dSmrg# This file is free software; the Free Software Foundation
118686fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
118696fc0178dSmrg# with or without modifications, as long as this notice is preserved.
118707a3b38f7Smrg
118716fc0178dSmrg# AM_MAKE_INCLUDE()
118726fc0178dSmrg# -----------------
118736fc0178dSmrg# Check to see how make treats includes.
118746fc0178dSmrgAC_DEFUN([AM_MAKE_INCLUDE],
118756fc0178dSmrg[am_make=${MAKE-make}
118766fc0178dSmrgcat > confinc << 'END'
118776fc0178dSmrgam__doit:
118786fc0178dSmrg	@echo this is the am__doit target
118796fc0178dSmrg.PHONY: am__doit
118806fc0178dSmrgEND
118816fc0178dSmrg# If we don't find an include directive, just comment out the code.
118826fc0178dSmrgAC_MSG_CHECKING([for style of include used by $am_make])
118836fc0178dSmrgam__include="#"
118846fc0178dSmrgam__quote=
118856fc0178dSmrg_am_result=none
118866fc0178dSmrg# First try GNU make style include.
118876fc0178dSmrgecho "include confinc" > confmf
118886fc0178dSmrg# Ignore all kinds of additional output from 'make'.
118896fc0178dSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
118906fc0178dSmrg*the\ am__doit\ target*)
118916fc0178dSmrg  am__include=include
118926fc0178dSmrg  am__quote=
118936fc0178dSmrg  _am_result=GNU
118946fc0178dSmrg  ;;
118956fc0178dSmrgesac
118966fc0178dSmrg# Now try BSD make style include.
118976fc0178dSmrgif test "$am__include" = "#"; then
118986fc0178dSmrg   echo '.include "confinc"' > confmf
118996fc0178dSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
119006fc0178dSmrg   *the\ am__doit\ target*)
119016fc0178dSmrg     am__include=.include
119026fc0178dSmrg     am__quote="\""
119036fc0178dSmrg     _am_result=BSD
119046fc0178dSmrg     ;;
119056fc0178dSmrg   esac
11906862f5301Smrgfi
119076fc0178dSmrgAC_SUBST([am__include])
119086fc0178dSmrgAC_SUBST([am__quote])
119096fc0178dSmrgAC_MSG_RESULT([$_am_result])
119106fc0178dSmrgrm -f confinc confmf
119116fc0178dSmrg])
1191244dda7b2Smrg
119136fc0178dSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1191444dda7b2Smrg
119156fc0178dSmrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
11916862f5301Smrg#
119176fc0178dSmrg# This file is free software; the Free Software Foundation
119186fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
119196fc0178dSmrg# with or without modifications, as long as this notice is preserved.
119207a3b38f7Smrg
119216fc0178dSmrg# AM_MISSING_PROG(NAME, PROGRAM)
119226fc0178dSmrg# ------------------------------
119236fc0178dSmrgAC_DEFUN([AM_MISSING_PROG],
119246fc0178dSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
119256fc0178dSmrg$1=${$1-"${am_missing_run}$2"}
119266fc0178dSmrgAC_SUBST($1)])
11927862f5301Smrg
119286fc0178dSmrg# AM_MISSING_HAS_RUN
119296fc0178dSmrg# ------------------
119306fc0178dSmrg# Define MISSING if not defined so far and test if it is modern enough.
119316fc0178dSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
119326fc0178dSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
119336fc0178dSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
119346fc0178dSmrgAC_REQUIRE_AUX_FILE([missing])dnl
119356fc0178dSmrgif test x"${MISSING+set}" != xset; then
119366fc0178dSmrg  case $am_aux_dir in
119376fc0178dSmrg  *\ * | *\	*)
119386fc0178dSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
119396fc0178dSmrg  *)
119406fc0178dSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
119416fc0178dSmrg  esac
11942862f5301Smrgfi
119436fc0178dSmrg# Use eval to expand $SHELL
119446fc0178dSmrgif eval "$MISSING --is-lightweight"; then
119456fc0178dSmrg  am_missing_run="$MISSING "
119466fc0178dSmrgelse
119476fc0178dSmrg  am_missing_run=
119486fc0178dSmrg  AC_MSG_WARN(['missing' script is too old or missing])
11949862f5301Smrgfi
119506fc0178dSmrg])
119517a3b38f7Smrg
119526fc0178dSmrg# Helper functions for option handling.                     -*- Autoconf -*-
11953862f5301Smrg
119546fc0178dSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
119556fc0178dSmrg#
119566fc0178dSmrg# This file is free software; the Free Software Foundation
119576fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
119586fc0178dSmrg# with or without modifications, as long as this notice is preserved.
11959862f5301Smrg
119606fc0178dSmrg# _AM_MANGLE_OPTION(NAME)
119616fc0178dSmrg# -----------------------
119626fc0178dSmrgAC_DEFUN([_AM_MANGLE_OPTION],
119636fc0178dSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
11964862f5301Smrg
119656fc0178dSmrg# _AM_SET_OPTION(NAME)
119666fc0178dSmrg# --------------------
119676fc0178dSmrg# Set option NAME.  Presently that only means defining a flag for this option.
119686fc0178dSmrgAC_DEFUN([_AM_SET_OPTION],
119696fc0178dSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
11970862f5301Smrg
119716fc0178dSmrg# _AM_SET_OPTIONS(OPTIONS)
119726fc0178dSmrg# ------------------------
119736fc0178dSmrg# OPTIONS is a space-separated list of Automake options.
119746fc0178dSmrgAC_DEFUN([_AM_SET_OPTIONS],
119756fc0178dSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
11976862f5301Smrg
119776fc0178dSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
119786fc0178dSmrg# -------------------------------------------
119796fc0178dSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
119806fc0178dSmrgAC_DEFUN([_AM_IF_OPTION],
119816fc0178dSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
11982ff559fabSmrg
119836fc0178dSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
11984862f5301Smrg#
119856fc0178dSmrg# This file is free software; the Free Software Foundation
119866fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
119876fc0178dSmrg# with or without modifications, as long as this notice is preserved.
11988862f5301Smrg
119896fc0178dSmrg# _AM_PROG_CC_C_O
119906fc0178dSmrg# ---------------
119916fc0178dSmrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
119926fc0178dSmrg# to automatically call this.
119936fc0178dSmrgAC_DEFUN([_AM_PROG_CC_C_O],
119946fc0178dSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
119956fc0178dSmrgAC_REQUIRE_AUX_FILE([compile])dnl
119966fc0178dSmrgAC_LANG_PUSH([C])dnl
119976fc0178dSmrgAC_CACHE_CHECK(
119986fc0178dSmrg  [whether $CC understands -c and -o together],
119996fc0178dSmrg  [am_cv_prog_cc_c_o],
120006fc0178dSmrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
120016fc0178dSmrg  # Make sure it works both with $CC and with simple cc.
120026fc0178dSmrg  # Following AC_PROG_CC_C_O, we do the test twice because some
120036fc0178dSmrg  # compilers refuse to overwrite an existing .o file with -o,
120046fc0178dSmrg  # though they will create one.
120056fc0178dSmrg  am_cv_prog_cc_c_o=yes
120066fc0178dSmrg  for am_i in 1 2; do
120076fc0178dSmrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
120086fc0178dSmrg         && test -f conftest2.$ac_objext; then
120096fc0178dSmrg      : OK
120106fc0178dSmrg    else
120116fc0178dSmrg      am_cv_prog_cc_c_o=no
120126fc0178dSmrg      break
120136fc0178dSmrg    fi
120146fc0178dSmrg  done
120156fc0178dSmrg  rm -f core conftest*
120166fc0178dSmrg  unset am_i])
120176fc0178dSmrgif test "$am_cv_prog_cc_c_o" != yes; then
120186fc0178dSmrg   # Losing compiler, so override with the script.
120196fc0178dSmrg   # FIXME: It is wrong to rewrite CC.
120206fc0178dSmrg   # But if we don't then we get into trouble of one sort or another.
120216fc0178dSmrg   # A longer-term fix would be to have automake use am__CC in this case,
120226fc0178dSmrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
120236fc0178dSmrg   CC="$am_aux_dir/compile $CC"
12024862f5301Smrgfi
120256fc0178dSmrgAC_LANG_POP([C])])
12026ff559fabSmrg
120276fc0178dSmrg# For backward compatibility.
120286fc0178dSmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
120296fc0178dSmrg
120306fc0178dSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
120316fc0178dSmrg#
120326fc0178dSmrg# This file is free software; the Free Software Foundation
120336fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
120346fc0178dSmrg# with or without modifications, as long as this notice is preserved.
120356fc0178dSmrg
120366fc0178dSmrg# AM_RUN_LOG(COMMAND)
120376fc0178dSmrg# -------------------
120386fc0178dSmrg# Run COMMAND, save the exit status in ac_status, and log it.
120396fc0178dSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
120406fc0178dSmrgAC_DEFUN([AM_RUN_LOG],
120416fc0178dSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
120426fc0178dSmrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
120436fc0178dSmrg   ac_status=$?
120446fc0178dSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
120456fc0178dSmrg   (exit $ac_status); }])
12046862f5301Smrg
120476fc0178dSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
12048ff559fabSmrg
120496fc0178dSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
120506fc0178dSmrg#
120516fc0178dSmrg# This file is free software; the Free Software Foundation
120526fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
120536fc0178dSmrg# with or without modifications, as long as this notice is preserved.
12054862f5301Smrg
120556fc0178dSmrg# AM_SANITY_CHECK
120566fc0178dSmrg# ---------------
120576fc0178dSmrgAC_DEFUN([AM_SANITY_CHECK],
120586fc0178dSmrg[AC_MSG_CHECKING([whether build environment is sane])
120596fc0178dSmrg# Reject unsafe characters in $srcdir or the absolute working directory
120606fc0178dSmrg# name.  Accept space and tab only in the latter.
120616fc0178dSmrgam_lf='
120626fc0178dSmrg'
120636fc0178dSmrgcase `pwd` in
120646fc0178dSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
120656fc0178dSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
120666fc0178dSmrgesac
120676fc0178dSmrgcase $srcdir in
120686fc0178dSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
120696fc0178dSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
120706fc0178dSmrgesac
12071862f5301Smrg
120726fc0178dSmrg# Do 'set' in a subshell so we don't clobber the current shell's
120736fc0178dSmrg# arguments.  Must try -L first in case configure is actually a
120746fc0178dSmrg# symlink; some systems play weird games with the mod time of symlinks
120756fc0178dSmrg# (eg FreeBSD returns the mod time of the symlink's containing
120766fc0178dSmrg# directory).
120776fc0178dSmrgif (
120786fc0178dSmrg   am_has_slept=no
120796fc0178dSmrg   for am_try in 1 2; do
120806fc0178dSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
120816fc0178dSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
120826fc0178dSmrg     if test "$[*]" = "X"; then
120836fc0178dSmrg	# -L didn't work.
120846fc0178dSmrg	set X `ls -t "$srcdir/configure" conftest.file`
120856fc0178dSmrg     fi
120866fc0178dSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
120876fc0178dSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
12088862f5301Smrg
120896fc0178dSmrg	# If neither matched, then we have a broken ls.  This can happen
120906fc0178dSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
120916fc0178dSmrg	# broken ls alias from the environment.  This has actually
120926fc0178dSmrg	# happened.  Such a system could not be considered "sane".
120936fc0178dSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
120946fc0178dSmrg  alias in your environment])
120956fc0178dSmrg     fi
120966fc0178dSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
120976fc0178dSmrg       break
120986fc0178dSmrg     fi
120996fc0178dSmrg     # Just in case.
121006fc0178dSmrg     sleep 1
121016fc0178dSmrg     am_has_slept=yes
121026fc0178dSmrg   done
121036fc0178dSmrg   test "$[2]" = conftest.file
121046fc0178dSmrg   )
121056fc0178dSmrgthen
121066fc0178dSmrg   # Ok.
121076fc0178dSmrg   :
12108862f5301Smrgelse
121096fc0178dSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
121106fc0178dSmrgCheck your system clock])
12111862f5301Smrgfi
121126fc0178dSmrgAC_MSG_RESULT([yes])
121136fc0178dSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
121146fc0178dSmrg# generated files are strictly newer.
121156fc0178dSmrgam_sleep_pid=
121166fc0178dSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
121176fc0178dSmrg  ( sleep 1 ) &
121186fc0178dSmrg  am_sleep_pid=$!
121196fc0178dSmrgfi
121206fc0178dSmrgAC_CONFIG_COMMANDS_PRE(
121216fc0178dSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
121226fc0178dSmrg   if test -n "$am_sleep_pid"; then
121236fc0178dSmrg     # Hide warnings about reused PIDs.
121246fc0178dSmrg     wait $am_sleep_pid 2>/dev/null
121256fc0178dSmrg   fi
121266fc0178dSmrg   AC_MSG_RESULT([done])])
121276fc0178dSmrgrm -f conftest.file
121286fc0178dSmrg])
1212944dda7b2Smrg
121306fc0178dSmrg# Copyright (C) 2009-2014 Free Software Foundation, Inc.
12131862f5301Smrg#
121326fc0178dSmrg# This file is free software; the Free Software Foundation
121336fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
121346fc0178dSmrg# with or without modifications, as long as this notice is preserved.
12135ff559fabSmrg
121366fc0178dSmrg# AM_SILENT_RULES([DEFAULT])
121376fc0178dSmrg# --------------------------
121386fc0178dSmrg# Enable less verbose build rules; with the default set to DEFAULT
121396fc0178dSmrg# ("yes" being less verbose, "no" or empty being verbose).
121406fc0178dSmrgAC_DEFUN([AM_SILENT_RULES],
121416fc0178dSmrg[AC_ARG_ENABLE([silent-rules], [dnl
121426fc0178dSmrgAS_HELP_STRING(
121436fc0178dSmrg  [--enable-silent-rules],
121446fc0178dSmrg  [less verbose build output (undo: "make V=1")])
121456fc0178dSmrgAS_HELP_STRING(
121466fc0178dSmrg  [--disable-silent-rules],
121476fc0178dSmrg  [verbose build output (undo: "make V=0")])dnl
121486fc0178dSmrg])
121496fc0178dSmrgcase $enable_silent_rules in @%:@ (((
121506fc0178dSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
121516fc0178dSmrg   no) AM_DEFAULT_VERBOSITY=1;;
121526fc0178dSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
121536fc0178dSmrgesac
121546fc0178dSmrgdnl
121556fc0178dSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
121566fc0178dSmrgdnl do not support nested variable expansions.
121576fc0178dSmrgdnl See automake bug#9928 and bug#10237.
121586fc0178dSmrgam_make=${MAKE-make}
121596fc0178dSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
121606fc0178dSmrg   [am_cv_make_support_nested_variables],
121616fc0178dSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
121626fc0178dSmrgBAR0=false
121636fc0178dSmrgBAR1=true
121646fc0178dSmrgV=1
121656fc0178dSmrgam__doit:
121666fc0178dSmrg	@$(TRUE)
121676fc0178dSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
121686fc0178dSmrg  am_cv_make_support_nested_variables=yes
121696fc0178dSmrgelse
121706fc0178dSmrg  am_cv_make_support_nested_variables=no
121716fc0178dSmrgfi])
121726fc0178dSmrgif test $am_cv_make_support_nested_variables = yes; then
121736fc0178dSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
121746fc0178dSmrg  AM_V='$(V)'
121756fc0178dSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
121766fc0178dSmrgelse
121776fc0178dSmrg  AM_V=$AM_DEFAULT_VERBOSITY
121786fc0178dSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
121796fc0178dSmrgfi
121806fc0178dSmrgAC_SUBST([AM_V])dnl
121816fc0178dSmrgAM_SUBST_NOTMAKE([AM_V])dnl
121826fc0178dSmrgAC_SUBST([AM_DEFAULT_V])dnl
121836fc0178dSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
121846fc0178dSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
121856fc0178dSmrgAM_BACKSLASH='\'
121866fc0178dSmrgAC_SUBST([AM_BACKSLASH])dnl
121876fc0178dSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
121886fc0178dSmrg])
121896fc0178dSmrg
121906fc0178dSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
12191862f5301Smrg#
121926fc0178dSmrg# This file is free software; the Free Software Foundation
121936fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
121946fc0178dSmrg# with or without modifications, as long as this notice is preserved.
121956fc0178dSmrg
121966fc0178dSmrg# AM_PROG_INSTALL_STRIP
121976fc0178dSmrg# ---------------------
121986fc0178dSmrg# One issue with vendor 'install' (even GNU) is that you can't
121996fc0178dSmrg# specify the program used to strip binaries.  This is especially
122006fc0178dSmrg# annoying in cross-compiling environments, where the build's strip
122016fc0178dSmrg# is unlikely to handle the host's binaries.
122026fc0178dSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
122036fc0178dSmrg# always use install-sh in "make install-strip", and initialize
122046fc0178dSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
122056fc0178dSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
122066fc0178dSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
122076fc0178dSmrg# Installed binaries are usually stripped using 'strip' when the user
122086fc0178dSmrg# run "make install-strip".  However 'strip' might not be the right
122096fc0178dSmrg# tool to use in cross-compilation environments, therefore Automake
122106fc0178dSmrg# will honor the 'STRIP' environment variable to overrule this program.
122116fc0178dSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
122126fc0178dSmrgif test "$cross_compiling" != no; then
122136fc0178dSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
122146fc0178dSmrgfi
122156fc0178dSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
122166fc0178dSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
122177a3b38f7Smrg
122186fc0178dSmrg# Copyright (C) 2006-2014 Free Software Foundation, Inc.
122196fc0178dSmrg#
122206fc0178dSmrg# This file is free software; the Free Software Foundation
122216fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
122226fc0178dSmrg# with or without modifications, as long as this notice is preserved.
12223ff559fabSmrg
122246fc0178dSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
122256fc0178dSmrg# ---------------------------
122266fc0178dSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
122276fc0178dSmrg# This macro is traced by Automake.
122286fc0178dSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1222944dda7b2Smrg
122306fc0178dSmrg# AM_SUBST_NOTMAKE(VARIABLE)
122316fc0178dSmrg# --------------------------
122326fc0178dSmrg# Public sister of _AM_SUBST_NOTMAKE.
122336fc0178dSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1223444dda7b2Smrg
122356fc0178dSmrg# Check how to create a tarball.                            -*- Autoconf -*-
12236ff559fabSmrg
122376fc0178dSmrg# Copyright (C) 2004-2014 Free Software Foundation, Inc.
122386fc0178dSmrg#
122396fc0178dSmrg# This file is free software; the Free Software Foundation
122406fc0178dSmrg# gives unlimited permission to copy and/or distribute it,
122416fc0178dSmrg# with or without modifications, as long as this notice is preserved.
12242ff559fabSmrg
122436fc0178dSmrg# _AM_PROG_TAR(FORMAT)
12244862f5301Smrg# --------------------
122456fc0178dSmrg# Check how to create a tarball in format FORMAT.
122466fc0178dSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
122477a3b38f7Smrg#
122486fc0178dSmrg# Substitute a variable $(am__tar) that is a command
122496fc0178dSmrg# writing to stdout a FORMAT-tarball containing the directory
122506fc0178dSmrg# $tardir.
122516fc0178dSmrg#     tardir=directory && $(am__tar) > result.tar
122527a3b38f7Smrg#
122536fc0178dSmrg# Substitute a variable $(am__untar) that extract such
122546fc0178dSmrg# a tarball read from stdin.
122556fc0178dSmrg#     $(am__untar) < result.tar
1225644dda7b2Smrg#
122576fc0178dSmrgAC_DEFUN([_AM_PROG_TAR],
122586fc0178dSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
122596fc0178dSmrg# in the wild :-(  We should find a proper way to deprecate it ...
122606fc0178dSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
1226144dda7b2Smrg
122626fc0178dSmrg# We'll loop over all known methods to create a tar archive until one works.
122636fc0178dSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
12264fc544a13Smrg
122656fc0178dSmrgm4_if([$1], [v7],
122666fc0178dSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1226744dda7b2Smrg
122686fc0178dSmrg  [m4_case([$1],
122696fc0178dSmrg    [ustar],
122706fc0178dSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
122716fc0178dSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
122726fc0178dSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
122736fc0178dSmrg      # and bug#13588).
122746fc0178dSmrg      am_max_uid=2097151 # 2^21 - 1
122756fc0178dSmrg      am_max_gid=$am_max_uid
122766fc0178dSmrg      # The $UID and $GID variables are not portable, so we need to resort
122776fc0178dSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
122786fc0178dSmrg      # below are definitely unexpected, so allow the users to see them
122796fc0178dSmrg      # (that is, avoid stderr redirection).
122806fc0178dSmrg      am_uid=`id -u || echo unknown`
122816fc0178dSmrg      am_gid=`id -g || echo unknown`
122826fc0178dSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
122836fc0178dSmrg      if test $am_uid -le $am_max_uid; then
122846fc0178dSmrg         AC_MSG_RESULT([yes])
122856fc0178dSmrg      else
122866fc0178dSmrg         AC_MSG_RESULT([no])
122876fc0178dSmrg         _am_tools=none
122886fc0178dSmrg      fi
122896fc0178dSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
122906fc0178dSmrg      if test $am_gid -le $am_max_gid; then
122916fc0178dSmrg         AC_MSG_RESULT([yes])
122926fc0178dSmrg      else
122936fc0178dSmrg        AC_MSG_RESULT([no])
122946fc0178dSmrg        _am_tools=none
122956fc0178dSmrg      fi],
122966fc0178dSmrg
122976fc0178dSmrg  [pax],
122986fc0178dSmrg    [],
122996fc0178dSmrg
123006fc0178dSmrg  [m4_fatal([Unknown tar format])])
123016fc0178dSmrg
123026fc0178dSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
123036fc0178dSmrg
123046fc0178dSmrg  # Go ahead even if we have the value already cached.  We do so because we
123056fc0178dSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
123066fc0178dSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
123076fc0178dSmrg
123086fc0178dSmrg  for _am_tool in $_am_tools; do
123096fc0178dSmrg    case $_am_tool in
123106fc0178dSmrg    gnutar)
123116fc0178dSmrg      for _am_tar in tar gnutar gtar; do
123126fc0178dSmrg        AM_RUN_LOG([$_am_tar --version]) && break
123136fc0178dSmrg      done
123146fc0178dSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
123156fc0178dSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
123166fc0178dSmrg      am__untar="$_am_tar -xf -"
123176fc0178dSmrg      ;;
123186fc0178dSmrg    plaintar)
123196fc0178dSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
123206fc0178dSmrg      # ustar tarball either.
123216fc0178dSmrg      (tar --version) >/dev/null 2>&1 && continue
123226fc0178dSmrg      am__tar='tar chf - "$$tardir"'
123236fc0178dSmrg      am__tar_='tar chf - "$tardir"'
123246fc0178dSmrg      am__untar='tar xf -'
123256fc0178dSmrg      ;;
123266fc0178dSmrg    pax)
123276fc0178dSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
123286fc0178dSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
123296fc0178dSmrg      am__untar='pax -r'
123306fc0178dSmrg      ;;
123316fc0178dSmrg    cpio)
123326fc0178dSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
123336fc0178dSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
123346fc0178dSmrg      am__untar='cpio -i -H $1 -d'
123356fc0178dSmrg      ;;
123366fc0178dSmrg    none)
123376fc0178dSmrg      am__tar=false
123386fc0178dSmrg      am__tar_=false
123396fc0178dSmrg      am__untar=false
123406fc0178dSmrg      ;;
123416fc0178dSmrg    esac
123426fc0178dSmrg
123436fc0178dSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
123446fc0178dSmrg    # and am__untar set.
123456fc0178dSmrg    test -n "${am_cv_prog_tar_$1}" && break
123466fc0178dSmrg
123476fc0178dSmrg    # tar/untar a dummy directory, and stop if the command works.
123486fc0178dSmrg    rm -rf conftest.dir
123496fc0178dSmrg    mkdir conftest.dir
123506fc0178dSmrg    echo GrepMe > conftest.dir/file
123516fc0178dSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
123526fc0178dSmrg    rm -rf conftest.dir
123536fc0178dSmrg    if test -s conftest.tar; then
123546fc0178dSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
123556fc0178dSmrg      AM_RUN_LOG([cat conftest.dir/file])
123566fc0178dSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
123576fc0178dSmrg    fi
123586fc0178dSmrg  done
123596fc0178dSmrg  rm -rf conftest.dir
123606fc0178dSmrg
123616fc0178dSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
123626fc0178dSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
123636fc0178dSmrg
123646fc0178dSmrgAC_SUBST([am__tar])
123656fc0178dSmrgAC_SUBST([am__untar])
123666fc0178dSmrg]) # _AM_PROG_TAR
12367ff559fabSmrg
12368