aclocal.m4 revision 54044362
170728a38Smrg# generated automatically by aclocal 1.15 -*- Autoconf -*-
270728a38Smrg
370728a38Smrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
48c9fbc29Smrg
58c9fbc29Smrg# This file is free software; the Free Software Foundation
68c9fbc29Smrg# gives unlimited permission to copy and/or distribute it,
78c9fbc29Smrg# with or without modifications, as long as this notice is preserved.
88c9fbc29Smrg
98c9fbc29Smrg# This program is distributed in the hope that it will be useful,
108c9fbc29Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
118c9fbc29Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
128c9fbc29Smrg# PARTICULAR PURPOSE.
138c9fbc29Smrg
1470728a38Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
154e411241Smrgm4_ifndef([AC_AUTOCONF_VERSION],
164e411241Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1770728a38Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
1870728a38Smrg[m4_warning([this file was generated for autoconf 2.69.
194e411241SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
204e411241SmrgIf you have problems, you may need to regenerate the build system entirely.
2170728a38SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
228c9fbc29Smrg
2354044362Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
248c9fbc29Smrg#
2554044362Smrg#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
2654044362Smrg#   Written by Gordon Matzigkeit, 1996
2754044362Smrg#
2854044362Smrg# This file is free software; the Free Software Foundation gives
2954044362Smrg# unlimited permission to copy and/or distribute it, with or without
3054044362Smrg# modifications, as long as this notice is preserved.
318c9fbc29Smrg
3254044362Smrgm4_define([_LT_COPYING], [dnl
3354044362Smrg# Copyright (C) 2014 Free Software Foundation, Inc.
3454044362Smrg# This is free software; see the source for copying conditions.  There is NO
3554044362Smrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
368c9fbc29Smrg
3754044362Smrg# GNU Libtool is free software; you can redistribute it and/or modify
3854044362Smrg# it under the terms of the GNU General Public License as published by
3954044362Smrg# the Free Software Foundation; either version 2 of of the License, or
4054044362Smrg# (at your option) any later version.
4154044362Smrg#
4254044362Smrg# As a special exception to the GNU General Public License, if you
4354044362Smrg# distribute this file as part of a program or library that is built
4454044362Smrg# using GNU Libtool, you may include this file under the  same
4554044362Smrg# distribution terms that you use for the rest of that program.
4654044362Smrg#
4754044362Smrg# GNU Libtool is distributed in the hope that it will be useful, but
4854044362Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
4954044362Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5054044362Smrg# GNU General Public License for more details.
5154044362Smrg#
5254044362Smrg# You should have received a copy of the GNU General Public License
5354044362Smrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
5454044362Smrg])
558c9fbc29Smrg
5654044362Smrg# serial 58 LT_INIT
578c9fbc29Smrg
588c9fbc29Smrg
5954044362Smrg# LT_PREREQ(VERSION)
6054044362Smrg# ------------------
6154044362Smrg# Complain and exit if this libtool version is less that VERSION.
6254044362Smrgm4_defun([LT_PREREQ],
6354044362Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
6454044362Smrg       [m4_default([$3],
6554044362Smrg		   [m4_fatal([Libtool version $1 or higher is required],
6654044362Smrg		             63)])],
6754044362Smrg       [$2])])
688c9fbc29Smrg
698c9fbc29Smrg
7054044362Smrg# _LT_CHECK_BUILDDIR
7154044362Smrg# ------------------
7254044362Smrg# Complain if the absolute build directory name contains unusual characters
7354044362Smrgm4_defun([_LT_CHECK_BUILDDIR],
7454044362Smrg[case `pwd` in
7554044362Smrg  *\ * | *\	*)
7654044362Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
7754044362Smrgesac
788c9fbc29Smrg])
798c9fbc29Smrg
808c9fbc29Smrg
8154044362Smrg# LT_INIT([OPTIONS])
8254044362Smrg# ------------------
8354044362SmrgAC_DEFUN([LT_INIT],
8454044362Smrg[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
8554044362SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
8654044362SmrgAC_BEFORE([$0], [LT_LANG])dnl
8754044362SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
8854044362SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
8954044362Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
908c9fbc29Smrg
9154044362Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
9254044362Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
9354044362Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
9454044362Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
9554044362Smrgdnl unless we require an AC_DEFUNed macro:
9654044362SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
9754044362SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
9854044362SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
9954044362SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
10054044362Smrgm4_require([_LT_PROG_LTMAIN])dnl
1018c9fbc29Smrg
10254044362Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1038c9fbc29Smrg
10454044362Smrgdnl Parse OPTIONS
10554044362Smrg_LT_SET_OPTIONS([$0], [$1])
1068c9fbc29Smrg
10754044362Smrg# This can be used to rebuild libtool when needed
10854044362SmrgLIBTOOL_DEPS=$ltmain
1098c9fbc29Smrg
11054044362Smrg# Always use our own libtool.
11154044362SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
11254044362SmrgAC_SUBST(LIBTOOL)dnl
1138c9fbc29Smrg
11454044362Smrg_LT_SETUP
1158c9fbc29Smrg
11654044362Smrg# Only expand once:
11754044362Smrgm4_define([LT_INIT])
11854044362Smrg])# LT_INIT
1198c9fbc29Smrg
12054044362Smrg# Old names:
12154044362SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
12254044362SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
12354044362Smrgdnl aclocal-1.4 backwards compatibility:
12454044362Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
12554044362Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1268c9fbc29Smrg
1274e411241Smrg
12854044362Smrg# _LT_PREPARE_CC_BASENAME
12954044362Smrg# -----------------------
13054044362Smrgm4_defun([_LT_PREPARE_CC_BASENAME], [
13154044362Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
13254044362Smrgfunc_cc_basename ()
13354044362Smrg{
13454044362Smrg    for cc_temp in @S|@*""; do
13554044362Smrg      case $cc_temp in
13654044362Smrg        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
13754044362Smrg        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
13854044362Smrg        \-*) ;;
13954044362Smrg        *) break;;
14054044362Smrg      esac
1418c9fbc29Smrg    done
14254044362Smrg    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
14354044362Smrg}
14454044362Smrg])# _LT_PREPARE_CC_BASENAME
1458c9fbc29Smrg
1468c9fbc29Smrg
14754044362Smrg# _LT_CC_BASENAME(CC)
14854044362Smrg# -------------------
14954044362Smrg# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
15054044362Smrg# but that macro is also expanded into generated libtool script, which
15154044362Smrg# arranges for $SED and $ECHO to be set by different means.
15254044362Smrgm4_defun([_LT_CC_BASENAME],
15354044362Smrg[m4_require([_LT_PREPARE_CC_BASENAME])dnl
15454044362SmrgAC_REQUIRE([_LT_DECL_SED])dnl
15554044362SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
15654044362Smrgfunc_cc_basename $1
15754044362Smrgcc_basename=$func_cc_basename_result
1588c9fbc29Smrg])
1598c9fbc29Smrg
1608c9fbc29Smrg
16154044362Smrg# _LT_FILEUTILS_DEFAULTS
16254044362Smrg# ----------------------
16354044362Smrg# It is okay to use these file commands and assume they have been set
16454044362Smrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
16554044362Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
16654044362Smrg[: ${CP="cp -f"}
16754044362Smrg: ${MV="mv -f"}
16854044362Smrg: ${RM="rm -f"}
16954044362Smrg])# _LT_FILEUTILS_DEFAULTS
1708c9fbc29Smrg
1718c9fbc29Smrg
17254044362Smrg# _LT_SETUP
17354044362Smrg# ---------
17454044362Smrgm4_defun([_LT_SETUP],
17554044362Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
17654044362SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
17754044362SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
17854044362SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
17954044362Smrg
18054044362Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
18154044362Smrgdnl
18254044362Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
18354044362Smrg_LT_DECL([], [host], [0])dnl
18454044362Smrg_LT_DECL([], [host_os], [0])dnl
18554044362Smrgdnl
18654044362Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
18754044362Smrg_LT_DECL([], [build], [0])dnl
18854044362Smrg_LT_DECL([], [build_os], [0])dnl
18954044362Smrgdnl
19054044362SmrgAC_REQUIRE([AC_PROG_CC])dnl
19154044362SmrgAC_REQUIRE([LT_PATH_LD])dnl
19254044362SmrgAC_REQUIRE([LT_PATH_NM])dnl
19354044362Smrgdnl
19454044362SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
19554044362Smrgtest -z "$LN_S" && LN_S="ln -s"
19654044362Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
19754044362Smrgdnl
19854044362SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
19954044362Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
20054044362Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
20154044362Smrgdnl
20254044362Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
20354044362Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
20454044362Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
20554044362Smrgm4_require([_LT_CMD_RELOAD])dnl
20654044362Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
20754044362Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
20854044362Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
20954044362Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
21054044362Smrgm4_require([_LT_WITH_SYSROOT])dnl
21154044362Smrgm4_require([_LT_CMD_TRUNCATE])dnl
21254044362Smrg
21354044362Smrg_LT_CONFIG_LIBTOOL_INIT([
21454044362Smrg# See if we are running on zsh, and set the options that allow our
21554044362Smrg# commands through without removal of \ escapes INIT.
21654044362Smrgif test -n "\${ZSH_VERSION+set}"; then
21754044362Smrg   setopt NO_GLOB_SUBST
2188c9fbc29Smrgfi
2198c9fbc29Smrg])
22054044362Smrgif test -n "${ZSH_VERSION+set}"; then
22154044362Smrg   setopt NO_GLOB_SUBST
22254044362Smrgfi
2238c9fbc29Smrg
22454044362Smrg_LT_CHECK_OBJDIR
2258c9fbc29Smrg
22654044362Smrgm4_require([_LT_TAG_COMPILER])dnl
2278c9fbc29Smrg
22854044362Smrgcase $host_os in
22954044362Smrgaix3*)
23054044362Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
23154044362Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
23254044362Smrg  # vanish in a puff of smoke.
23354044362Smrg  if test set != "${COLLECT_NAMES+set}"; then
23454044362Smrg    COLLECT_NAMES=
23554044362Smrg    export COLLECT_NAMES
23654044362Smrg  fi
23754044362Smrg  ;;
23854044362Smrgesac
2398c9fbc29Smrg
24054044362Smrg# Global variables:
24154044362Smrgofile=libtool
24254044362Smrgcan_build_shared=yes
2438c9fbc29Smrg
24454044362Smrg# All known linkers require a '.a' archive for static linking (except MSVC,
24554044362Smrg# which needs '.lib').
24654044362Smrglibext=a
2478c9fbc29Smrg
24854044362Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
2498c9fbc29Smrg
25054044362Smrgold_CC=$CC
25154044362Smrgold_CFLAGS=$CFLAGS
2528c9fbc29Smrg
25354044362Smrg# Set sane defaults for various variables
25454044362Smrgtest -z "$CC" && CC=cc
25554044362Smrgtest -z "$LTCC" && LTCC=$CC
25654044362Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
25754044362Smrgtest -z "$LD" && LD=ld
25854044362Smrgtest -z "$ac_objext" && ac_objext=o
2598c9fbc29Smrg
26054044362Smrg_LT_CC_BASENAME([$compiler])
26170728a38Smrg
26254044362Smrg# Only perform the check for file, if the check method requires it
26354044362Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
26454044362Smrgcase $deplibs_check_method in
26554044362Smrgfile_magic*)
26654044362Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
26754044362Smrg    _LT_PATH_MAGIC
2688c9fbc29Smrg  fi
26954044362Smrg  ;;
27054044362Smrgesac
2718c9fbc29Smrg
27254044362Smrg# Use C for the default configuration in the libtool script
27354044362SmrgLT_SUPPORTED_TAG([CC])
27454044362Smrg_LT_LANG_C_CONFIG
27554044362Smrg_LT_LANG_DEFAULT_CONFIG
27654044362Smrg_LT_CONFIG_COMMANDS
27754044362Smrg])# _LT_SETUP
2788c9fbc29Smrg
2798c9fbc29Smrg
28054044362Smrg# _LT_PREPARE_SED_QUOTE_VARS
28154044362Smrg# --------------------------
28254044362Smrg# Define a few sed substitution that help us do robust quoting.
28354044362Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
28454044362Smrg[# Backslashify metacharacters that are still active within
28554044362Smrg# double-quoted strings.
28654044362Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
2878c9fbc29Smrg
28854044362Smrg# Same as above, but do not quote variable references.
28954044362Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
29070728a38Smrg
29154044362Smrg# Sed substitution to delay expansion of an escaped shell variable in a
29254044362Smrg# double_quote_subst'ed string.
29354044362Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
29470728a38Smrg
29554044362Smrg# Sed substitution to delay expansion of an escaped single quote.
29654044362Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
29770728a38Smrg
29854044362Smrg# Sed substitution to avoid accidental globbing in evaled expressions
29954044362Smrgno_glob_subst='s/\*/\\\*/g'
30054044362Smrg])
30170728a38Smrg
30254044362Smrg# _LT_PROG_LTMAIN
30354044362Smrg# ---------------
30454044362Smrg# Note that this code is called both from 'configure', and 'config.status'
30554044362Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
30654044362Smrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
30754044362Smrg# so we pass a copy along to make sure it has a sensible value anyway.
30854044362Smrgm4_defun([_LT_PROG_LTMAIN],
30954044362Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
31054044362Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
31154044362Smrgltmain=$ac_aux_dir/ltmain.sh
31254044362Smrg])# _LT_PROG_LTMAIN
31370728a38Smrg
31470728a38Smrg
31570728a38Smrg
31654044362Smrg# So that we can recreate a full libtool script including additional
31754044362Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
31854044362Smrg# in macros and then make a single call at the end using the 'libtool'
31954044362Smrg# label.
3208c9fbc29Smrg
3214e411241Smrg
32254044362Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
32354044362Smrg# ----------------------------------------
32454044362Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
32554044362Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
32654044362Smrg[m4_ifval([$1],
32754044362Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
32854044362Smrg                     [$1
32954044362Smrg])])])
3308c9fbc29Smrg
33154044362Smrg# Initialize.
33254044362Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
3338c9fbc29Smrg
3348c9fbc29Smrg
33554044362Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
33654044362Smrg# ------------------------------
33754044362Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
33854044362Smrgm4_define([_LT_CONFIG_LIBTOOL],
33954044362Smrg[m4_ifval([$1],
34054044362Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
34154044362Smrg                     [$1
34254044362Smrg])])])
3438c9fbc29Smrg
34454044362Smrg# Initialize.
34554044362Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
3468c9fbc29Smrg
3478c9fbc29Smrg
34854044362Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
34954044362Smrg# -----------------------------------------------------
35054044362Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
35154044362Smrg[_LT_CONFIG_LIBTOOL([$1])
35254044362Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
35354044362Smrg])
3548c9fbc29Smrg
3558c9fbc29Smrg
35654044362Smrg# _LT_FORMAT_COMMENT([COMMENT])
35754044362Smrg# -----------------------------
35854044362Smrg# Add leading comment marks to the start of each line, and a trailing
35954044362Smrg# full-stop to the whole comment if one is not present already.
36054044362Smrgm4_define([_LT_FORMAT_COMMENT],
36154044362Smrg[m4_ifval([$1], [
36254044362Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
36354044362Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
36454044362Smrg)])
3658c9fbc29Smrg
3668c9fbc29Smrg
3678c9fbc29Smrg
3688c9fbc29Smrg
36954044362Smrg
37054044362Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
37154044362Smrg# -------------------------------------------------------------------
37254044362Smrg# CONFIGNAME is the name given to the value in the libtool script.
37354044362Smrg# VARNAME is the (base) name used in the configure script.
37454044362Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
37554044362Smrg# VARNAME.  Any other value will be used directly.
37654044362Smrgm4_define([_LT_DECL],
37754044362Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
37854044362Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
37954044362Smrg	[m4_ifval([$1], [$1], [$2])])
38054044362Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
38154044362Smrg    m4_ifval([$4],
38254044362Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
38354044362Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
38454044362Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
3858c9fbc29Smrg])
3868c9fbc29Smrg
3878c9fbc29Smrg
38854044362Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
38954044362Smrg# --------------------------------------------------------
39054044362Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
3918c9fbc29Smrg
3928c9fbc29Smrg
39354044362Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
39454044362Smrg# ------------------------------------------------
39554044362Smrgm4_define([lt_decl_tag_varnames],
39654044362Smrg[_lt_decl_filter([tagged?], [yes], $@)])
3978c9fbc29Smrg
3988c9fbc29Smrg
39954044362Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
40054044362Smrg# ---------------------------------------------------------
40154044362Smrgm4_define([_lt_decl_filter],
40254044362Smrg[m4_case([$#],
40354044362Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
40454044362Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
40554044362Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
40654044362Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
40754044362Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
40854044362Smrg])
4098c9fbc29Smrg
41070728a38Smrg
41154044362Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
41254044362Smrg# --------------------------------------------------
41354044362Smrgm4_define([lt_decl_quote_varnames],
41454044362Smrg[_lt_decl_filter([value], [1], $@)])
4158c9fbc29Smrg
41670728a38Smrg
41754044362Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
41854044362Smrg# ---------------------------------------------------
41954044362Smrgm4_define([lt_decl_dquote_varnames],
42054044362Smrg[_lt_decl_filter([value], [2], $@)])
4218c9fbc29Smrg
42270728a38Smrg
42354044362Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
42454044362Smrg# ---------------------------------------------------
42554044362Smrgm4_define([lt_decl_varnames_tagged],
42654044362Smrg[m4_assert([$# <= 2])dnl
42754044362Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
42854044362Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
42954044362Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
43054044362Smrgm4_define([_lt_decl_varnames_tagged],
43154044362Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
43270728a38Smrg
4338c9fbc29Smrg
43454044362Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
43554044362Smrg# ------------------------------------------------
43654044362Smrgm4_define([lt_decl_all_varnames],
43754044362Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
43854044362Smrg     m4_if([$2], [],
43954044362Smrg	   m4_quote(lt_decl_varnames),
44054044362Smrg	m4_quote(m4_shift($@))))[]dnl
44154044362Smrg])
44254044362Smrgm4_define([_lt_decl_all_varnames],
44354044362Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
44454044362Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
44554044362Smrg])
4464e411241Smrg
44770728a38Smrg
44854044362Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
44954044362Smrg# ------------------------------------
45054044362Smrg# Quote a variable value, and forward it to 'config.status' so that its
45154044362Smrg# declaration there will have the same value as in 'configure'.  VARNAME
45254044362Smrg# must have a single quote delimited value for this to work.
45354044362Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
45454044362Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
4558c9fbc29Smrg
45654044362Smrg
45754044362Smrg# _LT_CONFIG_STATUS_DECLARATIONS
45854044362Smrg# ------------------------------
45954044362Smrg# We delimit libtool config variables with single quotes, so when
46054044362Smrg# we write them to config.status, we have to be sure to quote all
46154044362Smrg# embedded single quotes properly.  In configure, this macro expands
46254044362Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
4634e411241Smrg#
46454044362Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
46554044362Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
46654044362Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
46754044362Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
4684e411241Smrg
46954044362Smrg
47054044362Smrg# _LT_LIBTOOL_TAGS
47154044362Smrg# ----------------
47254044362Smrg# Output comment and list of tags supported by the script
47354044362Smrgm4_defun([_LT_LIBTOOL_TAGS],
47454044362Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
47554044362Smrgavailable_tags='_LT_TAGS'dnl
4764e411241Smrg])
4774e411241Smrg
47854044362Smrg
47954044362Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
48054044362Smrg# -----------------------------------
48154044362Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
48254044362Smrg# expand to a commented shell variable setting:
4838c9fbc29Smrg#
48454044362Smrg#    # Some comment about what VAR is for.
48554044362Smrg#    visible_name=$lt_internal_name
48654044362Smrgm4_define([_LT_LIBTOOL_DECLARE],
48754044362Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
48854044362Smrg					   [description])))[]dnl
48954044362Smrgm4_pushdef([_libtool_name],
49054044362Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
49154044362Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
49254044362Smrg    [0], [_libtool_name=[$]$1],
49354044362Smrg    [1], [_libtool_name=$lt_[]$1],
49454044362Smrg    [2], [_libtool_name=$lt_[]$1],
49554044362Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
49654044362Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
49754044362Smrg])
4988c9fbc29Smrg
4998c9fbc29Smrg
50054044362Smrg# _LT_LIBTOOL_CONFIG_VARS
50154044362Smrg# -----------------------
50254044362Smrg# Produce commented declarations of non-tagged libtool config variables
50354044362Smrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
50454044362Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
50554044362Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
50654044362Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
50754044362Smrg[m4_foreach([_lt_var],
50854044362Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
50954044362Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
5108c9fbc29Smrg
5118c9fbc29Smrg
51254044362Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
51354044362Smrg# -------------------------
51454044362Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
51554044362Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
51654044362Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
5174e411241Smrg
5188c9fbc29Smrg
51954044362Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
52054044362Smrg# ------------------------------
52154044362Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
5228c9fbc29Smrg
5234e411241Smrg
52454044362Smrg# _LT_CONFIG_COMMANDS
52554044362Smrg# -------------------
52654044362Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
52754044362Smrg# variables for single and double quote escaping we saved from calls
52854044362Smrg# to _LT_DECL, we can put quote escaped variables declarations
52954044362Smrg# into 'config.status', and then the shell code to quote escape them in
53054044362Smrg# for loops in 'config.status'.  Finally, any additional code accumulated
53154044362Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
53254044362Smrgm4_defun([_LT_CONFIG_COMMANDS],
53354044362Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
53454044362Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
53554044362Smrg	dnl instead of duplicating it all over again into config.status,
53654044362Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
53754044362Smrg	dnl needs to know what name is stored there:
53854044362Smrg        [AC_CONFIG_COMMANDS([libtool],
53954044362Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
54054044362Smrg    dnl If the libtool generation code is destined for config.status,
54154044362Smrg    dnl expand the accumulated commands and init code now:
54254044362Smrg    [AC_CONFIG_COMMANDS([libtool],
54354044362Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
54454044362Smrg])#_LT_CONFIG_COMMANDS
54570728a38Smrg
5464e411241Smrg
54754044362Smrg# Initialize.
54854044362Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
54954044362Smrg[
5504e411241Smrg
55154044362Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
55254044362Smrg# if CDPATH is set.
55354044362Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5544e411241Smrg
55554044362Smrgsed_quote_subst='$sed_quote_subst'
55654044362Smrgdouble_quote_subst='$double_quote_subst'
55754044362Smrgdelay_variable_subst='$delay_variable_subst'
55854044362Smrg_LT_CONFIG_STATUS_DECLARATIONS
55954044362SmrgLTCC='$LTCC'
56054044362SmrgLTCFLAGS='$LTCFLAGS'
56154044362Smrgcompiler='$compiler_DEFAULT'
5624e411241Smrg
56354044362Smrg# A function that is used when there is no print builtin or printf.
56454044362Smrgfunc_fallback_echo ()
56554044362Smrg{
56654044362Smrg  eval 'cat <<_LTECHO_EOF
56754044362Smrg\$[]1
56854044362Smrg_LTECHO_EOF'
56954044362Smrg}
5704e411241Smrg
57154044362Smrg# Quote evaled strings.
57254044362Smrgfor var in lt_decl_all_varnames([[ \
57354044362Smrg]], lt_decl_quote_varnames); do
57454044362Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
57554044362Smrg    *[[\\\\\\\`\\"\\\$]]*)
57654044362Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
57770728a38Smrg      ;;
57854044362Smrg    *)
57954044362Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
58070728a38Smrg      ;;
58154044362Smrg    esac
58254044362Smrgdone
58354044362Smrg
58454044362Smrg# Double-quote double-evaled strings.
58554044362Smrgfor var in lt_decl_all_varnames([[ \
58654044362Smrg]], lt_decl_dquote_varnames); do
58754044362Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
58854044362Smrg    *[[\\\\\\\`\\"\\\$]]*)
58954044362Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
59070728a38Smrg      ;;
59154044362Smrg    *)
59254044362Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
59370728a38Smrg      ;;
59470728a38Smrg    esac
59554044362Smrgdone
5964e411241Smrg
59754044362Smrg_LT_OUTPUT_LIBTOOL_INIT
59854044362Smrg])
59970728a38Smrg
60054044362Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
60154044362Smrg# ------------------------------------
60254044362Smrg# Generate a child script FILE with all initialization necessary to
60354044362Smrg# reuse the environment learned by the parent script, and make the
60454044362Smrg# file executable.  If COMMENT is supplied, it is inserted after the
60554044362Smrg# '#!' sequence but before initialization text begins.  After this
60654044362Smrg# macro, additional text can be appended to FILE to form the body of
60754044362Smrg# the child script.  The macro ends with non-zero status if the
60854044362Smrg# file could not be fully written (such as if the disk is full).
60954044362Smrgm4_ifdef([AS_INIT_GENERATED],
61054044362Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
61154044362Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
61254044362Smrg[m4_require([AS_PREPARE])]dnl
61354044362Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
61454044362Smrg[lt_write_fail=0
61554044362Smrgcat >$1 <<_ASEOF || lt_write_fail=1
61654044362Smrg#! $SHELL
61754044362Smrg# Generated by $as_me.
61854044362Smrg$2
61954044362SmrgSHELL=\${CONFIG_SHELL-$SHELL}
62054044362Smrgexport SHELL
62154044362Smrg_ASEOF
62254044362Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
62354044362SmrgAS_SHELL_SANITIZE
62454044362Smrg_AS_PREPARE
62554044362Smrgexec AS_MESSAGE_FD>&1
62654044362Smrg_ASEOF
62754044362Smrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
62854044362Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
6294e411241Smrg
63054044362Smrg# LT_OUTPUT
63154044362Smrg# ---------
63254044362Smrg# This macro allows early generation of the libtool script (before
63354044362Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
63454044362Smrg# tests.
63554044362SmrgAC_DEFUN([LT_OUTPUT],
63654044362Smrg[: ${CONFIG_LT=./config.lt}
63754044362SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
63854044362Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
63954044362Smrg[# Run this file to recreate a libtool stub with the current configuration.])
6404e411241Smrg
64154044362Smrgcat >>"$CONFIG_LT" <<\_LTEOF
64254044362Smrglt_cl_silent=false
64354044362Smrgexec AS_MESSAGE_LOG_FD>>config.log
64454044362Smrg{
64554044362Smrg  echo
64654044362Smrg  AS_BOX([Running $as_me.])
64754044362Smrg} >&AS_MESSAGE_LOG_FD
6484e411241Smrg
64954044362Smrglt_cl_help="\
65054044362Smrg'$as_me' creates a local libtool stub from the current configuration,
65154044362Smrgfor use in further configure time tests before the real libtool is
65254044362Smrggenerated.
6534cd6a3aeSmrg
65454044362SmrgUsage: $[0] [[OPTIONS]]
6554e411241Smrg
65654044362Smrg  -h, --help      print this help, then exit
65754044362Smrg  -V, --version   print version number, then exit
65854044362Smrg  -q, --quiet     do not print progress messages
65954044362Smrg  -d, --debug     don't remove temporary files
6604e411241Smrg
66154044362SmrgReport bugs to <bug-libtool@gnu.org>."
6624e411241Smrg
66354044362Smrglt_cl_version="\
66454044362Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
66554044362Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
66654044362Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
6674e411241Smrg
66854044362SmrgCopyright (C) 2011 Free Software Foundation, Inc.
66954044362SmrgThis config.lt script is free software; the Free Software Foundation
67054044362Smrggives unlimited permision to copy, distribute and modify it."
6714e411241Smrg
67254044362Smrgwhile test 0 != $[#]
67354044362Smrgdo
67454044362Smrg  case $[1] in
67554044362Smrg    --version | --v* | -V )
67654044362Smrg      echo "$lt_cl_version"; exit 0 ;;
67754044362Smrg    --help | --h* | -h )
67854044362Smrg      echo "$lt_cl_help"; exit 0 ;;
67954044362Smrg    --debug | --d* | -d )
68054044362Smrg      debug=: ;;
68154044362Smrg    --quiet | --q* | --silent | --s* | -q )
68254044362Smrg      lt_cl_silent=: ;;
6834e411241Smrg
68454044362Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
68554044362SmrgTry '$[0] --help' for more information.]) ;;
6864e411241Smrg
68754044362Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
68854044362SmrgTry '$[0] --help' for more information.]) ;;
68954044362Smrg  esac
69054044362Smrg  shift
69154044362Smrgdone
6924e411241Smrg
69354044362Smrgif $lt_cl_silent; then
69454044362Smrg  exec AS_MESSAGE_FD>/dev/null
69554044362Smrgfi
69654044362Smrg_LTEOF
6974e411241Smrg
69854044362Smrgcat >>"$CONFIG_LT" <<_LTEOF
69954044362Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
70054044362Smrg_LTEOF
7014e411241Smrg
70254044362Smrgcat >>"$CONFIG_LT" <<\_LTEOF
70354044362SmrgAC_MSG_NOTICE([creating $ofile])
70454044362Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
70554044362SmrgAS_EXIT(0)
70654044362Smrg_LTEOF
70754044362Smrgchmod +x "$CONFIG_LT"
7084e411241Smrg
70954044362Smrg# configure is writing to config.log, but config.lt does its own redirection,
71054044362Smrg# appending to config.log, which fails on DOS, as config.log is still kept
71154044362Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
71254044362Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
71354044362Smrglt_cl_success=:
71454044362Smrgtest yes = "$silent" &&
71554044362Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
71654044362Smrgexec AS_MESSAGE_LOG_FD>/dev/null
71754044362Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
71854044362Smrgexec AS_MESSAGE_LOG_FD>>config.log
71954044362Smrg$lt_cl_success || AS_EXIT(1)
72054044362Smrg])# LT_OUTPUT
7214e411241Smrg
7224e411241Smrg
72354044362Smrg# _LT_CONFIG(TAG)
72454044362Smrg# ---------------
72554044362Smrg# If TAG is the built-in tag, create an initial libtool script with a
72654044362Smrg# default configuration from the untagged config vars.  Otherwise add code
72754044362Smrg# to config.status for appending the configuration named by TAG from the
72854044362Smrg# matching tagged config vars.
72954044362Smrgm4_defun([_LT_CONFIG],
73054044362Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
73154044362Smrg_LT_CONFIG_SAVE_COMMANDS([
73254044362Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
73354044362Smrg  m4_if(_LT_TAG, [C], [
73454044362Smrg    # See if we are running on zsh, and set the options that allow our
73554044362Smrg    # commands through without removal of \ escapes.
73654044362Smrg    if test -n "${ZSH_VERSION+set}"; then
73754044362Smrg      setopt NO_GLOB_SUBST
73854044362Smrg    fi
7394e411241Smrg
74054044362Smrg    cfgfile=${ofile}T
74154044362Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
74254044362Smrg    $RM "$cfgfile"
7434e411241Smrg
74454044362Smrg    cat <<_LT_EOF >> "$cfgfile"
74554044362Smrg#! $SHELL
74654044362Smrg# Generated automatically by $as_me ($PACKAGE) $VERSION
74754044362Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
74854044362Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
7494cd6a3aeSmrg
75054044362Smrg# Provide generalized library-building support services.
75154044362Smrg# Written by Gordon Matzigkeit, 1996
7524cd6a3aeSmrg
75354044362Smrg_LT_COPYING
75454044362Smrg_LT_LIBTOOL_TAGS
7554e411241Smrg
75654044362Smrg# Configured defaults for sys_lib_dlsearch_path munging.
75754044362Smrg: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
7584cd6a3aeSmrg
75954044362Smrg# ### BEGIN LIBTOOL CONFIG
76054044362Smrg_LT_LIBTOOL_CONFIG_VARS
76154044362Smrg_LT_LIBTOOL_TAG_VARS
76254044362Smrg# ### END LIBTOOL CONFIG
7634e411241Smrg
76454044362Smrg_LT_EOF
7654e411241Smrg
76654044362Smrg    cat <<'_LT_EOF' >> "$cfgfile"
7674e411241Smrg
76854044362Smrg# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
7694e411241Smrg
77054044362Smrg_LT_PREPARE_MUNGE_PATH_LIST
77154044362Smrg_LT_PREPARE_CC_BASENAME
7724e411241Smrg
77354044362Smrg# ### END FUNCTIONS SHARED WITH CONFIGURE
7744e411241Smrg
77554044362Smrg_LT_EOF
7764e411241Smrg
77754044362Smrg  case $host_os in
77854044362Smrg  aix3*)
77954044362Smrg    cat <<\_LT_EOF >> "$cfgfile"
78054044362Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
78154044362Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
78254044362Smrg# vanish in a puff of smoke.
78354044362Smrgif test set != "${COLLECT_NAMES+set}"; then
78454044362Smrg  COLLECT_NAMES=
78554044362Smrg  export COLLECT_NAMES
78654044362Smrgfi
78754044362Smrg_LT_EOF
78854044362Smrg    ;;
78954044362Smrg  esac
7904e411241Smrg
79154044362Smrg  _LT_PROG_LTMAIN
7924e411241Smrg
79354044362Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
79454044362Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
79554044362Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
79654044362Smrg  # is reportedly fixed, but why not run on old versions too?
79754044362Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
79854044362Smrg     || (rm -f "$cfgfile"; exit 1)
7994e411241Smrg
80054044362Smrg   mv -f "$cfgfile" "$ofile" ||
80154044362Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
80254044362Smrg  chmod +x "$ofile"
80354044362Smrg],
80454044362Smrg[cat <<_LT_EOF >> "$ofile"
8054e411241Smrg
80654044362Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
80754044362Smrgdnl in a comment (ie after a #).
80854044362Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
80954044362Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
81054044362Smrg# ### END LIBTOOL TAG CONFIG: $1
81154044362Smrg_LT_EOF
81254044362Smrg])dnl /m4_if
81354044362Smrg],
81454044362Smrg[m4_if([$1], [], [
81554044362Smrg    PACKAGE='$PACKAGE'
81654044362Smrg    VERSION='$VERSION'
81754044362Smrg    RM='$RM'
81854044362Smrg    ofile='$ofile'], [])
81954044362Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
82054044362Smrg])# _LT_CONFIG
8214e411241Smrg
8228c9fbc29Smrg
82354044362Smrg# LT_SUPPORTED_TAG(TAG)
82454044362Smrg# ---------------------
82554044362Smrg# Trace this macro to discover what tags are supported by the libtool
82654044362Smrg# --tag option, using:
82754044362Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
82854044362SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
8294cd6a3aeSmrg
8304cd6a3aeSmrg
83154044362Smrg# C support is built-in for now
83254044362Smrgm4_define([_LT_LANG_C_enabled], [])
83354044362Smrgm4_define([_LT_TAGS], [])
8344cd6a3aeSmrg
8354cd6a3aeSmrg
83654044362Smrg# LT_LANG(LANG)
83754044362Smrg# -------------
83854044362Smrg# Enable libtool support for the given language if not already enabled.
83954044362SmrgAC_DEFUN([LT_LANG],
84054044362Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
84154044362Smrgm4_case([$1],
84254044362Smrg  [C],			[_LT_LANG(C)],
84354044362Smrg  [C++],		[_LT_LANG(CXX)],
84454044362Smrg  [Go],			[_LT_LANG(GO)],
84554044362Smrg  [Java],		[_LT_LANG(GCJ)],
84654044362Smrg  [Fortran 77],		[_LT_LANG(F77)],
84754044362Smrg  [Fortran],		[_LT_LANG(FC)],
84854044362Smrg  [Windows Resource],	[_LT_LANG(RC)],
84954044362Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
85054044362Smrg    [_LT_LANG($1)],
85154044362Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
85254044362Smrg])# LT_LANG
8538c9fbc29Smrg
8544e411241Smrg
85554044362Smrg# _LT_LANG(LANGNAME)
85654044362Smrg# ------------------
85754044362Smrgm4_defun([_LT_LANG],
85854044362Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
85954044362Smrg  [LT_SUPPORTED_TAG([$1])dnl
86054044362Smrg  m4_append([_LT_TAGS], [$1 ])dnl
86154044362Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
86254044362Smrg  _LT_LANG_$1_CONFIG($1)])dnl
86354044362Smrg])# _LT_LANG
8648c9fbc29Smrg
8658c9fbc29Smrg
86654044362Smrgm4_ifndef([AC_PROG_GO], [
86754044362Smrg# NOTE: This macro has been submitted for inclusion into   #
86854044362Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
86954044362Smrg#  a released version of Autoconf we should remove this    #
87054044362Smrg#  macro and use it instead.                               #
87154044362Smrgm4_defun([AC_PROG_GO],
87254044362Smrg[AC_LANG_PUSH(Go)dnl
87354044362SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
87454044362SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
87554044362Smrg_AC_ARG_VAR_LDFLAGS()dnl
87654044362SmrgAC_CHECK_TOOL(GOC, gccgo)
87754044362Smrgif test -z "$GOC"; then
87854044362Smrg  if test -n "$ac_tool_prefix"; then
87954044362Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
88054044362Smrg  fi
88154044362Smrgfi
88254044362Smrgif test -z "$GOC"; then
88354044362Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
88454044362Smrgfi
88554044362Smrg])#m4_defun
88654044362Smrg])#m4_ifndef
8878c9fbc29Smrg
8888c9fbc29Smrg
88954044362Smrg# _LT_LANG_DEFAULT_CONFIG
89054044362Smrg# -----------------------
89154044362Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
89254044362Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
89354044362Smrg  [LT_LANG(CXX)],
89454044362Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
8958c9fbc29Smrg
89654044362SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
89754044362Smrg  [LT_LANG(F77)],
89854044362Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
8998c9fbc29Smrg
90054044362SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
90154044362Smrg  [LT_LANG(FC)],
90254044362Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
9038c9fbc29Smrg
90454044362Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
90554044362Smrgdnl pulling things in needlessly.
90654044362SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
90754044362Smrg  [LT_LANG(GCJ)],
90854044362Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
90954044362Smrg    [LT_LANG(GCJ)],
91054044362Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
91154044362Smrg      [LT_LANG(GCJ)],
91254044362Smrg      [m4_ifdef([AC_PROG_GCJ],
91354044362Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
91454044362Smrg       m4_ifdef([A][M_PROG_GCJ],
91554044362Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
91654044362Smrg       m4_ifdef([LT_PROG_GCJ],
91754044362Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
9184cd6a3aeSmrg
91954044362SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
92054044362Smrg  [LT_LANG(GO)],
92154044362Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
9224cd6a3aeSmrg
92354044362SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
92454044362Smrg  [LT_LANG(RC)],
92554044362Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
92654044362Smrg])# _LT_LANG_DEFAULT_CONFIG
9274cd6a3aeSmrg
92854044362Smrg# Obsolete macros:
92954044362SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
93054044362SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
93154044362SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
93254044362SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
93354044362SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
93454044362Smrgdnl aclocal-1.4 backwards compatibility:
93554044362Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
93654044362Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
93754044362Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
93854044362Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
93954044362Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
9408c9fbc29Smrg
9418c9fbc29Smrg
94254044362Smrg# _LT_TAG_COMPILER
94354044362Smrg# ----------------
94454044362Smrgm4_defun([_LT_TAG_COMPILER],
94554044362Smrg[AC_REQUIRE([AC_PROG_CC])dnl
9464cd6a3aeSmrg
94754044362Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
94854044362Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
94954044362Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
95054044362Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
9514cd6a3aeSmrg
95254044362Smrg# If no C compiler was specified, use CC.
95354044362SmrgLTCC=${LTCC-"$CC"}
9544cd6a3aeSmrg
95554044362Smrg# If no C compiler flags were specified, use CFLAGS.
95654044362SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
9574cd6a3aeSmrg
95854044362Smrg# Allow CC to be a program name with arguments.
95954044362Smrgcompiler=$CC
96054044362Smrg])# _LT_TAG_COMPILER
9614cd6a3aeSmrg
9628c9fbc29Smrg
96354044362Smrg# _LT_COMPILER_BOILERPLATE
96454044362Smrg# ------------------------
96554044362Smrg# Check for compiler boilerplate output or warnings with
96654044362Smrg# the simple compiler test code.
96754044362Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
96854044362Smrg[m4_require([_LT_DECL_SED])dnl
96954044362Smrgac_outfile=conftest.$ac_objext
97054044362Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
97154044362Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
97254044362Smrg_lt_compiler_boilerplate=`cat conftest.err`
97354044362Smrg$RM conftest*
97454044362Smrg])# _LT_COMPILER_BOILERPLATE
9758c9fbc29Smrg
9768c9fbc29Smrg
97754044362Smrg# _LT_LINKER_BOILERPLATE
97854044362Smrg# ----------------------
97954044362Smrg# Check for linker boilerplate output or warnings with
98054044362Smrg# the simple link test code.
98154044362Smrgm4_defun([_LT_LINKER_BOILERPLATE],
98254044362Smrg[m4_require([_LT_DECL_SED])dnl
98354044362Smrgac_outfile=conftest.$ac_objext
98454044362Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
98554044362Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
98654044362Smrg_lt_linker_boilerplate=`cat conftest.err`
98754044362Smrg$RM -r conftest*
98854044362Smrg])# _LT_LINKER_BOILERPLATE
9898c9fbc29Smrg
99054044362Smrg# _LT_REQUIRED_DARWIN_CHECKS
99154044362Smrg# -------------------------
99254044362Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
99354044362Smrg  case $host_os in
99454044362Smrg    rhapsody* | darwin*)
99554044362Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
99654044362Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
99754044362Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
99854044362Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
99954044362Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
100054044362Smrg    _LT_DECL([], [DSYMUTIL], [1],
100154044362Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
100254044362Smrg    _LT_DECL([], [NMEDIT], [1],
100354044362Smrg      [Tool to change global to local symbols on Mac OS X])
100454044362Smrg    _LT_DECL([], [LIPO], [1],
100554044362Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
100654044362Smrg    _LT_DECL([], [OTOOL], [1],
100754044362Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
100854044362Smrg    _LT_DECL([], [OTOOL64], [1],
100954044362Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
10108c9fbc29Smrg
101154044362Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
101254044362Smrg      [lt_cv_apple_cc_single_mod=no
101354044362Smrg      if test -z "$LT_MULTI_MODULE"; then
101454044362Smrg	# By default we will add the -single_module flag. You can override
101554044362Smrg	# by either setting the environment variable LT_MULTI_MODULE
101654044362Smrg	# non-empty at configure time, or by adding -multi_module to the
101754044362Smrg	# link flags.
101854044362Smrg	rm -rf libconftest.dylib*
101954044362Smrg	echo "int foo(void){return 1;}" > conftest.c
102054044362Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
102154044362Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
102254044362Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
102354044362Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
102454044362Smrg        _lt_result=$?
102554044362Smrg	# If there is a non-empty error log, and "single_module"
102654044362Smrg	# appears in it, assume the flag caused a linker warning
102754044362Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
102854044362Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
102954044362Smrg	# Otherwise, if the output was created with a 0 exit code from
103054044362Smrg	# the compiler, it worked.
103154044362Smrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
103254044362Smrg	  lt_cv_apple_cc_single_mod=yes
103354044362Smrg	else
103454044362Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
103554044362Smrg	fi
103654044362Smrg	rm -rf libconftest.dylib*
103754044362Smrg	rm -f conftest.*
103854044362Smrg      fi])
10398c9fbc29Smrg
104054044362Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
104154044362Smrg      [lt_cv_ld_exported_symbols_list],
104254044362Smrg      [lt_cv_ld_exported_symbols_list=no
104354044362Smrg      save_LDFLAGS=$LDFLAGS
104454044362Smrg      echo "_main" > conftest.sym
104554044362Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
104654044362Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
104754044362Smrg	[lt_cv_ld_exported_symbols_list=yes],
104854044362Smrg	[lt_cv_ld_exported_symbols_list=no])
104954044362Smrg	LDFLAGS=$save_LDFLAGS
105054044362Smrg    ])
105154044362Smrg
105254044362Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
105354044362Smrg      [lt_cv_ld_force_load=no
105454044362Smrg      cat > conftest.c << _LT_EOF
105554044362Smrgint forced_loaded() { return 2;}
105654044362Smrg_LT_EOF
105754044362Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
105854044362Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
105954044362Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
106054044362Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
106154044362Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
106254044362Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
106354044362Smrg      cat > conftest.c << _LT_EOF
106454044362Smrgint main() { return 0;}
106554044362Smrg_LT_EOF
106654044362Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
106754044362Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
106854044362Smrg      _lt_result=$?
106954044362Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
107054044362Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
107154044362Smrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
107254044362Smrg	lt_cv_ld_force_load=yes
107354044362Smrg      else
107454044362Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
107554044362Smrg      fi
107654044362Smrg        rm -f conftest.err libconftest.a conftest conftest.c
107754044362Smrg        rm -rf conftest.dSYM
107854044362Smrg    ])
107954044362Smrg    case $host_os in
108054044362Smrg    rhapsody* | darwin1.[[012]])
108154044362Smrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
108254044362Smrg    darwin1.*)
108354044362Smrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
108454044362Smrg    darwin*) # darwin 5.x on
108554044362Smrg      # if running on 10.5 or later, the deployment target defaults
108654044362Smrg      # to the OS version, if on x86, and 10.4, the deployment
108754044362Smrg      # target defaults to 10.4. Don't you love it?
108854044362Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
108954044362Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
109054044362Smrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
109154044362Smrg	10.[[012]][[,.]]*)
109254044362Smrg	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
109354044362Smrg	10.*)
109454044362Smrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
109554044362Smrg      esac
109654044362Smrg    ;;
109754044362Smrg  esac
109854044362Smrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
109954044362Smrg      _lt_dar_single_mod='$single_module'
110054044362Smrg    fi
110154044362Smrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
110254044362Smrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
110354044362Smrg    else
110454044362Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
110554044362Smrg    fi
110654044362Smrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
110754044362Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
110854044362Smrg    else
110954044362Smrg      _lt_dsymutil=
111054044362Smrg    fi
111154044362Smrg    ;;
111254044362Smrg  esac
11134cd6a3aeSmrg])
11148c9fbc29Smrg
11158c9fbc29Smrg
111654044362Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
111754044362Smrg# ---------------------------------
111854044362Smrg# Checks for linker and compiler features on darwin
111954044362Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
112054044362Smrg[
112154044362Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
112254044362Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
112354044362Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
112454044362Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
112554044362Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
112654044362Smrg  if test yes = "$lt_cv_ld_force_load"; then
112754044362Smrg    _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\"`'
112854044362Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
112954044362Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
113054044362Smrg  else
113154044362Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
113254044362Smrg  fi
113354044362Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
113454044362Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
113554044362Smrg  case $cc_basename in
113654044362Smrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
113754044362Smrg     *) _lt_dar_can_shared=$GCC ;;
113854044362Smrg  esac
113954044362Smrg  if test yes = "$_lt_dar_can_shared"; then
114054044362Smrg    output_verbose_link_cmd=func_echo_all
114154044362Smrg    _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"
114254044362Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
114354044362Smrg    _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"
114454044362Smrg    _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"
114554044362Smrg    m4_if([$1], [CXX],
114654044362Smrg[   if test yes != "$lt_cv_apple_cc_single_mod"; then
114754044362Smrg      _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"
114854044362Smrg      _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"
114954044362Smrg    fi
115054044362Smrg],[])
115154044362Smrg  else
115254044362Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
115354044362Smrg  fi
115454044362Smrg])
11558c9fbc29Smrg
115654044362Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
115754044362Smrg# ----------------------------------
115854044362Smrg# Links a minimal program and checks the executable
115954044362Smrg# for the system default hardcoded library path. In most cases,
116054044362Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
116154044362Smrg# the location of the communication and MPI libs are included too.
116254044362Smrg# If we don't find anything, use the default library path according
116354044362Smrg# to the aix ld manual.
116454044362Smrg# Store the results from the different compilers for each TAGNAME.
116554044362Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
116654044362Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
116754044362Smrg[m4_require([_LT_DECL_SED])dnl
116854044362Smrgif test set = "${lt_cv_aix_libpath+set}"; then
116954044362Smrg  aix_libpath=$lt_cv_aix_libpath
117054044362Smrgelse
117154044362Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
117254044362Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
117354044362Smrg  lt_aix_libpath_sed='[
117454044362Smrg      /Import File Strings/,/^$/ {
117554044362Smrg	  /^0/ {
117654044362Smrg	      s/^0  *\([^ ]*\) *$/\1/
117754044362Smrg	      p
117854044362Smrg	  }
117954044362Smrg      }]'
118054044362Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
118154044362Smrg  # Check for a 64-bit object if we didn't find anything.
118254044362Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
118354044362Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
118454044362Smrg  fi],[])
118554044362Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
118654044362Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
118754044362Smrg  fi
118854044362Smrg  ])
118954044362Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
119054044362Smrgfi
119154044362Smrg])# _LT_SYS_MODULE_PATH_AIX
11928c9fbc29Smrg
11938c9fbc29Smrg
119454044362Smrg# _LT_SHELL_INIT(ARG)
119554044362Smrg# -------------------
119654044362Smrgm4_define([_LT_SHELL_INIT],
119754044362Smrg[m4_divert_text([M4SH-INIT], [$1
119854044362Smrg])])# _LT_SHELL_INIT
11998c9fbc29Smrg
12008c9fbc29Smrg
12018c9fbc29Smrg
120254044362Smrg# _LT_PROG_ECHO_BACKSLASH
120354044362Smrg# -----------------------
120454044362Smrg# Find how we can fake an echo command that does not interpret backslash.
120554044362Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
120654044362Smrg# of the generated configure script that will find a shell with a builtin
120754044362Smrg# printf (that we can use as an echo command).
120854044362Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
120954044362Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
121054044362SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
121154044362SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
12128c9fbc29Smrg
121354044362SmrgAC_MSG_CHECKING([how to print strings])
121454044362Smrg# Test print first, because it will be a builtin if present.
121554044362Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
121654044362Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
121754044362Smrg  ECHO='print -r --'
121854044362Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
121954044362Smrg  ECHO='printf %s\n'
122054044362Smrgelse
122154044362Smrg  # Use this function as a fallback that always works.
122254044362Smrg  func_fallback_echo ()
122354044362Smrg  {
122454044362Smrg    eval 'cat <<_LTECHO_EOF
122554044362Smrg$[]1
122654044362Smrg_LTECHO_EOF'
122754044362Smrg  }
122854044362Smrg  ECHO='func_fallback_echo'
122954044362Smrgfi
12308c9fbc29Smrg
123154044362Smrg# func_echo_all arg...
123254044362Smrg# Invoke $ECHO with all args, space-separated.
123354044362Smrgfunc_echo_all ()
123454044362Smrg{
123554044362Smrg    $ECHO "$*"
123654044362Smrg}
12378c9fbc29Smrg
123854044362Smrgcase $ECHO in
123954044362Smrg  printf*) AC_MSG_RESULT([printf]) ;;
124054044362Smrg  print*) AC_MSG_RESULT([print -r]) ;;
124154044362Smrg  *) AC_MSG_RESULT([cat]) ;;
124254044362Smrgesac
12438c9fbc29Smrg
124454044362Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
124554044362Smrg[_AS_DETECT_SUGGESTED([
124654044362Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
124754044362Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
124854044362Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
124954044362Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
125054044362Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
125154044362Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
125254044362Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
12538c9fbc29Smrg
125454044362Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
125554044362Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
125654044362Smrg])# _LT_PROG_ECHO_BACKSLASH
12574e411241Smrg
125854044362Smrg
125954044362Smrg# _LT_WITH_SYSROOT
12604cd6a3aeSmrg# ----------------
126154044362SmrgAC_DEFUN([_LT_WITH_SYSROOT],
126254044362Smrg[AC_MSG_CHECKING([for sysroot])
126354044362SmrgAC_ARG_WITH([sysroot],
126454044362Smrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
126554044362Smrg  [Search for dependent libraries within DIR (or the compiler's sysroot
126654044362Smrg   if not specified).])],
126754044362Smrg[], [with_sysroot=no])
12688c9fbc29Smrg
126954044362Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
127054044362Smrgdnl in case the user passed a directory name.
127154044362Smrglt_sysroot=
127254044362Smrgcase $with_sysroot in #(
127354044362Smrg yes)
127454044362Smrg   if test yes = "$GCC"; then
127554044362Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
127654044362Smrg   fi
127754044362Smrg   ;; #(
127854044362Smrg /*)
127954044362Smrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
128054044362Smrg   ;; #(
128154044362Smrg no|'')
128254044362Smrg   ;; #(
128354044362Smrg *)
128454044362Smrg   AC_MSG_RESULT([$with_sysroot])
128554044362Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
128654044362Smrg   ;;
128754044362Smrgesac
12888c9fbc29Smrg
128954044362Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
129054044362Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
129154044362Smrg[dependent libraries, and where our libraries should be installed.])])
12928c9fbc29Smrg
129354044362Smrg# _LT_ENABLE_LOCK
129454044362Smrg# ---------------
129554044362Smrgm4_defun([_LT_ENABLE_LOCK],
129654044362Smrg[AC_ARG_ENABLE([libtool-lock],
129754044362Smrg  [AS_HELP_STRING([--disable-libtool-lock],
129854044362Smrg    [avoid locking (might break parallel builds)])])
129954044362Smrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
13008c9fbc29Smrg
130154044362Smrg# Some flags need to be propagated to the compiler or linker for good
130254044362Smrg# libtool support.
130354044362Smrgcase $host in
130454044362Smrgia64-*-hpux*)
130554044362Smrg  # Find out what ABI is being produced by ac_compile, and set mode
130654044362Smrg  # options accordingly.
130754044362Smrg  echo 'int i;' > conftest.$ac_ext
130854044362Smrg  if AC_TRY_EVAL(ac_compile); then
130954044362Smrg    case `/usr/bin/file conftest.$ac_objext` in
131054044362Smrg      *ELF-32*)
131154044362Smrg	HPUX_IA64_MODE=32
131254044362Smrg	;;
131354044362Smrg      *ELF-64*)
131454044362Smrg	HPUX_IA64_MODE=64
131554044362Smrg	;;
131654044362Smrg    esac
131754044362Smrg  fi
131854044362Smrg  rm -rf conftest*
131954044362Smrg  ;;
132054044362Smrg*-*-irix6*)
132154044362Smrg  # Find out what ABI is being produced by ac_compile, and set linker
132254044362Smrg  # options accordingly.
132354044362Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
132454044362Smrg  if AC_TRY_EVAL(ac_compile); then
132554044362Smrg    if test yes = "$lt_cv_prog_gnu_ld"; then
132654044362Smrg      case `/usr/bin/file conftest.$ac_objext` in
132754044362Smrg	*32-bit*)
132854044362Smrg	  LD="${LD-ld} -melf32bsmip"
132954044362Smrg	  ;;
133054044362Smrg	*N32*)
133154044362Smrg	  LD="${LD-ld} -melf32bmipn32"
133254044362Smrg	  ;;
133354044362Smrg	*64-bit*)
133454044362Smrg	  LD="${LD-ld} -melf64bmip"
133554044362Smrg	;;
133654044362Smrg      esac
133754044362Smrg    else
133854044362Smrg      case `/usr/bin/file conftest.$ac_objext` in
133954044362Smrg	*32-bit*)
134054044362Smrg	  LD="${LD-ld} -32"
134154044362Smrg	  ;;
134254044362Smrg	*N32*)
134354044362Smrg	  LD="${LD-ld} -n32"
134454044362Smrg	  ;;
134554044362Smrg	*64-bit*)
134654044362Smrg	  LD="${LD-ld} -64"
134754044362Smrg	  ;;
134854044362Smrg      esac
134954044362Smrg    fi
135054044362Smrg  fi
135154044362Smrg  rm -rf conftest*
135254044362Smrg  ;;
13538c9fbc29Smrg
135454044362Smrgmips64*-*linux*)
135554044362Smrg  # Find out what ABI is being produced by ac_compile, and set linker
135654044362Smrg  # options accordingly.
135754044362Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
135854044362Smrg  if AC_TRY_EVAL(ac_compile); then
135954044362Smrg    emul=elf
136054044362Smrg    case `/usr/bin/file conftest.$ac_objext` in
136154044362Smrg      *32-bit*)
136254044362Smrg	emul="${emul}32"
136354044362Smrg	;;
136454044362Smrg      *64-bit*)
136554044362Smrg	emul="${emul}64"
136654044362Smrg	;;
136754044362Smrg    esac
136854044362Smrg    case `/usr/bin/file conftest.$ac_objext` in
136954044362Smrg      *MSB*)
137054044362Smrg	emul="${emul}btsmip"
137154044362Smrg	;;
137254044362Smrg      *LSB*)
137354044362Smrg	emul="${emul}ltsmip"
137454044362Smrg	;;
137554044362Smrg    esac
137654044362Smrg    case `/usr/bin/file conftest.$ac_objext` in
137754044362Smrg      *N32*)
137854044362Smrg	emul="${emul}n32"
137954044362Smrg	;;
138054044362Smrg    esac
138154044362Smrg    LD="${LD-ld} -m $emul"
138254044362Smrg  fi
138354044362Smrg  rm -rf conftest*
138454044362Smrg  ;;
13858c9fbc29Smrg
138654044362Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
138754044362Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
138854044362Smrg  # Find out what ABI is being produced by ac_compile, and set linker
138954044362Smrg  # options accordingly.  Note that the listed cases only cover the
139054044362Smrg  # situations where additional linker options are needed (such as when
139154044362Smrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
139254044362Smrg  # vice versa); the common cases where no linker options are needed do
139354044362Smrg  # not appear in the list.
139454044362Smrg  echo 'int i;' > conftest.$ac_ext
139554044362Smrg  if AC_TRY_EVAL(ac_compile); then
139654044362Smrg    case `/usr/bin/file conftest.o` in
139754044362Smrg      *32-bit*)
139854044362Smrg	case $host in
139954044362Smrg	  x86_64-*kfreebsd*-gnu)
140054044362Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
140154044362Smrg	    ;;
140254044362Smrg	  x86_64-*linux*)
140354044362Smrg	    case `/usr/bin/file conftest.o` in
140454044362Smrg	      *x86-64*)
140554044362Smrg		LD="${LD-ld} -m elf32_x86_64"
140654044362Smrg		;;
140754044362Smrg	      *)
140854044362Smrg		LD="${LD-ld} -m elf_i386"
140954044362Smrg		;;
141054044362Smrg	    esac
141154044362Smrg	    ;;
141254044362Smrg	  powerpc64le-*linux*)
141354044362Smrg	    LD="${LD-ld} -m elf32lppclinux"
141454044362Smrg	    ;;
141554044362Smrg	  powerpc64-*linux*)
141654044362Smrg	    LD="${LD-ld} -m elf32ppclinux"
141754044362Smrg	    ;;
141854044362Smrg	  s390x-*linux*)
141954044362Smrg	    LD="${LD-ld} -m elf_s390"
142054044362Smrg	    ;;
142154044362Smrg	  sparc64-*linux*)
142254044362Smrg	    LD="${LD-ld} -m elf32_sparc"
142354044362Smrg	    ;;
142454044362Smrg	esac
142554044362Smrg	;;
142654044362Smrg      *64-bit*)
142754044362Smrg	case $host in
142854044362Smrg	  x86_64-*kfreebsd*-gnu)
142954044362Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
143054044362Smrg	    ;;
143154044362Smrg	  x86_64-*linux*)
143254044362Smrg	    LD="${LD-ld} -m elf_x86_64"
143354044362Smrg	    ;;
143454044362Smrg	  powerpcle-*linux*)
143554044362Smrg	    LD="${LD-ld} -m elf64lppc"
143654044362Smrg	    ;;
143754044362Smrg	  powerpc-*linux*)
143854044362Smrg	    LD="${LD-ld} -m elf64ppc"
143954044362Smrg	    ;;
144054044362Smrg	  s390*-*linux*|s390*-*tpf*)
144154044362Smrg	    LD="${LD-ld} -m elf64_s390"
144254044362Smrg	    ;;
144354044362Smrg	  sparc*-*linux*)
144454044362Smrg	    LD="${LD-ld} -m elf64_sparc"
144554044362Smrg	    ;;
144654044362Smrg	esac
144754044362Smrg	;;
144854044362Smrg    esac
144954044362Smrg  fi
145054044362Smrg  rm -rf conftest*
145154044362Smrg  ;;
14528c9fbc29Smrg
145354044362Smrg*-*-sco3.2v5*)
145454044362Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
145554044362Smrg  SAVE_CFLAGS=$CFLAGS
145654044362Smrg  CFLAGS="$CFLAGS -belf"
145754044362Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
145854044362Smrg    [AC_LANG_PUSH(C)
145954044362Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
146054044362Smrg     AC_LANG_POP])
146154044362Smrg  if test yes != "$lt_cv_cc_needs_belf"; then
146254044362Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
146354044362Smrg    CFLAGS=$SAVE_CFLAGS
146454044362Smrg  fi
146554044362Smrg  ;;
146654044362Smrg*-*solaris*)
146754044362Smrg  # Find out what ABI is being produced by ac_compile, and set linker
146854044362Smrg  # options accordingly.
146954044362Smrg  echo 'int i;' > conftest.$ac_ext
147054044362Smrg  if AC_TRY_EVAL(ac_compile); then
147154044362Smrg    case `/usr/bin/file conftest.o` in
147254044362Smrg    *64-bit*)
147354044362Smrg      case $lt_cv_prog_gnu_ld in
147454044362Smrg      yes*)
147554044362Smrg        case $host in
147654044362Smrg        i?86-*-solaris*|x86_64-*-solaris*)
147754044362Smrg          LD="${LD-ld} -m elf_x86_64"
147854044362Smrg          ;;
147954044362Smrg        sparc*-*-solaris*)
148054044362Smrg          LD="${LD-ld} -m elf64_sparc"
148154044362Smrg          ;;
148254044362Smrg        esac
148354044362Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
148454044362Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
148554044362Smrg          LD=${LD-ld}_sol2
148654044362Smrg        fi
148754044362Smrg        ;;
148854044362Smrg      *)
148954044362Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
149054044362Smrg	  LD="${LD-ld} -64"
149154044362Smrg	fi
149254044362Smrg	;;
149354044362Smrg      esac
149454044362Smrg      ;;
149554044362Smrg    esac
149654044362Smrg  fi
149754044362Smrg  rm -rf conftest*
149854044362Smrg  ;;
149954044362Smrgesac
15008c9fbc29Smrg
150154044362Smrgneed_locks=$enable_libtool_lock
150254044362Smrg])# _LT_ENABLE_LOCK
15038c9fbc29Smrg
15048c9fbc29Smrg
150554044362Smrg# _LT_PROG_AR
150654044362Smrg# -----------
150754044362Smrgm4_defun([_LT_PROG_AR],
150854044362Smrg[AC_CHECK_TOOLS(AR, [ar], false)
150954044362Smrg: ${AR=ar}
151054044362Smrg: ${AR_FLAGS=cru}
151154044362Smrg_LT_DECL([], [AR], [1], [The archiver])
151254044362Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
15134cd6a3aeSmrg
151454044362SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
151554044362Smrg  [lt_cv_ar_at_file=no
151654044362Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
151754044362Smrg     [echo conftest.$ac_objext > conftest.lst
151854044362Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
151954044362Smrg      AC_TRY_EVAL([lt_ar_try])
152054044362Smrg      if test 0 -eq "$ac_status"; then
152154044362Smrg	# Ensure the archiver fails upon bogus file names.
152254044362Smrg	rm -f conftest.$ac_objext libconftest.a
152354044362Smrg	AC_TRY_EVAL([lt_ar_try])
152454044362Smrg	if test 0 -ne "$ac_status"; then
152554044362Smrg          lt_cv_ar_at_file=@
152654044362Smrg        fi
152754044362Smrg      fi
152854044362Smrg      rm -f conftest.* libconftest.a
152954044362Smrg     ])
153054044362Smrg  ])
15314cd6a3aeSmrg
153254044362Smrgif test no = "$lt_cv_ar_at_file"; then
153354044362Smrg  archiver_list_spec=
153454044362Smrgelse
153554044362Smrg  archiver_list_spec=$lt_cv_ar_at_file
153654044362Smrgfi
153754044362Smrg_LT_DECL([], [archiver_list_spec], [1],
153854044362Smrg  [How to feed a file listing to the archiver])
153954044362Smrg])# _LT_PROG_AR
15404cd6a3aeSmrg
15414cd6a3aeSmrg
154254044362Smrg# _LT_CMD_OLD_ARCHIVE
154354044362Smrg# -------------------
154454044362Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
154554044362Smrg[_LT_PROG_AR
15464cd6a3aeSmrg
154754044362SmrgAC_CHECK_TOOL(STRIP, strip, :)
154854044362Smrgtest -z "$STRIP" && STRIP=:
154954044362Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
15504cd6a3aeSmrg
155154044362SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
155254044362Smrgtest -z "$RANLIB" && RANLIB=:
155354044362Smrg_LT_DECL([], [RANLIB], [1],
155454044362Smrg    [Commands used to install an old-style archive])
15558c9fbc29Smrg
155654044362Smrg# Determine commands to create old-style static archives.
155754044362Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
155854044362Smrgold_postinstall_cmds='chmod 644 $oldlib'
155954044362Smrgold_postuninstall_cmds=
15604cd6a3aeSmrg
156154044362Smrgif test -n "$RANLIB"; then
156254044362Smrg  case $host_os in
156354044362Smrg  bitrig* | openbsd*)
156454044362Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
156554044362Smrg    ;;
156654044362Smrg  *)
156754044362Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
156854044362Smrg    ;;
156954044362Smrg  esac
157054044362Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
157154044362Smrgfi
15724cd6a3aeSmrg
157354044362Smrgcase $host_os in
157454044362Smrg  darwin*)
157554044362Smrg    lock_old_archive_extraction=yes ;;
157654044362Smrg  *)
157754044362Smrg    lock_old_archive_extraction=no ;;
157854044362Smrgesac
157954044362Smrg_LT_DECL([], [old_postinstall_cmds], [2])
158054044362Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
158154044362Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
158254044362Smrg    [Commands used to build an old-style archive])
158354044362Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
158454044362Smrg    [Whether to use a lock for old archive extraction])
158554044362Smrg])# _LT_CMD_OLD_ARCHIVE
15868c9fbc29Smrg
15874cd6a3aeSmrg
158854044362Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
158954044362Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
159054044362Smrg# ----------------------------------------------------------------
159154044362Smrg# Check whether the given compiler option works
159254044362SmrgAC_DEFUN([_LT_COMPILER_OPTION],
159354044362Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
159454044362Smrgm4_require([_LT_DECL_SED])dnl
159554044362SmrgAC_CACHE_CHECK([$1], [$2],
159654044362Smrg  [$2=no
159754044362Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
159854044362Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
159954044362Smrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
160054044362Smrg   # Insert the option either (1) after the last *FLAGS variable, or
160154044362Smrg   # (2) before a word containing "conftest.", or (3) at the end.
160254044362Smrg   # Note that $ac_compile itself does not contain backslashes and begins
160354044362Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
160454044362Smrg   # The option is referenced via a variable to avoid confusing sed.
160554044362Smrg   lt_compile=`echo "$ac_compile" | $SED \
160654044362Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
160754044362Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
160854044362Smrg   -e 's:$: $lt_compiler_flag:'`
160954044362Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
161054044362Smrg   (eval "$lt_compile" 2>conftest.err)
161154044362Smrg   ac_status=$?
161254044362Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
161354044362Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
161454044362Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
161554044362Smrg     # The compiler can only warn and ignore the option if not recognized
161654044362Smrg     # So say no if there are warnings other than the usual output.
161754044362Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
161854044362Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
161954044362Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
162054044362Smrg       $2=yes
162154044362Smrg     fi
162254044362Smrg   fi
162354044362Smrg   $RM conftest*
162454044362Smrg])
16254cd6a3aeSmrg
162654044362Smrgif test yes = "[$]$2"; then
162754044362Smrg    m4_if([$5], , :, [$5])
162854044362Smrgelse
162954044362Smrg    m4_if([$6], , :, [$6])
163054044362Smrgfi
163154044362Smrg])# _LT_COMPILER_OPTION
16324cd6a3aeSmrg
163354044362Smrg# Old name:
163454044362SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
163554044362Smrgdnl aclocal-1.4 backwards compatibility:
163654044362Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
16374cd6a3aeSmrg
16384cd6a3aeSmrg
163954044362Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
164054044362Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
164154044362Smrg# ----------------------------------------------------
164254044362Smrg# Check whether the given linker option works
164354044362SmrgAC_DEFUN([_LT_LINKER_OPTION],
164454044362Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
164554044362Smrgm4_require([_LT_DECL_SED])dnl
164654044362SmrgAC_CACHE_CHECK([$1], [$2],
164754044362Smrg  [$2=no
164854044362Smrg   save_LDFLAGS=$LDFLAGS
164954044362Smrg   LDFLAGS="$LDFLAGS $3"
165054044362Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
165154044362Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
165254044362Smrg     # The linker can only warn and ignore the option if not recognized
165354044362Smrg     # So say no if there are warnings
165454044362Smrg     if test -s conftest.err; then
165554044362Smrg       # Append any errors to the config.log.
165654044362Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
165754044362Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
165854044362Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
165954044362Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
166054044362Smrg         $2=yes
166154044362Smrg       fi
166254044362Smrg     else
166354044362Smrg       $2=yes
166454044362Smrg     fi
166554044362Smrg   fi
166654044362Smrg   $RM -r conftest*
166754044362Smrg   LDFLAGS=$save_LDFLAGS
166854044362Smrg])
16694cd6a3aeSmrg
167054044362Smrgif test yes = "[$]$2"; then
167154044362Smrg    m4_if([$4], , :, [$4])
167254044362Smrgelse
167354044362Smrg    m4_if([$5], , :, [$5])
167454044362Smrgfi
167554044362Smrg])# _LT_LINKER_OPTION
16764cd6a3aeSmrg
167754044362Smrg# Old name:
167854044362SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
167954044362Smrgdnl aclocal-1.4 backwards compatibility:
168054044362Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
16814cd6a3aeSmrg
16824cd6a3aeSmrg
168354044362Smrg# LT_CMD_MAX_LEN
168454044362Smrg#---------------
168554044362SmrgAC_DEFUN([LT_CMD_MAX_LEN],
168654044362Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
168754044362Smrg# find the maximum length of command line arguments
168854044362SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
168954044362SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
169054044362Smrg  i=0
169154044362Smrg  teststring=ABCD
16924cd6a3aeSmrg
169354044362Smrg  case $build_os in
169454044362Smrg  msdosdjgpp*)
169554044362Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
169654044362Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
169754044362Smrg    # during glob expansion).  Even if it were fixed, the result of this
169854044362Smrg    # check would be larger than it should be.
169954044362Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
170054044362Smrg    ;;
17014cd6a3aeSmrg
170254044362Smrg  gnu*)
170354044362Smrg    # Under GNU Hurd, this test is not required because there is
170454044362Smrg    # no limit to the length of command line arguments.
170554044362Smrg    # Libtool will interpret -1 as no limit whatsoever
170654044362Smrg    lt_cv_sys_max_cmd_len=-1;
170754044362Smrg    ;;
17084cd6a3aeSmrg
170954044362Smrg  cygwin* | mingw* | cegcc*)
171054044362Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
171154044362Smrg    # about 5 minutes as the teststring grows exponentially.
171254044362Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
171354044362Smrg    # you end up with a "frozen" computer, even though with patience
171454044362Smrg    # the test eventually succeeds (with a max line length of 256k).
171554044362Smrg    # Instead, let's just punt: use the minimum linelength reported by
171654044362Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
171754044362Smrg    lt_cv_sys_max_cmd_len=8192;
171854044362Smrg    ;;
17194cd6a3aeSmrg
172054044362Smrg  mint*)
172154044362Smrg    # On MiNT this can take a long time and run out of memory.
172254044362Smrg    lt_cv_sys_max_cmd_len=8192;
172354044362Smrg    ;;
17244cd6a3aeSmrg
172554044362Smrg  amigaos*)
172654044362Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
172754044362Smrg    # So we just punt and use a minimum line length of 8192.
172854044362Smrg    lt_cv_sys_max_cmd_len=8192;
172954044362Smrg    ;;
17304cd6a3aeSmrg
173154044362Smrg  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
173254044362Smrg    # This has been around since 386BSD, at least.  Likely further.
173354044362Smrg    if test -x /sbin/sysctl; then
173454044362Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
173554044362Smrg    elif test -x /usr/sbin/sysctl; then
173654044362Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
173754044362Smrg    else
173854044362Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
173954044362Smrg    fi
174054044362Smrg    # And add a safety zone
174154044362Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
174254044362Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
174354044362Smrg    ;;
17444cd6a3aeSmrg
174554044362Smrg  interix*)
174654044362Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
174754044362Smrg    lt_cv_sys_max_cmd_len=196608
174854044362Smrg    ;;
17494cd6a3aeSmrg
175054044362Smrg  os2*)
175154044362Smrg    # The test takes a long time on OS/2.
175254044362Smrg    lt_cv_sys_max_cmd_len=8192
175354044362Smrg    ;;
17544cd6a3aeSmrg
175554044362Smrg  osf*)
175654044362Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
175754044362Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
175854044362Smrg    # nice to cause kernel panics so lets avoid the loop below.
175954044362Smrg    # First set a reasonable default.
176054044362Smrg    lt_cv_sys_max_cmd_len=16384
176154044362Smrg    #
176254044362Smrg    if test -x /sbin/sysconfig; then
176354044362Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
176454044362Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
176554044362Smrg      esac
176654044362Smrg    fi
176754044362Smrg    ;;
176854044362Smrg  sco3.2v5*)
176954044362Smrg    lt_cv_sys_max_cmd_len=102400
177054044362Smrg    ;;
177154044362Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
177254044362Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
177354044362Smrg    if test -n "$kargmax"; then
177454044362Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
177554044362Smrg    else
177654044362Smrg      lt_cv_sys_max_cmd_len=32768
177754044362Smrg    fi
177854044362Smrg    ;;
177954044362Smrg  *)
178054044362Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
178154044362Smrg    if test -n "$lt_cv_sys_max_cmd_len" && \
178254044362Smrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
178354044362Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
178454044362Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
178554044362Smrg    else
178654044362Smrg      # Make teststring a little bigger before we do anything with it.
178754044362Smrg      # a 1K string should be a reasonable start.
178854044362Smrg      for i in 1 2 3 4 5 6 7 8; do
178954044362Smrg        teststring=$teststring$teststring
179054044362Smrg      done
179154044362Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
179254044362Smrg      # If test is not a shell built-in, we'll probably end up computing a
179354044362Smrg      # maximum length that is only half of the actual maximum length, but
179454044362Smrg      # we can't tell.
179554044362Smrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
179654044362Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
179754044362Smrg	      test 17 != "$i" # 1/2 MB should be enough
179854044362Smrg      do
179954044362Smrg        i=`expr $i + 1`
180054044362Smrg        teststring=$teststring$teststring
180154044362Smrg      done
180254044362Smrg      # Only check the string length outside the loop.
180354044362Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
180454044362Smrg      teststring=
180554044362Smrg      # Add a significant safety factor because C++ compilers can tack on
180654044362Smrg      # massive amounts of additional arguments before passing them to the
180754044362Smrg      # linker.  It appears as though 1/2 is a usable value.
180854044362Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
180954044362Smrg    fi
18104cd6a3aeSmrg    ;;
18114cd6a3aeSmrg  esac
181254044362Smrg])
181354044362Smrgif test -n "$lt_cv_sys_max_cmd_len"; then
181454044362Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
181554044362Smrgelse
181654044362Smrg  AC_MSG_RESULT(none)
181754044362Smrgfi
181854044362Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
181954044362Smrg_LT_DECL([], [max_cmd_len], [0],
182054044362Smrg    [What is the maximum length of a command?])
182154044362Smrg])# LT_CMD_MAX_LEN
18224cd6a3aeSmrg
182354044362Smrg# Old name:
182454044362SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
182554044362Smrgdnl aclocal-1.4 backwards compatibility:
182654044362Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
18274cd6a3aeSmrg
18284cd6a3aeSmrg
182954044362Smrg# _LT_HEADER_DLFCN
183054044362Smrg# ----------------
183154044362Smrgm4_defun([_LT_HEADER_DLFCN],
183254044362Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
183354044362Smrg])# _LT_HEADER_DLFCN
18344cd6a3aeSmrg
18354cd6a3aeSmrg
183654044362Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
183754044362Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
183854044362Smrg# ----------------------------------------------------------------
183954044362Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
184054044362Smrg[m4_require([_LT_HEADER_DLFCN])dnl
184154044362Smrgif test yes = "$cross_compiling"; then :
184254044362Smrg  [$4]
184354044362Smrgelse
184454044362Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
184554044362Smrg  lt_status=$lt_dlunknown
184654044362Smrg  cat > conftest.$ac_ext <<_LT_EOF
184754044362Smrg[#line $LINENO "configure"
184854044362Smrg#include "confdefs.h"
18494cd6a3aeSmrg
185054044362Smrg#if HAVE_DLFCN_H
185154044362Smrg#include <dlfcn.h>
185254044362Smrg#endif
18534cd6a3aeSmrg
185454044362Smrg#include <stdio.h>
18554cd6a3aeSmrg
185654044362Smrg#ifdef RTLD_GLOBAL
185754044362Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
185854044362Smrg#else
185954044362Smrg#  ifdef DL_GLOBAL
186054044362Smrg#    define LT_DLGLOBAL		DL_GLOBAL
186154044362Smrg#  else
186254044362Smrg#    define LT_DLGLOBAL		0
186354044362Smrg#  endif
186454044362Smrg#endif
18654cd6a3aeSmrg
186654044362Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
186754044362Smrg   find out it does not work in some platform. */
186854044362Smrg#ifndef LT_DLLAZY_OR_NOW
186954044362Smrg#  ifdef RTLD_LAZY
187054044362Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
187154044362Smrg#  else
187254044362Smrg#    ifdef DL_LAZY
187354044362Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
187454044362Smrg#    else
187554044362Smrg#      ifdef RTLD_NOW
187654044362Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
187754044362Smrg#      else
187854044362Smrg#        ifdef DL_NOW
187954044362Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
188054044362Smrg#        else
188154044362Smrg#          define LT_DLLAZY_OR_NOW	0
188254044362Smrg#        endif
188354044362Smrg#      endif
188454044362Smrg#    endif
188554044362Smrg#  endif
188654044362Smrg#endif
18874cd6a3aeSmrg
188854044362Smrg/* When -fvisibility=hidden is used, assume the code has been annotated
188954044362Smrg   correspondingly for the symbols needed.  */
189054044362Smrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
189154044362Smrgint fnord () __attribute__((visibility("default")));
189254044362Smrg#endif
18934cd6a3aeSmrg
189454044362Smrgint fnord () { return 42; }
189554044362Smrgint main ()
189654044362Smrg{
189754044362Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
189854044362Smrg  int status = $lt_dlunknown;
18994cd6a3aeSmrg
190054044362Smrg  if (self)
190154044362Smrg    {
190254044362Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
190354044362Smrg      else
190454044362Smrg        {
190554044362Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
190654044362Smrg          else puts (dlerror ());
190754044362Smrg	}
190854044362Smrg      /* dlclose (self); */
190954044362Smrg    }
191054044362Smrg  else
191154044362Smrg    puts (dlerror ());
19124cd6a3aeSmrg
191354044362Smrg  return status;
191454044362Smrg}]
191554044362Smrg_LT_EOF
191654044362Smrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
191754044362Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
191854044362Smrg    lt_status=$?
191954044362Smrg    case x$lt_status in
192054044362Smrg      x$lt_dlno_uscore) $1 ;;
192154044362Smrg      x$lt_dlneed_uscore) $2 ;;
192254044362Smrg      x$lt_dlunknown|x*) $3 ;;
192354044362Smrg    esac
192454044362Smrg  else :
192554044362Smrg    # compilation failed
192654044362Smrg    $3
192770728a38Smrg  fi
192870728a38Smrgfi
192954044362Smrgrm -fr conftest*
193054044362Smrg])# _LT_TRY_DLOPEN_SELF
193170728a38Smrg
193270728a38Smrg
193354044362Smrg# LT_SYS_DLOPEN_SELF
193454044362Smrg# ------------------
193554044362SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
193654044362Smrg[m4_require([_LT_HEADER_DLFCN])dnl
193754044362Smrgif test yes != "$enable_dlopen"; then
193854044362Smrg  enable_dlopen=unknown
193954044362Smrg  enable_dlopen_self=unknown
194054044362Smrg  enable_dlopen_self_static=unknown
194154044362Smrgelse
194254044362Smrg  lt_cv_dlopen=no
194354044362Smrg  lt_cv_dlopen_libs=
19444cd6a3aeSmrg
194554044362Smrg  case $host_os in
194654044362Smrg  beos*)
194754044362Smrg    lt_cv_dlopen=load_add_on
194854044362Smrg    lt_cv_dlopen_libs=
194954044362Smrg    lt_cv_dlopen_self=yes
195054044362Smrg    ;;
19514cd6a3aeSmrg
195254044362Smrg  mingw* | pw32* | cegcc*)
195354044362Smrg    lt_cv_dlopen=LoadLibrary
195454044362Smrg    lt_cv_dlopen_libs=
195554044362Smrg    ;;
19564cd6a3aeSmrg
195754044362Smrg  cygwin*)
195854044362Smrg    lt_cv_dlopen=dlopen
195954044362Smrg    lt_cv_dlopen_libs=
196054044362Smrg    ;;
19614cd6a3aeSmrg
196254044362Smrg  darwin*)
196354044362Smrg    # if libdl is installed we need to link against it
196454044362Smrg    AC_CHECK_LIB([dl], [dlopen],
196554044362Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
196654044362Smrg    lt_cv_dlopen=dyld
196754044362Smrg    lt_cv_dlopen_libs=
196854044362Smrg    lt_cv_dlopen_self=yes
196954044362Smrg    ])
197054044362Smrg    ;;
197170728a38Smrg
197254044362Smrg  tpf*)
197354044362Smrg    # Don't try to run any link tests for TPF.  We know it's impossible
197454044362Smrg    # because TPF is a cross-compiler, and we know how we open DSOs.
197554044362Smrg    lt_cv_dlopen=dlopen
197654044362Smrg    lt_cv_dlopen_libs=
197754044362Smrg    lt_cv_dlopen_self=no
197854044362Smrg    ;;
19794cd6a3aeSmrg
198054044362Smrg  *)
198154044362Smrg    AC_CHECK_FUNC([shl_load],
198254044362Smrg	  [lt_cv_dlopen=shl_load],
198354044362Smrg      [AC_CHECK_LIB([dld], [shl_load],
198454044362Smrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
198554044362Smrg	[AC_CHECK_FUNC([dlopen],
198654044362Smrg	      [lt_cv_dlopen=dlopen],
198754044362Smrg	  [AC_CHECK_LIB([dl], [dlopen],
198854044362Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
198954044362Smrg	    [AC_CHECK_LIB([svld], [dlopen],
199054044362Smrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
199154044362Smrg	      [AC_CHECK_LIB([dld], [dld_link],
199254044362Smrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
199354044362Smrg	      ])
199454044362Smrg	    ])
199554044362Smrg	  ])
199654044362Smrg	])
199754044362Smrg      ])
199854044362Smrg    ;;
199954044362Smrg  esac
20004cd6a3aeSmrg
200154044362Smrg  if test no = "$lt_cv_dlopen"; then
200254044362Smrg    enable_dlopen=no
200354044362Smrg  else
200454044362Smrg    enable_dlopen=yes
200554044362Smrg  fi
20064cd6a3aeSmrg
200754044362Smrg  case $lt_cv_dlopen in
200854044362Smrg  dlopen)
200954044362Smrg    save_CPPFLAGS=$CPPFLAGS
201054044362Smrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
20114cd6a3aeSmrg
201254044362Smrg    save_LDFLAGS=$LDFLAGS
201354044362Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
20144cd6a3aeSmrg
201554044362Smrg    save_LIBS=$LIBS
201654044362Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
20174cd6a3aeSmrg
201854044362Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
201954044362Smrg	  lt_cv_dlopen_self, [dnl
202054044362Smrg	  _LT_TRY_DLOPEN_SELF(
202154044362Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
202254044362Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
202354044362Smrg    ])
20244cd6a3aeSmrg
202554044362Smrg    if test yes = "$lt_cv_dlopen_self"; then
202654044362Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
202754044362Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
202854044362Smrg	  lt_cv_dlopen_self_static, [dnl
202954044362Smrg	  _LT_TRY_DLOPEN_SELF(
203054044362Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
203154044362Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
203254044362Smrg      ])
203354044362Smrg    fi
20344cd6a3aeSmrg
203554044362Smrg    CPPFLAGS=$save_CPPFLAGS
203654044362Smrg    LDFLAGS=$save_LDFLAGS
203754044362Smrg    LIBS=$save_LIBS
203854044362Smrg    ;;
203954044362Smrg  esac
20404cd6a3aeSmrg
204154044362Smrg  case $lt_cv_dlopen_self in
204254044362Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
204354044362Smrg  *) enable_dlopen_self=unknown ;;
204454044362Smrg  esac
20458c9fbc29Smrg
204654044362Smrg  case $lt_cv_dlopen_self_static in
204754044362Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
204854044362Smrg  *) enable_dlopen_self_static=unknown ;;
204954044362Smrg  esac
205054044362Smrgfi
205154044362Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
205254044362Smrg	 [Whether dlopen is supported])
205354044362Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
205454044362Smrg	 [Whether dlopen of programs is supported])
205554044362Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
205654044362Smrg	 [Whether dlopen of statically linked programs is supported])
205754044362Smrg])# LT_SYS_DLOPEN_SELF
20588c9fbc29Smrg
205954044362Smrg# Old name:
206054044362SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
206154044362Smrgdnl aclocal-1.4 backwards compatibility:
206254044362Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
206354044362Smrg
206454044362Smrg
206554044362Smrg# _LT_COMPILER_C_O([TAGNAME])
206654044362Smrg# ---------------------------
206754044362Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
206854044362Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
206954044362Smrgm4_defun([_LT_COMPILER_C_O],
20704cd6a3aeSmrg[m4_require([_LT_DECL_SED])dnl
207154044362Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
207254044362Smrgm4_require([_LT_TAG_COMPILER])dnl
207354044362SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
207454044362Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
207554044362Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
207654044362Smrg   $RM -r conftest 2>/dev/null
207754044362Smrg   mkdir conftest
207854044362Smrg   cd conftest
207954044362Smrg   mkdir out
208054044362Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
20818c9fbc29Smrg
208254044362Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
208354044362Smrg   # Insert the option either (1) after the last *FLAGS variable, or
208454044362Smrg   # (2) before a word containing "conftest.", or (3) at the end.
208554044362Smrg   # Note that $ac_compile itself does not contain backslashes and begins
208654044362Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
208754044362Smrg   lt_compile=`echo "$ac_compile" | $SED \
208854044362Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
208954044362Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
209054044362Smrg   -e 's:$: $lt_compiler_flag:'`
209154044362Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
209254044362Smrg   (eval "$lt_compile" 2>out/conftest.err)
209354044362Smrg   ac_status=$?
209454044362Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
209554044362Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
209654044362Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
209754044362Smrg   then
209854044362Smrg     # The compiler can only warn and ignore the option if not recognized
209954044362Smrg     # So say no if there are warnings
210054044362Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
210154044362Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
210254044362Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
210354044362Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
210454044362Smrg     fi
210554044362Smrg   fi
210654044362Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
210754044362Smrg   $RM conftest*
210854044362Smrg   # SGI C++ compiler will create directory out/ii_files/ for
210954044362Smrg   # template instantiation
211054044362Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
211154044362Smrg   $RM out/* && rmdir out
211254044362Smrg   cd ..
211354044362Smrg   $RM -r conftest
211454044362Smrg   $RM conftest*
21154e411241Smrg])
211654044362Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
211754044362Smrg	[Does compiler simultaneously support -c and -o options?])
211854044362Smrg])# _LT_COMPILER_C_O
21198c9fbc29Smrg
21204cd6a3aeSmrg
212154044362Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
21224cd6a3aeSmrg# ----------------------------------
212354044362Smrg# Check to see if we can do hard links to lock some files if needed
212454044362Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
212554044362Smrg[m4_require([_LT_ENABLE_LOCK])dnl
212654044362Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
212754044362Smrg_LT_COMPILER_C_O([$1])
212854044362Smrg
212954044362Smrghard_links=nottested
213054044362Smrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
213154044362Smrg  # do not overwrite the value of need_locks provided by the user
213254044362Smrg  AC_MSG_CHECKING([if we can lock with hard links])
213354044362Smrg  hard_links=yes
213454044362Smrg  $RM conftest*
213554044362Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
213654044362Smrg  touch conftest.a
213754044362Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
213854044362Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
213954044362Smrg  AC_MSG_RESULT([$hard_links])
214054044362Smrg  if test no = "$hard_links"; then
214154044362Smrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
214254044362Smrg    need_locks=warn
21434cd6a3aeSmrg  fi
214454044362Smrgelse
214554044362Smrg  need_locks=no
21468c9fbc29Smrgfi
214754044362Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
214854044362Smrg])# _LT_COMPILER_FILE_LOCKS
21498c9fbc29Smrg
21508c9fbc29Smrg
215154044362Smrg# _LT_CHECK_OBJDIR
215254044362Smrg# ----------------
215354044362Smrgm4_defun([_LT_CHECK_OBJDIR],
215454044362Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
215554044362Smrg[rm -f .libs 2>/dev/null
215654044362Smrgmkdir .libs 2>/dev/null
215754044362Smrgif test -d .libs; then
215854044362Smrg  lt_cv_objdir=.libs
215954044362Smrgelse
216054044362Smrg  # MS-DOS does not allow filenames that begin with a dot.
216154044362Smrg  lt_cv_objdir=_libs
216254044362Smrgfi
216354044362Smrgrmdir .libs 2>/dev/null])
216454044362Smrgobjdir=$lt_cv_objdir
216554044362Smrg_LT_DECL([], [objdir], [0],
216654044362Smrg         [The name of the directory that contains temporary libtool files])dnl
216754044362Smrgm4_pattern_allow([LT_OBJDIR])dnl
216854044362SmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
216954044362Smrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
217054044362Smrg])# _LT_CHECK_OBJDIR
21718c9fbc29Smrg
21728c9fbc29Smrg
217354044362Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
217454044362Smrg# --------------------------------------
217554044362Smrg# Check hardcoding attributes.
217654044362Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
217754044362Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
217854044362Smrg_LT_TAGVAR(hardcode_action, $1)=
217954044362Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
218054044362Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
218154044362Smrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
21824cd6a3aeSmrg
218354044362Smrg  # We can hardcode non-existent directories.
218454044362Smrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
218554044362Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
218654044362Smrg     # have to relink, otherwise we might link with an installed library
218754044362Smrg     # when we should be linking with a yet-to-be-installed one
218854044362Smrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
218954044362Smrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
219054044362Smrg    # Linking always hardcodes the temporary library directory.
219154044362Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
219254044362Smrg  else
219354044362Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
219454044362Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
219554044362Smrg  fi
219654044362Smrgelse
219754044362Smrg  # We cannot hardcode anything, or else we can only hardcode existing
219854044362Smrg  # directories.
219954044362Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
220054044362Smrgfi
220154044362SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
22024cd6a3aeSmrg
220354044362Smrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
220454044362Smrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
220554044362Smrg  # Fast installation is not supported
220654044362Smrg  enable_fast_install=no
220754044362Smrgelif test yes = "$shlibpath_overrides_runpath" ||
220854044362Smrg     test no = "$enable_shared"; then
220954044362Smrg  # Fast installation is not necessary
221054044362Smrg  enable_fast_install=needless
221154044362Smrgfi
221254044362Smrg_LT_TAGDECL([], [hardcode_action], [0],
221354044362Smrg    [How to hardcode a shared library path into an executable])
221454044362Smrg])# _LT_LINKER_HARDCODE_LIBPATH
221554044362Smrg
221654044362Smrg
221754044362Smrg# _LT_CMD_STRIPLIB
221854044362Smrg# ----------------
221954044362Smrgm4_defun([_LT_CMD_STRIPLIB],
222054044362Smrg[m4_require([_LT_DECL_EGREP])
222154044362Smrgstriplib=
222254044362Smrgold_striplib=
222354044362SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
222454044362Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
222554044362Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
222654044362Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
222754044362Smrg  AC_MSG_RESULT([yes])
22288c9fbc29Smrgelse
222954044362Smrg# FIXME - insert some real tests, host_os isn't really good enough
223054044362Smrg  case $host_os in
223154044362Smrg  darwin*)
223254044362Smrg    if test -n "$STRIP"; then
223354044362Smrg      striplib="$STRIP -x"
223454044362Smrg      old_striplib="$STRIP -S"
223554044362Smrg      AC_MSG_RESULT([yes])
223654044362Smrg    else
223754044362Smrg      AC_MSG_RESULT([no])
223854044362Smrg    fi
223954044362Smrg    ;;
224054044362Smrg  *)
224154044362Smrg    AC_MSG_RESULT([no])
224254044362Smrg    ;;
224354044362Smrg  esac
22444cd6a3aeSmrgfi
224554044362Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
224654044362Smrg_LT_DECL([], [striplib], [1])
224754044362Smrg])# _LT_CMD_STRIPLIB
22488c9fbc29Smrg
224954044362Smrg
225054044362Smrg# _LT_PREPARE_MUNGE_PATH_LIST
225154044362Smrg# ---------------------------
225254044362Smrg# Make sure func_munge_path_list() is defined correctly.
225354044362Smrgm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
225454044362Smrg[[# func_munge_path_list VARIABLE PATH
225554044362Smrg# -----------------------------------
225654044362Smrg# VARIABLE is name of variable containing _space_ separated list of
225754044362Smrg# directories to be munged by the contents of PATH, which is string
225854044362Smrg# having a format:
225954044362Smrg# "DIR[:DIR]:"
226054044362Smrg#       string "DIR[ DIR]" will be prepended to VARIABLE
226154044362Smrg# ":DIR[:DIR]"
226254044362Smrg#       string "DIR[ DIR]" will be appended to VARIABLE
226354044362Smrg# "DIRP[:DIRP]::[DIRA:]DIRA"
226454044362Smrg#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
226554044362Smrg#       "DIRA[ DIRA]" will be appended to VARIABLE
226654044362Smrg# "DIR[:DIR]"
226754044362Smrg#       VARIABLE will be replaced by "DIR[ DIR]"
226854044362Smrgfunc_munge_path_list ()
22694cd6a3aeSmrg{
227054044362Smrg    case x@S|@2 in
227154044362Smrg    x)
227254044362Smrg        ;;
227354044362Smrg    *:)
227454044362Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
227554044362Smrg        ;;
227654044362Smrg    x:*)
227754044362Smrg        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
227854044362Smrg        ;;
227954044362Smrg    *::*)
228054044362Smrg        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
228154044362Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
228254044362Smrg        ;;
228354044362Smrg    *)
228454044362Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
228554044362Smrg        ;;
228654044362Smrg    esac
22874cd6a3aeSmrg}
228854044362Smrg]])# _LT_PREPARE_PATH_LIST
22898c9fbc29Smrg
22908c9fbc29Smrg
229154044362Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
229254044362Smrg# -----------------------------
229354044362Smrg# PORTME Fill in your ld.so characteristics
229454044362Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
229554044362Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
229654044362Smrgm4_require([_LT_DECL_EGREP])dnl
229754044362Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
229854044362Smrgm4_require([_LT_DECL_OBJDUMP])dnl
229954044362Smrgm4_require([_LT_DECL_SED])dnl
230054044362Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
230154044362Smrgm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
230254044362SmrgAC_MSG_CHECKING([dynamic linker characteristics])
230354044362Smrgm4_if([$1],
230454044362Smrg	[], [
230554044362Smrgif test yes = "$GCC"; then
230654044362Smrg  case $host_os in
230754044362Smrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
230854044362Smrg    *) lt_awk_arg='/^libraries:/' ;;
230954044362Smrg  esac
231054044362Smrg  case $host_os in
231154044362Smrg    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
231254044362Smrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
231354044362Smrg  esac
231454044362Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
231554044362Smrg  case $lt_search_path_spec in
231654044362Smrg  *\;*)
231754044362Smrg    # if the path contains ";" then we assume it to be the separator
231854044362Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
231954044362Smrg    # assumed that no part of a normal pathname contains ";" but that should
232054044362Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
232154044362Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
232254044362Smrg    ;;
232354044362Smrg  *)
232454044362Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
232554044362Smrg    ;;
232654044362Smrg  esac
232754044362Smrg  # Ok, now we have the path, separated by spaces, we can step through it
232854044362Smrg  # and add multilib dir if necessary...
232954044362Smrg  lt_tmp_lt_search_path_spec=
233054044362Smrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
233154044362Smrg  # ...but if some path component already ends with the multilib dir we assume
233254044362Smrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
233354044362Smrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
233454044362Smrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
233554044362Smrg    lt_multi_os_dir=
233654044362Smrg    ;;
233754044362Smrg  esac
233854044362Smrg  for lt_sys_path in $lt_search_path_spec; do
233954044362Smrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
234054044362Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
234154044362Smrg    elif test -n "$lt_multi_os_dir"; then
234254044362Smrg      test -d "$lt_sys_path" && \
234354044362Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
234454044362Smrg    fi
234554044362Smrg  done
234654044362Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
234754044362SmrgBEGIN {RS = " "; FS = "/|\n";} {
234854044362Smrg  lt_foo = "";
234954044362Smrg  lt_count = 0;
235054044362Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
235154044362Smrg    if ($lt_i != "" && $lt_i != ".") {
235254044362Smrg      if ($lt_i == "..") {
235354044362Smrg        lt_count++;
235454044362Smrg      } else {
235554044362Smrg        if (lt_count == 0) {
235654044362Smrg          lt_foo = "/" $lt_i lt_foo;
235754044362Smrg        } else {
235854044362Smrg          lt_count--;
235954044362Smrg        }
236054044362Smrg      }
236154044362Smrg    }
236254044362Smrg  }
236354044362Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
236454044362Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
236554044362Smrg}'`
236654044362Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
236754044362Smrg  # for these hosts.
236854044362Smrg  case $host_os in
236954044362Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
237054044362Smrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
237154044362Smrg  esac
237254044362Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
237354044362Smrgelse
237454044362Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
237554044362Smrgfi])
237654044362Smrglibrary_names_spec=
237754044362Smrglibname_spec='lib$name'
237854044362Smrgsoname_spec=
237954044362Smrgshrext_cmds=.so
238054044362Smrgpostinstall_cmds=
238154044362Smrgpostuninstall_cmds=
238254044362Smrgfinish_cmds=
238354044362Smrgfinish_eval=
238454044362Smrgshlibpath_var=
238554044362Smrgshlibpath_overrides_runpath=unknown
238654044362Smrgversion_type=none
238754044362Smrgdynamic_linker="$host_os ld.so"
238854044362Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
238954044362Smrgneed_lib_prefix=unknown
239054044362Smrghardcode_into_libs=no
23918c9fbc29Smrg
239254044362Smrg# when you set need_version to no, make sure it does not cause -set_version
239354044362Smrg# flags to be left without arguments
239454044362Smrgneed_version=unknown
23954cd6a3aeSmrg
239654044362SmrgAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
239754044362Smrg[User-defined run-time library search path.])
23988c9fbc29Smrg
239954044362Smrgcase $host_os in
240054044362Smrgaix3*)
240154044362Smrg  version_type=linux # correct to gnu/linux during the next big refactor
240254044362Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
240354044362Smrg  shlibpath_var=LIBPATH
24048c9fbc29Smrg
240554044362Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
240654044362Smrg  soname_spec='$libname$release$shared_ext$major'
240754044362Smrg  ;;
24088c9fbc29Smrg
240954044362Smrgaix[[4-9]]*)
241054044362Smrg  version_type=linux # correct to gnu/linux during the next big refactor
241154044362Smrg  need_lib_prefix=no
241254044362Smrg  need_version=no
241354044362Smrg  hardcode_into_libs=yes
241454044362Smrg  if test ia64 = "$host_cpu"; then
241554044362Smrg    # AIX 5 supports IA64
241654044362Smrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
241754044362Smrg    shlibpath_var=LD_LIBRARY_PATH
241854044362Smrg  else
241954044362Smrg    # With GCC up to 2.95.x, collect2 would create an import file
242054044362Smrg    # for dependence libraries.  The import file would start with
242154044362Smrg    # the line '#! .'.  This would cause the generated library to
242254044362Smrg    # depend on '.', always an invalid library.  This was fixed in
242354044362Smrg    # development snapshots of GCC prior to 3.0.
242454044362Smrg    case $host_os in
242554044362Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
242654044362Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
242754044362Smrg	   echo ' yes '
242854044362Smrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
242954044362Smrg	:
243054044362Smrg      else
243154044362Smrg	can_build_shared=no
243254044362Smrg      fi
243354044362Smrg      ;;
24348c9fbc29Smrg    esac
243554044362Smrg    # Using Import Files as archive members, it is possible to support
243654044362Smrg    # filename-based versioning of shared library archives on AIX. While
243754044362Smrg    # this would work for both with and without runtime linking, it will
243854044362Smrg    # prevent static linking of such archives. So we do filename-based
243954044362Smrg    # shared library versioning with .so extension only, which is used
244054044362Smrg    # when both runtime linking and shared linking is enabled.
244154044362Smrg    # Unfortunately, runtime linking may impact performance, so we do
244254044362Smrg    # not want this to be the default eventually. Also, we use the
244354044362Smrg    # versioned .so libs for executables only if there is the -brtl
244454044362Smrg    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
244554044362Smrg    # To allow for filename-based versioning support, we need to create
244654044362Smrg    # libNAME.so.V as an archive file, containing:
244754044362Smrg    # *) an Import File, referring to the versioned filename of the
244854044362Smrg    #    archive as well as the shared archive member, telling the
244954044362Smrg    #    bitwidth (32 or 64) of that shared object, and providing the
245054044362Smrg    #    list of exported symbols of that shared object, eventually
245154044362Smrg    #    decorated with the 'weak' keyword
245254044362Smrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
245354044362Smrg    #    it being seen by the linker.
245454044362Smrg    # At run time we better use the real file rather than another symlink,
245554044362Smrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
245654044362Smrg
245754044362Smrg    case $with_aix_soname,$aix_use_runtimelinking in
245854044362Smrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
245954044362Smrg    # soname into executable. Probably we can add versioning support to
246054044362Smrg    # collect2, so additional links can be useful in future.
246154044362Smrg    aix,yes) # traditional libtool
246254044362Smrg      dynamic_linker='AIX unversionable lib.so'
246354044362Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
246454044362Smrg      # instead of lib<name>.a to let people know that these are not
246554044362Smrg      # typical AIX shared libraries.
246654044362Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
246754044362Smrg      ;;
246854044362Smrg    aix,no) # traditional AIX only
246954044362Smrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
247054044362Smrg      # We preserve .a as extension for shared libraries through AIX4.2
247154044362Smrg      # and later when we are not doing run time linking.
247254044362Smrg      library_names_spec='$libname$release.a $libname.a'
247354044362Smrg      soname_spec='$libname$release$shared_ext$major'
247454044362Smrg      ;;
247554044362Smrg    svr4,*) # full svr4 only
247654044362Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
247754044362Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
247854044362Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
247954044362Smrg      shlibpath_overrides_runpath=yes
248054044362Smrg      ;;
248154044362Smrg    *,yes) # both, prefer svr4
248254044362Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
248354044362Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
248454044362Smrg      # unpreferred sharedlib libNAME.a needs extra handling
248554044362Smrg      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"'
248654044362Smrg      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"'
248754044362Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
248854044362Smrg      shlibpath_overrides_runpath=yes
248954044362Smrg      ;;
249054044362Smrg    *,no) # both, prefer aix
249154044362Smrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
249254044362Smrg      library_names_spec='$libname$release.a $libname.a'
249354044362Smrg      soname_spec='$libname$release$shared_ext$major'
249454044362Smrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
249554044362Smrg      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)'
249654044362Smrg      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"'
249754044362Smrg      ;;
24988c9fbc29Smrg    esac
249954044362Smrg    shlibpath_var=LIBPATH
25008c9fbc29Smrg  fi
25018c9fbc29Smrg  ;;
25028c9fbc29Smrg
250354044362Smrgamigaos*)
250454044362Smrg  case $host_cpu in
250554044362Smrg  powerpc)
250654044362Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
250754044362Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
250854044362Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
250954044362Smrg    ;;
251054044362Smrg  m68k)
251154044362Smrg    library_names_spec='$libname.ixlibrary $libname.a'
251254044362Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
251354044362Smrg    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'
251454044362Smrg    ;;
251554044362Smrg  esac
25168c9fbc29Smrg  ;;
251754044362Smrg
251854044362Smrgbeos*)
251954044362Smrg  library_names_spec='$libname$shared_ext'
252054044362Smrg  dynamic_linker="$host_os ld.so"
252154044362Smrg  shlibpath_var=LIBRARY_PATH
25228c9fbc29Smrg  ;;
25238c9fbc29Smrg
252454044362Smrgbsdi[[45]]*)
252554044362Smrg  version_type=linux # correct to gnu/linux during the next big refactor
252654044362Smrg  need_version=no
252754044362Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
252854044362Smrg  soname_spec='$libname$release$shared_ext$major'
252954044362Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
253054044362Smrg  shlibpath_var=LD_LIBRARY_PATH
253154044362Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
253254044362Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
253354044362Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
253454044362Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
253554044362Smrg  # libtool to hard-code these into programs
253654044362Smrg  ;;
25378c9fbc29Smrg
253854044362Smrgcygwin* | mingw* | pw32* | cegcc*)
253954044362Smrg  version_type=windows
254054044362Smrg  shrext_cmds=.dll
254154044362Smrg  need_version=no
254254044362Smrg  need_lib_prefix=no
25438c9fbc29Smrg
254454044362Smrg  case $GCC,$cc_basename in
254554044362Smrg  yes,*)
254654044362Smrg    # gcc
254754044362Smrg    library_names_spec='$libname.dll.a'
254854044362Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
254954044362Smrg    postinstall_cmds='base_file=`basename \$file`~
255054044362Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
255154044362Smrg      dldir=$destdir/`dirname \$dlpath`~
255254044362Smrg      test -d \$dldir || mkdir -p \$dldir~
255354044362Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
255454044362Smrg      chmod a+x \$dldir/$dlname~
255554044362Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
255654044362Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
255754044362Smrg      fi'
255854044362Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
255954044362Smrg      dlpath=$dir/\$dldll~
256054044362Smrg       $RM \$dlpath'
256154044362Smrg    shlibpath_overrides_runpath=yes
25624cd6a3aeSmrg
256354044362Smrg    case $host_os in
256454044362Smrg    cygwin*)
256554044362Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
256654044362Smrg      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
256754044362Smrgm4_if([$1], [],[
256854044362Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
256954044362Smrg      ;;
257054044362Smrg    mingw* | cegcc*)
257154044362Smrg      # MinGW DLLs use traditional 'lib' prefix
257254044362Smrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
257354044362Smrg      ;;
257454044362Smrg    pw32*)
257554044362Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
257654044362Smrg      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
257754044362Smrg      ;;
257854044362Smrg    esac
257954044362Smrg    dynamic_linker='Win32 ld.exe'
258054044362Smrg    ;;
25818c9fbc29Smrg
258254044362Smrg  *,cl*)
258354044362Smrg    # Native MSVC
258454044362Smrg    libname_spec='$name'
258554044362Smrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
258654044362Smrg    library_names_spec='$libname.dll.lib'
25874cd6a3aeSmrg
258854044362Smrg    case $build_os in
258954044362Smrg    mingw*)
259054044362Smrg      sys_lib_search_path_spec=
259154044362Smrg      lt_save_ifs=$IFS
259254044362Smrg      IFS=';'
259354044362Smrg      for lt_path in $LIB
259454044362Smrg      do
259554044362Smrg        IFS=$lt_save_ifs
259654044362Smrg        # Let DOS variable expansion print the short 8.3 style file name.
259754044362Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
259854044362Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
259954044362Smrg      done
260054044362Smrg      IFS=$lt_save_ifs
260154044362Smrg      # Convert to MSYS style.
260254044362Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
260354044362Smrg      ;;
260454044362Smrg    cygwin*)
260554044362Smrg      # Convert to unix form, then to dos form, then back to unix form
260654044362Smrg      # but this time dos style (no spaces!) so that the unix form looks
260754044362Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
260854044362Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
260954044362Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
261054044362Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
261154044362Smrg      ;;
261254044362Smrg    *)
261354044362Smrg      sys_lib_search_path_spec=$LIB
261454044362Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
261554044362Smrg        # It is most probably a Windows format PATH.
261654044362Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
261754044362Smrg      else
261854044362Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
261954044362Smrg      fi
262054044362Smrg      # FIXME: find the short name or the path components, as spaces are
262154044362Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
262254044362Smrg      ;;
262354044362Smrg    esac
26244cd6a3aeSmrg
262554044362Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
262654044362Smrg    postinstall_cmds='base_file=`basename \$file`~
262754044362Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
262854044362Smrg      dldir=$destdir/`dirname \$dlpath`~
262954044362Smrg      test -d \$dldir || mkdir -p \$dldir~
263054044362Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
263154044362Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
263254044362Smrg      dlpath=$dir/\$dldll~
263354044362Smrg       $RM \$dlpath'
263454044362Smrg    shlibpath_overrides_runpath=yes
263554044362Smrg    dynamic_linker='Win32 link.exe'
263654044362Smrg    ;;
26374cd6a3aeSmrg
263854044362Smrg  *)
263954044362Smrg    # Assume MSVC wrapper
264054044362Smrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
264154044362Smrg    dynamic_linker='Win32 ld.exe'
264254044362Smrg    ;;
264354044362Smrg  esac
264454044362Smrg  # FIXME: first we should search . and the directory the executable is in
264554044362Smrg  shlibpath_var=PATH
264654044362Smrg  ;;
26474cd6a3aeSmrg
264854044362Smrgdarwin* | rhapsody*)
264954044362Smrg  dynamic_linker="$host_os dyld"
265054044362Smrg  version_type=darwin
265154044362Smrg  need_lib_prefix=no
265254044362Smrg  need_version=no
265354044362Smrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
265454044362Smrg  soname_spec='$libname$release$major$shared_ext'
265554044362Smrg  shlibpath_overrides_runpath=yes
265654044362Smrg  shlibpath_var=DYLD_LIBRARY_PATH
265754044362Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
265854044362Smrgm4_if([$1], [],[
265954044362Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
266054044362Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
266154044362Smrg  ;;
26624cd6a3aeSmrg
266354044362Smrgdgux*)
266454044362Smrg  version_type=linux # correct to gnu/linux during the next big refactor
266554044362Smrg  need_lib_prefix=no
266654044362Smrg  need_version=no
266754044362Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
266854044362Smrg  soname_spec='$libname$release$shared_ext$major'
266954044362Smrg  shlibpath_var=LD_LIBRARY_PATH
267054044362Smrg  ;;
26714cd6a3aeSmrg
267254044362Smrgfreebsd* | dragonfly*)
267354044362Smrg  # DragonFly does not have aout.  When/if they implement a new
267454044362Smrg  # versioning mechanism, adjust this.
267554044362Smrg  if test -x /usr/bin/objformat; then
267654044362Smrg    objformat=`/usr/bin/objformat`
267754044362Smrg  else
267854044362Smrg    case $host_os in
267954044362Smrg    freebsd[[23]].*) objformat=aout ;;
268054044362Smrg    *) objformat=elf ;;
268154044362Smrg    esac
268254044362Smrg  fi
268354044362Smrg  version_type=freebsd-$objformat
268454044362Smrg  case $version_type in
268554044362Smrg    freebsd-elf*)
268654044362Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
268754044362Smrg      soname_spec='$libname$release$shared_ext$major'
268854044362Smrg      need_version=no
268954044362Smrg      need_lib_prefix=no
269054044362Smrg      ;;
269154044362Smrg    freebsd-*)
269254044362Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
269354044362Smrg      need_version=yes
269454044362Smrg      ;;
269554044362Smrg  esac
269654044362Smrg  shlibpath_var=LD_LIBRARY_PATH
26974cd6a3aeSmrg  case $host_os in
269854044362Smrg  freebsd2.*)
269954044362Smrg    shlibpath_overrides_runpath=yes
27004cd6a3aeSmrg    ;;
270154044362Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
270254044362Smrg    shlibpath_overrides_runpath=yes
270354044362Smrg    hardcode_into_libs=yes
270454044362Smrg    ;;
270554044362Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
270654044362Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
270754044362Smrg    shlibpath_overrides_runpath=no
270854044362Smrg    hardcode_into_libs=yes
270954044362Smrg    ;;
271054044362Smrg  *) # from 4.6 on, and DragonFly
271154044362Smrg    shlibpath_overrides_runpath=yes
271254044362Smrg    hardcode_into_libs=yes
27134cd6a3aeSmrg    ;;
27144cd6a3aeSmrg  esac
271554044362Smrg  ;;
27164cd6a3aeSmrg
271754044362Smrghaiku*)
271854044362Smrg  version_type=linux # correct to gnu/linux during the next big refactor
271954044362Smrg  need_lib_prefix=no
272054044362Smrg  need_version=no
272154044362Smrg  dynamic_linker="$host_os runtime_loader"
272254044362Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
272354044362Smrg  soname_spec='$libname$release$shared_ext$major'
272454044362Smrg  shlibpath_var=LIBRARY_PATH
272554044362Smrg  shlibpath_overrides_runpath=no
272654044362Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
272754044362Smrg  hardcode_into_libs=yes
272854044362Smrg  ;;
272954044362Smrg
273054044362Smrghpux9* | hpux10* | hpux11*)
273154044362Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
273254044362Smrg  # link against other versions.
273354044362Smrg  version_type=sunos
273454044362Smrg  need_lib_prefix=no
273554044362Smrg  need_version=no
273654044362Smrg  case $host_cpu in
273754044362Smrg  ia64*)
273854044362Smrg    shrext_cmds='.so'
273954044362Smrg    hardcode_into_libs=yes
274054044362Smrg    dynamic_linker="$host_os dld.so"
274154044362Smrg    shlibpath_var=LD_LIBRARY_PATH
274254044362Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
274354044362Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
274454044362Smrg    soname_spec='$libname$release$shared_ext$major'
274554044362Smrg    if test 32 = "$HPUX_IA64_MODE"; then
274654044362Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
274754044362Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
274854044362Smrg    else
274954044362Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
275054044362Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
275154044362Smrg    fi
275254044362Smrg    ;;
275354044362Smrg  hppa*64*)
275454044362Smrg    shrext_cmds='.sl'
275554044362Smrg    hardcode_into_libs=yes
275654044362Smrg    dynamic_linker="$host_os dld.sl"
275754044362Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
275854044362Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
275954044362Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
276054044362Smrg    soname_spec='$libname$release$shared_ext$major'
276154044362Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
276254044362Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
276354044362Smrg    ;;
27644cd6a3aeSmrg  *)
276554044362Smrg    shrext_cmds='.sl'
276654044362Smrg    dynamic_linker="$host_os dld.sl"
276754044362Smrg    shlibpath_var=SHLIB_PATH
276854044362Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
276954044362Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
277054044362Smrg    soname_spec='$libname$release$shared_ext$major'
277154044362Smrg    ;;
277254044362Smrg  esac
277354044362Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
277454044362Smrg  postinstall_cmds='chmod 555 $lib'
277554044362Smrg  # or fails outright, so override atomically:
277654044362Smrg  install_override_mode=555
277754044362Smrg  ;;
27784cd6a3aeSmrg
277954044362Smrginterix[[3-9]]*)
278054044362Smrg  version_type=linux # correct to gnu/linux during the next big refactor
278154044362Smrg  need_lib_prefix=no
278254044362Smrg  need_version=no
278354044362Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
278454044362Smrg  soname_spec='$libname$release$shared_ext$major'
278554044362Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
278654044362Smrg  shlibpath_var=LD_LIBRARY_PATH
278754044362Smrg  shlibpath_overrides_runpath=no
278854044362Smrg  hardcode_into_libs=yes
278954044362Smrg  ;;
27904cd6a3aeSmrg
279154044362Smrgirix5* | irix6* | nonstopux*)
279254044362Smrg  case $host_os in
279354044362Smrg    nonstopux*) version_type=nonstopux ;;
279454044362Smrg    *)
279554044362Smrg	if test yes = "$lt_cv_prog_gnu_ld"; then
279654044362Smrg		version_type=linux # correct to gnu/linux during the next big refactor
279754044362Smrg	else
279854044362Smrg		version_type=irix
279954044362Smrg	fi ;;
280054044362Smrg  esac
280154044362Smrg  need_lib_prefix=no
280254044362Smrg  need_version=no
280354044362Smrg  soname_spec='$libname$release$shared_ext$major'
280454044362Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
280554044362Smrg  case $host_os in
280654044362Smrg  irix5* | nonstopux*)
280754044362Smrg    libsuff= shlibsuff=
280854044362Smrg    ;;
280954044362Smrg  *)
281054044362Smrg    case $LD in # libtool.m4 will add one of these switches to LD
281154044362Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
281254044362Smrg      libsuff= shlibsuff= libmagic=32-bit;;
281354044362Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
281454044362Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
281554044362Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
281654044362Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
281754044362Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
281854044362Smrg    esac
281954044362Smrg    ;;
282054044362Smrg  esac
282154044362Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
282254044362Smrg  shlibpath_overrides_runpath=no
282354044362Smrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
282454044362Smrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
282554044362Smrg  hardcode_into_libs=yes
282654044362Smrg  ;;
28278c9fbc29Smrg
282854044362Smrg# No shared lib support for Linux oldld, aout, or coff.
282954044362Smrglinux*oldld* | linux*aout* | linux*coff*)
283054044362Smrg  dynamic_linker=no
283154044362Smrg  ;;
28328c9fbc29Smrg
283354044362Smrglinux*android*)
283454044362Smrg  version_type=none # Android doesn't support versioned libraries.
283554044362Smrg  need_lib_prefix=no
283654044362Smrg  need_version=no
283754044362Smrg  library_names_spec='$libname$release$shared_ext'
283854044362Smrg  soname_spec='$libname$release$shared_ext'
283954044362Smrg  finish_cmds=
284054044362Smrg  shlibpath_var=LD_LIBRARY_PATH
284154044362Smrg  shlibpath_overrides_runpath=yes
28428c9fbc29Smrg
284354044362Smrg  # This implies no fast_install, which is unacceptable.
284454044362Smrg  # Some rework will be needed to allow for fast_install
284554044362Smrg  # before this can be enabled.
284654044362Smrg  hardcode_into_libs=yes
28474cd6a3aeSmrg
284854044362Smrg  dynamic_linker='Android linker'
284954044362Smrg  # Don't embed -rpath directories since the linker doesn't support them.
285054044362Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
285154044362Smrg  ;;
28528c9fbc29Smrg
285354044362Smrg# This must be glibc/ELF.
285454044362Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
285554044362Smrg  version_type=linux # correct to gnu/linux during the next big refactor
285654044362Smrg  need_lib_prefix=no
285754044362Smrg  need_version=no
285854044362Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
285954044362Smrg  soname_spec='$libname$release$shared_ext$major'
286054044362Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
286154044362Smrg  shlibpath_var=LD_LIBRARY_PATH
286254044362Smrg  shlibpath_overrides_runpath=no
28638c9fbc29Smrg
286454044362Smrg  # Some binutils ld are patched to set DT_RUNPATH
286554044362Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
286654044362Smrg    [lt_cv_shlibpath_overrides_runpath=no
286754044362Smrg    save_LDFLAGS=$LDFLAGS
286854044362Smrg    save_libdir=$libdir
286954044362Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
287054044362Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
287154044362Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
287254044362Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
287354044362Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
287454044362Smrg    LDFLAGS=$save_LDFLAGS
287554044362Smrg    libdir=$save_libdir
287654044362Smrg    ])
287754044362Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
28788c9fbc29Smrg
287954044362Smrg  # This implies no fast_install, which is unacceptable.
288054044362Smrg  # Some rework will be needed to allow for fast_install
288154044362Smrg  # before this can be enabled.
288254044362Smrg  hardcode_into_libs=yes
28834cd6a3aeSmrg
288454044362Smrg  # Ideally, we could use ldconfig to report *all* directores which are
288554044362Smrg  # searched for libraries, however this is still not possible.  Aside from not
288654044362Smrg  # being certain /sbin/ldconfig is available, command
288754044362Smrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
288854044362Smrg  # even though it is searched at run-time.  Try to do the best guess by
288954044362Smrg  # appending ld.so.conf contents (and includes) to the search path.
289054044362Smrg  if test -f /etc/ld.so.conf; then
289154044362Smrg    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' ' '`
289254044362Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
289354044362Smrg  fi
28948c9fbc29Smrg
289554044362Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
289654044362Smrg  # powerpc, because MkLinux only supported shared libraries with the
289754044362Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
289854044362Smrg  # most powerpc-linux boxes support dynamic linking these days and
289954044362Smrg  # people can always --disable-shared, the test was removed, and we
290054044362Smrg  # assume the GNU/Linux dynamic linker is in use.
290154044362Smrg  dynamic_linker='GNU/Linux ld.so'
290254044362Smrg  ;;
29038c9fbc29Smrg
290454044362Smrgnetbsd*)
290554044362Smrg  version_type=sunos
290654044362Smrg  need_lib_prefix=no
290754044362Smrg  need_version=no
290854044362Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
290954044362Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
291054044362Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
291154044362Smrg    dynamic_linker='NetBSD (a.out) ld.so'
291254044362Smrg  else
291354044362Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
291454044362Smrg    soname_spec='$libname$release$shared_ext$major'
291554044362Smrg    dynamic_linker='NetBSD ld.elf_so'
291654044362Smrg  fi
291754044362Smrg  shlibpath_var=LD_LIBRARY_PATH
291854044362Smrg  shlibpath_overrides_runpath=yes
291954044362Smrg  hardcode_into_libs=yes
292054044362Smrg  ;;
29218c9fbc29Smrg
292254044362Smrgnewsos6)
292354044362Smrg  version_type=linux # correct to gnu/linux during the next big refactor
292454044362Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
292554044362Smrg  shlibpath_var=LD_LIBRARY_PATH
292654044362Smrg  shlibpath_overrides_runpath=yes
292754044362Smrg  ;;
29288c9fbc29Smrg
292954044362Smrg*nto* | *qnx*)
293054044362Smrg  version_type=qnx
293154044362Smrg  need_lib_prefix=no
293254044362Smrg  need_version=no
293354044362Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
293454044362Smrg  soname_spec='$libname$release$shared_ext$major'
293554044362Smrg  shlibpath_var=LD_LIBRARY_PATH
293654044362Smrg  shlibpath_overrides_runpath=no
293754044362Smrg  hardcode_into_libs=yes
293854044362Smrg  dynamic_linker='ldqnx.so'
293954044362Smrg  ;;
29404cd6a3aeSmrg
294154044362Smrgopenbsd* | bitrig*)
294254044362Smrg  version_type=sunos
294354044362Smrg  sys_lib_dlsearch_path_spec=/usr/lib
294454044362Smrg  need_lib_prefix=no
294554044362Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
294654044362Smrg    need_version=no
294754044362Smrg  else
294854044362Smrg    need_version=yes
294954044362Smrg  fi
295054044362Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
295154044362Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
295254044362Smrg  shlibpath_var=LD_LIBRARY_PATH
295354044362Smrg  shlibpath_overrides_runpath=yes
295454044362Smrg  ;;
29558c9fbc29Smrg
295654044362Smrgos2*)
295754044362Smrg  libname_spec='$name'
295854044362Smrg  version_type=windows
295954044362Smrg  shrext_cmds=.dll
296054044362Smrg  need_version=no
296154044362Smrg  need_lib_prefix=no
296254044362Smrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
296354044362Smrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
296454044362Smrg    v=$($ECHO $release$versuffix | tr -d .-);
296554044362Smrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
296654044362Smrg    $ECHO $n$v`$shared_ext'
296754044362Smrg  library_names_spec='${libname}_dll.$libext'
296854044362Smrg  dynamic_linker='OS/2 ld.exe'
296954044362Smrg  shlibpath_var=BEGINLIBPATH
297054044362Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
297154044362Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
297254044362Smrg  postinstall_cmds='base_file=`basename \$file`~
297354044362Smrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
297454044362Smrg    dldir=$destdir/`dirname \$dlpath`~
297554044362Smrg    test -d \$dldir || mkdir -p \$dldir~
297654044362Smrg    $install_prog $dir/$dlname \$dldir/$dlname~
297754044362Smrg    chmod a+x \$dldir/$dlname~
297854044362Smrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
297954044362Smrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
298054044362Smrg    fi'
298154044362Smrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
298254044362Smrg    dlpath=$dir/\$dldll~
298354044362Smrg    $RM \$dlpath'
298454044362Smrg  ;;
29858c9fbc29Smrg
298654044362Smrgosf3* | osf4* | osf5*)
298754044362Smrg  version_type=osf
298854044362Smrg  need_lib_prefix=no
298954044362Smrg  need_version=no
299054044362Smrg  soname_spec='$libname$release$shared_ext$major'
299154044362Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
299254044362Smrg  shlibpath_var=LD_LIBRARY_PATH
299354044362Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
299454044362Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
299554044362Smrg  ;;
29968c9fbc29Smrg
299754044362Smrgrdos*)
299854044362Smrg  dynamic_linker=no
299954044362Smrg  ;;
300070728a38Smrg
300154044362Smrgsolaris*)
300254044362Smrg  version_type=linux # correct to gnu/linux during the next big refactor
300354044362Smrg  need_lib_prefix=no
300454044362Smrg  need_version=no
300554044362Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
300654044362Smrg  soname_spec='$libname$release$shared_ext$major'
300754044362Smrg  shlibpath_var=LD_LIBRARY_PATH
300854044362Smrg  shlibpath_overrides_runpath=yes
300954044362Smrg  hardcode_into_libs=yes
301054044362Smrg  # ldd complains unless libraries are executable
301154044362Smrg  postinstall_cmds='chmod +x $lib'
301254044362Smrg  ;;
30138c9fbc29Smrg
301454044362Smrgsunos4*)
301554044362Smrg  version_type=sunos
301654044362Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
301754044362Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
301854044362Smrg  shlibpath_var=LD_LIBRARY_PATH
301954044362Smrg  shlibpath_overrides_runpath=yes
302054044362Smrg  if test yes = "$with_gnu_ld"; then
302154044362Smrg    need_lib_prefix=no
302254044362Smrg  fi
302354044362Smrg  need_version=yes
302454044362Smrg  ;;
30258c9fbc29Smrg
302654044362Smrgsysv4 | sysv4.3*)
302754044362Smrg  version_type=linux # correct to gnu/linux during the next big refactor
302854044362Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
302954044362Smrg  soname_spec='$libname$release$shared_ext$major'
303054044362Smrg  shlibpath_var=LD_LIBRARY_PATH
303154044362Smrg  case $host_vendor in
303254044362Smrg    sni)
303354044362Smrg      shlibpath_overrides_runpath=no
303454044362Smrg      need_lib_prefix=no
303554044362Smrg      runpath_var=LD_RUN_PATH
303654044362Smrg      ;;
303754044362Smrg    siemens)
303854044362Smrg      need_lib_prefix=no
303954044362Smrg      ;;
304054044362Smrg    motorola)
304154044362Smrg      need_lib_prefix=no
304254044362Smrg      need_version=no
304354044362Smrg      shlibpath_overrides_runpath=no
304454044362Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
304554044362Smrg      ;;
304654044362Smrg  esac
304754044362Smrg  ;;
30488c9fbc29Smrg
304954044362Smrgsysv4*MP*)
305054044362Smrg  if test -d /usr/nec; then
305154044362Smrg    version_type=linux # correct to gnu/linux during the next big refactor
305254044362Smrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
305354044362Smrg    soname_spec='$libname$shared_ext.$major'
305454044362Smrg    shlibpath_var=LD_LIBRARY_PATH
305554044362Smrg  fi
305654044362Smrg  ;;
30578c9fbc29Smrg
305854044362Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
305954044362Smrg  version_type=sco
306054044362Smrg  need_lib_prefix=no
306154044362Smrg  need_version=no
306254044362Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
306354044362Smrg  soname_spec='$libname$release$shared_ext$major'
306454044362Smrg  shlibpath_var=LD_LIBRARY_PATH
306554044362Smrg  shlibpath_overrides_runpath=yes
306654044362Smrg  hardcode_into_libs=yes
306754044362Smrg  if test yes = "$with_gnu_ld"; then
306854044362Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
30698c9fbc29Smrg  else
307054044362Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
307154044362Smrg    case $host_os in
307254044362Smrg      sco3.2v5*)
307354044362Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
307454044362Smrg	;;
30758c9fbc29Smrg    esac
30768c9fbc29Smrg  fi
307754044362Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
307854044362Smrg  ;;
30798c9fbc29Smrg
308054044362Smrgtpf*)
308154044362Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
308254044362Smrg  version_type=linux # correct to gnu/linux during the next big refactor
308354044362Smrg  need_lib_prefix=no
308454044362Smrg  need_version=no
308554044362Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
308654044362Smrg  shlibpath_var=LD_LIBRARY_PATH
308754044362Smrg  shlibpath_overrides_runpath=no
308854044362Smrg  hardcode_into_libs=yes
308954044362Smrg  ;;
30908c9fbc29Smrg
309154044362Smrguts4*)
309254044362Smrg  version_type=linux # correct to gnu/linux during the next big refactor
309354044362Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
309454044362Smrg  soname_spec='$libname$release$shared_ext$major'
309554044362Smrg  shlibpath_var=LD_LIBRARY_PATH
309654044362Smrg  ;;
30978c9fbc29Smrg
309854044362Smrg*)
309954044362Smrg  dynamic_linker=no
310054044362Smrg  ;;
310154044362Smrgesac
310254044362SmrgAC_MSG_RESULT([$dynamic_linker])
310354044362Smrgtest no = "$dynamic_linker" && can_build_shared=no
31048c9fbc29Smrg
310554044362Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
310654044362Smrgif test yes = "$GCC"; then
310754044362Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
310854044362Smrgfi
31098c9fbc29Smrg
311054044362Smrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
311154044362Smrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
311254044362Smrgfi
31138c9fbc29Smrg
311454044362Smrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
311554044362Smrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
311654044362Smrgfi
31178c9fbc29Smrg
311854044362Smrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
311954044362Smrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
31208c9fbc29Smrg
312154044362Smrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
312254044362Smrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
31238c9fbc29Smrg
312454044362Smrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
312554044362Smrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
31268c9fbc29Smrg
312754044362Smrg_LT_DECL([], [variables_saved_for_relink], [1],
312854044362Smrg    [Variables whose values should be saved in libtool wrapper scripts and
312954044362Smrg    restored at link time])
313054044362Smrg_LT_DECL([], [need_lib_prefix], [0],
313154044362Smrg    [Do we need the "lib" prefix for modules?])
313254044362Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
313354044362Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
313454044362Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
313554044362Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
313654044362Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
313754044362Smrg    [Is shlibpath searched before the hard-coded library search path?])
313854044362Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
313954044362Smrg_LT_DECL([], [library_names_spec], [1],
314054044362Smrg    [[List of archive names.  First name is the real one, the rest are links.
314154044362Smrg    The last name is the one that the linker finds with -lNAME]])
314254044362Smrg_LT_DECL([], [soname_spec], [1],
314354044362Smrg    [[The coded name of the library, if different from the real name]])
314454044362Smrg_LT_DECL([], [install_override_mode], [1],
314554044362Smrg    [Permission mode override for installation of shared libraries])
314654044362Smrg_LT_DECL([], [postinstall_cmds], [2],
314754044362Smrg    [Command to use after installation of a shared archive])
314854044362Smrg_LT_DECL([], [postuninstall_cmds], [2],
314954044362Smrg    [Command to use after uninstallation of a shared archive])
315054044362Smrg_LT_DECL([], [finish_cmds], [2],
315154044362Smrg    [Commands used to finish a libtool library installation in a directory])
315254044362Smrg_LT_DECL([], [finish_eval], [1],
315354044362Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
315454044362Smrg    not shown]])
315554044362Smrg_LT_DECL([], [hardcode_into_libs], [0],
315654044362Smrg    [Whether we should hardcode library paths into libraries])
315754044362Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
315854044362Smrg    [Compile-time system search path for libraries])
315954044362Smrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
316054044362Smrg    [Detected run-time system search path for libraries])
316154044362Smrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
316254044362Smrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
316354044362Smrg])# _LT_SYS_DYNAMIC_LINKER
31648c9fbc29Smrg
31658c9fbc29Smrg
316654044362Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
316754044362Smrg# --------------------------
316854044362Smrg# find a file program that can recognize shared library
316954044362SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
317054044362Smrg[m4_require([_LT_DECL_EGREP])dnl
317154044362SmrgAC_MSG_CHECKING([for $1])
317254044362SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
317354044362Smrg[case $MAGIC_CMD in
317454044362Smrg[[\\/*] |  ?:[\\/]*])
317554044362Smrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
317654044362Smrg  ;;
317754044362Smrg*)
317854044362Smrg  lt_save_MAGIC_CMD=$MAGIC_CMD
317954044362Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
318054044362Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
318154044362Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
318254044362Smrgdnl not every word.  This closes a longstanding sh security hole.
318354044362Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
318454044362Smrg  for ac_dir in $ac_dummy; do
318554044362Smrg    IFS=$lt_save_ifs
318654044362Smrg    test -z "$ac_dir" && ac_dir=.
318754044362Smrg    if test -f "$ac_dir/$1"; then
318854044362Smrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
318954044362Smrg      if test -n "$file_magic_test_file"; then
319054044362Smrg	case $deplibs_check_method in
319154044362Smrg	"file_magic "*)
319254044362Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
319354044362Smrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
319454044362Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
319554044362Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
319654044362Smrg	    :
319754044362Smrg	  else
319854044362Smrg	    cat <<_LT_EOF 1>&2
31998c9fbc29Smrg
320054044362Smrg*** Warning: the command libtool uses to detect shared libraries,
320154044362Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
320254044362Smrg*** The result is that libtool may fail to recognize shared libraries
320354044362Smrg*** as such.  This will affect the creation of libtool libraries that
320454044362Smrg*** depend on shared libraries, but programs linked with such libtool
320554044362Smrg*** libraries will work regardless of this problem.  Nevertheless, you
320654044362Smrg*** may want to report the problem to your system manager and/or to
320754044362Smrg*** bug-libtool@gnu.org
32088c9fbc29Smrg
320954044362Smrg_LT_EOF
321054044362Smrg	  fi ;;
321154044362Smrg	esac
321254044362Smrg      fi
321354044362Smrg      break
321454044362Smrg    fi
321554044362Smrg  done
321654044362Smrg  IFS=$lt_save_ifs
321754044362Smrg  MAGIC_CMD=$lt_save_MAGIC_CMD
321854044362Smrg  ;;
321954044362Smrgesac])
322054044362SmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
322154044362Smrgif test -n "$MAGIC_CMD"; then
322254044362Smrg  AC_MSG_RESULT($MAGIC_CMD)
322354044362Smrgelse
322454044362Smrg  AC_MSG_RESULT(no)
32258c9fbc29Smrgfi
322654044362Smrg_LT_DECL([], [MAGIC_CMD], [0],
322754044362Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
322854044362Smrg])# _LT_PATH_TOOL_PREFIX
32298c9fbc29Smrg
32304cd6a3aeSmrg# Old name:
323154044362SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
32324cd6a3aeSmrgdnl aclocal-1.4 backwards compatibility:
323354044362Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
32348c9fbc29Smrg
32354cd6a3aeSmrg
323654044362Smrg# _LT_PATH_MAGIC
323754044362Smrg# --------------
323854044362Smrg# find a file program that can recognize a shared library
323954044362Smrgm4_defun([_LT_PATH_MAGIC],
324054044362Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
324154044362Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
324254044362Smrg  if test -n "$ac_tool_prefix"; then
324354044362Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
324454044362Smrg  else
324554044362Smrg    MAGIC_CMD=:
324654044362Smrg  fi
324754044362Smrgfi
324854044362Smrg])# _LT_PATH_MAGIC
32498c9fbc29Smrg
32508c9fbc29Smrg
325154044362Smrg# LT_PATH_LD
325254044362Smrg# ----------
325354044362Smrg# find the pathname to the GNU or non-GNU linker
325454044362SmrgAC_DEFUN([LT_PATH_LD],
325554044362Smrg[AC_REQUIRE([AC_PROG_CC])dnl
325654044362SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
325754044362SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
325854044362Smrgm4_require([_LT_DECL_SED])dnl
325954044362Smrgm4_require([_LT_DECL_EGREP])dnl
326054044362Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
32618c9fbc29Smrg
326254044362SmrgAC_ARG_WITH([gnu-ld],
326354044362Smrg    [AS_HELP_STRING([--with-gnu-ld],
326454044362Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
326554044362Smrg    [test no = "$withval" || with_gnu_ld=yes],
326654044362Smrg    [with_gnu_ld=no])dnl
32678c9fbc29Smrg
326854044362Smrgac_prog=ld
326954044362Smrgif test yes = "$GCC"; then
327054044362Smrg  # Check if gcc -print-prog-name=ld gives a path.
327154044362Smrg  AC_MSG_CHECKING([for ld used by $CC])
327254044362Smrg  case $host in
327354044362Smrg  *-*-mingw*)
327454044362Smrg    # gcc leaves a trailing carriage return, which upsets mingw
327554044362Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
327654044362Smrg  *)
327754044362Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
327854044362Smrg  esac
327954044362Smrg  case $ac_prog in
328054044362Smrg    # Accept absolute paths.
328154044362Smrg    [[\\/]]* | ?:[[\\/]]*)
328254044362Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
328354044362Smrg      # Canonicalize the pathname of ld
328454044362Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
328554044362Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
328654044362Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
328754044362Smrg      done
328854044362Smrg      test -z "$LD" && LD=$ac_prog
328954044362Smrg      ;;
329054044362Smrg  "")
329154044362Smrg    # If it fails, then pretend we aren't using GCC.
329254044362Smrg    ac_prog=ld
329354044362Smrg    ;;
329454044362Smrg  *)
329554044362Smrg    # If it is relative, then search for the first ld in PATH.
329654044362Smrg    with_gnu_ld=unknown
329754044362Smrg    ;;
329854044362Smrg  esac
329954044362Smrgelif test yes = "$with_gnu_ld"; then
330054044362Smrg  AC_MSG_CHECKING([for GNU ld])
33018c9fbc29Smrgelse
330254044362Smrg  AC_MSG_CHECKING([for non-GNU ld])
33038c9fbc29Smrgfi
330454044362SmrgAC_CACHE_VAL(lt_cv_path_LD,
330554044362Smrg[if test -z "$LD"; then
330654044362Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
330754044362Smrg  for ac_dir in $PATH; do
330854044362Smrg    IFS=$lt_save_ifs
330954044362Smrg    test -z "$ac_dir" && ac_dir=.
331054044362Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
331154044362Smrg      lt_cv_path_LD=$ac_dir/$ac_prog
331254044362Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
331354044362Smrg      # but apparently some variants of GNU ld only accept -v.
331454044362Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
331554044362Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
331654044362Smrg      *GNU* | *'with BFD'*)
331754044362Smrg	test no != "$with_gnu_ld" && break
331854044362Smrg	;;
331954044362Smrg      *)
332054044362Smrg	test yes != "$with_gnu_ld" && break
332154044362Smrg	;;
332254044362Smrg      esac
332354044362Smrg    fi
332454044362Smrg  done
332554044362Smrg  IFS=$lt_save_ifs
33268c9fbc29Smrgelse
332754044362Smrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
332854044362Smrgfi])
332954044362SmrgLD=$lt_cv_path_LD
333054044362Smrgif test -n "$LD"; then
333154044362Smrg  AC_MSG_RESULT($LD)
333254044362Smrgelse
333354044362Smrg  AC_MSG_RESULT(no)
33348c9fbc29Smrgfi
333554044362Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
333654044362Smrg_LT_PATH_LD_GNU
333754044362SmrgAC_SUBST([LD])
33388c9fbc29Smrg
333954044362Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
334054044362Smrg])# LT_PATH_LD
33418c9fbc29Smrg
334254044362Smrg# Old names:
334354044362SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
334454044362SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
334554044362Smrgdnl aclocal-1.4 backwards compatibility:
334654044362Smrgdnl AC_DEFUN([AM_PROG_LD], [])
334754044362Smrgdnl AC_DEFUN([AC_PROG_LD], [])
33488c9fbc29Smrg
33498c9fbc29Smrg
335054044362Smrg# _LT_PATH_LD_GNU
335154044362Smrg#- --------------
335254044362Smrgm4_defun([_LT_PATH_LD_GNU],
335354044362Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
335454044362Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
335554044362Smrgcase `$LD -v 2>&1 </dev/null` in
335654044362Smrg*GNU* | *'with BFD'*)
335754044362Smrg  lt_cv_prog_gnu_ld=yes
335854044362Smrg  ;;
335954044362Smrg*)
336054044362Smrg  lt_cv_prog_gnu_ld=no
336154044362Smrg  ;;
336254044362Smrgesac])
336354044362Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
336454044362Smrg])# _LT_PATH_LD_GNU
33658c9fbc29Smrg
33668c9fbc29Smrg
336754044362Smrg# _LT_CMD_RELOAD
336854044362Smrg# --------------
336954044362Smrg# find reload flag for linker
337054044362Smrg#   -- PORTME Some linkers may need a different reload flag.
337154044362Smrgm4_defun([_LT_CMD_RELOAD],
337254044362Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
337354044362Smrg  lt_cv_ld_reload_flag,
337454044362Smrg  [lt_cv_ld_reload_flag='-r'])
337554044362Smrgreload_flag=$lt_cv_ld_reload_flag
337654044362Smrgcase $reload_flag in
337754044362Smrg"" | " "*) ;;
337854044362Smrg*) reload_flag=" $reload_flag" ;;
337954044362Smrgesac
338054044362Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
338154044362Smrgcase $host_os in
338254044362Smrg  cygwin* | mingw* | pw32* | cegcc*)
338354044362Smrg    if test yes != "$GCC"; then
338454044362Smrg      reload_cmds=false
338554044362Smrg    fi
338654044362Smrg    ;;
33874cd6a3aeSmrg  darwin*)
338854044362Smrg    if test yes = "$GCC"; then
338954044362Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
33904cd6a3aeSmrg    else
339154044362Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
33924cd6a3aeSmrg    fi
33934cd6a3aeSmrg    ;;
339454044362Smrgesac
339554044362Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
339654044362Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
339754044362Smrg])# _LT_CMD_RELOAD
33988c9fbc29Smrg
33998c9fbc29Smrg
340054044362Smrg# _LT_PATH_DD
340154044362Smrg# -----------
340254044362Smrg# find a working dd
340354044362Smrgm4_defun([_LT_PATH_DD],
340454044362Smrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
340554044362Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
340654044362Smrgcat conftest.i conftest.i >conftest2.i
340754044362Smrg: ${lt_DD:=$DD}
340854044362SmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
340954044362Smrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
341054044362Smrg  cmp -s conftest.i conftest.out \
341154044362Smrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
34124e411241Smrgfi])
341354044362Smrgrm -f conftest.i conftest2.i conftest.out])
341454044362Smrg])# _LT_PATH_DD
34158c9fbc29Smrg
34168c9fbc29Smrg
341754044362Smrg# _LT_CMD_TRUNCATE
341854044362Smrg# ----------------
341954044362Smrg# find command to truncate a binary pipe
342054044362Smrgm4_defun([_LT_CMD_TRUNCATE],
342154044362Smrg[m4_require([_LT_PATH_DD])
342254044362SmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
342354044362Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
342454044362Smrgcat conftest.i conftest.i >conftest2.i
342554044362Smrglt_cv_truncate_bin=
342654044362Smrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
342754044362Smrg  cmp -s conftest.i conftest.out \
342854044362Smrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
342954044362Smrgfi
343054044362Smrgrm -f conftest.i conftest2.i conftest.out
343154044362Smrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
343254044362Smrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
343354044362Smrg  [Command to truncate a binary pipe])
343454044362Smrg])# _LT_CMD_TRUNCATE
34358c9fbc29Smrg
34368c9fbc29Smrg
343754044362Smrg# _LT_CHECK_MAGIC_METHOD
343854044362Smrg# ----------------------
343954044362Smrg# how to check for library dependencies
344054044362Smrg#  -- PORTME fill in with the dynamic library characteristics
344154044362Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
344254044362Smrg[m4_require([_LT_DECL_EGREP])
344354044362Smrgm4_require([_LT_DECL_OBJDUMP])
344454044362SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
344554044362Smrglt_cv_deplibs_check_method,
344654044362Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
344754044362Smrglt_cv_file_magic_test_file=
344854044362Smrglt_cv_deplibs_check_method='unknown'
344954044362Smrg# Need to set the preceding variable on all platforms that support
345054044362Smrg# interlibrary dependencies.
345154044362Smrg# 'none' -- dependencies not supported.
345254044362Smrg# 'unknown' -- same as none, but documents that we really don't know.
345354044362Smrg# 'pass_all' -- all dependencies passed with no checks.
345454044362Smrg# 'test_compile' -- check by making test program.
345554044362Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
345654044362Smrg# that responds to the $file_magic_cmd with a given extended regex.
345754044362Smrg# If you have 'file' or equivalent on your system and you're not sure
345854044362Smrg# whether 'pass_all' will *always* work, you probably want this one.
34598c9fbc29Smrg
346054044362Smrgcase $host_os in
346154044362Smrgaix[[4-9]]*)
346254044362Smrg  lt_cv_deplibs_check_method=pass_all
34638c9fbc29Smrg  ;;
34648c9fbc29Smrg
34658c9fbc29Smrgbeos*)
346654044362Smrg  lt_cv_deplibs_check_method=pass_all
34678c9fbc29Smrg  ;;
34688c9fbc29Smrg
34698c9fbc29Smrgbsdi[[45]]*)
347054044362Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
347154044362Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
347254044362Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
34738c9fbc29Smrg  ;;
34748c9fbc29Smrg
347554044362Smrgcygwin*)
347654044362Smrg  # func_win32_libid is a shell function defined in ltmain.sh
347754044362Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
347854044362Smrg  lt_cv_file_magic_cmd='func_win32_libid'
347954044362Smrg  ;;
34808c9fbc29Smrg
348154044362Smrgmingw* | pw32*)
348254044362Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
348354044362Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
348454044362Smrg  # unless we find 'file', for example because we are cross-compiling.
348554044362Smrg  if ( file / ) >/dev/null 2>&1; then
348654044362Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
348754044362Smrg    lt_cv_file_magic_cmd='func_win32_libid'
348854044362Smrg  else
348954044362Smrg    # Keep this pattern in sync with the one in func_win32_libid.
349054044362Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
349154044362Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
349254044362Smrg  fi
34938c9fbc29Smrg  ;;
34948c9fbc29Smrg
349554044362Smrgcegcc*)
349654044362Smrg  # use the weaker test based on 'objdump'. See mingw*.
349754044362Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
349854044362Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
34998c9fbc29Smrg  ;;
35008c9fbc29Smrg
350154044362Smrgdarwin* | rhapsody*)
350254044362Smrg  lt_cv_deplibs_check_method=pass_all
35038c9fbc29Smrg  ;;
35048c9fbc29Smrg
35058c9fbc29Smrgfreebsd* | dragonfly*)
350654044362Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
350754044362Smrg    case $host_cpu in
350854044362Smrg    i*86 )
350954044362Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
351054044362Smrg      # Let's accept both of them until this is cleared up.
351154044362Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
351254044362Smrg      lt_cv_file_magic_cmd=/usr/bin/file
351354044362Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
351454044362Smrg      ;;
35158c9fbc29Smrg    esac
351654044362Smrg  else
351754044362Smrg    lt_cv_deplibs_check_method=pass_all
35188c9fbc29Smrg  fi
35198c9fbc29Smrg  ;;
35208c9fbc29Smrg
35214cd6a3aeSmrghaiku*)
352254044362Smrg  lt_cv_deplibs_check_method=pass_all
35234cd6a3aeSmrg  ;;
35244cd6a3aeSmrg
352554044362Smrghpux10.20* | hpux11*)
352654044362Smrg  lt_cv_file_magic_cmd=/usr/bin/file
35278c9fbc29Smrg  case $host_cpu in
35288c9fbc29Smrg  ia64*)
352954044362Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
353054044362Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
35318c9fbc29Smrg    ;;
35324cd6a3aeSmrg  hppa*64*)
353354044362Smrg    [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]']
353454044362Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
35354cd6a3aeSmrg    ;;
35364cd6a3aeSmrg  *)
353754044362Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
353854044362Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
35398c9fbc29Smrg    ;;
35408c9fbc29Smrg  esac
35418c9fbc29Smrg  ;;
35428c9fbc29Smrg
35434e411241Smrginterix[[3-9]]*)
354454044362Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
354554044362Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
35468c9fbc29Smrg  ;;
35478c9fbc29Smrg
35488c9fbc29Smrgirix5* | irix6* | nonstopux*)
354954044362Smrg  case $LD in
355054044362Smrg  *-32|*"-32 ") libmagic=32-bit;;
355154044362Smrg  *-n32|*"-n32 ") libmagic=N32;;
355254044362Smrg  *-64|*"-64 ") libmagic=64-bit;;
355354044362Smrg  *) libmagic=never-match;;
35548c9fbc29Smrg  esac
355554044362Smrg  lt_cv_deplibs_check_method=pass_all
35568c9fbc29Smrg  ;;
35578c9fbc29Smrg
355870728a38Smrg# This must be glibc/ELF.
355954044362Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
356054044362Smrg  lt_cv_deplibs_check_method=pass_all
35618c9fbc29Smrg  ;;
35628c9fbc29Smrg
35638c9fbc29Smrgnetbsd*)
356454044362Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
356554044362Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
35668c9fbc29Smrg  else
356754044362Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
35688c9fbc29Smrg  fi
35698c9fbc29Smrg  ;;
35708c9fbc29Smrg
357154044362Smrgnewos6*)
357254044362Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
357354044362Smrg  lt_cv_file_magic_cmd=/usr/bin/file
357454044362Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
35758c9fbc29Smrg  ;;
35768c9fbc29Smrg
35774cd6a3aeSmrg*nto* | *qnx*)
357854044362Smrg  lt_cv_deplibs_check_method=pass_all
35798c9fbc29Smrg  ;;
35808c9fbc29Smrg
358154044362Smrgopenbsd* | bitrig*)
358254044362Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
358354044362Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
35848c9fbc29Smrg  else
358554044362Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
35868c9fbc29Smrg  fi
35878c9fbc29Smrg  ;;
35888c9fbc29Smrg
35898c9fbc29Smrgosf3* | osf4* | osf5*)
359054044362Smrg  lt_cv_deplibs_check_method=pass_all
35918c9fbc29Smrg  ;;
35928c9fbc29Smrg
35934e411241Smrgrdos*)
359454044362Smrg  lt_cv_deplibs_check_method=pass_all
35954e411241Smrg  ;;
35964e411241Smrg
35978c9fbc29Smrgsolaris*)
359854044362Smrg  lt_cv_deplibs_check_method=pass_all
35998c9fbc29Smrg  ;;
36008c9fbc29Smrg
360154044362Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
360254044362Smrg  lt_cv_deplibs_check_method=pass_all
36038c9fbc29Smrg  ;;
36048c9fbc29Smrg
36058c9fbc29Smrgsysv4 | sysv4.3*)
36068c9fbc29Smrg  case $host_vendor in
360754044362Smrg  motorola)
360854044362Smrg    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]]'
360954044362Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
361054044362Smrg    ;;
361154044362Smrg  ncr)
361254044362Smrg    lt_cv_deplibs_check_method=pass_all
361354044362Smrg    ;;
361454044362Smrg  sequent)
361554044362Smrg    lt_cv_file_magic_cmd='/bin/file'
361654044362Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
361754044362Smrg    ;;
361854044362Smrg  sni)
361954044362Smrg    lt_cv_file_magic_cmd='/bin/file'
362054044362Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
362154044362Smrg    lt_cv_file_magic_test_file=/lib/libc.so
362254044362Smrg    ;;
362354044362Smrg  siemens)
362454044362Smrg    lt_cv_deplibs_check_method=pass_all
362554044362Smrg    ;;
362654044362Smrg  pc)
362754044362Smrg    lt_cv_deplibs_check_method=pass_all
362854044362Smrg    ;;
36298c9fbc29Smrg  esac
36308c9fbc29Smrg  ;;
36318c9fbc29Smrg
36324cd6a3aeSmrgtpf*)
363354044362Smrg  lt_cv_deplibs_check_method=pass_all
36348c9fbc29Smrg  ;;
363554044362Smrgos2*)
363654044362Smrg  lt_cv_deplibs_check_method=pass_all
36378c9fbc29Smrg  ;;
36388c9fbc29Smrgesac
363954044362Smrg])
36408c9fbc29Smrg
364154044362Smrgfile_magic_glob=
364254044362Smrgwant_nocaseglob=no
364354044362Smrgif test "$build" = "$host"; then
364454044362Smrg  case $host_os in
364554044362Smrg  mingw* | pw32*)
364654044362Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
364754044362Smrg      want_nocaseglob=yes
364854044362Smrg    else
364954044362Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
365054044362Smrg    fi
365154044362Smrg    ;;
365254044362Smrg  esac
36538c9fbc29Smrgfi
36548c9fbc29Smrg
365554044362Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
365654044362Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
365754044362Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
36584cd6a3aeSmrg
365954044362Smrg_LT_DECL([], [deplibs_check_method], [1],
366054044362Smrg    [Method to check whether dependent libraries are shared objects])
366154044362Smrg_LT_DECL([], [file_magic_cmd], [1],
366254044362Smrg    [Command to use when deplibs_check_method = "file_magic"])
366354044362Smrg_LT_DECL([], [file_magic_glob], [1],
366454044362Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
366554044362Smrg_LT_DECL([], [want_nocaseglob], [1],
366654044362Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
366754044362Smrg])# _LT_CHECK_MAGIC_METHOD
36688c9fbc29Smrg
36698c9fbc29Smrg
367054044362Smrg# LT_PATH_NM
367154044362Smrg# ----------
367254044362Smrg# find the pathname to a BSD- or MS-compatible name lister
367354044362SmrgAC_DEFUN([LT_PATH_NM],
367454044362Smrg[AC_REQUIRE([AC_PROG_CC])dnl
367554044362SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
367654044362Smrg[if test -n "$NM"; then
367754044362Smrg  # Let the user override the test.
367854044362Smrg  lt_cv_path_NM=$NM
367954044362Smrgelse
368054044362Smrg  lt_nm_to_check=${ac_tool_prefix}nm
368154044362Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
368254044362Smrg    lt_nm_to_check="$lt_nm_to_check nm"
368354044362Smrg  fi
368454044362Smrg  for lt_tmp_nm in $lt_nm_to_check; do
368554044362Smrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
368654044362Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
368754044362Smrg      IFS=$lt_save_ifs
368854044362Smrg      test -z "$ac_dir" && ac_dir=.
368954044362Smrg      tmp_nm=$ac_dir/$lt_tmp_nm
369054044362Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
369154044362Smrg	# Check to see if the nm accepts a BSD-compat flag.
369254044362Smrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
369354044362Smrg	#   nm: unknown option "B" ignored
369454044362Smrg	# Tru64's nm complains that /dev/null is an invalid object file
369554044362Smrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
369654044362Smrg	case $build_os in
369754044362Smrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
369854044362Smrg	*) lt_bad_file=/dev/null ;;
369954044362Smrg	esac
370054044362Smrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
370154044362Smrg	*$lt_bad_file* | *'Invalid file or object type'*)
370254044362Smrg	  lt_cv_path_NM="$tmp_nm -B"
370354044362Smrg	  break 2
370454044362Smrg	  ;;
370554044362Smrg	*)
370654044362Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
370754044362Smrg	  */dev/null*)
370854044362Smrg	    lt_cv_path_NM="$tmp_nm -p"
370954044362Smrg	    break 2
371054044362Smrg	    ;;
371154044362Smrg	  *)
371254044362Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
371354044362Smrg	    continue # so that we can try to find one that supports BSD flags
371454044362Smrg	    ;;
371554044362Smrg	  esac
371654044362Smrg	  ;;
37178c9fbc29Smrg	esac
37188c9fbc29Smrg      fi
371954044362Smrg    done
372054044362Smrg    IFS=$lt_save_ifs
37218c9fbc29Smrg  done
372254044362Smrg  : ${lt_cv_path_NM=no}
372354044362Smrgfi])
372454044362Smrgif test no != "$lt_cv_path_NM"; then
372554044362Smrg  NM=$lt_cv_path_NM
37268c9fbc29Smrgelse
372754044362Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
372854044362Smrg  if test -n "$DUMPBIN"; then :
372954044362Smrg    # Let the user override the test.
37308c9fbc29Smrg  else
373154044362Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
373254044362Smrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
373354044362Smrg    *COFF*)
373454044362Smrg      DUMPBIN="$DUMPBIN -symbols -headers"
373554044362Smrg      ;;
373654044362Smrg    *)
373754044362Smrg      DUMPBIN=:
373854044362Smrg      ;;
373954044362Smrg    esac
374054044362Smrg  fi
374154044362Smrg  AC_SUBST([DUMPBIN])
374254044362Smrg  if test : != "$DUMPBIN"; then
374354044362Smrg    NM=$DUMPBIN
37448c9fbc29Smrg  fi
37458c9fbc29Smrgfi
374654044362Smrgtest -z "$NM" && NM=nm
374754044362SmrgAC_SUBST([NM])
374854044362Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
37498c9fbc29Smrg
375054044362SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
375154044362Smrg  [lt_cv_nm_interface="BSD nm"
375254044362Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
375354044362Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
375454044362Smrg  (eval "$ac_compile" 2>conftest.err)
375554044362Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
375654044362Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
375754044362Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
375854044362Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
375954044362Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
376054044362Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
376154044362Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
376254044362Smrg    lt_cv_nm_interface="MS dumpbin"
376354044362Smrg  fi
376454044362Smrg  rm -f conftest*])
376554044362Smrg])# LT_PATH_NM
37668c9fbc29Smrg
376754044362Smrg# Old names:
376854044362SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
376954044362SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
377054044362Smrgdnl aclocal-1.4 backwards compatibility:
377154044362Smrgdnl AC_DEFUN([AM_PROG_NM], [])
377254044362Smrgdnl AC_DEFUN([AC_PROG_NM], [])
37734cd6a3aeSmrg
377454044362Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
377554044362Smrg# --------------------------------
377654044362Smrg# how to determine the name of the shared library
377754044362Smrg# associated with a specific link library.
377854044362Smrg#  -- PORTME fill in with the dynamic library characteristics
377954044362Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
378054044362Smrg[m4_require([_LT_DECL_EGREP])
378154044362Smrgm4_require([_LT_DECL_OBJDUMP])
378254044362Smrgm4_require([_LT_DECL_DLLTOOL])
378354044362SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
378454044362Smrglt_cv_sharedlib_from_linklib_cmd,
378554044362Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
37864cd6a3aeSmrg
378754044362Smrgcase $host_os in
378854044362Smrgcygwin* | mingw* | pw32* | cegcc*)
378954044362Smrg  # two different shell functions defined in ltmain.sh;
379054044362Smrg  # decide which one to use based on capabilities of $DLLTOOL
379154044362Smrg  case `$DLLTOOL --help 2>&1` in
379254044362Smrg  *--identify-strict*)
379354044362Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
37948c9fbc29Smrg    ;;
37958c9fbc29Smrg  *)
379654044362Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
37978c9fbc29Smrg    ;;
37988c9fbc29Smrg  esac
37998c9fbc29Smrg  ;;
38008c9fbc29Smrg*)
380154044362Smrg  # fallback: assume linklib IS sharedlib
380254044362Smrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
38038c9fbc29Smrg  ;;
38048c9fbc29Smrgesac
380554044362Smrg])
380654044362Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
380754044362Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
380854044362Smrg
380954044362Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
381054044362Smrg    [Command to associate shared and link libraries])
381154044362Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
38128c9fbc29Smrg
38138c9fbc29Smrg
381454044362Smrg# _LT_PATH_MANIFEST_TOOL
38154cd6a3aeSmrg# ----------------------
381654044362Smrg# locate the manifest tool
381754044362Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
381854044362Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
381954044362Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
382054044362SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
382154044362Smrg  [lt_cv_path_mainfest_tool=no
382254044362Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
382354044362Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
382454044362Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
382554044362Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
382654044362Smrg    lt_cv_path_mainfest_tool=yes
382754044362Smrg  fi
382854044362Smrg  rm -f conftest*])
382954044362Smrgif test yes != "$lt_cv_path_mainfest_tool"; then
383054044362Smrg  MANIFEST_TOOL=:
383154044362Smrgfi
383254044362Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
383354044362Smrg])# _LT_PATH_MANIFEST_TOOL
38348c9fbc29Smrg
38358c9fbc29Smrg
383654044362Smrg# _LT_DLL_DEF_P([FILE])
383754044362Smrg# ---------------------
383854044362Smrg# True iff FILE is a Windows DLL '.def' file.
383954044362Smrg# Keep in sync with func_dll_def_p in the libtool script
384054044362SmrgAC_DEFUN([_LT_DLL_DEF_P],
384154044362Smrg[dnl
384254044362Smrg  test DEF = "`$SED -n dnl
384354044362Smrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
384454044362Smrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
384554044362Smrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
384654044362Smrg    -e q dnl                          Only consider the first "real" line
384754044362Smrg    $1`" dnl
384854044362Smrg])# _LT_DLL_DEF_P
38498c9fbc29Smrg
38508c9fbc29Smrg
385154044362Smrg# LT_LIB_M
385254044362Smrg# --------
385354044362Smrg# check for math library
385454044362SmrgAC_DEFUN([LT_LIB_M],
385554044362Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
385654044362SmrgLIBM=
385754044362Smrgcase $host in
385854044362Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
385954044362Smrg  # These system don't have libm, or don't need it
38608c9fbc29Smrg  ;;
386154044362Smrg*-ncr-sysv4.3*)
386254044362Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
386354044362Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
38648c9fbc29Smrg  ;;
386554044362Smrg*)
386654044362Smrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
38674cd6a3aeSmrg  ;;
386854044362Smrgesac
386954044362SmrgAC_SUBST([LIBM])
387054044362Smrg])# LT_LIB_M
38714cd6a3aeSmrg
387254044362Smrg# Old name:
387354044362SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
387454044362Smrgdnl aclocal-1.4 backwards compatibility:
387554044362Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
38768c9fbc29Smrg
38778c9fbc29Smrg
387854044362Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
387954044362Smrg# -------------------------------
388054044362Smrgm4_defun([_LT_COMPILER_NO_RTTI],
388154044362Smrg[m4_require([_LT_TAG_COMPILER])dnl
38828c9fbc29Smrg
388354044362Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
38844cd6a3aeSmrg
388554044362Smrgif test yes = "$GCC"; then
388654044362Smrg  case $cc_basename in
388754044362Smrg  nvcc*)
388854044362Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
38898c9fbc29Smrg  *)
389054044362Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
38918c9fbc29Smrg  esac
38928c9fbc29Smrg
389354044362Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
389454044362Smrg    lt_cv_prog_compiler_rtti_exceptions,
389554044362Smrg    [-fno-rtti -fno-exceptions], [],
389654044362Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
389754044362Smrgfi
389854044362Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
389954044362Smrg	[Compiler flag to turn off builtin functions])
390054044362Smrg])# _LT_COMPILER_NO_RTTI
39018c9fbc29Smrg
39028c9fbc29Smrg
390354044362Smrg# _LT_CMD_GLOBAL_SYMBOLS
390454044362Smrg# ----------------------
390554044362Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
390654044362Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
390754044362SmrgAC_REQUIRE([AC_PROG_CC])dnl
390854044362SmrgAC_REQUIRE([AC_PROG_AWK])dnl
390954044362SmrgAC_REQUIRE([LT_PATH_NM])dnl
391054044362SmrgAC_REQUIRE([LT_PATH_LD])dnl
391154044362Smrgm4_require([_LT_DECL_SED])dnl
391254044362Smrgm4_require([_LT_DECL_EGREP])dnl
391354044362Smrgm4_require([_LT_TAG_COMPILER])dnl
39148c9fbc29Smrg
391554044362Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
391654044362SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
391754044362SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
391854044362Smrg[
391954044362Smrg# These are sane defaults that work on at least a few old systems.
392054044362Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
39218c9fbc29Smrg
392254044362Smrg# Character class describing NM global symbol codes.
392354044362Smrgsymcode='[[BCDEGRST]]'
39248c9fbc29Smrg
392554044362Smrg# Regexp to match symbols that can be accessed directly from C.
392654044362Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
39278c9fbc29Smrg
392854044362Smrg# Define system-specific variables.
392954044362Smrgcase $host_os in
393054044362Smrgaix*)
393154044362Smrg  symcode='[[BCDT]]'
393254044362Smrg  ;;
393354044362Smrgcygwin* | mingw* | pw32* | cegcc*)
393454044362Smrg  symcode='[[ABCDGISTW]]'
393554044362Smrg  ;;
393654044362Smrghpux*)
393754044362Smrg  if test ia64 = "$host_cpu"; then
393854044362Smrg    symcode='[[ABCDEGRST]]'
39398c9fbc29Smrg  fi
39408c9fbc29Smrg  ;;
394154044362Smrgirix* | nonstopux*)
394254044362Smrg  symcode='[[BCDEGRST]]'
39438c9fbc29Smrg  ;;
394454044362Smrgosf*)
394554044362Smrg  symcode='[[BCDEGQRST]]'
39464e411241Smrg  ;;
39478c9fbc29Smrgsolaris*)
394854044362Smrg  symcode='[[BDRT]]'
39498c9fbc29Smrg  ;;
395054044362Smrgsco3.2v5*)
395154044362Smrg  symcode='[[DT]]'
39524cd6a3aeSmrg  ;;
395354044362Smrgsysv4.2uw2*)
395454044362Smrg  symcode='[[DT]]'
39558c9fbc29Smrg  ;;
395654044362Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
395754044362Smrg  symcode='[[ABDT]]'
395854044362Smrg  ;;
395954044362Smrgsysv4)
396054044362Smrg  symcode='[[DFNSTU]]'
39618c9fbc29Smrg  ;;
39628c9fbc29Smrgesac
39638c9fbc29Smrg
396454044362Smrg# If we're using GNU nm, then use its standard symbol codes.
396554044362Smrgcase `$NM -V 2>&1` in
396654044362Smrg*GNU* | *'with BFD'*)
396754044362Smrg  symcode='[[ABCDGIRSTW]]' ;;
396854044362Smrgesac
39698c9fbc29Smrg
397054044362Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
397154044362Smrg  # Gets list of data symbols to import.
397254044362Smrg  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
397354044362Smrg  # Adjust the below global symbol transforms to fixup imported variables.
397454044362Smrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
397554044362Smrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
397654044362Smrg  lt_c_name_lib_hook="\
397754044362Smrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
397854044362Smrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
39794cd6a3aeSmrgelse
398054044362Smrg  # Disable hooks by default.
398154044362Smrg  lt_cv_sys_global_symbol_to_import=
398254044362Smrg  lt_cdecl_hook=
398354044362Smrg  lt_c_name_hook=
398454044362Smrg  lt_c_name_lib_hook=
39854cd6a3aeSmrgfi
39864cd6a3aeSmrg
398754044362Smrg# Transform an extracted symbol line into a proper C declaration.
398854044362Smrg# Some systems (esp. on ia64) link data and code symbols differently,
398954044362Smrg# so use this general approach.
399054044362Smrglt_cv_sys_global_symbol_to_cdecl="sed -n"\
399154044362Smrg$lt_cdecl_hook\
399254044362Smrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
399354044362Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
39944cd6a3aeSmrg
399554044362Smrg# Transform an extracted symbol line into symbol name and symbol address
399654044362Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n"\
399754044362Smrg$lt_c_name_hook\
399854044362Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
399954044362Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
400054044362Smrg
400154044362Smrg# Transform an extracted symbol line into symbol name with lib prefix and
400254044362Smrg# symbol address.
400354044362Smrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
400454044362Smrg$lt_c_name_lib_hook\
400554044362Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
400654044362Smrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
400754044362Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
40084cd6a3aeSmrg
400954044362Smrg# Handle CRLF in mingw tool chain
401054044362Smrgopt_cr=
401154044362Smrgcase $build_os in
401254044362Smrgmingw*)
401354044362Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
40144cd6a3aeSmrg  ;;
40154cd6a3aeSmrgesac
40168c9fbc29Smrg
401754044362Smrg# Try without a prefix underscore, then with it.
401854044362Smrgfor ac_symprfx in "" "_"; do
40194cd6a3aeSmrg
402054044362Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
402154044362Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
40228c9fbc29Smrg
40234cd6a3aeSmrg  # Write the raw and C identifiers.
40244cd6a3aeSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
402554044362Smrg    # Fake it for dumpbin and say T for any non-static function,
402654044362Smrg    # D for any global variable and I for any imported variable.
40274cd6a3aeSmrg    # Also find C++ and __fastcall symbols from MSVC++,
40284cd6a3aeSmrg    # which start with @ or ?.
40294cd6a3aeSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
40304cd6a3aeSmrg"     {last_section=section; section=\$ 3};"\
403170728a38Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
40324cd6a3aeSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
403354044362Smrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
403454044362Smrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
403554044362Smrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
40364cd6a3aeSmrg"     \$ 0!~/External *\|/{next};"\
40374cd6a3aeSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
40384cd6a3aeSmrg"     {if(hide[section]) next};"\
403954044362Smrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
404054044362Smrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
404154044362Smrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
404254044362Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
40434cd6a3aeSmrg"     ' prfx=^$ac_symprfx]"
40444cd6a3aeSmrg  else
40454cd6a3aeSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
40464cd6a3aeSmrg  fi
40474cd6a3aeSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
40488c9fbc29Smrg
40494cd6a3aeSmrg  # Check to see that the pipe works correctly.
40504cd6a3aeSmrg  pipe_works=no
40518c9fbc29Smrg
40524cd6a3aeSmrg  rm -f conftest*
40534cd6a3aeSmrg  cat > conftest.$ac_ext <<_LT_EOF
40544cd6a3aeSmrg#ifdef __cplusplus
40554cd6a3aeSmrgextern "C" {
40564cd6a3aeSmrg#endif
40574cd6a3aeSmrgchar nm_test_var;
40584cd6a3aeSmrgvoid nm_test_func(void);
40594cd6a3aeSmrgvoid nm_test_func(void){}
40604cd6a3aeSmrg#ifdef __cplusplus
40614cd6a3aeSmrg}
40624cd6a3aeSmrg#endif
40634cd6a3aeSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
40644cd6a3aeSmrg_LT_EOF
40658c9fbc29Smrg
40664cd6a3aeSmrg  if AC_TRY_EVAL(ac_compile); then
40674cd6a3aeSmrg    # Now try to grab the symbols.
40684cd6a3aeSmrg    nlist=conftest.nm
40694cd6a3aeSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
40704cd6a3aeSmrg      # Try sorting and uniquifying the output.
40714cd6a3aeSmrg      if sort "$nlist" | uniq > "$nlist"T; then
40724cd6a3aeSmrg	mv -f "$nlist"T "$nlist"
40734cd6a3aeSmrg      else
40744cd6a3aeSmrg	rm -f "$nlist"T
40754cd6a3aeSmrg      fi
40768c9fbc29Smrg
40774cd6a3aeSmrg      # Make sure that we snagged all the symbols we need.
40784cd6a3aeSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
40794cd6a3aeSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
40804cd6a3aeSmrg	  cat <<_LT_EOF > conftest.$ac_ext
40814cd6a3aeSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
408254044362Smrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
408354044362Smrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
40844cd6a3aeSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
40854cd6a3aeSmrg# define LT@&t@_DLSYM_CONST
408654044362Smrg#elif defined __osf__
40874cd6a3aeSmrg/* This system does not cope well with relocations in const data.  */
40884cd6a3aeSmrg# define LT@&t@_DLSYM_CONST
40894cd6a3aeSmrg#else
40904cd6a3aeSmrg# define LT@&t@_DLSYM_CONST const
40914cd6a3aeSmrg#endif
40928c9fbc29Smrg
40934cd6a3aeSmrg#ifdef __cplusplus
40944cd6a3aeSmrgextern "C" {
40954cd6a3aeSmrg#endif
40968c9fbc29Smrg
40974cd6a3aeSmrg_LT_EOF
40984cd6a3aeSmrg	  # Now generate the symbol file.
40994cd6a3aeSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
41008c9fbc29Smrg
41014cd6a3aeSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
41028c9fbc29Smrg
41034cd6a3aeSmrg/* The mapping between symbol names and symbols.  */
41044cd6a3aeSmrgLT@&t@_DLSYM_CONST struct {
41054cd6a3aeSmrg  const char *name;
41064cd6a3aeSmrg  void       *address;
41074cd6a3aeSmrg}
41084cd6a3aeSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
41094cd6a3aeSmrg{
41104cd6a3aeSmrg  { "@PROGRAM@", (void *) 0 },
41114cd6a3aeSmrg_LT_EOF
411254044362Smrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
41134cd6a3aeSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
41144cd6a3aeSmrg  {0, (void *) 0}
41154cd6a3aeSmrg};
41168c9fbc29Smrg
41174cd6a3aeSmrg/* This works around a problem in FreeBSD linker */
41184cd6a3aeSmrg#ifdef FREEBSD_WORKAROUND
41194cd6a3aeSmrgstatic const void *lt_preloaded_setup() {
41204cd6a3aeSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
41214cd6a3aeSmrg}
41224cd6a3aeSmrg#endif
41238c9fbc29Smrg
41244cd6a3aeSmrg#ifdef __cplusplus
41254cd6a3aeSmrg}
41264cd6a3aeSmrg#endif
41274cd6a3aeSmrg_LT_EOF
41284cd6a3aeSmrg	  # Now try linking the two files.
41294cd6a3aeSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
41304cd6a3aeSmrg	  lt_globsym_save_LIBS=$LIBS
41314cd6a3aeSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
413254044362Smrg	  LIBS=conftstm.$ac_objext
41334cd6a3aeSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
413454044362Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
41354cd6a3aeSmrg	    pipe_works=yes
41364cd6a3aeSmrg	  fi
41374cd6a3aeSmrg	  LIBS=$lt_globsym_save_LIBS
41384cd6a3aeSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
41394cd6a3aeSmrg	else
41404cd6a3aeSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
41414cd6a3aeSmrg	fi
41424cd6a3aeSmrg      else
41434cd6a3aeSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
41444cd6a3aeSmrg      fi
41458c9fbc29Smrg    else
41464cd6a3aeSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
41478c9fbc29Smrg    fi
41488c9fbc29Smrg  else
41494cd6a3aeSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
41504cd6a3aeSmrg    cat conftest.$ac_ext >&5
41518c9fbc29Smrg  fi
41524cd6a3aeSmrg  rm -rf conftest* conftst*
41538c9fbc29Smrg
41544cd6a3aeSmrg  # Do not use the global_symbol_pipe unless it works.
415554044362Smrg  if test yes = "$pipe_works"; then
41564cd6a3aeSmrg    break
41574cd6a3aeSmrg  else
41584cd6a3aeSmrg    lt_cv_sys_global_symbol_pipe=
41594cd6a3aeSmrg  fi
41604cd6a3aeSmrgdone
41614cd6a3aeSmrg])
41624cd6a3aeSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
41634cd6a3aeSmrg  lt_cv_sys_global_symbol_to_cdecl=
41644cd6a3aeSmrgfi
41654cd6a3aeSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
41664cd6a3aeSmrg  AC_MSG_RESULT(failed)
41678c9fbc29Smrgelse
41684cd6a3aeSmrg  AC_MSG_RESULT(ok)
41698c9fbc29Smrgfi
41708c9fbc29Smrg
41714cd6a3aeSmrg# Response file support.
41724cd6a3aeSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
41734cd6a3aeSmrg  nm_file_list_spec='@'
41744cd6a3aeSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
41754cd6a3aeSmrg  nm_file_list_spec='@'
41764cd6a3aeSmrgfi
41778c9fbc29Smrg
41784cd6a3aeSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
41794cd6a3aeSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
41804cd6a3aeSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
41814cd6a3aeSmrg    [Transform the output of nm in a proper C declaration])
418254044362Smrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
418354044362Smrg    [Transform the output of nm into a list of symbols to manually relocate])
41844cd6a3aeSmrg_LT_DECL([global_symbol_to_c_name_address],
41854cd6a3aeSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
41864cd6a3aeSmrg    [Transform the output of nm in a C name address pair])
41874cd6a3aeSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
41884cd6a3aeSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
41894cd6a3aeSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
419054044362Smrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
419154044362Smrg    [The name lister interface])
41924cd6a3aeSmrg_LT_DECL([], [nm_file_list_spec], [1],
41934cd6a3aeSmrg    [Specify filename containing input files for $NM])
41944cd6a3aeSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
41954cd6a3aeSmrg
41964cd6a3aeSmrg
41974cd6a3aeSmrg# _LT_COMPILER_PIC([TAGNAME])
41984cd6a3aeSmrg# ---------------------------
41994cd6a3aeSmrgm4_defun([_LT_COMPILER_PIC],
42004cd6a3aeSmrg[m4_require([_LT_TAG_COMPILER])dnl
42014cd6a3aeSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
42024cd6a3aeSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
42034cd6a3aeSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
42048c9fbc29Smrg
42054cd6a3aeSmrgm4_if([$1], [CXX], [
42064cd6a3aeSmrg  # C++ specific cases for pic, static, wl, etc.
420754044362Smrg  if test yes = "$GXX"; then
42084cd6a3aeSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
42094cd6a3aeSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
42108c9fbc29Smrg
42114cd6a3aeSmrg    case $host_os in
42124cd6a3aeSmrg    aix*)
42134cd6a3aeSmrg      # All AIX code is PIC.
421454044362Smrg      if test ia64 = "$host_cpu"; then
42154cd6a3aeSmrg	# AIX 5 now supports IA64 processor
42164cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
42178c9fbc29Smrg      fi
421854044362Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42194cd6a3aeSmrg      ;;
42208c9fbc29Smrg
42214cd6a3aeSmrg    amigaos*)
42224cd6a3aeSmrg      case $host_cpu in
42234cd6a3aeSmrg      powerpc)
42244cd6a3aeSmrg            # see comment about AmigaOS4 .so support
42254cd6a3aeSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42264cd6a3aeSmrg        ;;
42274cd6a3aeSmrg      m68k)
42284cd6a3aeSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
422954044362Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
423054044362Smrg            # like '-m68040'.
42314cd6a3aeSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
42324cd6a3aeSmrg        ;;
42334cd6a3aeSmrg      esac
42344cd6a3aeSmrg      ;;
42358c9fbc29Smrg
42364cd6a3aeSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
42374cd6a3aeSmrg      # PIC is the default for these OSes.
42388c9fbc29Smrg      ;;
42394cd6a3aeSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
42404cd6a3aeSmrg      # This hack is so that the source file can tell whether it is being
42414cd6a3aeSmrg      # built for inclusion in a dll (and should export symbols for example).
42424cd6a3aeSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
42434cd6a3aeSmrg      # (--disable-auto-import) libraries
42444cd6a3aeSmrg      m4_if([$1], [GCJ], [],
42454cd6a3aeSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
424654044362Smrg      case $host_os in
424754044362Smrg      os2*)
424854044362Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
424954044362Smrg	;;
425054044362Smrg      esac
42518c9fbc29Smrg      ;;
42524cd6a3aeSmrg    darwin* | rhapsody*)
42534cd6a3aeSmrg      # PIC is the default on this platform
42544cd6a3aeSmrg      # Common symbols not allowed in MH_DYLIB files
42554cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
42564cd6a3aeSmrg      ;;
42574cd6a3aeSmrg    *djgpp*)
42584cd6a3aeSmrg      # DJGPP does not support shared libraries at all
42594cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
42604cd6a3aeSmrg      ;;
42614cd6a3aeSmrg    haiku*)
42624cd6a3aeSmrg      # PIC is the default for Haiku.
42634cd6a3aeSmrg      # The "-static" flag exists, but is broken.
42644cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
42654cd6a3aeSmrg      ;;
42664cd6a3aeSmrg    interix[[3-9]]*)
42674cd6a3aeSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
42684cd6a3aeSmrg      # Instead, we relocate shared libraries at runtime.
42694cd6a3aeSmrg      ;;
42704cd6a3aeSmrg    sysv4*MP*)
42714cd6a3aeSmrg      if test -d /usr/nec; then
42724cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
42738c9fbc29Smrg      fi
42748c9fbc29Smrg      ;;
42754cd6a3aeSmrg    hpux*)
42764cd6a3aeSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
42774cd6a3aeSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
42784cd6a3aeSmrg      # sets the default TLS model and affects inlining.
42798c9fbc29Smrg      case $host_cpu in
42804cd6a3aeSmrg      hppa*64*)
42814cd6a3aeSmrg	;;
42828c9fbc29Smrg      *)
42834cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42844cd6a3aeSmrg	;;
42858c9fbc29Smrg      esac
42864cd6a3aeSmrg      ;;
42874cd6a3aeSmrg    *qnx* | *nto*)
42884cd6a3aeSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
42894cd6a3aeSmrg      # it will coredump.
42904cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
42918c9fbc29Smrg      ;;
42928c9fbc29Smrg    *)
42934cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42948c9fbc29Smrg      ;;
42958c9fbc29Smrg    esac
42964cd6a3aeSmrg  else
42974cd6a3aeSmrg    case $host_os in
42984cd6a3aeSmrg      aix[[4-9]]*)
42994cd6a3aeSmrg	# All AIX code is PIC.
430054044362Smrg	if test ia64 = "$host_cpu"; then
43014cd6a3aeSmrg	  # AIX 5 now supports IA64 processor
43024cd6a3aeSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43034cd6a3aeSmrg	else
43044cd6a3aeSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
43054cd6a3aeSmrg	fi
43068c9fbc29Smrg	;;
43074cd6a3aeSmrg      chorus*)
43084cd6a3aeSmrg	case $cc_basename in
43094cd6a3aeSmrg	cxch68*)
43104cd6a3aeSmrg	  # Green Hills C++ Compiler
43114cd6a3aeSmrg	  # _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"
43128c9fbc29Smrg	  ;;
43138c9fbc29Smrg	esac
43148c9fbc29Smrg	;;
43154cd6a3aeSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
43164cd6a3aeSmrg	# This hack is so that the source file can tell whether it is being
43174cd6a3aeSmrg	# built for inclusion in a dll (and should export symbols for example).
43184cd6a3aeSmrg	m4_if([$1], [GCJ], [],
43194cd6a3aeSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
43204cd6a3aeSmrg	;;
43214cd6a3aeSmrg      dgux*)
43224cd6a3aeSmrg	case $cc_basename in
43234cd6a3aeSmrg	  ec++*)
43244cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
43254cd6a3aeSmrg	    ;;
43264cd6a3aeSmrg	  ghcx*)
43274cd6a3aeSmrg	    # Green Hills C++ Compiler
43284cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
43294cd6a3aeSmrg	    ;;
43304cd6a3aeSmrg	  *)
43314cd6a3aeSmrg	    ;;
43324cd6a3aeSmrg	esac
43334cd6a3aeSmrg	;;
43344cd6a3aeSmrg      freebsd* | dragonfly*)
43354cd6a3aeSmrg	# FreeBSD uses GNU C++
43364cd6a3aeSmrg	;;
43374cd6a3aeSmrg      hpux9* | hpux10* | hpux11*)
43384cd6a3aeSmrg	case $cc_basename in
43394cd6a3aeSmrg	  CC*)
43404cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
434154044362Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
434254044362Smrg	    if test ia64 != "$host_cpu"; then
43434cd6a3aeSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
43444cd6a3aeSmrg	    fi
43454cd6a3aeSmrg	    ;;
43464cd6a3aeSmrg	  aCC*)
43474cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
434854044362Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
43498c9fbc29Smrg	    case $host_cpu in
43504cd6a3aeSmrg	    hppa*64*|ia64*)
43514cd6a3aeSmrg	      # +Z the default
43528c9fbc29Smrg	      ;;
43538c9fbc29Smrg	    *)
43544cd6a3aeSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
43558c9fbc29Smrg	      ;;
43568c9fbc29Smrg	    esac
43574cd6a3aeSmrg	    ;;
43584cd6a3aeSmrg	  *)
43594cd6a3aeSmrg	    ;;
43604cd6a3aeSmrg	esac
43618c9fbc29Smrg	;;
43624cd6a3aeSmrg      interix*)
43634cd6a3aeSmrg	# This is c89, which is MS Visual C++ (no shared libs)
43644cd6a3aeSmrg	# Anyone wants to do a port?
43658c9fbc29Smrg	;;
43664cd6a3aeSmrg      irix5* | irix6* | nonstopux*)
43674cd6a3aeSmrg	case $cc_basename in
43684cd6a3aeSmrg	  CC*)
43694cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43704cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
43714cd6a3aeSmrg	    # CC pic flag -KPIC is the default.
43724cd6a3aeSmrg	    ;;
43734cd6a3aeSmrg	  *)
43744cd6a3aeSmrg	    ;;
43754cd6a3aeSmrg	esac
43768c9fbc29Smrg	;;
437754044362Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
43784cd6a3aeSmrg	case $cc_basename in
43794cd6a3aeSmrg	  KCC*)
43804cd6a3aeSmrg	    # KAI C++ Compiler
43814cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
43824cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
43834cd6a3aeSmrg	    ;;
43844cd6a3aeSmrg	  ecpc* )
438554044362Smrg	    # old Intel C++ for x86_64, which still supported -KPIC.
43864cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43874cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
43884cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
43894cd6a3aeSmrg	    ;;
43904cd6a3aeSmrg	  icpc* )
43914cd6a3aeSmrg	    # Intel C++, used to be incompatible with GCC.
43924cd6a3aeSmrg	    # ICC 10 doesn't accept -KPIC any more.
43934cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43944cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
43954cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
43964cd6a3aeSmrg	    ;;
43974cd6a3aeSmrg	  pgCC* | pgcpp*)
43984cd6a3aeSmrg	    # Portland Group C++ compiler
43994cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44004cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
44014cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44024cd6a3aeSmrg	    ;;
44034cd6a3aeSmrg	  cxx*)
44044cd6a3aeSmrg	    # Compaq C++
44054cd6a3aeSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
44064cd6a3aeSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
44074cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
44084cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44094cd6a3aeSmrg	    ;;
44104cd6a3aeSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
44114cd6a3aeSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
44124cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44134cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
44144cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
44154cd6a3aeSmrg	    ;;
44164cd6a3aeSmrg	  *)
44174cd6a3aeSmrg	    case `$CC -V 2>&1 | sed 5q` in
44184cd6a3aeSmrg	    *Sun\ C*)
44194cd6a3aeSmrg	      # Sun C++ 5.9
44204cd6a3aeSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44214cd6a3aeSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44224cd6a3aeSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44234cd6a3aeSmrg	      ;;
44244cd6a3aeSmrg	    esac
44254cd6a3aeSmrg	    ;;
44264cd6a3aeSmrg	esac
44278c9fbc29Smrg	;;
44284cd6a3aeSmrg      lynxos*)
44294cd6a3aeSmrg	;;
44304cd6a3aeSmrg      m88k*)
44314cd6a3aeSmrg	;;
44324cd6a3aeSmrg      mvs*)
44334cd6a3aeSmrg	case $cc_basename in
44344cd6a3aeSmrg	  cxx*)
44354cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
44364cd6a3aeSmrg	    ;;
44374cd6a3aeSmrg	  *)
44384cd6a3aeSmrg	    ;;
44398c9fbc29Smrg	esac
44408c9fbc29Smrg	;;
44414cd6a3aeSmrg      netbsd*)
44424cd6a3aeSmrg	;;
44434cd6a3aeSmrg      *qnx* | *nto*)
44444cd6a3aeSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
44454cd6a3aeSmrg        # it will coredump.
44464cd6a3aeSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
44478c9fbc29Smrg        ;;
44484cd6a3aeSmrg      osf3* | osf4* | osf5*)
44494cd6a3aeSmrg	case $cc_basename in
44504cd6a3aeSmrg	  KCC*)
44514cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
44524cd6a3aeSmrg	    ;;
44534cd6a3aeSmrg	  RCC*)
44544cd6a3aeSmrg	    # Rational C++ 2.4.1
44554cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
44564cd6a3aeSmrg	    ;;
44574cd6a3aeSmrg	  cxx*)
44584cd6a3aeSmrg	    # Digital/Compaq C++
44594cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44604cd6a3aeSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
44614cd6a3aeSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
44624cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
44634cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44644cd6a3aeSmrg	    ;;
44654cd6a3aeSmrg	  *)
44664cd6a3aeSmrg	    ;;
44674cd6a3aeSmrg	esac
44688c9fbc29Smrg	;;
44694cd6a3aeSmrg      psos*)
44704cd6a3aeSmrg	;;
44714cd6a3aeSmrg      solaris*)
44724cd6a3aeSmrg	case $cc_basename in
44734cd6a3aeSmrg	  CC* | sunCC*)
44744cd6a3aeSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
44754cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44764cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44774cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44784cd6a3aeSmrg	    ;;
44794cd6a3aeSmrg	  gcx*)
44804cd6a3aeSmrg	    # Green Hills C++ Compiler
44814cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
44824cd6a3aeSmrg	    ;;
44834cd6a3aeSmrg	  *)
44844cd6a3aeSmrg	    ;;
44854e411241Smrg	esac
44864e411241Smrg	;;
44874cd6a3aeSmrg      sunos4*)
44884cd6a3aeSmrg	case $cc_basename in
44894cd6a3aeSmrg	  CC*)
44904cd6a3aeSmrg	    # Sun C++ 4.x
44914cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
44924cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44934cd6a3aeSmrg	    ;;
44944cd6a3aeSmrg	  lcc*)
44954cd6a3aeSmrg	    # Lucid
44964cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
44974cd6a3aeSmrg	    ;;
44984cd6a3aeSmrg	  *)
44994cd6a3aeSmrg	    ;;
45004cd6a3aeSmrg	esac
45014cd6a3aeSmrg	;;
45024cd6a3aeSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
45034cd6a3aeSmrg	case $cc_basename in
45044cd6a3aeSmrg	  CC*)
45054cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
45064cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
45074cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
45084cd6a3aeSmrg	    ;;
45094cd6a3aeSmrg	esac
45104cd6a3aeSmrg	;;
45114cd6a3aeSmrg      tandem*)
45124cd6a3aeSmrg	case $cc_basename in
45134cd6a3aeSmrg	  NCC*)
45144cd6a3aeSmrg	    # NonStop-UX NCC 3.20
45154cd6a3aeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
45164cd6a3aeSmrg	    ;;
45174cd6a3aeSmrg	  *)
45184cd6a3aeSmrg	    ;;
45194cd6a3aeSmrg	esac
45204cd6a3aeSmrg	;;
45214cd6a3aeSmrg      vxworks*)
45228c9fbc29Smrg	;;
45238c9fbc29Smrg      *)
45244cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
45258c9fbc29Smrg	;;
45268c9fbc29Smrg    esac
45274cd6a3aeSmrg  fi
45284cd6a3aeSmrg],
45294cd6a3aeSmrg[
453054044362Smrg  if test yes = "$GCC"; then
45314cd6a3aeSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
45324cd6a3aeSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
45334cd6a3aeSmrg
45344cd6a3aeSmrg    case $host_os in
45354cd6a3aeSmrg      aix*)
45364cd6a3aeSmrg      # All AIX code is PIC.
453754044362Smrg      if test ia64 = "$host_cpu"; then
45384cd6a3aeSmrg	# AIX 5 now supports IA64 processor
45394cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
45404e411241Smrg      fi
454154044362Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
45424cd6a3aeSmrg      ;;
45434cd6a3aeSmrg
45444cd6a3aeSmrg    amigaos*)
45454cd6a3aeSmrg      case $host_cpu in
45464cd6a3aeSmrg      powerpc)
45474cd6a3aeSmrg            # see comment about AmigaOS4 .so support
45484cd6a3aeSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
45494cd6a3aeSmrg        ;;
45504cd6a3aeSmrg      m68k)
45514cd6a3aeSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
455254044362Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
455354044362Smrg            # like '-m68040'.
45544cd6a3aeSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
45554cd6a3aeSmrg        ;;
45564cd6a3aeSmrg      esac
45574cd6a3aeSmrg      ;;
45588c9fbc29Smrg
45594cd6a3aeSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
45604cd6a3aeSmrg      # PIC is the default for these OSes.
45614cd6a3aeSmrg      ;;
45624cd6a3aeSmrg
45634cd6a3aeSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
45644cd6a3aeSmrg      # This hack is so that the source file can tell whether it is being
45654cd6a3aeSmrg      # built for inclusion in a dll (and should export symbols for example).
45664cd6a3aeSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
45674cd6a3aeSmrg      # (--disable-auto-import) libraries
45684cd6a3aeSmrg      m4_if([$1], [GCJ], [],
45694cd6a3aeSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
457054044362Smrg      case $host_os in
457154044362Smrg      os2*)
457254044362Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
457354044362Smrg	;;
457454044362Smrg      esac
45754cd6a3aeSmrg      ;;
45768c9fbc29Smrg
45774cd6a3aeSmrg    darwin* | rhapsody*)
45784cd6a3aeSmrg      # PIC is the default on this platform
45794cd6a3aeSmrg      # Common symbols not allowed in MH_DYLIB files
45804cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
45814cd6a3aeSmrg      ;;
45828c9fbc29Smrg
45834cd6a3aeSmrg    haiku*)
45844cd6a3aeSmrg      # PIC is the default for Haiku.
45854cd6a3aeSmrg      # The "-static" flag exists, but is broken.
45864cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
45874cd6a3aeSmrg      ;;
45888c9fbc29Smrg
45894cd6a3aeSmrg    hpux*)
45904cd6a3aeSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
45914cd6a3aeSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
45924cd6a3aeSmrg      # sets the default TLS model and affects inlining.
45934cd6a3aeSmrg      case $host_cpu in
45944cd6a3aeSmrg      hppa*64*)
45954cd6a3aeSmrg	# +Z the default
45968c9fbc29Smrg	;;
45978c9fbc29Smrg      *)
45984cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
45994cd6a3aeSmrg	;;
46004cd6a3aeSmrg      esac
46014cd6a3aeSmrg      ;;
46024cd6a3aeSmrg
46034cd6a3aeSmrg    interix[[3-9]]*)
46044cd6a3aeSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
46054cd6a3aeSmrg      # Instead, we relocate shared libraries at runtime.
46064cd6a3aeSmrg      ;;
46078c9fbc29Smrg
46084cd6a3aeSmrg    msdosdjgpp*)
46094cd6a3aeSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
46104cd6a3aeSmrg      # on systems that don't support them.
46114cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
46124cd6a3aeSmrg      enable_shared=no
46134cd6a3aeSmrg      ;;
46148c9fbc29Smrg
46154cd6a3aeSmrg    *nto* | *qnx*)
46164cd6a3aeSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
46174cd6a3aeSmrg      # it will coredump.
46184cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
46194cd6a3aeSmrg      ;;
46208c9fbc29Smrg
46214cd6a3aeSmrg    sysv4*MP*)
46224cd6a3aeSmrg      if test -d /usr/nec; then
46234cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
46244cd6a3aeSmrg      fi
46254cd6a3aeSmrg      ;;
46264cd6a3aeSmrg
46274cd6a3aeSmrg    *)
46284cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
46294cd6a3aeSmrg      ;;
46308c9fbc29Smrg    esac
46318c9fbc29Smrg
46324cd6a3aeSmrg    case $cc_basename in
46334cd6a3aeSmrg    nvcc*) # Cuda Compiler Driver 2.2
46344cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
463570728a38Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
463670728a38Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
463770728a38Smrg      fi
46384cd6a3aeSmrg      ;;
46394cd6a3aeSmrg    esac
46404cd6a3aeSmrg  else
46414cd6a3aeSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
46424cd6a3aeSmrg    case $host_os in
46434cd6a3aeSmrg    aix*)
46444cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
464554044362Smrg      if test ia64 = "$host_cpu"; then
46464cd6a3aeSmrg	# AIX 5 now supports IA64 processor
46474cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
46484cd6a3aeSmrg      else
46494cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
46504cd6a3aeSmrg      fi
46514cd6a3aeSmrg      ;;
46528c9fbc29Smrg
465354044362Smrg    darwin* | rhapsody*)
465454044362Smrg      # PIC is the default on this platform
465554044362Smrg      # Common symbols not allowed in MH_DYLIB files
465654044362Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
465754044362Smrg      case $cc_basename in
465854044362Smrg      nagfor*)
465954044362Smrg        # NAG Fortran compiler
466054044362Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
466154044362Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
466254044362Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
466354044362Smrg        ;;
466454044362Smrg      esac
466554044362Smrg      ;;
466654044362Smrg
46674cd6a3aeSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
46684cd6a3aeSmrg      # This hack is so that the source file can tell whether it is being
46694cd6a3aeSmrg      # built for inclusion in a dll (and should export symbols for example).
46704cd6a3aeSmrg      m4_if([$1], [GCJ], [],
46714cd6a3aeSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
467254044362Smrg      case $host_os in
467354044362Smrg      os2*)
467454044362Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
467554044362Smrg	;;
467654044362Smrg      esac
46774cd6a3aeSmrg      ;;
46788c9fbc29Smrg
46794cd6a3aeSmrg    hpux9* | hpux10* | hpux11*)
46804cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
46814cd6a3aeSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
46824cd6a3aeSmrg      # not for PA HP-UX.
46834cd6a3aeSmrg      case $host_cpu in
46844cd6a3aeSmrg      hppa*64*|ia64*)
46854cd6a3aeSmrg	# +Z the default
46868c9fbc29Smrg	;;
46878c9fbc29Smrg      *)
46884cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
46894cd6a3aeSmrg	;;
46904cd6a3aeSmrg      esac
46914cd6a3aeSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
469254044362Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
46934cd6a3aeSmrg      ;;
46948c9fbc29Smrg
46954cd6a3aeSmrg    irix5* | irix6* | nonstopux*)
46964cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
46974cd6a3aeSmrg      # PIC (with -KPIC) is the default.
46984cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
46994cd6a3aeSmrg      ;;
47008c9fbc29Smrg
470154044362Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
47024cd6a3aeSmrg      case $cc_basename in
470354044362Smrg      # old Intel for x86_64, which still supported -KPIC.
47044cd6a3aeSmrg      ecc*)
47054cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47064cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47074cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
47084cd6a3aeSmrg        ;;
47094cd6a3aeSmrg      # icc used to be incompatible with GCC.
47104cd6a3aeSmrg      # ICC 10 doesn't accept -KPIC any more.
47114cd6a3aeSmrg      icc* | ifort*)
47124cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47134cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
47144cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
47154cd6a3aeSmrg        ;;
47164cd6a3aeSmrg      # Lahey Fortran 8.1.
47174cd6a3aeSmrg      lf95*)
47184cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47194cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
47204cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
47218c9fbc29Smrg	;;
47224cd6a3aeSmrg      nagfor*)
47234cd6a3aeSmrg	# NAG Fortran compiler
47244cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
47254cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
47264cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47278c9fbc29Smrg	;;
472854044362Smrg      tcc*)
472954044362Smrg	# Fabrice Bellard et al's Tiny C Compiler
473054044362Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
473154044362Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
473254044362Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
473354044362Smrg	;;
47344cd6a3aeSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
47354cd6a3aeSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
47364cd6a3aeSmrg	# which looks to be a dead project)
47374cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47384cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
47394cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47404cd6a3aeSmrg        ;;
47414cd6a3aeSmrg      ccc*)
47424cd6a3aeSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47434cd6a3aeSmrg        # All Alpha code is PIC.
47444cd6a3aeSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
47454cd6a3aeSmrg        ;;
47464cd6a3aeSmrg      xl* | bgxl* | bgf* | mpixl*)
47474cd6a3aeSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
47484cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47494cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
47504cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
47518c9fbc29Smrg	;;
47528c9fbc29Smrg      *)
47534cd6a3aeSmrg	case `$CC -V 2>&1 | sed 5q` in
475470728a38Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
47554cd6a3aeSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
47564cd6a3aeSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47574cd6a3aeSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47584cd6a3aeSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
47594cd6a3aeSmrg	  ;;
476070728a38Smrg	*Sun\ F* | *Sun*Fortran*)
476170728a38Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
476270728a38Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
476370728a38Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
476470728a38Smrg	  ;;
47654cd6a3aeSmrg	*Sun\ C*)
47664cd6a3aeSmrg	  # Sun C 5.9
47674cd6a3aeSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47684cd6a3aeSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47694cd6a3aeSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47704cd6a3aeSmrg	  ;;
477170728a38Smrg        *Intel*\ [[CF]]*Compiler*)
477270728a38Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
477370728a38Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
477470728a38Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
477570728a38Smrg	  ;;
477670728a38Smrg	*Portland\ Group*)
477770728a38Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
477870728a38Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
477970728a38Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
478070728a38Smrg	  ;;
47818c9fbc29Smrg	esac
47824cd6a3aeSmrg	;;
47834cd6a3aeSmrg      esac
47844cd6a3aeSmrg      ;;
47854cd6a3aeSmrg
47864cd6a3aeSmrg    newsos6)
47874cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47884cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47894cd6a3aeSmrg      ;;
47908c9fbc29Smrg
47914cd6a3aeSmrg    *nto* | *qnx*)
47924cd6a3aeSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
47934cd6a3aeSmrg      # it will coredump.
47944cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
47954cd6a3aeSmrg      ;;
47968c9fbc29Smrg
47974cd6a3aeSmrg    osf3* | osf4* | osf5*)
47984cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47994cd6a3aeSmrg      # All OSF/1 code is PIC.
48004cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
48014cd6a3aeSmrg      ;;
48028c9fbc29Smrg
48034cd6a3aeSmrg    rdos*)
48044cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
48054cd6a3aeSmrg      ;;
48064cd6a3aeSmrg
48074cd6a3aeSmrg    solaris*)
48084cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
48094cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48104cd6a3aeSmrg      case $cc_basename in
48114cd6a3aeSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
48124cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
48138c9fbc29Smrg      *)
48144cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
48154cd6a3aeSmrg      esac
48164cd6a3aeSmrg      ;;
48178c9fbc29Smrg
48184cd6a3aeSmrg    sunos4*)
48194cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
48204cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
48214cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48224cd6a3aeSmrg      ;;
48238c9fbc29Smrg
48244cd6a3aeSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
48254cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
48264cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
48274cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48284cd6a3aeSmrg      ;;
48298c9fbc29Smrg
48304cd6a3aeSmrg    sysv4*MP*)
483154044362Smrg      if test -d /usr/nec; then
48324cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
48334cd6a3aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48344cd6a3aeSmrg      fi
48354cd6a3aeSmrg      ;;
48368c9fbc29Smrg
48374cd6a3aeSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
48384cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
48394cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
48404cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48414cd6a3aeSmrg      ;;
48428c9fbc29Smrg
48434cd6a3aeSmrg    unicos*)
48444cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
48454cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
48464cd6a3aeSmrg      ;;
48474cd6a3aeSmrg
48484cd6a3aeSmrg    uts4*)
48494cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
48504cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48514cd6a3aeSmrg      ;;
48524cd6a3aeSmrg
48534cd6a3aeSmrg    *)
48544cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
48554cd6a3aeSmrg      ;;
48568c9fbc29Smrg    esac
48574cd6a3aeSmrg  fi
48584cd6a3aeSmrg])
48594cd6a3aeSmrgcase $host_os in
486054044362Smrg  # For platforms that do not support PIC, -DPIC is meaningless:
48614cd6a3aeSmrg  *djgpp*)
48624cd6a3aeSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
48638c9fbc29Smrg    ;;
48648c9fbc29Smrg  *)
48654cd6a3aeSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
48668c9fbc29Smrg    ;;
48678c9fbc29Smrgesac
48688c9fbc29Smrg
48694cd6a3aeSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
48704cd6a3aeSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
48714cd6a3aeSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
48724cd6a3aeSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
48738c9fbc29Smrg
48744cd6a3aeSmrg#
48754cd6a3aeSmrg# Check to make sure the PIC flag actually works.
48764cd6a3aeSmrg#
48774cd6a3aeSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
48784cd6a3aeSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
48794cd6a3aeSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
48804cd6a3aeSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
48814cd6a3aeSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
48824cd6a3aeSmrg     "" | " "*) ;;
48834cd6a3aeSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
48844cd6a3aeSmrg     esac],
48854cd6a3aeSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
48864cd6a3aeSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
48874cd6a3aeSmrgfi
48884cd6a3aeSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
48894cd6a3aeSmrg	[Additional compiler flags for building library objects])
48908c9fbc29Smrg
48914cd6a3aeSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
48924cd6a3aeSmrg	[How to pass a linker flag through the compiler])
48934cd6a3aeSmrg#
48944cd6a3aeSmrg# Check to make sure the static flag actually works.
48954cd6a3aeSmrg#
48964cd6a3aeSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
48974cd6a3aeSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
48984cd6a3aeSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
48994cd6a3aeSmrg  $lt_tmp_static_flag,
49004cd6a3aeSmrg  [],
49014cd6a3aeSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
49024cd6a3aeSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
49034cd6a3aeSmrg	[Compiler flag to prevent dynamic linking])
49044cd6a3aeSmrg])# _LT_COMPILER_PIC
49058c9fbc29Smrg
49068c9fbc29Smrg
49074cd6a3aeSmrg# _LT_LINKER_SHLIBS([TAGNAME])
49084cd6a3aeSmrg# ----------------------------
49094cd6a3aeSmrg# See if the linker supports building shared libraries.
49104cd6a3aeSmrgm4_defun([_LT_LINKER_SHLIBS],
49114cd6a3aeSmrg[AC_REQUIRE([LT_PATH_LD])dnl
49124cd6a3aeSmrgAC_REQUIRE([LT_PATH_NM])dnl
49134cd6a3aeSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
49144cd6a3aeSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
49154cd6a3aeSmrgm4_require([_LT_DECL_EGREP])dnl
49164cd6a3aeSmrgm4_require([_LT_DECL_SED])dnl
49174cd6a3aeSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
49184cd6a3aeSmrgm4_require([_LT_TAG_COMPILER])dnl
49194cd6a3aeSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
49204cd6a3aeSmrgm4_if([$1], [CXX], [
49214cd6a3aeSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
49224cd6a3aeSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
49234cd6a3aeSmrg  case $host_os in
49244cd6a3aeSmrg  aix[[4-9]]*)
49254cd6a3aeSmrg    # If we're using GNU nm, then we don't want the "-C" option.
492654044362Smrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
492754044362Smrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
492854044362Smrg    # weak defined symbols like other global defined symbols, whereas
492954044362Smrg    # GNU nm marks them as "W".
493054044362Smrg    # While the 'weak' keyword is ignored in the Export File, we need
493154044362Smrg    # it in the Import File for the 'aix-soname' feature, so we have
493254044362Smrg    # to replace the "-B" option with "-P" for AIX nm.
49334cd6a3aeSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
493454044362Smrg      _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'
49354cd6a3aeSmrg    else
493654044362Smrg      _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'
49374e411241Smrg    fi
49384e411241Smrg    ;;
49394cd6a3aeSmrg  pw32*)
494054044362Smrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
49414cd6a3aeSmrg    ;;
49424cd6a3aeSmrg  cygwin* | mingw* | cegcc*)
49434cd6a3aeSmrg    case $cc_basename in
494470728a38Smrg    cl*)
494570728a38Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
494670728a38Smrg      ;;
49474cd6a3aeSmrg    *)
49484cd6a3aeSmrg      _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'
49494cd6a3aeSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
49504e411241Smrg      ;;
49514e411241Smrg    esac
49524cd6a3aeSmrg    ;;
49534cd6a3aeSmrg  *)
49544cd6a3aeSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
49554cd6a3aeSmrg    ;;
49564cd6a3aeSmrg  esac
49574cd6a3aeSmrg], [
49584cd6a3aeSmrg  runpath_var=
49594cd6a3aeSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
49604cd6a3aeSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
49614cd6a3aeSmrg  _LT_TAGVAR(archive_cmds, $1)=
49624cd6a3aeSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
49634cd6a3aeSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
49644cd6a3aeSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
49654cd6a3aeSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
49664cd6a3aeSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
49674cd6a3aeSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
49684cd6a3aeSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
49694cd6a3aeSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
49704cd6a3aeSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
49714cd6a3aeSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
49724cd6a3aeSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
49734cd6a3aeSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
49744cd6a3aeSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
49754cd6a3aeSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
49764cd6a3aeSmrg  _LT_TAGVAR(module_cmds, $1)=
49774cd6a3aeSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
49784cd6a3aeSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
49794cd6a3aeSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
49804cd6a3aeSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
49814cd6a3aeSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
49824cd6a3aeSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
49834cd6a3aeSmrg  # included in the symbol list
49844cd6a3aeSmrg  _LT_TAGVAR(include_expsyms, $1)=
49854cd6a3aeSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
498654044362Smrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
498754044362Smrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
498854044362Smrg  # as well as any symbol that contains 'd'.
49894cd6a3aeSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
49904cd6a3aeSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
49914cd6a3aeSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
49924cd6a3aeSmrg  # the symbol is explicitly referenced.  Since portable code cannot
49934cd6a3aeSmrg  # rely on this symbol name, it's probably fine to never include it in
49944cd6a3aeSmrg  # preloaded symbol tables.
49954cd6a3aeSmrg  # Exclude shared library initialization/finalization symbols.
49964cd6a3aeSmrgdnl Note also adjust exclude_expsyms for C++ above.
49974cd6a3aeSmrg  extract_expsyms_cmds=
49984e411241Smrg
49994cd6a3aeSmrg  case $host_os in
50004cd6a3aeSmrg  cygwin* | mingw* | pw32* | cegcc*)
50014cd6a3aeSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
50024cd6a3aeSmrg    # When not using gcc, we currently assume that we are using
50034cd6a3aeSmrg    # Microsoft Visual C++.
500454044362Smrg    if test yes != "$GCC"; then
50054cd6a3aeSmrg      with_gnu_ld=no
50064e411241Smrg    fi
50078c9fbc29Smrg    ;;
50084cd6a3aeSmrg  interix*)
50094cd6a3aeSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
50104cd6a3aeSmrg    with_gnu_ld=yes
50114cd6a3aeSmrg    ;;
501254044362Smrg  openbsd* | bitrig*)
50134cd6a3aeSmrg    with_gnu_ld=no
50144cd6a3aeSmrg    ;;
50158c9fbc29Smrg  esac
50168c9fbc29Smrg
50174cd6a3aeSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
50188c9fbc29Smrg
50194cd6a3aeSmrg  # On some targets, GNU ld is compatible enough with the native linker
50204cd6a3aeSmrg  # that we're better off using the native interface for both.
50214cd6a3aeSmrg  lt_use_gnu_ld_interface=no
502254044362Smrg  if test yes = "$with_gnu_ld"; then
50234cd6a3aeSmrg    case $host_os in
50244cd6a3aeSmrg      aix*)
50254cd6a3aeSmrg	# The AIX port of GNU ld has always aspired to compatibility
50264cd6a3aeSmrg	# with the native linker.  However, as the warning in the GNU ld
50274cd6a3aeSmrg	# block says, versions before 2.19.5* couldn't really create working
50284cd6a3aeSmrg	# shared libraries, regardless of the interface used.
50294cd6a3aeSmrg	case `$LD -v 2>&1` in
50304cd6a3aeSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
50314cd6a3aeSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
50324cd6a3aeSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
50334cd6a3aeSmrg	  *)
50344cd6a3aeSmrg	    lt_use_gnu_ld_interface=yes
50354cd6a3aeSmrg	    ;;
50364cd6a3aeSmrg	esac
50374cd6a3aeSmrg	;;
50384cd6a3aeSmrg      *)
50394cd6a3aeSmrg	lt_use_gnu_ld_interface=yes
50404cd6a3aeSmrg	;;
50414cd6a3aeSmrg    esac
50424cd6a3aeSmrg  fi
50438c9fbc29Smrg
504454044362Smrg  if test yes = "$lt_use_gnu_ld_interface"; then
50454cd6a3aeSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
504654044362Smrg    wlarc='$wl'
50478c9fbc29Smrg
50484cd6a3aeSmrg    # Set some defaults for GNU ld with shared library support. These
50494cd6a3aeSmrg    # are reset later if shared libraries are not supported. Putting them
50504cd6a3aeSmrg    # here allows them to be overridden if necessary.
50514cd6a3aeSmrg    runpath_var=LD_RUN_PATH
505254044362Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
505354044362Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
50544cd6a3aeSmrg    # ancient GNU ld didn't support --whole-archive et. al.
50554cd6a3aeSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
505654044362Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
50574cd6a3aeSmrg    else
50584cd6a3aeSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
50594cd6a3aeSmrg    fi
50604cd6a3aeSmrg    supports_anon_versioning=no
506154044362Smrg    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
50624cd6a3aeSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
50634cd6a3aeSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
50644cd6a3aeSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
50654cd6a3aeSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
50664cd6a3aeSmrg      *\ 2.11.*) ;; # other 2.11 versions
50674cd6a3aeSmrg      *) supports_anon_versioning=yes ;;
50684cd6a3aeSmrg    esac
50698c9fbc29Smrg
50704cd6a3aeSmrg    # See if GNU ld supports shared libraries.
50714cd6a3aeSmrg    case $host_os in
50724cd6a3aeSmrg    aix[[3-9]]*)
50734cd6a3aeSmrg      # On AIX/PPC, the GNU linker is very broken
507454044362Smrg      if test ia64 != "$host_cpu"; then
50754cd6a3aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
50764cd6a3aeSmrg	cat <<_LT_EOF 1>&2
50778c9fbc29Smrg
50784cd6a3aeSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
50794cd6a3aeSmrg*** to be unable to reliably create shared libraries on AIX.
50804cd6a3aeSmrg*** Therefore, libtool is disabling shared libraries support.  If you
50814cd6a3aeSmrg*** really care for shared libraries, you may want to install binutils
50824cd6a3aeSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
50834cd6a3aeSmrg*** You will then need to restart the configuration process.
50848c9fbc29Smrg
50854cd6a3aeSmrg_LT_EOF
50864cd6a3aeSmrg      fi
50874cd6a3aeSmrg      ;;
50888c9fbc29Smrg
50894cd6a3aeSmrg    amigaos*)
50904cd6a3aeSmrg      case $host_cpu in
50914cd6a3aeSmrg      powerpc)
50924cd6a3aeSmrg            # see comment about AmigaOS4 .so support
509354044362Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
50944cd6a3aeSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
50954cd6a3aeSmrg        ;;
50964cd6a3aeSmrg      m68k)
50974cd6a3aeSmrg            _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)'
50984cd6a3aeSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
50994cd6a3aeSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
51004cd6a3aeSmrg        ;;
51014cd6a3aeSmrg      esac
51024cd6a3aeSmrg      ;;
51038c9fbc29Smrg
51044cd6a3aeSmrg    beos*)
51054cd6a3aeSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
51064cd6a3aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51074cd6a3aeSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
51084cd6a3aeSmrg	# support --undefined.  This deserves some investigation.  FIXME
510954044362Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
51104cd6a3aeSmrg      else
51114cd6a3aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
51124cd6a3aeSmrg      fi
51134cd6a3aeSmrg      ;;
51148c9fbc29Smrg
51154cd6a3aeSmrg    cygwin* | mingw* | pw32* | cegcc*)
51164cd6a3aeSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
51174cd6a3aeSmrg      # as there is no search path for DLLs.
51184cd6a3aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
511954044362Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
51204cd6a3aeSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51214cd6a3aeSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
51224cd6a3aeSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
51234cd6a3aeSmrg      _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'
51244cd6a3aeSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
51254cd6a3aeSmrg
51264cd6a3aeSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
512754044362Smrg        _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'
512854044362Smrg	# If the export-symbols file already is a .def file, use it as
512954044362Smrg	# is; otherwise, prepend EXPORTS...
513054044362Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
513154044362Smrg          cp $export_symbols $output_objdir/$soname.def;
513254044362Smrg        else
513354044362Smrg          echo EXPORTS > $output_objdir/$soname.def;
513454044362Smrg          cat $export_symbols >> $output_objdir/$soname.def;
513554044362Smrg        fi~
513654044362Smrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
51374cd6a3aeSmrg      else
51384cd6a3aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
51394cd6a3aeSmrg      fi
51404cd6a3aeSmrg      ;;
51418c9fbc29Smrg
51424cd6a3aeSmrg    haiku*)
514354044362Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
51444cd6a3aeSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
51454cd6a3aeSmrg      ;;
51468c9fbc29Smrg
514754044362Smrg    os2*)
514854044362Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
514954044362Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
515054044362Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
515154044362Smrg      shrext_cmds=.dll
515254044362Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
515354044362Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
515454044362Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
515554044362Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
515654044362Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
515754044362Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
515854044362Smrg	emximp -o $lib $output_objdir/$libname.def'
515954044362Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
516054044362Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
516154044362Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
516254044362Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
516354044362Smrg	prefix_cmds="$SED"~
516454044362Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
516554044362Smrg	  prefix_cmds="$prefix_cmds -e 1d";
516654044362Smrg	fi~
516754044362Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
516854044362Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
516954044362Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
517054044362Smrg	emximp -o $lib $output_objdir/$libname.def'
517154044362Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
517254044362Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
517354044362Smrg      ;;
517454044362Smrg
51754cd6a3aeSmrg    interix[[3-9]]*)
51764cd6a3aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
51774cd6a3aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
517854044362Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
517954044362Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
51804cd6a3aeSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
51814cd6a3aeSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
51824cd6a3aeSmrg      # default) and relocated if they conflict, which is a slow very memory
51834cd6a3aeSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
51844cd6a3aeSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
51854cd6a3aeSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
518654044362Smrg      _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'
518754044362Smrg      _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'
51884cd6a3aeSmrg      ;;
51898c9fbc29Smrg
51904cd6a3aeSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
51914cd6a3aeSmrg      tmp_diet=no
519254044362Smrg      if test linux-dietlibc = "$host_os"; then
51934cd6a3aeSmrg	case $cc_basename in
51944cd6a3aeSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
51954cd6a3aeSmrg	esac
51964cd6a3aeSmrg      fi
51974cd6a3aeSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
519854044362Smrg	 && test no = "$tmp_diet"
51994cd6a3aeSmrg      then
52004cd6a3aeSmrg	tmp_addflag=' $pic_flag'
52014cd6a3aeSmrg	tmp_sharedflag='-shared'
52024cd6a3aeSmrg	case $cc_basename,$host_cpu in
52034cd6a3aeSmrg        pgcc*)				# Portland Group C compiler
520454044362Smrg	  _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'
52054cd6a3aeSmrg	  tmp_addflag=' $pic_flag'
52064cd6a3aeSmrg	  ;;
52074cd6a3aeSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
52084cd6a3aeSmrg					# Portland Group f77 and f90 compilers
520954044362Smrg	  _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'
52104cd6a3aeSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
52114cd6a3aeSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
52124cd6a3aeSmrg	  tmp_addflag=' -i_dynamic' ;;
52134cd6a3aeSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
52144cd6a3aeSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
52154cd6a3aeSmrg	ifc* | ifort*)			# Intel Fortran compiler
52164cd6a3aeSmrg	  tmp_addflag=' -nofor_main' ;;
52174cd6a3aeSmrg	lf95*)				# Lahey Fortran 8.1
52184cd6a3aeSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
52194cd6a3aeSmrg	  tmp_sharedflag='--shared' ;;
522054044362Smrg        nagfor*)                        # NAGFOR 5.3
522154044362Smrg          tmp_sharedflag='-Wl,-shared' ;;
52224cd6a3aeSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
52234cd6a3aeSmrg	  tmp_sharedflag='-qmkshrobj'
52244cd6a3aeSmrg	  tmp_addflag= ;;
52254cd6a3aeSmrg	nvcc*)	# Cuda Compiler Driver 2.2
522654044362Smrg	  _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'
52274cd6a3aeSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
52284cd6a3aeSmrg	  ;;
52294cd6a3aeSmrg	esac
52304cd6a3aeSmrg	case `$CC -V 2>&1 | sed 5q` in
52314cd6a3aeSmrg	*Sun\ C*)			# Sun C 5.9
523254044362Smrg	  _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'
52334cd6a3aeSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
52344cd6a3aeSmrg	  tmp_sharedflag='-G' ;;
52354cd6a3aeSmrg	*Sun\ F*)			# Sun Fortran 8.3
52364cd6a3aeSmrg	  tmp_sharedflag='-G' ;;
52374cd6a3aeSmrg	esac
523854044362Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
52398c9fbc29Smrg
524054044362Smrg        if test yes = "$supports_anon_versioning"; then
52414cd6a3aeSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
524254044362Smrg            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
524354044362Smrg            echo "local: *; };" >> $output_objdir/$libname.ver~
524454044362Smrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
52454cd6a3aeSmrg        fi
52468c9fbc29Smrg
52474cd6a3aeSmrg	case $cc_basename in
524854044362Smrg	tcc*)
524954044362Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
525054044362Smrg	  ;;
52514cd6a3aeSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
52524cd6a3aeSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
52534cd6a3aeSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
525454044362Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
52554cd6a3aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
525654044362Smrg	  if test yes = "$supports_anon_versioning"; then
52574cd6a3aeSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
525854044362Smrg              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
525954044362Smrg              echo "local: *; };" >> $output_objdir/$libname.ver~
526054044362Smrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
52614cd6a3aeSmrg	  fi
52624cd6a3aeSmrg	  ;;
52634cd6a3aeSmrg	esac
52644cd6a3aeSmrg      else
52654cd6a3aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
52664cd6a3aeSmrg      fi
52674cd6a3aeSmrg      ;;
52688c9fbc29Smrg
52694cd6a3aeSmrg    netbsd*)
52704cd6a3aeSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
52714cd6a3aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
52724cd6a3aeSmrg	wlarc=
52734cd6a3aeSmrg      else
527454044362Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
527554044362Smrg	_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'
52764cd6a3aeSmrg      fi
52774cd6a3aeSmrg      ;;
52788c9fbc29Smrg
52794cd6a3aeSmrg    solaris*)
52804cd6a3aeSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
52814cd6a3aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
52824cd6a3aeSmrg	cat <<_LT_EOF 1>&2
52838c9fbc29Smrg
52844cd6a3aeSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
52854cd6a3aeSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
52864cd6a3aeSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
52874cd6a3aeSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
52884cd6a3aeSmrg*** your PATH or compiler configuration so that the native linker is
52894cd6a3aeSmrg*** used, and then restart.
52908c9fbc29Smrg
52914cd6a3aeSmrg_LT_EOF
52924cd6a3aeSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
529354044362Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
529454044362Smrg	_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'
52954cd6a3aeSmrg      else
52964cd6a3aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
52974cd6a3aeSmrg      fi
52984cd6a3aeSmrg      ;;
52998c9fbc29Smrg
53004cd6a3aeSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
53014cd6a3aeSmrg      case `$LD -v 2>&1` in
53024cd6a3aeSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
53034cd6a3aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
53044cd6a3aeSmrg	cat <<_LT_EOF 1>&2
53058c9fbc29Smrg
530654044362Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
53074cd6a3aeSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
53084cd6a3aeSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
53094cd6a3aeSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
53104cd6a3aeSmrg*** your PATH or compiler configuration so that the native linker is
53114cd6a3aeSmrg*** used, and then restart.
53128c9fbc29Smrg
53134cd6a3aeSmrg_LT_EOF
53144cd6a3aeSmrg	;;
53154cd6a3aeSmrg	*)
53164cd6a3aeSmrg	  # For security reasons, it is highly recommended that you always
53174cd6a3aeSmrg	  # use absolute paths for naming shared libraries, and exclude the
53184cd6a3aeSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
53194cd6a3aeSmrg	  # requires that you compile everything twice, which is a pain.
53204cd6a3aeSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
532154044362Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
532254044362Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
532354044362Smrg	    _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'
53244cd6a3aeSmrg	  else
53254cd6a3aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
53264cd6a3aeSmrg	  fi
53274cd6a3aeSmrg	;;
53284cd6a3aeSmrg      esac
53294cd6a3aeSmrg      ;;
53308c9fbc29Smrg
53314cd6a3aeSmrg    sunos4*)
53324cd6a3aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
53334cd6a3aeSmrg      wlarc=
53344cd6a3aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
53354cd6a3aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53364cd6a3aeSmrg      ;;
53378c9fbc29Smrg
53384cd6a3aeSmrg    *)
53394cd6a3aeSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
534054044362Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
534154044362Smrg	_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'
53424cd6a3aeSmrg      else
53434cd6a3aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
53444cd6a3aeSmrg      fi
53454cd6a3aeSmrg      ;;
53464cd6a3aeSmrg    esac
53478c9fbc29Smrg
534854044362Smrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
53494cd6a3aeSmrg      runpath_var=
53504cd6a3aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
53514cd6a3aeSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
53524cd6a3aeSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
53534cd6a3aeSmrg    fi
53544cd6a3aeSmrg  else
53554cd6a3aeSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
53564cd6a3aeSmrg    case $host_os in
53574cd6a3aeSmrg    aix3*)
53584cd6a3aeSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
53594cd6a3aeSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
53604cd6a3aeSmrg      _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'
53614cd6a3aeSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
53624cd6a3aeSmrg      # are no directories specified by -L.
53634cd6a3aeSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
536454044362Smrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
53654cd6a3aeSmrg	# Neither direct hardcoding nor static linking is supported with a
53664cd6a3aeSmrg	# broken collect2.
53674cd6a3aeSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
53684cd6a3aeSmrg      fi
53694cd6a3aeSmrg      ;;
53708c9fbc29Smrg
53714cd6a3aeSmrg    aix[[4-9]]*)
537254044362Smrg      if test ia64 = "$host_cpu"; then
53734cd6a3aeSmrg	# On IA64, the linker does run time linking by default, so we don't
53744cd6a3aeSmrg	# have to do anything special.
53754cd6a3aeSmrg	aix_use_runtimelinking=no
53764cd6a3aeSmrg	exp_sym_flag='-Bexport'
537754044362Smrg	no_entry_flag=
53784cd6a3aeSmrg      else
53794cd6a3aeSmrg	# If we're using GNU nm, then we don't want the "-C" option.
538054044362Smrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
538154044362Smrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
538254044362Smrg	# weak defined symbols like other global defined symbols, whereas
538354044362Smrg	# GNU nm marks them as "W".
538454044362Smrg	# While the 'weak' keyword is ignored in the Export File, we need
538554044362Smrg	# it in the Import File for the 'aix-soname' feature, so we have
538654044362Smrg	# to replace the "-B" option with "-P" for AIX nm.
53874cd6a3aeSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
538854044362Smrg	  _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'
53894cd6a3aeSmrg	else
539054044362Smrg	  _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'
53914cd6a3aeSmrg	fi
53924cd6a3aeSmrg	aix_use_runtimelinking=no
53938c9fbc29Smrg
53944cd6a3aeSmrg	# Test if we are trying to use run time linking or normal
53954cd6a3aeSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
539654044362Smrg	# have runtime linking enabled, and use it for executables.
539754044362Smrg	# For shared libraries, we enable/disable runtime linking
539854044362Smrg	# depending on the kind of the shared library created -
539954044362Smrg	# when "with_aix_soname,aix_use_runtimelinking" is:
540054044362Smrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
540154044362Smrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
540254044362Smrg	#            lib.a           static archive
540354044362Smrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
540454044362Smrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
540554044362Smrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
540654044362Smrg	#            lib.a(lib.so.V) shared, rtl:no
540754044362Smrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
540854044362Smrg	#            lib.a           static archive
54094cd6a3aeSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
54104cd6a3aeSmrg	  for ld_flag in $LDFLAGS; do
541154044362Smrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
54124cd6a3aeSmrg	    aix_use_runtimelinking=yes
54134cd6a3aeSmrg	    break
54144cd6a3aeSmrg	  fi
54154cd6a3aeSmrg	  done
541654044362Smrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
541754044362Smrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
541854044362Smrg	    # so we don't have lib.a shared libs to link our executables.
541954044362Smrg	    # We have to force runtime linking in this case.
542054044362Smrg	    aix_use_runtimelinking=yes
542154044362Smrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
542254044362Smrg	  fi
54234cd6a3aeSmrg	  ;;
54244cd6a3aeSmrg	esac
54258c9fbc29Smrg
54264cd6a3aeSmrg	exp_sym_flag='-bexport'
54274cd6a3aeSmrg	no_entry_flag='-bnoentry'
54284cd6a3aeSmrg      fi
54298c9fbc29Smrg
54304cd6a3aeSmrg      # When large executables or shared objects are built, AIX ld can
54314cd6a3aeSmrg      # have problems creating the table of contents.  If linking a library
54324cd6a3aeSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
54334cd6a3aeSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
54344cd6a3aeSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
54358c9fbc29Smrg
54364cd6a3aeSmrg      _LT_TAGVAR(archive_cmds, $1)=''
54374cd6a3aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
54384cd6a3aeSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
54394cd6a3aeSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
54404cd6a3aeSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
544154044362Smrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
544254044362Smrg      case $with_aix_soname,$aix_use_runtimelinking in
544354044362Smrg      aix,*) ;; # traditional, no import file
544454044362Smrg      svr4,* | *,yes) # use import file
544554044362Smrg	# The Import File defines what to hardcode.
544654044362Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
544754044362Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
544854044362Smrg	;;
544954044362Smrg      esac
54508c9fbc29Smrg
545154044362Smrg      if test yes = "$GCC"; then
54524cd6a3aeSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
54534cd6a3aeSmrg	# We only want to do this on AIX 4.2 and lower, the check
54544cd6a3aeSmrg	# below for broken collect2 doesn't work under 4.3+
545554044362Smrg	  collect2name=`$CC -print-prog-name=collect2`
54564cd6a3aeSmrg	  if test -f "$collect2name" &&
54574cd6a3aeSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
54584cd6a3aeSmrg	  then
54594cd6a3aeSmrg	  # We have reworked collect2
54604cd6a3aeSmrg	  :
54614cd6a3aeSmrg	  else
54624cd6a3aeSmrg	  # We have old collect2
54634cd6a3aeSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
54644cd6a3aeSmrg	  # It fails to find uninstalled libraries when the uninstalled
54654cd6a3aeSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
54664cd6a3aeSmrg	  # to unsupported forces relinking
54674cd6a3aeSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
54684cd6a3aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
54694cd6a3aeSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
54704cd6a3aeSmrg	  fi
54714cd6a3aeSmrg	  ;;
54724cd6a3aeSmrg	esac
54734cd6a3aeSmrg	shared_flag='-shared'
547454044362Smrg	if test yes = "$aix_use_runtimelinking"; then
547554044362Smrg	  shared_flag="$shared_flag "'$wl-G'
54764cd6a3aeSmrg	fi
547754044362Smrg	# Need to ensure runtime linking is disabled for the traditional
547854044362Smrg	# shared library, or the linker may eventually find shared libraries
547954044362Smrg	# /with/ Import File - we do not want to mix them.
548054044362Smrg	shared_flag_aix='-shared'
548154044362Smrg	shared_flag_svr4='-shared $wl-G'
54824cd6a3aeSmrg      else
54834cd6a3aeSmrg	# not using gcc
548454044362Smrg	if test ia64 = "$host_cpu"; then
54854cd6a3aeSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
54864cd6a3aeSmrg	# chokes on -Wl,-G. The following line is correct:
54874cd6a3aeSmrg	  shared_flag='-G'
54884cd6a3aeSmrg	else
548954044362Smrg	  if test yes = "$aix_use_runtimelinking"; then
549054044362Smrg	    shared_flag='$wl-G'
54914cd6a3aeSmrg	  else
549254044362Smrg	    shared_flag='$wl-bM:SRE'
54934cd6a3aeSmrg	  fi
549454044362Smrg	  shared_flag_aix='$wl-bM:SRE'
549554044362Smrg	  shared_flag_svr4='$wl-G'
54964cd6a3aeSmrg	fi
54974cd6a3aeSmrg      fi
54988c9fbc29Smrg
549954044362Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
55004cd6a3aeSmrg      # It seems that -bexpall does not export symbols beginning with
55014cd6a3aeSmrg      # underscore (_), so it is better to generate a list of symbols to export.
55024cd6a3aeSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
550354044362Smrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
55044cd6a3aeSmrg	# Warning - without using the other runtime loading flags (-brtl),
55054cd6a3aeSmrg	# -berok will link without error, but may produce a broken library.
55064cd6a3aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
55074cd6a3aeSmrg        # Determine the default libpath from the value encoded in an
55084cd6a3aeSmrg        # empty executable.
55094cd6a3aeSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
551054044362Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
551154044362Smrg        _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
55124cd6a3aeSmrg      else
551354044362Smrg	if test ia64 = "$host_cpu"; then
551454044362Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
55154cd6a3aeSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
551654044362Smrg	  _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"
55174cd6a3aeSmrg	else
55184cd6a3aeSmrg	 # Determine the default libpath from the value encoded in an
55194cd6a3aeSmrg	 # empty executable.
55204cd6a3aeSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
552154044362Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
55224cd6a3aeSmrg	  # Warning - without using the other run time loading flags,
55234cd6a3aeSmrg	  # -berok will link without error, but may produce a broken library.
552454044362Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
552554044362Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
552654044362Smrg	  if test yes = "$with_gnu_ld"; then
55274cd6a3aeSmrg	    # We only use this code for GNU lds that support --whole-archive.
552854044362Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
55294cd6a3aeSmrg	  else
55304cd6a3aeSmrg	    # Exported symbols can be pulled into shared objects from archives
55314cd6a3aeSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
55324cd6a3aeSmrg	  fi
55334cd6a3aeSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
553454044362Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
553554044362Smrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
553654044362Smrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
553754044362Smrg	  if test svr4 != "$with_aix_soname"; then
553854044362Smrg	    # This is similar to how AIX traditionally builds its shared libraries.
553954044362Smrg	    _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'
554054044362Smrg	  fi
554154044362Smrg	  if test aix != "$with_aix_soname"; then
554254044362Smrg	    _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'
554354044362Smrg	  else
554454044362Smrg	    # used by -dlpreopen to get the symbols
554554044362Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
554654044362Smrg	  fi
554754044362Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
55484cd6a3aeSmrg	fi
55494cd6a3aeSmrg      fi
55504cd6a3aeSmrg      ;;
55518c9fbc29Smrg
55524cd6a3aeSmrg    amigaos*)
55534cd6a3aeSmrg      case $host_cpu in
55544cd6a3aeSmrg      powerpc)
55554cd6a3aeSmrg            # see comment about AmigaOS4 .so support
555654044362Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
55574cd6a3aeSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
55584cd6a3aeSmrg        ;;
55594cd6a3aeSmrg      m68k)
55604cd6a3aeSmrg            _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)'
55614cd6a3aeSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
55624cd6a3aeSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
55634cd6a3aeSmrg        ;;
55644cd6a3aeSmrg      esac
55654cd6a3aeSmrg      ;;
55668c9fbc29Smrg
55674cd6a3aeSmrg    bsdi[[45]]*)
55684cd6a3aeSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
55694cd6a3aeSmrg      ;;
55708c9fbc29Smrg
55714cd6a3aeSmrg    cygwin* | mingw* | pw32* | cegcc*)
55724cd6a3aeSmrg      # When not using gcc, we currently assume that we are using
55734cd6a3aeSmrg      # Microsoft Visual C++.
55744cd6a3aeSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
55754cd6a3aeSmrg      # no search path for DLLs.
55764cd6a3aeSmrg      case $cc_basename in
55774cd6a3aeSmrg      cl*)
55784cd6a3aeSmrg	# Native MSVC
55794cd6a3aeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
55804cd6a3aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
55814cd6a3aeSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
55824cd6a3aeSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
55834cd6a3aeSmrg	# Tell ltmain to make .lib files, not .a files.
55844cd6a3aeSmrg	libext=lib
55854cd6a3aeSmrg	# Tell ltmain to make .dll files, not .so files.
558654044362Smrg	shrext_cmds=.dll
55874cd6a3aeSmrg	# FIXME: Setting linknames here is a bad hack.
558854044362Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
558954044362Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
559054044362Smrg            cp "$export_symbols" "$output_objdir/$soname.def";
559154044362Smrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
559254044362Smrg          else
559354044362Smrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
559454044362Smrg          fi~
559554044362Smrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
559654044362Smrg          linknames='
55974cd6a3aeSmrg	# The linker will not automatically build a static lib if we build a DLL.
55984cd6a3aeSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
55994cd6a3aeSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
560070728a38Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
56014cd6a3aeSmrg	_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'
56024cd6a3aeSmrg	# Don't use ranlib
56034cd6a3aeSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
56044cd6a3aeSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
560554044362Smrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
560654044362Smrg          case $lt_outputfile in
560754044362Smrg            *.exe|*.EXE) ;;
560854044362Smrg            *)
560954044362Smrg              lt_outputfile=$lt_outputfile.exe
561054044362Smrg              lt_tool_outputfile=$lt_tool_outputfile.exe
561154044362Smrg              ;;
561254044362Smrg          esac~
561354044362Smrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
561454044362Smrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
561554044362Smrg            $RM "$lt_outputfile.manifest";
561654044362Smrg          fi'
56174cd6a3aeSmrg	;;
56184cd6a3aeSmrg      *)
56194cd6a3aeSmrg	# Assume MSVC wrapper
56204cd6a3aeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
56214cd6a3aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
56224cd6a3aeSmrg	# Tell ltmain to make .lib files, not .a files.
56234cd6a3aeSmrg	libext=lib
56244cd6a3aeSmrg	# Tell ltmain to make .dll files, not .so files.
562554044362Smrg	shrext_cmds=.dll
56264cd6a3aeSmrg	# FIXME: Setting linknames here is a bad hack.
56274cd6a3aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
56284cd6a3aeSmrg	# The linker will automatically build a .lib file if we build a DLL.
56294cd6a3aeSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
56304cd6a3aeSmrg	# FIXME: Should let the user specify the lib program.
56314cd6a3aeSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
56324cd6a3aeSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
56334cd6a3aeSmrg	;;
56344cd6a3aeSmrg      esac
56354cd6a3aeSmrg      ;;
56368c9fbc29Smrg
56374cd6a3aeSmrg    darwin* | rhapsody*)
56384cd6a3aeSmrg      _LT_DARWIN_LINKER_FEATURES($1)
56394cd6a3aeSmrg      ;;
56408c9fbc29Smrg
56414cd6a3aeSmrg    dgux*)
56424cd6a3aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
564370728a38Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
564470728a38Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
56454cd6a3aeSmrg      ;;
56468c9fbc29Smrg
56474cd6a3aeSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
56484cd6a3aeSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
56494cd6a3aeSmrg    # does not break anything, and helps significantly (at the cost of a little
56504cd6a3aeSmrg    # extra space).
56514cd6a3aeSmrg    freebsd2.2*)
56524cd6a3aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
56534cd6a3aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
56544cd6a3aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56554cd6a3aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
56568c9fbc29Smrg      ;;
56574cd6a3aeSmrg
56584cd6a3aeSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
565970728a38Smrg    freebsd2.*)
56604cd6a3aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
56614cd6a3aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56624cd6a3aeSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
56634cd6a3aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
56648c9fbc29Smrg      ;;
56658c9fbc29Smrg
56664cd6a3aeSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
56674cd6a3aeSmrg    freebsd* | dragonfly*)
56684cd6a3aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
56694cd6a3aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
56704cd6a3aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56714cd6a3aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
56724cd6a3aeSmrg      ;;
56738c9fbc29Smrg
56744cd6a3aeSmrg    hpux9*)
567554044362Smrg      if test yes = "$GCC"; then
567654044362Smrg	_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'
56774cd6a3aeSmrg      else
567854044362Smrg	_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'
56794cd6a3aeSmrg      fi
568054044362Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
56814cd6a3aeSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
56824cd6a3aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56838c9fbc29Smrg
56844cd6a3aeSmrg      # hardcode_minus_L: Not really in the search PATH,
56854cd6a3aeSmrg      # but as the default location of the library.
56864cd6a3aeSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
568754044362Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
56884cd6a3aeSmrg      ;;
56898c9fbc29Smrg
56904cd6a3aeSmrg    hpux10*)
569154044362Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
569254044362Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
56934cd6a3aeSmrg      else
56944cd6a3aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
56954cd6a3aeSmrg      fi
569654044362Smrg      if test no = "$with_gnu_ld"; then
569754044362Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
56984cd6a3aeSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
56994cd6a3aeSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
57004cd6a3aeSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
570154044362Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
57024cd6a3aeSmrg	# hardcode_minus_L: Not really in the search PATH,
57034cd6a3aeSmrg	# but as the default location of the library.
57044cd6a3aeSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
57054cd6a3aeSmrg      fi
57064cd6a3aeSmrg      ;;
57078c9fbc29Smrg
57084cd6a3aeSmrg    hpux11*)
570954044362Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
57104cd6a3aeSmrg	case $host_cpu in
57114cd6a3aeSmrg	hppa*64*)
571254044362Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
57134cd6a3aeSmrg	  ;;
57144cd6a3aeSmrg	ia64*)
571554044362Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
57164cd6a3aeSmrg	  ;;
57174cd6a3aeSmrg	*)
571854044362Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
57194cd6a3aeSmrg	  ;;
57204cd6a3aeSmrg	esac
57214cd6a3aeSmrg      else
57224cd6a3aeSmrg	case $host_cpu in
57234cd6a3aeSmrg	hppa*64*)
572454044362Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
57254cd6a3aeSmrg	  ;;
57264cd6a3aeSmrg	ia64*)
572754044362Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
57284cd6a3aeSmrg	  ;;
57294cd6a3aeSmrg	*)
57304cd6a3aeSmrg	m4_if($1, [], [
57314cd6a3aeSmrg	  # Older versions of the 11.00 compiler do not understand -b yet
57324cd6a3aeSmrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
57334cd6a3aeSmrg	  _LT_LINKER_OPTION([if $CC understands -b],
57344cd6a3aeSmrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
573554044362Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
57364cd6a3aeSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
573754044362Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
57384cd6a3aeSmrg	  ;;
57394cd6a3aeSmrg	esac
57404cd6a3aeSmrg      fi
574154044362Smrg      if test no = "$with_gnu_ld"; then
574254044362Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
57434cd6a3aeSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
57448c9fbc29Smrg
57454cd6a3aeSmrg	case $host_cpu in
57464cd6a3aeSmrg	hppa*64*|ia64*)
57474cd6a3aeSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
57484cd6a3aeSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
57494cd6a3aeSmrg	  ;;
57504cd6a3aeSmrg	*)
57514cd6a3aeSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
57524cd6a3aeSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
575354044362Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
57548c9fbc29Smrg
57554cd6a3aeSmrg	  # hardcode_minus_L: Not really in the search PATH,
57564cd6a3aeSmrg	  # but as the default location of the library.
57574cd6a3aeSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
57584cd6a3aeSmrg	  ;;
57594cd6a3aeSmrg	esac
57604cd6a3aeSmrg      fi
57614cd6a3aeSmrg      ;;
57628c9fbc29Smrg
57634cd6a3aeSmrg    irix5* | irix6* | nonstopux*)
576454044362Smrg      if test yes = "$GCC"; then
576554044362Smrg	_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'
57664cd6a3aeSmrg	# Try to use the -exported_symbol ld option, if it does not
57674cd6a3aeSmrg	# work, assume that -exports_file does not work either and
57684cd6a3aeSmrg	# implicitly export all symbols.
57694cd6a3aeSmrg	# This should be the same for all languages, so no per-tag cache variable.
57704cd6a3aeSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
57714cd6a3aeSmrg	  [lt_cv_irix_exported_symbol],
577254044362Smrg	  [save_LDFLAGS=$LDFLAGS
577354044362Smrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
57744cd6a3aeSmrg	   AC_LINK_IFELSE(
57754cd6a3aeSmrg	     [AC_LANG_SOURCE(
57764cd6a3aeSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
57774cd6a3aeSmrg			      [C++], [[int foo (void) { return 0; }]],
57784cd6a3aeSmrg			      [Fortran 77], [[
57794cd6a3aeSmrg      subroutine foo
57804cd6a3aeSmrg      end]],
57814cd6a3aeSmrg			      [Fortran], [[
57824cd6a3aeSmrg      subroutine foo
57834cd6a3aeSmrg      end]])])],
57844cd6a3aeSmrg	      [lt_cv_irix_exported_symbol=yes],
57854cd6a3aeSmrg	      [lt_cv_irix_exported_symbol=no])
578654044362Smrg           LDFLAGS=$save_LDFLAGS])
578754044362Smrg	if test yes = "$lt_cv_irix_exported_symbol"; then
578854044362Smrg          _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'
57894cd6a3aeSmrg	fi
57904cd6a3aeSmrg      else
579154044362Smrg	_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'
579254044362Smrg	_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'
57934cd6a3aeSmrg      fi
57944cd6a3aeSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
579554044362Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
57964cd6a3aeSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
57974cd6a3aeSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
57984cd6a3aeSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
57994cd6a3aeSmrg      ;;
58008c9fbc29Smrg
580154044362Smrg    linux*)
580254044362Smrg      case $cc_basename in
580354044362Smrg      tcc*)
580454044362Smrg	# Fabrice Bellard et al's Tiny C Compiler
580554044362Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
580654044362Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
580754044362Smrg	;;
580854044362Smrg      esac
580954044362Smrg      ;;
581054044362Smrg
58114cd6a3aeSmrg    netbsd*)
58124cd6a3aeSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
58134cd6a3aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
58144cd6a3aeSmrg      else
58154cd6a3aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
58164cd6a3aeSmrg      fi
58174cd6a3aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
58184cd6a3aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
58194cd6a3aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58204cd6a3aeSmrg      ;;
58218c9fbc29Smrg
58224cd6a3aeSmrg    newsos6)
58234cd6a3aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
58244cd6a3aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
582554044362Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
58264cd6a3aeSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
58274cd6a3aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58284cd6a3aeSmrg      ;;
58298c9fbc29Smrg
58304cd6a3aeSmrg    *nto* | *qnx*)
58314cd6a3aeSmrg      ;;
58328c9fbc29Smrg
583354044362Smrg    openbsd* | bitrig*)
58344cd6a3aeSmrg      if test -f /usr/libexec/ld.so; then
58354cd6a3aeSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
58364cd6a3aeSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58374cd6a3aeSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
583854044362Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
58394cd6a3aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
584054044362Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
584154044362Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
584254044362Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
58434cd6a3aeSmrg	else
584454044362Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
584554044362Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
58464cd6a3aeSmrg	fi
58474cd6a3aeSmrg      else
58484cd6a3aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
58494cd6a3aeSmrg      fi
58504cd6a3aeSmrg      ;;
58518c9fbc29Smrg
58524cd6a3aeSmrg    os2*)
58534cd6a3aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
58544cd6a3aeSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
58554cd6a3aeSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
585654044362Smrg      shrext_cmds=.dll
585754044362Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
585854044362Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
585954044362Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
586054044362Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
586154044362Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
586254044362Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
586354044362Smrg	emximp -o $lib $output_objdir/$libname.def'
586454044362Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
586554044362Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
586654044362Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
586754044362Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
586854044362Smrg	prefix_cmds="$SED"~
586954044362Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
587054044362Smrg	  prefix_cmds="$prefix_cmds -e 1d";
587154044362Smrg	fi~
587254044362Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
587354044362Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
587454044362Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
587554044362Smrg	emximp -o $lib $output_objdir/$libname.def'
587654044362Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
587754044362Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
58784cd6a3aeSmrg      ;;
58798c9fbc29Smrg
58804cd6a3aeSmrg    osf3*)
588154044362Smrg      if test yes = "$GCC"; then
588254044362Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
588354044362Smrg	_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'
58844cd6a3aeSmrg      else
58854cd6a3aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
588654044362Smrg	_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'
58874cd6a3aeSmrg      fi
58884cd6a3aeSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
588954044362Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
58904cd6a3aeSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
58914cd6a3aeSmrg      ;;
58928c9fbc29Smrg
58934cd6a3aeSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
589454044362Smrg      if test yes = "$GCC"; then
589554044362Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
589654044362Smrg	_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'
589754044362Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
58984cd6a3aeSmrg      else
58994cd6a3aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
590054044362Smrg	_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'
59014cd6a3aeSmrg	_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~
590254044362Smrg          $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'
59038c9fbc29Smrg
59044cd6a3aeSmrg	# Both c and cxx compiler support -rpath directly
59054cd6a3aeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
59064cd6a3aeSmrg      fi
59074cd6a3aeSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
59084cd6a3aeSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
59094cd6a3aeSmrg      ;;
59108c9fbc29Smrg
59114cd6a3aeSmrg    solaris*)
59124cd6a3aeSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
591354044362Smrg      if test yes = "$GCC"; then
591454044362Smrg	wlarc='$wl'
591554044362Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
59164cd6a3aeSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
591754044362Smrg          $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'
59184cd6a3aeSmrg      else
59194cd6a3aeSmrg	case `$CC -V 2>&1` in
59204cd6a3aeSmrg	*"Compilers 5.0"*)
59214cd6a3aeSmrg	  wlarc=''
592254044362Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
59234cd6a3aeSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
592454044362Smrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
59254cd6a3aeSmrg	  ;;
59264cd6a3aeSmrg	*)
592754044362Smrg	  wlarc='$wl'
592854044362Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
59294cd6a3aeSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
593054044362Smrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
59314cd6a3aeSmrg	  ;;
59324cd6a3aeSmrg	esac
59334cd6a3aeSmrg      fi
59344cd6a3aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
59354cd6a3aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59364cd6a3aeSmrg      case $host_os in
59374cd6a3aeSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
59384cd6a3aeSmrg      *)
59394cd6a3aeSmrg	# The compiler driver will combine and reorder linker options,
594054044362Smrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
59414cd6a3aeSmrg	# but is careful enough not to reorder.
59424cd6a3aeSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
594354044362Smrg	if test yes = "$GCC"; then
594454044362Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
59454cd6a3aeSmrg	else
59464cd6a3aeSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
59474cd6a3aeSmrg	fi
59484cd6a3aeSmrg	;;
59494cd6a3aeSmrg      esac
59504cd6a3aeSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
59514cd6a3aeSmrg      ;;
59528c9fbc29Smrg
59534cd6a3aeSmrg    sunos4*)
595454044362Smrg      if test sequent = "$host_vendor"; then
59554cd6a3aeSmrg	# Use $CC to link under sequent, because it throws in some extra .o
59564cd6a3aeSmrg	# files that make .init and .fini sections work.
595754044362Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
59584cd6a3aeSmrg      else
59594cd6a3aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
59604cd6a3aeSmrg      fi
59614cd6a3aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
59624cd6a3aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
59634cd6a3aeSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
59644cd6a3aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59654cd6a3aeSmrg      ;;
59668c9fbc29Smrg
59674cd6a3aeSmrg    sysv4)
59684cd6a3aeSmrg      case $host_vendor in
59694cd6a3aeSmrg	sni)
59704cd6a3aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
59714cd6a3aeSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
59724cd6a3aeSmrg	;;
59734cd6a3aeSmrg	siemens)
59744cd6a3aeSmrg	  ## LD is ld it makes a PLAMLIB
59754cd6a3aeSmrg	  ## CC just makes a GrossModule.
59764cd6a3aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
59774cd6a3aeSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
59784cd6a3aeSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
59794cd6a3aeSmrg        ;;
59804cd6a3aeSmrg	motorola)
59814cd6a3aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
59824cd6a3aeSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
59834cd6a3aeSmrg	;;
59844cd6a3aeSmrg      esac
59854cd6a3aeSmrg      runpath_var='LD_RUN_PATH'
59864cd6a3aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59874cd6a3aeSmrg      ;;
59888c9fbc29Smrg
59894cd6a3aeSmrg    sysv4.3*)
59904cd6a3aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
59914cd6a3aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59924cd6a3aeSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
59934cd6a3aeSmrg      ;;
59948c9fbc29Smrg
59954cd6a3aeSmrg    sysv4*MP*)
59964cd6a3aeSmrg      if test -d /usr/nec; then
59974cd6a3aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
59984cd6a3aeSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59994cd6a3aeSmrg	runpath_var=LD_RUN_PATH
60004cd6a3aeSmrg	hardcode_runpath_var=yes
60014cd6a3aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
60024cd6a3aeSmrg      fi
60034cd6a3aeSmrg      ;;
60048c9fbc29Smrg
60054cd6a3aeSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
600654044362Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
60074cd6a3aeSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
60084cd6a3aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60094cd6a3aeSmrg      runpath_var='LD_RUN_PATH'
60108c9fbc29Smrg
601154044362Smrg      if test yes = "$GCC"; then
601254044362Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
601354044362Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60144cd6a3aeSmrg      else
601554044362Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
601654044362Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60174cd6a3aeSmrg      fi
60184cd6a3aeSmrg      ;;
60198c9fbc29Smrg
60204cd6a3aeSmrg    sysv5* | sco3.2v5* | sco5v6*)
602154044362Smrg      # Note: We CANNOT use -z defs as we might desire, because we do not
60224cd6a3aeSmrg      # link with -lc, and that would cause any symbols used from libc to
60234cd6a3aeSmrg      # always be unresolved, which means just about no library would
60244cd6a3aeSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
60254cd6a3aeSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
60264cd6a3aeSmrg      # as -z defs.
602754044362Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
602854044362Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
60294cd6a3aeSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
60304cd6a3aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
603154044362Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
60324cd6a3aeSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
60334cd6a3aeSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
603454044362Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
60354cd6a3aeSmrg      runpath_var='LD_RUN_PATH'
60368c9fbc29Smrg
603754044362Smrg      if test yes = "$GCC"; then
603854044362Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
603954044362Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60404cd6a3aeSmrg      else
604154044362Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
604254044362Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60434cd6a3aeSmrg      fi
60444cd6a3aeSmrg      ;;
60458c9fbc29Smrg
60464cd6a3aeSmrg    uts4*)
60474cd6a3aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
60484cd6a3aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
60494cd6a3aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60504cd6a3aeSmrg      ;;
60518c9fbc29Smrg
60524cd6a3aeSmrg    *)
60534cd6a3aeSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
60544cd6a3aeSmrg      ;;
60554cd6a3aeSmrg    esac
60568c9fbc29Smrg
605754044362Smrg    if test sni = "$host_vendor"; then
60584cd6a3aeSmrg      case $host in
60594cd6a3aeSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
606054044362Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
60614cd6a3aeSmrg	;;
60624cd6a3aeSmrg      esac
60634cd6a3aeSmrg    fi
60644cd6a3aeSmrg  fi
60654cd6a3aeSmrg])
60664cd6a3aeSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
606754044362Smrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
60688c9fbc29Smrg
60694cd6a3aeSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
60708c9fbc29Smrg
60714cd6a3aeSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
60724cd6a3aeSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
60734cd6a3aeSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
60744cd6a3aeSmrg    [The commands to extract the exported symbol list from a shared archive])
60758c9fbc29Smrg
60764cd6a3aeSmrg#
60774cd6a3aeSmrg# Do we need to explicitly link libc?
60784cd6a3aeSmrg#
60794cd6a3aeSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
60804cd6a3aeSmrgx|xyes)
60814cd6a3aeSmrg  # Assume -lc should be added
60824cd6a3aeSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
60838c9fbc29Smrg
608454044362Smrg  if test yes,yes = "$GCC,$enable_shared"; then
60854cd6a3aeSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
60864cd6a3aeSmrg    *'~'*)
60874cd6a3aeSmrg      # FIXME: we may have to deal with multi-command sequences.
60884cd6a3aeSmrg      ;;
60894cd6a3aeSmrg    '$CC '*)
60904cd6a3aeSmrg      # Test whether the compiler implicitly links with -lc since on some
60914cd6a3aeSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
60924cd6a3aeSmrg      # to ld, don't add -lc before -lgcc.
60934cd6a3aeSmrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
60944cd6a3aeSmrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
60954cd6a3aeSmrg	[$RM conftest*
60964cd6a3aeSmrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
60974cd6a3aeSmrg
60984cd6a3aeSmrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
60994cd6a3aeSmrg	  soname=conftest
61004cd6a3aeSmrg	  lib=conftest
61014cd6a3aeSmrg	  libobjs=conftest.$ac_objext
61024cd6a3aeSmrg	  deplibs=
61034cd6a3aeSmrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
61044cd6a3aeSmrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
61054cd6a3aeSmrg	  compiler_flags=-v
61064cd6a3aeSmrg	  linker_flags=-v
61074cd6a3aeSmrg	  verstring=
61084cd6a3aeSmrg	  output_objdir=.
61094cd6a3aeSmrg	  libname=conftest
61104cd6a3aeSmrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
61114cd6a3aeSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
61124cd6a3aeSmrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
61134cd6a3aeSmrg	  then
61144cd6a3aeSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
61154cd6a3aeSmrg	  else
61164cd6a3aeSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
61174cd6a3aeSmrg	  fi
61184cd6a3aeSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
61194cd6a3aeSmrg	else
61204cd6a3aeSmrg	  cat conftest.err 1>&5
61214cd6a3aeSmrg	fi
61224cd6a3aeSmrg	$RM conftest*
61234cd6a3aeSmrg	])
61244cd6a3aeSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
61254cd6a3aeSmrg      ;;
61264cd6a3aeSmrg    esac
61274cd6a3aeSmrg  fi
61284cd6a3aeSmrg  ;;
61294cd6a3aeSmrgesac
61308c9fbc29Smrg
61314cd6a3aeSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
61324cd6a3aeSmrg    [Whether or not to add -lc for building shared libraries])
61334cd6a3aeSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
61344cd6a3aeSmrg    [enable_shared_with_static_runtimes], [0],
61354cd6a3aeSmrg    [Whether or not to disallow shared libs when runtime libs are static])
61364cd6a3aeSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
61374cd6a3aeSmrg    [Compiler flag to allow reflexive dlopens])
61384cd6a3aeSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
61394cd6a3aeSmrg    [Compiler flag to generate shared objects directly from archives])
61404cd6a3aeSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
61414cd6a3aeSmrg    [Whether the compiler copes with passing no objects directly])
61424cd6a3aeSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
61434cd6a3aeSmrg    [Create an old-style archive from a shared archive])
61444cd6a3aeSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
61454cd6a3aeSmrg    [Create a temporary old-style archive to link instead of a shared archive])
61464cd6a3aeSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
61474cd6a3aeSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
61484cd6a3aeSmrg_LT_TAGDECL([], [module_cmds], [2],
61494cd6a3aeSmrg    [Commands used to build a loadable module if different from building
61504cd6a3aeSmrg    a shared archive.])
61514cd6a3aeSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
61524cd6a3aeSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
61534cd6a3aeSmrg    [Whether we are building with GNU ld or not])
61544cd6a3aeSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
61554cd6a3aeSmrg    [Flag that allows shared libraries with undefined symbols to be built])
61564cd6a3aeSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
61574cd6a3aeSmrg    [Flag that enforces no undefined symbols])
61584cd6a3aeSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
61594cd6a3aeSmrg    [Flag to hardcode $libdir into a binary during linking.
61604cd6a3aeSmrg    This must work even if $libdir does not exist])
61614cd6a3aeSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
61624cd6a3aeSmrg    [Whether we need a single "-rpath" flag with a separated argument])
61634cd6a3aeSmrg_LT_TAGDECL([], [hardcode_direct], [0],
616454044362Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
61654cd6a3aeSmrg    DIR into the resulting binary])
61664cd6a3aeSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
616754044362Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
61684cd6a3aeSmrg    DIR into the resulting binary and the resulting library dependency is
616954044362Smrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
61704cd6a3aeSmrg    library is relocated])
61714cd6a3aeSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
61724cd6a3aeSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
61734cd6a3aeSmrg    into the resulting binary])
61744cd6a3aeSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
61754cd6a3aeSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
61764cd6a3aeSmrg    into the resulting binary])
61774cd6a3aeSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
61784cd6a3aeSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
61794cd6a3aeSmrg    into the library and all subsequent libraries and executables linked
61804cd6a3aeSmrg    against it])
61814cd6a3aeSmrg_LT_TAGDECL([], [inherit_rpath], [0],
61824cd6a3aeSmrg    [Set to yes if linker adds runtime paths of dependent libraries
61834cd6a3aeSmrg    to runtime path list])
61844cd6a3aeSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
61854cd6a3aeSmrg    [Whether libtool must link a program against all its dependency libraries])
61864cd6a3aeSmrg_LT_TAGDECL([], [always_export_symbols], [0],
61874cd6a3aeSmrg    [Set to "yes" if exported symbols are required])
61884cd6a3aeSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
61894cd6a3aeSmrg    [The commands to list exported symbols])
61904cd6a3aeSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
61914cd6a3aeSmrg    [Symbols that should not be listed in the preloaded symbols])
61924cd6a3aeSmrg_LT_TAGDECL([], [include_expsyms], [1],
61934cd6a3aeSmrg    [Symbols that must always be exported])
61944cd6a3aeSmrg_LT_TAGDECL([], [prelink_cmds], [2],
61954cd6a3aeSmrg    [Commands necessary for linking programs (against libraries) with templates])
61964cd6a3aeSmrg_LT_TAGDECL([], [postlink_cmds], [2],
61974cd6a3aeSmrg    [Commands necessary for finishing linking programs])
61984cd6a3aeSmrg_LT_TAGDECL([], [file_list_spec], [1],
61994cd6a3aeSmrg    [Specify filename containing input files])
62004cd6a3aeSmrgdnl FIXME: Not yet implemented
62014cd6a3aeSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
62024cd6a3aeSmrgdnl    [Compiler flag to generate thread safe objects])
62034cd6a3aeSmrg])# _LT_LINKER_SHLIBS
62044cd6a3aeSmrg
62054cd6a3aeSmrg
62064cd6a3aeSmrg# _LT_LANG_C_CONFIG([TAG])
62074cd6a3aeSmrg# ------------------------
62084cd6a3aeSmrg# Ensure that the configuration variables for a C compiler are suitably
62094cd6a3aeSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
621054044362Smrg# the compiler configuration to 'libtool'.
62114cd6a3aeSmrgm4_defun([_LT_LANG_C_CONFIG],
62124cd6a3aeSmrg[m4_require([_LT_DECL_EGREP])dnl
621354044362Smrglt_save_CC=$CC
62144cd6a3aeSmrgAC_LANG_PUSH(C)
62158c9fbc29Smrg
62164cd6a3aeSmrg# Source file extension for C test sources.
62174cd6a3aeSmrgac_ext=c
62188c9fbc29Smrg
62194cd6a3aeSmrg# Object file extension for compiled C test sources.
62204cd6a3aeSmrgobjext=o
62214cd6a3aeSmrg_LT_TAGVAR(objext, $1)=$objext
62228c9fbc29Smrg
62234cd6a3aeSmrg# Code to be used in simple compile tests
62244cd6a3aeSmrglt_simple_compile_test_code="int some_variable = 0;"
62258c9fbc29Smrg
62264cd6a3aeSmrg# Code to be used in simple link tests
62274cd6a3aeSmrglt_simple_link_test_code='int main(){return(0);}'
62288c9fbc29Smrg
62294cd6a3aeSmrg_LT_TAG_COMPILER
62304cd6a3aeSmrg# Save the default compiler, since it gets overwritten when the other
62314cd6a3aeSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
62324cd6a3aeSmrgcompiler_DEFAULT=$CC
62338c9fbc29Smrg
62344cd6a3aeSmrg# save warnings/boilerplate of simple test code
62354cd6a3aeSmrg_LT_COMPILER_BOILERPLATE
62364cd6a3aeSmrg_LT_LINKER_BOILERPLATE
62378c9fbc29Smrg
62384cd6a3aeSmrgif test -n "$compiler"; then
62394cd6a3aeSmrg  _LT_COMPILER_NO_RTTI($1)
62404cd6a3aeSmrg  _LT_COMPILER_PIC($1)
62414cd6a3aeSmrg  _LT_COMPILER_C_O($1)
62424cd6a3aeSmrg  _LT_COMPILER_FILE_LOCKS($1)
62434cd6a3aeSmrg  _LT_LINKER_SHLIBS($1)
62444cd6a3aeSmrg  _LT_SYS_DYNAMIC_LINKER($1)
62454cd6a3aeSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
62464cd6a3aeSmrg  LT_SYS_DLOPEN_SELF
62474cd6a3aeSmrg  _LT_CMD_STRIPLIB
62484cd6a3aeSmrg
624954044362Smrg  # Report what library types will actually be built
62504cd6a3aeSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
62514cd6a3aeSmrg  AC_MSG_RESULT([$can_build_shared])
62524cd6a3aeSmrg
62534cd6a3aeSmrg  AC_MSG_CHECKING([whether to build shared libraries])
625454044362Smrg  test no = "$can_build_shared" && enable_shared=no
62554cd6a3aeSmrg
62564cd6a3aeSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
62574cd6a3aeSmrg  # are all built from PIC.
62584cd6a3aeSmrg  case $host_os in
62594cd6a3aeSmrg  aix3*)
626054044362Smrg    test yes = "$enable_shared" && enable_static=no
62614cd6a3aeSmrg    if test -n "$RANLIB"; then
62624cd6a3aeSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
62634cd6a3aeSmrg      postinstall_cmds='$RANLIB $lib'
62644cd6a3aeSmrg    fi
62654cd6a3aeSmrg    ;;
62668c9fbc29Smrg
62674cd6a3aeSmrg  aix[[4-9]]*)
626854044362Smrg    if test ia64 != "$host_cpu"; then
626954044362Smrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
627054044362Smrg      yes,aix,yes) ;;			# shared object as lib.so file only
627154044362Smrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
627254044362Smrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
627354044362Smrg      esac
62744cd6a3aeSmrg    fi
62754cd6a3aeSmrg    ;;
62764cd6a3aeSmrg  esac
62774cd6a3aeSmrg  AC_MSG_RESULT([$enable_shared])
62788c9fbc29Smrg
62794cd6a3aeSmrg  AC_MSG_CHECKING([whether to build static libraries])
62804cd6a3aeSmrg  # Make sure either enable_shared or enable_static is yes.
628154044362Smrg  test yes = "$enable_shared" || enable_static=yes
62824cd6a3aeSmrg  AC_MSG_RESULT([$enable_static])
62838c9fbc29Smrg
62844cd6a3aeSmrg  _LT_CONFIG($1)
62854cd6a3aeSmrgfi
62864cd6a3aeSmrgAC_LANG_POP
628754044362SmrgCC=$lt_save_CC
62884cd6a3aeSmrg])# _LT_LANG_C_CONFIG
62898c9fbc29Smrg
62908c9fbc29Smrg
62914cd6a3aeSmrg# _LT_LANG_CXX_CONFIG([TAG])
62924cd6a3aeSmrg# --------------------------
62934cd6a3aeSmrg# Ensure that the configuration variables for a C++ compiler are suitably
62944cd6a3aeSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
629554044362Smrg# the compiler configuration to 'libtool'.
62964cd6a3aeSmrgm4_defun([_LT_LANG_CXX_CONFIG],
62974cd6a3aeSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
62984cd6a3aeSmrgm4_require([_LT_DECL_EGREP])dnl
62994cd6a3aeSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
630054044362Smrgif test -n "$CXX" && ( test no != "$CXX" &&
630154044362Smrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
630254044362Smrg    (test g++ != "$CXX"))); then
63034cd6a3aeSmrg  AC_PROG_CXXCPP
63044cd6a3aeSmrgelse
63054cd6a3aeSmrg  _lt_caught_CXX_error=yes
63064cd6a3aeSmrgfi
63078c9fbc29Smrg
63084cd6a3aeSmrgAC_LANG_PUSH(C++)
63094cd6a3aeSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
63104cd6a3aeSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
63114cd6a3aeSmrg_LT_TAGVAR(always_export_symbols, $1)=no
63124cd6a3aeSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
63134cd6a3aeSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
63144cd6a3aeSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
63154cd6a3aeSmrg_LT_TAGVAR(hardcode_direct, $1)=no
63164cd6a3aeSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
63174cd6a3aeSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
63184cd6a3aeSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
63194cd6a3aeSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
63204cd6a3aeSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
63214cd6a3aeSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
63224cd6a3aeSmrg_LT_TAGVAR(inherit_rpath, $1)=no
63234cd6a3aeSmrg_LT_TAGVAR(module_cmds, $1)=
63244cd6a3aeSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
63254cd6a3aeSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
63264cd6a3aeSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
63274cd6a3aeSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
63284cd6a3aeSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
63294cd6a3aeSmrg_LT_TAGVAR(no_undefined_flag, $1)=
63304cd6a3aeSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
63314cd6a3aeSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
63328c9fbc29Smrg
63334cd6a3aeSmrg# Source file extension for C++ test sources.
63344cd6a3aeSmrgac_ext=cpp
63358c9fbc29Smrg
63364cd6a3aeSmrg# Object file extension for compiled C++ test sources.
63374cd6a3aeSmrgobjext=o
63384cd6a3aeSmrg_LT_TAGVAR(objext, $1)=$objext
63394cd6a3aeSmrg
63404cd6a3aeSmrg# No sense in running all these tests if we already determined that
63414cd6a3aeSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
63424cd6a3aeSmrg# are currently assumed to apply to all compilers on this platform,
63434cd6a3aeSmrg# and will be corrupted by setting them based on a non-working compiler.
634454044362Smrgif test yes != "$_lt_caught_CXX_error"; then
63454cd6a3aeSmrg  # Code to be used in simple compile tests
63464cd6a3aeSmrg  lt_simple_compile_test_code="int some_variable = 0;"
63474cd6a3aeSmrg
63484cd6a3aeSmrg  # Code to be used in simple link tests
63494cd6a3aeSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
63504cd6a3aeSmrg
63514cd6a3aeSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
63524cd6a3aeSmrg  _LT_TAG_COMPILER
63534cd6a3aeSmrg
63544cd6a3aeSmrg  # save warnings/boilerplate of simple test code
63554cd6a3aeSmrg  _LT_COMPILER_BOILERPLATE
63564cd6a3aeSmrg  _LT_LINKER_BOILERPLATE
63574cd6a3aeSmrg
63584cd6a3aeSmrg  # Allow CC to be a program name with arguments.
63594cd6a3aeSmrg  lt_save_CC=$CC
63604cd6a3aeSmrg  lt_save_CFLAGS=$CFLAGS
63614cd6a3aeSmrg  lt_save_LD=$LD
63624cd6a3aeSmrg  lt_save_GCC=$GCC
63634cd6a3aeSmrg  GCC=$GXX
63644cd6a3aeSmrg  lt_save_with_gnu_ld=$with_gnu_ld
63654cd6a3aeSmrg  lt_save_path_LD=$lt_cv_path_LD
63664cd6a3aeSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
63674cd6a3aeSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
63684cd6a3aeSmrg  else
63694cd6a3aeSmrg    $as_unset lt_cv_prog_gnu_ld
63704cd6a3aeSmrg  fi
63714cd6a3aeSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
63724cd6a3aeSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
63734cd6a3aeSmrg  else
63744cd6a3aeSmrg    $as_unset lt_cv_path_LD
63754cd6a3aeSmrg  fi
63764cd6a3aeSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
63774cd6a3aeSmrg  CC=${CXX-"c++"}
63784cd6a3aeSmrg  CFLAGS=$CXXFLAGS
63794cd6a3aeSmrg  compiler=$CC
63804cd6a3aeSmrg  _LT_TAGVAR(compiler, $1)=$CC
63814cd6a3aeSmrg  _LT_CC_BASENAME([$compiler])
63828c9fbc29Smrg
63834cd6a3aeSmrg  if test -n "$compiler"; then
63844cd6a3aeSmrg    # We don't want -fno-exception when compiling C++ code, so set the
63854cd6a3aeSmrg    # no_builtin_flag separately
638654044362Smrg    if test yes = "$GXX"; then
63874cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
63884cd6a3aeSmrg    else
63894cd6a3aeSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
63904cd6a3aeSmrg    fi
63918c9fbc29Smrg
639254044362Smrg    if test yes = "$GXX"; then
63934cd6a3aeSmrg      # Set up default GNU C++ configuration
63948c9fbc29Smrg
63954cd6a3aeSmrg      LT_PATH_LD
63968c9fbc29Smrg
63974cd6a3aeSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
63984cd6a3aeSmrg      # archiving commands below assume that GNU ld is being used.
639954044362Smrg      if test yes = "$with_gnu_ld"; then
640054044362Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
640154044362Smrg        _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'
64028c9fbc29Smrg
640354044362Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
640454044362Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
64058c9fbc29Smrg
64064cd6a3aeSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
64074cd6a3aeSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
64084cd6a3aeSmrg        #     investigate it a little bit more. (MM)
640954044362Smrg        wlarc='$wl'
64108c9fbc29Smrg
64114cd6a3aeSmrg        # ancient GNU ld didn't support --whole-archive et. al.
64124cd6a3aeSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
64134cd6a3aeSmrg	  $GREP 'no-whole-archive' > /dev/null; then
641454044362Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
64154cd6a3aeSmrg        else
64164cd6a3aeSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
64174cd6a3aeSmrg        fi
64184cd6a3aeSmrg      else
64194cd6a3aeSmrg        with_gnu_ld=no
64204cd6a3aeSmrg        wlarc=
64214cd6a3aeSmrg
64224cd6a3aeSmrg        # A generic and very simple default shared library creation
64234cd6a3aeSmrg        # command for GNU C++ for the case where it uses the native
64244cd6a3aeSmrg        # linker, instead of GNU ld.  If possible, this setting should
64254cd6a3aeSmrg        # overridden to take advantage of the native linker features on
64264cd6a3aeSmrg        # the platform it is being used on.
64274cd6a3aeSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
64284cd6a3aeSmrg      fi
64298c9fbc29Smrg
64304cd6a3aeSmrg      # Commands to make compiler produce verbose output that lists
64314cd6a3aeSmrg      # what "hidden" libraries, object files and flags are used when
64324cd6a3aeSmrg      # linking a shared library.
64334cd6a3aeSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
64348c9fbc29Smrg
64354cd6a3aeSmrg    else
64364cd6a3aeSmrg      GXX=no
64374cd6a3aeSmrg      with_gnu_ld=no
64384cd6a3aeSmrg      wlarc=
64394cd6a3aeSmrg    fi
64408c9fbc29Smrg
64414cd6a3aeSmrg    # PORTME: fill in a description of your system's C++ link characteristics
64424cd6a3aeSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
64434cd6a3aeSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
64444cd6a3aeSmrg    case $host_os in
64454cd6a3aeSmrg      aix3*)
64464cd6a3aeSmrg        # FIXME: insert proper C++ library support
64474cd6a3aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
64484cd6a3aeSmrg        ;;
64494cd6a3aeSmrg      aix[[4-9]]*)
645054044362Smrg        if test ia64 = "$host_cpu"; then
64514cd6a3aeSmrg          # On IA64, the linker does run time linking by default, so we don't
64524cd6a3aeSmrg          # have to do anything special.
64534cd6a3aeSmrg          aix_use_runtimelinking=no
64544cd6a3aeSmrg          exp_sym_flag='-Bexport'
645554044362Smrg          no_entry_flag=
64564cd6a3aeSmrg        else
64574cd6a3aeSmrg          aix_use_runtimelinking=no
64584cd6a3aeSmrg
64594cd6a3aeSmrg          # Test if we are trying to use run time linking or normal
64604cd6a3aeSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
646154044362Smrg          # have runtime linking enabled, and use it for executables.
646254044362Smrg          # For shared libraries, we enable/disable runtime linking
646354044362Smrg          # depending on the kind of the shared library created -
646454044362Smrg          # when "with_aix_soname,aix_use_runtimelinking" is:
646554044362Smrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
646654044362Smrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
646754044362Smrg          #            lib.a           static archive
646854044362Smrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
646954044362Smrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
647054044362Smrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
647154044362Smrg          #            lib.a(lib.so.V) shared, rtl:no
647254044362Smrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
647354044362Smrg          #            lib.a           static archive
64744cd6a3aeSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
64754cd6a3aeSmrg	    for ld_flag in $LDFLAGS; do
64764cd6a3aeSmrg	      case $ld_flag in
64774cd6a3aeSmrg	      *-brtl*)
64784cd6a3aeSmrg	        aix_use_runtimelinking=yes
64794cd6a3aeSmrg	        break
64804cd6a3aeSmrg	        ;;
64814cd6a3aeSmrg	      esac
64824cd6a3aeSmrg	    done
648354044362Smrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
648454044362Smrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
648554044362Smrg	      # so we don't have lib.a shared libs to link our executables.
648654044362Smrg	      # We have to force runtime linking in this case.
648754044362Smrg	      aix_use_runtimelinking=yes
648854044362Smrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
648954044362Smrg	    fi
64904cd6a3aeSmrg	    ;;
64914cd6a3aeSmrg          esac
64928c9fbc29Smrg
64934cd6a3aeSmrg          exp_sym_flag='-bexport'
64944cd6a3aeSmrg          no_entry_flag='-bnoentry'
64954cd6a3aeSmrg        fi
64968c9fbc29Smrg
64974cd6a3aeSmrg        # When large executables or shared objects are built, AIX ld can
64984cd6a3aeSmrg        # have problems creating the table of contents.  If linking a library
64994cd6a3aeSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
65004cd6a3aeSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
65014cd6a3aeSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
65024cd6a3aeSmrg
65034cd6a3aeSmrg        _LT_TAGVAR(archive_cmds, $1)=''
65044cd6a3aeSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
65054cd6a3aeSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
65064cd6a3aeSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
65074cd6a3aeSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
650854044362Smrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
650954044362Smrg        case $with_aix_soname,$aix_use_runtimelinking in
651054044362Smrg        aix,*) ;;	# no import file
651154044362Smrg        svr4,* | *,yes) # use import file
651254044362Smrg          # The Import File defines what to hardcode.
651354044362Smrg          _LT_TAGVAR(hardcode_direct, $1)=no
651454044362Smrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
651554044362Smrg          ;;
651654044362Smrg        esac
65174cd6a3aeSmrg
651854044362Smrg        if test yes = "$GXX"; then
65194cd6a3aeSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
65204cd6a3aeSmrg          # We only want to do this on AIX 4.2 and lower, the check
65214cd6a3aeSmrg          # below for broken collect2 doesn't work under 4.3+
652254044362Smrg	  collect2name=`$CC -print-prog-name=collect2`
65234cd6a3aeSmrg	  if test -f "$collect2name" &&
65244cd6a3aeSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
65254cd6a3aeSmrg	  then
65264cd6a3aeSmrg	    # We have reworked collect2
65274cd6a3aeSmrg	    :
65284cd6a3aeSmrg	  else
65294cd6a3aeSmrg	    # We have old collect2
65304cd6a3aeSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
65314cd6a3aeSmrg	    # It fails to find uninstalled libraries when the uninstalled
65324cd6a3aeSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
65334cd6a3aeSmrg	    # to unsupported forces relinking
65344cd6a3aeSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
65354cd6a3aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
65364cd6a3aeSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
65374cd6a3aeSmrg	  fi
65384cd6a3aeSmrg          esac
65394cd6a3aeSmrg          shared_flag='-shared'
654054044362Smrg	  if test yes = "$aix_use_runtimelinking"; then
654154044362Smrg	    shared_flag=$shared_flag' $wl-G'
65424cd6a3aeSmrg	  fi
654354044362Smrg	  # Need to ensure runtime linking is disabled for the traditional
654454044362Smrg	  # shared library, or the linker may eventually find shared libraries
654554044362Smrg	  # /with/ Import File - we do not want to mix them.
654654044362Smrg	  shared_flag_aix='-shared'
654754044362Smrg	  shared_flag_svr4='-shared $wl-G'
65484cd6a3aeSmrg        else
65494cd6a3aeSmrg          # not using gcc
655054044362Smrg          if test ia64 = "$host_cpu"; then
65514cd6a3aeSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
65524cd6a3aeSmrg	  # chokes on -Wl,-G. The following line is correct:
65534cd6a3aeSmrg	  shared_flag='-G'
65544cd6a3aeSmrg          else
655554044362Smrg	    if test yes = "$aix_use_runtimelinking"; then
655654044362Smrg	      shared_flag='$wl-G'
65574cd6a3aeSmrg	    else
655854044362Smrg	      shared_flag='$wl-bM:SRE'
65594cd6a3aeSmrg	    fi
656054044362Smrg	    shared_flag_aix='$wl-bM:SRE'
656154044362Smrg	    shared_flag_svr4='$wl-G'
65624cd6a3aeSmrg          fi
65634cd6a3aeSmrg        fi
65648c9fbc29Smrg
656554044362Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
65664cd6a3aeSmrg        # It seems that -bexpall does not export symbols beginning with
65674cd6a3aeSmrg        # underscore (_), so it is better to generate a list of symbols to
65684cd6a3aeSmrg	# export.
65694cd6a3aeSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
657054044362Smrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
65714cd6a3aeSmrg          # Warning - without using the other runtime loading flags (-brtl),
65724cd6a3aeSmrg          # -berok will link without error, but may produce a broken library.
657354044362Smrg          # The "-G" linker flag allows undefined symbols.
657454044362Smrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
65754cd6a3aeSmrg          # Determine the default libpath from the value encoded in an empty
65764cd6a3aeSmrg          # executable.
65774cd6a3aeSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
657854044362Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
65794cd6a3aeSmrg
658054044362Smrg          _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
65814cd6a3aeSmrg        else
658254044362Smrg          if test ia64 = "$host_cpu"; then
658354044362Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
65844cd6a3aeSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
658554044362Smrg	    _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"
65864cd6a3aeSmrg          else
65874cd6a3aeSmrg	    # Determine the default libpath from the value encoded in an
65884cd6a3aeSmrg	    # empty executable.
65894cd6a3aeSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
659054044362Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
65914cd6a3aeSmrg	    # Warning - without using the other run time loading flags,
65924cd6a3aeSmrg	    # -berok will link without error, but may produce a broken library.
659354044362Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
659454044362Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
659554044362Smrg	    if test yes = "$with_gnu_ld"; then
65964cd6a3aeSmrg	      # We only use this code for GNU lds that support --whole-archive.
659754044362Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
65984cd6a3aeSmrg	    else
65994cd6a3aeSmrg	      # Exported symbols can be pulled into shared objects from archives
66004cd6a3aeSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
66014cd6a3aeSmrg	    fi
66024cd6a3aeSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
660354044362Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
660454044362Smrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
660554044362Smrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
660654044362Smrg	    if test svr4 != "$with_aix_soname"; then
660754044362Smrg	      # This is similar to how AIX traditionally builds its shared
660854044362Smrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
660954044362Smrg	      _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'
661054044362Smrg	    fi
661154044362Smrg	    if test aix != "$with_aix_soname"; then
661254044362Smrg	      _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'
661354044362Smrg	    else
661454044362Smrg	      # used by -dlpreopen to get the symbols
661554044362Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
661654044362Smrg	    fi
661754044362Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
66184cd6a3aeSmrg          fi
66194cd6a3aeSmrg        fi
66204cd6a3aeSmrg        ;;
66214e411241Smrg
66224cd6a3aeSmrg      beos*)
66234cd6a3aeSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
66244cd6a3aeSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
66254cd6a3aeSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
66264cd6a3aeSmrg	  # support --undefined.  This deserves some investigation.  FIXME
662754044362Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
66284cd6a3aeSmrg	else
66294cd6a3aeSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
66304cd6a3aeSmrg	fi
66314cd6a3aeSmrg	;;
66328c9fbc29Smrg
66334cd6a3aeSmrg      chorus*)
66344cd6a3aeSmrg        case $cc_basename in
66354cd6a3aeSmrg          *)
66364cd6a3aeSmrg	  # FIXME: insert proper C++ library support
66374cd6a3aeSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
66384cd6a3aeSmrg	  ;;
66394cd6a3aeSmrg        esac
66404cd6a3aeSmrg        ;;
66418c9fbc29Smrg
66424cd6a3aeSmrg      cygwin* | mingw* | pw32* | cegcc*)
66434cd6a3aeSmrg	case $GXX,$cc_basename in
66444cd6a3aeSmrg	,cl* | no,cl*)
66454cd6a3aeSmrg	  # Native MSVC
66464cd6a3aeSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
66474cd6a3aeSmrg	  # no search path for DLLs.
66484cd6a3aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
66494cd6a3aeSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
66504cd6a3aeSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
66514cd6a3aeSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
66524cd6a3aeSmrg	  # Tell ltmain to make .lib files, not .a files.
66534cd6a3aeSmrg	  libext=lib
66544cd6a3aeSmrg	  # Tell ltmain to make .dll files, not .so files.
665554044362Smrg	  shrext_cmds=.dll
66564cd6a3aeSmrg	  # FIXME: Setting linknames here is a bad hack.
665754044362Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
665854044362Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
665954044362Smrg              cp "$export_symbols" "$output_objdir/$soname.def";
666054044362Smrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
666154044362Smrg            else
666254044362Smrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
666354044362Smrg            fi~
666454044362Smrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
666554044362Smrg            linknames='
66664cd6a3aeSmrg	  # The linker will not automatically build a static lib if we build a DLL.
66674cd6a3aeSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
66684cd6a3aeSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
66694cd6a3aeSmrg	  # Don't use ranlib
66704cd6a3aeSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
66714cd6a3aeSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
667254044362Smrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
667354044362Smrg            case $lt_outputfile in
667454044362Smrg              *.exe|*.EXE) ;;
667554044362Smrg              *)
667654044362Smrg                lt_outputfile=$lt_outputfile.exe
667754044362Smrg                lt_tool_outputfile=$lt_tool_outputfile.exe
667854044362Smrg                ;;
667954044362Smrg            esac~
668054044362Smrg            func_to_tool_file "$lt_outputfile"~
668154044362Smrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
668254044362Smrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
668354044362Smrg              $RM "$lt_outputfile.manifest";
668454044362Smrg            fi'
66854cd6a3aeSmrg	  ;;
66864cd6a3aeSmrg	*)
66874cd6a3aeSmrg	  # g++
66884cd6a3aeSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
66894cd6a3aeSmrg	  # as there is no search path for DLLs.
66904cd6a3aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
669154044362Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
66924cd6a3aeSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
66934cd6a3aeSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
66944cd6a3aeSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
66954cd6a3aeSmrg
66964cd6a3aeSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
669754044362Smrg	    _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'
669854044362Smrg	    # If the export-symbols file already is a .def file, use it as
669954044362Smrg	    # is; otherwise, prepend EXPORTS...
670054044362Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
670154044362Smrg              cp $export_symbols $output_objdir/$soname.def;
670254044362Smrg            else
670354044362Smrg              echo EXPORTS > $output_objdir/$soname.def;
670454044362Smrg              cat $export_symbols >> $output_objdir/$soname.def;
670554044362Smrg            fi~
670654044362Smrg            $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'
67074cd6a3aeSmrg	  else
67084cd6a3aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67094cd6a3aeSmrg	  fi
67104cd6a3aeSmrg	  ;;
67114cd6a3aeSmrg	esac
67124cd6a3aeSmrg	;;
67134cd6a3aeSmrg      darwin* | rhapsody*)
67144cd6a3aeSmrg        _LT_DARWIN_LINKER_FEATURES($1)
67154cd6a3aeSmrg	;;
67168c9fbc29Smrg
671754044362Smrg      os2*)
671854044362Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
671954044362Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
672054044362Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
672154044362Smrg	shrext_cmds=.dll
672254044362Smrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
672354044362Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
672454044362Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
672554044362Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
672654044362Smrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
672754044362Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
672854044362Smrg	  emximp -o $lib $output_objdir/$libname.def'
672954044362Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
673054044362Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
673154044362Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
673254044362Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
673354044362Smrg	  prefix_cmds="$SED"~
673454044362Smrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
673554044362Smrg	    prefix_cmds="$prefix_cmds -e 1d";
673654044362Smrg	  fi~
673754044362Smrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
673854044362Smrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
673954044362Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
674054044362Smrg	  emximp -o $lib $output_objdir/$libname.def'
674154044362Smrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
674254044362Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
674354044362Smrg	;;
674454044362Smrg
67454cd6a3aeSmrg      dgux*)
67464cd6a3aeSmrg        case $cc_basename in
67474cd6a3aeSmrg          ec++*)
67484cd6a3aeSmrg	    # FIXME: insert proper C++ library support
67494cd6a3aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67504cd6a3aeSmrg	    ;;
67514cd6a3aeSmrg          ghcx*)
67524cd6a3aeSmrg	    # Green Hills C++ Compiler
67534cd6a3aeSmrg	    # FIXME: insert proper C++ library support
67544cd6a3aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67554cd6a3aeSmrg	    ;;
67564cd6a3aeSmrg          *)
67574cd6a3aeSmrg	    # FIXME: insert proper C++ library support
67584cd6a3aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67594cd6a3aeSmrg	    ;;
67604cd6a3aeSmrg        esac
67614cd6a3aeSmrg        ;;
67628c9fbc29Smrg
676370728a38Smrg      freebsd2.*)
67644cd6a3aeSmrg        # C++ shared libraries reported to be fairly broken before
67654cd6a3aeSmrg	# switch to ELF
67664cd6a3aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
67674cd6a3aeSmrg        ;;
67688c9fbc29Smrg
67694cd6a3aeSmrg      freebsd-elf*)
67704cd6a3aeSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
67714cd6a3aeSmrg        ;;
67728c9fbc29Smrg
67734cd6a3aeSmrg      freebsd* | dragonfly*)
67744cd6a3aeSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
67754cd6a3aeSmrg        # conventions
67764cd6a3aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
67774cd6a3aeSmrg        ;;
67788c9fbc29Smrg
67794cd6a3aeSmrg      haiku*)
678054044362Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
67814cd6a3aeSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
67824cd6a3aeSmrg        ;;
67838c9fbc29Smrg
67844cd6a3aeSmrg      hpux9*)
678554044362Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
67864cd6a3aeSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
678754044362Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
67884cd6a3aeSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
67894cd6a3aeSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
67904cd6a3aeSmrg				             # but as the default
67914cd6a3aeSmrg				             # location of the library.
67924cd6a3aeSmrg
67934cd6a3aeSmrg        case $cc_basename in
67944cd6a3aeSmrg          CC*)
67954cd6a3aeSmrg            # FIXME: insert proper C++ library support
67964cd6a3aeSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
67974cd6a3aeSmrg            ;;
67984cd6a3aeSmrg          aCC*)
679954044362Smrg            _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'
68004cd6a3aeSmrg            # Commands to make compiler produce verbose output that lists
68014cd6a3aeSmrg            # what "hidden" libraries, object files and flags are used when
68024cd6a3aeSmrg            # linking a shared library.
68034cd6a3aeSmrg            #
68044cd6a3aeSmrg            # There doesn't appear to be a way to prevent this compiler from
68054cd6a3aeSmrg            # explicitly linking system object files so we need to strip them
68064cd6a3aeSmrg            # from the output so that they don't get included in the library
68074cd6a3aeSmrg            # dependencies.
680854044362Smrg            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"'
68094cd6a3aeSmrg            ;;
68104cd6a3aeSmrg          *)
681154044362Smrg            if test yes = "$GXX"; then
681254044362Smrg              _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'
68134cd6a3aeSmrg            else
68144cd6a3aeSmrg              # FIXME: insert proper C++ library support
68154cd6a3aeSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
68164cd6a3aeSmrg            fi
68174cd6a3aeSmrg            ;;
68184cd6a3aeSmrg        esac
68194cd6a3aeSmrg        ;;
68208c9fbc29Smrg
68214cd6a3aeSmrg      hpux10*|hpux11*)
682254044362Smrg        if test no = "$with_gnu_ld"; then
682354044362Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
68244cd6a3aeSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
68254cd6a3aeSmrg
68264cd6a3aeSmrg          case $host_cpu in
68274cd6a3aeSmrg            hppa*64*|ia64*)
68284cd6a3aeSmrg              ;;
68294cd6a3aeSmrg            *)
683054044362Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
68314cd6a3aeSmrg              ;;
68324cd6a3aeSmrg          esac
68334cd6a3aeSmrg        fi
68344cd6a3aeSmrg        case $host_cpu in
68354cd6a3aeSmrg          hppa*64*|ia64*)
68364cd6a3aeSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
68374cd6a3aeSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
68384cd6a3aeSmrg            ;;
68394cd6a3aeSmrg          *)
68404cd6a3aeSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
68414cd6a3aeSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
68424cd6a3aeSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
68434cd6a3aeSmrg					         # but as the default
68444cd6a3aeSmrg					         # location of the library.
68454cd6a3aeSmrg            ;;
68464cd6a3aeSmrg        esac
68474cd6a3aeSmrg
68484cd6a3aeSmrg        case $cc_basename in
68494cd6a3aeSmrg          CC*)
68504cd6a3aeSmrg	    # FIXME: insert proper C++ library support
68514cd6a3aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68524cd6a3aeSmrg	    ;;
68534cd6a3aeSmrg          aCC*)
68544cd6a3aeSmrg	    case $host_cpu in
68554cd6a3aeSmrg	      hppa*64*)
685654044362Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68574cd6a3aeSmrg	        ;;
68584cd6a3aeSmrg	      ia64*)
685954044362Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68604cd6a3aeSmrg	        ;;
68614cd6a3aeSmrg	      *)
686254044362Smrg	        _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'
68634cd6a3aeSmrg	        ;;
68644cd6a3aeSmrg	    esac
68654cd6a3aeSmrg	    # Commands to make compiler produce verbose output that lists
68664cd6a3aeSmrg	    # what "hidden" libraries, object files and flags are used when
68674cd6a3aeSmrg	    # linking a shared library.
68684cd6a3aeSmrg	    #
68694cd6a3aeSmrg	    # There doesn't appear to be a way to prevent this compiler from
68704cd6a3aeSmrg	    # explicitly linking system object files so we need to strip them
68714cd6a3aeSmrg	    # from the output so that they don't get included in the library
68724cd6a3aeSmrg	    # dependencies.
687354044362Smrg	    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"'
68744cd6a3aeSmrg	    ;;
68754cd6a3aeSmrg          *)
687654044362Smrg	    if test yes = "$GXX"; then
687754044362Smrg	      if test no = "$with_gnu_ld"; then
68784cd6a3aeSmrg	        case $host_cpu in
68794cd6a3aeSmrg	          hppa*64*)
688054044362Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68814cd6a3aeSmrg	            ;;
68824cd6a3aeSmrg	          ia64*)
688354044362Smrg	            _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'
68844cd6a3aeSmrg	            ;;
68854cd6a3aeSmrg	          *)
688654044362Smrg	            _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'
68874cd6a3aeSmrg	            ;;
68884cd6a3aeSmrg	        esac
68894cd6a3aeSmrg	      fi
68904cd6a3aeSmrg	    else
68914cd6a3aeSmrg	      # FIXME: insert proper C++ library support
68924cd6a3aeSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
68934cd6a3aeSmrg	    fi
68944cd6a3aeSmrg	    ;;
68954cd6a3aeSmrg        esac
68964cd6a3aeSmrg        ;;
68978c9fbc29Smrg
68984cd6a3aeSmrg      interix[[3-9]]*)
68994cd6a3aeSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
69004cd6a3aeSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
690154044362Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
690254044362Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
69034cd6a3aeSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
69044cd6a3aeSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
69054cd6a3aeSmrg	# default) and relocated if they conflict, which is a slow very memory
69064cd6a3aeSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
69074cd6a3aeSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
69084cd6a3aeSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
690954044362Smrg	_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'
691054044362Smrg	_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'
69114cd6a3aeSmrg	;;
69124cd6a3aeSmrg      irix5* | irix6*)
69134cd6a3aeSmrg        case $cc_basename in
69144cd6a3aeSmrg          CC*)
69154cd6a3aeSmrg	    # SGI C++
691654044362Smrg	    _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'
69174cd6a3aeSmrg
69184cd6a3aeSmrg	    # Archives containing C++ object files must be created using
69194cd6a3aeSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
69204cd6a3aeSmrg	    # necessary to make sure instantiated templates are included
69214cd6a3aeSmrg	    # in the archive.
69224cd6a3aeSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
69234cd6a3aeSmrg	    ;;
69244cd6a3aeSmrg          *)
692554044362Smrg	    if test yes = "$GXX"; then
692654044362Smrg	      if test no = "$with_gnu_ld"; then
692754044362Smrg	        _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'
69284cd6a3aeSmrg	      else
692954044362Smrg	        _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'
69304cd6a3aeSmrg	      fi
69314cd6a3aeSmrg	    fi
69324cd6a3aeSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
69334cd6a3aeSmrg	    ;;
69344cd6a3aeSmrg        esac
693554044362Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
69364cd6a3aeSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
69374cd6a3aeSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
69384cd6a3aeSmrg        ;;
69398c9fbc29Smrg
694054044362Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
69414cd6a3aeSmrg        case $cc_basename in
69424cd6a3aeSmrg          KCC*)
69434cd6a3aeSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
69448c9fbc29Smrg
69454cd6a3aeSmrg	    # KCC will only create a shared library if the output file
69464cd6a3aeSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
69474cd6a3aeSmrg	    # to its proper name (with version) after linking.
694854044362Smrg	    _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'
694954044362Smrg	    _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'
69504cd6a3aeSmrg	    # Commands to make compiler produce verbose output that lists
69514cd6a3aeSmrg	    # what "hidden" libraries, object files and flags are used when
69524cd6a3aeSmrg	    # linking a shared library.
69534cd6a3aeSmrg	    #
69544cd6a3aeSmrg	    # There doesn't appear to be a way to prevent this compiler from
69554cd6a3aeSmrg	    # explicitly linking system object files so we need to strip them
69564cd6a3aeSmrg	    # from the output so that they don't get included in the library
69574cd6a3aeSmrg	    # dependencies.
695854044362Smrg	    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"'
69594cd6a3aeSmrg
696054044362Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
696154044362Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
69624cd6a3aeSmrg
69634cd6a3aeSmrg	    # Archives containing C++ object files must be created using
69644cd6a3aeSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
69654cd6a3aeSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
69664cd6a3aeSmrg	    ;;
69674cd6a3aeSmrg	  icpc* | ecpc* )
69684cd6a3aeSmrg	    # Intel C++
69694cd6a3aeSmrg	    with_gnu_ld=yes
69704cd6a3aeSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
69714cd6a3aeSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
69724cd6a3aeSmrg	    # earlier do not add the objects themselves.
69734cd6a3aeSmrg	    case `$CC -V 2>&1` in
69744cd6a3aeSmrg	      *"Version 7."*)
697554044362Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
697654044362Smrg		_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'
69774cd6a3aeSmrg		;;
69784cd6a3aeSmrg	      *)  # Version 8.0 or newer
69794cd6a3aeSmrg	        tmp_idyn=
69804cd6a3aeSmrg	        case $host_cpu in
69814cd6a3aeSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
69824cd6a3aeSmrg		esac
698354044362Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
698454044362Smrg		_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'
69854cd6a3aeSmrg		;;
69864cd6a3aeSmrg	    esac
69874cd6a3aeSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
698854044362Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
698954044362Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
699054044362Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
69914cd6a3aeSmrg	    ;;
69924cd6a3aeSmrg          pgCC* | pgcpp*)
69934cd6a3aeSmrg            # Portland Group C++ compiler
69944cd6a3aeSmrg	    case `$CC -V` in
69954cd6a3aeSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
69964cd6a3aeSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
699754044362Smrg               rm -rf $tpldir~
699854044362Smrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
699954044362Smrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
70004cd6a3aeSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
700154044362Smrg                rm -rf $tpldir~
700254044362Smrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
700354044362Smrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
700454044362Smrg                $RANLIB $oldlib'
70054cd6a3aeSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
700654044362Smrg                rm -rf $tpldir~
700754044362Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
700854044362Smrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
70094cd6a3aeSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
701054044362Smrg                rm -rf $tpldir~
701154044362Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
701254044362Smrg                $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'
70134cd6a3aeSmrg	      ;;
70144cd6a3aeSmrg	    *) # Version 6 and above use weak symbols
701554044362Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
701654044362Smrg	      _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'
70174cd6a3aeSmrg	      ;;
70184cd6a3aeSmrg	    esac
70198c9fbc29Smrg
702054044362Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
702154044362Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
702254044362Smrg	    _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'
70234cd6a3aeSmrg            ;;
70244cd6a3aeSmrg	  cxx*)
70254cd6a3aeSmrg	    # Compaq C++
702654044362Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
702754044362Smrg	    _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'
70288c9fbc29Smrg
70294cd6a3aeSmrg	    runpath_var=LD_RUN_PATH
70304cd6a3aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
70314cd6a3aeSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
70328c9fbc29Smrg
70334cd6a3aeSmrg	    # Commands to make compiler produce verbose output that lists
70344cd6a3aeSmrg	    # what "hidden" libraries, object files and flags are used when
70354cd6a3aeSmrg	    # linking a shared library.
70364cd6a3aeSmrg	    #
70374cd6a3aeSmrg	    # There doesn't appear to be a way to prevent this compiler from
70384cd6a3aeSmrg	    # explicitly linking system object files so we need to strip them
70394cd6a3aeSmrg	    # from the output so that they don't get included in the library
70404cd6a3aeSmrg	    # dependencies.
704154044362Smrg	    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'
70424cd6a3aeSmrg	    ;;
70434cd6a3aeSmrg	  xl* | mpixl* | bgxl*)
70444cd6a3aeSmrg	    # IBM XL 8.0 on PPC, with GNU ld
704554044362Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
704654044362Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
704754044362Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
704854044362Smrg	    if test yes = "$supports_anon_versioning"; then
70494cd6a3aeSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
705054044362Smrg                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
705154044362Smrg                echo "local: *; };" >> $output_objdir/$libname.ver~
705254044362Smrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
70534cd6a3aeSmrg	    fi
70544cd6a3aeSmrg	    ;;
70554cd6a3aeSmrg	  *)
70564cd6a3aeSmrg	    case `$CC -V 2>&1 | sed 5q` in
70574cd6a3aeSmrg	    *Sun\ C*)
70584cd6a3aeSmrg	      # Sun C++ 5.9
70594cd6a3aeSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
706054044362Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
706154044362Smrg	      _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'
70624cd6a3aeSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
706354044362Smrg	      _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'
70644cd6a3aeSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
70654cd6a3aeSmrg
70664cd6a3aeSmrg	      # Not sure whether something based on
70674cd6a3aeSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
70684cd6a3aeSmrg	      # would be better.
70694cd6a3aeSmrg	      output_verbose_link_cmd='func_echo_all'
70704cd6a3aeSmrg
70714cd6a3aeSmrg	      # Archives containing C++ object files must be created using
70724cd6a3aeSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
70734cd6a3aeSmrg	      # necessary to make sure instantiated templates are included
70744cd6a3aeSmrg	      # in the archive.
70754cd6a3aeSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
70764cd6a3aeSmrg	      ;;
70774cd6a3aeSmrg	    esac
70784cd6a3aeSmrg	    ;;
70794cd6a3aeSmrg	esac
70804cd6a3aeSmrg	;;
70818c9fbc29Smrg
70824cd6a3aeSmrg      lynxos*)
70834cd6a3aeSmrg        # FIXME: insert proper C++ library support
70844cd6a3aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
70854cd6a3aeSmrg	;;
70868c9fbc29Smrg
70874cd6a3aeSmrg      m88k*)
70884cd6a3aeSmrg        # FIXME: insert proper C++ library support
70894cd6a3aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
70904cd6a3aeSmrg	;;
70918c9fbc29Smrg
70924cd6a3aeSmrg      mvs*)
70934cd6a3aeSmrg        case $cc_basename in
70944cd6a3aeSmrg          cxx*)
70954cd6a3aeSmrg	    # FIXME: insert proper C++ library support
70964cd6a3aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
70974cd6a3aeSmrg	    ;;
70984cd6a3aeSmrg	  *)
70994cd6a3aeSmrg	    # FIXME: insert proper C++ library support
71004cd6a3aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
71014cd6a3aeSmrg	    ;;
71024cd6a3aeSmrg	esac
71034cd6a3aeSmrg	;;
71048c9fbc29Smrg
71054cd6a3aeSmrg      netbsd*)
71064cd6a3aeSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
71074cd6a3aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
71084cd6a3aeSmrg	  wlarc=
71094cd6a3aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
71104cd6a3aeSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
71114cd6a3aeSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
71124cd6a3aeSmrg	fi
71134cd6a3aeSmrg	# Workaround some broken pre-1.5 toolchains
71144cd6a3aeSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
71154cd6a3aeSmrg	;;
71168c9fbc29Smrg
71174cd6a3aeSmrg      *nto* | *qnx*)
71184cd6a3aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
71194cd6a3aeSmrg	;;
71208c9fbc29Smrg
712154044362Smrg      openbsd* | bitrig*)
71224cd6a3aeSmrg	if test -f /usr/libexec/ld.so; then
71234cd6a3aeSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
71244cd6a3aeSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
71254cd6a3aeSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
71264cd6a3aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
712754044362Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
712854044362Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
712954044362Smrg	    _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'
713054044362Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
713154044362Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
71324cd6a3aeSmrg	  fi
71334cd6a3aeSmrg	  output_verbose_link_cmd=func_echo_all
71344cd6a3aeSmrg	else
71354cd6a3aeSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
71364cd6a3aeSmrg	fi
71374cd6a3aeSmrg	;;
71388c9fbc29Smrg
71394cd6a3aeSmrg      osf3* | osf4* | osf5*)
71404cd6a3aeSmrg        case $cc_basename in
71414cd6a3aeSmrg          KCC*)
71424cd6a3aeSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
71434cd6a3aeSmrg
71444cd6a3aeSmrg	    # KCC will only create a shared library if the output file
71454cd6a3aeSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
71464cd6a3aeSmrg	    # to its proper name (with version) after linking.
714754044362Smrg	    _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'
71484cd6a3aeSmrg
714954044362Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
71504cd6a3aeSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
71514cd6a3aeSmrg
71524cd6a3aeSmrg	    # Archives containing C++ object files must be created using
71534cd6a3aeSmrg	    # the KAI C++ compiler.
71544cd6a3aeSmrg	    case $host in
71554cd6a3aeSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
71564cd6a3aeSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
71574cd6a3aeSmrg	    esac
71584cd6a3aeSmrg	    ;;
71594cd6a3aeSmrg          RCC*)
71604cd6a3aeSmrg	    # Rational C++ 2.4.1
71614cd6a3aeSmrg	    # FIXME: insert proper C++ library support
71624cd6a3aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
71634cd6a3aeSmrg	    ;;
71644cd6a3aeSmrg          cxx*)
71654cd6a3aeSmrg	    case $host in
71664cd6a3aeSmrg	      osf3*)
716754044362Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
716854044362Smrg	        _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'
716954044362Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
71704cd6a3aeSmrg		;;
71714cd6a3aeSmrg	      *)
71724cd6a3aeSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
717354044362Smrg	        _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'
71744cd6a3aeSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
717554044362Smrg                  echo "-hidden">> $lib.exp~
717654044362Smrg                  $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~
717754044362Smrg                  $RM $lib.exp'
71784cd6a3aeSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
71794cd6a3aeSmrg		;;
71804cd6a3aeSmrg	    esac
71818c9fbc29Smrg
71824cd6a3aeSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
71838c9fbc29Smrg
71844cd6a3aeSmrg	    # Commands to make compiler produce verbose output that lists
71854cd6a3aeSmrg	    # what "hidden" libraries, object files and flags are used when
71864cd6a3aeSmrg	    # linking a shared library.
71874cd6a3aeSmrg	    #
71884cd6a3aeSmrg	    # There doesn't appear to be a way to prevent this compiler from
71894cd6a3aeSmrg	    # explicitly linking system object files so we need to strip them
71904cd6a3aeSmrg	    # from the output so that they don't get included in the library
71914cd6a3aeSmrg	    # dependencies.
719254044362Smrg	    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"'
71934cd6a3aeSmrg	    ;;
71944cd6a3aeSmrg	  *)
719554044362Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
719654044362Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
71974cd6a3aeSmrg	      case $host in
71984cd6a3aeSmrg	        osf3*)
719954044362Smrg	          _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'
72004cd6a3aeSmrg		  ;;
72014cd6a3aeSmrg	        *)
720254044362Smrg	          _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'
72034cd6a3aeSmrg		  ;;
72044cd6a3aeSmrg	      esac
72054cd6a3aeSmrg
720654044362Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
72074cd6a3aeSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
72084cd6a3aeSmrg
72094cd6a3aeSmrg	      # Commands to make compiler produce verbose output that lists
72104cd6a3aeSmrg	      # what "hidden" libraries, object files and flags are used when
72114cd6a3aeSmrg	      # linking a shared library.
72124cd6a3aeSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
72134cd6a3aeSmrg
72144cd6a3aeSmrg	    else
72154cd6a3aeSmrg	      # FIXME: insert proper C++ library support
72164cd6a3aeSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
72174cd6a3aeSmrg	    fi
72184cd6a3aeSmrg	    ;;
72194cd6a3aeSmrg        esac
72204cd6a3aeSmrg        ;;
72218c9fbc29Smrg
72224cd6a3aeSmrg      psos*)
72234cd6a3aeSmrg        # FIXME: insert proper C++ library support
72244cd6a3aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
72254cd6a3aeSmrg        ;;
72268c9fbc29Smrg
72274cd6a3aeSmrg      sunos4*)
72284cd6a3aeSmrg        case $cc_basename in
72294cd6a3aeSmrg          CC*)
72304cd6a3aeSmrg	    # Sun C++ 4.x
72314cd6a3aeSmrg	    # FIXME: insert proper C++ library support
72324cd6a3aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72334cd6a3aeSmrg	    ;;
72344cd6a3aeSmrg          lcc*)
72354cd6a3aeSmrg	    # Lucid
72364cd6a3aeSmrg	    # FIXME: insert proper C++ library support
72374cd6a3aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72384cd6a3aeSmrg	    ;;
72394cd6a3aeSmrg          *)
72404cd6a3aeSmrg	    # FIXME: insert proper C++ library support
72414cd6a3aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72424cd6a3aeSmrg	    ;;
72434cd6a3aeSmrg        esac
72444cd6a3aeSmrg        ;;
72458c9fbc29Smrg
72464cd6a3aeSmrg      solaris*)
72474cd6a3aeSmrg        case $cc_basename in
72484cd6a3aeSmrg          CC* | sunCC*)
72494cd6a3aeSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
72504cd6a3aeSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
72514cd6a3aeSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
725254044362Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
72534cd6a3aeSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
725454044362Smrg              $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'
72554cd6a3aeSmrg
72564cd6a3aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
72574cd6a3aeSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
72584cd6a3aeSmrg	    case $host_os in
72594cd6a3aeSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
72604cd6a3aeSmrg	      *)
72614cd6a3aeSmrg		# The compiler driver will combine and reorder linker options,
726254044362Smrg		# but understands '-z linker_flag'.
72634cd6a3aeSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
72644cd6a3aeSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
72654cd6a3aeSmrg	        ;;
72664cd6a3aeSmrg	    esac
72674cd6a3aeSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
72688c9fbc29Smrg
72694cd6a3aeSmrg	    output_verbose_link_cmd='func_echo_all'
72708c9fbc29Smrg
72714cd6a3aeSmrg	    # Archives containing C++ object files must be created using
72724cd6a3aeSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
72734cd6a3aeSmrg	    # necessary to make sure instantiated templates are included
72744cd6a3aeSmrg	    # in the archive.
72754cd6a3aeSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
72764cd6a3aeSmrg	    ;;
72774cd6a3aeSmrg          gcx*)
72784cd6a3aeSmrg	    # Green Hills C++ Compiler
727954044362Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
72808c9fbc29Smrg
72814cd6a3aeSmrg	    # The C++ compiler must be used to create the archive.
72824cd6a3aeSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
72834cd6a3aeSmrg	    ;;
72844cd6a3aeSmrg          *)
72854cd6a3aeSmrg	    # GNU C++ compiler with Solaris linker
728654044362Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
728754044362Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
72884cd6a3aeSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
728954044362Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
72904cd6a3aeSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
729154044362Smrg                  $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'
72924cd6a3aeSmrg
72934cd6a3aeSmrg	        # Commands to make compiler produce verbose output that lists
72944cd6a3aeSmrg	        # what "hidden" libraries, object files and flags are used when
72954cd6a3aeSmrg	        # linking a shared library.
72964cd6a3aeSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
72974cd6a3aeSmrg	      else
729854044362Smrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
72994cd6a3aeSmrg	        # platform.
730054044362Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
73014cd6a3aeSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
730254044362Smrg                  $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'
73034cd6a3aeSmrg
73044cd6a3aeSmrg	        # Commands to make compiler produce verbose output that lists
73054cd6a3aeSmrg	        # what "hidden" libraries, object files and flags are used when
73064cd6a3aeSmrg	        # linking a shared library.
73074cd6a3aeSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
73084cd6a3aeSmrg	      fi
73094cd6a3aeSmrg
731054044362Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
73114cd6a3aeSmrg	      case $host_os in
73124cd6a3aeSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
73134cd6a3aeSmrg		*)
731454044362Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
73154cd6a3aeSmrg		  ;;
73164cd6a3aeSmrg	      esac
73174cd6a3aeSmrg	    fi
73184cd6a3aeSmrg	    ;;
73194cd6a3aeSmrg        esac
73204cd6a3aeSmrg        ;;
73218c9fbc29Smrg
73224cd6a3aeSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
732354044362Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
73244cd6a3aeSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
73254cd6a3aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
73264cd6a3aeSmrg      runpath_var='LD_RUN_PATH'
73278c9fbc29Smrg
73284cd6a3aeSmrg      case $cc_basename in
73294cd6a3aeSmrg        CC*)
733054044362Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
733154044362Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73324cd6a3aeSmrg	  ;;
73334cd6a3aeSmrg	*)
733454044362Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
733554044362Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73364cd6a3aeSmrg	  ;;
73374cd6a3aeSmrg      esac
73384cd6a3aeSmrg      ;;
73398c9fbc29Smrg
73404cd6a3aeSmrg      sysv5* | sco3.2v5* | sco5v6*)
734154044362Smrg	# Note: We CANNOT use -z defs as we might desire, because we do not
73424cd6a3aeSmrg	# link with -lc, and that would cause any symbols used from libc to
73434cd6a3aeSmrg	# always be unresolved, which means just about no library would
73444cd6a3aeSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
73454cd6a3aeSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
73464cd6a3aeSmrg	# as -z defs.
734754044362Smrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
734854044362Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
73494cd6a3aeSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
73504cd6a3aeSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
735154044362Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
73524cd6a3aeSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
73534cd6a3aeSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
735454044362Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
73554cd6a3aeSmrg	runpath_var='LD_RUN_PATH'
73568c9fbc29Smrg
73574cd6a3aeSmrg	case $cc_basename in
73584cd6a3aeSmrg          CC*)
735954044362Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
736054044362Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73614cd6a3aeSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
736254044362Smrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
73634cd6a3aeSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
736454044362Smrg              '"$_LT_TAGVAR(reload_cmds, $1)"
73654cd6a3aeSmrg	    ;;
73664cd6a3aeSmrg	  *)
736754044362Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
736854044362Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73694cd6a3aeSmrg	    ;;
73704cd6a3aeSmrg	esac
73714cd6a3aeSmrg      ;;
73728c9fbc29Smrg
73734cd6a3aeSmrg      tandem*)
73744cd6a3aeSmrg        case $cc_basename in
73754cd6a3aeSmrg          NCC*)
73764cd6a3aeSmrg	    # NonStop-UX NCC 3.20
73774cd6a3aeSmrg	    # FIXME: insert proper C++ library support
73784cd6a3aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
73794cd6a3aeSmrg	    ;;
73804cd6a3aeSmrg          *)
73814cd6a3aeSmrg	    # FIXME: insert proper C++ library support
73824cd6a3aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
73834cd6a3aeSmrg	    ;;
73844cd6a3aeSmrg        esac
73854cd6a3aeSmrg        ;;
73868c9fbc29Smrg
73874cd6a3aeSmrg      vxworks*)
73884cd6a3aeSmrg        # FIXME: insert proper C++ library support
73894cd6a3aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
73904cd6a3aeSmrg        ;;
73918c9fbc29Smrg
73924cd6a3aeSmrg      *)
73934cd6a3aeSmrg        # FIXME: insert proper C++ library support
73944cd6a3aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
73954cd6a3aeSmrg        ;;
73964cd6a3aeSmrg    esac
73978c9fbc29Smrg
73984cd6a3aeSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
739954044362Smrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
74004cd6a3aeSmrg
740154044362Smrg    _LT_TAGVAR(GCC, $1)=$GXX
740254044362Smrg    _LT_TAGVAR(LD, $1)=$LD
74034cd6a3aeSmrg
74044cd6a3aeSmrg    ## CAVEAT EMPTOR:
74054cd6a3aeSmrg    ## There is no encapsulation within the following macros, do not change
74064cd6a3aeSmrg    ## the running order or otherwise move them around unless you know exactly
74074cd6a3aeSmrg    ## what you are doing...
74084cd6a3aeSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
74094cd6a3aeSmrg    _LT_COMPILER_PIC($1)
74104cd6a3aeSmrg    _LT_COMPILER_C_O($1)
74114cd6a3aeSmrg    _LT_COMPILER_FILE_LOCKS($1)
74124cd6a3aeSmrg    _LT_LINKER_SHLIBS($1)
74134cd6a3aeSmrg    _LT_SYS_DYNAMIC_LINKER($1)
74144cd6a3aeSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
74154cd6a3aeSmrg
74164cd6a3aeSmrg    _LT_CONFIG($1)
74174cd6a3aeSmrg  fi # test -n "$compiler"
74184cd6a3aeSmrg
74194cd6a3aeSmrg  CC=$lt_save_CC
74204cd6a3aeSmrg  CFLAGS=$lt_save_CFLAGS
74214cd6a3aeSmrg  LDCXX=$LD
74224cd6a3aeSmrg  LD=$lt_save_LD
74234cd6a3aeSmrg  GCC=$lt_save_GCC
74244cd6a3aeSmrg  with_gnu_ld=$lt_save_with_gnu_ld
74254cd6a3aeSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
74264cd6a3aeSmrg  lt_cv_path_LD=$lt_save_path_LD
74274cd6a3aeSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
74284cd6a3aeSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
742954044362Smrgfi # test yes != "$_lt_caught_CXX_error"
74308c9fbc29Smrg
74314cd6a3aeSmrgAC_LANG_POP
74324cd6a3aeSmrg])# _LT_LANG_CXX_CONFIG
74338c9fbc29Smrg
74348c9fbc29Smrg
74354cd6a3aeSmrg# _LT_FUNC_STRIPNAME_CNF
74364cd6a3aeSmrg# ----------------------
74374cd6a3aeSmrg# func_stripname_cnf prefix suffix name
74384cd6a3aeSmrg# strip PREFIX and SUFFIX off of NAME.
74394cd6a3aeSmrg# PREFIX and SUFFIX must not contain globbing or regex special
74404cd6a3aeSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
74414cd6a3aeSmrg# dot (in which case that matches only a dot).
74424cd6a3aeSmrg#
74434cd6a3aeSmrg# This function is identical to the (non-XSI) version of func_stripname,
74444cd6a3aeSmrg# except this one can be used by m4 code that may be executed by configure,
74454cd6a3aeSmrg# rather than the libtool script.
74464cd6a3aeSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
74474cd6a3aeSmrgAC_REQUIRE([_LT_DECL_SED])
74484cd6a3aeSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
74494cd6a3aeSmrgfunc_stripname_cnf ()
74504cd6a3aeSmrg{
745154044362Smrg  case @S|@2 in
745254044362Smrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
745354044362Smrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
74544cd6a3aeSmrg  esac
74554cd6a3aeSmrg} # func_stripname_cnf
74564cd6a3aeSmrg])# _LT_FUNC_STRIPNAME_CNF
74578c9fbc29Smrg
745854044362Smrg
74594cd6a3aeSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
74608c9fbc29Smrg# ---------------------------------
74614cd6a3aeSmrg# Figure out "hidden" library dependencies from verbose
74624cd6a3aeSmrg# compiler output when linking a shared library.
74634cd6a3aeSmrg# Parse the compiler output and extract the necessary
74644cd6a3aeSmrg# objects, libraries and library flags.
74654cd6a3aeSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
74664cd6a3aeSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
74674cd6a3aeSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
74684cd6a3aeSmrg# Dependencies to place before and after the object being linked:
74694cd6a3aeSmrg_LT_TAGVAR(predep_objects, $1)=
74704cd6a3aeSmrg_LT_TAGVAR(postdep_objects, $1)=
74714cd6a3aeSmrg_LT_TAGVAR(predeps, $1)=
74724cd6a3aeSmrg_LT_TAGVAR(postdeps, $1)=
74734cd6a3aeSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
74748c9fbc29Smrg
74754cd6a3aeSmrgdnl we can't use the lt_simple_compile_test_code here,
74764cd6a3aeSmrgdnl because it contains code intended for an executable,
74774cd6a3aeSmrgdnl not a library.  It's possible we should let each
74784cd6a3aeSmrgdnl tag define a new lt_????_link_test_code variable,
74794cd6a3aeSmrgdnl but it's only used here...
74804cd6a3aeSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
74814cd6a3aeSmrgint a;
74824cd6a3aeSmrgvoid foo (void) { a = 0; }
74834cd6a3aeSmrg_LT_EOF
74844cd6a3aeSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
74854cd6a3aeSmrgclass Foo
74864cd6a3aeSmrg{
74874cd6a3aeSmrgpublic:
74884cd6a3aeSmrg  Foo (void) { a = 0; }
74894cd6a3aeSmrgprivate:
74904cd6a3aeSmrg  int a;
74914cd6a3aeSmrg};
74924cd6a3aeSmrg_LT_EOF
74934cd6a3aeSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
74944cd6a3aeSmrg      subroutine foo
74954cd6a3aeSmrg      implicit none
74964cd6a3aeSmrg      integer*4 a
74974cd6a3aeSmrg      a=0
74984cd6a3aeSmrg      return
74994cd6a3aeSmrg      end
75004cd6a3aeSmrg_LT_EOF
75014cd6a3aeSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
75024cd6a3aeSmrg      subroutine foo
75034cd6a3aeSmrg      implicit none
75044cd6a3aeSmrg      integer a
75054cd6a3aeSmrg      a=0
75064cd6a3aeSmrg      return
75074cd6a3aeSmrg      end
75084cd6a3aeSmrg_LT_EOF
75094cd6a3aeSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
75104cd6a3aeSmrgpublic class foo {
75114cd6a3aeSmrg  private int a;
75124cd6a3aeSmrg  public void bar (void) {
75134cd6a3aeSmrg    a = 0;
75144cd6a3aeSmrg  }
75154cd6a3aeSmrg};
75164cd6a3aeSmrg_LT_EOF
751770728a38Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
751870728a38Smrgpackage foo
751970728a38Smrgfunc foo() {
752070728a38Smrg}
752170728a38Smrg_LT_EOF
75224cd6a3aeSmrg])
75238c9fbc29Smrg
75244cd6a3aeSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
75254cd6a3aeSmrgcase "$CC $CFLAGS " in #(
75264cd6a3aeSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
75274cd6a3aeSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
752870728a38Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
75298c9fbc29Smrgesac
75308c9fbc29Smrg
75314cd6a3aeSmrgdnl Parse the compiler output and extract the necessary
75324cd6a3aeSmrgdnl objects, libraries and library flags.
75334cd6a3aeSmrgif AC_TRY_EVAL(ac_compile); then
75344cd6a3aeSmrg  # Parse the compiler output and extract the necessary
75354cd6a3aeSmrg  # objects, libraries and library flags.
75368c9fbc29Smrg
75374cd6a3aeSmrg  # Sentinel used to keep track of whether or not we are before
75384cd6a3aeSmrg  # the conftest object file.
75394cd6a3aeSmrg  pre_test_object_deps_done=no
75408c9fbc29Smrg
75414cd6a3aeSmrg  for p in `eval "$output_verbose_link_cmd"`; do
754254044362Smrg    case $prev$p in
75438c9fbc29Smrg
75444cd6a3aeSmrg    -L* | -R* | -l*)
75454cd6a3aeSmrg       # Some compilers place space between "-{L,R}" and the path.
75464cd6a3aeSmrg       # Remove the space.
754754044362Smrg       if test x-L = "$p" ||
754854044362Smrg          test x-R = "$p"; then
75494cd6a3aeSmrg	 prev=$p
75504cd6a3aeSmrg	 continue
75514cd6a3aeSmrg       fi
75528c9fbc29Smrg
75534cd6a3aeSmrg       # Expand the sysroot to ease extracting the directories later.
75544cd6a3aeSmrg       if test -z "$prev"; then
75554cd6a3aeSmrg         case $p in
75564cd6a3aeSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
75574cd6a3aeSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
75584cd6a3aeSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
75594cd6a3aeSmrg         esac
75604cd6a3aeSmrg       fi
75614cd6a3aeSmrg       case $p in
75624cd6a3aeSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
75634cd6a3aeSmrg       esac
756454044362Smrg       if test no = "$pre_test_object_deps_done"; then
756554044362Smrg	 case $prev in
75664cd6a3aeSmrg	 -L | -R)
75674cd6a3aeSmrg	   # Internal compiler library paths should come after those
75684cd6a3aeSmrg	   # provided the user.  The postdeps already come after the
75694cd6a3aeSmrg	   # user supplied libs so there is no need to process them.
75704cd6a3aeSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
757154044362Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
75724cd6a3aeSmrg	   else
757354044362Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
75744cd6a3aeSmrg	   fi
75754cd6a3aeSmrg	   ;;
75764cd6a3aeSmrg	 # The "-l" case would never come before the object being
75774cd6a3aeSmrg	 # linked, so don't bother handling this case.
75784cd6a3aeSmrg	 esac
75794cd6a3aeSmrg       else
75804cd6a3aeSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
758154044362Smrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
75824cd6a3aeSmrg	 else
758354044362Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
75844cd6a3aeSmrg	 fi
75854cd6a3aeSmrg       fi
75864cd6a3aeSmrg       prev=
75874cd6a3aeSmrg       ;;
75888c9fbc29Smrg
75894cd6a3aeSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
75904cd6a3aeSmrg    *.$objext)
75914cd6a3aeSmrg       # This assumes that the test object file only shows up
75924cd6a3aeSmrg       # once in the compiler output.
75934cd6a3aeSmrg       if test "$p" = "conftest.$objext"; then
75944cd6a3aeSmrg	 pre_test_object_deps_done=yes
75954cd6a3aeSmrg	 continue
75964cd6a3aeSmrg       fi
75978c9fbc29Smrg
759854044362Smrg       if test no = "$pre_test_object_deps_done"; then
75994cd6a3aeSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
760054044362Smrg	   _LT_TAGVAR(predep_objects, $1)=$p
76014cd6a3aeSmrg	 else
76024cd6a3aeSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
76034cd6a3aeSmrg	 fi
76044cd6a3aeSmrg       else
76054cd6a3aeSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
760654044362Smrg	   _LT_TAGVAR(postdep_objects, $1)=$p
76074cd6a3aeSmrg	 else
76084cd6a3aeSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
76094cd6a3aeSmrg	 fi
76104cd6a3aeSmrg       fi
76114cd6a3aeSmrg       ;;
76128c9fbc29Smrg
76134cd6a3aeSmrg    *) ;; # Ignore the rest.
76148c9fbc29Smrg
76154cd6a3aeSmrg    esac
76164cd6a3aeSmrg  done
76178c9fbc29Smrg
76184cd6a3aeSmrg  # Clean up.
76194cd6a3aeSmrg  rm -f a.out a.exe
76208c9fbc29Smrgelse
76214cd6a3aeSmrg  echo "libtool.m4: error: problem compiling $1 test program"
76228c9fbc29Smrgfi
76238c9fbc29Smrg
76244cd6a3aeSmrg$RM -f confest.$objext
76254cd6a3aeSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
76268c9fbc29Smrg
76274cd6a3aeSmrg# PORTME: override above test on systems where it is broken
76284cd6a3aeSmrgm4_if([$1], [CXX],
76294cd6a3aeSmrg[case $host_os in
76304cd6a3aeSmrginterix[[3-9]]*)
76314cd6a3aeSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
76324cd6a3aeSmrg  # hack all around it, let's just trust "g++" to DTRT.
76334cd6a3aeSmrg  _LT_TAGVAR(predep_objects,$1)=
76344cd6a3aeSmrg  _LT_TAGVAR(postdep_objects,$1)=
76354cd6a3aeSmrg  _LT_TAGVAR(postdeps,$1)=
76364cd6a3aeSmrg  ;;
76374cd6a3aeSmrgesac
76384cd6a3aeSmrg])
76394cd6a3aeSmrg
76404cd6a3aeSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
76414cd6a3aeSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
76424cd6a3aeSmrgesac
76434cd6a3aeSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
76444cd6a3aeSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
764554044362Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
76464cd6a3aeSmrgfi
76474cd6a3aeSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
76484cd6a3aeSmrg    [The directories searched by this compiler when creating a shared library])
76494cd6a3aeSmrg_LT_TAGDECL([], [predep_objects], [1],
76504cd6a3aeSmrg    [Dependencies to place before and after the objects being linked to
76514cd6a3aeSmrg    create a shared library])
76524cd6a3aeSmrg_LT_TAGDECL([], [postdep_objects], [1])
76534cd6a3aeSmrg_LT_TAGDECL([], [predeps], [1])
76544cd6a3aeSmrg_LT_TAGDECL([], [postdeps], [1])
76554cd6a3aeSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
76564cd6a3aeSmrg    [The library search path used internally by the compiler when linking
76574cd6a3aeSmrg    a shared library])
76584cd6a3aeSmrg])# _LT_SYS_HIDDEN_LIBDEPS
76594cd6a3aeSmrg
76604cd6a3aeSmrg
76614cd6a3aeSmrg# _LT_LANG_F77_CONFIG([TAG])
76624cd6a3aeSmrg# --------------------------
76634cd6a3aeSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
76644cd6a3aeSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
766554044362Smrg# to write the compiler configuration to 'libtool'.
76664cd6a3aeSmrgm4_defun([_LT_LANG_F77_CONFIG],
76674cd6a3aeSmrg[AC_LANG_PUSH(Fortran 77)
766854044362Smrgif test -z "$F77" || test no = "$F77"; then
76694cd6a3aeSmrg  _lt_disable_F77=yes
76704cd6a3aeSmrgfi
76714cd6a3aeSmrg
76724cd6a3aeSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
76734cd6a3aeSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
76744cd6a3aeSmrg_LT_TAGVAR(always_export_symbols, $1)=no
76754cd6a3aeSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
76764cd6a3aeSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
76774cd6a3aeSmrg_LT_TAGVAR(hardcode_direct, $1)=no
76784cd6a3aeSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
76794cd6a3aeSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
76804cd6a3aeSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
76814cd6a3aeSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
76824cd6a3aeSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
76834cd6a3aeSmrg_LT_TAGVAR(inherit_rpath, $1)=no
76844cd6a3aeSmrg_LT_TAGVAR(module_cmds, $1)=
76854cd6a3aeSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
76864cd6a3aeSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
76874cd6a3aeSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
76884cd6a3aeSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
76894cd6a3aeSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
76904cd6a3aeSmrg_LT_TAGVAR(no_undefined_flag, $1)=
76914cd6a3aeSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
76924cd6a3aeSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
76934cd6a3aeSmrg
76944cd6a3aeSmrg# Source file extension for f77 test sources.
76954cd6a3aeSmrgac_ext=f
76964cd6a3aeSmrg
76974cd6a3aeSmrg# Object file extension for compiled f77 test sources.
76984cd6a3aeSmrgobjext=o
76994cd6a3aeSmrg_LT_TAGVAR(objext, $1)=$objext
77004cd6a3aeSmrg
77014cd6a3aeSmrg# No sense in running all these tests if we already determined that
77024cd6a3aeSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
77034cd6a3aeSmrg# are currently assumed to apply to all compilers on this platform,
77044cd6a3aeSmrg# and will be corrupted by setting them based on a non-working compiler.
770554044362Smrgif test yes != "$_lt_disable_F77"; then
77064cd6a3aeSmrg  # Code to be used in simple compile tests
77074cd6a3aeSmrg  lt_simple_compile_test_code="\
77084cd6a3aeSmrg      subroutine t
77094cd6a3aeSmrg      return
77104cd6a3aeSmrg      end
77114cd6a3aeSmrg"
77124cd6a3aeSmrg
77134cd6a3aeSmrg  # Code to be used in simple link tests
77144cd6a3aeSmrg  lt_simple_link_test_code="\
77154cd6a3aeSmrg      program t
77164cd6a3aeSmrg      end
77174cd6a3aeSmrg"
77184cd6a3aeSmrg
77194cd6a3aeSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
77204cd6a3aeSmrg  _LT_TAG_COMPILER
77214cd6a3aeSmrg
77224cd6a3aeSmrg  # save warnings/boilerplate of simple test code
77234cd6a3aeSmrg  _LT_COMPILER_BOILERPLATE
77244cd6a3aeSmrg  _LT_LINKER_BOILERPLATE
77254cd6a3aeSmrg
77264cd6a3aeSmrg  # Allow CC to be a program name with arguments.
772754044362Smrg  lt_save_CC=$CC
77284cd6a3aeSmrg  lt_save_GCC=$GCC
77294cd6a3aeSmrg  lt_save_CFLAGS=$CFLAGS
77304cd6a3aeSmrg  CC=${F77-"f77"}
77314cd6a3aeSmrg  CFLAGS=$FFLAGS
77324cd6a3aeSmrg  compiler=$CC
77334cd6a3aeSmrg  _LT_TAGVAR(compiler, $1)=$CC
77344cd6a3aeSmrg  _LT_CC_BASENAME([$compiler])
77354cd6a3aeSmrg  GCC=$G77
77364cd6a3aeSmrg  if test -n "$compiler"; then
77374cd6a3aeSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
77384cd6a3aeSmrg    AC_MSG_RESULT([$can_build_shared])
77394cd6a3aeSmrg
77404cd6a3aeSmrg    AC_MSG_CHECKING([whether to build shared libraries])
774154044362Smrg    test no = "$can_build_shared" && enable_shared=no
77424cd6a3aeSmrg
77434cd6a3aeSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
77444cd6a3aeSmrg    # are all built from PIC.
77458c9fbc29Smrg    case $host_os in
77464cd6a3aeSmrg      aix3*)
774754044362Smrg        test yes = "$enable_shared" && enable_static=no
77484cd6a3aeSmrg        if test -n "$RANLIB"; then
77494cd6a3aeSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
77504cd6a3aeSmrg          postinstall_cmds='$RANLIB $lib'
77514cd6a3aeSmrg        fi
77524cd6a3aeSmrg        ;;
77534e411241Smrg      aix[[4-9]]*)
775454044362Smrg	if test ia64 != "$host_cpu"; then
775554044362Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
775654044362Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
775754044362Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
775854044362Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
775954044362Smrg	  esac
77608c9fbc29Smrg	fi
77614cd6a3aeSmrg        ;;
77628c9fbc29Smrg    esac
77634cd6a3aeSmrg    AC_MSG_RESULT([$enable_shared])
77644cd6a3aeSmrg
77654cd6a3aeSmrg    AC_MSG_CHECKING([whether to build static libraries])
77664cd6a3aeSmrg    # Make sure either enable_shared or enable_static is yes.
776754044362Smrg    test yes = "$enable_shared" || enable_static=yes
77684cd6a3aeSmrg    AC_MSG_RESULT([$enable_static])
77694cd6a3aeSmrg
777054044362Smrg    _LT_TAGVAR(GCC, $1)=$G77
777154044362Smrg    _LT_TAGVAR(LD, $1)=$LD
77724cd6a3aeSmrg
77734cd6a3aeSmrg    ## CAVEAT EMPTOR:
77744cd6a3aeSmrg    ## There is no encapsulation within the following macros, do not change
77754cd6a3aeSmrg    ## the running order or otherwise move them around unless you know exactly
77764cd6a3aeSmrg    ## what you are doing...
77774cd6a3aeSmrg    _LT_COMPILER_PIC($1)
77784cd6a3aeSmrg    _LT_COMPILER_C_O($1)
77794cd6a3aeSmrg    _LT_COMPILER_FILE_LOCKS($1)
77804cd6a3aeSmrg    _LT_LINKER_SHLIBS($1)
77814cd6a3aeSmrg    _LT_SYS_DYNAMIC_LINKER($1)
77824cd6a3aeSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
77834cd6a3aeSmrg
77844cd6a3aeSmrg    _LT_CONFIG($1)
77854cd6a3aeSmrg  fi # test -n "$compiler"
77864cd6a3aeSmrg
77874cd6a3aeSmrg  GCC=$lt_save_GCC
778854044362Smrg  CC=$lt_save_CC
778954044362Smrg  CFLAGS=$lt_save_CFLAGS
779054044362Smrgfi # test yes != "$_lt_disable_F77"
77914cd6a3aeSmrg
77924cd6a3aeSmrgAC_LANG_POP
77934cd6a3aeSmrg])# _LT_LANG_F77_CONFIG
77944cd6a3aeSmrg
77954cd6a3aeSmrg
77964cd6a3aeSmrg# _LT_LANG_FC_CONFIG([TAG])
77974cd6a3aeSmrg# -------------------------
77984cd6a3aeSmrg# Ensure that the configuration variables for a Fortran compiler are
77994cd6a3aeSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
780054044362Smrg# to write the compiler configuration to 'libtool'.
78014cd6a3aeSmrgm4_defun([_LT_LANG_FC_CONFIG],
78024cd6a3aeSmrg[AC_LANG_PUSH(Fortran)
78034cd6a3aeSmrg
780454044362Smrgif test -z "$FC" || test no = "$FC"; then
78054cd6a3aeSmrg  _lt_disable_FC=yes
78064cd6a3aeSmrgfi
78074cd6a3aeSmrg
78084cd6a3aeSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
78094cd6a3aeSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
78104cd6a3aeSmrg_LT_TAGVAR(always_export_symbols, $1)=no
78114cd6a3aeSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
78124cd6a3aeSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
78134cd6a3aeSmrg_LT_TAGVAR(hardcode_direct, $1)=no
78144cd6a3aeSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
78154cd6a3aeSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
78164cd6a3aeSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
78174cd6a3aeSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
78184cd6a3aeSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
78194cd6a3aeSmrg_LT_TAGVAR(inherit_rpath, $1)=no
78204cd6a3aeSmrg_LT_TAGVAR(module_cmds, $1)=
78214cd6a3aeSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
78224cd6a3aeSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
78234cd6a3aeSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
78244cd6a3aeSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
78254cd6a3aeSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
78264cd6a3aeSmrg_LT_TAGVAR(no_undefined_flag, $1)=
78274cd6a3aeSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
78284cd6a3aeSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
78294cd6a3aeSmrg
78304cd6a3aeSmrg# Source file extension for fc test sources.
78314cd6a3aeSmrgac_ext=${ac_fc_srcext-f}
78324cd6a3aeSmrg
78334cd6a3aeSmrg# Object file extension for compiled fc test sources.
78344cd6a3aeSmrgobjext=o
78354cd6a3aeSmrg_LT_TAGVAR(objext, $1)=$objext
78364cd6a3aeSmrg
78374cd6a3aeSmrg# No sense in running all these tests if we already determined that
78384cd6a3aeSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
78394cd6a3aeSmrg# are currently assumed to apply to all compilers on this platform,
78404cd6a3aeSmrg# and will be corrupted by setting them based on a non-working compiler.
784154044362Smrgif test yes != "$_lt_disable_FC"; then
78424cd6a3aeSmrg  # Code to be used in simple compile tests
78434cd6a3aeSmrg  lt_simple_compile_test_code="\
78444cd6a3aeSmrg      subroutine t
78454cd6a3aeSmrg      return
78464cd6a3aeSmrg      end
78474cd6a3aeSmrg"
78484cd6a3aeSmrg
78494cd6a3aeSmrg  # Code to be used in simple link tests
78504cd6a3aeSmrg  lt_simple_link_test_code="\
78514cd6a3aeSmrg      program t
78524cd6a3aeSmrg      end
78534cd6a3aeSmrg"
78544cd6a3aeSmrg
78554cd6a3aeSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
78564cd6a3aeSmrg  _LT_TAG_COMPILER
78574cd6a3aeSmrg
78584cd6a3aeSmrg  # save warnings/boilerplate of simple test code
78594cd6a3aeSmrg  _LT_COMPILER_BOILERPLATE
78604cd6a3aeSmrg  _LT_LINKER_BOILERPLATE
78614cd6a3aeSmrg
78624cd6a3aeSmrg  # Allow CC to be a program name with arguments.
786354044362Smrg  lt_save_CC=$CC
78644cd6a3aeSmrg  lt_save_GCC=$GCC
78654cd6a3aeSmrg  lt_save_CFLAGS=$CFLAGS
78664cd6a3aeSmrg  CC=${FC-"f95"}
78674cd6a3aeSmrg  CFLAGS=$FCFLAGS
78684cd6a3aeSmrg  compiler=$CC
78694cd6a3aeSmrg  GCC=$ac_cv_fc_compiler_gnu
78704cd6a3aeSmrg
78714cd6a3aeSmrg  _LT_TAGVAR(compiler, $1)=$CC
78724cd6a3aeSmrg  _LT_CC_BASENAME([$compiler])
78734cd6a3aeSmrg
78744cd6a3aeSmrg  if test -n "$compiler"; then
78754cd6a3aeSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
78764cd6a3aeSmrg    AC_MSG_RESULT([$can_build_shared])
78774cd6a3aeSmrg
78784cd6a3aeSmrg    AC_MSG_CHECKING([whether to build shared libraries])
787954044362Smrg    test no = "$can_build_shared" && enable_shared=no
78804cd6a3aeSmrg
78814cd6a3aeSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
78824cd6a3aeSmrg    # are all built from PIC.
78834cd6a3aeSmrg    case $host_os in
78844cd6a3aeSmrg      aix3*)
788554044362Smrg        test yes = "$enable_shared" && enable_static=no
78864cd6a3aeSmrg        if test -n "$RANLIB"; then
78874cd6a3aeSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
78884cd6a3aeSmrg          postinstall_cmds='$RANLIB $lib'
78894cd6a3aeSmrg        fi
78904cd6a3aeSmrg        ;;
78914cd6a3aeSmrg      aix[[4-9]]*)
789254044362Smrg	if test ia64 != "$host_cpu"; then
789354044362Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
789454044362Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
789554044362Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
789654044362Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
789754044362Smrg	  esac
78984cd6a3aeSmrg	fi
78994cd6a3aeSmrg        ;;
79004cd6a3aeSmrg    esac
79014cd6a3aeSmrg    AC_MSG_RESULT([$enable_shared])
79024cd6a3aeSmrg
79034cd6a3aeSmrg    AC_MSG_CHECKING([whether to build static libraries])
79044cd6a3aeSmrg    # Make sure either enable_shared or enable_static is yes.
790554044362Smrg    test yes = "$enable_shared" || enable_static=yes
79064cd6a3aeSmrg    AC_MSG_RESULT([$enable_static])
79074cd6a3aeSmrg
790854044362Smrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
790954044362Smrg    _LT_TAGVAR(LD, $1)=$LD
79104cd6a3aeSmrg
79114cd6a3aeSmrg    ## CAVEAT EMPTOR:
79124cd6a3aeSmrg    ## There is no encapsulation within the following macros, do not change
79134cd6a3aeSmrg    ## the running order or otherwise move them around unless you know exactly
79144cd6a3aeSmrg    ## what you are doing...
79154cd6a3aeSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
79164cd6a3aeSmrg    _LT_COMPILER_PIC($1)
79174cd6a3aeSmrg    _LT_COMPILER_C_O($1)
79184cd6a3aeSmrg    _LT_COMPILER_FILE_LOCKS($1)
79194cd6a3aeSmrg    _LT_LINKER_SHLIBS($1)
79204cd6a3aeSmrg    _LT_SYS_DYNAMIC_LINKER($1)
79214cd6a3aeSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
79224cd6a3aeSmrg
79234cd6a3aeSmrg    _LT_CONFIG($1)
79244cd6a3aeSmrg  fi # test -n "$compiler"
79254cd6a3aeSmrg
79264cd6a3aeSmrg  GCC=$lt_save_GCC
79274cd6a3aeSmrg  CC=$lt_save_CC
79284cd6a3aeSmrg  CFLAGS=$lt_save_CFLAGS
792954044362Smrgfi # test yes != "$_lt_disable_FC"
79304cd6a3aeSmrg
79314cd6a3aeSmrgAC_LANG_POP
79324cd6a3aeSmrg])# _LT_LANG_FC_CONFIG
79334cd6a3aeSmrg
79344cd6a3aeSmrg
79354cd6a3aeSmrg# _LT_LANG_GCJ_CONFIG([TAG])
79364cd6a3aeSmrg# --------------------------
79374cd6a3aeSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
79384cd6a3aeSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
793954044362Smrg# to write the compiler configuration to 'libtool'.
79404cd6a3aeSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
79414cd6a3aeSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
79424cd6a3aeSmrgAC_LANG_SAVE
79434cd6a3aeSmrg
79444cd6a3aeSmrg# Source file extension for Java test sources.
79454cd6a3aeSmrgac_ext=java
79464cd6a3aeSmrg
79474cd6a3aeSmrg# Object file extension for compiled Java test sources.
79484cd6a3aeSmrgobjext=o
79494cd6a3aeSmrg_LT_TAGVAR(objext, $1)=$objext
79504cd6a3aeSmrg
79514cd6a3aeSmrg# Code to be used in simple compile tests
79524cd6a3aeSmrglt_simple_compile_test_code="class foo {}"
79534cd6a3aeSmrg
79544cd6a3aeSmrg# Code to be used in simple link tests
79554cd6a3aeSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
79564cd6a3aeSmrg
79574cd6a3aeSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
79584cd6a3aeSmrg_LT_TAG_COMPILER
79594cd6a3aeSmrg
79604cd6a3aeSmrg# save warnings/boilerplate of simple test code
79614cd6a3aeSmrg_LT_COMPILER_BOILERPLATE
79624cd6a3aeSmrg_LT_LINKER_BOILERPLATE
79634cd6a3aeSmrg
79644cd6a3aeSmrg# Allow CC to be a program name with arguments.
79654cd6a3aeSmrglt_save_CC=$CC
79664cd6a3aeSmrglt_save_CFLAGS=$CFLAGS
79674cd6a3aeSmrglt_save_GCC=$GCC
79684cd6a3aeSmrgGCC=yes
79694cd6a3aeSmrgCC=${GCJ-"gcj"}
79704cd6a3aeSmrgCFLAGS=$GCJFLAGS
79714cd6a3aeSmrgcompiler=$CC
79724cd6a3aeSmrg_LT_TAGVAR(compiler, $1)=$CC
797354044362Smrg_LT_TAGVAR(LD, $1)=$LD
79744cd6a3aeSmrg_LT_CC_BASENAME([$compiler])
79754cd6a3aeSmrg
79764cd6a3aeSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
79774cd6a3aeSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
79784cd6a3aeSmrg
79794cd6a3aeSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
79804cd6a3aeSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
79814cd6a3aeSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
79824cd6a3aeSmrg
79834cd6a3aeSmrgif test -n "$compiler"; then
79844cd6a3aeSmrg  _LT_COMPILER_NO_RTTI($1)
79854cd6a3aeSmrg  _LT_COMPILER_PIC($1)
79864cd6a3aeSmrg  _LT_COMPILER_C_O($1)
79874cd6a3aeSmrg  _LT_COMPILER_FILE_LOCKS($1)
79884cd6a3aeSmrg  _LT_LINKER_SHLIBS($1)
79894cd6a3aeSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
79904cd6a3aeSmrg
79914cd6a3aeSmrg  _LT_CONFIG($1)
79924cd6a3aeSmrgfi
79934cd6a3aeSmrg
79944cd6a3aeSmrgAC_LANG_RESTORE
79954cd6a3aeSmrg
79964cd6a3aeSmrgGCC=$lt_save_GCC
79974cd6a3aeSmrgCC=$lt_save_CC
79984cd6a3aeSmrgCFLAGS=$lt_save_CFLAGS
79994cd6a3aeSmrg])# _LT_LANG_GCJ_CONFIG
80004cd6a3aeSmrg
80014cd6a3aeSmrg
800270728a38Smrg# _LT_LANG_GO_CONFIG([TAG])
800370728a38Smrg# --------------------------
800470728a38Smrg# Ensure that the configuration variables for the GNU Go compiler
800570728a38Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
800654044362Smrg# to write the compiler configuration to 'libtool'.
800770728a38Smrgm4_defun([_LT_LANG_GO_CONFIG],
800870728a38Smrg[AC_REQUIRE([LT_PROG_GO])dnl
800970728a38SmrgAC_LANG_SAVE
801070728a38Smrg
801170728a38Smrg# Source file extension for Go test sources.
801270728a38Smrgac_ext=go
801370728a38Smrg
801470728a38Smrg# Object file extension for compiled Go test sources.
801570728a38Smrgobjext=o
801670728a38Smrg_LT_TAGVAR(objext, $1)=$objext
801770728a38Smrg
801870728a38Smrg# Code to be used in simple compile tests
801970728a38Smrglt_simple_compile_test_code="package main; func main() { }"
802070728a38Smrg
802170728a38Smrg# Code to be used in simple link tests
802270728a38Smrglt_simple_link_test_code='package main; func main() { }'
802370728a38Smrg
802470728a38Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
802570728a38Smrg_LT_TAG_COMPILER
802670728a38Smrg
802770728a38Smrg# save warnings/boilerplate of simple test code
802870728a38Smrg_LT_COMPILER_BOILERPLATE
802970728a38Smrg_LT_LINKER_BOILERPLATE
803070728a38Smrg
803170728a38Smrg# Allow CC to be a program name with arguments.
803270728a38Smrglt_save_CC=$CC
803370728a38Smrglt_save_CFLAGS=$CFLAGS
803470728a38Smrglt_save_GCC=$GCC
803570728a38SmrgGCC=yes
803670728a38SmrgCC=${GOC-"gccgo"}
803770728a38SmrgCFLAGS=$GOFLAGS
803870728a38Smrgcompiler=$CC
803970728a38Smrg_LT_TAGVAR(compiler, $1)=$CC
804054044362Smrg_LT_TAGVAR(LD, $1)=$LD
804170728a38Smrg_LT_CC_BASENAME([$compiler])
804270728a38Smrg
804370728a38Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
804470728a38Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
804570728a38Smrg
804670728a38Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
804770728a38Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
804870728a38Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
804970728a38Smrg
805070728a38Smrgif test -n "$compiler"; then
805170728a38Smrg  _LT_COMPILER_NO_RTTI($1)
805270728a38Smrg  _LT_COMPILER_PIC($1)
805370728a38Smrg  _LT_COMPILER_C_O($1)
805470728a38Smrg  _LT_COMPILER_FILE_LOCKS($1)
805570728a38Smrg  _LT_LINKER_SHLIBS($1)
805670728a38Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
805770728a38Smrg
805870728a38Smrg  _LT_CONFIG($1)
805970728a38Smrgfi
806070728a38Smrg
806170728a38SmrgAC_LANG_RESTORE
806270728a38Smrg
806370728a38SmrgGCC=$lt_save_GCC
806470728a38SmrgCC=$lt_save_CC
806570728a38SmrgCFLAGS=$lt_save_CFLAGS
806670728a38Smrg])# _LT_LANG_GO_CONFIG
806770728a38Smrg
806870728a38Smrg
80694cd6a3aeSmrg# _LT_LANG_RC_CONFIG([TAG])
80704cd6a3aeSmrg# -------------------------
80714cd6a3aeSmrg# Ensure that the configuration variables for the Windows resource compiler
80724cd6a3aeSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
807354044362Smrg# to write the compiler configuration to 'libtool'.
80744cd6a3aeSmrgm4_defun([_LT_LANG_RC_CONFIG],
80754cd6a3aeSmrg[AC_REQUIRE([LT_PROG_RC])dnl
80764cd6a3aeSmrgAC_LANG_SAVE
80774cd6a3aeSmrg
80784cd6a3aeSmrg# Source file extension for RC test sources.
80794cd6a3aeSmrgac_ext=rc
80804cd6a3aeSmrg
80814cd6a3aeSmrg# Object file extension for compiled RC test sources.
80824cd6a3aeSmrgobjext=o
80834cd6a3aeSmrg_LT_TAGVAR(objext, $1)=$objext
80844cd6a3aeSmrg
80854cd6a3aeSmrg# Code to be used in simple compile tests
80864cd6a3aeSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
80874cd6a3aeSmrg
80884cd6a3aeSmrg# Code to be used in simple link tests
808954044362Smrglt_simple_link_test_code=$lt_simple_compile_test_code
80904cd6a3aeSmrg
80914cd6a3aeSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
80924cd6a3aeSmrg_LT_TAG_COMPILER
80934cd6a3aeSmrg
80944cd6a3aeSmrg# save warnings/boilerplate of simple test code
80954cd6a3aeSmrg_LT_COMPILER_BOILERPLATE
80964cd6a3aeSmrg_LT_LINKER_BOILERPLATE
80974cd6a3aeSmrg
80984cd6a3aeSmrg# Allow CC to be a program name with arguments.
809954044362Smrglt_save_CC=$CC
81004cd6a3aeSmrglt_save_CFLAGS=$CFLAGS
81014cd6a3aeSmrglt_save_GCC=$GCC
81024cd6a3aeSmrgGCC=
81034cd6a3aeSmrgCC=${RC-"windres"}
81044cd6a3aeSmrgCFLAGS=
81054cd6a3aeSmrgcompiler=$CC
81064cd6a3aeSmrg_LT_TAGVAR(compiler, $1)=$CC
81074cd6a3aeSmrg_LT_CC_BASENAME([$compiler])
81084cd6a3aeSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
81094cd6a3aeSmrg
81104cd6a3aeSmrgif test -n "$compiler"; then
81114cd6a3aeSmrg  :
81124cd6a3aeSmrg  _LT_CONFIG($1)
81134cd6a3aeSmrgfi
81144cd6a3aeSmrg
81154cd6a3aeSmrgGCC=$lt_save_GCC
81164cd6a3aeSmrgAC_LANG_RESTORE
81174cd6a3aeSmrgCC=$lt_save_CC
81184cd6a3aeSmrgCFLAGS=$lt_save_CFLAGS
81194cd6a3aeSmrg])# _LT_LANG_RC_CONFIG
81204cd6a3aeSmrg
81214cd6a3aeSmrg
81224cd6a3aeSmrg# LT_PROG_GCJ
81234cd6a3aeSmrg# -----------
81244cd6a3aeSmrgAC_DEFUN([LT_PROG_GCJ],
81254cd6a3aeSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
81264cd6a3aeSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
81274cd6a3aeSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
812854044362Smrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
81294cd6a3aeSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
81304cd6a3aeSmrg])
81314cd6a3aeSmrg
81324cd6a3aeSmrg# Old name:
81334cd6a3aeSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
81344cd6a3aeSmrgdnl aclocal-1.4 backwards compatibility:
81354cd6a3aeSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
81364cd6a3aeSmrg
81374cd6a3aeSmrg
813870728a38Smrg# LT_PROG_GO
813970728a38Smrg# ----------
814070728a38SmrgAC_DEFUN([LT_PROG_GO],
814170728a38Smrg[AC_CHECK_TOOL(GOC, gccgo,)
814270728a38Smrg])
814370728a38Smrg
814470728a38Smrg
81454cd6a3aeSmrg# LT_PROG_RC
81464cd6a3aeSmrg# ----------
81474cd6a3aeSmrgAC_DEFUN([LT_PROG_RC],
81484cd6a3aeSmrg[AC_CHECK_TOOL(RC, windres,)
81494cd6a3aeSmrg])
81504cd6a3aeSmrg
81514cd6a3aeSmrg# Old name:
81524cd6a3aeSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
81534cd6a3aeSmrgdnl aclocal-1.4 backwards compatibility:
81544cd6a3aeSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
81554cd6a3aeSmrg
81564cd6a3aeSmrg
81574cd6a3aeSmrg# _LT_DECL_EGREP
81584cd6a3aeSmrg# --------------
81594cd6a3aeSmrg# If we don't have a new enough Autoconf to choose the best grep
81604cd6a3aeSmrg# available, choose the one first in the user's PATH.
81614cd6a3aeSmrgm4_defun([_LT_DECL_EGREP],
81624cd6a3aeSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
81634cd6a3aeSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
81644cd6a3aeSmrgtest -z "$GREP" && GREP=grep
81654cd6a3aeSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
81664cd6a3aeSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
81674cd6a3aeSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
81684cd6a3aeSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
81694cd6a3aeSmrgAC_SUBST([GREP])
81704cd6a3aeSmrg])
81714cd6a3aeSmrg
81724cd6a3aeSmrg
81734cd6a3aeSmrg# _LT_DECL_OBJDUMP
81744cd6a3aeSmrg# --------------
81754cd6a3aeSmrg# If we don't have a new enough Autoconf to choose the best objdump
81764cd6a3aeSmrg# available, choose the one first in the user's PATH.
81774cd6a3aeSmrgm4_defun([_LT_DECL_OBJDUMP],
81784cd6a3aeSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
81794cd6a3aeSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
81804cd6a3aeSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
81814cd6a3aeSmrgAC_SUBST([OBJDUMP])
81824cd6a3aeSmrg])
81834cd6a3aeSmrg
81844cd6a3aeSmrg# _LT_DECL_DLLTOOL
81854cd6a3aeSmrg# ----------------
81864cd6a3aeSmrg# Ensure DLLTOOL variable is set.
81874cd6a3aeSmrgm4_defun([_LT_DECL_DLLTOOL],
81884cd6a3aeSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
81894cd6a3aeSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
81904cd6a3aeSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
81914cd6a3aeSmrgAC_SUBST([DLLTOOL])
81924cd6a3aeSmrg])
81934cd6a3aeSmrg
81944cd6a3aeSmrg# _LT_DECL_SED
81954cd6a3aeSmrg# ------------
81964cd6a3aeSmrg# Check for a fully-functional sed program, that truncates
81974cd6a3aeSmrg# as few characters as possible.  Prefer GNU sed if found.
81984cd6a3aeSmrgm4_defun([_LT_DECL_SED],
81994cd6a3aeSmrg[AC_PROG_SED
82004cd6a3aeSmrgtest -z "$SED" && SED=sed
82014cd6a3aeSmrgXsed="$SED -e 1s/^X//"
82024cd6a3aeSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
82034cd6a3aeSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
82044cd6a3aeSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
82054cd6a3aeSmrg])# _LT_DECL_SED
82064cd6a3aeSmrg
82074cd6a3aeSmrgm4_ifndef([AC_PROG_SED], [
82084cd6a3aeSmrg# NOTE: This macro has been submitted for inclusion into   #
82094cd6a3aeSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
82104cd6a3aeSmrg#  a released version of Autoconf we should remove this    #
82114cd6a3aeSmrg#  macro and use it instead.                               #
82124cd6a3aeSmrg
82134cd6a3aeSmrgm4_defun([AC_PROG_SED],
82144cd6a3aeSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
82154cd6a3aeSmrgAC_CACHE_VAL(lt_cv_path_SED,
82164cd6a3aeSmrg[# Loop through the user's path and test for sed and gsed.
82174cd6a3aeSmrg# Then use that list of sed's as ones to test for truncation.
82184cd6a3aeSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
82194cd6a3aeSmrgfor as_dir in $PATH
82204cd6a3aeSmrgdo
82214cd6a3aeSmrg  IFS=$as_save_IFS
82224cd6a3aeSmrg  test -z "$as_dir" && as_dir=.
82234cd6a3aeSmrg  for lt_ac_prog in sed gsed; do
82244cd6a3aeSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
82254cd6a3aeSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
82264cd6a3aeSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
82274cd6a3aeSmrg      fi
82284cd6a3aeSmrg    done
82294cd6a3aeSmrg  done
82304cd6a3aeSmrgdone
82314cd6a3aeSmrgIFS=$as_save_IFS
82324cd6a3aeSmrglt_ac_max=0
82334cd6a3aeSmrglt_ac_count=0
82344cd6a3aeSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
82354cd6a3aeSmrg# along with /bin/sed that truncates output.
82364cd6a3aeSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
823754044362Smrg  test ! -f "$lt_ac_sed" && continue
82384cd6a3aeSmrg  cat /dev/null > conftest.in
82394cd6a3aeSmrg  lt_ac_count=0
82404cd6a3aeSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
82414cd6a3aeSmrg  # Check for GNU sed and select it if it is found.
82424cd6a3aeSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
82434cd6a3aeSmrg    lt_cv_path_SED=$lt_ac_sed
82444cd6a3aeSmrg    break
82458c9fbc29Smrg  fi
82464cd6a3aeSmrg  while true; do
82474cd6a3aeSmrg    cat conftest.in conftest.in >conftest.tmp
82484cd6a3aeSmrg    mv conftest.tmp conftest.in
82494cd6a3aeSmrg    cp conftest.in conftest.nl
82504cd6a3aeSmrg    echo >>conftest.nl
82514cd6a3aeSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
82524cd6a3aeSmrg    cmp -s conftest.out conftest.nl || break
82534cd6a3aeSmrg    # 10000 chars as input seems more than enough
825454044362Smrg    test 10 -lt "$lt_ac_count" && break
82554cd6a3aeSmrg    lt_ac_count=`expr $lt_ac_count + 1`
825654044362Smrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
82574cd6a3aeSmrg      lt_ac_max=$lt_ac_count
82584cd6a3aeSmrg      lt_cv_path_SED=$lt_ac_sed
82594cd6a3aeSmrg    fi
82604cd6a3aeSmrg  done
82614cd6a3aeSmrgdone
82624cd6a3aeSmrg])
82634cd6a3aeSmrgSED=$lt_cv_path_SED
82644cd6a3aeSmrgAC_SUBST([SED])
82654cd6a3aeSmrgAC_MSG_RESULT([$SED])
82664cd6a3aeSmrg])#AC_PROG_SED
82674cd6a3aeSmrg])#m4_ifndef
82684cd6a3aeSmrg
82694cd6a3aeSmrg# Old name:
82704cd6a3aeSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
82714cd6a3aeSmrgdnl aclocal-1.4 backwards compatibility:
82724cd6a3aeSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
82734cd6a3aeSmrg
82744cd6a3aeSmrg
82754cd6a3aeSmrg# _LT_CHECK_SHELL_FEATURES
82764cd6a3aeSmrg# ------------------------
82774cd6a3aeSmrg# Find out whether the shell is Bourne or XSI compatible,
82784cd6a3aeSmrg# or has some other useful features.
82794cd6a3aeSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
828054044362Smrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
82814cd6a3aeSmrg  lt_unset=unset
82824cd6a3aeSmrgelse
82834cd6a3aeSmrg  lt_unset=false
82844cd6a3aeSmrgfi
82854cd6a3aeSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
82864cd6a3aeSmrg
82874cd6a3aeSmrg# test EBCDIC or ASCII
82884cd6a3aeSmrgcase `echo X|tr X '\101'` in
82894cd6a3aeSmrg A) # ASCII based system
82904cd6a3aeSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
82914cd6a3aeSmrg  lt_SP2NL='tr \040 \012'
82924cd6a3aeSmrg  lt_NL2SP='tr \015\012 \040\040'
82934cd6a3aeSmrg  ;;
82944cd6a3aeSmrg *) # EBCDIC based system
82954cd6a3aeSmrg  lt_SP2NL='tr \100 \n'
82964cd6a3aeSmrg  lt_NL2SP='tr \r\n \100\100'
82974cd6a3aeSmrg  ;;
82984cd6a3aeSmrgesac
82994cd6a3aeSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
83004cd6a3aeSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
83014cd6a3aeSmrg])# _LT_CHECK_SHELL_FEATURES
83024cd6a3aeSmrg
83034cd6a3aeSmrg
83044cd6a3aeSmrg# _LT_PATH_CONVERSION_FUNCTIONS
83054cd6a3aeSmrg# -----------------------------
830654044362Smrg# Determine what file name conversion functions should be used by
83074cd6a3aeSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
83084cd6a3aeSmrg# for certain cross-compile configurations and native mingw.
83094cd6a3aeSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
83104cd6a3aeSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
83114cd6a3aeSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
83124cd6a3aeSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
83134cd6a3aeSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
83144cd6a3aeSmrg[case $host in
83154cd6a3aeSmrg  *-*-mingw* )
83164cd6a3aeSmrg    case $build in
83174cd6a3aeSmrg      *-*-mingw* ) # actually msys
83184cd6a3aeSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
83194cd6a3aeSmrg        ;;
83204cd6a3aeSmrg      *-*-cygwin* )
83214cd6a3aeSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
83224cd6a3aeSmrg        ;;
83234cd6a3aeSmrg      * ) # otherwise, assume *nix
83244cd6a3aeSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
83254cd6a3aeSmrg        ;;
83264cd6a3aeSmrg    esac
83274cd6a3aeSmrg    ;;
83284cd6a3aeSmrg  *-*-cygwin* )
83294cd6a3aeSmrg    case $build in
83304cd6a3aeSmrg      *-*-mingw* ) # actually msys
83314cd6a3aeSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
83324cd6a3aeSmrg        ;;
83334cd6a3aeSmrg      *-*-cygwin* )
83344cd6a3aeSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
83354cd6a3aeSmrg        ;;
83364cd6a3aeSmrg      * ) # otherwise, assume *nix
83374cd6a3aeSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
83384cd6a3aeSmrg        ;;
83394cd6a3aeSmrg    esac
83404cd6a3aeSmrg    ;;
83414cd6a3aeSmrg  * ) # unhandled hosts (and "normal" native builds)
83424cd6a3aeSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
83434cd6a3aeSmrg    ;;
83444cd6a3aeSmrgesac
83454cd6a3aeSmrg])
83464cd6a3aeSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
83474cd6a3aeSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
83484cd6a3aeSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
83494cd6a3aeSmrg         [0], [convert $build file names to $host format])dnl
83504cd6a3aeSmrg
83514cd6a3aeSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
83524cd6a3aeSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
83534cd6a3aeSmrg[#assume ordinary cross tools, or native build.
83544cd6a3aeSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
83554cd6a3aeSmrgcase $host in
83564cd6a3aeSmrg  *-*-mingw* )
83574cd6a3aeSmrg    case $build in
83584cd6a3aeSmrg      *-*-mingw* ) # actually msys
83594cd6a3aeSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
83604cd6a3aeSmrg        ;;
83614cd6a3aeSmrg    esac
83624cd6a3aeSmrg    ;;
83634cd6a3aeSmrgesac
83644cd6a3aeSmrg])
83654cd6a3aeSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
83664cd6a3aeSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
83674cd6a3aeSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
83684cd6a3aeSmrg         [0], [convert $build files to toolchain format])dnl
83694cd6a3aeSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
83704cd6a3aeSmrg
83714cd6a3aeSmrg# Helper functions for option handling.                    -*- Autoconf -*-
83724cd6a3aeSmrg#
837354044362Smrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
837454044362Smrg#   Foundation, Inc.
83754cd6a3aeSmrg#   Written by Gary V. Vaughan, 2004
83764cd6a3aeSmrg#
83774cd6a3aeSmrg# This file is free software; the Free Software Foundation gives
83784cd6a3aeSmrg# unlimited permission to copy and/or distribute it, with or without
83794cd6a3aeSmrg# modifications, as long as this notice is preserved.
83804cd6a3aeSmrg
838154044362Smrg# serial 8 ltoptions.m4
83824cd6a3aeSmrg
83834cd6a3aeSmrg# This is to help aclocal find these macros, as it can't see m4_define.
83844cd6a3aeSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
83854cd6a3aeSmrg
83868c9fbc29Smrg
83874cd6a3aeSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
83884cd6a3aeSmrg# ------------------------------------------
83894cd6a3aeSmrgm4_define([_LT_MANGLE_OPTION],
83904cd6a3aeSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
83918c9fbc29Smrg
83928c9fbc29Smrg
83934cd6a3aeSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
83944cd6a3aeSmrg# ---------------------------------------
83954cd6a3aeSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
83964cd6a3aeSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
83974cd6a3aeSmrg# saved as a flag.
83984cd6a3aeSmrgm4_define([_LT_SET_OPTION],
83994cd6a3aeSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
84004cd6a3aeSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
84014cd6a3aeSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
840254044362Smrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
84034cd6a3aeSmrg])
84048c9fbc29Smrg
84058c9fbc29Smrg
84064cd6a3aeSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
84074cd6a3aeSmrg# ------------------------------------------------------------
84084cd6a3aeSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
84094cd6a3aeSmrgm4_define([_LT_IF_OPTION],
84104cd6a3aeSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
84114cd6a3aeSmrg
84124cd6a3aeSmrg
84134cd6a3aeSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
84144cd6a3aeSmrg# -------------------------------------------------------
84154cd6a3aeSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
84164cd6a3aeSmrg# are set.
84174cd6a3aeSmrgm4_define([_LT_UNLESS_OPTIONS],
84184cd6a3aeSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
84194cd6a3aeSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
84204cd6a3aeSmrg		      [m4_define([$0_found])])])[]dnl
84214cd6a3aeSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
84224cd6a3aeSmrg])[]dnl
84234cd6a3aeSmrg])
84248c9fbc29Smrg
84258c9fbc29Smrg
84264cd6a3aeSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
84274cd6a3aeSmrg# ----------------------------------------
84284cd6a3aeSmrg# OPTION-LIST is a space-separated list of Libtool options associated
84294cd6a3aeSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
84304cd6a3aeSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
84314cd6a3aeSmrg# the unknown option and exit.
84324cd6a3aeSmrgm4_defun([_LT_SET_OPTIONS],
84334cd6a3aeSmrg[# Set options
84344cd6a3aeSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
84354cd6a3aeSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
84364cd6a3aeSmrg
84374cd6a3aeSmrgm4_if([$1],[LT_INIT],[
84384cd6a3aeSmrg  dnl
84394cd6a3aeSmrg  dnl Simply set some default values (i.e off) if boolean options were not
84404cd6a3aeSmrg  dnl specified:
84414cd6a3aeSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
84424cd6a3aeSmrg  ])
84434cd6a3aeSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
84444cd6a3aeSmrg  ])
84454cd6a3aeSmrg  dnl
84464cd6a3aeSmrg  dnl If no reference was made to various pairs of opposing options, then
84474cd6a3aeSmrg  dnl we run the default mode handler for the pair.  For example, if neither
844854044362Smrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
84494cd6a3aeSmrg  dnl archives by default:
84504cd6a3aeSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
84514cd6a3aeSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
84524cd6a3aeSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
84534cd6a3aeSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
845454044362Smrg		   [_LT_ENABLE_FAST_INSTALL])
845554044362Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
845654044362Smrg		   [_LT_WITH_AIX_SONAME([aix])])
84574cd6a3aeSmrg  ])
84584cd6a3aeSmrg])# _LT_SET_OPTIONS
84594cd6a3aeSmrg
84604cd6a3aeSmrg
84614cd6a3aeSmrg
84624cd6a3aeSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
84634cd6a3aeSmrg# -----------------------------------------
84644cd6a3aeSmrgm4_define([_LT_MANGLE_DEFUN],
84654cd6a3aeSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
84664cd6a3aeSmrg
84674cd6a3aeSmrg
84684cd6a3aeSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
84694cd6a3aeSmrg# -----------------------------------------------
84704cd6a3aeSmrgm4_define([LT_OPTION_DEFINE],
84714cd6a3aeSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
84724cd6a3aeSmrg])# LT_OPTION_DEFINE
84734cd6a3aeSmrg
84744cd6a3aeSmrg
84754cd6a3aeSmrg# dlopen
84764cd6a3aeSmrg# ------
84774cd6a3aeSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
84784cd6a3aeSmrg])
84794cd6a3aeSmrg
84804cd6a3aeSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
84814cd6a3aeSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
84824cd6a3aeSmrgAC_DIAGNOSE([obsolete],
84834cd6a3aeSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
848454044362Smrgput the 'dlopen' option into LT_INIT's first parameter.])
84854cd6a3aeSmrg])
84864cd6a3aeSmrg
84874cd6a3aeSmrgdnl aclocal-1.4 backwards compatibility:
84884cd6a3aeSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
84894cd6a3aeSmrg
84904cd6a3aeSmrg
84914cd6a3aeSmrg# win32-dll
84924cd6a3aeSmrg# ---------
84934cd6a3aeSmrg# Declare package support for building win32 dll's.
84944cd6a3aeSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
84954cd6a3aeSmrg[enable_win32_dll=yes
84964cd6a3aeSmrg
84974cd6a3aeSmrgcase $host in
84984cd6a3aeSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
84994cd6a3aeSmrg  AC_CHECK_TOOL(AS, as, false)
85004cd6a3aeSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
85014cd6a3aeSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
85024cd6a3aeSmrg  ;;
85034cd6a3aeSmrgesac
85044cd6a3aeSmrg
85054cd6a3aeSmrgtest -z "$AS" && AS=as
85064cd6a3aeSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
85074cd6a3aeSmrg
85084cd6a3aeSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
85094cd6a3aeSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
85104cd6a3aeSmrg
85114cd6a3aeSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
85124cd6a3aeSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
85134cd6a3aeSmrg])# win32-dll
85144cd6a3aeSmrg
85154cd6a3aeSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
85164cd6a3aeSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
85174cd6a3aeSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
85184cd6a3aeSmrgAC_DIAGNOSE([obsolete],
85194cd6a3aeSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
852054044362Smrgput the 'win32-dll' option into LT_INIT's first parameter.])
85214cd6a3aeSmrg])
85224cd6a3aeSmrg
85234cd6a3aeSmrgdnl aclocal-1.4 backwards compatibility:
85244cd6a3aeSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
85254cd6a3aeSmrg
85264cd6a3aeSmrg
85274cd6a3aeSmrg# _LT_ENABLE_SHARED([DEFAULT])
85284cd6a3aeSmrg# ----------------------------
852954044362Smrg# implement the --enable-shared flag, and supports the 'shared' and
853054044362Smrg# 'disable-shared' LT_INIT options.
853154044362Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
85324cd6a3aeSmrgm4_define([_LT_ENABLE_SHARED],
85334cd6a3aeSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
85344cd6a3aeSmrgAC_ARG_ENABLE([shared],
85354cd6a3aeSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
85364cd6a3aeSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
85374cd6a3aeSmrg    [p=${PACKAGE-default}
85384cd6a3aeSmrg    case $enableval in
85394cd6a3aeSmrg    yes) enable_shared=yes ;;
85404cd6a3aeSmrg    no) enable_shared=no ;;
85414cd6a3aeSmrg    *)
85428c9fbc29Smrg      enable_shared=no
85434cd6a3aeSmrg      # Look at the argument we got.  We use all the common list separators.
854454044362Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
85454cd6a3aeSmrg      for pkg in $enableval; do
854654044362Smrg	IFS=$lt_save_ifs
85474cd6a3aeSmrg	if test "X$pkg" = "X$p"; then
85484cd6a3aeSmrg	  enable_shared=yes
85494cd6a3aeSmrg	fi
85504cd6a3aeSmrg      done
855154044362Smrg      IFS=$lt_save_ifs
85528c9fbc29Smrg      ;;
85534cd6a3aeSmrg    esac],
85544cd6a3aeSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
85558c9fbc29Smrg
85564cd6a3aeSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
85574cd6a3aeSmrg	[Whether or not to build shared libraries])
85584cd6a3aeSmrg])# _LT_ENABLE_SHARED
85598c9fbc29Smrg
85604cd6a3aeSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
85614cd6a3aeSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
85624cd6a3aeSmrg
85634cd6a3aeSmrg# Old names:
85644cd6a3aeSmrgAC_DEFUN([AC_ENABLE_SHARED],
85654cd6a3aeSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
85664cd6a3aeSmrg])
85674cd6a3aeSmrg
85684cd6a3aeSmrgAC_DEFUN([AC_DISABLE_SHARED],
85694cd6a3aeSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
85704cd6a3aeSmrg])
85714cd6a3aeSmrg
85724cd6a3aeSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
85734cd6a3aeSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
85744cd6a3aeSmrg
85754cd6a3aeSmrgdnl aclocal-1.4 backwards compatibility:
85764cd6a3aeSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
85774cd6a3aeSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
85788c9fbc29Smrg
85794cd6a3aeSmrg
85804cd6a3aeSmrg
85814cd6a3aeSmrg# _LT_ENABLE_STATIC([DEFAULT])
85824cd6a3aeSmrg# ----------------------------
858354044362Smrg# implement the --enable-static flag, and support the 'static' and
858454044362Smrg# 'disable-static' LT_INIT options.
858554044362Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
85864cd6a3aeSmrgm4_define([_LT_ENABLE_STATIC],
85874cd6a3aeSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
85884cd6a3aeSmrgAC_ARG_ENABLE([static],
85894cd6a3aeSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
85904cd6a3aeSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
85914cd6a3aeSmrg    [p=${PACKAGE-default}
85924cd6a3aeSmrg    case $enableval in
85934cd6a3aeSmrg    yes) enable_static=yes ;;
85944cd6a3aeSmrg    no) enable_static=no ;;
85958c9fbc29Smrg    *)
85964cd6a3aeSmrg     enable_static=no
85974cd6a3aeSmrg      # Look at the argument we got.  We use all the common list separators.
859854044362Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
85994cd6a3aeSmrg      for pkg in $enableval; do
860054044362Smrg	IFS=$lt_save_ifs
86014cd6a3aeSmrg	if test "X$pkg" = "X$p"; then
86024cd6a3aeSmrg	  enable_static=yes
86034cd6a3aeSmrg	fi
86044cd6a3aeSmrg      done
860554044362Smrg      IFS=$lt_save_ifs
86068c9fbc29Smrg      ;;
86074cd6a3aeSmrg    esac],
86084cd6a3aeSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
86098c9fbc29Smrg
86104cd6a3aeSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
86114cd6a3aeSmrg	[Whether or not to build static libraries])
86124cd6a3aeSmrg])# _LT_ENABLE_STATIC
86138c9fbc29Smrg
86144cd6a3aeSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
86154cd6a3aeSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
86168c9fbc29Smrg
86174cd6a3aeSmrg# Old names:
86184cd6a3aeSmrgAC_DEFUN([AC_ENABLE_STATIC],
86194cd6a3aeSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
86204cd6a3aeSmrg])
86218c9fbc29Smrg
86224cd6a3aeSmrgAC_DEFUN([AC_DISABLE_STATIC],
86234cd6a3aeSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
86244cd6a3aeSmrg])
86258c9fbc29Smrg
86264cd6a3aeSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
86274cd6a3aeSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
86288c9fbc29Smrg
86294cd6a3aeSmrgdnl aclocal-1.4 backwards compatibility:
86304cd6a3aeSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
86314cd6a3aeSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
86328c9fbc29Smrg
86334e411241Smrg
86348c9fbc29Smrg
86354cd6a3aeSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
86364cd6a3aeSmrg# ----------------------------------
863754044362Smrg# implement the --enable-fast-install flag, and support the 'fast-install'
863854044362Smrg# and 'disable-fast-install' LT_INIT options.
863954044362Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
86404cd6a3aeSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
86414cd6a3aeSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
86424cd6a3aeSmrgAC_ARG_ENABLE([fast-install],
86434cd6a3aeSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
86444cd6a3aeSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
86454cd6a3aeSmrg    [p=${PACKAGE-default}
86464cd6a3aeSmrg    case $enableval in
86474cd6a3aeSmrg    yes) enable_fast_install=yes ;;
86484cd6a3aeSmrg    no) enable_fast_install=no ;;
86494cd6a3aeSmrg    *)
86504cd6a3aeSmrg      enable_fast_install=no
86514cd6a3aeSmrg      # Look at the argument we got.  We use all the common list separators.
865254044362Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
86534cd6a3aeSmrg      for pkg in $enableval; do
865454044362Smrg	IFS=$lt_save_ifs
86554cd6a3aeSmrg	if test "X$pkg" = "X$p"; then
86564cd6a3aeSmrg	  enable_fast_install=yes
86574cd6a3aeSmrg	fi
86584cd6a3aeSmrg      done
865954044362Smrg      IFS=$lt_save_ifs
86608c9fbc29Smrg      ;;
86614cd6a3aeSmrg    esac],
86624cd6a3aeSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
86638c9fbc29Smrg
86644cd6a3aeSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
86654cd6a3aeSmrg	 [Whether or not to optimize for fast installation])dnl
86664cd6a3aeSmrg])# _LT_ENABLE_FAST_INSTALL
86674cd6a3aeSmrg
86684cd6a3aeSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
86694cd6a3aeSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
86704cd6a3aeSmrg
86714cd6a3aeSmrg# Old names:
86724cd6a3aeSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
86734cd6a3aeSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
86744cd6a3aeSmrgAC_DIAGNOSE([obsolete],
86754cd6a3aeSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
867654044362Smrgthe 'fast-install' option into LT_INIT's first parameter.])
86774cd6a3aeSmrg])
86784cd6a3aeSmrg
86794cd6a3aeSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
86804cd6a3aeSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
86814cd6a3aeSmrgAC_DIAGNOSE([obsolete],
86824cd6a3aeSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
868354044362Smrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
86844cd6a3aeSmrg])
86854cd6a3aeSmrg
86864cd6a3aeSmrgdnl aclocal-1.4 backwards compatibility:
86874cd6a3aeSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
86884cd6a3aeSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
86894cd6a3aeSmrg
86904cd6a3aeSmrg
869154044362Smrg# _LT_WITH_AIX_SONAME([DEFAULT])
869254044362Smrg# ----------------------------------
869354044362Smrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
869454044362Smrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
869554044362Smrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
869654044362Smrgm4_define([_LT_WITH_AIX_SONAME],
869754044362Smrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
869854044362Smrgshared_archive_member_spec=
869954044362Smrgcase $host,$enable_shared in
870054044362Smrgpower*-*-aix[[5-9]]*,yes)
870154044362Smrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
870254044362Smrg  AC_ARG_WITH([aix-soname],
870354044362Smrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
870454044362Smrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
870554044362Smrg    [case $withval in
870654044362Smrg    aix|svr4|both)
870754044362Smrg      ;;
870854044362Smrg    *)
870954044362Smrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
871054044362Smrg      ;;
871154044362Smrg    esac
871254044362Smrg    lt_cv_with_aix_soname=$with_aix_soname],
871354044362Smrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
871454044362Smrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
871554044362Smrg    with_aix_soname=$lt_cv_with_aix_soname])
871654044362Smrg  AC_MSG_RESULT([$with_aix_soname])
871754044362Smrg  if test aix != "$with_aix_soname"; then
871854044362Smrg    # For the AIX way of multilib, we name the shared archive member
871954044362Smrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
872054044362Smrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
872154044362Smrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
872254044362Smrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
872354044362Smrg    if test 64 = "${OBJECT_MODE-32}"; then
872454044362Smrg      shared_archive_member_spec=shr_64
872554044362Smrg    else
872654044362Smrg      shared_archive_member_spec=shr
872754044362Smrg    fi
872854044362Smrg  fi
872954044362Smrg  ;;
873054044362Smrg*)
873154044362Smrg  with_aix_soname=aix
873254044362Smrg  ;;
873354044362Smrgesac
873454044362Smrg
873554044362Smrg_LT_DECL([], [shared_archive_member_spec], [0],
873654044362Smrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
873754044362Smrg])# _LT_WITH_AIX_SONAME
873854044362Smrg
873954044362SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
874054044362SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
874154044362SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
874254044362Smrg
874354044362Smrg
87444cd6a3aeSmrg# _LT_WITH_PIC([MODE])
87454cd6a3aeSmrg# --------------------
874654044362Smrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
87474cd6a3aeSmrg# LT_INIT options.
874854044362Smrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
87494cd6a3aeSmrgm4_define([_LT_WITH_PIC],
87504cd6a3aeSmrg[AC_ARG_WITH([pic],
875170728a38Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
87524cd6a3aeSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
875370728a38Smrg    [lt_p=${PACKAGE-default}
875470728a38Smrg    case $withval in
875570728a38Smrg    yes|no) pic_mode=$withval ;;
875670728a38Smrg    *)
875770728a38Smrg      pic_mode=default
875870728a38Smrg      # Look at the argument we got.  We use all the common list separators.
875954044362Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
876070728a38Smrg      for lt_pkg in $withval; do
876154044362Smrg	IFS=$lt_save_ifs
876270728a38Smrg	if test "X$lt_pkg" = "X$lt_p"; then
876370728a38Smrg	  pic_mode=yes
876470728a38Smrg	fi
876570728a38Smrg      done
876654044362Smrg      IFS=$lt_save_ifs
876770728a38Smrg      ;;
876870728a38Smrg    esac],
876954044362Smrg    [pic_mode=m4_default([$1], [default])])
87704cd6a3aeSmrg
87714cd6a3aeSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
87724cd6a3aeSmrg])# _LT_WITH_PIC
87734cd6a3aeSmrg
87744cd6a3aeSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
87754cd6a3aeSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
87764cd6a3aeSmrg
87774cd6a3aeSmrg# Old name:
87784cd6a3aeSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
87794cd6a3aeSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
87804cd6a3aeSmrgAC_DIAGNOSE([obsolete],
87814cd6a3aeSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
878254044362Smrgput the 'pic-only' option into LT_INIT's first parameter.])
87834cd6a3aeSmrg])
87844cd6a3aeSmrg
87854cd6a3aeSmrgdnl aclocal-1.4 backwards compatibility:
87864cd6a3aeSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
87874cd6a3aeSmrg
87884cd6a3aeSmrg
87894cd6a3aeSmrgm4_define([_LTDL_MODE], [])
87904cd6a3aeSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
87914cd6a3aeSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
87924cd6a3aeSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
87934cd6a3aeSmrg		 [m4_define([_LTDL_MODE], [recursive])])
87944cd6a3aeSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
87954cd6a3aeSmrg		 [m4_define([_LTDL_MODE], [subproject])])
87964cd6a3aeSmrg
87974cd6a3aeSmrgm4_define([_LTDL_TYPE], [])
87984cd6a3aeSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
87994cd6a3aeSmrg		 [m4_define([_LTDL_TYPE], [installable])])
88004cd6a3aeSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
88014cd6a3aeSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
88024cd6a3aeSmrg
88034cd6a3aeSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
88044cd6a3aeSmrg#
880554044362Smrg# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
880654044362Smrg# Foundation, Inc.
88074cd6a3aeSmrg# Written by Gary V. Vaughan, 2004
88084cd6a3aeSmrg#
88094cd6a3aeSmrg# This file is free software; the Free Software Foundation gives
88104cd6a3aeSmrg# unlimited permission to copy and/or distribute it, with or without
88114cd6a3aeSmrg# modifications, as long as this notice is preserved.
88124cd6a3aeSmrg
88134cd6a3aeSmrg# serial 6 ltsugar.m4
88144cd6a3aeSmrg
88154cd6a3aeSmrg# This is to help aclocal find these macros, as it can't see m4_define.
88164cd6a3aeSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
88174cd6a3aeSmrg
88184cd6a3aeSmrg
88194cd6a3aeSmrg# lt_join(SEP, ARG1, [ARG2...])
88204cd6a3aeSmrg# -----------------------------
88214cd6a3aeSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
88224cd6a3aeSmrg# associated separator.
88234cd6a3aeSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
88244cd6a3aeSmrg# versions in m4sugar had bugs.
88254cd6a3aeSmrgm4_define([lt_join],
88264cd6a3aeSmrg[m4_if([$#], [1], [],
88274cd6a3aeSmrg       [$#], [2], [[$2]],
88284cd6a3aeSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
88294cd6a3aeSmrgm4_define([_lt_join],
88304cd6a3aeSmrg[m4_if([$#$2], [2], [],
88314cd6a3aeSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
88324cd6a3aeSmrg
88334cd6a3aeSmrg
88344cd6a3aeSmrg# lt_car(LIST)
88354cd6a3aeSmrg# lt_cdr(LIST)
88364cd6a3aeSmrg# ------------
88374cd6a3aeSmrg# Manipulate m4 lists.
88384cd6a3aeSmrg# These macros are necessary as long as will still need to support
883954044362Smrg# Autoconf-2.59, which quotes differently.
88404cd6a3aeSmrgm4_define([lt_car], [[$1]])
88414cd6a3aeSmrgm4_define([lt_cdr],
88424cd6a3aeSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
88434cd6a3aeSmrg       [$#], 1, [],
88444cd6a3aeSmrg       [m4_dquote(m4_shift($@))])])
88454cd6a3aeSmrgm4_define([lt_unquote], $1)
88464cd6a3aeSmrg
88474cd6a3aeSmrg
88484cd6a3aeSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
88494cd6a3aeSmrg# ------------------------------------------
885054044362Smrg# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
88514cd6a3aeSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
88524cd6a3aeSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
88534cd6a3aeSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
88544cd6a3aeSmrg# than defined and empty).
88554cd6a3aeSmrg#
88564cd6a3aeSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
88574cd6a3aeSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
88584cd6a3aeSmrgm4_define([lt_append],
88594cd6a3aeSmrg[m4_define([$1],
88604cd6a3aeSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
88614cd6a3aeSmrg
88624cd6a3aeSmrg
88634cd6a3aeSmrg
88644cd6a3aeSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
88654cd6a3aeSmrg# ----------------------------------------------------------
88664cd6a3aeSmrg# Produce a SEP delimited list of all paired combinations of elements of
88674cd6a3aeSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
88684cd6a3aeSmrg# has the form PREFIXmINFIXSUFFIXn.
88694cd6a3aeSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
88704cd6a3aeSmrgm4_define([lt_combine],
88714cd6a3aeSmrg[m4_if(m4_eval([$# > 3]), [1],
88724cd6a3aeSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
88734cd6a3aeSmrg[[m4_foreach([_Lt_prefix], [$2],
88744cd6a3aeSmrg	     [m4_foreach([_Lt_suffix],
88754cd6a3aeSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
88764cd6a3aeSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
88774cd6a3aeSmrg
88784cd6a3aeSmrg
88794cd6a3aeSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
88804cd6a3aeSmrg# -----------------------------------------------------------------------
88814cd6a3aeSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
88824cd6a3aeSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
88834cd6a3aeSmrgm4_define([lt_if_append_uniq],
88844cd6a3aeSmrg[m4_ifdef([$1],
88854cd6a3aeSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
88864cd6a3aeSmrg		 [lt_append([$1], [$2], [$3])$4],
88874cd6a3aeSmrg		 [$5])],
88884cd6a3aeSmrg	  [lt_append([$1], [$2], [$3])$4])])
88894cd6a3aeSmrg
88904cd6a3aeSmrg
88914cd6a3aeSmrg# lt_dict_add(DICT, KEY, VALUE)
88924cd6a3aeSmrg# -----------------------------
88934cd6a3aeSmrgm4_define([lt_dict_add],
88944cd6a3aeSmrg[m4_define([$1($2)], [$3])])
88958c9fbc29Smrg
88968c9fbc29Smrg
88974cd6a3aeSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
88984cd6a3aeSmrg# --------------------------------------------
88994cd6a3aeSmrgm4_define([lt_dict_add_subkey],
89004cd6a3aeSmrg[m4_define([$1($2:$3)], [$4])])
89018c9fbc29Smrg
89028c9fbc29Smrg
89034cd6a3aeSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
89044cd6a3aeSmrg# ----------------------------------
89054cd6a3aeSmrgm4_define([lt_dict_fetch],
89064cd6a3aeSmrg[m4_ifval([$3],
89074cd6a3aeSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
89084cd6a3aeSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
89098c9fbc29Smrg
89104cd6a3aeSmrg
89114cd6a3aeSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
89124cd6a3aeSmrg# -----------------------------------------------------------------
89134cd6a3aeSmrgm4_define([lt_if_dict_fetch],
89144cd6a3aeSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
89154cd6a3aeSmrg	[$5],
89164cd6a3aeSmrg    [$6])])
89174cd6a3aeSmrg
89184cd6a3aeSmrg
89194cd6a3aeSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
89204cd6a3aeSmrg# --------------------------------------------------------------
89214cd6a3aeSmrgm4_define([lt_dict_filter],
89224cd6a3aeSmrg[m4_if([$5], [], [],
89234cd6a3aeSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
89244cd6a3aeSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
89254cd6a3aeSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
89268c9fbc29Smrg])
89278c9fbc29Smrg
89284cd6a3aeSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
89298c9fbc29Smrg#
893054044362Smrg#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
89314cd6a3aeSmrg#   Written by Scott James Remnant, 2004
89328c9fbc29Smrg#
89334cd6a3aeSmrg# This file is free software; the Free Software Foundation gives
89344cd6a3aeSmrg# unlimited permission to copy and/or distribute it, with or without
89354cd6a3aeSmrg# modifications, as long as this notice is preserved.
89368c9fbc29Smrg
89374cd6a3aeSmrg# @configure_input@
89388c9fbc29Smrg
893954044362Smrg# serial 4179 ltversion.m4
89404cd6a3aeSmrg# This file is part of GNU Libtool
89418c9fbc29Smrg
894254044362Smrgm4_define([LT_PACKAGE_VERSION], [2.4.6])
894354044362Smrgm4_define([LT_PACKAGE_REVISION], [2.4.6])
89448c9fbc29Smrg
89454cd6a3aeSmrgAC_DEFUN([LTVERSION_VERSION],
894654044362Smrg[macro_version='2.4.6'
894754044362Smrgmacro_revision='2.4.6'
89484cd6a3aeSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
89494cd6a3aeSmrg_LT_DECL(, macro_revision, 0)
89504cd6a3aeSmrg])
89518c9fbc29Smrg
89524cd6a3aeSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
89534cd6a3aeSmrg#
895454044362Smrg#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
895554044362Smrg#   Foundation, Inc.
89564cd6a3aeSmrg#   Written by Scott James Remnant, 2004.
89574cd6a3aeSmrg#
89584cd6a3aeSmrg# This file is free software; the Free Software Foundation gives
89594cd6a3aeSmrg# unlimited permission to copy and/or distribute it, with or without
89604cd6a3aeSmrg# modifications, as long as this notice is preserved.
89618c9fbc29Smrg
89624cd6a3aeSmrg# serial 5 lt~obsolete.m4
89638c9fbc29Smrg
89644cd6a3aeSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
89654cd6a3aeSmrg#
896654044362Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
89674cd6a3aeSmrg# which have later been changed to m4_define as they aren't part of the
89684cd6a3aeSmrg# exported API, or moved to Autoconf or Automake where they belong.
89694cd6a3aeSmrg#
89704cd6a3aeSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
89714cd6a3aeSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
89724cd6a3aeSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
89734cd6a3aeSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
89744cd6a3aeSmrg# and doesn't know about Autoconf macros at all.)
89754cd6a3aeSmrg#
89764cd6a3aeSmrg# So we provide this file, which has a silly filename so it's always
89774cd6a3aeSmrg# included after everything else.  This provides aclocal with the
89784cd6a3aeSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
89794cd6a3aeSmrg# because those macros already exist, or will be overwritten later.
898054044362Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
89814cd6a3aeSmrg#
89824cd6a3aeSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
89834cd6a3aeSmrg# Yes, that means every name once taken will need to remain here until
89844cd6a3aeSmrg# we give up compatibility with versions before 1.7, at which point
89854cd6a3aeSmrg# we need to keep only those names which we still refer to.
89864cd6a3aeSmrg
89874cd6a3aeSmrg# This is to help aclocal find these macros, as it can't see m4_define.
89884cd6a3aeSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
89894cd6a3aeSmrg
89904cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
89914cd6a3aeSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
89924cd6a3aeSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
89934cd6a3aeSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
89944cd6a3aeSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
89954cd6a3aeSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
89964cd6a3aeSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
89974cd6a3aeSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
89984cd6a3aeSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
89994cd6a3aeSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
90004cd6a3aeSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
90014cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
90024cd6a3aeSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
90034cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
90044cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
90054cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
90064cd6a3aeSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
90074cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
90084cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
90094cd6a3aeSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
90104cd6a3aeSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
90114cd6a3aeSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
90124cd6a3aeSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
90134cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
90144cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
90154cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
90164cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
90174cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
90184cd6a3aeSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
90194cd6a3aeSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
90204cd6a3aeSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
90214cd6a3aeSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
90224cd6a3aeSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
90234cd6a3aeSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
90244cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
90254cd6a3aeSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
90264cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
90274cd6a3aeSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
90284cd6a3aeSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
90294cd6a3aeSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
90304cd6a3aeSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
90314cd6a3aeSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
90324cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
90334cd6a3aeSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
90344cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
90354cd6a3aeSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
90364cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
90374cd6a3aeSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
90384cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
90394cd6a3aeSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
90404cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
90414cd6a3aeSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
90424cd6a3aeSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
90434cd6a3aeSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
90444cd6a3aeSmrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
90454cd6a3aeSmrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
90464cd6a3aeSmrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
90474cd6a3aeSmrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
90484cd6a3aeSmrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
90494cd6a3aeSmrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
90504cd6a3aeSmrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
90518c9fbc29Smrg
905254044362Smrgdnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
905354044362Smrgdnl serial 11 (pkg-config-0.29)
905454044362Smrgdnl
905554044362Smrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
905654044362Smrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
905754044362Smrgdnl
905854044362Smrgdnl This program is free software; you can redistribute it and/or modify
905954044362Smrgdnl it under the terms of the GNU General Public License as published by
906054044362Smrgdnl the Free Software Foundation; either version 2 of the License, or
906154044362Smrgdnl (at your option) any later version.
906254044362Smrgdnl
906354044362Smrgdnl This program is distributed in the hope that it will be useful, but
906454044362Smrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of
906554044362Smrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
906654044362Smrgdnl General Public License for more details.
906754044362Smrgdnl
906854044362Smrgdnl You should have received a copy of the GNU General Public License
906954044362Smrgdnl along with this program; if not, write to the Free Software
907054044362Smrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
907154044362Smrgdnl 02111-1307, USA.
907254044362Smrgdnl
907354044362Smrgdnl As a special exception to the GNU General Public License, if you
907454044362Smrgdnl distribute this file as part of a program that contains a
907554044362Smrgdnl configuration script generated by Autoconf, you may include it under
907654044362Smrgdnl the same distribution terms that you use for the rest of that
907754044362Smrgdnl program.
907854044362Smrg
907954044362Smrgdnl PKG_PREREQ(MIN-VERSION)
908054044362Smrgdnl -----------------------
908154044362Smrgdnl Since: 0.29
908254044362Smrgdnl
908354044362Smrgdnl Verify that the version of the pkg-config macros are at least
908454044362Smrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
908554044362Smrgdnl installed version of pkg-config, this checks the developer's version
908654044362Smrgdnl of pkg.m4 when generating configure.
908754044362Smrgdnl
908854044362Smrgdnl To ensure that this macro is defined, also add:
908954044362Smrgdnl m4_ifndef([PKG_PREREQ],
909054044362Smrgdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
909154044362Smrgdnl
909254044362Smrgdnl See the "Since" comment for each macro you use to see what version
909354044362Smrgdnl of the macros you require.
909454044362Smrgm4_defun([PKG_PREREQ],
909554044362Smrg[m4_define([PKG_MACROS_VERSION], [0.29])
909654044362Smrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
909754044362Smrg    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
909854044362Smrg])dnl PKG_PREREQ
909954044362Smrg
910054044362Smrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
910154044362Smrgdnl ----------------------------------
910254044362Smrgdnl Since: 0.16
910354044362Smrgdnl
910454044362Smrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
910554044362Smrgdnl first found in the path. Checks that the version of pkg-config found
910654044362Smrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
910754044362Smrgdnl used since that's the first version where most current features of
910854044362Smrgdnl pkg-config existed.
910970728a38SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
911070728a38Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
911154044362Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
911254044362Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
911354044362SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
911454044362SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
911554044362SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
911654044362Smrg
911770728a38Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
911870728a38Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
911970728a38Smrgfi
912070728a38Smrgif test -n "$PKG_CONFIG"; then
912170728a38Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
912270728a38Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
912370728a38Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
912470728a38Smrg		AC_MSG_RESULT([yes])
912570728a38Smrg	else
912670728a38Smrg		AC_MSG_RESULT([no])
912770728a38Smrg		PKG_CONFIG=""
912870728a38Smrg	fi
912970728a38Smrgfi[]dnl
913054044362Smrg])dnl PKG_PROG_PKG_CONFIG
913170728a38Smrg
913254044362Smrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
913354044362Smrgdnl -------------------------------------------------------------------
913454044362Smrgdnl Since: 0.18
913554044362Smrgdnl
913654044362Smrgdnl Check to see whether a particular set of modules exists. Similar to
913754044362Smrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
913854044362Smrgdnl
913954044362Smrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
914054044362Smrgdnl only at the first occurence in configure.ac, so if the first place
914154044362Smrgdnl it's called might be skipped (such as if it is within an "if", you
914254044362Smrgdnl have to call PKG_CHECK_EXISTS manually
914370728a38SmrgAC_DEFUN([PKG_CHECK_EXISTS],
914470728a38Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
914570728a38Smrgif test -n "$PKG_CONFIG" && \
914670728a38Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
914754044362Smrg  m4_default([$2], [:])
914870728a38Smrgm4_ifvaln([$3], [else
914970728a38Smrg  $3])dnl
915070728a38Smrgfi])
915170728a38Smrg
915254044362Smrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
915354044362Smrgdnl ---------------------------------------------
915454044362Smrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
915554044362Smrgdnl pkg_failed based on the result.
915670728a38Smrgm4_define([_PKG_CONFIG],
915770728a38Smrg[if test -n "$$1"; then
915870728a38Smrg    pkg_cv_[]$1="$$1"
915970728a38Smrg elif test -n "$PKG_CONFIG"; then
916070728a38Smrg    PKG_CHECK_EXISTS([$3],
916154044362Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
916254044362Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
916370728a38Smrg		     [pkg_failed=yes])
916470728a38Smrg else
916570728a38Smrg    pkg_failed=untried
916670728a38Smrgfi[]dnl
916754044362Smrg])dnl _PKG_CONFIG
916870728a38Smrg
916954044362Smrgdnl _PKG_SHORT_ERRORS_SUPPORTED
917054044362Smrgdnl ---------------------------
917154044362Smrgdnl Internal check to see if pkg-config supports short errors.
917270728a38SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
917370728a38Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
917470728a38Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
917570728a38Smrg        _pkg_short_errors_supported=yes
917670728a38Smrgelse
917770728a38Smrg        _pkg_short_errors_supported=no
917870728a38Smrgfi[]dnl
917954044362Smrg])dnl _PKG_SHORT_ERRORS_SUPPORTED
918070728a38Smrg
918170728a38Smrg
918254044362Smrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
918354044362Smrgdnl   [ACTION-IF-NOT-FOUND])
918454044362Smrgdnl --------------------------------------------------------------
918554044362Smrgdnl Since: 0.4.0
918654044362Smrgdnl
918754044362Smrgdnl Note that if there is a possibility the first call to
918854044362Smrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
918954044362Smrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
919070728a38SmrgAC_DEFUN([PKG_CHECK_MODULES],
919170728a38Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
919270728a38SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
919370728a38SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
919470728a38Smrg
919570728a38Smrgpkg_failed=no
919670728a38SmrgAC_MSG_CHECKING([for $1])
919770728a38Smrg
919870728a38Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
919970728a38Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
920070728a38Smrg
920170728a38Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
920270728a38Smrgand $1[]_LIBS to avoid the need to call pkg-config.
920370728a38SmrgSee the pkg-config man page for more details.])
920470728a38Smrg
920570728a38Smrgif test $pkg_failed = yes; then
920654044362Smrg   	AC_MSG_RESULT([no])
920770728a38Smrg        _PKG_SHORT_ERRORS_SUPPORTED
920870728a38Smrg        if test $_pkg_short_errors_supported = yes; then
920954044362Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
921070728a38Smrg        else 
921154044362Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
921270728a38Smrg        fi
921370728a38Smrg	# Put the nasty error message in config.log where it belongs
921470728a38Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
921570728a38Smrg
921654044362Smrg	m4_default([$4], [AC_MSG_ERROR(
921770728a38Smrg[Package requirements ($2) were not met:
921870728a38Smrg
921970728a38Smrg$$1_PKG_ERRORS
922070728a38Smrg
922170728a38SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
922270728a38Smrginstalled software in a non-standard prefix.
922370728a38Smrg
922454044362Smrg_PKG_TEXT])[]dnl
922554044362Smrg        ])
922670728a38Smrgelif test $pkg_failed = untried; then
922754044362Smrg     	AC_MSG_RESULT([no])
922854044362Smrg	m4_default([$4], [AC_MSG_FAILURE(
922970728a38Smrg[The pkg-config script could not be found or is too old.  Make sure it
923070728a38Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
923170728a38Smrgpath to pkg-config.
923270728a38Smrg
923370728a38Smrg_PKG_TEXT
923470728a38Smrg
923554044362SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
923654044362Smrg        ])
923770728a38Smrgelse
923870728a38Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
923970728a38Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
924070728a38Smrg        AC_MSG_RESULT([yes])
924154044362Smrg	$3
924270728a38Smrgfi[]dnl
924354044362Smrg])dnl PKG_CHECK_MODULES
924454044362Smrg
924554044362Smrg
924654044362Smrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
924754044362Smrgdnl   [ACTION-IF-NOT-FOUND])
924854044362Smrgdnl ---------------------------------------------------------------------
924954044362Smrgdnl Since: 0.29
925054044362Smrgdnl
925154044362Smrgdnl Checks for existence of MODULES and gathers its build flags with
925254044362Smrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
925354044362Smrgdnl and VARIABLE-PREFIX_LIBS from --libs.
925454044362Smrgdnl
925554044362Smrgdnl Note that if there is a possibility the first call to
925654044362Smrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
925754044362Smrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
925854044362Smrgdnl configure.ac.
925954044362SmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC],
926054044362Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
926154044362Smrg_save_PKG_CONFIG=$PKG_CONFIG
926254044362SmrgPKG_CONFIG="$PKG_CONFIG --static"
926354044362SmrgPKG_CHECK_MODULES($@)
926454044362SmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl
926554044362Smrg])dnl PKG_CHECK_MODULES_STATIC
926654044362Smrg
926754044362Smrg
926854044362Smrgdnl PKG_INSTALLDIR([DIRECTORY])
926954044362Smrgdnl -------------------------
927054044362Smrgdnl Since: 0.27
927154044362Smrgdnl
927254044362Smrgdnl Substitutes the variable pkgconfigdir as the location where a module
927354044362Smrgdnl should install pkg-config .pc files. By default the directory is
927454044362Smrgdnl $libdir/pkgconfig, but the default can be changed by passing
927554044362Smrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir
927654044362Smrgdnl parameter.
927754044362SmrgAC_DEFUN([PKG_INSTALLDIR],
927854044362Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
927954044362Smrgm4_pushdef([pkg_description],
928054044362Smrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
928154044362SmrgAC_ARG_WITH([pkgconfigdir],
928254044362Smrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
928354044362Smrg    [with_pkgconfigdir=]pkg_default)
928454044362SmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
928554044362Smrgm4_popdef([pkg_default])
928654044362Smrgm4_popdef([pkg_description])
928754044362Smrg])dnl PKG_INSTALLDIR
928854044362Smrg
928954044362Smrg
929054044362Smrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
929154044362Smrgdnl --------------------------------
929254044362Smrgdnl Since: 0.27
929354044362Smrgdnl
929454044362Smrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a
929554044362Smrgdnl module should install arch-independent pkg-config .pc files. By
929654044362Smrgdnl default the directory is $datadir/pkgconfig, but the default can be
929754044362Smrgdnl changed by passing DIRECTORY. The user can override through the
929854044362Smrgdnl --with-noarch-pkgconfigdir parameter.
929954044362SmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
930054044362Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
930154044362Smrgm4_pushdef([pkg_description],
930254044362Smrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
930354044362SmrgAC_ARG_WITH([noarch-pkgconfigdir],
930454044362Smrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
930554044362Smrg    [with_noarch_pkgconfigdir=]pkg_default)
930654044362SmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
930754044362Smrgm4_popdef([pkg_default])
930854044362Smrgm4_popdef([pkg_description])
930954044362Smrg])dnl PKG_NOARCH_INSTALLDIR
931054044362Smrg
931154044362Smrg
931254044362Smrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
931354044362Smrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
931454044362Smrgdnl -------------------------------------------
931554044362Smrgdnl Since: 0.28
931654044362Smrgdnl
931754044362Smrgdnl Retrieves the value of the pkg-config variable for the given module.
931854044362SmrgAC_DEFUN([PKG_CHECK_VAR],
931954044362Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
932054044362SmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
932154044362Smrg
932254044362Smrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
932354044362SmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
932454044362Smrg
932554044362SmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
932654044362Smrg])dnl PKG_CHECK_VAR
932770728a38Smrg
93284cd6a3aeSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
93294cd6a3aeSmrgdnl
933054044362Smrgdnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
933170728a38Smrgdnl
93324cd6a3aeSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
93334cd6a3aeSmrgdnl copy of this software and associated documentation files (the "Software"),
93344cd6a3aeSmrgdnl to deal in the Software without restriction, including without limitation
93354cd6a3aeSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
93364cd6a3aeSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
93374cd6a3aeSmrgdnl Software is furnished to do so, subject to the following conditions:
93384cd6a3aeSmrgdnl
93394cd6a3aeSmrgdnl The above copyright notice and this permission notice (including the next
93404cd6a3aeSmrgdnl paragraph) shall be included in all copies or substantial portions of the
93414cd6a3aeSmrgdnl Software.
93424cd6a3aeSmrgdnl
93434cd6a3aeSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
93444cd6a3aeSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
93454cd6a3aeSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
93464cd6a3aeSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
93474cd6a3aeSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93484cd6a3aeSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
93494cd6a3aeSmrgdnl DEALINGS IN THE SOFTWARE.
93508c9fbc29Smrg
93514cd6a3aeSmrg# XORG_MACROS_VERSION(required-version)
93524cd6a3aeSmrg# -------------------------------------
93534cd6a3aeSmrg# Minimum version: 1.1.0
93544cd6a3aeSmrg#
93554cd6a3aeSmrg# If you're using a macro added in Version 1.1 or newer, include this in
93564cd6a3aeSmrg# your configure.ac with the minimum required version, such as:
93574cd6a3aeSmrg# XORG_MACROS_VERSION(1.1)
93584cd6a3aeSmrg#
93594cd6a3aeSmrg# To ensure that this macro is defined, also add:
93604cd6a3aeSmrg# m4_ifndef([XORG_MACROS_VERSION],
93614cd6a3aeSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
93624cd6a3aeSmrg#
93634cd6a3aeSmrg#
936470728a38Smrg# See the "minimum version" comment for each macro you use to see what
93654cd6a3aeSmrg# version you require.
93664cd6a3aeSmrgm4_defun([XORG_MACROS_VERSION],[
936770728a38Smrgm4_define([vers_have], [1.19.0])
93684cd6a3aeSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
93694cd6a3aeSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
93704cd6a3aeSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
93714cd6a3aeSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
93724cd6a3aeSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
93734cd6a3aeSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
93744cd6a3aeSmrgm4_undefine([vers_have])
93754cd6a3aeSmrgm4_undefine([maj_have])
93764cd6a3aeSmrgm4_undefine([maj_needed])
93774cd6a3aeSmrg]) # XORG_MACROS_VERSION
93788c9fbc29Smrg
93794cd6a3aeSmrg# XORG_PROG_RAWCPP()
93804cd6a3aeSmrg# ------------------
93814cd6a3aeSmrg# Minimum version: 1.0.0
93824cd6a3aeSmrg#
93834cd6a3aeSmrg# Find cpp program and necessary flags for use in pre-processing text files
93844cd6a3aeSmrg# such as man pages and config files
93854cd6a3aeSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
93864cd6a3aeSmrgAC_REQUIRE([AC_PROG_CPP])
938770728a38SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
93884cd6a3aeSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
93898c9fbc29Smrg
93904cd6a3aeSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
93914cd6a3aeSmrg# which is not the best choice for supporting other OS'es, but covers most
93924cd6a3aeSmrg# of the ones we need for now.
93934cd6a3aeSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
93944cd6a3aeSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
93954cd6a3aeSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
93964cd6a3aeSmrg	AC_MSG_RESULT([no])
93974cd6a3aeSmrgelse
93984cd6a3aeSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
93994cd6a3aeSmrg		RAWCPPFLAGS=-undef
94004cd6a3aeSmrg		AC_MSG_RESULT([yes])
94014cd6a3aeSmrg	# under Cygwin unix is still defined even with -undef
94024cd6a3aeSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
94034cd6a3aeSmrg		RAWCPPFLAGS="-undef -ansi"
94044cd6a3aeSmrg		AC_MSG_RESULT([yes, with -ansi])
94058c9fbc29Smrg	else
94064cd6a3aeSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
94078c9fbc29Smrg	fi
94084cd6a3aeSmrgfi
94094cd6a3aeSmrgrm -f conftest.$ac_ext
94108c9fbc29Smrg
94114cd6a3aeSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
94124cd6a3aeSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
94134cd6a3aeSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
94144cd6a3aeSmrg	AC_MSG_RESULT([no])
94154cd6a3aeSmrgelse
94164cd6a3aeSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
941770728a38Smrg		TRADITIONALCPPFLAGS="-traditional"
94184cd6a3aeSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
94194cd6a3aeSmrg		AC_MSG_RESULT([yes])
94204cd6a3aeSmrg	else
94214cd6a3aeSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
94224cd6a3aeSmrg	fi
94234cd6a3aeSmrgfi
94244cd6a3aeSmrgrm -f conftest.$ac_ext
94254cd6a3aeSmrgAC_SUBST(RAWCPPFLAGS)
942670728a38SmrgAC_SUBST(TRADITIONALCPPFLAGS)
94274cd6a3aeSmrg]) # XORG_PROG_RAWCPP
94288c9fbc29Smrg
94294cd6a3aeSmrg# XORG_MANPAGE_SECTIONS()
94304cd6a3aeSmrg# -----------------------
94314cd6a3aeSmrg# Minimum version: 1.0.0
94324cd6a3aeSmrg#
94334cd6a3aeSmrg# Determine which sections man pages go in for the different man page types
94344cd6a3aeSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
94354cd6a3aeSmrg# Not sure if there's any better way than just hardcoding by OS name.
94364cd6a3aeSmrg# Override default settings by setting environment variables
94374cd6a3aeSmrg# Added MAN_SUBSTS in version 1.8
94384cd6a3aeSmrg# Added AC_PROG_SED in version 1.8
94398c9fbc29Smrg
94404cd6a3aeSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
94414cd6a3aeSmrgAC_REQUIRE([AC_CANONICAL_HOST])
94424cd6a3aeSmrgAC_REQUIRE([AC_PROG_SED])
94438c9fbc29Smrg
94444cd6a3aeSmrgif test x$APP_MAN_SUFFIX = x    ; then
94454cd6a3aeSmrg    APP_MAN_SUFFIX=1
94464cd6a3aeSmrgfi
94474cd6a3aeSmrgif test x$APP_MAN_DIR = x    ; then
94484cd6a3aeSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
94494cd6a3aeSmrgfi
94508c9fbc29Smrg
94514cd6a3aeSmrgif test x$LIB_MAN_SUFFIX = x    ; then
94524cd6a3aeSmrg    LIB_MAN_SUFFIX=3
94534cd6a3aeSmrgfi
94544cd6a3aeSmrgif test x$LIB_MAN_DIR = x    ; then
94554cd6a3aeSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
94564cd6a3aeSmrgfi
94578c9fbc29Smrg
94584cd6a3aeSmrgif test x$FILE_MAN_SUFFIX = x    ; then
94594cd6a3aeSmrg    case $host_os in
946054044362Smrg	# Solaris 2.0 - 11 use SysV man page sections
946154044362Smrg	solaris2.?|solaris2.1[[01]])	FILE_MAN_SUFFIX=4  ;;
946254044362Smrg	*)				FILE_MAN_SUFFIX=5  ;;
94634cd6a3aeSmrg    esac
94644cd6a3aeSmrgfi
94654cd6a3aeSmrgif test x$FILE_MAN_DIR = x    ; then
94664cd6a3aeSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
94674cd6a3aeSmrgfi
94688c9fbc29Smrg
94694cd6a3aeSmrgif test x$MISC_MAN_SUFFIX = x    ; then
94704cd6a3aeSmrg    case $host_os in
947154044362Smrg	# Solaris 2.0 - 11 use SysV man page sections
947254044362Smrg	solaris2.?|solaris2.1[[01]])	MISC_MAN_SUFFIX=5  ;;
947354044362Smrg	*)				MISC_MAN_SUFFIX=7  ;;
94744cd6a3aeSmrg    esac
94754cd6a3aeSmrgfi
94764cd6a3aeSmrgif test x$MISC_MAN_DIR = x    ; then
94774cd6a3aeSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
94784cd6a3aeSmrgfi
94798c9fbc29Smrg
94804cd6a3aeSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
94814cd6a3aeSmrg    case $host_os in
948254044362Smrg	# Solaris 2.0 - 11 use SysV man page sections
948354044362Smrg	solaris2.?|solaris2.1[[01]])	DRIVER_MAN_SUFFIX=7  ;;
948454044362Smrg	*)				DRIVER_MAN_SUFFIX=4  ;;
94858c9fbc29Smrg    esac
94864cd6a3aeSmrgfi
94874cd6a3aeSmrgif test x$DRIVER_MAN_DIR = x    ; then
94884cd6a3aeSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
94894cd6a3aeSmrgfi
94908c9fbc29Smrg
94914cd6a3aeSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
94928c9fbc29Smrg    case $host_os in
949354044362Smrg	# Solaris 2.0 - 11 use SysV man page sections
949454044362Smrg	solaris2.?|solaris2.1[[01]])	ADMIN_MAN_SUFFIX=1m ;;
949554044362Smrg	*)				ADMIN_MAN_SUFFIX=8  ;;
94964cd6a3aeSmrg    esac
94974cd6a3aeSmrgfi
94984cd6a3aeSmrgif test x$ADMIN_MAN_DIR = x    ; then
94994cd6a3aeSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
95004cd6a3aeSmrgfi
95018c9fbc29Smrg
95028c9fbc29Smrg
95034cd6a3aeSmrgAC_SUBST([APP_MAN_SUFFIX])
95044cd6a3aeSmrgAC_SUBST([LIB_MAN_SUFFIX])
95054cd6a3aeSmrgAC_SUBST([FILE_MAN_SUFFIX])
95064cd6a3aeSmrgAC_SUBST([MISC_MAN_SUFFIX])
95074cd6a3aeSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
95084cd6a3aeSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
95094cd6a3aeSmrgAC_SUBST([APP_MAN_DIR])
95104cd6a3aeSmrgAC_SUBST([LIB_MAN_DIR])
95114cd6a3aeSmrgAC_SUBST([FILE_MAN_DIR])
95124cd6a3aeSmrgAC_SUBST([MISC_MAN_DIR])
95134cd6a3aeSmrgAC_SUBST([DRIVER_MAN_DIR])
95144cd6a3aeSmrgAC_SUBST([ADMIN_MAN_DIR])
95158c9fbc29Smrg
95164cd6a3aeSmrgXORG_MAN_PAGE="X Version 11"
95174cd6a3aeSmrgAC_SUBST([XORG_MAN_PAGE])
95184cd6a3aeSmrgMAN_SUBSTS="\
95194cd6a3aeSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
95204cd6a3aeSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
95214cd6a3aeSmrg	-e 's|__xservername__|Xorg|g' \
95224cd6a3aeSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
95234cd6a3aeSmrg	-e 's|__projectroot__|\$(prefix)|g' \
95244cd6a3aeSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
95254cd6a3aeSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
95264cd6a3aeSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
95274cd6a3aeSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
95284cd6a3aeSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
95294cd6a3aeSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
95304cd6a3aeSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
95314cd6a3aeSmrgAC_SUBST([MAN_SUBSTS])
95328c9fbc29Smrg
95334cd6a3aeSmrg]) # XORG_MANPAGE_SECTIONS
95348c9fbc29Smrg
95354cd6a3aeSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
95364cd6a3aeSmrg# ------------------------
95374cd6a3aeSmrg# Minimum version: 1.7.0
95384cd6a3aeSmrg#
95394cd6a3aeSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
95404cd6a3aeSmrg# provided by xorg-sgml-doctools, if installed.
95414cd6a3aeSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
95424cd6a3aeSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
95434cd6a3aeSmrgXORG_SGML_PATH=
95444cd6a3aeSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
95454cd6a3aeSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
95464cd6a3aeSmrg    [m4_ifval([$1],[:],
95474cd6a3aeSmrg        [if test x"$cross_compiling" != x"yes" ; then
95484cd6a3aeSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
95494cd6a3aeSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
95504cd6a3aeSmrg         fi])
95514cd6a3aeSmrg    ])
95528c9fbc29Smrg
95534cd6a3aeSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
95544cd6a3aeSmrg# the path and the name of the doc stylesheet
95554cd6a3aeSmrgif test "x$XORG_SGML_PATH" != "x" ; then
95564cd6a3aeSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
95574cd6a3aeSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
95584cd6a3aeSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
95594cd6a3aeSmrgelse
95604cd6a3aeSmrg   AC_MSG_RESULT([no])
95614cd6a3aeSmrgfi
95628c9fbc29Smrg
95634cd6a3aeSmrgAC_SUBST(XORG_SGML_PATH)
95644cd6a3aeSmrgAC_SUBST(STYLESHEET_SRCDIR)
95654cd6a3aeSmrgAC_SUBST(XSL_STYLESHEET)
95664cd6a3aeSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
95674cd6a3aeSmrg]) # XORG_CHECK_SGML_DOCTOOLS
95688c9fbc29Smrg
95694cd6a3aeSmrg# XORG_CHECK_LINUXDOC
95704cd6a3aeSmrg# -------------------
95714cd6a3aeSmrg# Minimum version: 1.0.0
95724cd6a3aeSmrg#
95734cd6a3aeSmrg# Defines the variable MAKE_TEXT if the necessary tools and
95744cd6a3aeSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
95754cd6a3aeSmrg# Whether or not the necessary tools and files are found can be checked
95764cd6a3aeSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
95774cd6a3aeSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
95784cd6a3aeSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
95794cd6a3aeSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
95808c9fbc29Smrg
95814cd6a3aeSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
95828c9fbc29Smrg
95834cd6a3aeSmrgAC_MSG_CHECKING([whether to build documentation])
95848c9fbc29Smrg
95854cd6a3aeSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
95864cd6a3aeSmrg   BUILDDOC=yes
95874cd6a3aeSmrgelse
95884cd6a3aeSmrg   BUILDDOC=no
95894cd6a3aeSmrgfi
95908c9fbc29Smrg
95914cd6a3aeSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
95928c9fbc29Smrg
95934cd6a3aeSmrgAC_MSG_RESULT([$BUILDDOC])
95948c9fbc29Smrg
95954cd6a3aeSmrgAC_MSG_CHECKING([whether to build pdf documentation])
95968c9fbc29Smrg
95974cd6a3aeSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
95984cd6a3aeSmrg   BUILDPDFDOC=yes
95994cd6a3aeSmrgelse
96004cd6a3aeSmrg   BUILDPDFDOC=no
96014cd6a3aeSmrgfi
96028c9fbc29Smrg
96034cd6a3aeSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
96048c9fbc29Smrg
96054cd6a3aeSmrgAC_MSG_RESULT([$BUILDPDFDOC])
96064cd6a3aeSmrg
96074cd6a3aeSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
96084cd6a3aeSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
96094cd6a3aeSmrgMAKE_PDF="$PS2PDF"
96104cd6a3aeSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
96114cd6a3aeSmrg
96124cd6a3aeSmrgAC_SUBST(MAKE_TEXT)
96134cd6a3aeSmrgAC_SUBST(MAKE_PS)
96144cd6a3aeSmrgAC_SUBST(MAKE_PDF)
96154cd6a3aeSmrgAC_SUBST(MAKE_HTML)
96164cd6a3aeSmrg]) # XORG_CHECK_LINUXDOC
96174cd6a3aeSmrg
96184cd6a3aeSmrg# XORG_CHECK_DOCBOOK
96194cd6a3aeSmrg# -------------------
96204cd6a3aeSmrg# Minimum version: 1.0.0
96214cd6a3aeSmrg#
96224cd6a3aeSmrg# Checks for the ability to build output formats from SGML DocBook source.
96234cd6a3aeSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
96244cd6a3aeSmrg# indicates whether the necessary tools and files are found and, if set,
96254cd6a3aeSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
96264cd6a3aeSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
96274cd6a3aeSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
96288c9fbc29Smrg
96294cd6a3aeSmrgBUILDTXTDOC=no
96304cd6a3aeSmrgBUILDPDFDOC=no
96314cd6a3aeSmrgBUILDPSDOC=no
96324cd6a3aeSmrgBUILDHTMLDOC=no
96338c9fbc29Smrg
96344cd6a3aeSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
96354cd6a3aeSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
96364cd6a3aeSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
96374cd6a3aeSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
96388c9fbc29Smrg
96394cd6a3aeSmrgAC_MSG_CHECKING([whether to build text documentation])
96404cd6a3aeSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
96414cd6a3aeSmrg   test x$BUILD_TXTDOC != xno; then
96424cd6a3aeSmrg	BUILDTXTDOC=yes
96434cd6a3aeSmrgfi
96444cd6a3aeSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
96454cd6a3aeSmrgAC_MSG_RESULT([$BUILDTXTDOC])
96468c9fbc29Smrg
96474cd6a3aeSmrgAC_MSG_CHECKING([whether to build PDF documentation])
96484cd6a3aeSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
96494cd6a3aeSmrg   test x$BUILD_PDFDOC != xno; then
96504cd6a3aeSmrg	BUILDPDFDOC=yes
96514cd6a3aeSmrgfi
96524cd6a3aeSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
96534cd6a3aeSmrgAC_MSG_RESULT([$BUILDPDFDOC])
96548c9fbc29Smrg
96554cd6a3aeSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
96564cd6a3aeSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
96574cd6a3aeSmrg   test x$BUILD_PSDOC != xno; then
96584cd6a3aeSmrg	BUILDPSDOC=yes
96594cd6a3aeSmrgfi
96604cd6a3aeSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
96614cd6a3aeSmrgAC_MSG_RESULT([$BUILDPSDOC])
96628c9fbc29Smrg
96634cd6a3aeSmrgAC_MSG_CHECKING([whether to build HTML documentation])
96644cd6a3aeSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
96654cd6a3aeSmrg   test x$BUILD_HTMLDOC != xno; then
96664cd6a3aeSmrg	BUILDHTMLDOC=yes
96674cd6a3aeSmrgfi
96684cd6a3aeSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
96694cd6a3aeSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
96708c9fbc29Smrg
96714cd6a3aeSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
96724cd6a3aeSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
96734cd6a3aeSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
96744cd6a3aeSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
96758c9fbc29Smrg
96764cd6a3aeSmrgAC_SUBST(MAKE_TEXT)
96774cd6a3aeSmrgAC_SUBST(MAKE_PS)
96784cd6a3aeSmrgAC_SUBST(MAKE_PDF)
96794cd6a3aeSmrgAC_SUBST(MAKE_HTML)
96804cd6a3aeSmrg]) # XORG_CHECK_DOCBOOK
96818c9fbc29Smrg
96824cd6a3aeSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
96834cd6a3aeSmrg# ----------------
96844cd6a3aeSmrg# Minimum version: 1.5.0
96854cd6a3aeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
96864cd6a3aeSmrg#
96874cd6a3aeSmrg# Documentation tools are not always available on all platforms and sometimes
96884cd6a3aeSmrg# not at the appropriate level. This macro enables a module to test for the
96894cd6a3aeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
96904cd6a3aeSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
96914cd6a3aeSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
96924cd6a3aeSmrg# --with-xmlto assumes 'auto'.
96934cd6a3aeSmrg#
96944cd6a3aeSmrg# Interface to module:
96954cd6a3aeSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
96964cd6a3aeSmrg# XMLTO:	returns the path of the xmlto program found
96974cd6a3aeSmrg#		returns the path set by the user in the environment
96984cd6a3aeSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
96994cd6a3aeSmrg#		'no' user instructs the module not to use xmlto
97004cd6a3aeSmrg#
97014cd6a3aeSmrg# Added in version 1.10.0
97024cd6a3aeSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
97034cd6a3aeSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
97044cd6a3aeSmrg#
97054cd6a3aeSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
97064cd6a3aeSmrg#
97074cd6a3aeSmrgAC_DEFUN([XORG_WITH_XMLTO],[
97084cd6a3aeSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
97094cd6a3aeSmrgm4_define([_defopt], m4_default([$2], [auto]))
97104cd6a3aeSmrgAC_ARG_WITH(xmlto,
97114cd6a3aeSmrg	AS_HELP_STRING([--with-xmlto],
97124cd6a3aeSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
97134cd6a3aeSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
97144cd6a3aeSmrgm4_undefine([_defopt])
97154cd6a3aeSmrg
97164cd6a3aeSmrgif test "x$use_xmlto" = x"auto"; then
97174cd6a3aeSmrg   AC_PATH_PROG([XMLTO], [xmlto])
97184cd6a3aeSmrg   if test "x$XMLTO" = "x"; then
97194cd6a3aeSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
97204cd6a3aeSmrg	have_xmlto=no
97214cd6a3aeSmrg   else
97224cd6a3aeSmrg        have_xmlto=yes
97234cd6a3aeSmrg   fi
97244cd6a3aeSmrgelif test "x$use_xmlto" = x"yes" ; then
97254cd6a3aeSmrg   AC_PATH_PROG([XMLTO], [xmlto])
97264cd6a3aeSmrg   if test "x$XMLTO" = "x"; then
97274cd6a3aeSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
97284cd6a3aeSmrg   fi
97294cd6a3aeSmrg   have_xmlto=yes
97304cd6a3aeSmrgelif test "x$use_xmlto" = x"no" ; then
97314cd6a3aeSmrg   if test "x$XMLTO" != "x"; then
97324cd6a3aeSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
97334cd6a3aeSmrg   fi
97344cd6a3aeSmrg   have_xmlto=no
97354cd6a3aeSmrgelse
97364cd6a3aeSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
97374cd6a3aeSmrgfi
97388c9fbc29Smrg
97394cd6a3aeSmrg# Test for a minimum version of xmlto, if provided.
97404cd6a3aeSmrgm4_ifval([$1],
97414cd6a3aeSmrg[if test "$have_xmlto" = yes; then
97424cd6a3aeSmrg    # scrape the xmlto version
97434cd6a3aeSmrg    AC_MSG_CHECKING([the xmlto version])
97444cd6a3aeSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
97454cd6a3aeSmrg    AC_MSG_RESULT([$xmlto_version])
97464cd6a3aeSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
97474cd6a3aeSmrg        [if test "x$use_xmlto" = xauto; then
97484cd6a3aeSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
97494cd6a3aeSmrg            have_xmlto=no
97504cd6a3aeSmrg        else
97514cd6a3aeSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
97524cd6a3aeSmrg        fi])
97534cd6a3aeSmrgfi])
97548c9fbc29Smrg
97554cd6a3aeSmrg# Test for the ability of xmlto to generate a text target
975654044362Smrg#
975754044362Smrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
975854044362Smrg# following test for empty XML docbook files.
975954044362Smrg# For compatibility reasons use the following empty XML docbook file and if
976054044362Smrg# it fails try it again with a non-empty XML file.
97614cd6a3aeSmrghave_xmlto_text=no
97624cd6a3aeSmrgcat > conftest.xml << "EOF"
97634cd6a3aeSmrgEOF
97644cd6a3aeSmrgAS_IF([test "$have_xmlto" = yes],
97654cd6a3aeSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
97664cd6a3aeSmrg             [have_xmlto_text=yes],
976754044362Smrg             [# Try it again with a non-empty XML file.
976854044362Smrg              cat > conftest.xml << "EOF"
976954044362Smrg<x></x>
977054044362SmrgEOF
977154044362Smrg              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
977254044362Smrg                    [have_xmlto_text=yes],
977354044362Smrg                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
97744cd6a3aeSmrgrm -f conftest.xml
97754cd6a3aeSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
97764cd6a3aeSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
97774cd6a3aeSmrg]) # XORG_WITH_XMLTO
97784cd6a3aeSmrg
97794cd6a3aeSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
97804cd6a3aeSmrg# --------------------------------------------
97814cd6a3aeSmrg# Minimum version: 1.12.0
97824cd6a3aeSmrg# Minimum version for optional DEFAULT argument: 1.12.0
97834cd6a3aeSmrg#
97844cd6a3aeSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
97854cd6a3aeSmrg# XML-based language used for the transformation of XML documents.
97864cd6a3aeSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
97874cd6a3aeSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
97884cd6a3aeSmrg# The XSLT processor is often used as a standalone tool for transformations.
97894cd6a3aeSmrg# It should not be assumed that this tool is used only to work with documnetation.
97904cd6a3aeSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
97914cd6a3aeSmrg#
97924cd6a3aeSmrg# Interface to module:
97934cd6a3aeSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
97944cd6a3aeSmrg# XSLTPROC:	 returns the path of the xsltproc program found
97954cd6a3aeSmrg#		 returns the path set by the user in the environment
97964cd6a3aeSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
97974cd6a3aeSmrg#		  'no' user instructs the module not to use xsltproc
97984cd6a3aeSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
97994cd6a3aeSmrg#
98004cd6a3aeSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
98014cd6a3aeSmrg#
98024cd6a3aeSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
98034cd6a3aeSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
98044cd6a3aeSmrg# Preserves the interface, should it be implemented later
98054cd6a3aeSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
98064cd6a3aeSmrgm4_define([_defopt], m4_default([$2], [auto]))
98074cd6a3aeSmrgAC_ARG_WITH(xsltproc,
98084cd6a3aeSmrg	AS_HELP_STRING([--with-xsltproc],
98094cd6a3aeSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
98104cd6a3aeSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
98114cd6a3aeSmrgm4_undefine([_defopt])
98124cd6a3aeSmrg
98134cd6a3aeSmrgif test "x$use_xsltproc" = x"auto"; then
98144cd6a3aeSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
98154cd6a3aeSmrg   if test "x$XSLTPROC" = "x"; then
98164cd6a3aeSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
98174cd6a3aeSmrg	have_xsltproc=no
98184cd6a3aeSmrg   else
98194cd6a3aeSmrg        have_xsltproc=yes
98204cd6a3aeSmrg   fi
98214cd6a3aeSmrgelif test "x$use_xsltproc" = x"yes" ; then
98224cd6a3aeSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
98234cd6a3aeSmrg   if test "x$XSLTPROC" = "x"; then
98244cd6a3aeSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
98254cd6a3aeSmrg   fi
98264cd6a3aeSmrg   have_xsltproc=yes
98274cd6a3aeSmrgelif test "x$use_xsltproc" = x"no" ; then
98284cd6a3aeSmrg   if test "x$XSLTPROC" != "x"; then
98294cd6a3aeSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
98304cd6a3aeSmrg   fi
98314cd6a3aeSmrg   have_xsltproc=no
98324cd6a3aeSmrgelse
98334cd6a3aeSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
98344cd6a3aeSmrgfi
98358c9fbc29Smrg
98364cd6a3aeSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
98374cd6a3aeSmrg]) # XORG_WITH_XSLTPROC
98388c9fbc29Smrg
98394cd6a3aeSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
98404cd6a3aeSmrg# ----------------------------------------
98414cd6a3aeSmrg# Minimum version: 1.15.0
98424cd6a3aeSmrg#
98434cd6a3aeSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
98444cd6a3aeSmrg# scanning arbitrary text files, extracting information from those text files,
98454cd6a3aeSmrg# and printing reports based on that information.
98464cd6a3aeSmrg#
98474cd6a3aeSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
98484cd6a3aeSmrg#
98494cd6a3aeSmrg# Interface to module:
98504cd6a3aeSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
98514cd6a3aeSmrg# PERL:	     returns the path of the perl program found
98524cd6a3aeSmrg#	     returns the path set by the user in the environment
98534cd6a3aeSmrg# --with-perl: 'yes' user instructs the module to use perl
98544cd6a3aeSmrg#	       'no' user instructs the module not to use perl
98554cd6a3aeSmrg# have_perl: returns yes if perl found in PATH or no
98564cd6a3aeSmrg#
98574cd6a3aeSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
98584cd6a3aeSmrg#
98594cd6a3aeSmrgAC_DEFUN([XORG_WITH_PERL],[
98604cd6a3aeSmrgAC_ARG_VAR([PERL], [Path to perl command])
98614cd6a3aeSmrg# Preserves the interface, should it be implemented later
98624cd6a3aeSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
98634cd6a3aeSmrgm4_define([_defopt], m4_default([$2], [auto]))
98644cd6a3aeSmrgAC_ARG_WITH(perl,
98654cd6a3aeSmrg	AS_HELP_STRING([--with-perl],
98664cd6a3aeSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
98674cd6a3aeSmrg	   [use_perl=$withval], [use_perl=]_defopt)
98684cd6a3aeSmrgm4_undefine([_defopt])
98694cd6a3aeSmrg
98704cd6a3aeSmrgif test "x$use_perl" = x"auto"; then
98714cd6a3aeSmrg   AC_PATH_PROG([PERL], [perl])
98724cd6a3aeSmrg   if test "x$PERL" = "x"; then
98734cd6a3aeSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
98744cd6a3aeSmrg	have_perl=no
98754cd6a3aeSmrg   else
98764cd6a3aeSmrg        have_perl=yes
98774cd6a3aeSmrg   fi
98784cd6a3aeSmrgelif test "x$use_perl" = x"yes" ; then
98794cd6a3aeSmrg   AC_PATH_PROG([PERL], [perl])
98804cd6a3aeSmrg   if test "x$PERL" = "x"; then
98814cd6a3aeSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
98824cd6a3aeSmrg   fi
98834cd6a3aeSmrg   have_perl=yes
98844cd6a3aeSmrgelif test "x$use_perl" = x"no" ; then
98854cd6a3aeSmrg   if test "x$PERL" != "x"; then
98864cd6a3aeSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
98874cd6a3aeSmrg   fi
98884cd6a3aeSmrg   have_perl=no
98894cd6a3aeSmrgelse
98904cd6a3aeSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
98914cd6a3aeSmrgfi
98928c9fbc29Smrg
98934cd6a3aeSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
98944cd6a3aeSmrg]) # XORG_WITH_PERL
98958c9fbc29Smrg
98964cd6a3aeSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
98974cd6a3aeSmrg# ----------------
98984cd6a3aeSmrg# Minimum version: 1.5.0
98994cd6a3aeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
99004cd6a3aeSmrg#
99014cd6a3aeSmrg# Documentation tools are not always available on all platforms and sometimes
99024cd6a3aeSmrg# not at the appropriate level. This macro enables a module to test for the
99034cd6a3aeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
99044cd6a3aeSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
99054cd6a3aeSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
99064cd6a3aeSmrg# --with-asciidoc assumes 'auto'.
99074cd6a3aeSmrg#
99084cd6a3aeSmrg# Interface to module:
99094cd6a3aeSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
99104cd6a3aeSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
99114cd6a3aeSmrg#		 returns the path set by the user in the environment
99124cd6a3aeSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
99134cd6a3aeSmrg#		  'no' user instructs the module not to use asciidoc
99144cd6a3aeSmrg#
99154cd6a3aeSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
99164cd6a3aeSmrg#
99174cd6a3aeSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
99184cd6a3aeSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
99194cd6a3aeSmrgm4_define([_defopt], m4_default([$2], [auto]))
99204cd6a3aeSmrgAC_ARG_WITH(asciidoc,
99214cd6a3aeSmrg	AS_HELP_STRING([--with-asciidoc],
99224cd6a3aeSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
99234cd6a3aeSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
99244cd6a3aeSmrgm4_undefine([_defopt])
99254cd6a3aeSmrg
99264cd6a3aeSmrgif test "x$use_asciidoc" = x"auto"; then
99274cd6a3aeSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
99284cd6a3aeSmrg   if test "x$ASCIIDOC" = "x"; then
99294cd6a3aeSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
99304cd6a3aeSmrg	have_asciidoc=no
99314cd6a3aeSmrg   else
99324cd6a3aeSmrg        have_asciidoc=yes
99334cd6a3aeSmrg   fi
99344cd6a3aeSmrgelif test "x$use_asciidoc" = x"yes" ; then
99354cd6a3aeSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
99364cd6a3aeSmrg   if test "x$ASCIIDOC" = "x"; then
99374cd6a3aeSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
99384cd6a3aeSmrg   fi
99394cd6a3aeSmrg   have_asciidoc=yes
99404cd6a3aeSmrgelif test "x$use_asciidoc" = x"no" ; then
99414cd6a3aeSmrg   if test "x$ASCIIDOC" != "x"; then
99424cd6a3aeSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
99434cd6a3aeSmrg   fi
99444cd6a3aeSmrg   have_asciidoc=no
99454cd6a3aeSmrgelse
99464cd6a3aeSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
99474cd6a3aeSmrgfi
99484cd6a3aeSmrgm4_ifval([$1],
99494cd6a3aeSmrg[if test "$have_asciidoc" = yes; then
99504cd6a3aeSmrg    # scrape the asciidoc version
99514cd6a3aeSmrg    AC_MSG_CHECKING([the asciidoc version])
99524cd6a3aeSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
99534cd6a3aeSmrg    AC_MSG_RESULT([$asciidoc_version])
99544cd6a3aeSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
99554cd6a3aeSmrg        [if test "x$use_asciidoc" = xauto; then
99564cd6a3aeSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
99574cd6a3aeSmrg            have_asciidoc=no
99584cd6a3aeSmrg        else
99594cd6a3aeSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
99604cd6a3aeSmrg        fi])
99614cd6a3aeSmrgfi])
99624cd6a3aeSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
99634cd6a3aeSmrg]) # XORG_WITH_ASCIIDOC
99648c9fbc29Smrg
99654cd6a3aeSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
996670728a38Smrg# -------------------------------------------
99674cd6a3aeSmrg# Minimum version: 1.5.0
99684cd6a3aeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
996970728a38Smrg# Minimum version for optional DOT checking: 1.18.0
99704cd6a3aeSmrg#
99714cd6a3aeSmrg# Documentation tools are not always available on all platforms and sometimes
99724cd6a3aeSmrg# not at the appropriate level. This macro enables a module to test for the
99734cd6a3aeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
99744cd6a3aeSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
99754cd6a3aeSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
99764cd6a3aeSmrg# --with-doxygen assumes 'auto'.
99774cd6a3aeSmrg#
99784cd6a3aeSmrg# Interface to module:
99794cd6a3aeSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
99804cd6a3aeSmrg# DOXYGEN:	 returns the path of the doxygen program found
99814cd6a3aeSmrg#		 returns the path set by the user in the environment
99824cd6a3aeSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
99834cd6a3aeSmrg#		  'no' user instructs the module not to use doxygen
99844cd6a3aeSmrg#
99854cd6a3aeSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
99864cd6a3aeSmrg#
99874cd6a3aeSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
99884cd6a3aeSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
998970728a38SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
99904cd6a3aeSmrgm4_define([_defopt], m4_default([$2], [auto]))
99914cd6a3aeSmrgAC_ARG_WITH(doxygen,
99924cd6a3aeSmrg	AS_HELP_STRING([--with-doxygen],
99934cd6a3aeSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
99944cd6a3aeSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
99954cd6a3aeSmrgm4_undefine([_defopt])
99964cd6a3aeSmrg
99974cd6a3aeSmrgif test "x$use_doxygen" = x"auto"; then
99984cd6a3aeSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
99994cd6a3aeSmrg   if test "x$DOXYGEN" = "x"; then
100004cd6a3aeSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
100014cd6a3aeSmrg	have_doxygen=no
100024cd6a3aeSmrg   else
100034cd6a3aeSmrg        have_doxygen=yes
100044cd6a3aeSmrg   fi
100054cd6a3aeSmrgelif test "x$use_doxygen" = x"yes" ; then
100064cd6a3aeSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
100074cd6a3aeSmrg   if test "x$DOXYGEN" = "x"; then
100084cd6a3aeSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
100094cd6a3aeSmrg   fi
100104cd6a3aeSmrg   have_doxygen=yes
100114cd6a3aeSmrgelif test "x$use_doxygen" = x"no" ; then
100124cd6a3aeSmrg   if test "x$DOXYGEN" != "x"; then
100134cd6a3aeSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
100144cd6a3aeSmrg   fi
100154cd6a3aeSmrg   have_doxygen=no
100164cd6a3aeSmrgelse
100174cd6a3aeSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
100184cd6a3aeSmrgfi
100194cd6a3aeSmrgm4_ifval([$1],
100204cd6a3aeSmrg[if test "$have_doxygen" = yes; then
100214cd6a3aeSmrg    # scrape the doxygen version
100224cd6a3aeSmrg    AC_MSG_CHECKING([the doxygen version])
100234cd6a3aeSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
100244cd6a3aeSmrg    AC_MSG_RESULT([$doxygen_version])
100254cd6a3aeSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
100264cd6a3aeSmrg        [if test "x$use_doxygen" = xauto; then
100274cd6a3aeSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
100284cd6a3aeSmrg            have_doxygen=no
100294cd6a3aeSmrg        else
100304cd6a3aeSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
100314cd6a3aeSmrg        fi])
100324cd6a3aeSmrgfi])
1003370728a38Smrg
1003470728a38Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
1003570728a38Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
1003670728a38Smrgdnl 	HAVE_DOT = @HAVE_DOT@
1003770728a38SmrgHAVE_DOT=no
1003870728a38Smrgif test "x$have_doxygen" = "xyes"; then
1003970728a38Smrg  AC_PATH_PROG([DOT], [dot])
1004070728a38Smrg    if test "x$DOT" != "x"; then
1004170728a38Smrg      HAVE_DOT=yes
1004270728a38Smrg    fi
1004370728a38Smrgfi
1004470728a38Smrg
1004570728a38SmrgAC_SUBST([HAVE_DOT])
1004670728a38SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
100474cd6a3aeSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
100484cd6a3aeSmrg]) # XORG_WITH_DOXYGEN
100498c9fbc29Smrg
100504cd6a3aeSmrg# XORG_WITH_GROFF([DEFAULT])
100514cd6a3aeSmrg# ----------------
100524cd6a3aeSmrg# Minimum version: 1.6.0
100534cd6a3aeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
100544cd6a3aeSmrg#
100554cd6a3aeSmrg# Documentation tools are not always available on all platforms and sometimes
100564cd6a3aeSmrg# not at the appropriate level. This macro enables a module to test for the
100574cd6a3aeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
100584cd6a3aeSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
100594cd6a3aeSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
100604cd6a3aeSmrg# --with-groff assumes 'auto'.
100614cd6a3aeSmrg#
100624cd6a3aeSmrg# Interface to module:
100634cd6a3aeSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
100644cd6a3aeSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
100654cd6a3aeSmrg# HAVE_GROFF_MS: the -ms macros package
100664cd6a3aeSmrg# GROFF:	 returns the path of the groff program found
100674cd6a3aeSmrg#		 returns the path set by the user in the environment
100684cd6a3aeSmrg# --with-groff:	 'yes' user instructs the module to use groff
100694cd6a3aeSmrg#		 'no' user instructs the module not to use groff
100704cd6a3aeSmrg#
100714cd6a3aeSmrg# Added in version 1.9.0:
100724cd6a3aeSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
100734cd6a3aeSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
100744cd6a3aeSmrg#		   psselect from the psutils package.
100754cd6a3aeSmrg#		   the ghostcript package. Refer to the grohtml man pages
100764cd6a3aeSmrg#
100774cd6a3aeSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
100784cd6a3aeSmrg#
100794cd6a3aeSmrg# OS and distros often splits groff in a basic and full package, the former
100804cd6a3aeSmrg# having the groff program and the later having devices, fonts and macros
100814cd6a3aeSmrg# Checking for the groff executable is not enough.
100824cd6a3aeSmrg#
100834cd6a3aeSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
100844cd6a3aeSmrg# unset HAVE_GROFF or GROFF env variables.
100854cd6a3aeSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
100864cd6a3aeSmrg#
100874cd6a3aeSmrgAC_DEFUN([XORG_WITH_GROFF],[
100884cd6a3aeSmrgAC_ARG_VAR([GROFF], [Path to groff command])
100894cd6a3aeSmrgm4_define([_defopt], m4_default([$1], [auto]))
100904cd6a3aeSmrgAC_ARG_WITH(groff,
100914cd6a3aeSmrg	AS_HELP_STRING([--with-groff],
100924cd6a3aeSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
100934cd6a3aeSmrg	   [use_groff=$withval], [use_groff=]_defopt)
100944cd6a3aeSmrgm4_undefine([_defopt])
100954cd6a3aeSmrg
100964cd6a3aeSmrgif test "x$use_groff" = x"auto"; then
100974cd6a3aeSmrg   AC_PATH_PROG([GROFF], [groff])
100984cd6a3aeSmrg   if test "x$GROFF" = "x"; then
100994cd6a3aeSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
101004cd6a3aeSmrg	have_groff=no
101014cd6a3aeSmrg   else
101024cd6a3aeSmrg        have_groff=yes
101034cd6a3aeSmrg   fi
101044cd6a3aeSmrgelif test "x$use_groff" = x"yes" ; then
101054cd6a3aeSmrg   AC_PATH_PROG([GROFF], [groff])
101064cd6a3aeSmrg   if test "x$GROFF" = "x"; then
101074cd6a3aeSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
101084cd6a3aeSmrg   fi
101094cd6a3aeSmrg   have_groff=yes
101104cd6a3aeSmrgelif test "x$use_groff" = x"no" ; then
101114cd6a3aeSmrg   if test "x$GROFF" != "x"; then
101124cd6a3aeSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
101134cd6a3aeSmrg   fi
101144cd6a3aeSmrg   have_groff=no
101154cd6a3aeSmrgelse
101164cd6a3aeSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
101174cd6a3aeSmrgfi
101188c9fbc29Smrg
101194cd6a3aeSmrg# We have groff, test for the presence of the macro packages
101204cd6a3aeSmrgif test "x$have_groff" = x"yes"; then
101214cd6a3aeSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
101224cd6a3aeSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
101234cd6a3aeSmrg        groff_ms_works=yes
101244cd6a3aeSmrg    else
101254cd6a3aeSmrg        groff_ms_works=no
101264cd6a3aeSmrg    fi
101274cd6a3aeSmrg    AC_MSG_RESULT([$groff_ms_works])
101284cd6a3aeSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
101294cd6a3aeSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
101304cd6a3aeSmrg        groff_mm_works=yes
101314cd6a3aeSmrg    else
101324cd6a3aeSmrg        groff_mm_works=no
101334cd6a3aeSmrg    fi
101344cd6a3aeSmrg    AC_MSG_RESULT([$groff_mm_works])
101354cd6a3aeSmrgfi
101368c9fbc29Smrg
101374cd6a3aeSmrg# We have groff, test for HTML dependencies, one command per package
101384cd6a3aeSmrgif test "x$have_groff" = x"yes"; then
101394cd6a3aeSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
101404cd6a3aeSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
101414cd6a3aeSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
101424cd6a3aeSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
101434cd6a3aeSmrg      have_groff_html=yes
101444cd6a3aeSmrg   else
101454cd6a3aeSmrg      have_groff_html=no
101464cd6a3aeSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
101474cd6a3aeSmrg   fi
101484cd6a3aeSmrgfi
101498c9fbc29Smrg
101504cd6a3aeSmrg# Set Automake conditionals for Makefiles
101514cd6a3aeSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
101524cd6a3aeSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
101534cd6a3aeSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
101544cd6a3aeSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
101554cd6a3aeSmrg]) # XORG_WITH_GROFF
101564cd6a3aeSmrg
101574cd6a3aeSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
101584cd6a3aeSmrg# ---------------------------------------
101594cd6a3aeSmrg# Minimum version: 1.6.0
101604cd6a3aeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
101614cd6a3aeSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
101624cd6a3aeSmrg#
101634cd6a3aeSmrg# Documentation tools are not always available on all platforms and sometimes
101644cd6a3aeSmrg# not at the appropriate level. This macro enables a module to test for the
101654cd6a3aeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
101664cd6a3aeSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
101674cd6a3aeSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
101684cd6a3aeSmrg# --with-fop assumes 'auto'.
101694cd6a3aeSmrg#
101704cd6a3aeSmrg# Interface to module:
101714cd6a3aeSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
101724cd6a3aeSmrg# FOP:	 	returns the path of the fop program found
101734cd6a3aeSmrg#		returns the path set by the user in the environment
101744cd6a3aeSmrg# --with-fop: 	'yes' user instructs the module to use fop
101754cd6a3aeSmrg#		'no' user instructs the module not to use fop
101764cd6a3aeSmrg#
101774cd6a3aeSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
101784cd6a3aeSmrg#
101794cd6a3aeSmrgAC_DEFUN([XORG_WITH_FOP],[
101804cd6a3aeSmrgAC_ARG_VAR([FOP], [Path to fop command])
101814cd6a3aeSmrgm4_define([_defopt], m4_default([$2], [auto]))
101824cd6a3aeSmrgAC_ARG_WITH(fop,
101834cd6a3aeSmrg	AS_HELP_STRING([--with-fop],
101844cd6a3aeSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
101854cd6a3aeSmrg	   [use_fop=$withval], [use_fop=]_defopt)
101864cd6a3aeSmrgm4_undefine([_defopt])
101874cd6a3aeSmrg
101884cd6a3aeSmrgif test "x$use_fop" = x"auto"; then
101894cd6a3aeSmrg   AC_PATH_PROG([FOP], [fop])
101904cd6a3aeSmrg   if test "x$FOP" = "x"; then
101914cd6a3aeSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
101924cd6a3aeSmrg	have_fop=no
101934cd6a3aeSmrg   else
101944cd6a3aeSmrg        have_fop=yes
101954cd6a3aeSmrg   fi
101964cd6a3aeSmrgelif test "x$use_fop" = x"yes" ; then
101974cd6a3aeSmrg   AC_PATH_PROG([FOP], [fop])
101984cd6a3aeSmrg   if test "x$FOP" = "x"; then
101994cd6a3aeSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
102004cd6a3aeSmrg   fi
102014cd6a3aeSmrg   have_fop=yes
102024cd6a3aeSmrgelif test "x$use_fop" = x"no" ; then
102034cd6a3aeSmrg   if test "x$FOP" != "x"; then
102044cd6a3aeSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
102054cd6a3aeSmrg   fi
102064cd6a3aeSmrg   have_fop=no
102074cd6a3aeSmrgelse
102084cd6a3aeSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
102094cd6a3aeSmrgfi
102108c9fbc29Smrg
102114cd6a3aeSmrg# Test for a minimum version of fop, if provided.
102124cd6a3aeSmrgm4_ifval([$1],
102134cd6a3aeSmrg[if test "$have_fop" = yes; then
102144cd6a3aeSmrg    # scrape the fop version
102154cd6a3aeSmrg    AC_MSG_CHECKING([for fop minimum version])
102164cd6a3aeSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
102174cd6a3aeSmrg    AC_MSG_RESULT([$fop_version])
102184cd6a3aeSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
102194cd6a3aeSmrg        [if test "x$use_fop" = xauto; then
102204cd6a3aeSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
102214cd6a3aeSmrg            have_fop=no
102224cd6a3aeSmrg        else
102234cd6a3aeSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
102244cd6a3aeSmrg        fi])
102254cd6a3aeSmrgfi])
102264cd6a3aeSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
102274cd6a3aeSmrg]) # XORG_WITH_FOP
102288c9fbc29Smrg
1022970728a38Smrg# XORG_WITH_M4([MIN-VERSION])
1023070728a38Smrg# ---------------------------
1023170728a38Smrg# Minimum version: 1.19.0
1023270728a38Smrg#
1023370728a38Smrg# This macro attempts to locate an m4 macro processor which supports
1023470728a38Smrg# -I option and is only useful for modules relying on M4 in order to
1023570728a38Smrg# expand macros in source code files.
1023670728a38Smrg#
1023770728a38Smrg# Interface to module:
1023870728a38Smrg# M4:	 	returns the path of the m4 program found
1023970728a38Smrg#		returns the path set by the user in the environment
1024070728a38Smrg#
1024170728a38SmrgAC_DEFUN([XORG_WITH_M4], [
1024270728a38SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
1024370728a38Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
1024470728a38Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
1024570728a38Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
1024670728a38Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
1024770728a38Smrg   [$PATH:/usr/gnu/bin])])
1024870728a38Smrg
1024970728a38SmrgAC_SUBST([M4], [$ac_cv_path_M4])
1025070728a38Smrg]) # XORG_WITH_M4
1025170728a38Smrg
102524cd6a3aeSmrg# XORG_WITH_PS2PDF([DEFAULT])
102534cd6a3aeSmrg# ----------------
102544cd6a3aeSmrg# Minimum version: 1.6.0
102554cd6a3aeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
102564cd6a3aeSmrg#
102574cd6a3aeSmrg# Documentation tools are not always available on all platforms and sometimes
102584cd6a3aeSmrg# not at the appropriate level. This macro enables a module to test for the
102594cd6a3aeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
102604cd6a3aeSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
102614cd6a3aeSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
102624cd6a3aeSmrg# --with-ps2pdf assumes 'auto'.
102634cd6a3aeSmrg#
102644cd6a3aeSmrg# Interface to module:
102654cd6a3aeSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
102664cd6a3aeSmrg# PS2PDF:	returns the path of the ps2pdf program found
102674cd6a3aeSmrg#		returns the path set by the user in the environment
102684cd6a3aeSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
102694cd6a3aeSmrg#		 'no' user instructs the module not to use ps2pdf
102704cd6a3aeSmrg#
102714cd6a3aeSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
102724cd6a3aeSmrg#
102734cd6a3aeSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
102744cd6a3aeSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
102754cd6a3aeSmrgm4_define([_defopt], m4_default([$1], [auto]))
102764cd6a3aeSmrgAC_ARG_WITH(ps2pdf,
102774cd6a3aeSmrg	AS_HELP_STRING([--with-ps2pdf],
102784cd6a3aeSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
102794cd6a3aeSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
102804cd6a3aeSmrgm4_undefine([_defopt])
102814cd6a3aeSmrg
102824cd6a3aeSmrgif test "x$use_ps2pdf" = x"auto"; then
102834cd6a3aeSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
102844cd6a3aeSmrg   if test "x$PS2PDF" = "x"; then
102854cd6a3aeSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
102864cd6a3aeSmrg	have_ps2pdf=no
102874cd6a3aeSmrg   else
102884cd6a3aeSmrg        have_ps2pdf=yes
102894cd6a3aeSmrg   fi
102904cd6a3aeSmrgelif test "x$use_ps2pdf" = x"yes" ; then
102914cd6a3aeSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
102924cd6a3aeSmrg   if test "x$PS2PDF" = "x"; then
102934cd6a3aeSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
102944cd6a3aeSmrg   fi
102954cd6a3aeSmrg   have_ps2pdf=yes
102964cd6a3aeSmrgelif test "x$use_ps2pdf" = x"no" ; then
102974cd6a3aeSmrg   if test "x$PS2PDF" != "x"; then
102984cd6a3aeSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
102994cd6a3aeSmrg   fi
103004cd6a3aeSmrg   have_ps2pdf=no
103014cd6a3aeSmrgelse
103024cd6a3aeSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
103034cd6a3aeSmrgfi
103044cd6a3aeSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
103054cd6a3aeSmrg]) # XORG_WITH_PS2PDF
103068c9fbc29Smrg
103074cd6a3aeSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
103084cd6a3aeSmrg# ----------------
103094cd6a3aeSmrg# Minimum version: 1.6.0
103104cd6a3aeSmrg#
103114cd6a3aeSmrg# Documentation tools are not always available on all platforms and sometimes
103124cd6a3aeSmrg# not at the appropriate level. This macro enables a builder to skip all
103134cd6a3aeSmrg# documentation targets except traditional man pages.
103144cd6a3aeSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
103154cd6a3aeSmrg# maximum flexibilty in controlling documentation building.
103164cd6a3aeSmrg# Refer to:
103174cd6a3aeSmrg# XORG_WITH_XMLTO         --with-xmlto
103184cd6a3aeSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
103194cd6a3aeSmrg# XORG_WITH_DOXYGEN       --with-doxygen
103204cd6a3aeSmrg# XORG_WITH_FOP           --with-fop
103214cd6a3aeSmrg# XORG_WITH_GROFF         --with-groff
103224cd6a3aeSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
103234cd6a3aeSmrg#
103244cd6a3aeSmrg# Interface to module:
103254cd6a3aeSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
103264cd6a3aeSmrg# --enable-docs: 'yes' user instructs the module to generate docs
103274cd6a3aeSmrg#		 'no' user instructs the module not to generate docs
103284cd6a3aeSmrg# parm1:	specify the default value, yes or no.
103294cd6a3aeSmrg#
103304cd6a3aeSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
103314cd6a3aeSmrgm4_define([docs_default], m4_default([$1], [yes]))
103324cd6a3aeSmrgAC_ARG_ENABLE(docs,
103334cd6a3aeSmrg	AS_HELP_STRING([--enable-docs],
103344cd6a3aeSmrg	   [Enable building the documentation (default: ]docs_default[)]),
103354cd6a3aeSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
103364cd6a3aeSmrgm4_undefine([docs_default])
103374cd6a3aeSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
103384cd6a3aeSmrgAC_MSG_CHECKING([whether to build documentation])
103394cd6a3aeSmrgAC_MSG_RESULT([$build_docs])
103404cd6a3aeSmrg]) # XORG_ENABLE_DOCS
103414cd6a3aeSmrg
103424cd6a3aeSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
103434cd6a3aeSmrg# ----------------
103444cd6a3aeSmrg# Minimum version: 1.6.0
103454cd6a3aeSmrg#
103464cd6a3aeSmrg# This macro enables a builder to skip all developer documentation.
103474cd6a3aeSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
103484cd6a3aeSmrg# maximum flexibilty in controlling documentation building.
103494cd6a3aeSmrg# Refer to:
103504cd6a3aeSmrg# XORG_WITH_XMLTO         --with-xmlto
103514cd6a3aeSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
103524cd6a3aeSmrg# XORG_WITH_DOXYGEN       --with-doxygen
103534cd6a3aeSmrg# XORG_WITH_FOP           --with-fop
103544cd6a3aeSmrg# XORG_WITH_GROFF         --with-groff
103554cd6a3aeSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
103564cd6a3aeSmrg#
103574cd6a3aeSmrg# Interface to module:
103584cd6a3aeSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
103594cd6a3aeSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
103604cd6a3aeSmrg#			'no' user instructs the module not to generate developer docs
103614cd6a3aeSmrg# parm1:		specify the default value, yes or no.
103624cd6a3aeSmrg#
103634cd6a3aeSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
103644cd6a3aeSmrgm4_define([devel_default], m4_default([$1], [yes]))
103654cd6a3aeSmrgAC_ARG_ENABLE(devel-docs,
103664cd6a3aeSmrg	AS_HELP_STRING([--enable-devel-docs],
103674cd6a3aeSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
103684cd6a3aeSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
103694cd6a3aeSmrgm4_undefine([devel_default])
103704cd6a3aeSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
103714cd6a3aeSmrgAC_MSG_CHECKING([whether to build developer documentation])
103724cd6a3aeSmrgAC_MSG_RESULT([$build_devel_docs])
103734cd6a3aeSmrg]) # XORG_ENABLE_DEVEL_DOCS
103744cd6a3aeSmrg
103754cd6a3aeSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
103764cd6a3aeSmrg# ----------------
103774cd6a3aeSmrg# Minimum version: 1.6.0
103784cd6a3aeSmrg#
103794cd6a3aeSmrg# This macro enables a builder to skip all functional specification targets.
103804cd6a3aeSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
103814cd6a3aeSmrg# maximum flexibilty in controlling documentation building.
103824cd6a3aeSmrg# Refer to:
103834cd6a3aeSmrg# XORG_WITH_XMLTO         --with-xmlto
103844cd6a3aeSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
103854cd6a3aeSmrg# XORG_WITH_DOXYGEN       --with-doxygen
103864cd6a3aeSmrg# XORG_WITH_FOP           --with-fop
103874cd6a3aeSmrg# XORG_WITH_GROFF         --with-groff
103884cd6a3aeSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
103894cd6a3aeSmrg#
103904cd6a3aeSmrg# Interface to module:
103914cd6a3aeSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
103924cd6a3aeSmrg# --enable-specs:	'yes' user instructs the module to generate specs
103934cd6a3aeSmrg#			'no' user instructs the module not to generate specs
103944cd6a3aeSmrg# parm1:		specify the default value, yes or no.
103954cd6a3aeSmrg#
103964cd6a3aeSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
103974cd6a3aeSmrgm4_define([spec_default], m4_default([$1], [yes]))
103984cd6a3aeSmrgAC_ARG_ENABLE(specs,
103994cd6a3aeSmrg	AS_HELP_STRING([--enable-specs],
104004cd6a3aeSmrg	   [Enable building the specs (default: ]spec_default[)]),
104014cd6a3aeSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
104024cd6a3aeSmrgm4_undefine([spec_default])
104034cd6a3aeSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
104044cd6a3aeSmrgAC_MSG_CHECKING([whether to build functional specifications])
104054cd6a3aeSmrgAC_MSG_RESULT([$build_specs])
104064cd6a3aeSmrg]) # XORG_ENABLE_SPECS
104074cd6a3aeSmrg
104084cd6a3aeSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
104094cd6a3aeSmrg# ----------------------------------------------
104104cd6a3aeSmrg# Minimum version: 1.13.0
104114cd6a3aeSmrg#
104124cd6a3aeSmrg# This macro enables a builder to enable/disable unit testing
104134cd6a3aeSmrg# It makes no assumption about the test cases implementation
104144cd6a3aeSmrg# Test cases may or may not use Automake "Support for test suites"
104154cd6a3aeSmrg# They may or may not use the software utility library GLib
104164cd6a3aeSmrg#
104174cd6a3aeSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
104184cd6a3aeSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
104194cd6a3aeSmrg# The variable enable_unit_tests is used by other macros in this file.
104204cd6a3aeSmrg#
104214cd6a3aeSmrg# Interface to module:
104224cd6a3aeSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
104234cd6a3aeSmrg# enable_unit_tests:    used in configure.ac for additional configuration
104244cd6a3aeSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
104254cd6a3aeSmrg#			'no' user instructs the module not to build tests
104264cd6a3aeSmrg# parm1:		specify the default value, yes or no.
104274cd6a3aeSmrg#
104284cd6a3aeSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
104294cd6a3aeSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
104304cd6a3aeSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
104314cd6a3aeSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
104324cd6a3aeSmrgm4_define([_defopt], m4_default([$1], [auto]))
104334cd6a3aeSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
104344cd6a3aeSmrg	[Enable building unit test cases (default: ]_defopt[)]),
104354cd6a3aeSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
104364cd6a3aeSmrgm4_undefine([_defopt])
104374cd6a3aeSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
104384cd6a3aeSmrgAC_MSG_CHECKING([whether to build unit test cases])
104394cd6a3aeSmrgAC_MSG_RESULT([$enable_unit_tests])
104404cd6a3aeSmrg]) # XORG_ENABLE_UNIT_TESTS
104414cd6a3aeSmrg
1044270728a38Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
1044370728a38Smrg# ------------------------------------------------------
1044470728a38Smrg# Minimum version: 1.17.0
1044570728a38Smrg#
1044670728a38Smrg# This macro enables a builder to enable/disable integration testing
1044770728a38Smrg# It makes no assumption about the test cases' implementation
1044870728a38Smrg# Test cases may or may not use Automake "Support for test suites"
1044970728a38Smrg#
1045070728a38Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
1045170728a38Smrg# usually requires less dependencies and may be built and run under less
1045270728a38Smrg# stringent environments than integration tests.
1045370728a38Smrg#
1045470728a38Smrg# Interface to module:
1045570728a38Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
1045670728a38Smrg# enable_integration_tests:   used in configure.ac for additional configuration
1045770728a38Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
1045870728a38Smrg#                             'no' user instructs the module not to build tests
1045970728a38Smrg# parm1:                      specify the default value, yes or no.
1046070728a38Smrg#
1046170728a38SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
1046270728a38SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1046370728a38Smrgm4_define([_defopt], m4_default([$1], [auto]))
1046470728a38SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
1046570728a38Smrg	[Enable building integration test cases (default: ]_defopt[)]),
1046670728a38Smrg	[enable_integration_tests=$enableval],
1046770728a38Smrg	[enable_integration_tests=]_defopt)
1046870728a38Smrgm4_undefine([_defopt])
1046970728a38SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
1047070728a38Smrg	[test "x$enable_integration_tests" != xno])
1047170728a38SmrgAC_MSG_CHECKING([whether to build unit test cases])
1047270728a38SmrgAC_MSG_RESULT([$enable_integration_tests])
1047370728a38Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
1047470728a38Smrg
104754cd6a3aeSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
104764cd6a3aeSmrg# ----------------------------------------
104774cd6a3aeSmrg# Minimum version: 1.13.0
104784cd6a3aeSmrg#
104794cd6a3aeSmrg# GLib is a library which provides advanced data structures and functions.
104804cd6a3aeSmrg# This macro enables a module to test for the presence of Glib.
104814cd6a3aeSmrg#
104824cd6a3aeSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
104834cd6a3aeSmrg# Otherwise the value of $enable_unit_tests is blank.
104844cd6a3aeSmrg#
1048570728a38Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
1048670728a38Smrg# test support usually requires less dependencies and may be built and run under
1048770728a38Smrg# less stringent environments than integration tests.
1048870728a38Smrg#
104894cd6a3aeSmrg# Interface to module:
104904cd6a3aeSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
104914cd6a3aeSmrg# with_glib: used in configure.ac to know if GLib has been found
104924cd6a3aeSmrg# --with-glib:	'yes' user instructs the module to use glib
104934cd6a3aeSmrg#		'no' user instructs the module not to use glib
104944cd6a3aeSmrg#
104954cd6a3aeSmrgAC_DEFUN([XORG_WITH_GLIB],[
104964cd6a3aeSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
104974cd6a3aeSmrgm4_define([_defopt], m4_default([$2], [auto]))
104984cd6a3aeSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
104994cd6a3aeSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
105004cd6a3aeSmrg	[with_glib=$withval], [with_glib=]_defopt)
105014cd6a3aeSmrgm4_undefine([_defopt])
105024cd6a3aeSmrg
105034cd6a3aeSmrghave_glib=no
105044cd6a3aeSmrg# Do not probe GLib if user explicitly disabled unit testing
105054cd6a3aeSmrgif test "x$enable_unit_tests" != x"no"; then
105064cd6a3aeSmrg  # Do not probe GLib if user explicitly disabled it
105074cd6a3aeSmrg  if test "x$with_glib" != x"no"; then
105084cd6a3aeSmrg    m4_ifval(
105094cd6a3aeSmrg      [$1],
105104cd6a3aeSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
105114cd6a3aeSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
105124cd6a3aeSmrg    )
105134cd6a3aeSmrg  fi
105144cd6a3aeSmrgfi
105158c9fbc29Smrg
105164cd6a3aeSmrg# Not having GLib when unit testing has been explicitly requested is an error
105174cd6a3aeSmrgif test "x$enable_unit_tests" = x"yes"; then
105184cd6a3aeSmrg  if test "x$have_glib" = x"no"; then
105194cd6a3aeSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
105204cd6a3aeSmrg  fi
105214cd6a3aeSmrgfi
105228c9fbc29Smrg
105234cd6a3aeSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
105244cd6a3aeSmrgif test "x$enable_unit_tests" = x"no"; then
105254cd6a3aeSmrg  if test "x$with_glib" = x"yes"; then
105264cd6a3aeSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
105274cd6a3aeSmrg  fi
105284cd6a3aeSmrgfi
105298c9fbc29Smrg
1053054044362Smrg# Not having GLib when it has been explicitly requested is an error
1053154044362Smrgif test "x$with_glib" = x"yes"; then
1053254044362Smrg  if test "x$have_glib" = x"no"; then
1053354044362Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
1053454044362Smrg  fi
1053554044362Smrgfi
1053654044362Smrg
1053754044362SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
1053854044362Smrg]) # XORG_WITH_GLIB
1053954044362Smrg
1054054044362Smrg# XORG_LD_WRAP([required|optional])
1054154044362Smrg# ---------------------------------
1054254044362Smrg# Minimum version: 1.13.0
1054354044362Smrg#
1054454044362Smrg# Check if linker supports -wrap, passed via compiler flags
1054554044362Smrg#
1054654044362Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
1054754044362Smrg# Otherwise the value of $enable_unit_tests is blank.
1054854044362Smrg#
1054954044362Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
1055054044362Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
1055154044362Smrg# available, an argument of "optional" allows use when some unit tests require
1055254044362Smrg# ld -wrap and others do not.
1055354044362Smrg#
1055454044362SmrgAC_DEFUN([XORG_LD_WRAP],[
1055554044362SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
1055654044362Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
1055754044362Smrg                      void __wrap_exit(int status) { return; }],
1055854044362Smrg                     [exit(0);])])
1055954044362Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
1056054044362Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
1056154044362Smrg  if test "x$have_ld_wrap" = x"no"; then
1056254044362Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
1056354044362Smrg  fi
1056454044362Smrgfi
1056554044362SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
1056654044362Smrg#
1056754044362Smrg]) # XORG_LD_WRAP
1056854044362Smrg
1056954044362Smrg# XORG_CHECK_LINKER_FLAGS
1057054044362Smrg# -----------------------
1057154044362Smrg# SYNOPSIS
1057254044362Smrg#
1057354044362Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
1057454044362Smrg#
1057554044362Smrg# DESCRIPTION
1057654044362Smrg#
1057754044362Smrg#   Check whether the given linker FLAGS work with the current language's
1057854044362Smrg#   linker, or whether they give an error.
1057954044362Smrg#
1058054044362Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
1058154044362Smrg#   success/failure.
1058254044362Smrg#
1058354044362Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
1058454044362Smrg#
1058554044362Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
1058654044362Smrg#
1058754044362Smrg# LICENSE
1058854044362Smrg#
1058954044362Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
1059054044362Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
1059154044362Smrg#   Copyright (c) 2009 Matteo Frigo
1059254044362Smrg#
1059354044362Smrg#   This program is free software: you can redistribute it and/or modify it
1059454044362Smrg#   under the terms of the GNU General Public License as published by the
1059554044362Smrg#   Free Software Foundation, either version 3 of the License, or (at your
1059654044362Smrg#   option) any later version.
1059754044362Smrg#
1059854044362Smrg#   This program is distributed in the hope that it will be useful, but
1059954044362Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
1060054044362Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1060154044362Smrg#   Public License for more details.
1060254044362Smrg#
1060354044362Smrg#   You should have received a copy of the GNU General Public License along
1060454044362Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
1060554044362Smrg#
1060654044362Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
1060754044362Smrg#   gives unlimited permission to copy, distribute and modify the configure
1060854044362Smrg#   scripts that are the output of Autoconf when processing the Macro. You
1060954044362Smrg#   need not follow the terms of the GNU General Public License when using
1061054044362Smrg#   or distributing such scripts, even though portions of the text of the
1061154044362Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
1061254044362Smrg#   all other use of the material that constitutes the Autoconf Macro.
1061354044362Smrg#
1061454044362Smrg#   This special exception to the GPL applies to versions of the Autoconf
1061554044362Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
1061654044362Smrg#   modified version of the Autoconf Macro, you may extend this special
1061754044362Smrg#   exception to the GPL to apply to your modified version as well.#
1061854044362SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
1061954044362Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
1062054044362Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
1062154044362SmrgAS_LITERAL_IF([$1],
1062254044362Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
1062354044362Smrg      ax_save_FLAGS=$LDFLAGS
1062454044362Smrg      LDFLAGS="$1"
1062554044362Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
1062654044362Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1062754044362Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1062854044362Smrg      LDFLAGS=$ax_save_FLAGS])],
1062954044362Smrg  [ax_save_FLAGS=$LDFLAGS
1063054044362Smrg   LDFLAGS="$1"
1063154044362Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1063254044362Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1063354044362Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1063454044362Smrg   LDFLAGS=$ax_save_FLAGS])
1063554044362Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
1063654044362SmrgAC_MSG_RESULT($xorg_check_linker_flags)
1063754044362Smrgif test "x$xorg_check_linker_flags" = xyes; then
1063854044362Smrg	m4_default([$2], :)
1063954044362Smrgelse
1064054044362Smrg	m4_default([$3], :)
1064154044362Smrgfi
1064254044362Smrg]) # XORG_CHECK_LINKER_FLAGS
1064354044362Smrg
1064454044362Smrg# XORG_MEMORY_CHECK_FLAGS
1064554044362Smrg# -----------------------
1064654044362Smrg# Minimum version: 1.16.0
1064754044362Smrg#
1064854044362Smrg# This macro attempts to find appropriate memory checking functionality
1064954044362Smrg# for various platforms which unit testing code may use to catch various
1065054044362Smrg# forms of memory allocation and access errors in testing.
1065154044362Smrg#
1065254044362Smrg# Interface to module:
1065354044362Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
1065454044362Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
1065554044362Smrg#
1065654044362Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
1065754044362Smrg#
1065854044362SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
1065954044362Smrg
1066054044362SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1066154044362SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
1066254044362Smrg           [Environment variables to enable memory checking in tests])
1066354044362Smrg
1066454044362Smrg# Check for different types of support on different platforms
1066554044362Smrgcase $host_os in
1066654044362Smrg    solaris*)
1066754044362Smrg        AC_CHECK_LIB([umem], [umem_alloc],
1066854044362Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
1066954044362Smrg        ;;
1067054044362Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
1067154044362Smrg        # both directly and inverted, so should not be 0 or 255.
1067254044362Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
1067354044362Smrg        ;;
1067454044362Smrg    darwin*)
1067554044362Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
1067654044362Smrg        ;;
1067754044362Smrg    *bsd*)
1067854044362Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
1067954044362Smrg        ;;
1068054044362Smrgesac
1068154044362Smrg
1068254044362Smrg# User supplied flags override default flags
1068354044362Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
1068454044362Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
1068554044362Smrgfi
1068654044362Smrg
1068754044362SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
1068854044362Smrg]) # XORG_WITH_LINT
1068954044362Smrg
1069054044362Smrg# XORG_CHECK_MALLOC_ZERO
1069154044362Smrg# ----------------------
1069254044362Smrg# Minimum version: 1.0.0
1069354044362Smrg#
1069454044362Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1069554044362Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1069654044362Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1069754044362SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1069854044362SmrgAC_ARG_ENABLE(malloc0returnsnull,
1069954044362Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1070054044362Smrg		       [malloc(0) returns NULL (default: auto)]),
1070154044362Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1070254044362Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1070354044362Smrg
1070454044362SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1070554044362Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1070654044362SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
1070754044362Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
1070854044362Smrg#include <stdlib.h>
1070954044362Smrg],[
1071054044362Smrg    char *m0, *r0, *c0, *p;
1071154044362Smrg    m0 = malloc(0);
1071254044362Smrg    p = malloc(10);
1071354044362Smrg    r0 = realloc(p,0);
1071454044362Smrg    c0 = calloc(0,10);
1071554044362Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
1071654044362Smrg])],
1071754044362Smrg		[xorg_cv_malloc0_returns_null=yes],
1071854044362Smrg		[xorg_cv_malloc0_returns_null=no])])
1071954044362SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
1072054044362Smrgfi
1072154044362SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1072254044362Smrg
1072354044362Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1072454044362Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1072554044362Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1072654044362Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1072754044362Smrgelse
1072854044362Smrg	MALLOC_ZERO_CFLAGS=""
1072954044362Smrg	XMALLOC_ZERO_CFLAGS=""
1073054044362Smrg	XTMALLOC_ZERO_CFLAGS=""
1073154044362Smrgfi
1073254044362Smrg
1073354044362SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1073454044362SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1073554044362SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1073654044362Smrg]) # XORG_CHECK_MALLOC_ZERO
1073754044362Smrg
1073854044362Smrg# XORG_WITH_LINT()
1073954044362Smrg# ----------------
1074054044362Smrg# Minimum version: 1.1.0
1074154044362Smrg#
1074254044362Smrg# This macro enables the use of a tool that flags some suspicious and
1074354044362Smrg# non-portable constructs (likely to be bugs) in C language source code.
1074454044362Smrg# It will attempt to locate the tool and use appropriate options.
1074554044362Smrg# There are various lint type tools on different platforms.
1074654044362Smrg#
1074754044362Smrg# Interface to module:
1074854044362Smrg# LINT:		returns the path to the tool found on the platform
1074954044362Smrg#		or the value set to LINT on the configure cmd line
1075054044362Smrg#		also an Automake conditional
1075154044362Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
1075254044362Smrg#
1075354044362Smrg# --with-lint:	'yes' user instructs the module to use lint
1075454044362Smrg#		'no' user instructs the module not to use lint (default)
1075554044362Smrg#
1075654044362Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1075754044362Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1075854044362Smrg#
1075954044362SmrgAC_DEFUN([XORG_WITH_LINT],[
1076054044362Smrg
1076154044362SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1076254044362SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1076354044362SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1076454044362Smrg		[Use a lint-style source code checker (default: disabled)])],
1076554044362Smrg		[use_lint=$withval], [use_lint=no])
1076654044362Smrg
1076754044362Smrg# Obtain platform specific info like program name and options
1076854044362Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1076954044362Smrgcase $host_os in
1077054044362Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1077154044362Smrg	lint_name=splint
1077254044362Smrg	lint_options="-badflag"
1077354044362Smrg	;;
1077454044362Smrg  *freebsd* | *netbsd*)
1077554044362Smrg	lint_name=lint
1077654044362Smrg	lint_options="-u -b"
1077754044362Smrg	;;
1077854044362Smrg  *solaris*)
1077954044362Smrg	lint_name=lint
1078054044362Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1078154044362Smrg	;;
1078254044362Smrgesac
1078354044362Smrg
1078454044362Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
1078554044362Smrgif test "x$use_lint" = x"yes" ; then
1078654044362Smrg   AC_PATH_PROG([LINT], [$lint_name])
1078754044362Smrg   if test "x$LINT" = "x"; then
1078854044362Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1078954044362Smrg   fi
1079054044362Smrgelif test "x$use_lint" = x"no" ; then
1079154044362Smrg   if test "x$LINT" != "x"; then
1079254044362Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1079354044362Smrg   fi
1079454044362Smrgelse
1079554044362Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1079654044362Smrgfi
1079754044362Smrg
1079854044362Smrg# User supplied flags override default flags
1079954044362Smrgif test "x$LINT_FLAGS" != "x"; then
1080054044362Smrg   lint_options=$LINT_FLAGS
1080154044362Smrgfi
1080254044362Smrg
1080354044362SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
1080454044362SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
1080554044362Smrg
1080654044362Smrg]) # XORG_WITH_LINT
1080754044362Smrg
1080854044362Smrg# XORG_LINT_LIBRARY(LIBNAME)
1080954044362Smrg# --------------------------
1081054044362Smrg# Minimum version: 1.1.0
1081154044362Smrg#
1081254044362Smrg# Sets up flags for building lint libraries for checking programs that call
1081354044362Smrg# functions in the library.
1081454044362Smrg#
1081554044362Smrg# Interface to module:
1081654044362Smrg# LINTLIB		- Automake variable with the name of lint library file to make
1081754044362Smrg# MAKE_LINT_LIB		- Automake conditional
1081854044362Smrg#
1081954044362Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
1082054044362Smrg#			  - 'no' user instructs the module not to create a lint library (default)
1082154044362Smrg
1082254044362SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1082354044362SmrgAC_REQUIRE([XORG_WITH_LINT])
1082454044362SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1082554044362Smrg	[Create lint library (default: disabled)])],
1082654044362Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1082754044362Smrg
1082854044362Smrgif test "x$make_lint_lib" = x"yes" ; then
1082954044362Smrg   LINTLIB=llib-l$1.ln
1083054044362Smrg   if test "x$LINT" = "x"; then
1083154044362Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
1083254044362Smrg   fi
1083354044362Smrgelif test "x$make_lint_lib" != x"no" ; then
1083454044362Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1083554044362Smrgfi
1083654044362Smrg
1083754044362SmrgAC_SUBST(LINTLIB)
1083854044362SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1083954044362Smrg
1084054044362Smrg]) # XORG_LINT_LIBRARY
1084154044362Smrg
1084254044362Smrg# XORG_COMPILER_BRAND
1084354044362Smrg# -------------------
1084454044362Smrg# Minimum version: 1.14.0
1084554044362Smrg#
1084654044362Smrg# Checks for various brands of compilers and sets flags as appropriate:
1084754044362Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
1084854044362Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
1084954044362Smrg#   clang compiler - sets CLANGCC to "yes"
1085054044362Smrg#   Intel compiler - sets INTELCC to "yes"
1085154044362Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
1085254044362Smrg#
1085354044362SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
1085454044362SmrgAC_LANG_CASE(
1085554044362Smrg	[C], [
1085654044362Smrg		AC_REQUIRE([AC_PROG_CC_C99])
1085754044362Smrg	],
1085854044362Smrg	[C++], [
1085954044362Smrg		AC_REQUIRE([AC_PROG_CXX])
1086054044362Smrg	]
1086154044362Smrg)
1086254044362SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
1086354044362SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1086454044362SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1086554044362Smrg]) # XORG_COMPILER_BRAND
1086654044362Smrg
1086754044362Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
1086854044362Smrg# ---------------
1086954044362Smrg# Minimum version: 1.16.0
1087054044362Smrg#
1087154044362Smrg# Test if the compiler works when passed the given flag as a command line argument.
1087254044362Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
1087354044362Smrg# next flag in the list until there are no more options.
1087454044362Smrg#
1087554044362Smrg# Note that this does not guarantee that the compiler supports the flag as some
1087654044362Smrg# compilers will simply ignore arguments that they do not understand, but we do
1087754044362Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
1087854044362Smrg# -Werror=unused-command-line-argument
1087954044362Smrg#
1088054044362SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
1088154044362Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1088254044362Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1088354044362Smrg
1088454044362SmrgAC_LANG_COMPILER_REQUIRE
1088554044362Smrg
1088654044362SmrgAC_LANG_CASE(
1088754044362Smrg	[C], [
1088854044362Smrg		AC_REQUIRE([AC_PROG_CC_C99])
1088954044362Smrg		define([PREFIX], [C])
1089054044362Smrg		define([CACHE_PREFIX], [cc])
1089154044362Smrg		define([COMPILER], [$CC])
1089254044362Smrg	],
1089354044362Smrg	[C++], [
1089454044362Smrg		define([PREFIX], [CXX])
1089554044362Smrg		define([CACHE_PREFIX], [cxx])
1089654044362Smrg		define([COMPILER], [$CXX])
1089754044362Smrg	]
1089854044362Smrg)
1089954044362Smrg
1090054044362Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
1090154044362Smrg
1090254044362Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
1090354044362Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1090454044362Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
1090554044362Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
1090654044362Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1090754044362Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
1090854044362Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
1090954044362Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
1091054044362Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1091154044362Smrgfi
1091254044362Smrg
1091354044362Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
1091454044362Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
1091554044362Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1091654044362Smrg	fi
1091754044362Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1091854044362Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
1091954044362Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
1092054044362Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1092154044362Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
1092254044362Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
1092354044362Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
1092454044362Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1092554044362Smrgfi
1092654044362Smrg
1092754044362Smrgfound="no"
1092854044362Smrgm4_foreach([flag], m4_cdr($@), [
1092954044362Smrg	if test $found = "no" ; then
1093054044362Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
1093154044362Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1093254044362Smrg		fi
1093354044362Smrg
1093454044362Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
1093554044362Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1093654044362Smrg		fi
1093754044362Smrg
1093854044362Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
1093954044362Smrg
1094054044362Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
1094154044362Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
1094254044362Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
1094354044362Smrg		AC_CACHE_VAL($cacheid,
1094454044362Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
1094554044362Smrg					     [eval $cacheid=yes],
1094654044362Smrg					     [eval $cacheid=no])])
1094754044362Smrg
1094854044362Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1094954044362Smrg
1095054044362Smrg		eval supported=\$$cacheid
1095154044362Smrg		AC_MSG_RESULT([$supported])
1095254044362Smrg		if test "$supported" = "yes" ; then
1095354044362Smrg			$1="$$1 ]flag["
1095454044362Smrg			found="yes"
1095554044362Smrg		fi
1095654044362Smrg	fi
1095754044362Smrg])
1095854044362Smrg]) # XORG_TESTSET_CFLAG
1095954044362Smrg
1096054044362Smrg# XORG_COMPILER_FLAGS
1096154044362Smrg# ---------------
1096254044362Smrg# Minimum version: 1.16.0
1096354044362Smrg#
1096454044362Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
1096554044362Smrg# arguments supported by the selected compiler which do NOT alter the generated
1096654044362Smrg# code.  These arguments will cause the compiler to print various warnings
1096754044362Smrg# during compilation AND turn a conservative set of warnings into errors.
1096854044362Smrg#
1096954044362Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
1097054044362Smrg# future versions of util-macros as options are added to new compilers.
1097154044362Smrg#
1097254044362SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
1097354044362SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1097454044362Smrg
1097554044362SmrgAC_ARG_ENABLE(selective-werror,
1097654044362Smrg              AS_HELP_STRING([--disable-selective-werror],
1097754044362Smrg                             [Turn off selective compiler errors. (default: enabled)]),
1097854044362Smrg              [SELECTIVE_WERROR=$enableval],
1097954044362Smrg              [SELECTIVE_WERROR=yes])
1098054044362Smrg
1098154044362SmrgAC_LANG_CASE(
1098254044362Smrg        [C], [
1098354044362Smrg                define([PREFIX], [C])
1098454044362Smrg        ],
1098554044362Smrg        [C++], [
1098654044362Smrg                define([PREFIX], [CXX])
1098754044362Smrg        ]
1098854044362Smrg)
1098954044362Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
1099054044362Smrgif test "x$SUNCC" = "xyes"; then
1099154044362Smrg    [BASE_]PREFIX[FLAGS]="-v"
1099254044362Smrgelse
1099354044362Smrg    [BASE_]PREFIX[FLAGS]=""
1099454044362Smrgfi
1099554044362Smrg
1099654044362Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
1099754044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
1099854044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
1099954044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
1100054044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
1100154044362Smrg
1100254044362SmrgAC_LANG_CASE(
1100354044362Smrg	[C], [
1100454044362Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
1100554044362Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
1100654044362Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
1100754044362Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
1100854044362Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
1100954044362Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
1101054044362Smrg	]
1101154044362Smrg)
1101254044362Smrg
1101354044362Smrg# This chunk adds additional warnings that could catch undesired effects.
1101454044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
1101554044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
1101654044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
1101754044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
1101854044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
1101954044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
1102054044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
1102154044362Smrg
1102254044362Smrg# These are currently disabled because they are noisy.  They will be enabled
1102354044362Smrg# in the future once the codebase is sufficiently modernized to silence
1102454044362Smrg# them.  For now, I don't want them to drown out the other warnings.
1102554044362Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
1102654044362Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
1102754044362Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
1102854044362Smrg
1102954044362Smrg# Turn some warnings into errors, so we don't accidently get successful builds
1103054044362Smrg# when there are problems that should be fixed.
1103154044362Smrg
1103254044362Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
1103354044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
1103454044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
1103554044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
1103654044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
1103754044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
1103854044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
1103954044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
1104054044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
1104154044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
1104254044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
1104354044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
1104454044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
1104554044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
1104654044362Smrgelse
1104754044362SmrgAC_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])
1104854044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
1104954044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
1105054044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
1105154044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
1105254044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
1105354044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
1105454044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
1105554044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
1105654044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
1105754044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
1105854044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
1105954044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
1106054044362SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
1106154044362Smrgfi
1106254044362Smrg
1106354044362SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1106454044362Smrg]) # XORG_COMPILER_FLAGS
1106554044362Smrg
1106654044362Smrg# XORG_CWARNFLAGS
1106754044362Smrg# ---------------
1106854044362Smrg# Minimum version: 1.2.0
1106954044362Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
1107054044362Smrg#
1107154044362Smrg# Defines CWARNFLAGS to enable C compiler warnings.
1107254044362Smrg#
1107354044362Smrg# This function is deprecated because it defines -fno-strict-aliasing
1107454044362Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
1107554044362Smrg# is needed, then it should be added explicitly in the module when
1107654044362Smrg# it is updated to use BASE_CFLAGS.
1107754044362Smrg#
1107854044362SmrgAC_DEFUN([XORG_CWARNFLAGS], [
1107954044362SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1108054044362SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1108154044362SmrgAC_LANG_CASE(
1108254044362Smrg	[C], [
1108354044362Smrg		CWARNFLAGS="$BASE_CFLAGS"
1108454044362Smrg		if  test "x$GCC" = xyes ; then
1108554044362Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
1108654044362Smrg		fi
1108754044362Smrg		AC_SUBST(CWARNFLAGS)
1108854044362Smrg	]
1108954044362Smrg)
1109054044362Smrg]) # XORG_CWARNFLAGS
1109154044362Smrg
1109254044362Smrg# XORG_STRICT_OPTION
1109354044362Smrg# -----------------------
1109454044362Smrg# Minimum version: 1.3.0
1109554044362Smrg#
1109654044362Smrg# Add configure option to enable strict compilation flags, such as treating
1109754044362Smrg# warnings as fatal errors.
1109854044362Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
1109954044362Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
1110054044362Smrg#
1110154044362Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
1110254044362Smrg# when strict compilation is unconditionally desired.
1110354044362SmrgAC_DEFUN([XORG_STRICT_OPTION], [
1110454044362SmrgAC_REQUIRE([XORG_CWARNFLAGS])
1110554044362SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1110654044362Smrg
1110754044362SmrgAC_ARG_ENABLE(strict-compilation,
1110854044362Smrg			  AS_HELP_STRING([--enable-strict-compilation],
1110954044362Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1111054044362Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1111154044362Smrg
1111254044362SmrgAC_LANG_CASE(
1111354044362Smrg        [C], [
1111454044362Smrg                define([PREFIX], [C])
1111554044362Smrg        ],
1111654044362Smrg        [C++], [
1111754044362Smrg                define([PREFIX], [CXX])
1111854044362Smrg        ]
1111954044362Smrg)
1112054044362Smrg
1112154044362Smrg[STRICT_]PREFIX[FLAGS]=""
1112254044362SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
1112354044362SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
1112454044362Smrg
1112554044362Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
1112654044362Smrg# activate it with -Werror, so we add it here explicitly.
1112754044362SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
1112854044362Smrg
1112954044362Smrgif test "x$STRICT_COMPILE" = "xyes"; then
1113054044362Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
1113154044362Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
1113254044362Smrgfi
1113354044362SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
1113454044362SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1113554044362SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
1113654044362Smrg]) # XORG_STRICT_OPTION
1113754044362Smrg
1113854044362Smrg# XORG_DEFAULT_OPTIONS
1113954044362Smrg# --------------------
1114054044362Smrg# Minimum version: 1.3.0
1114154044362Smrg#
1114254044362Smrg# Defines default options for X.Org modules.
1114354044362Smrg#
1114454044362SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1114554044362SmrgAC_REQUIRE([AC_PROG_INSTALL])
1114654044362SmrgXORG_COMPILER_FLAGS
1114754044362SmrgXORG_CWARNFLAGS
1114854044362SmrgXORG_STRICT_OPTION
1114954044362SmrgXORG_RELEASE_VERSION
1115054044362SmrgXORG_CHANGELOG
1115154044362SmrgXORG_INSTALL
1115254044362SmrgXORG_MANPAGE_SECTIONS
1115354044362Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1115454044362Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1115554044362Smrg]) # XORG_DEFAULT_OPTIONS
1115654044362Smrg
1115754044362Smrg# XORG_INSTALL()
1115854044362Smrg# ----------------
1115954044362Smrg# Minimum version: 1.4.0
1116054044362Smrg#
1116154044362Smrg# Defines the variable INSTALL_CMD as the command to copy
1116254044362Smrg# INSTALL from $prefix/share/util-macros.
1116354044362Smrg#
1116454044362SmrgAC_DEFUN([XORG_INSTALL], [
1116554044362SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1116654044362Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1116754044362SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1116854044362Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1116954044362Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1117054044362Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1117154044362SmrgAC_SUBST([INSTALL_CMD])
1117254044362Smrg]) # XORG_INSTALL
1117354044362Smrgdnl Copyright 2005 Red Hat, Inc
1117454044362Smrgdnl
1117554044362Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1117654044362Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1117754044362Smrgdnl the above copyright notice appear in all copies and that both that
1117854044362Smrgdnl copyright notice and this permission notice appear in supporting
1117954044362Smrgdnl documentation.
1118054044362Smrgdnl
1118154044362Smrgdnl The above copyright notice and this permission notice shall be included
1118254044362Smrgdnl in all copies or substantial portions of the Software.
1118354044362Smrgdnl
1118454044362Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1118554044362Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1118654044362Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1118754044362Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1118854044362Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1118954044362Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1119054044362Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1119154044362Smrgdnl
1119254044362Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1119354044362Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1119454044362Smrgdnl other dealings in this Software without prior written authorization
1119554044362Smrgdnl from the copyright holders.
1119654044362Smrgdnl
1119754044362Smrg
1119854044362Smrg# XORG_RELEASE_VERSION
1119954044362Smrg# --------------------
1120054044362Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1120154044362Smrg
1120254044362SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1120354044362Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1120454044362Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1120554044362Smrg		[Major version of this package])
1120654044362Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1120754044362Smrg	if test "x$PVM" = "x"; then
1120854044362Smrg		PVM="0"
1120954044362Smrg	fi
1121054044362Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1121154044362Smrg		[$PVM],
1121254044362Smrg		[Minor version of this package])
1121354044362Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1121454044362Smrg	if test "x$PVP" = "x"; then
1121554044362Smrg		PVP="0"
1121654044362Smrg	fi
1121754044362Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1121854044362Smrg		[$PVP],
1121954044362Smrg		[Patch version of this package])
1122054044362Smrg])
1122154044362Smrg
1122254044362Smrg# XORG_CHANGELOG()
1122354044362Smrg# ----------------
1122454044362Smrg# Minimum version: 1.2.0
1122554044362Smrg#
1122654044362Smrg# Defines the variable CHANGELOG_CMD as the command to generate
1122754044362Smrg# ChangeLog from git.
1122854044362Smrg#
1122954044362Smrg#
1123054044362SmrgAC_DEFUN([XORG_CHANGELOG], [
1123154044362SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1123254044362Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1123354044362Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1123454044362Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1123554044362SmrgAC_SUBST([CHANGELOG_CMD])
1123654044362Smrg]) # XORG_CHANGELOG
1123754044362Smrg
1123854044362Smrg# Copyright (C) 2002-2014 Free Software Foundation, Inc.
1123954044362Smrg#
1124054044362Smrg# This file is free software; the Free Software Foundation
1124154044362Smrg# gives unlimited permission to copy and/or distribute it,
1124254044362Smrg# with or without modifications, as long as this notice is preserved.
1124354044362Smrg
1124454044362Smrg# AM_AUTOMAKE_VERSION(VERSION)
1124554044362Smrg# ----------------------------
1124654044362Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
1124754044362Smrg# generated from the m4 files accompanying Automake X.Y.
1124854044362Smrg# (This private macro should not be called outside this file.)
1124954044362SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
1125054044362Smrg[am__api_version='1.15'
1125154044362Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1125254044362Smrgdnl require some minimum version.  Point them to the right macro.
1125354044362Smrgm4_if([$1], [1.15], [],
1125454044362Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1125554044362Smrg])
1125654044362Smrg
1125754044362Smrg# _AM_AUTOCONF_VERSION(VERSION)
1125854044362Smrg# -----------------------------
1125954044362Smrg# aclocal traces this macro to find the Autoconf version.
1126054044362Smrg# This is a private macro too.  Using m4_define simplifies
1126154044362Smrg# the logic in aclocal, which can simply ignore this definition.
1126254044362Smrgm4_define([_AM_AUTOCONF_VERSION], [])
1126354044362Smrg
1126454044362Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
1126554044362Smrg# -------------------------------
1126654044362Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1126754044362Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1126854044362SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1126954044362Smrg[AM_AUTOMAKE_VERSION([1.15])dnl
1127054044362Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1127154044362Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1127254044362Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1127354044362Smrg
1127454044362Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
1127554044362Smrg
1127654044362Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
1127754044362Smrg#
1127854044362Smrg# This file is free software; the Free Software Foundation
1127954044362Smrg# gives unlimited permission to copy and/or distribute it,
1128054044362Smrg# with or without modifications, as long as this notice is preserved.
1128154044362Smrg
1128254044362Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1128354044362Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
1128454044362Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
1128554044362Smrg#
1128654044362Smrg# Of course, Automake must honor this variable whenever it calls a
1128754044362Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
1128854044362Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
1128954044362Smrg# depending on how configure is run.  This is pretty annoying, since
1129054044362Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
1129154044362Smrg# source directory, any form will work fine, but in subdirectories a
1129254044362Smrg# relative path needs to be adjusted first.
1129354044362Smrg#
1129454044362Smrg# $ac_aux_dir/missing
1129554044362Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
1129654044362Smrg# $top_srcdir/$ac_aux_dir/missing
1129754044362Smrg#    fails if $ac_aux_dir is absolute,
1129854044362Smrg#    fails when called from a subdirectory in a VPATH build with
1129954044362Smrg#          a relative $ac_aux_dir
1130054044362Smrg#
1130154044362Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1130254044362Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
1130354044362Smrg# harmless because $srcdir is '.', but things will broke when you
1130454044362Smrg# start a VPATH build or use an absolute $srcdir.
1130554044362Smrg#
1130654044362Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1130754044362Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
1130854044362Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1130954044362Smrg# and then we would define $MISSING as
1131054044362Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
1131154044362Smrg# This will work as long as MISSING is not called from configure, because
1131254044362Smrg# unfortunately $(top_srcdir) has no meaning in configure.
1131354044362Smrg# However there are other variables, like CC, which are often used in
1131454044362Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
1131554044362Smrg#
1131654044362Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
1131754044362Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
1131854044362Smrg# configured tree to be moved without reconfiguration.
1131954044362Smrg
1132054044362SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1132154044362Smrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1132254044362Smrg# Expand $ac_aux_dir to an absolute path.
1132354044362Smrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
1132454044362Smrg])
1132554044362Smrg
1132654044362Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1132754044362Smrg
1132854044362Smrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
1132954044362Smrg#
1133054044362Smrg# This file is free software; the Free Software Foundation
1133154044362Smrg# gives unlimited permission to copy and/or distribute it,
1133254044362Smrg# with or without modifications, as long as this notice is preserved.
1133354044362Smrg
1133454044362Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1133554044362Smrg# -------------------------------------
1133654044362Smrg# Define a conditional.
1133754044362SmrgAC_DEFUN([AM_CONDITIONAL],
1133854044362Smrg[AC_PREREQ([2.52])dnl
1133954044362Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1134054044362Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1134154044362SmrgAC_SUBST([$1_TRUE])dnl
1134254044362SmrgAC_SUBST([$1_FALSE])dnl
1134354044362Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1134454044362Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1134554044362Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1134654044362Smrgif $2; then
1134754044362Smrg  $1_TRUE=
1134854044362Smrg  $1_FALSE='#'
1134954044362Smrgelse
1135054044362Smrg  $1_TRUE='#'
1135154044362Smrg  $1_FALSE=
1135254044362Smrgfi
1135354044362SmrgAC_CONFIG_COMMANDS_PRE(
1135454044362Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1135554044362Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1135654044362SmrgUsually this means the macro was only invoked conditionally.]])
1135754044362Smrgfi])])
1135854044362Smrg
1135954044362Smrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
1136054044362Smrg#
1136154044362Smrg# This file is free software; the Free Software Foundation
1136254044362Smrg# gives unlimited permission to copy and/or distribute it,
1136354044362Smrg# with or without modifications, as long as this notice is preserved.
1136454044362Smrg
1136554044362Smrg
1136654044362Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
1136754044362Smrg# written in clear, in which case automake, when reading aclocal.m4,
1136854044362Smrg# will think it sees a *use*, and therefore will trigger all it's
1136954044362Smrg# C support machinery.  Also note that it means that autoscan, seeing
1137054044362Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1137154044362Smrg
1137254044362Smrg
1137354044362Smrg# _AM_DEPENDENCIES(NAME)
1137454044362Smrg# ----------------------
1137554044362Smrg# See how the compiler implements dependency checking.
1137654044362Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
1137754044362Smrg# We try a few techniques and use that to set a single cache variable.
1137854044362Smrg#
1137954044362Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1138054044362Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1138154044362Smrg# dependency, and given that the user is not expected to run this macro,
1138254044362Smrg# just rely on AC_PROG_CC.
1138354044362SmrgAC_DEFUN([_AM_DEPENDENCIES],
1138454044362Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1138554044362SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1138654044362SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1138754044362SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1138854044362Smrg
1138954044362Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
1139054044362Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
1139154044362Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1139254044362Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
1139354044362Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
1139454044362Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1139554044362Smrg                    [depcc="$$1"   am_compiler_list=])
1139654044362Smrg
1139754044362SmrgAC_CACHE_CHECK([dependency style of $depcc],
1139854044362Smrg               [am_cv_$1_dependencies_compiler_type],
1139954044362Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1140054044362Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
1140154044362Smrg  # making bogus files that we don't know about and never remove.  For
1140254044362Smrg  # instance it was reported that on HP-UX the gcc test will end up
1140354044362Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
1140454044362Smrg  # in D".
1140554044362Smrg  rm -rf conftest.dir
1140654044362Smrg  mkdir conftest.dir
1140754044362Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1140854044362Smrg  # using a relative directory.
1140954044362Smrg  cp "$am_depcomp" conftest.dir
1141054044362Smrg  cd conftest.dir
1141154044362Smrg  # We will build objects and dependencies in a subdirectory because
1141254044362Smrg  # it helps to detect inapplicable dependency modes.  For instance
1141354044362Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
1141454044362Smrg  # side effect of compilation, but ICC will put the dependencies in
1141554044362Smrg  # the current directory while Tru64 will put them in the object
1141654044362Smrg  # directory.
1141754044362Smrg  mkdir sub
1141854044362Smrg
1141954044362Smrg  am_cv_$1_dependencies_compiler_type=none
1142054044362Smrg  if test "$am_compiler_list" = ""; then
1142154044362Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1142254044362Smrg  fi
1142354044362Smrg  am__universal=false
1142454044362Smrg  m4_case([$1], [CC],
1142554044362Smrg    [case " $depcc " in #(
1142654044362Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
1142754044362Smrg     esac],
1142854044362Smrg    [CXX],
1142954044362Smrg    [case " $depcc " in #(
1143054044362Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
1143154044362Smrg     esac])
1143254044362Smrg
1143354044362Smrg  for depmode in $am_compiler_list; do
1143454044362Smrg    # Setup a source with many dependencies, because some compilers
1143554044362Smrg    # like to wrap large dependency lists on column 80 (with \), and
1143654044362Smrg    # we should not choose a depcomp mode which is confused by this.
1143754044362Smrg    #
1143854044362Smrg    # We need to recreate these files for each test, as the compiler may
1143954044362Smrg    # overwrite some of them when testing with obscure command lines.
1144054044362Smrg    # This happens at least with the AIX C compiler.
1144154044362Smrg    : > sub/conftest.c
1144254044362Smrg    for i in 1 2 3 4 5 6; do
1144354044362Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
1144454044362Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
1144554044362Smrg      # Solaris 10 /bin/sh.
1144654044362Smrg      echo '/* dummy */' > sub/conftst$i.h
1144754044362Smrg    done
1144854044362Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1144954044362Smrg
1145054044362Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
1145154044362Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
1145254044362Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
1145354044362Smrg    # versions had trouble with output in subdirs.
1145454044362Smrg    am__obj=sub/conftest.${OBJEXT-o}
1145554044362Smrg    am__minus_obj="-o $am__obj"
1145654044362Smrg    case $depmode in
1145754044362Smrg    gcc)
1145854044362Smrg      # This depmode causes a compiler race in universal mode.
1145954044362Smrg      test "$am__universal" = false || continue
1146054044362Smrg      ;;
1146154044362Smrg    nosideeffect)
1146254044362Smrg      # After this tag, mechanisms are not by side-effect, so they'll
1146354044362Smrg      # only be used when explicitly requested.
1146454044362Smrg      if test "x$enable_dependency_tracking" = xyes; then
1146554044362Smrg	continue
1146654044362Smrg      else
1146754044362Smrg	break
1146854044362Smrg      fi
1146954044362Smrg      ;;
1147054044362Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
1147154044362Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
1147254044362Smrg      # not run yet.  These depmodes are late enough in the game, and
1147354044362Smrg      # so weak that their functioning should not be impacted.
1147454044362Smrg      am__obj=conftest.${OBJEXT-o}
1147554044362Smrg      am__minus_obj=
1147654044362Smrg      ;;
1147754044362Smrg    none) break ;;
1147854044362Smrg    esac
1147954044362Smrg    if depmode=$depmode \
1148054044362Smrg       source=sub/conftest.c object=$am__obj \
1148154044362Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1148254044362Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1148354044362Smrg         >/dev/null 2>conftest.err &&
1148454044362Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1148554044362Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1148654044362Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1148754044362Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1148854044362Smrg      # icc doesn't choke on unknown options, it will just issue warnings
1148954044362Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
1149054044362Smrg      # that says an option was ignored or not supported.
1149154044362Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
1149254044362Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
1149354044362Smrg      # The diagnosis changed in icc 8.0:
1149454044362Smrg      #   icc: Command line remark: option '-MP' not supported
1149554044362Smrg      if (grep 'ignoring option' conftest.err ||
1149654044362Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1149754044362Smrg        am_cv_$1_dependencies_compiler_type=$depmode
1149854044362Smrg        break
1149954044362Smrg      fi
1150054044362Smrg    fi
1150154044362Smrg  done
1150254044362Smrg
1150354044362Smrg  cd ..
1150454044362Smrg  rm -rf conftest.dir
1150554044362Smrgelse
1150654044362Smrg  am_cv_$1_dependencies_compiler_type=none
1150754044362Smrgfi
1150854044362Smrg])
1150954044362SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1151054044362SmrgAM_CONDITIONAL([am__fastdep$1], [
1151154044362Smrg  test "x$enable_dependency_tracking" != xno \
1151254044362Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1151354044362Smrg])
1151454044362Smrg
1151554044362Smrg
1151654044362Smrg# AM_SET_DEPDIR
1151754044362Smrg# -------------
1151854044362Smrg# Choose a directory name for dependency files.
1151954044362Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
1152054044362SmrgAC_DEFUN([AM_SET_DEPDIR],
1152154044362Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1152254044362SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1152354044362Smrg])
1152454044362Smrg
1152554044362Smrg
1152654044362Smrg# AM_DEP_TRACK
1152754044362Smrg# ------------
1152854044362SmrgAC_DEFUN([AM_DEP_TRACK],
1152954044362Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
1153054044362SmrgAS_HELP_STRING(
1153154044362Smrg  [--enable-dependency-tracking],
1153254044362Smrg  [do not reject slow dependency extractors])
1153354044362SmrgAS_HELP_STRING(
1153454044362Smrg  [--disable-dependency-tracking],
1153554044362Smrg  [speeds up one-time build])])
1153654044362Smrgif test "x$enable_dependency_tracking" != xno; then
1153754044362Smrg  am_depcomp="$ac_aux_dir/depcomp"
1153854044362Smrg  AMDEPBACKSLASH='\'
1153954044362Smrg  am__nodep='_no'
1154054044362Smrgfi
1154154044362SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1154254044362SmrgAC_SUBST([AMDEPBACKSLASH])dnl
1154354044362Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1154454044362SmrgAC_SUBST([am__nodep])dnl
1154554044362Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
1154654044362Smrg])
1154754044362Smrg
1154854044362Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
1154954044362Smrg
1155054044362Smrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
1155154044362Smrg#
1155254044362Smrg# This file is free software; the Free Software Foundation
1155354044362Smrg# gives unlimited permission to copy and/or distribute it,
1155454044362Smrg# with or without modifications, as long as this notice is preserved.
1155554044362Smrg
1155654044362Smrg
1155754044362Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
1155854044362Smrg# ------------------------------
1155954044362SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1156054044362Smrg[{
1156154044362Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
1156254044362Smrg  # are listed without --file.  Let's play safe and only enable the eval
1156354044362Smrg  # if we detect the quoting.
1156454044362Smrg  case $CONFIG_FILES in
1156554044362Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
1156654044362Smrg  *)   set x $CONFIG_FILES ;;
1156754044362Smrg  esac
1156854044362Smrg  shift
1156954044362Smrg  for mf
1157054044362Smrg  do
1157154044362Smrg    # Strip MF so we end up with the name of the file.
1157254044362Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
1157354044362Smrg    # Check whether this is an Automake generated Makefile or not.
1157454044362Smrg    # We used to match only the files named 'Makefile.in', but
1157554044362Smrg    # some people rename them; so instead we look at the file content.
1157654044362Smrg    # Grep'ing the first line is not enough: some people post-process
1157754044362Smrg    # each Makefile.in and add a new line on top of each file to say so.
1157854044362Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
1157954044362Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
1158054044362Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1158154044362Smrg      dirpart=`AS_DIRNAME("$mf")`
1158254044362Smrg    else
1158354044362Smrg      continue
1158454044362Smrg    fi
1158554044362Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
1158654044362Smrg    # from the Makefile without running 'make'.
1158754044362Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1158854044362Smrg    test -z "$DEPDIR" && continue
1158954044362Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
1159054044362Smrg    test -z "$am__include" && continue
1159154044362Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1159254044362Smrg    # Find all dependency output files, they are included files with
1159354044362Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
1159454044362Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
1159554044362Smrg    # expansion.
1159654044362Smrg    for file in `sed -n "
1159754044362Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1159854044362Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
1159954044362Smrg      # Make sure the directory exists.
1160054044362Smrg      test -f "$dirpart/$file" && continue
1160154044362Smrg      fdir=`AS_DIRNAME(["$file"])`
1160254044362Smrg      AS_MKDIR_P([$dirpart/$fdir])
1160354044362Smrg      # echo "creating $dirpart/$file"
1160454044362Smrg      echo '# dummy' > "$dirpart/$file"
1160554044362Smrg    done
1160654044362Smrg  done
1160754044362Smrg}
1160854044362Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1160954044362Smrg
1161054044362Smrg
1161154044362Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
1161254044362Smrg# -----------------------------
1161354044362Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
1161454044362Smrg#
1161554044362Smrg# This code is only required when automatic dependency tracking
1161654044362Smrg# is enabled.  FIXME.  This creates each '.P' file that we will
1161754044362Smrg# need in order to bootstrap the dependency handling code.
1161854044362SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1161954044362Smrg[AC_CONFIG_COMMANDS([depfiles],
1162054044362Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1162154044362Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1162254044362Smrg])
1162354044362Smrg
1162454044362Smrg# Do all the work for Automake.                             -*- Autoconf -*-
1162554044362Smrg
1162654044362Smrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
1162754044362Smrg#
1162854044362Smrg# This file is free software; the Free Software Foundation
1162954044362Smrg# gives unlimited permission to copy and/or distribute it,
1163054044362Smrg# with or without modifications, as long as this notice is preserved.
1163154044362Smrg
1163254044362Smrg# This macro actually does too much.  Some checks are only needed if
1163354044362Smrg# your package does certain things.  But this isn't really a big deal.
1163454044362Smrg
1163554044362Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
1163654044362Smrgm4_define([AC_PROG_CC],
1163754044362Smrgm4_defn([AC_PROG_CC])
1163854044362Smrg[_AM_PROG_CC_C_O
1163954044362Smrg])
1164054044362Smrg
1164154044362Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1164254044362Smrg# AM_INIT_AUTOMAKE([OPTIONS])
1164354044362Smrg# -----------------------------------------------
1164454044362Smrg# The call with PACKAGE and VERSION arguments is the old style
1164554044362Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
1164654044362Smrg# and VERSION should now be passed to AC_INIT and removed from
1164754044362Smrg# the call to AM_INIT_AUTOMAKE.
1164854044362Smrg# We support both call styles for the transition.  After
1164954044362Smrg# the next Automake release, Autoconf can make the AC_INIT
1165054044362Smrg# arguments mandatory, and then we can depend on a new Autoconf
1165154044362Smrg# release and drop the old call support.
1165254044362SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
1165354044362Smrg[AC_PREREQ([2.65])dnl
1165454044362Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
1165554044362Smrgdnl the ones we care about.
1165654044362Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1165754044362SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1165854044362SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
1165954044362Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
1166054044362Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1166154044362Smrg  # is not polluted with repeated "-I."
1166254044362Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1166354044362Smrg  # test to see if srcdir already configured
1166454044362Smrg  if test -f $srcdir/config.status; then
1166554044362Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1166654044362Smrg  fi
1166754044362Smrgfi
1166854044362Smrg
1166954044362Smrg# test whether we have cygpath
1167054044362Smrgif test -z "$CYGPATH_W"; then
1167154044362Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
1167254044362Smrg    CYGPATH_W='cygpath -w'
1167354044362Smrg  else
1167454044362Smrg    CYGPATH_W=echo
116758c9fbc29Smrg  fi
116764cd6a3aeSmrgfi
1167754044362SmrgAC_SUBST([CYGPATH_W])
116788c9fbc29Smrg
1167954044362Smrg# Define the identity of the package.
1168054044362Smrgdnl Distinguish between old-style and new-style calls.
1168154044362Smrgm4_ifval([$2],
1168254044362Smrg[AC_DIAGNOSE([obsolete],
1168354044362Smrg             [$0: two- and three-arguments forms are deprecated.])
1168454044362Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1168554044362Smrg AC_SUBST([PACKAGE], [$1])dnl
1168654044362Smrg AC_SUBST([VERSION], [$2])],
1168754044362Smrg[_AM_SET_OPTIONS([$1])dnl
1168854044362Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1168954044362Smrgm4_if(
1169054044362Smrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
1169154044362Smrg  [ok:ok],,
1169254044362Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1169354044362Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1169454044362Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
116954cd6a3aeSmrg
1169654044362Smrg_AM_IF_OPTION([no-define],,
1169754044362Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
1169854044362Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
116998c9fbc29Smrg
1170054044362Smrg# Some tools Automake needs.
1170154044362SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
1170254044362SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
1170354044362SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
1170454044362SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
1170554044362SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
1170654044362SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
1170754044362SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
1170854044362SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1170954044362SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1171054044362SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
1171154044362Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
1171254044362Smrg# dies out for good.  For more background, see:
1171354044362Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
1171454044362Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
1171554044362SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
1171654044362Smrg# We need awk for the "check" target (and possibly the TAP driver).  The
1171754044362Smrg# system "awk" is bad on some platforms.
1171854044362SmrgAC_REQUIRE([AC_PROG_AWK])dnl
1171954044362SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
1172054044362SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
1172154044362Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1172254044362Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1172354044362Smrg			     [_AM_PROG_TAR([v7])])])
1172454044362Smrg_AM_IF_OPTION([no-dependencies],,
1172554044362Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
1172654044362Smrg		  [_AM_DEPENDENCIES([CC])],
1172754044362Smrg		  [m4_define([AC_PROG_CC],
1172854044362Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
1172954044362SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
1173054044362Smrg		  [_AM_DEPENDENCIES([CXX])],
1173154044362Smrg		  [m4_define([AC_PROG_CXX],
1173254044362Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
1173354044362SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
1173454044362Smrg		  [_AM_DEPENDENCIES([OBJC])],
1173554044362Smrg		  [m4_define([AC_PROG_OBJC],
1173654044362Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
1173754044362SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
1173854044362Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
1173954044362Smrg		  [m4_define([AC_PROG_OBJCXX],
1174054044362Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
1174154044362Smrg])
1174254044362SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
1174354044362Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
1174454044362Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
1174554044362Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
1174654044362SmrgAC_CONFIG_COMMANDS_PRE(dnl
1174754044362Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
1174854044362Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
117498c9fbc29Smrg
1175054044362Smrg# POSIX will say in a future version that running "rm -f" with no argument
1175154044362Smrg# is OK; and we want to be able to make that assumption in our Makefile
1175254044362Smrg# recipes.  So use an aggressive probe to check that the usage we want is
1175354044362Smrg# actually supported "in the wild" to an acceptable degree.
1175454044362Smrg# See automake bug#10828.
1175554044362Smrg# To make any issue more visible, cause the running configure to be aborted
1175654044362Smrg# by default if the 'rm' program in use doesn't match our expectations; the
1175754044362Smrg# user can still override this though.
1175854044362Smrgif rm -f && rm -fr && rm -rf; then : OK; else
1175954044362Smrg  cat >&2 <<'END'
1176054044362SmrgOops!
117618c9fbc29Smrg
1176254044362SmrgYour 'rm' program seems unable to run without file operands specified
1176354044362Smrgon the command line, even when the '-f' option is present.  This is contrary
1176454044362Smrgto the behaviour of most rm programs out there, and not conforming with
1176554044362Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
117668c9fbc29Smrg
1176754044362SmrgPlease tell bug-automake@gnu.org about your system, including the value
1176854044362Smrgof your $PATH and any error possibly output before this message.  This
1176954044362Smrgcan help us improve future automake versions.
117708c9fbc29Smrg
1177154044362SmrgEND
1177254044362Smrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
1177354044362Smrg    echo 'Configuration will proceed anyway, since you have set the' >&2
1177454044362Smrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
1177554044362Smrg    echo >&2
1177654044362Smrg  else
1177754044362Smrg    cat >&2 <<'END'
1177854044362SmrgAborting the configuration process, to ensure you take notice of the issue.
117798c9fbc29Smrg
1178054044362SmrgYou can download and install GNU coreutils to get an 'rm' implementation
1178154044362Smrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
117828c9fbc29Smrg
1178354044362SmrgIf you want to complete the configuration process using your problematic
1178454044362Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
1178554044362Smrgto "yes", and re-run configure.
117864cd6a3aeSmrg
1178754044362SmrgEND
1178854044362Smrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
1178954044362Smrg  fi
117904cd6a3aeSmrgfi
1179154044362Smrgdnl The trailing newline in this macro's definition is deliberate, for
1179254044362Smrgdnl backward compatibility and to allow trailing 'dnl'-style comments
1179354044362Smrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
1179454044362Smrg])
117958c9fbc29Smrg
1179654044362Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
1179754044362Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1179854044362Smrgdnl mangled by Autoconf and run in a shell conditional statement.
1179954044362Smrgm4_define([_AC_COMPILER_EXEEXT],
1180054044362Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
118014e411241Smrg
1180254044362Smrg# When config.status generates a header, we must update the stamp-h file.
1180354044362Smrg# This file resides in the same directory as the config header
1180454044362Smrg# that is generated.  The stamp files are numbered to have different names.
118054e411241Smrg
1180654044362Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1180754044362Smrg# loop where config.status creates the headers, so we can generate
1180854044362Smrg# our stamp files there.
1180954044362SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1181054044362Smrg[# Compute $1's index in $config_headers.
1181154044362Smrg_am_arg=$1
1181254044362Smrg_am_stamp_count=1
1181354044362Smrgfor _am_header in $config_headers :; do
1181454044362Smrg  case $_am_header in
1181554044362Smrg    $_am_arg | $_am_arg:* )
1181654044362Smrg      break ;;
1181754044362Smrg    * )
1181854044362Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1181954044362Smrg  esac
1182054044362Smrgdone
1182154044362Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1182254044362Smrg
1182354044362Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
118244cd6a3aeSmrg#
1182554044362Smrg# This file is free software; the Free Software Foundation
1182654044362Smrg# gives unlimited permission to copy and/or distribute it,
1182754044362Smrg# with or without modifications, as long as this notice is preserved.
118284cd6a3aeSmrg
1182954044362Smrg# AM_PROG_INSTALL_SH
1183054044362Smrg# ------------------
1183154044362Smrg# Define $install_sh.
1183254044362SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
1183354044362Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1183454044362Smrgif test x"${install_sh+set}" != xset; then
1183554044362Smrg  case $am_aux_dir in
1183654044362Smrg  *\ * | *\	*)
1183754044362Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
1183854044362Smrg  *)
1183954044362Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
1184054044362Smrg  esac
1184154044362Smrgfi
1184254044362SmrgAC_SUBST([install_sh])])
118434cd6a3aeSmrg
1184454044362Smrg# Copyright (C) 2003-2014 Free Software Foundation, Inc.
1184554044362Smrg#
1184654044362Smrg# This file is free software; the Free Software Foundation
1184754044362Smrg# gives unlimited permission to copy and/or distribute it,
1184854044362Smrg# with or without modifications, as long as this notice is preserved.
118494cd6a3aeSmrg
1185054044362Smrg# Check whether the underlying file-system supports filenames
1185154044362Smrg# with a leading dot.  For instance MS-DOS doesn't.
1185254044362SmrgAC_DEFUN([AM_SET_LEADING_DOT],
1185354044362Smrg[rm -rf .tst 2>/dev/null
1185454044362Smrgmkdir .tst 2>/dev/null
1185554044362Smrgif test -d .tst; then
1185654044362Smrg  am__leading_dot=.
118574e411241Smrgelse
1185854044362Smrg  am__leading_dot=_
118594cd6a3aeSmrgfi
1186054044362Smrgrmdir .tst 2>/dev/null
1186154044362SmrgAC_SUBST([am__leading_dot])])
118624e411241Smrg
1186354044362Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
118644cd6a3aeSmrg
1186554044362Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
118664cd6a3aeSmrg#
1186754044362Smrg# This file is free software; the Free Software Foundation
1186854044362Smrg# gives unlimited permission to copy and/or distribute it,
1186954044362Smrg# with or without modifications, as long as this notice is preserved.
118704cd6a3aeSmrg
1187154044362Smrg# AM_MAKE_INCLUDE()
1187254044362Smrg# -----------------
1187354044362Smrg# Check to see how make treats includes.
1187454044362SmrgAC_DEFUN([AM_MAKE_INCLUDE],
1187554044362Smrg[am_make=${MAKE-make}
1187654044362Smrgcat > confinc << 'END'
1187754044362Smrgam__doit:
1187854044362Smrg	@echo this is the am__doit target
1187954044362Smrg.PHONY: am__doit
1188054044362SmrgEND
1188154044362Smrg# If we don't find an include directive, just comment out the code.
1188254044362SmrgAC_MSG_CHECKING([for style of include used by $am_make])
1188354044362Smrgam__include="#"
1188454044362Smrgam__quote=
1188554044362Smrg_am_result=none
1188654044362Smrg# First try GNU make style include.
1188754044362Smrgecho "include confinc" > confmf
1188854044362Smrg# Ignore all kinds of additional output from 'make'.
1188954044362Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
1189054044362Smrg*the\ am__doit\ target*)
1189154044362Smrg  am__include=include
1189254044362Smrg  am__quote=
1189354044362Smrg  _am_result=GNU
1189454044362Smrg  ;;
1189554044362Smrgesac
1189654044362Smrg# Now try BSD make style include.
1189754044362Smrgif test "$am__include" = "#"; then
1189854044362Smrg   echo '.include "confinc"' > confmf
1189954044362Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
1190054044362Smrg   *the\ am__doit\ target*)
1190154044362Smrg     am__include=.include
1190254044362Smrg     am__quote="\""
1190354044362Smrg     _am_result=BSD
1190454044362Smrg     ;;
1190554044362Smrg   esac
119064cd6a3aeSmrgfi
1190754044362SmrgAC_SUBST([am__include])
1190854044362SmrgAC_SUBST([am__quote])
1190954044362SmrgAC_MSG_RESULT([$_am_result])
1191054044362Smrgrm -f confinc confmf
1191154044362Smrg])
119124cd6a3aeSmrg
1191354044362Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
119144cd6a3aeSmrg
1191554044362Smrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
119164cd6a3aeSmrg#
1191754044362Smrg# This file is free software; the Free Software Foundation
1191854044362Smrg# gives unlimited permission to copy and/or distribute it,
1191954044362Smrg# with or without modifications, as long as this notice is preserved.
119208c9fbc29Smrg
1192154044362Smrg# AM_MISSING_PROG(NAME, PROGRAM)
1192254044362Smrg# ------------------------------
1192354044362SmrgAC_DEFUN([AM_MISSING_PROG],
1192454044362Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
1192554044362Smrg$1=${$1-"${am_missing_run}$2"}
1192654044362SmrgAC_SUBST($1)])
119274cd6a3aeSmrg
1192854044362Smrg# AM_MISSING_HAS_RUN
1192954044362Smrg# ------------------
1193054044362Smrg# Define MISSING if not defined so far and test if it is modern enough.
1193154044362Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
1193254044362SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
1193354044362Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1193454044362SmrgAC_REQUIRE_AUX_FILE([missing])dnl
1193554044362Smrgif test x"${MISSING+set}" != xset; then
1193654044362Smrg  case $am_aux_dir in
1193754044362Smrg  *\ * | *\	*)
1193854044362Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
1193954044362Smrg  *)
1194054044362Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
1194154044362Smrg  esac
119428c9fbc29Smrgfi
1194354044362Smrg# Use eval to expand $SHELL
1194454044362Smrgif eval "$MISSING --is-lightweight"; then
1194554044362Smrg  am_missing_run="$MISSING "
1194654044362Smrgelse
1194754044362Smrg  am_missing_run=
1194854044362Smrg  AC_MSG_WARN(['missing' script is too old or missing])
119494cd6a3aeSmrgfi
1195054044362Smrg])
119518c9fbc29Smrg
1195254044362Smrg# Helper functions for option handling.                     -*- Autoconf -*-
119534cd6a3aeSmrg
1195454044362Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
1195554044362Smrg#
1195654044362Smrg# This file is free software; the Free Software Foundation
1195754044362Smrg# gives unlimited permission to copy and/or distribute it,
1195854044362Smrg# with or without modifications, as long as this notice is preserved.
119594cd6a3aeSmrg
1196054044362Smrg# _AM_MANGLE_OPTION(NAME)
1196154044362Smrg# -----------------------
1196254044362SmrgAC_DEFUN([_AM_MANGLE_OPTION],
1196354044362Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
119644cd6a3aeSmrg
1196554044362Smrg# _AM_SET_OPTION(NAME)
1196654044362Smrg# --------------------
1196754044362Smrg# Set option NAME.  Presently that only means defining a flag for this option.
1196854044362SmrgAC_DEFUN([_AM_SET_OPTION],
1196954044362Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
119704cd6a3aeSmrg
1197154044362Smrg# _AM_SET_OPTIONS(OPTIONS)
1197254044362Smrg# ------------------------
1197354044362Smrg# OPTIONS is a space-separated list of Automake options.
1197454044362SmrgAC_DEFUN([_AM_SET_OPTIONS],
1197554044362Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
119764cd6a3aeSmrg
1197754044362Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1197854044362Smrg# -------------------------------------------
1197954044362Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1198054044362SmrgAC_DEFUN([_AM_IF_OPTION],
1198154044362Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
119824cd6a3aeSmrg
1198354044362Smrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
119848c9fbc29Smrg#
1198554044362Smrg# This file is free software; the Free Software Foundation
1198654044362Smrg# gives unlimited permission to copy and/or distribute it,
1198754044362Smrg# with or without modifications, as long as this notice is preserved.
119884cd6a3aeSmrg
1198954044362Smrg# _AM_PROG_CC_C_O
1199054044362Smrg# ---------------
1199154044362Smrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
1199254044362Smrg# to automatically call this.
1199354044362SmrgAC_DEFUN([_AM_PROG_CC_C_O],
1199454044362Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1199554044362SmrgAC_REQUIRE_AUX_FILE([compile])dnl
1199654044362SmrgAC_LANG_PUSH([C])dnl
1199754044362SmrgAC_CACHE_CHECK(
1199854044362Smrg  [whether $CC understands -c and -o together],
1199954044362Smrg  [am_cv_prog_cc_c_o],
1200054044362Smrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
1200154044362Smrg  # Make sure it works both with $CC and with simple cc.
1200254044362Smrg  # Following AC_PROG_CC_C_O, we do the test twice because some
1200354044362Smrg  # compilers refuse to overwrite an existing .o file with -o,
1200454044362Smrg  # though they will create one.
1200554044362Smrg  am_cv_prog_cc_c_o=yes
1200654044362Smrg  for am_i in 1 2; do
1200754044362Smrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
1200854044362Smrg         && test -f conftest2.$ac_objext; then
1200954044362Smrg      : OK
1201054044362Smrg    else
1201154044362Smrg      am_cv_prog_cc_c_o=no
1201254044362Smrg      break
1201354044362Smrg    fi
1201454044362Smrg  done
1201554044362Smrg  rm -f core conftest*
1201654044362Smrg  unset am_i])
1201754044362Smrgif test "$am_cv_prog_cc_c_o" != yes; then
1201854044362Smrg   # Losing compiler, so override with the script.
1201954044362Smrg   # FIXME: It is wrong to rewrite CC.
1202054044362Smrg   # But if we don't then we get into trouble of one sort or another.
1202154044362Smrg   # A longer-term fix would be to have automake use am__CC in this case,
1202254044362Smrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
1202354044362Smrg   CC="$am_aux_dir/compile $CC"
120244cd6a3aeSmrgfi
1202554044362SmrgAC_LANG_POP([C])])
120268c9fbc29Smrg
1202754044362Smrg# For backward compatibility.
1202854044362SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
1202954044362Smrg
1203054044362Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
1203154044362Smrg#
1203254044362Smrg# This file is free software; the Free Software Foundation
1203354044362Smrg# gives unlimited permission to copy and/or distribute it,
1203454044362Smrg# with or without modifications, as long as this notice is preserved.
1203554044362Smrg
1203654044362Smrg# AM_RUN_LOG(COMMAND)
1203754044362Smrg# -------------------
1203854044362Smrg# Run COMMAND, save the exit status in ac_status, and log it.
1203954044362Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
1204054044362SmrgAC_DEFUN([AM_RUN_LOG],
1204154044362Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
1204254044362Smrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
1204354044362Smrg   ac_status=$?
1204454044362Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1204554044362Smrg   (exit $ac_status); }])
120464cd6a3aeSmrg
1204754044362Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
120488c9fbc29Smrg
1204954044362Smrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
1205054044362Smrg#
1205154044362Smrg# This file is free software; the Free Software Foundation
1205254044362Smrg# gives unlimited permission to copy and/or distribute it,
1205354044362Smrg# with or without modifications, as long as this notice is preserved.
120544cd6a3aeSmrg
1205554044362Smrg# AM_SANITY_CHECK
1205654044362Smrg# ---------------
1205754044362SmrgAC_DEFUN([AM_SANITY_CHECK],
1205854044362Smrg[AC_MSG_CHECKING([whether build environment is sane])
1205954044362Smrg# Reject unsafe characters in $srcdir or the absolute working directory
1206054044362Smrg# name.  Accept space and tab only in the latter.
1206154044362Smrgam_lf='
1206254044362Smrg'
1206354044362Smrgcase `pwd` in
1206454044362Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
1206554044362Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
1206654044362Smrgesac
1206754044362Smrgcase $srcdir in
1206854044362Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
1206954044362Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
1207054044362Smrgesac
120714cd6a3aeSmrg
1207254044362Smrg# Do 'set' in a subshell so we don't clobber the current shell's
1207354044362Smrg# arguments.  Must try -L first in case configure is actually a
1207454044362Smrg# symlink; some systems play weird games with the mod time of symlinks
1207554044362Smrg# (eg FreeBSD returns the mod time of the symlink's containing
1207654044362Smrg# directory).
1207754044362Smrgif (
1207854044362Smrg   am_has_slept=no
1207954044362Smrg   for am_try in 1 2; do
1208054044362Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
1208154044362Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
1208254044362Smrg     if test "$[*]" = "X"; then
1208354044362Smrg	# -L didn't work.
1208454044362Smrg	set X `ls -t "$srcdir/configure" conftest.file`
1208554044362Smrg     fi
1208654044362Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
1208754044362Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
120884cd6a3aeSmrg
1208954044362Smrg	# If neither matched, then we have a broken ls.  This can happen
1209054044362Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
1209154044362Smrg	# broken ls alias from the environment.  This has actually
1209254044362Smrg	# happened.  Such a system could not be considered "sane".
1209354044362Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1209454044362Smrg  alias in your environment])
1209554044362Smrg     fi
1209654044362Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
1209754044362Smrg       break
1209854044362Smrg     fi
1209954044362Smrg     # Just in case.
1210054044362Smrg     sleep 1
1210154044362Smrg     am_has_slept=yes
1210254044362Smrg   done
1210354044362Smrg   test "$[2]" = conftest.file
1210454044362Smrg   )
1210554044362Smrgthen
1210654044362Smrg   # Ok.
1210754044362Smrg   :
121084e411241Smrgelse
1210954044362Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
1211054044362SmrgCheck your system clock])
121114cd6a3aeSmrgfi
1211254044362SmrgAC_MSG_RESULT([yes])
1211354044362Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
1211454044362Smrg# generated files are strictly newer.
1211554044362Smrgam_sleep_pid=
1211654044362Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
1211754044362Smrg  ( sleep 1 ) &
1211854044362Smrg  am_sleep_pid=$!
1211954044362Smrgfi
1212054044362SmrgAC_CONFIG_COMMANDS_PRE(
1212154044362Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
1212254044362Smrg   if test -n "$am_sleep_pid"; then
1212354044362Smrg     # Hide warnings about reused PIDs.
1212454044362Smrg     wait $am_sleep_pid 2>/dev/null
1212554044362Smrg   fi
1212654044362Smrg   AC_MSG_RESULT([done])])
1212754044362Smrgrm -f conftest.file
1212854044362Smrg])
121294e411241Smrg
1213054044362Smrg# Copyright (C) 2009-2014 Free Software Foundation, Inc.
121318c9fbc29Smrg#
1213254044362Smrg# This file is free software; the Free Software Foundation
1213354044362Smrg# gives unlimited permission to copy and/or distribute it,
1213454044362Smrg# with or without modifications, as long as this notice is preserved.
121358c9fbc29Smrg
1213654044362Smrg# AM_SILENT_RULES([DEFAULT])
1213754044362Smrg# --------------------------
1213854044362Smrg# Enable less verbose build rules; with the default set to DEFAULT
1213954044362Smrg# ("yes" being less verbose, "no" or empty being verbose).
1214054044362SmrgAC_DEFUN([AM_SILENT_RULES],
1214154044362Smrg[AC_ARG_ENABLE([silent-rules], [dnl
1214254044362SmrgAS_HELP_STRING(
1214354044362Smrg  [--enable-silent-rules],
1214454044362Smrg  [less verbose build output (undo: "make V=1")])
1214554044362SmrgAS_HELP_STRING(
1214654044362Smrg  [--disable-silent-rules],
1214754044362Smrg  [verbose build output (undo: "make V=0")])dnl
1214854044362Smrg])
1214954044362Smrgcase $enable_silent_rules in @%:@ (((
1215054044362Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
1215154044362Smrg   no) AM_DEFAULT_VERBOSITY=1;;
1215254044362Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1215354044362Smrgesac
1215454044362Smrgdnl
1215554044362Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
1215654044362Smrgdnl do not support nested variable expansions.
1215754044362Smrgdnl See automake bug#9928 and bug#10237.
1215854044362Smrgam_make=${MAKE-make}
1215954044362SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
1216054044362Smrg   [am_cv_make_support_nested_variables],
1216154044362Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
1216254044362SmrgBAR0=false
1216354044362SmrgBAR1=true
1216454044362SmrgV=1
1216554044362Smrgam__doit:
1216654044362Smrg	@$(TRUE)
1216754044362Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
1216854044362Smrg  am_cv_make_support_nested_variables=yes
1216954044362Smrgelse
1217054044362Smrg  am_cv_make_support_nested_variables=no
1217154044362Smrgfi])
1217254044362Smrgif test $am_cv_make_support_nested_variables = yes; then
1217354044362Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
1217454044362Smrg  AM_V='$(V)'
1217554044362Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
1217654044362Smrgelse
1217754044362Smrg  AM_V=$AM_DEFAULT_VERBOSITY
1217854044362Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
1217954044362Smrgfi
1218054044362SmrgAC_SUBST([AM_V])dnl
1218154044362SmrgAM_SUBST_NOTMAKE([AM_V])dnl
1218254044362SmrgAC_SUBST([AM_DEFAULT_V])dnl
1218354044362SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
1218454044362SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1218554044362SmrgAM_BACKSLASH='\'
1218654044362SmrgAC_SUBST([AM_BACKSLASH])dnl
1218754044362Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1218854044362Smrg])
1218954044362Smrg
1219054044362Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
121914cd6a3aeSmrg#
1219254044362Smrg# This file is free software; the Free Software Foundation
1219354044362Smrg# gives unlimited permission to copy and/or distribute it,
1219454044362Smrg# with or without modifications, as long as this notice is preserved.
1219554044362Smrg
1219654044362Smrg# AM_PROG_INSTALL_STRIP
1219754044362Smrg# ---------------------
1219854044362Smrg# One issue with vendor 'install' (even GNU) is that you can't
1219954044362Smrg# specify the program used to strip binaries.  This is especially
1220054044362Smrg# annoying in cross-compiling environments, where the build's strip
1220154044362Smrg# is unlikely to handle the host's binaries.
1220254044362Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
1220354044362Smrg# always use install-sh in "make install-strip", and initialize
1220454044362Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
1220554044362SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
1220654044362Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1220754044362Smrg# Installed binaries are usually stripped using 'strip' when the user
1220854044362Smrg# run "make install-strip".  However 'strip' might not be the right
1220954044362Smrg# tool to use in cross-compilation environments, therefore Automake
1221054044362Smrg# will honor the 'STRIP' environment variable to overrule this program.
1221154044362Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
1221254044362Smrgif test "$cross_compiling" != no; then
1221354044362Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
1221454044362Smrgfi
1221554044362SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1221654044362SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
122178c9fbc29Smrg
1221854044362Smrg# Copyright (C) 2006-2014 Free Software Foundation, Inc.
1221954044362Smrg#
1222054044362Smrg# This file is free software; the Free Software Foundation
1222154044362Smrg# gives unlimited permission to copy and/or distribute it,
1222254044362Smrg# with or without modifications, as long as this notice is preserved.
122238c9fbc29Smrg
1222454044362Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
1222554044362Smrg# ---------------------------
1222654044362Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1222754044362Smrg# This macro is traced by Automake.
1222854044362SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
122294e411241Smrg
1223054044362Smrg# AM_SUBST_NOTMAKE(VARIABLE)
1223154044362Smrg# --------------------------
1223254044362Smrg# Public sister of _AM_SUBST_NOTMAKE.
1223354044362SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
122348c9fbc29Smrg
1223554044362Smrg# Check how to create a tarball.                            -*- Autoconf -*-
122364e411241Smrg
1223754044362Smrg# Copyright (C) 2004-2014 Free Software Foundation, Inc.
1223854044362Smrg#
1223954044362Smrg# This file is free software; the Free Software Foundation
1224054044362Smrg# gives unlimited permission to copy and/or distribute it,
1224154044362Smrg# with or without modifications, as long as this notice is preserved.
122424e411241Smrg
1224354044362Smrg# _AM_PROG_TAR(FORMAT)
122444cd6a3aeSmrg# --------------------
1224554044362Smrg# Check how to create a tarball in format FORMAT.
1224654044362Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
122474cd6a3aeSmrg#
1224854044362Smrg# Substitute a variable $(am__tar) that is a command
1224954044362Smrg# writing to stdout a FORMAT-tarball containing the directory
1225054044362Smrg# $tardir.
1225154044362Smrg#     tardir=directory && $(am__tar) > result.tar
122524cd6a3aeSmrg#
1225354044362Smrg# Substitute a variable $(am__untar) that extract such
1225454044362Smrg# a tarball read from stdin.
1225554044362Smrg#     $(am__untar) < result.tar
122564cd6a3aeSmrg#
1225754044362SmrgAC_DEFUN([_AM_PROG_TAR],
1225854044362Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
1225954044362Smrg# in the wild :-(  We should find a proper way to deprecate it ...
1226054044362SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
122618c9fbc29Smrg
1226254044362Smrg# We'll loop over all known methods to create a tar archive until one works.
1226354044362Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1226470728a38Smrg
1226554044362Smrgm4_if([$1], [v7],
1226654044362Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
122678c9fbc29Smrg
1226854044362Smrg  [m4_case([$1],
1226954044362Smrg    [ustar],
1227054044362Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1227154044362Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
1227254044362Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1227354044362Smrg      # and bug#13588).
1227454044362Smrg      am_max_uid=2097151 # 2^21 - 1
1227554044362Smrg      am_max_gid=$am_max_uid
1227654044362Smrg      # The $UID and $GID variables are not portable, so we need to resort
1227754044362Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
1227854044362Smrg      # below are definitely unexpected, so allow the users to see them
1227954044362Smrg      # (that is, avoid stderr redirection).
1228054044362Smrg      am_uid=`id -u || echo unknown`
1228154044362Smrg      am_gid=`id -g || echo unknown`
1228254044362Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
1228354044362Smrg      if test $am_uid -le $am_max_uid; then
1228454044362Smrg         AC_MSG_RESULT([yes])
1228554044362Smrg      else
1228654044362Smrg         AC_MSG_RESULT([no])
1228754044362Smrg         _am_tools=none
1228854044362Smrg      fi
1228954044362Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
1229054044362Smrg      if test $am_gid -le $am_max_gid; then
1229154044362Smrg         AC_MSG_RESULT([yes])
1229254044362Smrg      else
1229354044362Smrg        AC_MSG_RESULT([no])
1229454044362Smrg        _am_tools=none
1229554044362Smrg      fi],
1229654044362Smrg
1229754044362Smrg  [pax],
1229854044362Smrg    [],
1229954044362Smrg
1230054044362Smrg  [m4_fatal([Unknown tar format])])
1230154044362Smrg
1230254044362Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
1230354044362Smrg
1230454044362Smrg  # Go ahead even if we have the value already cached.  We do so because we
1230554044362Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
1230654044362Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1230754044362Smrg
1230854044362Smrg  for _am_tool in $_am_tools; do
1230954044362Smrg    case $_am_tool in
1231054044362Smrg    gnutar)
1231154044362Smrg      for _am_tar in tar gnutar gtar; do
1231254044362Smrg        AM_RUN_LOG([$_am_tar --version]) && break
1231354044362Smrg      done
1231454044362Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1231554044362Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1231654044362Smrg      am__untar="$_am_tar -xf -"
1231754044362Smrg      ;;
1231854044362Smrg    plaintar)
1231954044362Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
1232054044362Smrg      # ustar tarball either.
1232154044362Smrg      (tar --version) >/dev/null 2>&1 && continue
1232254044362Smrg      am__tar='tar chf - "$$tardir"'
1232354044362Smrg      am__tar_='tar chf - "$tardir"'
1232454044362Smrg      am__untar='tar xf -'
1232554044362Smrg      ;;
1232654044362Smrg    pax)
1232754044362Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
1232854044362Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
1232954044362Smrg      am__untar='pax -r'
1233054044362Smrg      ;;
1233154044362Smrg    cpio)
1233254044362Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1233354044362Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1233454044362Smrg      am__untar='cpio -i -H $1 -d'
1233554044362Smrg      ;;
1233654044362Smrg    none)
1233754044362Smrg      am__tar=false
1233854044362Smrg      am__tar_=false
1233954044362Smrg      am__untar=false
1234054044362Smrg      ;;
1234154044362Smrg    esac
1234254044362Smrg
1234354044362Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
1234454044362Smrg    # and am__untar set.
1234554044362Smrg    test -n "${am_cv_prog_tar_$1}" && break
1234654044362Smrg
1234754044362Smrg    # tar/untar a dummy directory, and stop if the command works.
1234854044362Smrg    rm -rf conftest.dir
1234954044362Smrg    mkdir conftest.dir
1235054044362Smrg    echo GrepMe > conftest.dir/file
1235154044362Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1235254044362Smrg    rm -rf conftest.dir
1235354044362Smrg    if test -s conftest.tar; then
1235454044362Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
1235554044362Smrg      AM_RUN_LOG([cat conftest.dir/file])
1235654044362Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1235754044362Smrg    fi
1235854044362Smrg  done
1235954044362Smrg  rm -rf conftest.dir
1236054044362Smrg
1236154044362Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1236254044362Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1236354044362Smrg
1236454044362SmrgAC_SUBST([am__tar])
1236554044362SmrgAC_SUBST([am__untar])
1236654044362Smrg]) # _AM_PROG_TAR
123678c9fbc29Smrg
12368