16b526288Smrg# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
26b526288Smrg
36b526288Smrg# Copyright (C) 1996-2017 Free Software Foundation, Inc.
441b2f0bdSmrg
541b2f0bdSmrg# This file is free software; the Free Software Foundation
641b2f0bdSmrg# gives unlimited permission to copy and/or distribute it,
741b2f0bdSmrg# with or without modifications, as long as this notice is preserved.
841b2f0bdSmrg
941b2f0bdSmrg# This program is distributed in the hope that it will be useful,
1041b2f0bdSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1141b2f0bdSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1241b2f0bdSmrg# PARTICULAR PURPOSE.
1341b2f0bdSmrg
146b526288Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
1511245024Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1611245024Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
176b526288Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
186b526288Smrg[m4_warning([this file was generated for autoconf 2.69.
1911245024SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
2011245024SmrgIf you have problems, you may need to regenerate the build system entirely.
216b526288SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
2241b2f0bdSmrg
236b526288Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2411245024Smrg#
256b526288Smrg#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
266b526288Smrg#   Written by Gordon Matzigkeit, 1996
276b526288Smrg#
286b526288Smrg# This file is free software; the Free Software Foundation gives
296b526288Smrg# unlimited permission to copy and/or distribute it, with or without
306b526288Smrg# modifications, as long as this notice is preserved.
3141b2f0bdSmrg
326b526288Smrgm4_define([_LT_COPYING], [dnl
336b526288Smrg# Copyright (C) 2014 Free Software Foundation, Inc.
346b526288Smrg# This is free software; see the source for copying conditions.  There is NO
356b526288Smrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3641b2f0bdSmrg
376b526288Smrg# GNU Libtool is free software; you can redistribute it and/or modify
386b526288Smrg# it under the terms of the GNU General Public License as published by
396b526288Smrg# the Free Software Foundation; either version 2 of of the License, or
406b526288Smrg# (at your option) any later version.
416b526288Smrg#
426b526288Smrg# As a special exception to the GNU General Public License, if you
436b526288Smrg# distribute this file as part of a program or library that is built
446b526288Smrg# using GNU Libtool, you may include this file under the  same
456b526288Smrg# distribution terms that you use for the rest of that program.
466b526288Smrg#
476b526288Smrg# GNU Libtool is distributed in the hope that it will be useful, but
486b526288Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
496b526288Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
506b526288Smrg# GNU General Public License for more details.
516b526288Smrg#
526b526288Smrg# You should have received a copy of the GNU General Public License
536b526288Smrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
546b526288Smrg])
5541b2f0bdSmrg
566b526288Smrg# serial 58 LT_INIT
5741b2f0bdSmrg
5841b2f0bdSmrg
596b526288Smrg# LT_PREREQ(VERSION)
606b526288Smrg# ------------------
616b526288Smrg# Complain and exit if this libtool version is less that VERSION.
626b526288Smrgm4_defun([LT_PREREQ],
636b526288Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
646b526288Smrg       [m4_default([$3],
656b526288Smrg		   [m4_fatal([Libtool version $1 or higher is required],
666b526288Smrg		             63)])],
676b526288Smrg       [$2])])
6841b2f0bdSmrg
6941b2f0bdSmrg
706b526288Smrg# _LT_CHECK_BUILDDIR
716b526288Smrg# ------------------
726b526288Smrg# Complain if the absolute build directory name contains unusual characters
736b526288Smrgm4_defun([_LT_CHECK_BUILDDIR],
746b526288Smrg[case `pwd` in
756b526288Smrg  *\ * | *\	*)
766b526288Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
776b526288Smrgesac
7811245024Smrg])
7941b2f0bdSmrg
8041b2f0bdSmrg
816b526288Smrg# LT_INIT([OPTIONS])
826b526288Smrg# ------------------
836b526288SmrgAC_DEFUN([LT_INIT],
846b526288Smrg[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
856b526288SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
866b526288SmrgAC_BEFORE([$0], [LT_LANG])dnl
876b526288SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
886b526288SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
896b526288Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
9041b2f0bdSmrg
916b526288Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
926b526288Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
936b526288Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
946b526288Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
956b526288Smrgdnl unless we require an AC_DEFUNed macro:
966b526288SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
976b526288SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
986b526288SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
996b526288SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
1006b526288Smrgm4_require([_LT_PROG_LTMAIN])dnl
10141b2f0bdSmrg
1026b526288Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
10341b2f0bdSmrg
1046b526288Smrgdnl Parse OPTIONS
1056b526288Smrg_LT_SET_OPTIONS([$0], [$1])
10641b2f0bdSmrg
1076b526288Smrg# This can be used to rebuild libtool when needed
1086b526288SmrgLIBTOOL_DEPS=$ltmain
10941b2f0bdSmrg
1106b526288Smrg# Always use our own libtool.
1116b526288SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
1126b526288SmrgAC_SUBST(LIBTOOL)dnl
11341b2f0bdSmrg
1146b526288Smrg_LT_SETUP
11541b2f0bdSmrg
1166b526288Smrg# Only expand once:
1176b526288Smrgm4_define([LT_INIT])
1186b526288Smrg])# LT_INIT
11941b2f0bdSmrg
1206b526288Smrg# Old names:
1216b526288SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1226b526288SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1236b526288Smrgdnl aclocal-1.4 backwards compatibility:
1246b526288Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1256b526288Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
12641b2f0bdSmrg
12741b2f0bdSmrg
1286b526288Smrg# _LT_PREPARE_CC_BASENAME
1296b526288Smrg# -----------------------
1306b526288Smrgm4_defun([_LT_PREPARE_CC_BASENAME], [
1316b526288Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1326b526288Smrgfunc_cc_basename ()
1336b526288Smrg{
1346b526288Smrg    for cc_temp in @S|@*""; do
1356b526288Smrg      case $cc_temp in
1366b526288Smrg        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1376b526288Smrg        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1386b526288Smrg        \-*) ;;
1396b526288Smrg        *) break;;
1406b526288Smrg      esac
14111245024Smrg    done
1426b526288Smrg    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
1436b526288Smrg}
1446b526288Smrg])# _LT_PREPARE_CC_BASENAME
14541b2f0bdSmrg
14641b2f0bdSmrg
1476b526288Smrg# _LT_CC_BASENAME(CC)
1486b526288Smrg# -------------------
1496b526288Smrg# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
1506b526288Smrg# but that macro is also expanded into generated libtool script, which
1516b526288Smrg# arranges for $SED and $ECHO to be set by different means.
1526b526288Smrgm4_defun([_LT_CC_BASENAME],
1536b526288Smrg[m4_require([_LT_PREPARE_CC_BASENAME])dnl
1546b526288SmrgAC_REQUIRE([_LT_DECL_SED])dnl
1556b526288SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1566b526288Smrgfunc_cc_basename $1
1576b526288Smrgcc_basename=$func_cc_basename_result
15811245024Smrg])
15941b2f0bdSmrg
16041b2f0bdSmrg
1616b526288Smrg# _LT_FILEUTILS_DEFAULTS
1626b526288Smrg# ----------------------
1636b526288Smrg# It is okay to use these file commands and assume they have been set
1646b526288Smrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
1656b526288Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
1666b526288Smrg[: ${CP="cp -f"}
1676b526288Smrg: ${MV="mv -f"}
1686b526288Smrg: ${RM="rm -f"}
1696b526288Smrg])# _LT_FILEUTILS_DEFAULTS
17041b2f0bdSmrg
17141b2f0bdSmrg
1726b526288Smrg# _LT_SETUP
1736b526288Smrg# ---------
1746b526288Smrgm4_defun([_LT_SETUP],
1756b526288Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1766b526288SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
1776b526288SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1786b526288SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1796b526288Smrg
1806b526288Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
1816b526288Smrgdnl
1826b526288Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
1836b526288Smrg_LT_DECL([], [host], [0])dnl
1846b526288Smrg_LT_DECL([], [host_os], [0])dnl
1856b526288Smrgdnl
1866b526288Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
1876b526288Smrg_LT_DECL([], [build], [0])dnl
1886b526288Smrg_LT_DECL([], [build_os], [0])dnl
1896b526288Smrgdnl
1906b526288SmrgAC_REQUIRE([AC_PROG_CC])dnl
1916b526288SmrgAC_REQUIRE([LT_PATH_LD])dnl
1926b526288SmrgAC_REQUIRE([LT_PATH_NM])dnl
1936b526288Smrgdnl
1946b526288SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
1956b526288Smrgtest -z "$LN_S" && LN_S="ln -s"
1966b526288Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1976b526288Smrgdnl
1986b526288SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
1996b526288Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
2006b526288Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
2016b526288Smrgdnl
2026b526288Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2036b526288Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2046b526288Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
2056b526288Smrgm4_require([_LT_CMD_RELOAD])dnl
2066b526288Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
2076b526288Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
2086b526288Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
2096b526288Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
2106b526288Smrgm4_require([_LT_WITH_SYSROOT])dnl
2116b526288Smrgm4_require([_LT_CMD_TRUNCATE])dnl
2126b526288Smrg
2136b526288Smrg_LT_CONFIG_LIBTOOL_INIT([
2146b526288Smrg# See if we are running on zsh, and set the options that allow our
2156b526288Smrg# commands through without removal of \ escapes INIT.
2166b526288Smrgif test -n "\${ZSH_VERSION+set}"; then
2176b526288Smrg   setopt NO_GLOB_SUBST
21811245024Smrgfi
21911245024Smrg])
2206b526288Smrgif test -n "${ZSH_VERSION+set}"; then
2216b526288Smrg   setopt NO_GLOB_SUBST
2226b526288Smrgfi
22341b2f0bdSmrg
2246b526288Smrg_LT_CHECK_OBJDIR
22541b2f0bdSmrg
2266b526288Smrgm4_require([_LT_TAG_COMPILER])dnl
22741b2f0bdSmrg
2286b526288Smrgcase $host_os in
2296b526288Smrgaix3*)
2306b526288Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
2316b526288Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
2326b526288Smrg  # vanish in a puff of smoke.
2336b526288Smrg  if test set != "${COLLECT_NAMES+set}"; then
2346b526288Smrg    COLLECT_NAMES=
2356b526288Smrg    export COLLECT_NAMES
2366b526288Smrg  fi
2376b526288Smrg  ;;
2386b526288Smrgesac
23941b2f0bdSmrg
2406b526288Smrg# Global variables:
2416b526288Smrgofile=libtool
2426b526288Smrgcan_build_shared=yes
24341b2f0bdSmrg
2446b526288Smrg# All known linkers require a '.a' archive for static linking (except MSVC,
2456b526288Smrg# which needs '.lib').
2466b526288Smrglibext=a
24741b2f0bdSmrg
2486b526288Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
24941b2f0bdSmrg
2506b526288Smrgold_CC=$CC
2516b526288Smrgold_CFLAGS=$CFLAGS
25241b2f0bdSmrg
2536b526288Smrg# Set sane defaults for various variables
2546b526288Smrgtest -z "$CC" && CC=cc
2556b526288Smrgtest -z "$LTCC" && LTCC=$CC
2566b526288Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
2576b526288Smrgtest -z "$LD" && LD=ld
2586b526288Smrgtest -z "$ac_objext" && ac_objext=o
25941b2f0bdSmrg
2606b526288Smrg_LT_CC_BASENAME([$compiler])
26141b2f0bdSmrg
2626b526288Smrg# Only perform the check for file, if the check method requires it
2636b526288Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
2646b526288Smrgcase $deplibs_check_method in
2656b526288Smrgfile_magic*)
2666b526288Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
2676b526288Smrg    _LT_PATH_MAGIC
26811245024Smrg  fi
2696b526288Smrg  ;;
2706b526288Smrgesac
27141b2f0bdSmrg
2726b526288Smrg# Use C for the default configuration in the libtool script
2736b526288SmrgLT_SUPPORTED_TAG([CC])
2746b526288Smrg_LT_LANG_C_CONFIG
2756b526288Smrg_LT_LANG_DEFAULT_CONFIG
2766b526288Smrg_LT_CONFIG_COMMANDS
2776b526288Smrg])# _LT_SETUP
27841b2f0bdSmrg
27941b2f0bdSmrg
2806b526288Smrg# _LT_PREPARE_SED_QUOTE_VARS
2816b526288Smrg# --------------------------
2826b526288Smrg# Define a few sed substitution that help us do robust quoting.
2836b526288Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
2846b526288Smrg[# Backslashify metacharacters that are still active within
2856b526288Smrg# double-quoted strings.
2866b526288Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
28741b2f0bdSmrg
2886b526288Smrg# Same as above, but do not quote variable references.
2896b526288Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
29041b2f0bdSmrg
2916b526288Smrg# Sed substitution to delay expansion of an escaped shell variable in a
2926b526288Smrg# double_quote_subst'ed string.
2936b526288Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
29441b2f0bdSmrg
2956b526288Smrg# Sed substitution to delay expansion of an escaped single quote.
2966b526288Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
29741b2f0bdSmrg
2986b526288Smrg# Sed substitution to avoid accidental globbing in evaled expressions
2996b526288Smrgno_glob_subst='s/\*/\\\*/g'
3006b526288Smrg])
30141b2f0bdSmrg
3026b526288Smrg# _LT_PROG_LTMAIN
3036b526288Smrg# ---------------
3046b526288Smrg# Note that this code is called both from 'configure', and 'config.status'
3056b526288Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
3066b526288Smrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
3076b526288Smrg# so we pass a copy along to make sure it has a sensible value anyway.
3086b526288Smrgm4_defun([_LT_PROG_LTMAIN],
3096b526288Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
3106b526288Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
3116b526288Smrgltmain=$ac_aux_dir/ltmain.sh
3126b526288Smrg])# _LT_PROG_LTMAIN
31341b2f0bdSmrg
31441b2f0bdSmrg
31541b2f0bdSmrg
3166b526288Smrg# So that we can recreate a full libtool script including additional
3176b526288Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
3186b526288Smrg# in macros and then make a single call at the end using the 'libtool'
3196b526288Smrg# label.
32041b2f0bdSmrg
32141b2f0bdSmrg
3226b526288Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
3236b526288Smrg# ----------------------------------------
3246b526288Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3256b526288Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
3266b526288Smrg[m4_ifval([$1],
3276b526288Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
3286b526288Smrg                     [$1
3296b526288Smrg])])])
33041b2f0bdSmrg
3316b526288Smrg# Initialize.
3326b526288Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
33341b2f0bdSmrg
33441b2f0bdSmrg
3356b526288Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
3366b526288Smrg# ------------------------------
3376b526288Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3386b526288Smrgm4_define([_LT_CONFIG_LIBTOOL],
3396b526288Smrg[m4_ifval([$1],
3406b526288Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
3416b526288Smrg                     [$1
3426b526288Smrg])])])
34311245024Smrg
3446b526288Smrg# Initialize.
3456b526288Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
34611245024Smrg
34711245024Smrg
3486b526288Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
3496b526288Smrg# -----------------------------------------------------
3506b526288Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
3516b526288Smrg[_LT_CONFIG_LIBTOOL([$1])
3526b526288Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
35311245024Smrg])
35441b2f0bdSmrg
35541b2f0bdSmrg
3566b526288Smrg# _LT_FORMAT_COMMENT([COMMENT])
3576b526288Smrg# -----------------------------
3586b526288Smrg# Add leading comment marks to the start of each line, and a trailing
3596b526288Smrg# full-stop to the whole comment if one is not present already.
3606b526288Smrgm4_define([_LT_FORMAT_COMMENT],
3616b526288Smrg[m4_ifval([$1], [
3626b526288Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
3636b526288Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
3646b526288Smrg)])
36541b2f0bdSmrg
36641b2f0bdSmrg
36741b2f0bdSmrg
36811245024Smrg
3696b526288Smrg
3706b526288Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
3716b526288Smrg# -------------------------------------------------------------------
3726b526288Smrg# CONFIGNAME is the name given to the value in the libtool script.
3736b526288Smrg# VARNAME is the (base) name used in the configure script.
3746b526288Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
3756b526288Smrg# VARNAME.  Any other value will be used directly.
3766b526288Smrgm4_define([_LT_DECL],
3776b526288Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
3786b526288Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
3796b526288Smrg	[m4_ifval([$1], [$1], [$2])])
3806b526288Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
3816b526288Smrg    m4_ifval([$4],
3826b526288Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
3836b526288Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
3846b526288Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
38511245024Smrg])
38641b2f0bdSmrg
38741b2f0bdSmrg
3886b526288Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
3896b526288Smrg# --------------------------------------------------------
3906b526288Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
39141b2f0bdSmrg
39241b2f0bdSmrg
3936b526288Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
3946b526288Smrg# ------------------------------------------------
3956b526288Smrgm4_define([lt_decl_tag_varnames],
3966b526288Smrg[_lt_decl_filter([tagged?], [yes], $@)])
39741b2f0bdSmrg
39841b2f0bdSmrg
3996b526288Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
4006b526288Smrg# ---------------------------------------------------------
4016b526288Smrgm4_define([_lt_decl_filter],
4026b526288Smrg[m4_case([$#],
4036b526288Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
4046b526288Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
4056b526288Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
4066b526288Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
4076b526288Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
4086b526288Smrg])
40941b2f0bdSmrg
41041b2f0bdSmrg
4116b526288Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
4126b526288Smrg# --------------------------------------------------
4136b526288Smrgm4_define([lt_decl_quote_varnames],
4146b526288Smrg[_lt_decl_filter([value], [1], $@)])
41541b2f0bdSmrg
41641b2f0bdSmrg
4176b526288Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
4186b526288Smrg# ---------------------------------------------------
4196b526288Smrgm4_define([lt_decl_dquote_varnames],
4206b526288Smrg[_lt_decl_filter([value], [2], $@)])
42141b2f0bdSmrg
42241b2f0bdSmrg
4236b526288Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
4246b526288Smrg# ---------------------------------------------------
4256b526288Smrgm4_define([lt_decl_varnames_tagged],
4266b526288Smrg[m4_assert([$# <= 2])dnl
4276b526288Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
4286b526288Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
4296b526288Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
4306b526288Smrgm4_define([_lt_decl_varnames_tagged],
4316b526288Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
43241b2f0bdSmrg
43341b2f0bdSmrg
4346b526288Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
4356b526288Smrg# ------------------------------------------------
4366b526288Smrgm4_define([lt_decl_all_varnames],
4376b526288Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
4386b526288Smrg     m4_if([$2], [],
4396b526288Smrg	   m4_quote(lt_decl_varnames),
4406b526288Smrg	m4_quote(m4_shift($@))))[]dnl
4416b526288Smrg])
4426b526288Smrgm4_define([_lt_decl_all_varnames],
4436b526288Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
4446b526288Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
4456b526288Smrg])
4466b526288Smrg
4476b526288Smrg
4486b526288Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
4496b526288Smrg# ------------------------------------
4506b526288Smrg# Quote a variable value, and forward it to 'config.status' so that its
4516b526288Smrg# declaration there will have the same value as in 'configure'.  VARNAME
4526b526288Smrg# must have a single quote delimited value for this to work.
4536b526288Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
4546b526288Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
45541b2f0bdSmrg
45641b2f0bdSmrg
4576b526288Smrg# _LT_CONFIG_STATUS_DECLARATIONS
4586b526288Smrg# ------------------------------
4596b526288Smrg# We delimit libtool config variables with single quotes, so when
4606b526288Smrg# we write them to config.status, we have to be sure to quote all
4616b526288Smrg# embedded single quotes properly.  In configure, this macro expands
4626b526288Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
46311245024Smrg#
4646b526288Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
4656b526288Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
4666b526288Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
4676b526288Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
46841b2f0bdSmrg
46941b2f0bdSmrg
4706b526288Smrg# _LT_LIBTOOL_TAGS
4716b526288Smrg# ----------------
4726b526288Smrg# Output comment and list of tags supported by the script
4736b526288Smrgm4_defun([_LT_LIBTOOL_TAGS],
4746b526288Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
4756b526288Smrgavailable_tags='_LT_TAGS'dnl
47611245024Smrg])
47741b2f0bdSmrg
47841b2f0bdSmrg
4796b526288Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
4806b526288Smrg# -----------------------------------
4816b526288Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
4826b526288Smrg# expand to a commented shell variable setting:
48311245024Smrg#
4846b526288Smrg#    # Some comment about what VAR is for.
4856b526288Smrg#    visible_name=$lt_internal_name
4866b526288Smrgm4_define([_LT_LIBTOOL_DECLARE],
4876b526288Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
4886b526288Smrg					   [description])))[]dnl
4896b526288Smrgm4_pushdef([_libtool_name],
4906b526288Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
4916b526288Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
4926b526288Smrg    [0], [_libtool_name=[$]$1],
4936b526288Smrg    [1], [_libtool_name=$lt_[]$1],
4946b526288Smrg    [2], [_libtool_name=$lt_[]$1],
4956b526288Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
4966b526288Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
4976b526288Smrg])
49841b2f0bdSmrg
49941b2f0bdSmrg
5006b526288Smrg# _LT_LIBTOOL_CONFIG_VARS
5016b526288Smrg# -----------------------
5026b526288Smrg# Produce commented declarations of non-tagged libtool config variables
5036b526288Smrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
5046b526288Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
5056b526288Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
5066b526288Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
5076b526288Smrg[m4_foreach([_lt_var],
5086b526288Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
5096b526288Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
51041b2f0bdSmrg
51141b2f0bdSmrg
5126b526288Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
5136b526288Smrg# -------------------------
5146b526288Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
5156b526288Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
5166b526288Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
51741b2f0bdSmrg
51841b2f0bdSmrg
5196b526288Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
5206b526288Smrg# ------------------------------
5216b526288Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
52211245024Smrg
52341b2f0bdSmrg
5246b526288Smrg# _LT_CONFIG_COMMANDS
5256b526288Smrg# -------------------
5266b526288Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
5276b526288Smrg# variables for single and double quote escaping we saved from calls
5286b526288Smrg# to _LT_DECL, we can put quote escaped variables declarations
5296b526288Smrg# into 'config.status', and then the shell code to quote escape them in
5306b526288Smrg# for loops in 'config.status'.  Finally, any additional code accumulated
5316b526288Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
5326b526288Smrgm4_defun([_LT_CONFIG_COMMANDS],
5336b526288Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
5346b526288Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
5356b526288Smrg	dnl instead of duplicating it all over again into config.status,
5366b526288Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
5376b526288Smrg	dnl needs to know what name is stored there:
5386b526288Smrg        [AC_CONFIG_COMMANDS([libtool],
5396b526288Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
5406b526288Smrg    dnl If the libtool generation code is destined for config.status,
5416b526288Smrg    dnl expand the accumulated commands and init code now:
5426b526288Smrg    [AC_CONFIG_COMMANDS([libtool],
5436b526288Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
5446b526288Smrg])#_LT_CONFIG_COMMANDS
54541b2f0bdSmrg
54641b2f0bdSmrg
5476b526288Smrg# Initialize.
5486b526288Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
5496b526288Smrg[
55041b2f0bdSmrg
5516b526288Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
5526b526288Smrg# if CDPATH is set.
5536b526288Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
55441b2f0bdSmrg
5556b526288Smrgsed_quote_subst='$sed_quote_subst'
5566b526288Smrgdouble_quote_subst='$double_quote_subst'
5576b526288Smrgdelay_variable_subst='$delay_variable_subst'
5586b526288Smrg_LT_CONFIG_STATUS_DECLARATIONS
5596b526288SmrgLTCC='$LTCC'
5606b526288SmrgLTCFLAGS='$LTCFLAGS'
5616b526288Smrgcompiler='$compiler_DEFAULT'
56241b2f0bdSmrg
5636b526288Smrg# A function that is used when there is no print builtin or printf.
5646b526288Smrgfunc_fallback_echo ()
5656b526288Smrg{
5666b526288Smrg  eval 'cat <<_LTECHO_EOF
5676b526288Smrg\$[]1
5686b526288Smrg_LTECHO_EOF'
5696b526288Smrg}
57041b2f0bdSmrg
5716b526288Smrg# Quote evaled strings.
5726b526288Smrgfor var in lt_decl_all_varnames([[ \
5736b526288Smrg]], lt_decl_quote_varnames); do
5746b526288Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
5756b526288Smrg    *[[\\\\\\\`\\"\\\$]]*)
5766b526288Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
5776b526288Smrg      ;;
5786b526288Smrg    *)
5796b526288Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5806b526288Smrg      ;;
5816b526288Smrg    esac
5826b526288Smrgdone
58341b2f0bdSmrg
5846b526288Smrg# Double-quote double-evaled strings.
5856b526288Smrgfor var in lt_decl_all_varnames([[ \
5866b526288Smrg]], lt_decl_dquote_varnames); do
5876b526288Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
5886b526288Smrg    *[[\\\\\\\`\\"\\\$]]*)
5896b526288Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
5906b526288Smrg      ;;
5916b526288Smrg    *)
5926b526288Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5936b526288Smrg      ;;
5946b526288Smrg    esac
5956b526288Smrgdone
59641b2f0bdSmrg
5976b526288Smrg_LT_OUTPUT_LIBTOOL_INIT
5986b526288Smrg])
59941b2f0bdSmrg
6006b526288Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
6016b526288Smrg# ------------------------------------
6026b526288Smrg# Generate a child script FILE with all initialization necessary to
6036b526288Smrg# reuse the environment learned by the parent script, and make the
6046b526288Smrg# file executable.  If COMMENT is supplied, it is inserted after the
6056b526288Smrg# '#!' sequence but before initialization text begins.  After this
6066b526288Smrg# macro, additional text can be appended to FILE to form the body of
6076b526288Smrg# the child script.  The macro ends with non-zero status if the
6086b526288Smrg# file could not be fully written (such as if the disk is full).
6096b526288Smrgm4_ifdef([AS_INIT_GENERATED],
6106b526288Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
6116b526288Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
6126b526288Smrg[m4_require([AS_PREPARE])]dnl
6136b526288Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
6146b526288Smrg[lt_write_fail=0
6156b526288Smrgcat >$1 <<_ASEOF || lt_write_fail=1
6166b526288Smrg#! $SHELL
6176b526288Smrg# Generated by $as_me.
6186b526288Smrg$2
6196b526288SmrgSHELL=\${CONFIG_SHELL-$SHELL}
6206b526288Smrgexport SHELL
6216b526288Smrg_ASEOF
6226b526288Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
6236b526288SmrgAS_SHELL_SANITIZE
6246b526288Smrg_AS_PREPARE
6256b526288Smrgexec AS_MESSAGE_FD>&1
6266b526288Smrg_ASEOF
6276b526288Smrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
6286b526288Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
62941b2f0bdSmrg
6306b526288Smrg# LT_OUTPUT
6316b526288Smrg# ---------
6326b526288Smrg# This macro allows early generation of the libtool script (before
6336b526288Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
6346b526288Smrg# tests.
6356b526288SmrgAC_DEFUN([LT_OUTPUT],
6366b526288Smrg[: ${CONFIG_LT=./config.lt}
6376b526288SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
6386b526288Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
6396b526288Smrg[# Run this file to recreate a libtool stub with the current configuration.])
64041b2f0bdSmrg
6416b526288Smrgcat >>"$CONFIG_LT" <<\_LTEOF
6426b526288Smrglt_cl_silent=false
6436b526288Smrgexec AS_MESSAGE_LOG_FD>>config.log
6446b526288Smrg{
6456b526288Smrg  echo
6466b526288Smrg  AS_BOX([Running $as_me.])
6476b526288Smrg} >&AS_MESSAGE_LOG_FD
64811245024Smrg
6496b526288Smrglt_cl_help="\
6506b526288Smrg'$as_me' creates a local libtool stub from the current configuration,
6516b526288Smrgfor use in further configure time tests before the real libtool is
6526b526288Smrggenerated.
65341b2f0bdSmrg
6546b526288SmrgUsage: $[0] [[OPTIONS]]
65541b2f0bdSmrg
6566b526288Smrg  -h, --help      print this help, then exit
6576b526288Smrg  -V, --version   print version number, then exit
6586b526288Smrg  -q, --quiet     do not print progress messages
6596b526288Smrg  -d, --debug     don't remove temporary files
66041b2f0bdSmrg
6616b526288SmrgReport bugs to <bug-libtool@gnu.org>."
66241b2f0bdSmrg
6636b526288Smrglt_cl_version="\
6646b526288Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
6656b526288Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
6666b526288Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
66711a29bacSmrg
6686b526288SmrgCopyright (C) 2011 Free Software Foundation, Inc.
6696b526288SmrgThis config.lt script is free software; the Free Software Foundation
6706b526288Smrggives unlimited permision to copy, distribute and modify it."
67111a29bacSmrg
6726b526288Smrgwhile test 0 != $[#]
6736b526288Smrgdo
6746b526288Smrg  case $[1] in
6756b526288Smrg    --version | --v* | -V )
6766b526288Smrg      echo "$lt_cl_version"; exit 0 ;;
6776b526288Smrg    --help | --h* | -h )
6786b526288Smrg      echo "$lt_cl_help"; exit 0 ;;
6796b526288Smrg    --debug | --d* | -d )
6806b526288Smrg      debug=: ;;
6816b526288Smrg    --quiet | --q* | --silent | --s* | -q )
6826b526288Smrg      lt_cl_silent=: ;;
68341b2f0bdSmrg
6846b526288Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
6856b526288SmrgTry '$[0] --help' for more information.]) ;;
68611a29bacSmrg
6876b526288Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
6886b526288SmrgTry '$[0] --help' for more information.]) ;;
6896b526288Smrg  esac
6906b526288Smrg  shift
6916b526288Smrgdone
6926b526288Smrg
6936b526288Smrgif $lt_cl_silent; then
6946b526288Smrg  exec AS_MESSAGE_FD>/dev/null
69511a29bacSmrgfi
6966b526288Smrg_LTEOF
69711a29bacSmrg
6986b526288Smrgcat >>"$CONFIG_LT" <<_LTEOF
6996b526288Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
7006b526288Smrg_LTEOF
70111a29bacSmrg
7026b526288Smrgcat >>"$CONFIG_LT" <<\_LTEOF
7036b526288SmrgAC_MSG_NOTICE([creating $ofile])
7046b526288Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
7056b526288SmrgAS_EXIT(0)
7066b526288Smrg_LTEOF
7076b526288Smrgchmod +x "$CONFIG_LT"
70841b2f0bdSmrg
7096b526288Smrg# configure is writing to config.log, but config.lt does its own redirection,
7106b526288Smrg# appending to config.log, which fails on DOS, as config.log is still kept
7116b526288Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
7126b526288Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
7136b526288Smrglt_cl_success=:
7146b526288Smrgtest yes = "$silent" &&
7156b526288Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
7166b526288Smrgexec AS_MESSAGE_LOG_FD>/dev/null
7176b526288Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
7186b526288Smrgexec AS_MESSAGE_LOG_FD>>config.log
7196b526288Smrg$lt_cl_success || AS_EXIT(1)
7206b526288Smrg])# LT_OUTPUT
72111245024Smrg
72241b2f0bdSmrg
7236b526288Smrg# _LT_CONFIG(TAG)
7246b526288Smrg# ---------------
7256b526288Smrg# If TAG is the built-in tag, create an initial libtool script with a
7266b526288Smrg# default configuration from the untagged config vars.  Otherwise add code
7276b526288Smrg# to config.status for appending the configuration named by TAG from the
7286b526288Smrg# matching tagged config vars.
7296b526288Smrgm4_defun([_LT_CONFIG],
7306b526288Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7316b526288Smrg_LT_CONFIG_SAVE_COMMANDS([
7326b526288Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
7336b526288Smrg  m4_if(_LT_TAG, [C], [
7346b526288Smrg    # See if we are running on zsh, and set the options that allow our
7356b526288Smrg    # commands through without removal of \ escapes.
7366b526288Smrg    if test -n "${ZSH_VERSION+set}"; then
7376b526288Smrg      setopt NO_GLOB_SUBST
7386b526288Smrg    fi
73941b2f0bdSmrg
7406b526288Smrg    cfgfile=${ofile}T
7416b526288Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
7426b526288Smrg    $RM "$cfgfile"
74341b2f0bdSmrg
7446b526288Smrg    cat <<_LT_EOF >> "$cfgfile"
7456b526288Smrg#! $SHELL
7466b526288Smrg# Generated automatically by $as_me ($PACKAGE) $VERSION
7476b526288Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7486b526288Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
74911245024Smrg
7506b526288Smrg# Provide generalized library-building support services.
7516b526288Smrg# Written by Gordon Matzigkeit, 1996
75211245024Smrg
7536b526288Smrg_LT_COPYING
7546b526288Smrg_LT_LIBTOOL_TAGS
75541b2f0bdSmrg
7566b526288Smrg# Configured defaults for sys_lib_dlsearch_path munging.
7576b526288Smrg: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
75841b2f0bdSmrg
7596b526288Smrg# ### BEGIN LIBTOOL CONFIG
7606b526288Smrg_LT_LIBTOOL_CONFIG_VARS
7616b526288Smrg_LT_LIBTOOL_TAG_VARS
7626b526288Smrg# ### END LIBTOOL CONFIG
76341b2f0bdSmrg
7646b526288Smrg_LT_EOF
76541b2f0bdSmrg
7666b526288Smrg    cat <<'_LT_EOF' >> "$cfgfile"
76741b2f0bdSmrg
7686b526288Smrg# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
76911a29bacSmrg
7706b526288Smrg_LT_PREPARE_MUNGE_PATH_LIST
7716b526288Smrg_LT_PREPARE_CC_BASENAME
77211245024Smrg
7736b526288Smrg# ### END FUNCTIONS SHARED WITH CONFIGURE
77411245024Smrg
7756b526288Smrg_LT_EOF
77641b2f0bdSmrg
7776b526288Smrg  case $host_os in
7786b526288Smrg  aix3*)
7796b526288Smrg    cat <<\_LT_EOF >> "$cfgfile"
7806b526288Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
7816b526288Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
7826b526288Smrg# vanish in a puff of smoke.
7836b526288Smrgif test set != "${COLLECT_NAMES+set}"; then
7846b526288Smrg  COLLECT_NAMES=
7856b526288Smrg  export COLLECT_NAMES
78611245024Smrgfi
7876b526288Smrg_LT_EOF
7886b526288Smrg    ;;
7896b526288Smrg  esac
79041b2f0bdSmrg
7916b526288Smrg  _LT_PROG_LTMAIN
79241b2f0bdSmrg
7936b526288Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
7946b526288Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
7956b526288Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
7966b526288Smrg  # is reportedly fixed, but why not run on old versions too?
7976b526288Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
7986b526288Smrg     || (rm -f "$cfgfile"; exit 1)
79941b2f0bdSmrg
8006b526288Smrg   mv -f "$cfgfile" "$ofile" ||
8016b526288Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
8026b526288Smrg  chmod +x "$ofile"
8036b526288Smrg],
8046b526288Smrg[cat <<_LT_EOF >> "$ofile"
80541b2f0bdSmrg
8066b526288Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
8076b526288Smrgdnl in a comment (ie after a #).
8086b526288Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
8096b526288Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
8106b526288Smrg# ### END LIBTOOL TAG CONFIG: $1
8116b526288Smrg_LT_EOF
8126b526288Smrg])dnl /m4_if
8136b526288Smrg],
8146b526288Smrg[m4_if([$1], [], [
8156b526288Smrg    PACKAGE='$PACKAGE'
8166b526288Smrg    VERSION='$VERSION'
8176b526288Smrg    RM='$RM'
8186b526288Smrg    ofile='$ofile'], [])
8196b526288Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
8206b526288Smrg])# _LT_CONFIG
82141b2f0bdSmrg
82211a29bacSmrg
8236b526288Smrg# LT_SUPPORTED_TAG(TAG)
8246b526288Smrg# ---------------------
8256b526288Smrg# Trace this macro to discover what tags are supported by the libtool
8266b526288Smrg# --tag option, using:
8276b526288Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
8286b526288SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
82911a29bacSmrg
83011a29bacSmrg
8316b526288Smrg# C support is built-in for now
8326b526288Smrgm4_define([_LT_LANG_C_enabled], [])
8336b526288Smrgm4_define([_LT_TAGS], [])
83411a29bacSmrg
83511a29bacSmrg
8366b526288Smrg# LT_LANG(LANG)
8376b526288Smrg# -------------
8386b526288Smrg# Enable libtool support for the given language if not already enabled.
8396b526288SmrgAC_DEFUN([LT_LANG],
8406b526288Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
8416b526288Smrgm4_case([$1],
8426b526288Smrg  [C],			[_LT_LANG(C)],
8436b526288Smrg  [C++],		[_LT_LANG(CXX)],
8446b526288Smrg  [Go],			[_LT_LANG(GO)],
8456b526288Smrg  [Java],		[_LT_LANG(GCJ)],
8466b526288Smrg  [Fortran 77],		[_LT_LANG(F77)],
8476b526288Smrg  [Fortran],		[_LT_LANG(FC)],
8486b526288Smrg  [Windows Resource],	[_LT_LANG(RC)],
8496b526288Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
8506b526288Smrg    [_LT_LANG($1)],
8516b526288Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
8526b526288Smrg])# LT_LANG
85311a29bacSmrg
85411a29bacSmrg
8556b526288Smrg# _LT_LANG(LANGNAME)
8566b526288Smrg# ------------------
8576b526288Smrgm4_defun([_LT_LANG],
8586b526288Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
8596b526288Smrg  [LT_SUPPORTED_TAG([$1])dnl
8606b526288Smrg  m4_append([_LT_TAGS], [$1 ])dnl
8616b526288Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
8626b526288Smrg  _LT_LANG_$1_CONFIG($1)])dnl
8636b526288Smrg])# _LT_LANG
8646b526288Smrg
8656b526288Smrg
8666b526288Smrgm4_ifndef([AC_PROG_GO], [
8676b526288Smrg# NOTE: This macro has been submitted for inclusion into   #
8686b526288Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
8696b526288Smrg#  a released version of Autoconf we should remove this    #
8706b526288Smrg#  macro and use it instead.                               #
8716b526288Smrgm4_defun([AC_PROG_GO],
8726b526288Smrg[AC_LANG_PUSH(Go)dnl
8736b526288SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
8746b526288SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
8756b526288Smrg_AC_ARG_VAR_LDFLAGS()dnl
8766b526288SmrgAC_CHECK_TOOL(GOC, gccgo)
8776b526288Smrgif test -z "$GOC"; then
8786b526288Smrg  if test -n "$ac_tool_prefix"; then
8796b526288Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
8806b526288Smrg  fi
88111a29bacSmrgfi
8826b526288Smrgif test -z "$GOC"; then
8836b526288Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
8846b526288Smrgfi
8856b526288Smrg])#m4_defun
8866b526288Smrg])#m4_ifndef
88711a29bacSmrg
88811a29bacSmrg
8896b526288Smrg# _LT_LANG_DEFAULT_CONFIG
8906b526288Smrg# -----------------------
8916b526288Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
8926b526288Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
8936b526288Smrg  [LT_LANG(CXX)],
8946b526288Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
89511a29bacSmrg
8966b526288SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
8976b526288Smrg  [LT_LANG(F77)],
8986b526288Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
89911a29bacSmrg
9006b526288SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
9016b526288Smrg  [LT_LANG(FC)],
9026b526288Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
90311a29bacSmrg
9046b526288Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
9056b526288Smrgdnl pulling things in needlessly.
9066b526288SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
9076b526288Smrg  [LT_LANG(GCJ)],
9086b526288Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
9096b526288Smrg    [LT_LANG(GCJ)],
9106b526288Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
9116b526288Smrg      [LT_LANG(GCJ)],
9126b526288Smrg      [m4_ifdef([AC_PROG_GCJ],
9136b526288Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
9146b526288Smrg       m4_ifdef([A][M_PROG_GCJ],
9156b526288Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
9166b526288Smrg       m4_ifdef([LT_PROG_GCJ],
9176b526288Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
91811a29bacSmrg
9196b526288SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
9206b526288Smrg  [LT_LANG(GO)],
9216b526288Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
92211a29bacSmrg
9236b526288SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
9246b526288Smrg  [LT_LANG(RC)],
9256b526288Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
9266b526288Smrg])# _LT_LANG_DEFAULT_CONFIG
92711a29bacSmrg
9286b526288Smrg# Obsolete macros:
9296b526288SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
9306b526288SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
9316b526288SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
9326b526288SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
9336b526288SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
9346b526288Smrgdnl aclocal-1.4 backwards compatibility:
9356b526288Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
9366b526288Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
9376b526288Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
9386b526288Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
9396b526288Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
94011a29bacSmrg
94111a29bacSmrg
9426b526288Smrg# _LT_TAG_COMPILER
94311a29bacSmrg# ----------------
9446b526288Smrgm4_defun([_LT_TAG_COMPILER],
9456b526288Smrg[AC_REQUIRE([AC_PROG_CC])dnl
94611a29bacSmrg
9476b526288Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
9486b526288Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
9496b526288Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
9506b526288Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
95141b2f0bdSmrg
9526b526288Smrg# If no C compiler was specified, use CC.
9536b526288SmrgLTCC=${LTCC-"$CC"}
95441b2f0bdSmrg
9556b526288Smrg# If no C compiler flags were specified, use CFLAGS.
9566b526288SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
95741b2f0bdSmrg
9586b526288Smrg# Allow CC to be a program name with arguments.
9596b526288Smrgcompiler=$CC
9606b526288Smrg])# _LT_TAG_COMPILER
96141b2f0bdSmrg
96211245024Smrg
9636b526288Smrg# _LT_COMPILER_BOILERPLATE
9646b526288Smrg# ------------------------
9656b526288Smrg# Check for compiler boilerplate output or warnings with
9666b526288Smrg# the simple compiler test code.
9676b526288Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
9686b526288Smrg[m4_require([_LT_DECL_SED])dnl
9696b526288Smrgac_outfile=conftest.$ac_objext
9706b526288Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
9716b526288Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
9726b526288Smrg_lt_compiler_boilerplate=`cat conftest.err`
9736b526288Smrg$RM conftest*
9746b526288Smrg])# _LT_COMPILER_BOILERPLATE
97511a29bacSmrg
97611a29bacSmrg
9776b526288Smrg# _LT_LINKER_BOILERPLATE
9786b526288Smrg# ----------------------
9796b526288Smrg# Check for linker boilerplate output or warnings with
9806b526288Smrg# the simple link test code.
9816b526288Smrgm4_defun([_LT_LINKER_BOILERPLATE],
9826b526288Smrg[m4_require([_LT_DECL_SED])dnl
9836b526288Smrgac_outfile=conftest.$ac_objext
9846b526288Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
9856b526288Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
9866b526288Smrg_lt_linker_boilerplate=`cat conftest.err`
9876b526288Smrg$RM -r conftest*
9886b526288Smrg])# _LT_LINKER_BOILERPLATE
98911a29bacSmrg
9906b526288Smrg# _LT_REQUIRED_DARWIN_CHECKS
9916b526288Smrg# -------------------------
9926b526288Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
9936b526288Smrg  case $host_os in
9946b526288Smrg    rhapsody* | darwin*)
9956b526288Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
9966b526288Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
9976b526288Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
9986b526288Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
9996b526288Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
10006b526288Smrg    _LT_DECL([], [DSYMUTIL], [1],
10016b526288Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
10026b526288Smrg    _LT_DECL([], [NMEDIT], [1],
10036b526288Smrg      [Tool to change global to local symbols on Mac OS X])
10046b526288Smrg    _LT_DECL([], [LIPO], [1],
10056b526288Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
10066b526288Smrg    _LT_DECL([], [OTOOL], [1],
10076b526288Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
10086b526288Smrg    _LT_DECL([], [OTOOL64], [1],
10096b526288Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
101041b2f0bdSmrg
10116b526288Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
10126b526288Smrg      [lt_cv_apple_cc_single_mod=no
10136b526288Smrg      if test -z "$LT_MULTI_MODULE"; then
10146b526288Smrg	# By default we will add the -single_module flag. You can override
10156b526288Smrg	# by either setting the environment variable LT_MULTI_MODULE
10166b526288Smrg	# non-empty at configure time, or by adding -multi_module to the
10176b526288Smrg	# link flags.
10186b526288Smrg	rm -rf libconftest.dylib*
10196b526288Smrg	echo "int foo(void){return 1;}" > conftest.c
10206b526288Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
10216b526288Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
10226b526288Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
10236b526288Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
10246b526288Smrg        _lt_result=$?
10256b526288Smrg	# If there is a non-empty error log, and "single_module"
10266b526288Smrg	# appears in it, assume the flag caused a linker warning
10276b526288Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
10286b526288Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
10296b526288Smrg	# Otherwise, if the output was created with a 0 exit code from
10306b526288Smrg	# the compiler, it worked.
10316b526288Smrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
10326b526288Smrg	  lt_cv_apple_cc_single_mod=yes
10336b526288Smrg	else
10346b526288Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
10356b526288Smrg	fi
10366b526288Smrg	rm -rf libconftest.dylib*
10376b526288Smrg	rm -f conftest.*
10386b526288Smrg      fi])
103941b2f0bdSmrg
10406b526288Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
10416b526288Smrg      [lt_cv_ld_exported_symbols_list],
10426b526288Smrg      [lt_cv_ld_exported_symbols_list=no
10436b526288Smrg      save_LDFLAGS=$LDFLAGS
10446b526288Smrg      echo "_main" > conftest.sym
10456b526288Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
10466b526288Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
10476b526288Smrg	[lt_cv_ld_exported_symbols_list=yes],
10486b526288Smrg	[lt_cv_ld_exported_symbols_list=no])
10496b526288Smrg	LDFLAGS=$save_LDFLAGS
10506b526288Smrg    ])
105141b2f0bdSmrg
10526b526288Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
10536b526288Smrg      [lt_cv_ld_force_load=no
10546b526288Smrg      cat > conftest.c << _LT_EOF
10556b526288Smrgint forced_loaded() { return 2;}
10566b526288Smrg_LT_EOF
10576b526288Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
10586b526288Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
10596b526288Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
10606b526288Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
10616b526288Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
10626b526288Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
10636b526288Smrg      cat > conftest.c << _LT_EOF
10646b526288Smrgint main() { return 0;}
10656b526288Smrg_LT_EOF
10666b526288Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
10676b526288Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
10686b526288Smrg      _lt_result=$?
10696b526288Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
10706b526288Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
10716b526288Smrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
10726b526288Smrg	lt_cv_ld_force_load=yes
10736b526288Smrg      else
10746b526288Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
10756b526288Smrg      fi
10766b526288Smrg        rm -f conftest.err libconftest.a conftest conftest.c
10776b526288Smrg        rm -rf conftest.dSYM
10786b526288Smrg    ])
10796b526288Smrg    case $host_os in
10806b526288Smrg    rhapsody* | darwin1.[[012]])
10816b526288Smrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
10826b526288Smrg    darwin1.*)
10836b526288Smrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
10846b526288Smrg    darwin*) # darwin 5.x on
10856b526288Smrg      # if running on 10.5 or later, the deployment target defaults
10866b526288Smrg      # to the OS version, if on x86, and 10.4, the deployment
10876b526288Smrg      # target defaults to 10.4. Don't you love it?
10886b526288Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10896b526288Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
10906b526288Smrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10916b526288Smrg	10.[[012]][[,.]]*)
10926b526288Smrg	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
10936b526288Smrg	10.*)
10946b526288Smrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10956b526288Smrg      esac
10966b526288Smrg    ;;
10976b526288Smrg  esac
10986b526288Smrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
10996b526288Smrg      _lt_dar_single_mod='$single_module'
11006b526288Smrg    fi
11016b526288Smrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
11026b526288Smrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
11036b526288Smrg    else
11046b526288Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
11056b526288Smrg    fi
11066b526288Smrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
11076b526288Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
11086b526288Smrg    else
11096b526288Smrg      _lt_dsymutil=
11106b526288Smrg    fi
11116b526288Smrg    ;;
11126b526288Smrg  esac
11136b526288Smrg])
111441b2f0bdSmrg
111511a29bacSmrg
11166b526288Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
11176b526288Smrg# ---------------------------------
11186b526288Smrg# Checks for linker and compiler features on darwin
11196b526288Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
11206b526288Smrg[
11216b526288Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
11226b526288Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
11236b526288Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
11246b526288Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
11256b526288Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
11266b526288Smrg  if test yes = "$lt_cv_ld_force_load"; then
11276b526288Smrg    _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\"`'
11286b526288Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
11296b526288Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
11306b526288Smrg  else
11316b526288Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
11326b526288Smrg  fi
11336b526288Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
11346b526288Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
11356b526288Smrg  case $cc_basename in
11366b526288Smrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
11376b526288Smrg     *) _lt_dar_can_shared=$GCC ;;
11386b526288Smrg  esac
11396b526288Smrg  if test yes = "$_lt_dar_can_shared"; then
11406b526288Smrg    output_verbose_link_cmd=func_echo_all
11416b526288Smrg    _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"
11426b526288Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
11436b526288Smrg    _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"
11446b526288Smrg    _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"
11456b526288Smrg    m4_if([$1], [CXX],
11466b526288Smrg[   if test yes != "$lt_cv_apple_cc_single_mod"; then
11476b526288Smrg      _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"
11486b526288Smrg      _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"
11496b526288Smrg    fi
11506b526288Smrg],[])
11516b526288Smrg  else
11526b526288Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
11536b526288Smrg  fi
11546b526288Smrg])
11556b526288Smrg
11566b526288Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
11576b526288Smrg# ----------------------------------
11586b526288Smrg# Links a minimal program and checks the executable
11596b526288Smrg# for the system default hardcoded library path. In most cases,
11606b526288Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
11616b526288Smrg# the location of the communication and MPI libs are included too.
11626b526288Smrg# If we don't find anything, use the default library path according
11636b526288Smrg# to the aix ld manual.
11646b526288Smrg# Store the results from the different compilers for each TAGNAME.
11656b526288Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
11666b526288Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
11676b526288Smrg[m4_require([_LT_DECL_SED])dnl
11686b526288Smrgif test set = "${lt_cv_aix_libpath+set}"; then
11696b526288Smrg  aix_libpath=$lt_cv_aix_libpath
11706b526288Smrgelse
11716b526288Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
11726b526288Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
11736b526288Smrg  lt_aix_libpath_sed='[
11746b526288Smrg      /Import File Strings/,/^$/ {
11756b526288Smrg	  /^0/ {
11766b526288Smrg	      s/^0  *\([^ ]*\) *$/\1/
11776b526288Smrg	      p
11786b526288Smrg	  }
11796b526288Smrg      }]'
11806b526288Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11816b526288Smrg  # Check for a 64-bit object if we didn't find anything.
11826b526288Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
11836b526288Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11846b526288Smrg  fi],[])
11856b526288Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
11866b526288Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
11876b526288Smrg  fi
11886b526288Smrg  ])
11896b526288Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
119011245024Smrgfi
11916b526288Smrg])# _LT_SYS_MODULE_PATH_AIX
119211a29bacSmrg
119311245024Smrg
11946b526288Smrg# _LT_SHELL_INIT(ARG)
11956b526288Smrg# -------------------
11966b526288Smrgm4_define([_LT_SHELL_INIT],
11976b526288Smrg[m4_divert_text([M4SH-INIT], [$1
11986b526288Smrg])])# _LT_SHELL_INIT
119911245024Smrg
120041b2f0bdSmrg
12016b526288Smrg
12026b526288Smrg# _LT_PROG_ECHO_BACKSLASH
120311245024Smrg# -----------------------
12046b526288Smrg# Find how we can fake an echo command that does not interpret backslash.
12056b526288Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
12066b526288Smrg# of the generated configure script that will find a shell with a builtin
12076b526288Smrg# printf (that we can use as an echo command).
12086b526288Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
12096b526288Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
12106b526288SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
12116b526288SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
121211245024Smrg
12136b526288SmrgAC_MSG_CHECKING([how to print strings])
12146b526288Smrg# Test print first, because it will be a builtin if present.
12156b526288Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
12166b526288Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
12176b526288Smrg  ECHO='print -r --'
12186b526288Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
12196b526288Smrg  ECHO='printf %s\n'
12206b526288Smrgelse
12216b526288Smrg  # Use this function as a fallback that always works.
12226b526288Smrg  func_fallback_echo ()
12236b526288Smrg  {
12246b526288Smrg    eval 'cat <<_LTECHO_EOF
12256b526288Smrg$[]1
12266b526288Smrg_LTECHO_EOF'
12276b526288Smrg  }
12286b526288Smrg  ECHO='func_fallback_echo'
122911245024Smrgfi
123041b2f0bdSmrg
12316b526288Smrg# func_echo_all arg...
12326b526288Smrg# Invoke $ECHO with all args, space-separated.
12336b526288Smrgfunc_echo_all ()
12346b526288Smrg{
12356b526288Smrg    $ECHO "$*"
12366b526288Smrg}
123711a29bacSmrg
12386b526288Smrgcase $ECHO in
12396b526288Smrg  printf*) AC_MSG_RESULT([printf]) ;;
12406b526288Smrg  print*) AC_MSG_RESULT([print -r]) ;;
12416b526288Smrg  *) AC_MSG_RESULT([cat]) ;;
12426b526288Smrgesac
124341b2f0bdSmrg
12446b526288Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
12456b526288Smrg[_AS_DETECT_SUGGESTED([
12466b526288Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
12476b526288Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
12486b526288Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
12496b526288Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
12506b526288Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
12516b526288Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
12526b526288Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
125341b2f0bdSmrg
12546b526288Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
12556b526288Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
12566b526288Smrg])# _LT_PROG_ECHO_BACKSLASH
125741b2f0bdSmrg
125841b2f0bdSmrg
12596b526288Smrg# _LT_WITH_SYSROOT
12606b526288Smrg# ----------------
12616b526288SmrgAC_DEFUN([_LT_WITH_SYSROOT],
12626b526288Smrg[AC_MSG_CHECKING([for sysroot])
12636b526288SmrgAC_ARG_WITH([sysroot],
12646b526288Smrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
12656b526288Smrg  [Search for dependent libraries within DIR (or the compiler's sysroot
12666b526288Smrg   if not specified).])],
12676b526288Smrg[], [with_sysroot=no])
12686b526288Smrg
12696b526288Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
12706b526288Smrgdnl in case the user passed a directory name.
12716b526288Smrglt_sysroot=
12726b526288Smrgcase $with_sysroot in #(
12736b526288Smrg yes)
12746b526288Smrg   if test yes = "$GCC"; then
12756b526288Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
12766b526288Smrg   fi
12776b526288Smrg   ;; #(
12786b526288Smrg /*)
12796b526288Smrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
12806b526288Smrg   ;; #(
12816b526288Smrg no|'')
12826b526288Smrg   ;; #(
12836b526288Smrg *)
12846b526288Smrg   AC_MSG_RESULT([$with_sysroot])
12856b526288Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
12866b526288Smrg   ;;
12876b526288Smrgesac
128841b2f0bdSmrg
12896b526288Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
12906b526288Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
12916b526288Smrg[dependent libraries, and where our libraries should be installed.])])
129241b2f0bdSmrg
12936b526288Smrg# _LT_ENABLE_LOCK
12946b526288Smrg# ---------------
12956b526288Smrgm4_defun([_LT_ENABLE_LOCK],
12966b526288Smrg[AC_ARG_ENABLE([libtool-lock],
12976b526288Smrg  [AS_HELP_STRING([--disable-libtool-lock],
12986b526288Smrg    [avoid locking (might break parallel builds)])])
12996b526288Smrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
130041b2f0bdSmrg
13016b526288Smrg# Some flags need to be propagated to the compiler or linker for good
13026b526288Smrg# libtool support.
13036b526288Smrgcase $host in
13046b526288Smrgia64-*-hpux*)
13056b526288Smrg  # Find out what ABI is being produced by ac_compile, and set mode
13066b526288Smrg  # options accordingly.
13076b526288Smrg  echo 'int i;' > conftest.$ac_ext
13086b526288Smrg  if AC_TRY_EVAL(ac_compile); then
13096b526288Smrg    case `/usr/bin/file conftest.$ac_objext` in
13106b526288Smrg      *ELF-32*)
13116b526288Smrg	HPUX_IA64_MODE=32
13126b526288Smrg	;;
13136b526288Smrg      *ELF-64*)
13146b526288Smrg	HPUX_IA64_MODE=64
13156b526288Smrg	;;
13166b526288Smrg    esac
13176b526288Smrg  fi
13186b526288Smrg  rm -rf conftest*
13196b526288Smrg  ;;
13206b526288Smrg*-*-irix6*)
13216b526288Smrg  # Find out what ABI is being produced by ac_compile, and set linker
13226b526288Smrg  # options accordingly.
13236b526288Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
13246b526288Smrg  if AC_TRY_EVAL(ac_compile); then
13256b526288Smrg    if test yes = "$lt_cv_prog_gnu_ld"; then
13266b526288Smrg      case `/usr/bin/file conftest.$ac_objext` in
13276b526288Smrg	*32-bit*)
13286b526288Smrg	  LD="${LD-ld} -melf32bsmip"
13296b526288Smrg	  ;;
13306b526288Smrg	*N32*)
13316b526288Smrg	  LD="${LD-ld} -melf32bmipn32"
13326b526288Smrg	  ;;
13336b526288Smrg	*64-bit*)
13346b526288Smrg	  LD="${LD-ld} -melf64bmip"
13356b526288Smrg	;;
13366b526288Smrg      esac
13376b526288Smrg    else
13386b526288Smrg      case `/usr/bin/file conftest.$ac_objext` in
13396b526288Smrg	*32-bit*)
13406b526288Smrg	  LD="${LD-ld} -32"
13416b526288Smrg	  ;;
13426b526288Smrg	*N32*)
13436b526288Smrg	  LD="${LD-ld} -n32"
13446b526288Smrg	  ;;
13456b526288Smrg	*64-bit*)
13466b526288Smrg	  LD="${LD-ld} -64"
13476b526288Smrg	  ;;
13486b526288Smrg      esac
13496b526288Smrg    fi
13506b526288Smrg  fi
13516b526288Smrg  rm -rf conftest*
13526b526288Smrg  ;;
135341b2f0bdSmrg
13546b526288Smrgmips64*-*linux*)
13556b526288Smrg  # Find out what ABI is being produced by ac_compile, and set linker
13566b526288Smrg  # options accordingly.
13576b526288Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
13586b526288Smrg  if AC_TRY_EVAL(ac_compile); then
13596b526288Smrg    emul=elf
13606b526288Smrg    case `/usr/bin/file conftest.$ac_objext` in
13616b526288Smrg      *32-bit*)
13626b526288Smrg	emul="${emul}32"
13636b526288Smrg	;;
13646b526288Smrg      *64-bit*)
13656b526288Smrg	emul="${emul}64"
13666b526288Smrg	;;
13676b526288Smrg    esac
13686b526288Smrg    case `/usr/bin/file conftest.$ac_objext` in
13696b526288Smrg      *MSB*)
13706b526288Smrg	emul="${emul}btsmip"
13716b526288Smrg	;;
13726b526288Smrg      *LSB*)
13736b526288Smrg	emul="${emul}ltsmip"
13746b526288Smrg	;;
13756b526288Smrg    esac
13766b526288Smrg    case `/usr/bin/file conftest.$ac_objext` in
13776b526288Smrg      *N32*)
13786b526288Smrg	emul="${emul}n32"
13796b526288Smrg	;;
13806b526288Smrg    esac
13816b526288Smrg    LD="${LD-ld} -m $emul"
13826b526288Smrg  fi
13836b526288Smrg  rm -rf conftest*
13846b526288Smrg  ;;
138541b2f0bdSmrg
13866b526288Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
13876b526288Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
13886b526288Smrg  # Find out what ABI is being produced by ac_compile, and set linker
13896b526288Smrg  # options accordingly.  Note that the listed cases only cover the
13906b526288Smrg  # situations where additional linker options are needed (such as when
13916b526288Smrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
13926b526288Smrg  # vice versa); the common cases where no linker options are needed do
13936b526288Smrg  # not appear in the list.
13946b526288Smrg  echo 'int i;' > conftest.$ac_ext
13956b526288Smrg  if AC_TRY_EVAL(ac_compile); then
13966b526288Smrg    case `/usr/bin/file conftest.o` in
13976b526288Smrg      *32-bit*)
13986b526288Smrg	case $host in
13996b526288Smrg	  x86_64-*kfreebsd*-gnu)
14006b526288Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
14016b526288Smrg	    ;;
14026b526288Smrg	  x86_64-*linux*)
14036b526288Smrg	    case `/usr/bin/file conftest.o` in
14046b526288Smrg	      *x86-64*)
14056b526288Smrg		LD="${LD-ld} -m elf32_x86_64"
14066b526288Smrg		;;
14076b526288Smrg	      *)
14086b526288Smrg		LD="${LD-ld} -m elf_i386"
14096b526288Smrg		;;
14106b526288Smrg	    esac
14116b526288Smrg	    ;;
14126b526288Smrg	  powerpc64le-*linux*)
14136b526288Smrg	    LD="${LD-ld} -m elf32lppclinux"
14146b526288Smrg	    ;;
14156b526288Smrg	  powerpc64-*linux*)
14166b526288Smrg	    LD="${LD-ld} -m elf32ppclinux"
14176b526288Smrg	    ;;
14186b526288Smrg	  s390x-*linux*)
14196b526288Smrg	    LD="${LD-ld} -m elf_s390"
14206b526288Smrg	    ;;
14216b526288Smrg	  sparc64-*linux*)
14226b526288Smrg	    LD="${LD-ld} -m elf32_sparc"
14236b526288Smrg	    ;;
14246b526288Smrg	esac
14256b526288Smrg	;;
14266b526288Smrg      *64-bit*)
14276b526288Smrg	case $host in
14286b526288Smrg	  x86_64-*kfreebsd*-gnu)
14296b526288Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
14306b526288Smrg	    ;;
14316b526288Smrg	  x86_64-*linux*)
14326b526288Smrg	    LD="${LD-ld} -m elf_x86_64"
14336b526288Smrg	    ;;
14346b526288Smrg	  powerpcle-*linux*)
14356b526288Smrg	    LD="${LD-ld} -m elf64lppc"
14366b526288Smrg	    ;;
14376b526288Smrg	  powerpc-*linux*)
14386b526288Smrg	    LD="${LD-ld} -m elf64ppc"
14396b526288Smrg	    ;;
14406b526288Smrg	  s390*-*linux*|s390*-*tpf*)
14416b526288Smrg	    LD="${LD-ld} -m elf64_s390"
14426b526288Smrg	    ;;
14436b526288Smrg	  sparc*-*linux*)
14446b526288Smrg	    LD="${LD-ld} -m elf64_sparc"
14456b526288Smrg	    ;;
14466b526288Smrg	esac
14476b526288Smrg	;;
14486b526288Smrg    esac
14496b526288Smrg  fi
14506b526288Smrg  rm -rf conftest*
14516b526288Smrg  ;;
145241b2f0bdSmrg
14536b526288Smrg*-*-sco3.2v5*)
14546b526288Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
14556b526288Smrg  SAVE_CFLAGS=$CFLAGS
14566b526288Smrg  CFLAGS="$CFLAGS -belf"
14576b526288Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
14586b526288Smrg    [AC_LANG_PUSH(C)
14596b526288Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
14606b526288Smrg     AC_LANG_POP])
14616b526288Smrg  if test yes != "$lt_cv_cc_needs_belf"; then
14626b526288Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
14636b526288Smrg    CFLAGS=$SAVE_CFLAGS
14646b526288Smrg  fi
14656b526288Smrg  ;;
14666b526288Smrg*-*solaris*)
14676b526288Smrg  # Find out what ABI is being produced by ac_compile, and set linker
14686b526288Smrg  # options accordingly.
14696b526288Smrg  echo 'int i;' > conftest.$ac_ext
14706b526288Smrg  if AC_TRY_EVAL(ac_compile); then
14716b526288Smrg    case `/usr/bin/file conftest.o` in
14726b526288Smrg    *64-bit*)
14736b526288Smrg      case $lt_cv_prog_gnu_ld in
14746b526288Smrg      yes*)
14756b526288Smrg        case $host in
14766b526288Smrg        i?86-*-solaris*|x86_64-*-solaris*)
14776b526288Smrg          LD="${LD-ld} -m elf_x86_64"
14786b526288Smrg          ;;
14796b526288Smrg        sparc*-*-solaris*)
14806b526288Smrg          LD="${LD-ld} -m elf64_sparc"
14816b526288Smrg          ;;
14826b526288Smrg        esac
14836b526288Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
14846b526288Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
14856b526288Smrg          LD=${LD-ld}_sol2
14866b526288Smrg        fi
14876b526288Smrg        ;;
14886b526288Smrg      *)
14896b526288Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
14906b526288Smrg	  LD="${LD-ld} -64"
14916b526288Smrg	fi
14926b526288Smrg	;;
14936b526288Smrg      esac
14946b526288Smrg      ;;
14956b526288Smrg    esac
14966b526288Smrg  fi
14976b526288Smrg  rm -rf conftest*
14986b526288Smrg  ;;
14996b526288Smrgesac
150011a29bacSmrg
15016b526288Smrgneed_locks=$enable_libtool_lock
15026b526288Smrg])# _LT_ENABLE_LOCK
150341b2f0bdSmrg
150441b2f0bdSmrg
15056b526288Smrg# _LT_PROG_AR
15066b526288Smrg# -----------
15076b526288Smrgm4_defun([_LT_PROG_AR],
15086b526288Smrg[AC_CHECK_TOOLS(AR, [ar], false)
15096b526288Smrg: ${AR=ar}
15106b526288Smrg: ${AR_FLAGS=cru}
15116b526288Smrg_LT_DECL([], [AR], [1], [The archiver])
15126b526288Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
15136b526288Smrg
15146b526288SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
15156b526288Smrg  [lt_cv_ar_at_file=no
15166b526288Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
15176b526288Smrg     [echo conftest.$ac_objext > conftest.lst
15186b526288Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
15196b526288Smrg      AC_TRY_EVAL([lt_ar_try])
15206b526288Smrg      if test 0 -eq "$ac_status"; then
15216b526288Smrg	# Ensure the archiver fails upon bogus file names.
15226b526288Smrg	rm -f conftest.$ac_objext libconftest.a
15236b526288Smrg	AC_TRY_EVAL([lt_ar_try])
15246b526288Smrg	if test 0 -ne "$ac_status"; then
15256b526288Smrg          lt_cv_ar_at_file=@
152611a29bacSmrg        fi
15276b526288Smrg      fi
15286b526288Smrg      rm -f conftest.* libconftest.a
15296b526288Smrg     ])
15306b526288Smrg  ])
153111a29bacSmrg
15326b526288Smrgif test no = "$lt_cv_ar_at_file"; then
15336b526288Smrg  archiver_list_spec=
153411a29bacSmrgelse
15356b526288Smrg  archiver_list_spec=$lt_cv_ar_at_file
15366b526288Smrgfi
15376b526288Smrg_LT_DECL([], [archiver_list_spec], [1],
15386b526288Smrg  [How to feed a file listing to the archiver])
15396b526288Smrg])# _LT_PROG_AR
154011a29bacSmrg
154111a29bacSmrg
15426b526288Smrg# _LT_CMD_OLD_ARCHIVE
15436b526288Smrg# -------------------
15446b526288Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
15456b526288Smrg[_LT_PROG_AR
154611a29bacSmrg
15476b526288SmrgAC_CHECK_TOOL(STRIP, strip, :)
15486b526288Smrgtest -z "$STRIP" && STRIP=:
15496b526288Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
155011a29bacSmrg
15516b526288SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
15526b526288Smrgtest -z "$RANLIB" && RANLIB=:
15536b526288Smrg_LT_DECL([], [RANLIB], [1],
15546b526288Smrg    [Commands used to install an old-style archive])
155511a29bacSmrg
15566b526288Smrg# Determine commands to create old-style static archives.
15576b526288Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
15586b526288Smrgold_postinstall_cmds='chmod 644 $oldlib'
15596b526288Smrgold_postuninstall_cmds=
156011a29bacSmrg
15616b526288Smrgif test -n "$RANLIB"; then
15626b526288Smrg  case $host_os in
15636b526288Smrg  bitrig* | openbsd*)
15646b526288Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
15656b526288Smrg    ;;
15666b526288Smrg  *)
15676b526288Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
15686b526288Smrg    ;;
15696b526288Smrg  esac
15706b526288Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
15716b526288Smrgfi
157211a29bacSmrg
15736b526288Smrgcase $host_os in
15746b526288Smrg  darwin*)
15756b526288Smrg    lock_old_archive_extraction=yes ;;
15766b526288Smrg  *)
15776b526288Smrg    lock_old_archive_extraction=no ;;
157811a29bacSmrgesac
15796b526288Smrg_LT_DECL([], [old_postinstall_cmds], [2])
15806b526288Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
15816b526288Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
15826b526288Smrg    [Commands used to build an old-style archive])
15836b526288Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
15846b526288Smrg    [Whether to use a lock for old archive extraction])
15856b526288Smrg])# _LT_CMD_OLD_ARCHIVE
158611a29bacSmrg
158711a29bacSmrg
15886b526288Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
15896b526288Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
15906b526288Smrg# ----------------------------------------------------------------
15916b526288Smrg# Check whether the given compiler option works
15926b526288SmrgAC_DEFUN([_LT_COMPILER_OPTION],
15936b526288Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
15946b526288Smrgm4_require([_LT_DECL_SED])dnl
15956b526288SmrgAC_CACHE_CHECK([$1], [$2],
15966b526288Smrg  [$2=no
15976b526288Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
15986b526288Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
15996b526288Smrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
16006b526288Smrg   # Insert the option either (1) after the last *FLAGS variable, or
16016b526288Smrg   # (2) before a word containing "conftest.", or (3) at the end.
16026b526288Smrg   # Note that $ac_compile itself does not contain backslashes and begins
16036b526288Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
16046b526288Smrg   # The option is referenced via a variable to avoid confusing sed.
16056b526288Smrg   lt_compile=`echo "$ac_compile" | $SED \
16066b526288Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
16076b526288Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
16086b526288Smrg   -e 's:$: $lt_compiler_flag:'`
16096b526288Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
16106b526288Smrg   (eval "$lt_compile" 2>conftest.err)
16116b526288Smrg   ac_status=$?
16126b526288Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
16136b526288Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
16146b526288Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
16156b526288Smrg     # The compiler can only warn and ignore the option if not recognized
16166b526288Smrg     # So say no if there are warnings other than the usual output.
16176b526288Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
16186b526288Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
16196b526288Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
16206b526288Smrg       $2=yes
16216b526288Smrg     fi
16226b526288Smrg   fi
16236b526288Smrg   $RM conftest*
16246b526288Smrg])
162511a29bacSmrg
16266b526288Smrgif test yes = "[$]$2"; then
16276b526288Smrg    m4_if([$5], , :, [$5])
16286b526288Smrgelse
16296b526288Smrg    m4_if([$6], , :, [$6])
16306b526288Smrgfi
16316b526288Smrg])# _LT_COMPILER_OPTION
163211a29bacSmrg
16336b526288Smrg# Old name:
16346b526288SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
163511a29bacSmrgdnl aclocal-1.4 backwards compatibility:
16366b526288Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
163711a29bacSmrg
163811a29bacSmrg
16396b526288Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
16406b526288Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
16416b526288Smrg# ----------------------------------------------------
16426b526288Smrg# Check whether the given linker option works
16436b526288SmrgAC_DEFUN([_LT_LINKER_OPTION],
16446b526288Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
16456b526288Smrgm4_require([_LT_DECL_SED])dnl
16466b526288SmrgAC_CACHE_CHECK([$1], [$2],
16476b526288Smrg  [$2=no
16486b526288Smrg   save_LDFLAGS=$LDFLAGS
16496b526288Smrg   LDFLAGS="$LDFLAGS $3"
16506b526288Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
16516b526288Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
16526b526288Smrg     # The linker can only warn and ignore the option if not recognized
16536b526288Smrg     # So say no if there are warnings
16546b526288Smrg     if test -s conftest.err; then
16556b526288Smrg       # Append any errors to the config.log.
16566b526288Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
16576b526288Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
16586b526288Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
16596b526288Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
16606b526288Smrg         $2=yes
16616b526288Smrg       fi
16626b526288Smrg     else
16636b526288Smrg       $2=yes
16646b526288Smrg     fi
16656b526288Smrg   fi
16666b526288Smrg   $RM -r conftest*
16676b526288Smrg   LDFLAGS=$save_LDFLAGS
166811a29bacSmrg])
166911a29bacSmrg
16706b526288Smrgif test yes = "[$]$2"; then
16716b526288Smrg    m4_if([$4], , :, [$4])
16726b526288Smrgelse
16736b526288Smrg    m4_if([$5], , :, [$5])
16746b526288Smrgfi
16756b526288Smrg])# _LT_LINKER_OPTION
167611a29bacSmrg
16776b526288Smrg# Old name:
16786b526288SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
16796b526288Smrgdnl aclocal-1.4 backwards compatibility:
16806b526288Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
168111a29bacSmrg
168211a29bacSmrg
16836b526288Smrg# LT_CMD_MAX_LEN
16846b526288Smrg#---------------
16856b526288SmrgAC_DEFUN([LT_CMD_MAX_LEN],
168611a29bacSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
16876b526288Smrg# find the maximum length of command line arguments
16886b526288SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
16896b526288SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
16906b526288Smrg  i=0
16916b526288Smrg  teststring=ABCD
169241b2f0bdSmrg
16936b526288Smrg  case $build_os in
16946b526288Smrg  msdosdjgpp*)
16956b526288Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
16966b526288Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
16976b526288Smrg    # during glob expansion).  Even if it were fixed, the result of this
16986b526288Smrg    # check would be larger than it should be.
16996b526288Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
17006b526288Smrg    ;;
170111a29bacSmrg
17026b526288Smrg  gnu*)
17036b526288Smrg    # Under GNU Hurd, this test is not required because there is
17046b526288Smrg    # no limit to the length of command line arguments.
17056b526288Smrg    # Libtool will interpret -1 as no limit whatsoever
17066b526288Smrg    lt_cv_sys_max_cmd_len=-1;
17076b526288Smrg    ;;
170811a29bacSmrg
17096b526288Smrg  cygwin* | mingw* | cegcc*)
17106b526288Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
17116b526288Smrg    # about 5 minutes as the teststring grows exponentially.
17126b526288Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
17136b526288Smrg    # you end up with a "frozen" computer, even though with patience
17146b526288Smrg    # the test eventually succeeds (with a max line length of 256k).
17156b526288Smrg    # Instead, let's just punt: use the minimum linelength reported by
17166b526288Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
17176b526288Smrg    lt_cv_sys_max_cmd_len=8192;
17186b526288Smrg    ;;
171941b2f0bdSmrg
17206b526288Smrg  mint*)
17216b526288Smrg    # On MiNT this can take a long time and run out of memory.
17226b526288Smrg    lt_cv_sys_max_cmd_len=8192;
17236b526288Smrg    ;;
172441b2f0bdSmrg
17256b526288Smrg  amigaos*)
17266b526288Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
17276b526288Smrg    # So we just punt and use a minimum line length of 8192.
17286b526288Smrg    lt_cv_sys_max_cmd_len=8192;
17296b526288Smrg    ;;
173041b2f0bdSmrg
17316b526288Smrg  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
17326b526288Smrg    # This has been around since 386BSD, at least.  Likely further.
17336b526288Smrg    if test -x /sbin/sysctl; then
17346b526288Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
17356b526288Smrg    elif test -x /usr/sbin/sysctl; then
17366b526288Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
17376b526288Smrg    else
17386b526288Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
17396b526288Smrg    fi
17406b526288Smrg    # And add a safety zone
17416b526288Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
17426b526288Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
17436b526288Smrg    ;;
174441b2f0bdSmrg
17456b526288Smrg  interix*)
17466b526288Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
17476b526288Smrg    lt_cv_sys_max_cmd_len=196608
17486b526288Smrg    ;;
174941b2f0bdSmrg
17506b526288Smrg  os2*)
17516b526288Smrg    # The test takes a long time on OS/2.
17526b526288Smrg    lt_cv_sys_max_cmd_len=8192
17536b526288Smrg    ;;
175441b2f0bdSmrg
17556b526288Smrg  osf*)
17566b526288Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
17576b526288Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
17586b526288Smrg    # nice to cause kernel panics so lets avoid the loop below.
17596b526288Smrg    # First set a reasonable default.
17606b526288Smrg    lt_cv_sys_max_cmd_len=16384
17616b526288Smrg    #
17626b526288Smrg    if test -x /sbin/sysconfig; then
17636b526288Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
17646b526288Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
17656b526288Smrg      esac
17666b526288Smrg    fi
17676b526288Smrg    ;;
17686b526288Smrg  sco3.2v5*)
17696b526288Smrg    lt_cv_sys_max_cmd_len=102400
17706b526288Smrg    ;;
17716b526288Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
17726b526288Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
17736b526288Smrg    if test -n "$kargmax"; then
17746b526288Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
17756b526288Smrg    else
17766b526288Smrg      lt_cv_sys_max_cmd_len=32768
17776b526288Smrg    fi
17786b526288Smrg    ;;
17796b526288Smrg  *)
17806b526288Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
17816b526288Smrg    if test -n "$lt_cv_sys_max_cmd_len" && \
17826b526288Smrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
17836b526288Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
17846b526288Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
17856b526288Smrg    else
17866b526288Smrg      # Make teststring a little bigger before we do anything with it.
17876b526288Smrg      # a 1K string should be a reasonable start.
17886b526288Smrg      for i in 1 2 3 4 5 6 7 8; do
17896b526288Smrg        teststring=$teststring$teststring
17906b526288Smrg      done
17916b526288Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
17926b526288Smrg      # If test is not a shell built-in, we'll probably end up computing a
17936b526288Smrg      # maximum length that is only half of the actual maximum length, but
17946b526288Smrg      # we can't tell.
17956b526288Smrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
17966b526288Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
17976b526288Smrg	      test 17 != "$i" # 1/2 MB should be enough
17986b526288Smrg      do
17996b526288Smrg        i=`expr $i + 1`
18006b526288Smrg        teststring=$teststring$teststring
18016b526288Smrg      done
18026b526288Smrg      # Only check the string length outside the loop.
18036b526288Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
18046b526288Smrg      teststring=
18056b526288Smrg      # Add a significant safety factor because C++ compilers can tack on
18066b526288Smrg      # massive amounts of additional arguments before passing them to the
18076b526288Smrg      # linker.  It appears as though 1/2 is a usable value.
18086b526288Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
18096b526288Smrg    fi
18106b526288Smrg    ;;
18116b526288Smrg  esac
18126b526288Smrg])
18136b526288Smrgif test -n "$lt_cv_sys_max_cmd_len"; then
18146b526288Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
18156b526288Smrgelse
18166b526288Smrg  AC_MSG_RESULT(none)
18176b526288Smrgfi
18186b526288Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
18196b526288Smrg_LT_DECL([], [max_cmd_len], [0],
18206b526288Smrg    [What is the maximum length of a command?])
18216b526288Smrg])# LT_CMD_MAX_LEN
182241b2f0bdSmrg
18236b526288Smrg# Old name:
18246b526288SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
18256b526288Smrgdnl aclocal-1.4 backwards compatibility:
18266b526288Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
182741b2f0bdSmrg
182841b2f0bdSmrg
18296b526288Smrg# _LT_HEADER_DLFCN
18306b526288Smrg# ----------------
18316b526288Smrgm4_defun([_LT_HEADER_DLFCN],
18326b526288Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
18336b526288Smrg])# _LT_HEADER_DLFCN
183441b2f0bdSmrg
183541b2f0bdSmrg
18366b526288Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
18376b526288Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
18386b526288Smrg# ----------------------------------------------------------------
18396b526288Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
18406b526288Smrg[m4_require([_LT_HEADER_DLFCN])dnl
18416b526288Smrgif test yes = "$cross_compiling"; then :
18426b526288Smrg  [$4]
18436b526288Smrgelse
18446b526288Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
18456b526288Smrg  lt_status=$lt_dlunknown
18466b526288Smrg  cat > conftest.$ac_ext <<_LT_EOF
18476b526288Smrg[#line $LINENO "configure"
18486b526288Smrg#include "confdefs.h"
184941b2f0bdSmrg
18506b526288Smrg#if HAVE_DLFCN_H
18516b526288Smrg#include <dlfcn.h>
18526b526288Smrg#endif
185341b2f0bdSmrg
18546b526288Smrg#include <stdio.h>
185541b2f0bdSmrg
18566b526288Smrg#ifdef RTLD_GLOBAL
18576b526288Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
18586b526288Smrg#else
18596b526288Smrg#  ifdef DL_GLOBAL
18606b526288Smrg#    define LT_DLGLOBAL		DL_GLOBAL
18616b526288Smrg#  else
18626b526288Smrg#    define LT_DLGLOBAL		0
18636b526288Smrg#  endif
18646b526288Smrg#endif
186541b2f0bdSmrg
18666b526288Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
18676b526288Smrg   find out it does not work in some platform. */
18686b526288Smrg#ifndef LT_DLLAZY_OR_NOW
18696b526288Smrg#  ifdef RTLD_LAZY
18706b526288Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
18716b526288Smrg#  else
18726b526288Smrg#    ifdef DL_LAZY
18736b526288Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
18746b526288Smrg#    else
18756b526288Smrg#      ifdef RTLD_NOW
18766b526288Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
18776b526288Smrg#      else
18786b526288Smrg#        ifdef DL_NOW
18796b526288Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
18806b526288Smrg#        else
18816b526288Smrg#          define LT_DLLAZY_OR_NOW	0
18826b526288Smrg#        endif
18836b526288Smrg#      endif
18846b526288Smrg#    endif
18856b526288Smrg#  endif
18866b526288Smrg#endif
188741b2f0bdSmrg
18886b526288Smrg/* When -fvisibility=hidden is used, assume the code has been annotated
18896b526288Smrg   correspondingly for the symbols needed.  */
18906b526288Smrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
18916b526288Smrgint fnord () __attribute__((visibility("default")));
18926b526288Smrg#endif
189341b2f0bdSmrg
18946b526288Smrgint fnord () { return 42; }
18956b526288Smrgint main ()
18966b526288Smrg{
18976b526288Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
18986b526288Smrg  int status = $lt_dlunknown;
189941b2f0bdSmrg
19006b526288Smrg  if (self)
19016b526288Smrg    {
19026b526288Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
19036b526288Smrg      else
19046b526288Smrg        {
19056b526288Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
19066b526288Smrg          else puts (dlerror ());
19076b526288Smrg	}
19086b526288Smrg      /* dlclose (self); */
19096b526288Smrg    }
19106b526288Smrg  else
19116b526288Smrg    puts (dlerror ());
191241b2f0bdSmrg
19136b526288Smrg  return status;
19146b526288Smrg}]
19156b526288Smrg_LT_EOF
19166b526288Smrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
19176b526288Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
19186b526288Smrg    lt_status=$?
19196b526288Smrg    case x$lt_status in
19206b526288Smrg      x$lt_dlno_uscore) $1 ;;
19216b526288Smrg      x$lt_dlneed_uscore) $2 ;;
19226b526288Smrg      x$lt_dlunknown|x*) $3 ;;
19236b526288Smrg    esac
19246b526288Smrg  else :
19256b526288Smrg    # compilation failed
19266b526288Smrg    $3
19276b526288Smrg  fi
19286b526288Smrgfi
19296b526288Smrgrm -fr conftest*
19306b526288Smrg])# _LT_TRY_DLOPEN_SELF
193141b2f0bdSmrg
193211a29bacSmrg
19336b526288Smrg# LT_SYS_DLOPEN_SELF
19346b526288Smrg# ------------------
19356b526288SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
19366b526288Smrg[m4_require([_LT_HEADER_DLFCN])dnl
19376b526288Smrgif test yes != "$enable_dlopen"; then
19386b526288Smrg  enable_dlopen=unknown
19396b526288Smrg  enable_dlopen_self=unknown
19406b526288Smrg  enable_dlopen_self_static=unknown
19416b526288Smrgelse
19426b526288Smrg  lt_cv_dlopen=no
19436b526288Smrg  lt_cv_dlopen_libs=
194411a29bacSmrg
19456b526288Smrg  case $host_os in
19466b526288Smrg  beos*)
19476b526288Smrg    lt_cv_dlopen=load_add_on
19486b526288Smrg    lt_cv_dlopen_libs=
19496b526288Smrg    lt_cv_dlopen_self=yes
19506b526288Smrg    ;;
195111a29bacSmrg
19526b526288Smrg  mingw* | pw32* | cegcc*)
19536b526288Smrg    lt_cv_dlopen=LoadLibrary
19546b526288Smrg    lt_cv_dlopen_libs=
19556b526288Smrg    ;;
195611a29bacSmrg
19576b526288Smrg  cygwin*)
19586b526288Smrg    lt_cv_dlopen=dlopen
19596b526288Smrg    lt_cv_dlopen_libs=
19606b526288Smrg    ;;
196111a29bacSmrg
19626b526288Smrg  darwin*)
19636b526288Smrg    # if libdl is installed we need to link against it
19646b526288Smrg    AC_CHECK_LIB([dl], [dlopen],
19656b526288Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
19666b526288Smrg    lt_cv_dlopen=dyld
19676b526288Smrg    lt_cv_dlopen_libs=
19686b526288Smrg    lt_cv_dlopen_self=yes
19696b526288Smrg    ])
19706b526288Smrg    ;;
197111a29bacSmrg
19726b526288Smrg  tpf*)
19736b526288Smrg    # Don't try to run any link tests for TPF.  We know it's impossible
19746b526288Smrg    # because TPF is a cross-compiler, and we know how we open DSOs.
19756b526288Smrg    lt_cv_dlopen=dlopen
19766b526288Smrg    lt_cv_dlopen_libs=
19776b526288Smrg    lt_cv_dlopen_self=no
19786b526288Smrg    ;;
197911a29bacSmrg
19806b526288Smrg  *)
19816b526288Smrg    AC_CHECK_FUNC([shl_load],
19826b526288Smrg	  [lt_cv_dlopen=shl_load],
19836b526288Smrg      [AC_CHECK_LIB([dld], [shl_load],
19846b526288Smrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
19856b526288Smrg	[AC_CHECK_FUNC([dlopen],
19866b526288Smrg	      [lt_cv_dlopen=dlopen],
19876b526288Smrg	  [AC_CHECK_LIB([dl], [dlopen],
19886b526288Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
19896b526288Smrg	    [AC_CHECK_LIB([svld], [dlopen],
19906b526288Smrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
19916b526288Smrg	      [AC_CHECK_LIB([dld], [dld_link],
19926b526288Smrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
19936b526288Smrg	      ])
19946b526288Smrg	    ])
19956b526288Smrg	  ])
19966b526288Smrg	])
19976b526288Smrg      ])
19986b526288Smrg    ;;
19996b526288Smrg  esac
200041b2f0bdSmrg
20016b526288Smrg  if test no = "$lt_cv_dlopen"; then
20026b526288Smrg    enable_dlopen=no
20036b526288Smrg  else
20046b526288Smrg    enable_dlopen=yes
20056b526288Smrg  fi
200641b2f0bdSmrg
20076b526288Smrg  case $lt_cv_dlopen in
20086b526288Smrg  dlopen)
20096b526288Smrg    save_CPPFLAGS=$CPPFLAGS
20106b526288Smrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
201111a29bacSmrg
20126b526288Smrg    save_LDFLAGS=$LDFLAGS
20136b526288Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
201411a29bacSmrg
20156b526288Smrg    save_LIBS=$LIBS
20166b526288Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
201711a29bacSmrg
20186b526288Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
20196b526288Smrg	  lt_cv_dlopen_self, [dnl
20206b526288Smrg	  _LT_TRY_DLOPEN_SELF(
20216b526288Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
20226b526288Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
20236b526288Smrg    ])
202411a29bacSmrg
20256b526288Smrg    if test yes = "$lt_cv_dlopen_self"; then
20266b526288Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
20276b526288Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
20286b526288Smrg	  lt_cv_dlopen_self_static, [dnl
20296b526288Smrg	  _LT_TRY_DLOPEN_SELF(
20306b526288Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
20316b526288Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
20326b526288Smrg      ])
20336b526288Smrg    fi
203411a29bacSmrg
20356b526288Smrg    CPPFLAGS=$save_CPPFLAGS
20366b526288Smrg    LDFLAGS=$save_LDFLAGS
20376b526288Smrg    LIBS=$save_LIBS
20386b526288Smrg    ;;
20396b526288Smrg  esac
204041b2f0bdSmrg
20416b526288Smrg  case $lt_cv_dlopen_self in
20426b526288Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
20436b526288Smrg  *) enable_dlopen_self=unknown ;;
20446b526288Smrg  esac
204541b2f0bdSmrg
20466b526288Smrg  case $lt_cv_dlopen_self_static in
20476b526288Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
20486b526288Smrg  *) enable_dlopen_self_static=unknown ;;
20496b526288Smrg  esac
20506b526288Smrgfi
20516b526288Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
20526b526288Smrg	 [Whether dlopen is supported])
20536b526288Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
20546b526288Smrg	 [Whether dlopen of programs is supported])
20556b526288Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
20566b526288Smrg	 [Whether dlopen of statically linked programs is supported])
20576b526288Smrg])# LT_SYS_DLOPEN_SELF
205811245024Smrg
20596b526288Smrg# Old name:
20606b526288SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
20616b526288Smrgdnl aclocal-1.4 backwards compatibility:
20626b526288Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
206311245024Smrg
206411a29bacSmrg
20656b526288Smrg# _LT_COMPILER_C_O([TAGNAME])
20666b526288Smrg# ---------------------------
20676b526288Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
20686b526288Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
20696b526288Smrgm4_defun([_LT_COMPILER_C_O],
20706b526288Smrg[m4_require([_LT_DECL_SED])dnl
20716b526288Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
20726b526288Smrgm4_require([_LT_TAG_COMPILER])dnl
20736b526288SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
20746b526288Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
20756b526288Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
20766b526288Smrg   $RM -r conftest 2>/dev/null
20776b526288Smrg   mkdir conftest
20786b526288Smrg   cd conftest
20796b526288Smrg   mkdir out
20806b526288Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
208111a29bacSmrg
20826b526288Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
20836b526288Smrg   # Insert the option either (1) after the last *FLAGS variable, or
20846b526288Smrg   # (2) before a word containing "conftest.", or (3) at the end.
20856b526288Smrg   # Note that $ac_compile itself does not contain backslashes and begins
20866b526288Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
20876b526288Smrg   lt_compile=`echo "$ac_compile" | $SED \
20886b526288Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
20896b526288Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
20906b526288Smrg   -e 's:$: $lt_compiler_flag:'`
20916b526288Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
20926b526288Smrg   (eval "$lt_compile" 2>out/conftest.err)
20936b526288Smrg   ac_status=$?
20946b526288Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
20956b526288Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
20966b526288Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
20976b526288Smrg   then
20986b526288Smrg     # The compiler can only warn and ignore the option if not recognized
20996b526288Smrg     # So say no if there are warnings
21006b526288Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
21016b526288Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
21026b526288Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
21036b526288Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
21046b526288Smrg     fi
21056b526288Smrg   fi
21066b526288Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
21076b526288Smrg   $RM conftest*
21086b526288Smrg   # SGI C++ compiler will create directory out/ii_files/ for
21096b526288Smrg   # template instantiation
21106b526288Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
21116b526288Smrg   $RM out/* && rmdir out
21126b526288Smrg   cd ..
21136b526288Smrg   $RM -r conftest
21146b526288Smrg   $RM conftest*
211511a29bacSmrg])
21166b526288Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
21176b526288Smrg	[Does compiler simultaneously support -c and -o options?])
21186b526288Smrg])# _LT_COMPILER_C_O
211911a29bacSmrg
212011a29bacSmrg
21216b526288Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
21226b526288Smrg# ----------------------------------
21236b526288Smrg# Check to see if we can do hard links to lock some files if needed
21246b526288Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
21256b526288Smrg[m4_require([_LT_ENABLE_LOCK])dnl
21266b526288Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
21276b526288Smrg_LT_COMPILER_C_O([$1])
212811a29bacSmrg
21296b526288Smrghard_links=nottested
21306b526288Smrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
21316b526288Smrg  # do not overwrite the value of need_locks provided by the user
21326b526288Smrg  AC_MSG_CHECKING([if we can lock with hard links])
21336b526288Smrg  hard_links=yes
21346b526288Smrg  $RM conftest*
21356b526288Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
21366b526288Smrg  touch conftest.a
21376b526288Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
21386b526288Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
21396b526288Smrg  AC_MSG_RESULT([$hard_links])
21406b526288Smrg  if test no = "$hard_links"; then
21416b526288Smrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
21426b526288Smrg    need_locks=warn
21436b526288Smrg  fi
21446b526288Smrgelse
21456b526288Smrg  need_locks=no
21466b526288Smrgfi
21476b526288Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
21486b526288Smrg])# _LT_COMPILER_FILE_LOCKS
214911a29bacSmrg
215011a29bacSmrg
21516b526288Smrg# _LT_CHECK_OBJDIR
21526b526288Smrg# ----------------
21536b526288Smrgm4_defun([_LT_CHECK_OBJDIR],
21546b526288Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
21556b526288Smrg[rm -f .libs 2>/dev/null
21566b526288Smrgmkdir .libs 2>/dev/null
21576b526288Smrgif test -d .libs; then
21586b526288Smrg  lt_cv_objdir=.libs
21596b526288Smrgelse
21606b526288Smrg  # MS-DOS does not allow filenames that begin with a dot.
21616b526288Smrg  lt_cv_objdir=_libs
21626b526288Smrgfi
21636b526288Smrgrmdir .libs 2>/dev/null])
21646b526288Smrgobjdir=$lt_cv_objdir
21656b526288Smrg_LT_DECL([], [objdir], [0],
21666b526288Smrg         [The name of the directory that contains temporary libtool files])dnl
21676b526288Smrgm4_pattern_allow([LT_OBJDIR])dnl
21686b526288SmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
21696b526288Smrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
21706b526288Smrg])# _LT_CHECK_OBJDIR
217111a29bacSmrg
217211a29bacSmrg
21736b526288Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
21746b526288Smrg# --------------------------------------
21756b526288Smrg# Check hardcoding attributes.
21766b526288Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
21776b526288Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
21786b526288Smrg_LT_TAGVAR(hardcode_action, $1)=
21796b526288Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
21806b526288Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
21816b526288Smrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
218211a29bacSmrg
21836b526288Smrg  # We can hardcode non-existent directories.
21846b526288Smrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
21856b526288Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
21866b526288Smrg     # have to relink, otherwise we might link with an installed library
21876b526288Smrg     # when we should be linking with a yet-to-be-installed one
21886b526288Smrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
21896b526288Smrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
21906b526288Smrg    # Linking always hardcodes the temporary library directory.
21916b526288Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
21926b526288Smrg  else
21936b526288Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
21946b526288Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
21956b526288Smrg  fi
21966b526288Smrgelse
21976b526288Smrg  # We cannot hardcode anything, or else we can only hardcode existing
21986b526288Smrg  # directories.
21996b526288Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
22006b526288Smrgfi
22016b526288SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
220211a29bacSmrg
22036b526288Smrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
22046b526288Smrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
22056b526288Smrg  # Fast installation is not supported
22066b526288Smrg  enable_fast_install=no
22076b526288Smrgelif test yes = "$shlibpath_overrides_runpath" ||
22086b526288Smrg     test no = "$enable_shared"; then
22096b526288Smrg  # Fast installation is not necessary
22106b526288Smrg  enable_fast_install=needless
22116b526288Smrgfi
22126b526288Smrg_LT_TAGDECL([], [hardcode_action], [0],
22136b526288Smrg    [How to hardcode a shared library path into an executable])
22146b526288Smrg])# _LT_LINKER_HARDCODE_LIBPATH
221511a29bacSmrg
221611a29bacSmrg
22176b526288Smrg# _LT_CMD_STRIPLIB
221811a29bacSmrg# ----------------
22196b526288Smrgm4_defun([_LT_CMD_STRIPLIB],
22206b526288Smrg[m4_require([_LT_DECL_EGREP])
22216b526288Smrgstriplib=
22226b526288Smrgold_striplib=
22236b526288SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
22246b526288Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
22256b526288Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
22266b526288Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
22276b526288Smrg  AC_MSG_RESULT([yes])
22286b526288Smrgelse
22296b526288Smrg# FIXME - insert some real tests, host_os isn't really good enough
22306b526288Smrg  case $host_os in
22316b526288Smrg  darwin*)
22326b526288Smrg    if test -n "$STRIP"; then
22336b526288Smrg      striplib="$STRIP -x"
22346b526288Smrg      old_striplib="$STRIP -S"
22356b526288Smrg      AC_MSG_RESULT([yes])
22366b526288Smrg    else
22376b526288Smrg      AC_MSG_RESULT([no])
22386b526288Smrg    fi
22396b526288Smrg    ;;
22406b526288Smrg  *)
22416b526288Smrg    AC_MSG_RESULT([no])
22426b526288Smrg    ;;
22436b526288Smrg  esac
22446b526288Smrgfi
22456b526288Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
22466b526288Smrg_LT_DECL([], [striplib], [1])
22476b526288Smrg])# _LT_CMD_STRIPLIB
224811a29bacSmrg
224911a29bacSmrg
22506b526288Smrg# _LT_PREPARE_MUNGE_PATH_LIST
22516b526288Smrg# ---------------------------
22526b526288Smrg# Make sure func_munge_path_list() is defined correctly.
22536b526288Smrgm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
22546b526288Smrg[[# func_munge_path_list VARIABLE PATH
225511a29bacSmrg# -----------------------------------
22566b526288Smrg# VARIABLE is name of variable containing _space_ separated list of
22576b526288Smrg# directories to be munged by the contents of PATH, which is string
22586b526288Smrg# having a format:
22596b526288Smrg# "DIR[:DIR]:"
22606b526288Smrg#       string "DIR[ DIR]" will be prepended to VARIABLE
22616b526288Smrg# ":DIR[:DIR]"
22626b526288Smrg#       string "DIR[ DIR]" will be appended to VARIABLE
22636b526288Smrg# "DIRP[:DIRP]::[DIRA:]DIRA"
22646b526288Smrg#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
22656b526288Smrg#       "DIRA[ DIRA]" will be appended to VARIABLE
22666b526288Smrg# "DIR[:DIR]"
22676b526288Smrg#       VARIABLE will be replaced by "DIR[ DIR]"
22686b526288Smrgfunc_munge_path_list ()
226911a29bacSmrg{
22706b526288Smrg    case x@S|@2 in
22716b526288Smrg    x)
22726b526288Smrg        ;;
22736b526288Smrg    *:)
22746b526288Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
22756b526288Smrg        ;;
22766b526288Smrg    x:*)
22776b526288Smrg        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
22786b526288Smrg        ;;
22796b526288Smrg    *::*)
22806b526288Smrg        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
22816b526288Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
22826b526288Smrg        ;;
228311a29bacSmrg    *)
22846b526288Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
22856b526288Smrg        ;;
228611a29bacSmrg    esac
22876b526288Smrg}
22886b526288Smrg]])# _LT_PREPARE_PATH_LIST
228911a29bacSmrg
229011a29bacSmrg
22916b526288Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
22926b526288Smrg# -----------------------------
22936b526288Smrg# PORTME Fill in your ld.so characteristics
22946b526288Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
22956b526288Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
22966b526288Smrgm4_require([_LT_DECL_EGREP])dnl
22976b526288Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
22986b526288Smrgm4_require([_LT_DECL_OBJDUMP])dnl
22996b526288Smrgm4_require([_LT_DECL_SED])dnl
23006b526288Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
23016b526288Smrgm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
23026b526288SmrgAC_MSG_CHECKING([dynamic linker characteristics])
23036b526288Smrgm4_if([$1],
23046b526288Smrg	[], [
23056b526288Smrgif test yes = "$GCC"; then
23066b526288Smrg  case $host_os in
23076b526288Smrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
23086b526288Smrg    *) lt_awk_arg='/^libraries:/' ;;
23096b526288Smrg  esac
23106b526288Smrg  case $host_os in
23116b526288Smrg    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
23126b526288Smrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
23136b526288Smrg  esac
23146b526288Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
23156b526288Smrg  case $lt_search_path_spec in
23166b526288Smrg  *\;*)
23176b526288Smrg    # if the path contains ";" then we assume it to be the separator
23186b526288Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
23196b526288Smrg    # assumed that no part of a normal pathname contains ";" but that should
23206b526288Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
23216b526288Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
23226b526288Smrg    ;;
23236b526288Smrg  *)
23246b526288Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
23256b526288Smrg    ;;
23266b526288Smrg  esac
23276b526288Smrg  # Ok, now we have the path, separated by spaces, we can step through it
23286b526288Smrg  # and add multilib dir if necessary...
23296b526288Smrg  lt_tmp_lt_search_path_spec=
23306b526288Smrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
23316b526288Smrg  # ...but if some path component already ends with the multilib dir we assume
23326b526288Smrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
23336b526288Smrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
23346b526288Smrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
23356b526288Smrg    lt_multi_os_dir=
23366b526288Smrg    ;;
23376b526288Smrg  esac
23386b526288Smrg  for lt_sys_path in $lt_search_path_spec; do
23396b526288Smrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
23406b526288Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
23416b526288Smrg    elif test -n "$lt_multi_os_dir"; then
23426b526288Smrg      test -d "$lt_sys_path" && \
23436b526288Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
23446b526288Smrg    fi
23456b526288Smrg  done
23466b526288Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
23476b526288SmrgBEGIN {RS = " "; FS = "/|\n";} {
23486b526288Smrg  lt_foo = "";
23496b526288Smrg  lt_count = 0;
23506b526288Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
23516b526288Smrg    if ($lt_i != "" && $lt_i != ".") {
23526b526288Smrg      if ($lt_i == "..") {
23536b526288Smrg        lt_count++;
23546b526288Smrg      } else {
23556b526288Smrg        if (lt_count == 0) {
23566b526288Smrg          lt_foo = "/" $lt_i lt_foo;
23576b526288Smrg        } else {
23586b526288Smrg          lt_count--;
23596b526288Smrg        }
23606b526288Smrg      }
23616b526288Smrg    }
23626b526288Smrg  }
23636b526288Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
23646b526288Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
23656b526288Smrg}'`
23666b526288Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
23676b526288Smrg  # for these hosts.
23686b526288Smrg  case $host_os in
23696b526288Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
23706b526288Smrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
23716b526288Smrg  esac
23726b526288Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
23736b526288Smrgelse
23746b526288Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
23756b526288Smrgfi])
23766b526288Smrglibrary_names_spec=
23776b526288Smrglibname_spec='lib$name'
23786b526288Smrgsoname_spec=
23796b526288Smrgshrext_cmds=.so
23806b526288Smrgpostinstall_cmds=
23816b526288Smrgpostuninstall_cmds=
23826b526288Smrgfinish_cmds=
23836b526288Smrgfinish_eval=
23846b526288Smrgshlibpath_var=
23856b526288Smrgshlibpath_overrides_runpath=unknown
23866b526288Smrgversion_type=none
23876b526288Smrgdynamic_linker="$host_os ld.so"
23886b526288Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
23896b526288Smrgneed_lib_prefix=unknown
23906b526288Smrghardcode_into_libs=no
239111a29bacSmrg
23926b526288Smrg# when you set need_version to no, make sure it does not cause -set_version
23936b526288Smrg# flags to be left without arguments
23946b526288Smrgneed_version=unknown
239511a29bacSmrg
23966b526288SmrgAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
23976b526288Smrg[User-defined run-time library search path.])
239811a29bacSmrg
23996b526288Smrgcase $host_os in
24006b526288Smrgaix3*)
24016b526288Smrg  version_type=linux # correct to gnu/linux during the next big refactor
24026b526288Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
24036b526288Smrg  shlibpath_var=LIBPATH
240411a29bacSmrg
24056b526288Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
24066b526288Smrg  soname_spec='$libname$release$shared_ext$major'
24076b526288Smrg  ;;
240811a29bacSmrg
24096b526288Smrgaix[[4-9]]*)
24106b526288Smrg  version_type=linux # correct to gnu/linux during the next big refactor
24116b526288Smrg  need_lib_prefix=no
24126b526288Smrg  need_version=no
24136b526288Smrg  hardcode_into_libs=yes
24146b526288Smrg  if test ia64 = "$host_cpu"; then
24156b526288Smrg    # AIX 5 supports IA64
24166b526288Smrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
24176b526288Smrg    shlibpath_var=LD_LIBRARY_PATH
24186b526288Smrg  else
24196b526288Smrg    # With GCC up to 2.95.x, collect2 would create an import file
24206b526288Smrg    # for dependence libraries.  The import file would start with
24216b526288Smrg    # the line '#! .'.  This would cause the generated library to
24226b526288Smrg    # depend on '.', always an invalid library.  This was fixed in
24236b526288Smrg    # development snapshots of GCC prior to 3.0.
24246b526288Smrg    case $host_os in
24256b526288Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
24266b526288Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
24276b526288Smrg	   echo ' yes '
24286b526288Smrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
24296b526288Smrg	:
24306b526288Smrg      else
24316b526288Smrg	can_build_shared=no
24326b526288Smrg      fi
24336b526288Smrg      ;;
24346b526288Smrg    esac
24356b526288Smrg    # Using Import Files as archive members, it is possible to support
24366b526288Smrg    # filename-based versioning of shared library archives on AIX. While
24376b526288Smrg    # this would work for both with and without runtime linking, it will
24386b526288Smrg    # prevent static linking of such archives. So we do filename-based
24396b526288Smrg    # shared library versioning with .so extension only, which is used
24406b526288Smrg    # when both runtime linking and shared linking is enabled.
24416b526288Smrg    # Unfortunately, runtime linking may impact performance, so we do
24426b526288Smrg    # not want this to be the default eventually. Also, we use the
24436b526288Smrg    # versioned .so libs for executables only if there is the -brtl
24446b526288Smrg    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
24456b526288Smrg    # To allow for filename-based versioning support, we need to create
24466b526288Smrg    # libNAME.so.V as an archive file, containing:
24476b526288Smrg    # *) an Import File, referring to the versioned filename of the
24486b526288Smrg    #    archive as well as the shared archive member, telling the
24496b526288Smrg    #    bitwidth (32 or 64) of that shared object, and providing the
24506b526288Smrg    #    list of exported symbols of that shared object, eventually
24516b526288Smrg    #    decorated with the 'weak' keyword
24526b526288Smrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
24536b526288Smrg    #    it being seen by the linker.
24546b526288Smrg    # At run time we better use the real file rather than another symlink,
24556b526288Smrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
24566b526288Smrg
24576b526288Smrg    case $with_aix_soname,$aix_use_runtimelinking in
24586b526288Smrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
24596b526288Smrg    # soname into executable. Probably we can add versioning support to
24606b526288Smrg    # collect2, so additional links can be useful in future.
24616b526288Smrg    aix,yes) # traditional libtool
24626b526288Smrg      dynamic_linker='AIX unversionable lib.so'
24636b526288Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
24646b526288Smrg      # instead of lib<name>.a to let people know that these are not
24656b526288Smrg      # typical AIX shared libraries.
24666b526288Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
24676b526288Smrg      ;;
24686b526288Smrg    aix,no) # traditional AIX only
24696b526288Smrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
24706b526288Smrg      # We preserve .a as extension for shared libraries through AIX4.2
24716b526288Smrg      # and later when we are not doing run time linking.
24726b526288Smrg      library_names_spec='$libname$release.a $libname.a'
24736b526288Smrg      soname_spec='$libname$release$shared_ext$major'
24746b526288Smrg      ;;
24756b526288Smrg    svr4,*) # full svr4 only
24766b526288Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
24776b526288Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
24786b526288Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
24796b526288Smrg      shlibpath_overrides_runpath=yes
24806b526288Smrg      ;;
24816b526288Smrg    *,yes) # both, prefer svr4
24826b526288Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
24836b526288Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
24846b526288Smrg      # unpreferred sharedlib libNAME.a needs extra handling
24856b526288Smrg      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"'
24866b526288Smrg      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"'
24876b526288Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
24886b526288Smrg      shlibpath_overrides_runpath=yes
24896b526288Smrg      ;;
24906b526288Smrg    *,no) # both, prefer aix
24916b526288Smrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
24926b526288Smrg      library_names_spec='$libname$release.a $libname.a'
24936b526288Smrg      soname_spec='$libname$release$shared_ext$major'
24946b526288Smrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
24956b526288Smrg      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)'
24966b526288Smrg      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"'
24976b526288Smrg      ;;
24986b526288Smrg    esac
24996b526288Smrg    shlibpath_var=LIBPATH
25006b526288Smrg  fi
25016b526288Smrg  ;;
250211a29bacSmrg
25036b526288Smrgamigaos*)
25046b526288Smrg  case $host_cpu in
25056b526288Smrg  powerpc)
25066b526288Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
25076b526288Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
25086b526288Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
25096b526288Smrg    ;;
25106b526288Smrg  m68k)
25116b526288Smrg    library_names_spec='$libname.ixlibrary $libname.a'
25126b526288Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
25136b526288Smrg    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'
25146b526288Smrg    ;;
25156b526288Smrg  esac
25166b526288Smrg  ;;
251711a29bacSmrg
25186b526288Smrgbeos*)
25196b526288Smrg  library_names_spec='$libname$shared_ext'
25206b526288Smrg  dynamic_linker="$host_os ld.so"
25216b526288Smrg  shlibpath_var=LIBRARY_PATH
25226b526288Smrg  ;;
252311a29bacSmrg
25246b526288Smrgbsdi[[45]]*)
25256b526288Smrg  version_type=linux # correct to gnu/linux during the next big refactor
25266b526288Smrg  need_version=no
25276b526288Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
25286b526288Smrg  soname_spec='$libname$release$shared_ext$major'
25296b526288Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
25306b526288Smrg  shlibpath_var=LD_LIBRARY_PATH
25316b526288Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
25326b526288Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
25336b526288Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
25346b526288Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
25356b526288Smrg  # libtool to hard-code these into programs
25366b526288Smrg  ;;
253711a29bacSmrg
25386b526288Smrgcygwin* | mingw* | pw32* | cegcc*)
25396b526288Smrg  version_type=windows
25406b526288Smrg  shrext_cmds=.dll
25416b526288Smrg  need_version=no
25426b526288Smrg  need_lib_prefix=no
254311a29bacSmrg
25446b526288Smrg  case $GCC,$cc_basename in
25456b526288Smrg  yes,*)
25466b526288Smrg    # gcc
25476b526288Smrg    library_names_spec='$libname.dll.a'
25486b526288Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
25496b526288Smrg    postinstall_cmds='base_file=`basename \$file`~
25506b526288Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
25516b526288Smrg      dldir=$destdir/`dirname \$dlpath`~
25526b526288Smrg      test -d \$dldir || mkdir -p \$dldir~
25536b526288Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
25546b526288Smrg      chmod a+x \$dldir/$dlname~
25556b526288Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
25566b526288Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
25576b526288Smrg      fi'
25586b526288Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
25596b526288Smrg      dlpath=$dir/\$dldll~
25606b526288Smrg       $RM \$dlpath'
25616b526288Smrg    shlibpath_overrides_runpath=yes
256211a29bacSmrg
25636b526288Smrg    case $host_os in
25646b526288Smrg    cygwin*)
25656b526288Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
25666b526288Smrg      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
25676b526288Smrgm4_if([$1], [],[
25686b526288Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
25696b526288Smrg      ;;
25706b526288Smrg    mingw* | cegcc*)
25716b526288Smrg      # MinGW DLLs use traditional 'lib' prefix
25726b526288Smrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
25736b526288Smrg      ;;
25746b526288Smrg    pw32*)
25756b526288Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
25766b526288Smrg      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
25776b526288Smrg      ;;
25786b526288Smrg    esac
25796b526288Smrg    dynamic_linker='Win32 ld.exe'
25806b526288Smrg    ;;
258111a29bacSmrg
25826b526288Smrg  *,cl*)
25836b526288Smrg    # Native MSVC
25846b526288Smrg    libname_spec='$name'
25856b526288Smrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
25866b526288Smrg    library_names_spec='$libname.dll.lib'
25876b526288Smrg
25886b526288Smrg    case $build_os in
25896b526288Smrg    mingw*)
25906b526288Smrg      sys_lib_search_path_spec=
25916b526288Smrg      lt_save_ifs=$IFS
25926b526288Smrg      IFS=';'
25936b526288Smrg      for lt_path in $LIB
25946b526288Smrg      do
25956b526288Smrg        IFS=$lt_save_ifs
25966b526288Smrg        # Let DOS variable expansion print the short 8.3 style file name.
25976b526288Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
25986b526288Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
25996b526288Smrg      done
26006b526288Smrg      IFS=$lt_save_ifs
26016b526288Smrg      # Convert to MSYS style.
26026b526288Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
26036b526288Smrg      ;;
26046b526288Smrg    cygwin*)
26056b526288Smrg      # Convert to unix form, then to dos form, then back to unix form
26066b526288Smrg      # but this time dos style (no spaces!) so that the unix form looks
26076b526288Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
26086b526288Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
26096b526288Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
26106b526288Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
26116b526288Smrg      ;;
26126b526288Smrg    *)
26136b526288Smrg      sys_lib_search_path_spec=$LIB
26146b526288Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
26156b526288Smrg        # It is most probably a Windows format PATH.
26166b526288Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
26176b526288Smrg      else
26186b526288Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
26196b526288Smrg      fi
26206b526288Smrg      # FIXME: find the short name or the path components, as spaces are
26216b526288Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
26226b526288Smrg      ;;
26236b526288Smrg    esac
262411a29bacSmrg
26256b526288Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
26266b526288Smrg    postinstall_cmds='base_file=`basename \$file`~
26276b526288Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
26286b526288Smrg      dldir=$destdir/`dirname \$dlpath`~
26296b526288Smrg      test -d \$dldir || mkdir -p \$dldir~
26306b526288Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
26316b526288Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
26326b526288Smrg      dlpath=$dir/\$dldll~
26336b526288Smrg       $RM \$dlpath'
26346b526288Smrg    shlibpath_overrides_runpath=yes
26356b526288Smrg    dynamic_linker='Win32 link.exe'
26366b526288Smrg    ;;
263711a29bacSmrg
26386b526288Smrg  *)
26396b526288Smrg    # Assume MSVC wrapper
26406b526288Smrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
26416b526288Smrg    dynamic_linker='Win32 ld.exe'
26426b526288Smrg    ;;
26436b526288Smrg  esac
26446b526288Smrg  # FIXME: first we should search . and the directory the executable is in
26456b526288Smrg  shlibpath_var=PATH
26466b526288Smrg  ;;
264711a29bacSmrg
26486b526288Smrgdarwin* | rhapsody*)
26496b526288Smrg  dynamic_linker="$host_os dyld"
26506b526288Smrg  version_type=darwin
26516b526288Smrg  need_lib_prefix=no
26526b526288Smrg  need_version=no
26536b526288Smrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
26546b526288Smrg  soname_spec='$libname$release$major$shared_ext'
26556b526288Smrg  shlibpath_overrides_runpath=yes
26566b526288Smrg  shlibpath_var=DYLD_LIBRARY_PATH
26576b526288Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
26586b526288Smrgm4_if([$1], [],[
26596b526288Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
26606b526288Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
26616b526288Smrg  ;;
266211a29bacSmrg
26636b526288Smrgdgux*)
26646b526288Smrg  version_type=linux # correct to gnu/linux during the next big refactor
26656b526288Smrg  need_lib_prefix=no
26666b526288Smrg  need_version=no
26676b526288Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
26686b526288Smrg  soname_spec='$libname$release$shared_ext$major'
26696b526288Smrg  shlibpath_var=LD_LIBRARY_PATH
26706b526288Smrg  ;;
267111a29bacSmrg
26726b526288Smrgfreebsd* | dragonfly*)
26736b526288Smrg  # DragonFly does not have aout.  When/if they implement a new
26746b526288Smrg  # versioning mechanism, adjust this.
26756b526288Smrg  if test -x /usr/bin/objformat; then
26766b526288Smrg    objformat=`/usr/bin/objformat`
26776b526288Smrg  else
26786b526288Smrg    case $host_os in
26796b526288Smrg    freebsd[[23]].*) objformat=aout ;;
26806b526288Smrg    *) objformat=elf ;;
26816b526288Smrg    esac
26826b526288Smrg  fi
26836b526288Smrg  version_type=freebsd-$objformat
26846b526288Smrg  case $version_type in
26856b526288Smrg    freebsd-elf*)
26866b526288Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
26876b526288Smrg      soname_spec='$libname$release$shared_ext$major'
26886b526288Smrg      need_version=no
26896b526288Smrg      need_lib_prefix=no
26906b526288Smrg      ;;
26916b526288Smrg    freebsd-*)
26926b526288Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
26936b526288Smrg      need_version=yes
26946b526288Smrg      ;;
26956b526288Smrg  esac
26966b526288Smrg  shlibpath_var=LD_LIBRARY_PATH
26976b526288Smrg  case $host_os in
26986b526288Smrg  freebsd2.*)
26996b526288Smrg    shlibpath_overrides_runpath=yes
27006b526288Smrg    ;;
27016b526288Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
27026b526288Smrg    shlibpath_overrides_runpath=yes
27036b526288Smrg    hardcode_into_libs=yes
27046b526288Smrg    ;;
27056b526288Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
27066b526288Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
27076b526288Smrg    shlibpath_overrides_runpath=no
27086b526288Smrg    hardcode_into_libs=yes
27096b526288Smrg    ;;
27106b526288Smrg  *) # from 4.6 on, and DragonFly
27116b526288Smrg    shlibpath_overrides_runpath=yes
27126b526288Smrg    hardcode_into_libs=yes
27136b526288Smrg    ;;
27146b526288Smrg  esac
27156b526288Smrg  ;;
271611a29bacSmrg
27176b526288Smrghaiku*)
27186b526288Smrg  version_type=linux # correct to gnu/linux during the next big refactor
27196b526288Smrg  need_lib_prefix=no
27206b526288Smrg  need_version=no
27216b526288Smrg  dynamic_linker="$host_os runtime_loader"
27226b526288Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27236b526288Smrg  soname_spec='$libname$release$shared_ext$major'
27246b526288Smrg  shlibpath_var=LIBRARY_PATH
27256b526288Smrg  shlibpath_overrides_runpath=no
27266b526288Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
27276b526288Smrg  hardcode_into_libs=yes
27286b526288Smrg  ;;
272911a29bacSmrg
27306b526288Smrghpux9* | hpux10* | hpux11*)
27316b526288Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
27326b526288Smrg  # link against other versions.
27336b526288Smrg  version_type=sunos
27346b526288Smrg  need_lib_prefix=no
27356b526288Smrg  need_version=no
27366b526288Smrg  case $host_cpu in
27376b526288Smrg  ia64*)
27386b526288Smrg    shrext_cmds='.so'
27396b526288Smrg    hardcode_into_libs=yes
27406b526288Smrg    dynamic_linker="$host_os dld.so"
27416b526288Smrg    shlibpath_var=LD_LIBRARY_PATH
27426b526288Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
27436b526288Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27446b526288Smrg    soname_spec='$libname$release$shared_ext$major'
27456b526288Smrg    if test 32 = "$HPUX_IA64_MODE"; then
27466b526288Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
27476b526288Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
27486b526288Smrg    else
27496b526288Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
27506b526288Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
27516b526288Smrg    fi
27526b526288Smrg    ;;
27536b526288Smrg  hppa*64*)
27546b526288Smrg    shrext_cmds='.sl'
27556b526288Smrg    hardcode_into_libs=yes
27566b526288Smrg    dynamic_linker="$host_os dld.sl"
27576b526288Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
27586b526288Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
27596b526288Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27606b526288Smrg    soname_spec='$libname$release$shared_ext$major'
27616b526288Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
27626b526288Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
27636b526288Smrg    ;;
27646b526288Smrg  *)
27656b526288Smrg    shrext_cmds='.sl'
27666b526288Smrg    dynamic_linker="$host_os dld.sl"
27676b526288Smrg    shlibpath_var=SHLIB_PATH
27686b526288Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
27696b526288Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27706b526288Smrg    soname_spec='$libname$release$shared_ext$major'
27716b526288Smrg    ;;
27726b526288Smrg  esac
27736b526288Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
27746b526288Smrg  postinstall_cmds='chmod 555 $lib'
27756b526288Smrg  # or fails outright, so override atomically:
27766b526288Smrg  install_override_mode=555
27776b526288Smrg  ;;
277811a29bacSmrg
27796b526288Smrginterix[[3-9]]*)
27806b526288Smrg  version_type=linux # correct to gnu/linux during the next big refactor
27816b526288Smrg  need_lib_prefix=no
27826b526288Smrg  need_version=no
27836b526288Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27846b526288Smrg  soname_spec='$libname$release$shared_ext$major'
27856b526288Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
27866b526288Smrg  shlibpath_var=LD_LIBRARY_PATH
27876b526288Smrg  shlibpath_overrides_runpath=no
27886b526288Smrg  hardcode_into_libs=yes
27896b526288Smrg  ;;
279011a29bacSmrg
27916b526288Smrgirix5* | irix6* | nonstopux*)
279211a29bacSmrg  case $host_os in
27936b526288Smrg    nonstopux*) version_type=nonstopux ;;
27946b526288Smrg    *)
27956b526288Smrg	if test yes = "$lt_cv_prog_gnu_ld"; then
27966b526288Smrg		version_type=linux # correct to gnu/linux during the next big refactor
27976b526288Smrg	else
27986b526288Smrg		version_type=irix
27996b526288Smrg	fi ;;
28006b526288Smrg  esac
28016b526288Smrg  need_lib_prefix=no
28026b526288Smrg  need_version=no
28036b526288Smrg  soname_spec='$libname$release$shared_ext$major'
28046b526288Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
28056b526288Smrg  case $host_os in
28066b526288Smrg  irix5* | nonstopux*)
28076b526288Smrg    libsuff= shlibsuff=
28086b526288Smrg    ;;
28096b526288Smrg  *)
28106b526288Smrg    case $LD in # libtool.m4 will add one of these switches to LD
28116b526288Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
28126b526288Smrg      libsuff= shlibsuff= libmagic=32-bit;;
28136b526288Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
28146b526288Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
28156b526288Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
28166b526288Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
28176b526288Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
28186b526288Smrg    esac
281911a29bacSmrg    ;;
282011a29bacSmrg  esac
28216b526288Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
28226b526288Smrg  shlibpath_overrides_runpath=no
28236b526288Smrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
28246b526288Smrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
28256b526288Smrg  hardcode_into_libs=yes
28266b526288Smrg  ;;
282711a29bacSmrg
28286b526288Smrg# No shared lib support for Linux oldld, aout, or coff.
28296b526288Smrglinux*oldld* | linux*aout* | linux*coff*)
28306b526288Smrg  dynamic_linker=no
28316b526288Smrg  ;;
283211a29bacSmrg
28336b526288Smrglinux*android*)
28346b526288Smrg  version_type=none # Android doesn't support versioned libraries.
28356b526288Smrg  need_lib_prefix=no
28366b526288Smrg  need_version=no
28376b526288Smrg  library_names_spec='$libname$release$shared_ext'
28386b526288Smrg  soname_spec='$libname$release$shared_ext'
28396b526288Smrg  finish_cmds=
28406b526288Smrg  shlibpath_var=LD_LIBRARY_PATH
28416b526288Smrg  shlibpath_overrides_runpath=yes
284211a29bacSmrg
28436b526288Smrg  # This implies no fast_install, which is unacceptable.
28446b526288Smrg  # Some rework will be needed to allow for fast_install
28456b526288Smrg  # before this can be enabled.
28466b526288Smrg  hardcode_into_libs=yes
284711a29bacSmrg
28486b526288Smrg  dynamic_linker='Android linker'
28496b526288Smrg  # Don't embed -rpath directories since the linker doesn't support them.
28506b526288Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
28516b526288Smrg  ;;
285211a29bacSmrg
28536b526288Smrg# This must be glibc/ELF.
28546b526288Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
28556b526288Smrg  version_type=linux # correct to gnu/linux during the next big refactor
28566b526288Smrg  need_lib_prefix=no
28576b526288Smrg  need_version=no
28586b526288Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
28596b526288Smrg  soname_spec='$libname$release$shared_ext$major'
28606b526288Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
28616b526288Smrg  shlibpath_var=LD_LIBRARY_PATH
28626b526288Smrg  shlibpath_overrides_runpath=no
286311a29bacSmrg
28646b526288Smrg  # Some binutils ld are patched to set DT_RUNPATH
28656b526288Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
28666b526288Smrg    [lt_cv_shlibpath_overrides_runpath=no
28676b526288Smrg    save_LDFLAGS=$LDFLAGS
28686b526288Smrg    save_libdir=$libdir
28696b526288Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
28706b526288Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
28716b526288Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
28726b526288Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
28736b526288Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
28746b526288Smrg    LDFLAGS=$save_LDFLAGS
28756b526288Smrg    libdir=$save_libdir
28766b526288Smrg    ])
28776b526288Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
287811a29bacSmrg
28796b526288Smrg  # This implies no fast_install, which is unacceptable.
28806b526288Smrg  # Some rework will be needed to allow for fast_install
28816b526288Smrg  # before this can be enabled.
28826b526288Smrg  hardcode_into_libs=yes
288311a29bacSmrg
28846b526288Smrg  # Add ABI-specific directories to the system library path.
28856b526288Smrg  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
288611a29bacSmrg
28876b526288Smrg  # Ideally, we could use ldconfig to report *all* directores which are
28886b526288Smrg  # searched for libraries, however this is still not possible.  Aside from not
28896b526288Smrg  # being certain /sbin/ldconfig is available, command
28906b526288Smrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
28916b526288Smrg  # even though it is searched at run-time.  Try to do the best guess by
28926b526288Smrg  # appending ld.so.conf contents (and includes) to the search path.
28936b526288Smrg  if test -f /etc/ld.so.conf; then
28946b526288Smrg    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' ' '`
28956b526288Smrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
28966b526288Smrg  fi
289711a29bacSmrg
28986b526288Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
28996b526288Smrg  # powerpc, because MkLinux only supported shared libraries with the
29006b526288Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
29016b526288Smrg  # most powerpc-linux boxes support dynamic linking these days and
29026b526288Smrg  # people can always --disable-shared, the test was removed, and we
29036b526288Smrg  # assume the GNU/Linux dynamic linker is in use.
29046b526288Smrg  dynamic_linker='GNU/Linux ld.so'
29056b526288Smrg  ;;
290611a29bacSmrg
29076b526288Smrgnetbsd*)
29086b526288Smrg  version_type=sunos
29096b526288Smrg  need_lib_prefix=no
29106b526288Smrg  need_version=no
29116b526288Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
29126b526288Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
29136b526288Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
29146b526288Smrg    dynamic_linker='NetBSD (a.out) ld.so'
29156b526288Smrg  else
29166b526288Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
29176b526288Smrg    soname_spec='$libname$release$shared_ext$major'
29186b526288Smrg    dynamic_linker='NetBSD ld.elf_so'
29196b526288Smrg  fi
29206b526288Smrg  shlibpath_var=LD_LIBRARY_PATH
29216b526288Smrg  shlibpath_overrides_runpath=yes
29226b526288Smrg  hardcode_into_libs=yes
29236b526288Smrg  ;;
292411a29bacSmrg
29256b526288Smrgnewsos6)
29266b526288Smrg  version_type=linux # correct to gnu/linux during the next big refactor
29276b526288Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
29286b526288Smrg  shlibpath_var=LD_LIBRARY_PATH
29296b526288Smrg  shlibpath_overrides_runpath=yes
29306b526288Smrg  ;;
293111a29bacSmrg
29326b526288Smrg*nto* | *qnx*)
29336b526288Smrg  version_type=qnx
29346b526288Smrg  need_lib_prefix=no
29356b526288Smrg  need_version=no
29366b526288Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
29376b526288Smrg  soname_spec='$libname$release$shared_ext$major'
29386b526288Smrg  shlibpath_var=LD_LIBRARY_PATH
29396b526288Smrg  shlibpath_overrides_runpath=no
29406b526288Smrg  hardcode_into_libs=yes
29416b526288Smrg  dynamic_linker='ldqnx.so'
29426b526288Smrg  ;;
294311a29bacSmrg
29446b526288Smrgopenbsd* | bitrig*)
29456b526288Smrg  version_type=sunos
29466b526288Smrg  sys_lib_dlsearch_path_spec=/usr/lib
29476b526288Smrg  need_lib_prefix=no
29486b526288Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
29496b526288Smrg    need_version=no
29506b526288Smrg  else
29516b526288Smrg    need_version=yes
29526b526288Smrg  fi
29536b526288Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
29546b526288Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
29556b526288Smrg  shlibpath_var=LD_LIBRARY_PATH
29566b526288Smrg  shlibpath_overrides_runpath=yes
29576b526288Smrg  ;;
295811a29bacSmrg
29596b526288Smrgos2*)
29606b526288Smrg  libname_spec='$name'
29616b526288Smrg  version_type=windows
29626b526288Smrg  shrext_cmds=.dll
29636b526288Smrg  need_version=no
29646b526288Smrg  need_lib_prefix=no
29656b526288Smrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
29666b526288Smrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
29676b526288Smrg    v=$($ECHO $release$versuffix | tr -d .-);
29686b526288Smrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
29696b526288Smrg    $ECHO $n$v`$shared_ext'
29706b526288Smrg  library_names_spec='${libname}_dll.$libext'
29716b526288Smrg  dynamic_linker='OS/2 ld.exe'
29726b526288Smrg  shlibpath_var=BEGINLIBPATH
29736b526288Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
29746b526288Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
29756b526288Smrg  postinstall_cmds='base_file=`basename \$file`~
29766b526288Smrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
29776b526288Smrg    dldir=$destdir/`dirname \$dlpath`~
29786b526288Smrg    test -d \$dldir || mkdir -p \$dldir~
29796b526288Smrg    $install_prog $dir/$dlname \$dldir/$dlname~
29806b526288Smrg    chmod a+x \$dldir/$dlname~
29816b526288Smrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
29826b526288Smrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
29836b526288Smrg    fi'
29846b526288Smrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
29856b526288Smrg    dlpath=$dir/\$dldll~
29866b526288Smrg    $RM \$dlpath'
29876b526288Smrg  ;;
298811a29bacSmrg
29896b526288Smrgosf3* | osf4* | osf5*)
29906b526288Smrg  version_type=osf
29916b526288Smrg  need_lib_prefix=no
29926b526288Smrg  need_version=no
29936b526288Smrg  soname_spec='$libname$release$shared_ext$major'
29946b526288Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
29956b526288Smrg  shlibpath_var=LD_LIBRARY_PATH
29966b526288Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
29976b526288Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
29986b526288Smrg  ;;
299911a29bacSmrg
30006b526288Smrgrdos*)
30016b526288Smrg  dynamic_linker=no
30026b526288Smrg  ;;
300311a29bacSmrg
30046b526288Smrgsolaris*)
30056b526288Smrg  version_type=linux # correct to gnu/linux during the next big refactor
30066b526288Smrg  need_lib_prefix=no
30076b526288Smrg  need_version=no
30086b526288Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
30096b526288Smrg  soname_spec='$libname$release$shared_ext$major'
30106b526288Smrg  shlibpath_var=LD_LIBRARY_PATH
30116b526288Smrg  shlibpath_overrides_runpath=yes
30126b526288Smrg  hardcode_into_libs=yes
30136b526288Smrg  # ldd complains unless libraries are executable
30146b526288Smrg  postinstall_cmds='chmod +x $lib'
30156b526288Smrg  ;;
301611a29bacSmrg
30176b526288Smrgsunos4*)
30186b526288Smrg  version_type=sunos
30196b526288Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
30206b526288Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
30216b526288Smrg  shlibpath_var=LD_LIBRARY_PATH
30226b526288Smrg  shlibpath_overrides_runpath=yes
30236b526288Smrg  if test yes = "$with_gnu_ld"; then
30246b526288Smrg    need_lib_prefix=no
30256b526288Smrg  fi
30266b526288Smrg  need_version=yes
30276b526288Smrg  ;;
302811a29bacSmrg
30296b526288Smrgsysv4 | sysv4.3*)
30306b526288Smrg  version_type=linux # correct to gnu/linux during the next big refactor
30316b526288Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
30326b526288Smrg  soname_spec='$libname$release$shared_ext$major'
30336b526288Smrg  shlibpath_var=LD_LIBRARY_PATH
30346b526288Smrg  case $host_vendor in
30356b526288Smrg    sni)
30366b526288Smrg      shlibpath_overrides_runpath=no
30376b526288Smrg      need_lib_prefix=no
30386b526288Smrg      runpath_var=LD_RUN_PATH
30396b526288Smrg      ;;
30406b526288Smrg    siemens)
30416b526288Smrg      need_lib_prefix=no
30426b526288Smrg      ;;
30436b526288Smrg    motorola)
30446b526288Smrg      need_lib_prefix=no
30456b526288Smrg      need_version=no
30466b526288Smrg      shlibpath_overrides_runpath=no
30476b526288Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
30486b526288Smrg      ;;
30496b526288Smrg  esac
30506b526288Smrg  ;;
305111a29bacSmrg
30526b526288Smrgsysv4*MP*)
30536b526288Smrg  if test -d /usr/nec; then
30546b526288Smrg    version_type=linux # correct to gnu/linux during the next big refactor
30556b526288Smrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
30566b526288Smrg    soname_spec='$libname$shared_ext.$major'
30576b526288Smrg    shlibpath_var=LD_LIBRARY_PATH
30586b526288Smrg  fi
30596b526288Smrg  ;;
306011a29bacSmrg
30616b526288Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
30626b526288Smrg  version_type=sco
30636b526288Smrg  need_lib_prefix=no
30646b526288Smrg  need_version=no
30656b526288Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
30666b526288Smrg  soname_spec='$libname$release$shared_ext$major'
30676b526288Smrg  shlibpath_var=LD_LIBRARY_PATH
30686b526288Smrg  shlibpath_overrides_runpath=yes
30696b526288Smrg  hardcode_into_libs=yes
30706b526288Smrg  if test yes = "$with_gnu_ld"; then
30716b526288Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
30726b526288Smrg  else
30736b526288Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
30746b526288Smrg    case $host_os in
30756b526288Smrg      sco3.2v5*)
30766b526288Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
30776b526288Smrg	;;
30786b526288Smrg    esac
30796b526288Smrg  fi
30806b526288Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
30816b526288Smrg  ;;
308211a29bacSmrg
30836b526288Smrgtpf*)
30846b526288Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
30856b526288Smrg  version_type=linux # correct to gnu/linux during the next big refactor
30866b526288Smrg  need_lib_prefix=no
30876b526288Smrg  need_version=no
30886b526288Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
30896b526288Smrg  shlibpath_var=LD_LIBRARY_PATH
30906b526288Smrg  shlibpath_overrides_runpath=no
30916b526288Smrg  hardcode_into_libs=yes
30926b526288Smrg  ;;
309311a29bacSmrg
30946b526288Smrguts4*)
30956b526288Smrg  version_type=linux # correct to gnu/linux during the next big refactor
30966b526288Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
30976b526288Smrg  soname_spec='$libname$release$shared_ext$major'
30986b526288Smrg  shlibpath_var=LD_LIBRARY_PATH
30996b526288Smrg  ;;
310011a29bacSmrg
31016b526288Smrg*)
31026b526288Smrg  dynamic_linker=no
31036b526288Smrg  ;;
31046b526288Smrgesac
31056b526288SmrgAC_MSG_RESULT([$dynamic_linker])
31066b526288Smrgtest no = "$dynamic_linker" && can_build_shared=no
310711a29bacSmrg
31086b526288Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
31096b526288Smrgif test yes = "$GCC"; then
31106b526288Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
31116b526288Smrgfi
311211a29bacSmrg
31136b526288Smrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
31146b526288Smrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
31156b526288Smrgfi
311611a29bacSmrg
31176b526288Smrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
31186b526288Smrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
31196b526288Smrgfi
312011a29bacSmrg
31216b526288Smrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
31226b526288Smrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
312311a29bacSmrg
31246b526288Smrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
31256b526288Smrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
312611a29bacSmrg
31276b526288Smrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
31286b526288Smrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
31296b526288Smrg
31306b526288Smrg_LT_DECL([], [variables_saved_for_relink], [1],
31316b526288Smrg    [Variables whose values should be saved in libtool wrapper scripts and
31326b526288Smrg    restored at link time])
31336b526288Smrg_LT_DECL([], [need_lib_prefix], [0],
31346b526288Smrg    [Do we need the "lib" prefix for modules?])
31356b526288Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
31366b526288Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
31376b526288Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
31386b526288Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
31396b526288Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
31406b526288Smrg    [Is shlibpath searched before the hard-coded library search path?])
31416b526288Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
31426b526288Smrg_LT_DECL([], [library_names_spec], [1],
31436b526288Smrg    [[List of archive names.  First name is the real one, the rest are links.
31446b526288Smrg    The last name is the one that the linker finds with -lNAME]])
31456b526288Smrg_LT_DECL([], [soname_spec], [1],
31466b526288Smrg    [[The coded name of the library, if different from the real name]])
31476b526288Smrg_LT_DECL([], [install_override_mode], [1],
31486b526288Smrg    [Permission mode override for installation of shared libraries])
31496b526288Smrg_LT_DECL([], [postinstall_cmds], [2],
31506b526288Smrg    [Command to use after installation of a shared archive])
31516b526288Smrg_LT_DECL([], [postuninstall_cmds], [2],
31526b526288Smrg    [Command to use after uninstallation of a shared archive])
31536b526288Smrg_LT_DECL([], [finish_cmds], [2],
31546b526288Smrg    [Commands used to finish a libtool library installation in a directory])
31556b526288Smrg_LT_DECL([], [finish_eval], [1],
31566b526288Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
31576b526288Smrg    not shown]])
31586b526288Smrg_LT_DECL([], [hardcode_into_libs], [0],
31596b526288Smrg    [Whether we should hardcode library paths into libraries])
31606b526288Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
31616b526288Smrg    [Compile-time system search path for libraries])
31626b526288Smrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
31636b526288Smrg    [Detected run-time system search path for libraries])
31646b526288Smrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
31656b526288Smrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
31666b526288Smrg])# _LT_SYS_DYNAMIC_LINKER
31676b526288Smrg
31686b526288Smrg
31696b526288Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
31706b526288Smrg# --------------------------
31716b526288Smrg# find a file program that can recognize shared library
31726b526288SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
31736b526288Smrg[m4_require([_LT_DECL_EGREP])dnl
31746b526288SmrgAC_MSG_CHECKING([for $1])
31756b526288SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
31766b526288Smrg[case $MAGIC_CMD in
31776b526288Smrg[[\\/*] |  ?:[\\/]*])
31786b526288Smrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
31796b526288Smrg  ;;
31806b526288Smrg*)
31816b526288Smrg  lt_save_MAGIC_CMD=$MAGIC_CMD
31826b526288Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
31836b526288Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
31846b526288Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
31856b526288Smrgdnl not every word.  This closes a longstanding sh security hole.
31866b526288Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
31876b526288Smrg  for ac_dir in $ac_dummy; do
31886b526288Smrg    IFS=$lt_save_ifs
31896b526288Smrg    test -z "$ac_dir" && ac_dir=.
31906b526288Smrg    if test -f "$ac_dir/$1"; then
31916b526288Smrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
31926b526288Smrg      if test -n "$file_magic_test_file"; then
31936b526288Smrg	case $deplibs_check_method in
31946b526288Smrg	"file_magic "*)
31956b526288Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
31966b526288Smrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
31976b526288Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
31986b526288Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
31996b526288Smrg	    :
32006b526288Smrg	  else
32016b526288Smrg	    cat <<_LT_EOF 1>&2
32026b526288Smrg
32036b526288Smrg*** Warning: the command libtool uses to detect shared libraries,
32046b526288Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
32056b526288Smrg*** The result is that libtool may fail to recognize shared libraries
32066b526288Smrg*** as such.  This will affect the creation of libtool libraries that
32076b526288Smrg*** depend on shared libraries, but programs linked with such libtool
32086b526288Smrg*** libraries will work regardless of this problem.  Nevertheless, you
32096b526288Smrg*** may want to report the problem to your system manager and/or to
32106b526288Smrg*** bug-libtool@gnu.org
321111a29bacSmrg
321211a29bacSmrg_LT_EOF
32136b526288Smrg	  fi ;;
32146b526288Smrg	esac
321511a29bacSmrg      fi
32166b526288Smrg      break
321711245024Smrg    fi
32186b526288Smrg  done
32196b526288Smrg  IFS=$lt_save_ifs
32206b526288Smrg  MAGIC_CMD=$lt_save_MAGIC_CMD
32216b526288Smrg  ;;
32226b526288Smrgesac])
32236b526288SmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
32246b526288Smrgif test -n "$MAGIC_CMD"; then
32256b526288Smrg  AC_MSG_RESULT($MAGIC_CMD)
32266b526288Smrgelse
32276b526288Smrg  AC_MSG_RESULT(no)
32286b526288Smrgfi
32296b526288Smrg_LT_DECL([], [MAGIC_CMD], [0],
32306b526288Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
32316b526288Smrg])# _LT_PATH_TOOL_PREFIX
323241b2f0bdSmrg
32336b526288Smrg# Old name:
32346b526288SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
32356b526288Smrgdnl aclocal-1.4 backwards compatibility:
32366b526288Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
323711a29bacSmrg
32386b526288Smrg
32396b526288Smrg# _LT_PATH_MAGIC
32406b526288Smrg# --------------
32416b526288Smrg# find a file program that can recognize a shared library
32426b526288Smrgm4_defun([_LT_PATH_MAGIC],
32436b526288Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
32446b526288Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
32456b526288Smrg  if test -n "$ac_tool_prefix"; then
32466b526288Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
324711a29bacSmrg  else
32486b526288Smrg    MAGIC_CMD=:
324911a29bacSmrg  fi
32506b526288Smrgfi
32516b526288Smrg])# _LT_PATH_MAGIC
325211a29bacSmrg
325341b2f0bdSmrg
32546b526288Smrg# LT_PATH_LD
32556b526288Smrg# ----------
32566b526288Smrg# find the pathname to the GNU or non-GNU linker
32576b526288SmrgAC_DEFUN([LT_PATH_LD],
32586b526288Smrg[AC_REQUIRE([AC_PROG_CC])dnl
32596b526288SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
32606b526288SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
32616b526288Smrgm4_require([_LT_DECL_SED])dnl
32626b526288Smrgm4_require([_LT_DECL_EGREP])dnl
32636b526288Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
326441b2f0bdSmrg
32656b526288SmrgAC_ARG_WITH([gnu-ld],
32666b526288Smrg    [AS_HELP_STRING([--with-gnu-ld],
32676b526288Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
32686b526288Smrg    [test no = "$withval" || with_gnu_ld=yes],
32696b526288Smrg    [with_gnu_ld=no])dnl
327041b2f0bdSmrg
32716b526288Smrgac_prog=ld
32726b526288Smrgif test yes = "$GCC"; then
32736b526288Smrg  # Check if gcc -print-prog-name=ld gives a path.
32746b526288Smrg  AC_MSG_CHECKING([for ld used by $CC])
32756b526288Smrg  case $host in
32766b526288Smrg  *-*-mingw*)
32776b526288Smrg    # gcc leaves a trailing carriage return, which upsets mingw
32786b526288Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
32796b526288Smrg  *)
32806b526288Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
32816b526288Smrg  esac
32826b526288Smrg  case $ac_prog in
32836b526288Smrg    # Accept absolute paths.
32846b526288Smrg    [[\\/]]* | ?:[[\\/]]*)
32856b526288Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
32866b526288Smrg      # Canonicalize the pathname of ld
32876b526288Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
32886b526288Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
32896b526288Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
32906b526288Smrg      done
32916b526288Smrg      test -z "$LD" && LD=$ac_prog
32926b526288Smrg      ;;
32936b526288Smrg  "")
32946b526288Smrg    # If it fails, then pretend we aren't using GCC.
32956b526288Smrg    ac_prog=ld
32966b526288Smrg    ;;
32976b526288Smrg  *)
32986b526288Smrg    # If it is relative, then search for the first ld in PATH.
32996b526288Smrg    with_gnu_ld=unknown
33006b526288Smrg    ;;
33016b526288Smrg  esac
33026b526288Smrgelif test yes = "$with_gnu_ld"; then
33036b526288Smrg  AC_MSG_CHECKING([for GNU ld])
33046b526288Smrgelse
33056b526288Smrg  AC_MSG_CHECKING([for non-GNU ld])
33066b526288Smrgfi
33076b526288SmrgAC_CACHE_VAL(lt_cv_path_LD,
33086b526288Smrg[if test -z "$LD"; then
33096b526288Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
33106b526288Smrg  for ac_dir in $PATH; do
33116b526288Smrg    IFS=$lt_save_ifs
33126b526288Smrg    test -z "$ac_dir" && ac_dir=.
33136b526288Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
33146b526288Smrg      lt_cv_path_LD=$ac_dir/$ac_prog
33156b526288Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
33166b526288Smrg      # but apparently some variants of GNU ld only accept -v.
33176b526288Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
33186b526288Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
33196b526288Smrg      *GNU* | *'with BFD'*)
33206b526288Smrg	test no != "$with_gnu_ld" && break
33216b526288Smrg	;;
33226b526288Smrg      *)
33236b526288Smrg	test yes != "$with_gnu_ld" && break
33246b526288Smrg	;;
33256b526288Smrg      esac
33266b526288Smrg    fi
33276b526288Smrg  done
33286b526288Smrg  IFS=$lt_save_ifs
33296b526288Smrgelse
33306b526288Smrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
33316b526288Smrgfi])
33326b526288SmrgLD=$lt_cv_path_LD
33336b526288Smrgif test -n "$LD"; then
33346b526288Smrg  AC_MSG_RESULT($LD)
33356b526288Smrgelse
33366b526288Smrg  AC_MSG_RESULT(no)
33376b526288Smrgfi
33386b526288Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
33396b526288Smrg_LT_PATH_LD_GNU
33406b526288SmrgAC_SUBST([LD])
334111245024Smrg
33426b526288Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
33436b526288Smrg])# LT_PATH_LD
334441b2f0bdSmrg
33456b526288Smrg# Old names:
33466b526288SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
33476b526288SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
33486b526288Smrgdnl aclocal-1.4 backwards compatibility:
33496b526288Smrgdnl AC_DEFUN([AM_PROG_LD], [])
33506b526288Smrgdnl AC_DEFUN([AC_PROG_LD], [])
335111a29bacSmrg
335211245024Smrg
33536b526288Smrg# _LT_PATH_LD_GNU
33546b526288Smrg#- --------------
33556b526288Smrgm4_defun([_LT_PATH_LD_GNU],
33566b526288Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
33576b526288Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
33586b526288Smrgcase `$LD -v 2>&1 </dev/null` in
33596b526288Smrg*GNU* | *'with BFD'*)
33606b526288Smrg  lt_cv_prog_gnu_ld=yes
33616b526288Smrg  ;;
33626b526288Smrg*)
33636b526288Smrg  lt_cv_prog_gnu_ld=no
33646b526288Smrg  ;;
33656b526288Smrgesac])
33666b526288Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
33676b526288Smrg])# _LT_PATH_LD_GNU
336811245024Smrg
33696b526288Smrg
33706b526288Smrg# _LT_CMD_RELOAD
33716b526288Smrg# --------------
33726b526288Smrg# find reload flag for linker
33736b526288Smrg#   -- PORTME Some linkers may need a different reload flag.
33746b526288Smrgm4_defun([_LT_CMD_RELOAD],
33756b526288Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
33766b526288Smrg  lt_cv_ld_reload_flag,
33776b526288Smrg  [lt_cv_ld_reload_flag='-r'])
33786b526288Smrgreload_flag=$lt_cv_ld_reload_flag
33796b526288Smrgcase $reload_flag in
33806b526288Smrg"" | " "*) ;;
33816b526288Smrg*) reload_flag=" $reload_flag" ;;
33826b526288Smrgesac
33836b526288Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
33846b526288Smrgcase $host_os in
33856b526288Smrg  cygwin* | mingw* | pw32* | cegcc*)
33866b526288Smrg    if test yes != "$GCC"; then
33876b526288Smrg      reload_cmds=false
33886b526288Smrg    fi
33896b526288Smrg    ;;
33906b526288Smrg  darwin*)
33916b526288Smrg    if test yes = "$GCC"; then
33926b526288Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
33936b526288Smrg    else
33946b526288Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
33956b526288Smrg    fi
33966b526288Smrg    ;;
339711a29bacSmrgesac
33986b526288Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
33996b526288Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
34006b526288Smrg])# _LT_CMD_RELOAD
340141b2f0bdSmrg
340241b2f0bdSmrg
34036b526288Smrg# _LT_PATH_DD
34046b526288Smrg# -----------
34056b526288Smrg# find a working dd
34066b526288Smrgm4_defun([_LT_PATH_DD],
34076b526288Smrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
34086b526288Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
34096b526288Smrgcat conftest.i conftest.i >conftest2.i
34106b526288Smrg: ${lt_DD:=$DD}
34116b526288SmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
34126b526288Smrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
34136b526288Smrg  cmp -s conftest.i conftest.out \
34146b526288Smrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
34156b526288Smrgfi])
34166b526288Smrgrm -f conftest.i conftest2.i conftest.out])
34176b526288Smrg])# _LT_PATH_DD
341841b2f0bdSmrg
341941b2f0bdSmrg
34206b526288Smrg# _LT_CMD_TRUNCATE
34216b526288Smrg# ----------------
34226b526288Smrg# find command to truncate a binary pipe
34236b526288Smrgm4_defun([_LT_CMD_TRUNCATE],
34246b526288Smrg[m4_require([_LT_PATH_DD])
34256b526288SmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
34266b526288Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
34276b526288Smrgcat conftest.i conftest.i >conftest2.i
34286b526288Smrglt_cv_truncate_bin=
34296b526288Smrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
34306b526288Smrg  cmp -s conftest.i conftest.out \
34316b526288Smrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
34326b526288Smrgfi
34336b526288Smrgrm -f conftest.i conftest2.i conftest.out
34346b526288Smrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
34356b526288Smrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
34366b526288Smrg  [Command to truncate a binary pipe])
34376b526288Smrg])# _LT_CMD_TRUNCATE
343841b2f0bdSmrg
34396b526288Smrg
34406b526288Smrg# _LT_CHECK_MAGIC_METHOD
34416b526288Smrg# ----------------------
34426b526288Smrg# how to check for library dependencies
34436b526288Smrg#  -- PORTME fill in with the dynamic library characteristics
34446b526288Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
34456b526288Smrg[m4_require([_LT_DECL_EGREP])
34466b526288Smrgm4_require([_LT_DECL_OBJDUMP])
34476b526288SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
34486b526288Smrglt_cv_deplibs_check_method,
34496b526288Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
34506b526288Smrglt_cv_file_magic_test_file=
34516b526288Smrglt_cv_deplibs_check_method='unknown'
34526b526288Smrg# Need to set the preceding variable on all platforms that support
34536b526288Smrg# interlibrary dependencies.
34546b526288Smrg# 'none' -- dependencies not supported.
34556b526288Smrg# 'unknown' -- same as none, but documents that we really don't know.
34566b526288Smrg# 'pass_all' -- all dependencies passed with no checks.
34576b526288Smrg# 'test_compile' -- check by making test program.
34586b526288Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
34596b526288Smrg# that responds to the $file_magic_cmd with a given extended regex.
34606b526288Smrg# If you have 'file' or equivalent on your system and you're not sure
34616b526288Smrg# whether 'pass_all' will *always* work, you probably want this one.
34626b526288Smrg
34636b526288Smrgcase $host_os in
34646b526288Smrgaix[[4-9]]*)
34656b526288Smrg  lt_cv_deplibs_check_method=pass_all
346641b2f0bdSmrg  ;;
346741b2f0bdSmrg
34686b526288Smrgbeos*)
34696b526288Smrg  lt_cv_deplibs_check_method=pass_all
347041b2f0bdSmrg  ;;
347141b2f0bdSmrg
34726b526288Smrgbsdi[[45]]*)
34736b526288Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
34746b526288Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
34756b526288Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
34766b526288Smrg  ;;
34776b526288Smrg
34786b526288Smrgcygwin*)
34796b526288Smrg  # func_win32_libid is a shell function defined in ltmain.sh
34806b526288Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
34816b526288Smrg  lt_cv_file_magic_cmd='func_win32_libid'
34826b526288Smrg  ;;
34836b526288Smrg
34846b526288Smrgmingw* | pw32*)
34856b526288Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
34866b526288Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
34876b526288Smrg  # unless we find 'file', for example because we are cross-compiling.
34886b526288Smrg  if ( file / ) >/dev/null 2>&1; then
34896b526288Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
34906b526288Smrg    lt_cv_file_magic_cmd='func_win32_libid'
34916b526288Smrg  else
34926b526288Smrg    # Keep this pattern in sync with the one in func_win32_libid.
34936b526288Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
34946b526288Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
349511245024Smrg  fi
349641b2f0bdSmrg  ;;
34976b526288Smrg
34986b526288Smrgcegcc*)
34996b526288Smrg  # use the weaker test based on 'objdump'. See mingw*.
35006b526288Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
35016b526288Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
35026b526288Smrg  ;;
35036b526288Smrg
35046b526288Smrgdarwin* | rhapsody*)
35056b526288Smrg  lt_cv_deplibs_check_method=pass_all
35066b526288Smrg  ;;
35076b526288Smrg
35086b526288Smrgfreebsd* | dragonfly*)
35096b526288Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
35106b526288Smrg    case $host_cpu in
35116b526288Smrg    i*86 )
35126b526288Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
35136b526288Smrg      # Let's accept both of them until this is cleared up.
35146b526288Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
35156b526288Smrg      lt_cv_file_magic_cmd=/usr/bin/file
35166b526288Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
351711245024Smrg      ;;
351811245024Smrg    esac
35196b526288Smrg  else
35206b526288Smrg    lt_cv_deplibs_check_method=pass_all
352111245024Smrg  fi
352241b2f0bdSmrg  ;;
352341b2f0bdSmrg
35246b526288Smrghaiku*)
35256b526288Smrg  lt_cv_deplibs_check_method=pass_all
35266b526288Smrg  ;;
35276b526288Smrg
35286b526288Smrghpux10.20* | hpux11*)
35296b526288Smrg  lt_cv_file_magic_cmd=/usr/bin/file
35306b526288Smrg  case $host_cpu in
35316b526288Smrg  ia64*)
35326b526288Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
35336b526288Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
35346b526288Smrg    ;;
35356b526288Smrg  hppa*64*)
35366b526288Smrg    [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]']
35376b526288Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
35386b526288Smrg    ;;
35396b526288Smrg  *)
35406b526288Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
35416b526288Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
35426b526288Smrg    ;;
35436b526288Smrg  esac
35446b526288Smrg  ;;
354511a29bacSmrg
35466b526288Smrginterix[[3-9]]*)
35476b526288Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
35486b526288Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
35496b526288Smrg  ;;
355011a29bacSmrg
35516b526288Smrgirix5* | irix6* | nonstopux*)
35526b526288Smrg  case $LD in
35536b526288Smrg  *-32|*"-32 ") libmagic=32-bit;;
35546b526288Smrg  *-n32|*"-n32 ") libmagic=N32;;
35556b526288Smrg  *-64|*"-64 ") libmagic=64-bit;;
35566b526288Smrg  *) libmagic=never-match;;
35576b526288Smrg  esac
35586b526288Smrg  lt_cv_deplibs_check_method=pass_all
35596b526288Smrg  ;;
356011a29bacSmrg
35616b526288Smrg# This must be glibc/ELF.
35626b526288Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
35636b526288Smrg  lt_cv_deplibs_check_method=pass_all
35646b526288Smrg  ;;
356511a29bacSmrg
35666b526288Smrgnetbsd*)
35676b526288Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
35686b526288Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
35696b526288Smrg  else
35706b526288Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
35716b526288Smrg  fi
35726b526288Smrg  ;;
357311a29bacSmrg
35746b526288Smrgnewos6*)
35756b526288Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
35766b526288Smrg  lt_cv_file_magic_cmd=/usr/bin/file
35776b526288Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
35786b526288Smrg  ;;
357911a29bacSmrg
35806b526288Smrg*nto* | *qnx*)
35816b526288Smrg  lt_cv_deplibs_check_method=pass_all
35826b526288Smrg  ;;
35836b526288Smrg
35846b526288Smrgopenbsd* | bitrig*)
35856b526288Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
35866b526288Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
35876b526288Smrg  else
35886b526288Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
35896b526288Smrg  fi
35906b526288Smrg  ;;
35916b526288Smrg
35926b526288Smrgosf3* | osf4* | osf5*)
35936b526288Smrg  lt_cv_deplibs_check_method=pass_all
35946b526288Smrg  ;;
35956b526288Smrg
35966b526288Smrgrdos*)
35976b526288Smrg  lt_cv_deplibs_check_method=pass_all
35986b526288Smrg  ;;
35996b526288Smrg
36006b526288Smrgsolaris*)
36016b526288Smrg  lt_cv_deplibs_check_method=pass_all
36026b526288Smrg  ;;
36036b526288Smrg
36046b526288Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
36056b526288Smrg  lt_cv_deplibs_check_method=pass_all
36066b526288Smrg  ;;
36076b526288Smrg
36086b526288Smrgsysv4 | sysv4.3*)
36096b526288Smrg  case $host_vendor in
36106b526288Smrg  motorola)
36116b526288Smrg    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]]'
36126b526288Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
361311a29bacSmrg    ;;
36146b526288Smrg  ncr)
36156b526288Smrg    lt_cv_deplibs_check_method=pass_all
36166b526288Smrg    ;;
36176b526288Smrg  sequent)
36186b526288Smrg    lt_cv_file_magic_cmd='/bin/file'
36196b526288Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
36206b526288Smrg    ;;
36216b526288Smrg  sni)
36226b526288Smrg    lt_cv_file_magic_cmd='/bin/file'
36236b526288Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
36246b526288Smrg    lt_cv_file_magic_test_file=/lib/libc.so
36256b526288Smrg    ;;
36266b526288Smrg  siemens)
36276b526288Smrg    lt_cv_deplibs_check_method=pass_all
36286b526288Smrg    ;;
36296b526288Smrg  pc)
36306b526288Smrg    lt_cv_deplibs_check_method=pass_all
363111a29bacSmrg    ;;
363211a29bacSmrg  esac
36336b526288Smrg  ;;
363441b2f0bdSmrg
36356b526288Smrgtpf*)
36366b526288Smrg  lt_cv_deplibs_check_method=pass_all
36376b526288Smrg  ;;
36386b526288Smrgos2*)
36396b526288Smrg  lt_cv_deplibs_check_method=pass_all
36406b526288Smrg  ;;
364111a29bacSmrgesac
36426b526288Smrg])
364341b2f0bdSmrg
36446b526288Smrgfile_magic_glob=
36456b526288Smrgwant_nocaseglob=no
36466b526288Smrgif test "$build" = "$host"; then
36476b526288Smrg  case $host_os in
36486b526288Smrg  mingw* | pw32*)
36496b526288Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
36506b526288Smrg      want_nocaseglob=yes
36516b526288Smrg    else
36526b526288Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
36536b526288Smrg    fi
36546b526288Smrg    ;;
36556b526288Smrg  esac
36566b526288Smrgfi
365741b2f0bdSmrg
36586b526288Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
36596b526288Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
36606b526288Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
366141b2f0bdSmrg
36626b526288Smrg_LT_DECL([], [deplibs_check_method], [1],
36636b526288Smrg    [Method to check whether dependent libraries are shared objects])
36646b526288Smrg_LT_DECL([], [file_magic_cmd], [1],
36656b526288Smrg    [Command to use when deplibs_check_method = "file_magic"])
36666b526288Smrg_LT_DECL([], [file_magic_glob], [1],
36676b526288Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
36686b526288Smrg_LT_DECL([], [want_nocaseglob], [1],
36696b526288Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
36706b526288Smrg])# _LT_CHECK_MAGIC_METHOD
36716b526288Smrg
36726b526288Smrg
36736b526288Smrg# LT_PATH_NM
36746b526288Smrg# ----------
36756b526288Smrg# find the pathname to a BSD- or MS-compatible name lister
36766b526288SmrgAC_DEFUN([LT_PATH_NM],
36776b526288Smrg[AC_REQUIRE([AC_PROG_CC])dnl
36786b526288SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
36796b526288Smrg[if test -n "$NM"; then
36806b526288Smrg  # Let the user override the test.
36816b526288Smrg  lt_cv_path_NM=$NM
368211245024Smrgelse
36836b526288Smrg  lt_nm_to_check=${ac_tool_prefix}nm
36846b526288Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
36856b526288Smrg    lt_nm_to_check="$lt_nm_to_check nm"
36866b526288Smrg  fi
36876b526288Smrg  for lt_tmp_nm in $lt_nm_to_check; do
36886b526288Smrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
36896b526288Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
36906b526288Smrg      IFS=$lt_save_ifs
36916b526288Smrg      test -z "$ac_dir" && ac_dir=.
36926b526288Smrg      tmp_nm=$ac_dir/$lt_tmp_nm
36936b526288Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
36946b526288Smrg	# Check to see if the nm accepts a BSD-compat flag.
36956b526288Smrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
36966b526288Smrg	#   nm: unknown option "B" ignored
36976b526288Smrg	# Tru64's nm complains that /dev/null is an invalid object file
36986b526288Smrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
36996b526288Smrg	case $build_os in
37006b526288Smrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
37016b526288Smrg	*) lt_bad_file=/dev/null ;;
37026b526288Smrg	esac
37036b526288Smrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
37046b526288Smrg	*$lt_bad_file* | *'Invalid file or object type'*)
37056b526288Smrg	  lt_cv_path_NM="$tmp_nm -B"
37066b526288Smrg	  break 2
37076b526288Smrg	  ;;
37086b526288Smrg	*)
37096b526288Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
37106b526288Smrg	  */dev/null*)
37116b526288Smrg	    lt_cv_path_NM="$tmp_nm -p"
37126b526288Smrg	    break 2
37136b526288Smrg	    ;;
37146b526288Smrg	  *)
37156b526288Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
37166b526288Smrg	    continue # so that we can try to find one that supports BSD flags
37176b526288Smrg	    ;;
37186b526288Smrg	  esac
37196b526288Smrg	  ;;
37206b526288Smrg	esac
37216b526288Smrg      fi
37226b526288Smrg    done
37236b526288Smrg    IFS=$lt_save_ifs
37246b526288Smrg  done
37256b526288Smrg  : ${lt_cv_path_NM=no}
37266b526288Smrgfi])
37276b526288Smrgif test no != "$lt_cv_path_NM"; then
37286b526288Smrg  NM=$lt_cv_path_NM
37296b526288Smrgelse
37306b526288Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
37316b526288Smrg  if test -n "$DUMPBIN"; then :
37326b526288Smrg    # Let the user override the test.
37336b526288Smrg  else
37346b526288Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
37356b526288Smrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
37366b526288Smrg    *COFF*)
37376b526288Smrg      DUMPBIN="$DUMPBIN -symbols -headers"
37386b526288Smrg      ;;
37396b526288Smrg    *)
37406b526288Smrg      DUMPBIN=:
37416b526288Smrg      ;;
37426b526288Smrg    esac
37436b526288Smrg  fi
37446b526288Smrg  AC_SUBST([DUMPBIN])
37456b526288Smrg  if test : != "$DUMPBIN"; then
37466b526288Smrg    NM=$DUMPBIN
37476b526288Smrg  fi
374811245024Smrgfi
37496b526288Smrgtest -z "$NM" && NM=nm
37506b526288SmrgAC_SUBST([NM])
37516b526288Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
375241b2f0bdSmrg
37536b526288SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
37546b526288Smrg  [lt_cv_nm_interface="BSD nm"
37556b526288Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
37566b526288Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
37576b526288Smrg  (eval "$ac_compile" 2>conftest.err)
37586b526288Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
37596b526288Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
37606b526288Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
37616b526288Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
37626b526288Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
37636b526288Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
37646b526288Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
37656b526288Smrg    lt_cv_nm_interface="MS dumpbin"
37666b526288Smrg  fi
37676b526288Smrg  rm -f conftest*])
37686b526288Smrg])# LT_PATH_NM
37696b526288Smrg
37706b526288Smrg# Old names:
37716b526288SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
37726b526288SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
377311a29bacSmrgdnl aclocal-1.4 backwards compatibility:
37746b526288Smrgdnl AC_DEFUN([AM_PROG_NM], [])
37756b526288Smrgdnl AC_DEFUN([AC_PROG_NM], [])
377641b2f0bdSmrg
37776b526288Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
37786b526288Smrg# --------------------------------
37796b526288Smrg# how to determine the name of the shared library
37806b526288Smrg# associated with a specific link library.
37816b526288Smrg#  -- PORTME fill in with the dynamic library characteristics
37826b526288Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
37836b526288Smrg[m4_require([_LT_DECL_EGREP])
37846b526288Smrgm4_require([_LT_DECL_OBJDUMP])
37856b526288Smrgm4_require([_LT_DECL_DLLTOOL])
37866b526288SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
37876b526288Smrglt_cv_sharedlib_from_linklib_cmd,
37886b526288Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
378911a29bacSmrg
37906b526288Smrgcase $host_os in
37916b526288Smrgcygwin* | mingw* | pw32* | cegcc*)
37926b526288Smrg  # two different shell functions defined in ltmain.sh;
37936b526288Smrg  # decide which one to use based on capabilities of $DLLTOOL
37946b526288Smrg  case `$DLLTOOL --help 2>&1` in
37956b526288Smrg  *--identify-strict*)
37966b526288Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
37976b526288Smrg    ;;
37986b526288Smrg  *)
37996b526288Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
38006b526288Smrg    ;;
38016b526288Smrg  esac
38026b526288Smrg  ;;
38036b526288Smrg*)
38046b526288Smrg  # fallback: assume linklib IS sharedlib
38056b526288Smrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
38066b526288Smrg  ;;
38076b526288Smrgesac
380841b2f0bdSmrg])
38096b526288Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
38106b526288Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
381141b2f0bdSmrg
38126b526288Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
38136b526288Smrg    [Command to associate shared and link libraries])
38146b526288Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
38156b526288Smrg
38166b526288Smrg
38176b526288Smrg# _LT_PATH_MANIFEST_TOOL
38186b526288Smrg# ----------------------
38196b526288Smrg# locate the manifest tool
38206b526288Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
38216b526288Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
38226b526288Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
38236b526288SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
38246b526288Smrg  [lt_cv_path_mainfest_tool=no
38256b526288Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
38266b526288Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
38276b526288Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
38286b526288Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
38296b526288Smrg    lt_cv_path_mainfest_tool=yes
38306b526288Smrg  fi
38316b526288Smrg  rm -f conftest*])
38326b526288Smrgif test yes != "$lt_cv_path_mainfest_tool"; then
38336b526288Smrg  MANIFEST_TOOL=:
383411245024Smrgfi
38356b526288Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
38366b526288Smrg])# _LT_PATH_MANIFEST_TOOL
383741b2f0bdSmrg
383841b2f0bdSmrg
38396b526288Smrg# _LT_DLL_DEF_P([FILE])
38406b526288Smrg# ---------------------
38416b526288Smrg# True iff FILE is a Windows DLL '.def' file.
38426b526288Smrg# Keep in sync with func_dll_def_p in the libtool script
38436b526288SmrgAC_DEFUN([_LT_DLL_DEF_P],
38446b526288Smrg[dnl
38456b526288Smrg  test DEF = "`$SED -n dnl
38466b526288Smrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
38476b526288Smrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
38486b526288Smrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
38496b526288Smrg    -e q dnl                          Only consider the first "real" line
38506b526288Smrg    $1`" dnl
38516b526288Smrg])# _LT_DLL_DEF_P
385211a29bacSmrg
38536b526288Smrg
38546b526288Smrg# LT_LIB_M
38556b526288Smrg# --------
38566b526288Smrg# check for math library
38576b526288SmrgAC_DEFUN([LT_LIB_M],
385811a29bacSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
38596b526288SmrgLIBM=
38606b526288Smrgcase $host in
38616b526288Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
38626b526288Smrg  # These system don't have libm, or don't need it
38636b526288Smrg  ;;
38646b526288Smrg*-ncr-sysv4.3*)
38656b526288Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
38666b526288Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
38676b526288Smrg  ;;
38686b526288Smrg*)
38696b526288Smrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
38706b526288Smrg  ;;
38716b526288Smrgesac
38726b526288SmrgAC_SUBST([LIBM])
38736b526288Smrg])# LT_LIB_M
387441b2f0bdSmrg
38756b526288Smrg# Old name:
38766b526288SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
38776b526288Smrgdnl aclocal-1.4 backwards compatibility:
38786b526288Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
387941b2f0bdSmrg
388041b2f0bdSmrg
38816b526288Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
38826b526288Smrg# -------------------------------
38836b526288Smrgm4_defun([_LT_COMPILER_NO_RTTI],
38846b526288Smrg[m4_require([_LT_TAG_COMPILER])dnl
388541b2f0bdSmrg
38866b526288Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
388711a29bacSmrg
38886b526288Smrgif test yes = "$GCC"; then
38896b526288Smrg  case $cc_basename in
38906b526288Smrg  nvcc*)
38916b526288Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
38926b526288Smrg  *)
38936b526288Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
38946b526288Smrg  esac
389541b2f0bdSmrg
38966b526288Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
38976b526288Smrg    lt_cv_prog_compiler_rtti_exceptions,
38986b526288Smrg    [-fno-rtti -fno-exceptions], [],
38996b526288Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
39006b526288Smrgfi
39016b526288Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
39026b526288Smrg	[Compiler flag to turn off builtin functions])
39036b526288Smrg])# _LT_COMPILER_NO_RTTI
390441b2f0bdSmrg
390541b2f0bdSmrg
39066b526288Smrg# _LT_CMD_GLOBAL_SYMBOLS
39076b526288Smrg# ----------------------
39086b526288Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
39096b526288Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
39106b526288SmrgAC_REQUIRE([AC_PROG_CC])dnl
39116b526288SmrgAC_REQUIRE([AC_PROG_AWK])dnl
39126b526288SmrgAC_REQUIRE([LT_PATH_NM])dnl
39136b526288SmrgAC_REQUIRE([LT_PATH_LD])dnl
39146b526288Smrgm4_require([_LT_DECL_SED])dnl
39156b526288Smrgm4_require([_LT_DECL_EGREP])dnl
39166b526288Smrgm4_require([_LT_TAG_COMPILER])dnl
391741b2f0bdSmrg
39186b526288Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
39196b526288SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
39206b526288SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
39216b526288Smrg[
39226b526288Smrg# These are sane defaults that work on at least a few old systems.
39236b526288Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
39246b526288Smrg
39256b526288Smrg# Character class describing NM global symbol codes.
39266b526288Smrgsymcode='[[BCDEGRST]]'
392741b2f0bdSmrg
39286b526288Smrg# Regexp to match symbols that can be accessed directly from C.
39296b526288Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
393011a29bacSmrg
39316b526288Smrg# Define system-specific variables.
39326b526288Smrgcase $host_os in
39336b526288Smrgaix*)
39346b526288Smrg  symcode='[[BCDT]]'
39356b526288Smrg  ;;
39366b526288Smrgcygwin* | mingw* | pw32* | cegcc*)
39376b526288Smrg  symcode='[[ABCDGISTW]]'
39386b526288Smrg  ;;
39396b526288Smrghpux*)
39406b526288Smrg  if test ia64 = "$host_cpu"; then
39416b526288Smrg    symcode='[[ABCDEGRST]]'
39426b526288Smrg  fi
39436b526288Smrg  ;;
39446b526288Smrgirix* | nonstopux*)
39456b526288Smrg  symcode='[[BCDEGRST]]'
39466b526288Smrg  ;;
39476b526288Smrgosf*)
39486b526288Smrg  symcode='[[BCDEGQRST]]'
39496b526288Smrg  ;;
39506b526288Smrgsolaris*)
39516b526288Smrg  symcode='[[BDRT]]'
39526b526288Smrg  ;;
39536b526288Smrgsco3.2v5*)
39546b526288Smrg  symcode='[[DT]]'
39556b526288Smrg  ;;
39566b526288Smrgsysv4.2uw2*)
39576b526288Smrg  symcode='[[DT]]'
39586b526288Smrg  ;;
39596b526288Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
39606b526288Smrg  symcode='[[ABDT]]'
39616b526288Smrg  ;;
39626b526288Smrgsysv4)
39636b526288Smrg  symcode='[[DFNSTU]]'
39646b526288Smrg  ;;
39656b526288Smrgesac
396641b2f0bdSmrg
39676b526288Smrg# If we're using GNU nm, then use its standard symbol codes.
39686b526288Smrgcase `$NM -V 2>&1` in
39696b526288Smrg*GNU* | *'with BFD'*)
39706b526288Smrg  symcode='[[ABCDGIRSTW]]' ;;
39716b526288Smrgesac
397241b2f0bdSmrg
39736b526288Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
39746b526288Smrg  # Gets list of data symbols to import.
39756b526288Smrg  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
39766b526288Smrg  # Adjust the below global symbol transforms to fixup imported variables.
39776b526288Smrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
39786b526288Smrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
39796b526288Smrg  lt_c_name_lib_hook="\
39806b526288Smrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
39816b526288Smrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
398211245024Smrgelse
39836b526288Smrg  # Disable hooks by default.
39846b526288Smrg  lt_cv_sys_global_symbol_to_import=
39856b526288Smrg  lt_cdecl_hook=
39866b526288Smrg  lt_c_name_hook=
39876b526288Smrg  lt_c_name_lib_hook=
39886b526288Smrgfi
398941b2f0bdSmrg
39906b526288Smrg# Transform an extracted symbol line into a proper C declaration.
39916b526288Smrg# Some systems (esp. on ia64) link data and code symbols differently,
39926b526288Smrg# so use this general approach.
39936b526288Smrglt_cv_sys_global_symbol_to_cdecl="sed -n"\
39946b526288Smrg$lt_cdecl_hook\
39956b526288Smrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
39966b526288Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
399741b2f0bdSmrg
39986b526288Smrg# Transform an extracted symbol line into symbol name and symbol address
39996b526288Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n"\
40006b526288Smrg$lt_c_name_hook\
40016b526288Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
40026b526288Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
40036b526288Smrg
40046b526288Smrg# Transform an extracted symbol line into symbol name with lib prefix and
40056b526288Smrg# symbol address.
40066b526288Smrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
40076b526288Smrg$lt_c_name_lib_hook\
40086b526288Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
40096b526288Smrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
40106b526288Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
401141b2f0bdSmrg
40126b526288Smrg# Handle CRLF in mingw tool chain
40136b526288Smrgopt_cr=
40146b526288Smrgcase $build_os in
40156b526288Smrgmingw*)
40166b526288Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
40176b526288Smrg  ;;
40186b526288Smrgesac
401941b2f0bdSmrg
40206b526288Smrg# Try without a prefix underscore, then with it.
40216b526288Smrgfor ac_symprfx in "" "_"; do
402241b2f0bdSmrg
40236b526288Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
40246b526288Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
402541b2f0bdSmrg
40266b526288Smrg  # Write the raw and C identifiers.
40276b526288Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
40286b526288Smrg    # Fake it for dumpbin and say T for any non-static function,
40296b526288Smrg    # D for any global variable and I for any imported variable.
40306b526288Smrg    # Also find C++ and __fastcall symbols from MSVC++,
40316b526288Smrg    # which start with @ or ?.
40326b526288Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
40336b526288Smrg"     {last_section=section; section=\$ 3};"\
40346b526288Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
40356b526288Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
40366b526288Smrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
40376b526288Smrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
40386b526288Smrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
40396b526288Smrg"     \$ 0!~/External *\|/{next};"\
40406b526288Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
40416b526288Smrg"     {if(hide[section]) next};"\
40426b526288Smrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
40436b526288Smrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
40446b526288Smrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
40456b526288Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
40466b526288Smrg"     ' prfx=^$ac_symprfx]"
404711245024Smrg  else
40486b526288Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
40496b526288Smrg  fi
40506b526288Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
405141b2f0bdSmrg
40526b526288Smrg  # Check to see that the pipe works correctly.
40536b526288Smrg  pipe_works=no
40546b526288Smrg
40556b526288Smrg  rm -f conftest*
40566b526288Smrg  cat > conftest.$ac_ext <<_LT_EOF
40576b526288Smrg#ifdef __cplusplus
40586b526288Smrgextern "C" {
40596b526288Smrg#endif
40606b526288Smrgchar nm_test_var;
40616b526288Smrgvoid nm_test_func(void);
40626b526288Smrgvoid nm_test_func(void){}
40636b526288Smrg#ifdef __cplusplus
40646b526288Smrg}
40656b526288Smrg#endif
40666b526288Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
40676b526288Smrg_LT_EOF
40686b526288Smrg
40696b526288Smrg  if AC_TRY_EVAL(ac_compile); then
40706b526288Smrg    # Now try to grab the symbols.
40716b526288Smrg    nlist=conftest.nm
40726b526288Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
40736b526288Smrg      # Try sorting and uniquifying the output.
40746b526288Smrg      if sort "$nlist" | uniq > "$nlist"T; then
40756b526288Smrg	mv -f "$nlist"T "$nlist"
40766b526288Smrg      else
40776b526288Smrg	rm -f "$nlist"T
40786b526288Smrg      fi
40796b526288Smrg
40806b526288Smrg      # Make sure that we snagged all the symbols we need.
40816b526288Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
40826b526288Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
40836b526288Smrg	  cat <<_LT_EOF > conftest.$ac_ext
40846b526288Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
40856b526288Smrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
40866b526288Smrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
40876b526288Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
40886b526288Smrg# define LT@&t@_DLSYM_CONST
40896b526288Smrg#elif defined __osf__
40906b526288Smrg/* This system does not cope well with relocations in const data.  */
40916b526288Smrg# define LT@&t@_DLSYM_CONST
40926b526288Smrg#else
40936b526288Smrg# define LT@&t@_DLSYM_CONST const
40946b526288Smrg#endif
40956b526288Smrg
40966b526288Smrg#ifdef __cplusplus
40976b526288Smrgextern "C" {
40986b526288Smrg#endif
40996b526288Smrg
41006b526288Smrg_LT_EOF
41016b526288Smrg	  # Now generate the symbol file.
41026b526288Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
41036b526288Smrg
41046b526288Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
41056b526288Smrg
41066b526288Smrg/* The mapping between symbol names and symbols.  */
41076b526288SmrgLT@&t@_DLSYM_CONST struct {
41086b526288Smrg  const char *name;
41096b526288Smrg  void       *address;
41106b526288Smrg}
41116b526288Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
41126b526288Smrg{
41136b526288Smrg  { "@PROGRAM@", (void *) 0 },
41146b526288Smrg_LT_EOF
41156b526288Smrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
41166b526288Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
41176b526288Smrg  {0, (void *) 0}
41186b526288Smrg};
41196b526288Smrg
41206b526288Smrg/* This works around a problem in FreeBSD linker */
41216b526288Smrg#ifdef FREEBSD_WORKAROUND
41226b526288Smrgstatic const void *lt_preloaded_setup() {
41236b526288Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
41246b526288Smrg}
41256b526288Smrg#endif
41266b526288Smrg
41276b526288Smrg#ifdef __cplusplus
41286b526288Smrg}
41296b526288Smrg#endif
41306b526288Smrg_LT_EOF
41316b526288Smrg	  # Now try linking the two files.
41326b526288Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
41336b526288Smrg	  lt_globsym_save_LIBS=$LIBS
41346b526288Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
41356b526288Smrg	  LIBS=conftstm.$ac_objext
41366b526288Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
41376b526288Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
41386b526288Smrg	    pipe_works=yes
41396b526288Smrg	  fi
41406b526288Smrg	  LIBS=$lt_globsym_save_LIBS
41416b526288Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
41426b526288Smrg	else
41436b526288Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
41446b526288Smrg	fi
41456b526288Smrg      else
41466b526288Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
41476b526288Smrg      fi
41486b526288Smrg    else
41496b526288Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
41506b526288Smrg    fi
41516b526288Smrg  else
41526b526288Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
41536b526288Smrg    cat conftest.$ac_ext >&5
41546b526288Smrg  fi
41556b526288Smrg  rm -rf conftest* conftst*
41566b526288Smrg
41576b526288Smrg  # Do not use the global_symbol_pipe unless it works.
41586b526288Smrg  if test yes = "$pipe_works"; then
41596b526288Smrg    break
41606b526288Smrg  else
41616b526288Smrg    lt_cv_sys_global_symbol_pipe=
41626b526288Smrg  fi
41636b526288Smrgdone
41646b526288Smrg])
41656b526288Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
41666b526288Smrg  lt_cv_sys_global_symbol_to_cdecl=
41676b526288Smrgfi
41686b526288Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
41696b526288Smrg  AC_MSG_RESULT(failed)
41706b526288Smrgelse
41716b526288Smrg  AC_MSG_RESULT(ok)
41726b526288Smrgfi
41736b526288Smrg
41746b526288Smrg# Response file support.
41756b526288Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
41766b526288Smrg  nm_file_list_spec='@'
41776b526288Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
41786b526288Smrg  nm_file_list_spec='@'
41796b526288Smrgfi
41806b526288Smrg
41816b526288Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
41826b526288Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
41836b526288Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
41846b526288Smrg    [Transform the output of nm in a proper C declaration])
41856b526288Smrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
41866b526288Smrg    [Transform the output of nm into a list of symbols to manually relocate])
41876b526288Smrg_LT_DECL([global_symbol_to_c_name_address],
41886b526288Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
41896b526288Smrg    [Transform the output of nm in a C name address pair])
41906b526288Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
41916b526288Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
41926b526288Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
41936b526288Smrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
41946b526288Smrg    [The name lister interface])
41956b526288Smrg_LT_DECL([], [nm_file_list_spec], [1],
41966b526288Smrg    [Specify filename containing input files for $NM])
41976b526288Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
41986b526288Smrg
41996b526288Smrg
42006b526288Smrg# _LT_COMPILER_PIC([TAGNAME])
42016b526288Smrg# ---------------------------
42026b526288Smrgm4_defun([_LT_COMPILER_PIC],
42036b526288Smrg[m4_require([_LT_TAG_COMPILER])dnl
42046b526288Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
42056b526288Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
42066b526288Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
42076b526288Smrg
42086b526288Smrgm4_if([$1], [CXX], [
42096b526288Smrg  # C++ specific cases for pic, static, wl, etc.
42106b526288Smrg  if test yes = "$GXX"; then
42116b526288Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
42126b526288Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
42136b526288Smrg
42146b526288Smrg    case $host_os in
42156b526288Smrg    aix*)
42166b526288Smrg      # All AIX code is PIC.
42176b526288Smrg      if test ia64 = "$host_cpu"; then
42186b526288Smrg	# AIX 5 now supports IA64 processor
42196b526288Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
42206b526288Smrg      fi
42216b526288Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42226b526288Smrg      ;;
42236b526288Smrg
42246b526288Smrg    amigaos*)
42256b526288Smrg      case $host_cpu in
42266b526288Smrg      powerpc)
42276b526288Smrg            # see comment about AmigaOS4 .so support
42286b526288Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42296b526288Smrg        ;;
42306b526288Smrg      m68k)
42316b526288Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
42326b526288Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
42336b526288Smrg            # like '-m68040'.
42346b526288Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
42356b526288Smrg        ;;
42366b526288Smrg      esac
42376b526288Smrg      ;;
42386b526288Smrg
42396b526288Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
42406b526288Smrg      # PIC is the default for these OSes.
42416b526288Smrg      ;;
42426b526288Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
42436b526288Smrg      # This hack is so that the source file can tell whether it is being
42446b526288Smrg      # built for inclusion in a dll (and should export symbols for example).
42456b526288Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
42466b526288Smrg      # (--disable-auto-import) libraries
42476b526288Smrg      m4_if([$1], [GCJ], [],
42486b526288Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
42496b526288Smrg      case $host_os in
42506b526288Smrg      os2*)
42516b526288Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
42526b526288Smrg	;;
42536b526288Smrg      esac
42546b526288Smrg      ;;
42556b526288Smrg    darwin* | rhapsody*)
42566b526288Smrg      # PIC is the default on this platform
42576b526288Smrg      # Common symbols not allowed in MH_DYLIB files
42586b526288Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
42596b526288Smrg      ;;
42606b526288Smrg    *djgpp*)
42616b526288Smrg      # DJGPP does not support shared libraries at all
42626b526288Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
42636b526288Smrg      ;;
42646b526288Smrg    haiku*)
42656b526288Smrg      # PIC is the default for Haiku.
42666b526288Smrg      # The "-static" flag exists, but is broken.
42676b526288Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
42686b526288Smrg      ;;
42696b526288Smrg    interix[[3-9]]*)
42706b526288Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
42716b526288Smrg      # Instead, we relocate shared libraries at runtime.
42726b526288Smrg      ;;
42736b526288Smrg    sysv4*MP*)
42746b526288Smrg      if test -d /usr/nec; then
42756b526288Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
42766b526288Smrg      fi
42776b526288Smrg      ;;
42786b526288Smrg    hpux*)
42796b526288Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
42806b526288Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
42816b526288Smrg      # sets the default TLS model and affects inlining.
42826b526288Smrg      case $host_cpu in
42836b526288Smrg      hppa*64*)
42846b526288Smrg	;;
42856b526288Smrg      *)
42866b526288Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42876b526288Smrg	;;
42886b526288Smrg      esac
42896b526288Smrg      ;;
42906b526288Smrg    *qnx* | *nto*)
42916b526288Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
42926b526288Smrg      # it will coredump.
42936b526288Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
42946b526288Smrg      ;;
42956b526288Smrg    *)
42966b526288Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42976b526288Smrg      ;;
42986b526288Smrg    esac
42996b526288Smrg  else
43006b526288Smrg    case $host_os in
43016b526288Smrg      aix[[4-9]]*)
43026b526288Smrg	# All AIX code is PIC.
43036b526288Smrg	if test ia64 = "$host_cpu"; then
43046b526288Smrg	  # AIX 5 now supports IA64 processor
43056b526288Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43066b526288Smrg	else
43076b526288Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
43086b526288Smrg	fi
43096b526288Smrg	;;
43106b526288Smrg      chorus*)
43116b526288Smrg	case $cc_basename in
43126b526288Smrg	cxch68*)
43136b526288Smrg	  # Green Hills C++ Compiler
43146b526288Smrg	  # _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"
43156b526288Smrg	  ;;
43166b526288Smrg	esac
43176b526288Smrg	;;
43186b526288Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
43196b526288Smrg	# This hack is so that the source file can tell whether it is being
43206b526288Smrg	# built for inclusion in a dll (and should export symbols for example).
43216b526288Smrg	m4_if([$1], [GCJ], [],
43226b526288Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
43236b526288Smrg	;;
43246b526288Smrg      dgux*)
43256b526288Smrg	case $cc_basename in
43266b526288Smrg	  ec++*)
43276b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
43286b526288Smrg	    ;;
43296b526288Smrg	  ghcx*)
43306b526288Smrg	    # Green Hills C++ Compiler
43316b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
43326b526288Smrg	    ;;
43336b526288Smrg	  *)
43346b526288Smrg	    ;;
43356b526288Smrg	esac
43366b526288Smrg	;;
43376b526288Smrg      freebsd* | dragonfly*)
43386b526288Smrg	# FreeBSD uses GNU C++
43396b526288Smrg	;;
43406b526288Smrg      hpux9* | hpux10* | hpux11*)
43416b526288Smrg	case $cc_basename in
43426b526288Smrg	  CC*)
43436b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43446b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
43456b526288Smrg	    if test ia64 != "$host_cpu"; then
43466b526288Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
43476b526288Smrg	    fi
43486b526288Smrg	    ;;
43496b526288Smrg	  aCC*)
43506b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43516b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
43526b526288Smrg	    case $host_cpu in
43536b526288Smrg	    hppa*64*|ia64*)
43546b526288Smrg	      # +Z the default
43556b526288Smrg	      ;;
43566b526288Smrg	    *)
43576b526288Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
43586b526288Smrg	      ;;
43596b526288Smrg	    esac
43606b526288Smrg	    ;;
43616b526288Smrg	  *)
43626b526288Smrg	    ;;
43636b526288Smrg	esac
43646b526288Smrg	;;
43656b526288Smrg      interix*)
43666b526288Smrg	# This is c89, which is MS Visual C++ (no shared libs)
43676b526288Smrg	# Anyone wants to do a port?
43686b526288Smrg	;;
43696b526288Smrg      irix5* | irix6* | nonstopux*)
43706b526288Smrg	case $cc_basename in
43716b526288Smrg	  CC*)
43726b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43736b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
43746b526288Smrg	    # CC pic flag -KPIC is the default.
43756b526288Smrg	    ;;
43766b526288Smrg	  *)
43776b526288Smrg	    ;;
43786b526288Smrg	esac
43796b526288Smrg	;;
43806b526288Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
43816b526288Smrg	case $cc_basename in
43826b526288Smrg	  KCC*)
43836b526288Smrg	    # KAI C++ Compiler
43846b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
43856b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
43866b526288Smrg	    ;;
43876b526288Smrg	  ecpc* )
43886b526288Smrg	    # old Intel C++ for x86_64, which still supported -KPIC.
43896b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43906b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
43916b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
43926b526288Smrg	    ;;
43936b526288Smrg	  icpc* )
43946b526288Smrg	    # Intel C++, used to be incompatible with GCC.
43956b526288Smrg	    # ICC 10 doesn't accept -KPIC any more.
43966b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43976b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
43986b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
43996b526288Smrg	    ;;
44006b526288Smrg	  pgCC* | pgcpp*)
44016b526288Smrg	    # Portland Group C++ compiler
44026b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44036b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
44046b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44056b526288Smrg	    ;;
44066b526288Smrg	  cxx*)
44076b526288Smrg	    # Compaq C++
44086b526288Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
44096b526288Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
44106b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
44116b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44126b526288Smrg	    ;;
44136b526288Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
44146b526288Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
44156b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44166b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
44176b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
44186b526288Smrg	    ;;
44196b526288Smrg	  *)
44206b526288Smrg	    case `$CC -V 2>&1 | sed 5q` in
44216b526288Smrg	    *Sun\ C*)
44226b526288Smrg	      # Sun C++ 5.9
44236b526288Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44246b526288Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44256b526288Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44266b526288Smrg	      ;;
44276b526288Smrg	    esac
44286b526288Smrg	    ;;
44296b526288Smrg	esac
44306b526288Smrg	;;
44316b526288Smrg      lynxos*)
44326b526288Smrg	;;
44336b526288Smrg      m88k*)
44346b526288Smrg	;;
44356b526288Smrg      mvs*)
44366b526288Smrg	case $cc_basename in
44376b526288Smrg	  cxx*)
44386b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
44396b526288Smrg	    ;;
44406b526288Smrg	  *)
44416b526288Smrg	    ;;
44426b526288Smrg	esac
44436b526288Smrg	;;
44446b526288Smrg      netbsd*)
44456b526288Smrg	;;
44466b526288Smrg      *qnx* | *nto*)
44476b526288Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
44486b526288Smrg        # it will coredump.
44496b526288Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
44506b526288Smrg        ;;
44516b526288Smrg      osf3* | osf4* | osf5*)
44526b526288Smrg	case $cc_basename in
44536b526288Smrg	  KCC*)
44546b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
44556b526288Smrg	    ;;
44566b526288Smrg	  RCC*)
44576b526288Smrg	    # Rational C++ 2.4.1
44586b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
44596b526288Smrg	    ;;
44606b526288Smrg	  cxx*)
44616b526288Smrg	    # Digital/Compaq C++
44626b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44636b526288Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
44646b526288Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
44656b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
44666b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44676b526288Smrg	    ;;
44686b526288Smrg	  *)
44696b526288Smrg	    ;;
44706b526288Smrg	esac
44716b526288Smrg	;;
44726b526288Smrg      psos*)
44736b526288Smrg	;;
44746b526288Smrg      solaris*)
44756b526288Smrg	case $cc_basename in
44766b526288Smrg	  CC* | sunCC*)
44776b526288Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
44786b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44796b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44806b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44816b526288Smrg	    ;;
44826b526288Smrg	  gcx*)
44836b526288Smrg	    # Green Hills C++ Compiler
44846b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
44856b526288Smrg	    ;;
44866b526288Smrg	  *)
44876b526288Smrg	    ;;
44886b526288Smrg	esac
44896b526288Smrg	;;
44906b526288Smrg      sunos4*)
44916b526288Smrg	case $cc_basename in
44926b526288Smrg	  CC*)
44936b526288Smrg	    # Sun C++ 4.x
44946b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
44956b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44966b526288Smrg	    ;;
44976b526288Smrg	  lcc*)
44986b526288Smrg	    # Lucid
44996b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
45006b526288Smrg	    ;;
45016b526288Smrg	  *)
45026b526288Smrg	    ;;
45036b526288Smrg	esac
45046b526288Smrg	;;
45056b526288Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
45066b526288Smrg	case $cc_basename in
45076b526288Smrg	  CC*)
45086b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
45096b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
45106b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
45116b526288Smrg	    ;;
45126b526288Smrg	esac
45136b526288Smrg	;;
45146b526288Smrg      tandem*)
45156b526288Smrg	case $cc_basename in
45166b526288Smrg	  NCC*)
45176b526288Smrg	    # NonStop-UX NCC 3.20
45186b526288Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
45196b526288Smrg	    ;;
45206b526288Smrg	  *)
45216b526288Smrg	    ;;
45226b526288Smrg	esac
45236b526288Smrg	;;
45246b526288Smrg      vxworks*)
45256b526288Smrg	;;
45266b526288Smrg      *)
45276b526288Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
45286b526288Smrg	;;
452911245024Smrg    esac
453041b2f0bdSmrg  fi
45316b526288Smrg],
45326b526288Smrg[
45336b526288Smrg  if test yes = "$GCC"; then
45346b526288Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
45356b526288Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
453641b2f0bdSmrg
45376b526288Smrg    case $host_os in
45386b526288Smrg      aix*)
45396b526288Smrg      # All AIX code is PIC.
45406b526288Smrg      if test ia64 = "$host_cpu"; then
45416b526288Smrg	# AIX 5 now supports IA64 processor
45426b526288Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
45436b526288Smrg      fi
45446b526288Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
45456b526288Smrg      ;;
454641b2f0bdSmrg
45476b526288Smrg    amigaos*)
45486b526288Smrg      case $host_cpu in
45496b526288Smrg      powerpc)
45506b526288Smrg            # see comment about AmigaOS4 .so support
45516b526288Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
45526b526288Smrg        ;;
45536b526288Smrg      m68k)
45546b526288Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
45556b526288Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
45566b526288Smrg            # like '-m68040'.
45576b526288Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
45586b526288Smrg        ;;
45596b526288Smrg      esac
45606b526288Smrg      ;;
456141b2f0bdSmrg
45626b526288Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
45636b526288Smrg      # PIC is the default for these OSes.
45646b526288Smrg      ;;
456541b2f0bdSmrg
45666b526288Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
45676b526288Smrg      # This hack is so that the source file can tell whether it is being
45686b526288Smrg      # built for inclusion in a dll (and should export symbols for example).
45696b526288Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
45706b526288Smrg      # (--disable-auto-import) libraries
45716b526288Smrg      m4_if([$1], [GCJ], [],
45726b526288Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
45736b526288Smrg      case $host_os in
45746b526288Smrg      os2*)
45756b526288Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
45766b526288Smrg	;;
45776b526288Smrg      esac
45786b526288Smrg      ;;
457941b2f0bdSmrg
45806b526288Smrg    darwin* | rhapsody*)
45816b526288Smrg      # PIC is the default on this platform
45826b526288Smrg      # Common symbols not allowed in MH_DYLIB files
45836b526288Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
45846b526288Smrg      ;;
458541b2f0bdSmrg
45866b526288Smrg    haiku*)
45876b526288Smrg      # PIC is the default for Haiku.
45886b526288Smrg      # The "-static" flag exists, but is broken.
45896b526288Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
45906b526288Smrg      ;;
459141b2f0bdSmrg
45926b526288Smrg    hpux*)
45936b526288Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
45946b526288Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
45956b526288Smrg      # sets the default TLS model and affects inlining.
45966b526288Smrg      case $host_cpu in
45976b526288Smrg      hppa*64*)
45986b526288Smrg	# +Z the default
45996b526288Smrg	;;
46006b526288Smrg      *)
46016b526288Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
46026b526288Smrg	;;
46036b526288Smrg      esac
46046b526288Smrg      ;;
460541b2f0bdSmrg
46066b526288Smrg    interix[[3-9]]*)
46076b526288Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
46086b526288Smrg      # Instead, we relocate shared libraries at runtime.
46096b526288Smrg      ;;
461041b2f0bdSmrg
46116b526288Smrg    msdosdjgpp*)
46126b526288Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
46136b526288Smrg      # on systems that don't support them.
46146b526288Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
46156b526288Smrg      enable_shared=no
46166b526288Smrg      ;;
461711a29bacSmrg
46186b526288Smrg    *nto* | *qnx*)
46196b526288Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
46206b526288Smrg      # it will coredump.
46216b526288Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
46226b526288Smrg      ;;
462341b2f0bdSmrg
46246b526288Smrg    sysv4*MP*)
46256b526288Smrg      if test -d /usr/nec; then
46266b526288Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
46276b526288Smrg      fi
46286b526288Smrg      ;;
462941b2f0bdSmrg
46306b526288Smrg    *)
46316b526288Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
46326b526288Smrg      ;;
46336b526288Smrg    esac
463441b2f0bdSmrg
46356b526288Smrg    case $cc_basename in
46366b526288Smrg    nvcc*) # Cuda Compiler Driver 2.2
46376b526288Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
46386b526288Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
46396b526288Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
46406b526288Smrg      fi
46416b526288Smrg      ;;
46426b526288Smrg    esac
46436b526288Smrg  else
46446b526288Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
46456b526288Smrg    case $host_os in
46466b526288Smrg    aix*)
46476b526288Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
46486b526288Smrg      if test ia64 = "$host_cpu"; then
46496b526288Smrg	# AIX 5 now supports IA64 processor
46506b526288Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
46516b526288Smrg      else
46526b526288Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
46536b526288Smrg      fi
46546b526288Smrg      ;;
465541b2f0bdSmrg
46566b526288Smrg    darwin* | rhapsody*)
46576b526288Smrg      # PIC is the default on this platform
46586b526288Smrg      # Common symbols not allowed in MH_DYLIB files
46596b526288Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
46606b526288Smrg      case $cc_basename in
46616b526288Smrg      nagfor*)
46626b526288Smrg        # NAG Fortran compiler
46636b526288Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
46646b526288Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
46656b526288Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
46666b526288Smrg        ;;
46676b526288Smrg      esac
46686b526288Smrg      ;;
466941b2f0bdSmrg
46706b526288Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
46716b526288Smrg      # This hack is so that the source file can tell whether it is being
46726b526288Smrg      # built for inclusion in a dll (and should export symbols for example).
46736b526288Smrg      m4_if([$1], [GCJ], [],
46746b526288Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
46756b526288Smrg      case $host_os in
46766b526288Smrg      os2*)
46776b526288Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
46786b526288Smrg	;;
46796b526288Smrg      esac
46806b526288Smrg      ;;
468111245024Smrg
46826b526288Smrg    hpux9* | hpux10* | hpux11*)
46836b526288Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
46846b526288Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
46856b526288Smrg      # not for PA HP-UX.
46866b526288Smrg      case $host_cpu in
46876b526288Smrg      hppa*64*|ia64*)
46886b526288Smrg	# +Z the default
46896b526288Smrg	;;
46906b526288Smrg      *)
46916b526288Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
46926b526288Smrg	;;
46936b526288Smrg      esac
46946b526288Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
46956b526288Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
46966b526288Smrg      ;;
469741b2f0bdSmrg
46986b526288Smrg    irix5* | irix6* | nonstopux*)
46996b526288Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47006b526288Smrg      # PIC (with -KPIC) is the default.
47016b526288Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
47026b526288Smrg      ;;
470341b2f0bdSmrg
47046b526288Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
47056b526288Smrg      case $cc_basename in
47066b526288Smrg      # old Intel for x86_64, which still supported -KPIC.
47076b526288Smrg      ecc*)
47086b526288Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47096b526288Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47106b526288Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
47116b526288Smrg        ;;
47126b526288Smrg      # icc used to be incompatible with GCC.
47136b526288Smrg      # ICC 10 doesn't accept -KPIC any more.
47146b526288Smrg      icc* | ifort*)
47156b526288Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47166b526288Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
47176b526288Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
47186b526288Smrg        ;;
47196b526288Smrg      # Lahey Fortran 8.1.
47206b526288Smrg      lf95*)
47216b526288Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47226b526288Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
47236b526288Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
47246b526288Smrg	;;
47256b526288Smrg      nagfor*)
47266b526288Smrg	# NAG Fortran compiler
47276b526288Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
47286b526288Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
47296b526288Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47306b526288Smrg	;;
47316b526288Smrg      tcc*)
47326b526288Smrg	# Fabrice Bellard et al's Tiny C Compiler
47336b526288Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47346b526288Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
47356b526288Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
47366b526288Smrg	;;
47376b526288Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
47386b526288Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
47396b526288Smrg	# which looks to be a dead project)
47406b526288Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47416b526288Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
47426b526288Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47436b526288Smrg        ;;
47446b526288Smrg      ccc*)
47456b526288Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47466b526288Smrg        # All Alpha code is PIC.
47476b526288Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
47486b526288Smrg        ;;
47496b526288Smrg      xl* | bgxl* | bgf* | mpixl*)
47506b526288Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
47516b526288Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47526b526288Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
47536b526288Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
47546b526288Smrg	;;
47556b526288Smrg      *)
47566b526288Smrg	case `$CC -V 2>&1 | sed 5q` in
47576b526288Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
47586b526288Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
47596b526288Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47606b526288Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47616b526288Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
47626b526288Smrg	  ;;
47636b526288Smrg	*Sun\ F* | *Sun*Fortran*)
47646b526288Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47656b526288Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47666b526288Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
47676b526288Smrg	  ;;
47686b526288Smrg	*Sun\ C*)
47696b526288Smrg	  # Sun C 5.9
47706b526288Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47716b526288Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47726b526288Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47736b526288Smrg	  ;;
47746b526288Smrg        *Intel*\ [[CF]]*Compiler*)
47756b526288Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47766b526288Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
47776b526288Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
47786b526288Smrg	  ;;
47796b526288Smrg	*Portland\ Group*)
47806b526288Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47816b526288Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
47826b526288Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47836b526288Smrg	  ;;
47846b526288Smrg	esac
47856b526288Smrg	;;
47866b526288Smrg      esac
47876b526288Smrg      ;;
478841b2f0bdSmrg
47896b526288Smrg    newsos6)
47906b526288Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47916b526288Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47926b526288Smrg      ;;
479341b2f0bdSmrg
47946b526288Smrg    *nto* | *qnx*)
47956b526288Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
47966b526288Smrg      # it will coredump.
47976b526288Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
47986b526288Smrg      ;;
479941b2f0bdSmrg
48006b526288Smrg    osf3* | osf4* | osf5*)
48016b526288Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
48026b526288Smrg      # All OSF/1 code is PIC.
48036b526288Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
48046b526288Smrg      ;;
480541b2f0bdSmrg
48066b526288Smrg    rdos*)
48076b526288Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
48086b526288Smrg      ;;
48096b526288Smrg
48106b526288Smrg    solaris*)
48116b526288Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
48126b526288Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48136b526288Smrg      case $cc_basename in
48146b526288Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
48156b526288Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
48166b526288Smrg      *)
48176b526288Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
48186b526288Smrg      esac
48196b526288Smrg      ;;
482041b2f0bdSmrg
48216b526288Smrg    sunos4*)
48226b526288Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
48236b526288Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
48246b526288Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48256b526288Smrg      ;;
482641b2f0bdSmrg
48276b526288Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
48286b526288Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
48296b526288Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
48306b526288Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48316b526288Smrg      ;;
483241b2f0bdSmrg
48336b526288Smrg    sysv4*MP*)
48346b526288Smrg      if test -d /usr/nec; then
48356b526288Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
48366b526288Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48376b526288Smrg      fi
48386b526288Smrg      ;;
483941b2f0bdSmrg
48406b526288Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
48416b526288Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
48426b526288Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
48436b526288Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48446b526288Smrg      ;;
484541b2f0bdSmrg
48466b526288Smrg    unicos*)
48476b526288Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
48486b526288Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
48496b526288Smrg      ;;
485041b2f0bdSmrg
48516b526288Smrg    uts4*)
48526b526288Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
48536b526288Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48546b526288Smrg      ;;
48556b526288Smrg
48566b526288Smrg    *)
48576b526288Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
485811245024Smrg      ;;
485911245024Smrg    esac
486011245024Smrg  fi
48616b526288Smrg])
48626b526288Smrgcase $host_os in
48636b526288Smrg  # For platforms that do not support PIC, -DPIC is meaningless:
48646b526288Smrg  *djgpp*)
48656b526288Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
486611a29bacSmrg    ;;
48676b526288Smrg  *)
48686b526288Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
486911a29bacSmrg    ;;
48706b526288Smrgesac
487141b2f0bdSmrg
48726b526288SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
48736b526288Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
48746b526288Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
48756b526288Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
487641b2f0bdSmrg
48776b526288Smrg#
48786b526288Smrg# Check to make sure the PIC flag actually works.
48796b526288Smrg#
48806b526288Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
48816b526288Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
48826b526288Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
48836b526288Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
48846b526288Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
48856b526288Smrg     "" | " "*) ;;
48866b526288Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
48876b526288Smrg     esac],
48886b526288Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
48896b526288Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
48906b526288Smrgfi
48916b526288Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
48926b526288Smrg	[Additional compiler flags for building library objects])
489341b2f0bdSmrg
48946b526288Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
48956b526288Smrg	[How to pass a linker flag through the compiler])
48966b526288Smrg#
48976b526288Smrg# Check to make sure the static flag actually works.
48986b526288Smrg#
48996b526288Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
49006b526288Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
49016b526288Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
49026b526288Smrg  $lt_tmp_static_flag,
49036b526288Smrg  [],
49046b526288Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
49056b526288Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
49066b526288Smrg	[Compiler flag to prevent dynamic linking])
49076b526288Smrg])# _LT_COMPILER_PIC
490841b2f0bdSmrg
490941b2f0bdSmrg
49106b526288Smrg# _LT_LINKER_SHLIBS([TAGNAME])
49116b526288Smrg# ----------------------------
49126b526288Smrg# See if the linker supports building shared libraries.
49136b526288Smrgm4_defun([_LT_LINKER_SHLIBS],
49146b526288Smrg[AC_REQUIRE([LT_PATH_LD])dnl
49156b526288SmrgAC_REQUIRE([LT_PATH_NM])dnl
49166b526288Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
49176b526288Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
49186b526288Smrgm4_require([_LT_DECL_EGREP])dnl
49196b526288Smrgm4_require([_LT_DECL_SED])dnl
49206b526288Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
49216b526288Smrgm4_require([_LT_TAG_COMPILER])dnl
49226b526288SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
49236b526288Smrgm4_if([$1], [CXX], [
49246b526288Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
49256b526288Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
49266b526288Smrg  case $host_os in
49276b526288Smrg  aix[[4-9]]*)
49286b526288Smrg    # If we're using GNU nm, then we don't want the "-C" option.
49296b526288Smrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
49306b526288Smrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
49316b526288Smrg    # weak defined symbols like other global defined symbols, whereas
49326b526288Smrg    # GNU nm marks them as "W".
49336b526288Smrg    # While the 'weak' keyword is ignored in the Export File, we need
49346b526288Smrg    # it in the Import File for the 'aix-soname' feature, so we have
49356b526288Smrg    # to replace the "-B" option with "-P" for AIX nm.
49366b526288Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
49376b526288Smrg      _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'
49386b526288Smrg    else
49396b526288Smrg      _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'
49406b526288Smrg    fi
49416b526288Smrg    ;;
49426b526288Smrg  pw32*)
49436b526288Smrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
49446b526288Smrg    ;;
49456b526288Smrg  cygwin* | mingw* | cegcc*)
49466b526288Smrg    case $cc_basename in
49476b526288Smrg    cl*)
49486b526288Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
494941b2f0bdSmrg      ;;
49506b526288Smrg    *)
49516b526288Smrg      _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'
49526b526288Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
495311245024Smrg      ;;
495441b2f0bdSmrg    esac
495541b2f0bdSmrg    ;;
495611245024Smrg  *)
49576b526288Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
495811245024Smrg    ;;
495911245024Smrg  esac
49606b526288Smrg], [
49616b526288Smrg  runpath_var=
49626b526288Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
49636b526288Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
49646b526288Smrg  _LT_TAGVAR(archive_cmds, $1)=
49656b526288Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
49666b526288Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
49676b526288Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
49686b526288Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
49696b526288Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
49706b526288Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
49716b526288Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
49726b526288Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
49736b526288Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
49746b526288Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
49756b526288Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
49766b526288Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
49776b526288Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
49786b526288Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
49796b526288Smrg  _LT_TAGVAR(module_cmds, $1)=
49806b526288Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
49816b526288Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
49826b526288Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
49836b526288Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
49846b526288Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
49856b526288Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
49866b526288Smrg  # included in the symbol list
49876b526288Smrg  _LT_TAGVAR(include_expsyms, $1)=
49886b526288Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
49896b526288Smrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
49906b526288Smrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
49916b526288Smrg  # as well as any symbol that contains 'd'.
49926b526288Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
49936b526288Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
49946b526288Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
49956b526288Smrg  # the symbol is explicitly referenced.  Since portable code cannot
49966b526288Smrg  # rely on this symbol name, it's probably fine to never include it in
49976b526288Smrg  # preloaded symbol tables.
49986b526288Smrg  # Exclude shared library initialization/finalization symbols.
49996b526288Smrgdnl Note also adjust exclude_expsyms for C++ above.
50006b526288Smrg  extract_expsyms_cmds=
500141b2f0bdSmrg
500211245024Smrg  case $host_os in
50036b526288Smrg  cygwin* | mingw* | pw32* | cegcc*)
50046b526288Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
50056b526288Smrg    # When not using gcc, we currently assume that we are using
50066b526288Smrg    # Microsoft Visual C++.
50076b526288Smrg    if test yes != "$GCC"; then
50086b526288Smrg      with_gnu_ld=no
50096b526288Smrg    fi
501041b2f0bdSmrg    ;;
50116b526288Smrg  interix*)
50126b526288Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
50136b526288Smrg    with_gnu_ld=yes
501441b2f0bdSmrg    ;;
50156b526288Smrg  openbsd* | bitrig*)
50166b526288Smrg    with_gnu_ld=no
501741b2f0bdSmrg    ;;
501811245024Smrg  esac
501941b2f0bdSmrg
50206b526288Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
502141b2f0bdSmrg
50226b526288Smrg  # On some targets, GNU ld is compatible enough with the native linker
50236b526288Smrg  # that we're better off using the native interface for both.
50246b526288Smrg  lt_use_gnu_ld_interface=no
50256b526288Smrg  if test yes = "$with_gnu_ld"; then
50266b526288Smrg    case $host_os in
50276b526288Smrg      aix*)
50286b526288Smrg	# The AIX port of GNU ld has always aspired to compatibility
50296b526288Smrg	# with the native linker.  However, as the warning in the GNU ld
50306b526288Smrg	# block says, versions before 2.19.5* couldn't really create working
50316b526288Smrg	# shared libraries, regardless of the interface used.
50326b526288Smrg	case `$LD -v 2>&1` in
50336b526288Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
50346b526288Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
50356b526288Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
50366b526288Smrg	  *)
50376b526288Smrg	    lt_use_gnu_ld_interface=yes
50386b526288Smrg	    ;;
50396b526288Smrg	esac
50406b526288Smrg	;;
50416b526288Smrg      *)
50426b526288Smrg	lt_use_gnu_ld_interface=yes
50436b526288Smrg	;;
50446b526288Smrg    esac
50456b526288Smrg  fi
504611a29bacSmrg
50476b526288Smrg  if test yes = "$lt_use_gnu_ld_interface"; then
50486b526288Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
50496b526288Smrg    wlarc='$wl'
50506b526288Smrg
50516b526288Smrg    # Set some defaults for GNU ld with shared library support. These
50526b526288Smrg    # are reset later if shared libraries are not supported. Putting them
50536b526288Smrg    # here allows them to be overridden if necessary.
50546b526288Smrg    runpath_var=LD_RUN_PATH
50556b526288Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
50566b526288Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
50576b526288Smrg    # ancient GNU ld didn't support --whole-archive et. al.
50586b526288Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
50596b526288Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
506011245024Smrg    else
50616b526288Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
506211245024Smrg    fi
50636b526288Smrg    supports_anon_versioning=no
50646b526288Smrg    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
50656b526288Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
50666b526288Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
50676b526288Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
50686b526288Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
50696b526288Smrg      *\ 2.11.*) ;; # other 2.11 versions
50706b526288Smrg      *) supports_anon_versioning=yes ;;
507141b2f0bdSmrg    esac
507241b2f0bdSmrg
50736b526288Smrg    # See if GNU ld supports shared libraries.
50746b526288Smrg    case $host_os in
50756b526288Smrg    aix[[3-9]]*)
50766b526288Smrg      # On AIX/PPC, the GNU linker is very broken
50776b526288Smrg      if test ia64 != "$host_cpu"; then
50786b526288Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
50796b526288Smrg	cat <<_LT_EOF 1>&2
508041b2f0bdSmrg
50816b526288Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
50826b526288Smrg*** to be unable to reliably create shared libraries on AIX.
50836b526288Smrg*** Therefore, libtool is disabling shared libraries support.  If you
50846b526288Smrg*** really care for shared libraries, you may want to install binutils
50856b526288Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
50866b526288Smrg*** You will then need to restart the configuration process.
508711a29bacSmrg
50886b526288Smrg_LT_EOF
50896b526288Smrg      fi
50906b526288Smrg      ;;
509111a29bacSmrg
50926b526288Smrg    amigaos*)
50936b526288Smrg      case $host_cpu in
50946b526288Smrg      powerpc)
50956b526288Smrg            # see comment about AmigaOS4 .so support
50966b526288Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
50976b526288Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
50986b526288Smrg        ;;
50996b526288Smrg      m68k)
51006b526288Smrg            _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)'
51016b526288Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
51026b526288Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
51036b526288Smrg        ;;
51046b526288Smrg      esac
51056b526288Smrg      ;;
510641b2f0bdSmrg
51076b526288Smrg    beos*)
51086b526288Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
51096b526288Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51106b526288Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
51116b526288Smrg	# support --undefined.  This deserves some investigation.  FIXME
51126b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
51136b526288Smrg      else
51146b526288Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
51156b526288Smrg      fi
51166b526288Smrg      ;;
511741b2f0bdSmrg
51186b526288Smrg    cygwin* | mingw* | pw32* | cegcc*)
51196b526288Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
51206b526288Smrg      # as there is no search path for DLLs.
51216b526288Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
51226b526288Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
51236b526288Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51246b526288Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
51256b526288Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
51266b526288Smrg      _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'
51276b526288Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
512841b2f0bdSmrg
51296b526288Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
51306b526288Smrg        _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'
51316b526288Smrg	# If the export-symbols file already is a .def file, use it as
51326b526288Smrg	# is; otherwise, prepend EXPORTS...
51336b526288Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
51346b526288Smrg          cp $export_symbols $output_objdir/$soname.def;
51356b526288Smrg        else
51366b526288Smrg          echo EXPORTS > $output_objdir/$soname.def;
51376b526288Smrg          cat $export_symbols >> $output_objdir/$soname.def;
51386b526288Smrg        fi~
51396b526288Smrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
51406b526288Smrg      else
51416b526288Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
51426b526288Smrg      fi
51436b526288Smrg      ;;
514441b2f0bdSmrg
51456b526288Smrg    haiku*)
51466b526288Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
51476b526288Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
51486b526288Smrg      ;;
514941b2f0bdSmrg
51506b526288Smrg    os2*)
51516b526288Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
51526b526288Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
51536b526288Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51546b526288Smrg      shrext_cmds=.dll
51556b526288Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
51566b526288Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
51576b526288Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
51586b526288Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
51596b526288Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
51606b526288Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
51616b526288Smrg	emximp -o $lib $output_objdir/$libname.def'
51626b526288Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
51636b526288Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
51646b526288Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
51656b526288Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
51666b526288Smrg	prefix_cmds="$SED"~
51676b526288Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
51686b526288Smrg	  prefix_cmds="$prefix_cmds -e 1d";
51696b526288Smrg	fi~
51706b526288Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
51716b526288Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
51726b526288Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
51736b526288Smrg	emximp -o $lib $output_objdir/$libname.def'
51746b526288Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
51756b526288Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
51766b526288Smrg      ;;
517741b2f0bdSmrg
51786b526288Smrg    interix[[3-9]]*)
51796b526288Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
51806b526288Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
51816b526288Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
51826b526288Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
51836b526288Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
51846b526288Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
51856b526288Smrg      # default) and relocated if they conflict, which is a slow very memory
51866b526288Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
51876b526288Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
51886b526288Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
51896b526288Smrg      _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'
51906b526288Smrg      _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'
51916b526288Smrg      ;;
519241b2f0bdSmrg
51936b526288Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
51946b526288Smrg      tmp_diet=no
51956b526288Smrg      if test linux-dietlibc = "$host_os"; then
51966b526288Smrg	case $cc_basename in
51976b526288Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
51986b526288Smrg	esac
51996b526288Smrg      fi
52006b526288Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
52016b526288Smrg	 && test no = "$tmp_diet"
52026b526288Smrg      then
52036b526288Smrg	tmp_addflag=' $pic_flag'
52046b526288Smrg	tmp_sharedflag='-shared'
52056b526288Smrg	case $cc_basename,$host_cpu in
52066b526288Smrg        pgcc*)				# Portland Group C compiler
52076b526288Smrg	  _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'
52086b526288Smrg	  tmp_addflag=' $pic_flag'
52096b526288Smrg	  ;;
52106b526288Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
52116b526288Smrg					# Portland Group f77 and f90 compilers
52126b526288Smrg	  _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'
52136b526288Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
52146b526288Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
52156b526288Smrg	  tmp_addflag=' -i_dynamic' ;;
52166b526288Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
52176b526288Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
52186b526288Smrg	ifc* | ifort*)			# Intel Fortran compiler
52196b526288Smrg	  tmp_addflag=' -nofor_main' ;;
52206b526288Smrg	lf95*)				# Lahey Fortran 8.1
52216b526288Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
52226b526288Smrg	  tmp_sharedflag='--shared' ;;
52236b526288Smrg        nagfor*)                        # NAGFOR 5.3
52246b526288Smrg          tmp_sharedflag='-Wl,-shared' ;;
52256b526288Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
52266b526288Smrg	  tmp_sharedflag='-qmkshrobj'
52276b526288Smrg	  tmp_addflag= ;;
52286b526288Smrg	nvcc*)	# Cuda Compiler Driver 2.2
52296b526288Smrg	  _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'
52306b526288Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
52316b526288Smrg	  ;;
52326b526288Smrg	esac
52336b526288Smrg	case `$CC -V 2>&1 | sed 5q` in
52346b526288Smrg	*Sun\ C*)			# Sun C 5.9
52356b526288Smrg	  _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'
52366b526288Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
52376b526288Smrg	  tmp_sharedflag='-G' ;;
52386b526288Smrg	*Sun\ F*)			# Sun Fortran 8.3
52396b526288Smrg	  tmp_sharedflag='-G' ;;
52406b526288Smrg	esac
52416b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
524241b2f0bdSmrg
52436b526288Smrg        if test yes = "$supports_anon_versioning"; then
52446b526288Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
52456b526288Smrg            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
52466b526288Smrg            echo "local: *; };" >> $output_objdir/$libname.ver~
52476b526288Smrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
52486b526288Smrg        fi
524941b2f0bdSmrg
52506b526288Smrg	case $cc_basename in
52516b526288Smrg	tcc*)
52526b526288Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
52536b526288Smrg	  ;;
52546b526288Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
52556b526288Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
52566b526288Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
52576b526288Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
52586b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
52596b526288Smrg	  if test yes = "$supports_anon_versioning"; then
52606b526288Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
52616b526288Smrg              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
52626b526288Smrg              echo "local: *; };" >> $output_objdir/$libname.ver~
52636b526288Smrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
52646b526288Smrg	  fi
52656b526288Smrg	  ;;
52666b526288Smrg	esac
52676b526288Smrg      else
52686b526288Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
52696b526288Smrg      fi
52706b526288Smrg      ;;
527141b2f0bdSmrg
52726b526288Smrg    netbsd*)
52736b526288Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
52746b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
52756b526288Smrg	wlarc=
52766b526288Smrg      else
52776b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
52786b526288Smrg	_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'
52796b526288Smrg      fi
52806b526288Smrg      ;;
528141b2f0bdSmrg
52826b526288Smrg    solaris*)
52836b526288Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
52846b526288Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
52856b526288Smrg	cat <<_LT_EOF 1>&2
528641b2f0bdSmrg
52876b526288Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
52886b526288Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
52896b526288Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
52906b526288Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
52916b526288Smrg*** your PATH or compiler configuration so that the native linker is
52926b526288Smrg*** used, and then restart.
52936b526288Smrg
52946b526288Smrg_LT_EOF
52956b526288Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
52966b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
52976b526288Smrg	_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'
52986b526288Smrg      else
52996b526288Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
53006b526288Smrg      fi
530111245024Smrg      ;;
53026b526288Smrg
53036b526288Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
53046b526288Smrg      case `$LD -v 2>&1` in
53056b526288Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
53066b526288Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
53076b526288Smrg	cat <<_LT_EOF 1>&2
53086b526288Smrg
53096b526288Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
53106b526288Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
53116b526288Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
53126b526288Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
53136b526288Smrg*** your PATH or compiler configuration so that the native linker is
53146b526288Smrg*** used, and then restart.
53156b526288Smrg
53166b526288Smrg_LT_EOF
53176b526288Smrg	;;
53186b526288Smrg	*)
53196b526288Smrg	  # For security reasons, it is highly recommended that you always
53206b526288Smrg	  # use absolute paths for naming shared libraries, and exclude the
53216b526288Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
53226b526288Smrg	  # requires that you compile everything twice, which is a pain.
53236b526288Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
53246b526288Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
53256b526288Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
53266b526288Smrg	    _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'
53276b526288Smrg	  else
53286b526288Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
53296b526288Smrg	  fi
53306b526288Smrg	;;
53316b526288Smrg      esac
533211245024Smrg      ;;
53336b526288Smrg
53346b526288Smrg    sunos4*)
53356b526288Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
53366b526288Smrg      wlarc=
53376b526288Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
53386b526288Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
533911245024Smrg      ;;
534041b2f0bdSmrg
53416b526288Smrg    *)
53426b526288Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
53436b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
53446b526288Smrg	_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'
53456b526288Smrg      else
53466b526288Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
53476b526288Smrg      fi
53486b526288Smrg      ;;
53496b526288Smrg    esac
535011245024Smrg
53516b526288Smrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
53526b526288Smrg      runpath_var=
53536b526288Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
53546b526288Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
53556b526288Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
53566b526288Smrg    fi
535711245024Smrg  else
53586b526288Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
535911245024Smrg    case $host_os in
53606b526288Smrg    aix3*)
53616b526288Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
53626b526288Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
53636b526288Smrg      _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'
53646b526288Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
53656b526288Smrg      # are no directories specified by -L.
53666b526288Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
53676b526288Smrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
53686b526288Smrg	# Neither direct hardcoding nor static linking is supported with a
53696b526288Smrg	# broken collect2.
53706b526288Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
53716b526288Smrg      fi
53726b526288Smrg      ;;
537311a29bacSmrg
53746b526288Smrg    aix[[4-9]]*)
53756b526288Smrg      if test ia64 = "$host_cpu"; then
53766b526288Smrg	# On IA64, the linker does run time linking by default, so we don't
53776b526288Smrg	# have to do anything special.
53786b526288Smrg	aix_use_runtimelinking=no
53796b526288Smrg	exp_sym_flag='-Bexport'
53806b526288Smrg	no_entry_flag=
53816b526288Smrg      else
53826b526288Smrg	# If we're using GNU nm, then we don't want the "-C" option.
53836b526288Smrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
53846b526288Smrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
53856b526288Smrg	# weak defined symbols like other global defined symbols, whereas
53866b526288Smrg	# GNU nm marks them as "W".
53876b526288Smrg	# While the 'weak' keyword is ignored in the Export File, we need
53886b526288Smrg	# it in the Import File for the 'aix-soname' feature, so we have
53896b526288Smrg	# to replace the "-B" option with "-P" for AIX nm.
53906b526288Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
53916b526288Smrg	  _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'
53926b526288Smrg	else
53936b526288Smrg	  _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'
53946b526288Smrg	fi
53956b526288Smrg	aix_use_runtimelinking=no
539611245024Smrg
53976b526288Smrg	# Test if we are trying to use run time linking or normal
53986b526288Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
53996b526288Smrg	# have runtime linking enabled, and use it for executables.
54006b526288Smrg	# For shared libraries, we enable/disable runtime linking
54016b526288Smrg	# depending on the kind of the shared library created -
54026b526288Smrg	# when "with_aix_soname,aix_use_runtimelinking" is:
54036b526288Smrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
54046b526288Smrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
54056b526288Smrg	#            lib.a           static archive
54066b526288Smrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
54076b526288Smrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
54086b526288Smrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
54096b526288Smrg	#            lib.a(lib.so.V) shared, rtl:no
54106b526288Smrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
54116b526288Smrg	#            lib.a           static archive
54126b526288Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
54136b526288Smrg	  for ld_flag in $LDFLAGS; do
54146b526288Smrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
54156b526288Smrg	    aix_use_runtimelinking=yes
54166b526288Smrg	    break
54176b526288Smrg	  fi
54186b526288Smrg	  done
54196b526288Smrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
54206b526288Smrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
54216b526288Smrg	    # so we don't have lib.a shared libs to link our executables.
54226b526288Smrg	    # We have to force runtime linking in this case.
54236b526288Smrg	    aix_use_runtimelinking=yes
54246b526288Smrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
54256b526288Smrg	  fi
54266b526288Smrg	  ;;
54276b526288Smrg	esac
542811245024Smrg
54296b526288Smrg	exp_sym_flag='-bexport'
54306b526288Smrg	no_entry_flag='-bnoentry'
54316b526288Smrg      fi
543211245024Smrg
54336b526288Smrg      # When large executables or shared objects are built, AIX ld can
54346b526288Smrg      # have problems creating the table of contents.  If linking a library
54356b526288Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
54366b526288Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
54376b526288Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
543811245024Smrg
54396b526288Smrg      _LT_TAGVAR(archive_cmds, $1)=''
54406b526288Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
54416b526288Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
54426b526288Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
54436b526288Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
54446b526288Smrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
54456b526288Smrg      case $with_aix_soname,$aix_use_runtimelinking in
54466b526288Smrg      aix,*) ;; # traditional, no import file
54476b526288Smrg      svr4,* | *,yes) # use import file
54486b526288Smrg	# The Import File defines what to hardcode.
54496b526288Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
54506b526288Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
54516b526288Smrg	;;
54526b526288Smrg      esac
545311a29bacSmrg
54546b526288Smrg      if test yes = "$GCC"; then
54556b526288Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
54566b526288Smrg	# We only want to do this on AIX 4.2 and lower, the check
54576b526288Smrg	# below for broken collect2 doesn't work under 4.3+
54586b526288Smrg	  collect2name=`$CC -print-prog-name=collect2`
54596b526288Smrg	  if test -f "$collect2name" &&
54606b526288Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
54616b526288Smrg	  then
54626b526288Smrg	  # We have reworked collect2
54636b526288Smrg	  :
54646b526288Smrg	  else
54656b526288Smrg	  # We have old collect2
54666b526288Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
54676b526288Smrg	  # It fails to find uninstalled libraries when the uninstalled
54686b526288Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
54696b526288Smrg	  # to unsupported forces relinking
54706b526288Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
54716b526288Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
54726b526288Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
54736b526288Smrg	  fi
54746b526288Smrg	  ;;
54756b526288Smrg	esac
54766b526288Smrg	shared_flag='-shared'
54776b526288Smrg	if test yes = "$aix_use_runtimelinking"; then
54786b526288Smrg	  shared_flag="$shared_flag "'$wl-G'
54796b526288Smrg	fi
54806b526288Smrg	# Need to ensure runtime linking is disabled for the traditional
54816b526288Smrg	# shared library, or the linker may eventually find shared libraries
54826b526288Smrg	# /with/ Import File - we do not want to mix them.
54836b526288Smrg	shared_flag_aix='-shared'
54846b526288Smrg	shared_flag_svr4='-shared $wl-G'
54856b526288Smrg      else
54866b526288Smrg	# not using gcc
54876b526288Smrg	if test ia64 = "$host_cpu"; then
54886b526288Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
54896b526288Smrg	# chokes on -Wl,-G. The following line is correct:
54906b526288Smrg	  shared_flag='-G'
54916b526288Smrg	else
54926b526288Smrg	  if test yes = "$aix_use_runtimelinking"; then
54936b526288Smrg	    shared_flag='$wl-G'
54946b526288Smrg	  else
54956b526288Smrg	    shared_flag='$wl-bM:SRE'
54966b526288Smrg	  fi
54976b526288Smrg	  shared_flag_aix='$wl-bM:SRE'
54986b526288Smrg	  shared_flag_svr4='$wl-G'
54996b526288Smrg	fi
55006b526288Smrg      fi
550111a29bacSmrg
55026b526288Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
55036b526288Smrg      # It seems that -bexpall does not export symbols beginning with
55046b526288Smrg      # underscore (_), so it is better to generate a list of symbols to export.
55056b526288Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
55066b526288Smrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
55076b526288Smrg	# Warning - without using the other runtime loading flags (-brtl),
55086b526288Smrg	# -berok will link without error, but may produce a broken library.
55096b526288Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
55106b526288Smrg        # Determine the default libpath from the value encoded in an
55116b526288Smrg        # empty executable.
55126b526288Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
55136b526288Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
55146b526288Smrg        _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
55156b526288Smrg      else
55166b526288Smrg	if test ia64 = "$host_cpu"; then
55176b526288Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
55186b526288Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
55196b526288Smrg	  _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"
55206b526288Smrg	else
55216b526288Smrg	 # Determine the default libpath from the value encoded in an
55226b526288Smrg	 # empty executable.
55236b526288Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
55246b526288Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
55256b526288Smrg	  # Warning - without using the other run time loading flags,
55266b526288Smrg	  # -berok will link without error, but may produce a broken library.
55276b526288Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
55286b526288Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
55296b526288Smrg	  if test yes = "$with_gnu_ld"; then
55306b526288Smrg	    # We only use this code for GNU lds that support --whole-archive.
55316b526288Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
553211245024Smrg	  else
55336b526288Smrg	    # Exported symbols can be pulled into shared objects from archives
55346b526288Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
55356b526288Smrg	  fi
55366b526288Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
55376b526288Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
55386b526288Smrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
55396b526288Smrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
55406b526288Smrg	  if test svr4 != "$with_aix_soname"; then
55416b526288Smrg	    # This is similar to how AIX traditionally builds its shared libraries.
55426b526288Smrg	    _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'
55436b526288Smrg	  fi
55446b526288Smrg	  if test aix != "$with_aix_soname"; then
55456b526288Smrg	    _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'
55466b526288Smrg	  else
55476b526288Smrg	    # used by -dlpreopen to get the symbols
55486b526288Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
55496b526288Smrg	  fi
55506b526288Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
55516b526288Smrg	fi
555211245024Smrg      fi
55536b526288Smrg      ;;
555441b2f0bdSmrg
55556b526288Smrg    amigaos*)
55566b526288Smrg      case $host_cpu in
55576b526288Smrg      powerpc)
55586b526288Smrg            # see comment about AmigaOS4 .so support
55596b526288Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
55606b526288Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
55616b526288Smrg        ;;
55626b526288Smrg      m68k)
55636b526288Smrg            _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)'
55646b526288Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
55656b526288Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
55666b526288Smrg        ;;
55676b526288Smrg      esac
55686b526288Smrg      ;;
556941b2f0bdSmrg
55706b526288Smrg    bsdi[[45]]*)
55716b526288Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
55726b526288Smrg      ;;
557311a29bacSmrg
55746b526288Smrg    cygwin* | mingw* | pw32* | cegcc*)
55756b526288Smrg      # When not using gcc, we currently assume that we are using
55766b526288Smrg      # Microsoft Visual C++.
55776b526288Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
55786b526288Smrg      # no search path for DLLs.
55796b526288Smrg      case $cc_basename in
55806b526288Smrg      cl*)
55816b526288Smrg	# Native MSVC
55826b526288Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
55836b526288Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
55846b526288Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
55856b526288Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
55866b526288Smrg	# Tell ltmain to make .lib files, not .a files.
55876b526288Smrg	libext=lib
55886b526288Smrg	# Tell ltmain to make .dll files, not .so files.
55896b526288Smrg	shrext_cmds=.dll
55906b526288Smrg	# FIXME: Setting linknames here is a bad hack.
55916b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
55926b526288Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
55936b526288Smrg            cp "$export_symbols" "$output_objdir/$soname.def";
55946b526288Smrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
55956b526288Smrg          else
55966b526288Smrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
55976b526288Smrg          fi~
55986b526288Smrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
55996b526288Smrg          linknames='
56006b526288Smrg	# The linker will not automatically build a static lib if we build a DLL.
56016b526288Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
56026b526288Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
56036b526288Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
56046b526288Smrg	_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'
56056b526288Smrg	# Don't use ranlib
56066b526288Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
56076b526288Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
56086b526288Smrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
56096b526288Smrg          case $lt_outputfile in
56106b526288Smrg            *.exe|*.EXE) ;;
56116b526288Smrg            *)
56126b526288Smrg              lt_outputfile=$lt_outputfile.exe
56136b526288Smrg              lt_tool_outputfile=$lt_tool_outputfile.exe
56146b526288Smrg              ;;
56156b526288Smrg          esac~
56166b526288Smrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
56176b526288Smrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
56186b526288Smrg            $RM "$lt_outputfile.manifest";
56196b526288Smrg          fi'
56206b526288Smrg	;;
56216b526288Smrg      *)
56226b526288Smrg	# Assume MSVC wrapper
56236b526288Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
56246b526288Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
56256b526288Smrg	# Tell ltmain to make .lib files, not .a files.
56266b526288Smrg	libext=lib
56276b526288Smrg	# Tell ltmain to make .dll files, not .so files.
56286b526288Smrg	shrext_cmds=.dll
56296b526288Smrg	# FIXME: Setting linknames here is a bad hack.
56306b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
56316b526288Smrg	# The linker will automatically build a .lib file if we build a DLL.
56326b526288Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
56336b526288Smrg	# FIXME: Should let the user specify the lib program.
56346b526288Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
56356b526288Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
56366b526288Smrg	;;
56376b526288Smrg      esac
56386b526288Smrg      ;;
563941b2f0bdSmrg
56406b526288Smrg    darwin* | rhapsody*)
56416b526288Smrg      _LT_DARWIN_LINKER_FEATURES($1)
56426b526288Smrg      ;;
564341b2f0bdSmrg
56446b526288Smrg    dgux*)
56456b526288Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
56466b526288Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
56476b526288Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
56486b526288Smrg      ;;
564911a29bacSmrg
56506b526288Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
56516b526288Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
56526b526288Smrg    # does not break anything, and helps significantly (at the cost of a little
56536b526288Smrg    # extra space).
56546b526288Smrg    freebsd2.2*)
56556b526288Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
56566b526288Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
56576b526288Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56586b526288Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
56596b526288Smrg      ;;
566011a29bacSmrg
56616b526288Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
56626b526288Smrg    freebsd2.*)
56636b526288Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
56646b526288Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56656b526288Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
56666b526288Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
566711245024Smrg      ;;
566841b2f0bdSmrg
56696b526288Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
56706b526288Smrg    freebsd* | dragonfly*)
56716b526288Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
56726b526288Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
56736b526288Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56746b526288Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
56756b526288Smrg      ;;
567641b2f0bdSmrg
56776b526288Smrg    hpux9*)
56786b526288Smrg      if test yes = "$GCC"; then
56796b526288Smrg	_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'
56806b526288Smrg      else
56816b526288Smrg	_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'
56826b526288Smrg      fi
56836b526288Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
56846b526288Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
56856b526288Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
568611a29bacSmrg
56876b526288Smrg      # hardcode_minus_L: Not really in the search PATH,
56886b526288Smrg      # but as the default location of the library.
56896b526288Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
56906b526288Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
56916b526288Smrg      ;;
569211a29bacSmrg
56936b526288Smrg    hpux10*)
56946b526288Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
56956b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
56966b526288Smrg      else
56976b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
56986b526288Smrg      fi
56996b526288Smrg      if test no = "$with_gnu_ld"; then
57006b526288Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
57016b526288Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
57026b526288Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
57036b526288Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
57046b526288Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
57056b526288Smrg	# hardcode_minus_L: Not really in the search PATH,
57066b526288Smrg	# but as the default location of the library.
57076b526288Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
57086b526288Smrg      fi
57096b526288Smrg      ;;
57106b526288Smrg
57116b526288Smrg    hpux11*)
57126b526288Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
57136b526288Smrg	case $host_cpu in
57146b526288Smrg	hppa*64*)
57156b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
57166b526288Smrg	  ;;
57176b526288Smrg	ia64*)
57186b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
57196b526288Smrg	  ;;
57206b526288Smrg	*)
57216b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
57226b526288Smrg	  ;;
57236b526288Smrg	esac
57246b526288Smrg      else
57256b526288Smrg	case $host_cpu in
57266b526288Smrg	hppa*64*)
57276b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
57286b526288Smrg	  ;;
57296b526288Smrg	ia64*)
57306b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
57316b526288Smrg	  ;;
57326b526288Smrg	*)
57336b526288Smrg	m4_if($1, [], [
57346b526288Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
57356b526288Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
57366b526288Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
57376b526288Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
57386b526288Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
57396b526288Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
57406b526288Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
57416b526288Smrg	  ;;
57426b526288Smrg	esac
57436b526288Smrg      fi
57446b526288Smrg      if test no = "$with_gnu_ld"; then
57456b526288Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
57466b526288Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
574741b2f0bdSmrg
57486b526288Smrg	case $host_cpu in
57496b526288Smrg	hppa*64*|ia64*)
57506b526288Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
57516b526288Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
57526b526288Smrg	  ;;
57536b526288Smrg	*)
57546b526288Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
57556b526288Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
57566b526288Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
575741b2f0bdSmrg
57586b526288Smrg	  # hardcode_minus_L: Not really in the search PATH,
57596b526288Smrg	  # but as the default location of the library.
57606b526288Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
57616b526288Smrg	  ;;
57626b526288Smrg	esac
57636b526288Smrg      fi
57646b526288Smrg      ;;
576541b2f0bdSmrg
57666b526288Smrg    irix5* | irix6* | nonstopux*)
57676b526288Smrg      if test yes = "$GCC"; then
57686b526288Smrg	_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'
57696b526288Smrg	# Try to use the -exported_symbol ld option, if it does not
57706b526288Smrg	# work, assume that -exports_file does not work either and
57716b526288Smrg	# implicitly export all symbols.
57726b526288Smrg	# This should be the same for all languages, so no per-tag cache variable.
57736b526288Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
57746b526288Smrg	  [lt_cv_irix_exported_symbol],
57756b526288Smrg	  [save_LDFLAGS=$LDFLAGS
57766b526288Smrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
57776b526288Smrg	   AC_LINK_IFELSE(
57786b526288Smrg	     [AC_LANG_SOURCE(
57796b526288Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
57806b526288Smrg			      [C++], [[int foo (void) { return 0; }]],
57816b526288Smrg			      [Fortran 77], [[
57826b526288Smrg      subroutine foo
57836b526288Smrg      end]],
57846b526288Smrg			      [Fortran], [[
57856b526288Smrg      subroutine foo
57866b526288Smrg      end]])])],
57876b526288Smrg	      [lt_cv_irix_exported_symbol=yes],
57886b526288Smrg	      [lt_cv_irix_exported_symbol=no])
57896b526288Smrg           LDFLAGS=$save_LDFLAGS])
57906b526288Smrg	if test yes = "$lt_cv_irix_exported_symbol"; then
57916b526288Smrg          _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'
57926b526288Smrg	fi
57936b526288Smrg      else
57946b526288Smrg	_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'
57956b526288Smrg	_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'
57966b526288Smrg      fi
57976b526288Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
57986b526288Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
57996b526288Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
58006b526288Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
58016b526288Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
58026b526288Smrg      ;;
580341b2f0bdSmrg
58046b526288Smrg    linux*)
58056b526288Smrg      case $cc_basename in
58066b526288Smrg      tcc*)
58076b526288Smrg	# Fabrice Bellard et al's Tiny C Compiler
58086b526288Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
58096b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
58106b526288Smrg	;;
58116b526288Smrg      esac
58126b526288Smrg      ;;
581341b2f0bdSmrg
58146b526288Smrg    netbsd*)
58156b526288Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
58166b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
58176b526288Smrg      else
58186b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
58196b526288Smrg      fi
58206b526288Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
58216b526288Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
58226b526288Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58236b526288Smrg      ;;
582441b2f0bdSmrg
58256b526288Smrg    newsos6)
58266b526288Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
58276b526288Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
58286b526288Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
58296b526288Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
58306b526288Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58316b526288Smrg      ;;
583241b2f0bdSmrg
58336b526288Smrg    *nto* | *qnx*)
58346b526288Smrg      ;;
583541b2f0bdSmrg
58366b526288Smrg    openbsd* | bitrig*)
58376b526288Smrg      if test -f /usr/libexec/ld.so; then
58386b526288Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
58396b526288Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58406b526288Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
58416b526288Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
58426b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
58436b526288Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
58446b526288Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
58456b526288Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
58466b526288Smrg	else
58476b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
58486b526288Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
58496b526288Smrg	fi
58506b526288Smrg      else
58516b526288Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
58526b526288Smrg      fi
58536b526288Smrg      ;;
585441b2f0bdSmrg
58556b526288Smrg    os2*)
58566b526288Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
58576b526288Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
58586b526288Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
58596b526288Smrg      shrext_cmds=.dll
58606b526288Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
58616b526288Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
58626b526288Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
58636b526288Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
58646b526288Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
58656b526288Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
58666b526288Smrg	emximp -o $lib $output_objdir/$libname.def'
58676b526288Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
58686b526288Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
58696b526288Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
58706b526288Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
58716b526288Smrg	prefix_cmds="$SED"~
58726b526288Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
58736b526288Smrg	  prefix_cmds="$prefix_cmds -e 1d";
58746b526288Smrg	fi~
58756b526288Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
58766b526288Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
58776b526288Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
58786b526288Smrg	emximp -o $lib $output_objdir/$libname.def'
58796b526288Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
58806b526288Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
58816b526288Smrg      ;;
588241b2f0bdSmrg
58836b526288Smrg    osf3*)
58846b526288Smrg      if test yes = "$GCC"; then
58856b526288Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
58866b526288Smrg	_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'
58876b526288Smrg      else
58886b526288Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
58896b526288Smrg	_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'
58906b526288Smrg      fi
58916b526288Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
58926b526288Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
58936b526288Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
58946b526288Smrg      ;;
589511a29bacSmrg
58966b526288Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
58976b526288Smrg      if test yes = "$GCC"; then
58986b526288Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
58996b526288Smrg	_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'
59006b526288Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
59016b526288Smrg      else
59026b526288Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
59036b526288Smrg	_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'
59046b526288Smrg	_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~
59056b526288Smrg          $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'
590641b2f0bdSmrg
59076b526288Smrg	# Both c and cxx compiler support -rpath directly
59086b526288Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
59096b526288Smrg      fi
59106b526288Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
59116b526288Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
591211245024Smrg      ;;
591341b2f0bdSmrg
59146b526288Smrg    solaris*)
59156b526288Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
59166b526288Smrg      if test yes = "$GCC"; then
59176b526288Smrg	wlarc='$wl'
59186b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
59196b526288Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
59206b526288Smrg          $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'
59216b526288Smrg      else
59226b526288Smrg	case `$CC -V 2>&1` in
59236b526288Smrg	*"Compilers 5.0"*)
59246b526288Smrg	  wlarc=''
59256b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
59266b526288Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
59276b526288Smrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
59286b526288Smrg	  ;;
59296b526288Smrg	*)
59306b526288Smrg	  wlarc='$wl'
59316b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
59326b526288Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
59336b526288Smrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
59346b526288Smrg	  ;;
59356b526288Smrg	esac
59366b526288Smrg      fi
59376b526288Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
59386b526288Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59396b526288Smrg      case $host_os in
59406b526288Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
59416b526288Smrg      *)
59426b526288Smrg	# The compiler driver will combine and reorder linker options,
59436b526288Smrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
59446b526288Smrg	# but is careful enough not to reorder.
59456b526288Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
59466b526288Smrg	if test yes = "$GCC"; then
59476b526288Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
59486b526288Smrg	else
59496b526288Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
59506b526288Smrg	fi
59516b526288Smrg	;;
59526b526288Smrg      esac
59536b526288Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
59546b526288Smrg      ;;
595541b2f0bdSmrg
59566b526288Smrg    sunos4*)
59576b526288Smrg      if test sequent = "$host_vendor"; then
59586b526288Smrg	# Use $CC to link under sequent, because it throws in some extra .o
59596b526288Smrg	# files that make .init and .fini sections work.
59606b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
59616b526288Smrg      else
59626b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
59636b526288Smrg      fi
59646b526288Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
59656b526288Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
59666b526288Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
59676b526288Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59686b526288Smrg      ;;
596911a29bacSmrg
59706b526288Smrg    sysv4)
59716b526288Smrg      case $host_vendor in
59726b526288Smrg	sni)
59736b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
59746b526288Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
59756b526288Smrg	;;
59766b526288Smrg	siemens)
59776b526288Smrg	  ## LD is ld it makes a PLAMLIB
59786b526288Smrg	  ## CC just makes a GrossModule.
59796b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
59806b526288Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
59816b526288Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
59826b526288Smrg        ;;
59836b526288Smrg	motorola)
59846b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
59856b526288Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
59866b526288Smrg	;;
59876b526288Smrg      esac
59886b526288Smrg      runpath_var='LD_RUN_PATH'
59896b526288Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59906b526288Smrg      ;;
599141b2f0bdSmrg
59926b526288Smrg    sysv4.3*)
59936b526288Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
59946b526288Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59956b526288Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
59966b526288Smrg      ;;
599741b2f0bdSmrg
59986b526288Smrg    sysv4*MP*)
59996b526288Smrg      if test -d /usr/nec; then
60006b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
60016b526288Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60026b526288Smrg	runpath_var=LD_RUN_PATH
60036b526288Smrg	hardcode_runpath_var=yes
60046b526288Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
60056b526288Smrg      fi
60066b526288Smrg      ;;
600741b2f0bdSmrg
60086b526288Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
60096b526288Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
60106b526288Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
60116b526288Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60126b526288Smrg      runpath_var='LD_RUN_PATH'
601341b2f0bdSmrg
60146b526288Smrg      if test yes = "$GCC"; then
60156b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60166b526288Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60176b526288Smrg      else
60186b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60196b526288Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60206b526288Smrg      fi
60216b526288Smrg      ;;
602241b2f0bdSmrg
60236b526288Smrg    sysv5* | sco3.2v5* | sco5v6*)
60246b526288Smrg      # Note: We CANNOT use -z defs as we might desire, because we do not
60256b526288Smrg      # link with -lc, and that would cause any symbols used from libc to
60266b526288Smrg      # always be unresolved, which means just about no library would
60276b526288Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
60286b526288Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
60296b526288Smrg      # as -z defs.
60306b526288Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
60316b526288Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
60326b526288Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
60336b526288Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60346b526288Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
60356b526288Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
60366b526288Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
60376b526288Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
60386b526288Smrg      runpath_var='LD_RUN_PATH'
603941b2f0bdSmrg
60406b526288Smrg      if test yes = "$GCC"; then
60416b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60426b526288Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60436b526288Smrg      else
60446b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60456b526288Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60466b526288Smrg      fi
60476b526288Smrg      ;;
604841b2f0bdSmrg
60496b526288Smrg    uts4*)
60506b526288Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
60516b526288Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
60526b526288Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60536b526288Smrg      ;;
605441b2f0bdSmrg
60556b526288Smrg    *)
60566b526288Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
60576b526288Smrg      ;;
60586b526288Smrg    esac
605941b2f0bdSmrg
60606b526288Smrg    if test sni = "$host_vendor"; then
60616b526288Smrg      case $host in
60626b526288Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
60636b526288Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
60646b526288Smrg	;;
60656b526288Smrg      esac
60666b526288Smrg    fi
60676b526288Smrg  fi
60686b526288Smrg])
60696b526288SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
60706b526288Smrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
607141b2f0bdSmrg
60726b526288Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
607341b2f0bdSmrg
60746b526288Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
60756b526288Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
60766b526288Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
60776b526288Smrg    [The commands to extract the exported symbol list from a shared archive])
607811a29bacSmrg
60796b526288Smrg#
60806b526288Smrg# Do we need to explicitly link libc?
60816b526288Smrg#
60826b526288Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
60836b526288Smrgx|xyes)
60846b526288Smrg  # Assume -lc should be added
60856b526288Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
608641b2f0bdSmrg
60876b526288Smrg  if test yes,yes = "$GCC,$enable_shared"; then
60886b526288Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
60896b526288Smrg    *'~'*)
60906b526288Smrg      # FIXME: we may have to deal with multi-command sequences.
60916b526288Smrg      ;;
60926b526288Smrg    '$CC '*)
60936b526288Smrg      # Test whether the compiler implicitly links with -lc since on some
60946b526288Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
60956b526288Smrg      # to ld, don't add -lc before -lgcc.
60966b526288Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
60976b526288Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
60986b526288Smrg	[$RM conftest*
60996b526288Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
61006b526288Smrg
61016b526288Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
61026b526288Smrg	  soname=conftest
61036b526288Smrg	  lib=conftest
61046b526288Smrg	  libobjs=conftest.$ac_objext
61056b526288Smrg	  deplibs=
61066b526288Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
61076b526288Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
61086b526288Smrg	  compiler_flags=-v
61096b526288Smrg	  linker_flags=-v
61106b526288Smrg	  verstring=
61116b526288Smrg	  output_objdir=.
61126b526288Smrg	  libname=conftest
61136b526288Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
61146b526288Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
61156b526288Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
61166b526288Smrg	  then
61176b526288Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
61186b526288Smrg	  else
61196b526288Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
61206b526288Smrg	  fi
61216b526288Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
61226b526288Smrg	else
61236b526288Smrg	  cat conftest.err 1>&5
61246b526288Smrg	fi
61256b526288Smrg	$RM conftest*
61266b526288Smrg	])
61276b526288Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
61286b526288Smrg      ;;
61296b526288Smrg    esac
61306b526288Smrg  fi
613111245024Smrg  ;;
613211245024Smrgesac
613311a29bacSmrg
61346b526288Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
61356b526288Smrg    [Whether or not to add -lc for building shared libraries])
61366b526288Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
61376b526288Smrg    [enable_shared_with_static_runtimes], [0],
61386b526288Smrg    [Whether or not to disallow shared libs when runtime libs are static])
61396b526288Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
61406b526288Smrg    [Compiler flag to allow reflexive dlopens])
61416b526288Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
61426b526288Smrg    [Compiler flag to generate shared objects directly from archives])
61436b526288Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
61446b526288Smrg    [Whether the compiler copes with passing no objects directly])
61456b526288Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
61466b526288Smrg    [Create an old-style archive from a shared archive])
61476b526288Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
61486b526288Smrg    [Create a temporary old-style archive to link instead of a shared archive])
61496b526288Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
61506b526288Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
61516b526288Smrg_LT_TAGDECL([], [module_cmds], [2],
61526b526288Smrg    [Commands used to build a loadable module if different from building
61536b526288Smrg    a shared archive.])
61546b526288Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
61556b526288Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
61566b526288Smrg    [Whether we are building with GNU ld or not])
61576b526288Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
61586b526288Smrg    [Flag that allows shared libraries with undefined symbols to be built])
61596b526288Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
61606b526288Smrg    [Flag that enforces no undefined symbols])
61616b526288Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
61626b526288Smrg    [Flag to hardcode $libdir into a binary during linking.
61636b526288Smrg    This must work even if $libdir does not exist])
61646b526288Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
61656b526288Smrg    [Whether we need a single "-rpath" flag with a separated argument])
61666b526288Smrg_LT_TAGDECL([], [hardcode_direct], [0],
61676b526288Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
61686b526288Smrg    DIR into the resulting binary])
61696b526288Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
61706b526288Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
61716b526288Smrg    DIR into the resulting binary and the resulting library dependency is
61726b526288Smrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
61736b526288Smrg    library is relocated])
61746b526288Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
61756b526288Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
61766b526288Smrg    into the resulting binary])
61776b526288Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
61786b526288Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
61796b526288Smrg    into the resulting binary])
61806b526288Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
61816b526288Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
61826b526288Smrg    into the library and all subsequent libraries and executables linked
61836b526288Smrg    against it])
61846b526288Smrg_LT_TAGDECL([], [inherit_rpath], [0],
61856b526288Smrg    [Set to yes if linker adds runtime paths of dependent libraries
61866b526288Smrg    to runtime path list])
61876b526288Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
61886b526288Smrg    [Whether libtool must link a program against all its dependency libraries])
61896b526288Smrg_LT_TAGDECL([], [always_export_symbols], [0],
61906b526288Smrg    [Set to "yes" if exported symbols are required])
61916b526288Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
61926b526288Smrg    [The commands to list exported symbols])
61936b526288Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
61946b526288Smrg    [Symbols that should not be listed in the preloaded symbols])
61956b526288Smrg_LT_TAGDECL([], [include_expsyms], [1],
61966b526288Smrg    [Symbols that must always be exported])
61976b526288Smrg_LT_TAGDECL([], [prelink_cmds], [2],
61986b526288Smrg    [Commands necessary for linking programs (against libraries) with templates])
61996b526288Smrg_LT_TAGDECL([], [postlink_cmds], [2],
62006b526288Smrg    [Commands necessary for finishing linking programs])
62016b526288Smrg_LT_TAGDECL([], [file_list_spec], [1],
62026b526288Smrg    [Specify filename containing input files])
62036b526288Smrgdnl FIXME: Not yet implemented
62046b526288Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
62056b526288Smrgdnl    [Compiler flag to generate thread safe objects])
62066b526288Smrg])# _LT_LINKER_SHLIBS
62076b526288Smrg
620841b2f0bdSmrg
62096b526288Smrg# _LT_LANG_C_CONFIG([TAG])
62106b526288Smrg# ------------------------
62116b526288Smrg# Ensure that the configuration variables for a C compiler are suitably
62126b526288Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
62136b526288Smrg# the compiler configuration to 'libtool'.
62146b526288Smrgm4_defun([_LT_LANG_C_CONFIG],
62156b526288Smrg[m4_require([_LT_DECL_EGREP])dnl
62166b526288Smrglt_save_CC=$CC
62176b526288SmrgAC_LANG_PUSH(C)
621841b2f0bdSmrg
62196b526288Smrg# Source file extension for C test sources.
62206b526288Smrgac_ext=c
622111a29bacSmrg
62226b526288Smrg# Object file extension for compiled C test sources.
62236b526288Smrgobjext=o
62246b526288Smrg_LT_TAGVAR(objext, $1)=$objext
622541b2f0bdSmrg
62266b526288Smrg# Code to be used in simple compile tests
62276b526288Smrglt_simple_compile_test_code="int some_variable = 0;"
622841b2f0bdSmrg
62296b526288Smrg# Code to be used in simple link tests
62306b526288Smrglt_simple_link_test_code='int main(){return(0);}'
623111a29bacSmrg
62326b526288Smrg_LT_TAG_COMPILER
62336b526288Smrg# Save the default compiler, since it gets overwritten when the other
62346b526288Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
62356b526288Smrgcompiler_DEFAULT=$CC
623641b2f0bdSmrg
62376b526288Smrg# save warnings/boilerplate of simple test code
62386b526288Smrg_LT_COMPILER_BOILERPLATE
62396b526288Smrg_LT_LINKER_BOILERPLATE
624041b2f0bdSmrg
62416b526288Smrgif test -n "$compiler"; then
62426b526288Smrg  _LT_COMPILER_NO_RTTI($1)
62436b526288Smrg  _LT_COMPILER_PIC($1)
62446b526288Smrg  _LT_COMPILER_C_O($1)
62456b526288Smrg  _LT_COMPILER_FILE_LOCKS($1)
62466b526288Smrg  _LT_LINKER_SHLIBS($1)
62476b526288Smrg  _LT_SYS_DYNAMIC_LINKER($1)
62486b526288Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
62496b526288Smrg  LT_SYS_DLOPEN_SELF
62506b526288Smrg  _LT_CMD_STRIPLIB
625141b2f0bdSmrg
62526b526288Smrg  # Report what library types will actually be built
62536b526288Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
62546b526288Smrg  AC_MSG_RESULT([$can_build_shared])
625541b2f0bdSmrg
62566b526288Smrg  AC_MSG_CHECKING([whether to build shared libraries])
62576b526288Smrg  test no = "$can_build_shared" && enable_shared=no
625841b2f0bdSmrg
62596b526288Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
62606b526288Smrg  # are all built from PIC.
62616b526288Smrg  case $host_os in
62626b526288Smrg  aix3*)
62636b526288Smrg    test yes = "$enable_shared" && enable_static=no
62646b526288Smrg    if test -n "$RANLIB"; then
62656b526288Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
62666b526288Smrg      postinstall_cmds='$RANLIB $lib'
62676b526288Smrg    fi
62686b526288Smrg    ;;
62696b526288Smrg
62706b526288Smrg  aix[[4-9]]*)
62716b526288Smrg    if test ia64 != "$host_cpu"; then
62726b526288Smrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
62736b526288Smrg      yes,aix,yes) ;;			# shared object as lib.so file only
62746b526288Smrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
62756b526288Smrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
62766b526288Smrg      esac
62776b526288Smrg    fi
62786b526288Smrg    ;;
627911a29bacSmrg  esac
62806b526288Smrg  AC_MSG_RESULT([$enable_shared])
628141b2f0bdSmrg
62826b526288Smrg  AC_MSG_CHECKING([whether to build static libraries])
62836b526288Smrg  # Make sure either enable_shared or enable_static is yes.
62846b526288Smrg  test yes = "$enable_shared" || enable_static=yes
62856b526288Smrg  AC_MSG_RESULT([$enable_static])
62866b526288Smrg
62876b526288Smrg  _LT_CONFIG($1)
628811245024Smrgfi
62896b526288SmrgAC_LANG_POP
62906b526288SmrgCC=$lt_save_CC
62916b526288Smrg])# _LT_LANG_C_CONFIG
629241b2f0bdSmrg
629341b2f0bdSmrg
62946b526288Smrg# _LT_LANG_CXX_CONFIG([TAG])
62956b526288Smrg# --------------------------
62966b526288Smrg# Ensure that the configuration variables for a C++ compiler are suitably
62976b526288Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
62986b526288Smrg# the compiler configuration to 'libtool'.
62996b526288Smrgm4_defun([_LT_LANG_CXX_CONFIG],
63006b526288Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
630111a29bacSmrgm4_require([_LT_DECL_EGREP])dnl
63026b526288Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
63036b526288Smrgif test -n "$CXX" && ( test no != "$CXX" &&
63046b526288Smrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
63056b526288Smrg    (test g++ != "$CXX"))); then
63066b526288Smrg  AC_PROG_CXXCPP
63076b526288Smrgelse
63086b526288Smrg  _lt_caught_CXX_error=yes
63096b526288Smrgfi
631041b2f0bdSmrg
63116b526288SmrgAC_LANG_PUSH(C++)
63126b526288Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
63136b526288Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
63146b526288Smrg_LT_TAGVAR(always_export_symbols, $1)=no
63156b526288Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
63166b526288Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
63176b526288Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
63186b526288Smrg_LT_TAGVAR(hardcode_direct, $1)=no
63196b526288Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
63206b526288Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
63216b526288Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
63226b526288Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
63236b526288Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
63246b526288Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
63256b526288Smrg_LT_TAGVAR(inherit_rpath, $1)=no
63266b526288Smrg_LT_TAGVAR(module_cmds, $1)=
63276b526288Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
63286b526288Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
63296b526288Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
63306b526288Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
63316b526288Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
63326b526288Smrg_LT_TAGVAR(no_undefined_flag, $1)=
63336b526288Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
63346b526288Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
633541b2f0bdSmrg
63366b526288Smrg# Source file extension for C++ test sources.
63376b526288Smrgac_ext=cpp
633841b2f0bdSmrg
63396b526288Smrg# Object file extension for compiled C++ test sources.
63406b526288Smrgobjext=o
63416b526288Smrg_LT_TAGVAR(objext, $1)=$objext
634241b2f0bdSmrg
63436b526288Smrg# No sense in running all these tests if we already determined that
63446b526288Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
63456b526288Smrg# are currently assumed to apply to all compilers on this platform,
63466b526288Smrg# and will be corrupted by setting them based on a non-working compiler.
63476b526288Smrgif test yes != "$_lt_caught_CXX_error"; then
63486b526288Smrg  # Code to be used in simple compile tests
63496b526288Smrg  lt_simple_compile_test_code="int some_variable = 0;"
635041b2f0bdSmrg
63516b526288Smrg  # Code to be used in simple link tests
63526b526288Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
635341b2f0bdSmrg
63546b526288Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
63556b526288Smrg  _LT_TAG_COMPILER
635641b2f0bdSmrg
63576b526288Smrg  # save warnings/boilerplate of simple test code
63586b526288Smrg  _LT_COMPILER_BOILERPLATE
63596b526288Smrg  _LT_LINKER_BOILERPLATE
636041b2f0bdSmrg
63616b526288Smrg  # Allow CC to be a program name with arguments.
63626b526288Smrg  lt_save_CC=$CC
63636b526288Smrg  lt_save_CFLAGS=$CFLAGS
63646b526288Smrg  lt_save_LD=$LD
63656b526288Smrg  lt_save_GCC=$GCC
63666b526288Smrg  GCC=$GXX
63676b526288Smrg  lt_save_with_gnu_ld=$with_gnu_ld
63686b526288Smrg  lt_save_path_LD=$lt_cv_path_LD
63696b526288Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
63706b526288Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
637111a29bacSmrg  else
63726b526288Smrg    $as_unset lt_cv_prog_gnu_ld
637311a29bacSmrg  fi
63746b526288Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
63756b526288Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
63766b526288Smrg  else
63776b526288Smrg    $as_unset lt_cv_path_LD
63786b526288Smrg  fi
63796b526288Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
63806b526288Smrg  CC=${CXX-"c++"}
63816b526288Smrg  CFLAGS=$CXXFLAGS
63826b526288Smrg  compiler=$CC
63836b526288Smrg  _LT_TAGVAR(compiler, $1)=$CC
63846b526288Smrg  _LT_CC_BASENAME([$compiler])
638541b2f0bdSmrg
63866b526288Smrg  if test -n "$compiler"; then
63876b526288Smrg    # We don't want -fno-exception when compiling C++ code, so set the
63886b526288Smrg    # no_builtin_flag separately
63896b526288Smrg    if test yes = "$GXX"; then
63906b526288Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
63916b526288Smrg    else
63926b526288Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
63936b526288Smrg    fi
639441b2f0bdSmrg
63956b526288Smrg    if test yes = "$GXX"; then
63966b526288Smrg      # Set up default GNU C++ configuration
639741b2f0bdSmrg
63986b526288Smrg      LT_PATH_LD
639941b2f0bdSmrg
64006b526288Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
64016b526288Smrg      # archiving commands below assume that GNU ld is being used.
64026b526288Smrg      if test yes = "$with_gnu_ld"; then
64036b526288Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
64046b526288Smrg        _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'
640541b2f0bdSmrg
64066b526288Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
64076b526288Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
640841b2f0bdSmrg
64096b526288Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
64106b526288Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
64116b526288Smrg        #     investigate it a little bit more. (MM)
64126b526288Smrg        wlarc='$wl'
641341b2f0bdSmrg
64146b526288Smrg        # ancient GNU ld didn't support --whole-archive et. al.
64156b526288Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
64166b526288Smrg	  $GREP 'no-whole-archive' > /dev/null; then
64176b526288Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
64186b526288Smrg        else
64196b526288Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
64206b526288Smrg        fi
642111a29bacSmrg      else
64226b526288Smrg        with_gnu_ld=no
64236b526288Smrg        wlarc=
64246b526288Smrg
64256b526288Smrg        # A generic and very simple default shared library creation
64266b526288Smrg        # command for GNU C++ for the case where it uses the native
64276b526288Smrg        # linker, instead of GNU ld.  If possible, this setting should
64286b526288Smrg        # overridden to take advantage of the native linker features on
64296b526288Smrg        # the platform it is being used on.
64306b526288Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
643111a29bacSmrg      fi
64326b526288Smrg
64336b526288Smrg      # Commands to make compiler produce verbose output that lists
64346b526288Smrg      # what "hidden" libraries, object files and flags are used when
64356b526288Smrg      # linking a shared library.
64366b526288Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
64376b526288Smrg
643811245024Smrg    else
64396b526288Smrg      GXX=no
64406b526288Smrg      with_gnu_ld=no
64416b526288Smrg      wlarc=
644211245024Smrg    fi
644341b2f0bdSmrg
64446b526288Smrg    # PORTME: fill in a description of your system's C++ link characteristics
64456b526288Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
64466b526288Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
64476b526288Smrg    case $host_os in
64486b526288Smrg      aix3*)
64496b526288Smrg        # FIXME: insert proper C++ library support
64506b526288Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
64516b526288Smrg        ;;
64526b526288Smrg      aix[[4-9]]*)
64536b526288Smrg        if test ia64 = "$host_cpu"; then
64546b526288Smrg          # On IA64, the linker does run time linking by default, so we don't
64556b526288Smrg          # have to do anything special.
64566b526288Smrg          aix_use_runtimelinking=no
64576b526288Smrg          exp_sym_flag='-Bexport'
64586b526288Smrg          no_entry_flag=
64596b526288Smrg        else
64606b526288Smrg          aix_use_runtimelinking=no
646141b2f0bdSmrg
64626b526288Smrg          # Test if we are trying to use run time linking or normal
64636b526288Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
64646b526288Smrg          # have runtime linking enabled, and use it for executables.
64656b526288Smrg          # For shared libraries, we enable/disable runtime linking
64666b526288Smrg          # depending on the kind of the shared library created -
64676b526288Smrg          # when "with_aix_soname,aix_use_runtimelinking" is:
64686b526288Smrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
64696b526288Smrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
64706b526288Smrg          #            lib.a           static archive
64716b526288Smrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
64726b526288Smrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
64736b526288Smrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
64746b526288Smrg          #            lib.a(lib.so.V) shared, rtl:no
64756b526288Smrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
64766b526288Smrg          #            lib.a           static archive
64776b526288Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
64786b526288Smrg	    for ld_flag in $LDFLAGS; do
64796b526288Smrg	      case $ld_flag in
64806b526288Smrg	      *-brtl*)
64816b526288Smrg	        aix_use_runtimelinking=yes
64826b526288Smrg	        break
64836b526288Smrg	        ;;
64846b526288Smrg	      esac
64856b526288Smrg	    done
64866b526288Smrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
64876b526288Smrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
64886b526288Smrg	      # so we don't have lib.a shared libs to link our executables.
64896b526288Smrg	      # We have to force runtime linking in this case.
64906b526288Smrg	      aix_use_runtimelinking=yes
64916b526288Smrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
64926b526288Smrg	    fi
64936b526288Smrg	    ;;
64946b526288Smrg          esac
649541b2f0bdSmrg
64966b526288Smrg          exp_sym_flag='-bexport'
64976b526288Smrg          no_entry_flag='-bnoentry'
64986b526288Smrg        fi
649941b2f0bdSmrg
65006b526288Smrg        # When large executables or shared objects are built, AIX ld can
65016b526288Smrg        # have problems creating the table of contents.  If linking a library
65026b526288Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
65036b526288Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
65046b526288Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
650541b2f0bdSmrg
65066b526288Smrg        _LT_TAGVAR(archive_cmds, $1)=''
65076b526288Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
65086b526288Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
65096b526288Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
65106b526288Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
65116b526288Smrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
65126b526288Smrg        case $with_aix_soname,$aix_use_runtimelinking in
65136b526288Smrg        aix,*) ;;	# no import file
65146b526288Smrg        svr4,* | *,yes) # use import file
65156b526288Smrg          # The Import File defines what to hardcode.
65166b526288Smrg          _LT_TAGVAR(hardcode_direct, $1)=no
65176b526288Smrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
65186b526288Smrg          ;;
65196b526288Smrg        esac
652041b2f0bdSmrg
65216b526288Smrg        if test yes = "$GXX"; then
65226b526288Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
65236b526288Smrg          # We only want to do this on AIX 4.2 and lower, the check
65246b526288Smrg          # below for broken collect2 doesn't work under 4.3+
65256b526288Smrg	  collect2name=`$CC -print-prog-name=collect2`
65266b526288Smrg	  if test -f "$collect2name" &&
65276b526288Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
65286b526288Smrg	  then
65296b526288Smrg	    # We have reworked collect2
65306b526288Smrg	    :
65316b526288Smrg	  else
65326b526288Smrg	    # We have old collect2
65336b526288Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
65346b526288Smrg	    # It fails to find uninstalled libraries when the uninstalled
65356b526288Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
65366b526288Smrg	    # to unsupported forces relinking
65376b526288Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
65386b526288Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
65396b526288Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
65406b526288Smrg	  fi
65416b526288Smrg          esac
65426b526288Smrg          shared_flag='-shared'
65436b526288Smrg	  if test yes = "$aix_use_runtimelinking"; then
65446b526288Smrg	    shared_flag=$shared_flag' $wl-G'
65456b526288Smrg	  fi
65466b526288Smrg	  # Need to ensure runtime linking is disabled for the traditional
65476b526288Smrg	  # shared library, or the linker may eventually find shared libraries
65486b526288Smrg	  # /with/ Import File - we do not want to mix them.
65496b526288Smrg	  shared_flag_aix='-shared'
65506b526288Smrg	  shared_flag_svr4='-shared $wl-G'
65516b526288Smrg        else
65526b526288Smrg          # not using gcc
65536b526288Smrg          if test ia64 = "$host_cpu"; then
65546b526288Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
65556b526288Smrg	  # chokes on -Wl,-G. The following line is correct:
65566b526288Smrg	  shared_flag='-G'
65576b526288Smrg          else
65586b526288Smrg	    if test yes = "$aix_use_runtimelinking"; then
65596b526288Smrg	      shared_flag='$wl-G'
65606b526288Smrg	    else
65616b526288Smrg	      shared_flag='$wl-bM:SRE'
65626b526288Smrg	    fi
65636b526288Smrg	    shared_flag_aix='$wl-bM:SRE'
65646b526288Smrg	    shared_flag_svr4='$wl-G'
65656b526288Smrg          fi
65666b526288Smrg        fi
656741b2f0bdSmrg
65686b526288Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
65696b526288Smrg        # It seems that -bexpall does not export symbols beginning with
65706b526288Smrg        # underscore (_), so it is better to generate a list of symbols to
65716b526288Smrg	# export.
65726b526288Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
65736b526288Smrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
65746b526288Smrg          # Warning - without using the other runtime loading flags (-brtl),
65756b526288Smrg          # -berok will link without error, but may produce a broken library.
65766b526288Smrg          # The "-G" linker flag allows undefined symbols.
65776b526288Smrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
65786b526288Smrg          # Determine the default libpath from the value encoded in an empty
65796b526288Smrg          # executable.
65806b526288Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
65816b526288Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
65826b526288Smrg
65836b526288Smrg          _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
65846b526288Smrg        else
65856b526288Smrg          if test ia64 = "$host_cpu"; then
65866b526288Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
65876b526288Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
65886b526288Smrg	    _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"
65896b526288Smrg          else
65906b526288Smrg	    # Determine the default libpath from the value encoded in an
65916b526288Smrg	    # empty executable.
65926b526288Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
65936b526288Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
65946b526288Smrg	    # Warning - without using the other run time loading flags,
65956b526288Smrg	    # -berok will link without error, but may produce a broken library.
65966b526288Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
65976b526288Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
65986b526288Smrg	    if test yes = "$with_gnu_ld"; then
65996b526288Smrg	      # We only use this code for GNU lds that support --whole-archive.
66006b526288Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
66016b526288Smrg	    else
66026b526288Smrg	      # Exported symbols can be pulled into shared objects from archives
66036b526288Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
66046b526288Smrg	    fi
66056b526288Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
66066b526288Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
66076b526288Smrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
66086b526288Smrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
66096b526288Smrg	    if test svr4 != "$with_aix_soname"; then
66106b526288Smrg	      # This is similar to how AIX traditionally builds its shared
66116b526288Smrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
66126b526288Smrg	      _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'
66136b526288Smrg	    fi
66146b526288Smrg	    if test aix != "$with_aix_soname"; then
66156b526288Smrg	      _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'
66166b526288Smrg	    else
66176b526288Smrg	      # used by -dlpreopen to get the symbols
66186b526288Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
66196b526288Smrg	    fi
66206b526288Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
66216b526288Smrg          fi
66226b526288Smrg        fi
662311a29bacSmrg        ;;
662441b2f0bdSmrg
66256b526288Smrg      beos*)
66266b526288Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
66276b526288Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
66286b526288Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
66296b526288Smrg	  # support --undefined.  This deserves some investigation.  FIXME
66306b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
663111a29bacSmrg	else
66326b526288Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
663311a29bacSmrg	fi
663411245024Smrg	;;
66356b526288Smrg
663611a29bacSmrg      chorus*)
66376b526288Smrg        case $cc_basename in
66386b526288Smrg          *)
66396b526288Smrg	  # FIXME: insert proper C++ library support
66406b526288Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
66416b526288Smrg	  ;;
66426b526288Smrg        esac
66436b526288Smrg        ;;
66446b526288Smrg
66456b526288Smrg      cygwin* | mingw* | pw32* | cegcc*)
66466b526288Smrg	case $GXX,$cc_basename in
66476b526288Smrg	,cl* | no,cl*)
66486b526288Smrg	  # Native MSVC
66496b526288Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
66506b526288Smrg	  # no search path for DLLs.
66516b526288Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
66526b526288Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
66536b526288Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
66546b526288Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
66556b526288Smrg	  # Tell ltmain to make .lib files, not .a files.
66566b526288Smrg	  libext=lib
66576b526288Smrg	  # Tell ltmain to make .dll files, not .so files.
66586b526288Smrg	  shrext_cmds=.dll
66596b526288Smrg	  # FIXME: Setting linknames here is a bad hack.
66606b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
66616b526288Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
66626b526288Smrg              cp "$export_symbols" "$output_objdir/$soname.def";
66636b526288Smrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
66646b526288Smrg            else
66656b526288Smrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
66666b526288Smrg            fi~
66676b526288Smrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
66686b526288Smrg            linknames='
66696b526288Smrg	  # The linker will not automatically build a static lib if we build a DLL.
66706b526288Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
66716b526288Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
66726b526288Smrg	  # Don't use ranlib
66736b526288Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
66746b526288Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
66756b526288Smrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
66766b526288Smrg            case $lt_outputfile in
66776b526288Smrg              *.exe|*.EXE) ;;
66786b526288Smrg              *)
66796b526288Smrg                lt_outputfile=$lt_outputfile.exe
66806b526288Smrg                lt_tool_outputfile=$lt_tool_outputfile.exe
66816b526288Smrg                ;;
66826b526288Smrg            esac~
66836b526288Smrg            func_to_tool_file "$lt_outputfile"~
66846b526288Smrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
66856b526288Smrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
66866b526288Smrg              $RM "$lt_outputfile.manifest";
66876b526288Smrg            fi'
66886b526288Smrg	  ;;
66896b526288Smrg	*)
66906b526288Smrg	  # g++
66916b526288Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
66926b526288Smrg	  # as there is no search path for DLLs.
66936b526288Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
66946b526288Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
66956b526288Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
66966b526288Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
66976b526288Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
66986b526288Smrg
66996b526288Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
67006b526288Smrg	    _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'
67016b526288Smrg	    # If the export-symbols file already is a .def file, use it as
67026b526288Smrg	    # is; otherwise, prepend EXPORTS...
67036b526288Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
67046b526288Smrg              cp $export_symbols $output_objdir/$soname.def;
67056b526288Smrg            else
67066b526288Smrg              echo EXPORTS > $output_objdir/$soname.def;
67076b526288Smrg              cat $export_symbols >> $output_objdir/$soname.def;
67086b526288Smrg            fi~
67096b526288Smrg            $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'
67106b526288Smrg	  else
67116b526288Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67126b526288Smrg	  fi
671311245024Smrg	  ;;
671411245024Smrg	esac
671511245024Smrg	;;
67166b526288Smrg      darwin* | rhapsody*)
67176b526288Smrg        _LT_DARWIN_LINKER_FEATURES($1)
67186b526288Smrg	;;
67196b526288Smrg
67206b526288Smrg      os2*)
67216b526288Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
67226b526288Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
67236b526288Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
67246b526288Smrg	shrext_cmds=.dll
67256b526288Smrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
67266b526288Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
67276b526288Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
67286b526288Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
67296b526288Smrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
67306b526288Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
67316b526288Smrg	  emximp -o $lib $output_objdir/$libname.def'
67326b526288Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
67336b526288Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
67346b526288Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
67356b526288Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
67366b526288Smrg	  prefix_cmds="$SED"~
67376b526288Smrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
67386b526288Smrg	    prefix_cmds="$prefix_cmds -e 1d";
67396b526288Smrg	  fi~
67406b526288Smrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
67416b526288Smrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
67426b526288Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
67436b526288Smrg	  emximp -o $lib $output_objdir/$libname.def'
67446b526288Smrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
67456b526288Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
67466b526288Smrg	;;
67476b526288Smrg
674811a29bacSmrg      dgux*)
67496b526288Smrg        case $cc_basename in
67506b526288Smrg          ec++*)
67516b526288Smrg	    # FIXME: insert proper C++ library support
67526b526288Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
675311a29bacSmrg	    ;;
67546b526288Smrg          ghcx*)
675511a29bacSmrg	    # Green Hills C++ Compiler
67566b526288Smrg	    # FIXME: insert proper C++ library support
67576b526288Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
675811a29bacSmrg	    ;;
67596b526288Smrg          *)
67606b526288Smrg	    # FIXME: insert proper C++ library support
67616b526288Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
676211a29bacSmrg	    ;;
67636b526288Smrg        esac
67646b526288Smrg        ;;
67656b526288Smrg
67666b526288Smrg      freebsd2.*)
67676b526288Smrg        # C++ shared libraries reported to be fairly broken before
67686b526288Smrg	# switch to ELF
67696b526288Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
67706b526288Smrg        ;;
67716b526288Smrg
67726b526288Smrg      freebsd-elf*)
67736b526288Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
67746b526288Smrg        ;;
67756b526288Smrg
677611a29bacSmrg      freebsd* | dragonfly*)
67776b526288Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
67786b526288Smrg        # conventions
67796b526288Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
67806b526288Smrg        ;;
67816b526288Smrg
67826b526288Smrg      haiku*)
67836b526288Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
67846b526288Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
67856b526288Smrg        ;;
67866b526288Smrg
67876b526288Smrg      hpux9*)
67886b526288Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
67896b526288Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
67906b526288Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
67916b526288Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
67926b526288Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
67936b526288Smrg				             # but as the default
67946b526288Smrg				             # location of the library.
67956b526288Smrg
67966b526288Smrg        case $cc_basename in
67976b526288Smrg          CC*)
67986b526288Smrg            # FIXME: insert proper C++ library support
67996b526288Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
68006b526288Smrg            ;;
68016b526288Smrg          aCC*)
68026b526288Smrg            _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'
68036b526288Smrg            # Commands to make compiler produce verbose output that lists
68046b526288Smrg            # what "hidden" libraries, object files and flags are used when
68056b526288Smrg            # linking a shared library.
68066b526288Smrg            #
68076b526288Smrg            # There doesn't appear to be a way to prevent this compiler from
68086b526288Smrg            # explicitly linking system object files so we need to strip them
68096b526288Smrg            # from the output so that they don't get included in the library
68106b526288Smrg            # dependencies.
68116b526288Smrg            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"'
68126b526288Smrg            ;;
68136b526288Smrg          *)
68146b526288Smrg            if test yes = "$GXX"; then
68156b526288Smrg              _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'
68166b526288Smrg            else
68176b526288Smrg              # FIXME: insert proper C++ library support
68186b526288Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
68196b526288Smrg            fi
68206b526288Smrg            ;;
68216b526288Smrg        esac
68226b526288Smrg        ;;
68236b526288Smrg
68246b526288Smrg      hpux10*|hpux11*)
68256b526288Smrg        if test no = "$with_gnu_ld"; then
68266b526288Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
68276b526288Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
68286b526288Smrg
68296b526288Smrg          case $host_cpu in
68306b526288Smrg            hppa*64*|ia64*)
68316b526288Smrg              ;;
68326b526288Smrg            *)
68336b526288Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
68346b526288Smrg              ;;
68356b526288Smrg          esac
68366b526288Smrg        fi
68376b526288Smrg        case $host_cpu in
68386b526288Smrg          hppa*64*|ia64*)
68396b526288Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
68406b526288Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
68416b526288Smrg            ;;
68426b526288Smrg          *)
68436b526288Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
68446b526288Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
68456b526288Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
68466b526288Smrg					         # but as the default
68476b526288Smrg					         # location of the library.
68486b526288Smrg            ;;
68496b526288Smrg        esac
68506b526288Smrg
68516b526288Smrg        case $cc_basename in
68526b526288Smrg          CC*)
68536b526288Smrg	    # FIXME: insert proper C++ library support
68546b526288Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
685511a29bacSmrg	    ;;
68566b526288Smrg          aCC*)
685711245024Smrg	    case $host_cpu in
68586b526288Smrg	      hppa*64*)
68596b526288Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68606b526288Smrg	        ;;
68616b526288Smrg	      ia64*)
68626b526288Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68636b526288Smrg	        ;;
68646b526288Smrg	      *)
68656b526288Smrg	        _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'
68666b526288Smrg	        ;;
686711245024Smrg	    esac
68686b526288Smrg	    # Commands to make compiler produce verbose output that lists
68696b526288Smrg	    # what "hidden" libraries, object files and flags are used when
68706b526288Smrg	    # linking a shared library.
68716b526288Smrg	    #
68726b526288Smrg	    # There doesn't appear to be a way to prevent this compiler from
68736b526288Smrg	    # explicitly linking system object files so we need to strip them
68746b526288Smrg	    # from the output so that they don't get included in the library
68756b526288Smrg	    # dependencies.
68766b526288Smrg	    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"'
687711a29bacSmrg	    ;;
68786b526288Smrg          *)
68796b526288Smrg	    if test yes = "$GXX"; then
68806b526288Smrg	      if test no = "$with_gnu_ld"; then
68816b526288Smrg	        case $host_cpu in
68826b526288Smrg	          hppa*64*)
68836b526288Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68846b526288Smrg	            ;;
68856b526288Smrg	          ia64*)
68866b526288Smrg	            _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'
68876b526288Smrg	            ;;
68886b526288Smrg	          *)
68896b526288Smrg	            _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'
68906b526288Smrg	            ;;
68916b526288Smrg	        esac
68926b526288Smrg	      fi
68936b526288Smrg	    else
68946b526288Smrg	      # FIXME: insert proper C++ library support
68956b526288Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
68966b526288Smrg	    fi
689711a29bacSmrg	    ;;
68986b526288Smrg        esac
68996b526288Smrg        ;;
69006b526288Smrg
69016b526288Smrg      interix[[3-9]]*)
69026b526288Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
69036b526288Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
69046b526288Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
69056b526288Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
69066b526288Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
69076b526288Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
69086b526288Smrg	# default) and relocated if they conflict, which is a slow very memory
69096b526288Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
69106b526288Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
69116b526288Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
69126b526288Smrg	_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'
69136b526288Smrg	_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'
691411245024Smrg	;;
69156b526288Smrg      irix5* | irix6*)
69166b526288Smrg        case $cc_basename in
69176b526288Smrg          CC*)
69186b526288Smrg	    # SGI C++
69196b526288Smrg	    _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'
69206b526288Smrg
69216b526288Smrg	    # Archives containing C++ object files must be created using
69226b526288Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
69236b526288Smrg	    # necessary to make sure instantiated templates are included
69246b526288Smrg	    # in the archive.
69256b526288Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
692611a29bacSmrg	    ;;
69276b526288Smrg          *)
69286b526288Smrg	    if test yes = "$GXX"; then
69296b526288Smrg	      if test no = "$with_gnu_ld"; then
69306b526288Smrg	        _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'
69316b526288Smrg	      else
69326b526288Smrg	        _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'
69336b526288Smrg	      fi
69346b526288Smrg	    fi
69356b526288Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
693611a29bacSmrg	    ;;
69376b526288Smrg        esac
69386b526288Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
69396b526288Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
69406b526288Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
69416b526288Smrg        ;;
69426b526288Smrg
69436b526288Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
69446b526288Smrg        case $cc_basename in
69456b526288Smrg          KCC*)
69466b526288Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
69476b526288Smrg
69486b526288Smrg	    # KCC will only create a shared library if the output file
69496b526288Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
69506b526288Smrg	    # to its proper name (with version) after linking.
69516b526288Smrg	    _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'
69526b526288Smrg	    _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'
69536b526288Smrg	    # Commands to make compiler produce verbose output that lists
69546b526288Smrg	    # what "hidden" libraries, object files and flags are used when
69556b526288Smrg	    # linking a shared library.
69566b526288Smrg	    #
69576b526288Smrg	    # There doesn't appear to be a way to prevent this compiler from
69586b526288Smrg	    # explicitly linking system object files so we need to strip them
69596b526288Smrg	    # from the output so that they don't get included in the library
69606b526288Smrg	    # dependencies.
69616b526288Smrg	    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"'
69626b526288Smrg
69636b526288Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
69646b526288Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
69656b526288Smrg
69666b526288Smrg	    # Archives containing C++ object files must be created using
69676b526288Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
69686b526288Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
696911a29bacSmrg	    ;;
69706b526288Smrg	  icpc* | ecpc* )
69716b526288Smrg	    # Intel C++
69726b526288Smrg	    with_gnu_ld=yes
69736b526288Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
69746b526288Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
69756b526288Smrg	    # earlier do not add the objects themselves.
69766b526288Smrg	    case `$CC -V 2>&1` in
69776b526288Smrg	      *"Version 7."*)
69786b526288Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
69796b526288Smrg		_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'
69806b526288Smrg		;;
69816b526288Smrg	      *)  # Version 8.0 or newer
69826b526288Smrg	        tmp_idyn=
69836b526288Smrg	        case $host_cpu in
69846b526288Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
69856b526288Smrg		esac
69866b526288Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
69876b526288Smrg		_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'
69886b526288Smrg		;;
69896b526288Smrg	    esac
69906b526288Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
69916b526288Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
69926b526288Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
69936b526288Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
699411a29bacSmrg	    ;;
69956b526288Smrg          pgCC* | pgcpp*)
69966b526288Smrg            # Portland Group C++ compiler
69976b526288Smrg	    case `$CC -V` in
69986b526288Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
69996b526288Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
70006b526288Smrg               rm -rf $tpldir~
70016b526288Smrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
70026b526288Smrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
70036b526288Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
70046b526288Smrg                rm -rf $tpldir~
70056b526288Smrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
70066b526288Smrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
70076b526288Smrg                $RANLIB $oldlib'
70086b526288Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
70096b526288Smrg                rm -rf $tpldir~
70106b526288Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
70116b526288Smrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
70126b526288Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
70136b526288Smrg                rm -rf $tpldir~
70146b526288Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
70156b526288Smrg                $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'
70166b526288Smrg	      ;;
70176b526288Smrg	    *) # Version 6 and above use weak symbols
70186b526288Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
70196b526288Smrg	      _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'
70206b526288Smrg	      ;;
70216b526288Smrg	    esac
70226b526288Smrg
70236b526288Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
70246b526288Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
70256b526288Smrg	    _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'
70266b526288Smrg            ;;
702711a29bacSmrg	  cxx*)
702811a29bacSmrg	    # Compaq C++
70296b526288Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
70306b526288Smrg	    _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'
70316b526288Smrg
70326b526288Smrg	    runpath_var=LD_RUN_PATH
70336b526288Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
70346b526288Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
70356b526288Smrg
70366b526288Smrg	    # Commands to make compiler produce verbose output that lists
70376b526288Smrg	    # what "hidden" libraries, object files and flags are used when
70386b526288Smrg	    # linking a shared library.
70396b526288Smrg	    #
70406b526288Smrg	    # There doesn't appear to be a way to prevent this compiler from
70416b526288Smrg	    # explicitly linking system object files so we need to strip them
70426b526288Smrg	    # from the output so that they don't get included in the library
70436b526288Smrg	    # dependencies.
70446b526288Smrg	    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'
704511a29bacSmrg	    ;;
70466b526288Smrg	  xl* | mpixl* | bgxl*)
70476b526288Smrg	    # IBM XL 8.0 on PPC, with GNU ld
70486b526288Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
70496b526288Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
70506b526288Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
70516b526288Smrg	    if test yes = "$supports_anon_versioning"; then
70526b526288Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
70536b526288Smrg                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
70546b526288Smrg                echo "local: *; };" >> $output_objdir/$libname.ver~
70556b526288Smrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
70566b526288Smrg	    fi
705711a29bacSmrg	    ;;
705811a29bacSmrg	  *)
705911a29bacSmrg	    case `$CC -V 2>&1 | sed 5q` in
706011a29bacSmrg	    *Sun\ C*)
706111a29bacSmrg	      # Sun C++ 5.9
70626b526288Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
70636b526288Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
70646b526288Smrg	      _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'
70656b526288Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
70666b526288Smrg	      _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'
70676b526288Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
70686b526288Smrg
70696b526288Smrg	      # Not sure whether something based on
70706b526288Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
70716b526288Smrg	      # would be better.
70726b526288Smrg	      output_verbose_link_cmd='func_echo_all'
70736b526288Smrg
70746b526288Smrg	      # Archives containing C++ object files must be created using
70756b526288Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
70766b526288Smrg	      # necessary to make sure instantiated templates are included
70776b526288Smrg	      # in the archive.
70786b526288Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
707911a29bacSmrg	      ;;
708011a29bacSmrg	    esac
708111a29bacSmrg	    ;;
708211a29bacSmrg	esac
708311245024Smrg	;;
70846b526288Smrg
708511a29bacSmrg      lynxos*)
70866b526288Smrg        # FIXME: insert proper C++ library support
70876b526288Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
708811a29bacSmrg	;;
70896b526288Smrg
709011a29bacSmrg      m88k*)
70916b526288Smrg        # FIXME: insert proper C++ library support
70926b526288Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
709311a29bacSmrg	;;
70946b526288Smrg
709511a29bacSmrg      mvs*)
70966b526288Smrg        case $cc_basename in
70976b526288Smrg          cxx*)
70986b526288Smrg	    # FIXME: insert proper C++ library support
70996b526288Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
710011a29bacSmrg	    ;;
710111a29bacSmrg	  *)
71026b526288Smrg	    # FIXME: insert proper C++ library support
71036b526288Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
710411a29bacSmrg	    ;;
710511245024Smrg	esac
710611245024Smrg	;;
71076b526288Smrg
710811a29bacSmrg      netbsd*)
71096b526288Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
71106b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
71116b526288Smrg	  wlarc=
71126b526288Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
71136b526288Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
71146b526288Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
71156b526288Smrg	fi
71166b526288Smrg	# Workaround some broken pre-1.5 toolchains
71176b526288Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
711811245024Smrg	;;
71196b526288Smrg
71206b526288Smrg      *nto* | *qnx*)
71216b526288Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
71226b526288Smrg	;;
71236b526288Smrg
71246b526288Smrg      openbsd* | bitrig*)
71256b526288Smrg	if test -f /usr/libexec/ld.so; then
71266b526288Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
71276b526288Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
71286b526288Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
71296b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
71306b526288Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
71316b526288Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
71326b526288Smrg	    _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'
71336b526288Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
71346b526288Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
71356b526288Smrg	  fi
71366b526288Smrg	  output_verbose_link_cmd=func_echo_all
71376b526288Smrg	else
71386b526288Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
71396b526288Smrg	fi
71406b526288Smrg	;;
71416b526288Smrg
714211a29bacSmrg      osf3* | osf4* | osf5*)
71436b526288Smrg        case $cc_basename in
71446b526288Smrg          KCC*)
71456b526288Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
71466b526288Smrg
71476b526288Smrg	    # KCC will only create a shared library if the output file
71486b526288Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
71496b526288Smrg	    # to its proper name (with version) after linking.
71506b526288Smrg	    _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'
71516b526288Smrg
71526b526288Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
71536b526288Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
71546b526288Smrg
71556b526288Smrg	    # Archives containing C++ object files must be created using
71566b526288Smrg	    # the KAI C++ compiler.
71576b526288Smrg	    case $host in
71586b526288Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
71596b526288Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
71606b526288Smrg	    esac
716111a29bacSmrg	    ;;
71626b526288Smrg          RCC*)
716311a29bacSmrg	    # Rational C++ 2.4.1
71646b526288Smrg	    # FIXME: insert proper C++ library support
71656b526288Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
716611a29bacSmrg	    ;;
71676b526288Smrg          cxx*)
71686b526288Smrg	    case $host in
71696b526288Smrg	      osf3*)
71706b526288Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
71716b526288Smrg	        _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'
71726b526288Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
71736b526288Smrg		;;
71746b526288Smrg	      *)
71756b526288Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
71766b526288Smrg	        _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'
71776b526288Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
71786b526288Smrg                  echo "-hidden">> $lib.exp~
71796b526288Smrg                  $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~
71806b526288Smrg                  $RM $lib.exp'
71816b526288Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
71826b526288Smrg		;;
71836b526288Smrg	    esac
71846b526288Smrg
71856b526288Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
71866b526288Smrg
71876b526288Smrg	    # Commands to make compiler produce verbose output that lists
71886b526288Smrg	    # what "hidden" libraries, object files and flags are used when
71896b526288Smrg	    # linking a shared library.
71906b526288Smrg	    #
71916b526288Smrg	    # There doesn't appear to be a way to prevent this compiler from
71926b526288Smrg	    # explicitly linking system object files so we need to strip them
71936b526288Smrg	    # from the output so that they don't get included in the library
71946b526288Smrg	    # dependencies.
71956b526288Smrg	    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"'
719611a29bacSmrg	    ;;
719711a29bacSmrg	  *)
71986b526288Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
71996b526288Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
72006b526288Smrg	      case $host in
72016b526288Smrg	        osf3*)
72026b526288Smrg	          _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'
72036b526288Smrg		  ;;
72046b526288Smrg	        *)
72056b526288Smrg	          _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'
72066b526288Smrg		  ;;
72076b526288Smrg	      esac
72086b526288Smrg
72096b526288Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
72106b526288Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
72116b526288Smrg
72126b526288Smrg	      # Commands to make compiler produce verbose output that lists
72136b526288Smrg	      # what "hidden" libraries, object files and flags are used when
72146b526288Smrg	      # linking a shared library.
72156b526288Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
72166b526288Smrg
72176b526288Smrg	    else
72186b526288Smrg	      # FIXME: insert proper C++ library support
72196b526288Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
72206b526288Smrg	    fi
722111a29bacSmrg	    ;;
72226b526288Smrg        esac
72236b526288Smrg        ;;
72246b526288Smrg
722511a29bacSmrg      psos*)
72266b526288Smrg        # FIXME: insert proper C++ library support
72276b526288Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
72286b526288Smrg        ;;
72296b526288Smrg
723011a29bacSmrg      sunos4*)
72316b526288Smrg        case $cc_basename in
72326b526288Smrg          CC*)
723311a29bacSmrg	    # Sun C++ 4.x
72346b526288Smrg	    # FIXME: insert proper C++ library support
72356b526288Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
723611a29bacSmrg	    ;;
72376b526288Smrg          lcc*)
723811a29bacSmrg	    # Lucid
72396b526288Smrg	    # FIXME: insert proper C++ library support
72406b526288Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
724111a29bacSmrg	    ;;
72426b526288Smrg          *)
72436b526288Smrg	    # FIXME: insert proper C++ library support
72446b526288Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
724511a29bacSmrg	    ;;
72466b526288Smrg        esac
72476b526288Smrg        ;;
72486b526288Smrg
72496b526288Smrg      solaris*)
72506b526288Smrg        case $cc_basename in
72516b526288Smrg          CC* | sunCC*)
72526b526288Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
72536b526288Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
72546b526288Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
72556b526288Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
72566b526288Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
72576b526288Smrg              $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'
72586b526288Smrg
72596b526288Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
72606b526288Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
72616b526288Smrg	    case $host_os in
72626b526288Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
72636b526288Smrg	      *)
72646b526288Smrg		# The compiler driver will combine and reorder linker options,
72656b526288Smrg		# but understands '-z linker_flag'.
72666b526288Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
72676b526288Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
72686b526288Smrg	        ;;
72696b526288Smrg	    esac
72706b526288Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
72716b526288Smrg
72726b526288Smrg	    output_verbose_link_cmd='func_echo_all'
72736b526288Smrg
72746b526288Smrg	    # Archives containing C++ object files must be created using
72756b526288Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
72766b526288Smrg	    # necessary to make sure instantiated templates are included
72776b526288Smrg	    # in the archive.
72786b526288Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
727911a29bacSmrg	    ;;
72806b526288Smrg          gcx*)
72816b526288Smrg	    # Green Hills C++ Compiler
72826b526288Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
72836b526288Smrg
72846b526288Smrg	    # The C++ compiler must be used to create the archive.
72856b526288Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
72866b526288Smrg	    ;;
72876b526288Smrg          *)
72886b526288Smrg	    # GNU C++ compiler with Solaris linker
72896b526288Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
72906b526288Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
72916b526288Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
72926b526288Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
72936b526288Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
72946b526288Smrg                  $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'
72956b526288Smrg
72966b526288Smrg	        # Commands to make compiler produce verbose output that lists
72976b526288Smrg	        # what "hidden" libraries, object files and flags are used when
72986b526288Smrg	        # linking a shared library.
72996b526288Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
73006b526288Smrg	      else
73016b526288Smrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
73026b526288Smrg	        # platform.
73036b526288Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
73046b526288Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
73056b526288Smrg                  $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'
73066b526288Smrg
73076b526288Smrg	        # Commands to make compiler produce verbose output that lists
73086b526288Smrg	        # what "hidden" libraries, object files and flags are used when
73096b526288Smrg	        # linking a shared library.
73106b526288Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
73116b526288Smrg	      fi
73126b526288Smrg
73136b526288Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
73146b526288Smrg	      case $host_os in
73156b526288Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
73166b526288Smrg		*)
73176b526288Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
73186b526288Smrg		  ;;
73196b526288Smrg	      esac
73206b526288Smrg	    fi
73216b526288Smrg	    ;;
73226b526288Smrg        esac
73236b526288Smrg        ;;
73246b526288Smrg
73256b526288Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
73266b526288Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
73276b526288Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
73286b526288Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
73296b526288Smrg      runpath_var='LD_RUN_PATH'
73306b526288Smrg
73316b526288Smrg      case $cc_basename in
73326b526288Smrg        CC*)
73336b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73346b526288Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73356b526288Smrg	  ;;
73366b526288Smrg	*)
73376b526288Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73386b526288Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73396b526288Smrg	  ;;
73406b526288Smrg      esac
73416b526288Smrg      ;;
73426b526288Smrg
73436b526288Smrg      sysv5* | sco3.2v5* | sco5v6*)
73446b526288Smrg	# Note: We CANNOT use -z defs as we might desire, because we do not
73456b526288Smrg	# link with -lc, and that would cause any symbols used from libc to
73466b526288Smrg	# always be unresolved, which means just about no library would
73476b526288Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
73486b526288Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
73496b526288Smrg	# as -z defs.
73506b526288Smrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
73516b526288Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
73526b526288Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
73536b526288Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
73546b526288Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
73556b526288Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
73566b526288Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
73576b526288Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
73586b526288Smrg	runpath_var='LD_RUN_PATH'
73596b526288Smrg
736011a29bacSmrg	case $cc_basename in
73616b526288Smrg          CC*)
73626b526288Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73636b526288Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73646b526288Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
73656b526288Smrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
73666b526288Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
73676b526288Smrg              '"$_LT_TAGVAR(reload_cmds, $1)"
736811a29bacSmrg	    ;;
736911a29bacSmrg	  *)
73706b526288Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73716b526288Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
737211a29bacSmrg	    ;;
737311a29bacSmrg	esac
737411a29bacSmrg      ;;
737541b2f0bdSmrg
73766b526288Smrg      tandem*)
73776b526288Smrg        case $cc_basename in
73786b526288Smrg          NCC*)
73796b526288Smrg	    # NonStop-UX NCC 3.20
73806b526288Smrg	    # FIXME: insert proper C++ library support
73816b526288Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
73826b526288Smrg	    ;;
73836b526288Smrg          *)
73846b526288Smrg	    # FIXME: insert proper C++ library support
73856b526288Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
73866b526288Smrg	    ;;
73876b526288Smrg        esac
738811a29bacSmrg        ;;
738941b2f0bdSmrg
73906b526288Smrg      vxworks*)
73916b526288Smrg        # FIXME: insert proper C++ library support
73926b526288Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
73936b526288Smrg        ;;
739411a29bacSmrg
739511245024Smrg      *)
73966b526288Smrg        # FIXME: insert proper C++ library support
73976b526288Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
73986b526288Smrg        ;;
73996b526288Smrg    esac
740041b2f0bdSmrg
74016b526288Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
74026b526288Smrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
740341b2f0bdSmrg
74046b526288Smrg    _LT_TAGVAR(GCC, $1)=$GXX
74056b526288Smrg    _LT_TAGVAR(LD, $1)=$LD
740641b2f0bdSmrg
74076b526288Smrg    ## CAVEAT EMPTOR:
74086b526288Smrg    ## There is no encapsulation within the following macros, do not change
74096b526288Smrg    ## the running order or otherwise move them around unless you know exactly
74106b526288Smrg    ## what you are doing...
74116b526288Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
74126b526288Smrg    _LT_COMPILER_PIC($1)
74136b526288Smrg    _LT_COMPILER_C_O($1)
74146b526288Smrg    _LT_COMPILER_FILE_LOCKS($1)
74156b526288Smrg    _LT_LINKER_SHLIBS($1)
74166b526288Smrg    _LT_SYS_DYNAMIC_LINKER($1)
74176b526288Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
741841b2f0bdSmrg
74196b526288Smrg    _LT_CONFIG($1)
74206b526288Smrg  fi # test -n "$compiler"
742141b2f0bdSmrg
74226b526288Smrg  CC=$lt_save_CC
74236b526288Smrg  CFLAGS=$lt_save_CFLAGS
74246b526288Smrg  LDCXX=$LD
74256b526288Smrg  LD=$lt_save_LD
74266b526288Smrg  GCC=$lt_save_GCC
74276b526288Smrg  with_gnu_ld=$lt_save_with_gnu_ld
74286b526288Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
74296b526288Smrg  lt_cv_path_LD=$lt_save_path_LD
74306b526288Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
74316b526288Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
74326b526288Smrgfi # test yes != "$_lt_caught_CXX_error"
743341b2f0bdSmrg
74346b526288SmrgAC_LANG_POP
74356b526288Smrg])# _LT_LANG_CXX_CONFIG
743611a29bacSmrg
743711a29bacSmrg
74386b526288Smrg# _LT_FUNC_STRIPNAME_CNF
74396b526288Smrg# ----------------------
74406b526288Smrg# func_stripname_cnf prefix suffix name
74416b526288Smrg# strip PREFIX and SUFFIX off of NAME.
74426b526288Smrg# PREFIX and SUFFIX must not contain globbing or regex special
74436b526288Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
74446b526288Smrg# dot (in which case that matches only a dot).
74456b526288Smrg#
74466b526288Smrg# This function is identical to the (non-XSI) version of func_stripname,
74476b526288Smrg# except this one can be used by m4 code that may be executed by configure,
74486b526288Smrg# rather than the libtool script.
74496b526288Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
74506b526288SmrgAC_REQUIRE([_LT_DECL_SED])
74516b526288SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
74526b526288Smrgfunc_stripname_cnf ()
74536b526288Smrg{
74546b526288Smrg  case @S|@2 in
74556b526288Smrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
74566b526288Smrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
74576b526288Smrg  esac
74586b526288Smrg} # func_stripname_cnf
74596b526288Smrg])# _LT_FUNC_STRIPNAME_CNF
746011a29bacSmrg
746141b2f0bdSmrg
74626b526288Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
74636b526288Smrg# ---------------------------------
74646b526288Smrg# Figure out "hidden" library dependencies from verbose
74656b526288Smrg# compiler output when linking a shared library.
74666b526288Smrg# Parse the compiler output and extract the necessary
74676b526288Smrg# objects, libraries and library flags.
74686b526288Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
74696b526288Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
74706b526288SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
74716b526288Smrg# Dependencies to place before and after the object being linked:
74726b526288Smrg_LT_TAGVAR(predep_objects, $1)=
74736b526288Smrg_LT_TAGVAR(postdep_objects, $1)=
74746b526288Smrg_LT_TAGVAR(predeps, $1)=
74756b526288Smrg_LT_TAGVAR(postdeps, $1)=
74766b526288Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
747741b2f0bdSmrg
74786b526288Smrgdnl we can't use the lt_simple_compile_test_code here,
74796b526288Smrgdnl because it contains code intended for an executable,
74806b526288Smrgdnl not a library.  It's possible we should let each
74816b526288Smrgdnl tag define a new lt_????_link_test_code variable,
74826b526288Smrgdnl but it's only used here...
74836b526288Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
74846b526288Smrgint a;
74856b526288Smrgvoid foo (void) { a = 0; }
74866b526288Smrg_LT_EOF
74876b526288Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
74886b526288Smrgclass Foo
74896b526288Smrg{
74906b526288Smrgpublic:
74916b526288Smrg  Foo (void) { a = 0; }
74926b526288Smrgprivate:
74936b526288Smrg  int a;
74946b526288Smrg};
74956b526288Smrg_LT_EOF
74966b526288Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
74976b526288Smrg      subroutine foo
74986b526288Smrg      implicit none
74996b526288Smrg      integer*4 a
75006b526288Smrg      a=0
75016b526288Smrg      return
75026b526288Smrg      end
75036b526288Smrg_LT_EOF
75046b526288Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
75056b526288Smrg      subroutine foo
75066b526288Smrg      implicit none
75076b526288Smrg      integer a
75086b526288Smrg      a=0
75096b526288Smrg      return
75106b526288Smrg      end
75116b526288Smrg_LT_EOF
75126b526288Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
75136b526288Smrgpublic class foo {
75146b526288Smrg  private int a;
75156b526288Smrg  public void bar (void) {
75166b526288Smrg    a = 0;
75176b526288Smrg  }
75186b526288Smrg};
75196b526288Smrg_LT_EOF
75206b526288Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
75216b526288Smrgpackage foo
75226b526288Smrgfunc foo() {
75236b526288Smrg}
75246b526288Smrg_LT_EOF
75256b526288Smrg])
752641b2f0bdSmrg
75276b526288Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
75286b526288Smrgcase "$CC $CFLAGS " in #(
75296b526288Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
75306b526288Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
75316b526288Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
75326b526288Smrgesac
753311245024Smrg
75346b526288Smrgdnl Parse the compiler output and extract the necessary
75356b526288Smrgdnl objects, libraries and library flags.
75366b526288Smrgif AC_TRY_EVAL(ac_compile); then
75376b526288Smrg  # Parse the compiler output and extract the necessary
75386b526288Smrg  # objects, libraries and library flags.
753911245024Smrg
75406b526288Smrg  # Sentinel used to keep track of whether or not we are before
75416b526288Smrg  # the conftest object file.
75426b526288Smrg  pre_test_object_deps_done=no
754311245024Smrg
75446b526288Smrg  for p in `eval "$output_verbose_link_cmd"`; do
75456b526288Smrg    case $prev$p in
754611245024Smrg
75476b526288Smrg    -L* | -R* | -l*)
75486b526288Smrg       # Some compilers place space between "-{L,R}" and the path.
75496b526288Smrg       # Remove the space.
75506b526288Smrg       if test x-L = "$p" ||
75516b526288Smrg          test x-R = "$p"; then
75526b526288Smrg	 prev=$p
75536b526288Smrg	 continue
75546b526288Smrg       fi
755511245024Smrg
75566b526288Smrg       # Expand the sysroot to ease extracting the directories later.
75576b526288Smrg       if test -z "$prev"; then
75586b526288Smrg         case $p in
75596b526288Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
75606b526288Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
75616b526288Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
75626b526288Smrg         esac
75636b526288Smrg       fi
75646b526288Smrg       case $p in
75656b526288Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
75666b526288Smrg       esac
75676b526288Smrg       if test no = "$pre_test_object_deps_done"; then
75686b526288Smrg	 case $prev in
75696b526288Smrg	 -L | -R)
75706b526288Smrg	   # Internal compiler library paths should come after those
75716b526288Smrg	   # provided the user.  The postdeps already come after the
75726b526288Smrg	   # user supplied libs so there is no need to process them.
75736b526288Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
75746b526288Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
75756b526288Smrg	   else
75766b526288Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
75776b526288Smrg	   fi
75786b526288Smrg	   ;;
75796b526288Smrg	 # The "-l" case would never come before the object being
75806b526288Smrg	 # linked, so don't bother handling this case.
75816b526288Smrg	 esac
75826b526288Smrg       else
75836b526288Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
75846b526288Smrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
75856b526288Smrg	 else
75866b526288Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
75876b526288Smrg	 fi
75886b526288Smrg       fi
75896b526288Smrg       prev=
75906b526288Smrg       ;;
759111245024Smrg
75926b526288Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
75936b526288Smrg    *.$objext)
75946b526288Smrg       # This assumes that the test object file only shows up
75956b526288Smrg       # once in the compiler output.
75966b526288Smrg       if test "$p" = "conftest.$objext"; then
75976b526288Smrg	 pre_test_object_deps_done=yes
75986b526288Smrg	 continue
75996b526288Smrg       fi
760011245024Smrg
76016b526288Smrg       if test no = "$pre_test_object_deps_done"; then
76026b526288Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
76036b526288Smrg	   _LT_TAGVAR(predep_objects, $1)=$p
76046b526288Smrg	 else
76056b526288Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
76066b526288Smrg	 fi
76076b526288Smrg       else
76086b526288Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
76096b526288Smrg	   _LT_TAGVAR(postdep_objects, $1)=$p
76106b526288Smrg	 else
76116b526288Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
76126b526288Smrg	 fi
76136b526288Smrg       fi
76146b526288Smrg       ;;
761511245024Smrg
76166b526288Smrg    *) ;; # Ignore the rest.
761711245024Smrg
761811245024Smrg    esac
76196b526288Smrg  done
76206b526288Smrg
76216b526288Smrg  # Clean up.
76226b526288Smrg  rm -f a.out a.exe
76236b526288Smrgelse
76246b526288Smrg  echo "libtool.m4: error: problem compiling $1 test program"
76256b526288Smrgfi
76266b526288Smrg
76276b526288Smrg$RM -f confest.$objext
76286b526288SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
76296b526288Smrg
76306b526288Smrg# PORTME: override above test on systems where it is broken
76316b526288Smrgm4_if([$1], [CXX],
76326b526288Smrg[case $host_os in
76336b526288Smrginterix[[3-9]]*)
76346b526288Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
76356b526288Smrg  # hack all around it, let's just trust "g++" to DTRT.
76366b526288Smrg  _LT_TAGVAR(predep_objects,$1)=
76376b526288Smrg  _LT_TAGVAR(postdep_objects,$1)=
76386b526288Smrg  _LT_TAGVAR(postdeps,$1)=
76396b526288Smrg  ;;
76406b526288Smrgesac
764111a29bacSmrg])
76426b526288Smrg
76436b526288Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
76446b526288Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
764511a29bacSmrgesac
76466b526288Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
76476b526288Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
76486b526288Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
76496b526288Smrgfi
76506b526288Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
76516b526288Smrg    [The directories searched by this compiler when creating a shared library])
76526b526288Smrg_LT_TAGDECL([], [predep_objects], [1],
76536b526288Smrg    [Dependencies to place before and after the objects being linked to
76546b526288Smrg    create a shared library])
76556b526288Smrg_LT_TAGDECL([], [postdep_objects], [1])
76566b526288Smrg_LT_TAGDECL([], [predeps], [1])
76576b526288Smrg_LT_TAGDECL([], [postdeps], [1])
76586b526288Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
76596b526288Smrg    [The library search path used internally by the compiler when linking
76606b526288Smrg    a shared library])
76616b526288Smrg])# _LT_SYS_HIDDEN_LIBDEPS
766211245024Smrg
76636b526288Smrg
76646b526288Smrg# _LT_LANG_F77_CONFIG([TAG])
76656b526288Smrg# --------------------------
76666b526288Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
76676b526288Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
76686b526288Smrg# to write the compiler configuration to 'libtool'.
76696b526288Smrgm4_defun([_LT_LANG_F77_CONFIG],
76706b526288Smrg[AC_LANG_PUSH(Fortran 77)
76716b526288Smrgif test -z "$F77" || test no = "$F77"; then
76726b526288Smrg  _lt_disable_F77=yes
767341b2f0bdSmrgfi
767441b2f0bdSmrg
76756b526288Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
76766b526288Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
76776b526288Smrg_LT_TAGVAR(always_export_symbols, $1)=no
76786b526288Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
76796b526288Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
76806b526288Smrg_LT_TAGVAR(hardcode_direct, $1)=no
76816b526288Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
76826b526288Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
76836b526288Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
76846b526288Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
76856b526288Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
76866b526288Smrg_LT_TAGVAR(inherit_rpath, $1)=no
76876b526288Smrg_LT_TAGVAR(module_cmds, $1)=
76886b526288Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
76896b526288Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
76906b526288Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
76916b526288Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
76926b526288Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
76936b526288Smrg_LT_TAGVAR(no_undefined_flag, $1)=
76946b526288Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
76956b526288Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
76966b526288Smrg
76976b526288Smrg# Source file extension for f77 test sources.
76986b526288Smrgac_ext=f
769941b2f0bdSmrg
77006b526288Smrg# Object file extension for compiled f77 test sources.
77016b526288Smrgobjext=o
77026b526288Smrg_LT_TAGVAR(objext, $1)=$objext
770341b2f0bdSmrg
77046b526288Smrg# No sense in running all these tests if we already determined that
77056b526288Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
77066b526288Smrg# are currently assumed to apply to all compilers on this platform,
77076b526288Smrg# and will be corrupted by setting them based on a non-working compiler.
77086b526288Smrgif test yes != "$_lt_disable_F77"; then
77096b526288Smrg  # Code to be used in simple compile tests
77106b526288Smrg  lt_simple_compile_test_code="\
77116b526288Smrg      subroutine t
77126b526288Smrg      return
77136b526288Smrg      end
77146b526288Smrg"
771511245024Smrg
77166b526288Smrg  # Code to be used in simple link tests
77176b526288Smrg  lt_simple_link_test_code="\
77186b526288Smrg      program t
77196b526288Smrg      end
77206b526288Smrg"
772111245024Smrg
77226b526288Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
77236b526288Smrg  _LT_TAG_COMPILER
772411245024Smrg
77256b526288Smrg  # save warnings/boilerplate of simple test code
77266b526288Smrg  _LT_COMPILER_BOILERPLATE
77276b526288Smrg  _LT_LINKER_BOILERPLATE
77286b526288Smrg
77296b526288Smrg  # Allow CC to be a program name with arguments.
77306b526288Smrg  lt_save_CC=$CC
77316b526288Smrg  lt_save_GCC=$GCC
77326b526288Smrg  lt_save_CFLAGS=$CFLAGS
77336b526288Smrg  CC=${F77-"f77"}
77346b526288Smrg  CFLAGS=$FFLAGS
77356b526288Smrg  compiler=$CC
77366b526288Smrg  _LT_TAGVAR(compiler, $1)=$CC
77376b526288Smrg  _LT_CC_BASENAME([$compiler])
77386b526288Smrg  GCC=$G77
77396b526288Smrg  if test -n "$compiler"; then
77406b526288Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
77416b526288Smrg    AC_MSG_RESULT([$can_build_shared])
77426b526288Smrg
77436b526288Smrg    AC_MSG_CHECKING([whether to build shared libraries])
77446b526288Smrg    test no = "$can_build_shared" && enable_shared=no
77456b526288Smrg
77466b526288Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
77476b526288Smrg    # are all built from PIC.
774811a29bacSmrg    case $host_os in
77496b526288Smrg      aix3*)
77506b526288Smrg        test yes = "$enable_shared" && enable_static=no
77516b526288Smrg        if test -n "$RANLIB"; then
77526b526288Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
77536b526288Smrg          postinstall_cmds='$RANLIB $lib'
77546b526288Smrg        fi
77556b526288Smrg        ;;
77566b526288Smrg      aix[[4-9]]*)
77576b526288Smrg	if test ia64 != "$host_cpu"; then
77586b526288Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
77596b526288Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
77606b526288Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
77616b526288Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
77626b526288Smrg	  esac
77636b526288Smrg	fi
77646b526288Smrg        ;;
776511a29bacSmrg    esac
77666b526288Smrg    AC_MSG_RESULT([$enable_shared])
776711245024Smrg
77686b526288Smrg    AC_MSG_CHECKING([whether to build static libraries])
77696b526288Smrg    # Make sure either enable_shared or enable_static is yes.
77706b526288Smrg    test yes = "$enable_shared" || enable_static=yes
77716b526288Smrg    AC_MSG_RESULT([$enable_static])
777211245024Smrg
77736b526288Smrg    _LT_TAGVAR(GCC, $1)=$G77
77746b526288Smrg    _LT_TAGVAR(LD, $1)=$LD
777511245024Smrg
77766b526288Smrg    ## CAVEAT EMPTOR:
77776b526288Smrg    ## There is no encapsulation within the following macros, do not change
77786b526288Smrg    ## the running order or otherwise move them around unless you know exactly
77796b526288Smrg    ## what you are doing...
77806b526288Smrg    _LT_COMPILER_PIC($1)
77816b526288Smrg    _LT_COMPILER_C_O($1)
77826b526288Smrg    _LT_COMPILER_FILE_LOCKS($1)
77836b526288Smrg    _LT_LINKER_SHLIBS($1)
77846b526288Smrg    _LT_SYS_DYNAMIC_LINKER($1)
77856b526288Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
778611245024Smrg
77876b526288Smrg    _LT_CONFIG($1)
77886b526288Smrg  fi # test -n "$compiler"
778911245024Smrg
77906b526288Smrg  GCC=$lt_save_GCC
77916b526288Smrg  CC=$lt_save_CC
77926b526288Smrg  CFLAGS=$lt_save_CFLAGS
77936b526288Smrgfi # test yes != "$_lt_disable_F77"
77946b526288Smrg
77956b526288SmrgAC_LANG_POP
77966b526288Smrg])# _LT_LANG_F77_CONFIG
77976b526288Smrg
77986b526288Smrg
77996b526288Smrg# _LT_LANG_FC_CONFIG([TAG])
78006b526288Smrg# -------------------------
78016b526288Smrg# Ensure that the configuration variables for a Fortran compiler are
78026b526288Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
78036b526288Smrg# to write the compiler configuration to 'libtool'.
78046b526288Smrgm4_defun([_LT_LANG_FC_CONFIG],
78056b526288Smrg[AC_LANG_PUSH(Fortran)
78066b526288Smrg
78076b526288Smrgif test -z "$FC" || test no = "$FC"; then
78086b526288Smrg  _lt_disable_FC=yes
78096b526288Smrgfi
78106b526288Smrg
78116b526288Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
78126b526288Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
78136b526288Smrg_LT_TAGVAR(always_export_symbols, $1)=no
78146b526288Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
78156b526288Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
78166b526288Smrg_LT_TAGVAR(hardcode_direct, $1)=no
78176b526288Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
78186b526288Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
78196b526288Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
78206b526288Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
78216b526288Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
78226b526288Smrg_LT_TAGVAR(inherit_rpath, $1)=no
78236b526288Smrg_LT_TAGVAR(module_cmds, $1)=
78246b526288Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
78256b526288Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
78266b526288Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
78276b526288Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
78286b526288Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
78296b526288Smrg_LT_TAGVAR(no_undefined_flag, $1)=
78306b526288Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
78316b526288Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
783211245024Smrg
78336b526288Smrg# Source file extension for fc test sources.
78346b526288Smrgac_ext=${ac_fc_srcext-f}
783511245024Smrg
78366b526288Smrg# Object file extension for compiled fc test sources.
78376b526288Smrgobjext=o
78386b526288Smrg_LT_TAGVAR(objext, $1)=$objext
783911245024Smrg
78406b526288Smrg# No sense in running all these tests if we already determined that
78416b526288Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
78426b526288Smrg# are currently assumed to apply to all compilers on this platform,
78436b526288Smrg# and will be corrupted by setting them based on a non-working compiler.
78446b526288Smrgif test yes != "$_lt_disable_FC"; then
78456b526288Smrg  # Code to be used in simple compile tests
78466b526288Smrg  lt_simple_compile_test_code="\
78476b526288Smrg      subroutine t
78486b526288Smrg      return
78496b526288Smrg      end
78506b526288Smrg"
785111a29bacSmrg
78526b526288Smrg  # Code to be used in simple link tests
78536b526288Smrg  lt_simple_link_test_code="\
78546b526288Smrg      program t
78556b526288Smrg      end
78566b526288Smrg"
785711245024Smrg
78586b526288Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
78596b526288Smrg  _LT_TAG_COMPILER
786011245024Smrg
78616b526288Smrg  # save warnings/boilerplate of simple test code
78626b526288Smrg  _LT_COMPILER_BOILERPLATE
78636b526288Smrg  _LT_LINKER_BOILERPLATE
786411245024Smrg
78656b526288Smrg  # Allow CC to be a program name with arguments.
78666b526288Smrg  lt_save_CC=$CC
78676b526288Smrg  lt_save_GCC=$GCC
78686b526288Smrg  lt_save_CFLAGS=$CFLAGS
78696b526288Smrg  CC=${FC-"f95"}
78706b526288Smrg  CFLAGS=$FCFLAGS
78716b526288Smrg  compiler=$CC
78726b526288Smrg  GCC=$ac_cv_fc_compiler_gnu
787311245024Smrg
78746b526288Smrg  _LT_TAGVAR(compiler, $1)=$CC
78756b526288Smrg  _LT_CC_BASENAME([$compiler])
787611245024Smrg
78776b526288Smrg  if test -n "$compiler"; then
78786b526288Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
78796b526288Smrg    AC_MSG_RESULT([$can_build_shared])
788011245024Smrg
78816b526288Smrg    AC_MSG_CHECKING([whether to build shared libraries])
78826b526288Smrg    test no = "$can_build_shared" && enable_shared=no
788311245024Smrg
78846b526288Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
78856b526288Smrg    # are all built from PIC.
78866b526288Smrg    case $host_os in
78876b526288Smrg      aix3*)
78886b526288Smrg        test yes = "$enable_shared" && enable_static=no
78896b526288Smrg        if test -n "$RANLIB"; then
78906b526288Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
78916b526288Smrg          postinstall_cmds='$RANLIB $lib'
78926b526288Smrg        fi
78936b526288Smrg        ;;
78946b526288Smrg      aix[[4-9]]*)
78956b526288Smrg	if test ia64 != "$host_cpu"; then
78966b526288Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
78976b526288Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
78986b526288Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
78996b526288Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
79006b526288Smrg	  esac
79016b526288Smrg	fi
79026b526288Smrg        ;;
79036b526288Smrg    esac
79046b526288Smrg    AC_MSG_RESULT([$enable_shared])
790511245024Smrg
79066b526288Smrg    AC_MSG_CHECKING([whether to build static libraries])
79076b526288Smrg    # Make sure either enable_shared or enable_static is yes.
79086b526288Smrg    test yes = "$enable_shared" || enable_static=yes
79096b526288Smrg    AC_MSG_RESULT([$enable_static])
791011245024Smrg
79116b526288Smrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
79126b526288Smrg    _LT_TAGVAR(LD, $1)=$LD
791311245024Smrg
79146b526288Smrg    ## CAVEAT EMPTOR:
79156b526288Smrg    ## There is no encapsulation within the following macros, do not change
79166b526288Smrg    ## the running order or otherwise move them around unless you know exactly
79176b526288Smrg    ## what you are doing...
79186b526288Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
79196b526288Smrg    _LT_COMPILER_PIC($1)
79206b526288Smrg    _LT_COMPILER_C_O($1)
79216b526288Smrg    _LT_COMPILER_FILE_LOCKS($1)
79226b526288Smrg    _LT_LINKER_SHLIBS($1)
79236b526288Smrg    _LT_SYS_DYNAMIC_LINKER($1)
79246b526288Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
792511245024Smrg
79266b526288Smrg    _LT_CONFIG($1)
79276b526288Smrg  fi # test -n "$compiler"
792811245024Smrg
79296b526288Smrg  GCC=$lt_save_GCC
79306b526288Smrg  CC=$lt_save_CC
79316b526288Smrg  CFLAGS=$lt_save_CFLAGS
79326b526288Smrgfi # test yes != "$_lt_disable_FC"
793311245024Smrg
79346b526288SmrgAC_LANG_POP
79356b526288Smrg])# _LT_LANG_FC_CONFIG
793611245024Smrg
793711245024Smrg
79386b526288Smrg# _LT_LANG_GCJ_CONFIG([TAG])
79396b526288Smrg# --------------------------
79406b526288Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
79416b526288Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
79426b526288Smrg# to write the compiler configuration to 'libtool'.
79436b526288Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
79446b526288Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
79456b526288SmrgAC_LANG_SAVE
794611245024Smrg
79476b526288Smrg# Source file extension for Java test sources.
79486b526288Smrgac_ext=java
794911245024Smrg
79506b526288Smrg# Object file extension for compiled Java test sources.
79516b526288Smrgobjext=o
79526b526288Smrg_LT_TAGVAR(objext, $1)=$objext
795311245024Smrg
79546b526288Smrg# Code to be used in simple compile tests
79556b526288Smrglt_simple_compile_test_code="class foo {}"
795611245024Smrg
79576b526288Smrg# Code to be used in simple link tests
79586b526288Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
795911245024Smrg
79606b526288Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
79616b526288Smrg_LT_TAG_COMPILER
796211245024Smrg
79636b526288Smrg# save warnings/boilerplate of simple test code
79646b526288Smrg_LT_COMPILER_BOILERPLATE
79656b526288Smrg_LT_LINKER_BOILERPLATE
796611245024Smrg
79676b526288Smrg# Allow CC to be a program name with arguments.
79686b526288Smrglt_save_CC=$CC
79696b526288Smrglt_save_CFLAGS=$CFLAGS
79706b526288Smrglt_save_GCC=$GCC
79716b526288SmrgGCC=yes
79726b526288SmrgCC=${GCJ-"gcj"}
79736b526288SmrgCFLAGS=$GCJFLAGS
79746b526288Smrgcompiler=$CC
79756b526288Smrg_LT_TAGVAR(compiler, $1)=$CC
79766b526288Smrg_LT_TAGVAR(LD, $1)=$LD
79776b526288Smrg_LT_CC_BASENAME([$compiler])
797811245024Smrg
79796b526288Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
79806b526288Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
798111245024Smrg
79826b526288Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
79836b526288Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
79846b526288Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
798511245024Smrg
79866b526288Smrgif test -n "$compiler"; then
79876b526288Smrg  _LT_COMPILER_NO_RTTI($1)
79886b526288Smrg  _LT_COMPILER_PIC($1)
79896b526288Smrg  _LT_COMPILER_C_O($1)
79906b526288Smrg  _LT_COMPILER_FILE_LOCKS($1)
79916b526288Smrg  _LT_LINKER_SHLIBS($1)
79926b526288Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
799311245024Smrg
79946b526288Smrg  _LT_CONFIG($1)
79956b526288Smrgfi
799611245024Smrg
79976b526288SmrgAC_LANG_RESTORE
799811245024Smrg
79996b526288SmrgGCC=$lt_save_GCC
80006b526288SmrgCC=$lt_save_CC
80016b526288SmrgCFLAGS=$lt_save_CFLAGS
80026b526288Smrg])# _LT_LANG_GCJ_CONFIG
800311245024Smrg
800411245024Smrg
80056b526288Smrg# _LT_LANG_GO_CONFIG([TAG])
80066b526288Smrg# --------------------------
80076b526288Smrg# Ensure that the configuration variables for the GNU Go compiler
80086b526288Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
80096b526288Smrg# to write the compiler configuration to 'libtool'.
80106b526288Smrgm4_defun([_LT_LANG_GO_CONFIG],
80116b526288Smrg[AC_REQUIRE([LT_PROG_GO])dnl
80126b526288SmrgAC_LANG_SAVE
801311a29bacSmrg
80146b526288Smrg# Source file extension for Go test sources.
80156b526288Smrgac_ext=go
801611245024Smrg
80176b526288Smrg# Object file extension for compiled Go test sources.
80186b526288Smrgobjext=o
80196b526288Smrg_LT_TAGVAR(objext, $1)=$objext
802011245024Smrg
80216b526288Smrg# Code to be used in simple compile tests
80226b526288Smrglt_simple_compile_test_code="package main; func main() { }"
802311245024Smrg
80246b526288Smrg# Code to be used in simple link tests
80256b526288Smrglt_simple_link_test_code='package main; func main() { }'
802611245024Smrg
80276b526288Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
80286b526288Smrg_LT_TAG_COMPILER
80296b526288Smrg
80306b526288Smrg# save warnings/boilerplate of simple test code
80316b526288Smrg_LT_COMPILER_BOILERPLATE
80326b526288Smrg_LT_LINKER_BOILERPLATE
80336b526288Smrg
80346b526288Smrg# Allow CC to be a program name with arguments.
80356b526288Smrglt_save_CC=$CC
80366b526288Smrglt_save_CFLAGS=$CFLAGS
80376b526288Smrglt_save_GCC=$GCC
80386b526288SmrgGCC=yes
80396b526288SmrgCC=${GOC-"gccgo"}
80406b526288SmrgCFLAGS=$GOFLAGS
80416b526288Smrgcompiler=$CC
80426b526288Smrg_LT_TAGVAR(compiler, $1)=$CC
80436b526288Smrg_LT_TAGVAR(LD, $1)=$LD
80446b526288Smrg_LT_CC_BASENAME([$compiler])
804511245024Smrg
80466b526288Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
80476b526288Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
804811245024Smrg
80496b526288Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
80506b526288Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
80516b526288Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
805211245024Smrg
80536b526288Smrgif test -n "$compiler"; then
80546b526288Smrg  _LT_COMPILER_NO_RTTI($1)
80556b526288Smrg  _LT_COMPILER_PIC($1)
80566b526288Smrg  _LT_COMPILER_C_O($1)
80576b526288Smrg  _LT_COMPILER_FILE_LOCKS($1)
80586b526288Smrg  _LT_LINKER_SHLIBS($1)
80596b526288Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
806011245024Smrg
80616b526288Smrg  _LT_CONFIG($1)
80626b526288Smrgfi
806311245024Smrg
80646b526288SmrgAC_LANG_RESTORE
806511245024Smrg
80666b526288SmrgGCC=$lt_save_GCC
80676b526288SmrgCC=$lt_save_CC
80686b526288SmrgCFLAGS=$lt_save_CFLAGS
80696b526288Smrg])# _LT_LANG_GO_CONFIG
807011245024Smrg
807111245024Smrg
80726b526288Smrg# _LT_LANG_RC_CONFIG([TAG])
80736b526288Smrg# -------------------------
80746b526288Smrg# Ensure that the configuration variables for the Windows resource compiler
80756b526288Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
80766b526288Smrg# to write the compiler configuration to 'libtool'.
80776b526288Smrgm4_defun([_LT_LANG_RC_CONFIG],
80786b526288Smrg[AC_REQUIRE([LT_PROG_RC])dnl
80796b526288SmrgAC_LANG_SAVE
808011245024Smrg
80816b526288Smrg# Source file extension for RC test sources.
80826b526288Smrgac_ext=rc
808311245024Smrg
80846b526288Smrg# Object file extension for compiled RC test sources.
80856b526288Smrgobjext=o
80866b526288Smrg_LT_TAGVAR(objext, $1)=$objext
808711245024Smrg
80886b526288Smrg# Code to be used in simple compile tests
80896b526288Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
809011245024Smrg
80916b526288Smrg# Code to be used in simple link tests
80926b526288Smrglt_simple_link_test_code=$lt_simple_compile_test_code
809311245024Smrg
80946b526288Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
80956b526288Smrg_LT_TAG_COMPILER
809611245024Smrg
80976b526288Smrg# save warnings/boilerplate of simple test code
80986b526288Smrg_LT_COMPILER_BOILERPLATE
80996b526288Smrg_LT_LINKER_BOILERPLATE
810011245024Smrg
81016b526288Smrg# Allow CC to be a program name with arguments.
81026b526288Smrglt_save_CC=$CC
81036b526288Smrglt_save_CFLAGS=$CFLAGS
81046b526288Smrglt_save_GCC=$GCC
81056b526288SmrgGCC=
81066b526288SmrgCC=${RC-"windres"}
81076b526288SmrgCFLAGS=
81086b526288Smrgcompiler=$CC
81096b526288Smrg_LT_TAGVAR(compiler, $1)=$CC
81106b526288Smrg_LT_CC_BASENAME([$compiler])
81116b526288Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
811211245024Smrg
81136b526288Smrgif test -n "$compiler"; then
81146b526288Smrg  :
81156b526288Smrg  _LT_CONFIG($1)
81166b526288Smrgfi
811711245024Smrg
81186b526288SmrgGCC=$lt_save_GCC
81196b526288SmrgAC_LANG_RESTORE
81206b526288SmrgCC=$lt_save_CC
81216b526288SmrgCFLAGS=$lt_save_CFLAGS
81226b526288Smrg])# _LT_LANG_RC_CONFIG
812341b2f0bdSmrg
812441b2f0bdSmrg
81256b526288Smrg# LT_PROG_GCJ
81266b526288Smrg# -----------
81276b526288SmrgAC_DEFUN([LT_PROG_GCJ],
81286b526288Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
81296b526288Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
81306b526288Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
81316b526288Smrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
81326b526288Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
81336b526288Smrg])
813441b2f0bdSmrg
81356b526288Smrg# Old name:
81366b526288SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
81376b526288Smrgdnl aclocal-1.4 backwards compatibility:
81386b526288Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
813941b2f0bdSmrg
814041b2f0bdSmrg
81416b526288Smrg# LT_PROG_GO
81426b526288Smrg# ----------
81436b526288SmrgAC_DEFUN([LT_PROG_GO],
81446b526288Smrg[AC_CHECK_TOOL(GOC, gccgo,)
81456b526288Smrg])
81466b526288Smrg
81476b526288Smrg
81486b526288Smrg# LT_PROG_RC
81496b526288Smrg# ----------
81506b526288SmrgAC_DEFUN([LT_PROG_RC],
81516b526288Smrg[AC_CHECK_TOOL(RC, windres,)
81526b526288Smrg])
81536b526288Smrg
81546b526288Smrg# Old name:
81556b526288SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
81566b526288Smrgdnl aclocal-1.4 backwards compatibility:
81576b526288Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
81586b526288Smrg
815941b2f0bdSmrg
81606b526288Smrg# _LT_DECL_EGREP
81616b526288Smrg# --------------
81626b526288Smrg# If we don't have a new enough Autoconf to choose the best grep
81636b526288Smrg# available, choose the one first in the user's PATH.
81646b526288Smrgm4_defun([_LT_DECL_EGREP],
81656b526288Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
81666b526288SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
81676b526288Smrgtest -z "$GREP" && GREP=grep
81686b526288Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
81696b526288Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
81706b526288Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
81716b526288Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
81726b526288SmrgAC_SUBST([GREP])
817311a29bacSmrg])
817441b2f0bdSmrg
817541b2f0bdSmrg
81766b526288Smrg# _LT_DECL_OBJDUMP
81776b526288Smrg# --------------
81786b526288Smrg# If we don't have a new enough Autoconf to choose the best objdump
81796b526288Smrg# available, choose the one first in the user's PATH.
81806b526288Smrgm4_defun([_LT_DECL_OBJDUMP],
81816b526288Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
81826b526288Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
81836b526288Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
81846b526288SmrgAC_SUBST([OBJDUMP])
81856b526288Smrg])
818641b2f0bdSmrg
81876b526288Smrg# _LT_DECL_DLLTOOL
81886b526288Smrg# ----------------
81896b526288Smrg# Ensure DLLTOOL variable is set.
81906b526288Smrgm4_defun([_LT_DECL_DLLTOOL],
81916b526288Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
81926b526288Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
81936b526288Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
81946b526288SmrgAC_SUBST([DLLTOOL])
81956b526288Smrg])
819641b2f0bdSmrg
81976b526288Smrg# _LT_DECL_SED
81986b526288Smrg# ------------
81996b526288Smrg# Check for a fully-functional sed program, that truncates
82006b526288Smrg# as few characters as possible.  Prefer GNU sed if found.
82016b526288Smrgm4_defun([_LT_DECL_SED],
82026b526288Smrg[AC_PROG_SED
82036b526288Smrgtest -z "$SED" && SED=sed
82046b526288SmrgXsed="$SED -e 1s/^X//"
82056b526288Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
82066b526288Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
82076b526288Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
82086b526288Smrg])# _LT_DECL_SED
820911a29bacSmrg
82106b526288Smrgm4_ifndef([AC_PROG_SED], [
82116b526288Smrg# NOTE: This macro has been submitted for inclusion into   #
82126b526288Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
82136b526288Smrg#  a released version of Autoconf we should remove this    #
82146b526288Smrg#  macro and use it instead.                               #
82156b526288Smrg
82166b526288Smrgm4_defun([AC_PROG_SED],
82176b526288Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
82186b526288SmrgAC_CACHE_VAL(lt_cv_path_SED,
82196b526288Smrg[# Loop through the user's path and test for sed and gsed.
82206b526288Smrg# Then use that list of sed's as ones to test for truncation.
82216b526288Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
82226b526288Smrgfor as_dir in $PATH
82236b526288Smrgdo
82246b526288Smrg  IFS=$as_save_IFS
82256b526288Smrg  test -z "$as_dir" && as_dir=.
82266b526288Smrg  for lt_ac_prog in sed gsed; do
82276b526288Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
82286b526288Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
82296b526288Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
82306b526288Smrg      fi
82316b526288Smrg    done
82326b526288Smrg  done
82336b526288Smrgdone
82346b526288SmrgIFS=$as_save_IFS
82356b526288Smrglt_ac_max=0
82366b526288Smrglt_ac_count=0
82376b526288Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
82386b526288Smrg# along with /bin/sed that truncates output.
82396b526288Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
82406b526288Smrg  test ! -f "$lt_ac_sed" && continue
82416b526288Smrg  cat /dev/null > conftest.in
82426b526288Smrg  lt_ac_count=0
82436b526288Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
82446b526288Smrg  # Check for GNU sed and select it if it is found.
82456b526288Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
82466b526288Smrg    lt_cv_path_SED=$lt_ac_sed
82476b526288Smrg    break
824811a29bacSmrg  fi
82496b526288Smrg  while true; do
82506b526288Smrg    cat conftest.in conftest.in >conftest.tmp
82516b526288Smrg    mv conftest.tmp conftest.in
82526b526288Smrg    cp conftest.in conftest.nl
82536b526288Smrg    echo >>conftest.nl
82546b526288Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
82556b526288Smrg    cmp -s conftest.out conftest.nl || break
82566b526288Smrg    # 10000 chars as input seems more than enough
82576b526288Smrg    test 10 -lt "$lt_ac_count" && break
82586b526288Smrg    lt_ac_count=`expr $lt_ac_count + 1`
82596b526288Smrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
82606b526288Smrg      lt_ac_max=$lt_ac_count
82616b526288Smrg      lt_cv_path_SED=$lt_ac_sed
82626b526288Smrg    fi
82636b526288Smrg  done
82646b526288Smrgdone
82656b526288Smrg])
82666b526288SmrgSED=$lt_cv_path_SED
82676b526288SmrgAC_SUBST([SED])
82686b526288SmrgAC_MSG_RESULT([$SED])
82696b526288Smrg])#AC_PROG_SED
82706b526288Smrg])#m4_ifndef
827141b2f0bdSmrg
82726b526288Smrg# Old name:
82736b526288SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
82746b526288Smrgdnl aclocal-1.4 backwards compatibility:
82756b526288Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
827611a29bacSmrg
827711a29bacSmrg
82786b526288Smrg# _LT_CHECK_SHELL_FEATURES
827911a29bacSmrg# ------------------------
82806b526288Smrg# Find out whether the shell is Bourne or XSI compatible,
82816b526288Smrg# or has some other useful features.
82826b526288Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
82836b526288Smrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
82846b526288Smrg  lt_unset=unset
82856b526288Smrgelse
82866b526288Smrg  lt_unset=false
82876b526288Smrgfi
82886b526288Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
828941b2f0bdSmrg
82906b526288Smrg# test EBCDIC or ASCII
82916b526288Smrgcase `echo X|tr X '\101'` in
82926b526288Smrg A) # ASCII based system
82936b526288Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
82946b526288Smrg  lt_SP2NL='tr \040 \012'
82956b526288Smrg  lt_NL2SP='tr \015\012 \040\040'
82966b526288Smrg  ;;
82976b526288Smrg *) # EBCDIC based system
82986b526288Smrg  lt_SP2NL='tr \100 \n'
82996b526288Smrg  lt_NL2SP='tr \r\n \100\100'
83006b526288Smrg  ;;
83016b526288Smrgesac
83026b526288Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
83036b526288Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
83046b526288Smrg])# _LT_CHECK_SHELL_FEATURES
830541b2f0bdSmrg
830641b2f0bdSmrg
83076b526288Smrg# _LT_PATH_CONVERSION_FUNCTIONS
83086b526288Smrg# -----------------------------
83096b526288Smrg# Determine what file name conversion functions should be used by
83106b526288Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
83116b526288Smrg# for certain cross-compile configurations and native mingw.
83126b526288Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
83136b526288Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
83146b526288SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
83156b526288SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
83166b526288SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
83176b526288Smrg[case $host in
83186b526288Smrg  *-*-mingw* )
83196b526288Smrg    case $build in
83206b526288Smrg      *-*-mingw* ) # actually msys
83216b526288Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
83226b526288Smrg        ;;
83236b526288Smrg      *-*-cygwin* )
83246b526288Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
83256b526288Smrg        ;;
83266b526288Smrg      * ) # otherwise, assume *nix
83276b526288Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
83286b526288Smrg        ;;
83296b526288Smrg    esac
83306b526288Smrg    ;;
83316b526288Smrg  *-*-cygwin* )
83326b526288Smrg    case $build in
83336b526288Smrg      *-*-mingw* ) # actually msys
83346b526288Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
83356b526288Smrg        ;;
83366b526288Smrg      *-*-cygwin* )
83376b526288Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
83386b526288Smrg        ;;
83396b526288Smrg      * ) # otherwise, assume *nix
83406b526288Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
83416b526288Smrg        ;;
83426b526288Smrg    esac
83436b526288Smrg    ;;
83446b526288Smrg  * ) # unhandled hosts (and "normal" native builds)
83456b526288Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
83466b526288Smrg    ;;
83476b526288Smrgesac
83486b526288Smrg])
83496b526288Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
83506b526288SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
83516b526288Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
83526b526288Smrg         [0], [convert $build file names to $host format])dnl
83536b526288Smrg
83546b526288SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
83556b526288SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
83566b526288Smrg[#assume ordinary cross tools, or native build.
83576b526288Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
83586b526288Smrgcase $host in
83596b526288Smrg  *-*-mingw* )
83606b526288Smrg    case $build in
83616b526288Smrg      *-*-mingw* ) # actually msys
83626b526288Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
83636b526288Smrg        ;;
83646b526288Smrg    esac
83656b526288Smrg    ;;
83666b526288Smrgesac
83676b526288Smrg])
83686b526288Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
83696b526288SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
83706b526288Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
83716b526288Smrg         [0], [convert $build files to toolchain format])dnl
83726b526288Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
837341b2f0bdSmrg
83746b526288Smrg# Helper functions for option handling.                    -*- Autoconf -*-
83756b526288Smrg#
83766b526288Smrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
83776b526288Smrg#   Foundation, Inc.
83786b526288Smrg#   Written by Gary V. Vaughan, 2004
83796b526288Smrg#
83806b526288Smrg# This file is free software; the Free Software Foundation gives
83816b526288Smrg# unlimited permission to copy and/or distribute it, with or without
83826b526288Smrg# modifications, as long as this notice is preserved.
838311245024Smrg
83846b526288Smrg# serial 8 ltoptions.m4
838511a29bacSmrg
83866b526288Smrg# This is to help aclocal find these macros, as it can't see m4_define.
83876b526288SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
838811a29bacSmrg
838911a29bacSmrg
83906b526288Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
83916b526288Smrg# ------------------------------------------
83926b526288Smrgm4_define([_LT_MANGLE_OPTION],
83936b526288Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
839411245024Smrg
839511245024Smrg
83966b526288Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
83976b526288Smrg# ---------------------------------------
83986b526288Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
83996b526288Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
84006b526288Smrg# saved as a flag.
84016b526288Smrgm4_define([_LT_SET_OPTION],
84026b526288Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
84036b526288Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
84046b526288Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
84056b526288Smrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
84066b526288Smrg])
840711245024Smrg
840811245024Smrg
84096b526288Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
84106b526288Smrg# ------------------------------------------------------------
84116b526288Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
84126b526288Smrgm4_define([_LT_IF_OPTION],
84136b526288Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
841411245024Smrg
841511245024Smrg
84166b526288Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
84176b526288Smrg# -------------------------------------------------------
84186b526288Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
84196b526288Smrg# are set.
84206b526288Smrgm4_define([_LT_UNLESS_OPTIONS],
84216b526288Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
84226b526288Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
84236b526288Smrg		      [m4_define([$0_found])])])[]dnl
84246b526288Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
84256b526288Smrg])[]dnl
84266b526288Smrg])
842711245024Smrg
842811245024Smrg
84296b526288Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
84306b526288Smrg# ----------------------------------------
84316b526288Smrg# OPTION-LIST is a space-separated list of Libtool options associated
84326b526288Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
84336b526288Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
84346b526288Smrg# the unknown option and exit.
84356b526288Smrgm4_defun([_LT_SET_OPTIONS],
84366b526288Smrg[# Set options
84376b526288Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
84386b526288Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
843911a29bacSmrg
84406b526288Smrgm4_if([$1],[LT_INIT],[
84416b526288Smrg  dnl
84426b526288Smrg  dnl Simply set some default values (i.e off) if boolean options were not
84436b526288Smrg  dnl specified:
84446b526288Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
84456b526288Smrg  ])
84466b526288Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
84476b526288Smrg  ])
84486b526288Smrg  dnl
84496b526288Smrg  dnl If no reference was made to various pairs of opposing options, then
84506b526288Smrg  dnl we run the default mode handler for the pair.  For example, if neither
84516b526288Smrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
84526b526288Smrg  dnl archives by default:
84536b526288Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
84546b526288Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
84556b526288Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
84566b526288Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
84576b526288Smrg		   [_LT_ENABLE_FAST_INSTALL])
84586b526288Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
84596b526288Smrg		   [_LT_WITH_AIX_SONAME([aix])])
84606b526288Smrg  ])
84616b526288Smrg])# _LT_SET_OPTIONS
846211a29bacSmrg
846311a29bacSmrg
846411a29bacSmrg
84656b526288Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
84666b526288Smrg# -----------------------------------------
84676b526288Smrgm4_define([_LT_MANGLE_DEFUN],
84686b526288Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
846911a29bacSmrg
847011245024Smrg
84716b526288Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
84726b526288Smrg# -----------------------------------------------
84736b526288Smrgm4_define([LT_OPTION_DEFINE],
84746b526288Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
84756b526288Smrg])# LT_OPTION_DEFINE
847611245024Smrg
847711245024Smrg
84786b526288Smrg# dlopen
84796b526288Smrg# ------
84806b526288SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
84816b526288Smrg])
848211245024Smrg
84836b526288SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
84846b526288Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
84856b526288SmrgAC_DIAGNOSE([obsolete],
84866b526288Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
84876b526288Smrgput the 'dlopen' option into LT_INIT's first parameter.])
84886b526288Smrg])
84896b526288Smrg
84906b526288Smrgdnl aclocal-1.4 backwards compatibility:
84916b526288Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
849211245024Smrg
849311245024Smrg
84946b526288Smrg# win32-dll
84956b526288Smrg# ---------
84966b526288Smrg# Declare package support for building win32 dll's.
84976b526288SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
84986b526288Smrg[enable_win32_dll=yes
849911245024Smrg
85006b526288Smrgcase $host in
85016b526288Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
85026b526288Smrg  AC_CHECK_TOOL(AS, as, false)
85036b526288Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
85046b526288Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
85056b526288Smrg  ;;
85066b526288Smrgesac
850711a29bacSmrg
85086b526288Smrgtest -z "$AS" && AS=as
85096b526288Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
851011245024Smrg
85116b526288Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
85126b526288Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
851311245024Smrg
85146b526288Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
85156b526288Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
85166b526288Smrg])# win32-dll
851711245024Smrg
85186b526288SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
85196b526288Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
85206b526288Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
85216b526288SmrgAC_DIAGNOSE([obsolete],
85226b526288Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
85236b526288Smrgput the 'win32-dll' option into LT_INIT's first parameter.])
85246b526288Smrg])
852511a29bacSmrg
85266b526288Smrgdnl aclocal-1.4 backwards compatibility:
85276b526288Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
852811245024Smrg
852911245024Smrg
85306b526288Smrg# _LT_ENABLE_SHARED([DEFAULT])
85316b526288Smrg# ----------------------------
85326b526288Smrg# implement the --enable-shared flag, and supports the 'shared' and
85336b526288Smrg# 'disable-shared' LT_INIT options.
85346b526288Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
85356b526288Smrgm4_define([_LT_ENABLE_SHARED],
85366b526288Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
85376b526288SmrgAC_ARG_ENABLE([shared],
85386b526288Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
85396b526288Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
85406b526288Smrg    [p=${PACKAGE-default}
85416b526288Smrg    case $enableval in
85426b526288Smrg    yes) enable_shared=yes ;;
85436b526288Smrg    no) enable_shared=no ;;
85446b526288Smrg    *)
85456b526288Smrg      enable_shared=no
85466b526288Smrg      # Look at the argument we got.  We use all the common list separators.
85476b526288Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
85486b526288Smrg      for pkg in $enableval; do
85496b526288Smrg	IFS=$lt_save_ifs
85506b526288Smrg	if test "X$pkg" = "X$p"; then
85516b526288Smrg	  enable_shared=yes
85526b526288Smrg	fi
85536b526288Smrg      done
85546b526288Smrg      IFS=$lt_save_ifs
85556b526288Smrg      ;;
85566b526288Smrg    esac],
85576b526288Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
855811a29bacSmrg
85596b526288Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
85606b526288Smrg	[Whether or not to build shared libraries])
85616b526288Smrg])# _LT_ENABLE_SHARED
856211a29bacSmrg
85636b526288SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
85646b526288SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
856511245024Smrg
85666b526288Smrg# Old names:
85676b526288SmrgAC_DEFUN([AC_ENABLE_SHARED],
85686b526288Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
85696b526288Smrg])
857011a29bacSmrg
85716b526288SmrgAC_DEFUN([AC_DISABLE_SHARED],
85726b526288Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
85736b526288Smrg])
857411245024Smrg
85756b526288SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
85766b526288SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
857741b2f0bdSmrg
85786b526288Smrgdnl aclocal-1.4 backwards compatibility:
85796b526288Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
85806b526288Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
858141b2f0bdSmrg
858241b2f0bdSmrg
858341b2f0bdSmrg
85846b526288Smrg# _LT_ENABLE_STATIC([DEFAULT])
85856b526288Smrg# ----------------------------
85866b526288Smrg# implement the --enable-static flag, and support the 'static' and
85876b526288Smrg# 'disable-static' LT_INIT options.
85886b526288Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
85896b526288Smrgm4_define([_LT_ENABLE_STATIC],
85906b526288Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
85916b526288SmrgAC_ARG_ENABLE([static],
85926b526288Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
85936b526288Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
85946b526288Smrg    [p=${PACKAGE-default}
85956b526288Smrg    case $enableval in
85966b526288Smrg    yes) enable_static=yes ;;
85976b526288Smrg    no) enable_static=no ;;
85986b526288Smrg    *)
85996b526288Smrg     enable_static=no
86006b526288Smrg      # Look at the argument we got.  We use all the common list separators.
86016b526288Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
86026b526288Smrg      for pkg in $enableval; do
86036b526288Smrg	IFS=$lt_save_ifs
86046b526288Smrg	if test "X$pkg" = "X$p"; then
86056b526288Smrg	  enable_static=yes
86066b526288Smrg	fi
86076b526288Smrg      done
86086b526288Smrg      IFS=$lt_save_ifs
86096b526288Smrg      ;;
86106b526288Smrg    esac],
86116b526288Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
86126b526288Smrg
86136b526288Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
86146b526288Smrg	[Whether or not to build static libraries])
86156b526288Smrg])# _LT_ENABLE_STATIC
861641b2f0bdSmrg
86176b526288SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
86186b526288SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
861941b2f0bdSmrg
86206b526288Smrg# Old names:
86216b526288SmrgAC_DEFUN([AC_ENABLE_STATIC],
86226b526288Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
86236b526288Smrg])
862441b2f0bdSmrg
86256b526288SmrgAC_DEFUN([AC_DISABLE_STATIC],
86266b526288Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
86276b526288Smrg])
862841b2f0bdSmrg
86296b526288SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
86306b526288SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
863141b2f0bdSmrg
86326b526288Smrgdnl aclocal-1.4 backwards compatibility:
86336b526288Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
86346b526288Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
863511a29bacSmrg
863641b2f0bdSmrg
863711a29bacSmrg
86386b526288Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
86396b526288Smrg# ----------------------------------
86406b526288Smrg# implement the --enable-fast-install flag, and support the 'fast-install'
86416b526288Smrg# and 'disable-fast-install' LT_INIT options.
86426b526288Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
86436b526288Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
86446b526288Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
86456b526288SmrgAC_ARG_ENABLE([fast-install],
86466b526288Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
86476b526288Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
86486b526288Smrg    [p=${PACKAGE-default}
86496b526288Smrg    case $enableval in
86506b526288Smrg    yes) enable_fast_install=yes ;;
86516b526288Smrg    no) enable_fast_install=no ;;
86526b526288Smrg    *)
86536b526288Smrg      enable_fast_install=no
86546b526288Smrg      # Look at the argument we got.  We use all the common list separators.
86556b526288Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
86566b526288Smrg      for pkg in $enableval; do
86576b526288Smrg	IFS=$lt_save_ifs
86586b526288Smrg	if test "X$pkg" = "X$p"; then
86596b526288Smrg	  enable_fast_install=yes
86606b526288Smrg	fi
86616b526288Smrg      done
86626b526288Smrg      IFS=$lt_save_ifs
86636b526288Smrg      ;;
86646b526288Smrg    esac],
86656b526288Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
866611a29bacSmrg
86676b526288Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
86686b526288Smrg	 [Whether or not to optimize for fast installation])dnl
86696b526288Smrg])# _LT_ENABLE_FAST_INSTALL
867041b2f0bdSmrg
86716b526288SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
86726b526288SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
867311a29bacSmrg
86746b526288Smrg# Old names:
86756b526288SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
86766b526288Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
86776b526288SmrgAC_DIAGNOSE([obsolete],
86786b526288Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
86796b526288Smrgthe 'fast-install' option into LT_INIT's first parameter.])
86806b526288Smrg])
868141b2f0bdSmrg
86826b526288SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
86836b526288Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
86846b526288SmrgAC_DIAGNOSE([obsolete],
86856b526288Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
86866b526288Smrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
86876b526288Smrg])
868841b2f0bdSmrg
86896b526288Smrgdnl aclocal-1.4 backwards compatibility:
86906b526288Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
86916b526288Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
869211a29bacSmrg
869311a29bacSmrg
86946b526288Smrg# _LT_WITH_AIX_SONAME([DEFAULT])
86956b526288Smrg# ----------------------------------
86966b526288Smrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
86976b526288Smrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
86986b526288Smrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
86996b526288Smrgm4_define([_LT_WITH_AIX_SONAME],
87006b526288Smrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
87016b526288Smrgshared_archive_member_spec=
87026b526288Smrgcase $host,$enable_shared in
87036b526288Smrgpower*-*-aix[[5-9]]*,yes)
87046b526288Smrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
87056b526288Smrg  AC_ARG_WITH([aix-soname],
87066b526288Smrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
87076b526288Smrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
87086b526288Smrg    [case $withval in
87096b526288Smrg    aix|svr4|both)
87106b526288Smrg      ;;
87116b526288Smrg    *)
87126b526288Smrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
87136b526288Smrg      ;;
87146b526288Smrg    esac
87156b526288Smrg    lt_cv_with_aix_soname=$with_aix_soname],
87166b526288Smrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
87176b526288Smrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
87186b526288Smrg    with_aix_soname=$lt_cv_with_aix_soname])
87196b526288Smrg  AC_MSG_RESULT([$with_aix_soname])
87206b526288Smrg  if test aix != "$with_aix_soname"; then
87216b526288Smrg    # For the AIX way of multilib, we name the shared archive member
87226b526288Smrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
87236b526288Smrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
87246b526288Smrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
87256b526288Smrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
87266b526288Smrg    if test 64 = "${OBJECT_MODE-32}"; then
87276b526288Smrg      shared_archive_member_spec=shr_64
87286b526288Smrg    else
87296b526288Smrg      shared_archive_member_spec=shr
87306b526288Smrg    fi
87316b526288Smrg  fi
87326b526288Smrg  ;;
87336b526288Smrg*)
87346b526288Smrg  with_aix_soname=aix
87356b526288Smrg  ;;
87366b526288Smrgesac
87376b526288Smrg
87386b526288Smrg_LT_DECL([], [shared_archive_member_spec], [0],
87396b526288Smrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
87406b526288Smrg])# _LT_WITH_AIX_SONAME
874141b2f0bdSmrg
87426b526288SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
87436b526288SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
87446b526288SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
874541b2f0bdSmrg
874641b2f0bdSmrg
87476b526288Smrg# _LT_WITH_PIC([MODE])
87486b526288Smrg# --------------------
87496b526288Smrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
87506b526288Smrg# LT_INIT options.
87516b526288Smrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
87526b526288Smrgm4_define([_LT_WITH_PIC],
87536b526288Smrg[AC_ARG_WITH([pic],
87546b526288Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
87556b526288Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
87566b526288Smrg    [lt_p=${PACKAGE-default}
87576b526288Smrg    case $withval in
87586b526288Smrg    yes|no) pic_mode=$withval ;;
87596b526288Smrg    *)
87606b526288Smrg      pic_mode=default
87616b526288Smrg      # Look at the argument we got.  We use all the common list separators.
87626b526288Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
87636b526288Smrg      for lt_pkg in $withval; do
87646b526288Smrg	IFS=$lt_save_ifs
87656b526288Smrg	if test "X$lt_pkg" = "X$lt_p"; then
87666b526288Smrg	  pic_mode=yes
87676b526288Smrg	fi
87686b526288Smrg      done
87696b526288Smrg      IFS=$lt_save_ifs
87706b526288Smrg      ;;
87716b526288Smrg    esac],
87726b526288Smrg    [pic_mode=m4_default([$1], [default])])
877311a29bacSmrg
87746b526288Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
87756b526288Smrg])# _LT_WITH_PIC
877611a29bacSmrg
87776b526288SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
87786b526288SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
877941b2f0bdSmrg
87806b526288Smrg# Old name:
87816b526288SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
87826b526288Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
87836b526288SmrgAC_DIAGNOSE([obsolete],
87846b526288Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
87856b526288Smrgput the 'pic-only' option into LT_INIT's first parameter.])
87866b526288Smrg])
878741b2f0bdSmrg
87886b526288Smrgdnl aclocal-1.4 backwards compatibility:
87896b526288Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
879041b2f0bdSmrg
879111245024Smrg
87926b526288Smrgm4_define([_LTDL_MODE], [])
87936b526288SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
87946b526288Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
87956b526288SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
87966b526288Smrg		 [m4_define([_LTDL_MODE], [recursive])])
87976b526288SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
87986b526288Smrg		 [m4_define([_LTDL_MODE], [subproject])])
879911245024Smrg
88006b526288Smrgm4_define([_LTDL_TYPE], [])
88016b526288SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
88026b526288Smrg		 [m4_define([_LTDL_TYPE], [installable])])
88036b526288SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
88046b526288Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
880541b2f0bdSmrg
88066b526288Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
88076b526288Smrg#
88086b526288Smrg# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
88096b526288Smrg# Foundation, Inc.
88106b526288Smrg# Written by Gary V. Vaughan, 2004
88116b526288Smrg#
88126b526288Smrg# This file is free software; the Free Software Foundation gives
88136b526288Smrg# unlimited permission to copy and/or distribute it, with or without
88146b526288Smrg# modifications, as long as this notice is preserved.
881541b2f0bdSmrg
88166b526288Smrg# serial 6 ltsugar.m4
881741b2f0bdSmrg
88186b526288Smrg# This is to help aclocal find these macros, as it can't see m4_define.
88196b526288SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
882011a29bacSmrg
882111a29bacSmrg
88226b526288Smrg# lt_join(SEP, ARG1, [ARG2...])
88236b526288Smrg# -----------------------------
88246b526288Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
88256b526288Smrg# associated separator.
88266b526288Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
88276b526288Smrg# versions in m4sugar had bugs.
88286b526288Smrgm4_define([lt_join],
88296b526288Smrg[m4_if([$#], [1], [],
88306b526288Smrg       [$#], [2], [[$2]],
88316b526288Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
88326b526288Smrgm4_define([_lt_join],
88336b526288Smrg[m4_if([$#$2], [2], [],
88346b526288Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
883511a29bacSmrg
883641b2f0bdSmrg
88376b526288Smrg# lt_car(LIST)
88386b526288Smrg# lt_cdr(LIST)
88396b526288Smrg# ------------
88406b526288Smrg# Manipulate m4 lists.
88416b526288Smrg# These macros are necessary as long as will still need to support
88426b526288Smrg# Autoconf-2.59, which quotes differently.
88436b526288Smrgm4_define([lt_car], [[$1]])
88446b526288Smrgm4_define([lt_cdr],
88456b526288Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
88466b526288Smrg       [$#], 1, [],
88476b526288Smrg       [m4_dquote(m4_shift($@))])])
88486b526288Smrgm4_define([lt_unquote], $1)
884941b2f0bdSmrg
885011a29bacSmrg
88516b526288Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
88526b526288Smrg# ------------------------------------------
88536b526288Smrg# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
88546b526288Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
88556b526288Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
88566b526288Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
88576b526288Smrg# than defined and empty).
88586b526288Smrg#
88596b526288Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
88606b526288Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
88616b526288Smrgm4_define([lt_append],
88626b526288Smrg[m4_define([$1],
88636b526288Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
886411a29bacSmrg
886511a29bacSmrg
886641b2f0bdSmrg
88676b526288Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
88686b526288Smrg# ----------------------------------------------------------
88696b526288Smrg# Produce a SEP delimited list of all paired combinations of elements of
88706b526288Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
88716b526288Smrg# has the form PREFIXmINFIXSUFFIXn.
88726b526288Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
88736b526288Smrgm4_define([lt_combine],
88746b526288Smrg[m4_if(m4_eval([$# > 3]), [1],
88756b526288Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
88766b526288Smrg[[m4_foreach([_Lt_prefix], [$2],
88776b526288Smrg	     [m4_foreach([_Lt_suffix],
88786b526288Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
88796b526288Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
88806b526288Smrg
88816b526288Smrg
88826b526288Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
88836b526288Smrg# -----------------------------------------------------------------------
88846b526288Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
88856b526288Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
88866b526288Smrgm4_define([lt_if_append_uniq],
88876b526288Smrg[m4_ifdef([$1],
88886b526288Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
88896b526288Smrg		 [lt_append([$1], [$2], [$3])$4],
88906b526288Smrg		 [$5])],
88916b526288Smrg	  [lt_append([$1], [$2], [$3])$4])])
88926b526288Smrg
88936b526288Smrg
88946b526288Smrg# lt_dict_add(DICT, KEY, VALUE)
88956b526288Smrg# -----------------------------
88966b526288Smrgm4_define([lt_dict_add],
88976b526288Smrg[m4_define([$1($2)], [$3])])
889841b2f0bdSmrg
889941b2f0bdSmrg
89006b526288Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
89016b526288Smrg# --------------------------------------------
89026b526288Smrgm4_define([lt_dict_add_subkey],
89036b526288Smrg[m4_define([$1($2:$3)], [$4])])
890411a29bacSmrg
890541b2f0bdSmrg
89066b526288Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
89076b526288Smrg# ----------------------------------
89086b526288Smrgm4_define([lt_dict_fetch],
89096b526288Smrg[m4_ifval([$3],
89106b526288Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
89116b526288Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
891241b2f0bdSmrg
891341b2f0bdSmrg
89146b526288Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
89156b526288Smrg# -----------------------------------------------------------------
89166b526288Smrgm4_define([lt_if_dict_fetch],
89176b526288Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
89186b526288Smrg	[$5],
89196b526288Smrg    [$6])])
892011a29bacSmrg
892111a29bacSmrg
89226b526288Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
89236b526288Smrg# --------------------------------------------------------------
89246b526288Smrgm4_define([lt_dict_filter],
89256b526288Smrg[m4_if([$5], [], [],
89266b526288Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
89276b526288Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
89286b526288Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
89296b526288Smrg])
893011a29bacSmrg
89316b526288Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
89326b526288Smrg#
89336b526288Smrg#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
89346b526288Smrg#   Written by Scott James Remnant, 2004
89356b526288Smrg#
89366b526288Smrg# This file is free software; the Free Software Foundation gives
89376b526288Smrg# unlimited permission to copy and/or distribute it, with or without
89386b526288Smrg# modifications, as long as this notice is preserved.
893941b2f0bdSmrg
89406b526288Smrg# @configure_input@
894141b2f0bdSmrg
89426b526288Smrg# serial 4179 ltversion.m4
89436b526288Smrg# This file is part of GNU Libtool
894441b2f0bdSmrg
89456b526288Smrgm4_define([LT_PACKAGE_VERSION], [2.4.6])
89466b526288Smrgm4_define([LT_PACKAGE_REVISION], [2.4.6])
894741b2f0bdSmrg
89486b526288SmrgAC_DEFUN([LTVERSION_VERSION],
89496b526288Smrg[macro_version='2.4.6'
89506b526288Smrgmacro_revision='2.4.6'
89516b526288Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
89526b526288Smrg_LT_DECL(, macro_revision, 0)
89536b526288Smrg])
895441b2f0bdSmrg
89556b526288Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
89566b526288Smrg#
89576b526288Smrg#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
89586b526288Smrg#   Foundation, Inc.
89596b526288Smrg#   Written by Scott James Remnant, 2004.
89606b526288Smrg#
89616b526288Smrg# This file is free software; the Free Software Foundation gives
89626b526288Smrg# unlimited permission to copy and/or distribute it, with or without
89636b526288Smrg# modifications, as long as this notice is preserved.
896441b2f0bdSmrg
89656b526288Smrg# serial 5 lt~obsolete.m4
896641b2f0bdSmrg
89676b526288Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
89686b526288Smrg#
89696b526288Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
89706b526288Smrg# which have later been changed to m4_define as they aren't part of the
89716b526288Smrg# exported API, or moved to Autoconf or Automake where they belong.
89726b526288Smrg#
89736b526288Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
89746b526288Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
89756b526288Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
89766b526288Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
89776b526288Smrg# and doesn't know about Autoconf macros at all.)
89786b526288Smrg#
89796b526288Smrg# So we provide this file, which has a silly filename so it's always
89806b526288Smrg# included after everything else.  This provides aclocal with the
89816b526288Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
89826b526288Smrg# because those macros already exist, or will be overwritten later.
89836b526288Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
89846b526288Smrg#
89856b526288Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
89866b526288Smrg# Yes, that means every name once taken will need to remain here until
89876b526288Smrg# we give up compatibility with versions before 1.7, at which point
89886b526288Smrg# we need to keep only those names which we still refer to.
89896b526288Smrg
89906b526288Smrg# This is to help aclocal find these macros, as it can't see m4_define.
89916b526288SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
89926b526288Smrg
89936b526288Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
89946b526288Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
89956b526288Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
89966b526288Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
89976b526288Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
89986b526288Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
89996b526288Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
90006b526288Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
90016b526288Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
90026b526288Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
90036b526288Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
90046b526288Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
90056b526288Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
90066b526288Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
90076b526288Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
90086b526288Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
90096b526288Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
90106b526288Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
90116b526288Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
90126b526288Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
90136b526288Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
90146b526288Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
90156b526288Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
90166b526288Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
90176b526288Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
90186b526288Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
90196b526288Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
90206b526288Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
90216b526288Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
90226b526288Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
90236b526288Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
90246b526288Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
90256b526288Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
90266b526288Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
90276b526288Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
90286b526288Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
90296b526288Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
90306b526288Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
90316b526288Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
90326b526288Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
90336b526288Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
90346b526288Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
90356b526288Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
90366b526288Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
90376b526288Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
90386b526288Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
90396b526288Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
90406b526288Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
90416b526288Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
90426b526288Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
90436b526288Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
90446b526288Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
90456b526288Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
90466b526288Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
90476b526288Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
90486b526288Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
90496b526288Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
90506b526288Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
90516b526288Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
90526b526288Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
90536b526288Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
905441b2f0bdSmrg
90556b526288Smrg# pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
90566b526288Smrg# serial 11 (pkg-config-0.29.1)
905711a29bacSmrg
90586b526288Smrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
90596b526288Smrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
90606b526288Smrgdnl
90616b526288Smrgdnl This program is free software; you can redistribute it and/or modify
90626b526288Smrgdnl it under the terms of the GNU General Public License as published by
90636b526288Smrgdnl the Free Software Foundation; either version 2 of the License, or
90646b526288Smrgdnl (at your option) any later version.
90656b526288Smrgdnl
90666b526288Smrgdnl This program is distributed in the hope that it will be useful, but
90676b526288Smrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of
90686b526288Smrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
90696b526288Smrgdnl General Public License for more details.
90706b526288Smrgdnl
90716b526288Smrgdnl You should have received a copy of the GNU General Public License
90726b526288Smrgdnl along with this program; if not, write to the Free Software
90736b526288Smrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
90746b526288Smrgdnl 02111-1307, USA.
90756b526288Smrgdnl
90766b526288Smrgdnl As a special exception to the GNU General Public License, if you
90776b526288Smrgdnl distribute this file as part of a program that contains a
90786b526288Smrgdnl configuration script generated by Autoconf, you may include it under
90796b526288Smrgdnl the same distribution terms that you use for the rest of that
90806b526288Smrgdnl program.
90816b526288Smrg
90826b526288Smrgdnl PKG_PREREQ(MIN-VERSION)
90836b526288Smrgdnl -----------------------
90846b526288Smrgdnl Since: 0.29
90856b526288Smrgdnl
90866b526288Smrgdnl Verify that the version of the pkg-config macros are at least
90876b526288Smrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
90886b526288Smrgdnl installed version of pkg-config, this checks the developer's version
90896b526288Smrgdnl of pkg.m4 when generating configure.
90906b526288Smrgdnl
90916b526288Smrgdnl To ensure that this macro is defined, also add:
90926b526288Smrgdnl m4_ifndef([PKG_PREREQ],
90936b526288Smrgdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
90946b526288Smrgdnl
90956b526288Smrgdnl See the "Since" comment for each macro you use to see what version
90966b526288Smrgdnl of the macros you require.
90976b526288Smrgm4_defun([PKG_PREREQ],
90986b526288Smrg[m4_define([PKG_MACROS_VERSION], [0.29.1])
90996b526288Smrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
91006b526288Smrg    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
91016b526288Smrg])dnl PKG_PREREQ
91026b526288Smrg
91036b526288Smrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
91046b526288Smrgdnl ----------------------------------
91056b526288Smrgdnl Since: 0.16
91066b526288Smrgdnl
91076b526288Smrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
91086b526288Smrgdnl first found in the path. Checks that the version of pkg-config found
91096b526288Smrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
91106b526288Smrgdnl used since that's the first version where most current features of
91116b526288Smrgdnl pkg-config existed.
91126b526288SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
91136b526288Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
91146b526288Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
91156b526288Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
91166b526288SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
91176b526288SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
91186b526288SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
911911a29bacSmrg
91206b526288Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
91216b526288Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
91226b526288Smrgfi
91236b526288Smrgif test -n "$PKG_CONFIG"; then
91246b526288Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
91256b526288Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
91266b526288Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
91276b526288Smrg		AC_MSG_RESULT([yes])
91286b526288Smrg	else
91296b526288Smrg		AC_MSG_RESULT([no])
91306b526288Smrg		PKG_CONFIG=""
91316b526288Smrg	fi
91326b526288Smrgfi[]dnl
91336b526288Smrg])dnl PKG_PROG_PKG_CONFIG
913411a29bacSmrg
91356b526288Smrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
91366b526288Smrgdnl -------------------------------------------------------------------
91376b526288Smrgdnl Since: 0.18
91386b526288Smrgdnl
91396b526288Smrgdnl Check to see whether a particular set of modules exists. Similar to
91406b526288Smrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
91416b526288Smrgdnl
91426b526288Smrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
91436b526288Smrgdnl only at the first occurence in configure.ac, so if the first place
91446b526288Smrgdnl it's called might be skipped (such as if it is within an "if", you
91456b526288Smrgdnl have to call PKG_CHECK_EXISTS manually
91466b526288SmrgAC_DEFUN([PKG_CHECK_EXISTS],
91476b526288Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
91486b526288Smrgif test -n "$PKG_CONFIG" && \
91496b526288Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
91506b526288Smrg  m4_default([$2], [:])
91516b526288Smrgm4_ifvaln([$3], [else
91526b526288Smrg  $3])dnl
91536b526288Smrgfi])
915411a29bacSmrg
91556b526288Smrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
91566b526288Smrgdnl ---------------------------------------------
91576b526288Smrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
91586b526288Smrgdnl pkg_failed based on the result.
91596b526288Smrgm4_define([_PKG_CONFIG],
91606b526288Smrg[if test -n "$$1"; then
91616b526288Smrg    pkg_cv_[]$1="$$1"
91626b526288Smrg elif test -n "$PKG_CONFIG"; then
91636b526288Smrg    PKG_CHECK_EXISTS([$3],
91646b526288Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
91656b526288Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
91666b526288Smrg		     [pkg_failed=yes])
91676b526288Smrg else
91686b526288Smrg    pkg_failed=untried
91696b526288Smrgfi[]dnl
91706b526288Smrg])dnl _PKG_CONFIG
917141b2f0bdSmrg
91726b526288Smrgdnl _PKG_SHORT_ERRORS_SUPPORTED
91736b526288Smrgdnl ---------------------------
91746b526288Smrgdnl Internal check to see if pkg-config supports short errors.
91756b526288SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
91766b526288Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
91776b526288Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
91786b526288Smrg        _pkg_short_errors_supported=yes
91796b526288Smrgelse
91806b526288Smrg        _pkg_short_errors_supported=no
91816b526288Smrgfi[]dnl
91826b526288Smrg])dnl _PKG_SHORT_ERRORS_SUPPORTED
918341b2f0bdSmrg
918441b2f0bdSmrg
91856b526288Smrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
91866b526288Smrgdnl   [ACTION-IF-NOT-FOUND])
91876b526288Smrgdnl --------------------------------------------------------------
91886b526288Smrgdnl Since: 0.4.0
91896b526288Smrgdnl
91906b526288Smrgdnl Note that if there is a possibility the first call to
91916b526288Smrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
91926b526288Smrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
91936b526288SmrgAC_DEFUN([PKG_CHECK_MODULES],
91946b526288Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
91956b526288SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
91966b526288SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
919741b2f0bdSmrg
91986b526288Smrgpkg_failed=no
91996b526288SmrgAC_MSG_CHECKING([for $1])
920041b2f0bdSmrg
92016b526288Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
92026b526288Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
920341b2f0bdSmrg
92046b526288Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
92056b526288Smrgand $1[]_LIBS to avoid the need to call pkg-config.
92066b526288SmrgSee the pkg-config man page for more details.])
920741b2f0bdSmrg
92086b526288Smrgif test $pkg_failed = yes; then
92096b526288Smrg   	AC_MSG_RESULT([no])
92106b526288Smrg        _PKG_SHORT_ERRORS_SUPPORTED
92116b526288Smrg        if test $_pkg_short_errors_supported = yes; then
92126b526288Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
92136b526288Smrg        else 
92146b526288Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
92156b526288Smrg        fi
92166b526288Smrg	# Put the nasty error message in config.log where it belongs
92176b526288Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
921811a29bacSmrg
92196b526288Smrg	m4_default([$4], [AC_MSG_ERROR(
92206b526288Smrg[Package requirements ($2) were not met:
922111a29bacSmrg
92226b526288Smrg$$1_PKG_ERRORS
922311a29bacSmrg
92246b526288SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
92256b526288Smrginstalled software in a non-standard prefix.
922611a29bacSmrg
92276b526288Smrg_PKG_TEXT])[]dnl
92286b526288Smrg        ])
92296b526288Smrgelif test $pkg_failed = untried; then
92306b526288Smrg     	AC_MSG_RESULT([no])
92316b526288Smrg	m4_default([$4], [AC_MSG_FAILURE(
92326b526288Smrg[The pkg-config script could not be found or is too old.  Make sure it
92336b526288Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
92346b526288Smrgpath to pkg-config.
923511a29bacSmrg
92366b526288Smrg_PKG_TEXT
923711a29bacSmrg
92386b526288SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
92396b526288Smrg        ])
924011a29bacSmrgelse
92416b526288Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
92426b526288Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
92436b526288Smrg        AC_MSG_RESULT([yes])
92446b526288Smrg	$3
92456b526288Smrgfi[]dnl
92466b526288Smrg])dnl PKG_CHECK_MODULES
924711a29bacSmrg
924811a29bacSmrg
92496b526288Smrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
92506b526288Smrgdnl   [ACTION-IF-NOT-FOUND])
92516b526288Smrgdnl ---------------------------------------------------------------------
92526b526288Smrgdnl Since: 0.29
92536b526288Smrgdnl
92546b526288Smrgdnl Checks for existence of MODULES and gathers its build flags with
92556b526288Smrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
92566b526288Smrgdnl and VARIABLE-PREFIX_LIBS from --libs.
92576b526288Smrgdnl
92586b526288Smrgdnl Note that if there is a possibility the first call to
92596b526288Smrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
92606b526288Smrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
92616b526288Smrgdnl configure.ac.
92626b526288SmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC],
92636b526288Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
92646b526288Smrg_save_PKG_CONFIG=$PKG_CONFIG
92656b526288SmrgPKG_CONFIG="$PKG_CONFIG --static"
92666b526288SmrgPKG_CHECK_MODULES($@)
92676b526288SmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl
92686b526288Smrg])dnl PKG_CHECK_MODULES_STATIC
926911a29bacSmrg
927011a29bacSmrg
92716b526288Smrgdnl PKG_INSTALLDIR([DIRECTORY])
92726b526288Smrgdnl -------------------------
92736b526288Smrgdnl Since: 0.27
92746b526288Smrgdnl
92756b526288Smrgdnl Substitutes the variable pkgconfigdir as the location where a module
92766b526288Smrgdnl should install pkg-config .pc files. By default the directory is
92776b526288Smrgdnl $libdir/pkgconfig, but the default can be changed by passing
92786b526288Smrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir
92796b526288Smrgdnl parameter.
92806b526288SmrgAC_DEFUN([PKG_INSTALLDIR],
92816b526288Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
92826b526288Smrgm4_pushdef([pkg_description],
92836b526288Smrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
92846b526288SmrgAC_ARG_WITH([pkgconfigdir],
92856b526288Smrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
92866b526288Smrg    [with_pkgconfigdir=]pkg_default)
92876b526288SmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
92886b526288Smrgm4_popdef([pkg_default])
92896b526288Smrgm4_popdef([pkg_description])
92906b526288Smrg])dnl PKG_INSTALLDIR
92916b526288Smrg
92926b526288Smrg
92936b526288Smrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
92946b526288Smrgdnl --------------------------------
92956b526288Smrgdnl Since: 0.27
92966b526288Smrgdnl
92976b526288Smrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a
92986b526288Smrgdnl module should install arch-independent pkg-config .pc files. By
92996b526288Smrgdnl default the directory is $datadir/pkgconfig, but the default can be
93006b526288Smrgdnl changed by passing DIRECTORY. The user can override through the
93016b526288Smrgdnl --with-noarch-pkgconfigdir parameter.
93026b526288SmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
93036b526288Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
93046b526288Smrgm4_pushdef([pkg_description],
93056b526288Smrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
93066b526288SmrgAC_ARG_WITH([noarch-pkgconfigdir],
93076b526288Smrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
93086b526288Smrg    [with_noarch_pkgconfigdir=]pkg_default)
93096b526288SmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
93106b526288Smrgm4_popdef([pkg_default])
93116b526288Smrgm4_popdef([pkg_description])
93126b526288Smrg])dnl PKG_NOARCH_INSTALLDIR
93136b526288Smrg
93146b526288Smrg
93156b526288Smrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
93166b526288Smrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
93176b526288Smrgdnl -------------------------------------------
93186b526288Smrgdnl Since: 0.28
93196b526288Smrgdnl
93206b526288Smrgdnl Retrieves the value of the pkg-config variable for the given module.
93216b526288SmrgAC_DEFUN([PKG_CHECK_VAR],
93226b526288Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
93236b526288SmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
932411a29bacSmrg
93256b526288Smrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
93266b526288SmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
932711a29bacSmrg
93286b526288SmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
93296b526288Smrg])dnl PKG_CHECK_VAR
93306b526288Smrg
93316b526288Smrgdnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
93326b526288Smrgdnl   [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
93336b526288Smrgdnl   [DESCRIPTION], [DEFAULT])
93346b526288Smrgdnl ------------------------------------------
93356b526288Smrgdnl
93366b526288Smrgdnl Prepare a "--with-" configure option using the lowercase
93376b526288Smrgdnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
93386b526288Smrgdnl PKG_CHECK_MODULES in a single macro.
93396b526288SmrgAC_DEFUN([PKG_WITH_MODULES],
93406b526288Smrg[
93416b526288Smrgm4_pushdef([with_arg], m4_tolower([$1]))
934241b2f0bdSmrg
93436b526288Smrgm4_pushdef([description],
93446b526288Smrg           [m4_default([$5], [build with ]with_arg[ support])])
934541b2f0bdSmrg
93466b526288Smrgm4_pushdef([def_arg], [m4_default([$6], [auto])])
93476b526288Smrgm4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
93486b526288Smrgm4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
934911a29bacSmrg
93506b526288Smrgm4_case(def_arg,
93516b526288Smrg            [yes],[m4_pushdef([with_without], [--without-]with_arg)],
93526b526288Smrg            [m4_pushdef([with_without],[--with-]with_arg)])
935311a29bacSmrg
93546b526288SmrgAC_ARG_WITH(with_arg,
93556b526288Smrg     AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
93566b526288Smrg    [AS_TR_SH([with_]with_arg)=def_arg])
935741b2f0bdSmrg
93586b526288SmrgAS_CASE([$AS_TR_SH([with_]with_arg)],
93596b526288Smrg            [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
93606b526288Smrg            [auto],[PKG_CHECK_MODULES([$1],[$2],
93616b526288Smrg                                        [m4_n([def_action_if_found]) $3],
93626b526288Smrg                                        [m4_n([def_action_if_not_found]) $4])])
936341b2f0bdSmrg
93646b526288Smrgm4_popdef([with_arg])
93656b526288Smrgm4_popdef([description])
93666b526288Smrgm4_popdef([def_arg])
936711245024Smrg
93686b526288Smrg])dnl PKG_WITH_MODULES
936911a29bacSmrg
93706b526288Smrgdnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
93716b526288Smrgdnl   [DESCRIPTION], [DEFAULT])
93726b526288Smrgdnl -----------------------------------------------
93736b526288Smrgdnl
93746b526288Smrgdnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
93756b526288Smrgdnl check._[VARIABLE-PREFIX] is exported as make variable.
93766b526288SmrgAC_DEFUN([PKG_HAVE_WITH_MODULES],
93776b526288Smrg[
93786b526288SmrgPKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
937911245024Smrg
93806b526288SmrgAM_CONDITIONAL([HAVE_][$1],
93816b526288Smrg               [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
93826b526288Smrg])dnl PKG_HAVE_WITH_MODULES
938341b2f0bdSmrg
93846b526288Smrgdnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
93856b526288Smrgdnl   [DESCRIPTION], [DEFAULT])
93866b526288Smrgdnl ------------------------------------------------------
93876b526288Smrgdnl
93886b526288Smrgdnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
93896b526288Smrgdnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
93906b526288Smrgdnl and preprocessor variable.
93916b526288SmrgAC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
93926b526288Smrg[
93936b526288SmrgPKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
939411245024Smrg
93956b526288SmrgAS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
93966b526288Smrg        [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
93976b526288Smrg])dnl PKG_HAVE_DEFINE_WITH_MODULES
939841b2f0bdSmrg
93996b526288Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
94006b526288Smrgdnl
94016b526288Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
94026b526288Smrgdnl
94036b526288Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
94046b526288Smrgdnl copy of this software and associated documentation files (the "Software"),
94056b526288Smrgdnl to deal in the Software without restriction, including without limitation
94066b526288Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
94076b526288Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
94086b526288Smrgdnl Software is furnished to do so, subject to the following conditions:
94096b526288Smrgdnl
94106b526288Smrgdnl The above copyright notice and this permission notice (including the next
94116b526288Smrgdnl paragraph) shall be included in all copies or substantial portions of the
94126b526288Smrgdnl Software.
94136b526288Smrgdnl
94146b526288Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
94156b526288Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
94166b526288Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
94176b526288Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
94186b526288Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
94196b526288Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
94206b526288Smrgdnl DEALINGS IN THE SOFTWARE.
942141b2f0bdSmrg
94226b526288Smrg# XORG_MACROS_VERSION(required-version)
94236b526288Smrg# -------------------------------------
94246b526288Smrg# Minimum version: 1.1.0
94256b526288Smrg#
94266b526288Smrg# If you're using a macro added in Version 1.1 or newer, include this in
94276b526288Smrg# your configure.ac with the minimum required version, such as:
94286b526288Smrg# XORG_MACROS_VERSION(1.1)
94296b526288Smrg#
94306b526288Smrg# To ensure that this macro is defined, also add:
94316b526288Smrg# m4_ifndef([XORG_MACROS_VERSION],
94326b526288Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
94336b526288Smrg#
94346b526288Smrg#
94356b526288Smrg# See the "minimum version" comment for each macro you use to see what
94366b526288Smrg# version you require.
94376b526288Smrgm4_defun([XORG_MACROS_VERSION],[
94386b526288Smrgm4_define([vers_have], [1.19.0])
94396b526288Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
94406b526288Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
94416b526288Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
94426b526288Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
94436b526288Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
94446b526288Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
94456b526288Smrgm4_undefine([vers_have])
94466b526288Smrgm4_undefine([maj_have])
94476b526288Smrgm4_undefine([maj_needed])
94486b526288Smrg]) # XORG_MACROS_VERSION
944941b2f0bdSmrg
94506b526288Smrg# XORG_PROG_RAWCPP()
94516b526288Smrg# ------------------
94526b526288Smrg# Minimum version: 1.0.0
94536b526288Smrg#
94546b526288Smrg# Find cpp program and necessary flags for use in pre-processing text files
94556b526288Smrg# such as man pages and config files
94566b526288SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
94576b526288SmrgAC_REQUIRE([AC_PROG_CPP])
94586b526288SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
94596b526288Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
94606b526288Smrg
94616b526288Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
94626b526288Smrg# which is not the best choice for supporting other OS'es, but covers most
94636b526288Smrg# of the ones we need for now.
94646b526288SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
94656b526288SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
94666b526288Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
94676b526288Smrg	AC_MSG_RESULT([no])
94686b526288Smrgelse
94696b526288Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
94706b526288Smrg		RAWCPPFLAGS=-undef
94716b526288Smrg		AC_MSG_RESULT([yes])
94726b526288Smrg	# under Cygwin unix is still defined even with -undef
94736b526288Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
94746b526288Smrg		RAWCPPFLAGS="-undef -ansi"
94756b526288Smrg		AC_MSG_RESULT([yes, with -ansi])
94766b526288Smrg	else
94776b526288Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
947811a29bacSmrg	fi
94796b526288Smrgfi
94806b526288Smrgrm -f conftest.$ac_ext
948111a29bacSmrg
94826b526288SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
94836b526288SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
94846b526288Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
94856b526288Smrg	AC_MSG_RESULT([no])
94866b526288Smrgelse
94876b526288Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
94886b526288Smrg		TRADITIONALCPPFLAGS="-traditional"
94896b526288Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
94906b526288Smrg		AC_MSG_RESULT([yes])
94916b526288Smrg	else
94926b526288Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
94936b526288Smrg	fi
94946b526288Smrgfi
94956b526288Smrgrm -f conftest.$ac_ext
94966b526288SmrgAC_SUBST(RAWCPPFLAGS)
94976b526288SmrgAC_SUBST(TRADITIONALCPPFLAGS)
94986b526288Smrg]) # XORG_PROG_RAWCPP
949911a29bacSmrg
95006b526288Smrg# XORG_MANPAGE_SECTIONS()
95016b526288Smrg# -----------------------
95026b526288Smrg# Minimum version: 1.0.0
95036b526288Smrg#
95046b526288Smrg# Determine which sections man pages go in for the different man page types
95056b526288Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
95066b526288Smrg# Not sure if there's any better way than just hardcoding by OS name.
95076b526288Smrg# Override default settings by setting environment variables
95086b526288Smrg# Added MAN_SUBSTS in version 1.8
95096b526288Smrg# Added AC_PROG_SED in version 1.8
951011a29bacSmrg
95116b526288SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
95126b526288SmrgAC_REQUIRE([AC_CANONICAL_HOST])
95136b526288SmrgAC_REQUIRE([AC_PROG_SED])
951411a29bacSmrg
95156b526288Smrgif test x$APP_MAN_SUFFIX = x    ; then
95166b526288Smrg    APP_MAN_SUFFIX=1
95176b526288Smrgfi
95186b526288Smrgif test x$APP_MAN_DIR = x    ; then
95196b526288Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
95206b526288Smrgfi
95216b526288Smrg
95226b526288Smrgif test x$LIB_MAN_SUFFIX = x    ; then
95236b526288Smrg    LIB_MAN_SUFFIX=3
95246b526288Smrgfi
95256b526288Smrgif test x$LIB_MAN_DIR = x    ; then
95266b526288Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
95276b526288Smrgfi
95286b526288Smrg
95296b526288Smrgif test x$FILE_MAN_SUFFIX = x    ; then
95306b526288Smrg    case $host_os in
95316b526288Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
95326b526288Smrg	*)		FILE_MAN_SUFFIX=5  ;;
95336b526288Smrg    esac
95346b526288Smrgfi
95356b526288Smrgif test x$FILE_MAN_DIR = x    ; then
95366b526288Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
95376b526288Smrgfi
95386b526288Smrg
95396b526288Smrgif test x$MISC_MAN_SUFFIX = x    ; then
95406b526288Smrg    case $host_os in
95416b526288Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
95426b526288Smrg	*)		MISC_MAN_SUFFIX=7  ;;
95436b526288Smrg    esac
95446b526288Smrgfi
95456b526288Smrgif test x$MISC_MAN_DIR = x    ; then
95466b526288Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
95476b526288Smrgfi
954811a29bacSmrg
95496b526288Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
95506b526288Smrg    case $host_os in
95516b526288Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
95526b526288Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
95536b526288Smrg    esac
95546b526288Smrgfi
95556b526288Smrgif test x$DRIVER_MAN_DIR = x    ; then
95566b526288Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
95576b526288Smrgfi
955841b2f0bdSmrg
95596b526288Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
95606b526288Smrg    case $host_os in
95616b526288Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
95626b526288Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
95636b526288Smrg    esac
95646b526288Smrgfi
95656b526288Smrgif test x$ADMIN_MAN_DIR = x    ; then
95666b526288Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
95676b526288Smrgfi
956841b2f0bdSmrg
956941b2f0bdSmrg
95706b526288SmrgAC_SUBST([APP_MAN_SUFFIX])
95716b526288SmrgAC_SUBST([LIB_MAN_SUFFIX])
95726b526288SmrgAC_SUBST([FILE_MAN_SUFFIX])
95736b526288SmrgAC_SUBST([MISC_MAN_SUFFIX])
95746b526288SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
95756b526288SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
95766b526288SmrgAC_SUBST([APP_MAN_DIR])
95776b526288SmrgAC_SUBST([LIB_MAN_DIR])
95786b526288SmrgAC_SUBST([FILE_MAN_DIR])
95796b526288SmrgAC_SUBST([MISC_MAN_DIR])
95806b526288SmrgAC_SUBST([DRIVER_MAN_DIR])
95816b526288SmrgAC_SUBST([ADMIN_MAN_DIR])
958211a29bacSmrg
95836b526288SmrgXORG_MAN_PAGE="X Version 11"
95846b526288SmrgAC_SUBST([XORG_MAN_PAGE])
95856b526288SmrgMAN_SUBSTS="\
95866b526288Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
95876b526288Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
95886b526288Smrg	-e 's|__xservername__|Xorg|g' \
95896b526288Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
95906b526288Smrg	-e 's|__projectroot__|\$(prefix)|g' \
95916b526288Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
95926b526288Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
95936b526288Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
95946b526288Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
95956b526288Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
95966b526288Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
95976b526288Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
95986b526288SmrgAC_SUBST([MAN_SUBSTS])
959941b2f0bdSmrg
96006b526288Smrg]) # XORG_MANPAGE_SECTIONS
960111a29bacSmrg
96026b526288Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
96036b526288Smrg# ------------------------
96046b526288Smrg# Minimum version: 1.7.0
96056b526288Smrg#
96066b526288Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
96076b526288Smrg# provided by xorg-sgml-doctools, if installed.
96086b526288SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
96096b526288SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
96106b526288SmrgXORG_SGML_PATH=
96116b526288SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
96126b526288Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
96136b526288Smrg    [m4_ifval([$1],[:],
96146b526288Smrg        [if test x"$cross_compiling" != x"yes" ; then
96156b526288Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
96166b526288Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
96176b526288Smrg         fi])
96186b526288Smrg    ])
961911a29bacSmrg
96206b526288Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
96216b526288Smrg# the path and the name of the doc stylesheet
96226b526288Smrgif test "x$XORG_SGML_PATH" != "x" ; then
96236b526288Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
96246b526288Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
96256b526288Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
96266b526288Smrgelse
96276b526288Smrg   AC_MSG_RESULT([no])
96286b526288Smrgfi
962911a29bacSmrg
96306b526288SmrgAC_SUBST(XORG_SGML_PATH)
96316b526288SmrgAC_SUBST(STYLESHEET_SRCDIR)
96326b526288SmrgAC_SUBST(XSL_STYLESHEET)
96336b526288SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
96346b526288Smrg]) # XORG_CHECK_SGML_DOCTOOLS
963541b2f0bdSmrg
96366b526288Smrg# XORG_CHECK_LINUXDOC
96376b526288Smrg# -------------------
96386b526288Smrg# Minimum version: 1.0.0
96396b526288Smrg#
96406b526288Smrg# Defines the variable MAKE_TEXT if the necessary tools and
96416b526288Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
96426b526288Smrg# Whether or not the necessary tools and files are found can be checked
96436b526288Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
96446b526288SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
96456b526288SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
96466b526288SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
964741b2f0bdSmrg
96486b526288SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
964911245024Smrg
96506b526288SmrgAC_MSG_CHECKING([whether to build documentation])
965111a29bacSmrg
96526b526288Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
96536b526288Smrg   BUILDDOC=yes
96546b526288Smrgelse
96556b526288Smrg   BUILDDOC=no
96566b526288Smrgfi
965711a29bacSmrg
96586b526288SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
965911a29bacSmrg
96606b526288SmrgAC_MSG_RESULT([$BUILDDOC])
966111a29bacSmrg
96626b526288SmrgAC_MSG_CHECKING([whether to build pdf documentation])
966311a29bacSmrg
96646b526288Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
96656b526288Smrg   BUILDPDFDOC=yes
96666b526288Smrgelse
96676b526288Smrg   BUILDPDFDOC=no
96686b526288Smrgfi
966911a29bacSmrg
96706b526288SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
967111a29bacSmrg
96726b526288SmrgAC_MSG_RESULT([$BUILDPDFDOC])
967311a29bacSmrg
96746b526288SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
96756b526288SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
96766b526288SmrgMAKE_PDF="$PS2PDF"
96776b526288SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
967811a29bacSmrg
96796b526288SmrgAC_SUBST(MAKE_TEXT)
96806b526288SmrgAC_SUBST(MAKE_PS)
96816b526288SmrgAC_SUBST(MAKE_PDF)
96826b526288SmrgAC_SUBST(MAKE_HTML)
96836b526288Smrg]) # XORG_CHECK_LINUXDOC
968411a29bacSmrg
96856b526288Smrg# XORG_CHECK_DOCBOOK
96866b526288Smrg# -------------------
96876b526288Smrg# Minimum version: 1.0.0
96886b526288Smrg#
96896b526288Smrg# Checks for the ability to build output formats from SGML DocBook source.
96906b526288Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
96916b526288Smrg# indicates whether the necessary tools and files are found and, if set,
96926b526288Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
96936b526288SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
96946b526288SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
969541b2f0bdSmrg
96966b526288SmrgBUILDTXTDOC=no
96976b526288SmrgBUILDPDFDOC=no
96986b526288SmrgBUILDPSDOC=no
96996b526288SmrgBUILDHTMLDOC=no
970041b2f0bdSmrg
97016b526288SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
97026b526288SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
97036b526288SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
97046b526288SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
970541b2f0bdSmrg
97066b526288SmrgAC_MSG_CHECKING([whether to build text documentation])
97076b526288Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
97086b526288Smrg   test x$BUILD_TXTDOC != xno; then
97096b526288Smrg	BUILDTXTDOC=yes
97106b526288Smrgfi
97116b526288SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
97126b526288SmrgAC_MSG_RESULT([$BUILDTXTDOC])
971341b2f0bdSmrg
97146b526288SmrgAC_MSG_CHECKING([whether to build PDF documentation])
97156b526288Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
97166b526288Smrg   test x$BUILD_PDFDOC != xno; then
97176b526288Smrg	BUILDPDFDOC=yes
97186b526288Smrgfi
97196b526288SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
97206b526288SmrgAC_MSG_RESULT([$BUILDPDFDOC])
972141b2f0bdSmrg
97226b526288SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
97236b526288Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
97246b526288Smrg   test x$BUILD_PSDOC != xno; then
97256b526288Smrg	BUILDPSDOC=yes
97266b526288Smrgfi
97276b526288SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
97286b526288SmrgAC_MSG_RESULT([$BUILDPSDOC])
972941b2f0bdSmrg
97306b526288SmrgAC_MSG_CHECKING([whether to build HTML documentation])
97316b526288Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
97326b526288Smrg   test x$BUILD_HTMLDOC != xno; then
97336b526288Smrg	BUILDHTMLDOC=yes
97346b526288Smrgfi
97356b526288SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
97366b526288SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
973741b2f0bdSmrg
97386b526288SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
97396b526288SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
97406b526288SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
97416b526288SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
974241b2f0bdSmrg
97436b526288SmrgAC_SUBST(MAKE_TEXT)
97446b526288SmrgAC_SUBST(MAKE_PS)
97456b526288SmrgAC_SUBST(MAKE_PDF)
97466b526288SmrgAC_SUBST(MAKE_HTML)
97476b526288Smrg]) # XORG_CHECK_DOCBOOK
974841b2f0bdSmrg
97496b526288Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
97506b526288Smrg# ----------------
97516b526288Smrg# Minimum version: 1.5.0
97526b526288Smrg# Minimum version for optional DEFAULT argument: 1.11.0
97536b526288Smrg#
97546b526288Smrg# Documentation tools are not always available on all platforms and sometimes
97556b526288Smrg# not at the appropriate level. This macro enables a module to test for the
97566b526288Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
97576b526288Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
97586b526288Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
97596b526288Smrg# --with-xmlto assumes 'auto'.
97606b526288Smrg#
97616b526288Smrg# Interface to module:
97626b526288Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
97636b526288Smrg# XMLTO:	returns the path of the xmlto program found
97646b526288Smrg#		returns the path set by the user in the environment
97656b526288Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
97666b526288Smrg#		'no' user instructs the module not to use xmlto
97676b526288Smrg#
97686b526288Smrg# Added in version 1.10.0
97696b526288Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
97706b526288Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
97716b526288Smrg#
97726b526288Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
97736b526288Smrg#
97746b526288SmrgAC_DEFUN([XORG_WITH_XMLTO],[
97756b526288SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
97766b526288Smrgm4_define([_defopt], m4_default([$2], [auto]))
97776b526288SmrgAC_ARG_WITH(xmlto,
97786b526288Smrg	AS_HELP_STRING([--with-xmlto],
97796b526288Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
97806b526288Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
97816b526288Smrgm4_undefine([_defopt])
978241b2f0bdSmrg
97836b526288Smrgif test "x$use_xmlto" = x"auto"; then
97846b526288Smrg   AC_PATH_PROG([XMLTO], [xmlto])
97856b526288Smrg   if test "x$XMLTO" = "x"; then
97866b526288Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
97876b526288Smrg	have_xmlto=no
97886b526288Smrg   else
97896b526288Smrg        have_xmlto=yes
97906b526288Smrg   fi
97916b526288Smrgelif test "x$use_xmlto" = x"yes" ; then
97926b526288Smrg   AC_PATH_PROG([XMLTO], [xmlto])
97936b526288Smrg   if test "x$XMLTO" = "x"; then
97946b526288Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
97956b526288Smrg   fi
97966b526288Smrg   have_xmlto=yes
97976b526288Smrgelif test "x$use_xmlto" = x"no" ; then
97986b526288Smrg   if test "x$XMLTO" != "x"; then
97996b526288Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
98006b526288Smrg   fi
98016b526288Smrg   have_xmlto=no
98026b526288Smrgelse
98036b526288Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
98046b526288Smrgfi
980511a29bacSmrg
98066b526288Smrg# Test for a minimum version of xmlto, if provided.
98076b526288Smrgm4_ifval([$1],
98086b526288Smrg[if test "$have_xmlto" = yes; then
98096b526288Smrg    # scrape the xmlto version
98106b526288Smrg    AC_MSG_CHECKING([the xmlto version])
98116b526288Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
98126b526288Smrg    AC_MSG_RESULT([$xmlto_version])
98136b526288Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
98146b526288Smrg        [if test "x$use_xmlto" = xauto; then
98156b526288Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
98166b526288Smrg            have_xmlto=no
98176b526288Smrg        else
98186b526288Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
98196b526288Smrg        fi])
98206b526288Smrgfi])
982111a29bacSmrg
98226b526288Smrg# Test for the ability of xmlto to generate a text target
98236b526288Smrghave_xmlto_text=no
98246b526288Smrgcat > conftest.xml << "EOF"
98256b526288SmrgEOF
98266b526288SmrgAS_IF([test "$have_xmlto" = yes],
98276b526288Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
98286b526288Smrg             [have_xmlto_text=yes],
98296b526288Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
98306b526288Smrgrm -f conftest.xml
98316b526288SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
98326b526288SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
98336b526288Smrg]) # XORG_WITH_XMLTO
983411a29bacSmrg
98356b526288Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
98366b526288Smrg# --------------------------------------------
98376b526288Smrg# Minimum version: 1.12.0
98386b526288Smrg# Minimum version for optional DEFAULT argument: 1.12.0
98396b526288Smrg#
98406b526288Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
98416b526288Smrg# XML-based language used for the transformation of XML documents.
98426b526288Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
98436b526288Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
98446b526288Smrg# The XSLT processor is often used as a standalone tool for transformations.
98456b526288Smrg# It should not be assumed that this tool is used only to work with documnetation.
98466b526288Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
98476b526288Smrg#
98486b526288Smrg# Interface to module:
98496b526288Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
98506b526288Smrg# XSLTPROC:	 returns the path of the xsltproc program found
98516b526288Smrg#		 returns the path set by the user in the environment
98526b526288Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
98536b526288Smrg#		  'no' user instructs the module not to use xsltproc
98546b526288Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
98556b526288Smrg#
98566b526288Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
98576b526288Smrg#
98586b526288SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
98596b526288SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
98606b526288Smrg# Preserves the interface, should it be implemented later
98616b526288Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
98626b526288Smrgm4_define([_defopt], m4_default([$2], [auto]))
98636b526288SmrgAC_ARG_WITH(xsltproc,
98646b526288Smrg	AS_HELP_STRING([--with-xsltproc],
98656b526288Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
98666b526288Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
98676b526288Smrgm4_undefine([_defopt])
986811a29bacSmrg
98696b526288Smrgif test "x$use_xsltproc" = x"auto"; then
98706b526288Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
98716b526288Smrg   if test "x$XSLTPROC" = "x"; then
98726b526288Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
98736b526288Smrg	have_xsltproc=no
98746b526288Smrg   else
98756b526288Smrg        have_xsltproc=yes
98766b526288Smrg   fi
98776b526288Smrgelif test "x$use_xsltproc" = x"yes" ; then
98786b526288Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
98796b526288Smrg   if test "x$XSLTPROC" = "x"; then
98806b526288Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
98816b526288Smrg   fi
98826b526288Smrg   have_xsltproc=yes
98836b526288Smrgelif test "x$use_xsltproc" = x"no" ; then
98846b526288Smrg   if test "x$XSLTPROC" != "x"; then
98856b526288Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
98866b526288Smrg   fi
98876b526288Smrg   have_xsltproc=no
98886b526288Smrgelse
98896b526288Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
989011a29bacSmrgfi
989111a29bacSmrg
98926b526288SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
98936b526288Smrg]) # XORG_WITH_XSLTPROC
989411a29bacSmrg
98956b526288Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
98966b526288Smrg# ----------------------------------------
98976b526288Smrg# Minimum version: 1.15.0
98986b526288Smrg#
98996b526288Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
99006b526288Smrg# scanning arbitrary text files, extracting information from those text files,
99016b526288Smrg# and printing reports based on that information.
99026b526288Smrg#
99036b526288Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
99046b526288Smrg#
99056b526288Smrg# Interface to module:
99066b526288Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
99076b526288Smrg# PERL:	     returns the path of the perl program found
99086b526288Smrg#	     returns the path set by the user in the environment
99096b526288Smrg# --with-perl: 'yes' user instructs the module to use perl
99106b526288Smrg#	       'no' user instructs the module not to use perl
99116b526288Smrg# have_perl: returns yes if perl found in PATH or no
99126b526288Smrg#
99136b526288Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
99146b526288Smrg#
99156b526288SmrgAC_DEFUN([XORG_WITH_PERL],[
99166b526288SmrgAC_ARG_VAR([PERL], [Path to perl command])
99176b526288Smrg# Preserves the interface, should it be implemented later
99186b526288Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
99196b526288Smrgm4_define([_defopt], m4_default([$2], [auto]))
99206b526288SmrgAC_ARG_WITH(perl,
99216b526288Smrg	AS_HELP_STRING([--with-perl],
99226b526288Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
99236b526288Smrg	   [use_perl=$withval], [use_perl=]_defopt)
99246b526288Smrgm4_undefine([_defopt])
992541b2f0bdSmrg
99266b526288Smrgif test "x$use_perl" = x"auto"; then
99276b526288Smrg   AC_PATH_PROG([PERL], [perl])
99286b526288Smrg   if test "x$PERL" = "x"; then
99296b526288Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
99306b526288Smrg	have_perl=no
99316b526288Smrg   else
99326b526288Smrg        have_perl=yes
99336b526288Smrg   fi
99346b526288Smrgelif test "x$use_perl" = x"yes" ; then
99356b526288Smrg   AC_PATH_PROG([PERL], [perl])
99366b526288Smrg   if test "x$PERL" = "x"; then
99376b526288Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
99386b526288Smrg   fi
99396b526288Smrg   have_perl=yes
99406b526288Smrgelif test "x$use_perl" = x"no" ; then
99416b526288Smrg   if test "x$PERL" != "x"; then
99426b526288Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
99436b526288Smrg   fi
99446b526288Smrg   have_perl=no
99456b526288Smrgelse
99466b526288Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
99476b526288Smrgfi
994841b2f0bdSmrg
99496b526288SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
99506b526288Smrg]) # XORG_WITH_PERL
995141b2f0bdSmrg
99526b526288Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
99536b526288Smrg# ----------------
99546b526288Smrg# Minimum version: 1.5.0
99556b526288Smrg# Minimum version for optional DEFAULT argument: 1.11.0
99566b526288Smrg#
99576b526288Smrg# Documentation tools are not always available on all platforms and sometimes
99586b526288Smrg# not at the appropriate level. This macro enables a module to test for the
99596b526288Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
99606b526288Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
99616b526288Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
99626b526288Smrg# --with-asciidoc assumes 'auto'.
99636b526288Smrg#
99646b526288Smrg# Interface to module:
99656b526288Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
99666b526288Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
99676b526288Smrg#		 returns the path set by the user in the environment
99686b526288Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
99696b526288Smrg#		  'no' user instructs the module not to use asciidoc
99706b526288Smrg#
99716b526288Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
99726b526288Smrg#
99736b526288SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
99746b526288SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
99756b526288Smrgm4_define([_defopt], m4_default([$2], [auto]))
99766b526288SmrgAC_ARG_WITH(asciidoc,
99776b526288Smrg	AS_HELP_STRING([--with-asciidoc],
99786b526288Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
99796b526288Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
99806b526288Smrgm4_undefine([_defopt])
998141b2f0bdSmrg
99826b526288Smrgif test "x$use_asciidoc" = x"auto"; then
99836b526288Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
99846b526288Smrg   if test "x$ASCIIDOC" = "x"; then
99856b526288Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
99866b526288Smrg	have_asciidoc=no
99876b526288Smrg   else
99886b526288Smrg        have_asciidoc=yes
99896b526288Smrg   fi
99906b526288Smrgelif test "x$use_asciidoc" = x"yes" ; then
99916b526288Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
99926b526288Smrg   if test "x$ASCIIDOC" = "x"; then
99936b526288Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
99946b526288Smrg   fi
99956b526288Smrg   have_asciidoc=yes
99966b526288Smrgelif test "x$use_asciidoc" = x"no" ; then
99976b526288Smrg   if test "x$ASCIIDOC" != "x"; then
99986b526288Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
99996b526288Smrg   fi
100006b526288Smrg   have_asciidoc=no
100016b526288Smrgelse
100026b526288Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
100036b526288Smrgfi
100046b526288Smrgm4_ifval([$1],
100056b526288Smrg[if test "$have_asciidoc" = yes; then
100066b526288Smrg    # scrape the asciidoc version
100076b526288Smrg    AC_MSG_CHECKING([the asciidoc version])
100086b526288Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
100096b526288Smrg    AC_MSG_RESULT([$asciidoc_version])
100106b526288Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
100116b526288Smrg        [if test "x$use_asciidoc" = xauto; then
100126b526288Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
100136b526288Smrg            have_asciidoc=no
100146b526288Smrg        else
100156b526288Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
100166b526288Smrg        fi])
100176b526288Smrgfi])
100186b526288SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
100196b526288Smrg]) # XORG_WITH_ASCIIDOC
1002041b2f0bdSmrg
100216b526288Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
100226b526288Smrg# -------------------------------------------
100236b526288Smrg# Minimum version: 1.5.0
100246b526288Smrg# Minimum version for optional DEFAULT argument: 1.11.0
100256b526288Smrg# Minimum version for optional DOT checking: 1.18.0
100266b526288Smrg#
100276b526288Smrg# Documentation tools are not always available on all platforms and sometimes
100286b526288Smrg# not at the appropriate level. This macro enables a module to test for the
100296b526288Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
100306b526288Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
100316b526288Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
100326b526288Smrg# --with-doxygen assumes 'auto'.
100336b526288Smrg#
100346b526288Smrg# Interface to module:
100356b526288Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
100366b526288Smrg# DOXYGEN:	 returns the path of the doxygen program found
100376b526288Smrg#		 returns the path set by the user in the environment
100386b526288Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
100396b526288Smrg#		  'no' user instructs the module not to use doxygen
100406b526288Smrg#
100416b526288Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
100426b526288Smrg#
100436b526288SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
100446b526288SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
100456b526288SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
100466b526288Smrgm4_define([_defopt], m4_default([$2], [auto]))
100476b526288SmrgAC_ARG_WITH(doxygen,
100486b526288Smrg	AS_HELP_STRING([--with-doxygen],
100496b526288Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
100506b526288Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
100516b526288Smrgm4_undefine([_defopt])
1005241b2f0bdSmrg
100536b526288Smrgif test "x$use_doxygen" = x"auto"; then
100546b526288Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
100556b526288Smrg   if test "x$DOXYGEN" = "x"; then
100566b526288Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
100576b526288Smrg	have_doxygen=no
100586b526288Smrg   else
100596b526288Smrg        have_doxygen=yes
100606b526288Smrg   fi
100616b526288Smrgelif test "x$use_doxygen" = x"yes" ; then
100626b526288Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
100636b526288Smrg   if test "x$DOXYGEN" = "x"; then
100646b526288Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
100656b526288Smrg   fi
100666b526288Smrg   have_doxygen=yes
100676b526288Smrgelif test "x$use_doxygen" = x"no" ; then
100686b526288Smrg   if test "x$DOXYGEN" != "x"; then
100696b526288Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
100706b526288Smrg   fi
100716b526288Smrg   have_doxygen=no
100726b526288Smrgelse
100736b526288Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
100746b526288Smrgfi
100756b526288Smrgm4_ifval([$1],
100766b526288Smrg[if test "$have_doxygen" = yes; then
100776b526288Smrg    # scrape the doxygen version
100786b526288Smrg    AC_MSG_CHECKING([the doxygen version])
100796b526288Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
100806b526288Smrg    AC_MSG_RESULT([$doxygen_version])
100816b526288Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
100826b526288Smrg        [if test "x$use_doxygen" = xauto; then
100836b526288Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
100846b526288Smrg            have_doxygen=no
100856b526288Smrg        else
100866b526288Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
100876b526288Smrg        fi])
100886b526288Smrgfi])
1008941b2f0bdSmrg
100906b526288Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
100916b526288Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
100926b526288Smrgdnl 	HAVE_DOT = @HAVE_DOT@
100936b526288SmrgHAVE_DOT=no
100946b526288Smrgif test "x$have_doxygen" = "xyes"; then
100956b526288Smrg  AC_PATH_PROG([DOT], [dot])
100966b526288Smrg    if test "x$DOT" != "x"; then
100976b526288Smrg      HAVE_DOT=yes
100986b526288Smrg    fi
100996b526288Smrgfi
1010041b2f0bdSmrg
101016b526288SmrgAC_SUBST([HAVE_DOT])
101026b526288SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
101036b526288SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
101046b526288Smrg]) # XORG_WITH_DOXYGEN
1010511245024Smrg
101066b526288Smrg# XORG_WITH_GROFF([DEFAULT])
101076b526288Smrg# ----------------
101086b526288Smrg# Minimum version: 1.6.0
101096b526288Smrg# Minimum version for optional DEFAULT argument: 1.11.0
101106b526288Smrg#
101116b526288Smrg# Documentation tools are not always available on all platforms and sometimes
101126b526288Smrg# not at the appropriate level. This macro enables a module to test for the
101136b526288Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
101146b526288Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
101156b526288Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
101166b526288Smrg# --with-groff assumes 'auto'.
101176b526288Smrg#
101186b526288Smrg# Interface to module:
101196b526288Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
101206b526288Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
101216b526288Smrg# HAVE_GROFF_MS: the -ms macros package
101226b526288Smrg# GROFF:	 returns the path of the groff program found
101236b526288Smrg#		 returns the path set by the user in the environment
101246b526288Smrg# --with-groff:	 'yes' user instructs the module to use groff
101256b526288Smrg#		 'no' user instructs the module not to use groff
101266b526288Smrg#
101276b526288Smrg# Added in version 1.9.0:
101286b526288Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
101296b526288Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
101306b526288Smrg#		   psselect from the psutils package.
101316b526288Smrg#		   the ghostcript package. Refer to the grohtml man pages
101326b526288Smrg#
101336b526288Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
101346b526288Smrg#
101356b526288Smrg# OS and distros often splits groff in a basic and full package, the former
101366b526288Smrg# having the groff program and the later having devices, fonts and macros
101376b526288Smrg# Checking for the groff executable is not enough.
101386b526288Smrg#
101396b526288Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
101406b526288Smrg# unset HAVE_GROFF or GROFF env variables.
101416b526288Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
101426b526288Smrg#
101436b526288SmrgAC_DEFUN([XORG_WITH_GROFF],[
101446b526288SmrgAC_ARG_VAR([GROFF], [Path to groff command])
101456b526288Smrgm4_define([_defopt], m4_default([$1], [auto]))
101466b526288SmrgAC_ARG_WITH(groff,
101476b526288Smrg	AS_HELP_STRING([--with-groff],
101486b526288Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
101496b526288Smrg	   [use_groff=$withval], [use_groff=]_defopt)
101506b526288Smrgm4_undefine([_defopt])
1015111245024Smrg
101526b526288Smrgif test "x$use_groff" = x"auto"; then
101536b526288Smrg   AC_PATH_PROG([GROFF], [groff])
101546b526288Smrg   if test "x$GROFF" = "x"; then
101556b526288Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
101566b526288Smrg	have_groff=no
101576b526288Smrg   else
101586b526288Smrg        have_groff=yes
101596b526288Smrg   fi
101606b526288Smrgelif test "x$use_groff" = x"yes" ; then
101616b526288Smrg   AC_PATH_PROG([GROFF], [groff])
101626b526288Smrg   if test "x$GROFF" = "x"; then
101636b526288Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
101646b526288Smrg   fi
101656b526288Smrg   have_groff=yes
101666b526288Smrgelif test "x$use_groff" = x"no" ; then
101676b526288Smrg   if test "x$GROFF" != "x"; then
101686b526288Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
101696b526288Smrg   fi
101706b526288Smrg   have_groff=no
101716b526288Smrgelse
101726b526288Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1017311a29bacSmrgfi
1017441b2f0bdSmrg
101756b526288Smrg# We have groff, test for the presence of the macro packages
101766b526288Smrgif test "x$have_groff" = x"yes"; then
101776b526288Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
101786b526288Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
101796b526288Smrg        groff_ms_works=yes
101806b526288Smrg    else
101816b526288Smrg        groff_ms_works=no
101826b526288Smrg    fi
101836b526288Smrg    AC_MSG_RESULT([$groff_ms_works])
101846b526288Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
101856b526288Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
101866b526288Smrg        groff_mm_works=yes
101876b526288Smrg    else
101886b526288Smrg        groff_mm_works=no
101896b526288Smrg    fi
101906b526288Smrg    AC_MSG_RESULT([$groff_mm_works])
101916b526288Smrgfi
1019241b2f0bdSmrg
101936b526288Smrg# We have groff, test for HTML dependencies, one command per package
101946b526288Smrgif test "x$have_groff" = x"yes"; then
101956b526288Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
101966b526288Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
101976b526288Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
101986b526288Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
101996b526288Smrg      have_groff_html=yes
102006b526288Smrg   else
102016b526288Smrg      have_groff_html=no
102026b526288Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
102036b526288Smrg   fi
102046b526288Smrgfi
1020541b2f0bdSmrg
102066b526288Smrg# Set Automake conditionals for Makefiles
102076b526288SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
102086b526288SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
102096b526288SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
102106b526288SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
102116b526288Smrg]) # XORG_WITH_GROFF
1021241b2f0bdSmrg
102136b526288Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
102146b526288Smrg# ---------------------------------------
102156b526288Smrg# Minimum version: 1.6.0
102166b526288Smrg# Minimum version for optional DEFAULT argument: 1.11.0
102176b526288Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
102186b526288Smrg#
102196b526288Smrg# Documentation tools are not always available on all platforms and sometimes
102206b526288Smrg# not at the appropriate level. This macro enables a module to test for the
102216b526288Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
102226b526288Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
102236b526288Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
102246b526288Smrg# --with-fop assumes 'auto'.
102256b526288Smrg#
102266b526288Smrg# Interface to module:
102276b526288Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
102286b526288Smrg# FOP:	 	returns the path of the fop program found
102296b526288Smrg#		returns the path set by the user in the environment
102306b526288Smrg# --with-fop: 	'yes' user instructs the module to use fop
102316b526288Smrg#		'no' user instructs the module not to use fop
102326b526288Smrg#
102336b526288Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
102346b526288Smrg#
102356b526288SmrgAC_DEFUN([XORG_WITH_FOP],[
102366b526288SmrgAC_ARG_VAR([FOP], [Path to fop command])
102376b526288Smrgm4_define([_defopt], m4_default([$2], [auto]))
102386b526288SmrgAC_ARG_WITH(fop,
102396b526288Smrg	AS_HELP_STRING([--with-fop],
102406b526288Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
102416b526288Smrg	   [use_fop=$withval], [use_fop=]_defopt)
102426b526288Smrgm4_undefine([_defopt])
1024341b2f0bdSmrg
102446b526288Smrgif test "x$use_fop" = x"auto"; then
102456b526288Smrg   AC_PATH_PROG([FOP], [fop])
102466b526288Smrg   if test "x$FOP" = "x"; then
102476b526288Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
102486b526288Smrg	have_fop=no
102496b526288Smrg   else
102506b526288Smrg        have_fop=yes
102516b526288Smrg   fi
102526b526288Smrgelif test "x$use_fop" = x"yes" ; then
102536b526288Smrg   AC_PATH_PROG([FOP], [fop])
102546b526288Smrg   if test "x$FOP" = "x"; then
102556b526288Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
102566b526288Smrg   fi
102576b526288Smrg   have_fop=yes
102586b526288Smrgelif test "x$use_fop" = x"no" ; then
102596b526288Smrg   if test "x$FOP" != "x"; then
102606b526288Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
102616b526288Smrg   fi
102626b526288Smrg   have_fop=no
102636b526288Smrgelse
102646b526288Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
102656b526288Smrgfi
1026611a29bacSmrg
102676b526288Smrg# Test for a minimum version of fop, if provided.
102686b526288Smrgm4_ifval([$1],
102696b526288Smrg[if test "$have_fop" = yes; then
102706b526288Smrg    # scrape the fop version
102716b526288Smrg    AC_MSG_CHECKING([for fop minimum version])
102726b526288Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
102736b526288Smrg    AC_MSG_RESULT([$fop_version])
102746b526288Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
102756b526288Smrg        [if test "x$use_fop" = xauto; then
102766b526288Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
102776b526288Smrg            have_fop=no
102786b526288Smrg        else
102796b526288Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
102806b526288Smrg        fi])
102816b526288Smrgfi])
102826b526288SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
102836b526288Smrg]) # XORG_WITH_FOP
1028441b2f0bdSmrg
102856b526288Smrg# XORG_WITH_M4([MIN-VERSION])
102866b526288Smrg# ---------------------------
102876b526288Smrg# Minimum version: 1.19.0
102886b526288Smrg#
102896b526288Smrg# This macro attempts to locate an m4 macro processor which supports
102906b526288Smrg# -I option and is only useful for modules relying on M4 in order to
102916b526288Smrg# expand macros in source code files.
102926b526288Smrg#
102936b526288Smrg# Interface to module:
102946b526288Smrg# M4:	 	returns the path of the m4 program found
102956b526288Smrg#		returns the path set by the user in the environment
102966b526288Smrg#
102976b526288SmrgAC_DEFUN([XORG_WITH_M4], [
102986b526288SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
102996b526288Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
103006b526288Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
103016b526288Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
103026b526288Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
103036b526288Smrg   [$PATH:/usr/gnu/bin])])
1030441b2f0bdSmrg
103056b526288SmrgAC_SUBST([M4], [$ac_cv_path_M4])
103066b526288Smrg]) # XORG_WITH_M4
1030711a29bacSmrg
103086b526288Smrg# XORG_WITH_PS2PDF([DEFAULT])
103096b526288Smrg# ----------------
103106b526288Smrg# Minimum version: 1.6.0
103116b526288Smrg# Minimum version for optional DEFAULT argument: 1.11.0
103126b526288Smrg#
103136b526288Smrg# Documentation tools are not always available on all platforms and sometimes
103146b526288Smrg# not at the appropriate level. This macro enables a module to test for the
103156b526288Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
103166b526288Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
103176b526288Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
103186b526288Smrg# --with-ps2pdf assumes 'auto'.
103196b526288Smrg#
103206b526288Smrg# Interface to module:
103216b526288Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
103226b526288Smrg# PS2PDF:	returns the path of the ps2pdf program found
103236b526288Smrg#		returns the path set by the user in the environment
103246b526288Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
103256b526288Smrg#		 'no' user instructs the module not to use ps2pdf
103266b526288Smrg#
103276b526288Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
103286b526288Smrg#
103296b526288SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
103306b526288SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
103316b526288Smrgm4_define([_defopt], m4_default([$1], [auto]))
103326b526288SmrgAC_ARG_WITH(ps2pdf,
103336b526288Smrg	AS_HELP_STRING([--with-ps2pdf],
103346b526288Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
103356b526288Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
103366b526288Smrgm4_undefine([_defopt])
103376b526288Smrg
103386b526288Smrgif test "x$use_ps2pdf" = x"auto"; then
103396b526288Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
103406b526288Smrg   if test "x$PS2PDF" = "x"; then
103416b526288Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
103426b526288Smrg	have_ps2pdf=no
103436b526288Smrg   else
103446b526288Smrg        have_ps2pdf=yes
103456b526288Smrg   fi
103466b526288Smrgelif test "x$use_ps2pdf" = x"yes" ; then
103476b526288Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
103486b526288Smrg   if test "x$PS2PDF" = "x"; then
103496b526288Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
103506b526288Smrg   fi
103516b526288Smrg   have_ps2pdf=yes
103526b526288Smrgelif test "x$use_ps2pdf" = x"no" ; then
103536b526288Smrg   if test "x$PS2PDF" != "x"; then
103546b526288Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
103556b526288Smrg   fi
103566b526288Smrg   have_ps2pdf=no
103576b526288Smrgelse
103586b526288Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
103596b526288Smrgfi
103606b526288SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
103616b526288Smrg]) # XORG_WITH_PS2PDF
1036241b2f0bdSmrg
103636b526288Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
103646b526288Smrg# ----------------
103656b526288Smrg# Minimum version: 1.6.0
103666b526288Smrg#
103676b526288Smrg# Documentation tools are not always available on all platforms and sometimes
103686b526288Smrg# not at the appropriate level. This macro enables a builder to skip all
103696b526288Smrg# documentation targets except traditional man pages.
103706b526288Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
103716b526288Smrg# maximum flexibilty in controlling documentation building.
103726b526288Smrg# Refer to:
103736b526288Smrg# XORG_WITH_XMLTO         --with-xmlto
103746b526288Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
103756b526288Smrg# XORG_WITH_DOXYGEN       --with-doxygen
103766b526288Smrg# XORG_WITH_FOP           --with-fop
103776b526288Smrg# XORG_WITH_GROFF         --with-groff
103786b526288Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
103796b526288Smrg#
103806b526288Smrg# Interface to module:
103816b526288Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
103826b526288Smrg# --enable-docs: 'yes' user instructs the module to generate docs
103836b526288Smrg#		 'no' user instructs the module not to generate docs
103846b526288Smrg# parm1:	specify the default value, yes or no.
103856b526288Smrg#
103866b526288SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
103876b526288Smrgm4_define([docs_default], m4_default([$1], [yes]))
103886b526288SmrgAC_ARG_ENABLE(docs,
103896b526288Smrg	AS_HELP_STRING([--enable-docs],
103906b526288Smrg	   [Enable building the documentation (default: ]docs_default[)]),
103916b526288Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
103926b526288Smrgm4_undefine([docs_default])
103936b526288SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
103946b526288SmrgAC_MSG_CHECKING([whether to build documentation])
103956b526288SmrgAC_MSG_RESULT([$build_docs])
103966b526288Smrg]) # XORG_ENABLE_DOCS
1039741b2f0bdSmrg
103986b526288Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
103996b526288Smrg# ----------------
104006b526288Smrg# Minimum version: 1.6.0
104016b526288Smrg#
104026b526288Smrg# This macro enables a builder to skip all developer documentation.
104036b526288Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
104046b526288Smrg# maximum flexibilty in controlling documentation building.
104056b526288Smrg# Refer to:
104066b526288Smrg# XORG_WITH_XMLTO         --with-xmlto
104076b526288Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
104086b526288Smrg# XORG_WITH_DOXYGEN       --with-doxygen
104096b526288Smrg# XORG_WITH_FOP           --with-fop
104106b526288Smrg# XORG_WITH_GROFF         --with-groff
104116b526288Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
104126b526288Smrg#
104136b526288Smrg# Interface to module:
104146b526288Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
104156b526288Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
104166b526288Smrg#			'no' user instructs the module not to generate developer docs
104176b526288Smrg# parm1:		specify the default value, yes or no.
104186b526288Smrg#
104196b526288SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
104206b526288Smrgm4_define([devel_default], m4_default([$1], [yes]))
104216b526288SmrgAC_ARG_ENABLE(devel-docs,
104226b526288Smrg	AS_HELP_STRING([--enable-devel-docs],
104236b526288Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
104246b526288Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
104256b526288Smrgm4_undefine([devel_default])
104266b526288SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
104276b526288SmrgAC_MSG_CHECKING([whether to build developer documentation])
104286b526288SmrgAC_MSG_RESULT([$build_devel_docs])
104296b526288Smrg]) # XORG_ENABLE_DEVEL_DOCS
1043011a29bacSmrg
104316b526288Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
104326b526288Smrg# ----------------
104336b526288Smrg# Minimum version: 1.6.0
104346b526288Smrg#
104356b526288Smrg# This macro enables a builder to skip all functional specification targets.
104366b526288Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
104376b526288Smrg# maximum flexibilty in controlling documentation building.
104386b526288Smrg# Refer to:
104396b526288Smrg# XORG_WITH_XMLTO         --with-xmlto
104406b526288Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
104416b526288Smrg# XORG_WITH_DOXYGEN       --with-doxygen
104426b526288Smrg# XORG_WITH_FOP           --with-fop
104436b526288Smrg# XORG_WITH_GROFF         --with-groff
104446b526288Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
104456b526288Smrg#
104466b526288Smrg# Interface to module:
104476b526288Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
104486b526288Smrg# --enable-specs:	'yes' user instructs the module to generate specs
104496b526288Smrg#			'no' user instructs the module not to generate specs
104506b526288Smrg# parm1:		specify the default value, yes or no.
104516b526288Smrg#
104526b526288SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
104536b526288Smrgm4_define([spec_default], m4_default([$1], [yes]))
104546b526288SmrgAC_ARG_ENABLE(specs,
104556b526288Smrg	AS_HELP_STRING([--enable-specs],
104566b526288Smrg	   [Enable building the specs (default: ]spec_default[)]),
104576b526288Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
104586b526288Smrgm4_undefine([spec_default])
104596b526288SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
104606b526288SmrgAC_MSG_CHECKING([whether to build functional specifications])
104616b526288SmrgAC_MSG_RESULT([$build_specs])
104626b526288Smrg]) # XORG_ENABLE_SPECS
1046311a29bacSmrg
104646b526288Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
104656b526288Smrg# ----------------------------------------------
104666b526288Smrg# Minimum version: 1.13.0
104676b526288Smrg#
104686b526288Smrg# This macro enables a builder to enable/disable unit testing
104696b526288Smrg# It makes no assumption about the test cases implementation
104706b526288Smrg# Test cases may or may not use Automake "Support for test suites"
104716b526288Smrg# They may or may not use the software utility library GLib
104726b526288Smrg#
104736b526288Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
104746b526288Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
104756b526288Smrg# The variable enable_unit_tests is used by other macros in this file.
104766b526288Smrg#
104776b526288Smrg# Interface to module:
104786b526288Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
104796b526288Smrg# enable_unit_tests:    used in configure.ac for additional configuration
104806b526288Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
104816b526288Smrg#			'no' user instructs the module not to build tests
104826b526288Smrg# parm1:		specify the default value, yes or no.
104836b526288Smrg#
104846b526288SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
104856b526288SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
104866b526288SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
104876b526288SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
104886b526288Smrgm4_define([_defopt], m4_default([$1], [auto]))
104896b526288SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
104906b526288Smrg	[Enable building unit test cases (default: ]_defopt[)]),
104916b526288Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
104926b526288Smrgm4_undefine([_defopt])
104936b526288SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
104946b526288SmrgAC_MSG_CHECKING([whether to build unit test cases])
104956b526288SmrgAC_MSG_RESULT([$enable_unit_tests])
104966b526288Smrg]) # XORG_ENABLE_UNIT_TESTS
1049711a29bacSmrg
104986b526288Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
104996b526288Smrg# ------------------------------------------------------
105006b526288Smrg# Minimum version: 1.17.0
105016b526288Smrg#
105026b526288Smrg# This macro enables a builder to enable/disable integration testing
105036b526288Smrg# It makes no assumption about the test cases' implementation
105046b526288Smrg# Test cases may or may not use Automake "Support for test suites"
105056b526288Smrg#
105066b526288Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
105076b526288Smrg# usually requires less dependencies and may be built and run under less
105086b526288Smrg# stringent environments than integration tests.
105096b526288Smrg#
105106b526288Smrg# Interface to module:
105116b526288Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
105126b526288Smrg# enable_integration_tests:   used in configure.ac for additional configuration
105136b526288Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
105146b526288Smrg#                             'no' user instructs the module not to build tests
105156b526288Smrg# parm1:                      specify the default value, yes or no.
105166b526288Smrg#
105176b526288SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
105186b526288SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
105196b526288Smrgm4_define([_defopt], m4_default([$1], [auto]))
105206b526288SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
105216b526288Smrg	[Enable building integration test cases (default: ]_defopt[)]),
105226b526288Smrg	[enable_integration_tests=$enableval],
105236b526288Smrg	[enable_integration_tests=]_defopt)
105246b526288Smrgm4_undefine([_defopt])
105256b526288SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
105266b526288Smrg	[test "x$enable_integration_tests" != xno])
105276b526288SmrgAC_MSG_CHECKING([whether to build unit test cases])
105286b526288SmrgAC_MSG_RESULT([$enable_integration_tests])
105296b526288Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
1053011a29bacSmrg
105316b526288Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
105326b526288Smrg# ----------------------------------------
105336b526288Smrg# Minimum version: 1.13.0
105346b526288Smrg#
105356b526288Smrg# GLib is a library which provides advanced data structures and functions.
105366b526288Smrg# This macro enables a module to test for the presence of Glib.
105376b526288Smrg#
105386b526288Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
105396b526288Smrg# Otherwise the value of $enable_unit_tests is blank.
105406b526288Smrg#
105416b526288Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
105426b526288Smrg# test support usually requires less dependencies and may be built and run under
105436b526288Smrg# less stringent environments than integration tests.
105446b526288Smrg#
105456b526288Smrg# Interface to module:
105466b526288Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
105476b526288Smrg# with_glib: used in configure.ac to know if GLib has been found
105486b526288Smrg# --with-glib:	'yes' user instructs the module to use glib
105496b526288Smrg#		'no' user instructs the module not to use glib
105506b526288Smrg#
105516b526288SmrgAC_DEFUN([XORG_WITH_GLIB],[
105526b526288SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
105536b526288Smrgm4_define([_defopt], m4_default([$2], [auto]))
105546b526288SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
105556b526288Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
105566b526288Smrg	[with_glib=$withval], [with_glib=]_defopt)
105576b526288Smrgm4_undefine([_defopt])
105586b526288Smrg
105596b526288Smrghave_glib=no
105606b526288Smrg# Do not probe GLib if user explicitly disabled unit testing
105616b526288Smrgif test "x$enable_unit_tests" != x"no"; then
105626b526288Smrg  # Do not probe GLib if user explicitly disabled it
105636b526288Smrg  if test "x$with_glib" != x"no"; then
105646b526288Smrg    m4_ifval(
105656b526288Smrg      [$1],
105666b526288Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
105676b526288Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
105686b526288Smrg    )
1056911a29bacSmrg  fi
105706b526288Smrgfi
1057111a29bacSmrg
105726b526288Smrg# Not having GLib when unit testing has been explicitly requested is an error
105736b526288Smrgif test "x$enable_unit_tests" = x"yes"; then
105746b526288Smrg  if test "x$have_glib" = x"no"; then
105756b526288Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
105766b526288Smrg  fi
105776b526288Smrgfi
105786b526288Smrg
105796b526288Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
105806b526288Smrgif test "x$enable_unit_tests" = x"no"; then
105816b526288Smrg  if test "x$with_glib" = x"yes"; then
105826b526288Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
105836b526288Smrg  fi
105846b526288Smrgfi
1058511a29bacSmrg
105866b526288Smrg# Not having GLib when it has been explicitly requested is an error
105876b526288Smrgif test "x$with_glib" = x"yes"; then
105886b526288Smrg  if test "x$have_glib" = x"no"; then
105896b526288Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
105906b526288Smrg  fi
105916b526288Smrgfi
1059211a29bacSmrg
105936b526288SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
105946b526288Smrg]) # XORG_WITH_GLIB
105956b526288Smrg
105966b526288Smrg# XORG_LD_WRAP([required|optional])
105976b526288Smrg# ---------------------------------
105986b526288Smrg# Minimum version: 1.13.0
105996b526288Smrg#
106006b526288Smrg# Check if linker supports -wrap, passed via compiler flags
106016b526288Smrg#
106026b526288Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
106036b526288Smrg# Otherwise the value of $enable_unit_tests is blank.
106046b526288Smrg#
106056b526288Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
106066b526288Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
106076b526288Smrg# available, an argument of "optional" allows use when some unit tests require
106086b526288Smrg# ld -wrap and others do not.
106096b526288Smrg#
106106b526288SmrgAC_DEFUN([XORG_LD_WRAP],[
106116b526288SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
106126b526288Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
106136b526288Smrg                      void __wrap_exit(int status) { return; }],
106146b526288Smrg                     [exit(0);])])
106156b526288Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
106166b526288Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
106176b526288Smrg  if test "x$have_ld_wrap" = x"no"; then
106186b526288Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
106196b526288Smrg  fi
106206b526288Smrgfi
106216b526288SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
106226b526288Smrg#
106236b526288Smrg]) # XORG_LD_WRAP
106246b526288Smrg
106256b526288Smrg# XORG_CHECK_LINKER_FLAGS
106266b526288Smrg# -----------------------
106276b526288Smrg# SYNOPSIS
106286b526288Smrg#
106296b526288Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
106306b526288Smrg#
106316b526288Smrg# DESCRIPTION
106326b526288Smrg#
106336b526288Smrg#   Check whether the given linker FLAGS work with the current language's
106346b526288Smrg#   linker, or whether they give an error.
106356b526288Smrg#
106366b526288Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
106376b526288Smrg#   success/failure.
106386b526288Smrg#
106396b526288Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
106406b526288Smrg#
106416b526288Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
106426b526288Smrg#
106436b526288Smrg# LICENSE
106446b526288Smrg#
106456b526288Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
106466b526288Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
106476b526288Smrg#   Copyright (c) 2009 Matteo Frigo
106486b526288Smrg#
106496b526288Smrg#   This program is free software: you can redistribute it and/or modify it
106506b526288Smrg#   under the terms of the GNU General Public License as published by the
106516b526288Smrg#   Free Software Foundation, either version 3 of the License, or (at your
106526b526288Smrg#   option) any later version.
106536b526288Smrg#
106546b526288Smrg#   This program is distributed in the hope that it will be useful, but
106556b526288Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
106566b526288Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
106576b526288Smrg#   Public License for more details.
106586b526288Smrg#
106596b526288Smrg#   You should have received a copy of the GNU General Public License along
106606b526288Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
106616b526288Smrg#
106626b526288Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
106636b526288Smrg#   gives unlimited permission to copy, distribute and modify the configure
106646b526288Smrg#   scripts that are the output of Autoconf when processing the Macro. You
106656b526288Smrg#   need not follow the terms of the GNU General Public License when using
106666b526288Smrg#   or distributing such scripts, even though portions of the text of the
106676b526288Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
106686b526288Smrg#   all other use of the material that constitutes the Autoconf Macro.
106696b526288Smrg#
106706b526288Smrg#   This special exception to the GPL applies to versions of the Autoconf
106716b526288Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
106726b526288Smrg#   modified version of the Autoconf Macro, you may extend this special
106736b526288Smrg#   exception to the GPL to apply to your modified version as well.#
106746b526288SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
106756b526288Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
106766b526288Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
106776b526288SmrgAS_LITERAL_IF([$1],
106786b526288Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
106796b526288Smrg      ax_save_FLAGS=$LDFLAGS
106806b526288Smrg      LDFLAGS="$1"
106816b526288Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
106826b526288Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
106836b526288Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
106846b526288Smrg      LDFLAGS=$ax_save_FLAGS])],
106856b526288Smrg  [ax_save_FLAGS=$LDFLAGS
106866b526288Smrg   LDFLAGS="$1"
106876b526288Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
106886b526288Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
106896b526288Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
106906b526288Smrg   LDFLAGS=$ax_save_FLAGS])
106916b526288Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
106926b526288SmrgAC_MSG_RESULT($xorg_check_linker_flags)
106936b526288Smrgif test "x$xorg_check_linker_flags" = xyes; then
106946b526288Smrg	m4_default([$2], :)
1069511a29bacSmrgelse
106966b526288Smrg	m4_default([$3], :)
1069711a29bacSmrgfi
106986b526288Smrg]) # XORG_CHECK_LINKER_FLAGS
1069911a29bacSmrg
107006b526288Smrg# XORG_MEMORY_CHECK_FLAGS
107016b526288Smrg# -----------------------
107026b526288Smrg# Minimum version: 1.16.0
107036b526288Smrg#
107046b526288Smrg# This macro attempts to find appropriate memory checking functionality
107056b526288Smrg# for various platforms which unit testing code may use to catch various
107066b526288Smrg# forms of memory allocation and access errors in testing.
107076b526288Smrg#
107086b526288Smrg# Interface to module:
107096b526288Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
107106b526288Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
107116b526288Smrg#
107126b526288Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
107136b526288Smrg#
107146b526288SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
107156b526288Smrg
107166b526288SmrgAC_REQUIRE([AC_CANONICAL_HOST])
107176b526288SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
107186b526288Smrg           [Environment variables to enable memory checking in tests])
107196b526288Smrg
107206b526288Smrg# Check for different types of support on different platforms
107216b526288Smrgcase $host_os in
107226b526288Smrg    solaris*)
107236b526288Smrg        AC_CHECK_LIB([umem], [umem_alloc],
107246b526288Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
107256b526288Smrg        ;;
107266b526288Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
107276b526288Smrg        # both directly and inverted, so should not be 0 or 255.
107286b526288Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
107296b526288Smrg        ;;
107306b526288Smrg    darwin*)
107316b526288Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
107326b526288Smrg        ;;
107336b526288Smrg    *bsd*)
107346b526288Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
107356b526288Smrg        ;;
1073611a29bacSmrgesac
1073711a29bacSmrg
107386b526288Smrg# User supplied flags override default flags
107396b526288Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
107406b526288Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
107416b526288Smrgfi
1074211a29bacSmrg
107436b526288SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
107446b526288Smrg]) # XORG_WITH_LINT
1074511a29bacSmrg
107466b526288Smrg# XORG_CHECK_MALLOC_ZERO
107476b526288Smrg# ----------------------
107486b526288Smrg# Minimum version: 1.0.0
107496b526288Smrg#
107506b526288Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
107516b526288Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
107526b526288Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
107536b526288SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
107546b526288SmrgAC_ARG_ENABLE(malloc0returnsnull,
107556b526288Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
107566b526288Smrg		       [malloc(0) returns NULL (default: auto)]),
107576b526288Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
107586b526288Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1075911a29bacSmrg
107606b526288SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
107616b526288Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
107626b526288SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
107636b526288Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
107646b526288Smrg#include <stdlib.h>
107656b526288Smrg],[
107666b526288Smrg    char *m0, *r0, *c0, *p;
107676b526288Smrg    m0 = malloc(0);
107686b526288Smrg    p = malloc(10);
107696b526288Smrg    r0 = realloc(p,0);
107706b526288Smrg    c0 = calloc(0,10);
107716b526288Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
107726b526288Smrg])],
107736b526288Smrg		[xorg_cv_malloc0_returns_null=yes],
107746b526288Smrg		[xorg_cv_malloc0_returns_null=no])])
107756b526288SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
107766b526288Smrgfi
107776b526288SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1077841b2f0bdSmrg
107796b526288Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
107806b526288Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
107816b526288Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
107826b526288Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
107836b526288Smrgelse
107846b526288Smrg	MALLOC_ZERO_CFLAGS=""
107856b526288Smrg	XMALLOC_ZERO_CFLAGS=""
107866b526288Smrg	XTMALLOC_ZERO_CFLAGS=""
107876b526288Smrgfi
1078811a29bacSmrg
107896b526288SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
107906b526288SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
107916b526288SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
107926b526288Smrg]) # XORG_CHECK_MALLOC_ZERO
1079311a29bacSmrg
107946b526288Smrg# XORG_WITH_LINT()
107956b526288Smrg# ----------------
107966b526288Smrg# Minimum version: 1.1.0
107976b526288Smrg#
107986b526288Smrg# This macro enables the use of a tool that flags some suspicious and
107996b526288Smrg# non-portable constructs (likely to be bugs) in C language source code.
108006b526288Smrg# It will attempt to locate the tool and use appropriate options.
108016b526288Smrg# There are various lint type tools on different platforms.
108026b526288Smrg#
108036b526288Smrg# Interface to module:
108046b526288Smrg# LINT:		returns the path to the tool found on the platform
108056b526288Smrg#		or the value set to LINT on the configure cmd line
108066b526288Smrg#		also an Automake conditional
108076b526288Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
108086b526288Smrg#
108096b526288Smrg# --with-lint:	'yes' user instructs the module to use lint
108106b526288Smrg#		'no' user instructs the module not to use lint (default)
108116b526288Smrg#
108126b526288Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
108136b526288Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
108146b526288Smrg#
108156b526288SmrgAC_DEFUN([XORG_WITH_LINT],[
1081641b2f0bdSmrg
108176b526288SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
108186b526288SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
108196b526288SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
108206b526288Smrg		[Use a lint-style source code checker (default: disabled)])],
108216b526288Smrg		[use_lint=$withval], [use_lint=no])
1082241b2f0bdSmrg
108236b526288Smrg# Obtain platform specific info like program name and options
108246b526288Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
108256b526288Smrgcase $host_os in
108266b526288Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
108276b526288Smrg	lint_name=splint
108286b526288Smrg	lint_options="-badflag"
108296b526288Smrg	;;
108306b526288Smrg  *freebsd* | *netbsd*)
108316b526288Smrg	lint_name=lint
108326b526288Smrg	lint_options="-u -b"
108336b526288Smrg	;;
108346b526288Smrg  *solaris*)
108356b526288Smrg	lint_name=lint
108366b526288Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
108376b526288Smrg	;;
108386b526288Smrgesac
1083941b2f0bdSmrg
108406b526288Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
108416b526288Smrgif test "x$use_lint" = x"yes" ; then
108426b526288Smrg   AC_PATH_PROG([LINT], [$lint_name])
108436b526288Smrg   if test "x$LINT" = "x"; then
108446b526288Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
108456b526288Smrg   fi
108466b526288Smrgelif test "x$use_lint" = x"no" ; then
108476b526288Smrg   if test "x$LINT" != "x"; then
108486b526288Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
108496b526288Smrg   fi
108506b526288Smrgelse
108516b526288Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
108526b526288Smrgfi
1085341b2f0bdSmrg
108546b526288Smrg# User supplied flags override default flags
108556b526288Smrgif test "x$LINT_FLAGS" != "x"; then
108566b526288Smrg   lint_options=$LINT_FLAGS
108576b526288Smrgfi
1085841b2f0bdSmrg
108596b526288SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
108606b526288SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
1086141b2f0bdSmrg
108626b526288Smrg]) # XORG_WITH_LINT
108636b526288Smrg
108646b526288Smrg# XORG_LINT_LIBRARY(LIBNAME)
108656b526288Smrg# --------------------------
108666b526288Smrg# Minimum version: 1.1.0
108676b526288Smrg#
108686b526288Smrg# Sets up flags for building lint libraries for checking programs that call
108696b526288Smrg# functions in the library.
108706b526288Smrg#
108716b526288Smrg# Interface to module:
108726b526288Smrg# LINTLIB		- Automake variable with the name of lint library file to make
108736b526288Smrg# MAKE_LINT_LIB		- Automake conditional
108746b526288Smrg#
108756b526288Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
108766b526288Smrg#			  - 'no' user instructs the module not to create a lint library (default)
1087741b2f0bdSmrg
108786b526288SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
108796b526288SmrgAC_REQUIRE([XORG_WITH_LINT])
108806b526288SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
108816b526288Smrg	[Create lint library (default: disabled)])],
108826b526288Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1088311a29bacSmrg
108846b526288Smrgif test "x$make_lint_lib" = x"yes" ; then
108856b526288Smrg   LINTLIB=llib-l$1.ln
108866b526288Smrg   if test "x$LINT" = "x"; then
108876b526288Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
108886b526288Smrg   fi
108896b526288Smrgelif test "x$make_lint_lib" != x"no" ; then
108906b526288Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
108916b526288Smrgfi
1089241b2f0bdSmrg
108936b526288SmrgAC_SUBST(LINTLIB)
108946b526288SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1089541b2f0bdSmrg
108966b526288Smrg]) # XORG_LINT_LIBRARY
1089741b2f0bdSmrg
108986b526288Smrg# XORG_COMPILER_BRAND
108996b526288Smrg# -------------------
109006b526288Smrg# Minimum version: 1.14.0
109016b526288Smrg#
109026b526288Smrg# Checks for various brands of compilers and sets flags as appropriate:
109036b526288Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
109046b526288Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
109056b526288Smrg#   clang compiler - sets CLANGCC to "yes"
109066b526288Smrg#   Intel compiler - sets INTELCC to "yes"
109076b526288Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
109086b526288Smrg#
109096b526288SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
109106b526288SmrgAC_LANG_CASE(
109116b526288Smrg	[C], [
109126b526288Smrg		AC_REQUIRE([AC_PROG_CC_C99])
109136b526288Smrg	],
109146b526288Smrg	[C++], [
109156b526288Smrg		AC_REQUIRE([AC_PROG_CXX])
109166b526288Smrg	]
109176b526288Smrg)
109186b526288SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
109196b526288SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
109206b526288SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
109216b526288Smrg]) # XORG_COMPILER_BRAND
1092241b2f0bdSmrg
109236b526288Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
109246b526288Smrg# ---------------
109256b526288Smrg# Minimum version: 1.16.0
109266b526288Smrg#
109276b526288Smrg# Test if the compiler works when passed the given flag as a command line argument.
109286b526288Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
109296b526288Smrg# next flag in the list until there are no more options.
109306b526288Smrg#
109316b526288Smrg# Note that this does not guarantee that the compiler supports the flag as some
109326b526288Smrg# compilers will simply ignore arguments that they do not understand, but we do
109336b526288Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
109346b526288Smrg# -Werror=unused-command-line-argument
109356b526288Smrg#
109366b526288SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
109376b526288Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
109386b526288Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
109396b526288Smrg
109406b526288SmrgAC_LANG_COMPILER_REQUIRE
109416b526288Smrg
109426b526288SmrgAC_LANG_CASE(
109436b526288Smrg	[C], [
109446b526288Smrg		AC_REQUIRE([AC_PROG_CC_C99])
109456b526288Smrg		define([PREFIX], [C])
109466b526288Smrg		define([CACHE_PREFIX], [cc])
109476b526288Smrg		define([COMPILER], [$CC])
109486b526288Smrg	],
109496b526288Smrg	[C++], [
109506b526288Smrg		define([PREFIX], [CXX])
109516b526288Smrg		define([CACHE_PREFIX], [cxx])
109526b526288Smrg		define([COMPILER], [$CXX])
109536b526288Smrg	]
109546b526288Smrg)
1095541b2f0bdSmrg
109566b526288Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
109576b526288Smrg
109586b526288Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
109596b526288Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
109606b526288Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
109616b526288Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
109626b526288Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
109636b526288Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
109646b526288Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
109656b526288Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
109666b526288Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
109676b526288Smrgfi
1096841b2f0bdSmrg
109696b526288Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
109706b526288Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
109716b526288Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
109726b526288Smrg	fi
109736b526288Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
109746b526288Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
109756b526288Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
109766b526288Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
109776b526288Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
109786b526288Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
109796b526288Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
109806b526288Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
109816b526288Smrgfi
1098241b2f0bdSmrg
109836b526288Smrgfound="no"
109846b526288Smrgm4_foreach([flag], m4_cdr($@), [
109856b526288Smrg	if test $found = "no" ; then
109866b526288Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
109876b526288Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
109886b526288Smrg		fi
109896b526288Smrg
109906b526288Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
109916b526288Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
109926b526288Smrg		fi
109936b526288Smrg
109946b526288Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
109956b526288Smrg
109966b526288Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
109976b526288Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
109986b526288Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
109996b526288Smrg		AC_CACHE_VAL($cacheid,
110006b526288Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
110016b526288Smrg					     [eval $cacheid=yes],
110026b526288Smrg					     [eval $cacheid=no])])
110036b526288Smrg
110046b526288Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
110056b526288Smrg
110066b526288Smrg		eval supported=\$$cacheid
110076b526288Smrg		AC_MSG_RESULT([$supported])
110086b526288Smrg		if test "$supported" = "yes" ; then
110096b526288Smrg			$1="$$1 ]flag["
110106b526288Smrg			found="yes"
110116b526288Smrg		fi
110126b526288Smrg	fi
110136b526288Smrg])
110146b526288Smrg]) # XORG_TESTSET_CFLAG
1101541b2f0bdSmrg
110166b526288Smrg# XORG_COMPILER_FLAGS
110176b526288Smrg# ---------------
110186b526288Smrg# Minimum version: 1.16.0
110196b526288Smrg#
110206b526288Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
110216b526288Smrg# arguments supported by the selected compiler which do NOT alter the generated
110226b526288Smrg# code.  These arguments will cause the compiler to print various warnings
110236b526288Smrg# during compilation AND turn a conservative set of warnings into errors.
110246b526288Smrg#
110256b526288Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
110266b526288Smrg# future versions of util-macros as options are added to new compilers.
110276b526288Smrg#
110286b526288SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
110296b526288SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
110306b526288Smrg
110316b526288SmrgAC_ARG_ENABLE(selective-werror,
110326b526288Smrg              AS_HELP_STRING([--disable-selective-werror],
110336b526288Smrg                             [Turn off selective compiler errors. (default: enabled)]),
110346b526288Smrg              [SELECTIVE_WERROR=$enableval],
110356b526288Smrg              [SELECTIVE_WERROR=yes])
110366b526288Smrg
110376b526288SmrgAC_LANG_CASE(
110386b526288Smrg        [C], [
110396b526288Smrg                define([PREFIX], [C])
110406b526288Smrg        ],
110416b526288Smrg        [C++], [
110426b526288Smrg                define([PREFIX], [CXX])
110436b526288Smrg        ]
110446b526288Smrg)
110456b526288Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
110466b526288Smrgif test "x$SUNCC" = "xyes"; then
110476b526288Smrg    [BASE_]PREFIX[FLAGS]="-v"
110486b526288Smrgelse
110496b526288Smrg    [BASE_]PREFIX[FLAGS]=""
110506b526288Smrgfi
1105141b2f0bdSmrg
110526b526288Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
110536b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
110546b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
110556b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
110566b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
110576b526288Smrg
110586b526288SmrgAC_LANG_CASE(
110596b526288Smrg	[C], [
110606b526288Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
110616b526288Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
110626b526288Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
110636b526288Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
110646b526288Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
110656b526288Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
110666b526288Smrg	]
110676b526288Smrg)
1106811a29bacSmrg
110696b526288Smrg# This chunk adds additional warnings that could catch undesired effects.
110706b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
110716b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
110726b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
110736b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
110746b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
110756b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
110766b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
110776b526288Smrg
110786b526288Smrg# These are currently disabled because they are noisy.  They will be enabled
110796b526288Smrg# in the future once the codebase is sufficiently modernized to silence
110806b526288Smrg# them.  For now, I don't want them to drown out the other warnings.
110816b526288Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
110826b526288Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
110836b526288Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
110846b526288Smrg
110856b526288Smrg# Turn some warnings into errors, so we don't accidently get successful builds
110866b526288Smrg# when there are problems that should be fixed.
110876b526288Smrg
110886b526288Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
110896b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
110906b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
110916b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
110926b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
110936b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
110946b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
110956b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
110966b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
110976b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
110986b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
110996b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
111006b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
111016b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
111026b526288Smrgelse
111036b526288SmrgAC_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])
111046b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
111056b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
111066b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
111076b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
111086b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
111096b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
111106b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
111116b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
111126b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
111136b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
111146b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
111156b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
111166b526288SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
111176b526288Smrgfi
1111841b2f0bdSmrg
111196b526288SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
111206b526288Smrg]) # XORG_COMPILER_FLAGS
1112111245024Smrg
111226b526288Smrg# XORG_CWARNFLAGS
111236b526288Smrg# ---------------
111246b526288Smrg# Minimum version: 1.2.0
111256b526288Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
1112611a29bacSmrg#
111276b526288Smrg# Defines CWARNFLAGS to enable C compiler warnings.
1112811a29bacSmrg#
111296b526288Smrg# This function is deprecated because it defines -fno-strict-aliasing
111306b526288Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
111316b526288Smrg# is needed, then it should be added explicitly in the module when
111326b526288Smrg# it is updated to use BASE_CFLAGS.
111336b526288Smrg#
111346b526288SmrgAC_DEFUN([XORG_CWARNFLAGS], [
111356b526288SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
111366b526288SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
111376b526288SmrgAC_LANG_CASE(
111386b526288Smrg	[C], [
111396b526288Smrg		CWARNFLAGS="$BASE_CFLAGS"
111406b526288Smrg		if  test "x$GCC" = xyes ; then
111416b526288Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
111426b526288Smrg		fi
111436b526288Smrg		AC_SUBST(CWARNFLAGS)
111446b526288Smrg	]
111456b526288Smrg)
111466b526288Smrg]) # XORG_CWARNFLAGS
1114711245024Smrg
111486b526288Smrg# XORG_STRICT_OPTION
111496b526288Smrg# -----------------------
111506b526288Smrg# Minimum version: 1.3.0
111516b526288Smrg#
111526b526288Smrg# Add configure option to enable strict compilation flags, such as treating
111536b526288Smrg# warnings as fatal errors.
111546b526288Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
111556b526288Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
111566b526288Smrg#
111576b526288Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
111586b526288Smrg# when strict compilation is unconditionally desired.
111596b526288SmrgAC_DEFUN([XORG_STRICT_OPTION], [
111606b526288SmrgAC_REQUIRE([XORG_CWARNFLAGS])
111616b526288SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1116241b2f0bdSmrg
111636b526288SmrgAC_ARG_ENABLE(strict-compilation,
111646b526288Smrg			  AS_HELP_STRING([--enable-strict-compilation],
111656b526288Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
111666b526288Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1116741b2f0bdSmrg
111686b526288SmrgAC_LANG_CASE(
111696b526288Smrg        [C], [
111706b526288Smrg                define([PREFIX], [C])
111716b526288Smrg        ],
111726b526288Smrg        [C++], [
111736b526288Smrg                define([PREFIX], [CXX])
111746b526288Smrg        ]
111756b526288Smrg)
1117641b2f0bdSmrg
111776b526288Smrg[STRICT_]PREFIX[FLAGS]=""
111786b526288SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
111796b526288SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
1118041b2f0bdSmrg
111816b526288Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
111826b526288Smrg# activate it with -Werror, so we add it here explicitly.
111836b526288SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
1118441b2f0bdSmrg
111856b526288Smrgif test "x$STRICT_COMPILE" = "xyes"; then
111866b526288Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
111876b526288Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
111886b526288Smrgfi
111896b526288SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
111906b526288SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
111916b526288SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
111926b526288Smrg]) # XORG_STRICT_OPTION
1119341b2f0bdSmrg
111946b526288Smrg# XORG_DEFAULT_OPTIONS
111956b526288Smrg# --------------------
111966b526288Smrg# Minimum version: 1.3.0
111976b526288Smrg#
111986b526288Smrg# Defines default options for X.Org modules.
111996b526288Smrg#
112006b526288SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
112016b526288SmrgAC_REQUIRE([AC_PROG_INSTALL])
112026b526288SmrgXORG_COMPILER_FLAGS
112036b526288SmrgXORG_CWARNFLAGS
112046b526288SmrgXORG_STRICT_OPTION
112056b526288SmrgXORG_RELEASE_VERSION
112066b526288SmrgXORG_CHANGELOG
112076b526288SmrgXORG_INSTALL
112086b526288SmrgXORG_MANPAGE_SECTIONS
112096b526288Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
112106b526288Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
112116b526288Smrg]) # XORG_DEFAULT_OPTIONS
1121241b2f0bdSmrg
112136b526288Smrg# XORG_INSTALL()
112146b526288Smrg# ----------------
112156b526288Smrg# Minimum version: 1.4.0
112166b526288Smrg#
112176b526288Smrg# Defines the variable INSTALL_CMD as the command to copy
112186b526288Smrg# INSTALL from $prefix/share/util-macros.
112196b526288Smrg#
112206b526288SmrgAC_DEFUN([XORG_INSTALL], [
112216b526288SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
112226b526288Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
112236b526288SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
112246b526288Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
112256b526288Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
112266b526288Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
112276b526288SmrgAC_SUBST([INSTALL_CMD])
112286b526288Smrg]) # XORG_INSTALL
112296b526288Smrgdnl Copyright 2005 Red Hat, Inc
112306b526288Smrgdnl
112316b526288Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
112326b526288Smrgdnl documentation for any purpose is hereby granted without fee, provided that
112336b526288Smrgdnl the above copyright notice appear in all copies and that both that
112346b526288Smrgdnl copyright notice and this permission notice appear in supporting
112356b526288Smrgdnl documentation.
112366b526288Smrgdnl
112376b526288Smrgdnl The above copyright notice and this permission notice shall be included
112386b526288Smrgdnl in all copies or substantial portions of the Software.
112396b526288Smrgdnl
112406b526288Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
112416b526288Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
112426b526288Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
112436b526288Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
112446b526288Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
112456b526288Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
112466b526288Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
112476b526288Smrgdnl
112486b526288Smrgdnl Except as contained in this notice, the name of the copyright holders shall
112496b526288Smrgdnl not be used in advertising or otherwise to promote the sale, use or
112506b526288Smrgdnl other dealings in this Software without prior written authorization
112516b526288Smrgdnl from the copyright holders.
112526b526288Smrgdnl
1125311a29bacSmrg
112546b526288Smrg# XORG_RELEASE_VERSION
112556b526288Smrg# --------------------
112566b526288Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1125711a29bacSmrg
112586b526288SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
112596b526288Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
112606b526288Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
112616b526288Smrg		[Major version of this package])
112626b526288Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
112636b526288Smrg	if test "x$PVM" = "x"; then
112646b526288Smrg		PVM="0"
112656b526288Smrg	fi
112666b526288Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
112676b526288Smrg		[$PVM],
112686b526288Smrg		[Minor version of this package])
112696b526288Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
112706b526288Smrg	if test "x$PVP" = "x"; then
112716b526288Smrg		PVP="0"
112726b526288Smrg	fi
112736b526288Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
112746b526288Smrg		[$PVP],
112756b526288Smrg		[Patch version of this package])
1127611a29bacSmrg])
1127741b2f0bdSmrg
112786b526288Smrg# XORG_CHANGELOG()
112796b526288Smrg# ----------------
112806b526288Smrg# Minimum version: 1.2.0
112816b526288Smrg#
112826b526288Smrg# Defines the variable CHANGELOG_CMD as the command to generate
112836b526288Smrg# ChangeLog from git.
112846b526288Smrg#
112856b526288Smrg#
112866b526288SmrgAC_DEFUN([XORG_CHANGELOG], [
112876b526288SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
112886b526288Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
112896b526288Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
112906b526288Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
112916b526288SmrgAC_SUBST([CHANGELOG_CMD])
112926b526288Smrg]) # XORG_CHANGELOG
1129341b2f0bdSmrg
112946b526288Smrg# Copyright (C) 2002-2017 Free Software Foundation, Inc.
112956b526288Smrg#
112966b526288Smrg# This file is free software; the Free Software Foundation
112976b526288Smrg# gives unlimited permission to copy and/or distribute it,
112986b526288Smrg# with or without modifications, as long as this notice is preserved.
1129911a29bacSmrg
113006b526288Smrg# AM_AUTOMAKE_VERSION(VERSION)
113016b526288Smrg# ----------------------------
113026b526288Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
113036b526288Smrg# generated from the m4 files accompanying Automake X.Y.
113046b526288Smrg# (This private macro should not be called outside this file.)
113056b526288SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
113066b526288Smrg[am__api_version='1.15'
113076b526288Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
113086b526288Smrgdnl require some minimum version.  Point them to the right macro.
113096b526288Smrgm4_if([$1], [1.15.1], [],
113106b526288Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
113116b526288Smrg])
1131211a29bacSmrg
113136b526288Smrg# _AM_AUTOCONF_VERSION(VERSION)
113146b526288Smrg# -----------------------------
113156b526288Smrg# aclocal traces this macro to find the Autoconf version.
113166b526288Smrg# This is a private macro too.  Using m4_define simplifies
113176b526288Smrg# the logic in aclocal, which can simply ignore this definition.
113186b526288Smrgm4_define([_AM_AUTOCONF_VERSION], [])
1131941b2f0bdSmrg
113206b526288Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
113216b526288Smrg# -------------------------------
113226b526288Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
113236b526288Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
113246b526288SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
113256b526288Smrg[AM_AUTOMAKE_VERSION([1.15.1])dnl
113266b526288Smrgm4_ifndef([AC_AUTOCONF_VERSION],
113276b526288Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
113286b526288Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1132941b2f0bdSmrg
113306b526288Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
1133141b2f0bdSmrg
113326b526288Smrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
113336b526288Smrg#
113346b526288Smrg# This file is free software; the Free Software Foundation
113356b526288Smrg# gives unlimited permission to copy and/or distribute it,
113366b526288Smrg# with or without modifications, as long as this notice is preserved.
1133741b2f0bdSmrg
113386b526288Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
113396b526288Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
113406b526288Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
113416b526288Smrg#
113426b526288Smrg# Of course, Automake must honor this variable whenever it calls a
113436b526288Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
113446b526288Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
113456b526288Smrg# depending on how configure is run.  This is pretty annoying, since
113466b526288Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
113476b526288Smrg# source directory, any form will work fine, but in subdirectories a
113486b526288Smrg# relative path needs to be adjusted first.
113496b526288Smrg#
113506b526288Smrg# $ac_aux_dir/missing
113516b526288Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
113526b526288Smrg# $top_srcdir/$ac_aux_dir/missing
113536b526288Smrg#    fails if $ac_aux_dir is absolute,
113546b526288Smrg#    fails when called from a subdirectory in a VPATH build with
113556b526288Smrg#          a relative $ac_aux_dir
113566b526288Smrg#
113576b526288Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
113586b526288Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
113596b526288Smrg# harmless because $srcdir is '.', but things will broke when you
113606b526288Smrg# start a VPATH build or use an absolute $srcdir.
113616b526288Smrg#
113626b526288Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
113636b526288Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
113646b526288Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
113656b526288Smrg# and then we would define $MISSING as
113666b526288Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
113676b526288Smrg# This will work as long as MISSING is not called from configure, because
113686b526288Smrg# unfortunately $(top_srcdir) has no meaning in configure.
113696b526288Smrg# However there are other variables, like CC, which are often used in
113706b526288Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
113716b526288Smrg#
113726b526288Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
113736b526288Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
113746b526288Smrg# configured tree to be moved without reconfiguration.
1137541b2f0bdSmrg
113766b526288SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
113776b526288Smrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
113786b526288Smrg# Expand $ac_aux_dir to an absolute path.
113796b526288Smrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
1138011a29bacSmrg])
1138141b2f0bdSmrg
113826b526288Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1138341b2f0bdSmrg
113846b526288Smrg# Copyright (C) 1997-2017 Free Software Foundation, Inc.
113856b526288Smrg#
113866b526288Smrg# This file is free software; the Free Software Foundation
113876b526288Smrg# gives unlimited permission to copy and/or distribute it,
113886b526288Smrg# with or without modifications, as long as this notice is preserved.
1138941b2f0bdSmrg
113906b526288Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
113916b526288Smrg# -------------------------------------
113926b526288Smrg# Define a conditional.
113936b526288SmrgAC_DEFUN([AM_CONDITIONAL],
113946b526288Smrg[AC_PREREQ([2.52])dnl
113956b526288Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
113966b526288Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
113976b526288SmrgAC_SUBST([$1_TRUE])dnl
113986b526288SmrgAC_SUBST([$1_FALSE])dnl
113996b526288Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
114006b526288Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
114016b526288Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
114026b526288Smrgif $2; then
114036b526288Smrg  $1_TRUE=
114046b526288Smrg  $1_FALSE='#'
114056b526288Smrgelse
114066b526288Smrg  $1_TRUE='#'
114076b526288Smrg  $1_FALSE=
114086b526288Smrgfi
114096b526288SmrgAC_CONFIG_COMMANDS_PRE(
114106b526288Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
114116b526288Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
114126b526288SmrgUsually this means the macro was only invoked conditionally.]])
114136b526288Smrgfi])])
1141441b2f0bdSmrg
114156b526288Smrg# Copyright (C) 1999-2017 Free Software Foundation, Inc.
114166b526288Smrg#
114176b526288Smrg# This file is free software; the Free Software Foundation
114186b526288Smrg# gives unlimited permission to copy and/or distribute it,
114196b526288Smrg# with or without modifications, as long as this notice is preserved.
1142041b2f0bdSmrg
1142141b2f0bdSmrg
114226b526288Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
114236b526288Smrg# written in clear, in which case automake, when reading aclocal.m4,
114246b526288Smrg# will think it sees a *use*, and therefore will trigger all it's
114256b526288Smrg# C support machinery.  Also note that it means that autoscan, seeing
114266b526288Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1142741b2f0bdSmrg
1142841b2f0bdSmrg
114296b526288Smrg# _AM_DEPENDENCIES(NAME)
114306b526288Smrg# ----------------------
114316b526288Smrg# See how the compiler implements dependency checking.
114326b526288Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
114336b526288Smrg# We try a few techniques and use that to set a single cache variable.
114346b526288Smrg#
114356b526288Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
114366b526288Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
114376b526288Smrg# dependency, and given that the user is not expected to run this macro,
114386b526288Smrg# just rely on AC_PROG_CC.
114396b526288SmrgAC_DEFUN([_AM_DEPENDENCIES],
114406b526288Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
114416b526288SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
114426b526288SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
114436b526288SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1144441b2f0bdSmrg
114456b526288Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
114466b526288Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
114476b526288Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
114486b526288Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
114496b526288Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
114506b526288Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
114516b526288Smrg                    [depcc="$$1"   am_compiler_list=])
1145241b2f0bdSmrg
114536b526288SmrgAC_CACHE_CHECK([dependency style of $depcc],
114546b526288Smrg               [am_cv_$1_dependencies_compiler_type],
114556b526288Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
114566b526288Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
114576b526288Smrg  # making bogus files that we don't know about and never remove.  For
114586b526288Smrg  # instance it was reported that on HP-UX the gcc test will end up
114596b526288Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
114606b526288Smrg  # in D".
114616b526288Smrg  rm -rf conftest.dir
114626b526288Smrg  mkdir conftest.dir
114636b526288Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
114646b526288Smrg  # using a relative directory.
114656b526288Smrg  cp "$am_depcomp" conftest.dir
114666b526288Smrg  cd conftest.dir
114676b526288Smrg  # We will build objects and dependencies in a subdirectory because
114686b526288Smrg  # it helps to detect inapplicable dependency modes.  For instance
114696b526288Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
114706b526288Smrg  # side effect of compilation, but ICC will put the dependencies in
114716b526288Smrg  # the current directory while Tru64 will put them in the object
114726b526288Smrg  # directory.
114736b526288Smrg  mkdir sub
1147441b2f0bdSmrg
114756b526288Smrg  am_cv_$1_dependencies_compiler_type=none
114766b526288Smrg  if test "$am_compiler_list" = ""; then
114776b526288Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
114786b526288Smrg  fi
114796b526288Smrg  am__universal=false
114806b526288Smrg  m4_case([$1], [CC],
114816b526288Smrg    [case " $depcc " in #(
114826b526288Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
114836b526288Smrg     esac],
114846b526288Smrg    [CXX],
114856b526288Smrg    [case " $depcc " in #(
114866b526288Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
114876b526288Smrg     esac])
1148841b2f0bdSmrg
114896b526288Smrg  for depmode in $am_compiler_list; do
114906b526288Smrg    # Setup a source with many dependencies, because some compilers
114916b526288Smrg    # like to wrap large dependency lists on column 80 (with \), and
114926b526288Smrg    # we should not choose a depcomp mode which is confused by this.
114936b526288Smrg    #
114946b526288Smrg    # We need to recreate these files for each test, as the compiler may
114956b526288Smrg    # overwrite some of them when testing with obscure command lines.
114966b526288Smrg    # This happens at least with the AIX C compiler.
114976b526288Smrg    : > sub/conftest.c
114986b526288Smrg    for i in 1 2 3 4 5 6; do
114996b526288Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
115006b526288Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
115016b526288Smrg      # Solaris 10 /bin/sh.
115026b526288Smrg      echo '/* dummy */' > sub/conftst$i.h
115036b526288Smrg    done
115046b526288Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1150541b2f0bdSmrg
115066b526288Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
115076b526288Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
115086b526288Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
115096b526288Smrg    # versions had trouble with output in subdirs.
115106b526288Smrg    am__obj=sub/conftest.${OBJEXT-o}
115116b526288Smrg    am__minus_obj="-o $am__obj"
115126b526288Smrg    case $depmode in
115136b526288Smrg    gcc)
115146b526288Smrg      # This depmode causes a compiler race in universal mode.
115156b526288Smrg      test "$am__universal" = false || continue
115166b526288Smrg      ;;
115176b526288Smrg    nosideeffect)
115186b526288Smrg      # After this tag, mechanisms are not by side-effect, so they'll
115196b526288Smrg      # only be used when explicitly requested.
115206b526288Smrg      if test "x$enable_dependency_tracking" = xyes; then
115216b526288Smrg	continue
115226b526288Smrg      else
115236b526288Smrg	break
115246b526288Smrg      fi
115256b526288Smrg      ;;
115266b526288Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
115276b526288Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
115286b526288Smrg      # not run yet.  These depmodes are late enough in the game, and
115296b526288Smrg      # so weak that their functioning should not be impacted.
115306b526288Smrg      am__obj=conftest.${OBJEXT-o}
115316b526288Smrg      am__minus_obj=
115326b526288Smrg      ;;
115336b526288Smrg    none) break ;;
115346b526288Smrg    esac
115356b526288Smrg    if depmode=$depmode \
115366b526288Smrg       source=sub/conftest.c object=$am__obj \
115376b526288Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
115386b526288Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
115396b526288Smrg         >/dev/null 2>conftest.err &&
115406b526288Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
115416b526288Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
115426b526288Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
115436b526288Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
115446b526288Smrg      # icc doesn't choke on unknown options, it will just issue warnings
115456b526288Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
115466b526288Smrg      # that says an option was ignored or not supported.
115476b526288Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
115486b526288Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
115496b526288Smrg      # The diagnosis changed in icc 8.0:
115506b526288Smrg      #   icc: Command line remark: option '-MP' not supported
115516b526288Smrg      if (grep 'ignoring option' conftest.err ||
115526b526288Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
115536b526288Smrg        am_cv_$1_dependencies_compiler_type=$depmode
115546b526288Smrg        break
115556b526288Smrg      fi
115566b526288Smrg    fi
115576b526288Smrg  done
1155841b2f0bdSmrg
115596b526288Smrg  cd ..
115606b526288Smrg  rm -rf conftest.dir
115616b526288Smrgelse
115626b526288Smrg  am_cv_$1_dependencies_compiler_type=none
115636b526288Smrgfi
1156411a29bacSmrg])
115656b526288SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
115666b526288SmrgAM_CONDITIONAL([am__fastdep$1], [
115676b526288Smrg  test "x$enable_dependency_tracking" != xno \
115686b526288Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1156911a29bacSmrg])
1157041b2f0bdSmrg
1157141b2f0bdSmrg
115726b526288Smrg# AM_SET_DEPDIR
115736b526288Smrg# -------------
115746b526288Smrg# Choose a directory name for dependency files.
115756b526288Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
115766b526288SmrgAC_DEFUN([AM_SET_DEPDIR],
115776b526288Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
115786b526288SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
115796b526288Smrg])
115806b526288Smrg
1158141b2f0bdSmrg
115826b526288Smrg# AM_DEP_TRACK
115836b526288Smrg# ------------
115846b526288SmrgAC_DEFUN([AM_DEP_TRACK],
115856b526288Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
115866b526288SmrgAS_HELP_STRING(
115876b526288Smrg  [--enable-dependency-tracking],
115886b526288Smrg  [do not reject slow dependency extractors])
115896b526288SmrgAS_HELP_STRING(
115906b526288Smrg  [--disable-dependency-tracking],
115916b526288Smrg  [speeds up one-time build])])
115926b526288Smrgif test "x$enable_dependency_tracking" != xno; then
115936b526288Smrg  am_depcomp="$ac_aux_dir/depcomp"
115946b526288Smrg  AMDEPBACKSLASH='\'
115956b526288Smrg  am__nodep='_no'
115966b526288Smrgfi
115976b526288SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
115986b526288SmrgAC_SUBST([AMDEPBACKSLASH])dnl
115996b526288Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
116006b526288SmrgAC_SUBST([am__nodep])dnl
116016b526288Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
116026b526288Smrg])
1160341b2f0bdSmrg
116046b526288Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
1160541b2f0bdSmrg
116066b526288Smrg# Copyright (C) 1999-2017 Free Software Foundation, Inc.
116076b526288Smrg#
116086b526288Smrg# This file is free software; the Free Software Foundation
116096b526288Smrg# gives unlimited permission to copy and/or distribute it,
116106b526288Smrg# with or without modifications, as long as this notice is preserved.
1161141b2f0bdSmrg
1161241b2f0bdSmrg
116136b526288Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
116146b526288Smrg# ------------------------------
116156b526288SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
116166b526288Smrg[{
116176b526288Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
116186b526288Smrg  # are listed without --file.  Let's play safe and only enable the eval
116196b526288Smrg  # if we detect the quoting.
116206b526288Smrg  case $CONFIG_FILES in
116216b526288Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
116226b526288Smrg  *)   set x $CONFIG_FILES ;;
116236b526288Smrg  esac
116246b526288Smrg  shift
116256b526288Smrg  for mf
116266b526288Smrg  do
116276b526288Smrg    # Strip MF so we end up with the name of the file.
116286b526288Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
116296b526288Smrg    # Check whether this is an Automake generated Makefile or not.
116306b526288Smrg    # We used to match only the files named 'Makefile.in', but
116316b526288Smrg    # some people rename them; so instead we look at the file content.
116326b526288Smrg    # Grep'ing the first line is not enough: some people post-process
116336b526288Smrg    # each Makefile.in and add a new line on top of each file to say so.
116346b526288Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
116356b526288Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
116366b526288Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
116376b526288Smrg      dirpart=`AS_DIRNAME("$mf")`
116386b526288Smrg    else
116396b526288Smrg      continue
116406b526288Smrg    fi
116416b526288Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
116426b526288Smrg    # from the Makefile without running 'make'.
116436b526288Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
116446b526288Smrg    test -z "$DEPDIR" && continue
116456b526288Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
116466b526288Smrg    test -z "$am__include" && continue
116476b526288Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
116486b526288Smrg    # Find all dependency output files, they are included files with
116496b526288Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
116506b526288Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
116516b526288Smrg    # expansion.
116526b526288Smrg    for file in `sed -n "
116536b526288Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
116546b526288Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
116556b526288Smrg      # Make sure the directory exists.
116566b526288Smrg      test -f "$dirpart/$file" && continue
116576b526288Smrg      fdir=`AS_DIRNAME(["$file"])`
116586b526288Smrg      AS_MKDIR_P([$dirpart/$fdir])
116596b526288Smrg      # echo "creating $dirpart/$file"
116606b526288Smrg      echo '# dummy' > "$dirpart/$file"
116616b526288Smrg    done
116626b526288Smrg  done
116636b526288Smrg}
116646b526288Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1166541b2f0bdSmrg
1166641b2f0bdSmrg
116676b526288Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
116686b526288Smrg# -----------------------------
116696b526288Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
116706b526288Smrg#
116716b526288Smrg# This code is only required when automatic dependency tracking
116726b526288Smrg# is enabled.  FIXME.  This creates each '.P' file that we will
116736b526288Smrg# need in order to bootstrap the dependency handling code.
116746b526288SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
116756b526288Smrg[AC_CONFIG_COMMANDS([depfiles],
116766b526288Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
116776b526288Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1167811a29bacSmrg])
1167941b2f0bdSmrg
116806b526288Smrg# Do all the work for Automake.                             -*- Autoconf -*-
1168141b2f0bdSmrg
116826b526288Smrg# Copyright (C) 1996-2017 Free Software Foundation, Inc.
116836b526288Smrg#
116846b526288Smrg# This file is free software; the Free Software Foundation
116856b526288Smrg# gives unlimited permission to copy and/or distribute it,
116866b526288Smrg# with or without modifications, as long as this notice is preserved.
1168741b2f0bdSmrg
116886b526288Smrg# This macro actually does too much.  Some checks are only needed if
116896b526288Smrg# your package does certain things.  But this isn't really a big deal.
1169041b2f0bdSmrg
116916b526288Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
116926b526288Smrgm4_define([AC_PROG_CC],
116936b526288Smrgm4_defn([AC_PROG_CC])
116946b526288Smrg[_AM_PROG_CC_C_O
116956b526288Smrg])
1169641b2f0bdSmrg
116976b526288Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
116986b526288Smrg# AM_INIT_AUTOMAKE([OPTIONS])
116996b526288Smrg# -----------------------------------------------
117006b526288Smrg# The call with PACKAGE and VERSION arguments is the old style
117016b526288Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
117026b526288Smrg# and VERSION should now be passed to AC_INIT and removed from
117036b526288Smrg# the call to AM_INIT_AUTOMAKE.
117046b526288Smrg# We support both call styles for the transition.  After
117056b526288Smrg# the next Automake release, Autoconf can make the AC_INIT
117066b526288Smrg# arguments mandatory, and then we can depend on a new Autoconf
117076b526288Smrg# release and drop the old call support.
117086b526288SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
117096b526288Smrg[AC_PREREQ([2.65])dnl
117106b526288Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
117116b526288Smrgdnl the ones we care about.
117126b526288Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
117136b526288SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
117146b526288SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
117156b526288Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
117166b526288Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
117176b526288Smrg  # is not polluted with repeated "-I."
117186b526288Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
117196b526288Smrg  # test to see if srcdir already configured
117206b526288Smrg  if test -f $srcdir/config.status; then
117216b526288Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
117226b526288Smrg  fi
117236b526288Smrgfi
1172441b2f0bdSmrg
117256b526288Smrg# test whether we have cygpath
117266b526288Smrgif test -z "$CYGPATH_W"; then
117276b526288Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
117286b526288Smrg    CYGPATH_W='cygpath -w'
117296b526288Smrg  else
117306b526288Smrg    CYGPATH_W=echo
117316b526288Smrg  fi
117326b526288Smrgfi
117336b526288SmrgAC_SUBST([CYGPATH_W])
1173441b2f0bdSmrg
117356b526288Smrg# Define the identity of the package.
117366b526288Smrgdnl Distinguish between old-style and new-style calls.
117376b526288Smrgm4_ifval([$2],
117386b526288Smrg[AC_DIAGNOSE([obsolete],
117396b526288Smrg             [$0: two- and three-arguments forms are deprecated.])
117406b526288Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
117416b526288Smrg AC_SUBST([PACKAGE], [$1])dnl
117426b526288Smrg AC_SUBST([VERSION], [$2])],
117436b526288Smrg[_AM_SET_OPTIONS([$1])dnl
117446b526288Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
117456b526288Smrgm4_if(
117466b526288Smrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
117476b526288Smrg  [ok:ok],,
117486b526288Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
117496b526288Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
117506b526288Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1175141b2f0bdSmrg
117526b526288Smrg_AM_IF_OPTION([no-define],,
117536b526288Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
117546b526288Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
1175541b2f0bdSmrg
117566b526288Smrg# Some tools Automake needs.
117576b526288SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
117586b526288SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
117596b526288SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
117606b526288SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
117616b526288SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
117626b526288SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
117636b526288SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
117646b526288SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
117656b526288SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
117666b526288SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
117676b526288Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
117686b526288Smrg# dies out for good.  For more background, see:
117696b526288Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
117706b526288Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
117716b526288SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
117726b526288Smrg# We need awk for the "check" target (and possibly the TAP driver).  The
117736b526288Smrg# system "awk" is bad on some platforms.
117746b526288SmrgAC_REQUIRE([AC_PROG_AWK])dnl
117756b526288SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
117766b526288SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
117776b526288Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
117786b526288Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
117796b526288Smrg			     [_AM_PROG_TAR([v7])])])
117806b526288Smrg_AM_IF_OPTION([no-dependencies],,
117816b526288Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
117826b526288Smrg		  [_AM_DEPENDENCIES([CC])],
117836b526288Smrg		  [m4_define([AC_PROG_CC],
117846b526288Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
117856b526288SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
117866b526288Smrg		  [_AM_DEPENDENCIES([CXX])],
117876b526288Smrg		  [m4_define([AC_PROG_CXX],
117886b526288Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
117896b526288SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
117906b526288Smrg		  [_AM_DEPENDENCIES([OBJC])],
117916b526288Smrg		  [m4_define([AC_PROG_OBJC],
117926b526288Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
117936b526288SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
117946b526288Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
117956b526288Smrg		  [m4_define([AC_PROG_OBJCXX],
117966b526288Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
1179711a29bacSmrg])
117986b526288SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
117996b526288Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
118006b526288Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
118016b526288Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
118026b526288SmrgAC_CONFIG_COMMANDS_PRE(dnl
118036b526288Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
118046b526288Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1180541b2f0bdSmrg
118066b526288Smrg# POSIX will say in a future version that running "rm -f" with no argument
118076b526288Smrg# is OK; and we want to be able to make that assumption in our Makefile
118086b526288Smrg# recipes.  So use an aggressive probe to check that the usage we want is
118096b526288Smrg# actually supported "in the wild" to an acceptable degree.
118106b526288Smrg# See automake bug#10828.
118116b526288Smrg# To make any issue more visible, cause the running configure to be aborted
118126b526288Smrg# by default if the 'rm' program in use doesn't match our expectations; the
118136b526288Smrg# user can still override this though.
118146b526288Smrgif rm -f && rm -fr && rm -rf; then : OK; else
118156b526288Smrg  cat >&2 <<'END'
118166b526288SmrgOops!
118176b526288Smrg
118186b526288SmrgYour 'rm' program seems unable to run without file operands specified
118196b526288Smrgon the command line, even when the '-f' option is present.  This is contrary
118206b526288Smrgto the behaviour of most rm programs out there, and not conforming with
118216b526288Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
118226b526288Smrg
118236b526288SmrgPlease tell bug-automake@gnu.org about your system, including the value
118246b526288Smrgof your $PATH and any error possibly output before this message.  This
118256b526288Smrgcan help us improve future automake versions.
1182641b2f0bdSmrg
118276b526288SmrgEND
118286b526288Smrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
118296b526288Smrg    echo 'Configuration will proceed anyway, since you have set the' >&2
118306b526288Smrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
118316b526288Smrg    echo >&2
118326b526288Smrg  else
118336b526288Smrg    cat >&2 <<'END'
118346b526288SmrgAborting the configuration process, to ensure you take notice of the issue.
1183541b2f0bdSmrg
118366b526288SmrgYou can download and install GNU coreutils to get an 'rm' implementation
118376b526288Smrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
1183841b2f0bdSmrg
118396b526288SmrgIf you want to complete the configuration process using your problematic
118406b526288Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
118416b526288Smrgto "yes", and re-run configure.
1184241b2f0bdSmrg
118436b526288SmrgEND
118446b526288Smrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
118456b526288Smrg  fi
118466b526288Smrgfi
118476b526288Smrgdnl The trailing newline in this macro's definition is deliberate, for
118486b526288Smrgdnl backward compatibility and to allow trailing 'dnl'-style comments
118496b526288Smrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
1185011a29bacSmrg])
1185141b2f0bdSmrg
118526b526288Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
118536b526288Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
118546b526288Smrgdnl mangled by Autoconf and run in a shell conditional statement.
118556b526288Smrgm4_define([_AC_COMPILER_EXEEXT],
118566b526288Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1185741b2f0bdSmrg
118586b526288Smrg# When config.status generates a header, we must update the stamp-h file.
118596b526288Smrg# This file resides in the same directory as the config header
118606b526288Smrg# that is generated.  The stamp files are numbered to have different names.
1186141b2f0bdSmrg
118626b526288Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
118636b526288Smrg# loop where config.status creates the headers, so we can generate
118646b526288Smrg# our stamp files there.
118656b526288SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
118666b526288Smrg[# Compute $1's index in $config_headers.
118676b526288Smrg_am_arg=$1
118686b526288Smrg_am_stamp_count=1
118696b526288Smrgfor _am_header in $config_headers :; do
118706b526288Smrg  case $_am_header in
118716b526288Smrg    $_am_arg | $_am_arg:* )
118726b526288Smrg      break ;;
118736b526288Smrg    * )
118746b526288Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
118756b526288Smrg  esac
118766b526288Smrgdone
118776b526288Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1187841b2f0bdSmrg
118796b526288Smrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
1188011245024Smrg#
118816b526288Smrg# This file is free software; the Free Software Foundation
118826b526288Smrg# gives unlimited permission to copy and/or distribute it,
118836b526288Smrg# with or without modifications, as long as this notice is preserved.
1188441b2f0bdSmrg
118856b526288Smrg# AM_PROG_INSTALL_SH
118866b526288Smrg# ------------------
118876b526288Smrg# Define $install_sh.
118886b526288SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
118896b526288Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
118906b526288Smrgif test x"${install_sh+set}" != xset; then
118916b526288Smrg  case $am_aux_dir in
118926b526288Smrg  *\ * | *\	*)
118936b526288Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
118946b526288Smrg  *)
118956b526288Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
118966b526288Smrg  esac
118976b526288Smrgfi
118986b526288SmrgAC_SUBST([install_sh])])
1189941b2f0bdSmrg
119006b526288Smrg# Copyright (C) 2003-2017 Free Software Foundation, Inc.
119016b526288Smrg#
119026b526288Smrg# This file is free software; the Free Software Foundation
119036b526288Smrg# gives unlimited permission to copy and/or distribute it,
119046b526288Smrg# with or without modifications, as long as this notice is preserved.
1190511a29bacSmrg
119066b526288Smrg# Check whether the underlying file-system supports filenames
119076b526288Smrg# with a leading dot.  For instance MS-DOS doesn't.
119086b526288SmrgAC_DEFUN([AM_SET_LEADING_DOT],
119096b526288Smrg[rm -rf .tst 2>/dev/null
119106b526288Smrgmkdir .tst 2>/dev/null
119116b526288Smrgif test -d .tst; then
119126b526288Smrg  am__leading_dot=.
119136b526288Smrgelse
119146b526288Smrg  am__leading_dot=_
119156b526288Smrgfi
119166b526288Smrgrmdir .tst 2>/dev/null
119176b526288SmrgAC_SUBST([am__leading_dot])])
1191811a29bacSmrg
119196b526288Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
1192011a29bacSmrg
119216b526288Smrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
119226b526288Smrg#
119236b526288Smrg# This file is free software; the Free Software Foundation
119246b526288Smrg# gives unlimited permission to copy and/or distribute it,
119256b526288Smrg# with or without modifications, as long as this notice is preserved.
1192611a29bacSmrg
119276b526288Smrg# AM_MAKE_INCLUDE()
119286b526288Smrg# -----------------
119296b526288Smrg# Check to see how make treats includes.
119306b526288SmrgAC_DEFUN([AM_MAKE_INCLUDE],
119316b526288Smrg[am_make=${MAKE-make}
119326b526288Smrgcat > confinc << 'END'
119336b526288Smrgam__doit:
119346b526288Smrg	@echo this is the am__doit target
119356b526288Smrg.PHONY: am__doit
119366b526288SmrgEND
119376b526288Smrg# If we don't find an include directive, just comment out the code.
119386b526288SmrgAC_MSG_CHECKING([for style of include used by $am_make])
119396b526288Smrgam__include="#"
119406b526288Smrgam__quote=
119416b526288Smrg_am_result=none
119426b526288Smrg# First try GNU make style include.
119436b526288Smrgecho "include confinc" > confmf
119446b526288Smrg# Ignore all kinds of additional output from 'make'.
119456b526288Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
119466b526288Smrg*the\ am__doit\ target*)
119476b526288Smrg  am__include=include
119486b526288Smrg  am__quote=
119496b526288Smrg  _am_result=GNU
119506b526288Smrg  ;;
119516b526288Smrgesac
119526b526288Smrg# Now try BSD make style include.
119536b526288Smrgif test "$am__include" = "#"; then
119546b526288Smrg   echo '.include "confinc"' > confmf
119556b526288Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
119566b526288Smrg   *the\ am__doit\ target*)
119576b526288Smrg     am__include=.include
119586b526288Smrg     am__quote="\""
119596b526288Smrg     _am_result=BSD
119606b526288Smrg     ;;
119616b526288Smrg   esac
119626b526288Smrgfi
119636b526288SmrgAC_SUBST([am__include])
119646b526288SmrgAC_SUBST([am__quote])
119656b526288SmrgAC_MSG_RESULT([$_am_result])
119666b526288Smrgrm -f confinc confmf
119676b526288Smrg])
1196811a29bacSmrg
119696b526288Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1197011a29bacSmrg
119716b526288Smrg# Copyright (C) 1997-2017 Free Software Foundation, Inc.
1197211245024Smrg#
119736b526288Smrg# This file is free software; the Free Software Foundation
119746b526288Smrg# gives unlimited permission to copy and/or distribute it,
119756b526288Smrg# with or without modifications, as long as this notice is preserved.
1197611a29bacSmrg
119776b526288Smrg# AM_MISSING_PROG(NAME, PROGRAM)
119786b526288Smrg# ------------------------------
119796b526288SmrgAC_DEFUN([AM_MISSING_PROG],
119806b526288Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
119816b526288Smrg$1=${$1-"${am_missing_run}$2"}
119826b526288SmrgAC_SUBST($1)])
1198311a29bacSmrg
119846b526288Smrg# AM_MISSING_HAS_RUN
119856b526288Smrg# ------------------
119866b526288Smrg# Define MISSING if not defined so far and test if it is modern enough.
119876b526288Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
119886b526288SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
119896b526288Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
119906b526288SmrgAC_REQUIRE_AUX_FILE([missing])dnl
119916b526288Smrgif test x"${MISSING+set}" != xset; then
119926b526288Smrg  case $am_aux_dir in
119936b526288Smrg  *\ * | *\	*)
119946b526288Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
119956b526288Smrg  *)
119966b526288Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
119976b526288Smrg  esac
119986b526288Smrgfi
119996b526288Smrg# Use eval to expand $SHELL
120006b526288Smrgif eval "$MISSING --is-lightweight"; then
120016b526288Smrg  am_missing_run="$MISSING "
120026b526288Smrgelse
120036b526288Smrg  am_missing_run=
120046b526288Smrg  AC_MSG_WARN(['missing' script is too old or missing])
120056b526288Smrgfi
120066b526288Smrg])
1200711a29bacSmrg
120086b526288Smrg# Helper functions for option handling.                     -*- Autoconf -*-
1200911a29bacSmrg
120106b526288Smrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
120116b526288Smrg#
120126b526288Smrg# This file is free software; the Free Software Foundation
120136b526288Smrg# gives unlimited permission to copy and/or distribute it,
120146b526288Smrg# with or without modifications, as long as this notice is preserved.
1201511a29bacSmrg
120166b526288Smrg# _AM_MANGLE_OPTION(NAME)
120176b526288Smrg# -----------------------
120186b526288SmrgAC_DEFUN([_AM_MANGLE_OPTION],
120196b526288Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1202011a29bacSmrg
120216b526288Smrg# _AM_SET_OPTION(NAME)
120226b526288Smrg# --------------------
120236b526288Smrg# Set option NAME.  Presently that only means defining a flag for this option.
120246b526288SmrgAC_DEFUN([_AM_SET_OPTION],
120256b526288Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
1202641b2f0bdSmrg
120276b526288Smrg# _AM_SET_OPTIONS(OPTIONS)
120286b526288Smrg# ------------------------
120296b526288Smrg# OPTIONS is a space-separated list of Automake options.
120306b526288SmrgAC_DEFUN([_AM_SET_OPTIONS],
120316b526288Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1203241b2f0bdSmrg
120336b526288Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
120346b526288Smrg# -------------------------------------------
120356b526288Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
120366b526288SmrgAC_DEFUN([_AM_IF_OPTION],
120376b526288Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1203841b2f0bdSmrg
120396b526288Smrg# Copyright (C) 1999-2017 Free Software Foundation, Inc.
120406b526288Smrg#
120416b526288Smrg# This file is free software; the Free Software Foundation
120426b526288Smrg# gives unlimited permission to copy and/or distribute it,
120436b526288Smrg# with or without modifications, as long as this notice is preserved.
1204441b2f0bdSmrg
120456b526288Smrg# _AM_PROG_CC_C_O
120466b526288Smrg# ---------------
120476b526288Smrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
120486b526288Smrg# to automatically call this.
120496b526288SmrgAC_DEFUN([_AM_PROG_CC_C_O],
120506b526288Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
120516b526288SmrgAC_REQUIRE_AUX_FILE([compile])dnl
120526b526288SmrgAC_LANG_PUSH([C])dnl
120536b526288SmrgAC_CACHE_CHECK(
120546b526288Smrg  [whether $CC understands -c and -o together],
120556b526288Smrg  [am_cv_prog_cc_c_o],
120566b526288Smrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
120576b526288Smrg  # Make sure it works both with $CC and with simple cc.
120586b526288Smrg  # Following AC_PROG_CC_C_O, we do the test twice because some
120596b526288Smrg  # compilers refuse to overwrite an existing .o file with -o,
120606b526288Smrg  # though they will create one.
120616b526288Smrg  am_cv_prog_cc_c_o=yes
120626b526288Smrg  for am_i in 1 2; do
120636b526288Smrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
120646b526288Smrg         && test -f conftest2.$ac_objext; then
120656b526288Smrg      : OK
120666b526288Smrg    else
120676b526288Smrg      am_cv_prog_cc_c_o=no
120686b526288Smrg      break
120696b526288Smrg    fi
120706b526288Smrg  done
120716b526288Smrg  rm -f core conftest*
120726b526288Smrg  unset am_i])
120736b526288Smrgif test "$am_cv_prog_cc_c_o" != yes; then
120746b526288Smrg   # Losing compiler, so override with the script.
120756b526288Smrg   # FIXME: It is wrong to rewrite CC.
120766b526288Smrg   # But if we don't then we get into trouble of one sort or another.
120776b526288Smrg   # A longer-term fix would be to have automake use am__CC in this case,
120786b526288Smrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
120796b526288Smrg   CC="$am_aux_dir/compile $CC"
120806b526288Smrgfi
120816b526288SmrgAC_LANG_POP([C])])
1208241b2f0bdSmrg
120836b526288Smrg# For backward compatibility.
120846b526288SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
1208541b2f0bdSmrg
120866b526288Smrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
120876b526288Smrg#
120886b526288Smrg# This file is free software; the Free Software Foundation
120896b526288Smrg# gives unlimited permission to copy and/or distribute it,
120906b526288Smrg# with or without modifications, as long as this notice is preserved.
1209141b2f0bdSmrg
120926b526288Smrg# AM_RUN_LOG(COMMAND)
120936b526288Smrg# -------------------
120946b526288Smrg# Run COMMAND, save the exit status in ac_status, and log it.
120956b526288Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
120966b526288SmrgAC_DEFUN([AM_RUN_LOG],
120976b526288Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
120986b526288Smrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
120996b526288Smrg   ac_status=$?
121006b526288Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
121016b526288Smrg   (exit $ac_status); }])
1210241b2f0bdSmrg
121036b526288Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
1210441b2f0bdSmrg
121056b526288Smrg# Copyright (C) 1996-2017 Free Software Foundation, Inc.
1210611a29bacSmrg#
121076b526288Smrg# This file is free software; the Free Software Foundation
121086b526288Smrg# gives unlimited permission to copy and/or distribute it,
121096b526288Smrg# with or without modifications, as long as this notice is preserved.
1211041b2f0bdSmrg
121116b526288Smrg# AM_SANITY_CHECK
121126b526288Smrg# ---------------
121136b526288SmrgAC_DEFUN([AM_SANITY_CHECK],
121146b526288Smrg[AC_MSG_CHECKING([whether build environment is sane])
121156b526288Smrg# Reject unsafe characters in $srcdir or the absolute working directory
121166b526288Smrg# name.  Accept space and tab only in the latter.
121176b526288Smrgam_lf='
121186b526288Smrg'
121196b526288Smrgcase `pwd` in
121206b526288Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
121216b526288Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
121226b526288Smrgesac
121236b526288Smrgcase $srcdir in
121246b526288Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
121256b526288Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
121266b526288Smrgesac
1212741b2f0bdSmrg
121286b526288Smrg# Do 'set' in a subshell so we don't clobber the current shell's
121296b526288Smrg# arguments.  Must try -L first in case configure is actually a
121306b526288Smrg# symlink; some systems play weird games with the mod time of symlinks
121316b526288Smrg# (eg FreeBSD returns the mod time of the symlink's containing
121326b526288Smrg# directory).
121336b526288Smrgif (
121346b526288Smrg   am_has_slept=no
121356b526288Smrg   for am_try in 1 2; do
121366b526288Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
121376b526288Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
121386b526288Smrg     if test "$[*]" = "X"; then
121396b526288Smrg	# -L didn't work.
121406b526288Smrg	set X `ls -t "$srcdir/configure" conftest.file`
121416b526288Smrg     fi
121426b526288Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
121436b526288Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
121446b526288Smrg
121456b526288Smrg	# If neither matched, then we have a broken ls.  This can happen
121466b526288Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
121476b526288Smrg	# broken ls alias from the environment.  This has actually
121486b526288Smrg	# happened.  Such a system could not be considered "sane".
121496b526288Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
121506b526288Smrg  alias in your environment])
121516b526288Smrg     fi
121526b526288Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
121536b526288Smrg       break
121546b526288Smrg     fi
121556b526288Smrg     # Just in case.
121566b526288Smrg     sleep 1
121576b526288Smrg     am_has_slept=yes
121586b526288Smrg   done
121596b526288Smrg   test "$[2]" = conftest.file
121606b526288Smrg   )
121616b526288Smrgthen
121626b526288Smrg   # Ok.
121636b526288Smrg   :
121646b526288Smrgelse
121656b526288Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
121666b526288SmrgCheck your system clock])
121676b526288Smrgfi
121686b526288SmrgAC_MSG_RESULT([yes])
121696b526288Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
121706b526288Smrg# generated files are strictly newer.
121716b526288Smrgam_sleep_pid=
121726b526288Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
121736b526288Smrg  ( sleep 1 ) &
121746b526288Smrg  am_sleep_pid=$!
121756b526288Smrgfi
121766b526288SmrgAC_CONFIG_COMMANDS_PRE(
121776b526288Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
121786b526288Smrg   if test -n "$am_sleep_pid"; then
121796b526288Smrg     # Hide warnings about reused PIDs.
121806b526288Smrg     wait $am_sleep_pid 2>/dev/null
121816b526288Smrg   fi
121826b526288Smrg   AC_MSG_RESULT([done])])
121836b526288Smrgrm -f conftest.file
121846b526288Smrg])
1218541b2f0bdSmrg
121866b526288Smrg# Copyright (C) 2009-2017 Free Software Foundation, Inc.
121876b526288Smrg#
121886b526288Smrg# This file is free software; the Free Software Foundation
121896b526288Smrg# gives unlimited permission to copy and/or distribute it,
121906b526288Smrg# with or without modifications, as long as this notice is preserved.
1219141b2f0bdSmrg
121926b526288Smrg# AM_SILENT_RULES([DEFAULT])
121936b526288Smrg# --------------------------
121946b526288Smrg# Enable less verbose build rules; with the default set to DEFAULT
121956b526288Smrg# ("yes" being less verbose, "no" or empty being verbose).
121966b526288SmrgAC_DEFUN([AM_SILENT_RULES],
121976b526288Smrg[AC_ARG_ENABLE([silent-rules], [dnl
121986b526288SmrgAS_HELP_STRING(
121996b526288Smrg  [--enable-silent-rules],
122006b526288Smrg  [less verbose build output (undo: "make V=1")])
122016b526288SmrgAS_HELP_STRING(
122026b526288Smrg  [--disable-silent-rules],
122036b526288Smrg  [verbose build output (undo: "make V=0")])dnl
122046b526288Smrg])
122056b526288Smrgcase $enable_silent_rules in @%:@ (((
122066b526288Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
122076b526288Smrg   no) AM_DEFAULT_VERBOSITY=1;;
122086b526288Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
122096b526288Smrgesac
122106b526288Smrgdnl
122116b526288Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
122126b526288Smrgdnl do not support nested variable expansions.
122136b526288Smrgdnl See automake bug#9928 and bug#10237.
122146b526288Smrgam_make=${MAKE-make}
122156b526288SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
122166b526288Smrg   [am_cv_make_support_nested_variables],
122176b526288Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
122186b526288SmrgBAR0=false
122196b526288SmrgBAR1=true
122206b526288SmrgV=1
122216b526288Smrgam__doit:
122226b526288Smrg	@$(TRUE)
122236b526288Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
122246b526288Smrg  am_cv_make_support_nested_variables=yes
122256b526288Smrgelse
122266b526288Smrg  am_cv_make_support_nested_variables=no
122276b526288Smrgfi])
122286b526288Smrgif test $am_cv_make_support_nested_variables = yes; then
122296b526288Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
122306b526288Smrg  AM_V='$(V)'
122316b526288Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
122326b526288Smrgelse
122336b526288Smrg  AM_V=$AM_DEFAULT_VERBOSITY
122346b526288Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
122356b526288Smrgfi
122366b526288SmrgAC_SUBST([AM_V])dnl
122376b526288SmrgAM_SUBST_NOTMAKE([AM_V])dnl
122386b526288SmrgAC_SUBST([AM_DEFAULT_V])dnl
122396b526288SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
122406b526288SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
122416b526288SmrgAM_BACKSLASH='\'
122426b526288SmrgAC_SUBST([AM_BACKSLASH])dnl
122436b526288Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1224411a29bacSmrg])
1224541b2f0bdSmrg
122466b526288Smrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
1224711a29bacSmrg#
122486b526288Smrg# This file is free software; the Free Software Foundation
122496b526288Smrg# gives unlimited permission to copy and/or distribute it,
122506b526288Smrg# with or without modifications, as long as this notice is preserved.
122516b526288Smrg
122526b526288Smrg# AM_PROG_INSTALL_STRIP
122536b526288Smrg# ---------------------
122546b526288Smrg# One issue with vendor 'install' (even GNU) is that you can't
122556b526288Smrg# specify the program used to strip binaries.  This is especially
122566b526288Smrg# annoying in cross-compiling environments, where the build's strip
122576b526288Smrg# is unlikely to handle the host's binaries.
122586b526288Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
122596b526288Smrg# always use install-sh in "make install-strip", and initialize
122606b526288Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
122616b526288SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
122626b526288Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
122636b526288Smrg# Installed binaries are usually stripped using 'strip' when the user
122646b526288Smrg# run "make install-strip".  However 'strip' might not be the right
122656b526288Smrg# tool to use in cross-compilation environments, therefore Automake
122666b526288Smrg# will honor the 'STRIP' environment variable to overrule this program.
122676b526288Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
122686b526288Smrgif test "$cross_compiling" != no; then
122696b526288Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
122706b526288Smrgfi
122716b526288SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
122726b526288SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
122736b526288Smrg
122746b526288Smrg# Copyright (C) 2006-2017 Free Software Foundation, Inc.
1227511a29bacSmrg#
122766b526288Smrg# This file is free software; the Free Software Foundation
122776b526288Smrg# gives unlimited permission to copy and/or distribute it,
122786b526288Smrg# with or without modifications, as long as this notice is preserved.
1227941b2f0bdSmrg
122806b526288Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
122816b526288Smrg# ---------------------------
122826b526288Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
122836b526288Smrg# This macro is traced by Automake.
122846b526288SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1228511a29bacSmrg
122866b526288Smrg# AM_SUBST_NOTMAKE(VARIABLE)
122876b526288Smrg# --------------------------
122886b526288Smrg# Public sister of _AM_SUBST_NOTMAKE.
122896b526288SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
122906b526288Smrg
122916b526288Smrg# Check how to create a tarball.                            -*- Autoconf -*-
122926b526288Smrg
122936b526288Smrg# Copyright (C) 2004-2017 Free Software Foundation, Inc.
1229411a29bacSmrg#
122956b526288Smrg# This file is free software; the Free Software Foundation
122966b526288Smrg# gives unlimited permission to copy and/or distribute it,
122976b526288Smrg# with or without modifications, as long as this notice is preserved.
122986b526288Smrg
122996b526288Smrg# _AM_PROG_TAR(FORMAT)
123006b526288Smrg# --------------------
123016b526288Smrg# Check how to create a tarball in format FORMAT.
123026b526288Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
1230311a29bacSmrg#
123046b526288Smrg# Substitute a variable $(am__tar) that is a command
123056b526288Smrg# writing to stdout a FORMAT-tarball containing the directory
123066b526288Smrg# $tardir.
123076b526288Smrg#     tardir=directory && $(am__tar) > result.tar
1230811a29bacSmrg#
123096b526288Smrg# Substitute a variable $(am__untar) that extract such
123106b526288Smrg# a tarball read from stdin.
123116b526288Smrg#     $(am__untar) < result.tar
1231211a29bacSmrg#
123136b526288SmrgAC_DEFUN([_AM_PROG_TAR],
123146b526288Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
123156b526288Smrg# in the wild :-(  We should find a proper way to deprecate it ...
123166b526288SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
1231711a29bacSmrg
123186b526288Smrg# We'll loop over all known methods to create a tar archive until one works.
123196b526288Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1232011a29bacSmrg
123216b526288Smrgm4_if([$1], [v7],
123226b526288Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
123236b526288Smrg
123246b526288Smrg  [m4_case([$1],
123256b526288Smrg    [ustar],
123266b526288Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
123276b526288Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
123286b526288Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
123296b526288Smrg      # and bug#13588).
123306b526288Smrg      am_max_uid=2097151 # 2^21 - 1
123316b526288Smrg      am_max_gid=$am_max_uid
123326b526288Smrg      # The $UID and $GID variables are not portable, so we need to resort
123336b526288Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
123346b526288Smrg      # below are definitely unexpected, so allow the users to see them
123356b526288Smrg      # (that is, avoid stderr redirection).
123366b526288Smrg      am_uid=`id -u || echo unknown`
123376b526288Smrg      am_gid=`id -g || echo unknown`
123386b526288Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
123396b526288Smrg      if test $am_uid -le $am_max_uid; then
123406b526288Smrg         AC_MSG_RESULT([yes])
123416b526288Smrg      else
123426b526288Smrg         AC_MSG_RESULT([no])
123436b526288Smrg         _am_tools=none
123446b526288Smrg      fi
123456b526288Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
123466b526288Smrg      if test $am_gid -le $am_max_gid; then
123476b526288Smrg         AC_MSG_RESULT([yes])
123486b526288Smrg      else
123496b526288Smrg        AC_MSG_RESULT([no])
123506b526288Smrg        _am_tools=none
123516b526288Smrg      fi],
123526b526288Smrg
123536b526288Smrg  [pax],
123546b526288Smrg    [],
123556b526288Smrg
123566b526288Smrg  [m4_fatal([Unknown tar format])])
123576b526288Smrg
123586b526288Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
123596b526288Smrg
123606b526288Smrg  # Go ahead even if we have the value already cached.  We do so because we
123616b526288Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
123626b526288Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
123636b526288Smrg
123646b526288Smrg  for _am_tool in $_am_tools; do
123656b526288Smrg    case $_am_tool in
123666b526288Smrg    gnutar)
123676b526288Smrg      for _am_tar in tar gnutar gtar; do
123686b526288Smrg        AM_RUN_LOG([$_am_tar --version]) && break
123696b526288Smrg      done
123706b526288Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
123716b526288Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
123726b526288Smrg      am__untar="$_am_tar -xf -"
123736b526288Smrg      ;;
123746b526288Smrg    plaintar)
123756b526288Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
123766b526288Smrg      # ustar tarball either.
123776b526288Smrg      (tar --version) >/dev/null 2>&1 && continue
123786b526288Smrg      am__tar='tar chf - "$$tardir"'
123796b526288Smrg      am__tar_='tar chf - "$tardir"'
123806b526288Smrg      am__untar='tar xf -'
123816b526288Smrg      ;;
123826b526288Smrg    pax)
123836b526288Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
123846b526288Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
123856b526288Smrg      am__untar='pax -r'
123866b526288Smrg      ;;
123876b526288Smrg    cpio)
123886b526288Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
123896b526288Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
123906b526288Smrg      am__untar='cpio -i -H $1 -d'
123916b526288Smrg      ;;
123926b526288Smrg    none)
123936b526288Smrg      am__tar=false
123946b526288Smrg      am__tar_=false
123956b526288Smrg      am__untar=false
123966b526288Smrg      ;;
123976b526288Smrg    esac
123986b526288Smrg
123996b526288Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
124006b526288Smrg    # and am__untar set.
124016b526288Smrg    test -n "${am_cv_prog_tar_$1}" && break
124026b526288Smrg
124036b526288Smrg    # tar/untar a dummy directory, and stop if the command works.
124046b526288Smrg    rm -rf conftest.dir
124056b526288Smrg    mkdir conftest.dir
124066b526288Smrg    echo GrepMe > conftest.dir/file
124076b526288Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
124086b526288Smrg    rm -rf conftest.dir
124096b526288Smrg    if test -s conftest.tar; then
124106b526288Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
124116b526288Smrg      AM_RUN_LOG([cat conftest.dir/file])
124126b526288Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
124136b526288Smrg    fi
124146b526288Smrg  done
124156b526288Smrg  rm -rf conftest.dir
124166b526288Smrg
124176b526288Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
124186b526288Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
124196b526288Smrg
124206b526288SmrgAC_SUBST([am__tar])
124216b526288SmrgAC_SUBST([am__untar])
124226b526288Smrg]) # _AM_PROG_TAR
1242341b2f0bdSmrg
12424