aclocal.m4 revision 9586ba5a
19586ba5aSmrg# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
29586ba5aSmrg
39586ba5aSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
476888252Smrg
576888252Smrg# This file is free software; the Free Software Foundation
676888252Smrg# gives unlimited permission to copy and/or distribute it,
776888252Smrg# with or without modifications, as long as this notice is preserved.
876888252Smrg
976888252Smrg# This program is distributed in the hope that it will be useful,
1076888252Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1176888252Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1276888252Smrg# PARTICULAR PURPOSE.
1376888252Smrg
149586ba5aSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
1586dafe34Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1686dafe34Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1763847c39Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
1863847c39Smrg[m4_warning([this file was generated for autoconf 2.69.
1986dafe34SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
2086dafe34SmrgIf you have problems, you may need to regenerate the build system entirely.
219586ba5aSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
2276888252Smrg
2386dafe34Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2463847c39Smrg#
2563847c39Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
2663847c39Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
2763847c39Smrg#                 Foundation, Inc.
2863847c39Smrg#   Written by Gordon Matzigkeit, 1996
2963847c39Smrg#
3063847c39Smrg# This file is free software; the Free Software Foundation gives
3163847c39Smrg# unlimited permission to copy and/or distribute it, with or without
3263847c39Smrg# modifications, as long as this notice is preserved.
3363847c39Smrg
3463847c39Smrgm4_define([_LT_COPYING], [dnl
3563847c39Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
3663847c39Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
3763847c39Smrg#                 Foundation, Inc.
3863847c39Smrg#   Written by Gordon Matzigkeit, 1996
3963847c39Smrg#
4063847c39Smrg#   This file is part of GNU Libtool.
4163847c39Smrg#
4263847c39Smrg# GNU Libtool is free software; you can redistribute it and/or
4363847c39Smrg# modify it under the terms of the GNU General Public License as
4463847c39Smrg# published by the Free Software Foundation; either version 2 of
4563847c39Smrg# the License, or (at your option) any later version.
4663847c39Smrg#
4763847c39Smrg# As a special exception to the GNU General Public License,
4863847c39Smrg# if you distribute this file as part of a program or library that
4963847c39Smrg# is built using GNU Libtool, you may include this file under the
5063847c39Smrg# same distribution terms that you use for the rest of that program.
5163847c39Smrg#
5263847c39Smrg# GNU Libtool is distributed in the hope that it will be useful,
5363847c39Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
5463847c39Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5563847c39Smrg# GNU General Public License for more details.
5663847c39Smrg#
5763847c39Smrg# You should have received a copy of the GNU General Public License
5863847c39Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
5963847c39Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
6063847c39Smrg# obtained by writing to the Free Software Foundation, Inc.,
6163847c39Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
6263847c39Smrg])
6376888252Smrg
6463847c39Smrg# serial 57 LT_INIT
6576888252Smrg
6676888252Smrg
6763847c39Smrg# LT_PREREQ(VERSION)
6863847c39Smrg# ------------------
6963847c39Smrg# Complain and exit if this libtool version is less that VERSION.
7063847c39Smrgm4_defun([LT_PREREQ],
7163847c39Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
7263847c39Smrg       [m4_default([$3],
7363847c39Smrg		   [m4_fatal([Libtool version $1 or higher is required],
7463847c39Smrg		             63)])],
7563847c39Smrg       [$2])])
7676888252Smrg
7776888252Smrg
7863847c39Smrg# _LT_CHECK_BUILDDIR
7963847c39Smrg# ------------------
8063847c39Smrg# Complain if the absolute build directory name contains unusual characters
8163847c39Smrgm4_defun([_LT_CHECK_BUILDDIR],
8263847c39Smrg[case `pwd` in
8363847c39Smrg  *\ * | *\	*)
8463847c39Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
8563847c39Smrgesac
8663847c39Smrg])
8763847c39Smrg
8863847c39Smrg
8963847c39Smrg# LT_INIT([OPTIONS])
9063847c39Smrg# ------------------
9163847c39SmrgAC_DEFUN([LT_INIT],
9263847c39Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
9363847c39SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
9463847c39SmrgAC_BEFORE([$0], [LT_LANG])dnl
9563847c39SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
9663847c39SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
9763847c39Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
9863847c39Smrg
9963847c39Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
10063847c39Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
10163847c39Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
10263847c39Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
10363847c39Smrgdnl unless we require an AC_DEFUNed macro:
10463847c39SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
10563847c39SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
10663847c39SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
10763847c39SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
10863847c39Smrgm4_require([_LT_PROG_LTMAIN])dnl
10963847c39Smrg
11063847c39Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
11163847c39Smrg
11263847c39Smrgdnl Parse OPTIONS
11363847c39Smrg_LT_SET_OPTIONS([$0], [$1])
11476888252Smrg
11586dafe34Smrg# This can be used to rebuild libtool when needed
11663847c39SmrgLIBTOOL_DEPS="$ltmain"
11776888252Smrg
11886dafe34Smrg# Always use our own libtool.
11986dafe34SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
12086dafe34SmrgAC_SUBST(LIBTOOL)dnl
12176888252Smrg
12263847c39Smrg_LT_SETUP
12376888252Smrg
12463847c39Smrg# Only expand once:
12563847c39Smrgm4_define([LT_INIT])
12663847c39Smrg])# LT_INIT
12786dafe34Smrg
12863847c39Smrg# Old names:
12963847c39SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
13063847c39SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
13163847c39Smrgdnl aclocal-1.4 backwards compatibility:
13263847c39Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
13363847c39Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
13463847c39Smrg
13563847c39Smrg
13663847c39Smrg# _LT_CC_BASENAME(CC)
13763847c39Smrg# -------------------
13863847c39Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
13963847c39Smrgm4_defun([_LT_CC_BASENAME],
14063847c39Smrg[for cc_temp in $1""; do
14163847c39Smrg  case $cc_temp in
14263847c39Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
14363847c39Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
14463847c39Smrg    \-*) ;;
14563847c39Smrg    *) break;;
14663847c39Smrg  esac
14763847c39Smrgdone
14863847c39Smrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
14963847c39Smrg])
15063847c39Smrg
15163847c39Smrg
15263847c39Smrg# _LT_FILEUTILS_DEFAULTS
15363847c39Smrg# ----------------------
15463847c39Smrg# It is okay to use these file commands and assume they have been set
15563847c39Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
15663847c39Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
15763847c39Smrg[: ${CP="cp -f"}
15863847c39Smrg: ${MV="mv -f"}
15963847c39Smrg: ${RM="rm -f"}
16063847c39Smrg])# _LT_FILEUTILS_DEFAULTS
16163847c39Smrg
16263847c39Smrg
16363847c39Smrg# _LT_SETUP
16463847c39Smrg# ---------
16563847c39Smrgm4_defun([_LT_SETUP],
16663847c39Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
16786dafe34SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
16863847c39SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
16963847c39SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
170d8556812Smrg
17163847c39Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
17263847c39Smrgdnl
17363847c39Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
17463847c39Smrg_LT_DECL([], [host], [0])dnl
17563847c39Smrg_LT_DECL([], [host_os], [0])dnl
17663847c39Smrgdnl
17763847c39Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
17863847c39Smrg_LT_DECL([], [build], [0])dnl
17963847c39Smrg_LT_DECL([], [build_os], [0])dnl
18063847c39Smrgdnl
18163847c39SmrgAC_REQUIRE([AC_PROG_CC])dnl
18263847c39SmrgAC_REQUIRE([LT_PATH_LD])dnl
18363847c39SmrgAC_REQUIRE([LT_PATH_NM])dnl
18463847c39Smrgdnl
18586dafe34SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
18663847c39Smrgtest -z "$LN_S" && LN_S="ln -s"
18763847c39Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
18886dafe34Smrgdnl
18963847c39SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
19063847c39Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
19163847c39Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
19263847c39Smrgdnl
19363847c39Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
19463847c39Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
19563847c39Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
19663847c39Smrgm4_require([_LT_CMD_RELOAD])dnl
19763847c39Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
19863847c39Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
19963847c39Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
20063847c39Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
20163847c39Smrgm4_require([_LT_WITH_SYSROOT])dnl
20263847c39Smrg
20363847c39Smrg_LT_CONFIG_LIBTOOL_INIT([
20463847c39Smrg# See if we are running on zsh, and set the options which allow our
20563847c39Smrg# commands through without removal of \ escapes INIT.
20663847c39Smrgif test -n "\${ZSH_VERSION+set}" ; then
20763847c39Smrg   setopt NO_GLOB_SUBST
20863847c39Smrgfi
20963847c39Smrg])
21063847c39Smrgif test -n "${ZSH_VERSION+set}" ; then
21163847c39Smrg   setopt NO_GLOB_SUBST
21263847c39Smrgfi
21376888252Smrg
21463847c39Smrg_LT_CHECK_OBJDIR
21563847c39Smrg
21663847c39Smrgm4_require([_LT_TAG_COMPILER])dnl
21776888252Smrg
21886dafe34Smrgcase $host_os in
21986dafe34Smrgaix3*)
22086dafe34Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
22186dafe34Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
22286dafe34Smrg  # vanish in a puff of smoke.
22386dafe34Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
22486dafe34Smrg    COLLECT_NAMES=
22586dafe34Smrg    export COLLECT_NAMES
22686dafe34Smrg  fi
22786dafe34Smrg  ;;
22886dafe34Smrgesac
22976888252Smrg
23086dafe34Smrg# Global variables:
23163847c39Smrgofile=libtool
23286dafe34Smrgcan_build_shared=yes
23376888252Smrg
23486dafe34Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
23586dafe34Smrg# which needs '.lib').
23686dafe34Smrglibext=a
23776888252Smrg
23863847c39Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
239d8556812Smrg
24086dafe34Smrgold_CC="$CC"
24186dafe34Smrgold_CFLAGS="$CFLAGS"
2421ae1b5e8Smrg
24386dafe34Smrg# Set sane defaults for various variables
24486dafe34Smrgtest -z "$CC" && CC=cc
24586dafe34Smrgtest -z "$LTCC" && LTCC=$CC
24686dafe34Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
24786dafe34Smrgtest -z "$LD" && LD=ld
24886dafe34Smrgtest -z "$ac_objext" && ac_objext=o
2491ae1b5e8Smrg
25086dafe34Smrg_LT_CC_BASENAME([$compiler])
2511ae1b5e8Smrg
25286dafe34Smrg# Only perform the check for file, if the check method requires it
25363847c39Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
25486dafe34Smrgcase $deplibs_check_method in
25586dafe34Smrgfile_magic*)
25686dafe34Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
25763847c39Smrg    _LT_PATH_MAGIC
25886dafe34Smrg  fi
25986dafe34Smrg  ;;
26086dafe34Smrgesac
26176888252Smrg
26263847c39Smrg# Use C for the default configuration in the libtool script
26363847c39SmrgLT_SUPPORTED_TAG([CC])
26463847c39Smrg_LT_LANG_C_CONFIG
26563847c39Smrg_LT_LANG_DEFAULT_CONFIG
26663847c39Smrg_LT_CONFIG_COMMANDS
26763847c39Smrg])# _LT_SETUP
26876888252Smrg
26976888252Smrg
27063847c39Smrg# _LT_PREPARE_SED_QUOTE_VARS
27163847c39Smrg# --------------------------
27263847c39Smrg# Define a few sed substitution that help us do robust quoting.
27363847c39Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
27463847c39Smrg[# Backslashify metacharacters that are still active within
27563847c39Smrg# double-quoted strings.
27663847c39Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
27776888252Smrg
27863847c39Smrg# Same as above, but do not quote variable references.
27963847c39Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
28076888252Smrg
28163847c39Smrg# Sed substitution to delay expansion of an escaped shell variable in a
28263847c39Smrg# double_quote_subst'ed string.
28363847c39Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
28476888252Smrg
28563847c39Smrg# Sed substitution to delay expansion of an escaped single quote.
28663847c39Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
28776888252Smrg
28863847c39Smrg# Sed substitution to avoid accidental globbing in evaled expressions
28963847c39Smrgno_glob_subst='s/\*/\\\*/g'
29063847c39Smrg])
29176888252Smrg
29263847c39Smrg# _LT_PROG_LTMAIN
29363847c39Smrg# ---------------
29463847c39Smrg# Note that this code is called both from `configure', and `config.status'
29563847c39Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
29663847c39Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
29763847c39Smrg# so we pass a copy along to make sure it has a sensible value anyway.
29863847c39Smrgm4_defun([_LT_PROG_LTMAIN],
29963847c39Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
30063847c39Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
30163847c39Smrgltmain="$ac_aux_dir/ltmain.sh"
30263847c39Smrg])# _LT_PROG_LTMAIN
30376888252Smrg
30476888252Smrg
305d8556812Smrg
30663847c39Smrg# So that we can recreate a full libtool script including additional
30763847c39Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
30863847c39Smrg# in macros and then make a single call at the end using the `libtool'
30963847c39Smrg# label.
310d8556812Smrg
31176888252Smrg
31263847c39Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
31363847c39Smrg# ----------------------------------------
31463847c39Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
31563847c39Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
31663847c39Smrg[m4_ifval([$1],
31763847c39Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
31863847c39Smrg                     [$1
31963847c39Smrg])])])
32076888252Smrg
32163847c39Smrg# Initialize.
32263847c39Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
32376888252Smrg
32476888252Smrg
32563847c39Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
32663847c39Smrg# ------------------------------
32763847c39Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
32863847c39Smrgm4_define([_LT_CONFIG_LIBTOOL],
32963847c39Smrg[m4_ifval([$1],
33063847c39Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
33163847c39Smrg                     [$1
33263847c39Smrg])])])
33363847c39Smrg
33463847c39Smrg# Initialize.
33563847c39Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
33663847c39Smrg
33763847c39Smrg
33863847c39Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
33963847c39Smrg# -----------------------------------------------------
34063847c39Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
34163847c39Smrg[_LT_CONFIG_LIBTOOL([$1])
34263847c39Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
34363847c39Smrg])
34476888252Smrg
34586dafe34Smrg
34663847c39Smrg# _LT_FORMAT_COMMENT([COMMENT])
34763847c39Smrg# -----------------------------
34863847c39Smrg# Add leading comment marks to the start of each line, and a trailing
34963847c39Smrg# full-stop to the whole comment if one is not present already.
35063847c39Smrgm4_define([_LT_FORMAT_COMMENT],
35163847c39Smrg[m4_ifval([$1], [
35263847c39Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
35363847c39Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
35463847c39Smrg)])
35563847c39Smrg
35663847c39Smrg
35763847c39Smrg
35863847c39Smrg
35963847c39Smrg
36063847c39Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
36163847c39Smrg# -------------------------------------------------------------------
36263847c39Smrg# CONFIGNAME is the name given to the value in the libtool script.
36363847c39Smrg# VARNAME is the (base) name used in the configure script.
36463847c39Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
36563847c39Smrg# VARNAME.  Any other value will be used directly.
36663847c39Smrgm4_define([_LT_DECL],
36763847c39Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
36863847c39Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
36963847c39Smrg	[m4_ifval([$1], [$1], [$2])])
37063847c39Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
37163847c39Smrg    m4_ifval([$4],
37263847c39Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
37363847c39Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
37463847c39Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
37586dafe34Smrg])
37676888252Smrg
37776888252Smrg
37863847c39Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
37963847c39Smrg# --------------------------------------------------------
38063847c39Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
38176888252Smrg
38276888252Smrg
38363847c39Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
38463847c39Smrg# ------------------------------------------------
38563847c39Smrgm4_define([lt_decl_tag_varnames],
38663847c39Smrg[_lt_decl_filter([tagged?], [yes], $@)])
38776888252Smrg
38886dafe34Smrg
38963847c39Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
39063847c39Smrg# ---------------------------------------------------------
39163847c39Smrgm4_define([_lt_decl_filter],
39263847c39Smrg[m4_case([$#],
39363847c39Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
39463847c39Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
39563847c39Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
39663847c39Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
39763847c39Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
39863847c39Smrg])
39976888252Smrg
40076888252Smrg
40163847c39Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
40263847c39Smrg# --------------------------------------------------
40363847c39Smrgm4_define([lt_decl_quote_varnames],
40463847c39Smrg[_lt_decl_filter([value], [1], $@)])
40576888252Smrg
40676888252Smrg
40763847c39Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
40863847c39Smrg# ---------------------------------------------------
40963847c39Smrgm4_define([lt_decl_dquote_varnames],
41063847c39Smrg[_lt_decl_filter([value], [2], $@)])
41176888252Smrg
41276888252Smrg
41363847c39Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
41463847c39Smrg# ---------------------------------------------------
41563847c39Smrgm4_define([lt_decl_varnames_tagged],
41663847c39Smrg[m4_assert([$# <= 2])dnl
41763847c39Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
41863847c39Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
41963847c39Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
42063847c39Smrgm4_define([_lt_decl_varnames_tagged],
42163847c39Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
42276888252Smrg
423d8556812Smrg
42463847c39Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
42563847c39Smrg# ------------------------------------------------
42663847c39Smrgm4_define([lt_decl_all_varnames],
42763847c39Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
42863847c39Smrg     m4_if([$2], [],
42963847c39Smrg	   m4_quote(lt_decl_varnames),
43063847c39Smrg	m4_quote(m4_shift($@))))[]dnl
43163847c39Smrg])
43263847c39Smrgm4_define([_lt_decl_all_varnames],
43363847c39Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
43463847c39Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
43563847c39Smrg])
43676888252Smrg
43776888252Smrg
43863847c39Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
43963847c39Smrg# ------------------------------------
44063847c39Smrg# Quote a variable value, and forward it to `config.status' so that its
44163847c39Smrg# declaration there will have the same value as in `configure'.  VARNAME
44263847c39Smrg# must have a single quote delimited value for this to work.
44363847c39Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
44463847c39Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
44576888252Smrg
44676888252Smrg
44763847c39Smrg# _LT_CONFIG_STATUS_DECLARATIONS
44863847c39Smrg# ------------------------------
44963847c39Smrg# We delimit libtool config variables with single quotes, so when
45063847c39Smrg# we write them to config.status, we have to be sure to quote all
45163847c39Smrg# embedded single quotes properly.  In configure, this macro expands
45263847c39Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
45363847c39Smrg#
45463847c39Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
45563847c39Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
45663847c39Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
45763847c39Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
45876888252Smrg
45963847c39Smrg
46063847c39Smrg# _LT_LIBTOOL_TAGS
46163847c39Smrg# ----------------
46263847c39Smrg# Output comment and list of tags supported by the script
46363847c39Smrgm4_defun([_LT_LIBTOOL_TAGS],
46463847c39Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
46563847c39Smrgavailable_tags="_LT_TAGS"dnl
46663847c39Smrg])
46763847c39Smrg
46863847c39Smrg
46963847c39Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
47063847c39Smrg# -----------------------------------
47163847c39Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
47263847c39Smrg# expand to a commented shell variable setting:
47363847c39Smrg#
47463847c39Smrg#    # Some comment about what VAR is for.
47563847c39Smrg#    visible_name=$lt_internal_name
47663847c39Smrgm4_define([_LT_LIBTOOL_DECLARE],
47763847c39Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
47863847c39Smrg					   [description])))[]dnl
47963847c39Smrgm4_pushdef([_libtool_name],
48063847c39Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
48163847c39Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
48263847c39Smrg    [0], [_libtool_name=[$]$1],
48363847c39Smrg    [1], [_libtool_name=$lt_[]$1],
48463847c39Smrg    [2], [_libtool_name=$lt_[]$1],
48563847c39Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
48663847c39Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
48763847c39Smrg])
48863847c39Smrg
48963847c39Smrg
49063847c39Smrg# _LT_LIBTOOL_CONFIG_VARS
49163847c39Smrg# -----------------------
49263847c39Smrg# Produce commented declarations of non-tagged libtool config variables
49363847c39Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
49463847c39Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
49563847c39Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
49663847c39Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
49763847c39Smrg[m4_foreach([_lt_var],
49863847c39Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
49963847c39Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
50063847c39Smrg
50163847c39Smrg
50263847c39Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
50363847c39Smrg# -------------------------
50463847c39Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
50563847c39Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
50663847c39Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
50763847c39Smrg
50863847c39Smrg
50963847c39Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
51063847c39Smrg# ------------------------------
51163847c39Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
51263847c39Smrg
51363847c39Smrg
51463847c39Smrg# _LT_CONFIG_COMMANDS
51563847c39Smrg# -------------------
51663847c39Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
51763847c39Smrg# variables for single and double quote escaping we saved from calls
51863847c39Smrg# to _LT_DECL, we can put quote escaped variables declarations
51963847c39Smrg# into `config.status', and then the shell code to quote escape them in
52063847c39Smrg# for loops in `config.status'.  Finally, any additional code accumulated
52163847c39Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
52263847c39Smrgm4_defun([_LT_CONFIG_COMMANDS],
52363847c39Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
52463847c39Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
52563847c39Smrg	dnl instead of duplicating it all over again into config.status,
52663847c39Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
52763847c39Smrg	dnl needs to know what name is stored there:
52863847c39Smrg        [AC_CONFIG_COMMANDS([libtool],
52963847c39Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
53063847c39Smrg    dnl If the libtool generation code is destined for config.status,
53163847c39Smrg    dnl expand the accumulated commands and init code now:
53263847c39Smrg    [AC_CONFIG_COMMANDS([libtool],
53363847c39Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
53463847c39Smrg])#_LT_CONFIG_COMMANDS
53563847c39Smrg
53663847c39Smrg
53763847c39Smrg# Initialize.
53863847c39Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
53963847c39Smrg[
54063847c39Smrg
54163847c39Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
54263847c39Smrg# if CDPATH is set.
54363847c39Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
54463847c39Smrg
54563847c39Smrgsed_quote_subst='$sed_quote_subst'
54663847c39Smrgdouble_quote_subst='$double_quote_subst'
54763847c39Smrgdelay_variable_subst='$delay_variable_subst'
54863847c39Smrg_LT_CONFIG_STATUS_DECLARATIONS
54963847c39SmrgLTCC='$LTCC'
55063847c39SmrgLTCFLAGS='$LTCFLAGS'
55163847c39Smrgcompiler='$compiler_DEFAULT'
55263847c39Smrg
55363847c39Smrg# A function that is used when there is no print builtin or printf.
55463847c39Smrgfunc_fallback_echo ()
55563847c39Smrg{
55663847c39Smrg  eval 'cat <<_LTECHO_EOF
55763847c39Smrg\$[]1
55863847c39Smrg_LTECHO_EOF'
55963847c39Smrg}
56063847c39Smrg
56163847c39Smrg# Quote evaled strings.
56263847c39Smrgfor var in lt_decl_all_varnames([[ \
56363847c39Smrg]], lt_decl_quote_varnames); do
56463847c39Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
56563847c39Smrg    *[[\\\\\\\`\\"\\\$]]*)
56663847c39Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
567d8556812Smrg      ;;
56863847c39Smrg    *)
56963847c39Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
570d8556812Smrg      ;;
571d8556812Smrg    esac
57263847c39Smrgdone
57376888252Smrg
57463847c39Smrg# Double-quote double-evaled strings.
57563847c39Smrgfor var in lt_decl_all_varnames([[ \
57663847c39Smrg]], lt_decl_dquote_varnames); do
57763847c39Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
57863847c39Smrg    *[[\\\\\\\`\\"\\\$]]*)
57963847c39Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
580d8556812Smrg      ;;
58163847c39Smrg    *)
58263847c39Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
583d8556812Smrg      ;;
58486dafe34Smrg    esac
58563847c39Smrgdone
58676888252Smrg
58763847c39Smrg_LT_OUTPUT_LIBTOOL_INIT
58863847c39Smrg])
589d8556812Smrg
59063847c39Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
59163847c39Smrg# ------------------------------------
59263847c39Smrg# Generate a child script FILE with all initialization necessary to
59363847c39Smrg# reuse the environment learned by the parent script, and make the
59463847c39Smrg# file executable.  If COMMENT is supplied, it is inserted after the
59563847c39Smrg# `#!' sequence but before initialization text begins.  After this
59663847c39Smrg# macro, additional text can be appended to FILE to form the body of
59763847c39Smrg# the child script.  The macro ends with non-zero status if the
59863847c39Smrg# file could not be fully written (such as if the disk is full).
59963847c39Smrgm4_ifdef([AS_INIT_GENERATED],
60063847c39Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
60163847c39Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
60263847c39Smrg[m4_require([AS_PREPARE])]dnl
60363847c39Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
60463847c39Smrg[lt_write_fail=0
60563847c39Smrgcat >$1 <<_ASEOF || lt_write_fail=1
60663847c39Smrg#! $SHELL
60763847c39Smrg# Generated by $as_me.
60863847c39Smrg$2
60963847c39SmrgSHELL=\${CONFIG_SHELL-$SHELL}
61063847c39Smrgexport SHELL
61163847c39Smrg_ASEOF
61263847c39Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
61363847c39SmrgAS_SHELL_SANITIZE
61463847c39Smrg_AS_PREPARE
61563847c39Smrgexec AS_MESSAGE_FD>&1
61663847c39Smrg_ASEOF
61763847c39Smrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
61863847c39Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
61963847c39Smrg
62063847c39Smrg# LT_OUTPUT
62163847c39Smrg# ---------
62263847c39Smrg# This macro allows early generation of the libtool script (before
62363847c39Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
62463847c39Smrg# tests.
62563847c39SmrgAC_DEFUN([LT_OUTPUT],
62663847c39Smrg[: ${CONFIG_LT=./config.lt}
62763847c39SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
62863847c39Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
62963847c39Smrg[# Run this file to recreate a libtool stub with the current configuration.])
63063847c39Smrg
63163847c39Smrgcat >>"$CONFIG_LT" <<\_LTEOF
63263847c39Smrglt_cl_silent=false
63363847c39Smrgexec AS_MESSAGE_LOG_FD>>config.log
63463847c39Smrg{
63563847c39Smrg  echo
63663847c39Smrg  AS_BOX([Running $as_me.])
63763847c39Smrg} >&AS_MESSAGE_LOG_FD
63876888252Smrg
63963847c39Smrglt_cl_help="\
64063847c39Smrg\`$as_me' creates a local libtool stub from the current configuration,
64163847c39Smrgfor use in further configure time tests before the real libtool is
64263847c39Smrggenerated.
64376888252Smrg
64463847c39SmrgUsage: $[0] [[OPTIONS]]
64576888252Smrg
64663847c39Smrg  -h, --help      print this help, then exit
64763847c39Smrg  -V, --version   print version number, then exit
64863847c39Smrg  -q, --quiet     do not print progress messages
64963847c39Smrg  -d, --debug     don't remove temporary files
65076888252Smrg
65163847c39SmrgReport bugs to <bug-libtool@gnu.org>."
65276888252Smrg
65363847c39Smrglt_cl_version="\
65463847c39Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
65563847c39Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
65663847c39Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
65776888252Smrg
65863847c39SmrgCopyright (C) 2011 Free Software Foundation, Inc.
65963847c39SmrgThis config.lt script is free software; the Free Software Foundation
66063847c39Smrggives unlimited permision to copy, distribute and modify it."
66176888252Smrg
66263847c39Smrgwhile test $[#] != 0
66363847c39Smrgdo
66463847c39Smrg  case $[1] in
66563847c39Smrg    --version | --v* | -V )
66663847c39Smrg      echo "$lt_cl_version"; exit 0 ;;
66763847c39Smrg    --help | --h* | -h )
66863847c39Smrg      echo "$lt_cl_help"; exit 0 ;;
66963847c39Smrg    --debug | --d* | -d )
67063847c39Smrg      debug=: ;;
67163847c39Smrg    --quiet | --q* | --silent | --s* | -q )
67263847c39Smrg      lt_cl_silent=: ;;
67363847c39Smrg
67463847c39Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
67563847c39SmrgTry \`$[0] --help' for more information.]) ;;
67663847c39Smrg
67763847c39Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
67863847c39SmrgTry \`$[0] --help' for more information.]) ;;
67963847c39Smrg  esac
68063847c39Smrg  shift
68163847c39Smrgdone
68276888252Smrg
68363847c39Smrgif $lt_cl_silent; then
68463847c39Smrg  exec AS_MESSAGE_FD>/dev/null
68576888252Smrgfi
68663847c39Smrg_LTEOF
68763847c39Smrg
68863847c39Smrgcat >>"$CONFIG_LT" <<_LTEOF
68963847c39Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
69063847c39Smrg_LTEOF
69163847c39Smrg
69263847c39Smrgcat >>"$CONFIG_LT" <<\_LTEOF
69363847c39SmrgAC_MSG_NOTICE([creating $ofile])
69463847c39Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
69563847c39SmrgAS_EXIT(0)
69663847c39Smrg_LTEOF
69763847c39Smrgchmod +x "$CONFIG_LT"
69863847c39Smrg
69963847c39Smrg# configure is writing to config.log, but config.lt does its own redirection,
70063847c39Smrg# appending to config.log, which fails on DOS, as config.log is still kept
70163847c39Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
70263847c39Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
70363847c39Smrglt_cl_success=:
70463847c39Smrgtest "$silent" = yes &&
70563847c39Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
70663847c39Smrgexec AS_MESSAGE_LOG_FD>/dev/null
70763847c39Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
70863847c39Smrgexec AS_MESSAGE_LOG_FD>>config.log
70963847c39Smrg$lt_cl_success || AS_EXIT(1)
71063847c39Smrg])# LT_OUTPUT
71163847c39Smrg
71263847c39Smrg
71363847c39Smrg# _LT_CONFIG(TAG)
71463847c39Smrg# ---------------
71563847c39Smrg# If TAG is the built-in tag, create an initial libtool script with a
71663847c39Smrg# default configuration from the untagged config vars.  Otherwise add code
71763847c39Smrg# to config.status for appending the configuration named by TAG from the
71863847c39Smrg# matching tagged config vars.
71963847c39Smrgm4_defun([_LT_CONFIG],
72063847c39Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
72163847c39Smrg_LT_CONFIG_SAVE_COMMANDS([
72263847c39Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
72363847c39Smrg  m4_if(_LT_TAG, [C], [
72463847c39Smrg    # See if we are running on zsh, and set the options which allow our
72563847c39Smrg    # commands through without removal of \ escapes.
72663847c39Smrg    if test -n "${ZSH_VERSION+set}" ; then
72763847c39Smrg      setopt NO_GLOB_SUBST
72863847c39Smrg    fi
72976888252Smrg
73063847c39Smrg    cfgfile="${ofile}T"
73163847c39Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
73263847c39Smrg    $RM "$cfgfile"
73376888252Smrg
73463847c39Smrg    cat <<_LT_EOF >> "$cfgfile"
73563847c39Smrg#! $SHELL
73676888252Smrg
73763847c39Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
73863847c39Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
73963847c39Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
74063847c39Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
74163847c39Smrg#
74263847c39Smrg_LT_COPYING
74363847c39Smrg_LT_LIBTOOL_TAGS
74476888252Smrg
74563847c39Smrg# ### BEGIN LIBTOOL CONFIG
74663847c39Smrg_LT_LIBTOOL_CONFIG_VARS
74763847c39Smrg_LT_LIBTOOL_TAG_VARS
74863847c39Smrg# ### END LIBTOOL CONFIG
74976888252Smrg
75063847c39Smrg_LT_EOF
75176888252Smrg
75263847c39Smrg  case $host_os in
75363847c39Smrg  aix3*)
75463847c39Smrg    cat <<\_LT_EOF >> "$cfgfile"
75563847c39Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
75663847c39Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
75763847c39Smrg# vanish in a puff of smoke.
75863847c39Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
75963847c39Smrg  COLLECT_NAMES=
76063847c39Smrg  export COLLECT_NAMES
76163847c39Smrgfi
76263847c39Smrg_LT_EOF
76386dafe34Smrg    ;;
76463847c39Smrg  esac
76576888252Smrg
76663847c39Smrg  _LT_PROG_LTMAIN
76786dafe34Smrg
76863847c39Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
76963847c39Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
77063847c39Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
77163847c39Smrg  # is reportedly fixed, but why not run on old versions too?
77263847c39Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
77363847c39Smrg     || (rm -f "$cfgfile"; exit 1)
77463847c39Smrg
77563847c39Smrg  _LT_PROG_REPLACE_SHELLFNS
77663847c39Smrg
77763847c39Smrg   mv -f "$cfgfile" "$ofile" ||
77863847c39Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
77963847c39Smrg  chmod +x "$ofile"
78063847c39Smrg],
78163847c39Smrg[cat <<_LT_EOF >> "$ofile"
78263847c39Smrg
78363847c39Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
78463847c39Smrgdnl in a comment (ie after a #).
78563847c39Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
78663847c39Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
78763847c39Smrg# ### END LIBTOOL TAG CONFIG: $1
78863847c39Smrg_LT_EOF
78963847c39Smrg])dnl /m4_if
79063847c39Smrg],
79163847c39Smrg[m4_if([$1], [], [
79263847c39Smrg    PACKAGE='$PACKAGE'
79363847c39Smrg    VERSION='$VERSION'
79463847c39Smrg    TIMESTAMP='$TIMESTAMP'
79563847c39Smrg    RM='$RM'
79663847c39Smrg    ofile='$ofile'], [])
79763847c39Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
79863847c39Smrg])# _LT_CONFIG
79986dafe34Smrg
80063847c39Smrg
80163847c39Smrg# LT_SUPPORTED_TAG(TAG)
80263847c39Smrg# ---------------------
80363847c39Smrg# Trace this macro to discover what tags are supported by the libtool
80463847c39Smrg# --tag option, using:
80563847c39Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
80663847c39SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
80763847c39Smrg
80863847c39Smrg
80963847c39Smrg# C support is built-in for now
81063847c39Smrgm4_define([_LT_LANG_C_enabled], [])
81163847c39Smrgm4_define([_LT_TAGS], [])
81276888252Smrg
8131ae1b5e8Smrg
81463847c39Smrg# LT_LANG(LANG)
81563847c39Smrg# -------------
81663847c39Smrg# Enable libtool support for the given language if not already enabled.
81763847c39SmrgAC_DEFUN([LT_LANG],
81863847c39Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
81963847c39Smrgm4_case([$1],
82063847c39Smrg  [C],			[_LT_LANG(C)],
82163847c39Smrg  [C++],		[_LT_LANG(CXX)],
82263847c39Smrg  [Go],			[_LT_LANG(GO)],
82363847c39Smrg  [Java],		[_LT_LANG(GCJ)],
82463847c39Smrg  [Fortran 77],		[_LT_LANG(F77)],
82563847c39Smrg  [Fortran],		[_LT_LANG(FC)],
82663847c39Smrg  [Windows Resource],	[_LT_LANG(RC)],
82763847c39Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
82863847c39Smrg    [_LT_LANG($1)],
82963847c39Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
83063847c39Smrg])# LT_LANG
83163847c39Smrg
83263847c39Smrg
83363847c39Smrg# _LT_LANG(LANGNAME)
834d8556812Smrg# ------------------
83563847c39Smrgm4_defun([_LT_LANG],
83663847c39Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
83763847c39Smrg  [LT_SUPPORTED_TAG([$1])dnl
83863847c39Smrg  m4_append([_LT_TAGS], [$1 ])dnl
83963847c39Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
84063847c39Smrg  _LT_LANG_$1_CONFIG($1)])dnl
84163847c39Smrg])# _LT_LANG
84276888252Smrg
84376888252Smrg
84463847c39Smrgm4_ifndef([AC_PROG_GO], [
84563847c39Smrg# NOTE: This macro has been submitted for inclusion into   #
84663847c39Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
84763847c39Smrg#  a released version of Autoconf we should remove this    #
84863847c39Smrg#  macro and use it instead.                               #
84963847c39Smrgm4_defun([AC_PROG_GO],
85063847c39Smrg[AC_LANG_PUSH(Go)dnl
85163847c39SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
85263847c39SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
85363847c39Smrg_AC_ARG_VAR_LDFLAGS()dnl
85463847c39SmrgAC_CHECK_TOOL(GOC, gccgo)
85563847c39Smrgif test -z "$GOC"; then
85663847c39Smrg  if test -n "$ac_tool_prefix"; then
85763847c39Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
85863847c39Smrg  fi
85963847c39Smrgfi
86063847c39Smrgif test -z "$GOC"; then
86163847c39Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
86263847c39Smrgfi
86363847c39Smrg])#m4_defun
86463847c39Smrg])#m4_ifndef
86576888252Smrg
86676888252Smrg
86763847c39Smrg# _LT_LANG_DEFAULT_CONFIG
86863847c39Smrg# -----------------------
86963847c39Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
87063847c39Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
87163847c39Smrg  [LT_LANG(CXX)],
87263847c39Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
87363847c39Smrg
87463847c39SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
87563847c39Smrg  [LT_LANG(F77)],
87663847c39Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
87763847c39Smrg
87863847c39SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
87963847c39Smrg  [LT_LANG(FC)],
88063847c39Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
88163847c39Smrg
88263847c39Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
88363847c39Smrgdnl pulling things in needlessly.
88463847c39SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
88563847c39Smrg  [LT_LANG(GCJ)],
88663847c39Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
88763847c39Smrg    [LT_LANG(GCJ)],
88863847c39Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
88963847c39Smrg      [LT_LANG(GCJ)],
89063847c39Smrg      [m4_ifdef([AC_PROG_GCJ],
89163847c39Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
89263847c39Smrg       m4_ifdef([A][M_PROG_GCJ],
89363847c39Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
89463847c39Smrg       m4_ifdef([LT_PROG_GCJ],
89563847c39Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
89663847c39Smrg
89763847c39SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
89863847c39Smrg  [LT_LANG(GO)],
89963847c39Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
90063847c39Smrg
90163847c39SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
90263847c39Smrg  [LT_LANG(RC)],
90363847c39Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
90463847c39Smrg])# _LT_LANG_DEFAULT_CONFIG
90563847c39Smrg
90663847c39Smrg# Obsolete macros:
90763847c39SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
90863847c39SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
90963847c39SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
91063847c39SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
91163847c39SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
91263847c39Smrgdnl aclocal-1.4 backwards compatibility:
91363847c39Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
91463847c39Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
91563847c39Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
91663847c39Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
91763847c39Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
91863847c39Smrg
91963847c39Smrg
92063847c39Smrg# _LT_TAG_COMPILER
92163847c39Smrg# ----------------
92263847c39Smrgm4_defun([_LT_TAG_COMPILER],
92363847c39Smrg[AC_REQUIRE([AC_PROG_CC])dnl
92476888252Smrg
92563847c39Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
92663847c39Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
92763847c39Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
92863847c39Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
92976888252Smrg
93063847c39Smrg# If no C compiler was specified, use CC.
93163847c39SmrgLTCC=${LTCC-"$CC"}
93276888252Smrg
93363847c39Smrg# If no C compiler flags were specified, use CFLAGS.
93463847c39SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
935d8556812Smrg
93663847c39Smrg# Allow CC to be a program name with arguments.
93763847c39Smrgcompiler=$CC
93863847c39Smrg])# _LT_TAG_COMPILER
93976888252Smrg
94076888252Smrg
94163847c39Smrg# _LT_COMPILER_BOILERPLATE
94263847c39Smrg# ------------------------
94363847c39Smrg# Check for compiler boilerplate output or warnings with
94463847c39Smrg# the simple compiler test code.
94563847c39Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
94663847c39Smrg[m4_require([_LT_DECL_SED])dnl
94763847c39Smrgac_outfile=conftest.$ac_objext
94863847c39Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
94963847c39Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
95063847c39Smrg_lt_compiler_boilerplate=`cat conftest.err`
95163847c39Smrg$RM conftest*
95263847c39Smrg])# _LT_COMPILER_BOILERPLATE
95376888252Smrg
95476888252Smrg
95563847c39Smrg# _LT_LINKER_BOILERPLATE
956d8556812Smrg# ----------------------
95763847c39Smrg# Check for linker boilerplate output or warnings with
95863847c39Smrg# the simple link test code.
95963847c39Smrgm4_defun([_LT_LINKER_BOILERPLATE],
96063847c39Smrg[m4_require([_LT_DECL_SED])dnl
96163847c39Smrgac_outfile=conftest.$ac_objext
96263847c39Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
96363847c39Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
96463847c39Smrg_lt_linker_boilerplate=`cat conftest.err`
96563847c39Smrg$RM -r conftest*
96663847c39Smrg])# _LT_LINKER_BOILERPLATE
96776888252Smrg
96863847c39Smrg# _LT_REQUIRED_DARWIN_CHECKS
96963847c39Smrg# -------------------------
97063847c39Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
97186dafe34Smrg  case $host_os in
97263847c39Smrg    rhapsody* | darwin*)
97363847c39Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
97463847c39Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
97563847c39Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
97663847c39Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
97763847c39Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
97863847c39Smrg    _LT_DECL([], [DSYMUTIL], [1],
97963847c39Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
98063847c39Smrg    _LT_DECL([], [NMEDIT], [1],
98163847c39Smrg      [Tool to change global to local symbols on Mac OS X])
98263847c39Smrg    _LT_DECL([], [LIPO], [1],
98363847c39Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
98463847c39Smrg    _LT_DECL([], [OTOOL], [1],
98563847c39Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
98663847c39Smrg    _LT_DECL([], [OTOOL64], [1],
98763847c39Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
98876888252Smrg
98963847c39Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
99063847c39Smrg      [lt_cv_apple_cc_single_mod=no
99163847c39Smrg      if test -z "${LT_MULTI_MODULE}"; then
99263847c39Smrg	# By default we will add the -single_module flag. You can override
99363847c39Smrg	# by either setting the environment variable LT_MULTI_MODULE
99463847c39Smrg	# non-empty at configure time, or by adding -multi_module to the
99563847c39Smrg	# link flags.
99663847c39Smrg	rm -rf libconftest.dylib*
99763847c39Smrg	echo "int foo(void){return 1;}" > conftest.c
99863847c39Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
99963847c39Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
100063847c39Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
100163847c39Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
100263847c39Smrg        _lt_result=$?
100363847c39Smrg	# If there is a non-empty error log, and "single_module"
100463847c39Smrg	# appears in it, assume the flag caused a linker warning
100563847c39Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
100663847c39Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
100763847c39Smrg	# Otherwise, if the output was created with a 0 exit code from
100863847c39Smrg	# the compiler, it worked.
100963847c39Smrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
101063847c39Smrg	  lt_cv_apple_cc_single_mod=yes
101163847c39Smrg	else
101263847c39Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
101363847c39Smrg	fi
101463847c39Smrg	rm -rf libconftest.dylib*
101563847c39Smrg	rm -f conftest.*
101663847c39Smrg      fi])
101776888252Smrg
101863847c39Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
101963847c39Smrg      [lt_cv_ld_exported_symbols_list],
102063847c39Smrg      [lt_cv_ld_exported_symbols_list=no
102163847c39Smrg      save_LDFLAGS=$LDFLAGS
102263847c39Smrg      echo "_main" > conftest.sym
102363847c39Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
102463847c39Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
102563847c39Smrg	[lt_cv_ld_exported_symbols_list=yes],
102663847c39Smrg	[lt_cv_ld_exported_symbols_list=no])
102763847c39Smrg	LDFLAGS="$save_LDFLAGS"
102886dafe34Smrg    ])
102976888252Smrg
103063847c39Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
103163847c39Smrg      [lt_cv_ld_force_load=no
103263847c39Smrg      cat > conftest.c << _LT_EOF
103363847c39Smrgint forced_loaded() { return 2;}
103463847c39Smrg_LT_EOF
103563847c39Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
103663847c39Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
103763847c39Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
103863847c39Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
103963847c39Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
104063847c39Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
104163847c39Smrg      cat > conftest.c << _LT_EOF
104263847c39Smrgint main() { return 0;}
104363847c39Smrg_LT_EOF
104463847c39Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
104563847c39Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
104663847c39Smrg      _lt_result=$?
104763847c39Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
104863847c39Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
104963847c39Smrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
105063847c39Smrg	lt_cv_ld_force_load=yes
105163847c39Smrg      else
105263847c39Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
105363847c39Smrg      fi
105463847c39Smrg        rm -f conftest.err libconftest.a conftest conftest.c
105563847c39Smrg        rm -rf conftest.dSYM
105663847c39Smrg    ])
105763847c39Smrg    case $host_os in
105863847c39Smrg    rhapsody* | darwin1.[[012]])
105963847c39Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
106063847c39Smrg    darwin1.*)
106163847c39Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
106263847c39Smrg    darwin*) # darwin 5.x on
106363847c39Smrg      # if running on 10.5 or later, the deployment target defaults
106463847c39Smrg      # to the OS version, if on x86, and 10.4, the deployment
106563847c39Smrg      # target defaults to 10.4. Don't you love it?
106663847c39Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
106763847c39Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
106863847c39Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
106963847c39Smrg	10.[[012]]*)
107063847c39Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
107163847c39Smrg	10.*)
107263847c39Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
107363847c39Smrg      esac
107463847c39Smrg    ;;
107563847c39Smrg  esac
107663847c39Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
107763847c39Smrg      _lt_dar_single_mod='$single_module'
107863847c39Smrg    fi
107963847c39Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
108063847c39Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
108163847c39Smrg    else
108263847c39Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
108363847c39Smrg    fi
108463847c39Smrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
108563847c39Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
108663847c39Smrg    else
108763847c39Smrg      _lt_dsymutil=
108863847c39Smrg    fi
108986dafe34Smrg    ;;
109086dafe34Smrg  esac
109163847c39Smrg])
109276888252Smrg
109363847c39Smrg
109463847c39Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
109563847c39Smrg# ---------------------------------
109663847c39Smrg# Checks for linker and compiler features on darwin
109763847c39Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
109863847c39Smrg[
109963847c39Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
110063847c39Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
110163847c39Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
110263847c39Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
110363847c39Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
110463847c39Smrg  if test "$lt_cv_ld_force_load" = "yes"; then
110563847c39Smrg    _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\"`'
110663847c39Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
110763847c39Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
110886dafe34Smrg  else
110963847c39Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
111086dafe34Smrg  fi
111163847c39Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
111263847c39Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
111363847c39Smrg  case $cc_basename in
111463847c39Smrg     ifort*) _lt_dar_can_shared=yes ;;
111563847c39Smrg     *) _lt_dar_can_shared=$GCC ;;
111663847c39Smrg  esac
111763847c39Smrg  if test "$_lt_dar_can_shared" = "yes"; then
111863847c39Smrg    output_verbose_link_cmd=func_echo_all
111963847c39Smrg    _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}"
112063847c39Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
112163847c39Smrg    _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}"
112263847c39Smrg    _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}"
112363847c39Smrg    m4_if([$1], [CXX],
112463847c39Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
112563847c39Smrg      _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}"
112663847c39Smrg      _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}"
112763847c39Smrg    fi
112863847c39Smrg],[])
112963847c39Smrg  else
113063847c39Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
113163847c39Smrg  fi
113263847c39Smrg])
113376888252Smrg
113463847c39Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
113563847c39Smrg# ----------------------------------
113663847c39Smrg# Links a minimal program and checks the executable
113763847c39Smrg# for the system default hardcoded library path. In most cases,
113863847c39Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
113963847c39Smrg# the location of the communication and MPI libs are included too.
114063847c39Smrg# If we don't find anything, use the default library path according
114163847c39Smrg# to the aix ld manual.
114263847c39Smrg# Store the results from the different compilers for each TAGNAME.
114363847c39Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
114463847c39Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
114563847c39Smrg[m4_require([_LT_DECL_SED])dnl
114663847c39Smrgif test "${lt_cv_aix_libpath+set}" = set; then
114763847c39Smrg  aix_libpath=$lt_cv_aix_libpath
114863847c39Smrgelse
114963847c39Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
115063847c39Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
115163847c39Smrg  lt_aix_libpath_sed='[
115263847c39Smrg      /Import File Strings/,/^$/ {
115363847c39Smrg	  /^0/ {
115463847c39Smrg	      s/^0  *\([^ ]*\) *$/\1/
115563847c39Smrg	      p
115663847c39Smrg	  }
115763847c39Smrg      }]'
115863847c39Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
115963847c39Smrg  # Check for a 64-bit object if we didn't find anything.
116063847c39Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
116163847c39Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
116263847c39Smrg  fi],[])
116363847c39Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
116463847c39Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
116563847c39Smrg  fi
116663847c39Smrg  ])
116763847c39Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
116863847c39Smrgfi
116963847c39Smrg])# _LT_SYS_MODULE_PATH_AIX
117076888252Smrg
117176888252Smrg
117263847c39Smrg# _LT_SHELL_INIT(ARG)
117363847c39Smrg# -------------------
117463847c39Smrgm4_define([_LT_SHELL_INIT],
117563847c39Smrg[m4_divert_text([M4SH-INIT], [$1
117663847c39Smrg])])# _LT_SHELL_INIT
117776888252Smrg
117863847c39Smrg
117963847c39Smrg
118063847c39Smrg# _LT_PROG_ECHO_BACKSLASH
118163847c39Smrg# -----------------------
118263847c39Smrg# Find how we can fake an echo command that does not interpret backslash.
118363847c39Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
118463847c39Smrg# of the generated configure script which will find a shell with a builtin
118563847c39Smrg# printf (which we can use as an echo command).
118663847c39Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
118763847c39Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
118863847c39SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
118963847c39SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
119063847c39Smrg
119163847c39SmrgAC_MSG_CHECKING([how to print strings])
119263847c39Smrg# Test print first, because it will be a builtin if present.
119363847c39Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
119463847c39Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
119563847c39Smrg  ECHO='print -r --'
119663847c39Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
119763847c39Smrg  ECHO='printf %s\n'
119863847c39Smrgelse
119963847c39Smrg  # Use this function as a fallback that always works.
120063847c39Smrg  func_fallback_echo ()
120163847c39Smrg  {
120263847c39Smrg    eval 'cat <<_LTECHO_EOF
120363847c39Smrg$[]1
120463847c39Smrg_LTECHO_EOF'
120563847c39Smrg  }
120663847c39Smrg  ECHO='func_fallback_echo'
120763847c39Smrgfi
120863847c39Smrg
120963847c39Smrg# func_echo_all arg...
121063847c39Smrg# Invoke $ECHO with all args, space-separated.
121163847c39Smrgfunc_echo_all ()
121263847c39Smrg{
121363847c39Smrg    $ECHO "$*" 
121463847c39Smrg}
121563847c39Smrg
121663847c39Smrgcase "$ECHO" in
121763847c39Smrg  printf*) AC_MSG_RESULT([printf]) ;;
121863847c39Smrg  print*) AC_MSG_RESULT([print -r]) ;;
121963847c39Smrg  *) AC_MSG_RESULT([cat]) ;;
122063847c39Smrgesac
122163847c39Smrg
122263847c39Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
122363847c39Smrg[_AS_DETECT_SUGGESTED([
122463847c39Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
122563847c39Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
122663847c39Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
122763847c39Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
122863847c39Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
122963847c39Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
123063847c39Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
123163847c39Smrg
123263847c39Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
123363847c39Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
123463847c39Smrg])# _LT_PROG_ECHO_BACKSLASH
123563847c39Smrg
123663847c39Smrg
123763847c39Smrg# _LT_WITH_SYSROOT
123863847c39Smrg# ----------------
123963847c39SmrgAC_DEFUN([_LT_WITH_SYSROOT],
124063847c39Smrg[AC_MSG_CHECKING([for sysroot])
124163847c39SmrgAC_ARG_WITH([sysroot],
124263847c39Smrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
124363847c39Smrg                        (or the compiler's sysroot if not specified).],
124463847c39Smrg[], [with_sysroot=no])
124563847c39Smrg
124663847c39Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
124763847c39Smrgdnl in case the user passed a directory name.
124863847c39Smrglt_sysroot=
124963847c39Smrgcase ${with_sysroot} in #(
125063847c39Smrg yes)
125163847c39Smrg   if test "$GCC" = yes; then
125263847c39Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
125363847c39Smrg   fi
125463847c39Smrg   ;; #(
125563847c39Smrg /*)
125663847c39Smrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
125763847c39Smrg   ;; #(
125863847c39Smrg no|'')
125963847c39Smrg   ;; #(
126063847c39Smrg *)
126163847c39Smrg   AC_MSG_RESULT([${with_sysroot}])
126263847c39Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
126363847c39Smrg   ;;
126463847c39Smrgesac
126563847c39Smrg
126663847c39Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
126763847c39Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
126863847c39Smrg[dependent libraries, and in which our libraries should be installed.])])
126963847c39Smrg
127063847c39Smrg# _LT_ENABLE_LOCK
127163847c39Smrg# ---------------
127263847c39Smrgm4_defun([_LT_ENABLE_LOCK],
127363847c39Smrg[AC_ARG_ENABLE([libtool-lock],
127463847c39Smrg  [AS_HELP_STRING([--disable-libtool-lock],
127563847c39Smrg    [avoid locking (might break parallel builds)])])
127663847c39Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
127763847c39Smrg
127863847c39Smrg# Some flags need to be propagated to the compiler or linker for good
127963847c39Smrg# libtool support.
128063847c39Smrgcase $host in
128163847c39Smrgia64-*-hpux*)
128263847c39Smrg  # Find out which ABI we are using.
128363847c39Smrg  echo 'int i;' > conftest.$ac_ext
128463847c39Smrg  if AC_TRY_EVAL(ac_compile); then
128563847c39Smrg    case `/usr/bin/file conftest.$ac_objext` in
128663847c39Smrg      *ELF-32*)
128763847c39Smrg	HPUX_IA64_MODE="32"
128863847c39Smrg	;;
128963847c39Smrg      *ELF-64*)
129063847c39Smrg	HPUX_IA64_MODE="64"
129163847c39Smrg	;;
129263847c39Smrg    esac
129363847c39Smrg  fi
129463847c39Smrg  rm -rf conftest*
129563847c39Smrg  ;;
129663847c39Smrg*-*-irix6*)
129763847c39Smrg  # Find out which ABI we are using.
129863847c39Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
129963847c39Smrg  if AC_TRY_EVAL(ac_compile); then
130063847c39Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
130163847c39Smrg      case `/usr/bin/file conftest.$ac_objext` in
130263847c39Smrg	*32-bit*)
130363847c39Smrg	  LD="${LD-ld} -melf32bsmip"
130463847c39Smrg	  ;;
130563847c39Smrg	*N32*)
130663847c39Smrg	  LD="${LD-ld} -melf32bmipn32"
130763847c39Smrg	  ;;
130863847c39Smrg	*64-bit*)
130963847c39Smrg	  LD="${LD-ld} -melf64bmip"
131063847c39Smrg	;;
131163847c39Smrg      esac
131263847c39Smrg    else
131363847c39Smrg      case `/usr/bin/file conftest.$ac_objext` in
131463847c39Smrg	*32-bit*)
131563847c39Smrg	  LD="${LD-ld} -32"
131663847c39Smrg	  ;;
131763847c39Smrg	*N32*)
131863847c39Smrg	  LD="${LD-ld} -n32"
131963847c39Smrg	  ;;
132063847c39Smrg	*64-bit*)
132163847c39Smrg	  LD="${LD-ld} -64"
132263847c39Smrg	  ;;
132363847c39Smrg      esac
132486dafe34Smrg    fi
132563847c39Smrg  fi
132663847c39Smrg  rm -rf conftest*
132763847c39Smrg  ;;
132876888252Smrg
13299586ba5aSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
133063847c39Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
133163847c39Smrg  # Find out which ABI we are using.
133263847c39Smrg  echo 'int i;' > conftest.$ac_ext
133363847c39Smrg  if AC_TRY_EVAL(ac_compile); then
133463847c39Smrg    case `/usr/bin/file conftest.o` in
133563847c39Smrg      *32-bit*)
133663847c39Smrg	case $host in
133763847c39Smrg	  x86_64-*kfreebsd*-gnu)
133863847c39Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
133963847c39Smrg	    ;;
134063847c39Smrg	  x86_64-*linux*)
13419586ba5aSmrg	    case `/usr/bin/file conftest.o` in
13429586ba5aSmrg	      *x86-64*)
13439586ba5aSmrg		LD="${LD-ld} -m elf32_x86_64"
13449586ba5aSmrg		;;
13459586ba5aSmrg	      *)
13469586ba5aSmrg		LD="${LD-ld} -m elf_i386"
13479586ba5aSmrg		;;
13489586ba5aSmrg	    esac
13499586ba5aSmrg	    ;;
13509586ba5aSmrg	  powerpc64le-*)
13519586ba5aSmrg	    LD="${LD-ld} -m elf32lppclinux"
135263847c39Smrg	    ;;
13539586ba5aSmrg	  powerpc64-*)
135463847c39Smrg	    LD="${LD-ld} -m elf32ppclinux"
135563847c39Smrg	    ;;
135663847c39Smrg	  s390x-*linux*)
135763847c39Smrg	    LD="${LD-ld} -m elf_s390"
135863847c39Smrg	    ;;
135963847c39Smrg	  sparc64-*linux*)
136063847c39Smrg	    LD="${LD-ld} -m elf32_sparc"
136163847c39Smrg	    ;;
136263847c39Smrg	esac
136363847c39Smrg	;;
136463847c39Smrg      *64-bit*)
136563847c39Smrg	case $host in
136663847c39Smrg	  x86_64-*kfreebsd*-gnu)
136763847c39Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
136863847c39Smrg	    ;;
136963847c39Smrg	  x86_64-*linux*)
137063847c39Smrg	    LD="${LD-ld} -m elf_x86_64"
137163847c39Smrg	    ;;
13729586ba5aSmrg	  powerpcle-*)
13739586ba5aSmrg	    LD="${LD-ld} -m elf64lppc"
13749586ba5aSmrg	    ;;
13759586ba5aSmrg	  powerpc-*)
137663847c39Smrg	    LD="${LD-ld} -m elf64ppc"
137763847c39Smrg	    ;;
137863847c39Smrg	  s390*-*linux*|s390*-*tpf*)
137963847c39Smrg	    LD="${LD-ld} -m elf64_s390"
138063847c39Smrg	    ;;
138163847c39Smrg	  sparc*-*linux*)
138263847c39Smrg	    LD="${LD-ld} -m elf64_sparc"
138363847c39Smrg	    ;;
138463847c39Smrg	esac
138563847c39Smrg	;;
138663847c39Smrg    esac
138763847c39Smrg  fi
138863847c39Smrg  rm -rf conftest*
138963847c39Smrg  ;;
139076888252Smrg
139163847c39Smrg*-*-sco3.2v5*)
139263847c39Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
139363847c39Smrg  SAVE_CFLAGS="$CFLAGS"
139463847c39Smrg  CFLAGS="$CFLAGS -belf"
139563847c39Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
139663847c39Smrg    [AC_LANG_PUSH(C)
139763847c39Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
139863847c39Smrg     AC_LANG_POP])
139963847c39Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
140063847c39Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
140163847c39Smrg    CFLAGS="$SAVE_CFLAGS"
140263847c39Smrg  fi
140363847c39Smrg  ;;
140463847c39Smrg*-*solaris*)
140563847c39Smrg  # Find out which ABI we are using.
140663847c39Smrg  echo 'int i;' > conftest.$ac_ext
140763847c39Smrg  if AC_TRY_EVAL(ac_compile); then
140863847c39Smrg    case `/usr/bin/file conftest.o` in
140963847c39Smrg    *64-bit*)
141063847c39Smrg      case $lt_cv_prog_gnu_ld in
141163847c39Smrg      yes*)
141263847c39Smrg        case $host in
141363847c39Smrg        i?86-*-solaris*)
141463847c39Smrg          LD="${LD-ld} -m elf_x86_64"
141563847c39Smrg          ;;
141663847c39Smrg        sparc*-*-solaris*)
141763847c39Smrg          LD="${LD-ld} -m elf64_sparc"
141863847c39Smrg          ;;
141963847c39Smrg        esac
142063847c39Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
142163847c39Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
142263847c39Smrg          LD="${LD-ld}_sol2"
142363847c39Smrg        fi
142463847c39Smrg        ;;
142563847c39Smrg      *)
142663847c39Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
142763847c39Smrg	  LD="${LD-ld} -64"
142863847c39Smrg	fi
142963847c39Smrg	;;
143063847c39Smrg      esac
143163847c39Smrg      ;;
143263847c39Smrg    esac
143363847c39Smrg  fi
143463847c39Smrg  rm -rf conftest*
143563847c39Smrg  ;;
143663847c39Smrgesac
143776888252Smrg
143863847c39Smrgneed_locks="$enable_libtool_lock"
143963847c39Smrg])# _LT_ENABLE_LOCK
144063847c39Smrg
144163847c39Smrg
144263847c39Smrg# _LT_PROG_AR
144363847c39Smrg# -----------
144463847c39Smrgm4_defun([_LT_PROG_AR],
144563847c39Smrg[AC_CHECK_TOOLS(AR, [ar], false)
144663847c39Smrg: ${AR=ar}
144763847c39Smrg: ${AR_FLAGS=cru}
144863847c39Smrg_LT_DECL([], [AR], [1], [The archiver])
144963847c39Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
145063847c39Smrg
145163847c39SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
145263847c39Smrg  [lt_cv_ar_at_file=no
145363847c39Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
145463847c39Smrg     [echo conftest.$ac_objext > conftest.lst
145563847c39Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
145663847c39Smrg      AC_TRY_EVAL([lt_ar_try])
145763847c39Smrg      if test "$ac_status" -eq 0; then
145863847c39Smrg	# Ensure the archiver fails upon bogus file names.
145963847c39Smrg	rm -f conftest.$ac_objext libconftest.a
146063847c39Smrg	AC_TRY_EVAL([lt_ar_try])
146163847c39Smrg	if test "$ac_status" -ne 0; then
146263847c39Smrg          lt_cv_ar_at_file=@
146363847c39Smrg        fi
146463847c39Smrg      fi
146563847c39Smrg      rm -f conftest.* libconftest.a
146663847c39Smrg     ])
146763847c39Smrg  ])
146863847c39Smrg
146963847c39Smrgif test "x$lt_cv_ar_at_file" = xno; then
147063847c39Smrg  archiver_list_spec=
147163847c39Smrgelse
147263847c39Smrg  archiver_list_spec=$lt_cv_ar_at_file
147363847c39Smrgfi
147463847c39Smrg_LT_DECL([], [archiver_list_spec], [1],
147563847c39Smrg  [How to feed a file listing to the archiver])
147663847c39Smrg])# _LT_PROG_AR
147763847c39Smrg
147863847c39Smrg
147963847c39Smrg# _LT_CMD_OLD_ARCHIVE
148063847c39Smrg# -------------------
148163847c39Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
148263847c39Smrg[_LT_PROG_AR
148363847c39Smrg
148463847c39SmrgAC_CHECK_TOOL(STRIP, strip, :)
148563847c39Smrgtest -z "$STRIP" && STRIP=:
148663847c39Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
148763847c39Smrg
148863847c39SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
148963847c39Smrgtest -z "$RANLIB" && RANLIB=:
149063847c39Smrg_LT_DECL([], [RANLIB], [1],
149163847c39Smrg    [Commands used to install an old-style archive])
149263847c39Smrg
149363847c39Smrg# Determine commands to create old-style static archives.
149463847c39Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
149563847c39Smrgold_postinstall_cmds='chmod 644 $oldlib'
149663847c39Smrgold_postuninstall_cmds=
149763847c39Smrg
149863847c39Smrgif test -n "$RANLIB"; then
149963847c39Smrg  case $host_os in
150063847c39Smrg  openbsd*)
150163847c39Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
150263847c39Smrg    ;;
150363847c39Smrg  *)
150463847c39Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
150563847c39Smrg    ;;
150686dafe34Smrg  esac
150763847c39Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
150886dafe34Smrgfi
150963847c39Smrg
151063847c39Smrgcase $host_os in
151163847c39Smrg  darwin*)
151263847c39Smrg    lock_old_archive_extraction=yes ;;
151363847c39Smrg  *)
151463847c39Smrg    lock_old_archive_extraction=no ;;
151563847c39Smrgesac
151663847c39Smrg_LT_DECL([], [old_postinstall_cmds], [2])
151763847c39Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
151863847c39Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
151963847c39Smrg    [Commands used to build an old-style archive])
152063847c39Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
152163847c39Smrg    [Whether to use a lock for old archive extraction])
152263847c39Smrg])# _LT_CMD_OLD_ARCHIVE
152376888252Smrg
15241ae1b5e8Smrg
152563847c39Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
152663847c39Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
152763847c39Smrg# ----------------------------------------------------------------
152863847c39Smrg# Check whether the given compiler option works
152963847c39SmrgAC_DEFUN([_LT_COMPILER_OPTION],
153063847c39Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
153163847c39Smrgm4_require([_LT_DECL_SED])dnl
153263847c39SmrgAC_CACHE_CHECK([$1], [$2],
153363847c39Smrg  [$2=no
153463847c39Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
153586dafe34Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
153663847c39Smrg   lt_compiler_flag="$3"
153786dafe34Smrg   # Insert the option either (1) after the last *FLAGS variable, or
153886dafe34Smrg   # (2) before a word containing "conftest.", or (3) at the end.
153986dafe34Smrg   # Note that $ac_compile itself does not contain backslashes and begins
154086dafe34Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
154163847c39Smrg   # The option is referenced via a variable to avoid confusing sed.
154286dafe34Smrg   lt_compile=`echo "$ac_compile" | $SED \
154386dafe34Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
154486dafe34Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
154586dafe34Smrg   -e 's:$: $lt_compiler_flag:'`
154663847c39Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
154763847c39Smrg   (eval "$lt_compile" 2>conftest.err)
154886dafe34Smrg   ac_status=$?
154963847c39Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
155063847c39Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
155163847c39Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
155286dafe34Smrg     # The compiler can only warn and ignore the option if not recognized
155363847c39Smrg     # So say no if there are warnings other than the usual output.
155463847c39Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
155563847c39Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
155663847c39Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
155763847c39Smrg       $2=yes
155886dafe34Smrg     fi
155986dafe34Smrg   fi
156063847c39Smrg   $RM conftest*
156186dafe34Smrg])
156276888252Smrg
156363847c39Smrgif test x"[$]$2" = xyes; then
156463847c39Smrg    m4_if([$5], , :, [$5])
156586dafe34Smrgelse
156663847c39Smrg    m4_if([$6], , :, [$6])
15671ae1b5e8Smrgfi
156863847c39Smrg])# _LT_COMPILER_OPTION
156976888252Smrg
157063847c39Smrg# Old name:
157163847c39SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
157263847c39Smrgdnl aclocal-1.4 backwards compatibility:
157363847c39Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
157476888252Smrg
157576888252Smrg
157663847c39Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
157763847c39Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
157863847c39Smrg# ----------------------------------------------------
157963847c39Smrg# Check whether the given linker option works
158063847c39SmrgAC_DEFUN([_LT_LINKER_OPTION],
158163847c39Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
158263847c39Smrgm4_require([_LT_DECL_SED])dnl
158363847c39SmrgAC_CACHE_CHECK([$1], [$2],
158463847c39Smrg  [$2=no
158563847c39Smrg   save_LDFLAGS="$LDFLAGS"
158663847c39Smrg   LDFLAGS="$LDFLAGS $3"
158763847c39Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
158863847c39Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
158963847c39Smrg     # The linker can only warn and ignore the option if not recognized
159063847c39Smrg     # So say no if there are warnings
159163847c39Smrg     if test -s conftest.err; then
159263847c39Smrg       # Append any errors to the config.log.
159363847c39Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
159463847c39Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
159563847c39Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
159663847c39Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
159763847c39Smrg         $2=yes
159863847c39Smrg       fi
159963847c39Smrg     else
160063847c39Smrg       $2=yes
160163847c39Smrg     fi
160263847c39Smrg   fi
160363847c39Smrg   $RM -r conftest*
160463847c39Smrg   LDFLAGS="$save_LDFLAGS"
160563847c39Smrg])
160676888252Smrg
160763847c39Smrgif test x"[$]$2" = xyes; then
160863847c39Smrg    m4_if([$4], , :, [$4])
160986dafe34Smrgelse
161063847c39Smrg    m4_if([$5], , :, [$5])
16111ae1b5e8Smrgfi
161263847c39Smrg])# _LT_LINKER_OPTION
161376888252Smrg
161463847c39Smrg# Old name:
161563847c39SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
161663847c39Smrgdnl aclocal-1.4 backwards compatibility:
161763847c39Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
161876888252Smrg
161976888252Smrg
162063847c39Smrg# LT_CMD_MAX_LEN
162163847c39Smrg#---------------
162263847c39SmrgAC_DEFUN([LT_CMD_MAX_LEN],
162363847c39Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
162463847c39Smrg# find the maximum length of command line arguments
162563847c39SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
162663847c39SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
162763847c39Smrg  i=0
162863847c39Smrg  teststring="ABCD"
162976888252Smrg
163063847c39Smrg  case $build_os in
163163847c39Smrg  msdosdjgpp*)
163263847c39Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
163363847c39Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
163463847c39Smrg    # during glob expansion).  Even if it were fixed, the result of this
163563847c39Smrg    # check would be larger than it should be.
163663847c39Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
163763847c39Smrg    ;;
163876888252Smrg
163963847c39Smrg  gnu*)
164063847c39Smrg    # Under GNU Hurd, this test is not required because there is
164163847c39Smrg    # no limit to the length of command line arguments.
164263847c39Smrg    # Libtool will interpret -1 as no limit whatsoever
164363847c39Smrg    lt_cv_sys_max_cmd_len=-1;
164463847c39Smrg    ;;
164576888252Smrg
164663847c39Smrg  cygwin* | mingw* | cegcc*)
164763847c39Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
164863847c39Smrg    # about 5 minutes as the teststring grows exponentially.
164963847c39Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
165063847c39Smrg    # you end up with a "frozen" computer, even though with patience
165163847c39Smrg    # the test eventually succeeds (with a max line length of 256k).
165263847c39Smrg    # Instead, let's just punt: use the minimum linelength reported by
165363847c39Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
165463847c39Smrg    lt_cv_sys_max_cmd_len=8192;
165563847c39Smrg    ;;
165676888252Smrg
165763847c39Smrg  mint*)
165863847c39Smrg    # On MiNT this can take a long time and run out of memory.
165963847c39Smrg    lt_cv_sys_max_cmd_len=8192;
166063847c39Smrg    ;;
166176888252Smrg
166263847c39Smrg  amigaos*)
166363847c39Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
166463847c39Smrg    # So we just punt and use a minimum line length of 8192.
166563847c39Smrg    lt_cv_sys_max_cmd_len=8192;
166663847c39Smrg    ;;
166776888252Smrg
166863847c39Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
166963847c39Smrg    # This has been around since 386BSD, at least.  Likely further.
167063847c39Smrg    if test -x /sbin/sysctl; then
167163847c39Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
167263847c39Smrg    elif test -x /usr/sbin/sysctl; then
167363847c39Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
167486dafe34Smrg    else
167563847c39Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
16761ae1b5e8Smrg    fi
167763847c39Smrg    # And add a safety zone
167863847c39Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
167963847c39Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
168063847c39Smrg    ;;
16811ae1b5e8Smrg
168263847c39Smrg  interix*)
168363847c39Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
168463847c39Smrg    lt_cv_sys_max_cmd_len=196608
168563847c39Smrg    ;;
16861ae1b5e8Smrg
168763847c39Smrg  os2*)
168863847c39Smrg    # The test takes a long time on OS/2.
168963847c39Smrg    lt_cv_sys_max_cmd_len=8192
169063847c39Smrg    ;;
16911ae1b5e8Smrg
169263847c39Smrg  osf*)
169363847c39Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
169463847c39Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
169563847c39Smrg    # nice to cause kernel panics so lets avoid the loop below.
169663847c39Smrg    # First set a reasonable default.
169763847c39Smrg    lt_cv_sys_max_cmd_len=16384
169863847c39Smrg    #
169963847c39Smrg    if test -x /sbin/sysconfig; then
170063847c39Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
170163847c39Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
170263847c39Smrg      esac
170363847c39Smrg    fi
170463847c39Smrg    ;;
170563847c39Smrg  sco3.2v5*)
170663847c39Smrg    lt_cv_sys_max_cmd_len=102400
170763847c39Smrg    ;;
170863847c39Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
170963847c39Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
171063847c39Smrg    if test -n "$kargmax"; then
171163847c39Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
171263847c39Smrg    else
171363847c39Smrg      lt_cv_sys_max_cmd_len=32768
171463847c39Smrg    fi
171576888252Smrg    ;;
171676888252Smrg  *)
171763847c39Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
17189586ba5aSmrg    if test -n "$lt_cv_sys_max_cmd_len" && \
17199586ba5aSmrg	test undefined != "$lt_cv_sys_max_cmd_len"; then
172063847c39Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
172163847c39Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
172263847c39Smrg    else
172363847c39Smrg      # Make teststring a little bigger before we do anything with it.
172463847c39Smrg      # a 1K string should be a reasonable start.
172563847c39Smrg      for i in 1 2 3 4 5 6 7 8 ; do
172663847c39Smrg        teststring=$teststring$teststring
172763847c39Smrg      done
172863847c39Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
172963847c39Smrg      # If test is not a shell built-in, we'll probably end up computing a
173063847c39Smrg      # maximum length that is only half of the actual maximum length, but
173163847c39Smrg      # we can't tell.
173263847c39Smrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
173363847c39Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
173463847c39Smrg	      test $i != 17 # 1/2 MB should be enough
173563847c39Smrg      do
173663847c39Smrg        i=`expr $i + 1`
173763847c39Smrg        teststring=$teststring$teststring
173863847c39Smrg      done
173963847c39Smrg      # Only check the string length outside the loop.
174063847c39Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
174163847c39Smrg      teststring=
174263847c39Smrg      # Add a significant safety factor because C++ compilers can tack on
174363847c39Smrg      # massive amounts of additional arguments before passing them to the
174463847c39Smrg      # linker.  It appears as though 1/2 is a usable value.
174563847c39Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
174663847c39Smrg    fi
174776888252Smrg    ;;
174876888252Smrg  esac
174963847c39Smrg])
175063847c39Smrgif test -n $lt_cv_sys_max_cmd_len ; then
175163847c39Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
175263847c39Smrgelse
175363847c39Smrg  AC_MSG_RESULT(none)
175463847c39Smrgfi
175563847c39Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
175663847c39Smrg_LT_DECL([], [max_cmd_len], [0],
175763847c39Smrg    [What is the maximum length of a command?])
175863847c39Smrg])# LT_CMD_MAX_LEN
175976888252Smrg
176063847c39Smrg# Old name:
176163847c39SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
176263847c39Smrgdnl aclocal-1.4 backwards compatibility:
176363847c39Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
176476888252Smrg
176576888252Smrg
176663847c39Smrg# _LT_HEADER_DLFCN
176763847c39Smrg# ----------------
176863847c39Smrgm4_defun([_LT_HEADER_DLFCN],
176963847c39Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
177063847c39Smrg])# _LT_HEADER_DLFCN
177176888252Smrg
177263847c39Smrg
177363847c39Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
177463847c39Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
177563847c39Smrg# ----------------------------------------------------------------
177663847c39Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
177763847c39Smrg[m4_require([_LT_HEADER_DLFCN])dnl
177863847c39Smrgif test "$cross_compiling" = yes; then :
177963847c39Smrg  [$4]
178063847c39Smrgelse
178163847c39Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
178263847c39Smrg  lt_status=$lt_dlunknown
178363847c39Smrg  cat > conftest.$ac_ext <<_LT_EOF
178463847c39Smrg[#line $LINENO "configure"
178563847c39Smrg#include "confdefs.h"
178663847c39Smrg
178763847c39Smrg#if HAVE_DLFCN_H
178863847c39Smrg#include <dlfcn.h>
178963847c39Smrg#endif
179063847c39Smrg
179163847c39Smrg#include <stdio.h>
179263847c39Smrg
179363847c39Smrg#ifdef RTLD_GLOBAL
179463847c39Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
179563847c39Smrg#else
179663847c39Smrg#  ifdef DL_GLOBAL
179763847c39Smrg#    define LT_DLGLOBAL		DL_GLOBAL
179863847c39Smrg#  else
179963847c39Smrg#    define LT_DLGLOBAL		0
180063847c39Smrg#  endif
180163847c39Smrg#endif
180263847c39Smrg
180363847c39Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
180463847c39Smrg   find out it does not work in some platform. */
180563847c39Smrg#ifndef LT_DLLAZY_OR_NOW
180663847c39Smrg#  ifdef RTLD_LAZY
180763847c39Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
180863847c39Smrg#  else
180963847c39Smrg#    ifdef DL_LAZY
181063847c39Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
181163847c39Smrg#    else
181263847c39Smrg#      ifdef RTLD_NOW
181363847c39Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
181463847c39Smrg#      else
181563847c39Smrg#        ifdef DL_NOW
181663847c39Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
181763847c39Smrg#        else
181863847c39Smrg#          define LT_DLLAZY_OR_NOW	0
181963847c39Smrg#        endif
182063847c39Smrg#      endif
182163847c39Smrg#    endif
182263847c39Smrg#  endif
182363847c39Smrg#endif
182463847c39Smrg
182563847c39Smrg/* When -fvisbility=hidden is used, assume the code has been annotated
182663847c39Smrg   correspondingly for the symbols needed.  */
182763847c39Smrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
182863847c39Smrgint fnord () __attribute__((visibility("default")));
182963847c39Smrg#endif
183063847c39Smrg
183163847c39Smrgint fnord () { return 42; }
183263847c39Smrgint main ()
183363847c39Smrg{
183463847c39Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
183563847c39Smrg  int status = $lt_dlunknown;
183663847c39Smrg
183763847c39Smrg  if (self)
183863847c39Smrg    {
183963847c39Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
184063847c39Smrg      else
184163847c39Smrg        {
184263847c39Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
184363847c39Smrg          else puts (dlerror ());
184463847c39Smrg	}
184563847c39Smrg      /* dlclose (self); */
184663847c39Smrg    }
184786dafe34Smrg  else
184863847c39Smrg    puts (dlerror ());
184963847c39Smrg
185063847c39Smrg  return status;
185163847c39Smrg}]
185263847c39Smrg_LT_EOF
185363847c39Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
185463847c39Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
185563847c39Smrg    lt_status=$?
185663847c39Smrg    case x$lt_status in
185763847c39Smrg      x$lt_dlno_uscore) $1 ;;
185863847c39Smrg      x$lt_dlneed_uscore) $2 ;;
185963847c39Smrg      x$lt_dlunknown|x*) $3 ;;
186086dafe34Smrg    esac
186163847c39Smrg  else :
186263847c39Smrg    # compilation failed
186363847c39Smrg    $3
186486dafe34Smrg  fi
186563847c39Smrgfi
186663847c39Smrgrm -fr conftest*
186763847c39Smrg])# _LT_TRY_DLOPEN_SELF
186863847c39Smrg
186963847c39Smrg
187063847c39Smrg# LT_SYS_DLOPEN_SELF
187163847c39Smrg# ------------------
187263847c39SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
187363847c39Smrg[m4_require([_LT_HEADER_DLFCN])dnl
187463847c39Smrgif test "x$enable_dlopen" != xyes; then
187563847c39Smrg  enable_dlopen=unknown
187663847c39Smrg  enable_dlopen_self=unknown
187763847c39Smrg  enable_dlopen_self_static=unknown
187863847c39Smrgelse
187963847c39Smrg  lt_cv_dlopen=no
188063847c39Smrg  lt_cv_dlopen_libs=
188163847c39Smrg
188286dafe34Smrg  case $host_os in
188363847c39Smrg  beos*)
188463847c39Smrg    lt_cv_dlopen="load_add_on"
188563847c39Smrg    lt_cv_dlopen_libs=
188663847c39Smrg    lt_cv_dlopen_self=yes
188786dafe34Smrg    ;;
188863847c39Smrg
188963847c39Smrg  mingw* | pw32* | cegcc*)
189063847c39Smrg    lt_cv_dlopen="LoadLibrary"
189163847c39Smrg    lt_cv_dlopen_libs=
189286dafe34Smrg    ;;
189363847c39Smrg
189463847c39Smrg  cygwin*)
189563847c39Smrg    lt_cv_dlopen="dlopen"
189663847c39Smrg    lt_cv_dlopen_libs=
189786dafe34Smrg    ;;
189863847c39Smrg
189963847c39Smrg  darwin*)
190063847c39Smrg  # if libdl is installed we need to link against it
190163847c39Smrg    AC_CHECK_LIB([dl], [dlopen],
190263847c39Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
190363847c39Smrg    lt_cv_dlopen="dyld"
190463847c39Smrg    lt_cv_dlopen_libs=
190563847c39Smrg    lt_cv_dlopen_self=yes
190663847c39Smrg    ])
190763847c39Smrg    ;;
190863847c39Smrg
190963847c39Smrg  *)
191063847c39Smrg    AC_CHECK_FUNC([shl_load],
191163847c39Smrg	  [lt_cv_dlopen="shl_load"],
191263847c39Smrg      [AC_CHECK_LIB([dld], [shl_load],
191363847c39Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
191463847c39Smrg	[AC_CHECK_FUNC([dlopen],
191563847c39Smrg	      [lt_cv_dlopen="dlopen"],
191663847c39Smrg	  [AC_CHECK_LIB([dl], [dlopen],
191763847c39Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
191863847c39Smrg	    [AC_CHECK_LIB([svld], [dlopen],
191963847c39Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
192063847c39Smrg	      [AC_CHECK_LIB([dld], [dld_link],
192163847c39Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
192263847c39Smrg	      ])
192363847c39Smrg	    ])
192463847c39Smrg	  ])
192563847c39Smrg	])
192663847c39Smrg      ])
192786dafe34Smrg    ;;
192886dafe34Smrg  esac
192976888252Smrg
193063847c39Smrg  if test "x$lt_cv_dlopen" != xno; then
193163847c39Smrg    enable_dlopen=yes
193263847c39Smrg  else
193363847c39Smrg    enable_dlopen=no
193463847c39Smrg  fi
193563847c39Smrg
193663847c39Smrg  case $lt_cv_dlopen in
193763847c39Smrg  dlopen)
193863847c39Smrg    save_CPPFLAGS="$CPPFLAGS"
193963847c39Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
194063847c39Smrg
194163847c39Smrg    save_LDFLAGS="$LDFLAGS"
194263847c39Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
194363847c39Smrg
194463847c39Smrg    save_LIBS="$LIBS"
194563847c39Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
194663847c39Smrg
194763847c39Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
194863847c39Smrg	  lt_cv_dlopen_self, [dnl
194963847c39Smrg	  _LT_TRY_DLOPEN_SELF(
195063847c39Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
195163847c39Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
195263847c39Smrg    ])
195363847c39Smrg
195463847c39Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
195563847c39Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
195663847c39Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
195763847c39Smrg	  lt_cv_dlopen_self_static, [dnl
195863847c39Smrg	  _LT_TRY_DLOPEN_SELF(
195963847c39Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
196063847c39Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
196163847c39Smrg      ])
196263847c39Smrg    fi
196363847c39Smrg
196463847c39Smrg    CPPFLAGS="$save_CPPFLAGS"
196563847c39Smrg    LDFLAGS="$save_LDFLAGS"
196663847c39Smrg    LIBS="$save_LIBS"
196763847c39Smrg    ;;
196863847c39Smrg  esac
196963847c39Smrg
197063847c39Smrg  case $lt_cv_dlopen_self in
197163847c39Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
197263847c39Smrg  *) enable_dlopen_self=unknown ;;
197363847c39Smrg  esac
197463847c39Smrg
197563847c39Smrg  case $lt_cv_dlopen_self_static in
197663847c39Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
197763847c39Smrg  *) enable_dlopen_self_static=unknown ;;
197863847c39Smrg  esac
197963847c39Smrgfi
198063847c39Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
198163847c39Smrg	 [Whether dlopen is supported])
198263847c39Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
198363847c39Smrg	 [Whether dlopen of programs is supported])
198463847c39Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
198563847c39Smrg	 [Whether dlopen of statically linked programs is supported])
198663847c39Smrg])# LT_SYS_DLOPEN_SELF
198763847c39Smrg
198863847c39Smrg# Old name:
198963847c39SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
199063847c39Smrgdnl aclocal-1.4 backwards compatibility:
199163847c39Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
199263847c39Smrg
199363847c39Smrg
199463847c39Smrg# _LT_COMPILER_C_O([TAGNAME])
199563847c39Smrg# ---------------------------
199663847c39Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
199763847c39Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
199863847c39Smrgm4_defun([_LT_COMPILER_C_O],
199963847c39Smrg[m4_require([_LT_DECL_SED])dnl
200063847c39Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
200163847c39Smrgm4_require([_LT_TAG_COMPILER])dnl
200263847c39SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
200363847c39Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
200463847c39Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
200563847c39Smrg   $RM -r conftest 2>/dev/null
200663847c39Smrg   mkdir conftest
200763847c39Smrg   cd conftest
200863847c39Smrg   mkdir out
200963847c39Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
201063847c39Smrg
201163847c39Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
201263847c39Smrg   # Insert the option either (1) after the last *FLAGS variable, or
201363847c39Smrg   # (2) before a word containing "conftest.", or (3) at the end.
201463847c39Smrg   # Note that $ac_compile itself does not contain backslashes and begins
201563847c39Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
201663847c39Smrg   lt_compile=`echo "$ac_compile" | $SED \
201763847c39Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
201863847c39Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
201963847c39Smrg   -e 's:$: $lt_compiler_flag:'`
202063847c39Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
202163847c39Smrg   (eval "$lt_compile" 2>out/conftest.err)
202263847c39Smrg   ac_status=$?
202363847c39Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
202463847c39Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
202563847c39Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
202663847c39Smrg   then
202763847c39Smrg     # The compiler can only warn and ignore the option if not recognized
202863847c39Smrg     # So say no if there are warnings
202963847c39Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
203063847c39Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
203163847c39Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
203263847c39Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
203363847c39Smrg     fi
203463847c39Smrg   fi
203563847c39Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
203663847c39Smrg   $RM conftest*
203763847c39Smrg   # SGI C++ compiler will create directory out/ii_files/ for
203863847c39Smrg   # template instantiation
203963847c39Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
204063847c39Smrg   $RM out/* && rmdir out
204163847c39Smrg   cd ..
204263847c39Smrg   $RM -r conftest
204363847c39Smrg   $RM conftest*
204463847c39Smrg])
204563847c39Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
204663847c39Smrg	[Does compiler simultaneously support -c and -o options?])
204763847c39Smrg])# _LT_COMPILER_C_O
204863847c39Smrg
204963847c39Smrg
205063847c39Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
205163847c39Smrg# ----------------------------------
205263847c39Smrg# Check to see if we can do hard links to lock some files if needed
205363847c39Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
205463847c39Smrg[m4_require([_LT_ENABLE_LOCK])dnl
205563847c39Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
205663847c39Smrg_LT_COMPILER_C_O([$1])
205763847c39Smrg
205863847c39Smrghard_links="nottested"
205963847c39Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
206063847c39Smrg  # do not overwrite the value of need_locks provided by the user
206163847c39Smrg  AC_MSG_CHECKING([if we can lock with hard links])
206263847c39Smrg  hard_links=yes
206363847c39Smrg  $RM conftest*
206463847c39Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
206563847c39Smrg  touch conftest.a
206663847c39Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
206763847c39Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
206863847c39Smrg  AC_MSG_RESULT([$hard_links])
206963847c39Smrg  if test "$hard_links" = no; then
207063847c39Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
207163847c39Smrg    need_locks=warn
207263847c39Smrg  fi
207363847c39Smrgelse
207463847c39Smrg  need_locks=no
207563847c39Smrgfi
207663847c39Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
207763847c39Smrg])# _LT_COMPILER_FILE_LOCKS
207863847c39Smrg
207963847c39Smrg
208063847c39Smrg# _LT_CHECK_OBJDIR
208163847c39Smrg# ----------------
208263847c39Smrgm4_defun([_LT_CHECK_OBJDIR],
208363847c39Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
208463847c39Smrg[rm -f .libs 2>/dev/null
208563847c39Smrgmkdir .libs 2>/dev/null
208663847c39Smrgif test -d .libs; then
208763847c39Smrg  lt_cv_objdir=.libs
208863847c39Smrgelse
208963847c39Smrg  # MS-DOS does not allow filenames that begin with a dot.
209063847c39Smrg  lt_cv_objdir=_libs
209163847c39Smrgfi
209263847c39Smrgrmdir .libs 2>/dev/null])
209363847c39Smrgobjdir=$lt_cv_objdir
209463847c39Smrg_LT_DECL([], [objdir], [0],
209563847c39Smrg         [The name of the directory that contains temporary libtool files])dnl
209663847c39Smrgm4_pattern_allow([LT_OBJDIR])dnl
209763847c39SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
209863847c39Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
209963847c39Smrg])# _LT_CHECK_OBJDIR
210063847c39Smrg
210163847c39Smrg
210263847c39Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
210363847c39Smrg# --------------------------------------
210463847c39Smrg# Check hardcoding attributes.
210563847c39Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
210663847c39Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
210763847c39Smrg_LT_TAGVAR(hardcode_action, $1)=
210863847c39Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
210963847c39Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
211063847c39Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
211163847c39Smrg
211263847c39Smrg  # We can hardcode non-existent directories.
211363847c39Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
211463847c39Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
211563847c39Smrg     # have to relink, otherwise we might link with an installed library
211663847c39Smrg     # when we should be linking with a yet-to-be-installed one
211763847c39Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
211863847c39Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
211963847c39Smrg    # Linking always hardcodes the temporary library directory.
212063847c39Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
212163847c39Smrg  else
212263847c39Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
212363847c39Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
212463847c39Smrg  fi
212563847c39Smrgelse
212663847c39Smrg  # We cannot hardcode anything, or else we can only hardcode existing
212763847c39Smrg  # directories.
212863847c39Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
212963847c39Smrgfi
213063847c39SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
213163847c39Smrg
213263847c39Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
213363847c39Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
213463847c39Smrg  # Fast installation is not supported
213563847c39Smrg  enable_fast_install=no
213663847c39Smrgelif test "$shlibpath_overrides_runpath" = yes ||
213763847c39Smrg     test "$enable_shared" = no; then
213863847c39Smrg  # Fast installation is not necessary
213963847c39Smrg  enable_fast_install=needless
214063847c39Smrgfi
214163847c39Smrg_LT_TAGDECL([], [hardcode_action], [0],
214263847c39Smrg    [How to hardcode a shared library path into an executable])
214363847c39Smrg])# _LT_LINKER_HARDCODE_LIBPATH
214463847c39Smrg
214563847c39Smrg
214663847c39Smrg# _LT_CMD_STRIPLIB
214763847c39Smrg# ----------------
214863847c39Smrgm4_defun([_LT_CMD_STRIPLIB],
214963847c39Smrg[m4_require([_LT_DECL_EGREP])
215063847c39Smrgstriplib=
215163847c39Smrgold_striplib=
215263847c39SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
215363847c39Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
215463847c39Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
215563847c39Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
215663847c39Smrg  AC_MSG_RESULT([yes])
215763847c39Smrgelse
215863847c39Smrg# FIXME - insert some real tests, host_os isn't really good enough
215963847c39Smrg  case $host_os in
216063847c39Smrg  darwin*)
216163847c39Smrg    if test -n "$STRIP" ; then
216263847c39Smrg      striplib="$STRIP -x"
216363847c39Smrg      old_striplib="$STRIP -S"
216463847c39Smrg      AC_MSG_RESULT([yes])
216563847c39Smrg    else
216663847c39Smrg      AC_MSG_RESULT([no])
216763847c39Smrg    fi
216863847c39Smrg    ;;
216963847c39Smrg  *)
217063847c39Smrg    AC_MSG_RESULT([no])
217163847c39Smrg    ;;
217263847c39Smrg  esac
217363847c39Smrgfi
217463847c39Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
217563847c39Smrg_LT_DECL([], [striplib], [1])
217663847c39Smrg])# _LT_CMD_STRIPLIB
217763847c39Smrg
217863847c39Smrg
217963847c39Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
218063847c39Smrg# -----------------------------
218163847c39Smrg# PORTME Fill in your ld.so characteristics
218263847c39Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
218363847c39Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
218463847c39Smrgm4_require([_LT_DECL_EGREP])dnl
218563847c39Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
218663847c39Smrgm4_require([_LT_DECL_OBJDUMP])dnl
218763847c39Smrgm4_require([_LT_DECL_SED])dnl
218863847c39Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
218963847c39SmrgAC_MSG_CHECKING([dynamic linker characteristics])
219063847c39Smrgm4_if([$1],
219163847c39Smrg	[], [
219263847c39Smrgif test "$GCC" = yes; then
219363847c39Smrg  case $host_os in
219463847c39Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
219563847c39Smrg    *) lt_awk_arg="/^libraries:/" ;;
219663847c39Smrg  esac
219763847c39Smrg  case $host_os in
219863847c39Smrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
219963847c39Smrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
220063847c39Smrg  esac
220163847c39Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
220263847c39Smrg  case $lt_search_path_spec in
220363847c39Smrg  *\;*)
220463847c39Smrg    # if the path contains ";" then we assume it to be the separator
220563847c39Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
220663847c39Smrg    # assumed that no part of a normal pathname contains ";" but that should
220763847c39Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
220863847c39Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
220963847c39Smrg    ;;
221063847c39Smrg  *)
221163847c39Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
221263847c39Smrg    ;;
221363847c39Smrg  esac
221463847c39Smrg  # Ok, now we have the path, separated by spaces, we can step through it
221563847c39Smrg  # and add multilib dir if necessary.
221663847c39Smrg  lt_tmp_lt_search_path_spec=
221763847c39Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
221863847c39Smrg  for lt_sys_path in $lt_search_path_spec; do
221963847c39Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
222063847c39Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
222163847c39Smrg    else
222263847c39Smrg      test -d "$lt_sys_path" && \
222363847c39Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
222463847c39Smrg    fi
222563847c39Smrg  done
222663847c39Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
222763847c39SmrgBEGIN {RS=" "; FS="/|\n";} {
222863847c39Smrg  lt_foo="";
222963847c39Smrg  lt_count=0;
223063847c39Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
223163847c39Smrg    if ($lt_i != "" && $lt_i != ".") {
223263847c39Smrg      if ($lt_i == "..") {
223363847c39Smrg        lt_count++;
223463847c39Smrg      } else {
223563847c39Smrg        if (lt_count == 0) {
223663847c39Smrg          lt_foo="/" $lt_i lt_foo;
223763847c39Smrg        } else {
223863847c39Smrg          lt_count--;
223963847c39Smrg        }
224063847c39Smrg      }
224163847c39Smrg    }
224263847c39Smrg  }
224363847c39Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
224463847c39Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
224563847c39Smrg}'`
224663847c39Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
224763847c39Smrg  # for these hosts.
224863847c39Smrg  case $host_os in
224963847c39Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
225063847c39Smrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
225163847c39Smrg  esac
225263847c39Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
225363847c39Smrgelse
225463847c39Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
225563847c39Smrgfi])
225663847c39Smrglibrary_names_spec=
225763847c39Smrglibname_spec='lib$name'
225863847c39Smrgsoname_spec=
225963847c39Smrgshrext_cmds=".so"
226063847c39Smrgpostinstall_cmds=
226163847c39Smrgpostuninstall_cmds=
226263847c39Smrgfinish_cmds=
226363847c39Smrgfinish_eval=
226463847c39Smrgshlibpath_var=
226563847c39Smrgshlibpath_overrides_runpath=unknown
226663847c39Smrgversion_type=none
226763847c39Smrgdynamic_linker="$host_os ld.so"
226863847c39Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
226963847c39Smrgneed_lib_prefix=unknown
227063847c39Smrghardcode_into_libs=no
227163847c39Smrg
227263847c39Smrg# when you set need_version to no, make sure it does not cause -set_version
227363847c39Smrg# flags to be left without arguments
227463847c39Smrgneed_version=unknown
227563847c39Smrg
227663847c39Smrgcase $host_os in
227763847c39Smrgaix3*)
227863847c39Smrg  version_type=linux # correct to gnu/linux during the next big refactor
227963847c39Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
228063847c39Smrg  shlibpath_var=LIBPATH
228163847c39Smrg
228263847c39Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
228363847c39Smrg  soname_spec='${libname}${release}${shared_ext}$major'
228463847c39Smrg  ;;
228563847c39Smrg
228663847c39Smrgaix[[4-9]]*)
228763847c39Smrg  version_type=linux # correct to gnu/linux during the next big refactor
228863847c39Smrg  need_lib_prefix=no
228963847c39Smrg  need_version=no
229063847c39Smrg  hardcode_into_libs=yes
229163847c39Smrg  if test "$host_cpu" = ia64; then
229263847c39Smrg    # AIX 5 supports IA64
229363847c39Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
229463847c39Smrg    shlibpath_var=LD_LIBRARY_PATH
229563847c39Smrg  else
229663847c39Smrg    # With GCC up to 2.95.x, collect2 would create an import file
229763847c39Smrg    # for dependence libraries.  The import file would start with
229863847c39Smrg    # the line `#! .'.  This would cause the generated library to
229963847c39Smrg    # depend on `.', always an invalid library.  This was fixed in
230063847c39Smrg    # development snapshots of GCC prior to 3.0.
230163847c39Smrg    case $host_os in
230263847c39Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
230363847c39Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
230463847c39Smrg	   echo ' yes '
230563847c39Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
230663847c39Smrg	:
230763847c39Smrg      else
230863847c39Smrg	can_build_shared=no
230963847c39Smrg      fi
231063847c39Smrg      ;;
231163847c39Smrg    esac
231263847c39Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
231363847c39Smrg    # soname into executable. Probably we can add versioning support to
231463847c39Smrg    # collect2, so additional links can be useful in future.
231563847c39Smrg    if test "$aix_use_runtimelinking" = yes; then
231663847c39Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
231763847c39Smrg      # instead of lib<name>.a to let people know that these are not
231863847c39Smrg      # typical AIX shared libraries.
231963847c39Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
232063847c39Smrg    else
232163847c39Smrg      # We preserve .a as extension for shared libraries through AIX4.2
232263847c39Smrg      # and later when we are not doing run time linking.
232363847c39Smrg      library_names_spec='${libname}${release}.a $libname.a'
232463847c39Smrg      soname_spec='${libname}${release}${shared_ext}$major'
232563847c39Smrg    fi
232663847c39Smrg    shlibpath_var=LIBPATH
232763847c39Smrg  fi
232863847c39Smrg  ;;
232963847c39Smrg
233063847c39Smrgamigaos*)
233163847c39Smrg  case $host_cpu in
233263847c39Smrg  powerpc)
233363847c39Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
233463847c39Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
233563847c39Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
233663847c39Smrg    ;;
233763847c39Smrg  m68k)
233863847c39Smrg    library_names_spec='$libname.ixlibrary $libname.a'
233963847c39Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
234063847c39Smrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
234163847c39Smrg    ;;
234263847c39Smrg  esac
234363847c39Smrg  ;;
234463847c39Smrg
234563847c39Smrgbeos*)
234663847c39Smrg  library_names_spec='${libname}${shared_ext}'
234763847c39Smrg  dynamic_linker="$host_os ld.so"
234863847c39Smrg  shlibpath_var=LIBRARY_PATH
234963847c39Smrg  ;;
235063847c39Smrg
235163847c39Smrgbsdi[[45]]*)
235263847c39Smrg  version_type=linux # correct to gnu/linux during the next big refactor
235363847c39Smrg  need_version=no
235463847c39Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
235563847c39Smrg  soname_spec='${libname}${release}${shared_ext}$major'
235663847c39Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
235763847c39Smrg  shlibpath_var=LD_LIBRARY_PATH
235863847c39Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
235963847c39Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
236063847c39Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
236163847c39Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
236263847c39Smrg  # libtool to hard-code these into programs
236363847c39Smrg  ;;
236463847c39Smrg
236563847c39Smrgcygwin* | mingw* | pw32* | cegcc*)
236663847c39Smrg  version_type=windows
236763847c39Smrg  shrext_cmds=".dll"
236863847c39Smrg  need_version=no
236963847c39Smrg  need_lib_prefix=no
237063847c39Smrg
237163847c39Smrg  case $GCC,$cc_basename in
237263847c39Smrg  yes,*)
237363847c39Smrg    # gcc
237463847c39Smrg    library_names_spec='$libname.dll.a'
237563847c39Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
237663847c39Smrg    postinstall_cmds='base_file=`basename \${file}`~
237763847c39Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
237863847c39Smrg      dldir=$destdir/`dirname \$dlpath`~
237963847c39Smrg      test -d \$dldir || mkdir -p \$dldir~
238063847c39Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
238163847c39Smrg      chmod a+x \$dldir/$dlname~
238263847c39Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
238363847c39Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
238463847c39Smrg      fi'
238563847c39Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
238663847c39Smrg      dlpath=$dir/\$dldll~
238763847c39Smrg       $RM \$dlpath'
238863847c39Smrg    shlibpath_overrides_runpath=yes
238963847c39Smrg
239063847c39Smrg    case $host_os in
239163847c39Smrg    cygwin*)
239263847c39Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
239363847c39Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
239463847c39Smrgm4_if([$1], [],[
239563847c39Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
239663847c39Smrg      ;;
239763847c39Smrg    mingw* | cegcc*)
239863847c39Smrg      # MinGW DLLs use traditional 'lib' prefix
239963847c39Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
240063847c39Smrg      ;;
240163847c39Smrg    pw32*)
240263847c39Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
240363847c39Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
240463847c39Smrg      ;;
240563847c39Smrg    esac
240663847c39Smrg    dynamic_linker='Win32 ld.exe'
240763847c39Smrg    ;;
240863847c39Smrg
240963847c39Smrg  *,cl*)
241063847c39Smrg    # Native MSVC
241163847c39Smrg    libname_spec='$name'
241263847c39Smrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
241363847c39Smrg    library_names_spec='${libname}.dll.lib'
241463847c39Smrg
241563847c39Smrg    case $build_os in
241663847c39Smrg    mingw*)
241763847c39Smrg      sys_lib_search_path_spec=
241863847c39Smrg      lt_save_ifs=$IFS
241963847c39Smrg      IFS=';'
242063847c39Smrg      for lt_path in $LIB
242163847c39Smrg      do
242263847c39Smrg        IFS=$lt_save_ifs
242363847c39Smrg        # Let DOS variable expansion print the short 8.3 style file name.
242463847c39Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
242563847c39Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
242663847c39Smrg      done
242763847c39Smrg      IFS=$lt_save_ifs
242863847c39Smrg      # Convert to MSYS style.
242963847c39Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
243063847c39Smrg      ;;
243163847c39Smrg    cygwin*)
243263847c39Smrg      # Convert to unix form, then to dos form, then back to unix form
243363847c39Smrg      # but this time dos style (no spaces!) so that the unix form looks
243463847c39Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
243563847c39Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
243663847c39Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
243763847c39Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
243863847c39Smrg      ;;
243963847c39Smrg    *)
244063847c39Smrg      sys_lib_search_path_spec="$LIB"
244163847c39Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
244263847c39Smrg        # It is most probably a Windows format PATH.
244363847c39Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
244463847c39Smrg      else
244563847c39Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
244663847c39Smrg      fi
244763847c39Smrg      # FIXME: find the short name or the path components, as spaces are
244863847c39Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
244963847c39Smrg      ;;
245063847c39Smrg    esac
245163847c39Smrg
245263847c39Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
245363847c39Smrg    postinstall_cmds='base_file=`basename \${file}`~
245463847c39Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
245563847c39Smrg      dldir=$destdir/`dirname \$dlpath`~
245663847c39Smrg      test -d \$dldir || mkdir -p \$dldir~
245763847c39Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
245863847c39Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
245963847c39Smrg      dlpath=$dir/\$dldll~
246063847c39Smrg       $RM \$dlpath'
246163847c39Smrg    shlibpath_overrides_runpath=yes
246263847c39Smrg    dynamic_linker='Win32 link.exe'
246363847c39Smrg    ;;
246463847c39Smrg
246563847c39Smrg  *)
246663847c39Smrg    # Assume MSVC wrapper
246763847c39Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
246863847c39Smrg    dynamic_linker='Win32 ld.exe'
246963847c39Smrg    ;;
247063847c39Smrg  esac
247163847c39Smrg  # FIXME: first we should search . and the directory the executable is in
247263847c39Smrg  shlibpath_var=PATH
247363847c39Smrg  ;;
247463847c39Smrg
247563847c39Smrgdarwin* | rhapsody*)
247663847c39Smrg  dynamic_linker="$host_os dyld"
247763847c39Smrg  version_type=darwin
247863847c39Smrg  need_lib_prefix=no
247963847c39Smrg  need_version=no
248063847c39Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
248163847c39Smrg  soname_spec='${libname}${release}${major}$shared_ext'
248263847c39Smrg  shlibpath_overrides_runpath=yes
248363847c39Smrg  shlibpath_var=DYLD_LIBRARY_PATH
248463847c39Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
248563847c39Smrgm4_if([$1], [],[
248663847c39Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
248763847c39Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
248863847c39Smrg  ;;
248963847c39Smrg
249063847c39Smrgdgux*)
249163847c39Smrg  version_type=linux # correct to gnu/linux during the next big refactor
249263847c39Smrg  need_lib_prefix=no
249363847c39Smrg  need_version=no
249463847c39Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
249563847c39Smrg  soname_spec='${libname}${release}${shared_ext}$major'
249663847c39Smrg  shlibpath_var=LD_LIBRARY_PATH
249763847c39Smrg  ;;
249863847c39Smrg
249963847c39Smrgfreebsd* | dragonfly*)
250063847c39Smrg  # DragonFly does not have aout.  When/if they implement a new
250163847c39Smrg  # versioning mechanism, adjust this.
250263847c39Smrg  if test -x /usr/bin/objformat; then
250363847c39Smrg    objformat=`/usr/bin/objformat`
250463847c39Smrg  else
250563847c39Smrg    case $host_os in
250663847c39Smrg    freebsd[[23]].*) objformat=aout ;;
250763847c39Smrg    *) objformat=elf ;;
250863847c39Smrg    esac
250963847c39Smrg  fi
251063847c39Smrg  version_type=freebsd-$objformat
251163847c39Smrg  case $version_type in
251263847c39Smrg    freebsd-elf*)
251363847c39Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
251463847c39Smrg      need_version=no
251563847c39Smrg      need_lib_prefix=no
251663847c39Smrg      ;;
251763847c39Smrg    freebsd-*)
251863847c39Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
251963847c39Smrg      need_version=yes
252063847c39Smrg      ;;
252163847c39Smrg  esac
252263847c39Smrg  shlibpath_var=LD_LIBRARY_PATH
252363847c39Smrg  case $host_os in
252463847c39Smrg  freebsd2.*)
252563847c39Smrg    shlibpath_overrides_runpath=yes
252663847c39Smrg    ;;
252763847c39Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
252863847c39Smrg    shlibpath_overrides_runpath=yes
252963847c39Smrg    hardcode_into_libs=yes
253063847c39Smrg    ;;
253163847c39Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
253263847c39Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
253363847c39Smrg    shlibpath_overrides_runpath=no
253463847c39Smrg    hardcode_into_libs=yes
253563847c39Smrg    ;;
253663847c39Smrg  *) # from 4.6 on, and DragonFly
253763847c39Smrg    shlibpath_overrides_runpath=yes
253863847c39Smrg    hardcode_into_libs=yes
253963847c39Smrg    ;;
254063847c39Smrg  esac
254163847c39Smrg  ;;
254263847c39Smrg
254363847c39Smrghaiku*)
254463847c39Smrg  version_type=linux # correct to gnu/linux during the next big refactor
254563847c39Smrg  need_lib_prefix=no
254663847c39Smrg  need_version=no
254763847c39Smrg  dynamic_linker="$host_os runtime_loader"
254863847c39Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
254963847c39Smrg  soname_spec='${libname}${release}${shared_ext}$major'
255063847c39Smrg  shlibpath_var=LIBRARY_PATH
255163847c39Smrg  shlibpath_overrides_runpath=yes
255263847c39Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
255386dafe34Smrg  hardcode_into_libs=yes
255486dafe34Smrg  ;;
255576888252Smrg
255686dafe34Smrghpux9* | hpux10* | hpux11*)
255786dafe34Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
255886dafe34Smrg  # link against other versions.
255986dafe34Smrg  version_type=sunos
256086dafe34Smrg  need_lib_prefix=no
256186dafe34Smrg  need_version=no
256286dafe34Smrg  case $host_cpu in
256386dafe34Smrg  ia64*)
256486dafe34Smrg    shrext_cmds='.so'
256586dafe34Smrg    hardcode_into_libs=yes
256686dafe34Smrg    dynamic_linker="$host_os dld.so"
256786dafe34Smrg    shlibpath_var=LD_LIBRARY_PATH
256886dafe34Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
256986dafe34Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
257086dafe34Smrg    soname_spec='${libname}${release}${shared_ext}$major'
257186dafe34Smrg    if test "X$HPUX_IA64_MODE" = X32; then
257286dafe34Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
257386dafe34Smrg    else
257486dafe34Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
257586dafe34Smrg    fi
257686dafe34Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
257786dafe34Smrg    ;;
257863847c39Smrg  hppa*64*)
257963847c39Smrg    shrext_cmds='.sl'
258063847c39Smrg    hardcode_into_libs=yes
258163847c39Smrg    dynamic_linker="$host_os dld.sl"
258263847c39Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
258363847c39Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
258463847c39Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
258563847c39Smrg    soname_spec='${libname}${release}${shared_ext}$major'
258663847c39Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
258763847c39Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
258863847c39Smrg    ;;
258963847c39Smrg  *)
259086dafe34Smrg    shrext_cmds='.sl'
259186dafe34Smrg    dynamic_linker="$host_os dld.sl"
259286dafe34Smrg    shlibpath_var=SHLIB_PATH
259386dafe34Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
259486dafe34Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
259586dafe34Smrg    soname_spec='${libname}${release}${shared_ext}$major'
259686dafe34Smrg    ;;
259786dafe34Smrg  esac
259863847c39Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
259986dafe34Smrg  postinstall_cmds='chmod 555 $lib'
260063847c39Smrg  # or fails outright, so override atomically:
260163847c39Smrg  install_override_mode=555
260286dafe34Smrg  ;;
260376888252Smrg
260486dafe34Smrginterix[[3-9]]*)
260563847c39Smrg  version_type=linux # correct to gnu/linux during the next big refactor
260686dafe34Smrg  need_lib_prefix=no
260786dafe34Smrg  need_version=no
260886dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
260986dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
261086dafe34Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
261186dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
261286dafe34Smrg  shlibpath_overrides_runpath=no
261386dafe34Smrg  hardcode_into_libs=yes
261486dafe34Smrg  ;;
261576888252Smrg
261686dafe34Smrgirix5* | irix6* | nonstopux*)
261786dafe34Smrg  case $host_os in
261886dafe34Smrg    nonstopux*) version_type=nonstopux ;;
261986dafe34Smrg    *)
262086dafe34Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
262163847c39Smrg		version_type=linux # correct to gnu/linux during the next big refactor
262286dafe34Smrg	else
262386dafe34Smrg		version_type=irix
262486dafe34Smrg	fi ;;
262586dafe34Smrg  esac
262686dafe34Smrg  need_lib_prefix=no
262786dafe34Smrg  need_version=no
262886dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
262986dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
263086dafe34Smrg  case $host_os in
263186dafe34Smrg  irix5* | nonstopux*)
263286dafe34Smrg    libsuff= shlibsuff=
263386dafe34Smrg    ;;
263486dafe34Smrg  *)
263586dafe34Smrg    case $LD in # libtool.m4 will add one of these switches to LD
263686dafe34Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
263786dafe34Smrg      libsuff= shlibsuff= libmagic=32-bit;;
263886dafe34Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
263986dafe34Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
264086dafe34Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
264186dafe34Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
264286dafe34Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
264386dafe34Smrg    esac
264486dafe34Smrg    ;;
264586dafe34Smrg  esac
264686dafe34Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
264786dafe34Smrg  shlibpath_overrides_runpath=no
264886dafe34Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
264986dafe34Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
265086dafe34Smrg  hardcode_into_libs=yes
265186dafe34Smrg  ;;
265276888252Smrg
265386dafe34Smrg# No shared lib support for Linux oldld, aout, or coff.
265486dafe34Smrglinux*oldld* | linux*aout* | linux*coff*)
265586dafe34Smrg  dynamic_linker=no
265686dafe34Smrg  ;;
265776888252Smrg
265863847c39Smrg# This must be glibc/ELF.
26599586ba5aSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
266063847c39Smrg  version_type=linux # correct to gnu/linux during the next big refactor
266186dafe34Smrg  need_lib_prefix=no
266286dafe34Smrg  need_version=no
266386dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
266486dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
266586dafe34Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
266686dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
266786dafe34Smrg  shlibpath_overrides_runpath=no
266863847c39Smrg
266963847c39Smrg  # Some binutils ld are patched to set DT_RUNPATH
267063847c39Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
267163847c39Smrg    [lt_cv_shlibpath_overrides_runpath=no
267263847c39Smrg    save_LDFLAGS=$LDFLAGS
267363847c39Smrg    save_libdir=$libdir
267463847c39Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
267563847c39Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
267663847c39Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
267763847c39Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
267863847c39Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
267963847c39Smrg    LDFLAGS=$save_LDFLAGS
268063847c39Smrg    libdir=$save_libdir
268163847c39Smrg    ])
268263847c39Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
268363847c39Smrg
268486dafe34Smrg  # This implies no fast_install, which is unacceptable.
268586dafe34Smrg  # Some rework will be needed to allow for fast_install
268686dafe34Smrg  # before this can be enabled.
268786dafe34Smrg  hardcode_into_libs=yes
268876888252Smrg
268986dafe34Smrg  # Append ld.so.conf contents to the search path
269086dafe34Smrg  if test -f /etc/ld.so.conf; then
269163847c39Smrg    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' ' '`
269263847c39Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
269386dafe34Smrg  fi
269476888252Smrg
269586dafe34Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
269686dafe34Smrg  # powerpc, because MkLinux only supported shared libraries with the
269786dafe34Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
269886dafe34Smrg  # most powerpc-linux boxes support dynamic linking these days and
269986dafe34Smrg  # people can always --disable-shared, the test was removed, and we
270086dafe34Smrg  # assume the GNU/Linux dynamic linker is in use.
270186dafe34Smrg  dynamic_linker='GNU/Linux ld.so'
270286dafe34Smrg  ;;
270376888252Smrg
270463847c39Smrgnetbsdelf*-gnu)
270563847c39Smrg  version_type=linux
270663847c39Smrg  need_lib_prefix=no
270763847c39Smrg  need_version=no
270863847c39Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
270963847c39Smrg  soname_spec='${libname}${release}${shared_ext}$major'
271063847c39Smrg  shlibpath_var=LD_LIBRARY_PATH
271163847c39Smrg  shlibpath_overrides_runpath=no
271263847c39Smrg  hardcode_into_libs=yes
271363847c39Smrg  dynamic_linker='NetBSD ld.elf_so'
271463847c39Smrg  ;;
271563847c39Smrg
271686dafe34Smrgnetbsd*)
271786dafe34Smrg  version_type=sunos
271886dafe34Smrg  need_lib_prefix=no
271986dafe34Smrg  need_version=no
272063847c39Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
272186dafe34Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
272286dafe34Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
272386dafe34Smrg    dynamic_linker='NetBSD (a.out) ld.so'
272486dafe34Smrg  else
272586dafe34Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
272686dafe34Smrg    soname_spec='${libname}${release}${shared_ext}$major'
272786dafe34Smrg    dynamic_linker='NetBSD ld.elf_so'
272886dafe34Smrg  fi
272986dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
273086dafe34Smrg  shlibpath_overrides_runpath=yes
273186dafe34Smrg  hardcode_into_libs=yes
273276888252Smrg  ;;
273376888252Smrg
273486dafe34Smrgnewsos6)
273563847c39Smrg  version_type=linux # correct to gnu/linux during the next big refactor
273686dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
273786dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
273886dafe34Smrg  shlibpath_overrides_runpath=yes
273986dafe34Smrg  ;;
274076888252Smrg
274163847c39Smrg*nto* | *qnx*)
274263847c39Smrg  version_type=qnx
274386dafe34Smrg  need_lib_prefix=no
274486dafe34Smrg  need_version=no
274586dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
274686dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
274786dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
274863847c39Smrg  shlibpath_overrides_runpath=no
274963847c39Smrg  hardcode_into_libs=yes
275063847c39Smrg  dynamic_linker='ldqnx.so'
275186dafe34Smrg  ;;
275276888252Smrg
275386dafe34Smrgopenbsd*)
275486dafe34Smrg  version_type=sunos
275586dafe34Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
275686dafe34Smrg  need_lib_prefix=no
275786dafe34Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
275886dafe34Smrg  case $host_os in
275963847c39Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
276063847c39Smrg    *)				need_version=no  ;;
276186dafe34Smrg  esac
276286dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
276386dafe34Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
276486dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
276563847c39Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
276686dafe34Smrg    case $host_os in
276786dafe34Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
276886dafe34Smrg	shlibpath_overrides_runpath=no
276986dafe34Smrg	;;
277086dafe34Smrg      *)
277186dafe34Smrg	shlibpath_overrides_runpath=yes
277286dafe34Smrg	;;
277386dafe34Smrg      esac
277486dafe34Smrg  else
277586dafe34Smrg    shlibpath_overrides_runpath=yes
27761ae1b5e8Smrg  fi
277786dafe34Smrg  ;;
277876888252Smrg
277986dafe34Smrgos2*)
278086dafe34Smrg  libname_spec='$name'
278186dafe34Smrg  shrext_cmds=".dll"
278286dafe34Smrg  need_lib_prefix=no
278386dafe34Smrg  library_names_spec='$libname${shared_ext} $libname.a'
278486dafe34Smrg  dynamic_linker='OS/2 ld.exe'
278586dafe34Smrg  shlibpath_var=LIBPATH
278686dafe34Smrg  ;;
278776888252Smrg
278886dafe34Smrgosf3* | osf4* | osf5*)
278986dafe34Smrg  version_type=osf
279086dafe34Smrg  need_lib_prefix=no
279186dafe34Smrg  need_version=no
279286dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
279386dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
279486dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
279586dafe34Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
279686dafe34Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
279786dafe34Smrg  ;;
279876888252Smrg
279986dafe34Smrgrdos*)
280086dafe34Smrg  dynamic_linker=no
280186dafe34Smrg  ;;
280276888252Smrg
280386dafe34Smrgsolaris*)
280463847c39Smrg  version_type=linux # correct to gnu/linux during the next big refactor
280586dafe34Smrg  need_lib_prefix=no
280686dafe34Smrg  need_version=no
280786dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
280886dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
280986dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
281086dafe34Smrg  shlibpath_overrides_runpath=yes
281186dafe34Smrg  hardcode_into_libs=yes
281286dafe34Smrg  # ldd complains unless libraries are executable
281386dafe34Smrg  postinstall_cmds='chmod +x $lib'
281486dafe34Smrg  ;;
281576888252Smrg
281686dafe34Smrgsunos4*)
281786dafe34Smrg  version_type=sunos
281886dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
281986dafe34Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
282086dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
282186dafe34Smrg  shlibpath_overrides_runpath=yes
282286dafe34Smrg  if test "$with_gnu_ld" = yes; then
282386dafe34Smrg    need_lib_prefix=no
28241ae1b5e8Smrg  fi
282586dafe34Smrg  need_version=yes
28261ae1b5e8Smrg  ;;
282786dafe34Smrg
282886dafe34Smrgsysv4 | sysv4.3*)
282963847c39Smrg  version_type=linux # correct to gnu/linux during the next big refactor
283086dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
283186dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
283286dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
283386dafe34Smrg  case $host_vendor in
283486dafe34Smrg    sni)
283586dafe34Smrg      shlibpath_overrides_runpath=no
283686dafe34Smrg      need_lib_prefix=no
283786dafe34Smrg      runpath_var=LD_RUN_PATH
28381ae1b5e8Smrg      ;;
283986dafe34Smrg    siemens)
284086dafe34Smrg      need_lib_prefix=no
28411ae1b5e8Smrg      ;;
284286dafe34Smrg    motorola)
284386dafe34Smrg      need_lib_prefix=no
284486dafe34Smrg      need_version=no
284586dafe34Smrg      shlibpath_overrides_runpath=no
284686dafe34Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
28471ae1b5e8Smrg      ;;
284886dafe34Smrg  esac
28491ae1b5e8Smrg  ;;
285076888252Smrg
285186dafe34Smrgsysv4*MP*)
285286dafe34Smrg  if test -d /usr/nec ;then
285363847c39Smrg    version_type=linux # correct to gnu/linux during the next big refactor
285486dafe34Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
285586dafe34Smrg    soname_spec='$libname${shared_ext}.$major'
285686dafe34Smrg    shlibpath_var=LD_LIBRARY_PATH
28571ae1b5e8Smrg  fi
28581ae1b5e8Smrg  ;;
285976888252Smrg
286086dafe34Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
286186dafe34Smrg  version_type=freebsd-elf
286286dafe34Smrg  need_lib_prefix=no
286386dafe34Smrg  need_version=no
286486dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
286586dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
286686dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
286763847c39Smrg  shlibpath_overrides_runpath=yes
286886dafe34Smrg  hardcode_into_libs=yes
286986dafe34Smrg  if test "$with_gnu_ld" = yes; then
287086dafe34Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
287186dafe34Smrg  else
287286dafe34Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
287386dafe34Smrg    case $host_os in
287486dafe34Smrg      sco3.2v5*)
287586dafe34Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
287686dafe34Smrg	;;
28771ae1b5e8Smrg    esac
28781ae1b5e8Smrg  fi
287986dafe34Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
28801ae1b5e8Smrg  ;;
288176888252Smrg
288263847c39Smrgtpf*)
288363847c39Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
288463847c39Smrg  version_type=linux # correct to gnu/linux during the next big refactor
288563847c39Smrg  need_lib_prefix=no
288663847c39Smrg  need_version=no
288763847c39Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
288863847c39Smrg  shlibpath_var=LD_LIBRARY_PATH
288963847c39Smrg  shlibpath_overrides_runpath=no
289063847c39Smrg  hardcode_into_libs=yes
289163847c39Smrg  ;;
289263847c39Smrg
289386dafe34Smrguts4*)
289463847c39Smrg  version_type=linux # correct to gnu/linux during the next big refactor
289586dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
289686dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
289786dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
289886dafe34Smrg  ;;
289976888252Smrg
290086dafe34Smrg*)
290186dafe34Smrg  dynamic_linker=no
290286dafe34Smrg  ;;
290386dafe34Smrgesac
290486dafe34SmrgAC_MSG_RESULT([$dynamic_linker])
290586dafe34Smrgtest "$dynamic_linker" = no && can_build_shared=no
290686dafe34Smrg
290786dafe34Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
290886dafe34Smrgif test "$GCC" = yes; then
290986dafe34Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
29101ae1b5e8Smrgfi
2911d8556812Smrg
291263847c39Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
291363847c39Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
291463847c39Smrgfi
291563847c39Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
291663847c39Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2917d8556812Smrgfi
2918d8556812Smrg
291963847c39Smrg_LT_DECL([], [variables_saved_for_relink], [1],
292063847c39Smrg    [Variables whose values should be saved in libtool wrapper scripts and
292163847c39Smrg    restored at link time])
292263847c39Smrg_LT_DECL([], [need_lib_prefix], [0],
292363847c39Smrg    [Do we need the "lib" prefix for modules?])
292463847c39Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
292563847c39Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
292663847c39Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
292763847c39Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
292863847c39Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
292963847c39Smrg    [Is shlibpath searched before the hard-coded library search path?])
293063847c39Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
293163847c39Smrg_LT_DECL([], [library_names_spec], [1],
293263847c39Smrg    [[List of archive names.  First name is the real one, the rest are links.
293363847c39Smrg    The last name is the one that the linker finds with -lNAME]])
293463847c39Smrg_LT_DECL([], [soname_spec], [1],
293563847c39Smrg    [[The coded name of the library, if different from the real name]])
293663847c39Smrg_LT_DECL([], [install_override_mode], [1],
293763847c39Smrg    [Permission mode override for installation of shared libraries])
293863847c39Smrg_LT_DECL([], [postinstall_cmds], [2],
293963847c39Smrg    [Command to use after installation of a shared archive])
294063847c39Smrg_LT_DECL([], [postuninstall_cmds], [2],
294163847c39Smrg    [Command to use after uninstallation of a shared archive])
294263847c39Smrg_LT_DECL([], [finish_cmds], [2],
294363847c39Smrg    [Commands used to finish a libtool library installation in a directory])
294463847c39Smrg_LT_DECL([], [finish_eval], [1],
294563847c39Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
294663847c39Smrg    not shown]])
294763847c39Smrg_LT_DECL([], [hardcode_into_libs], [0],
294863847c39Smrg    [Whether we should hardcode library paths into libraries])
294963847c39Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
295063847c39Smrg    [Compile-time system search path for libraries])
295163847c39Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
295263847c39Smrg    [Run-time system search path for libraries])
295363847c39Smrg])# _LT_SYS_DYNAMIC_LINKER
295463847c39Smrg
295563847c39Smrg
295663847c39Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
2957d8556812Smrg# --------------------------
2958d8556812Smrg# find a file program which can recognize shared library
295963847c39SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
296063847c39Smrg[m4_require([_LT_DECL_EGREP])dnl
2961d8556812SmrgAC_MSG_CHECKING([for $1])
2962d8556812SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2963d8556812Smrg[case $MAGIC_CMD in
296486dafe34Smrg[[\\/*] |  ?:[\\/]*])
296586dafe34Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
296686dafe34Smrg  ;;
296786dafe34Smrg*)
296886dafe34Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
296986dafe34Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
297086dafe34Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
297186dafe34Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
297286dafe34Smrgdnl not every word.  This closes a longstanding sh security hole.
297363847c39Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
297486dafe34Smrg  for ac_dir in $ac_dummy; do
297586dafe34Smrg    IFS="$lt_save_ifs"
297686dafe34Smrg    test -z "$ac_dir" && ac_dir=.
297786dafe34Smrg    if test -f $ac_dir/$1; then
297886dafe34Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
297986dafe34Smrg      if test -n "$file_magic_test_file"; then
298086dafe34Smrg	case $deplibs_check_method in
298186dafe34Smrg	"file_magic "*)
298286dafe34Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
298386dafe34Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
298486dafe34Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
298586dafe34Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
298686dafe34Smrg	    :
298786dafe34Smrg	  else
298863847c39Smrg	    cat <<_LT_EOF 1>&2
298976888252Smrg
299086dafe34Smrg*** Warning: the command libtool uses to detect shared libraries,
299186dafe34Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
299286dafe34Smrg*** The result is that libtool may fail to recognize shared libraries
299386dafe34Smrg*** as such.  This will affect the creation of libtool libraries that
299486dafe34Smrg*** depend on shared libraries, but programs linked with such libtool
299586dafe34Smrg*** libraries will work regardless of this problem.  Nevertheless, you
299686dafe34Smrg*** may want to report the problem to your system manager and/or to
299786dafe34Smrg*** bug-libtool@gnu.org
299886dafe34Smrg
299963847c39Smrg_LT_EOF
300086dafe34Smrg	  fi ;;
300186dafe34Smrg	esac
300286dafe34Smrg      fi
300386dafe34Smrg      break
300486dafe34Smrg    fi
300586dafe34Smrg  done
300686dafe34Smrg  IFS="$lt_save_ifs"
300786dafe34Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
300886dafe34Smrg  ;;
300986dafe34Smrgesac])
301086dafe34SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
301186dafe34Smrgif test -n "$MAGIC_CMD"; then
301286dafe34Smrg  AC_MSG_RESULT($MAGIC_CMD)
30131ae1b5e8Smrgelse
301486dafe34Smrg  AC_MSG_RESULT(no)
30151ae1b5e8Smrgfi
301663847c39Smrg_LT_DECL([], [MAGIC_CMD], [0],
301763847c39Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
301863847c39Smrg])# _LT_PATH_TOOL_PREFIX
301976888252Smrg
302063847c39Smrg# Old name:
302163847c39SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
302263847c39Smrgdnl aclocal-1.4 backwards compatibility:
302363847c39Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
302476888252Smrg
302563847c39Smrg
302663847c39Smrg# _LT_PATH_MAGIC
302763847c39Smrg# --------------
302886dafe34Smrg# find a file program which can recognize a shared library
302963847c39Smrgm4_defun([_LT_PATH_MAGIC],
303063847c39Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
303186dafe34Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
303286dafe34Smrg  if test -n "$ac_tool_prefix"; then
303363847c39Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
303486dafe34Smrg  else
303586dafe34Smrg    MAGIC_CMD=:
303686dafe34Smrg  fi
303786dafe34Smrgfi
303863847c39Smrg])# _LT_PATH_MAGIC
303976888252Smrg
304076888252Smrg
304163847c39Smrg# LT_PATH_LD
304286dafe34Smrg# ----------
304386dafe34Smrg# find the pathname to the GNU or non-GNU linker
304463847c39SmrgAC_DEFUN([LT_PATH_LD],
304563847c39Smrg[AC_REQUIRE([AC_PROG_CC])dnl
3046d8556812SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
3047d8556812SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
304863847c39Smrgm4_require([_LT_DECL_SED])dnl
304963847c39Smrgm4_require([_LT_DECL_EGREP])dnl
305063847c39Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
305163847c39Smrg
305263847c39SmrgAC_ARG_WITH([gnu-ld],
305363847c39Smrg    [AS_HELP_STRING([--with-gnu-ld],
305463847c39Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
305563847c39Smrg    [test "$withval" = no || with_gnu_ld=yes],
305663847c39Smrg    [with_gnu_ld=no])dnl
305763847c39Smrg
305886dafe34Smrgac_prog=ld
305986dafe34Smrgif test "$GCC" = yes; then
306086dafe34Smrg  # Check if gcc -print-prog-name=ld gives a path.
306186dafe34Smrg  AC_MSG_CHECKING([for ld used by $CC])
306286dafe34Smrg  case $host in
306386dafe34Smrg  *-*-mingw*)
306486dafe34Smrg    # gcc leaves a trailing carriage return which upsets mingw
306586dafe34Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
306686dafe34Smrg  *)
306786dafe34Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
306886dafe34Smrg  esac
306986dafe34Smrg  case $ac_prog in
307086dafe34Smrg    # Accept absolute paths.
307186dafe34Smrg    [[\\/]]* | ?:[[\\/]]*)
307286dafe34Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
307386dafe34Smrg      # Canonicalize the pathname of ld
307463847c39Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
307563847c39Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
307663847c39Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
307786dafe34Smrg      done
307886dafe34Smrg      test -z "$LD" && LD="$ac_prog"
307986dafe34Smrg      ;;
308086dafe34Smrg  "")
308186dafe34Smrg    # If it fails, then pretend we aren't using GCC.
308286dafe34Smrg    ac_prog=ld
30831ae1b5e8Smrg    ;;
30841ae1b5e8Smrg  *)
308586dafe34Smrg    # If it is relative, then search for the first ld in PATH.
308686dafe34Smrg    with_gnu_ld=unknown
30871ae1b5e8Smrg    ;;
30881ae1b5e8Smrg  esac
308986dafe34Smrgelif test "$with_gnu_ld" = yes; then
309086dafe34Smrg  AC_MSG_CHECKING([for GNU ld])
30911ae1b5e8Smrgelse
309286dafe34Smrg  AC_MSG_CHECKING([for non-GNU ld])
30931ae1b5e8Smrgfi
309486dafe34SmrgAC_CACHE_VAL(lt_cv_path_LD,
309586dafe34Smrg[if test -z "$LD"; then
309686dafe34Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
309786dafe34Smrg  for ac_dir in $PATH; do
309886dafe34Smrg    IFS="$lt_save_ifs"
309986dafe34Smrg    test -z "$ac_dir" && ac_dir=.
310086dafe34Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
310186dafe34Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
310286dafe34Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
310386dafe34Smrg      # but apparently some variants of GNU ld only accept -v.
310486dafe34Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
310586dafe34Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
310686dafe34Smrg      *GNU* | *'with BFD'*)
310786dafe34Smrg	test "$with_gnu_ld" != no && break
310886dafe34Smrg	;;
310986dafe34Smrg      *)
311086dafe34Smrg	test "$with_gnu_ld" != yes && break
311186dafe34Smrg	;;
311286dafe34Smrg      esac
311386dafe34Smrg    fi
311486dafe34Smrg  done
311586dafe34Smrg  IFS="$lt_save_ifs"
311686dafe34Smrgelse
311786dafe34Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
311886dafe34Smrgfi])
311986dafe34SmrgLD="$lt_cv_path_LD"
312086dafe34Smrgif test -n "$LD"; then
312186dafe34Smrg  AC_MSG_RESULT($LD)
312286dafe34Smrgelse
312386dafe34Smrg  AC_MSG_RESULT(no)
312486dafe34Smrgfi
312586dafe34Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
312663847c39Smrg_LT_PATH_LD_GNU
312763847c39SmrgAC_SUBST([LD])
312876888252Smrg
312963847c39Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
313063847c39Smrg])# LT_PATH_LD
313176888252Smrg
313263847c39Smrg# Old names:
313363847c39SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
313463847c39SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
313563847c39Smrgdnl aclocal-1.4 backwards compatibility:
313663847c39Smrgdnl AC_DEFUN([AM_PROG_LD], [])
313763847c39Smrgdnl AC_DEFUN([AC_PROG_LD], [])
313863847c39Smrg
313963847c39Smrg
314063847c39Smrg# _LT_PATH_LD_GNU
314163847c39Smrg#- --------------
314263847c39Smrgm4_defun([_LT_PATH_LD_GNU],
314363847c39Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
314486dafe34Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
314586dafe34Smrgcase `$LD -v 2>&1 </dev/null` in
314686dafe34Smrg*GNU* | *'with BFD'*)
314786dafe34Smrg  lt_cv_prog_gnu_ld=yes
314886dafe34Smrg  ;;
314986dafe34Smrg*)
315086dafe34Smrg  lt_cv_prog_gnu_ld=no
315186dafe34Smrg  ;;
315286dafe34Smrgesac])
315386dafe34Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
315463847c39Smrg])# _LT_PATH_LD_GNU
315576888252Smrg
315676888252Smrg
315763847c39Smrg# _LT_CMD_RELOAD
315863847c39Smrg# --------------
315986dafe34Smrg# find reload flag for linker
316086dafe34Smrg#   -- PORTME Some linkers may need a different reload flag.
316163847c39Smrgm4_defun([_LT_CMD_RELOAD],
316286dafe34Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
316386dafe34Smrg  lt_cv_ld_reload_flag,
316486dafe34Smrg  [lt_cv_ld_reload_flag='-r'])
316586dafe34Smrgreload_flag=$lt_cv_ld_reload_flag
316686dafe34Smrgcase $reload_flag in
316786dafe34Smrg"" | " "*) ;;
316886dafe34Smrg*) reload_flag=" $reload_flag" ;;
316986dafe34Smrgesac
317086dafe34Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
317186dafe34Smrgcase $host_os in
317263847c39Smrg  cygwin* | mingw* | pw32* | cegcc*)
317363847c39Smrg    if test "$GCC" != yes; then
317463847c39Smrg      reload_cmds=false
317563847c39Smrg    fi
317663847c39Smrg    ;;
317786dafe34Smrg  darwin*)
317886dafe34Smrg    if test "$GCC" = yes; then
317986dafe34Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
318086dafe34Smrg    else
318186dafe34Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
318286dafe34Smrg    fi
318386dafe34Smrg    ;;
318486dafe34Smrgesac
318563847c39Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
318663847c39Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
318763847c39Smrg])# _LT_CMD_RELOAD
318876888252Smrg
318976888252Smrg
319063847c39Smrg# _LT_CHECK_MAGIC_METHOD
319163847c39Smrg# ----------------------
319286dafe34Smrg# how to check for library dependencies
319386dafe34Smrg#  -- PORTME fill in with the dynamic library characteristics
319463847c39Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
319563847c39Smrg[m4_require([_LT_DECL_EGREP])
319663847c39Smrgm4_require([_LT_DECL_OBJDUMP])
319763847c39SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
319886dafe34Smrglt_cv_deplibs_check_method,
319986dafe34Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
320086dafe34Smrglt_cv_file_magic_test_file=
320186dafe34Smrglt_cv_deplibs_check_method='unknown'
320286dafe34Smrg# Need to set the preceding variable on all platforms that support
320386dafe34Smrg# interlibrary dependencies.
320486dafe34Smrg# 'none' -- dependencies not supported.
320586dafe34Smrg# `unknown' -- same as none, but documents that we really don't know.
320686dafe34Smrg# 'pass_all' -- all dependencies passed with no checks.
320786dafe34Smrg# 'test_compile' -- check by making test program.
320886dafe34Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
320986dafe34Smrg# which responds to the $file_magic_cmd with a given extended regex.
321086dafe34Smrg# If you have `file' or equivalent on your system and you're not sure
321186dafe34Smrg# whether `pass_all' will *always* work, you probably want this one.
321276888252Smrg
321386dafe34Smrgcase $host_os in
321486dafe34Smrgaix[[4-9]]*)
321586dafe34Smrg  lt_cv_deplibs_check_method=pass_all
321686dafe34Smrg  ;;
321776888252Smrg
321886dafe34Smrgbeos*)
321986dafe34Smrg  lt_cv_deplibs_check_method=pass_all
322086dafe34Smrg  ;;
322176888252Smrg
322286dafe34Smrgbsdi[[45]]*)
322386dafe34Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
322486dafe34Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
322586dafe34Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
322686dafe34Smrg  ;;
322776888252Smrg
322886dafe34Smrgcygwin*)
322986dafe34Smrg  # func_win32_libid is a shell function defined in ltmain.sh
323086dafe34Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
323186dafe34Smrg  lt_cv_file_magic_cmd='func_win32_libid'
323286dafe34Smrg  ;;
323376888252Smrg
323486dafe34Smrgmingw* | pw32*)
323586dafe34Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
323686dafe34Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
323786dafe34Smrg  # unless we find 'file', for example because we are cross-compiling.
323863847c39Smrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
323963847c39Smrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
324086dafe34Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
324186dafe34Smrg    lt_cv_file_magic_cmd='func_win32_libid'
32421ae1b5e8Smrg  else
324363847c39Smrg    # Keep this pattern in sync with the one in func_win32_libid.
324463847c39Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
324586dafe34Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
32461ae1b5e8Smrg  fi
324786dafe34Smrg  ;;
324876888252Smrg
324963847c39Smrgcegcc*)
325063847c39Smrg  # use the weaker test based on 'objdump'. See mingw*.
325163847c39Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
325263847c39Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
325363847c39Smrg  ;;
325463847c39Smrg
325586dafe34Smrgdarwin* | rhapsody*)
325686dafe34Smrg  lt_cv_deplibs_check_method=pass_all
325786dafe34Smrg  ;;
32581ae1b5e8Smrg
325986dafe34Smrgfreebsd* | dragonfly*)
326063847c39Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
326186dafe34Smrg    case $host_cpu in
326286dafe34Smrg    i*86 )
326386dafe34Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
326486dafe34Smrg      # Let's accept both of them until this is cleared up.
326586dafe34Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
326686dafe34Smrg      lt_cv_file_magic_cmd=/usr/bin/file
326786dafe34Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
326886dafe34Smrg      ;;
326986dafe34Smrg    esac
327086dafe34Smrg  else
327186dafe34Smrg    lt_cv_deplibs_check_method=pass_all
327286dafe34Smrg  fi
327386dafe34Smrg  ;;
32741ae1b5e8Smrg
327563847c39Smrghaiku*)
327663847c39Smrg  lt_cv_deplibs_check_method=pass_all
327763847c39Smrg  ;;
327863847c39Smrg
327986dafe34Smrghpux10.20* | hpux11*)
328086dafe34Smrg  lt_cv_file_magic_cmd=/usr/bin/file
328186dafe34Smrg  case $host_cpu in
328286dafe34Smrg  ia64*)
328386dafe34Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
328486dafe34Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
328586dafe34Smrg    ;;
328686dafe34Smrg  hppa*64*)
328763847c39Smrg    [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]']
328886dafe34Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
328986dafe34Smrg    ;;
329086dafe34Smrg  *)
329163847c39Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
329286dafe34Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
329376888252Smrg    ;;
32941ae1b5e8Smrg  esac
329586dafe34Smrg  ;;
329676888252Smrg
329786dafe34Smrginterix[[3-9]]*)
329886dafe34Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
329986dafe34Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
330086dafe34Smrg  ;;
330176888252Smrg
330286dafe34Smrgirix5* | irix6* | nonstopux*)
330386dafe34Smrg  case $LD in
330486dafe34Smrg  *-32|*"-32 ") libmagic=32-bit;;
330586dafe34Smrg  *-n32|*"-n32 ") libmagic=N32;;
330686dafe34Smrg  *-64|*"-64 ") libmagic=64-bit;;
330786dafe34Smrg  *) libmagic=never-match;;
33081ae1b5e8Smrg  esac
330986dafe34Smrg  lt_cv_deplibs_check_method=pass_all
331086dafe34Smrg  ;;
331176888252Smrg
331263847c39Smrg# This must be glibc/ELF.
33139586ba5aSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
331486dafe34Smrg  lt_cv_deplibs_check_method=pass_all
331586dafe34Smrg  ;;
331676888252Smrg
331763847c39Smrgnetbsd* | netbsdelf*-gnu)
331863847c39Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
331986dafe34Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
332086dafe34Smrg  else
332186dafe34Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
332286dafe34Smrg  fi
332386dafe34Smrg  ;;
332476888252Smrg
332586dafe34Smrgnewos6*)
332686dafe34Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
332786dafe34Smrg  lt_cv_file_magic_cmd=/usr/bin/file
332886dafe34Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
332986dafe34Smrg  ;;
333086dafe34Smrg
333163847c39Smrg*nto* | *qnx*)
333263847c39Smrg  lt_cv_deplibs_check_method=pass_all
333386dafe34Smrg  ;;
333486dafe34Smrg
333586dafe34Smrgopenbsd*)
333663847c39Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
333786dafe34Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
333886dafe34Smrg  else
333986dafe34Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
334086dafe34Smrg  fi
334186dafe34Smrg  ;;
334286dafe34Smrg
334386dafe34Smrgosf3* | osf4* | osf5*)
334486dafe34Smrg  lt_cv_deplibs_check_method=pass_all
334586dafe34Smrg  ;;
334686dafe34Smrg
334786dafe34Smrgrdos*)
334886dafe34Smrg  lt_cv_deplibs_check_method=pass_all
334986dafe34Smrg  ;;
335086dafe34Smrg
335186dafe34Smrgsolaris*)
335286dafe34Smrg  lt_cv_deplibs_check_method=pass_all
335386dafe34Smrg  ;;
335486dafe34Smrg
335563847c39Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
335663847c39Smrg  lt_cv_deplibs_check_method=pass_all
335763847c39Smrg  ;;
335863847c39Smrg
335986dafe34Smrgsysv4 | sysv4.3*)
336086dafe34Smrg  case $host_vendor in
336186dafe34Smrg  motorola)
336286dafe34Smrg    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]]'
336386dafe34Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
336486dafe34Smrg    ;;
336586dafe34Smrg  ncr)
336686dafe34Smrg    lt_cv_deplibs_check_method=pass_all
336786dafe34Smrg    ;;
336886dafe34Smrg  sequent)
336986dafe34Smrg    lt_cv_file_magic_cmd='/bin/file'
337086dafe34Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
337186dafe34Smrg    ;;
337286dafe34Smrg  sni)
337386dafe34Smrg    lt_cv_file_magic_cmd='/bin/file'
337486dafe34Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
337586dafe34Smrg    lt_cv_file_magic_test_file=/lib/libc.so
337686dafe34Smrg    ;;
337786dafe34Smrg  siemens)
337886dafe34Smrg    lt_cv_deplibs_check_method=pass_all
337986dafe34Smrg    ;;
338086dafe34Smrg  pc)
338186dafe34Smrg    lt_cv_deplibs_check_method=pass_all
338286dafe34Smrg    ;;
338386dafe34Smrg  esac
338486dafe34Smrg  ;;
338586dafe34Smrg
338663847c39Smrgtpf*)
338786dafe34Smrg  lt_cv_deplibs_check_method=pass_all
338886dafe34Smrg  ;;
338986dafe34Smrgesac
33901ae1b5e8Smrg])
339163847c39Smrg
339263847c39Smrgfile_magic_glob=
339363847c39Smrgwant_nocaseglob=no
339463847c39Smrgif test "$build" = "$host"; then
339563847c39Smrg  case $host_os in
339663847c39Smrg  mingw* | pw32*)
339763847c39Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
339863847c39Smrg      want_nocaseglob=yes
339963847c39Smrg    else
340063847c39Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
340163847c39Smrg    fi
340263847c39Smrg    ;;
340363847c39Smrg  esac
340463847c39Smrgfi
340563847c39Smrg
340686dafe34Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
340786dafe34Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
340886dafe34Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
340963847c39Smrg
341063847c39Smrg_LT_DECL([], [deplibs_check_method], [1],
341163847c39Smrg    [Method to check whether dependent libraries are shared objects])
341263847c39Smrg_LT_DECL([], [file_magic_cmd], [1],
341363847c39Smrg    [Command to use when deplibs_check_method = "file_magic"])
341463847c39Smrg_LT_DECL([], [file_magic_glob], [1],
341563847c39Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
341663847c39Smrg_LT_DECL([], [want_nocaseglob], [1],
341763847c39Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
341863847c39Smrg])# _LT_CHECK_MAGIC_METHOD
341976888252Smrg
342076888252Smrg
342163847c39Smrg# LT_PATH_NM
342286dafe34Smrg# ----------
342363847c39Smrg# find the pathname to a BSD- or MS-compatible name lister
342463847c39SmrgAC_DEFUN([LT_PATH_NM],
342563847c39Smrg[AC_REQUIRE([AC_PROG_CC])dnl
342663847c39SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
342786dafe34Smrg[if test -n "$NM"; then
342886dafe34Smrg  # Let the user override the test.
342986dafe34Smrg  lt_cv_path_NM="$NM"
343086dafe34Smrgelse
343186dafe34Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
343286dafe34Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
343386dafe34Smrg    lt_nm_to_check="$lt_nm_to_check nm"
34341ae1b5e8Smrg  fi
343586dafe34Smrg  for lt_tmp_nm in $lt_nm_to_check; do
343686dafe34Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
343786dafe34Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
343886dafe34Smrg      IFS="$lt_save_ifs"
343986dafe34Smrg      test -z "$ac_dir" && ac_dir=.
344086dafe34Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
344186dafe34Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
344286dafe34Smrg	# Check to see if the nm accepts a BSD-compat flag.
344386dafe34Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
344486dafe34Smrg	#   nm: unknown option "B" ignored
344586dafe34Smrg	# Tru64's nm complains that /dev/null is an invalid object file
344686dafe34Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
344786dafe34Smrg	*/dev/null* | *'Invalid file or object type'*)
344886dafe34Smrg	  lt_cv_path_NM="$tmp_nm -B"
344986dafe34Smrg	  break
345086dafe34Smrg	  ;;
345186dafe34Smrg	*)
345286dafe34Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
345386dafe34Smrg	  */dev/null*)
345486dafe34Smrg	    lt_cv_path_NM="$tmp_nm -p"
345586dafe34Smrg	    break
345686dafe34Smrg	    ;;
345786dafe34Smrg	  *)
345886dafe34Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
345986dafe34Smrg	    continue # so that we can try to find one that supports BSD flags
346086dafe34Smrg	    ;;
346186dafe34Smrg	  esac
346286dafe34Smrg	  ;;
346386dafe34Smrg	esac
346486dafe34Smrg      fi
346586dafe34Smrg    done
346686dafe34Smrg    IFS="$lt_save_ifs"
346786dafe34Smrg  done
346863847c39Smrg  : ${lt_cv_path_NM=no}
346986dafe34Smrgfi])
347063847c39Smrgif test "$lt_cv_path_NM" != "no"; then
347163847c39Smrg  NM="$lt_cv_path_NM"
347263847c39Smrgelse
347363847c39Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
347463847c39Smrg  if test -n "$DUMPBIN"; then :
347563847c39Smrg    # Let the user override the test.
347663847c39Smrg  else
347763847c39Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
347863847c39Smrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
347963847c39Smrg    *COFF*)
348063847c39Smrg      DUMPBIN="$DUMPBIN -symbols"
348163847c39Smrg      ;;
348263847c39Smrg    *)
348363847c39Smrg      DUMPBIN=:
348463847c39Smrg      ;;
348563847c39Smrg    esac
348663847c39Smrg  fi
348763847c39Smrg  AC_SUBST([DUMPBIN])
348863847c39Smrg  if test "$DUMPBIN" != ":"; then
348963847c39Smrg    NM="$DUMPBIN"
349063847c39Smrg  fi
349163847c39Smrgfi
349263847c39Smrgtest -z "$NM" && NM=nm
349363847c39SmrgAC_SUBST([NM])
349463847c39Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
349563847c39Smrg
349663847c39SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
349763847c39Smrg  [lt_cv_nm_interface="BSD nm"
349863847c39Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
349963847c39Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
350063847c39Smrg  (eval "$ac_compile" 2>conftest.err)
350163847c39Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
350263847c39Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
350363847c39Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
350463847c39Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
350563847c39Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
350663847c39Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
350763847c39Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
350863847c39Smrg    lt_cv_nm_interface="MS dumpbin"
350963847c39Smrg  fi
351063847c39Smrg  rm -f conftest*])
351163847c39Smrg])# LT_PATH_NM
351263847c39Smrg
351363847c39Smrg# Old names:
351463847c39SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
351563847c39SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
351663847c39Smrgdnl aclocal-1.4 backwards compatibility:
351763847c39Smrgdnl AC_DEFUN([AM_PROG_NM], [])
351863847c39Smrgdnl AC_DEFUN([AC_PROG_NM], [])
351963847c39Smrg
352063847c39Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
352163847c39Smrg# --------------------------------
352263847c39Smrg# how to determine the name of the shared library
352363847c39Smrg# associated with a specific link library.
352463847c39Smrg#  -- PORTME fill in with the dynamic library characteristics
352563847c39Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
352663847c39Smrg[m4_require([_LT_DECL_EGREP])
352763847c39Smrgm4_require([_LT_DECL_OBJDUMP])
352863847c39Smrgm4_require([_LT_DECL_DLLTOOL])
352963847c39SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
353063847c39Smrglt_cv_sharedlib_from_linklib_cmd,
353163847c39Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
353263847c39Smrg
353363847c39Smrgcase $host_os in
353463847c39Smrgcygwin* | mingw* | pw32* | cegcc*)
353563847c39Smrg  # two different shell functions defined in ltmain.sh
353663847c39Smrg  # decide which to use based on capabilities of $DLLTOOL
353763847c39Smrg  case `$DLLTOOL --help 2>&1` in
353863847c39Smrg  *--identify-strict*)
353963847c39Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
354063847c39Smrg    ;;
354163847c39Smrg  *)
354263847c39Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
354363847c39Smrg    ;;
354463847c39Smrg  esac
354563847c39Smrg  ;;
354663847c39Smrg*)
354763847c39Smrg  # fallback: assume linklib IS sharedlib
354863847c39Smrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
354963847c39Smrg  ;;
355063847c39Smrgesac
355163847c39Smrg])
355263847c39Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
355363847c39Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
355476888252Smrg
355563847c39Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
355663847c39Smrg    [Command to associate shared and link libraries])
355763847c39Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
355876888252Smrg
355963847c39Smrg
356063847c39Smrg# _LT_PATH_MANIFEST_TOOL
356163847c39Smrg# ----------------------
356263847c39Smrg# locate the manifest tool
356363847c39Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
356463847c39Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
356563847c39Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
356663847c39SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
356763847c39Smrg  [lt_cv_path_mainfest_tool=no
356863847c39Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
356963847c39Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
357063847c39Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
357163847c39Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
357263847c39Smrg    lt_cv_path_mainfest_tool=yes
357363847c39Smrg  fi
357463847c39Smrg  rm -f conftest*])
357563847c39Smrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
357663847c39Smrg  MANIFEST_TOOL=:
357763847c39Smrgfi
357863847c39Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
357963847c39Smrg])# _LT_PATH_MANIFEST_TOOL
358063847c39Smrg
358163847c39Smrg
358263847c39Smrg# LT_LIB_M
358363847c39Smrg# --------
358486dafe34Smrg# check for math library
358563847c39SmrgAC_DEFUN([LT_LIB_M],
358686dafe34Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
358786dafe34SmrgLIBM=
358886dafe34Smrgcase $host in
358963847c39Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
359086dafe34Smrg  # These system don't have libm, or don't need it
359186dafe34Smrg  ;;
359286dafe34Smrg*-ncr-sysv4.3*)
359386dafe34Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
359486dafe34Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
359586dafe34Smrg  ;;
359686dafe34Smrg*)
359786dafe34Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
359886dafe34Smrg  ;;
359986dafe34Smrgesac
360063847c39SmrgAC_SUBST([LIBM])
360163847c39Smrg])# LT_LIB_M
360276888252Smrg
360363847c39Smrg# Old name:
360463847c39SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
360563847c39Smrgdnl aclocal-1.4 backwards compatibility:
360663847c39Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
360786dafe34Smrg
360886dafe34Smrg
360963847c39Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
361063847c39Smrg# -------------------------------
361163847c39Smrgm4_defun([_LT_COMPILER_NO_RTTI],
361263847c39Smrg[m4_require([_LT_TAG_COMPILER])dnl
36131ae1b5e8Smrg
361463847c39Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
36151ae1b5e8Smrg
361663847c39Smrgif test "$GCC" = yes; then
361763847c39Smrg  case $cc_basename in
361863847c39Smrg  nvcc*)
361963847c39Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
362063847c39Smrg  *)
362163847c39Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
362263847c39Smrg  esac
362376888252Smrg
362463847c39Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
362563847c39Smrg    lt_cv_prog_compiler_rtti_exceptions,
362663847c39Smrg    [-fno-rtti -fno-exceptions], [],
362763847c39Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3628d8556812Smrgfi
362963847c39Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
363063847c39Smrg	[Compiler flag to turn off builtin functions])
363163847c39Smrg])# _LT_COMPILER_NO_RTTI
3632d8556812Smrg
3633d8556812Smrg
363463847c39Smrg# _LT_CMD_GLOBAL_SYMBOLS
363563847c39Smrg# ----------------------
363663847c39Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
363763847c39Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
363863847c39SmrgAC_REQUIRE([AC_PROG_CC])dnl
363963847c39SmrgAC_REQUIRE([AC_PROG_AWK])dnl
364063847c39SmrgAC_REQUIRE([LT_PATH_NM])dnl
364163847c39SmrgAC_REQUIRE([LT_PATH_LD])dnl
364263847c39Smrgm4_require([_LT_DECL_SED])dnl
364363847c39Smrgm4_require([_LT_DECL_EGREP])dnl
364463847c39Smrgm4_require([_LT_TAG_COMPILER])dnl
3645d8556812Smrg
364663847c39Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
364763847c39SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
364863847c39SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
364963847c39Smrg[
365063847c39Smrg# These are sane defaults that work on at least a few old systems.
365163847c39Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3652d8556812Smrg
365363847c39Smrg# Character class describing NM global symbol codes.
365463847c39Smrgsymcode='[[BCDEGRST]]'
3655d8556812Smrg
365663847c39Smrg# Regexp to match symbols that can be accessed directly from C.
365763847c39Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3658d8556812Smrg
365963847c39Smrg# Define system-specific variables.
3660d8556812Smrgcase $host_os in
366163847c39Smrgaix*)
366263847c39Smrg  symcode='[[BCDT]]'
3663d8556812Smrg  ;;
366463847c39Smrgcygwin* | mingw* | pw32* | cegcc*)
366563847c39Smrg  symcode='[[ABCDGISTW]]'
366663847c39Smrg  ;;
366763847c39Smrghpux*)
366863847c39Smrg  if test "$host_cpu" = ia64; then
366963847c39Smrg    symcode='[[ABCDEGRST]]'
3670d8556812Smrg  fi
367163847c39Smrg  ;;
367263847c39Smrgirix* | nonstopux*)
367363847c39Smrg  symcode='[[BCDEGRST]]'
367463847c39Smrg  ;;
367563847c39Smrgosf*)
367663847c39Smrg  symcode='[[BCDEGQRST]]'
367763847c39Smrg  ;;
367863847c39Smrgsolaris*)
367963847c39Smrg  symcode='[[BDRT]]'
368063847c39Smrg  ;;
368163847c39Smrgsco3.2v5*)
368263847c39Smrg  symcode='[[DT]]'
368363847c39Smrg  ;;
368463847c39Smrgsysv4.2uw2*)
368563847c39Smrg  symcode='[[DT]]'
368663847c39Smrg  ;;
368763847c39Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
368863847c39Smrg  symcode='[[ABDT]]'
368963847c39Smrg  ;;
369063847c39Smrgsysv4)
369163847c39Smrg  symcode='[[DFNSTU]]'
369263847c39Smrg  ;;
3693d8556812Smrgesac
3694d8556812Smrg
369563847c39Smrg# If we're using GNU nm, then use its standard symbol codes.
369663847c39Smrgcase `$NM -V 2>&1` in
369763847c39Smrg*GNU* | *'with BFD'*)
369863847c39Smrg  symcode='[[ABCDGIRSTW]]' ;;
369963847c39Smrgesac
3700d8556812Smrg
370163847c39Smrg# Transform an extracted symbol line into a proper C declaration.
370263847c39Smrg# Some systems (esp. on ia64) link data and code symbols differently,
370363847c39Smrg# so use this general approach.
370463847c39Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3705d8556812Smrg
370663847c39Smrg# Transform an extracted symbol line into symbol name and symbol address
370763847c39Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
370863847c39Smrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
3709d8556812Smrg
371063847c39Smrg# Handle CRLF in mingw tool chain
371163847c39Smrgopt_cr=
371263847c39Smrgcase $build_os in
371363847c39Smrgmingw*)
371463847c39Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
371563847c39Smrg  ;;
371663847c39Smrgesac
3717d8556812Smrg
371863847c39Smrg# Try without a prefix underscore, then with it.
371963847c39Smrgfor ac_symprfx in "" "_"; do
3720d8556812Smrg
372163847c39Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
372263847c39Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
3723d8556812Smrg
372463847c39Smrg  # Write the raw and C identifiers.
372563847c39Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
372663847c39Smrg    # Fake it for dumpbin and say T for any non-static function
372763847c39Smrg    # and D for any global variable.
372863847c39Smrg    # Also find C++ and __fastcall symbols from MSVC++,
372963847c39Smrg    # which start with @ or ?.
373063847c39Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
373163847c39Smrg"     {last_section=section; section=\$ 3};"\
373263847c39Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
373363847c39Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
373463847c39Smrg"     \$ 0!~/External *\|/{next};"\
373563847c39Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
373663847c39Smrg"     {if(hide[section]) next};"\
373763847c39Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
373863847c39Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
373963847c39Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
374063847c39Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
374163847c39Smrg"     ' prfx=^$ac_symprfx]"
374286dafe34Smrg  else
374363847c39Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
37441ae1b5e8Smrg  fi
374563847c39Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
374676888252Smrg
374763847c39Smrg  # Check to see that the pipe works correctly.
374863847c39Smrg  pipe_works=no
3749d8556812Smrg
375063847c39Smrg  rm -f conftest*
375163847c39Smrg  cat > conftest.$ac_ext <<_LT_EOF
375263847c39Smrg#ifdef __cplusplus
375363847c39Smrgextern "C" {
375463847c39Smrg#endif
375563847c39Smrgchar nm_test_var;
375663847c39Smrgvoid nm_test_func(void);
375763847c39Smrgvoid nm_test_func(void){}
375863847c39Smrg#ifdef __cplusplus
375963847c39Smrg}
376063847c39Smrg#endif
376163847c39Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
376263847c39Smrg_LT_EOF
376376888252Smrg
376463847c39Smrg  if AC_TRY_EVAL(ac_compile); then
376563847c39Smrg    # Now try to grab the symbols.
376663847c39Smrg    nlist=conftest.nm
376763847c39Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
376863847c39Smrg      # Try sorting and uniquifying the output.
376963847c39Smrg      if sort "$nlist" | uniq > "$nlist"T; then
377063847c39Smrg	mv -f "$nlist"T "$nlist"
377163847c39Smrg      else
377263847c39Smrg	rm -f "$nlist"T
377363847c39Smrg      fi
377463847c39Smrg
377563847c39Smrg      # Make sure that we snagged all the symbols we need.
377663847c39Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
377763847c39Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
377863847c39Smrg	  cat <<_LT_EOF > conftest.$ac_ext
377963847c39Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
378063847c39Smrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
378163847c39Smrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
378263847c39Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
378363847c39Smrg# define LT@&t@_DLSYM_CONST
378463847c39Smrg#elif defined(__osf__)
378563847c39Smrg/* This system does not cope well with relocations in const data.  */
378663847c39Smrg# define LT@&t@_DLSYM_CONST
378763847c39Smrg#else
378863847c39Smrg# define LT@&t@_DLSYM_CONST const
378963847c39Smrg#endif
379076888252Smrg
379163847c39Smrg#ifdef __cplusplus
379263847c39Smrgextern "C" {
379363847c39Smrg#endif
379476888252Smrg
379563847c39Smrg_LT_EOF
379663847c39Smrg	  # Now generate the symbol file.
379763847c39Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
379876888252Smrg
379963847c39Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
380076888252Smrg
380163847c39Smrg/* The mapping between symbol names and symbols.  */
380263847c39SmrgLT@&t@_DLSYM_CONST struct {
380363847c39Smrg  const char *name;
380463847c39Smrg  void       *address;
380563847c39Smrg}
380663847c39Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
380763847c39Smrg{
380863847c39Smrg  { "@PROGRAM@", (void *) 0 },
380963847c39Smrg_LT_EOF
381063847c39Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
381163847c39Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
381263847c39Smrg  {0, (void *) 0}
381363847c39Smrg};
381463847c39Smrg
381563847c39Smrg/* This works around a problem in FreeBSD linker */
381663847c39Smrg#ifdef FREEBSD_WORKAROUND
381763847c39Smrgstatic const void *lt_preloaded_setup() {
381863847c39Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
381963847c39Smrg}
382063847c39Smrg#endif
382163847c39Smrg
382263847c39Smrg#ifdef __cplusplus
382363847c39Smrg}
382463847c39Smrg#endif
382563847c39Smrg_LT_EOF
382663847c39Smrg	  # Now try linking the two files.
382763847c39Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
382863847c39Smrg	  lt_globsym_save_LIBS=$LIBS
382963847c39Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
383063847c39Smrg	  LIBS="conftstm.$ac_objext"
383163847c39Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
383263847c39Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
383363847c39Smrg	    pipe_works=yes
383463847c39Smrg	  fi
383563847c39Smrg	  LIBS=$lt_globsym_save_LIBS
383663847c39Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
3837d8556812Smrg	else
383863847c39Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3839d8556812Smrg	fi
3840d8556812Smrg      else
384163847c39Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3842d8556812Smrg      fi
384363847c39Smrg    else
384463847c39Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3845d8556812Smrg    fi
384663847c39Smrg  else
384763847c39Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
384863847c39Smrg    cat conftest.$ac_ext >&5
384963847c39Smrg  fi
385063847c39Smrg  rm -rf conftest* conftst*
3851d8556812Smrg
385263847c39Smrg  # Do not use the global_symbol_pipe unless it works.
385363847c39Smrg  if test "$pipe_works" = yes; then
385463847c39Smrg    break
385563847c39Smrg  else
385663847c39Smrg    lt_cv_sys_global_symbol_pipe=
385763847c39Smrg  fi
385863847c39Smrgdone
385963847c39Smrg])
386063847c39Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
386163847c39Smrg  lt_cv_sys_global_symbol_to_cdecl=
386263847c39Smrgfi
386363847c39Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
386463847c39Smrg  AC_MSG_RESULT(failed)
386563847c39Smrgelse
386663847c39Smrg  AC_MSG_RESULT(ok)
386763847c39Smrgfi
3868d8556812Smrg
386963847c39Smrg# Response file support.
387063847c39Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
387163847c39Smrg  nm_file_list_spec='@'
387263847c39Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
387363847c39Smrg  nm_file_list_spec='@'
387463847c39Smrgfi
3875d8556812Smrg
387663847c39Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
387763847c39Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
387863847c39Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
387963847c39Smrg    [Transform the output of nm in a proper C declaration])
388063847c39Smrg_LT_DECL([global_symbol_to_c_name_address],
388163847c39Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
388263847c39Smrg    [Transform the output of nm in a C name address pair])
388363847c39Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
388463847c39Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
388563847c39Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
388663847c39Smrg_LT_DECL([], [nm_file_list_spec], [1],
388763847c39Smrg    [Specify filename containing input files for $NM])
388863847c39Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
388963847c39Smrg
389063847c39Smrg
389163847c39Smrg# _LT_COMPILER_PIC([TAGNAME])
389263847c39Smrg# ---------------------------
389363847c39Smrgm4_defun([_LT_COMPILER_PIC],
389463847c39Smrg[m4_require([_LT_TAG_COMPILER])dnl
389563847c39Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
389663847c39Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
389763847c39Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
3898d8556812Smrg
389963847c39Smrgm4_if([$1], [CXX], [
390063847c39Smrg  # C++ specific cases for pic, static, wl, etc.
390163847c39Smrg  if test "$GXX" = yes; then
390263847c39Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
390363847c39Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
390463847c39Smrg
390563847c39Smrg    case $host_os in
390663847c39Smrg    aix*)
390763847c39Smrg      # All AIX code is PIC.
390863847c39Smrg      if test "$host_cpu" = ia64; then
390963847c39Smrg	# AIX 5 now supports IA64 processor
391063847c39Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3911d8556812Smrg      fi
391263847c39Smrg      ;;
3913d8556812Smrg
391463847c39Smrg    amigaos*)
391563847c39Smrg      case $host_cpu in
391663847c39Smrg      powerpc)
391763847c39Smrg            # see comment about AmigaOS4 .so support
391863847c39Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
391963847c39Smrg        ;;
392063847c39Smrg      m68k)
392163847c39Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
392263847c39Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
392363847c39Smrg            # like `-m68040'.
392463847c39Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
392563847c39Smrg        ;;
392663847c39Smrg      esac
392763847c39Smrg      ;;
3928d8556812Smrg
392963847c39Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
393063847c39Smrg      # PIC is the default for these OSes.
3931d8556812Smrg      ;;
393263847c39Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
393363847c39Smrg      # This hack is so that the source file can tell whether it is being
393463847c39Smrg      # built for inclusion in a dll (and should export symbols for example).
393563847c39Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
393663847c39Smrg      # (--disable-auto-import) libraries
393763847c39Smrg      m4_if([$1], [GCJ], [],
393863847c39Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3939d8556812Smrg      ;;
394063847c39Smrg    darwin* | rhapsody*)
394163847c39Smrg      # PIC is the default on this platform
394263847c39Smrg      # Common symbols not allowed in MH_DYLIB files
394363847c39Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
394463847c39Smrg      ;;
394563847c39Smrg    *djgpp*)
394663847c39Smrg      # DJGPP does not support shared libraries at all
394763847c39Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
394863847c39Smrg      ;;
394963847c39Smrg    haiku*)
395063847c39Smrg      # PIC is the default for Haiku.
395163847c39Smrg      # The "-static" flag exists, but is broken.
395263847c39Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
395363847c39Smrg      ;;
395463847c39Smrg    interix[[3-9]]*)
395563847c39Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
395663847c39Smrg      # Instead, we relocate shared libraries at runtime.
395763847c39Smrg      ;;
395863847c39Smrg    sysv4*MP*)
395963847c39Smrg      if test -d /usr/nec; then
396063847c39Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
396186dafe34Smrg      fi
396286dafe34Smrg      ;;
396363847c39Smrg    hpux*)
396463847c39Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
396563847c39Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
396663847c39Smrg      # sets the default TLS model and affects inlining.
396786dafe34Smrg      case $host_cpu in
396863847c39Smrg      hppa*64*)
396963847c39Smrg	;;
3970d8556812Smrg      *)
397163847c39Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
397263847c39Smrg	;;
397386dafe34Smrg      esac
397463847c39Smrg      ;;
397563847c39Smrg    *qnx* | *nto*)
397663847c39Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
397763847c39Smrg      # it will coredump.
397863847c39Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3979d8556812Smrg      ;;
3980d8556812Smrg    *)
398163847c39Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
398286dafe34Smrg      ;;
3983d8556812Smrg    esac
398463847c39Smrg  else
398563847c39Smrg    case $host_os in
398663847c39Smrg      aix[[4-9]]*)
398763847c39Smrg	# All AIX code is PIC.
398863847c39Smrg	if test "$host_cpu" = ia64; then
398963847c39Smrg	  # AIX 5 now supports IA64 processor
399063847c39Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3991d8556812Smrg	else
399263847c39Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3993d8556812Smrg	fi
399486dafe34Smrg	;;
399563847c39Smrg      chorus*)
399663847c39Smrg	case $cc_basename in
399763847c39Smrg	cxch68*)
399863847c39Smrg	  # Green Hills C++ Compiler
399963847c39Smrg	  # _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"
400063847c39Smrg	  ;;
400163847c39Smrg	esac
400286dafe34Smrg	;;
400363847c39Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
400463847c39Smrg	# This hack is so that the source file can tell whether it is being
400563847c39Smrg	# built for inclusion in a dll (and should export symbols for example).
400663847c39Smrg	m4_if([$1], [GCJ], [],
400763847c39Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
400886dafe34Smrg	;;
400963847c39Smrg      dgux*)
401063847c39Smrg	case $cc_basename in
401163847c39Smrg	  ec++*)
401263847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
401363847c39Smrg	    ;;
401463847c39Smrg	  ghcx*)
401563847c39Smrg	    # Green Hills C++ Compiler
401663847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
401763847c39Smrg	    ;;
401863847c39Smrg	  *)
401963847c39Smrg	    ;;
402063847c39Smrg	esac
4021d8556812Smrg	;;
402263847c39Smrg      freebsd* | dragonfly*)
402363847c39Smrg	# FreeBSD uses GNU C++
4024d8556812Smrg	;;
402563847c39Smrg      hpux9* | hpux10* | hpux11*)
402663847c39Smrg	case $cc_basename in
402763847c39Smrg	  CC*)
402863847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
402963847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
403063847c39Smrg	    if test "$host_cpu" != ia64; then
403163847c39Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
403263847c39Smrg	    fi
403363847c39Smrg	    ;;
403463847c39Smrg	  aCC*)
403563847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
403663847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
403763847c39Smrg	    case $host_cpu in
403863847c39Smrg	    hppa*64*|ia64*)
403963847c39Smrg	      # +Z the default
404063847c39Smrg	      ;;
404163847c39Smrg	    *)
404263847c39Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
404363847c39Smrg	      ;;
404463847c39Smrg	    esac
404563847c39Smrg	    ;;
404663847c39Smrg	  *)
404763847c39Smrg	    ;;
404863847c39Smrg	esac
4049d8556812Smrg	;;
405063847c39Smrg      interix*)
405163847c39Smrg	# This is c89, which is MS Visual C++ (no shared libs)
405263847c39Smrg	# Anyone wants to do a port?
4053d8556812Smrg	;;
405463847c39Smrg      irix5* | irix6* | nonstopux*)
405563847c39Smrg	case $cc_basename in
405663847c39Smrg	  CC*)
405763847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
405863847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
405963847c39Smrg	    # CC pic flag -KPIC is the default.
406063847c39Smrg	    ;;
406186dafe34Smrg	  *)
406286dafe34Smrg	    ;;
406386dafe34Smrg	esac
406486dafe34Smrg	;;
40659586ba5aSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
406663847c39Smrg	case $cc_basename in
406763847c39Smrg	  KCC*)
406863847c39Smrg	    # KAI C++ Compiler
406963847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
407063847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
407163847c39Smrg	    ;;
407263847c39Smrg	  ecpc* )
407363847c39Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
407463847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
407563847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
407663847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
407763847c39Smrg	    ;;
407863847c39Smrg	  icpc* )
407963847c39Smrg	    # Intel C++, used to be incompatible with GCC.
408063847c39Smrg	    # ICC 10 doesn't accept -KPIC any more.
408163847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
408263847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
408363847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
408463847c39Smrg	    ;;
408563847c39Smrg	  pgCC* | pgcpp*)
408663847c39Smrg	    # Portland Group C++ compiler
408763847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
408863847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
408963847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
409063847c39Smrg	    ;;
409163847c39Smrg	  cxx*)
409263847c39Smrg	    # Compaq C++
409363847c39Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
409463847c39Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
409563847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
409663847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
409763847c39Smrg	    ;;
409863847c39Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
409963847c39Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
410063847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
410163847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
410263847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
410363847c39Smrg	    ;;
4104d8556812Smrg	  *)
410563847c39Smrg	    case `$CC -V 2>&1 | sed 5q` in
410663847c39Smrg	    *Sun\ C*)
410763847c39Smrg	      # Sun C++ 5.9
410863847c39Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
410963847c39Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
411063847c39Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
411163847c39Smrg	      ;;
411263847c39Smrg	    esac
4113d8556812Smrg	    ;;
411463847c39Smrg	esac
4115d8556812Smrg	;;
411663847c39Smrg      lynxos*)
411786dafe34Smrg	;;
411863847c39Smrg      m88k*)
411986dafe34Smrg	;;
412063847c39Smrg      mvs*)
412163847c39Smrg	case $cc_basename in
412263847c39Smrg	  cxx*)
412363847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
412463847c39Smrg	    ;;
412563847c39Smrg	  *)
412663847c39Smrg	    ;;
412763847c39Smrg	esac
412886dafe34Smrg	;;
412963847c39Smrg      netbsd* | netbsdelf*-gnu)
413086dafe34Smrg	;;
413163847c39Smrg      *qnx* | *nto*)
413263847c39Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
413363847c39Smrg        # it will coredump.
413463847c39Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
413563847c39Smrg        ;;
413663847c39Smrg      osf3* | osf4* | osf5*)
413763847c39Smrg	case $cc_basename in
413863847c39Smrg	  KCC*)
413963847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
414063847c39Smrg	    ;;
414163847c39Smrg	  RCC*)
414263847c39Smrg	    # Rational C++ 2.4.1
414363847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
414463847c39Smrg	    ;;
414563847c39Smrg	  cxx*)
414663847c39Smrg	    # Digital/Compaq C++
414763847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
414863847c39Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
414963847c39Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
415063847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
415163847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
415263847c39Smrg	    ;;
415363847c39Smrg	  *)
415463847c39Smrg	    ;;
415563847c39Smrg	esac
415686dafe34Smrg	;;
415763847c39Smrg      psos*)
415863847c39Smrg	;;
415963847c39Smrg      solaris*)
416063847c39Smrg	case $cc_basename in
416163847c39Smrg	  CC* | sunCC*)
416263847c39Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
416363847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
416463847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
416563847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
416663847c39Smrg	    ;;
416763847c39Smrg	  gcx*)
416863847c39Smrg	    # Green Hills C++ Compiler
416963847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
417063847c39Smrg	    ;;
417163847c39Smrg	  *)
417263847c39Smrg	    ;;
417363847c39Smrg	esac
417463847c39Smrg	;;
417563847c39Smrg      sunos4*)
417663847c39Smrg	case $cc_basename in
417763847c39Smrg	  CC*)
417863847c39Smrg	    # Sun C++ 4.x
417963847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
418063847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
418163847c39Smrg	    ;;
418263847c39Smrg	  lcc*)
418363847c39Smrg	    # Lucid
418463847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
418563847c39Smrg	    ;;
418663847c39Smrg	  *)
418763847c39Smrg	    ;;
418863847c39Smrg	esac
418963847c39Smrg	;;
419063847c39Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
419163847c39Smrg	case $cc_basename in
419263847c39Smrg	  CC*)
419363847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
419463847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
419563847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
419663847c39Smrg	    ;;
419763847c39Smrg	esac
419863847c39Smrg	;;
419963847c39Smrg      tandem*)
420063847c39Smrg	case $cc_basename in
420163847c39Smrg	  NCC*)
420263847c39Smrg	    # NonStop-UX NCC 3.20
420363847c39Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
420463847c39Smrg	    ;;
420563847c39Smrg	  *)
420663847c39Smrg	    ;;
420763847c39Smrg	esac
420863847c39Smrg	;;
420963847c39Smrg      vxworks*)
421063847c39Smrg	;;
421163847c39Smrg      *)
421263847c39Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
421386dafe34Smrg	;;
4214d8556812Smrg    esac
421563847c39Smrg  fi
421663847c39Smrg],
421763847c39Smrg[
421863847c39Smrg  if test "$GCC" = yes; then
421963847c39Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
422063847c39Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4221d8556812Smrg
422263847c39Smrg    case $host_os in
422363847c39Smrg      aix*)
422463847c39Smrg      # All AIX code is PIC.
422563847c39Smrg      if test "$host_cpu" = ia64; then
422663847c39Smrg	# AIX 5 now supports IA64 processor
422763847c39Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
422863847c39Smrg      fi
4229d8556812Smrg      ;;
423076888252Smrg
423163847c39Smrg    amigaos*)
423263847c39Smrg      case $host_cpu in
423363847c39Smrg      powerpc)
423463847c39Smrg            # see comment about AmigaOS4 .so support
423563847c39Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
423663847c39Smrg        ;;
423763847c39Smrg      m68k)
423863847c39Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
423963847c39Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
424063847c39Smrg            # like `-m68040'.
424163847c39Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
424263847c39Smrg        ;;
424363847c39Smrg      esac
4244d8556812Smrg      ;;
424576888252Smrg
424663847c39Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
424763847c39Smrg      # PIC is the default for these OSes.
424863847c39Smrg      ;;
424976888252Smrg
425063847c39Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
425163847c39Smrg      # This hack is so that the source file can tell whether it is being
425263847c39Smrg      # built for inclusion in a dll (and should export symbols for example).
425363847c39Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
425463847c39Smrg      # (--disable-auto-import) libraries
425563847c39Smrg      m4_if([$1], [GCJ], [],
425663847c39Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
425763847c39Smrg      ;;
425876888252Smrg
425963847c39Smrg    darwin* | rhapsody*)
426063847c39Smrg      # PIC is the default on this platform
426163847c39Smrg      # Common symbols not allowed in MH_DYLIB files
426263847c39Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
426363847c39Smrg      ;;
426476888252Smrg
426563847c39Smrg    haiku*)
426663847c39Smrg      # PIC is the default for Haiku.
426763847c39Smrg      # The "-static" flag exists, but is broken.
426863847c39Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
426963847c39Smrg      ;;
427076888252Smrg
427163847c39Smrg    hpux*)
427263847c39Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
427363847c39Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
427463847c39Smrg      # sets the default TLS model and affects inlining.
427563847c39Smrg      case $host_cpu in
427663847c39Smrg      hppa*64*)
427763847c39Smrg	# +Z the default
427863847c39Smrg	;;
427963847c39Smrg      *)
428063847c39Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
428163847c39Smrg	;;
428263847c39Smrg      esac
428363847c39Smrg      ;;
428476888252Smrg
428563847c39Smrg    interix[[3-9]]*)
428663847c39Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
428763847c39Smrg      # Instead, we relocate shared libraries at runtime.
428863847c39Smrg      ;;
428976888252Smrg
429063847c39Smrg    msdosdjgpp*)
429163847c39Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
429263847c39Smrg      # on systems that don't support them.
429363847c39Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
429463847c39Smrg      enable_shared=no
429563847c39Smrg      ;;
429676888252Smrg
429763847c39Smrg    *nto* | *qnx*)
429863847c39Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
429963847c39Smrg      # it will coredump.
430063847c39Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
430163847c39Smrg      ;;
430276888252Smrg
430363847c39Smrg    sysv4*MP*)
430463847c39Smrg      if test -d /usr/nec; then
430563847c39Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
430663847c39Smrg      fi
430763847c39Smrg      ;;
430876888252Smrg
430963847c39Smrg    *)
431063847c39Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
431163847c39Smrg      ;;
431263847c39Smrg    esac
431376888252Smrg
431463847c39Smrg    case $cc_basename in
431563847c39Smrg    nvcc*) # Cuda Compiler Driver 2.2
431663847c39Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
431763847c39Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
431863847c39Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
431963847c39Smrg      fi
432063847c39Smrg      ;;
432163847c39Smrg    esac
432263847c39Smrg  else
432363847c39Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
432463847c39Smrg    case $host_os in
432563847c39Smrg    aix*)
432663847c39Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
432763847c39Smrg      if test "$host_cpu" = ia64; then
432863847c39Smrg	# AIX 5 now supports IA64 processor
432963847c39Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
433063847c39Smrg      else
433163847c39Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
433263847c39Smrg      fi
433363847c39Smrg      ;;
433476888252Smrg
433563847c39Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
433663847c39Smrg      # This hack is so that the source file can tell whether it is being
433763847c39Smrg      # built for inclusion in a dll (and should export symbols for example).
433863847c39Smrg      m4_if([$1], [GCJ], [],
433963847c39Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
434063847c39Smrg      ;;
434176888252Smrg
434263847c39Smrg    hpux9* | hpux10* | hpux11*)
434363847c39Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
434463847c39Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
434563847c39Smrg      # not for PA HP-UX.
434663847c39Smrg      case $host_cpu in
434763847c39Smrg      hppa*64*|ia64*)
434863847c39Smrg	# +Z the default
434963847c39Smrg	;;
435063847c39Smrg      *)
435163847c39Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
435263847c39Smrg	;;
435363847c39Smrg      esac
435463847c39Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
435563847c39Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
435663847c39Smrg      ;;
435776888252Smrg
435863847c39Smrg    irix5* | irix6* | nonstopux*)
435963847c39Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
436063847c39Smrg      # PIC (with -KPIC) is the default.
436163847c39Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
436263847c39Smrg      ;;
436376888252Smrg
43649586ba5aSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
436563847c39Smrg      case $cc_basename in
436663847c39Smrg      # old Intel for x86_64 which still supported -KPIC.
436763847c39Smrg      ecc*)
436863847c39Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
436963847c39Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
437063847c39Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
437163847c39Smrg        ;;
437263847c39Smrg      # icc used to be incompatible with GCC.
437363847c39Smrg      # ICC 10 doesn't accept -KPIC any more.
437463847c39Smrg      icc* | ifort*)
437563847c39Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
437663847c39Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
437763847c39Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
437863847c39Smrg        ;;
437963847c39Smrg      # Lahey Fortran 8.1.
438063847c39Smrg      lf95*)
438163847c39Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
438263847c39Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
438363847c39Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
438463847c39Smrg	;;
438563847c39Smrg      nagfor*)
438663847c39Smrg	# NAG Fortran compiler
438763847c39Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
438863847c39Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
438963847c39Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
439063847c39Smrg	;;
439163847c39Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
439263847c39Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
439363847c39Smrg	# which looks to be a dead project)
439463847c39Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
439563847c39Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
439663847c39Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
439763847c39Smrg        ;;
439863847c39Smrg      ccc*)
439963847c39Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
440063847c39Smrg        # All Alpha code is PIC.
440163847c39Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
440263847c39Smrg        ;;
440363847c39Smrg      xl* | bgxl* | bgf* | mpixl*)
440463847c39Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
440563847c39Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
440663847c39Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
440763847c39Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
440863847c39Smrg	;;
440963847c39Smrg      *)
441063847c39Smrg	case `$CC -V 2>&1 | sed 5q` in
441163847c39Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
441263847c39Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
441363847c39Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
441463847c39Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
441563847c39Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
441663847c39Smrg	  ;;
441763847c39Smrg	*Sun\ F* | *Sun*Fortran*)
441863847c39Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
441963847c39Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
442063847c39Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
442163847c39Smrg	  ;;
442263847c39Smrg	*Sun\ C*)
442363847c39Smrg	  # Sun C 5.9
442463847c39Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
442563847c39Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
442663847c39Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
442763847c39Smrg	  ;;
442863847c39Smrg        *Intel*\ [[CF]]*Compiler*)
442963847c39Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
443063847c39Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
443163847c39Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
443263847c39Smrg	  ;;
443363847c39Smrg	*Portland\ Group*)
443463847c39Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
443563847c39Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
443663847c39Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
443763847c39Smrg	  ;;
443863847c39Smrg	esac
443963847c39Smrg	;;
444063847c39Smrg      esac
444163847c39Smrg      ;;
444276888252Smrg
444363847c39Smrg    newsos6)
444463847c39Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
444563847c39Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
444663847c39Smrg      ;;
444776888252Smrg
444863847c39Smrg    *nto* | *qnx*)
444963847c39Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
445063847c39Smrg      # it will coredump.
445163847c39Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
445263847c39Smrg      ;;
445376888252Smrg
445463847c39Smrg    osf3* | osf4* | osf5*)
445563847c39Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
445663847c39Smrg      # All OSF/1 code is PIC.
445763847c39Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
445863847c39Smrg      ;;
445976888252Smrg
446063847c39Smrg    rdos*)
446163847c39Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
446263847c39Smrg      ;;
446376888252Smrg
446463847c39Smrg    solaris*)
446563847c39Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
446663847c39Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
446763847c39Smrg      case $cc_basename in
446863847c39Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
446963847c39Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
447063847c39Smrg      *)
447163847c39Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
447263847c39Smrg      esac
447363847c39Smrg      ;;
447476888252Smrg
447563847c39Smrg    sunos4*)
447663847c39Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
447763847c39Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
447863847c39Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
447963847c39Smrg      ;;
448076888252Smrg
448163847c39Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
448263847c39Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
448363847c39Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
448463847c39Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
448563847c39Smrg      ;;
448676888252Smrg
448763847c39Smrg    sysv4*MP*)
448863847c39Smrg      if test -d /usr/nec ;then
448963847c39Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
449063847c39Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
449163847c39Smrg      fi
449263847c39Smrg      ;;
449376888252Smrg
449463847c39Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
449563847c39Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
449663847c39Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
449763847c39Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
449863847c39Smrg      ;;
449976888252Smrg
450063847c39Smrg    unicos*)
450163847c39Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
450263847c39Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
450363847c39Smrg      ;;
450476888252Smrg
450563847c39Smrg    uts4*)
450663847c39Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
450763847c39Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
450886dafe34Smrg      ;;
450963847c39Smrg
4510d8556812Smrg    *)
451163847c39Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
451286dafe34Smrg      ;;
4513d8556812Smrg    esac
451463847c39Smrg  fi
451563847c39Smrg])
451663847c39Smrgcase $host_os in
451763847c39Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
451863847c39Smrg  *djgpp*)
451963847c39Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4520d8556812Smrg    ;;
452163847c39Smrg  *)
452263847c39Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
452363847c39Smrg    ;;
452463847c39Smrgesac
452576888252Smrg
452663847c39SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
452763847c39Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
452863847c39Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
452963847c39Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
453076888252Smrg
4531d8556812Smrg#
453263847c39Smrg# Check to make sure the PIC flag actually works.
4533d8556812Smrg#
453463847c39Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
453563847c39Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
453663847c39Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
453763847c39Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
453863847c39Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
453963847c39Smrg     "" | " "*) ;;
454063847c39Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
454163847c39Smrg     esac],
454263847c39Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
454363847c39Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
454463847c39Smrgfi
454563847c39Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
454663847c39Smrg	[Additional compiler flags for building library objects])
454763847c39Smrg
454863847c39Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
454963847c39Smrg	[How to pass a linker flag through the compiler])
4550d8556812Smrg#
455163847c39Smrg# Check to make sure the static flag actually works.
4552d8556812Smrg#
455363847c39Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
455463847c39Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
455563847c39Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
455663847c39Smrg  $lt_tmp_static_flag,
455763847c39Smrg  [],
455863847c39Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
455963847c39Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
456063847c39Smrg	[Compiler flag to prevent dynamic linking])
456163847c39Smrg])# _LT_COMPILER_PIC
456276888252Smrg
456376888252Smrg
456463847c39Smrg# _LT_LINKER_SHLIBS([TAGNAME])
456563847c39Smrg# ----------------------------
456663847c39Smrg# See if the linker supports building shared libraries.
456763847c39Smrgm4_defun([_LT_LINKER_SHLIBS],
456863847c39Smrg[AC_REQUIRE([LT_PATH_LD])dnl
456963847c39SmrgAC_REQUIRE([LT_PATH_NM])dnl
457063847c39Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
457163847c39Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
457263847c39Smrgm4_require([_LT_DECL_EGREP])dnl
457363847c39Smrgm4_require([_LT_DECL_SED])dnl
457463847c39Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
457563847c39Smrgm4_require([_LT_TAG_COMPILER])dnl
457663847c39SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
457763847c39Smrgm4_if([$1], [CXX], [
457863847c39Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
457963847c39Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
458063847c39Smrg  case $host_os in
458163847c39Smrg  aix[[4-9]]*)
458263847c39Smrg    # If we're using GNU nm, then we don't want the "-C" option.
458363847c39Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
458463847c39Smrg    # Also, AIX nm treats weak defined symbols like other global defined
458563847c39Smrg    # symbols, whereas GNU nm marks them as "W".
458663847c39Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
458763847c39Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
458863847c39Smrg    else
458963847c39Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
459063847c39Smrg    fi
459163847c39Smrg    ;;
459263847c39Smrg  pw32*)
459363847c39Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
459463847c39Smrg    ;;
459563847c39Smrg  cygwin* | mingw* | cegcc*)
459663847c39Smrg    case $cc_basename in
459763847c39Smrg    cl*)
459863847c39Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
459963847c39Smrg      ;;
460063847c39Smrg    *)
460163847c39Smrg      _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'
460263847c39Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
460363847c39Smrg      ;;
460463847c39Smrg    esac
460563847c39Smrg    ;;
460663847c39Smrg  linux* | k*bsd*-gnu | gnu*)
460763847c39Smrg    _LT_TAGVAR(link_all_deplibs, $1)=no
460863847c39Smrg    ;;
460963847c39Smrg  *)
461063847c39Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
461163847c39Smrg    ;;
461263847c39Smrg  esac
461363847c39Smrg], [
461463847c39Smrg  runpath_var=
461563847c39Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
461663847c39Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
461763847c39Smrg  _LT_TAGVAR(archive_cmds, $1)=
461863847c39Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
461963847c39Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
462063847c39Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
462163847c39Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
462263847c39Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
462363847c39Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
462463847c39Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
462563847c39Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
462663847c39Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
462763847c39Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
462863847c39Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
462963847c39Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
463063847c39Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
463163847c39Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
463263847c39Smrg  _LT_TAGVAR(module_cmds, $1)=
463363847c39Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
463463847c39Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
463563847c39Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
463663847c39Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
463763847c39Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
463863847c39Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
463963847c39Smrg  # included in the symbol list
464063847c39Smrg  _LT_TAGVAR(include_expsyms, $1)=
464163847c39Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
464263847c39Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
464363847c39Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
464463847c39Smrg  # as well as any symbol that contains `d'.
464563847c39Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
464663847c39Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
464763847c39Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
464863847c39Smrg  # the symbol is explicitly referenced.  Since portable code cannot
464963847c39Smrg  # rely on this symbol name, it's probably fine to never include it in
465063847c39Smrg  # preloaded symbol tables.
465163847c39Smrg  # Exclude shared library initialization/finalization symbols.
465263847c39Smrgdnl Note also adjust exclude_expsyms for C++ above.
465363847c39Smrg  extract_expsyms_cmds=
465486dafe34Smrg
465563847c39Smrg  case $host_os in
465663847c39Smrg  cygwin* | mingw* | pw32* | cegcc*)
465763847c39Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
465863847c39Smrg    # When not using gcc, we currently assume that we are using
465963847c39Smrg    # Microsoft Visual C++.
466063847c39Smrg    if test "$GCC" != yes; then
466163847c39Smrg      with_gnu_ld=no
466263847c39Smrg    fi
466363847c39Smrg    ;;
466463847c39Smrg  interix*)
466563847c39Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
466663847c39Smrg    with_gnu_ld=yes
466763847c39Smrg    ;;
466863847c39Smrg  openbsd*)
466963847c39Smrg    with_gnu_ld=no
467063847c39Smrg    ;;
467163847c39Smrg  linux* | k*bsd*-gnu | gnu*)
467263847c39Smrg    _LT_TAGVAR(link_all_deplibs, $1)=no
467363847c39Smrg    ;;
467463847c39Smrg  esac
467576888252Smrg
467663847c39Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
467786dafe34Smrg
467863847c39Smrg  # On some targets, GNU ld is compatible enough with the native linker
467963847c39Smrg  # that we're better off using the native interface for both.
468063847c39Smrg  lt_use_gnu_ld_interface=no
468163847c39Smrg  if test "$with_gnu_ld" = yes; then
468263847c39Smrg    case $host_os in
468363847c39Smrg      aix*)
468463847c39Smrg	# The AIX port of GNU ld has always aspired to compatibility
468563847c39Smrg	# with the native linker.  However, as the warning in the GNU ld
468663847c39Smrg	# block says, versions before 2.19.5* couldn't really create working
468763847c39Smrg	# shared libraries, regardless of the interface used.
468863847c39Smrg	case `$LD -v 2>&1` in
468963847c39Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
469063847c39Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
469163847c39Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
469263847c39Smrg	  *)
469363847c39Smrg	    lt_use_gnu_ld_interface=yes
469463847c39Smrg	    ;;
469563847c39Smrg	esac
469663847c39Smrg	;;
469763847c39Smrg      *)
469863847c39Smrg	lt_use_gnu_ld_interface=yes
469963847c39Smrg	;;
470063847c39Smrg    esac
470163847c39Smrg  fi
470286dafe34Smrg
470363847c39Smrg  if test "$lt_use_gnu_ld_interface" = yes; then
470463847c39Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
470563847c39Smrg    wlarc='${wl}'
470686dafe34Smrg
470763847c39Smrg    # Set some defaults for GNU ld with shared library support. These
470863847c39Smrg    # are reset later if shared libraries are not supported. Putting them
470963847c39Smrg    # here allows them to be overridden if necessary.
471063847c39Smrg    runpath_var=LD_RUN_PATH
471163847c39Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
471263847c39Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
471363847c39Smrg    # ancient GNU ld didn't support --whole-archive et. al.
471463847c39Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
471563847c39Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
471663847c39Smrg    else
471763847c39Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
471863847c39Smrg    fi
471963847c39Smrg    supports_anon_versioning=no
472063847c39Smrg    case `$LD -v 2>&1` in
472163847c39Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
472263847c39Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
472363847c39Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
472463847c39Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
472563847c39Smrg      *\ 2.11.*) ;; # other 2.11 versions
472663847c39Smrg      *) supports_anon_versioning=yes ;;
472763847c39Smrg    esac
472886dafe34Smrg
472963847c39Smrg    # See if GNU ld supports shared libraries.
473063847c39Smrg    case $host_os in
473163847c39Smrg    aix[[3-9]]*)
473263847c39Smrg      # On AIX/PPC, the GNU linker is very broken
473363847c39Smrg      if test "$host_cpu" != ia64; then
473463847c39Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
473563847c39Smrg	cat <<_LT_EOF 1>&2
473686dafe34Smrg
473763847c39Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
473863847c39Smrg*** to be unable to reliably create shared libraries on AIX.
473963847c39Smrg*** Therefore, libtool is disabling shared libraries support.  If you
474063847c39Smrg*** really care for shared libraries, you may want to install binutils
474163847c39Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
474263847c39Smrg*** You will then need to restart the configuration process.
474386dafe34Smrg
474463847c39Smrg_LT_EOF
474563847c39Smrg      fi
474663847c39Smrg      ;;
474786dafe34Smrg
474863847c39Smrg    amigaos*)
474963847c39Smrg      case $host_cpu in
475063847c39Smrg      powerpc)
475163847c39Smrg            # see comment about AmigaOS4 .so support
475263847c39Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
475363847c39Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
475463847c39Smrg        ;;
475563847c39Smrg      m68k)
475663847c39Smrg            _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)'
475763847c39Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
475863847c39Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
475963847c39Smrg        ;;
476063847c39Smrg      esac
476163847c39Smrg      ;;
476286dafe34Smrg
476363847c39Smrg    beos*)
476463847c39Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
476563847c39Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
476663847c39Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
476763847c39Smrg	# support --undefined.  This deserves some investigation.  FIXME
476863847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
476963847c39Smrg      else
477063847c39Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
477163847c39Smrg      fi
477263847c39Smrg      ;;
477386dafe34Smrg
477463847c39Smrg    cygwin* | mingw* | pw32* | cegcc*)
477563847c39Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
477663847c39Smrg      # as there is no search path for DLLs.
477763847c39Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
477863847c39Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
477963847c39Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
478063847c39Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
478163847c39Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
478263847c39Smrg      _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'
478363847c39Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
478463847c39Smrg
478563847c39Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
478663847c39Smrg        _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'
478763847c39Smrg	# If the export-symbols file already is a .def file (1st line
478863847c39Smrg	# is EXPORTS), use it as is; otherwise, prepend...
478963847c39Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
479063847c39Smrg	  cp $export_symbols $output_objdir/$soname.def;
479163847c39Smrg	else
479263847c39Smrg	  echo EXPORTS > $output_objdir/$soname.def;
479363847c39Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
479463847c39Smrg	fi~
479563847c39Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
479663847c39Smrg      else
479763847c39Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
479863847c39Smrg      fi
479963847c39Smrg      ;;
480086dafe34Smrg
480163847c39Smrg    haiku*)
480263847c39Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
480363847c39Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
480463847c39Smrg      ;;
480586dafe34Smrg
480663847c39Smrg    interix[[3-9]]*)
480763847c39Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
480863847c39Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
480963847c39Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
481063847c39Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
481163847c39Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
481263847c39Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
481363847c39Smrg      # default) and relocated if they conflict, which is a slow very memory
481463847c39Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
481563847c39Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
481663847c39Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
481763847c39Smrg      _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'
481863847c39Smrg      _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'
481963847c39Smrg      ;;
482086dafe34Smrg
482163847c39Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
482263847c39Smrg      tmp_diet=no
482363847c39Smrg      if test "$host_os" = linux-dietlibc; then
482463847c39Smrg	case $cc_basename in
482563847c39Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
482663847c39Smrg	esac
482763847c39Smrg      fi
482863847c39Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
482963847c39Smrg	 && test "$tmp_diet" = no
483063847c39Smrg      then
483163847c39Smrg	tmp_addflag=' $pic_flag'
483263847c39Smrg	tmp_sharedflag='-shared'
483363847c39Smrg	case $cc_basename,$host_cpu in
483463847c39Smrg        pgcc*)				# Portland Group C compiler
483563847c39Smrg	  _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'
483663847c39Smrg	  tmp_addflag=' $pic_flag'
483763847c39Smrg	  ;;
483863847c39Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
483963847c39Smrg					# Portland Group f77 and f90 compilers
484063847c39Smrg	  _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'
484163847c39Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
484263847c39Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
484363847c39Smrg	  tmp_addflag=' -i_dynamic' ;;
484463847c39Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
484563847c39Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
484663847c39Smrg	ifc* | ifort*)			# Intel Fortran compiler
484763847c39Smrg	  tmp_addflag=' -nofor_main' ;;
484863847c39Smrg	lf95*)				# Lahey Fortran 8.1
484963847c39Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
485063847c39Smrg	  tmp_sharedflag='--shared' ;;
485163847c39Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
485263847c39Smrg	  tmp_sharedflag='-qmkshrobj'
485363847c39Smrg	  tmp_addflag= ;;
485463847c39Smrg	nvcc*)	# Cuda Compiler Driver 2.2
485563847c39Smrg	  _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'
485663847c39Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
485763847c39Smrg	  ;;
485863847c39Smrg	esac
485963847c39Smrg	case `$CC -V 2>&1 | sed 5q` in
486063847c39Smrg	*Sun\ C*)			# Sun C 5.9
486163847c39Smrg	  _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'
486263847c39Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
486363847c39Smrg	  tmp_sharedflag='-G' ;;
486463847c39Smrg	*Sun\ F*)			# Sun Fortran 8.3
486563847c39Smrg	  tmp_sharedflag='-G' ;;
486663847c39Smrg	esac
486763847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
486886dafe34Smrg
486963847c39Smrg        if test "x$supports_anon_versioning" = xyes; then
487063847c39Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
487163847c39Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
487263847c39Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
487363847c39Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
487463847c39Smrg        fi
487586dafe34Smrg
487663847c39Smrg	case $cc_basename in
487763847c39Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
487863847c39Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
487963847c39Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
488063847c39Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
488163847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
488263847c39Smrg	  if test "x$supports_anon_versioning" = xyes; then
488363847c39Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
488463847c39Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
488563847c39Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
488663847c39Smrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
488763847c39Smrg	  fi
488863847c39Smrg	  ;;
488963847c39Smrg	esac
489063847c39Smrg      else
489163847c39Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
489263847c39Smrg      fi
489363847c39Smrg      ;;
489486dafe34Smrg
489563847c39Smrg    netbsd* | netbsdelf*-gnu)
489663847c39Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
489763847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
489863847c39Smrg	wlarc=
489963847c39Smrg      else
490063847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
490163847c39Smrg	_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'
490263847c39Smrg      fi
490363847c39Smrg      ;;
490486dafe34Smrg
490563847c39Smrg    solaris*)
490663847c39Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
490763847c39Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
490863847c39Smrg	cat <<_LT_EOF 1>&2
490986dafe34Smrg
491063847c39Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
491163847c39Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
491263847c39Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
491363847c39Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
491463847c39Smrg*** your PATH or compiler configuration so that the native linker is
491563847c39Smrg*** used, and then restart.
491686dafe34Smrg
491763847c39Smrg_LT_EOF
491863847c39Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
491963847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
492063847c39Smrg	_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'
492163847c39Smrg      else
492263847c39Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
492363847c39Smrg      fi
492463847c39Smrg      ;;
492586dafe34Smrg
492663847c39Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
492763847c39Smrg      case `$LD -v 2>&1` in
492863847c39Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
492963847c39Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
493063847c39Smrg	cat <<_LT_EOF 1>&2
493186dafe34Smrg
493263847c39Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
493363847c39Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
493463847c39Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
493563847c39Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
493663847c39Smrg*** your PATH or compiler configuration so that the native linker is
493763847c39Smrg*** used, and then restart.
493886dafe34Smrg
493963847c39Smrg_LT_EOF
494063847c39Smrg	;;
494163847c39Smrg	*)
494263847c39Smrg	  # For security reasons, it is highly recommended that you always
494363847c39Smrg	  # use absolute paths for naming shared libraries, and exclude the
494463847c39Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
494563847c39Smrg	  # requires that you compile everything twice, which is a pain.
494663847c39Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
494763847c39Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
494863847c39Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
494963847c39Smrg	    _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'
495063847c39Smrg	  else
495163847c39Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
495263847c39Smrg	  fi
495363847c39Smrg	;;
495463847c39Smrg      esac
495563847c39Smrg      ;;
495686dafe34Smrg
495763847c39Smrg    sunos4*)
495863847c39Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
495963847c39Smrg      wlarc=
496063847c39Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
496163847c39Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
496263847c39Smrg      ;;
496386dafe34Smrg
496463847c39Smrg    *)
496563847c39Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
496663847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
496763847c39Smrg	_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'
496863847c39Smrg      else
496963847c39Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
497063847c39Smrg      fi
497163847c39Smrg      ;;
497263847c39Smrg    esac
497386dafe34Smrg
497463847c39Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
497563847c39Smrg      runpath_var=
497663847c39Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
497763847c39Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
497863847c39Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
497963847c39Smrg    fi
498063847c39Smrg  else
498163847c39Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
498263847c39Smrg    case $host_os in
498363847c39Smrg    aix3*)
498463847c39Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
498563847c39Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
498663847c39Smrg      _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'
498763847c39Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
498863847c39Smrg      # are no directories specified by -L.
498963847c39Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
499063847c39Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
499163847c39Smrg	# Neither direct hardcoding nor static linking is supported with a
499263847c39Smrg	# broken collect2.
499363847c39Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
499463847c39Smrg      fi
499563847c39Smrg      ;;
499676888252Smrg
499763847c39Smrg    aix[[4-9]]*)
499863847c39Smrg      if test "$host_cpu" = ia64; then
499963847c39Smrg	# On IA64, the linker does run time linking by default, so we don't
500063847c39Smrg	# have to do anything special.
500163847c39Smrg	aix_use_runtimelinking=no
500263847c39Smrg	exp_sym_flag='-Bexport'
500363847c39Smrg	no_entry_flag=""
500463847c39Smrg      else
500563847c39Smrg	# If we're using GNU nm, then we don't want the "-C" option.
500663847c39Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
500763847c39Smrg	# Also, AIX nm treats weak defined symbols like other global
500863847c39Smrg	# defined symbols, whereas GNU nm marks them as "W".
500963847c39Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
501063847c39Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
501163847c39Smrg	else
501263847c39Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
501363847c39Smrg	fi
501463847c39Smrg	aix_use_runtimelinking=no
50151ae1b5e8Smrg
501663847c39Smrg	# Test if we are trying to use run time linking or normal
501763847c39Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
501863847c39Smrg	# need to do runtime linking.
501963847c39Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
502063847c39Smrg	  for ld_flag in $LDFLAGS; do
502163847c39Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
502263847c39Smrg	    aix_use_runtimelinking=yes
502363847c39Smrg	    break
502463847c39Smrg	  fi
502563847c39Smrg	  done
502663847c39Smrg	  ;;
502763847c39Smrg	esac
50281ae1b5e8Smrg
502963847c39Smrg	exp_sym_flag='-bexport'
503063847c39Smrg	no_entry_flag='-bnoentry'
503163847c39Smrg      fi
503286dafe34Smrg
503363847c39Smrg      # When large executables or shared objects are built, AIX ld can
503463847c39Smrg      # have problems creating the table of contents.  If linking a library
503563847c39Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
503663847c39Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
503763847c39Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
503886dafe34Smrg
503963847c39Smrg      _LT_TAGVAR(archive_cmds, $1)=''
504063847c39Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
504163847c39Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
504263847c39Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
504363847c39Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
504463847c39Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
504586dafe34Smrg
504663847c39Smrg      if test "$GCC" = yes; then
504763847c39Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
504863847c39Smrg	# We only want to do this on AIX 4.2 and lower, the check
504963847c39Smrg	# below for broken collect2 doesn't work under 4.3+
505063847c39Smrg	  collect2name=`${CC} -print-prog-name=collect2`
505163847c39Smrg	  if test -f "$collect2name" &&
505263847c39Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
505363847c39Smrg	  then
505463847c39Smrg	  # We have reworked collect2
505563847c39Smrg	  :
505663847c39Smrg	  else
505763847c39Smrg	  # We have old collect2
505863847c39Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
505963847c39Smrg	  # It fails to find uninstalled libraries when the uninstalled
506063847c39Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
506163847c39Smrg	  # to unsupported forces relinking
506263847c39Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
506363847c39Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
506463847c39Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
506563847c39Smrg	  fi
506663847c39Smrg	  ;;
506763847c39Smrg	esac
506863847c39Smrg	shared_flag='-shared'
506963847c39Smrg	if test "$aix_use_runtimelinking" = yes; then
507063847c39Smrg	  shared_flag="$shared_flag "'${wl}-G'
507163847c39Smrg	fi
507263847c39Smrg	_LT_TAGVAR(link_all_deplibs, $1)=no
507363847c39Smrg      else
507463847c39Smrg	# not using gcc
507563847c39Smrg	if test "$host_cpu" = ia64; then
507663847c39Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
507763847c39Smrg	# chokes on -Wl,-G. The following line is correct:
507863847c39Smrg	  shared_flag='-G'
507963847c39Smrg	else
508063847c39Smrg	  if test "$aix_use_runtimelinking" = yes; then
508163847c39Smrg	    shared_flag='${wl}-G'
508263847c39Smrg	  else
508363847c39Smrg	    shared_flag='${wl}-bM:SRE'
508463847c39Smrg	  fi
508563847c39Smrg	fi
508663847c39Smrg      fi
508786dafe34Smrg
508863847c39Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
508963847c39Smrg      # It seems that -bexpall does not export symbols beginning with
509063847c39Smrg      # underscore (_), so it is better to generate a list of symbols to export.
509163847c39Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
509263847c39Smrg      if test "$aix_use_runtimelinking" = yes; then
509363847c39Smrg	# Warning - without using the other runtime loading flags (-brtl),
509463847c39Smrg	# -berok will link without error, but may produce a broken library.
509563847c39Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
509663847c39Smrg        # Determine the default libpath from the value encoded in an
509763847c39Smrg        # empty executable.
509863847c39Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
509963847c39Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
510063847c39Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
510163847c39Smrg      else
510263847c39Smrg	if test "$host_cpu" = ia64; then
510363847c39Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
510463847c39Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
510563847c39Smrg	  _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"
510663847c39Smrg	else
510763847c39Smrg	 # Determine the default libpath from the value encoded in an
510863847c39Smrg	 # empty executable.
510963847c39Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
511063847c39Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
511163847c39Smrg	  # Warning - without using the other run time loading flags,
511263847c39Smrg	  # -berok will link without error, but may produce a broken library.
511363847c39Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
511463847c39Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
511563847c39Smrg	  if test "$with_gnu_ld" = yes; then
511663847c39Smrg	    # We only use this code for GNU lds that support --whole-archive.
511763847c39Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
511863847c39Smrg	  else
511963847c39Smrg	    # Exported symbols can be pulled into shared objects from archives
512063847c39Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
512163847c39Smrg	  fi
512263847c39Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
512363847c39Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
512463847c39Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
512563847c39Smrg	fi
512663847c39Smrg      fi
512763847c39Smrg      ;;
512886dafe34Smrg
512963847c39Smrg    amigaos*)
513063847c39Smrg      case $host_cpu in
513163847c39Smrg      powerpc)
513263847c39Smrg            # see comment about AmigaOS4 .so support
513363847c39Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
513463847c39Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
513563847c39Smrg        ;;
513663847c39Smrg      m68k)
513763847c39Smrg            _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)'
513863847c39Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
513963847c39Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
514063847c39Smrg        ;;
514163847c39Smrg      esac
514263847c39Smrg      ;;
51431ae1b5e8Smrg
514463847c39Smrg    bsdi[[45]]*)
514563847c39Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
514663847c39Smrg      ;;
51471ae1b5e8Smrg
514863847c39Smrg    cygwin* | mingw* | pw32* | cegcc*)
514963847c39Smrg      # When not using gcc, we currently assume that we are using
515063847c39Smrg      # Microsoft Visual C++.
515163847c39Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
515263847c39Smrg      # no search path for DLLs.
515363847c39Smrg      case $cc_basename in
515463847c39Smrg      cl*)
515563847c39Smrg	# Native MSVC
515663847c39Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
515763847c39Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
515863847c39Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
515963847c39Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
516063847c39Smrg	# Tell ltmain to make .lib files, not .a files.
516163847c39Smrg	libext=lib
516263847c39Smrg	# Tell ltmain to make .dll files, not .so files.
516363847c39Smrg	shrext_cmds=".dll"
516463847c39Smrg	# FIXME: Setting linknames here is a bad hack.
516563847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
516663847c39Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
516763847c39Smrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
516863847c39Smrg	  else
516963847c39Smrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
517063847c39Smrg	  fi~
517163847c39Smrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
517263847c39Smrg	  linknames='
517363847c39Smrg	# The linker will not automatically build a static lib if we build a DLL.
517463847c39Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
517563847c39Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
517663847c39Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
517763847c39Smrg	_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'
517863847c39Smrg	# Don't use ranlib
517963847c39Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
518063847c39Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
518163847c39Smrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
518263847c39Smrg	  case $lt_outputfile in
518363847c39Smrg	    *.exe|*.EXE) ;;
518463847c39Smrg	    *)
518563847c39Smrg	      lt_outputfile="$lt_outputfile.exe"
518663847c39Smrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
518763847c39Smrg	      ;;
518863847c39Smrg	  esac~
518963847c39Smrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
519063847c39Smrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
519163847c39Smrg	    $RM "$lt_outputfile.manifest";
519263847c39Smrg	  fi'
519363847c39Smrg	;;
519463847c39Smrg      *)
519563847c39Smrg	# Assume MSVC wrapper
519663847c39Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
519763847c39Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
519863847c39Smrg	# Tell ltmain to make .lib files, not .a files.
519963847c39Smrg	libext=lib
520063847c39Smrg	# Tell ltmain to make .dll files, not .so files.
520163847c39Smrg	shrext_cmds=".dll"
520263847c39Smrg	# FIXME: Setting linknames here is a bad hack.
520363847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
520463847c39Smrg	# The linker will automatically build a .lib file if we build a DLL.
520563847c39Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
520663847c39Smrg	# FIXME: Should let the user specify the lib program.
520763847c39Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
520863847c39Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
520963847c39Smrg	;;
521063847c39Smrg      esac
521163847c39Smrg      ;;
52121ae1b5e8Smrg
521363847c39Smrg    darwin* | rhapsody*)
521463847c39Smrg      _LT_DARWIN_LINKER_FEATURES($1)
521563847c39Smrg      ;;
52161ae1b5e8Smrg
521763847c39Smrg    dgux*)
521863847c39Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
521963847c39Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
522063847c39Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
522163847c39Smrg      ;;
52221ae1b5e8Smrg
522363847c39Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
522463847c39Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
522563847c39Smrg    # does not break anything, and helps significantly (at the cost of a little
522663847c39Smrg    # extra space).
522763847c39Smrg    freebsd2.2*)
522863847c39Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
522963847c39Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
523063847c39Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
523163847c39Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
523263847c39Smrg      ;;
52331ae1b5e8Smrg
523463847c39Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
523563847c39Smrg    freebsd2.*)
523663847c39Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
523763847c39Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
523863847c39Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
523963847c39Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
524063847c39Smrg      ;;
52411ae1b5e8Smrg
524263847c39Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
524363847c39Smrg    freebsd* | dragonfly*)
524463847c39Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
524563847c39Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
524663847c39Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
524763847c39Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
524863847c39Smrg      ;;
524986dafe34Smrg
525063847c39Smrg    hpux9*)
525163847c39Smrg      if test "$GCC" = yes; then
525263847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
525363847c39Smrg      else
525463847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
525563847c39Smrg      fi
525663847c39Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
525763847c39Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
525863847c39Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52591ae1b5e8Smrg
526063847c39Smrg      # hardcode_minus_L: Not really in the search PATH,
526163847c39Smrg      # but as the default location of the library.
526263847c39Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
526363847c39Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
526463847c39Smrg      ;;
52651ae1b5e8Smrg
526663847c39Smrg    hpux10*)
526763847c39Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
526863847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
526963847c39Smrg      else
527063847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
527163847c39Smrg      fi
527263847c39Smrg      if test "$with_gnu_ld" = no; then
527363847c39Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
527463847c39Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
527563847c39Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
527663847c39Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
527763847c39Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
527863847c39Smrg	# hardcode_minus_L: Not really in the search PATH,
527963847c39Smrg	# but as the default location of the library.
528063847c39Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
528163847c39Smrg      fi
528263847c39Smrg      ;;
528386dafe34Smrg
528463847c39Smrg    hpux11*)
528563847c39Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
528663847c39Smrg	case $host_cpu in
528763847c39Smrg	hppa*64*)
528863847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
528963847c39Smrg	  ;;
529063847c39Smrg	ia64*)
529163847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
529263847c39Smrg	  ;;
529363847c39Smrg	*)
529463847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
529563847c39Smrg	  ;;
529663847c39Smrg	esac
529763847c39Smrg      else
529863847c39Smrg	case $host_cpu in
529963847c39Smrg	hppa*64*)
530063847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
530163847c39Smrg	  ;;
530263847c39Smrg	ia64*)
530363847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
530463847c39Smrg	  ;;
530563847c39Smrg	*)
530663847c39Smrg	m4_if($1, [], [
530763847c39Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
530863847c39Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
530963847c39Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
531063847c39Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
531163847c39Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
531263847c39Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
531363847c39Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
531463847c39Smrg	  ;;
531563847c39Smrg	esac
531663847c39Smrg      fi
531763847c39Smrg      if test "$with_gnu_ld" = no; then
531863847c39Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
531963847c39Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
532086dafe34Smrg
532163847c39Smrg	case $host_cpu in
532263847c39Smrg	hppa*64*|ia64*)
532363847c39Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
532463847c39Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
532563847c39Smrg	  ;;
532663847c39Smrg	*)
532763847c39Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
532863847c39Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
532963847c39Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
533086dafe34Smrg
533163847c39Smrg	  # hardcode_minus_L: Not really in the search PATH,
533263847c39Smrg	  # but as the default location of the library.
533363847c39Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
533463847c39Smrg	  ;;
533563847c39Smrg	esac
533663847c39Smrg      fi
533763847c39Smrg      ;;
533886dafe34Smrg
533963847c39Smrg    irix5* | irix6* | nonstopux*)
534063847c39Smrg      if test "$GCC" = yes; then
534163847c39Smrg	_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'
534263847c39Smrg	# Try to use the -exported_symbol ld option, if it does not
534363847c39Smrg	# work, assume that -exports_file does not work either and
534463847c39Smrg	# implicitly export all symbols.
534563847c39Smrg	# This should be the same for all languages, so no per-tag cache variable.
534663847c39Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
534763847c39Smrg	  [lt_cv_irix_exported_symbol],
534863847c39Smrg	  [save_LDFLAGS="$LDFLAGS"
534963847c39Smrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
535063847c39Smrg	   AC_LINK_IFELSE(
535163847c39Smrg	     [AC_LANG_SOURCE(
535263847c39Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
535363847c39Smrg			      [C++], [[int foo (void) { return 0; }]],
535463847c39Smrg			      [Fortran 77], [[
535563847c39Smrg      subroutine foo
535663847c39Smrg      end]],
535763847c39Smrg			      [Fortran], [[
535863847c39Smrg      subroutine foo
535963847c39Smrg      end]])])],
536063847c39Smrg	      [lt_cv_irix_exported_symbol=yes],
536163847c39Smrg	      [lt_cv_irix_exported_symbol=no])
536263847c39Smrg           LDFLAGS="$save_LDFLAGS"])
536363847c39Smrg	if test "$lt_cv_irix_exported_symbol" = yes; then
536463847c39Smrg          _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'
536563847c39Smrg	fi
536663847c39Smrg      else
536763847c39Smrg	_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'
536863847c39Smrg	_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'
536963847c39Smrg      fi
537063847c39Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
537163847c39Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
537263847c39Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
537363847c39Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
537463847c39Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
537563847c39Smrg      ;;
537686dafe34Smrg
537763847c39Smrg    netbsd* | netbsdelf*-gnu)
537863847c39Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
537963847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
538063847c39Smrg      else
538163847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
538263847c39Smrg      fi
538363847c39Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
538463847c39Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
538563847c39Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
538663847c39Smrg      ;;
538786dafe34Smrg
538863847c39Smrg    newsos6)
538963847c39Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
539063847c39Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
539163847c39Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
539263847c39Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
539363847c39Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
539463847c39Smrg      ;;
539586dafe34Smrg
539663847c39Smrg    *nto* | *qnx*)
539763847c39Smrg      ;;
539886dafe34Smrg
539963847c39Smrg    openbsd*)
540063847c39Smrg      if test -f /usr/libexec/ld.so; then
540163847c39Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
540263847c39Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
540363847c39Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
540463847c39Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
540563847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
540663847c39Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
540763847c39Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
540863847c39Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
540963847c39Smrg	else
541063847c39Smrg	  case $host_os in
541163847c39Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
541263847c39Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
541363847c39Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
541463847c39Smrg	     ;;
541563847c39Smrg	   *)
541663847c39Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
541763847c39Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
541863847c39Smrg	     ;;
541963847c39Smrg	  esac
542063847c39Smrg	fi
542163847c39Smrg      else
542263847c39Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
542363847c39Smrg      fi
542463847c39Smrg      ;;
54251ae1b5e8Smrg
542663847c39Smrg    os2*)
542763847c39Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
542863847c39Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
542963847c39Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
543063847c39Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
543163847c39Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
543263847c39Smrg      ;;
543386dafe34Smrg
543463847c39Smrg    osf3*)
543563847c39Smrg      if test "$GCC" = yes; then
543663847c39Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
543763847c39Smrg	_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'
543863847c39Smrg      else
543963847c39Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
544063847c39Smrg	_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'
544163847c39Smrg      fi
544263847c39Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
544363847c39Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
544463847c39Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
544563847c39Smrg      ;;
544686dafe34Smrg
544763847c39Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
544863847c39Smrg      if test "$GCC" = yes; then
544963847c39Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
545063847c39Smrg	_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'
545163847c39Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
545263847c39Smrg      else
545363847c39Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
545463847c39Smrg	_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'
545563847c39Smrg	_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~
545663847c39Smrg	$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'
545786dafe34Smrg
545863847c39Smrg	# Both c and cxx compiler support -rpath directly
545963847c39Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
546063847c39Smrg      fi
546163847c39Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
546263847c39Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
546363847c39Smrg      ;;
546486dafe34Smrg
546563847c39Smrg    solaris*)
546663847c39Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
546763847c39Smrg      if test "$GCC" = yes; then
546863847c39Smrg	wlarc='${wl}'
546963847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
547063847c39Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
547163847c39Smrg	  $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'
547263847c39Smrg      else
547363847c39Smrg	case `$CC -V 2>&1` in
547463847c39Smrg	*"Compilers 5.0"*)
547563847c39Smrg	  wlarc=''
547663847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
547763847c39Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
547863847c39Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
547963847c39Smrg	  ;;
548063847c39Smrg	*)
548163847c39Smrg	  wlarc='${wl}'
548263847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
548363847c39Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
548463847c39Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
548563847c39Smrg	  ;;
548663847c39Smrg	esac
548763847c39Smrg      fi
548863847c39Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
548963847c39Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
549063847c39Smrg      case $host_os in
549163847c39Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
549263847c39Smrg      *)
549363847c39Smrg	# The compiler driver will combine and reorder linker options,
549463847c39Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
549563847c39Smrg	# but is careful enough not to reorder.
549663847c39Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
549763847c39Smrg	if test "$GCC" = yes; then
549863847c39Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
549963847c39Smrg	else
550063847c39Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
550163847c39Smrg	fi
550263847c39Smrg	;;
550363847c39Smrg      esac
550463847c39Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
550563847c39Smrg      ;;
550686dafe34Smrg
550763847c39Smrg    sunos4*)
550863847c39Smrg      if test "x$host_vendor" = xsequent; then
550963847c39Smrg	# Use $CC to link under sequent, because it throws in some extra .o
551063847c39Smrg	# files that make .init and .fini sections work.
551163847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
551263847c39Smrg      else
551363847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
551463847c39Smrg      fi
551563847c39Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
551663847c39Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
551763847c39Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
551863847c39Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
551963847c39Smrg      ;;
552086dafe34Smrg
552163847c39Smrg    sysv4)
552263847c39Smrg      case $host_vendor in
552363847c39Smrg	sni)
552463847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
552563847c39Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
552663847c39Smrg	;;
552763847c39Smrg	siemens)
552863847c39Smrg	  ## LD is ld it makes a PLAMLIB
552963847c39Smrg	  ## CC just makes a GrossModule.
553063847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
553163847c39Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
553263847c39Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
553363847c39Smrg        ;;
553463847c39Smrg	motorola)
553563847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
553663847c39Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
553763847c39Smrg	;;
553863847c39Smrg      esac
553963847c39Smrg      runpath_var='LD_RUN_PATH'
554063847c39Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
554163847c39Smrg      ;;
554286dafe34Smrg
554363847c39Smrg    sysv4.3*)
554463847c39Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
554563847c39Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
554663847c39Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
554763847c39Smrg      ;;
554886dafe34Smrg
554963847c39Smrg    sysv4*MP*)
555063847c39Smrg      if test -d /usr/nec; then
555163847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
555263847c39Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
555363847c39Smrg	runpath_var=LD_RUN_PATH
555463847c39Smrg	hardcode_runpath_var=yes
555563847c39Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
555663847c39Smrg      fi
555763847c39Smrg      ;;
555886dafe34Smrg
555963847c39Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
556063847c39Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
556163847c39Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
556263847c39Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
556363847c39Smrg      runpath_var='LD_RUN_PATH'
556486dafe34Smrg
556563847c39Smrg      if test "$GCC" = yes; then
556663847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
556763847c39Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
556863847c39Smrg      else
556963847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
557063847c39Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
557163847c39Smrg      fi
557263847c39Smrg      ;;
557386dafe34Smrg
557463847c39Smrg    sysv5* | sco3.2v5* | sco5v6*)
557563847c39Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
557663847c39Smrg      # link with -lc, and that would cause any symbols used from libc to
557763847c39Smrg      # always be unresolved, which means just about no library would
557863847c39Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
557963847c39Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
558063847c39Smrg      # as -z defs.
558163847c39Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
558263847c39Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
558363847c39Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
558463847c39Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
558563847c39Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
558663847c39Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
558763847c39Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
558863847c39Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
558963847c39Smrg      runpath_var='LD_RUN_PATH'
559086dafe34Smrg
559163847c39Smrg      if test "$GCC" = yes; then
559263847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
559363847c39Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
559463847c39Smrg      else
559563847c39Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
559663847c39Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
559763847c39Smrg      fi
559863847c39Smrg      ;;
559986dafe34Smrg
560063847c39Smrg    uts4*)
560163847c39Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
560263847c39Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
560363847c39Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
560463847c39Smrg      ;;
560586dafe34Smrg
560663847c39Smrg    *)
560763847c39Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
560863847c39Smrg      ;;
560963847c39Smrg    esac
561086dafe34Smrg
561163847c39Smrg    if test x$host_vendor = xsni; then
561263847c39Smrg      case $host in
561363847c39Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
561463847c39Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
561563847c39Smrg	;;
561663847c39Smrg      esac
561763847c39Smrg    fi
561863847c39Smrg  fi
561963847c39Smrg])
562063847c39SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
562163847c39Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
56221ae1b5e8Smrg
562363847c39Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
56241ae1b5e8Smrg
562563847c39Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
562663847c39Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
562763847c39Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
562863847c39Smrg    [The commands to extract the exported symbol list from a shared archive])
56291ae1b5e8Smrg
563063847c39Smrg#
563163847c39Smrg# Do we need to explicitly link libc?
563263847c39Smrg#
563363847c39Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
563463847c39Smrgx|xyes)
563563847c39Smrg  # Assume -lc should be added
563663847c39Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
563786dafe34Smrg
563863847c39Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
563963847c39Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
564063847c39Smrg    *'~'*)
564163847c39Smrg      # FIXME: we may have to deal with multi-command sequences.
564263847c39Smrg      ;;
564363847c39Smrg    '$CC '*)
564463847c39Smrg      # Test whether the compiler implicitly links with -lc since on some
564563847c39Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
564663847c39Smrg      # to ld, don't add -lc before -lgcc.
564763847c39Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
564863847c39Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
564963847c39Smrg	[$RM conftest*
565063847c39Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
565163847c39Smrg
565263847c39Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
565363847c39Smrg	  soname=conftest
565463847c39Smrg	  lib=conftest
565563847c39Smrg	  libobjs=conftest.$ac_objext
565663847c39Smrg	  deplibs=
565763847c39Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
565863847c39Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
565963847c39Smrg	  compiler_flags=-v
566063847c39Smrg	  linker_flags=-v
566163847c39Smrg	  verstring=
566263847c39Smrg	  output_objdir=.
566363847c39Smrg	  libname=conftest
566463847c39Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
566563847c39Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
566663847c39Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
566763847c39Smrg	  then
566863847c39Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
566963847c39Smrg	  else
567063847c39Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
567163847c39Smrg	  fi
567263847c39Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
567363847c39Smrg	else
567463847c39Smrg	  cat conftest.err 1>&5
567563847c39Smrg	fi
567663847c39Smrg	$RM conftest*
567763847c39Smrg	])
567863847c39Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
567963847c39Smrg      ;;
568063847c39Smrg    esac
568163847c39Smrg  fi
568263847c39Smrg  ;;
568363847c39Smrgesac
568486dafe34Smrg
568563847c39Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
568663847c39Smrg    [Whether or not to add -lc for building shared libraries])
568763847c39Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
568863847c39Smrg    [enable_shared_with_static_runtimes], [0],
568963847c39Smrg    [Whether or not to disallow shared libs when runtime libs are static])
569063847c39Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
569163847c39Smrg    [Compiler flag to allow reflexive dlopens])
569263847c39Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
569363847c39Smrg    [Compiler flag to generate shared objects directly from archives])
569463847c39Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
569563847c39Smrg    [Whether the compiler copes with passing no objects directly])
569663847c39Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
569763847c39Smrg    [Create an old-style archive from a shared archive])
569863847c39Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
569963847c39Smrg    [Create a temporary old-style archive to link instead of a shared archive])
570063847c39Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
570163847c39Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
570263847c39Smrg_LT_TAGDECL([], [module_cmds], [2],
570363847c39Smrg    [Commands used to build a loadable module if different from building
570463847c39Smrg    a shared archive.])
570563847c39Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
570663847c39Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
570763847c39Smrg    [Whether we are building with GNU ld or not])
570863847c39Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
570963847c39Smrg    [Flag that allows shared libraries with undefined symbols to be built])
571063847c39Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
571163847c39Smrg    [Flag that enforces no undefined symbols])
571263847c39Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
571363847c39Smrg    [Flag to hardcode $libdir into a binary during linking.
571463847c39Smrg    This must work even if $libdir does not exist])
571563847c39Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
571663847c39Smrg    [Whether we need a single "-rpath" flag with a separated argument])
571763847c39Smrg_LT_TAGDECL([], [hardcode_direct], [0],
571863847c39Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
571963847c39Smrg    DIR into the resulting binary])
572063847c39Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
572163847c39Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
572263847c39Smrg    DIR into the resulting binary and the resulting library dependency is
572363847c39Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
572463847c39Smrg    library is relocated])
572563847c39Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
572663847c39Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
572763847c39Smrg    into the resulting binary])
572863847c39Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
572963847c39Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
573063847c39Smrg    into the resulting binary])
573163847c39Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
573263847c39Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
573363847c39Smrg    into the library and all subsequent libraries and executables linked
573463847c39Smrg    against it])
573563847c39Smrg_LT_TAGDECL([], [inherit_rpath], [0],
573663847c39Smrg    [Set to yes if linker adds runtime paths of dependent libraries
573763847c39Smrg    to runtime path list])
573863847c39Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
573963847c39Smrg    [Whether libtool must link a program against all its dependency libraries])
574063847c39Smrg_LT_TAGDECL([], [always_export_symbols], [0],
574163847c39Smrg    [Set to "yes" if exported symbols are required])
574263847c39Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
574363847c39Smrg    [The commands to list exported symbols])
574463847c39Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
574563847c39Smrg    [Symbols that should not be listed in the preloaded symbols])
574663847c39Smrg_LT_TAGDECL([], [include_expsyms], [1],
574763847c39Smrg    [Symbols that must always be exported])
574863847c39Smrg_LT_TAGDECL([], [prelink_cmds], [2],
574963847c39Smrg    [Commands necessary for linking programs (against libraries) with templates])
575063847c39Smrg_LT_TAGDECL([], [postlink_cmds], [2],
575163847c39Smrg    [Commands necessary for finishing linking programs])
575263847c39Smrg_LT_TAGDECL([], [file_list_spec], [1],
575363847c39Smrg    [Specify filename containing input files])
575463847c39Smrgdnl FIXME: Not yet implemented
575563847c39Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
575663847c39Smrgdnl    [Compiler flag to generate thread safe objects])
575763847c39Smrg])# _LT_LINKER_SHLIBS
575863847c39Smrg
575963847c39Smrg
576063847c39Smrg# _LT_LANG_C_CONFIG([TAG])
576163847c39Smrg# ------------------------
576263847c39Smrg# Ensure that the configuration variables for a C compiler are suitably
576363847c39Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
576463847c39Smrg# the compiler configuration to `libtool'.
576563847c39Smrgm4_defun([_LT_LANG_C_CONFIG],
576663847c39Smrg[m4_require([_LT_DECL_EGREP])dnl
576763847c39Smrglt_save_CC="$CC"
576863847c39SmrgAC_LANG_PUSH(C)
576986dafe34Smrg
577063847c39Smrg# Source file extension for C test sources.
577163847c39Smrgac_ext=c
57721ae1b5e8Smrg
577363847c39Smrg# Object file extension for compiled C test sources.
577463847c39Smrgobjext=o
577563847c39Smrg_LT_TAGVAR(objext, $1)=$objext
57761ae1b5e8Smrg
577763847c39Smrg# Code to be used in simple compile tests
577863847c39Smrglt_simple_compile_test_code="int some_variable = 0;"
57791ae1b5e8Smrg
578063847c39Smrg# Code to be used in simple link tests
578163847c39Smrglt_simple_link_test_code='int main(){return(0);}'
57821ae1b5e8Smrg
578363847c39Smrg_LT_TAG_COMPILER
578463847c39Smrg# Save the default compiler, since it gets overwritten when the other
578563847c39Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
578663847c39Smrgcompiler_DEFAULT=$CC
57871ae1b5e8Smrg
578863847c39Smrg# save warnings/boilerplate of simple test code
578963847c39Smrg_LT_COMPILER_BOILERPLATE
579063847c39Smrg_LT_LINKER_BOILERPLATE
57911ae1b5e8Smrg
579263847c39Smrgif test -n "$compiler"; then
579363847c39Smrg  _LT_COMPILER_NO_RTTI($1)
579463847c39Smrg  _LT_COMPILER_PIC($1)
579563847c39Smrg  _LT_COMPILER_C_O($1)
579663847c39Smrg  _LT_COMPILER_FILE_LOCKS($1)
579763847c39Smrg  _LT_LINKER_SHLIBS($1)
579863847c39Smrg  _LT_SYS_DYNAMIC_LINKER($1)
579963847c39Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
580063847c39Smrg  LT_SYS_DLOPEN_SELF
580163847c39Smrg  _LT_CMD_STRIPLIB
580263847c39Smrg
580363847c39Smrg  # Report which library types will actually be built
580463847c39Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
580563847c39Smrg  AC_MSG_RESULT([$can_build_shared])
580663847c39Smrg
580763847c39Smrg  AC_MSG_CHECKING([whether to build shared libraries])
580863847c39Smrg  test "$can_build_shared" = "no" && enable_shared=no
580963847c39Smrg
581063847c39Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
581163847c39Smrg  # are all built from PIC.
5812d8556812Smrg  case $host_os in
5813d8556812Smrg  aix3*)
581463847c39Smrg    test "$enable_shared" = yes && enable_static=no
581563847c39Smrg    if test -n "$RANLIB"; then
581663847c39Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
581763847c39Smrg      postinstall_cmds='$RANLIB $lib'
581863847c39Smrg    fi
581963847c39Smrg    ;;
58201ae1b5e8Smrg
582163847c39Smrg  aix[[4-9]]*)
582263847c39Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
582363847c39Smrg      test "$enable_shared" = yes && enable_static=no
582463847c39Smrg    fi
5825d8556812Smrg    ;;
5826d8556812Smrg  esac
582763847c39Smrg  AC_MSG_RESULT([$enable_shared])
58281ae1b5e8Smrg
582963847c39Smrg  AC_MSG_CHECKING([whether to build static libraries])
583063847c39Smrg  # Make sure either enable_shared or enable_static is yes.
583163847c39Smrg  test "$enable_shared" = yes || enable_static=yes
583263847c39Smrg  AC_MSG_RESULT([$enable_static])
58331ae1b5e8Smrg
583463847c39Smrg  _LT_CONFIG($1)
58351ae1b5e8Smrgfi
583663847c39SmrgAC_LANG_POP
583763847c39SmrgCC="$lt_save_CC"
583863847c39Smrg])# _LT_LANG_C_CONFIG
583986dafe34Smrg
58401ae1b5e8Smrg
584163847c39Smrg# _LT_LANG_CXX_CONFIG([TAG])
584263847c39Smrg# --------------------------
584363847c39Smrg# Ensure that the configuration variables for a C++ compiler are suitably
584463847c39Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
584563847c39Smrg# the compiler configuration to `libtool'.
584663847c39Smrgm4_defun([_LT_LANG_CXX_CONFIG],
584763847c39Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
584863847c39Smrgm4_require([_LT_DECL_EGREP])dnl
584963847c39Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
585063847c39Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
585163847c39Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
585263847c39Smrg    (test "X$CXX" != "Xg++"))) ; then
585363847c39Smrg  AC_PROG_CXXCPP
585463847c39Smrgelse
585563847c39Smrg  _lt_caught_CXX_error=yes
585686dafe34Smrgfi
585786dafe34Smrg
585863847c39SmrgAC_LANG_PUSH(C++)
585963847c39Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
586063847c39Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
586163847c39Smrg_LT_TAGVAR(always_export_symbols, $1)=no
586263847c39Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
586363847c39Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
586463847c39Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
586563847c39Smrg_LT_TAGVAR(hardcode_direct, $1)=no
586663847c39Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
586763847c39Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
586863847c39Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
586963847c39Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
587063847c39Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
587163847c39Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
587263847c39Smrg_LT_TAGVAR(inherit_rpath, $1)=no
587363847c39Smrg_LT_TAGVAR(module_cmds, $1)=
587463847c39Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
587563847c39Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
587663847c39Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
587763847c39Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
587863847c39Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
587963847c39Smrg_LT_TAGVAR(no_undefined_flag, $1)=
588063847c39Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
588163847c39Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
588286dafe34Smrg
588363847c39Smrg# Source file extension for C++ test sources.
588463847c39Smrgac_ext=cpp
588586dafe34Smrg
588663847c39Smrg# Object file extension for compiled C++ test sources.
588763847c39Smrgobjext=o
588863847c39Smrg_LT_TAGVAR(objext, $1)=$objext
588963847c39Smrg
589063847c39Smrg# No sense in running all these tests if we already determined that
589163847c39Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
589263847c39Smrg# are currently assumed to apply to all compilers on this platform,
589363847c39Smrg# and will be corrupted by setting them based on a non-working compiler.
589463847c39Smrgif test "$_lt_caught_CXX_error" != yes; then
589563847c39Smrg  # Code to be used in simple compile tests
589663847c39Smrg  lt_simple_compile_test_code="int some_variable = 0;"
589763847c39Smrg
589863847c39Smrg  # Code to be used in simple link tests
589963847c39Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
590063847c39Smrg
590163847c39Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
590263847c39Smrg  _LT_TAG_COMPILER
590363847c39Smrg
590463847c39Smrg  # save warnings/boilerplate of simple test code
590563847c39Smrg  _LT_COMPILER_BOILERPLATE
590663847c39Smrg  _LT_LINKER_BOILERPLATE
590763847c39Smrg
590863847c39Smrg  # Allow CC to be a program name with arguments.
590963847c39Smrg  lt_save_CC=$CC
591063847c39Smrg  lt_save_CFLAGS=$CFLAGS
591163847c39Smrg  lt_save_LD=$LD
591263847c39Smrg  lt_save_GCC=$GCC
591363847c39Smrg  GCC=$GXX
591463847c39Smrg  lt_save_with_gnu_ld=$with_gnu_ld
591563847c39Smrg  lt_save_path_LD=$lt_cv_path_LD
591663847c39Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
591763847c39Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
591863847c39Smrg  else
591963847c39Smrg    $as_unset lt_cv_prog_gnu_ld
592063847c39Smrg  fi
592163847c39Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
592263847c39Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
592363847c39Smrg  else
592463847c39Smrg    $as_unset lt_cv_path_LD
592563847c39Smrg  fi
592663847c39Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
592763847c39Smrg  CC=${CXX-"c++"}
592863847c39Smrg  CFLAGS=$CXXFLAGS
592963847c39Smrg  compiler=$CC
593063847c39Smrg  _LT_TAGVAR(compiler, $1)=$CC
593163847c39Smrg  _LT_CC_BASENAME([$compiler])
593286dafe34Smrg
593363847c39Smrg  if test -n "$compiler"; then
593463847c39Smrg    # We don't want -fno-exception when compiling C++ code, so set the
593563847c39Smrg    # no_builtin_flag separately
593663847c39Smrg    if test "$GXX" = yes; then
593763847c39Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
593863847c39Smrg    else
593963847c39Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
594063847c39Smrg    fi
594186dafe34Smrg
594263847c39Smrg    if test "$GXX" = yes; then
594363847c39Smrg      # Set up default GNU C++ configuration
59441ae1b5e8Smrg
594563847c39Smrg      LT_PATH_LD
59461ae1b5e8Smrg
594763847c39Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
594863847c39Smrg      # archiving commands below assume that GNU ld is being used.
594963847c39Smrg      if test "$with_gnu_ld" = yes; then
595063847c39Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
595163847c39Smrg        _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'
595286dafe34Smrg
595363847c39Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
595463847c39Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
59551ae1b5e8Smrg
595663847c39Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
595763847c39Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
595863847c39Smrg        #     investigate it a little bit more. (MM)
595963847c39Smrg        wlarc='${wl}'
59601ae1b5e8Smrg
596163847c39Smrg        # ancient GNU ld didn't support --whole-archive et. al.
596263847c39Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
596363847c39Smrg	  $GREP 'no-whole-archive' > /dev/null; then
596463847c39Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
596563847c39Smrg        else
596663847c39Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
596763847c39Smrg        fi
5968d8556812Smrg      else
596963847c39Smrg        with_gnu_ld=no
597063847c39Smrg        wlarc=
597163847c39Smrg
597263847c39Smrg        # A generic and very simple default shared library creation
597363847c39Smrg        # command for GNU C++ for the case where it uses the native
597463847c39Smrg        # linker, instead of GNU ld.  If possible, this setting should
597563847c39Smrg        # overridden to take advantage of the native linker features on
597663847c39Smrg        # the platform it is being used on.
597763847c39Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5978d8556812Smrg      fi
597963847c39Smrg
598063847c39Smrg      # Commands to make compiler produce verbose output that lists
598163847c39Smrg      # what "hidden" libraries, object files and flags are used when
598263847c39Smrg      # linking a shared library.
598363847c39Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
598463847c39Smrg
5985d8556812Smrg    else
598663847c39Smrg      GXX=no
598763847c39Smrg      with_gnu_ld=no
598863847c39Smrg      wlarc=
5989d8556812Smrg    fi
59901ae1b5e8Smrg
599163847c39Smrg    # PORTME: fill in a description of your system's C++ link characteristics
599263847c39Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
599363847c39Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
599463847c39Smrg    case $host_os in
599563847c39Smrg      aix3*)
599663847c39Smrg        # FIXME: insert proper C++ library support
599763847c39Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
599863847c39Smrg        ;;
599963847c39Smrg      aix[[4-9]]*)
600063847c39Smrg        if test "$host_cpu" = ia64; then
600163847c39Smrg          # On IA64, the linker does run time linking by default, so we don't
600263847c39Smrg          # have to do anything special.
600363847c39Smrg          aix_use_runtimelinking=no
600463847c39Smrg          exp_sym_flag='-Bexport'
600563847c39Smrg          no_entry_flag=""
600663847c39Smrg        else
600763847c39Smrg          aix_use_runtimelinking=no
600863847c39Smrg
600963847c39Smrg          # Test if we are trying to use run time linking or normal
601063847c39Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
601163847c39Smrg          # need to do runtime linking.
601263847c39Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
601363847c39Smrg	    for ld_flag in $LDFLAGS; do
601463847c39Smrg	      case $ld_flag in
601563847c39Smrg	      *-brtl*)
601663847c39Smrg	        aix_use_runtimelinking=yes
601763847c39Smrg	        break
601863847c39Smrg	        ;;
601963847c39Smrg	      esac
602063847c39Smrg	    done
602163847c39Smrg	    ;;
602263847c39Smrg          esac
60231ae1b5e8Smrg
602463847c39Smrg          exp_sym_flag='-bexport'
602563847c39Smrg          no_entry_flag='-bnoentry'
602663847c39Smrg        fi
60271ae1b5e8Smrg
602863847c39Smrg        # When large executables or shared objects are built, AIX ld can
602963847c39Smrg        # have problems creating the table of contents.  If linking a library
603063847c39Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
603163847c39Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
603263847c39Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
603363847c39Smrg
603463847c39Smrg        _LT_TAGVAR(archive_cmds, $1)=''
603563847c39Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
603663847c39Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
603763847c39Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
603863847c39Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
603963847c39Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
604063847c39Smrg
604163847c39Smrg        if test "$GXX" = yes; then
604263847c39Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
604363847c39Smrg          # We only want to do this on AIX 4.2 and lower, the check
604463847c39Smrg          # below for broken collect2 doesn't work under 4.3+
604563847c39Smrg	  collect2name=`${CC} -print-prog-name=collect2`
604663847c39Smrg	  if test -f "$collect2name" &&
604763847c39Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
604863847c39Smrg	  then
604963847c39Smrg	    # We have reworked collect2
605063847c39Smrg	    :
605163847c39Smrg	  else
605263847c39Smrg	    # We have old collect2
605363847c39Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
605463847c39Smrg	    # It fails to find uninstalled libraries when the uninstalled
605563847c39Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
605663847c39Smrg	    # to unsupported forces relinking
605763847c39Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
605863847c39Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
605963847c39Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
606063847c39Smrg	  fi
606163847c39Smrg          esac
606263847c39Smrg          shared_flag='-shared'
606363847c39Smrg	  if test "$aix_use_runtimelinking" = yes; then
606463847c39Smrg	    shared_flag="$shared_flag "'${wl}-G'
606563847c39Smrg	  fi
606663847c39Smrg        else
606763847c39Smrg          # not using gcc
606863847c39Smrg          if test "$host_cpu" = ia64; then
606963847c39Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
607063847c39Smrg	  # chokes on -Wl,-G. The following line is correct:
607163847c39Smrg	  shared_flag='-G'
607263847c39Smrg          else
607363847c39Smrg	    if test "$aix_use_runtimelinking" = yes; then
607463847c39Smrg	      shared_flag='${wl}-G'
607563847c39Smrg	    else
607663847c39Smrg	      shared_flag='${wl}-bM:SRE'
607763847c39Smrg	    fi
607863847c39Smrg          fi
607963847c39Smrg        fi
60801ae1b5e8Smrg
608163847c39Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
608263847c39Smrg        # It seems that -bexpall does not export symbols beginning with
608363847c39Smrg        # underscore (_), so it is better to generate a list of symbols to
608463847c39Smrg	# export.
608563847c39Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
608663847c39Smrg        if test "$aix_use_runtimelinking" = yes; then
608763847c39Smrg          # Warning - without using the other runtime loading flags (-brtl),
608863847c39Smrg          # -berok will link without error, but may produce a broken library.
608963847c39Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
609063847c39Smrg          # Determine the default libpath from the value encoded in an empty
609163847c39Smrg          # executable.
609263847c39Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
609363847c39Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
609463847c39Smrg
609563847c39Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
609663847c39Smrg        else
609763847c39Smrg          if test "$host_cpu" = ia64; then
609863847c39Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
609963847c39Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
610063847c39Smrg	    _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"
610163847c39Smrg          else
610263847c39Smrg	    # Determine the default libpath from the value encoded in an
610363847c39Smrg	    # empty executable.
610463847c39Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
610563847c39Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
610663847c39Smrg	    # Warning - without using the other run time loading flags,
610763847c39Smrg	    # -berok will link without error, but may produce a broken library.
610863847c39Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
610963847c39Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
611063847c39Smrg	    if test "$with_gnu_ld" = yes; then
611163847c39Smrg	      # We only use this code for GNU lds that support --whole-archive.
611263847c39Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
611363847c39Smrg	    else
611463847c39Smrg	      # Exported symbols can be pulled into shared objects from archives
611563847c39Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
611663847c39Smrg	    fi
611763847c39Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
611863847c39Smrg	    # This is similar to how AIX traditionally builds its shared
611963847c39Smrg	    # libraries.
612063847c39Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
612163847c39Smrg          fi
612263847c39Smrg        fi
612363847c39Smrg        ;;
61241ae1b5e8Smrg
612563847c39Smrg      beos*)
612663847c39Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
612763847c39Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
612863847c39Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
612963847c39Smrg	  # support --undefined.  This deserves some investigation.  FIXME
613063847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6131d8556812Smrg	else
613263847c39Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6133d8556812Smrg	fi
6134d8556812Smrg	;;
613563847c39Smrg
6136d8556812Smrg      chorus*)
613763847c39Smrg        case $cc_basename in
613863847c39Smrg          *)
613963847c39Smrg	  # FIXME: insert proper C++ library support
614063847c39Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
614163847c39Smrg	  ;;
614263847c39Smrg        esac
614363847c39Smrg        ;;
614463847c39Smrg
614563847c39Smrg      cygwin* | mingw* | pw32* | cegcc*)
614663847c39Smrg	case $GXX,$cc_basename in
614763847c39Smrg	,cl* | no,cl*)
614863847c39Smrg	  # Native MSVC
614963847c39Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
615063847c39Smrg	  # no search path for DLLs.
615163847c39Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
615263847c39Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
615363847c39Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
615463847c39Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
615563847c39Smrg	  # Tell ltmain to make .lib files, not .a files.
615663847c39Smrg	  libext=lib
615763847c39Smrg	  # Tell ltmain to make .dll files, not .so files.
615863847c39Smrg	  shrext_cmds=".dll"
615963847c39Smrg	  # FIXME: Setting linknames here is a bad hack.
616063847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
616163847c39Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
616263847c39Smrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
616363847c39Smrg	    else
616463847c39Smrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
616563847c39Smrg	    fi~
616663847c39Smrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
616763847c39Smrg	    linknames='
616863847c39Smrg	  # The linker will not automatically build a static lib if we build a DLL.
616963847c39Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
617063847c39Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
617163847c39Smrg	  # Don't use ranlib
617263847c39Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
617363847c39Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
617463847c39Smrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
617563847c39Smrg	    case $lt_outputfile in
617663847c39Smrg	      *.exe|*.EXE) ;;
617763847c39Smrg	      *)
617863847c39Smrg		lt_outputfile="$lt_outputfile.exe"
617963847c39Smrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
618063847c39Smrg		;;
618163847c39Smrg	    esac~
618263847c39Smrg	    func_to_tool_file "$lt_outputfile"~
618363847c39Smrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
618463847c39Smrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
618563847c39Smrg	      $RM "$lt_outputfile.manifest";
618663847c39Smrg	    fi'
618763847c39Smrg	  ;;
618863847c39Smrg	*)
618963847c39Smrg	  # g++
619063847c39Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
619163847c39Smrg	  # as there is no search path for DLLs.
619263847c39Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
619363847c39Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
619463847c39Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
619563847c39Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
619663847c39Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
619763847c39Smrg
619863847c39Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
619963847c39Smrg	    _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'
620063847c39Smrg	    # If the export-symbols file already is a .def file (1st line
620163847c39Smrg	    # is EXPORTS), use it as is; otherwise, prepend...
620263847c39Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
620363847c39Smrg	      cp $export_symbols $output_objdir/$soname.def;
620463847c39Smrg	    else
620563847c39Smrg	      echo EXPORTS > $output_objdir/$soname.def;
620663847c39Smrg	      cat $export_symbols >> $output_objdir/$soname.def;
620763847c39Smrg	    fi~
620863847c39Smrg	    $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'
620963847c39Smrg	  else
621063847c39Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
621163847c39Smrg	  fi
6212d8556812Smrg	  ;;
6213d8556812Smrg	esac
6214d8556812Smrg	;;
621563847c39Smrg      darwin* | rhapsody*)
621663847c39Smrg        _LT_DARWIN_LINKER_FEATURES($1)
621763847c39Smrg	;;
621863847c39Smrg
6219d8556812Smrg      dgux*)
622063847c39Smrg        case $cc_basename in
622163847c39Smrg          ec++*)
622263847c39Smrg	    # FIXME: insert proper C++ library support
622363847c39Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6224d8556812Smrg	    ;;
622563847c39Smrg          ghcx*)
6226d8556812Smrg	    # Green Hills C++ Compiler
622763847c39Smrg	    # FIXME: insert proper C++ library support
622863847c39Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6229d8556812Smrg	    ;;
623063847c39Smrg          *)
623163847c39Smrg	    # FIXME: insert proper C++ library support
623263847c39Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6233d8556812Smrg	    ;;
623463847c39Smrg        esac
623563847c39Smrg        ;;
623663847c39Smrg
623763847c39Smrg      freebsd2.*)
623863847c39Smrg        # C++ shared libraries reported to be fairly broken before
623963847c39Smrg	# switch to ELF
624063847c39Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
624163847c39Smrg        ;;
624263847c39Smrg
624363847c39Smrg      freebsd-elf*)
624463847c39Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
624563847c39Smrg        ;;
624663847c39Smrg
6247d8556812Smrg      freebsd* | dragonfly*)
624863847c39Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
624963847c39Smrg        # conventions
625063847c39Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
625163847c39Smrg        ;;
625263847c39Smrg
625363847c39Smrg      haiku*)
625463847c39Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
625563847c39Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
625663847c39Smrg        ;;
625763847c39Smrg
625863847c39Smrg      hpux9*)
625963847c39Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
626063847c39Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
626163847c39Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
626263847c39Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
626363847c39Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
626463847c39Smrg				             # but as the default
626563847c39Smrg				             # location of the library.
626663847c39Smrg
626763847c39Smrg        case $cc_basename in
626863847c39Smrg          CC*)
626963847c39Smrg            # FIXME: insert proper C++ library support
627063847c39Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
627163847c39Smrg            ;;
627263847c39Smrg          aCC*)
627363847c39Smrg            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
627463847c39Smrg            # Commands to make compiler produce verbose output that lists
627563847c39Smrg            # what "hidden" libraries, object files and flags are used when
627663847c39Smrg            # linking a shared library.
627763847c39Smrg            #
627863847c39Smrg            # There doesn't appear to be a way to prevent this compiler from
627963847c39Smrg            # explicitly linking system object files so we need to strip them
628063847c39Smrg            # from the output so that they don't get included in the library
628163847c39Smrg            # dependencies.
628263847c39Smrg            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"'
628363847c39Smrg            ;;
628463847c39Smrg          *)
628563847c39Smrg            if test "$GXX" = yes; then
628663847c39Smrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
628763847c39Smrg            else
628863847c39Smrg              # FIXME: insert proper C++ library support
628963847c39Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
629063847c39Smrg            fi
629163847c39Smrg            ;;
629263847c39Smrg        esac
629363847c39Smrg        ;;
629463847c39Smrg
629563847c39Smrg      hpux10*|hpux11*)
629663847c39Smrg        if test $with_gnu_ld = no; then
629763847c39Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
629863847c39Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
629963847c39Smrg
630063847c39Smrg          case $host_cpu in
630163847c39Smrg            hppa*64*|ia64*)
630263847c39Smrg              ;;
630363847c39Smrg            *)
630463847c39Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
630563847c39Smrg              ;;
630663847c39Smrg          esac
630763847c39Smrg        fi
630863847c39Smrg        case $host_cpu in
630963847c39Smrg          hppa*64*|ia64*)
631063847c39Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
631163847c39Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
631263847c39Smrg            ;;
631363847c39Smrg          *)
631463847c39Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
631563847c39Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
631663847c39Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
631763847c39Smrg					         # but as the default
631863847c39Smrg					         # location of the library.
631963847c39Smrg            ;;
632063847c39Smrg        esac
632163847c39Smrg
632263847c39Smrg        case $cc_basename in
632363847c39Smrg          CC*)
632463847c39Smrg	    # FIXME: insert proper C++ library support
632563847c39Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6326d8556812Smrg	    ;;
632763847c39Smrg          aCC*)
6328d8556812Smrg	    case $host_cpu in
632963847c39Smrg	      hppa*64*)
633063847c39Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
633163847c39Smrg	        ;;
633263847c39Smrg	      ia64*)
633363847c39Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
633463847c39Smrg	        ;;
633563847c39Smrg	      *)
633663847c39Smrg	        _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'
633763847c39Smrg	        ;;
6338d8556812Smrg	    esac
633963847c39Smrg	    # Commands to make compiler produce verbose output that lists
634063847c39Smrg	    # what "hidden" libraries, object files and flags are used when
634163847c39Smrg	    # linking a shared library.
634263847c39Smrg	    #
634363847c39Smrg	    # There doesn't appear to be a way to prevent this compiler from
634463847c39Smrg	    # explicitly linking system object files so we need to strip them
634563847c39Smrg	    # from the output so that they don't get included in the library
634663847c39Smrg	    # dependencies.
634763847c39Smrg	    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"'
6348d8556812Smrg	    ;;
634963847c39Smrg          *)
635063847c39Smrg	    if test "$GXX" = yes; then
635163847c39Smrg	      if test $with_gnu_ld = no; then
635263847c39Smrg	        case $host_cpu in
635363847c39Smrg	          hppa*64*)
635463847c39Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
635563847c39Smrg	            ;;
635663847c39Smrg	          ia64*)
635763847c39Smrg	            _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'
635863847c39Smrg	            ;;
635963847c39Smrg	          *)
636063847c39Smrg	            _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'
636163847c39Smrg	            ;;
636263847c39Smrg	        esac
636363847c39Smrg	      fi
636463847c39Smrg	    else
636563847c39Smrg	      # FIXME: insert proper C++ library support
636663847c39Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
636763847c39Smrg	    fi
6368d8556812Smrg	    ;;
636963847c39Smrg        esac
637063847c39Smrg        ;;
637163847c39Smrg
637263847c39Smrg      interix[[3-9]]*)
637363847c39Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
637463847c39Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
637563847c39Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
637663847c39Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
637763847c39Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
637863847c39Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
637963847c39Smrg	# default) and relocated if they conflict, which is a slow very memory
638063847c39Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
638163847c39Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
638263847c39Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
638363847c39Smrg	_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'
638463847c39Smrg	_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'
6385d8556812Smrg	;;
638663847c39Smrg      irix5* | irix6*)
638763847c39Smrg        case $cc_basename in
638863847c39Smrg          CC*)
638963847c39Smrg	    # SGI C++
639063847c39Smrg	    _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'
639163847c39Smrg
639263847c39Smrg	    # Archives containing C++ object files must be created using
639363847c39Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
639463847c39Smrg	    # necessary to make sure instantiated templates are included
639563847c39Smrg	    # in the archive.
639663847c39Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6397d8556812Smrg	    ;;
639863847c39Smrg          *)
639963847c39Smrg	    if test "$GXX" = yes; then
640063847c39Smrg	      if test "$with_gnu_ld" = no; then
640163847c39Smrg	        _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'
640263847c39Smrg	      else
640363847c39Smrg	        _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'
640463847c39Smrg	      fi
640563847c39Smrg	    fi
640663847c39Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6407d8556812Smrg	    ;;
640863847c39Smrg        esac
640963847c39Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
641063847c39Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
641163847c39Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
641263847c39Smrg        ;;
641363847c39Smrg
64149586ba5aSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
641563847c39Smrg        case $cc_basename in
641663847c39Smrg          KCC*)
641763847c39Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
641863847c39Smrg
641963847c39Smrg	    # KCC will only create a shared library if the output file
642063847c39Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
642163847c39Smrg	    # to its proper name (with version) after linking.
642263847c39Smrg	    _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'
642363847c39Smrg	    _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'
642463847c39Smrg	    # Commands to make compiler produce verbose output that lists
642563847c39Smrg	    # what "hidden" libraries, object files and flags are used when
642663847c39Smrg	    # linking a shared library.
642763847c39Smrg	    #
642863847c39Smrg	    # There doesn't appear to be a way to prevent this compiler from
642963847c39Smrg	    # explicitly linking system object files so we need to strip them
643063847c39Smrg	    # from the output so that they don't get included in the library
643163847c39Smrg	    # dependencies.
643263847c39Smrg	    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"'
643363847c39Smrg
643463847c39Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
643563847c39Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
643663847c39Smrg
643763847c39Smrg	    # Archives containing C++ object files must be created using
643863847c39Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
643963847c39Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6440d8556812Smrg	    ;;
644163847c39Smrg	  icpc* | ecpc* )
6442d8556812Smrg	    # Intel C++
644363847c39Smrg	    with_gnu_ld=yes
644463847c39Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
644563847c39Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
644663847c39Smrg	    # earlier do not add the objects themselves.
644763847c39Smrg	    case `$CC -V 2>&1` in
644863847c39Smrg	      *"Version 7."*)
644963847c39Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
645063847c39Smrg		_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'
645163847c39Smrg		;;
645263847c39Smrg	      *)  # Version 8.0 or newer
645363847c39Smrg	        tmp_idyn=
645463847c39Smrg	        case $host_cpu in
645563847c39Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
645663847c39Smrg		esac
645763847c39Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
645863847c39Smrg		_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'
645963847c39Smrg		;;
646063847c39Smrg	    esac
646163847c39Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
646263847c39Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
646363847c39Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
646463847c39Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6465d8556812Smrg	    ;;
646663847c39Smrg          pgCC* | pgcpp*)
646763847c39Smrg            # Portland Group C++ compiler
646863847c39Smrg	    case `$CC -V` in
646963847c39Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
647063847c39Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
647163847c39Smrg		rm -rf $tpldir~
647263847c39Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
647363847c39Smrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
647463847c39Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
647563847c39Smrg		rm -rf $tpldir~
647663847c39Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
647763847c39Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
647863847c39Smrg		$RANLIB $oldlib'
647963847c39Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
648063847c39Smrg		rm -rf $tpldir~
648163847c39Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
648263847c39Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
648363847c39Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
648463847c39Smrg		rm -rf $tpldir~
648563847c39Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
648663847c39Smrg		$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'
648763847c39Smrg	      ;;
648863847c39Smrg	    *) # Version 6 and above use weak symbols
648963847c39Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
649063847c39Smrg	      _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'
649163847c39Smrg	      ;;
649263847c39Smrg	    esac
649363847c39Smrg
649463847c39Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
649563847c39Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
649663847c39Smrg	    _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'
649763847c39Smrg            ;;
6498d8556812Smrg	  cxx*)
6499d8556812Smrg	    # Compaq C++
650063847c39Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
650163847c39Smrg	    _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'
650263847c39Smrg
650363847c39Smrg	    runpath_var=LD_RUN_PATH
650463847c39Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
650563847c39Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
650663847c39Smrg
650763847c39Smrg	    # Commands to make compiler produce verbose output that lists
650863847c39Smrg	    # what "hidden" libraries, object files and flags are used when
650963847c39Smrg	    # linking a shared library.
651063847c39Smrg	    #
651163847c39Smrg	    # There doesn't appear to be a way to prevent this compiler from
651263847c39Smrg	    # explicitly linking system object files so we need to strip them
651363847c39Smrg	    # from the output so that they don't get included in the library
651463847c39Smrg	    # dependencies.
651563847c39Smrg	    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'
651663847c39Smrg	    ;;
651763847c39Smrg	  xl* | mpixl* | bgxl*)
651863847c39Smrg	    # IBM XL 8.0 on PPC, with GNU ld
651963847c39Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
652063847c39Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
652163847c39Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
652263847c39Smrg	    if test "x$supports_anon_versioning" = xyes; then
652363847c39Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
652463847c39Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
652563847c39Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
652663847c39Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
652763847c39Smrg	    fi
6528d8556812Smrg	    ;;
6529d8556812Smrg	  *)
6530d8556812Smrg	    case `$CC -V 2>&1 | sed 5q` in
6531d8556812Smrg	    *Sun\ C*)
6532d8556812Smrg	      # Sun C++ 5.9
653363847c39Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
653463847c39Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
653563847c39Smrg	      _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'
653663847c39Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
653763847c39Smrg	      _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'
653863847c39Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
653963847c39Smrg
654063847c39Smrg	      # Not sure whether something based on
654163847c39Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
654263847c39Smrg	      # would be better.
654363847c39Smrg	      output_verbose_link_cmd='func_echo_all'
654463847c39Smrg
654563847c39Smrg	      # Archives containing C++ object files must be created using
654663847c39Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
654763847c39Smrg	      # necessary to make sure instantiated templates are included
654863847c39Smrg	      # in the archive.
654963847c39Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6550d8556812Smrg	      ;;
6551d8556812Smrg	    esac
6552d8556812Smrg	    ;;
6553d8556812Smrg	esac
6554d8556812Smrg	;;
655563847c39Smrg
6556d8556812Smrg      lynxos*)
655763847c39Smrg        # FIXME: insert proper C++ library support
655863847c39Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6559d8556812Smrg	;;
656063847c39Smrg
6561d8556812Smrg      m88k*)
656263847c39Smrg        # FIXME: insert proper C++ library support
656363847c39Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6564d8556812Smrg	;;
656563847c39Smrg
6566d8556812Smrg      mvs*)
656763847c39Smrg        case $cc_basename in
656863847c39Smrg          cxx*)
656963847c39Smrg	    # FIXME: insert proper C++ library support
657063847c39Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6571d8556812Smrg	    ;;
6572d8556812Smrg	  *)
657363847c39Smrg	    # FIXME: insert proper C++ library support
657463847c39Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6575d8556812Smrg	    ;;
6576d8556812Smrg	esac
6577d8556812Smrg	;;
657863847c39Smrg
6579d8556812Smrg      netbsd*)
658063847c39Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
658163847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
658263847c39Smrg	  wlarc=
658363847c39Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
658463847c39Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
658563847c39Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
658663847c39Smrg	fi
658763847c39Smrg	# Workaround some broken pre-1.5 toolchains
658863847c39Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
658963847c39Smrg	;;
659063847c39Smrg
659163847c39Smrg      *nto* | *qnx*)
659263847c39Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
659363847c39Smrg	;;
659463847c39Smrg
659563847c39Smrg      openbsd2*)
659663847c39Smrg        # C++ shared libraries are fairly broken
659763847c39Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
659863847c39Smrg	;;
659963847c39Smrg
660063847c39Smrg      openbsd*)
660163847c39Smrg	if test -f /usr/libexec/ld.so; then
660263847c39Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
660363847c39Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
660463847c39Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
660563847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
660663847c39Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
660763847c39Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
660863847c39Smrg	    _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'
660963847c39Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
661063847c39Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
661163847c39Smrg	  fi
661263847c39Smrg	  output_verbose_link_cmd=func_echo_all
661363847c39Smrg	else
661463847c39Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
661563847c39Smrg	fi
6616d8556812Smrg	;;
661763847c39Smrg
6618d8556812Smrg      osf3* | osf4* | osf5*)
661963847c39Smrg        case $cc_basename in
662063847c39Smrg          KCC*)
662163847c39Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
662263847c39Smrg
662363847c39Smrg	    # KCC will only create a shared library if the output file
662463847c39Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
662563847c39Smrg	    # to its proper name (with version) after linking.
662663847c39Smrg	    _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'
662763847c39Smrg
662863847c39Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
662963847c39Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
663063847c39Smrg
663163847c39Smrg	    # Archives containing C++ object files must be created using
663263847c39Smrg	    # the KAI C++ compiler.
663363847c39Smrg	    case $host in
663463847c39Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
663563847c39Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
663663847c39Smrg	    esac
6637d8556812Smrg	    ;;
663863847c39Smrg          RCC*)
6639d8556812Smrg	    # Rational C++ 2.4.1
664063847c39Smrg	    # FIXME: insert proper C++ library support
664163847c39Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6642d8556812Smrg	    ;;
664363847c39Smrg          cxx*)
664463847c39Smrg	    case $host in
664563847c39Smrg	      osf3*)
664663847c39Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
664763847c39Smrg	        _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'
664863847c39Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
664963847c39Smrg		;;
665063847c39Smrg	      *)
665163847c39Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
665263847c39Smrg	        _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'
665363847c39Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
665463847c39Smrg	          echo "-hidden">> $lib.exp~
665563847c39Smrg	          $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~
665663847c39Smrg	          $RM $lib.exp'
665763847c39Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
665863847c39Smrg		;;
665963847c39Smrg	    esac
666063847c39Smrg
666163847c39Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
666263847c39Smrg
666363847c39Smrg	    # Commands to make compiler produce verbose output that lists
666463847c39Smrg	    # what "hidden" libraries, object files and flags are used when
666563847c39Smrg	    # linking a shared library.
666663847c39Smrg	    #
666763847c39Smrg	    # There doesn't appear to be a way to prevent this compiler from
666863847c39Smrg	    # explicitly linking system object files so we need to strip them
666963847c39Smrg	    # from the output so that they don't get included in the library
667063847c39Smrg	    # dependencies.
667163847c39Smrg	    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"'
6672d8556812Smrg	    ;;
6673d8556812Smrg	  *)
667463847c39Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
667563847c39Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
667663847c39Smrg	      case $host in
667763847c39Smrg	        osf3*)
667863847c39Smrg	          _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'
667963847c39Smrg		  ;;
668063847c39Smrg	        *)
668163847c39Smrg	          _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'
668263847c39Smrg		  ;;
668363847c39Smrg	      esac
668463847c39Smrg
668563847c39Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
668663847c39Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
668763847c39Smrg
668863847c39Smrg	      # Commands to make compiler produce verbose output that lists
668963847c39Smrg	      # what "hidden" libraries, object files and flags are used when
669063847c39Smrg	      # linking a shared library.
669163847c39Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
669263847c39Smrg
669363847c39Smrg	    else
669463847c39Smrg	      # FIXME: insert proper C++ library support
669563847c39Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
669663847c39Smrg	    fi
6697d8556812Smrg	    ;;
669863847c39Smrg        esac
669963847c39Smrg        ;;
670063847c39Smrg
6701d8556812Smrg      psos*)
670263847c39Smrg        # FIXME: insert proper C++ library support
670363847c39Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
670463847c39Smrg        ;;
670563847c39Smrg
6706d8556812Smrg      sunos4*)
670763847c39Smrg        case $cc_basename in
670863847c39Smrg          CC*)
6709d8556812Smrg	    # Sun C++ 4.x
671063847c39Smrg	    # FIXME: insert proper C++ library support
671163847c39Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6712d8556812Smrg	    ;;
671363847c39Smrg          lcc*)
6714d8556812Smrg	    # Lucid
671563847c39Smrg	    # FIXME: insert proper C++ library support
671663847c39Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6717d8556812Smrg	    ;;
671863847c39Smrg          *)
671963847c39Smrg	    # FIXME: insert proper C++ library support
672063847c39Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6721d8556812Smrg	    ;;
672263847c39Smrg        esac
672363847c39Smrg        ;;
67241ae1b5e8Smrg
672563847c39Smrg      solaris*)
672663847c39Smrg        case $cc_basename in
672763847c39Smrg          CC* | sunCC*)
672863847c39Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
672963847c39Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
673063847c39Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
673163847c39Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
673263847c39Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
673363847c39Smrg	      $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'
673463847c39Smrg
673563847c39Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
673663847c39Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
673763847c39Smrg	    case $host_os in
673863847c39Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
673963847c39Smrg	      *)
674063847c39Smrg		# The compiler driver will combine and reorder linker options,
674163847c39Smrg		# but understands `-z linker_flag'.
674263847c39Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
674363847c39Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
674463847c39Smrg	        ;;
674563847c39Smrg	    esac
674663847c39Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
67471ae1b5e8Smrg
674863847c39Smrg	    output_verbose_link_cmd='func_echo_all'
67491ae1b5e8Smrg
675063847c39Smrg	    # Archives containing C++ object files must be created using
675163847c39Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
675263847c39Smrg	    # necessary to make sure instantiated templates are included
675363847c39Smrg	    # in the archive.
675463847c39Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
675563847c39Smrg	    ;;
675663847c39Smrg          gcx*)
675763847c39Smrg	    # Green Hills C++ Compiler
675863847c39Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
67591ae1b5e8Smrg
676063847c39Smrg	    # The C++ compiler must be used to create the archive.
676163847c39Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
676263847c39Smrg	    ;;
676363847c39Smrg          *)
676463847c39Smrg	    # GNU C++ compiler with Solaris linker
676563847c39Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
676663847c39Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
676763847c39Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
676863847c39Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
676963847c39Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
677063847c39Smrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
677163847c39Smrg
677263847c39Smrg	        # Commands to make compiler produce verbose output that lists
677363847c39Smrg	        # what "hidden" libraries, object files and flags are used when
677463847c39Smrg	        # linking a shared library.
677563847c39Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
677663847c39Smrg	      else
677763847c39Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
677863847c39Smrg	        # platform.
677963847c39Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
678063847c39Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
678163847c39Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
678263847c39Smrg
678363847c39Smrg	        # Commands to make compiler produce verbose output that lists
678463847c39Smrg	        # what "hidden" libraries, object files and flags are used when
678563847c39Smrg	        # linking a shared library.
678663847c39Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
678763847c39Smrg	      fi
678863847c39Smrg
678963847c39Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
679063847c39Smrg	      case $host_os in
679163847c39Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
679263847c39Smrg		*)
679363847c39Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
679463847c39Smrg		  ;;
679563847c39Smrg	      esac
679663847c39Smrg	    fi
679763847c39Smrg	    ;;
679863847c39Smrg        esac
679963847c39Smrg        ;;
68001ae1b5e8Smrg
680163847c39Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
680263847c39Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
680363847c39Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
680463847c39Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
680563847c39Smrg      runpath_var='LD_RUN_PATH'
68061ae1b5e8Smrg
6807d8556812Smrg      case $cc_basename in
680863847c39Smrg        CC*)
680963847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
681063847c39Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6811d8556812Smrg	  ;;
681263847c39Smrg	*)
681363847c39Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
681463847c39Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6815d8556812Smrg	  ;;
6816d8556812Smrg      esac
6817d8556812Smrg      ;;
68181ae1b5e8Smrg
681963847c39Smrg      sysv5* | sco3.2v5* | sco5v6*)
682063847c39Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
682163847c39Smrg	# link with -lc, and that would cause any symbols used from libc to
682263847c39Smrg	# always be unresolved, which means just about no library would
682363847c39Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
682463847c39Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
682563847c39Smrg	# as -z defs.
682663847c39Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
682763847c39Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
682863847c39Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
682963847c39Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
683063847c39Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
683163847c39Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
683263847c39Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
683363847c39Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
683463847c39Smrg	runpath_var='LD_RUN_PATH'
68351ae1b5e8Smrg
683663847c39Smrg	case $cc_basename in
683763847c39Smrg          CC*)
683863847c39Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
683963847c39Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
684063847c39Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
684163847c39Smrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
684263847c39Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
684363847c39Smrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
684463847c39Smrg	    ;;
684563847c39Smrg	  *)
684663847c39Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
684763847c39Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
684863847c39Smrg	    ;;
684963847c39Smrg	esac
6850d8556812Smrg      ;;
68511ae1b5e8Smrg
685263847c39Smrg      tandem*)
685363847c39Smrg        case $cc_basename in
685463847c39Smrg          NCC*)
685563847c39Smrg	    # NonStop-UX NCC 3.20
685663847c39Smrg	    # FIXME: insert proper C++ library support
685763847c39Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
685863847c39Smrg	    ;;
685963847c39Smrg          *)
686063847c39Smrg	    # FIXME: insert proper C++ library support
686163847c39Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
686263847c39Smrg	    ;;
686363847c39Smrg        esac
686463847c39Smrg        ;;
68651ae1b5e8Smrg
686663847c39Smrg      vxworks*)
686763847c39Smrg        # FIXME: insert proper C++ library support
686863847c39Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
686963847c39Smrg        ;;
68701ae1b5e8Smrg
687163847c39Smrg      *)
687263847c39Smrg        # FIXME: insert proper C++ library support
687363847c39Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
687463847c39Smrg        ;;
6875d8556812Smrg    esac
687676888252Smrg
687763847c39Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
687863847c39Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
687963847c39Smrg
688063847c39Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
688163847c39Smrg    _LT_TAGVAR(LD, $1)="$LD"
688263847c39Smrg
688363847c39Smrg    ## CAVEAT EMPTOR:
688463847c39Smrg    ## There is no encapsulation within the following macros, do not change
688563847c39Smrg    ## the running order or otherwise move them around unless you know exactly
688663847c39Smrg    ## what you are doing...
688763847c39Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
688863847c39Smrg    _LT_COMPILER_PIC($1)
688963847c39Smrg    _LT_COMPILER_C_O($1)
689063847c39Smrg    _LT_COMPILER_FILE_LOCKS($1)
689163847c39Smrg    _LT_LINKER_SHLIBS($1)
689263847c39Smrg    _LT_SYS_DYNAMIC_LINKER($1)
689363847c39Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
689463847c39Smrg
689563847c39Smrg    _LT_CONFIG($1)
689663847c39Smrg  fi # test -n "$compiler"
689763847c39Smrg
689863847c39Smrg  CC=$lt_save_CC
689963847c39Smrg  CFLAGS=$lt_save_CFLAGS
690063847c39Smrg  LDCXX=$LD
690163847c39Smrg  LD=$lt_save_LD
690263847c39Smrg  GCC=$lt_save_GCC
690363847c39Smrg  with_gnu_ld=$lt_save_with_gnu_ld
690463847c39Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
690563847c39Smrg  lt_cv_path_LD=$lt_save_path_LD
690663847c39Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
690763847c39Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
690863847c39Smrgfi # test "$_lt_caught_CXX_error" != yes
690976888252Smrg
691063847c39SmrgAC_LANG_POP
691163847c39Smrg])# _LT_LANG_CXX_CONFIG
691263847c39Smrg
691363847c39Smrg
691463847c39Smrg# _LT_FUNC_STRIPNAME_CNF
691563847c39Smrg# ----------------------
691663847c39Smrg# func_stripname_cnf prefix suffix name
691763847c39Smrg# strip PREFIX and SUFFIX off of NAME.
691863847c39Smrg# PREFIX and SUFFIX must not contain globbing or regex special
691963847c39Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
692063847c39Smrg# dot (in which case that matches only a dot).
6921d8556812Smrg#
692263847c39Smrg# This function is identical to the (non-XSI) version of func_stripname,
692363847c39Smrg# except this one can be used by m4 code that may be executed by configure,
692463847c39Smrg# rather than the libtool script.
692563847c39Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
692663847c39SmrgAC_REQUIRE([_LT_DECL_SED])
692763847c39SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
692863847c39Smrgfunc_stripname_cnf ()
692963847c39Smrg{
693063847c39Smrg  case ${2} in
693163847c39Smrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
693263847c39Smrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
693363847c39Smrg  esac
693463847c39Smrg} # func_stripname_cnf
693563847c39Smrg])# _LT_FUNC_STRIPNAME_CNF
693663847c39Smrg
693763847c39Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
693863847c39Smrg# ---------------------------------
693963847c39Smrg# Figure out "hidden" library dependencies from verbose
694063847c39Smrg# compiler output when linking a shared library.
694163847c39Smrg# Parse the compiler output and extract the necessary
694263847c39Smrg# objects, libraries and library flags.
694363847c39Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
694463847c39Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
694563847c39SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
694663847c39Smrg# Dependencies to place before and after the object being linked:
694763847c39Smrg_LT_TAGVAR(predep_objects, $1)=
694863847c39Smrg_LT_TAGVAR(postdep_objects, $1)=
694963847c39Smrg_LT_TAGVAR(predeps, $1)=
695063847c39Smrg_LT_TAGVAR(postdeps, $1)=
695163847c39Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
695263847c39Smrg
695363847c39Smrgdnl we can't use the lt_simple_compile_test_code here,
695463847c39Smrgdnl because it contains code intended for an executable,
695563847c39Smrgdnl not a library.  It's possible we should let each
695663847c39Smrgdnl tag define a new lt_????_link_test_code variable,
695763847c39Smrgdnl but it's only used here...
695863847c39Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
695963847c39Smrgint a;
696063847c39Smrgvoid foo (void) { a = 0; }
696163847c39Smrg_LT_EOF
696263847c39Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
696363847c39Smrgclass Foo
696463847c39Smrg{
696563847c39Smrgpublic:
696663847c39Smrg  Foo (void) { a = 0; }
696763847c39Smrgprivate:
696863847c39Smrg  int a;
696963847c39Smrg};
697063847c39Smrg_LT_EOF
697163847c39Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
697263847c39Smrg      subroutine foo
697363847c39Smrg      implicit none
697463847c39Smrg      integer*4 a
697563847c39Smrg      a=0
697663847c39Smrg      return
697763847c39Smrg      end
697863847c39Smrg_LT_EOF
697963847c39Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
698063847c39Smrg      subroutine foo
698163847c39Smrg      implicit none
698263847c39Smrg      integer a
698363847c39Smrg      a=0
698463847c39Smrg      return
698563847c39Smrg      end
698663847c39Smrg_LT_EOF
698763847c39Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
698863847c39Smrgpublic class foo {
698963847c39Smrg  private int a;
699063847c39Smrg  public void bar (void) {
699163847c39Smrg    a = 0;
699263847c39Smrg  }
699363847c39Smrg};
699463847c39Smrg_LT_EOF
699563847c39Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
699663847c39Smrgpackage foo
699763847c39Smrgfunc foo() {
699863847c39Smrg}
699963847c39Smrg_LT_EOF
7000d8556812Smrg])
700176888252Smrg
700263847c39Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
700363847c39Smrgcase "$CC $CFLAGS " in #(
700463847c39Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
700563847c39Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
700663847c39Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
700763847c39Smrgesac
700876888252Smrg
700963847c39Smrgdnl Parse the compiler output and extract the necessary
701063847c39Smrgdnl objects, libraries and library flags.
701163847c39Smrgif AC_TRY_EVAL(ac_compile); then
701263847c39Smrg  # Parse the compiler output and extract the necessary
701363847c39Smrg  # objects, libraries and library flags.
701476888252Smrg
701563847c39Smrg  # Sentinel used to keep track of whether or not we are before
701663847c39Smrg  # the conftest object file.
701763847c39Smrg  pre_test_object_deps_done=no
70181ae1b5e8Smrg
701963847c39Smrg  for p in `eval "$output_verbose_link_cmd"`; do
702063847c39Smrg    case ${prev}${p} in
70211ae1b5e8Smrg
702263847c39Smrg    -L* | -R* | -l*)
702363847c39Smrg       # Some compilers place space between "-{L,R}" and the path.
702463847c39Smrg       # Remove the space.
702563847c39Smrg       if test $p = "-L" ||
702663847c39Smrg          test $p = "-R"; then
702763847c39Smrg	 prev=$p
702863847c39Smrg	 continue
702963847c39Smrg       fi
70301ae1b5e8Smrg
703163847c39Smrg       # Expand the sysroot to ease extracting the directories later.
703263847c39Smrg       if test -z "$prev"; then
703363847c39Smrg         case $p in
703463847c39Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
703563847c39Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
703663847c39Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
703763847c39Smrg         esac
703863847c39Smrg       fi
703963847c39Smrg       case $p in
704063847c39Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
704163847c39Smrg       esac
704263847c39Smrg       if test "$pre_test_object_deps_done" = no; then
704363847c39Smrg	 case ${prev} in
704463847c39Smrg	 -L | -R)
704563847c39Smrg	   # Internal compiler library paths should come after those
704663847c39Smrg	   # provided the user.  The postdeps already come after the
704763847c39Smrg	   # user supplied libs so there is no need to process them.
704863847c39Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
704963847c39Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
705063847c39Smrg	   else
705163847c39Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
705263847c39Smrg	   fi
705363847c39Smrg	   ;;
705463847c39Smrg	 # The "-l" case would never come before the object being
705563847c39Smrg	 # linked, so don't bother handling this case.
705663847c39Smrg	 esac
705763847c39Smrg       else
705863847c39Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
705963847c39Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
706063847c39Smrg	 else
706163847c39Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
706263847c39Smrg	 fi
706363847c39Smrg       fi
706463847c39Smrg       prev=
706563847c39Smrg       ;;
70661ae1b5e8Smrg
706763847c39Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
706863847c39Smrg    *.$objext)
706963847c39Smrg       # This assumes that the test object file only shows up
707063847c39Smrg       # once in the compiler output.
707163847c39Smrg       if test "$p" = "conftest.$objext"; then
707263847c39Smrg	 pre_test_object_deps_done=yes
707363847c39Smrg	 continue
707463847c39Smrg       fi
70751ae1b5e8Smrg
707663847c39Smrg       if test "$pre_test_object_deps_done" = no; then
707763847c39Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
707863847c39Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
707963847c39Smrg	 else
708063847c39Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
708163847c39Smrg	 fi
708263847c39Smrg       else
708363847c39Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
708463847c39Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
708563847c39Smrg	 else
708663847c39Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
708763847c39Smrg	 fi
708863847c39Smrg       fi
708963847c39Smrg       ;;
70901ae1b5e8Smrg
709163847c39Smrg    *) ;; # Ignore the rest.
70921ae1b5e8Smrg
709363847c39Smrg    esac
709463847c39Smrg  done
70951ae1b5e8Smrg
709663847c39Smrg  # Clean up.
709763847c39Smrg  rm -f a.out a.exe
709863847c39Smrgelse
709963847c39Smrg  echo "libtool.m4: error: problem compiling $1 test program"
710063847c39Smrgfi
71011ae1b5e8Smrg
710263847c39Smrg$RM -f confest.$objext
710363847c39SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
710463847c39Smrg
710563847c39Smrg# PORTME: override above test on systems where it is broken
710663847c39Smrgm4_if([$1], [CXX],
710763847c39Smrg[case $host_os in
710863847c39Smrginterix[[3-9]]*)
710963847c39Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
711063847c39Smrg  # hack all around it, let's just trust "g++" to DTRT.
711163847c39Smrg  _LT_TAGVAR(predep_objects,$1)=
711263847c39Smrg  _LT_TAGVAR(postdep_objects,$1)=
711363847c39Smrg  _LT_TAGVAR(postdeps,$1)=
711463847c39Smrg  ;;
71151ae1b5e8Smrg
711663847c39Smrglinux*)
711763847c39Smrg  case `$CC -V 2>&1 | sed 5q` in
711863847c39Smrg  *Sun\ C*)
711963847c39Smrg    # Sun C++ 5.9
712063847c39Smrg
712163847c39Smrg    # The more standards-conforming stlport4 library is
712263847c39Smrg    # incompatible with the Cstd library. Avoid specifying
712363847c39Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
712463847c39Smrg    # -library=stlport4 depends on it.
712563847c39Smrg    case " $CXX $CXXFLAGS " in
712663847c39Smrg    *" -library=stlport4 "*)
712763847c39Smrg      solaris_use_stlport4=yes
7128d8556812Smrg      ;;
712963847c39Smrg    esac
71301ae1b5e8Smrg
713163847c39Smrg    if test "$solaris_use_stlport4" != yes; then
713263847c39Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
713363847c39Smrg    fi
713463847c39Smrg    ;;
713563847c39Smrg  esac
713663847c39Smrg  ;;
713763847c39Smrg
713863847c39Smrgsolaris*)
713963847c39Smrg  case $cc_basename in
714063847c39Smrg  CC* | sunCC*)
714163847c39Smrg    # The more standards-conforming stlport4 library is
714263847c39Smrg    # incompatible with the Cstd library. Avoid specifying
714363847c39Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
714463847c39Smrg    # -library=stlport4 depends on it.
714563847c39Smrg    case " $CXX $CXXFLAGS " in
714663847c39Smrg    *" -library=stlport4 "*)
714763847c39Smrg      solaris_use_stlport4=yes
7148d8556812Smrg      ;;
714963847c39Smrg    esac
715076888252Smrg
715163847c39Smrg    # Adding this requires a known-good setup of shared libraries for
715263847c39Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
715363847c39Smrg    # archive will be linked into the output, leading to subtle bugs.
715463847c39Smrg    if test "$solaris_use_stlport4" != yes; then
715563847c39Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
715663847c39Smrg    fi
715763847c39Smrg    ;;
715863847c39Smrg  esac
715963847c39Smrg  ;;
716063847c39Smrgesac
716163847c39Smrg])
716276888252Smrg
716363847c39Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
716463847c39Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
716563847c39Smrgesac
716663847c39Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
716763847c39Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
716863847c39Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
716963847c39Smrgfi
717063847c39Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
717163847c39Smrg    [The directories searched by this compiler when creating a shared library])
717263847c39Smrg_LT_TAGDECL([], [predep_objects], [1],
717363847c39Smrg    [Dependencies to place before and after the objects being linked to
717463847c39Smrg    create a shared library])
717563847c39Smrg_LT_TAGDECL([], [postdep_objects], [1])
717663847c39Smrg_LT_TAGDECL([], [predeps], [1])
717763847c39Smrg_LT_TAGDECL([], [postdeps], [1])
717863847c39Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
717963847c39Smrg    [The library search path used internally by the compiler when linking
718063847c39Smrg    a shared library])
718163847c39Smrg])# _LT_SYS_HIDDEN_LIBDEPS
718263847c39Smrg
718363847c39Smrg
718463847c39Smrg# _LT_LANG_F77_CONFIG([TAG])
718563847c39Smrg# --------------------------
718663847c39Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
718763847c39Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
718863847c39Smrg# to write the compiler configuration to `libtool'.
718963847c39Smrgm4_defun([_LT_LANG_F77_CONFIG],
719063847c39Smrg[AC_LANG_PUSH(Fortran 77)
719163847c39Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
719263847c39Smrg  _lt_disable_F77=yes
719363847c39Smrgfi
719476888252Smrg
719563847c39Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
719663847c39Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
719763847c39Smrg_LT_TAGVAR(always_export_symbols, $1)=no
719863847c39Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
719963847c39Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
720063847c39Smrg_LT_TAGVAR(hardcode_direct, $1)=no
720163847c39Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
720263847c39Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
720363847c39Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
720463847c39Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
720563847c39Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
720663847c39Smrg_LT_TAGVAR(inherit_rpath, $1)=no
720763847c39Smrg_LT_TAGVAR(module_cmds, $1)=
720863847c39Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
720963847c39Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
721063847c39Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
721163847c39Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
721263847c39Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
721363847c39Smrg_LT_TAGVAR(no_undefined_flag, $1)=
721463847c39Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
721563847c39Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
721676888252Smrg
721763847c39Smrg# Source file extension for f77 test sources.
721863847c39Smrgac_ext=f
721976888252Smrg
722063847c39Smrg# Object file extension for compiled f77 test sources.
722163847c39Smrgobjext=o
722263847c39Smrg_LT_TAGVAR(objext, $1)=$objext
722363847c39Smrg
722463847c39Smrg# No sense in running all these tests if we already determined that
722563847c39Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
722663847c39Smrg# are currently assumed to apply to all compilers on this platform,
722763847c39Smrg# and will be corrupted by setting them based on a non-working compiler.
722863847c39Smrgif test "$_lt_disable_F77" != yes; then
722963847c39Smrg  # Code to be used in simple compile tests
723063847c39Smrg  lt_simple_compile_test_code="\
723163847c39Smrg      subroutine t
723263847c39Smrg      return
723363847c39Smrg      end
723463847c39Smrg"
723576888252Smrg
723663847c39Smrg  # Code to be used in simple link tests
723763847c39Smrg  lt_simple_link_test_code="\
723863847c39Smrg      program t
723963847c39Smrg      end
724063847c39Smrg"
724176888252Smrg
724263847c39Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
724363847c39Smrg  _LT_TAG_COMPILER
724463847c39Smrg
724563847c39Smrg  # save warnings/boilerplate of simple test code
724663847c39Smrg  _LT_COMPILER_BOILERPLATE
724763847c39Smrg  _LT_LINKER_BOILERPLATE
724863847c39Smrg
724963847c39Smrg  # Allow CC to be a program name with arguments.
725063847c39Smrg  lt_save_CC="$CC"
725163847c39Smrg  lt_save_GCC=$GCC
725263847c39Smrg  lt_save_CFLAGS=$CFLAGS
725363847c39Smrg  CC=${F77-"f77"}
725463847c39Smrg  CFLAGS=$FFLAGS
725563847c39Smrg  compiler=$CC
725663847c39Smrg  _LT_TAGVAR(compiler, $1)=$CC
725763847c39Smrg  _LT_CC_BASENAME([$compiler])
725863847c39Smrg  GCC=$G77
725963847c39Smrg  if test -n "$compiler"; then
726063847c39Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
726163847c39Smrg    AC_MSG_RESULT([$can_build_shared])
726276888252Smrg
726363847c39Smrg    AC_MSG_CHECKING([whether to build shared libraries])
726463847c39Smrg    test "$can_build_shared" = "no" && enable_shared=no
726576888252Smrg
726663847c39Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
726763847c39Smrg    # are all built from PIC.
7268d8556812Smrg    case $host_os in
726963847c39Smrg      aix3*)
727063847c39Smrg        test "$enable_shared" = yes && enable_static=no
727163847c39Smrg        if test -n "$RANLIB"; then
727263847c39Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
727363847c39Smrg          postinstall_cmds='$RANLIB $lib'
727463847c39Smrg        fi
727563847c39Smrg        ;;
727663847c39Smrg      aix[[4-9]]*)
727763847c39Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
727863847c39Smrg	  test "$enable_shared" = yes && enable_static=no
7279d8556812Smrg	fi
728063847c39Smrg        ;;
728163847c39Smrg    esac
728263847c39Smrg    AC_MSG_RESULT([$enable_shared])
728363847c39Smrg
728463847c39Smrg    AC_MSG_CHECKING([whether to build static libraries])
728563847c39Smrg    # Make sure either enable_shared or enable_static is yes.
728663847c39Smrg    test "$enable_shared" = yes || enable_static=yes
728763847c39Smrg    AC_MSG_RESULT([$enable_static])
728863847c39Smrg
728963847c39Smrg    _LT_TAGVAR(GCC, $1)="$G77"
729063847c39Smrg    _LT_TAGVAR(LD, $1)="$LD"
729163847c39Smrg
729263847c39Smrg    ## CAVEAT EMPTOR:
729363847c39Smrg    ## There is no encapsulation within the following macros, do not change
729463847c39Smrg    ## the running order or otherwise move them around unless you know exactly
729563847c39Smrg    ## what you are doing...
729663847c39Smrg    _LT_COMPILER_PIC($1)
729763847c39Smrg    _LT_COMPILER_C_O($1)
729863847c39Smrg    _LT_COMPILER_FILE_LOCKS($1)
729963847c39Smrg    _LT_LINKER_SHLIBS($1)
730063847c39Smrg    _LT_SYS_DYNAMIC_LINKER($1)
730163847c39Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
730263847c39Smrg
730363847c39Smrg    _LT_CONFIG($1)
730463847c39Smrg  fi # test -n "$compiler"
730563847c39Smrg
730663847c39Smrg  GCC=$lt_save_GCC
730763847c39Smrg  CC="$lt_save_CC"
730863847c39Smrg  CFLAGS="$lt_save_CFLAGS"
730963847c39Smrgfi # test "$_lt_disable_F77" != yes
731076888252Smrg
731163847c39SmrgAC_LANG_POP
731263847c39Smrg])# _LT_LANG_F77_CONFIG
731376888252Smrg
731476888252Smrg
731563847c39Smrg# _LT_LANG_FC_CONFIG([TAG])
731663847c39Smrg# -------------------------
731763847c39Smrg# Ensure that the configuration variables for a Fortran compiler are
731863847c39Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
731963847c39Smrg# to write the compiler configuration to `libtool'.
732063847c39Smrgm4_defun([_LT_LANG_FC_CONFIG],
732163847c39Smrg[AC_LANG_PUSH(Fortran)
732263847c39Smrg
732363847c39Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
732463847c39Smrg  _lt_disable_FC=yes
732563847c39Smrgfi
732676888252Smrg
732763847c39Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
732863847c39Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
732963847c39Smrg_LT_TAGVAR(always_export_symbols, $1)=no
733063847c39Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
733163847c39Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
733263847c39Smrg_LT_TAGVAR(hardcode_direct, $1)=no
733363847c39Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
733463847c39Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
733563847c39Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
733663847c39Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
733763847c39Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
733863847c39Smrg_LT_TAGVAR(inherit_rpath, $1)=no
733963847c39Smrg_LT_TAGVAR(module_cmds, $1)=
734063847c39Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
734163847c39Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
734263847c39Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
734363847c39Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
734463847c39Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
734563847c39Smrg_LT_TAGVAR(no_undefined_flag, $1)=
734663847c39Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
734763847c39Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
734863847c39Smrg
734963847c39Smrg# Source file extension for fc test sources.
735063847c39Smrgac_ext=${ac_fc_srcext-f}
735163847c39Smrg
735263847c39Smrg# Object file extension for compiled fc test sources.
735363847c39Smrgobjext=o
735463847c39Smrg_LT_TAGVAR(objext, $1)=$objext
735563847c39Smrg
735663847c39Smrg# No sense in running all these tests if we already determined that
735763847c39Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
735863847c39Smrg# are currently assumed to apply to all compilers on this platform,
735963847c39Smrg# and will be corrupted by setting them based on a non-working compiler.
736063847c39Smrgif test "$_lt_disable_FC" != yes; then
736163847c39Smrg  # Code to be used in simple compile tests
736263847c39Smrg  lt_simple_compile_test_code="\
736363847c39Smrg      subroutine t
736463847c39Smrg      return
736563847c39Smrg      end
736663847c39Smrg"
736776888252Smrg
736863847c39Smrg  # Code to be used in simple link tests
736963847c39Smrg  lt_simple_link_test_code="\
737063847c39Smrg      program t
737163847c39Smrg      end
737263847c39Smrg"
737376888252Smrg
737463847c39Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
737563847c39Smrg  _LT_TAG_COMPILER
737663847c39Smrg
737763847c39Smrg  # save warnings/boilerplate of simple test code
737863847c39Smrg  _LT_COMPILER_BOILERPLATE
737963847c39Smrg  _LT_LINKER_BOILERPLATE
738063847c39Smrg
738163847c39Smrg  # Allow CC to be a program name with arguments.
738263847c39Smrg  lt_save_CC="$CC"
738363847c39Smrg  lt_save_GCC=$GCC
738463847c39Smrg  lt_save_CFLAGS=$CFLAGS
738563847c39Smrg  CC=${FC-"f95"}
738663847c39Smrg  CFLAGS=$FCFLAGS
738763847c39Smrg  compiler=$CC
738863847c39Smrg  GCC=$ac_cv_fc_compiler_gnu
738963847c39Smrg
739063847c39Smrg  _LT_TAGVAR(compiler, $1)=$CC
739163847c39Smrg  _LT_CC_BASENAME([$compiler])
739263847c39Smrg
739363847c39Smrg  if test -n "$compiler"; then
739463847c39Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
739563847c39Smrg    AC_MSG_RESULT([$can_build_shared])
739663847c39Smrg
739763847c39Smrg    AC_MSG_CHECKING([whether to build shared libraries])
739863847c39Smrg    test "$can_build_shared" = "no" && enable_shared=no
739963847c39Smrg
740063847c39Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
740163847c39Smrg    # are all built from PIC.
740263847c39Smrg    case $host_os in
740363847c39Smrg      aix3*)
740463847c39Smrg        test "$enable_shared" = yes && enable_static=no
740563847c39Smrg        if test -n "$RANLIB"; then
740663847c39Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
740763847c39Smrg          postinstall_cmds='$RANLIB $lib'
740863847c39Smrg        fi
740963847c39Smrg        ;;
741063847c39Smrg      aix[[4-9]]*)
741163847c39Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
741263847c39Smrg	  test "$enable_shared" = yes && enable_static=no
7413d8556812Smrg	fi
741463847c39Smrg        ;;
741563847c39Smrg    esac
741663847c39Smrg    AC_MSG_RESULT([$enable_shared])
741763847c39Smrg
741863847c39Smrg    AC_MSG_CHECKING([whether to build static libraries])
741963847c39Smrg    # Make sure either enable_shared or enable_static is yes.
742063847c39Smrg    test "$enable_shared" = yes || enable_static=yes
742163847c39Smrg    AC_MSG_RESULT([$enable_static])
742263847c39Smrg
742363847c39Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
742463847c39Smrg    _LT_TAGVAR(LD, $1)="$LD"
742563847c39Smrg
742663847c39Smrg    ## CAVEAT EMPTOR:
742763847c39Smrg    ## There is no encapsulation within the following macros, do not change
742863847c39Smrg    ## the running order or otherwise move them around unless you know exactly
742963847c39Smrg    ## what you are doing...
743063847c39Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
743163847c39Smrg    _LT_COMPILER_PIC($1)
743263847c39Smrg    _LT_COMPILER_C_O($1)
743363847c39Smrg    _LT_COMPILER_FILE_LOCKS($1)
743463847c39Smrg    _LT_LINKER_SHLIBS($1)
743563847c39Smrg    _LT_SYS_DYNAMIC_LINKER($1)
743663847c39Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
743763847c39Smrg
743863847c39Smrg    _LT_CONFIG($1)
743963847c39Smrg  fi # test -n "$compiler"
744063847c39Smrg
744163847c39Smrg  GCC=$lt_save_GCC
744263847c39Smrg  CC=$lt_save_CC
744363847c39Smrg  CFLAGS=$lt_save_CFLAGS
744463847c39Smrgfi # test "$_lt_disable_FC" != yes
744576888252Smrg
744663847c39SmrgAC_LANG_POP
744763847c39Smrg])# _LT_LANG_FC_CONFIG
744876888252Smrg
744976888252Smrg
745063847c39Smrg# _LT_LANG_GCJ_CONFIG([TAG])
745163847c39Smrg# --------------------------
745263847c39Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
745363847c39Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
745463847c39Smrg# to write the compiler configuration to `libtool'.
745563847c39Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
745663847c39Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
745763847c39SmrgAC_LANG_SAVE
745876888252Smrg
745963847c39Smrg# Source file extension for Java test sources.
746063847c39Smrgac_ext=java
746176888252Smrg
746263847c39Smrg# Object file extension for compiled Java test sources.
746363847c39Smrgobjext=o
746463847c39Smrg_LT_TAGVAR(objext, $1)=$objext
746576888252Smrg
746663847c39Smrg# Code to be used in simple compile tests
746763847c39Smrglt_simple_compile_test_code="class foo {}"
746876888252Smrg
746963847c39Smrg# Code to be used in simple link tests
747063847c39Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
747163847c39Smrg
747263847c39Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
747363847c39Smrg_LT_TAG_COMPILER
747463847c39Smrg
747563847c39Smrg# save warnings/boilerplate of simple test code
747663847c39Smrg_LT_COMPILER_BOILERPLATE
747763847c39Smrg_LT_LINKER_BOILERPLATE
747863847c39Smrg
747963847c39Smrg# Allow CC to be a program name with arguments.
748063847c39Smrglt_save_CC=$CC
748163847c39Smrglt_save_CFLAGS=$CFLAGS
748263847c39Smrglt_save_GCC=$GCC
748363847c39SmrgGCC=yes
748463847c39SmrgCC=${GCJ-"gcj"}
748563847c39SmrgCFLAGS=$GCJFLAGS
748663847c39Smrgcompiler=$CC
748763847c39Smrg_LT_TAGVAR(compiler, $1)=$CC
748863847c39Smrg_LT_TAGVAR(LD, $1)="$LD"
748963847c39Smrg_LT_CC_BASENAME([$compiler])
749076888252Smrg
749163847c39Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
749263847c39Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
749376888252Smrg
749463847c39Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
749563847c39Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
749663847c39Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
749776888252Smrg
749863847c39Smrgif test -n "$compiler"; then
749963847c39Smrg  _LT_COMPILER_NO_RTTI($1)
750063847c39Smrg  _LT_COMPILER_PIC($1)
750163847c39Smrg  _LT_COMPILER_C_O($1)
750263847c39Smrg  _LT_COMPILER_FILE_LOCKS($1)
750363847c39Smrg  _LT_LINKER_SHLIBS($1)
750463847c39Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
750576888252Smrg
750663847c39Smrg  _LT_CONFIG($1)
750763847c39Smrgfi
750876888252Smrg
750963847c39SmrgAC_LANG_RESTORE
751076888252Smrg
751163847c39SmrgGCC=$lt_save_GCC
751263847c39SmrgCC=$lt_save_CC
751363847c39SmrgCFLAGS=$lt_save_CFLAGS
751463847c39Smrg])# _LT_LANG_GCJ_CONFIG
751576888252Smrg
751676888252Smrg
751763847c39Smrg# _LT_LANG_GO_CONFIG([TAG])
751863847c39Smrg# --------------------------
751963847c39Smrg# Ensure that the configuration variables for the GNU Go compiler
752063847c39Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
752163847c39Smrg# to write the compiler configuration to `libtool'.
752263847c39Smrgm4_defun([_LT_LANG_GO_CONFIG],
752363847c39Smrg[AC_REQUIRE([LT_PROG_GO])dnl
752463847c39SmrgAC_LANG_SAVE
752576888252Smrg
752663847c39Smrg# Source file extension for Go test sources.
752763847c39Smrgac_ext=go
752876888252Smrg
752963847c39Smrg# Object file extension for compiled Go test sources.
753063847c39Smrgobjext=o
753163847c39Smrg_LT_TAGVAR(objext, $1)=$objext
753276888252Smrg
753363847c39Smrg# Code to be used in simple compile tests
753463847c39Smrglt_simple_compile_test_code="package main; func main() { }"
753576888252Smrg
753663847c39Smrg# Code to be used in simple link tests
753763847c39Smrglt_simple_link_test_code='package main; func main() { }'
753876888252Smrg
753963847c39Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
754063847c39Smrg_LT_TAG_COMPILER
754176888252Smrg
754263847c39Smrg# save warnings/boilerplate of simple test code
754363847c39Smrg_LT_COMPILER_BOILERPLATE
754463847c39Smrg_LT_LINKER_BOILERPLATE
754576888252Smrg
754663847c39Smrg# Allow CC to be a program name with arguments.
754763847c39Smrglt_save_CC=$CC
754863847c39Smrglt_save_CFLAGS=$CFLAGS
754963847c39Smrglt_save_GCC=$GCC
755063847c39SmrgGCC=yes
755163847c39SmrgCC=${GOC-"gccgo"}
755263847c39SmrgCFLAGS=$GOFLAGS
755363847c39Smrgcompiler=$CC
755463847c39Smrg_LT_TAGVAR(compiler, $1)=$CC
755563847c39Smrg_LT_TAGVAR(LD, $1)="$LD"
755663847c39Smrg_LT_CC_BASENAME([$compiler])
755776888252Smrg
755863847c39Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
755963847c39Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
756076888252Smrg
756163847c39Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
756263847c39Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
756363847c39Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
756476888252Smrg
756563847c39Smrgif test -n "$compiler"; then
756663847c39Smrg  _LT_COMPILER_NO_RTTI($1)
756763847c39Smrg  _LT_COMPILER_PIC($1)
756863847c39Smrg  _LT_COMPILER_C_O($1)
756963847c39Smrg  _LT_COMPILER_FILE_LOCKS($1)
757063847c39Smrg  _LT_LINKER_SHLIBS($1)
757163847c39Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
757276888252Smrg
757363847c39Smrg  _LT_CONFIG($1)
757463847c39Smrgfi
757576888252Smrg
757663847c39SmrgAC_LANG_RESTORE
757776888252Smrg
757863847c39SmrgGCC=$lt_save_GCC
757963847c39SmrgCC=$lt_save_CC
758063847c39SmrgCFLAGS=$lt_save_CFLAGS
758163847c39Smrg])# _LT_LANG_GO_CONFIG
758276888252Smrg
758376888252Smrg
758463847c39Smrg# _LT_LANG_RC_CONFIG([TAG])
758563847c39Smrg# -------------------------
758663847c39Smrg# Ensure that the configuration variables for the Windows resource compiler
758763847c39Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
758863847c39Smrg# to write the compiler configuration to `libtool'.
758963847c39Smrgm4_defun([_LT_LANG_RC_CONFIG],
759063847c39Smrg[AC_REQUIRE([LT_PROG_RC])dnl
759163847c39SmrgAC_LANG_SAVE
759276888252Smrg
759363847c39Smrg# Source file extension for RC test sources.
759463847c39Smrgac_ext=rc
759576888252Smrg
759663847c39Smrg# Object file extension for compiled RC test sources.
759763847c39Smrgobjext=o
759863847c39Smrg_LT_TAGVAR(objext, $1)=$objext
759976888252Smrg
760063847c39Smrg# Code to be used in simple compile tests
760163847c39Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
760276888252Smrg
760363847c39Smrg# Code to be used in simple link tests
760463847c39Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
760576888252Smrg
760663847c39Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
760763847c39Smrg_LT_TAG_COMPILER
760876888252Smrg
760963847c39Smrg# save warnings/boilerplate of simple test code
761063847c39Smrg_LT_COMPILER_BOILERPLATE
761163847c39Smrg_LT_LINKER_BOILERPLATE
761276888252Smrg
761363847c39Smrg# Allow CC to be a program name with arguments.
761463847c39Smrglt_save_CC="$CC"
761563847c39Smrglt_save_CFLAGS=$CFLAGS
761663847c39Smrglt_save_GCC=$GCC
761763847c39SmrgGCC=
761863847c39SmrgCC=${RC-"windres"}
761963847c39SmrgCFLAGS=
762063847c39Smrgcompiler=$CC
762163847c39Smrg_LT_TAGVAR(compiler, $1)=$CC
762263847c39Smrg_LT_CC_BASENAME([$compiler])
762363847c39Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
762476888252Smrg
762563847c39Smrgif test -n "$compiler"; then
762663847c39Smrg  :
762763847c39Smrg  _LT_CONFIG($1)
762863847c39Smrgfi
762963847c39Smrg
763063847c39SmrgGCC=$lt_save_GCC
763163847c39SmrgAC_LANG_RESTORE
763263847c39SmrgCC=$lt_save_CC
763363847c39SmrgCFLAGS=$lt_save_CFLAGS
763463847c39Smrg])# _LT_LANG_RC_CONFIG
763576888252Smrg
763676888252Smrg
763763847c39Smrg# LT_PROG_GCJ
763863847c39Smrg# -----------
763963847c39SmrgAC_DEFUN([LT_PROG_GCJ],
764063847c39Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
764163847c39Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
764263847c39Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
764363847c39Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
764463847c39Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
764563847c39Smrg])
764663847c39Smrg
764763847c39Smrg# Old name:
764863847c39SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
764963847c39Smrgdnl aclocal-1.4 backwards compatibility:
765063847c39Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
76511ae1b5e8Smrg
76521ae1b5e8Smrg
765363847c39Smrg# LT_PROG_GO
765463847c39Smrg# ----------
765563847c39SmrgAC_DEFUN([LT_PROG_GO],
765663847c39Smrg[AC_CHECK_TOOL(GOC, gccgo,)
765763847c39Smrg])
765876888252Smrg
765976888252Smrg
766063847c39Smrg# LT_PROG_RC
766163847c39Smrg# ----------
766263847c39SmrgAC_DEFUN([LT_PROG_RC],
766363847c39Smrg[AC_CHECK_TOOL(RC, windres,)
7664d8556812Smrg])
766576888252Smrg
766663847c39Smrg# Old name:
766763847c39SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
766863847c39Smrgdnl aclocal-1.4 backwards compatibility:
766963847c39Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
767063847c39Smrg
767163847c39Smrg
767263847c39Smrg# _LT_DECL_EGREP
767363847c39Smrg# --------------
767463847c39Smrg# If we don't have a new enough Autoconf to choose the best grep
767563847c39Smrg# available, choose the one first in the user's PATH.
767663847c39Smrgm4_defun([_LT_DECL_EGREP],
767763847c39Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
767863847c39SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
767963847c39Smrgtest -z "$GREP" && GREP=grep
768063847c39Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
768163847c39Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
768263847c39Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
768363847c39Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
768463847c39SmrgAC_SUBST([GREP])
768586dafe34Smrg])
768676888252Smrg
768776888252Smrg
768863847c39Smrg# _LT_DECL_OBJDUMP
768963847c39Smrg# --------------
769063847c39Smrg# If we don't have a new enough Autoconf to choose the best objdump
769163847c39Smrg# available, choose the one first in the user's PATH.
769263847c39Smrgm4_defun([_LT_DECL_OBJDUMP],
769363847c39Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
769463847c39Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
769563847c39Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
769663847c39SmrgAC_SUBST([OBJDUMP])
769763847c39Smrg])
769876888252Smrg
769963847c39Smrg# _LT_DECL_DLLTOOL
7700d8556812Smrg# ----------------
770163847c39Smrg# Ensure DLLTOOL variable is set.
770263847c39Smrgm4_defun([_LT_DECL_DLLTOOL],
770363847c39Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
770463847c39Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
770563847c39Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
770663847c39SmrgAC_SUBST([DLLTOOL])
770763847c39Smrg])
770876888252Smrg
770963847c39Smrg# _LT_DECL_SED
771063847c39Smrg# ------------
771163847c39Smrg# Check for a fully-functional sed program, that truncates
771263847c39Smrg# as few characters as possible.  Prefer GNU sed if found.
771363847c39Smrgm4_defun([_LT_DECL_SED],
771463847c39Smrg[AC_PROG_SED
771563847c39Smrgtest -z "$SED" && SED=sed
771663847c39SmrgXsed="$SED -e 1s/^X//"
771763847c39Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
771863847c39Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
771963847c39Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
772063847c39Smrg])# _LT_DECL_SED
772176888252Smrg
772263847c39Smrgm4_ifndef([AC_PROG_SED], [
7723d8556812Smrg# NOTE: This macro has been submitted for inclusion into   #
7724d8556812Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
7725d8556812Smrg#  a released version of Autoconf we should remove this    #
772663847c39Smrg#  macro and use it instead.                               #
772763847c39Smrg
772863847c39Smrgm4_defun([AC_PROG_SED],
7729d8556812Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
7730d8556812SmrgAC_CACHE_VAL(lt_cv_path_SED,
7731d8556812Smrg[# Loop through the user's path and test for sed and gsed.
7732d8556812Smrg# Then use that list of sed's as ones to test for truncation.
7733d8556812Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7734d8556812Smrgfor as_dir in $PATH
7735d8556812Smrgdo
7736d8556812Smrg  IFS=$as_save_IFS
7737d8556812Smrg  test -z "$as_dir" && as_dir=.
7738d8556812Smrg  for lt_ac_prog in sed gsed; do
7739d8556812Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
774063847c39Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7741d8556812Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7742d8556812Smrg      fi
7743d8556812Smrg    done
7744d8556812Smrg  done
7745d8556812Smrgdone
7746d8556812SmrgIFS=$as_save_IFS
7747d8556812Smrglt_ac_max=0
7748d8556812Smrglt_ac_count=0
7749d8556812Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
7750d8556812Smrg# along with /bin/sed that truncates output.
7751d8556812Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7752d8556812Smrg  test ! -f $lt_ac_sed && continue
7753d8556812Smrg  cat /dev/null > conftest.in
7754d8556812Smrg  lt_ac_count=0
7755d8556812Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7756d8556812Smrg  # Check for GNU sed and select it if it is found.
7757d8556812Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7758d8556812Smrg    lt_cv_path_SED=$lt_ac_sed
7759d8556812Smrg    break
7760d8556812Smrg  fi
7761d8556812Smrg  while true; do
7762d8556812Smrg    cat conftest.in conftest.in >conftest.tmp
7763d8556812Smrg    mv conftest.tmp conftest.in
7764d8556812Smrg    cp conftest.in conftest.nl
7765d8556812Smrg    echo >>conftest.nl
7766d8556812Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7767d8556812Smrg    cmp -s conftest.out conftest.nl || break
7768d8556812Smrg    # 10000 chars as input seems more than enough
7769d8556812Smrg    test $lt_ac_count -gt 10 && break
7770d8556812Smrg    lt_ac_count=`expr $lt_ac_count + 1`
7771d8556812Smrg    if test $lt_ac_count -gt $lt_ac_max; then
7772d8556812Smrg      lt_ac_max=$lt_ac_count
7773d8556812Smrg      lt_cv_path_SED=$lt_ac_sed
7774d8556812Smrg    fi
7775d8556812Smrg  done
7776d8556812Smrgdone
7777d8556812Smrg])
7778d8556812SmrgSED=$lt_cv_path_SED
7779d8556812SmrgAC_SUBST([SED])
7780d8556812SmrgAC_MSG_RESULT([$SED])
778163847c39Smrg])#AC_PROG_SED
778263847c39Smrg])#m4_ifndef
778363847c39Smrg
778463847c39Smrg# Old name:
778563847c39SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
778663847c39Smrgdnl aclocal-1.4 backwards compatibility:
778763847c39Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
778863847c39Smrg
778963847c39Smrg
779063847c39Smrg# _LT_CHECK_SHELL_FEATURES
779163847c39Smrg# ------------------------
779263847c39Smrg# Find out whether the shell is Bourne or XSI compatible,
779363847c39Smrg# or has some other useful features.
779463847c39Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
779563847c39Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
779663847c39Smrg# Try some XSI features
779763847c39Smrgxsi_shell=no
779863847c39Smrg( _lt_dummy="a/b/c"
779963847c39Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
780063847c39Smrg      = c,a/b,b/c, \
780163847c39Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
780263847c39Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
780363847c39Smrg  && xsi_shell=yes
780463847c39SmrgAC_MSG_RESULT([$xsi_shell])
780563847c39Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
780663847c39Smrg
780763847c39SmrgAC_MSG_CHECKING([whether the shell understands "+="])
780863847c39Smrglt_shell_append=no
780963847c39Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
781063847c39Smrg    >/dev/null 2>&1 \
781163847c39Smrg  && lt_shell_append=yes
781263847c39SmrgAC_MSG_RESULT([$lt_shell_append])
781363847c39Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
781463847c39Smrg
781563847c39Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
781663847c39Smrg  lt_unset=unset
781763847c39Smrgelse
781863847c39Smrg  lt_unset=false
781963847c39Smrgfi
782063847c39Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
782163847c39Smrg
782263847c39Smrg# test EBCDIC or ASCII
782363847c39Smrgcase `echo X|tr X '\101'` in
782463847c39Smrg A) # ASCII based system
782563847c39Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
782663847c39Smrg  lt_SP2NL='tr \040 \012'
782763847c39Smrg  lt_NL2SP='tr \015\012 \040\040'
782863847c39Smrg  ;;
782963847c39Smrg *) # EBCDIC based system
783063847c39Smrg  lt_SP2NL='tr \100 \n'
783163847c39Smrg  lt_NL2SP='tr \r\n \100\100'
783263847c39Smrg  ;;
783363847c39Smrgesac
783463847c39Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
783563847c39Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
783663847c39Smrg])# _LT_CHECK_SHELL_FEATURES
783763847c39Smrg
783863847c39Smrg
783963847c39Smrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
784063847c39Smrg# ------------------------------------------------------
784163847c39Smrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
784263847c39Smrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
784363847c39Smrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
784463847c39Smrg[dnl {
784563847c39Smrgsed -e '/^$1 ()$/,/^} # $1 /c\
784663847c39Smrg$1 ()\
784763847c39Smrg{\
784863847c39Smrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
784963847c39Smrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
785063847c39Smrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
785163847c39Smrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
785263847c39Smrgtest 0 -eq $? || _lt_function_replace_fail=:
785363847c39Smrg])
785463847c39Smrg
785563847c39Smrg
785663847c39Smrg# _LT_PROG_REPLACE_SHELLFNS
785763847c39Smrg# -------------------------
785863847c39Smrg# Replace existing portable implementations of several shell functions with
785963847c39Smrg# equivalent extended shell implementations where those features are available..
786063847c39Smrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
786163847c39Smrg[if test x"$xsi_shell" = xyes; then
786263847c39Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
786363847c39Smrg    case ${1} in
786463847c39Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
786563847c39Smrg      *  ) func_dirname_result="${3}" ;;
786663847c39Smrg    esac])
786763847c39Smrg
786863847c39Smrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
786963847c39Smrg    func_basename_result="${1##*/}"])
787063847c39Smrg
787163847c39Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
787263847c39Smrg    case ${1} in
787363847c39Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
787463847c39Smrg      *  ) func_dirname_result="${3}" ;;
787563847c39Smrg    esac
787663847c39Smrg    func_basename_result="${1##*/}"])
787763847c39Smrg
787863847c39Smrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
787963847c39Smrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
788063847c39Smrg    # positional parameters, so assign one to ordinary parameter first.
788163847c39Smrg    func_stripname_result=${3}
788263847c39Smrg    func_stripname_result=${func_stripname_result#"${1}"}
788363847c39Smrg    func_stripname_result=${func_stripname_result%"${2}"}])
788463847c39Smrg
788563847c39Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
788663847c39Smrg    func_split_long_opt_name=${1%%=*}
788763847c39Smrg    func_split_long_opt_arg=${1#*=}])
788863847c39Smrg
788963847c39Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
789063847c39Smrg    func_split_short_opt_arg=${1#??}
789163847c39Smrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
789263847c39Smrg
789363847c39Smrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
789463847c39Smrg    case ${1} in
789563847c39Smrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
789663847c39Smrg      *)    func_lo2o_result=${1} ;;
789763847c39Smrg    esac])
789863847c39Smrg
789963847c39Smrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
790063847c39Smrg
790163847c39Smrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
790263847c39Smrg
790363847c39Smrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
790463847c39Smrgfi
790563847c39Smrg
790663847c39Smrgif test x"$lt_shell_append" = xyes; then
790763847c39Smrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
790863847c39Smrg
790963847c39Smrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
791063847c39Smrg    func_quote_for_eval "${2}"
791163847c39Smrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
791263847c39Smrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
791363847c39Smrg
791463847c39Smrg  # Save a `func_append' function call where possible by direct use of '+='
791563847c39Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
791663847c39Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
791763847c39Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
791863847c39Smrg  test 0 -eq $? || _lt_function_replace_fail=:
791963847c39Smrgelse
792063847c39Smrg  # Save a `func_append' function call even when '+=' is not available
792163847c39Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
792263847c39Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
792363847c39Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
792463847c39Smrg  test 0 -eq $? || _lt_function_replace_fail=:
792563847c39Smrgfi
792663847c39Smrg
792763847c39Smrgif test x"$_lt_function_replace_fail" = x":"; then
792863847c39Smrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
792963847c39Smrgfi
793063847c39Smrg])
793163847c39Smrg
793263847c39Smrg# _LT_PATH_CONVERSION_FUNCTIONS
793363847c39Smrg# -----------------------------
793463847c39Smrg# Determine which file name conversion functions should be used by
793563847c39Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
793663847c39Smrg# for certain cross-compile configurations and native mingw.
793763847c39Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
793863847c39Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
793963847c39SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
794063847c39SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
794163847c39SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
794263847c39Smrg[case $host in
794363847c39Smrg  *-*-mingw* )
794463847c39Smrg    case $build in
794563847c39Smrg      *-*-mingw* ) # actually msys
794663847c39Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
794763847c39Smrg        ;;
794863847c39Smrg      *-*-cygwin* )
794963847c39Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
795063847c39Smrg        ;;
795163847c39Smrg      * ) # otherwise, assume *nix
795263847c39Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
795363847c39Smrg        ;;
795463847c39Smrg    esac
795563847c39Smrg    ;;
795663847c39Smrg  *-*-cygwin* )
795763847c39Smrg    case $build in
795863847c39Smrg      *-*-mingw* ) # actually msys
795963847c39Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
796063847c39Smrg        ;;
796163847c39Smrg      *-*-cygwin* )
796263847c39Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
796363847c39Smrg        ;;
796463847c39Smrg      * ) # otherwise, assume *nix
796563847c39Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
796663847c39Smrg        ;;
796763847c39Smrg    esac
796863847c39Smrg    ;;
796963847c39Smrg  * ) # unhandled hosts (and "normal" native builds)
797063847c39Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
797163847c39Smrg    ;;
797263847c39Smrgesac
797363847c39Smrg])
797463847c39Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
797563847c39SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
797663847c39Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
797763847c39Smrg         [0], [convert $build file names to $host format])dnl
797863847c39Smrg
797963847c39SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
798063847c39SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
798163847c39Smrg[#assume ordinary cross tools, or native build.
798263847c39Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
798363847c39Smrgcase $host in
798463847c39Smrg  *-*-mingw* )
798563847c39Smrg    case $build in
798663847c39Smrg      *-*-mingw* ) # actually msys
798763847c39Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
798863847c39Smrg        ;;
798963847c39Smrg    esac
799063847c39Smrg    ;;
799163847c39Smrgesac
799263847c39Smrg])
799363847c39Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
799463847c39SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
799563847c39Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
799663847c39Smrg         [0], [convert $build files to toolchain format])dnl
799763847c39Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
799863847c39Smrg
799963847c39Smrg# Helper functions for option handling.                    -*- Autoconf -*-
800063847c39Smrg#
800163847c39Smrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
800263847c39Smrg#   Inc.
800363847c39Smrg#   Written by Gary V. Vaughan, 2004
800463847c39Smrg#
800563847c39Smrg# This file is free software; the Free Software Foundation gives
800663847c39Smrg# unlimited permission to copy and/or distribute it, with or without
800763847c39Smrg# modifications, as long as this notice is preserved.
800863847c39Smrg
800963847c39Smrg# serial 7 ltoptions.m4
801063847c39Smrg
801163847c39Smrg# This is to help aclocal find these macros, as it can't see m4_define.
801263847c39SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
801363847c39Smrg
801463847c39Smrg
801563847c39Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
801663847c39Smrg# ------------------------------------------
801763847c39Smrgm4_define([_LT_MANGLE_OPTION],
801863847c39Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
801963847c39Smrg
802063847c39Smrg
802163847c39Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
802263847c39Smrg# ---------------------------------------
802363847c39Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
802463847c39Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
802563847c39Smrg# saved as a flag.
802663847c39Smrgm4_define([_LT_SET_OPTION],
802763847c39Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
802863847c39Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
802963847c39Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
803063847c39Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
803163847c39Smrg])
803263847c39Smrg
803363847c39Smrg
803463847c39Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
803563847c39Smrg# ------------------------------------------------------------
803663847c39Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
803763847c39Smrgm4_define([_LT_IF_OPTION],
803863847c39Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
803963847c39Smrg
804063847c39Smrg
804163847c39Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
804263847c39Smrg# -------------------------------------------------------
804363847c39Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
804463847c39Smrg# are set.
804563847c39Smrgm4_define([_LT_UNLESS_OPTIONS],
804663847c39Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
804763847c39Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
804863847c39Smrg		      [m4_define([$0_found])])])[]dnl
804963847c39Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
805063847c39Smrg])[]dnl
805163847c39Smrg])
805263847c39Smrg
805363847c39Smrg
805463847c39Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
805563847c39Smrg# ----------------------------------------
805663847c39Smrg# OPTION-LIST is a space-separated list of Libtool options associated
805763847c39Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
805863847c39Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
805963847c39Smrg# the unknown option and exit.
806063847c39Smrgm4_defun([_LT_SET_OPTIONS],
806163847c39Smrg[# Set options
806263847c39Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
806363847c39Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
806463847c39Smrg
806563847c39Smrgm4_if([$1],[LT_INIT],[
806663847c39Smrg  dnl
806763847c39Smrg  dnl Simply set some default values (i.e off) if boolean options were not
806863847c39Smrg  dnl specified:
806963847c39Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
807063847c39Smrg  ])
807163847c39Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
807263847c39Smrg  ])
807363847c39Smrg  dnl
807463847c39Smrg  dnl If no reference was made to various pairs of opposing options, then
807563847c39Smrg  dnl we run the default mode handler for the pair.  For example, if neither
807663847c39Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
807763847c39Smrg  dnl archives by default:
807863847c39Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
807963847c39Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
808063847c39Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
808163847c39Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
808263847c39Smrg  		   [_LT_ENABLE_FAST_INSTALL])
808363847c39Smrg  ])
808463847c39Smrg])# _LT_SET_OPTIONS
808563847c39Smrg
808663847c39Smrg
808763847c39Smrg
808863847c39Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
808963847c39Smrg# -----------------------------------------
809063847c39Smrgm4_define([_LT_MANGLE_DEFUN],
809163847c39Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
809263847c39Smrg
809363847c39Smrg
809463847c39Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
809563847c39Smrg# -----------------------------------------------
809663847c39Smrgm4_define([LT_OPTION_DEFINE],
809763847c39Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
809863847c39Smrg])# LT_OPTION_DEFINE
809963847c39Smrg
810063847c39Smrg
810163847c39Smrg# dlopen
810263847c39Smrg# ------
810363847c39SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
810463847c39Smrg])
810563847c39Smrg
810663847c39SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
810763847c39Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
810863847c39SmrgAC_DIAGNOSE([obsolete],
810963847c39Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
811063847c39Smrgput the `dlopen' option into LT_INIT's first parameter.])
811163847c39Smrg])
811263847c39Smrg
811363847c39Smrgdnl aclocal-1.4 backwards compatibility:
811463847c39Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
811563847c39Smrg
811663847c39Smrg
811763847c39Smrg# win32-dll
811863847c39Smrg# ---------
811963847c39Smrg# Declare package support for building win32 dll's.
812063847c39SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
812163847c39Smrg[enable_win32_dll=yes
812263847c39Smrg
812363847c39Smrgcase $host in
812463847c39Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
812563847c39Smrg  AC_CHECK_TOOL(AS, as, false)
812663847c39Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
812763847c39Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
812863847c39Smrg  ;;
812963847c39Smrgesac
813063847c39Smrg
813163847c39Smrgtest -z "$AS" && AS=as
813263847c39Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
813363847c39Smrg
813463847c39Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
813563847c39Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
813663847c39Smrg
813763847c39Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
813863847c39Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
813963847c39Smrg])# win32-dll
814063847c39Smrg
814163847c39SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
814263847c39Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
814363847c39Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
814463847c39SmrgAC_DIAGNOSE([obsolete],
814563847c39Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
814663847c39Smrgput the `win32-dll' option into LT_INIT's first parameter.])
814763847c39Smrg])
814863847c39Smrg
814963847c39Smrgdnl aclocal-1.4 backwards compatibility:
815063847c39Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
815163847c39Smrg
815263847c39Smrg
815363847c39Smrg# _LT_ENABLE_SHARED([DEFAULT])
815463847c39Smrg# ----------------------------
815563847c39Smrg# implement the --enable-shared flag, and supports the `shared' and
815663847c39Smrg# `disable-shared' LT_INIT options.
815763847c39Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
815863847c39Smrgm4_define([_LT_ENABLE_SHARED],
815963847c39Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
816063847c39SmrgAC_ARG_ENABLE([shared],
816163847c39Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
816263847c39Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
816363847c39Smrg    [p=${PACKAGE-default}
816463847c39Smrg    case $enableval in
816563847c39Smrg    yes) enable_shared=yes ;;
816663847c39Smrg    no) enable_shared=no ;;
816763847c39Smrg    *)
816863847c39Smrg      enable_shared=no
816963847c39Smrg      # Look at the argument we got.  We use all the common list separators.
817063847c39Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
817163847c39Smrg      for pkg in $enableval; do
817263847c39Smrg	IFS="$lt_save_ifs"
817363847c39Smrg	if test "X$pkg" = "X$p"; then
817463847c39Smrg	  enable_shared=yes
817563847c39Smrg	fi
817663847c39Smrg      done
817763847c39Smrg      IFS="$lt_save_ifs"
817863847c39Smrg      ;;
817963847c39Smrg    esac],
818063847c39Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
818163847c39Smrg
818263847c39Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
818363847c39Smrg	[Whether or not to build shared libraries])
818463847c39Smrg])# _LT_ENABLE_SHARED
818563847c39Smrg
818663847c39SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
818763847c39SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
818863847c39Smrg
818963847c39Smrg# Old names:
819063847c39SmrgAC_DEFUN([AC_ENABLE_SHARED],
819163847c39Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
819263847c39Smrg])
819363847c39Smrg
819463847c39SmrgAC_DEFUN([AC_DISABLE_SHARED],
819563847c39Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
819663847c39Smrg])
819763847c39Smrg
819863847c39SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
819963847c39SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
820063847c39Smrg
820163847c39Smrgdnl aclocal-1.4 backwards compatibility:
820263847c39Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
820363847c39Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
820463847c39Smrg
820563847c39Smrg
820663847c39Smrg
820763847c39Smrg# _LT_ENABLE_STATIC([DEFAULT])
820863847c39Smrg# ----------------------------
820963847c39Smrg# implement the --enable-static flag, and support the `static' and
821063847c39Smrg# `disable-static' LT_INIT options.
821163847c39Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
821263847c39Smrgm4_define([_LT_ENABLE_STATIC],
821363847c39Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
821463847c39SmrgAC_ARG_ENABLE([static],
821563847c39Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
821663847c39Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
821763847c39Smrg    [p=${PACKAGE-default}
821863847c39Smrg    case $enableval in
821963847c39Smrg    yes) enable_static=yes ;;
822063847c39Smrg    no) enable_static=no ;;
822163847c39Smrg    *)
822263847c39Smrg     enable_static=no
822363847c39Smrg      # Look at the argument we got.  We use all the common list separators.
822463847c39Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
822563847c39Smrg      for pkg in $enableval; do
822663847c39Smrg	IFS="$lt_save_ifs"
822763847c39Smrg	if test "X$pkg" = "X$p"; then
822863847c39Smrg	  enable_static=yes
822963847c39Smrg	fi
823063847c39Smrg      done
823163847c39Smrg      IFS="$lt_save_ifs"
823263847c39Smrg      ;;
823363847c39Smrg    esac],
823463847c39Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
823563847c39Smrg
823663847c39Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
823763847c39Smrg	[Whether or not to build static libraries])
823863847c39Smrg])# _LT_ENABLE_STATIC
823963847c39Smrg
824063847c39SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
824163847c39SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
824263847c39Smrg
824363847c39Smrg# Old names:
824463847c39SmrgAC_DEFUN([AC_ENABLE_STATIC],
824563847c39Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
824663847c39Smrg])
824763847c39Smrg
824863847c39SmrgAC_DEFUN([AC_DISABLE_STATIC],
824963847c39Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
825063847c39Smrg])
825163847c39Smrg
825263847c39SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
825363847c39SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
825463847c39Smrg
825563847c39Smrgdnl aclocal-1.4 backwards compatibility:
825663847c39Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
825763847c39Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
825863847c39Smrg
825963847c39Smrg
826063847c39Smrg
826163847c39Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
826263847c39Smrg# ----------------------------------
826363847c39Smrg# implement the --enable-fast-install flag, and support the `fast-install'
826463847c39Smrg# and `disable-fast-install' LT_INIT options.
826563847c39Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
826663847c39Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
826763847c39Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
826863847c39SmrgAC_ARG_ENABLE([fast-install],
826963847c39Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
827063847c39Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
827163847c39Smrg    [p=${PACKAGE-default}
827263847c39Smrg    case $enableval in
827363847c39Smrg    yes) enable_fast_install=yes ;;
827463847c39Smrg    no) enable_fast_install=no ;;
827563847c39Smrg    *)
827663847c39Smrg      enable_fast_install=no
827763847c39Smrg      # Look at the argument we got.  We use all the common list separators.
827863847c39Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
827963847c39Smrg      for pkg in $enableval; do
828063847c39Smrg	IFS="$lt_save_ifs"
828163847c39Smrg	if test "X$pkg" = "X$p"; then
828263847c39Smrg	  enable_fast_install=yes
828363847c39Smrg	fi
828463847c39Smrg      done
828563847c39Smrg      IFS="$lt_save_ifs"
828663847c39Smrg      ;;
828763847c39Smrg    esac],
828863847c39Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
828963847c39Smrg
829063847c39Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
829163847c39Smrg	 [Whether or not to optimize for fast installation])dnl
829263847c39Smrg])# _LT_ENABLE_FAST_INSTALL
829363847c39Smrg
829463847c39SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
829563847c39SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
829663847c39Smrg
829763847c39Smrg# Old names:
829863847c39SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
829963847c39Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
830063847c39SmrgAC_DIAGNOSE([obsolete],
830163847c39Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
830263847c39Smrgthe `fast-install' option into LT_INIT's first parameter.])
830363847c39Smrg])
830463847c39Smrg
830563847c39SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
830663847c39Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
830763847c39SmrgAC_DIAGNOSE([obsolete],
830863847c39Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
830963847c39Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
831063847c39Smrg])
831163847c39Smrg
831263847c39Smrgdnl aclocal-1.4 backwards compatibility:
831363847c39Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
831463847c39Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
831563847c39Smrg
831663847c39Smrg
831763847c39Smrg# _LT_WITH_PIC([MODE])
831863847c39Smrg# --------------------
831963847c39Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
832063847c39Smrg# LT_INIT options.
832163847c39Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
832263847c39Smrgm4_define([_LT_WITH_PIC],
832363847c39Smrg[AC_ARG_WITH([pic],
832463847c39Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
832563847c39Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
832663847c39Smrg    [lt_p=${PACKAGE-default}
832763847c39Smrg    case $withval in
832863847c39Smrg    yes|no) pic_mode=$withval ;;
832963847c39Smrg    *)
833063847c39Smrg      pic_mode=default
833163847c39Smrg      # Look at the argument we got.  We use all the common list separators.
833263847c39Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
833363847c39Smrg      for lt_pkg in $withval; do
833463847c39Smrg	IFS="$lt_save_ifs"
833563847c39Smrg	if test "X$lt_pkg" = "X$lt_p"; then
833663847c39Smrg	  pic_mode=yes
833763847c39Smrg	fi
833863847c39Smrg      done
833963847c39Smrg      IFS="$lt_save_ifs"
834063847c39Smrg      ;;
834163847c39Smrg    esac],
834263847c39Smrg    [pic_mode=default])
834363847c39Smrg
834463847c39Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
834563847c39Smrg
834663847c39Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
834763847c39Smrg])# _LT_WITH_PIC
834863847c39Smrg
834963847c39SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
835063847c39SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
835163847c39Smrg
835263847c39Smrg# Old name:
835363847c39SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
835463847c39Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
835563847c39SmrgAC_DIAGNOSE([obsolete],
835663847c39Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
835763847c39Smrgput the `pic-only' option into LT_INIT's first parameter.])
835863847c39Smrg])
835963847c39Smrg
836063847c39Smrgdnl aclocal-1.4 backwards compatibility:
836163847c39Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
836263847c39Smrg
836363847c39Smrg
836463847c39Smrgm4_define([_LTDL_MODE], [])
836563847c39SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
836663847c39Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
836763847c39SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
836863847c39Smrg		 [m4_define([_LTDL_MODE], [recursive])])
836963847c39SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
837063847c39Smrg		 [m4_define([_LTDL_MODE], [subproject])])
837163847c39Smrg
837263847c39Smrgm4_define([_LTDL_TYPE], [])
837363847c39SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
837463847c39Smrg		 [m4_define([_LTDL_TYPE], [installable])])
837563847c39SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
837663847c39Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
837763847c39Smrg
837863847c39Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
837963847c39Smrg#
838063847c39Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
838163847c39Smrg# Written by Gary V. Vaughan, 2004
838263847c39Smrg#
838363847c39Smrg# This file is free software; the Free Software Foundation gives
838463847c39Smrg# unlimited permission to copy and/or distribute it, with or without
838563847c39Smrg# modifications, as long as this notice is preserved.
838663847c39Smrg
838763847c39Smrg# serial 6 ltsugar.m4
838863847c39Smrg
838963847c39Smrg# This is to help aclocal find these macros, as it can't see m4_define.
839063847c39SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
839163847c39Smrg
839263847c39Smrg
839363847c39Smrg# lt_join(SEP, ARG1, [ARG2...])
839463847c39Smrg# -----------------------------
839563847c39Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
839663847c39Smrg# associated separator.
839763847c39Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
839863847c39Smrg# versions in m4sugar had bugs.
839963847c39Smrgm4_define([lt_join],
840063847c39Smrg[m4_if([$#], [1], [],
840163847c39Smrg       [$#], [2], [[$2]],
840263847c39Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
840363847c39Smrgm4_define([_lt_join],
840463847c39Smrg[m4_if([$#$2], [2], [],
840563847c39Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
840663847c39Smrg
840763847c39Smrg
840863847c39Smrg# lt_car(LIST)
840963847c39Smrg# lt_cdr(LIST)
841063847c39Smrg# ------------
841163847c39Smrg# Manipulate m4 lists.
841263847c39Smrg# These macros are necessary as long as will still need to support
841363847c39Smrg# Autoconf-2.59 which quotes differently.
841463847c39Smrgm4_define([lt_car], [[$1]])
841563847c39Smrgm4_define([lt_cdr],
841663847c39Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
841763847c39Smrg       [$#], 1, [],
841863847c39Smrg       [m4_dquote(m4_shift($@))])])
841963847c39Smrgm4_define([lt_unquote], $1)
842063847c39Smrg
842163847c39Smrg
842263847c39Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
842363847c39Smrg# ------------------------------------------
842463847c39Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
842563847c39Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
842663847c39Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
842763847c39Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
842863847c39Smrg# than defined and empty).
842963847c39Smrg#
843063847c39Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
843163847c39Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
843263847c39Smrgm4_define([lt_append],
843363847c39Smrg[m4_define([$1],
843463847c39Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
843563847c39Smrg
843663847c39Smrg
843763847c39Smrg
843863847c39Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
843963847c39Smrg# ----------------------------------------------------------
844063847c39Smrg# Produce a SEP delimited list of all paired combinations of elements of
844163847c39Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
844263847c39Smrg# has the form PREFIXmINFIXSUFFIXn.
844363847c39Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
844463847c39Smrgm4_define([lt_combine],
844563847c39Smrg[m4_if(m4_eval([$# > 3]), [1],
844663847c39Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
844763847c39Smrg[[m4_foreach([_Lt_prefix], [$2],
844863847c39Smrg	     [m4_foreach([_Lt_suffix],
844963847c39Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
845063847c39Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
845163847c39Smrg
845263847c39Smrg
845363847c39Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
845463847c39Smrg# -----------------------------------------------------------------------
845563847c39Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
845663847c39Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
845763847c39Smrgm4_define([lt_if_append_uniq],
845863847c39Smrg[m4_ifdef([$1],
845963847c39Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
846063847c39Smrg		 [lt_append([$1], [$2], [$3])$4],
846163847c39Smrg		 [$5])],
846263847c39Smrg	  [lt_append([$1], [$2], [$3])$4])])
846363847c39Smrg
846463847c39Smrg
846563847c39Smrg# lt_dict_add(DICT, KEY, VALUE)
846663847c39Smrg# -----------------------------
846763847c39Smrgm4_define([lt_dict_add],
846863847c39Smrg[m4_define([$1($2)], [$3])])
846963847c39Smrg
847063847c39Smrg
847163847c39Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
847263847c39Smrg# --------------------------------------------
847363847c39Smrgm4_define([lt_dict_add_subkey],
847463847c39Smrg[m4_define([$1($2:$3)], [$4])])
847563847c39Smrg
847663847c39Smrg
847763847c39Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
847863847c39Smrg# ----------------------------------
847963847c39Smrgm4_define([lt_dict_fetch],
848063847c39Smrg[m4_ifval([$3],
848163847c39Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
848263847c39Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
848363847c39Smrg
848463847c39Smrg
848563847c39Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
848663847c39Smrg# -----------------------------------------------------------------
848763847c39Smrgm4_define([lt_if_dict_fetch],
848863847c39Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
848963847c39Smrg	[$5],
849063847c39Smrg    [$6])])
849163847c39Smrg
849263847c39Smrg
849363847c39Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
849463847c39Smrg# --------------------------------------------------------------
849563847c39Smrgm4_define([lt_dict_filter],
849663847c39Smrg[m4_if([$5], [], [],
849763847c39Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
849863847c39Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
849963847c39Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
850063847c39Smrg])
850163847c39Smrg
850263847c39Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
850363847c39Smrg#
850463847c39Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
850563847c39Smrg#   Written by Scott James Remnant, 2004
850663847c39Smrg#
850763847c39Smrg# This file is free software; the Free Software Foundation gives
850863847c39Smrg# unlimited permission to copy and/or distribute it, with or without
850963847c39Smrg# modifications, as long as this notice is preserved.
851063847c39Smrg
851163847c39Smrg# @configure_input@
851263847c39Smrg
851363847c39Smrg# serial 3337 ltversion.m4
851463847c39Smrg# This file is part of GNU Libtool
851563847c39Smrg
851663847c39Smrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
851763847c39Smrgm4_define([LT_PACKAGE_REVISION], [1.3337])
851863847c39Smrg
851963847c39SmrgAC_DEFUN([LTVERSION_VERSION],
852063847c39Smrg[macro_version='2.4.2'
852163847c39Smrgmacro_revision='1.3337'
852263847c39Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
852363847c39Smrg_LT_DECL(, macro_revision, 0)
852486dafe34Smrg])
852576888252Smrg
852663847c39Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
852763847c39Smrg#
852863847c39Smrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
852963847c39Smrg#   Written by Scott James Remnant, 2004.
853063847c39Smrg#
853163847c39Smrg# This file is free software; the Free Software Foundation gives
853263847c39Smrg# unlimited permission to copy and/or distribute it, with or without
853363847c39Smrg# modifications, as long as this notice is preserved.
853463847c39Smrg
853563847c39Smrg# serial 5 lt~obsolete.m4
853663847c39Smrg
853763847c39Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
853863847c39Smrg#
853963847c39Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
854063847c39Smrg# which have later been changed to m4_define as they aren't part of the
854163847c39Smrg# exported API, or moved to Autoconf or Automake where they belong.
854263847c39Smrg#
854363847c39Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
854463847c39Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
854563847c39Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
854663847c39Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
854763847c39Smrg# and doesn't know about Autoconf macros at all.)
854863847c39Smrg#
854963847c39Smrg# So we provide this file, which has a silly filename so it's always
855063847c39Smrg# included after everything else.  This provides aclocal with the
855163847c39Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
855263847c39Smrg# because those macros already exist, or will be overwritten later.
855363847c39Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
855463847c39Smrg#
855563847c39Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
855663847c39Smrg# Yes, that means every name once taken will need to remain here until
855763847c39Smrg# we give up compatibility with versions before 1.7, at which point
855863847c39Smrg# we need to keep only those names which we still refer to.
855963847c39Smrg
856063847c39Smrg# This is to help aclocal find these macros, as it can't see m4_define.
856163847c39SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
856263847c39Smrg
856363847c39Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
856463847c39Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
856563847c39Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
856663847c39Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
856763847c39Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
856863847c39Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
856963847c39Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
857063847c39Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
857163847c39Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
857263847c39Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
857363847c39Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
857463847c39Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
857563847c39Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
857663847c39Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
857763847c39Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
857863847c39Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
857963847c39Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
858063847c39Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
858163847c39Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
858263847c39Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
858363847c39Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
858463847c39Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
858563847c39Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
858663847c39Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
858763847c39Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
858863847c39Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
858963847c39Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
859063847c39Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
859163847c39Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
859263847c39Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
859363847c39Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
859463847c39Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
859563847c39Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
859663847c39Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
859763847c39Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
859863847c39Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
859963847c39Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
860063847c39Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
860163847c39Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
860263847c39Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
860363847c39Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
860463847c39Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
860563847c39Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
860663847c39Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
860763847c39Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
860863847c39Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
860963847c39Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
861063847c39Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
861163847c39Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
861263847c39Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
861363847c39Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
861463847c39Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
861563847c39Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
861663847c39Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
861763847c39Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
861863847c39Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
861963847c39Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
862063847c39Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
862163847c39Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
862263847c39Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
862363847c39Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
862463847c39Smrg
862586dafe34Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
862663847c39Smrg# serial 1 (pkg-config-0.24)
862786dafe34Smrg# 
862886dafe34Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
862986dafe34Smrg#
863086dafe34Smrg# This program is free software; you can redistribute it and/or modify
863186dafe34Smrg# it under the terms of the GNU General Public License as published by
863286dafe34Smrg# the Free Software Foundation; either version 2 of the License, or
863386dafe34Smrg# (at your option) any later version.
863486dafe34Smrg#
863586dafe34Smrg# This program is distributed in the hope that it will be useful, but
863686dafe34Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
863786dafe34Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
863886dafe34Smrg# General Public License for more details.
863986dafe34Smrg#
864086dafe34Smrg# You should have received a copy of the GNU General Public License
864186dafe34Smrg# along with this program; if not, write to the Free Software
864286dafe34Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
864386dafe34Smrg#
864486dafe34Smrg# As a special exception to the GNU General Public License, if you
864586dafe34Smrg# distribute this file as part of a program that contains a
864686dafe34Smrg# configuration script generated by Autoconf, you may include it under
864786dafe34Smrg# the same distribution terms that you use for the rest of that program.
864876888252Smrg
864986dafe34Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
865086dafe34Smrg# ----------------------------------
865186dafe34SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
865286dafe34Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
865363847c39Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
865463847c39Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
865563847c39SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
865663847c39SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
865763847c39SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
865863847c39Smrg
865986dafe34Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
866086dafe34Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
866186dafe34Smrgfi
866286dafe34Smrgif test -n "$PKG_CONFIG"; then
866386dafe34Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
866486dafe34Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
866586dafe34Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
866686dafe34Smrg		AC_MSG_RESULT([yes])
86671ae1b5e8Smrg	else
866886dafe34Smrg		AC_MSG_RESULT([no])
866986dafe34Smrg		PKG_CONFIG=""
86701ae1b5e8Smrg	fi
867186dafe34Smrgfi[]dnl
867286dafe34Smrg])# PKG_PROG_PKG_CONFIG
867376888252Smrg
867486dafe34Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
867586dafe34Smrg#
867686dafe34Smrg# Check to see whether a particular set of modules exists.  Similar
867786dafe34Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
867886dafe34Smrg#
867963847c39Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
868063847c39Smrg# only at the first occurence in configure.ac, so if the first place
868163847c39Smrg# it's called might be skipped (such as if it is within an "if", you
868263847c39Smrg# have to call PKG_CHECK_EXISTS manually
868386dafe34Smrg# --------------------------------------------------------------
868486dafe34SmrgAC_DEFUN([PKG_CHECK_EXISTS],
868586dafe34Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
868686dafe34Smrgif test -n "$PKG_CONFIG" && \
868786dafe34Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
868863847c39Smrg  m4_default([$2], [:])
868986dafe34Smrgm4_ifvaln([$3], [else
869086dafe34Smrg  $3])dnl
869186dafe34Smrgfi])
869276888252Smrg
869386dafe34Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
869486dafe34Smrg# ---------------------------------------------
869586dafe34Smrgm4_define([_PKG_CONFIG],
869686dafe34Smrg[if test -n "$$1"; then
869786dafe34Smrg    pkg_cv_[]$1="$$1"
869886dafe34Smrg elif test -n "$PKG_CONFIG"; then
869986dafe34Smrg    PKG_CHECK_EXISTS([$3],
870063847c39Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
870163847c39Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
870286dafe34Smrg		     [pkg_failed=yes])
870386dafe34Smrg else
870486dafe34Smrg    pkg_failed=untried
870586dafe34Smrgfi[]dnl
870686dafe34Smrg])# _PKG_CONFIG
870776888252Smrg
870886dafe34Smrg# _PKG_SHORT_ERRORS_SUPPORTED
870986dafe34Smrg# -----------------------------
871086dafe34SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
871186dafe34Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
871286dafe34Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
871386dafe34Smrg        _pkg_short_errors_supported=yes
871486dafe34Smrgelse
871586dafe34Smrg        _pkg_short_errors_supported=no
871686dafe34Smrgfi[]dnl
871786dafe34Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
871876888252Smrg
871986dafe34Smrg
872086dafe34Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
872186dafe34Smrg# [ACTION-IF-NOT-FOUND])
872286dafe34Smrg#
872386dafe34Smrg#
872486dafe34Smrg# Note that if there is a possibility the first call to
872586dafe34Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
872686dafe34Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
872786dafe34Smrg#
872886dafe34Smrg#
872986dafe34Smrg# --------------------------------------------------------------
873086dafe34SmrgAC_DEFUN([PKG_CHECK_MODULES],
873186dafe34Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
873286dafe34SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
873386dafe34SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
873486dafe34Smrg
873586dafe34Smrgpkg_failed=no
873686dafe34SmrgAC_MSG_CHECKING([for $1])
873786dafe34Smrg
873886dafe34Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
873986dafe34Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
874086dafe34Smrg
874186dafe34Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
874286dafe34Smrgand $1[]_LIBS to avoid the need to call pkg-config.
874386dafe34SmrgSee the pkg-config man page for more details.])
874486dafe34Smrg
874586dafe34Smrgif test $pkg_failed = yes; then
874663847c39Smrg   	AC_MSG_RESULT([no])
874786dafe34Smrg        _PKG_SHORT_ERRORS_SUPPORTED
874886dafe34Smrg        if test $_pkg_short_errors_supported = yes; then
874963847c39Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
875086dafe34Smrg        else 
875163847c39Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
875286dafe34Smrg        fi
875386dafe34Smrg	# Put the nasty error message in config.log where it belongs
875486dafe34Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
875586dafe34Smrg
875663847c39Smrg	m4_default([$4], [AC_MSG_ERROR(
875786dafe34Smrg[Package requirements ($2) were not met:
875886dafe34Smrg
875986dafe34Smrg$$1_PKG_ERRORS
876086dafe34Smrg
876186dafe34SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
876286dafe34Smrginstalled software in a non-standard prefix.
876386dafe34Smrg
876463847c39Smrg_PKG_TEXT])[]dnl
876563847c39Smrg        ])
876686dafe34Smrgelif test $pkg_failed = untried; then
876763847c39Smrg     	AC_MSG_RESULT([no])
876863847c39Smrg	m4_default([$4], [AC_MSG_FAILURE(
876986dafe34Smrg[The pkg-config script could not be found or is too old.  Make sure it
877086dafe34Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
877186dafe34Smrgpath to pkg-config.
877286dafe34Smrg
877386dafe34Smrg_PKG_TEXT
877486dafe34Smrg
877563847c39SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
877663847c39Smrg        ])
877786dafe34Smrgelse
877886dafe34Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
877986dafe34Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
878086dafe34Smrg        AC_MSG_RESULT([yes])
878163847c39Smrg	$3
878286dafe34Smrgfi[]dnl
878386dafe34Smrg])# PKG_CHECK_MODULES
878486dafe34Smrg
87859586ba5aSmrg
87869586ba5aSmrg# PKG_INSTALLDIR(DIRECTORY)
87879586ba5aSmrg# -------------------------
87889586ba5aSmrg# Substitutes the variable pkgconfigdir as the location where a module
87899586ba5aSmrg# should install pkg-config .pc files. By default the directory is
87909586ba5aSmrg# $libdir/pkgconfig, but the default can be changed by passing
87919586ba5aSmrg# DIRECTORY. The user can override through the --with-pkgconfigdir
87929586ba5aSmrg# parameter.
87939586ba5aSmrgAC_DEFUN([PKG_INSTALLDIR],
87949586ba5aSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
87959586ba5aSmrgm4_pushdef([pkg_description],
87969586ba5aSmrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
87979586ba5aSmrgAC_ARG_WITH([pkgconfigdir],
87989586ba5aSmrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
87999586ba5aSmrg    [with_pkgconfigdir=]pkg_default)
88009586ba5aSmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
88019586ba5aSmrgm4_popdef([pkg_default])
88029586ba5aSmrgm4_popdef([pkg_description])
88039586ba5aSmrg]) dnl PKG_INSTALLDIR
88049586ba5aSmrg
88059586ba5aSmrg
88069586ba5aSmrg# PKG_NOARCH_INSTALLDIR(DIRECTORY)
88079586ba5aSmrg# -------------------------
88089586ba5aSmrg# Substitutes the variable noarch_pkgconfigdir as the location where a
88099586ba5aSmrg# module should install arch-independent pkg-config .pc files. By
88109586ba5aSmrg# default the directory is $datadir/pkgconfig, but the default can be
88119586ba5aSmrg# changed by passing DIRECTORY. The user can override through the
88129586ba5aSmrg# --with-noarch-pkgconfigdir parameter.
88139586ba5aSmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
88149586ba5aSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
88159586ba5aSmrgm4_pushdef([pkg_description],
88169586ba5aSmrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
88179586ba5aSmrgAC_ARG_WITH([noarch-pkgconfigdir],
88189586ba5aSmrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
88199586ba5aSmrg    [with_noarch_pkgconfigdir=]pkg_default)
88209586ba5aSmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
88219586ba5aSmrgm4_popdef([pkg_default])
88229586ba5aSmrgm4_popdef([pkg_description])
88239586ba5aSmrg]) dnl PKG_NOARCH_INSTALLDIR
88249586ba5aSmrg
88259586ba5aSmrg
88269586ba5aSmrg# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
88279586ba5aSmrg# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
88289586ba5aSmrg# -------------------------------------------
88299586ba5aSmrg# Retrieves the value of the pkg-config variable for the given module.
88309586ba5aSmrgAC_DEFUN([PKG_CHECK_VAR],
88319586ba5aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
88329586ba5aSmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
88339586ba5aSmrg
88349586ba5aSmrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
88359586ba5aSmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
88369586ba5aSmrg
88379586ba5aSmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
88389586ba5aSmrg])# PKG_CHECK_VAR
88399586ba5aSmrg
884086dafe34Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
884186dafe34Smrgdnl
884263847c39Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
88439586ba5aSmrgdnl
884486dafe34Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
884563847c39Smrgdnl copy of this software and associated documentation files (the "Software"),
884663847c39Smrgdnl to deal in the Software without restriction, including without limitation
884763847c39Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
884863847c39Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
884963847c39Smrgdnl Software is furnished to do so, subject to the following conditions:
885086dafe34Smrgdnl
885163847c39Smrgdnl The above copyright notice and this permission notice (including the next
885263847c39Smrgdnl paragraph) shall be included in all copies or substantial portions of the
885363847c39Smrgdnl Software.
885486dafe34Smrgdnl
885563847c39Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
885663847c39Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
885763847c39Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
885863847c39Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
885963847c39Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
886063847c39Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
886163847c39Smrgdnl DEALINGS IN THE SOFTWARE.
886286dafe34Smrg
886386dafe34Smrg# XORG_MACROS_VERSION(required-version)
886486dafe34Smrg# -------------------------------------
886586dafe34Smrg# Minimum version: 1.1.0
886686dafe34Smrg#
886786dafe34Smrg# If you're using a macro added in Version 1.1 or newer, include this in
886886dafe34Smrg# your configure.ac with the minimum required version, such as:
886986dafe34Smrg# XORG_MACROS_VERSION(1.1)
887086dafe34Smrg#
887163847c39Smrg# To ensure that this macro is defined, also add:
887263847c39Smrg# m4_ifndef([XORG_MACROS_VERSION],
887363847c39Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
887486dafe34Smrg#
887586dafe34Smrg#
88769586ba5aSmrg# See the "minimum version" comment for each macro you use to see what
887786dafe34Smrg# version you require.
887863847c39Smrgm4_defun([XORG_MACROS_VERSION],[
88799586ba5aSmrgm4_define([vers_have], [1.19.0])
888063847c39Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
888163847c39Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
888263847c39Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
888363847c39Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
888463847c39Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
888563847c39Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
888663847c39Smrgm4_undefine([vers_have])
888763847c39Smrgm4_undefine([maj_have])
888863847c39Smrgm4_undefine([maj_needed])
888986dafe34Smrg]) # XORG_MACROS_VERSION
889086dafe34Smrg
889186dafe34Smrg# XORG_PROG_RAWCPP()
889286dafe34Smrg# ------------------
889386dafe34Smrg# Minimum version: 1.0.0
889486dafe34Smrg#
889586dafe34Smrg# Find cpp program and necessary flags for use in pre-processing text files
889686dafe34Smrg# such as man pages and config files
889786dafe34SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
889886dafe34SmrgAC_REQUIRE([AC_PROG_CPP])
88999586ba5aSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
890086dafe34Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
890186dafe34Smrg
890286dafe34Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
890386dafe34Smrg# which is not the best choice for supporting other OS'es, but covers most
890486dafe34Smrg# of the ones we need for now.
890586dafe34SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
890663847c39SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
890786dafe34Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
890886dafe34Smrg	AC_MSG_RESULT([no])
890986dafe34Smrgelse
891086dafe34Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
891186dafe34Smrg		RAWCPPFLAGS=-undef
891286dafe34Smrg		AC_MSG_RESULT([yes])
891386dafe34Smrg	# under Cygwin unix is still defined even with -undef
891486dafe34Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
891586dafe34Smrg		RAWCPPFLAGS="-undef -ansi"
891686dafe34Smrg		AC_MSG_RESULT([yes, with -ansi])
891786dafe34Smrg	else
891886dafe34Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
891986dafe34Smrg	fi
892086dafe34Smrgfi
892186dafe34Smrgrm -f conftest.$ac_ext
892286dafe34Smrg
892386dafe34SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
892463847c39SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
892586dafe34Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
892686dafe34Smrg	AC_MSG_RESULT([no])
892786dafe34Smrgelse
892886dafe34Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
89299586ba5aSmrg		TRADITIONALCPPFLAGS="-traditional"
893086dafe34Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
893186dafe34Smrg		AC_MSG_RESULT([yes])
893286dafe34Smrg	else
893386dafe34Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
893486dafe34Smrg	fi
893586dafe34Smrgfi
893686dafe34Smrgrm -f conftest.$ac_ext
893786dafe34SmrgAC_SUBST(RAWCPPFLAGS)
89389586ba5aSmrgAC_SUBST(TRADITIONALCPPFLAGS)
893986dafe34Smrg]) # XORG_PROG_RAWCPP
894086dafe34Smrg
894186dafe34Smrg# XORG_MANPAGE_SECTIONS()
894286dafe34Smrg# -----------------------
894386dafe34Smrg# Minimum version: 1.0.0
894486dafe34Smrg#
894586dafe34Smrg# Determine which sections man pages go in for the different man page types
894686dafe34Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
894786dafe34Smrg# Not sure if there's any better way than just hardcoding by OS name.
894886dafe34Smrg# Override default settings by setting environment variables
894963847c39Smrg# Added MAN_SUBSTS in version 1.8
895063847c39Smrg# Added AC_PROG_SED in version 1.8
895186dafe34Smrg
895286dafe34SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
895386dafe34SmrgAC_REQUIRE([AC_CANONICAL_HOST])
895463847c39SmrgAC_REQUIRE([AC_PROG_SED])
895586dafe34Smrg
895686dafe34Smrgif test x$APP_MAN_SUFFIX = x    ; then
895786dafe34Smrg    APP_MAN_SUFFIX=1
895886dafe34Smrgfi
895986dafe34Smrgif test x$APP_MAN_DIR = x    ; then
896086dafe34Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
896186dafe34Smrgfi
896286dafe34Smrg
896386dafe34Smrgif test x$LIB_MAN_SUFFIX = x    ; then
896486dafe34Smrg    LIB_MAN_SUFFIX=3
896586dafe34Smrgfi
896686dafe34Smrgif test x$LIB_MAN_DIR = x    ; then
896786dafe34Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
896886dafe34Smrgfi
896986dafe34Smrg
897086dafe34Smrgif test x$FILE_MAN_SUFFIX = x    ; then
897186dafe34Smrg    case $host_os in
897286dafe34Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
897386dafe34Smrg	*)		FILE_MAN_SUFFIX=5  ;;
89741ae1b5e8Smrg    esac
897586dafe34Smrgfi
897686dafe34Smrgif test x$FILE_MAN_DIR = x    ; then
897786dafe34Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
897886dafe34Smrgfi
897976888252Smrg
898086dafe34Smrgif test x$MISC_MAN_SUFFIX = x    ; then
89811ae1b5e8Smrg    case $host_os in
898286dafe34Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
898386dafe34Smrg	*)		MISC_MAN_SUFFIX=7  ;;
898486dafe34Smrg    esac
898586dafe34Smrgfi
898686dafe34Smrgif test x$MISC_MAN_DIR = x    ; then
898786dafe34Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
898886dafe34Smrgfi
898976888252Smrg
899086dafe34Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
899186dafe34Smrg    case $host_os in
899286dafe34Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
899386dafe34Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
899486dafe34Smrg    esac
899586dafe34Smrgfi
899686dafe34Smrgif test x$DRIVER_MAN_DIR = x    ; then
899786dafe34Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
899886dafe34Smrgfi
899976888252Smrg
900086dafe34Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
900186dafe34Smrg    case $host_os in
900286dafe34Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
900386dafe34Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
900486dafe34Smrg    esac
900586dafe34Smrgfi
900686dafe34Smrgif test x$ADMIN_MAN_DIR = x    ; then
900786dafe34Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
900886dafe34Smrgfi
900976888252Smrg
901076888252Smrg
901186dafe34SmrgAC_SUBST([APP_MAN_SUFFIX])
901286dafe34SmrgAC_SUBST([LIB_MAN_SUFFIX])
901386dafe34SmrgAC_SUBST([FILE_MAN_SUFFIX])
901486dafe34SmrgAC_SUBST([MISC_MAN_SUFFIX])
901586dafe34SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
901686dafe34SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
901786dafe34SmrgAC_SUBST([APP_MAN_DIR])
901886dafe34SmrgAC_SUBST([LIB_MAN_DIR])
901986dafe34SmrgAC_SUBST([FILE_MAN_DIR])
902086dafe34SmrgAC_SUBST([MISC_MAN_DIR])
902186dafe34SmrgAC_SUBST([DRIVER_MAN_DIR])
902286dafe34SmrgAC_SUBST([ADMIN_MAN_DIR])
902363847c39Smrg
902463847c39SmrgXORG_MAN_PAGE="X Version 11"
902563847c39SmrgAC_SUBST([XORG_MAN_PAGE])
902663847c39SmrgMAN_SUBSTS="\
902763847c39Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
902863847c39Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
902963847c39Smrg	-e 's|__xservername__|Xorg|g' \
903063847c39Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
903163847c39Smrg	-e 's|__projectroot__|\$(prefix)|g' \
903263847c39Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
903363847c39Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
903463847c39Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
903563847c39Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
903663847c39Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
903763847c39Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
903863847c39Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
903963847c39SmrgAC_SUBST([MAN_SUBSTS])
904063847c39Smrg
904186dafe34Smrg]) # XORG_MANPAGE_SECTIONS
904276888252Smrg
904363847c39Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
904463847c39Smrg# ------------------------
904563847c39Smrg# Minimum version: 1.7.0
904663847c39Smrg#
904763847c39Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
904863847c39Smrg# provided by xorg-sgml-doctools, if installed.
904963847c39SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
905063847c39SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
905163847c39SmrgXORG_SGML_PATH=
905263847c39SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
905363847c39Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
905463847c39Smrg    [m4_ifval([$1],[:],
905563847c39Smrg        [if test x"$cross_compiling" != x"yes" ; then
905663847c39Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
905763847c39Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
905863847c39Smrg         fi])
905963847c39Smrg    ])
906063847c39Smrg
906163847c39Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
906263847c39Smrg# the path and the name of the doc stylesheet
906363847c39Smrgif test "x$XORG_SGML_PATH" != "x" ; then
906463847c39Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
906563847c39Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
906663847c39Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
906763847c39Smrgelse
906863847c39Smrg   AC_MSG_RESULT([no])
906963847c39Smrgfi
907063847c39Smrg
907163847c39SmrgAC_SUBST(XORG_SGML_PATH)
907263847c39SmrgAC_SUBST(STYLESHEET_SRCDIR)
907363847c39SmrgAC_SUBST(XSL_STYLESHEET)
907463847c39SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
907563847c39Smrg]) # XORG_CHECK_SGML_DOCTOOLS
907663847c39Smrg
907786dafe34Smrg# XORG_CHECK_LINUXDOC
907886dafe34Smrg# -------------------
907986dafe34Smrg# Minimum version: 1.0.0
908086dafe34Smrg#
908186dafe34Smrg# Defines the variable MAKE_TEXT if the necessary tools and
908286dafe34Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
908386dafe34Smrg# Whether or not the necessary tools and files are found can be checked
908486dafe34Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
908586dafe34SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
908663847c39SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
908763847c39SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
908886dafe34Smrg
908986dafe34SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
909086dafe34Smrg
909163847c39SmrgAC_MSG_CHECKING([whether to build documentation])
909286dafe34Smrg
909363847c39Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
909486dafe34Smrg   BUILDDOC=yes
909586dafe34Smrgelse
909686dafe34Smrg   BUILDDOC=no
909786dafe34Smrgfi
909886dafe34Smrg
909986dafe34SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
910086dafe34Smrg
910186dafe34SmrgAC_MSG_RESULT([$BUILDDOC])
910286dafe34Smrg
910363847c39SmrgAC_MSG_CHECKING([whether to build pdf documentation])
910486dafe34Smrg
910563847c39Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
910686dafe34Smrg   BUILDPDFDOC=yes
910786dafe34Smrgelse
910886dafe34Smrg   BUILDPDFDOC=no
910986dafe34Smrgfi
911086dafe34Smrg
911186dafe34SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
911286dafe34Smrg
911386dafe34SmrgAC_MSG_RESULT([$BUILDPDFDOC])
911486dafe34Smrg
911563847c39SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
911686dafe34SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
911786dafe34SmrgMAKE_PDF="$PS2PDF"
911886dafe34SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
911986dafe34Smrg
912086dafe34SmrgAC_SUBST(MAKE_TEXT)
912186dafe34SmrgAC_SUBST(MAKE_PS)
912286dafe34SmrgAC_SUBST(MAKE_PDF)
912386dafe34SmrgAC_SUBST(MAKE_HTML)
912486dafe34Smrg]) # XORG_CHECK_LINUXDOC
912586dafe34Smrg
912686dafe34Smrg# XORG_CHECK_DOCBOOK
912786dafe34Smrg# -------------------
912886dafe34Smrg# Minimum version: 1.0.0
912986dafe34Smrg#
913086dafe34Smrg# Checks for the ability to build output formats from SGML DocBook source.
913186dafe34Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
913286dafe34Smrg# indicates whether the necessary tools and files are found and, if set,
913386dafe34Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
913486dafe34SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
913563847c39SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
913663847c39Smrg
913786dafe34SmrgBUILDTXTDOC=no
913886dafe34SmrgBUILDPDFDOC=no
913986dafe34SmrgBUILDPSDOC=no
914086dafe34SmrgBUILDHTMLDOC=no
914186dafe34Smrg
914286dafe34SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
914386dafe34SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
914486dafe34SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
914586dafe34SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
914686dafe34Smrg
914763847c39SmrgAC_MSG_CHECKING([whether to build text documentation])
914863847c39Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
914986dafe34Smrg   test x$BUILD_TXTDOC != xno; then
915086dafe34Smrg	BUILDTXTDOC=yes
915186dafe34Smrgfi
915286dafe34SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
915386dafe34SmrgAC_MSG_RESULT([$BUILDTXTDOC])
915476888252Smrg
915563847c39SmrgAC_MSG_CHECKING([whether to build PDF documentation])
915663847c39Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
915763847c39Smrg   test x$BUILD_PDFDOC != xno; then
915863847c39Smrg	BUILDPDFDOC=yes
915963847c39Smrgfi
916063847c39SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
916163847c39SmrgAC_MSG_RESULT([$BUILDPDFDOC])
916263847c39Smrg
916363847c39SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
916463847c39Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
916563847c39Smrg   test x$BUILD_PSDOC != xno; then
916663847c39Smrg	BUILDPSDOC=yes
916763847c39Smrgfi
916863847c39SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
916963847c39SmrgAC_MSG_RESULT([$BUILDPSDOC])
917063847c39Smrg
917163847c39SmrgAC_MSG_CHECKING([whether to build HTML documentation])
917263847c39Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
917363847c39Smrg   test x$BUILD_HTMLDOC != xno; then
917463847c39Smrg	BUILDHTMLDOC=yes
917563847c39Smrgfi
917663847c39SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
917763847c39SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
917863847c39Smrg
917963847c39SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
918063847c39SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
918163847c39SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
918263847c39SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
918363847c39Smrg
918463847c39SmrgAC_SUBST(MAKE_TEXT)
918563847c39SmrgAC_SUBST(MAKE_PS)
918663847c39SmrgAC_SUBST(MAKE_PDF)
918763847c39SmrgAC_SUBST(MAKE_HTML)
918863847c39Smrg]) # XORG_CHECK_DOCBOOK
918963847c39Smrg
919063847c39Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
919163847c39Smrg# ----------------
919263847c39Smrg# Minimum version: 1.5.0
919363847c39Smrg# Minimum version for optional DEFAULT argument: 1.11.0
919463847c39Smrg#
919563847c39Smrg# Documentation tools are not always available on all platforms and sometimes
919663847c39Smrg# not at the appropriate level. This macro enables a module to test for the
919763847c39Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
919863847c39Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
919963847c39Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
920063847c39Smrg# --with-xmlto assumes 'auto'.
920163847c39Smrg#
920263847c39Smrg# Interface to module:
920363847c39Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
920463847c39Smrg# XMLTO:	returns the path of the xmlto program found
920563847c39Smrg#		returns the path set by the user in the environment
920663847c39Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
920763847c39Smrg#		'no' user instructs the module not to use xmlto
920863847c39Smrg#
920963847c39Smrg# Added in version 1.10.0
921063847c39Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
921163847c39Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
921263847c39Smrg#
921363847c39Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
921463847c39Smrg#
921563847c39SmrgAC_DEFUN([XORG_WITH_XMLTO],[
921663847c39SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
921763847c39Smrgm4_define([_defopt], m4_default([$2], [auto]))
921863847c39SmrgAC_ARG_WITH(xmlto,
921963847c39Smrg	AS_HELP_STRING([--with-xmlto],
922063847c39Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
922163847c39Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
922263847c39Smrgm4_undefine([_defopt])
922363847c39Smrg
922463847c39Smrgif test "x$use_xmlto" = x"auto"; then
922563847c39Smrg   AC_PATH_PROG([XMLTO], [xmlto])
922663847c39Smrg   if test "x$XMLTO" = "x"; then
922763847c39Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
922863847c39Smrg	have_xmlto=no
922963847c39Smrg   else
923063847c39Smrg        have_xmlto=yes
923163847c39Smrg   fi
923263847c39Smrgelif test "x$use_xmlto" = x"yes" ; then
923363847c39Smrg   AC_PATH_PROG([XMLTO], [xmlto])
923463847c39Smrg   if test "x$XMLTO" = "x"; then
923563847c39Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
923663847c39Smrg   fi
923763847c39Smrg   have_xmlto=yes
923863847c39Smrgelif test "x$use_xmlto" = x"no" ; then
923963847c39Smrg   if test "x$XMLTO" != "x"; then
924063847c39Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
924163847c39Smrg   fi
924263847c39Smrg   have_xmlto=no
924363847c39Smrgelse
924463847c39Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
924563847c39Smrgfi
924663847c39Smrg
924763847c39Smrg# Test for a minimum version of xmlto, if provided.
924863847c39Smrgm4_ifval([$1],
924963847c39Smrg[if test "$have_xmlto" = yes; then
925063847c39Smrg    # scrape the xmlto version
925163847c39Smrg    AC_MSG_CHECKING([the xmlto version])
925263847c39Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
925363847c39Smrg    AC_MSG_RESULT([$xmlto_version])
925463847c39Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
925563847c39Smrg        [if test "x$use_xmlto" = xauto; then
925663847c39Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
925763847c39Smrg            have_xmlto=no
925863847c39Smrg        else
925963847c39Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
926063847c39Smrg        fi])
926163847c39Smrgfi])
926263847c39Smrg
926363847c39Smrg# Test for the ability of xmlto to generate a text target
926463847c39Smrghave_xmlto_text=no
926563847c39Smrgcat > conftest.xml << "EOF"
926663847c39SmrgEOF
926763847c39SmrgAS_IF([test "$have_xmlto" = yes],
926863847c39Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
926963847c39Smrg             [have_xmlto_text=yes],
927063847c39Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
927163847c39Smrgrm -f conftest.xml
927263847c39SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
927363847c39SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
927463847c39Smrg]) # XORG_WITH_XMLTO
927563847c39Smrg
927663847c39Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
927763847c39Smrg# --------------------------------------------
927863847c39Smrg# Minimum version: 1.12.0
927963847c39Smrg# Minimum version for optional DEFAULT argument: 1.12.0
928063847c39Smrg#
928163847c39Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
928263847c39Smrg# XML-based language used for the transformation of XML documents.
928363847c39Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
928463847c39Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
928563847c39Smrg# The XSLT processor is often used as a standalone tool for transformations.
928663847c39Smrg# It should not be assumed that this tool is used only to work with documnetation.
928763847c39Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
928863847c39Smrg#
928963847c39Smrg# Interface to module:
929063847c39Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
929163847c39Smrg# XSLTPROC:	 returns the path of the xsltproc program found
929263847c39Smrg#		 returns the path set by the user in the environment
929363847c39Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
929463847c39Smrg#		  'no' user instructs the module not to use xsltproc
929563847c39Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
929663847c39Smrg#
929763847c39Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
929863847c39Smrg#
929963847c39SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
930063847c39SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
930163847c39Smrg# Preserves the interface, should it be implemented later
930263847c39Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
930363847c39Smrgm4_define([_defopt], m4_default([$2], [auto]))
930463847c39SmrgAC_ARG_WITH(xsltproc,
930563847c39Smrg	AS_HELP_STRING([--with-xsltproc],
930663847c39Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
930763847c39Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
930863847c39Smrgm4_undefine([_defopt])
930963847c39Smrg
931063847c39Smrgif test "x$use_xsltproc" = x"auto"; then
931163847c39Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
931263847c39Smrg   if test "x$XSLTPROC" = "x"; then
931363847c39Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
931463847c39Smrg	have_xsltproc=no
931563847c39Smrg   else
931663847c39Smrg        have_xsltproc=yes
931763847c39Smrg   fi
931863847c39Smrgelif test "x$use_xsltproc" = x"yes" ; then
931963847c39Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
932063847c39Smrg   if test "x$XSLTPROC" = "x"; then
932163847c39Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
932263847c39Smrg   fi
932363847c39Smrg   have_xsltproc=yes
932463847c39Smrgelif test "x$use_xsltproc" = x"no" ; then
932563847c39Smrg   if test "x$XSLTPROC" != "x"; then
932663847c39Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
932763847c39Smrg   fi
932863847c39Smrg   have_xsltproc=no
932963847c39Smrgelse
933063847c39Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
933163847c39Smrgfi
933263847c39Smrg
933363847c39SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
933463847c39Smrg]) # XORG_WITH_XSLTPROC
933563847c39Smrg
933663847c39Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
933763847c39Smrg# ----------------------------------------
933863847c39Smrg# Minimum version: 1.15.0
933963847c39Smrg#
934063847c39Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
934163847c39Smrg# scanning arbitrary text files, extracting information from those text files,
934263847c39Smrg# and printing reports based on that information.
934363847c39Smrg#
934463847c39Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
934563847c39Smrg#
934663847c39Smrg# Interface to module:
934763847c39Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
934863847c39Smrg# PERL:	     returns the path of the perl program found
934963847c39Smrg#	     returns the path set by the user in the environment
935063847c39Smrg# --with-perl: 'yes' user instructs the module to use perl
935163847c39Smrg#	       'no' user instructs the module not to use perl
935263847c39Smrg# have_perl: returns yes if perl found in PATH or no
935363847c39Smrg#
935463847c39Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
935563847c39Smrg#
935663847c39SmrgAC_DEFUN([XORG_WITH_PERL],[
935763847c39SmrgAC_ARG_VAR([PERL], [Path to perl command])
935863847c39Smrg# Preserves the interface, should it be implemented later
935963847c39Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
936063847c39Smrgm4_define([_defopt], m4_default([$2], [auto]))
936163847c39SmrgAC_ARG_WITH(perl,
936263847c39Smrg	AS_HELP_STRING([--with-perl],
936363847c39Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
936463847c39Smrg	   [use_perl=$withval], [use_perl=]_defopt)
936563847c39Smrgm4_undefine([_defopt])
936663847c39Smrg
936763847c39Smrgif test "x$use_perl" = x"auto"; then
936863847c39Smrg   AC_PATH_PROG([PERL], [perl])
936963847c39Smrg   if test "x$PERL" = "x"; then
937063847c39Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
937163847c39Smrg	have_perl=no
937263847c39Smrg   else
937363847c39Smrg        have_perl=yes
937463847c39Smrg   fi
937563847c39Smrgelif test "x$use_perl" = x"yes" ; then
937663847c39Smrg   AC_PATH_PROG([PERL], [perl])
937763847c39Smrg   if test "x$PERL" = "x"; then
937863847c39Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
937963847c39Smrg   fi
938063847c39Smrg   have_perl=yes
938163847c39Smrgelif test "x$use_perl" = x"no" ; then
938263847c39Smrg   if test "x$PERL" != "x"; then
938363847c39Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
938463847c39Smrg   fi
938563847c39Smrg   have_perl=no
938663847c39Smrgelse
938763847c39Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
938863847c39Smrgfi
938963847c39Smrg
939063847c39SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
939163847c39Smrg]) # XORG_WITH_PERL
939263847c39Smrg
939363847c39Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
939463847c39Smrg# ----------------
939563847c39Smrg# Minimum version: 1.5.0
939663847c39Smrg# Minimum version for optional DEFAULT argument: 1.11.0
939763847c39Smrg#
939863847c39Smrg# Documentation tools are not always available on all platforms and sometimes
939963847c39Smrg# not at the appropriate level. This macro enables a module to test for the
940063847c39Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
940163847c39Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
940263847c39Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
940363847c39Smrg# --with-asciidoc assumes 'auto'.
940463847c39Smrg#
940563847c39Smrg# Interface to module:
940663847c39Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
940763847c39Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
940863847c39Smrg#		 returns the path set by the user in the environment
940963847c39Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
941063847c39Smrg#		  'no' user instructs the module not to use asciidoc
941163847c39Smrg#
941263847c39Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
941363847c39Smrg#
941463847c39SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
941563847c39SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
941663847c39Smrgm4_define([_defopt], m4_default([$2], [auto]))
941763847c39SmrgAC_ARG_WITH(asciidoc,
941863847c39Smrg	AS_HELP_STRING([--with-asciidoc],
941963847c39Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
942063847c39Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
942163847c39Smrgm4_undefine([_defopt])
942263847c39Smrg
942363847c39Smrgif test "x$use_asciidoc" = x"auto"; then
942463847c39Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
942563847c39Smrg   if test "x$ASCIIDOC" = "x"; then
942663847c39Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
942763847c39Smrg	have_asciidoc=no
942863847c39Smrg   else
942963847c39Smrg        have_asciidoc=yes
943063847c39Smrg   fi
943163847c39Smrgelif test "x$use_asciidoc" = x"yes" ; then
943263847c39Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
943363847c39Smrg   if test "x$ASCIIDOC" = "x"; then
943463847c39Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
943563847c39Smrg   fi
943663847c39Smrg   have_asciidoc=yes
943763847c39Smrgelif test "x$use_asciidoc" = x"no" ; then
943863847c39Smrg   if test "x$ASCIIDOC" != "x"; then
943963847c39Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
944063847c39Smrg   fi
944163847c39Smrg   have_asciidoc=no
944263847c39Smrgelse
944363847c39Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
944463847c39Smrgfi
944563847c39Smrgm4_ifval([$1],
944663847c39Smrg[if test "$have_asciidoc" = yes; then
944763847c39Smrg    # scrape the asciidoc version
944863847c39Smrg    AC_MSG_CHECKING([the asciidoc version])
944963847c39Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
945063847c39Smrg    AC_MSG_RESULT([$asciidoc_version])
945163847c39Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
945263847c39Smrg        [if test "x$use_asciidoc" = xauto; then
945363847c39Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
945463847c39Smrg            have_asciidoc=no
945563847c39Smrg        else
945663847c39Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
945763847c39Smrg        fi])
945863847c39Smrgfi])
945963847c39SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
946063847c39Smrg]) # XORG_WITH_ASCIIDOC
946163847c39Smrg
946263847c39Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
94639586ba5aSmrg# -------------------------------------------
946463847c39Smrg# Minimum version: 1.5.0
946563847c39Smrg# Minimum version for optional DEFAULT argument: 1.11.0
94669586ba5aSmrg# Minimum version for optional DOT checking: 1.18.0
946763847c39Smrg#
946863847c39Smrg# Documentation tools are not always available on all platforms and sometimes
946963847c39Smrg# not at the appropriate level. This macro enables a module to test for the
947063847c39Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
947163847c39Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
947263847c39Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
947363847c39Smrg# --with-doxygen assumes 'auto'.
947463847c39Smrg#
947563847c39Smrg# Interface to module:
947663847c39Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
947763847c39Smrg# DOXYGEN:	 returns the path of the doxygen program found
947863847c39Smrg#		 returns the path set by the user in the environment
947963847c39Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
948063847c39Smrg#		  'no' user instructs the module not to use doxygen
948163847c39Smrg#
948263847c39Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
948363847c39Smrg#
948463847c39SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
948563847c39SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
94869586ba5aSmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
948763847c39Smrgm4_define([_defopt], m4_default([$2], [auto]))
948863847c39SmrgAC_ARG_WITH(doxygen,
948963847c39Smrg	AS_HELP_STRING([--with-doxygen],
949063847c39Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
949163847c39Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
949263847c39Smrgm4_undefine([_defopt])
949363847c39Smrg
949463847c39Smrgif test "x$use_doxygen" = x"auto"; then
949563847c39Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
949663847c39Smrg   if test "x$DOXYGEN" = "x"; then
949763847c39Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
949863847c39Smrg	have_doxygen=no
949963847c39Smrg   else
950063847c39Smrg        have_doxygen=yes
950163847c39Smrg   fi
950263847c39Smrgelif test "x$use_doxygen" = x"yes" ; then
950363847c39Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
950463847c39Smrg   if test "x$DOXYGEN" = "x"; then
950563847c39Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
950663847c39Smrg   fi
950763847c39Smrg   have_doxygen=yes
950863847c39Smrgelif test "x$use_doxygen" = x"no" ; then
950963847c39Smrg   if test "x$DOXYGEN" != "x"; then
951063847c39Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
951163847c39Smrg   fi
951263847c39Smrg   have_doxygen=no
951363847c39Smrgelse
951463847c39Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
951563847c39Smrgfi
951663847c39Smrgm4_ifval([$1],
951763847c39Smrg[if test "$have_doxygen" = yes; then
951863847c39Smrg    # scrape the doxygen version
951963847c39Smrg    AC_MSG_CHECKING([the doxygen version])
952063847c39Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
952163847c39Smrg    AC_MSG_RESULT([$doxygen_version])
952263847c39Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
952363847c39Smrg        [if test "x$use_doxygen" = xauto; then
952463847c39Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
952563847c39Smrg            have_doxygen=no
952663847c39Smrg        else
952763847c39Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
952863847c39Smrg        fi])
952963847c39Smrgfi])
95309586ba5aSmrg
95319586ba5aSmrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
95329586ba5aSmrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
95339586ba5aSmrgdnl 	HAVE_DOT = @HAVE_DOT@
95349586ba5aSmrgHAVE_DOT=no
95359586ba5aSmrgif test "x$have_doxygen" = "xyes"; then
95369586ba5aSmrg  AC_PATH_PROG([DOT], [dot])
95379586ba5aSmrg    if test "x$DOT" != "x"; then
95389586ba5aSmrg      HAVE_DOT=yes
95399586ba5aSmrg    fi
95409586ba5aSmrgfi
95419586ba5aSmrg
95429586ba5aSmrgAC_SUBST([HAVE_DOT])
95439586ba5aSmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
954463847c39SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
954563847c39Smrg]) # XORG_WITH_DOXYGEN
954663847c39Smrg
954763847c39Smrg# XORG_WITH_GROFF([DEFAULT])
954863847c39Smrg# ----------------
954963847c39Smrg# Minimum version: 1.6.0
955063847c39Smrg# Minimum version for optional DEFAULT argument: 1.11.0
955163847c39Smrg#
955263847c39Smrg# Documentation tools are not always available on all platforms and sometimes
955363847c39Smrg# not at the appropriate level. This macro enables a module to test for the
955463847c39Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
955563847c39Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
955663847c39Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
955763847c39Smrg# --with-groff assumes 'auto'.
955863847c39Smrg#
955963847c39Smrg# Interface to module:
956063847c39Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
956163847c39Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
956263847c39Smrg# HAVE_GROFF_MS: the -ms macros package
956363847c39Smrg# GROFF:	 returns the path of the groff program found
956463847c39Smrg#		 returns the path set by the user in the environment
956563847c39Smrg# --with-groff:	 'yes' user instructs the module to use groff
956663847c39Smrg#		 'no' user instructs the module not to use groff
956763847c39Smrg#
956863847c39Smrg# Added in version 1.9.0:
956963847c39Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
957063847c39Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
957163847c39Smrg#		   psselect from the psutils package.
957263847c39Smrg#		   the ghostcript package. Refer to the grohtml man pages
957363847c39Smrg#
957463847c39Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
957563847c39Smrg#
957663847c39Smrg# OS and distros often splits groff in a basic and full package, the former
957763847c39Smrg# having the groff program and the later having devices, fonts and macros
957863847c39Smrg# Checking for the groff executable is not enough.
957963847c39Smrg#
958063847c39Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
958163847c39Smrg# unset HAVE_GROFF or GROFF env variables.
958263847c39Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
958363847c39Smrg#
958463847c39SmrgAC_DEFUN([XORG_WITH_GROFF],[
958563847c39SmrgAC_ARG_VAR([GROFF], [Path to groff command])
958663847c39Smrgm4_define([_defopt], m4_default([$1], [auto]))
958763847c39SmrgAC_ARG_WITH(groff,
958863847c39Smrg	AS_HELP_STRING([--with-groff],
958963847c39Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
959063847c39Smrg	   [use_groff=$withval], [use_groff=]_defopt)
959163847c39Smrgm4_undefine([_defopt])
959263847c39Smrg
959363847c39Smrgif test "x$use_groff" = x"auto"; then
959463847c39Smrg   AC_PATH_PROG([GROFF], [groff])
959563847c39Smrg   if test "x$GROFF" = "x"; then
959663847c39Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
959763847c39Smrg	have_groff=no
959863847c39Smrg   else
959963847c39Smrg        have_groff=yes
960063847c39Smrg   fi
960163847c39Smrgelif test "x$use_groff" = x"yes" ; then
960263847c39Smrg   AC_PATH_PROG([GROFF], [groff])
960363847c39Smrg   if test "x$GROFF" = "x"; then
960463847c39Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
960563847c39Smrg   fi
960663847c39Smrg   have_groff=yes
960763847c39Smrgelif test "x$use_groff" = x"no" ; then
960863847c39Smrg   if test "x$GROFF" != "x"; then
960963847c39Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
961063847c39Smrg   fi
961163847c39Smrg   have_groff=no
961263847c39Smrgelse
961363847c39Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
961463847c39Smrgfi
961563847c39Smrg
961663847c39Smrg# We have groff, test for the presence of the macro packages
961763847c39Smrgif test "x$have_groff" = x"yes"; then
961863847c39Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
961963847c39Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
962063847c39Smrg        groff_ms_works=yes
962163847c39Smrg    else
962263847c39Smrg        groff_ms_works=no
962363847c39Smrg    fi
962463847c39Smrg    AC_MSG_RESULT([$groff_ms_works])
962563847c39Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
962663847c39Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
962763847c39Smrg        groff_mm_works=yes
962863847c39Smrg    else
962963847c39Smrg        groff_mm_works=no
963063847c39Smrg    fi
963163847c39Smrg    AC_MSG_RESULT([$groff_mm_works])
963263847c39Smrgfi
963363847c39Smrg
963463847c39Smrg# We have groff, test for HTML dependencies, one command per package
963563847c39Smrgif test "x$have_groff" = x"yes"; then
963663847c39Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
963763847c39Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
963863847c39Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
963963847c39Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
964063847c39Smrg      have_groff_html=yes
964163847c39Smrg   else
964263847c39Smrg      have_groff_html=no
964363847c39Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
964463847c39Smrg   fi
964563847c39Smrgfi
964663847c39Smrg
964763847c39Smrg# Set Automake conditionals for Makefiles
964863847c39SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
964963847c39SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
965063847c39SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
965163847c39SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
965263847c39Smrg]) # XORG_WITH_GROFF
965363847c39Smrg
965463847c39Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
965563847c39Smrg# ---------------------------------------
965663847c39Smrg# Minimum version: 1.6.0
965763847c39Smrg# Minimum version for optional DEFAULT argument: 1.11.0
965863847c39Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
965963847c39Smrg#
966063847c39Smrg# Documentation tools are not always available on all platforms and sometimes
966163847c39Smrg# not at the appropriate level. This macro enables a module to test for the
966263847c39Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
966363847c39Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
966463847c39Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
966563847c39Smrg# --with-fop assumes 'auto'.
966663847c39Smrg#
966763847c39Smrg# Interface to module:
966863847c39Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
966963847c39Smrg# FOP:	 	returns the path of the fop program found
967063847c39Smrg#		returns the path set by the user in the environment
967163847c39Smrg# --with-fop: 	'yes' user instructs the module to use fop
967263847c39Smrg#		'no' user instructs the module not to use fop
967363847c39Smrg#
967463847c39Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
967563847c39Smrg#
967663847c39SmrgAC_DEFUN([XORG_WITH_FOP],[
967763847c39SmrgAC_ARG_VAR([FOP], [Path to fop command])
967863847c39Smrgm4_define([_defopt], m4_default([$2], [auto]))
967963847c39SmrgAC_ARG_WITH(fop,
968063847c39Smrg	AS_HELP_STRING([--with-fop],
968163847c39Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
968263847c39Smrg	   [use_fop=$withval], [use_fop=]_defopt)
968363847c39Smrgm4_undefine([_defopt])
968463847c39Smrg
968563847c39Smrgif test "x$use_fop" = x"auto"; then
968663847c39Smrg   AC_PATH_PROG([FOP], [fop])
968763847c39Smrg   if test "x$FOP" = "x"; then
968863847c39Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
968963847c39Smrg	have_fop=no
969063847c39Smrg   else
969163847c39Smrg        have_fop=yes
969263847c39Smrg   fi
969363847c39Smrgelif test "x$use_fop" = x"yes" ; then
969463847c39Smrg   AC_PATH_PROG([FOP], [fop])
969563847c39Smrg   if test "x$FOP" = "x"; then
969663847c39Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
969763847c39Smrg   fi
969863847c39Smrg   have_fop=yes
969963847c39Smrgelif test "x$use_fop" = x"no" ; then
970063847c39Smrg   if test "x$FOP" != "x"; then
970163847c39Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
970263847c39Smrg   fi
970363847c39Smrg   have_fop=no
970463847c39Smrgelse
970563847c39Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
970663847c39Smrgfi
970763847c39Smrg
970863847c39Smrg# Test for a minimum version of fop, if provided.
970963847c39Smrgm4_ifval([$1],
971063847c39Smrg[if test "$have_fop" = yes; then
971163847c39Smrg    # scrape the fop version
971263847c39Smrg    AC_MSG_CHECKING([for fop minimum version])
971363847c39Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
971463847c39Smrg    AC_MSG_RESULT([$fop_version])
971563847c39Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
971663847c39Smrg        [if test "x$use_fop" = xauto; then
971763847c39Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
971863847c39Smrg            have_fop=no
971963847c39Smrg        else
972063847c39Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
972163847c39Smrg        fi])
972263847c39Smrgfi])
972363847c39SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
972463847c39Smrg]) # XORG_WITH_FOP
972563847c39Smrg
97269586ba5aSmrg# XORG_WITH_M4([MIN-VERSION])
97279586ba5aSmrg# ---------------------------
97289586ba5aSmrg# Minimum version: 1.19.0
97299586ba5aSmrg#
97309586ba5aSmrg# This macro attempts to locate an m4 macro processor which supports
97319586ba5aSmrg# -I option and is only useful for modules relying on M4 in order to
97329586ba5aSmrg# expand macros in source code files.
97339586ba5aSmrg#
97349586ba5aSmrg# Interface to module:
97359586ba5aSmrg# M4:	 	returns the path of the m4 program found
97369586ba5aSmrg#		returns the path set by the user in the environment
97379586ba5aSmrg#
97389586ba5aSmrgAC_DEFUN([XORG_WITH_M4], [
97399586ba5aSmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
97409586ba5aSmrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
97419586ba5aSmrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
97429586ba5aSmrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
97439586ba5aSmrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
97449586ba5aSmrg   [$PATH:/usr/gnu/bin])])
97459586ba5aSmrg
97469586ba5aSmrgAC_SUBST([M4], [$ac_cv_path_M4])
97479586ba5aSmrg]) # XORG_WITH_M4
97489586ba5aSmrg
974963847c39Smrg# XORG_WITH_PS2PDF([DEFAULT])
975063847c39Smrg# ----------------
975163847c39Smrg# Minimum version: 1.6.0
975263847c39Smrg# Minimum version for optional DEFAULT argument: 1.11.0
975363847c39Smrg#
975463847c39Smrg# Documentation tools are not always available on all platforms and sometimes
975563847c39Smrg# not at the appropriate level. This macro enables a module to test for the
975663847c39Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
975763847c39Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
975863847c39Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
975963847c39Smrg# --with-ps2pdf assumes 'auto'.
976063847c39Smrg#
976163847c39Smrg# Interface to module:
976263847c39Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
976363847c39Smrg# PS2PDF:	returns the path of the ps2pdf program found
976463847c39Smrg#		returns the path set by the user in the environment
976563847c39Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
976663847c39Smrg#		 'no' user instructs the module not to use ps2pdf
976763847c39Smrg#
976863847c39Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
976963847c39Smrg#
977063847c39SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
977163847c39SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
977263847c39Smrgm4_define([_defopt], m4_default([$1], [auto]))
977363847c39SmrgAC_ARG_WITH(ps2pdf,
977463847c39Smrg	AS_HELP_STRING([--with-ps2pdf],
977563847c39Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
977663847c39Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
977763847c39Smrgm4_undefine([_defopt])
977863847c39Smrg
977963847c39Smrgif test "x$use_ps2pdf" = x"auto"; then
978063847c39Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
978163847c39Smrg   if test "x$PS2PDF" = "x"; then
978263847c39Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
978363847c39Smrg	have_ps2pdf=no
978463847c39Smrg   else
978563847c39Smrg        have_ps2pdf=yes
978663847c39Smrg   fi
978763847c39Smrgelif test "x$use_ps2pdf" = x"yes" ; then
978863847c39Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
978963847c39Smrg   if test "x$PS2PDF" = "x"; then
979063847c39Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
979163847c39Smrg   fi
979263847c39Smrg   have_ps2pdf=yes
979363847c39Smrgelif test "x$use_ps2pdf" = x"no" ; then
979463847c39Smrg   if test "x$PS2PDF" != "x"; then
979563847c39Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
979663847c39Smrg   fi
979763847c39Smrg   have_ps2pdf=no
979863847c39Smrgelse
979963847c39Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
980063847c39Smrgfi
980163847c39SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
980263847c39Smrg]) # XORG_WITH_PS2PDF
980363847c39Smrg
980463847c39Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
980563847c39Smrg# ----------------
980663847c39Smrg# Minimum version: 1.6.0
980763847c39Smrg#
980863847c39Smrg# Documentation tools are not always available on all platforms and sometimes
980963847c39Smrg# not at the appropriate level. This macro enables a builder to skip all
981063847c39Smrg# documentation targets except traditional man pages.
981163847c39Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
981263847c39Smrg# maximum flexibilty in controlling documentation building.
981363847c39Smrg# Refer to:
981463847c39Smrg# XORG_WITH_XMLTO         --with-xmlto
981563847c39Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
981663847c39Smrg# XORG_WITH_DOXYGEN       --with-doxygen
981763847c39Smrg# XORG_WITH_FOP           --with-fop
981863847c39Smrg# XORG_WITH_GROFF         --with-groff
981963847c39Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
982063847c39Smrg#
982163847c39Smrg# Interface to module:
982263847c39Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
982363847c39Smrg# --enable-docs: 'yes' user instructs the module to generate docs
982463847c39Smrg#		 'no' user instructs the module not to generate docs
982563847c39Smrg# parm1:	specify the default value, yes or no.
982663847c39Smrg#
982763847c39SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
982863847c39Smrgm4_define([docs_default], m4_default([$1], [yes]))
982963847c39SmrgAC_ARG_ENABLE(docs,
983063847c39Smrg	AS_HELP_STRING([--enable-docs],
983163847c39Smrg	   [Enable building the documentation (default: ]docs_default[)]),
983263847c39Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
983363847c39Smrgm4_undefine([docs_default])
983463847c39SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
983563847c39SmrgAC_MSG_CHECKING([whether to build documentation])
983663847c39SmrgAC_MSG_RESULT([$build_docs])
983763847c39Smrg]) # XORG_ENABLE_DOCS
983863847c39Smrg
983963847c39Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
984063847c39Smrg# ----------------
984163847c39Smrg# Minimum version: 1.6.0
984263847c39Smrg#
984363847c39Smrg# This macro enables a builder to skip all developer documentation.
984463847c39Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
984563847c39Smrg# maximum flexibilty in controlling documentation building.
984663847c39Smrg# Refer to:
984763847c39Smrg# XORG_WITH_XMLTO         --with-xmlto
984863847c39Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
984963847c39Smrg# XORG_WITH_DOXYGEN       --with-doxygen
985063847c39Smrg# XORG_WITH_FOP           --with-fop
985163847c39Smrg# XORG_WITH_GROFF         --with-groff
985263847c39Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
985363847c39Smrg#
985463847c39Smrg# Interface to module:
985563847c39Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
985663847c39Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
985763847c39Smrg#			'no' user instructs the module not to generate developer docs
985863847c39Smrg# parm1:		specify the default value, yes or no.
985963847c39Smrg#
986063847c39SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
986163847c39Smrgm4_define([devel_default], m4_default([$1], [yes]))
986263847c39SmrgAC_ARG_ENABLE(devel-docs,
986363847c39Smrg	AS_HELP_STRING([--enable-devel-docs],
986463847c39Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
986563847c39Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
986663847c39Smrgm4_undefine([devel_default])
986763847c39SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
986863847c39SmrgAC_MSG_CHECKING([whether to build developer documentation])
986963847c39SmrgAC_MSG_RESULT([$build_devel_docs])
987063847c39Smrg]) # XORG_ENABLE_DEVEL_DOCS
987163847c39Smrg
987263847c39Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
987363847c39Smrg# ----------------
987463847c39Smrg# Minimum version: 1.6.0
987563847c39Smrg#
987663847c39Smrg# This macro enables a builder to skip all functional specification targets.
987763847c39Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
987863847c39Smrg# maximum flexibilty in controlling documentation building.
987963847c39Smrg# Refer to:
988063847c39Smrg# XORG_WITH_XMLTO         --with-xmlto
988163847c39Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
988263847c39Smrg# XORG_WITH_DOXYGEN       --with-doxygen
988363847c39Smrg# XORG_WITH_FOP           --with-fop
988463847c39Smrg# XORG_WITH_GROFF         --with-groff
988563847c39Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
988663847c39Smrg#
988763847c39Smrg# Interface to module:
988863847c39Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
988963847c39Smrg# --enable-specs:	'yes' user instructs the module to generate specs
989063847c39Smrg#			'no' user instructs the module not to generate specs
989163847c39Smrg# parm1:		specify the default value, yes or no.
989263847c39Smrg#
989363847c39SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
989463847c39Smrgm4_define([spec_default], m4_default([$1], [yes]))
989563847c39SmrgAC_ARG_ENABLE(specs,
989663847c39Smrg	AS_HELP_STRING([--enable-specs],
989763847c39Smrg	   [Enable building the specs (default: ]spec_default[)]),
989863847c39Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
989963847c39Smrgm4_undefine([spec_default])
990063847c39SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
990163847c39SmrgAC_MSG_CHECKING([whether to build functional specifications])
990263847c39SmrgAC_MSG_RESULT([$build_specs])
990363847c39Smrg]) # XORG_ENABLE_SPECS
990463847c39Smrg
990563847c39Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
990663847c39Smrg# ----------------------------------------------
990763847c39Smrg# Minimum version: 1.13.0
990863847c39Smrg#
990963847c39Smrg# This macro enables a builder to enable/disable unit testing
991063847c39Smrg# It makes no assumption about the test cases implementation
991163847c39Smrg# Test cases may or may not use Automake "Support for test suites"
991263847c39Smrg# They may or may not use the software utility library GLib
991363847c39Smrg#
991463847c39Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
991563847c39Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
991663847c39Smrg# The variable enable_unit_tests is used by other macros in this file.
991763847c39Smrg#
991863847c39Smrg# Interface to module:
991963847c39Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
992063847c39Smrg# enable_unit_tests:    used in configure.ac for additional configuration
992163847c39Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
992263847c39Smrg#			'no' user instructs the module not to build tests
992363847c39Smrg# parm1:		specify the default value, yes or no.
992463847c39Smrg#
992563847c39SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
992663847c39SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
992763847c39SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
992863847c39SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
992963847c39Smrgm4_define([_defopt], m4_default([$1], [auto]))
993063847c39SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
993163847c39Smrg	[Enable building unit test cases (default: ]_defopt[)]),
993263847c39Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
993363847c39Smrgm4_undefine([_defopt])
993463847c39SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
993563847c39SmrgAC_MSG_CHECKING([whether to build unit test cases])
993663847c39SmrgAC_MSG_RESULT([$enable_unit_tests])
993763847c39Smrg]) # XORG_ENABLE_UNIT_TESTS
993863847c39Smrg
993963847c39Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
994063847c39Smrg# ------------------------------------------------------
994163847c39Smrg# Minimum version: 1.17.0
994263847c39Smrg#
994363847c39Smrg# This macro enables a builder to enable/disable integration testing
994463847c39Smrg# It makes no assumption about the test cases' implementation
994563847c39Smrg# Test cases may or may not use Automake "Support for test suites"
994663847c39Smrg#
994763847c39Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
994863847c39Smrg# usually requires less dependencies and may be built and run under less
994963847c39Smrg# stringent environments than integration tests.
995063847c39Smrg#
995163847c39Smrg# Interface to module:
995263847c39Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
995363847c39Smrg# enable_integration_tests:   used in configure.ac for additional configuration
995463847c39Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
995563847c39Smrg#                             'no' user instructs the module not to build tests
995663847c39Smrg# parm1:                      specify the default value, yes or no.
995763847c39Smrg#
995863847c39SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
995963847c39SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
996063847c39Smrgm4_define([_defopt], m4_default([$1], [auto]))
996163847c39SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
996263847c39Smrg	[Enable building integration test cases (default: ]_defopt[)]),
996363847c39Smrg	[enable_integration_tests=$enableval],
996463847c39Smrg	[enable_integration_tests=]_defopt)
996563847c39Smrgm4_undefine([_defopt])
996663847c39SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
996763847c39Smrg	[test "x$enable_integration_tests" != xno])
996863847c39SmrgAC_MSG_CHECKING([whether to build unit test cases])
996963847c39SmrgAC_MSG_RESULT([$enable_integration_tests])
997063847c39Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
997163847c39Smrg
997263847c39Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
997363847c39Smrg# ----------------------------------------
997463847c39Smrg# Minimum version: 1.13.0
997563847c39Smrg#
997663847c39Smrg# GLib is a library which provides advanced data structures and functions.
997763847c39Smrg# This macro enables a module to test for the presence of Glib.
997863847c39Smrg#
997963847c39Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
998063847c39Smrg# Otherwise the value of $enable_unit_tests is blank.
998163847c39Smrg#
998263847c39Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
998363847c39Smrg# test support usually requires less dependencies and may be built and run under
998463847c39Smrg# less stringent environments than integration tests.
998563847c39Smrg#
998663847c39Smrg# Interface to module:
998763847c39Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
998863847c39Smrg# with_glib: used in configure.ac to know if GLib has been found
998963847c39Smrg# --with-glib:	'yes' user instructs the module to use glib
999063847c39Smrg#		'no' user instructs the module not to use glib
999163847c39Smrg#
999263847c39SmrgAC_DEFUN([XORG_WITH_GLIB],[
999363847c39SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
999463847c39Smrgm4_define([_defopt], m4_default([$2], [auto]))
999563847c39SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
999663847c39Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
999763847c39Smrg	[with_glib=$withval], [with_glib=]_defopt)
999863847c39Smrgm4_undefine([_defopt])
999963847c39Smrg
1000063847c39Smrghave_glib=no
1000163847c39Smrg# Do not probe GLib if user explicitly disabled unit testing
1000263847c39Smrgif test "x$enable_unit_tests" != x"no"; then
1000363847c39Smrg  # Do not probe GLib if user explicitly disabled it
1000463847c39Smrg  if test "x$with_glib" != x"no"; then
1000563847c39Smrg    m4_ifval(
1000663847c39Smrg      [$1],
1000763847c39Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
1000863847c39Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
1000963847c39Smrg    )
1001063847c39Smrg  fi
1001163847c39Smrgfi
1001263847c39Smrg
1001363847c39Smrg# Not having GLib when unit testing has been explicitly requested is an error
1001463847c39Smrgif test "x$enable_unit_tests" = x"yes"; then
1001563847c39Smrg  if test "x$have_glib" = x"no"; then
1001663847c39Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1001763847c39Smrg  fi
1001863847c39Smrgfi
1001963847c39Smrg
1002063847c39Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
1002163847c39Smrgif test "x$enable_unit_tests" = x"no"; then
1002263847c39Smrg  if test "x$with_glib" = x"yes"; then
1002363847c39Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1002463847c39Smrg  fi
1002563847c39Smrgfi
1002663847c39Smrg
1002763847c39Smrg# Not having GLib when it has been explicitly requested is an error
1002863847c39Smrgif test "x$with_glib" = x"yes"; then
1002963847c39Smrg  if test "x$have_glib" = x"no"; then
1003063847c39Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
1003163847c39Smrg  fi
1003263847c39Smrgfi
1003363847c39Smrg
1003463847c39SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
1003563847c39Smrg]) # XORG_WITH_GLIB
1003663847c39Smrg
1003763847c39Smrg# XORG_LD_WRAP([required|optional])
1003863847c39Smrg# ---------------------------------
1003963847c39Smrg# Minimum version: 1.13.0
1004063847c39Smrg#
1004163847c39Smrg# Check if linker supports -wrap, passed via compiler flags
1004263847c39Smrg#
1004363847c39Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
1004463847c39Smrg# Otherwise the value of $enable_unit_tests is blank.
1004563847c39Smrg#
1004663847c39Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
1004763847c39Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
1004863847c39Smrg# available, an argument of "optional" allows use when some unit tests require
1004963847c39Smrg# ld -wrap and others do not.
1005063847c39Smrg#
1005163847c39SmrgAC_DEFUN([XORG_LD_WRAP],[
1005263847c39SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
1005363847c39Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
1005463847c39Smrg                      void __wrap_exit(int status) { return; }],
1005563847c39Smrg                     [exit(0);])])
1005663847c39Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
1005763847c39Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
1005863847c39Smrg  if test "x$have_ld_wrap" = x"no"; then
1005963847c39Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
1006063847c39Smrg  fi
1006163847c39Smrgfi
1006263847c39SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
1006363847c39Smrg#
1006463847c39Smrg]) # XORG_LD_WRAP
1006563847c39Smrg
1006663847c39Smrg# XORG_CHECK_LINKER_FLAGS
1006763847c39Smrg# -----------------------
1006863847c39Smrg# SYNOPSIS
1006963847c39Smrg#
1007063847c39Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
1007163847c39Smrg#
1007263847c39Smrg# DESCRIPTION
1007363847c39Smrg#
1007463847c39Smrg#   Check whether the given linker FLAGS work with the current language's
1007563847c39Smrg#   linker, or whether they give an error.
1007663847c39Smrg#
1007763847c39Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
1007863847c39Smrg#   success/failure.
1007963847c39Smrg#
1008063847c39Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
1008163847c39Smrg#
1008263847c39Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
1008363847c39Smrg#
1008463847c39Smrg# LICENSE
1008563847c39Smrg#
1008663847c39Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
1008763847c39Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
1008863847c39Smrg#   Copyright (c) 2009 Matteo Frigo
1008963847c39Smrg#
1009063847c39Smrg#   This program is free software: you can redistribute it and/or modify it
1009163847c39Smrg#   under the terms of the GNU General Public License as published by the
1009263847c39Smrg#   Free Software Foundation, either version 3 of the License, or (at your
1009363847c39Smrg#   option) any later version.
1009463847c39Smrg#
1009563847c39Smrg#   This program is distributed in the hope that it will be useful, but
1009663847c39Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
1009763847c39Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1009863847c39Smrg#   Public License for more details.
1009963847c39Smrg#
1010063847c39Smrg#   You should have received a copy of the GNU General Public License along
1010163847c39Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
1010263847c39Smrg#
1010363847c39Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
1010463847c39Smrg#   gives unlimited permission to copy, distribute and modify the configure
1010563847c39Smrg#   scripts that are the output of Autoconf when processing the Macro. You
1010663847c39Smrg#   need not follow the terms of the GNU General Public License when using
1010763847c39Smrg#   or distributing such scripts, even though portions of the text of the
1010863847c39Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
1010963847c39Smrg#   all other use of the material that constitutes the Autoconf Macro.
1011063847c39Smrg#
1011163847c39Smrg#   This special exception to the GPL applies to versions of the Autoconf
1011263847c39Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
1011363847c39Smrg#   modified version of the Autoconf Macro, you may extend this special
1011463847c39Smrg#   exception to the GPL to apply to your modified version as well.#
1011563847c39SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
1011663847c39Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
1011763847c39Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
1011863847c39SmrgAS_LITERAL_IF([$1],
1011963847c39Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
1012063847c39Smrg      ax_save_FLAGS=$LDFLAGS
1012163847c39Smrg      LDFLAGS="$1"
1012263847c39Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
1012363847c39Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1012463847c39Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1012563847c39Smrg      LDFLAGS=$ax_save_FLAGS])],
1012663847c39Smrg  [ax_save_FLAGS=$LDFLAGS
1012763847c39Smrg   LDFLAGS="$1"
1012863847c39Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1012963847c39Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1013063847c39Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1013163847c39Smrg   LDFLAGS=$ax_save_FLAGS])
1013263847c39Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
1013363847c39SmrgAC_MSG_RESULT($xorg_check_linker_flags)
1013463847c39Smrgif test "x$xorg_check_linker_flags" = xyes; then
1013563847c39Smrg	m4_default([$2], :)
1013663847c39Smrgelse
1013763847c39Smrg	m4_default([$3], :)
1013863847c39Smrgfi
1013963847c39Smrg]) # XORG_CHECK_LINKER_FLAGS
1014063847c39Smrg
1014163847c39Smrg# XORG_MEMORY_CHECK_FLAGS
1014263847c39Smrg# -----------------------
1014363847c39Smrg# Minimum version: 1.16.0
1014463847c39Smrg#
1014563847c39Smrg# This macro attempts to find appropriate memory checking functionality
1014663847c39Smrg# for various platforms which unit testing code may use to catch various
1014763847c39Smrg# forms of memory allocation and access errors in testing.
1014863847c39Smrg#
1014963847c39Smrg# Interface to module:
1015063847c39Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
1015163847c39Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
1015263847c39Smrg#
1015363847c39Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
1015463847c39Smrg#
1015563847c39SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
1015663847c39Smrg
1015763847c39SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1015863847c39SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
1015963847c39Smrg           [Environment variables to enable memory checking in tests])
1016076888252Smrg
1016163847c39Smrg# Check for different types of support on different platforms
1016263847c39Smrgcase $host_os in
1016363847c39Smrg    solaris*)
1016463847c39Smrg        AC_CHECK_LIB([umem], [umem_alloc],
1016563847c39Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
1016663847c39Smrg        ;;
1016763847c39Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
1016863847c39Smrg        # both directly and inverted, so should not be 0 or 255.
1016963847c39Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
1017063847c39Smrg        ;;
1017163847c39Smrg    darwin*)
1017263847c39Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
1017363847c39Smrg        ;;
1017463847c39Smrg    *bsd*)
1017563847c39Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
1017663847c39Smrg        ;;
1017763847c39Smrgesac
1017876888252Smrg
1017963847c39Smrg# User supplied flags override default flags
1018063847c39Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
1018163847c39Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
1018286dafe34Smrgfi
1018376888252Smrg
1018463847c39SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
1018563847c39Smrg]) # XORG_WITH_LINT
1018676888252Smrg
1018786dafe34Smrg# XORG_CHECK_MALLOC_ZERO
1018886dafe34Smrg# ----------------------
1018986dafe34Smrg# Minimum version: 1.0.0
1019086dafe34Smrg#
1019186dafe34Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1019286dafe34Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1019386dafe34Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1019486dafe34SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1019586dafe34SmrgAC_ARG_ENABLE(malloc0returnsnull,
1019663847c39Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1019786dafe34Smrg		       [malloc(0) returns NULL (default: auto)]),
1019886dafe34Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1019986dafe34Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1020076888252Smrg
1020186dafe34SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1020286dafe34Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
102039586ba5aSmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
102049586ba5aSmrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
1020563847c39Smrg#include <stdlib.h>
1020663847c39Smrg],[
1020786dafe34Smrg    char *m0, *r0, *c0, *p;
1020886dafe34Smrg    m0 = malloc(0);
1020986dafe34Smrg    p = malloc(10);
1021086dafe34Smrg    r0 = realloc(p,0);
1021163847c39Smrg    c0 = calloc(0,10);
1021263847c39Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
1021363847c39Smrg])],
102149586ba5aSmrg		[xorg_cv_malloc0_returns_null=yes],
102159586ba5aSmrg		[xorg_cv_malloc0_returns_null=no])])
102169586ba5aSmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
1021786dafe34Smrgfi
1021886dafe34SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1021976888252Smrg
1022086dafe34Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1022186dafe34Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1022286dafe34Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1022386dafe34Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1022486dafe34Smrgelse
1022586dafe34Smrg	MALLOC_ZERO_CFLAGS=""
1022686dafe34Smrg	XMALLOC_ZERO_CFLAGS=""
1022786dafe34Smrg	XTMALLOC_ZERO_CFLAGS=""
1022886dafe34Smrgfi
1022976888252Smrg
1023086dafe34SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1023186dafe34SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1023286dafe34SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1023386dafe34Smrg]) # XORG_CHECK_MALLOC_ZERO
1023476888252Smrg
1023586dafe34Smrg# XORG_WITH_LINT()
1023686dafe34Smrg# ----------------
1023786dafe34Smrg# Minimum version: 1.1.0
1023886dafe34Smrg#
1023963847c39Smrg# This macro enables the use of a tool that flags some suspicious and
1024063847c39Smrg# non-portable constructs (likely to be bugs) in C language source code.
1024163847c39Smrg# It will attempt to locate the tool and use appropriate options.
1024263847c39Smrg# There are various lint type tools on different platforms.
1024363847c39Smrg#
1024463847c39Smrg# Interface to module:
1024563847c39Smrg# LINT:		returns the path to the tool found on the platform
1024663847c39Smrg#		or the value set to LINT on the configure cmd line
1024763847c39Smrg#		also an Automake conditional
1024863847c39Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
1024963847c39Smrg#
1025063847c39Smrg# --with-lint:	'yes' user instructs the module to use lint
1025163847c39Smrg#		'no' user instructs the module not to use lint (default)
1025263847c39Smrg#
1025363847c39Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1025463847c39Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1025586dafe34Smrg#
1025686dafe34SmrgAC_DEFUN([XORG_WITH_LINT],[
1025776888252Smrg
1025863847c39SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1025963847c39SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1026063847c39SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1026186dafe34Smrg		[Use a lint-style source code checker (default: disabled)])],
1026286dafe34Smrg		[use_lint=$withval], [use_lint=no])
1026363847c39Smrg
1026463847c39Smrg# Obtain platform specific info like program name and options
1026563847c39Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1026663847c39Smrgcase $host_os in
1026763847c39Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1026863847c39Smrg	lint_name=splint
1026963847c39Smrg	lint_options="-badflag"
1027063847c39Smrg	;;
1027163847c39Smrg  *freebsd* | *netbsd*)
1027263847c39Smrg	lint_name=lint
1027363847c39Smrg	lint_options="-u -b"
1027463847c39Smrg	;;
1027563847c39Smrg  *solaris*)
1027663847c39Smrg	lint_name=lint
1027763847c39Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1027863847c39Smrg	;;
1027963847c39Smrgesac
1028063847c39Smrg
1028163847c39Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
1028263847c39Smrgif test "x$use_lint" = x"yes" ; then
1028363847c39Smrg   AC_PATH_PROG([LINT], [$lint_name])
1028463847c39Smrg   if test "x$LINT" = "x"; then
1028563847c39Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1028663847c39Smrg   fi
1028763847c39Smrgelif test "x$use_lint" = x"no" ; then
1028863847c39Smrg   if test "x$LINT" != "x"; then
1028963847c39Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1029063847c39Smrg   fi
1029186dafe34Smrgelse
1029263847c39Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1029386dafe34Smrgfi
1029463847c39Smrg
1029563847c39Smrg# User supplied flags override default flags
1029663847c39Smrgif test "x$LINT_FLAGS" != "x"; then
1029763847c39Smrg   lint_options=$LINT_FLAGS
1029886dafe34Smrgfi
1029976888252Smrg
1030063847c39SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
1030163847c39SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
1030276888252Smrg
1030386dafe34Smrg]) # XORG_WITH_LINT
1030476888252Smrg
1030586dafe34Smrg# XORG_LINT_LIBRARY(LIBNAME)
1030686dafe34Smrg# --------------------------
1030786dafe34Smrg# Minimum version: 1.1.0
1030886dafe34Smrg#
1030986dafe34Smrg# Sets up flags for building lint libraries for checking programs that call
1031086dafe34Smrg# functions in the library.
1031186dafe34Smrg#
1031263847c39Smrg# Interface to module:
1031363847c39Smrg# LINTLIB		- Automake variable with the name of lint library file to make
1031463847c39Smrg# MAKE_LINT_LIB		- Automake conditional
1031563847c39Smrg#
1031663847c39Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
1031763847c39Smrg#			  - 'no' user instructs the module not to create a lint library (default)
1031876888252Smrg
1031986dafe34SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1032086dafe34SmrgAC_REQUIRE([XORG_WITH_LINT])
1032163847c39SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1032286dafe34Smrg	[Create lint library (default: disabled)])],
1032386dafe34Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1032463847c39Smrg
1032563847c39Smrgif test "x$make_lint_lib" = x"yes" ; then
1032663847c39Smrg   LINTLIB=llib-l$1.ln
1032763847c39Smrg   if test "x$LINT" = "x"; then
1032863847c39Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
1032963847c39Smrg   fi
1033063847c39Smrgelif test "x$make_lint_lib" != x"no" ; then
1033163847c39Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1033286dafe34Smrgfi
1033363847c39Smrg
1033486dafe34SmrgAC_SUBST(LINTLIB)
1033586dafe34SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1033676888252Smrg
1033786dafe34Smrg]) # XORG_LINT_LIBRARY
1033876888252Smrg
1033963847c39Smrg# XORG_COMPILER_BRAND
1034063847c39Smrg# -------------------
1034163847c39Smrg# Minimum version: 1.14.0
1034263847c39Smrg#
1034363847c39Smrg# Checks for various brands of compilers and sets flags as appropriate:
1034463847c39Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
1034563847c39Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
1034663847c39Smrg#   clang compiler - sets CLANGCC to "yes"
1034763847c39Smrg#   Intel compiler - sets INTELCC to "yes"
1034863847c39Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
1034963847c39Smrg#
1035063847c39SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
1035163847c39SmrgAC_LANG_CASE(
1035263847c39Smrg	[C], [
1035363847c39Smrg		AC_REQUIRE([AC_PROG_CC_C99])
1035463847c39Smrg	],
1035563847c39Smrg	[C++], [
1035663847c39Smrg		AC_REQUIRE([AC_PROG_CXX])
1035763847c39Smrg	]
1035863847c39Smrg)
1035963847c39SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
1036063847c39SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1036163847c39SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1036263847c39Smrg]) # XORG_COMPILER_BRAND
1036363847c39Smrg
1036463847c39Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
1036563847c39Smrg# ---------------
1036663847c39Smrg# Minimum version: 1.16.0
1036763847c39Smrg#
1036863847c39Smrg# Test if the compiler works when passed the given flag as a command line argument.
1036963847c39Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
1037063847c39Smrg# next flag in the list until there are no more options.
1037163847c39Smrg#
1037263847c39Smrg# Note that this does not guarantee that the compiler supports the flag as some
1037363847c39Smrg# compilers will simply ignore arguments that they do not understand, but we do
1037463847c39Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
1037563847c39Smrg# -Werror=unused-command-line-argument
1037663847c39Smrg#
1037763847c39SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
1037863847c39Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1037963847c39Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1038063847c39Smrg
1038163847c39SmrgAC_LANG_COMPILER_REQUIRE
1038263847c39Smrg
1038363847c39SmrgAC_LANG_CASE(
1038463847c39Smrg	[C], [
1038563847c39Smrg		AC_REQUIRE([AC_PROG_CC_C99])
1038663847c39Smrg		define([PREFIX], [C])
1038763847c39Smrg		define([CACHE_PREFIX], [cc])
1038863847c39Smrg		define([COMPILER], [$CC])
1038963847c39Smrg	],
1039063847c39Smrg	[C++], [
1039163847c39Smrg		define([PREFIX], [CXX])
1039263847c39Smrg		define([CACHE_PREFIX], [cxx])
1039363847c39Smrg		define([COMPILER], [$CXX])
1039463847c39Smrg	]
1039563847c39Smrg)
1039663847c39Smrg
1039763847c39Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
1039863847c39Smrg
1039963847c39Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
1040063847c39Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1040163847c39Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
1040263847c39Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
1040363847c39Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1040463847c39Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
1040563847c39Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
1040663847c39Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
1040763847c39Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1040863847c39Smrgfi
1040963847c39Smrg
1041063847c39Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
1041163847c39Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
1041263847c39Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1041363847c39Smrg	fi
1041463847c39Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1041563847c39Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
1041663847c39Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
1041763847c39Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1041863847c39Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
1041963847c39Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
1042063847c39Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
1042163847c39Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1042263847c39Smrgfi
1042363847c39Smrg
1042463847c39Smrgfound="no"
1042563847c39Smrgm4_foreach([flag], m4_cdr($@), [
1042663847c39Smrg	if test $found = "no" ; then
104279586ba5aSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
1042863847c39Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1042963847c39Smrg		fi
1043063847c39Smrg
104319586ba5aSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
1043263847c39Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1043363847c39Smrg		fi
1043463847c39Smrg
1043563847c39Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
1043663847c39Smrg
1043763847c39Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
104389586ba5aSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
1043963847c39Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
1044063847c39Smrg		AC_CACHE_VAL($cacheid,
1044163847c39Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
1044263847c39Smrg					     [eval $cacheid=yes],
1044363847c39Smrg					     [eval $cacheid=no])])
1044463847c39Smrg
1044563847c39Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1044663847c39Smrg
1044763847c39Smrg		eval supported=\$$cacheid
1044863847c39Smrg		AC_MSG_RESULT([$supported])
1044963847c39Smrg		if test "$supported" = "yes" ; then
1045063847c39Smrg			$1="$$1 ]flag["
1045163847c39Smrg			found="yes"
1045263847c39Smrg		fi
1045363847c39Smrg	fi
1045463847c39Smrg])
1045563847c39Smrg]) # XORG_TESTSET_CFLAG
1045663847c39Smrg
1045763847c39Smrg# XORG_COMPILER_FLAGS
1045863847c39Smrg# ---------------
1045963847c39Smrg# Minimum version: 1.16.0
1046063847c39Smrg#
1046163847c39Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
1046263847c39Smrg# arguments supported by the selected compiler which do NOT alter the generated
1046363847c39Smrg# code.  These arguments will cause the compiler to print various warnings
1046463847c39Smrg# during compilation AND turn a conservative set of warnings into errors.
1046563847c39Smrg#
1046663847c39Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
1046763847c39Smrg# future versions of util-macros as options are added to new compilers.
1046863847c39Smrg#
1046963847c39SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
1047063847c39SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1047163847c39Smrg
1047263847c39SmrgAC_ARG_ENABLE(selective-werror,
1047363847c39Smrg              AS_HELP_STRING([--disable-selective-werror],
1047463847c39Smrg                             [Turn off selective compiler errors. (default: enabled)]),
1047563847c39Smrg              [SELECTIVE_WERROR=$enableval],
1047663847c39Smrg              [SELECTIVE_WERROR=yes])
1047763847c39Smrg
1047863847c39SmrgAC_LANG_CASE(
1047963847c39Smrg        [C], [
1048063847c39Smrg                define([PREFIX], [C])
1048163847c39Smrg        ],
1048263847c39Smrg        [C++], [
1048363847c39Smrg                define([PREFIX], [CXX])
1048463847c39Smrg        ]
1048563847c39Smrg)
1048663847c39Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
1048763847c39Smrgif test "x$SUNCC" = "xyes"; then
1048863847c39Smrg    [BASE_]PREFIX[FLAGS]="-v"
1048963847c39Smrgelse
1049063847c39Smrg    [BASE_]PREFIX[FLAGS]=""
1049163847c39Smrgfi
1049263847c39Smrg
1049363847c39Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
1049463847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
1049563847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
1049663847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
1049763847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
1049863847c39Smrg
1049963847c39SmrgAC_LANG_CASE(
1050063847c39Smrg	[C], [
1050163847c39Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
1050263847c39Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
1050363847c39Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
1050463847c39Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
105059586ba5aSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
1050663847c39Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
1050763847c39Smrg	]
1050863847c39Smrg)
1050963847c39Smrg
1051063847c39Smrg# This chunk adds additional warnings that could catch undesired effects.
1051163847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
1051263847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
1051363847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
1051463847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
1051563847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
1051663847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
105179586ba5aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
1051863847c39Smrg
1051963847c39Smrg# These are currently disabled because they are noisy.  They will be enabled
1052063847c39Smrg# in the future once the codebase is sufficiently modernized to silence
1052163847c39Smrg# them.  For now, I don't want them to drown out the other warnings.
1052263847c39Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
1052363847c39Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
105249586ba5aSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
1052563847c39Smrg
1052663847c39Smrg# Turn some warnings into errors, so we don't accidently get successful builds
1052763847c39Smrg# when there are problems that should be fixed.
1052863847c39Smrg
1052963847c39Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
1053063847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
1053163847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
1053263847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
1053363847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
1053463847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
1053563847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
1053663847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
1053763847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
1053863847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
1053963847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
1054063847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
1054163847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
1054263847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
1054363847c39Smrgelse
1054463847c39SmrgAC_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])
1054563847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
1054663847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
1054763847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
1054863847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
1054963847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
1055063847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
1055163847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
1055263847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
1055363847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
1055463847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
1055563847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
1055663847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
1055763847c39SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
1055863847c39Smrgfi
1055963847c39Smrg
1056063847c39SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1056163847c39Smrg]) # XORG_COMPILER_FLAGS
1056263847c39Smrg
1056386dafe34Smrg# XORG_CWARNFLAGS
1056486dafe34Smrg# ---------------
1056586dafe34Smrg# Minimum version: 1.2.0
1056663847c39Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
1056786dafe34Smrg#
1056886dafe34Smrg# Defines CWARNFLAGS to enable C compiler warnings.
1056986dafe34Smrg#
1057063847c39Smrg# This function is deprecated because it defines -fno-strict-aliasing
1057163847c39Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
1057263847c39Smrg# is needed, then it should be added explicitly in the module when
1057363847c39Smrg# it is updated to use BASE_CFLAGS.
1057463847c39Smrg#
1057586dafe34SmrgAC_DEFUN([XORG_CWARNFLAGS], [
1057663847c39SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1057763847c39SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1057863847c39SmrgAC_LANG_CASE(
1057963847c39Smrg	[C], [
1058063847c39Smrg		CWARNFLAGS="$BASE_CFLAGS"
1058163847c39Smrg		if  test "x$GCC" = xyes ; then
1058263847c39Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
1058363847c39Smrg		fi
1058463847c39Smrg		AC_SUBST(CWARNFLAGS)
1058563847c39Smrg	]
1058663847c39Smrg)
1058786dafe34Smrg]) # XORG_CWARNFLAGS
1058863847c39Smrg
1058963847c39Smrg# XORG_STRICT_OPTION
1059063847c39Smrg# -----------------------
1059163847c39Smrg# Minimum version: 1.3.0
1059263847c39Smrg#
1059363847c39Smrg# Add configure option to enable strict compilation flags, such as treating
1059463847c39Smrg# warnings as fatal errors.
1059563847c39Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
1059663847c39Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
1059763847c39Smrg#
1059863847c39Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
1059963847c39Smrg# when strict compilation is unconditionally desired.
1060063847c39SmrgAC_DEFUN([XORG_STRICT_OPTION], [
1060163847c39SmrgAC_REQUIRE([XORG_CWARNFLAGS])
1060263847c39SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1060363847c39Smrg
1060463847c39SmrgAC_ARG_ENABLE(strict-compilation,
1060563847c39Smrg			  AS_HELP_STRING([--enable-strict-compilation],
1060663847c39Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1060763847c39Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1060863847c39Smrg
1060963847c39SmrgAC_LANG_CASE(
1061063847c39Smrg        [C], [
1061163847c39Smrg                define([PREFIX], [C])
1061263847c39Smrg        ],
1061363847c39Smrg        [C++], [
1061463847c39Smrg                define([PREFIX], [CXX])
1061563847c39Smrg        ]
1061663847c39Smrg)
1061763847c39Smrg
1061863847c39Smrg[STRICT_]PREFIX[FLAGS]=""
1061963847c39SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
1062063847c39SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
1062163847c39Smrg
1062263847c39Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
1062363847c39Smrg# activate it with -Werror, so we add it here explicitly.
1062463847c39SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
1062563847c39Smrg
1062663847c39Smrgif test "x$STRICT_COMPILE" = "xyes"; then
1062763847c39Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
1062863847c39Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
1062963847c39Smrgfi
1063063847c39SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
1063163847c39SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1063263847c39SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
1063363847c39Smrg]) # XORG_STRICT_OPTION
1063463847c39Smrg
1063563847c39Smrg# XORG_DEFAULT_OPTIONS
1063663847c39Smrg# --------------------
1063763847c39Smrg# Minimum version: 1.3.0
1063863847c39Smrg#
1063963847c39Smrg# Defines default options for X.Org modules.
1064063847c39Smrg#
1064163847c39SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1064263847c39SmrgAC_REQUIRE([AC_PROG_INSTALL])
1064363847c39SmrgXORG_COMPILER_FLAGS
1064463847c39SmrgXORG_CWARNFLAGS
1064563847c39SmrgXORG_STRICT_OPTION
1064663847c39SmrgXORG_RELEASE_VERSION
1064763847c39SmrgXORG_CHANGELOG
1064863847c39SmrgXORG_INSTALL
1064963847c39SmrgXORG_MANPAGE_SECTIONS
1065063847c39Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1065163847c39Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1065263847c39Smrg]) # XORG_DEFAULT_OPTIONS
1065363847c39Smrg
1065463847c39Smrg# XORG_INSTALL()
1065563847c39Smrg# ----------------
1065663847c39Smrg# Minimum version: 1.4.0
1065763847c39Smrg#
1065863847c39Smrg# Defines the variable INSTALL_CMD as the command to copy
1065963847c39Smrg# INSTALL from $prefix/share/util-macros.
1066063847c39Smrg#
1066163847c39SmrgAC_DEFUN([XORG_INSTALL], [
1066263847c39SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1066363847c39Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1066463847c39SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1066563847c39Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1066663847c39Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1066763847c39Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1066863847c39SmrgAC_SUBST([INSTALL_CMD])
1066963847c39Smrg]) # XORG_INSTALL
1067086dafe34Smrgdnl Copyright 2005 Red Hat, Inc
1067186dafe34Smrgdnl
1067286dafe34Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1067386dafe34Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1067486dafe34Smrgdnl the above copyright notice appear in all copies and that both that
1067586dafe34Smrgdnl copyright notice and this permission notice appear in supporting
1067686dafe34Smrgdnl documentation.
1067786dafe34Smrgdnl
1067886dafe34Smrgdnl The above copyright notice and this permission notice shall be included
1067986dafe34Smrgdnl in all copies or substantial portions of the Software.
1068086dafe34Smrgdnl
1068186dafe34Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1068286dafe34Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1068386dafe34Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1068486dafe34Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1068586dafe34Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1068686dafe34Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1068786dafe34Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1068886dafe34Smrgdnl
1068986dafe34Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1069086dafe34Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1069186dafe34Smrgdnl other dealings in this Software without prior written authorization
1069286dafe34Smrgdnl from the copyright holders.
1069386dafe34Smrgdnl
1069476888252Smrg
1069586dafe34Smrg# XORG_RELEASE_VERSION
1069686dafe34Smrg# --------------------
1069763847c39Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
106989586ba5aSmrg
1069986dafe34SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1070086dafe34Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1070186dafe34Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1070286dafe34Smrg		[Major version of this package])
1070386dafe34Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1070486dafe34Smrg	if test "x$PVM" = "x"; then
1070586dafe34Smrg		PVM="0"
1070686dafe34Smrg	fi
1070786dafe34Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1070886dafe34Smrg		[$PVM],
1070986dafe34Smrg		[Minor version of this package])
1071086dafe34Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1071186dafe34Smrg	if test "x$PVP" = "x"; then
1071286dafe34Smrg		PVP="0"
1071386dafe34Smrg	fi
1071486dafe34Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1071586dafe34Smrg		[$PVP],
1071686dafe34Smrg		[Patch version of this package])
107171ae1b5e8Smrg])
107181ae1b5e8Smrg
1071986dafe34Smrg# XORG_CHANGELOG()
1072086dafe34Smrg# ----------------
1072186dafe34Smrg# Minimum version: 1.2.0
107221ae1b5e8Smrg#
1072386dafe34Smrg# Defines the variable CHANGELOG_CMD as the command to generate
1072486dafe34Smrg# ChangeLog from git.
107251ae1b5e8Smrg#
107261ae1b5e8Smrg#
1072786dafe34SmrgAC_DEFUN([XORG_CHANGELOG], [
1072863847c39SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1072963847c39Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1073063847c39Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1073186dafe34Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1073286dafe34SmrgAC_SUBST([CHANGELOG_CMD])
1073386dafe34Smrg]) # XORG_CHANGELOG
1073476888252Smrg
1073563847c39Smrgdnl Copyright 2005 Red Hat, Inc
1073663847c39Smrgdnl 
1073763847c39Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1073863847c39Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1073963847c39Smrgdnl the above copyright notice appear in all copies and that both that
1074063847c39Smrgdnl copyright notice and this permission notice appear in supporting
1074163847c39Smrgdnl documentation.
1074263847c39Smrgdnl 
1074363847c39Smrgdnl The above copyright notice and this permission notice shall be included
1074463847c39Smrgdnl in all copies or substantial portions of the Software.
1074563847c39Smrgdnl 
1074663847c39Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1074763847c39Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1074863847c39Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1074963847c39Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1075063847c39Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1075163847c39Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1075263847c39Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1075363847c39Smrgdnl 
1075463847c39Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1075563847c39Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1075663847c39Smrgdnl other dealings in this Software without prior written authorization
1075763847c39Smrgdnl from the copyright holders.
1075863847c39Smrgdnl 
1075963847c39Smrg
107609586ba5aSmrg# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
1076163847c39Smrg# --------------------------
107629586ba5aSmrg# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
107639586ba5aSmrg# is defined, then add the given PROTO to $REQUIRED_MODULES.
1076463847c39Smrg
1076563847c39SmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
1076663847c39Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1076763847c39Smrg	SAVE_CFLAGS="$CFLAGS"
1076863847c39Smrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
1076963847c39Smrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1077063847c39Smrg#include "xorg-server.h"
1077163847c39Smrg#if !defined $1
1077263847c39Smrg#error $1 not defined
1077363847c39Smrg#endif
1077463847c39Smrg		]])],
1077563847c39Smrg		[_EXT_CHECK=yes],
1077663847c39Smrg		[_EXT_CHECK=no])
1077763847c39Smrg	CFLAGS="$SAVE_CFLAGS"
1077863847c39Smrg	AC_MSG_CHECKING([if $1 is defined])
1077963847c39Smrg	AC_MSG_RESULT([$_EXT_CHECK])
1078063847c39Smrg	if test "$_EXT_CHECK" != no; then
1078163847c39Smrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
1078263847c39Smrg	fi
1078363847c39Smrg])
1078463847c39Smrg
107859586ba5aSmrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
1078686dafe34Smrg#
1078786dafe34Smrg# This file is free software; the Free Software Foundation
1078886dafe34Smrg# gives unlimited permission to copy and/or distribute it,
1078986dafe34Smrg# with or without modifications, as long as this notice is preserved.
1079076888252Smrg
1079186dafe34Smrg# AM_AUTOMAKE_VERSION(VERSION)
1079286dafe34Smrg# ----------------------------
1079386dafe34Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
1079486dafe34Smrg# generated from the m4 files accompanying Automake X.Y.
1079586dafe34Smrg# (This private macro should not be called outside this file.)
1079686dafe34SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
107979586ba5aSmrg[am__api_version='1.14'
1079886dafe34Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1079986dafe34Smrgdnl require some minimum version.  Point them to the right macro.
108009586ba5aSmrgm4_if([$1], [1.14.1], [],
1080186dafe34Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1080286dafe34Smrg])
1080376888252Smrg
1080486dafe34Smrg# _AM_AUTOCONF_VERSION(VERSION)
1080586dafe34Smrg# -----------------------------
1080686dafe34Smrg# aclocal traces this macro to find the Autoconf version.
1080786dafe34Smrg# This is a private macro too.  Using m4_define simplifies
1080886dafe34Smrg# the logic in aclocal, which can simply ignore this definition.
1080986dafe34Smrgm4_define([_AM_AUTOCONF_VERSION], [])
1081076888252Smrg
1081186dafe34Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
1081286dafe34Smrg# -------------------------------
1081386dafe34Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1081486dafe34Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1081586dafe34SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
108169586ba5aSmrg[AM_AUTOMAKE_VERSION([1.14.1])dnl
1081786dafe34Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1081886dafe34Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1081986dafe34Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1082076888252Smrg
1082186dafe34Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
1082276888252Smrg
108239586ba5aSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1082486dafe34Smrg#
1082586dafe34Smrg# This file is free software; the Free Software Foundation
1082686dafe34Smrg# gives unlimited permission to copy and/or distribute it,
1082786dafe34Smrg# with or without modifications, as long as this notice is preserved.
1082876888252Smrg
1082986dafe34Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
108309586ba5aSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
108319586ba5aSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
1083286dafe34Smrg#
1083386dafe34Smrg# Of course, Automake must honor this variable whenever it calls a
1083486dafe34Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
1083586dafe34Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
1083686dafe34Smrg# depending on how configure is run.  This is pretty annoying, since
1083786dafe34Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
1083886dafe34Smrg# source directory, any form will work fine, but in subdirectories a
1083986dafe34Smrg# relative path needs to be adjusted first.
1084086dafe34Smrg#
1084186dafe34Smrg# $ac_aux_dir/missing
1084286dafe34Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
1084386dafe34Smrg# $top_srcdir/$ac_aux_dir/missing
1084486dafe34Smrg#    fails if $ac_aux_dir is absolute,
1084586dafe34Smrg#    fails when called from a subdirectory in a VPATH build with
1084686dafe34Smrg#          a relative $ac_aux_dir
1084786dafe34Smrg#
1084886dafe34Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1084986dafe34Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
108509586ba5aSmrg# harmless because $srcdir is '.', but things will broke when you
1085186dafe34Smrg# start a VPATH build or use an absolute $srcdir.
1085286dafe34Smrg#
1085386dafe34Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1085486dafe34Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
1085586dafe34Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1085686dafe34Smrg# and then we would define $MISSING as
1085786dafe34Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
1085886dafe34Smrg# This will work as long as MISSING is not called from configure, because
1085986dafe34Smrg# unfortunately $(top_srcdir) has no meaning in configure.
1086086dafe34Smrg# However there are other variables, like CC, which are often used in
1086186dafe34Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
1086286dafe34Smrg#
1086386dafe34Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
1086486dafe34Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
1086586dafe34Smrg# configured tree to be moved without reconfiguration.
1086676888252Smrg
1086786dafe34SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
108689586ba5aSmrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
108699586ba5aSmrg# Expand $ac_aux_dir to an absolute path.
108709586ba5aSmrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
1087186dafe34Smrg])
1087276888252Smrg
1087386dafe34Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1087476888252Smrg
108759586ba5aSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
1087686dafe34Smrg#
1087786dafe34Smrg# This file is free software; the Free Software Foundation
1087886dafe34Smrg# gives unlimited permission to copy and/or distribute it,
1087986dafe34Smrg# with or without modifications, as long as this notice is preserved.
1088076888252Smrg
1088186dafe34Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1088286dafe34Smrg# -------------------------------------
1088386dafe34Smrg# Define a conditional.
1088486dafe34SmrgAC_DEFUN([AM_CONDITIONAL],
108859586ba5aSmrg[AC_PREREQ([2.52])dnl
108869586ba5aSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
108879586ba5aSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1088886dafe34SmrgAC_SUBST([$1_TRUE])dnl
1088986dafe34SmrgAC_SUBST([$1_FALSE])dnl
1089086dafe34Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1089186dafe34Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
10892d8556812Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1089386dafe34Smrgif $2; then
1089486dafe34Smrg  $1_TRUE=
1089586dafe34Smrg  $1_FALSE='#'
1089686dafe34Smrgelse
1089786dafe34Smrg  $1_TRUE='#'
1089886dafe34Smrg  $1_FALSE=
1089986dafe34Smrgfi
1090086dafe34SmrgAC_CONFIG_COMMANDS_PRE(
1090186dafe34Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1090286dafe34Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1090386dafe34SmrgUsually this means the macro was only invoked conditionally.]])
1090486dafe34Smrgfi])])
1090576888252Smrg
109069586ba5aSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
1090786dafe34Smrg#
1090886dafe34Smrg# This file is free software; the Free Software Foundation
1090986dafe34Smrg# gives unlimited permission to copy and/or distribute it,
1091086dafe34Smrg# with or without modifications, as long as this notice is preserved.
1091176888252Smrg
1091276888252Smrg
109139586ba5aSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
1091486dafe34Smrg# written in clear, in which case automake, when reading aclocal.m4,
1091586dafe34Smrg# will think it sees a *use*, and therefore will trigger all it's
1091686dafe34Smrg# C support machinery.  Also note that it means that autoscan, seeing
1091786dafe34Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1091876888252Smrg
1091976888252Smrg
1092086dafe34Smrg# _AM_DEPENDENCIES(NAME)
1092186dafe34Smrg# ----------------------
1092286dafe34Smrg# See how the compiler implements dependency checking.
109239586ba5aSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
1092486dafe34Smrg# We try a few techniques and use that to set a single cache variable.
1092586dafe34Smrg#
1092686dafe34Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1092786dafe34Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1092886dafe34Smrg# dependency, and given that the user is not expected to run this macro,
1092986dafe34Smrg# just rely on AC_PROG_CC.
1093086dafe34SmrgAC_DEFUN([_AM_DEPENDENCIES],
1093186dafe34Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1093286dafe34SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1093386dafe34SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1093486dafe34SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1093576888252Smrg
109369586ba5aSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
109379586ba5aSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
109389586ba5aSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
109399586ba5aSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
109409586ba5aSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
109419586ba5aSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
109429586ba5aSmrg                    [depcc="$$1"   am_compiler_list=])
1094386dafe34Smrg
1094486dafe34SmrgAC_CACHE_CHECK([dependency style of $depcc],
1094586dafe34Smrg               [am_cv_$1_dependencies_compiler_type],
1094686dafe34Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1094786dafe34Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
1094886dafe34Smrg  # making bogus files that we don't know about and never remove.  For
1094986dafe34Smrg  # instance it was reported that on HP-UX the gcc test will end up
109509586ba5aSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
109519586ba5aSmrg  # in D".
1095263847c39Smrg  rm -rf conftest.dir
1095386dafe34Smrg  mkdir conftest.dir
1095486dafe34Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1095586dafe34Smrg  # using a relative directory.
1095686dafe34Smrg  cp "$am_depcomp" conftest.dir
1095786dafe34Smrg  cd conftest.dir
1095886dafe34Smrg  # We will build objects and dependencies in a subdirectory because
1095986dafe34Smrg  # it helps to detect inapplicable dependency modes.  For instance
1096086dafe34Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
1096186dafe34Smrg  # side effect of compilation, but ICC will put the dependencies in
1096286dafe34Smrg  # the current directory while Tru64 will put them in the object
1096386dafe34Smrg  # directory.
1096486dafe34Smrg  mkdir sub
1096576888252Smrg
1096686dafe34Smrg  am_cv_$1_dependencies_compiler_type=none
1096786dafe34Smrg  if test "$am_compiler_list" = ""; then
1096886dafe34Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1096986dafe34Smrg  fi
10970d8556812Smrg  am__universal=false
10971d8556812Smrg  m4_case([$1], [CC],
10972d8556812Smrg    [case " $depcc " in #(
10973d8556812Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
10974d8556812Smrg     esac],
10975d8556812Smrg    [CXX],
10976d8556812Smrg    [case " $depcc " in #(
10977d8556812Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
10978d8556812Smrg     esac])
10979d8556812Smrg
1098086dafe34Smrg  for depmode in $am_compiler_list; do
1098186dafe34Smrg    # Setup a source with many dependencies, because some compilers
1098286dafe34Smrg    # like to wrap large dependency lists on column 80 (with \), and
1098386dafe34Smrg    # we should not choose a depcomp mode which is confused by this.
1098486dafe34Smrg    #
1098586dafe34Smrg    # We need to recreate these files for each test, as the compiler may
1098686dafe34Smrg    # overwrite some of them when testing with obscure command lines.
1098786dafe34Smrg    # This happens at least with the AIX C compiler.
1098886dafe34Smrg    : > sub/conftest.c
1098986dafe34Smrg    for i in 1 2 3 4 5 6; do
1099086dafe34Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
109919586ba5aSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
109929586ba5aSmrg      # Solaris 10 /bin/sh.
109939586ba5aSmrg      echo '/* dummy */' > sub/conftst$i.h
1099486dafe34Smrg    done
1099586dafe34Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1099676888252Smrg
109979586ba5aSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
10998d8556812Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
109999586ba5aSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
110009586ba5aSmrg    # versions had trouble with output in subdirs.
11001d8556812Smrg    am__obj=sub/conftest.${OBJEXT-o}
11002d8556812Smrg    am__minus_obj="-o $am__obj"
1100386dafe34Smrg    case $depmode in
11004d8556812Smrg    gcc)
11005d8556812Smrg      # This depmode causes a compiler race in universal mode.
11006d8556812Smrg      test "$am__universal" = false || continue
11007d8556812Smrg      ;;
1100886dafe34Smrg    nosideeffect)
110099586ba5aSmrg      # After this tag, mechanisms are not by side-effect, so they'll
110109586ba5aSmrg      # only be used when explicitly requested.
1101186dafe34Smrg      if test "x$enable_dependency_tracking" = xyes; then
1101286dafe34Smrg	continue
110131ae1b5e8Smrg      else
1101486dafe34Smrg	break
110151ae1b5e8Smrg      fi
110161ae1b5e8Smrg      ;;
1101763847c39Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
110189586ba5aSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
11019d8556812Smrg      # not run yet.  These depmodes are late enough in the game, and
11020d8556812Smrg      # so weak that their functioning should not be impacted.
11021d8556812Smrg      am__obj=conftest.${OBJEXT-o}
11022d8556812Smrg      am__minus_obj=
11023d8556812Smrg      ;;
1102486dafe34Smrg    none) break ;;
1102586dafe34Smrg    esac
1102686dafe34Smrg    if depmode=$depmode \
11027d8556812Smrg       source=sub/conftest.c object=$am__obj \
1102886dafe34Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
11029d8556812Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1103086dafe34Smrg         >/dev/null 2>conftest.err &&
1103186dafe34Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1103286dafe34Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
11033d8556812Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1103486dafe34Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1103586dafe34Smrg      # icc doesn't choke on unknown options, it will just issue warnings
1103686dafe34Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
1103786dafe34Smrg      # that says an option was ignored or not supported.
1103886dafe34Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
1103986dafe34Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
1104086dafe34Smrg      # The diagnosis changed in icc 8.0:
1104186dafe34Smrg      #   icc: Command line remark: option '-MP' not supported
1104286dafe34Smrg      if (grep 'ignoring option' conftest.err ||
1104386dafe34Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1104486dafe34Smrg        am_cv_$1_dependencies_compiler_type=$depmode
1104586dafe34Smrg        break
1104686dafe34Smrg      fi
1104786dafe34Smrg    fi
1104886dafe34Smrg  done
1104976888252Smrg
1105086dafe34Smrg  cd ..
1105186dafe34Smrg  rm -rf conftest.dir
1105286dafe34Smrgelse
1105386dafe34Smrg  am_cv_$1_dependencies_compiler_type=none
1105486dafe34Smrgfi
1105586dafe34Smrg])
1105686dafe34SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1105786dafe34SmrgAM_CONDITIONAL([am__fastdep$1], [
1105886dafe34Smrg  test "x$enable_dependency_tracking" != xno \
1105986dafe34Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1106086dafe34Smrg])
1106176888252Smrg
1106276888252Smrg
1106386dafe34Smrg# AM_SET_DEPDIR
1106486dafe34Smrg# -------------
1106586dafe34Smrg# Choose a directory name for dependency files.
110669586ba5aSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
1106786dafe34SmrgAC_DEFUN([AM_SET_DEPDIR],
1106886dafe34Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1106986dafe34SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1107086dafe34Smrg])
1107176888252Smrg
1107276888252Smrg
1107386dafe34Smrg# AM_DEP_TRACK
1107486dafe34Smrg# ------------
1107586dafe34SmrgAC_DEFUN([AM_DEP_TRACK],
110769586ba5aSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
110779586ba5aSmrgAS_HELP_STRING(
110789586ba5aSmrg  [--enable-dependency-tracking],
110799586ba5aSmrg  [do not reject slow dependency extractors])
110809586ba5aSmrgAS_HELP_STRING(
110819586ba5aSmrg  [--disable-dependency-tracking],
110829586ba5aSmrg  [speeds up one-time build])])
1108386dafe34Smrgif test "x$enable_dependency_tracking" != xno; then
1108486dafe34Smrg  am_depcomp="$ac_aux_dir/depcomp"
1108586dafe34Smrg  AMDEPBACKSLASH='\'
1108663847c39Smrg  am__nodep='_no'
1108786dafe34Smrgfi
1108886dafe34SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1108986dafe34SmrgAC_SUBST([AMDEPBACKSLASH])dnl
1109086dafe34Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1109163847c39SmrgAC_SUBST([am__nodep])dnl
1109263847c39Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
1109386dafe34Smrg])
1109476888252Smrg
1109586dafe34Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
1109676888252Smrg
110979586ba5aSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
1109886dafe34Smrg#
1109986dafe34Smrg# This file is free software; the Free Software Foundation
1110086dafe34Smrg# gives unlimited permission to copy and/or distribute it,
1110186dafe34Smrg# with or without modifications, as long as this notice is preserved.
1110276888252Smrg
1110376888252Smrg
1110486dafe34Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
1110586dafe34Smrg# ------------------------------
1110686dafe34SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
11107d8556812Smrg[{
111089586ba5aSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
11109d8556812Smrg  # are listed without --file.  Let's play safe and only enable the eval
11110d8556812Smrg  # if we detect the quoting.
11111d8556812Smrg  case $CONFIG_FILES in
11112d8556812Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
11113d8556812Smrg  *)   set x $CONFIG_FILES ;;
11114d8556812Smrg  esac
11115d8556812Smrg  shift
11116d8556812Smrg  for mf
11117d8556812Smrg  do
11118d8556812Smrg    # Strip MF so we end up with the name of the file.
11119d8556812Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
11120d8556812Smrg    # Check whether this is an Automake generated Makefile or not.
111219586ba5aSmrg    # We used to match only the files named 'Makefile.in', but
11122d8556812Smrg    # some people rename them; so instead we look at the file content.
11123d8556812Smrg    # Grep'ing the first line is not enough: some people post-process
11124d8556812Smrg    # each Makefile.in and add a new line on top of each file to say so.
11125d8556812Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
11126d8556812Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
11127d8556812Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
11128d8556812Smrg      dirpart=`AS_DIRNAME("$mf")`
11129d8556812Smrg    else
11130d8556812Smrg      continue
11131d8556812Smrg    fi
11132d8556812Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
111339586ba5aSmrg    # from the Makefile without running 'make'.
11134d8556812Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
11135d8556812Smrg    test -z "$DEPDIR" && continue
11136d8556812Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
111379586ba5aSmrg    test -z "$am__include" && continue
11138d8556812Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
11139d8556812Smrg    # Find all dependency output files, they are included files with
11140d8556812Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
11141d8556812Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
11142d8556812Smrg    # expansion.
11143d8556812Smrg    for file in `sed -n "
11144d8556812Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
111459586ba5aSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
11146d8556812Smrg      # Make sure the directory exists.
11147d8556812Smrg      test -f "$dirpart/$file" && continue
11148d8556812Smrg      fdir=`AS_DIRNAME(["$file"])`
11149d8556812Smrg      AS_MKDIR_P([$dirpart/$fdir])
11150d8556812Smrg      # echo "creating $dirpart/$file"
11151d8556812Smrg      echo '# dummy' > "$dirpart/$file"
11152d8556812Smrg    done
1115386dafe34Smrg  done
11154d8556812Smrg}
1115586dafe34Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1115676888252Smrg
111571ae1b5e8Smrg
1115886dafe34Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
1115986dafe34Smrg# -----------------------------
1116086dafe34Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
1116186dafe34Smrg#
1116286dafe34Smrg# This code is only required when automatic dependency tracking
111639586ba5aSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
1116486dafe34Smrg# need in order to bootstrap the dependency handling code.
1116586dafe34SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1116686dafe34Smrg[AC_CONFIG_COMMANDS([depfiles],
1116786dafe34Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1116886dafe34Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1116986dafe34Smrg])
111701ae1b5e8Smrg
1117186dafe34Smrg# Do all the work for Automake.                             -*- Autoconf -*-
1117276888252Smrg
111739586ba5aSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
1117486dafe34Smrg#
1117586dafe34Smrg# This file is free software; the Free Software Foundation
1117686dafe34Smrg# gives unlimited permission to copy and/or distribute it,
1117786dafe34Smrg# with or without modifications, as long as this notice is preserved.
1117876888252Smrg
1117986dafe34Smrg# This macro actually does too much.  Some checks are only needed if
1118086dafe34Smrg# your package does certain things.  But this isn't really a big deal.
1118176888252Smrg
111829586ba5aSmrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
111839586ba5aSmrgm4_define([AC_PROG_CC],
111849586ba5aSmrgm4_defn([AC_PROG_CC])
111859586ba5aSmrg[_AM_PROG_CC_C_O
111869586ba5aSmrg])
111879586ba5aSmrg
1118886dafe34Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1118986dafe34Smrg# AM_INIT_AUTOMAKE([OPTIONS])
1119086dafe34Smrg# -----------------------------------------------
1119186dafe34Smrg# The call with PACKAGE and VERSION arguments is the old style
1119286dafe34Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
1119386dafe34Smrg# and VERSION should now be passed to AC_INIT and removed from
1119486dafe34Smrg# the call to AM_INIT_AUTOMAKE.
1119586dafe34Smrg# We support both call styles for the transition.  After
1119686dafe34Smrg# the next Automake release, Autoconf can make the AC_INIT
1119786dafe34Smrg# arguments mandatory, and then we can depend on a new Autoconf
1119886dafe34Smrg# release and drop the old call support.
1119986dafe34SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
112009586ba5aSmrg[AC_PREREQ([2.65])dnl
1120186dafe34Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
1120286dafe34Smrgdnl the ones we care about.
1120386dafe34Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1120486dafe34SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1120586dafe34SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
1120686dafe34Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
1120786dafe34Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1120886dafe34Smrg  # is not polluted with repeated "-I."
1120986dafe34Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1121086dafe34Smrg  # test to see if srcdir already configured
1121186dafe34Smrg  if test -f $srcdir/config.status; then
1121286dafe34Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1121386dafe34Smrg  fi
1121486dafe34Smrgfi
1121576888252Smrg
1121686dafe34Smrg# test whether we have cygpath
1121786dafe34Smrgif test -z "$CYGPATH_W"; then
1121886dafe34Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
1121986dafe34Smrg    CYGPATH_W='cygpath -w'
1122086dafe34Smrg  else
1122186dafe34Smrg    CYGPATH_W=echo
1122286dafe34Smrg  fi
1122386dafe34Smrgfi
1122486dafe34SmrgAC_SUBST([CYGPATH_W])
1122576888252Smrg
1122686dafe34Smrg# Define the identity of the package.
1122786dafe34Smrgdnl Distinguish between old-style and new-style calls.
1122886dafe34Smrgm4_ifval([$2],
112299586ba5aSmrg[AC_DIAGNOSE([obsolete],
112309586ba5aSmrg             [$0: two- and three-arguments forms are deprecated.])
112319586ba5aSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1123286dafe34Smrg AC_SUBST([PACKAGE], [$1])dnl
1123386dafe34Smrg AC_SUBST([VERSION], [$2])],
1123486dafe34Smrg[_AM_SET_OPTIONS([$1])dnl
1123586dafe34Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
112369586ba5aSmrgm4_if(
112379586ba5aSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
112389586ba5aSmrg  [ok:ok],,
1123986dafe34Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1124086dafe34Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1124186dafe34Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1124276888252Smrg
1124386dafe34Smrg_AM_IF_OPTION([no-define],,
112449586ba5aSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
112459586ba5aSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
1124676888252Smrg
1124786dafe34Smrg# Some tools Automake needs.
1124886dafe34SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
1124986dafe34SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
112509586ba5aSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
112519586ba5aSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
112529586ba5aSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
112539586ba5aSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
112549586ba5aSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
11255d8556812SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
11256d8556812SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
112579586ba5aSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
112589586ba5aSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
112599586ba5aSmrg# dies out for good.  For more background, see:
112609586ba5aSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
112619586ba5aSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
112629586ba5aSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
1126386dafe34Smrg# We need awk for the "check" target.  The system "awk" is bad on
1126486dafe34Smrg# some platforms.
1126586dafe34SmrgAC_REQUIRE([AC_PROG_AWK])dnl
1126686dafe34SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
1126786dafe34SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
1126886dafe34Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
11269d8556812Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
11270d8556812Smrg			     [_AM_PROG_TAR([v7])])])
1127186dafe34Smrg_AM_IF_OPTION([no-dependencies],,
1127286dafe34Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
112739586ba5aSmrg		  [_AM_DEPENDENCIES([CC])],
112749586ba5aSmrg		  [m4_define([AC_PROG_CC],
112759586ba5aSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
1127686dafe34SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
112779586ba5aSmrg		  [_AM_DEPENDENCIES([CXX])],
112789586ba5aSmrg		  [m4_define([AC_PROG_CXX],
112799586ba5aSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
1128086dafe34SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
112819586ba5aSmrg		  [_AM_DEPENDENCIES([OBJC])],
112829586ba5aSmrg		  [m4_define([AC_PROG_OBJC],
112839586ba5aSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
112849586ba5aSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
112859586ba5aSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
112869586ba5aSmrg		  [m4_define([AC_PROG_OBJCXX],
112879586ba5aSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
1128886dafe34Smrg])
112899586ba5aSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
112909586ba5aSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
112919586ba5aSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
112929586ba5aSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
11293d8556812SmrgAC_CONFIG_COMMANDS_PRE(dnl
11294d8556812Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
11295d8556812Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
112969586ba5aSmrg
112979586ba5aSmrg# POSIX will say in a future version that running "rm -f" with no argument
112989586ba5aSmrg# is OK; and we want to be able to make that assumption in our Makefile
112999586ba5aSmrg# recipes.  So use an aggressive probe to check that the usage we want is
113009586ba5aSmrg# actually supported "in the wild" to an acceptable degree.
113019586ba5aSmrg# See automake bug#10828.
113029586ba5aSmrg# To make any issue more visible, cause the running configure to be aborted
113039586ba5aSmrg# by default if the 'rm' program in use doesn't match our expectations; the
113049586ba5aSmrg# user can still override this though.
113059586ba5aSmrgif rm -f && rm -fr && rm -rf; then : OK; else
113069586ba5aSmrg  cat >&2 <<'END'
113079586ba5aSmrgOops!
113089586ba5aSmrg
113099586ba5aSmrgYour 'rm' program seems unable to run without file operands specified
113109586ba5aSmrgon the command line, even when the '-f' option is present.  This is contrary
113119586ba5aSmrgto the behaviour of most rm programs out there, and not conforming with
113129586ba5aSmrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
113139586ba5aSmrg
113149586ba5aSmrgPlease tell bug-automake@gnu.org about your system, including the value
113159586ba5aSmrgof your $PATH and any error possibly output before this message.  This
113169586ba5aSmrgcan help us improve future automake versions.
113179586ba5aSmrg
113189586ba5aSmrgEND
113199586ba5aSmrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
113209586ba5aSmrg    echo 'Configuration will proceed anyway, since you have set the' >&2
113219586ba5aSmrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
113229586ba5aSmrg    echo >&2
113239586ba5aSmrg  else
113249586ba5aSmrg    cat >&2 <<'END'
113259586ba5aSmrgAborting the configuration process, to ensure you take notice of the issue.
113269586ba5aSmrg
113279586ba5aSmrgYou can download and install GNU coreutils to get an 'rm' implementation
113289586ba5aSmrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
113299586ba5aSmrg
113309586ba5aSmrgIf you want to complete the configuration process using your problematic
113319586ba5aSmrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
113329586ba5aSmrgto "yes", and re-run configure.
113339586ba5aSmrg
113349586ba5aSmrgEND
113359586ba5aSmrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
113369586ba5aSmrg  fi
113379586ba5aSmrgfi
1133886dafe34Smrg])
1133976888252Smrg
113409586ba5aSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
11341d8556812Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
11342d8556812Smrgdnl mangled by Autoconf and run in a shell conditional statement.
11343d8556812Smrgm4_define([_AC_COMPILER_EXEEXT],
11344d8556812Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
11345d8556812Smrg
1134686dafe34Smrg# When config.status generates a header, we must update the stamp-h file.
1134786dafe34Smrg# This file resides in the same directory as the config header
1134886dafe34Smrg# that is generated.  The stamp files are numbered to have different names.
1134976888252Smrg
1135086dafe34Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1135186dafe34Smrg# loop where config.status creates the headers, so we can generate
1135286dafe34Smrg# our stamp files there.
1135386dafe34SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1135486dafe34Smrg[# Compute $1's index in $config_headers.
1135586dafe34Smrg_am_arg=$1
1135686dafe34Smrg_am_stamp_count=1
1135786dafe34Smrgfor _am_header in $config_headers :; do
1135886dafe34Smrg  case $_am_header in
1135986dafe34Smrg    $_am_arg | $_am_arg:* )
1136086dafe34Smrg      break ;;
1136186dafe34Smrg    * )
1136286dafe34Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1136386dafe34Smrg  esac
1136486dafe34Smrgdone
1136586dafe34Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1136676888252Smrg
113679586ba5aSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1136886dafe34Smrg#
1136986dafe34Smrg# This file is free software; the Free Software Foundation
1137086dafe34Smrg# gives unlimited permission to copy and/or distribute it,
1137186dafe34Smrg# with or without modifications, as long as this notice is preserved.
1137276888252Smrg
1137386dafe34Smrg# AM_PROG_INSTALL_SH
1137486dafe34Smrg# ------------------
1137586dafe34Smrg# Define $install_sh.
1137686dafe34SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
1137786dafe34Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11378d8556812Smrgif test x"${install_sh}" != xset; then
11379d8556812Smrg  case $am_aux_dir in
11380d8556812Smrg  *\ * | *\	*)
11381d8556812Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
11382d8556812Smrg  *)
11383d8556812Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
11384d8556812Smrg  esac
11385d8556812Smrgfi
113869586ba5aSmrgAC_SUBST([install_sh])])
1138776888252Smrg
113889586ba5aSmrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
1138986dafe34Smrg#
1139086dafe34Smrg# This file is free software; the Free Software Foundation
1139186dafe34Smrg# gives unlimited permission to copy and/or distribute it,
1139286dafe34Smrg# with or without modifications, as long as this notice is preserved.
1139376888252Smrg
1139486dafe34Smrg# Check whether the underlying file-system supports filenames
1139586dafe34Smrg# with a leading dot.  For instance MS-DOS doesn't.
1139686dafe34SmrgAC_DEFUN([AM_SET_LEADING_DOT],
1139786dafe34Smrg[rm -rf .tst 2>/dev/null
1139886dafe34Smrgmkdir .tst 2>/dev/null
1139986dafe34Smrgif test -d .tst; then
1140086dafe34Smrg  am__leading_dot=.
1140186dafe34Smrgelse
1140286dafe34Smrg  am__leading_dot=_
1140386dafe34Smrgfi
1140486dafe34Smrgrmdir .tst 2>/dev/null
1140586dafe34SmrgAC_SUBST([am__leading_dot])])
1140676888252Smrg
1140786dafe34Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
1140876888252Smrg
114099586ba5aSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1141076888252Smrg#
1141186dafe34Smrg# This file is free software; the Free Software Foundation
1141286dafe34Smrg# gives unlimited permission to copy and/or distribute it,
1141386dafe34Smrg# with or without modifications, as long as this notice is preserved.
1141476888252Smrg
1141586dafe34Smrg# AM_MAKE_INCLUDE()
1141686dafe34Smrg# -----------------
1141786dafe34Smrg# Check to see how make treats includes.
1141886dafe34SmrgAC_DEFUN([AM_MAKE_INCLUDE],
1141986dafe34Smrg[am_make=${MAKE-make}
1142086dafe34Smrgcat > confinc << 'END'
1142186dafe34Smrgam__doit:
11422d8556812Smrg	@echo this is the am__doit target
1142386dafe34Smrg.PHONY: am__doit
1142486dafe34SmrgEND
1142586dafe34Smrg# If we don't find an include directive, just comment out the code.
1142686dafe34SmrgAC_MSG_CHECKING([for style of include used by $am_make])
1142786dafe34Smrgam__include="#"
1142886dafe34Smrgam__quote=
1142986dafe34Smrg_am_result=none
1143086dafe34Smrg# First try GNU make style include.
1143186dafe34Smrgecho "include confinc" > confmf
114329586ba5aSmrg# Ignore all kinds of additional output from 'make'.
11433d8556812Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
11434d8556812Smrg*the\ am__doit\ target*)
11435d8556812Smrg  am__include=include
11436d8556812Smrg  am__quote=
11437d8556812Smrg  _am_result=GNU
11438d8556812Smrg  ;;
11439d8556812Smrgesac
1144086dafe34Smrg# Now try BSD make style include.
1144186dafe34Smrgif test "$am__include" = "#"; then
1144286dafe34Smrg   echo '.include "confinc"' > confmf
11443d8556812Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
11444d8556812Smrg   *the\ am__doit\ target*)
11445d8556812Smrg     am__include=.include
11446d8556812Smrg     am__quote="\""
11447d8556812Smrg     _am_result=BSD
11448d8556812Smrg     ;;
11449d8556812Smrg   esac
1145086dafe34Smrgfi
1145186dafe34SmrgAC_SUBST([am__include])
1145286dafe34SmrgAC_SUBST([am__quote])
1145386dafe34SmrgAC_MSG_RESULT([$_am_result])
1145486dafe34Smrgrm -f confinc confmf
1145586dafe34Smrg])
1145676888252Smrg
1145786dafe34Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1145876888252Smrg
114599586ba5aSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
114601ae1b5e8Smrg#
1146186dafe34Smrg# This file is free software; the Free Software Foundation
1146286dafe34Smrg# gives unlimited permission to copy and/or distribute it,
1146386dafe34Smrg# with or without modifications, as long as this notice is preserved.
1146476888252Smrg
1146586dafe34Smrg# AM_MISSING_PROG(NAME, PROGRAM)
1146686dafe34Smrg# ------------------------------
1146786dafe34SmrgAC_DEFUN([AM_MISSING_PROG],
1146886dafe34Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
1146986dafe34Smrg$1=${$1-"${am_missing_run}$2"}
1147086dafe34SmrgAC_SUBST($1)])
1147176888252Smrg
1147286dafe34Smrg# AM_MISSING_HAS_RUN
1147386dafe34Smrg# ------------------
114749586ba5aSmrg# Define MISSING if not defined so far and test if it is modern enough.
114759586ba5aSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
1147686dafe34SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
1147786dafe34Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1147886dafe34SmrgAC_REQUIRE_AUX_FILE([missing])dnl
11479d8556812Smrgif test x"${MISSING+set}" != xset; then
11480d8556812Smrg  case $am_aux_dir in
11481d8556812Smrg  *\ * | *\	*)
11482d8556812Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
11483d8556812Smrg  *)
11484d8556812Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
11485d8556812Smrg  esac
11486d8556812Smrgfi
1148786dafe34Smrg# Use eval to expand $SHELL
114889586ba5aSmrgif eval "$MISSING --is-lightweight"; then
114899586ba5aSmrg  am_missing_run="$MISSING "
1149086dafe34Smrgelse
1149186dafe34Smrg  am_missing_run=
114929586ba5aSmrg  AC_MSG_WARN(['missing' script is too old or missing])
1149386dafe34Smrgfi
114941ae1b5e8Smrg])
1149576888252Smrg
1149686dafe34Smrg# Helper functions for option handling.                     -*- Autoconf -*-
1149776888252Smrg
114989586ba5aSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
114991ae1b5e8Smrg#
1150086dafe34Smrg# This file is free software; the Free Software Foundation
1150186dafe34Smrg# gives unlimited permission to copy and/or distribute it,
1150286dafe34Smrg# with or without modifications, as long as this notice is preserved.
1150386dafe34Smrg
1150486dafe34Smrg# _AM_MANGLE_OPTION(NAME)
1150586dafe34Smrg# -----------------------
1150686dafe34SmrgAC_DEFUN([_AM_MANGLE_OPTION],
1150786dafe34Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1150886dafe34Smrg
1150986dafe34Smrg# _AM_SET_OPTION(NAME)
1151063847c39Smrg# --------------------
1151186dafe34Smrg# Set option NAME.  Presently that only means defining a flag for this option.
1151286dafe34SmrgAC_DEFUN([_AM_SET_OPTION],
115139586ba5aSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
1151486dafe34Smrg
1151586dafe34Smrg# _AM_SET_OPTIONS(OPTIONS)
1151663847c39Smrg# ------------------------
1151786dafe34Smrg# OPTIONS is a space-separated list of Automake options.
1151886dafe34SmrgAC_DEFUN([_AM_SET_OPTIONS],
1151986dafe34Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1152086dafe34Smrg
1152186dafe34Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1152286dafe34Smrg# -------------------------------------------
1152386dafe34Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1152486dafe34SmrgAC_DEFUN([_AM_IF_OPTION],
1152586dafe34Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1152686dafe34Smrg
115279586ba5aSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
115289586ba5aSmrg#
115299586ba5aSmrg# This file is free software; the Free Software Foundation
115309586ba5aSmrg# gives unlimited permission to copy and/or distribute it,
115319586ba5aSmrg# with or without modifications, as long as this notice is preserved.
115329586ba5aSmrg
115339586ba5aSmrg# _AM_PROG_CC_C_O
115349586ba5aSmrg# ---------------
115359586ba5aSmrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
115369586ba5aSmrg# to automatically call this.
115379586ba5aSmrgAC_DEFUN([_AM_PROG_CC_C_O],
115389586ba5aSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
115399586ba5aSmrgAC_REQUIRE_AUX_FILE([compile])dnl
115409586ba5aSmrgAC_LANG_PUSH([C])dnl
115419586ba5aSmrgAC_CACHE_CHECK(
115429586ba5aSmrg  [whether $CC understands -c and -o together],
115439586ba5aSmrg  [am_cv_prog_cc_c_o],
115449586ba5aSmrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
115459586ba5aSmrg  # Make sure it works both with $CC and with simple cc.
115469586ba5aSmrg  # Following AC_PROG_CC_C_O, we do the test twice because some
115479586ba5aSmrg  # compilers refuse to overwrite an existing .o file with -o,
115489586ba5aSmrg  # though they will create one.
115499586ba5aSmrg  am_cv_prog_cc_c_o=yes
115509586ba5aSmrg  for am_i in 1 2; do
115519586ba5aSmrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
115529586ba5aSmrg         && test -f conftest2.$ac_objext; then
115539586ba5aSmrg      : OK
115549586ba5aSmrg    else
115559586ba5aSmrg      am_cv_prog_cc_c_o=no
115569586ba5aSmrg      break
115579586ba5aSmrg    fi
115589586ba5aSmrg  done
115599586ba5aSmrg  rm -f core conftest*
115609586ba5aSmrg  unset am_i])
115619586ba5aSmrgif test "$am_cv_prog_cc_c_o" != yes; then
115629586ba5aSmrg   # Losing compiler, so override with the script.
115639586ba5aSmrg   # FIXME: It is wrong to rewrite CC.
115649586ba5aSmrg   # But if we don't then we get into trouble of one sort or another.
115659586ba5aSmrg   # A longer-term fix would be to have automake use am__CC in this case,
115669586ba5aSmrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
115679586ba5aSmrg   CC="$am_aux_dir/compile $CC"
115689586ba5aSmrgfi
115699586ba5aSmrgAC_LANG_POP([C])])
115709586ba5aSmrg
115719586ba5aSmrg# For backward compatibility.
115729586ba5aSmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
1157386dafe34Smrg
115749586ba5aSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
115751ae1b5e8Smrg#
1157686dafe34Smrg# This file is free software; the Free Software Foundation
1157786dafe34Smrg# gives unlimited permission to copy and/or distribute it,
1157886dafe34Smrg# with or without modifications, as long as this notice is preserved.
1157976888252Smrg
115809586ba5aSmrg# AM_RUN_LOG(COMMAND)
115819586ba5aSmrg# -------------------
115829586ba5aSmrg# Run COMMAND, save the exit status in ac_status, and log it.
115839586ba5aSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
115849586ba5aSmrgAC_DEFUN([AM_RUN_LOG],
115859586ba5aSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
115869586ba5aSmrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
115879586ba5aSmrg   ac_status=$?
115889586ba5aSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
115899586ba5aSmrg   (exit $ac_status); }])
115909586ba5aSmrg
115919586ba5aSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
115929586ba5aSmrg
115939586ba5aSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
115949586ba5aSmrg#
115959586ba5aSmrg# This file is free software; the Free Software Foundation
115969586ba5aSmrg# gives unlimited permission to copy and/or distribute it,
115979586ba5aSmrg# with or without modifications, as long as this notice is preserved.
1159876888252Smrg
1159986dafe34Smrg# AM_SANITY_CHECK
1160086dafe34Smrg# ---------------
1160186dafe34SmrgAC_DEFUN([AM_SANITY_CHECK],
1160286dafe34Smrg[AC_MSG_CHECKING([whether build environment is sane])
11603d8556812Smrg# Reject unsafe characters in $srcdir or the absolute working directory
11604d8556812Smrg# name.  Accept space and tab only in the latter.
11605d8556812Smrgam_lf='
11606d8556812Smrg'
11607d8556812Smrgcase `pwd` in
11608d8556812Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
11609d8556812Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
11610d8556812Smrgesac
11611d8556812Smrgcase $srcdir in
11612d8556812Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
116139586ba5aSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
11614d8556812Smrgesac
11615d8556812Smrg
116169586ba5aSmrg# Do 'set' in a subshell so we don't clobber the current shell's
1161786dafe34Smrg# arguments.  Must try -L first in case configure is actually a
1161886dafe34Smrg# symlink; some systems play weird games with the mod time of symlinks
1161986dafe34Smrg# (eg FreeBSD returns the mod time of the symlink's containing
1162086dafe34Smrg# directory).
1162186dafe34Smrgif (
116229586ba5aSmrg   am_has_slept=no
116239586ba5aSmrg   for am_try in 1 2; do
116249586ba5aSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
116259586ba5aSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
116269586ba5aSmrg     if test "$[*]" = "X"; then
116279586ba5aSmrg	# -L didn't work.
116289586ba5aSmrg	set X `ls -t "$srcdir/configure" conftest.file`
116299586ba5aSmrg     fi
116309586ba5aSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
116319586ba5aSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
116329586ba5aSmrg
116339586ba5aSmrg	# If neither matched, then we have a broken ls.  This can happen
116349586ba5aSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
116359586ba5aSmrg	# broken ls alias from the environment.  This has actually
116369586ba5aSmrg	# happened.  Such a system could not be considered "sane".
116379586ba5aSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
116389586ba5aSmrg  alias in your environment])
116399586ba5aSmrg     fi
116409586ba5aSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
116419586ba5aSmrg       break
116429586ba5aSmrg     fi
116439586ba5aSmrg     # Just in case.
116449586ba5aSmrg     sleep 1
116459586ba5aSmrg     am_has_slept=yes
116469586ba5aSmrg   done
1164786dafe34Smrg   test "$[2]" = conftest.file
1164886dafe34Smrg   )
1164986dafe34Smrgthen
1165086dafe34Smrg   # Ok.
1165186dafe34Smrg   :
1165276888252Smrgelse
1165386dafe34Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
1165486dafe34SmrgCheck your system clock])
1165586dafe34Smrgfi
116569586ba5aSmrgAC_MSG_RESULT([yes])
116579586ba5aSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
116589586ba5aSmrg# generated files are strictly newer.
116599586ba5aSmrgam_sleep_pid=
116609586ba5aSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
116619586ba5aSmrg  ( sleep 1 ) &
116629586ba5aSmrg  am_sleep_pid=$!
116639586ba5aSmrgfi
116649586ba5aSmrgAC_CONFIG_COMMANDS_PRE(
116659586ba5aSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
116669586ba5aSmrg   if test -n "$am_sleep_pid"; then
116679586ba5aSmrg     # Hide warnings about reused PIDs.
116689586ba5aSmrg     wait $am_sleep_pid 2>/dev/null
116699586ba5aSmrg   fi
116709586ba5aSmrg   AC_MSG_RESULT([done])])
116719586ba5aSmrgrm -f conftest.file
116729586ba5aSmrg])
1167376888252Smrg
116749586ba5aSmrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
1167563847c39Smrg#
1167663847c39Smrg# This file is free software; the Free Software Foundation
1167763847c39Smrg# gives unlimited permission to copy and/or distribute it,
1167863847c39Smrg# with or without modifications, as long as this notice is preserved.
1167963847c39Smrg
1168063847c39Smrg# AM_SILENT_RULES([DEFAULT])
1168163847c39Smrg# --------------------------
1168263847c39Smrg# Enable less verbose build rules; with the default set to DEFAULT
116839586ba5aSmrg# ("yes" being less verbose, "no" or empty being verbose).
1168463847c39SmrgAC_DEFUN([AM_SILENT_RULES],
116859586ba5aSmrg[AC_ARG_ENABLE([silent-rules], [dnl
116869586ba5aSmrgAS_HELP_STRING(
116879586ba5aSmrg  [--enable-silent-rules],
116889586ba5aSmrg  [less verbose build output (undo: "make V=1")])
116899586ba5aSmrgAS_HELP_STRING(
116909586ba5aSmrg  [--disable-silent-rules],
116919586ba5aSmrg  [verbose build output (undo: "make V=0")])dnl
116929586ba5aSmrg])
116939586ba5aSmrgcase $enable_silent_rules in @%:@ (((
116949586ba5aSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
116959586ba5aSmrg   no) AM_DEFAULT_VERBOSITY=1;;
116969586ba5aSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1169763847c39Smrgesac
1169863847c39Smrgdnl
116999586ba5aSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
1170063847c39Smrgdnl do not support nested variable expansions.
1170163847c39Smrgdnl See automake bug#9928 and bug#10237.
1170263847c39Smrgam_make=${MAKE-make}
1170363847c39SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
1170463847c39Smrg   [am_cv_make_support_nested_variables],
1170563847c39Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
1170663847c39SmrgBAR0=false
1170763847c39SmrgBAR1=true
1170863847c39SmrgV=1
1170963847c39Smrgam__doit:
1171063847c39Smrg	@$(TRUE)
1171163847c39Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
1171263847c39Smrg  am_cv_make_support_nested_variables=yes
1171363847c39Smrgelse
1171463847c39Smrg  am_cv_make_support_nested_variables=no
1171563847c39Smrgfi])
1171663847c39Smrgif test $am_cv_make_support_nested_variables = yes; then
117179586ba5aSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
1171863847c39Smrg  AM_V='$(V)'
1171963847c39Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
1172063847c39Smrgelse
1172163847c39Smrg  AM_V=$AM_DEFAULT_VERBOSITY
1172263847c39Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
1172363847c39Smrgfi
1172463847c39SmrgAC_SUBST([AM_V])dnl
1172563847c39SmrgAM_SUBST_NOTMAKE([AM_V])dnl
1172663847c39SmrgAC_SUBST([AM_DEFAULT_V])dnl
1172763847c39SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
1172863847c39SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1172963847c39SmrgAM_BACKSLASH='\'
1173063847c39SmrgAC_SUBST([AM_BACKSLASH])dnl
1173163847c39Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1173263847c39Smrg])
1173363847c39Smrg
117349586ba5aSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
117351ae1b5e8Smrg#
1173686dafe34Smrg# This file is free software; the Free Software Foundation
1173786dafe34Smrg# gives unlimited permission to copy and/or distribute it,
1173886dafe34Smrg# with or without modifications, as long as this notice is preserved.
1173986dafe34Smrg
1174086dafe34Smrg# AM_PROG_INSTALL_STRIP
1174186dafe34Smrg# ---------------------
117429586ba5aSmrg# One issue with vendor 'install' (even GNU) is that you can't
1174386dafe34Smrg# specify the program used to strip binaries.  This is especially
1174486dafe34Smrg# annoying in cross-compiling environments, where the build's strip
1174586dafe34Smrg# is unlikely to handle the host's binaries.
1174686dafe34Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
117479586ba5aSmrg# always use install-sh in "make install-strip", and initialize
1174886dafe34Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
1174986dafe34SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
1175086dafe34Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
117519586ba5aSmrg# Installed binaries are usually stripped using 'strip' when the user
117529586ba5aSmrg# run "make install-strip".  However 'strip' might not be the right
1175386dafe34Smrg# tool to use in cross-compilation environments, therefore Automake
117549586ba5aSmrg# will honor the 'STRIP' environment variable to overrule this program.
117559586ba5aSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
1175686dafe34Smrgif test "$cross_compiling" != no; then
1175786dafe34Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
1175886dafe34Smrgfi
1175986dafe34SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1176086dafe34SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
1176186dafe34Smrg
117629586ba5aSmrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
117631ae1b5e8Smrg#
1176486dafe34Smrg# This file is free software; the Free Software Foundation
1176586dafe34Smrg# gives unlimited permission to copy and/or distribute it,
1176686dafe34Smrg# with or without modifications, as long as this notice is preserved.
1176776888252Smrg
1176886dafe34Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
1176986dafe34Smrg# ---------------------------
1177086dafe34Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1177186dafe34Smrg# This macro is traced by Automake.
1177286dafe34SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1177376888252Smrg
11774d8556812Smrg# AM_SUBST_NOTMAKE(VARIABLE)
1177563847c39Smrg# --------------------------
11776d8556812Smrg# Public sister of _AM_SUBST_NOTMAKE.
11777d8556812SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
11778d8556812Smrg
1177986dafe34Smrg# Check how to create a tarball.                            -*- Autoconf -*-
1178076888252Smrg
117819586ba5aSmrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
1178286dafe34Smrg#
1178386dafe34Smrg# This file is free software; the Free Software Foundation
1178486dafe34Smrg# gives unlimited permission to copy and/or distribute it,
1178586dafe34Smrg# with or without modifications, as long as this notice is preserved.
1178676888252Smrg
1178786dafe34Smrg# _AM_PROG_TAR(FORMAT)
1178886dafe34Smrg# --------------------
1178986dafe34Smrg# Check how to create a tarball in format FORMAT.
117909586ba5aSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
1179186dafe34Smrg#
1179286dafe34Smrg# Substitute a variable $(am__tar) that is a command
1179386dafe34Smrg# writing to stdout a FORMAT-tarball containing the directory
1179486dafe34Smrg# $tardir.
1179586dafe34Smrg#     tardir=directory && $(am__tar) > result.tar
1179686dafe34Smrg#
1179786dafe34Smrg# Substitute a variable $(am__untar) that extract such
1179886dafe34Smrg# a tarball read from stdin.
1179986dafe34Smrg#     $(am__untar) < result.tar
118009586ba5aSmrg#
1180186dafe34SmrgAC_DEFUN([_AM_PROG_TAR],
1180263847c39Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
1180363847c39Smrg# in the wild :-(  We should find a proper way to deprecate it ...
1180463847c39SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
118059586ba5aSmrg
118069586ba5aSmrg# We'll loop over all known methods to create a tar archive until one works.
1180786dafe34Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1180876888252Smrg
118099586ba5aSmrgm4_if([$1], [v7],
118109586ba5aSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
118119586ba5aSmrg
118129586ba5aSmrg  [m4_case([$1],
118139586ba5aSmrg    [ustar],
118149586ba5aSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
118159586ba5aSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
118169586ba5aSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
118179586ba5aSmrg      # and bug#13588).
118189586ba5aSmrg      am_max_uid=2097151 # 2^21 - 1
118199586ba5aSmrg      am_max_gid=$am_max_uid
118209586ba5aSmrg      # The $UID and $GID variables are not portable, so we need to resort
118219586ba5aSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
118229586ba5aSmrg      # below are definitely unexpected, so allow the users to see them
118239586ba5aSmrg      # (that is, avoid stderr redirection).
118249586ba5aSmrg      am_uid=`id -u || echo unknown`
118259586ba5aSmrg      am_gid=`id -g || echo unknown`
118269586ba5aSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
118279586ba5aSmrg      if test $am_uid -le $am_max_uid; then
118289586ba5aSmrg         AC_MSG_RESULT([yes])
118299586ba5aSmrg      else
118309586ba5aSmrg         AC_MSG_RESULT([no])
118319586ba5aSmrg         _am_tools=none
118329586ba5aSmrg      fi
118339586ba5aSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
118349586ba5aSmrg      if test $am_gid -le $am_max_gid; then
118359586ba5aSmrg         AC_MSG_RESULT([yes])
118369586ba5aSmrg      else
118379586ba5aSmrg        AC_MSG_RESULT([no])
118389586ba5aSmrg        _am_tools=none
118399586ba5aSmrg      fi],
1184076888252Smrg
118419586ba5aSmrg  [pax],
118429586ba5aSmrg    [],
118439586ba5aSmrg
118449586ba5aSmrg  [m4_fatal([Unknown tar format])])
118459586ba5aSmrg
118469586ba5aSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
118479586ba5aSmrg
118489586ba5aSmrg  # Go ahead even if we have the value already cached.  We do so because we
118499586ba5aSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
118509586ba5aSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
118519586ba5aSmrg
118529586ba5aSmrg  for _am_tool in $_am_tools; do
118539586ba5aSmrg    case $_am_tool in
118549586ba5aSmrg    gnutar)
118559586ba5aSmrg      for _am_tar in tar gnutar gtar; do
118569586ba5aSmrg        AM_RUN_LOG([$_am_tar --version]) && break
118579586ba5aSmrg      done
118589586ba5aSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
118599586ba5aSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
118609586ba5aSmrg      am__untar="$_am_tar -xf -"
118619586ba5aSmrg      ;;
118629586ba5aSmrg    plaintar)
118639586ba5aSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
118649586ba5aSmrg      # ustar tarball either.
118659586ba5aSmrg      (tar --version) >/dev/null 2>&1 && continue
118669586ba5aSmrg      am__tar='tar chf - "$$tardir"'
118679586ba5aSmrg      am__tar_='tar chf - "$tardir"'
118689586ba5aSmrg      am__untar='tar xf -'
118699586ba5aSmrg      ;;
118709586ba5aSmrg    pax)
118719586ba5aSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
118729586ba5aSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
118739586ba5aSmrg      am__untar='pax -r'
118749586ba5aSmrg      ;;
118759586ba5aSmrg    cpio)
118769586ba5aSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
118779586ba5aSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
118789586ba5aSmrg      am__untar='cpio -i -H $1 -d'
118799586ba5aSmrg      ;;
118809586ba5aSmrg    none)
118819586ba5aSmrg      am__tar=false
118829586ba5aSmrg      am__tar_=false
118839586ba5aSmrg      am__untar=false
118849586ba5aSmrg      ;;
118859586ba5aSmrg    esac
118869586ba5aSmrg
118879586ba5aSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
118889586ba5aSmrg    # and am__untar set.
118899586ba5aSmrg    test -n "${am_cv_prog_tar_$1}" && break
118909586ba5aSmrg
118919586ba5aSmrg    # tar/untar a dummy directory, and stop if the command works.
118929586ba5aSmrg    rm -rf conftest.dir
118939586ba5aSmrg    mkdir conftest.dir
118949586ba5aSmrg    echo GrepMe > conftest.dir/file
118959586ba5aSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
118969586ba5aSmrg    rm -rf conftest.dir
118979586ba5aSmrg    if test -s conftest.tar; then
118989586ba5aSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
118999586ba5aSmrg      AM_RUN_LOG([cat conftest.dir/file])
119009586ba5aSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
119019586ba5aSmrg    fi
119029586ba5aSmrg  done
1190386dafe34Smrg  rm -rf conftest.dir
1190486dafe34Smrg
119059586ba5aSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
119069586ba5aSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
119079586ba5aSmrg
1190886dafe34SmrgAC_SUBST([am__tar])
1190986dafe34SmrgAC_SUBST([am__untar])
1191086dafe34Smrg]) # _AM_PROG_TAR
1191176888252Smrg
11912