1983b4bf2Smrg# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
27e6fb56fSmrg
3983b4bf2Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4983b4bf2Smrg# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
5983b4bf2Smrg# Inc.
67e6fb56fSmrg# This file is free software; the Free Software Foundation
77e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
87e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
97e6fb56fSmrg
107e6fb56fSmrg# This program is distributed in the hope that it will be useful,
117e6fb56fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
127e6fb56fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
137e6fb56fSmrg# PARTICULAR PURPOSE.
147e6fb56fSmrg
157e6fb56fSmrgm4_ifndef([AC_AUTOCONF_VERSION],
167e6fb56fSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17983b4bf2Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
18983b4bf2Smrg[m4_warning([this file was generated for autoconf 2.68.
197e6fb56fSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
207e6fb56fSmrgIf you have problems, you may need to regenerate the build system entirely.
21983b4bf2SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
227e6fb56fSmrg
237e6fb56fSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2490b17f1bSmrg#
25983b4bf2Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
26983b4bf2Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
27983b4bf2Smrg#                 Foundation, Inc.
2890b17f1bSmrg#   Written by Gordon Matzigkeit, 1996
2990b17f1bSmrg#
3090b17f1bSmrg# This file is free software; the Free Software Foundation gives
3190b17f1bSmrg# unlimited permission to copy and/or distribute it, with or without
3290b17f1bSmrg# modifications, as long as this notice is preserved.
3390b17f1bSmrg
3490b17f1bSmrgm4_define([_LT_COPYING], [dnl
35983b4bf2Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
36983b4bf2Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
37983b4bf2Smrg#                 Foundation, Inc.
38983b4bf2Smrg#   Written by Gordon Matzigkeit, 1996
3990b17f1bSmrg#
40983b4bf2Smrg#   This file is part of GNU Libtool.
4190b17f1bSmrg#
42983b4bf2Smrg# GNU Libtool is free software; you can redistribute it and/or
43983b4bf2Smrg# modify it under the terms of the GNU General Public License as
44983b4bf2Smrg# published by the Free Software Foundation; either version 2 of
45983b4bf2Smrg# the License, or (at your option) any later version.
46983b4bf2Smrg#
47983b4bf2Smrg# As a special exception to the GNU General Public License,
48983b4bf2Smrg# if you distribute this file as part of a program or library that
49983b4bf2Smrg# is built using GNU Libtool, you may include this file under the
50983b4bf2Smrg# same distribution terms that you use for the rest of that program.
51983b4bf2Smrg#
52983b4bf2Smrg# GNU Libtool is distributed in the hope that it will be useful,
53983b4bf2Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
5490b17f1bSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5590b17f1bSmrg# GNU General Public License for more details.
5690b17f1bSmrg#
5790b17f1bSmrg# You should have received a copy of the GNU General Public License
58983b4bf2Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
59983b4bf2Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
60983b4bf2Smrg# obtained by writing to the Free Software Foundation, Inc.,
61983b4bf2Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
6290b17f1bSmrg])
637e6fb56fSmrg
64983b4bf2Smrg# serial 57 LT_INIT
657e6fb56fSmrg
667e6fb56fSmrg
6790b17f1bSmrg# LT_PREREQ(VERSION)
6890b17f1bSmrg# ------------------
6990b17f1bSmrg# Complain and exit if this libtool version is less that VERSION.
7090b17f1bSmrgm4_defun([LT_PREREQ],
7190b17f1bSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
7290b17f1bSmrg       [m4_default([$3],
7390b17f1bSmrg		   [m4_fatal([Libtool version $1 or higher is required],
7490b17f1bSmrg		             63)])],
7590b17f1bSmrg       [$2])])
767e6fb56fSmrg
777e6fb56fSmrg
7890b17f1bSmrg# _LT_CHECK_BUILDDIR
7990b17f1bSmrg# ------------------
8090b17f1bSmrg# Complain if the absolute build directory name contains unusual characters
8190b17f1bSmrgm4_defun([_LT_CHECK_BUILDDIR],
8290b17f1bSmrg[case `pwd` in
8390b17f1bSmrg  *\ * | *\	*)
8490b17f1bSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
8590b17f1bSmrgesac
8690b17f1bSmrg])
8790b17f1bSmrg
8890b17f1bSmrg
8990b17f1bSmrg# LT_INIT([OPTIONS])
9090b17f1bSmrg# ------------------
9190b17f1bSmrgAC_DEFUN([LT_INIT],
92983b4bf2Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
9390b17f1bSmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
9490b17f1bSmrgAC_BEFORE([$0], [LT_LANG])dnl
9590b17f1bSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
9690b17f1bSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
9790b17f1bSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
9890b17f1bSmrg
9990b17f1bSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
10090b17f1bSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
10190b17f1bSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
10290b17f1bSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
10390b17f1bSmrgdnl unless we require an AC_DEFUNed macro:
10490b17f1bSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
10590b17f1bSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
10690b17f1bSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
10790b17f1bSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
10890b17f1bSmrgm4_require([_LT_PROG_LTMAIN])dnl
10990b17f1bSmrg
11090b17f1bSmrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
11190b17f1bSmrg
11290b17f1bSmrgdnl Parse OPTIONS
11390b17f1bSmrg_LT_SET_OPTIONS([$0], [$1])
1147e6fb56fSmrg
1157e6fb56fSmrg# This can be used to rebuild libtool when needed
116983b4bf2SmrgLIBTOOL_DEPS="$ltmain"
1177e6fb56fSmrg
1187e6fb56fSmrg# Always use our own libtool.
1197e6fb56fSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
1207e6fb56fSmrgAC_SUBST(LIBTOOL)dnl
1217e6fb56fSmrg
12290b17f1bSmrg_LT_SETUP
1237e6fb56fSmrg
12490b17f1bSmrg# Only expand once:
12590b17f1bSmrgm4_define([LT_INIT])
12690b17f1bSmrg])# LT_INIT
1277e6fb56fSmrg
12890b17f1bSmrg# Old names:
12990b17f1bSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
13090b17f1bSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
13190b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
13290b17f1bSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
13390b17f1bSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
13490b17f1bSmrg
13590b17f1bSmrg
13690b17f1bSmrg# _LT_CC_BASENAME(CC)
13790b17f1bSmrg# -------------------
138983b4bf2Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
13990b17f1bSmrgm4_defun([_LT_CC_BASENAME],
140983b4bf2Smrg[for cc_temp in $1""; do
141983b4bf2Smrg  case $cc_temp in
142983b4bf2Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
143983b4bf2Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
144983b4bf2Smrg    \-*) ;;
145983b4bf2Smrg    *) break;;
146983b4bf2Smrg  esac
147983b4bf2Smrgdone
148983b4bf2Smrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
14990b17f1bSmrg])
15090b17f1bSmrg
15190b17f1bSmrg
15290b17f1bSmrg# _LT_FILEUTILS_DEFAULTS
15390b17f1bSmrg# ----------------------
15490b17f1bSmrg# It is okay to use these file commands and assume they have been set
155983b4bf2Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
15690b17f1bSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
15790b17f1bSmrg[: ${CP="cp -f"}
15890b17f1bSmrg: ${MV="mv -f"}
15990b17f1bSmrg: ${RM="rm -f"}
16090b17f1bSmrg])# _LT_FILEUTILS_DEFAULTS
16190b17f1bSmrg
16290b17f1bSmrg
16390b17f1bSmrg# _LT_SETUP
16490b17f1bSmrg# ---------
16590b17f1bSmrgm4_defun([_LT_SETUP],
16690b17f1bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1677e6fb56fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
16890b17f1bSmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
16990b17f1bSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1707e6fb56fSmrg
17190b17f1bSmrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
17290b17f1bSmrgdnl
17390b17f1bSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
17490b17f1bSmrg_LT_DECL([], [host], [0])dnl
17590b17f1bSmrg_LT_DECL([], [host_os], [0])dnl
17690b17f1bSmrgdnl
17790b17f1bSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
17890b17f1bSmrg_LT_DECL([], [build], [0])dnl
17990b17f1bSmrg_LT_DECL([], [build_os], [0])dnl
18090b17f1bSmrgdnl
18190b17f1bSmrgAC_REQUIRE([AC_PROG_CC])dnl
18290b17f1bSmrgAC_REQUIRE([LT_PATH_LD])dnl
18390b17f1bSmrgAC_REQUIRE([LT_PATH_NM])dnl
18490b17f1bSmrgdnl
1857e6fb56fSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
18690b17f1bSmrgtest -z "$LN_S" && LN_S="ln -s"
18790b17f1bSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
18890b17f1bSmrgdnl
18990b17f1bSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
19090b17f1bSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
19190b17f1bSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1927e6fb56fSmrgdnl
19390b17f1bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
19490b17f1bSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
19590b17f1bSmrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
19690b17f1bSmrgm4_require([_LT_CMD_RELOAD])dnl
19790b17f1bSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
19890b17f1bSmrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
19990b17f1bSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
20090b17f1bSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
20190b17f1bSmrgm4_require([_LT_WITH_SYSROOT])dnl
20290b17f1bSmrg
20390b17f1bSmrg_LT_CONFIG_LIBTOOL_INIT([
204983b4bf2Smrg# See if we are running on zsh, and set the options which allow our
20590b17f1bSmrg# commands through without removal of \ escapes INIT.
206983b4bf2Smrgif test -n "\${ZSH_VERSION+set}" ; then
20790b17f1bSmrg   setopt NO_GLOB_SUBST
20890b17f1bSmrgfi
20990b17f1bSmrg])
210983b4bf2Smrgif test -n "${ZSH_VERSION+set}" ; then
21190b17f1bSmrg   setopt NO_GLOB_SUBST
21290b17f1bSmrgfi
21390b17f1bSmrg
21490b17f1bSmrg_LT_CHECK_OBJDIR
2157e6fb56fSmrg
21690b17f1bSmrgm4_require([_LT_TAG_COMPILER])dnl
2177e6fb56fSmrg
2187e6fb56fSmrgcase $host_os in
2197e6fb56fSmrgaix3*)
2207e6fb56fSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
2217e6fb56fSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
2227e6fb56fSmrg  # vanish in a puff of smoke.
223983b4bf2Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
2247e6fb56fSmrg    COLLECT_NAMES=
2257e6fb56fSmrg    export COLLECT_NAMES
2267e6fb56fSmrg  fi
2277e6fb56fSmrg  ;;
2287e6fb56fSmrgesac
2297e6fb56fSmrg
2307e6fb56fSmrg# Global variables:
23190b17f1bSmrgofile=libtool
2327e6fb56fSmrgcan_build_shared=yes
2337e6fb56fSmrg
234983b4bf2Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
2357e6fb56fSmrg# which needs '.lib').
2367e6fb56fSmrglibext=a
2377e6fb56fSmrg
238983b4bf2Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
2397e6fb56fSmrg
240983b4bf2Smrgold_CC="$CC"
241983b4bf2Smrgold_CFLAGS="$CFLAGS"
2427e6fb56fSmrg
2437e6fb56fSmrg# Set sane defaults for various variables
2447e6fb56fSmrgtest -z "$CC" && CC=cc
2457e6fb56fSmrgtest -z "$LTCC" && LTCC=$CC
2467e6fb56fSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
2477e6fb56fSmrgtest -z "$LD" && LD=ld
2487e6fb56fSmrgtest -z "$ac_objext" && ac_objext=o
2497e6fb56fSmrg
2507e6fb56fSmrg_LT_CC_BASENAME([$compiler])
2517e6fb56fSmrg
2527e6fb56fSmrg# Only perform the check for file, if the check method requires it
25390b17f1bSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
2547e6fb56fSmrgcase $deplibs_check_method in
2557e6fb56fSmrgfile_magic*)
2567e6fb56fSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
25790b17f1bSmrg    _LT_PATH_MAGIC
2587e6fb56fSmrg  fi
2597e6fb56fSmrg  ;;
2607e6fb56fSmrgesac
2617e6fb56fSmrg
26290b17f1bSmrg# Use C for the default configuration in the libtool script
26390b17f1bSmrgLT_SUPPORTED_TAG([CC])
26490b17f1bSmrg_LT_LANG_C_CONFIG
26590b17f1bSmrg_LT_LANG_DEFAULT_CONFIG
26690b17f1bSmrg_LT_CONFIG_COMMANDS
26790b17f1bSmrg])# _LT_SETUP
2687e6fb56fSmrg
2697e6fb56fSmrg
27090b17f1bSmrg# _LT_PREPARE_SED_QUOTE_VARS
27190b17f1bSmrg# --------------------------
27290b17f1bSmrg# Define a few sed substitution that help us do robust quoting.
27390b17f1bSmrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
27490b17f1bSmrg[# Backslashify metacharacters that are still active within
27590b17f1bSmrg# double-quoted strings.
27690b17f1bSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
2777e6fb56fSmrg
27890b17f1bSmrg# Same as above, but do not quote variable references.
27990b17f1bSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
2807e6fb56fSmrg
28190b17f1bSmrg# Sed substitution to delay expansion of an escaped shell variable in a
28290b17f1bSmrg# double_quote_subst'ed string.
28390b17f1bSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
2847e6fb56fSmrg
28590b17f1bSmrg# Sed substitution to delay expansion of an escaped single quote.
28690b17f1bSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
2877e6fb56fSmrg
28890b17f1bSmrg# Sed substitution to avoid accidental globbing in evaled expressions
28990b17f1bSmrgno_glob_subst='s/\*/\\\*/g'
29090b17f1bSmrg])
2917e6fb56fSmrg
29290b17f1bSmrg# _LT_PROG_LTMAIN
29390b17f1bSmrg# ---------------
294983b4bf2Smrg# Note that this code is called both from `configure', and `config.status'
29590b17f1bSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
296983b4bf2Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
29790b17f1bSmrg# so we pass a copy along to make sure it has a sensible value anyway.
29890b17f1bSmrgm4_defun([_LT_PROG_LTMAIN],
29990b17f1bSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
30090b17f1bSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
301983b4bf2Smrgltmain="$ac_aux_dir/ltmain.sh"
30290b17f1bSmrg])# _LT_PROG_LTMAIN
3037e6fb56fSmrg
3047e6fb56fSmrg
3057e6fb56fSmrg
30690b17f1bSmrg# So that we can recreate a full libtool script including additional
30790b17f1bSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
308983b4bf2Smrg# in macros and then make a single call at the end using the `libtool'
30990b17f1bSmrg# label.
3107e6fb56fSmrg
3117e6fb56fSmrg
31290b17f1bSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
31390b17f1bSmrg# ----------------------------------------
31490b17f1bSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
31590b17f1bSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
31690b17f1bSmrg[m4_ifval([$1],
31790b17f1bSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
31890b17f1bSmrg                     [$1
31990b17f1bSmrg])])])
3207e6fb56fSmrg
32190b17f1bSmrg# Initialize.
32290b17f1bSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
3237e6fb56fSmrg
3247e6fb56fSmrg
32590b17f1bSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
32690b17f1bSmrg# ------------------------------
32790b17f1bSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
32890b17f1bSmrgm4_define([_LT_CONFIG_LIBTOOL],
32990b17f1bSmrg[m4_ifval([$1],
33090b17f1bSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
33190b17f1bSmrg                     [$1
33290b17f1bSmrg])])])
33390b17f1bSmrg
33490b17f1bSmrg# Initialize.
33590b17f1bSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
33690b17f1bSmrg
33790b17f1bSmrg
33890b17f1bSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
33990b17f1bSmrg# -----------------------------------------------------
34090b17f1bSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
34190b17f1bSmrg[_LT_CONFIG_LIBTOOL([$1])
34290b17f1bSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
34390b17f1bSmrg])
3447e6fb56fSmrg
3457e6fb56fSmrg
34690b17f1bSmrg# _LT_FORMAT_COMMENT([COMMENT])
34790b17f1bSmrg# -----------------------------
34890b17f1bSmrg# Add leading comment marks to the start of each line, and a trailing
34990b17f1bSmrg# full-stop to the whole comment if one is not present already.
35090b17f1bSmrgm4_define([_LT_FORMAT_COMMENT],
35190b17f1bSmrg[m4_ifval([$1], [
35290b17f1bSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
35390b17f1bSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
35490b17f1bSmrg)])
35590b17f1bSmrg
35690b17f1bSmrg
35790b17f1bSmrg
35890b17f1bSmrg
35990b17f1bSmrg
36090b17f1bSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
36190b17f1bSmrg# -------------------------------------------------------------------
36290b17f1bSmrg# CONFIGNAME is the name given to the value in the libtool script.
36390b17f1bSmrg# VARNAME is the (base) name used in the configure script.
36490b17f1bSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
36590b17f1bSmrg# VARNAME.  Any other value will be used directly.
36690b17f1bSmrgm4_define([_LT_DECL],
36790b17f1bSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
36890b17f1bSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
36990b17f1bSmrg	[m4_ifval([$1], [$1], [$2])])
37090b17f1bSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
37190b17f1bSmrg    m4_ifval([$4],
37290b17f1bSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
37390b17f1bSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
37490b17f1bSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
3757e6fb56fSmrg])
3767e6fb56fSmrg
3777e6fb56fSmrg
37890b17f1bSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
37990b17f1bSmrg# --------------------------------------------------------
38090b17f1bSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
3817e6fb56fSmrg
3827e6fb56fSmrg
38390b17f1bSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
38490b17f1bSmrg# ------------------------------------------------
38590b17f1bSmrgm4_define([lt_decl_tag_varnames],
38690b17f1bSmrg[_lt_decl_filter([tagged?], [yes], $@)])
3877e6fb56fSmrg
3887e6fb56fSmrg
38990b17f1bSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
39090b17f1bSmrg# ---------------------------------------------------------
39190b17f1bSmrgm4_define([_lt_decl_filter],
39290b17f1bSmrg[m4_case([$#],
39390b17f1bSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
39490b17f1bSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
39590b17f1bSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
39690b17f1bSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
39790b17f1bSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
39890b17f1bSmrg])
3997e6fb56fSmrg
4007e6fb56fSmrg
40190b17f1bSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
40290b17f1bSmrg# --------------------------------------------------
40390b17f1bSmrgm4_define([lt_decl_quote_varnames],
40490b17f1bSmrg[_lt_decl_filter([value], [1], $@)])
4057e6fb56fSmrg
4067e6fb56fSmrg
40790b17f1bSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
40890b17f1bSmrg# ---------------------------------------------------
40990b17f1bSmrgm4_define([lt_decl_dquote_varnames],
41090b17f1bSmrg[_lt_decl_filter([value], [2], $@)])
4117e6fb56fSmrg
4127e6fb56fSmrg
41390b17f1bSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
41490b17f1bSmrg# ---------------------------------------------------
41590b17f1bSmrgm4_define([lt_decl_varnames_tagged],
41690b17f1bSmrg[m4_assert([$# <= 2])dnl
41790b17f1bSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
41890b17f1bSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
41990b17f1bSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
42090b17f1bSmrgm4_define([_lt_decl_varnames_tagged],
42190b17f1bSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
4227e6fb56fSmrg
4237e6fb56fSmrg
42490b17f1bSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
42590b17f1bSmrg# ------------------------------------------------
42690b17f1bSmrgm4_define([lt_decl_all_varnames],
42790b17f1bSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
42890b17f1bSmrg     m4_if([$2], [],
42990b17f1bSmrg	   m4_quote(lt_decl_varnames),
43090b17f1bSmrg	m4_quote(m4_shift($@))))[]dnl
43190b17f1bSmrg])
43290b17f1bSmrgm4_define([_lt_decl_all_varnames],
43390b17f1bSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
43490b17f1bSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
43590b17f1bSmrg])
4367e6fb56fSmrg
4377e6fb56fSmrg
43890b17f1bSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
43990b17f1bSmrg# ------------------------------------
440983b4bf2Smrg# Quote a variable value, and forward it to `config.status' so that its
441983b4bf2Smrg# declaration there will have the same value as in `configure'.  VARNAME
44290b17f1bSmrg# must have a single quote delimited value for this to work.
44390b17f1bSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
44490b17f1bSmrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
4457e6fb56fSmrg
4467e6fb56fSmrg
44790b17f1bSmrg# _LT_CONFIG_STATUS_DECLARATIONS
44890b17f1bSmrg# ------------------------------
44990b17f1bSmrg# We delimit libtool config variables with single quotes, so when
45090b17f1bSmrg# we write them to config.status, we have to be sure to quote all
45190b17f1bSmrg# embedded single quotes properly.  In configure, this macro expands
45290b17f1bSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
45390b17f1bSmrg#
45490b17f1bSmrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
45590b17f1bSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
45690b17f1bSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
45790b17f1bSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
4587e6fb56fSmrg
45990b17f1bSmrg
46090b17f1bSmrg# _LT_LIBTOOL_TAGS
46190b17f1bSmrg# ----------------
46290b17f1bSmrg# Output comment and list of tags supported by the script
46390b17f1bSmrgm4_defun([_LT_LIBTOOL_TAGS],
46490b17f1bSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
465983b4bf2Smrgavailable_tags="_LT_TAGS"dnl
46690b17f1bSmrg])
46790b17f1bSmrg
46890b17f1bSmrg
46990b17f1bSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
47090b17f1bSmrg# -----------------------------------
47190b17f1bSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
47290b17f1bSmrg# expand to a commented shell variable setting:
47390b17f1bSmrg#
47490b17f1bSmrg#    # Some comment about what VAR is for.
47590b17f1bSmrg#    visible_name=$lt_internal_name
47690b17f1bSmrgm4_define([_LT_LIBTOOL_DECLARE],
47790b17f1bSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
47890b17f1bSmrg					   [description])))[]dnl
47990b17f1bSmrgm4_pushdef([_libtool_name],
48090b17f1bSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
48190b17f1bSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
48290b17f1bSmrg    [0], [_libtool_name=[$]$1],
48390b17f1bSmrg    [1], [_libtool_name=$lt_[]$1],
48490b17f1bSmrg    [2], [_libtool_name=$lt_[]$1],
48590b17f1bSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
48690b17f1bSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
48790b17f1bSmrg])
48890b17f1bSmrg
48990b17f1bSmrg
49090b17f1bSmrg# _LT_LIBTOOL_CONFIG_VARS
49190b17f1bSmrg# -----------------------
49290b17f1bSmrg# Produce commented declarations of non-tagged libtool config variables
493983b4bf2Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
49490b17f1bSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
49590b17f1bSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
49690b17f1bSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
49790b17f1bSmrg[m4_foreach([_lt_var],
49890b17f1bSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
49990b17f1bSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
50090b17f1bSmrg
50190b17f1bSmrg
50290b17f1bSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
50390b17f1bSmrg# -------------------------
50490b17f1bSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
50590b17f1bSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
50690b17f1bSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
50790b17f1bSmrg
50890b17f1bSmrg
50990b17f1bSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
51090b17f1bSmrg# ------------------------------
51190b17f1bSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
51290b17f1bSmrg
51390b17f1bSmrg
51490b17f1bSmrg# _LT_CONFIG_COMMANDS
51590b17f1bSmrg# -------------------
51690b17f1bSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
51790b17f1bSmrg# variables for single and double quote escaping we saved from calls
51890b17f1bSmrg# to _LT_DECL, we can put quote escaped variables declarations
519983b4bf2Smrg# into `config.status', and then the shell code to quote escape them in
520983b4bf2Smrg# for loops in `config.status'.  Finally, any additional code accumulated
52190b17f1bSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
52290b17f1bSmrgm4_defun([_LT_CONFIG_COMMANDS],
52390b17f1bSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
52490b17f1bSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
52590b17f1bSmrg	dnl instead of duplicating it all over again into config.status,
52690b17f1bSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
52790b17f1bSmrg	dnl needs to know what name is stored there:
52890b17f1bSmrg        [AC_CONFIG_COMMANDS([libtool],
52990b17f1bSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
53090b17f1bSmrg    dnl If the libtool generation code is destined for config.status,
53190b17f1bSmrg    dnl expand the accumulated commands and init code now:
53290b17f1bSmrg    [AC_CONFIG_COMMANDS([libtool],
53390b17f1bSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
53490b17f1bSmrg])#_LT_CONFIG_COMMANDS
53590b17f1bSmrg
53690b17f1bSmrg
53790b17f1bSmrg# Initialize.
53890b17f1bSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
53990b17f1bSmrg[
54090b17f1bSmrg
54190b17f1bSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
54290b17f1bSmrg# if CDPATH is set.
54390b17f1bSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
54490b17f1bSmrg
54590b17f1bSmrgsed_quote_subst='$sed_quote_subst'
54690b17f1bSmrgdouble_quote_subst='$double_quote_subst'
54790b17f1bSmrgdelay_variable_subst='$delay_variable_subst'
54890b17f1bSmrg_LT_CONFIG_STATUS_DECLARATIONS
54990b17f1bSmrgLTCC='$LTCC'
55090b17f1bSmrgLTCFLAGS='$LTCFLAGS'
55190b17f1bSmrgcompiler='$compiler_DEFAULT'
55290b17f1bSmrg
55390b17f1bSmrg# A function that is used when there is no print builtin or printf.
55490b17f1bSmrgfunc_fallback_echo ()
55590b17f1bSmrg{
55690b17f1bSmrg  eval 'cat <<_LTECHO_EOF
55790b17f1bSmrg\$[]1
55890b17f1bSmrg_LTECHO_EOF'
55990b17f1bSmrg}
56090b17f1bSmrg
56190b17f1bSmrg# Quote evaled strings.
56290b17f1bSmrgfor var in lt_decl_all_varnames([[ \
56390b17f1bSmrg]], lt_decl_quote_varnames); do
56490b17f1bSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
56590b17f1bSmrg    *[[\\\\\\\`\\"\\\$]]*)
566983b4bf2Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
5677e6fb56fSmrg      ;;
56890b17f1bSmrg    *)
56990b17f1bSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5707e6fb56fSmrg      ;;
5717e6fb56fSmrg    esac
57290b17f1bSmrgdone
5737e6fb56fSmrg
57490b17f1bSmrg# Double-quote double-evaled strings.
57590b17f1bSmrgfor var in lt_decl_all_varnames([[ \
57690b17f1bSmrg]], lt_decl_dquote_varnames); do
57790b17f1bSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
57890b17f1bSmrg    *[[\\\\\\\`\\"\\\$]]*)
579983b4bf2Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
5807e6fb56fSmrg      ;;
58190b17f1bSmrg    *)
58290b17f1bSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5837e6fb56fSmrg      ;;
5847e6fb56fSmrg    esac
58590b17f1bSmrgdone
5867e6fb56fSmrg
58790b17f1bSmrg_LT_OUTPUT_LIBTOOL_INIT
58890b17f1bSmrg])
5897e6fb56fSmrg
59090b17f1bSmrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
59190b17f1bSmrg# ------------------------------------
59290b17f1bSmrg# Generate a child script FILE with all initialization necessary to
59390b17f1bSmrg# reuse the environment learned by the parent script, and make the
59490b17f1bSmrg# file executable.  If COMMENT is supplied, it is inserted after the
595983b4bf2Smrg# `#!' sequence but before initialization text begins.  After this
59690b17f1bSmrg# macro, additional text can be appended to FILE to form the body of
59790b17f1bSmrg# the child script.  The macro ends with non-zero status if the
59890b17f1bSmrg# file could not be fully written (such as if the disk is full).
59990b17f1bSmrgm4_ifdef([AS_INIT_GENERATED],
60090b17f1bSmrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
60190b17f1bSmrg[m4_defun([_LT_GENERATED_FILE_INIT],
60290b17f1bSmrg[m4_require([AS_PREPARE])]dnl
60390b17f1bSmrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
60490b17f1bSmrg[lt_write_fail=0
60590b17f1bSmrgcat >$1 <<_ASEOF || lt_write_fail=1
60690b17f1bSmrg#! $SHELL
60790b17f1bSmrg# Generated by $as_me.
60890b17f1bSmrg$2
60990b17f1bSmrgSHELL=\${CONFIG_SHELL-$SHELL}
61090b17f1bSmrgexport SHELL
61190b17f1bSmrg_ASEOF
61290b17f1bSmrgcat >>$1 <<\_ASEOF || lt_write_fail=1
61390b17f1bSmrgAS_SHELL_SANITIZE
61490b17f1bSmrg_AS_PREPARE
61590b17f1bSmrgexec AS_MESSAGE_FD>&1
61690b17f1bSmrg_ASEOF
617983b4bf2Smrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
61890b17f1bSmrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
61990b17f1bSmrg
62090b17f1bSmrg# LT_OUTPUT
62190b17f1bSmrg# ---------
62290b17f1bSmrg# This macro allows early generation of the libtool script (before
62390b17f1bSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
62490b17f1bSmrg# tests.
62590b17f1bSmrgAC_DEFUN([LT_OUTPUT],
62690b17f1bSmrg[: ${CONFIG_LT=./config.lt}
62790b17f1bSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
62890b17f1bSmrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
62990b17f1bSmrg[# Run this file to recreate a libtool stub with the current configuration.])
63090b17f1bSmrg
63190b17f1bSmrgcat >>"$CONFIG_LT" <<\_LTEOF
63290b17f1bSmrglt_cl_silent=false
63390b17f1bSmrgexec AS_MESSAGE_LOG_FD>>config.log
63490b17f1bSmrg{
63590b17f1bSmrg  echo
63690b17f1bSmrg  AS_BOX([Running $as_me.])
63790b17f1bSmrg} >&AS_MESSAGE_LOG_FD
6387e6fb56fSmrg
63990b17f1bSmrglt_cl_help="\
640983b4bf2Smrg\`$as_me' creates a local libtool stub from the current configuration,
64190b17f1bSmrgfor use in further configure time tests before the real libtool is
64290b17f1bSmrggenerated.
6437e6fb56fSmrg
64490b17f1bSmrgUsage: $[0] [[OPTIONS]]
6457e6fb56fSmrg
64690b17f1bSmrg  -h, --help      print this help, then exit
64790b17f1bSmrg  -V, --version   print version number, then exit
64890b17f1bSmrg  -q, --quiet     do not print progress messages
64990b17f1bSmrg  -d, --debug     don't remove temporary files
6507e6fb56fSmrg
65190b17f1bSmrgReport bugs to <bug-libtool@gnu.org>."
6527e6fb56fSmrg
65390b17f1bSmrglt_cl_version="\
65490b17f1bSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
65590b17f1bSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
65690b17f1bSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
6577e6fb56fSmrg
65890b17f1bSmrgCopyright (C) 2011 Free Software Foundation, Inc.
65990b17f1bSmrgThis config.lt script is free software; the Free Software Foundation
66090b17f1bSmrggives unlimited permision to copy, distribute and modify it."
6617e6fb56fSmrg
662983b4bf2Smrgwhile test $[#] != 0
66390b17f1bSmrgdo
66490b17f1bSmrg  case $[1] in
66590b17f1bSmrg    --version | --v* | -V )
66690b17f1bSmrg      echo "$lt_cl_version"; exit 0 ;;
66790b17f1bSmrg    --help | --h* | -h )
66890b17f1bSmrg      echo "$lt_cl_help"; exit 0 ;;
66990b17f1bSmrg    --debug | --d* | -d )
67090b17f1bSmrg      debug=: ;;
67190b17f1bSmrg    --quiet | --q* | --silent | --s* | -q )
67290b17f1bSmrg      lt_cl_silent=: ;;
67390b17f1bSmrg
67490b17f1bSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
675983b4bf2SmrgTry \`$[0] --help' for more information.]) ;;
67690b17f1bSmrg
67790b17f1bSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
678983b4bf2SmrgTry \`$[0] --help' for more information.]) ;;
67990b17f1bSmrg  esac
68090b17f1bSmrg  shift
68190b17f1bSmrgdone
6827e6fb56fSmrg
68390b17f1bSmrgif $lt_cl_silent; then
68490b17f1bSmrg  exec AS_MESSAGE_FD>/dev/null
6857e6fb56fSmrgfi
68690b17f1bSmrg_LTEOF
68790b17f1bSmrg
68890b17f1bSmrgcat >>"$CONFIG_LT" <<_LTEOF
68990b17f1bSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
69090b17f1bSmrg_LTEOF
69190b17f1bSmrg
69290b17f1bSmrgcat >>"$CONFIG_LT" <<\_LTEOF
69390b17f1bSmrgAC_MSG_NOTICE([creating $ofile])
69490b17f1bSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
69590b17f1bSmrgAS_EXIT(0)
69690b17f1bSmrg_LTEOF
69790b17f1bSmrgchmod +x "$CONFIG_LT"
69890b17f1bSmrg
69990b17f1bSmrg# configure is writing to config.log, but config.lt does its own redirection,
70090b17f1bSmrg# appending to config.log, which fails on DOS, as config.log is still kept
70190b17f1bSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
70290b17f1bSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
70390b17f1bSmrglt_cl_success=:
704983b4bf2Smrgtest "$silent" = yes &&
70590b17f1bSmrg  lt_config_lt_args="$lt_config_lt_args --quiet"
70690b17f1bSmrgexec AS_MESSAGE_LOG_FD>/dev/null
70790b17f1bSmrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
70890b17f1bSmrgexec AS_MESSAGE_LOG_FD>>config.log
70990b17f1bSmrg$lt_cl_success || AS_EXIT(1)
71090b17f1bSmrg])# LT_OUTPUT
71190b17f1bSmrg
71290b17f1bSmrg
71390b17f1bSmrg# _LT_CONFIG(TAG)
71490b17f1bSmrg# ---------------
71590b17f1bSmrg# If TAG is the built-in tag, create an initial libtool script with a
71690b17f1bSmrg# default configuration from the untagged config vars.  Otherwise add code
71790b17f1bSmrg# to config.status for appending the configuration named by TAG from the
71890b17f1bSmrg# matching tagged config vars.
71990b17f1bSmrgm4_defun([_LT_CONFIG],
72090b17f1bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
72190b17f1bSmrg_LT_CONFIG_SAVE_COMMANDS([
72290b17f1bSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
72390b17f1bSmrg  m4_if(_LT_TAG, [C], [
724983b4bf2Smrg    # See if we are running on zsh, and set the options which allow our
72590b17f1bSmrg    # commands through without removal of \ escapes.
726983b4bf2Smrg    if test -n "${ZSH_VERSION+set}" ; then
72790b17f1bSmrg      setopt NO_GLOB_SUBST
72890b17f1bSmrg    fi
7297e6fb56fSmrg
730983b4bf2Smrg    cfgfile="${ofile}T"
73190b17f1bSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
73290b17f1bSmrg    $RM "$cfgfile"
7337e6fb56fSmrg
73490b17f1bSmrg    cat <<_LT_EOF >> "$cfgfile"
73590b17f1bSmrg#! $SHELL
736983b4bf2Smrg
737983b4bf2Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
738983b4bf2Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
73990b17f1bSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
74090b17f1bSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
741983b4bf2Smrg#
74290b17f1bSmrg_LT_COPYING
74390b17f1bSmrg_LT_LIBTOOL_TAGS
7447e6fb56fSmrg
74590b17f1bSmrg# ### BEGIN LIBTOOL CONFIG
74690b17f1bSmrg_LT_LIBTOOL_CONFIG_VARS
74790b17f1bSmrg_LT_LIBTOOL_TAG_VARS
74890b17f1bSmrg# ### END LIBTOOL CONFIG
7497e6fb56fSmrg
75090b17f1bSmrg_LT_EOF
7517e6fb56fSmrg
75290b17f1bSmrg  case $host_os in
75390b17f1bSmrg  aix3*)
75490b17f1bSmrg    cat <<\_LT_EOF >> "$cfgfile"
75590b17f1bSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
75690b17f1bSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
75790b17f1bSmrg# vanish in a puff of smoke.
758983b4bf2Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
75990b17f1bSmrg  COLLECT_NAMES=
76090b17f1bSmrg  export COLLECT_NAMES
76190b17f1bSmrgfi
76290b17f1bSmrg_LT_EOF
7637e6fb56fSmrg    ;;
76490b17f1bSmrg  esac
7657e6fb56fSmrg
76690b17f1bSmrg  _LT_PROG_LTMAIN
7677e6fb56fSmrg
76890b17f1bSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
76990b17f1bSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
77090b17f1bSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
77190b17f1bSmrg  # is reportedly fixed, but why not run on old versions too?
77290b17f1bSmrg  sed '$q' "$ltmain" >> "$cfgfile" \
77390b17f1bSmrg     || (rm -f "$cfgfile"; exit 1)
7747e6fb56fSmrg
775983b4bf2Smrg  _LT_PROG_REPLACE_SHELLFNS
776983b4bf2Smrg
77790b17f1bSmrg   mv -f "$cfgfile" "$ofile" ||
77890b17f1bSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
77990b17f1bSmrg  chmod +x "$ofile"
78090b17f1bSmrg],
78190b17f1bSmrg[cat <<_LT_EOF >> "$ofile"
78290b17f1bSmrg
78390b17f1bSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
78490b17f1bSmrgdnl in a comment (ie after a #).
78590b17f1bSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
78690b17f1bSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
78790b17f1bSmrg# ### END LIBTOOL TAG CONFIG: $1
78890b17f1bSmrg_LT_EOF
78990b17f1bSmrg])dnl /m4_if
79090b17f1bSmrg],
79190b17f1bSmrg[m4_if([$1], [], [
79290b17f1bSmrg    PACKAGE='$PACKAGE'
79390b17f1bSmrg    VERSION='$VERSION'
794983b4bf2Smrg    TIMESTAMP='$TIMESTAMP'
79590b17f1bSmrg    RM='$RM'
79690b17f1bSmrg    ofile='$ofile'], [])
79790b17f1bSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
79890b17f1bSmrg])# _LT_CONFIG
7997e6fb56fSmrg
8007e6fb56fSmrg
80190b17f1bSmrg# LT_SUPPORTED_TAG(TAG)
80290b17f1bSmrg# ---------------------
80390b17f1bSmrg# Trace this macro to discover what tags are supported by the libtool
80490b17f1bSmrg# --tag option, using:
80590b17f1bSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
80690b17f1bSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
80790b17f1bSmrg
80890b17f1bSmrg
80990b17f1bSmrg# C support is built-in for now
81090b17f1bSmrgm4_define([_LT_LANG_C_enabled], [])
81190b17f1bSmrgm4_define([_LT_TAGS], [])
81290b17f1bSmrg
81390b17f1bSmrg
81490b17f1bSmrg# LT_LANG(LANG)
81590b17f1bSmrg# -------------
81690b17f1bSmrg# Enable libtool support for the given language if not already enabled.
81790b17f1bSmrgAC_DEFUN([LT_LANG],
81890b17f1bSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
81990b17f1bSmrgm4_case([$1],
82090b17f1bSmrg  [C],			[_LT_LANG(C)],
82190b17f1bSmrg  [C++],		[_LT_LANG(CXX)],
82290b17f1bSmrg  [Go],			[_LT_LANG(GO)],
82390b17f1bSmrg  [Java],		[_LT_LANG(GCJ)],
82490b17f1bSmrg  [Fortran 77],		[_LT_LANG(F77)],
82590b17f1bSmrg  [Fortran],		[_LT_LANG(FC)],
82690b17f1bSmrg  [Windows Resource],	[_LT_LANG(RC)],
82790b17f1bSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
82890b17f1bSmrg    [_LT_LANG($1)],
82990b17f1bSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
83090b17f1bSmrg])# LT_LANG
83190b17f1bSmrg
83290b17f1bSmrg
83390b17f1bSmrg# _LT_LANG(LANGNAME)
8347e6fb56fSmrg# ------------------
83590b17f1bSmrgm4_defun([_LT_LANG],
83690b17f1bSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
83790b17f1bSmrg  [LT_SUPPORTED_TAG([$1])dnl
83890b17f1bSmrg  m4_append([_LT_TAGS], [$1 ])dnl
83990b17f1bSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
84090b17f1bSmrg  _LT_LANG_$1_CONFIG($1)])dnl
84190b17f1bSmrg])# _LT_LANG
8427e6fb56fSmrg
8437e6fb56fSmrg
84490b17f1bSmrgm4_ifndef([AC_PROG_GO], [
84590b17f1bSmrg# NOTE: This macro has been submitted for inclusion into   #
84690b17f1bSmrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
84790b17f1bSmrg#  a released version of Autoconf we should remove this    #
84890b17f1bSmrg#  macro and use it instead.                               #
84990b17f1bSmrgm4_defun([AC_PROG_GO],
85090b17f1bSmrg[AC_LANG_PUSH(Go)dnl
85190b17f1bSmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
85290b17f1bSmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
85390b17f1bSmrg_AC_ARG_VAR_LDFLAGS()dnl
85490b17f1bSmrgAC_CHECK_TOOL(GOC, gccgo)
85590b17f1bSmrgif test -z "$GOC"; then
85690b17f1bSmrg  if test -n "$ac_tool_prefix"; then
85790b17f1bSmrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
85890b17f1bSmrg  fi
85990b17f1bSmrgfi
86090b17f1bSmrgif test -z "$GOC"; then
86190b17f1bSmrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
86290b17f1bSmrgfi
86390b17f1bSmrg])#m4_defun
86490b17f1bSmrg])#m4_ifndef
8657e6fb56fSmrg
8667e6fb56fSmrg
86790b17f1bSmrg# _LT_LANG_DEFAULT_CONFIG
86890b17f1bSmrg# -----------------------
86990b17f1bSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
87090b17f1bSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
87190b17f1bSmrg  [LT_LANG(CXX)],
87290b17f1bSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
87390b17f1bSmrg
87490b17f1bSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
87590b17f1bSmrg  [LT_LANG(F77)],
87690b17f1bSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
87790b17f1bSmrg
87890b17f1bSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
87990b17f1bSmrg  [LT_LANG(FC)],
88090b17f1bSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
88190b17f1bSmrg
88290b17f1bSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
88390b17f1bSmrgdnl pulling things in needlessly.
88490b17f1bSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
88590b17f1bSmrg  [LT_LANG(GCJ)],
88690b17f1bSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
88790b17f1bSmrg    [LT_LANG(GCJ)],
88890b17f1bSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
88990b17f1bSmrg      [LT_LANG(GCJ)],
89090b17f1bSmrg      [m4_ifdef([AC_PROG_GCJ],
89190b17f1bSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
89290b17f1bSmrg       m4_ifdef([A][M_PROG_GCJ],
89390b17f1bSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
89490b17f1bSmrg       m4_ifdef([LT_PROG_GCJ],
89590b17f1bSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
89690b17f1bSmrg
89790b17f1bSmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
89890b17f1bSmrg  [LT_LANG(GO)],
89990b17f1bSmrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
90090b17f1bSmrg
90190b17f1bSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
90290b17f1bSmrg  [LT_LANG(RC)],
90390b17f1bSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
90490b17f1bSmrg])# _LT_LANG_DEFAULT_CONFIG
90590b17f1bSmrg
90690b17f1bSmrg# Obsolete macros:
90790b17f1bSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
90890b17f1bSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
90990b17f1bSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
91090b17f1bSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
91190b17f1bSmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
91290b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
91390b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
91490b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
91590b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
91690b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
91790b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
91890b17f1bSmrg
91990b17f1bSmrg
92090b17f1bSmrg# _LT_TAG_COMPILER
92190b17f1bSmrg# ----------------
92290b17f1bSmrgm4_defun([_LT_TAG_COMPILER],
92390b17f1bSmrg[AC_REQUIRE([AC_PROG_CC])dnl
9247e6fb56fSmrg
92590b17f1bSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
92690b17f1bSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
92790b17f1bSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
92890b17f1bSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
9297e6fb56fSmrg
93090b17f1bSmrg# If no C compiler was specified, use CC.
93190b17f1bSmrgLTCC=${LTCC-"$CC"}
9327e6fb56fSmrg
93390b17f1bSmrg# If no C compiler flags were specified, use CFLAGS.
93490b17f1bSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
9357e6fb56fSmrg
93690b17f1bSmrg# Allow CC to be a program name with arguments.
93790b17f1bSmrgcompiler=$CC
93890b17f1bSmrg])# _LT_TAG_COMPILER
9397e6fb56fSmrg
9407e6fb56fSmrg
94190b17f1bSmrg# _LT_COMPILER_BOILERPLATE
94290b17f1bSmrg# ------------------------
94390b17f1bSmrg# Check for compiler boilerplate output or warnings with
94490b17f1bSmrg# the simple compiler test code.
94590b17f1bSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
94690b17f1bSmrg[m4_require([_LT_DECL_SED])dnl
94790b17f1bSmrgac_outfile=conftest.$ac_objext
94890b17f1bSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
94990b17f1bSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
95090b17f1bSmrg_lt_compiler_boilerplate=`cat conftest.err`
95190b17f1bSmrg$RM conftest*
95290b17f1bSmrg])# _LT_COMPILER_BOILERPLATE
9537e6fb56fSmrg
9547e6fb56fSmrg
95590b17f1bSmrg# _LT_LINKER_BOILERPLATE
9567e6fb56fSmrg# ----------------------
95790b17f1bSmrg# Check for linker boilerplate output or warnings with
95890b17f1bSmrg# the simple link test code.
95990b17f1bSmrgm4_defun([_LT_LINKER_BOILERPLATE],
96090b17f1bSmrg[m4_require([_LT_DECL_SED])dnl
96190b17f1bSmrgac_outfile=conftest.$ac_objext
96290b17f1bSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
96390b17f1bSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
96490b17f1bSmrg_lt_linker_boilerplate=`cat conftest.err`
96590b17f1bSmrg$RM -r conftest*
96690b17f1bSmrg])# _LT_LINKER_BOILERPLATE
9677e6fb56fSmrg
96890b17f1bSmrg# _LT_REQUIRED_DARWIN_CHECKS
96990b17f1bSmrg# -------------------------
97090b17f1bSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
9717e6fb56fSmrg  case $host_os in
97290b17f1bSmrg    rhapsody* | darwin*)
97390b17f1bSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
97490b17f1bSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
97590b17f1bSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
97690b17f1bSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
97790b17f1bSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
97890b17f1bSmrg    _LT_DECL([], [DSYMUTIL], [1],
97990b17f1bSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
98090b17f1bSmrg    _LT_DECL([], [NMEDIT], [1],
98190b17f1bSmrg      [Tool to change global to local symbols on Mac OS X])
98290b17f1bSmrg    _LT_DECL([], [LIPO], [1],
98390b17f1bSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
98490b17f1bSmrg    _LT_DECL([], [OTOOL], [1],
98590b17f1bSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
98690b17f1bSmrg    _LT_DECL([], [OTOOL64], [1],
98790b17f1bSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
9887e6fb56fSmrg
98990b17f1bSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
99090b17f1bSmrg      [lt_cv_apple_cc_single_mod=no
991983b4bf2Smrg      if test -z "${LT_MULTI_MODULE}"; then
99290b17f1bSmrg	# By default we will add the -single_module flag. You can override
99390b17f1bSmrg	# by either setting the environment variable LT_MULTI_MODULE
99490b17f1bSmrg	# non-empty at configure time, or by adding -multi_module to the
99590b17f1bSmrg	# link flags.
99690b17f1bSmrg	rm -rf libconftest.dylib*
99790b17f1bSmrg	echo "int foo(void){return 1;}" > conftest.c
99890b17f1bSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
99990b17f1bSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
100090b17f1bSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
100190b17f1bSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
100290b17f1bSmrg        _lt_result=$?
100390b17f1bSmrg	# If there is a non-empty error log, and "single_module"
100490b17f1bSmrg	# appears in it, assume the flag caused a linker warning
100590b17f1bSmrg        if test -s conftest.err && $GREP single_module conftest.err; then
100690b17f1bSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
100790b17f1bSmrg	# Otherwise, if the output was created with a 0 exit code from
100890b17f1bSmrg	# the compiler, it worked.
1009983b4bf2Smrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
101090b17f1bSmrg	  lt_cv_apple_cc_single_mod=yes
101190b17f1bSmrg	else
101290b17f1bSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
101390b17f1bSmrg	fi
101490b17f1bSmrg	rm -rf libconftest.dylib*
101590b17f1bSmrg	rm -f conftest.*
101690b17f1bSmrg      fi])
10177e6fb56fSmrg
101890b17f1bSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
101990b17f1bSmrg      [lt_cv_ld_exported_symbols_list],
102090b17f1bSmrg      [lt_cv_ld_exported_symbols_list=no
102190b17f1bSmrg      save_LDFLAGS=$LDFLAGS
102290b17f1bSmrg      echo "_main" > conftest.sym
102390b17f1bSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
102490b17f1bSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
102590b17f1bSmrg	[lt_cv_ld_exported_symbols_list=yes],
102690b17f1bSmrg	[lt_cv_ld_exported_symbols_list=no])
1027983b4bf2Smrg	LDFLAGS="$save_LDFLAGS"
10287e6fb56fSmrg    ])
10297e6fb56fSmrg
103090b17f1bSmrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
103190b17f1bSmrg      [lt_cv_ld_force_load=no
103290b17f1bSmrg      cat > conftest.c << _LT_EOF
103390b17f1bSmrgint forced_loaded() { return 2;}
103490b17f1bSmrg_LT_EOF
103590b17f1bSmrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
103690b17f1bSmrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
103790b17f1bSmrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
103890b17f1bSmrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
103990b17f1bSmrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
104090b17f1bSmrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
104190b17f1bSmrg      cat > conftest.c << _LT_EOF
104290b17f1bSmrgint main() { return 0;}
104390b17f1bSmrg_LT_EOF
104490b17f1bSmrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
104590b17f1bSmrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
104690b17f1bSmrg      _lt_result=$?
104790b17f1bSmrg      if test -s conftest.err && $GREP force_load conftest.err; then
104890b17f1bSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1049983b4bf2Smrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
105090b17f1bSmrg	lt_cv_ld_force_load=yes
105190b17f1bSmrg      else
105290b17f1bSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
105390b17f1bSmrg      fi
105490b17f1bSmrg        rm -f conftest.err libconftest.a conftest conftest.c
105590b17f1bSmrg        rm -rf conftest.dSYM
105690b17f1bSmrg    ])
105790b17f1bSmrg    case $host_os in
105890b17f1bSmrg    rhapsody* | darwin1.[[012]])
1059983b4bf2Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
106090b17f1bSmrg    darwin1.*)
1061983b4bf2Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
106290b17f1bSmrg    darwin*) # darwin 5.x on
106390b17f1bSmrg      # if running on 10.5 or later, the deployment target defaults
106490b17f1bSmrg      # to the OS version, if on x86, and 10.4, the deployment
106590b17f1bSmrg      # target defaults to 10.4. Don't you love it?
106690b17f1bSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
106790b17f1bSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1068983b4bf2Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1069983b4bf2Smrg	10.[[012]]*)
1070983b4bf2Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
107190b17f1bSmrg	10.*)
1072983b4bf2Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
107390b17f1bSmrg      esac
107490b17f1bSmrg    ;;
107590b17f1bSmrg  esac
1076983b4bf2Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
107790b17f1bSmrg      _lt_dar_single_mod='$single_module'
107890b17f1bSmrg    fi
1079983b4bf2Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
1080983b4bf2Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
108190b17f1bSmrg    else
1082983b4bf2Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
108390b17f1bSmrg    fi
1084983b4bf2Smrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
108590b17f1bSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
108690b17f1bSmrg    else
108790b17f1bSmrg      _lt_dsymutil=
108890b17f1bSmrg    fi
10897e6fb56fSmrg    ;;
10907e6fb56fSmrg  esac
109190b17f1bSmrg])
10927e6fb56fSmrg
109390b17f1bSmrg
109490b17f1bSmrg# _LT_DARWIN_LINKER_FEATURES([TAG])
109590b17f1bSmrg# ---------------------------------
109690b17f1bSmrg# Checks for linker and compiler features on darwin
109790b17f1bSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
109890b17f1bSmrg[
109990b17f1bSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
110090b17f1bSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
110190b17f1bSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
110290b17f1bSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
110390b17f1bSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1104983b4bf2Smrg  if test "$lt_cv_ld_force_load" = "yes"; then
1105983b4bf2Smrg    _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\"`'
110690b17f1bSmrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
110790b17f1bSmrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
11087e6fb56fSmrg  else
110990b17f1bSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
11107e6fb56fSmrg  fi
111190b17f1bSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1112983b4bf2Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
111390b17f1bSmrg  case $cc_basename in
1114983b4bf2Smrg     ifort*) _lt_dar_can_shared=yes ;;
111590b17f1bSmrg     *) _lt_dar_can_shared=$GCC ;;
111690b17f1bSmrg  esac
1117983b4bf2Smrg  if test "$_lt_dar_can_shared" = "yes"; then
111890b17f1bSmrg    output_verbose_link_cmd=func_echo_all
1119983b4bf2Smrg    _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}"
1120983b4bf2Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1121983b4bf2Smrg    _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}"
1122983b4bf2Smrg    _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}"
112390b17f1bSmrg    m4_if([$1], [CXX],
1124983b4bf2Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1125983b4bf2Smrg      _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}"
1126983b4bf2Smrg      _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}"
112790b17f1bSmrg    fi
112890b17f1bSmrg],[])
112990b17f1bSmrg  else
113090b17f1bSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
113190b17f1bSmrg  fi
113290b17f1bSmrg])
11337e6fb56fSmrg
113490b17f1bSmrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
113590b17f1bSmrg# ----------------------------------
113690b17f1bSmrg# Links a minimal program and checks the executable
113790b17f1bSmrg# for the system default hardcoded library path. In most cases,
113890b17f1bSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
113990b17f1bSmrg# the location of the communication and MPI libs are included too.
114090b17f1bSmrg# If we don't find anything, use the default library path according
114190b17f1bSmrg# to the aix ld manual.
114290b17f1bSmrg# Store the results from the different compilers for each TAGNAME.
114390b17f1bSmrg# Allow to override them for all tags through lt_cv_aix_libpath.
114490b17f1bSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
114590b17f1bSmrg[m4_require([_LT_DECL_SED])dnl
1146983b4bf2Smrgif test "${lt_cv_aix_libpath+set}" = set; then
114790b17f1bSmrg  aix_libpath=$lt_cv_aix_libpath
114890b17f1bSmrgelse
114990b17f1bSmrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
115090b17f1bSmrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
115190b17f1bSmrg  lt_aix_libpath_sed='[
115290b17f1bSmrg      /Import File Strings/,/^$/ {
115390b17f1bSmrg	  /^0/ {
115490b17f1bSmrg	      s/^0  *\([^ ]*\) *$/\1/
115590b17f1bSmrg	      p
115690b17f1bSmrg	  }
115790b17f1bSmrg      }]'
115890b17f1bSmrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
115990b17f1bSmrg  # Check for a 64-bit object if we didn't find anything.
116090b17f1bSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
116190b17f1bSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
116290b17f1bSmrg  fi],[])
116390b17f1bSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1164983b4bf2Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
116590b17f1bSmrg  fi
116690b17f1bSmrg  ])
116790b17f1bSmrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
116890b17f1bSmrgfi
116990b17f1bSmrg])# _LT_SYS_MODULE_PATH_AIX
11707e6fb56fSmrg
11717e6fb56fSmrg
117290b17f1bSmrg# _LT_SHELL_INIT(ARG)
117390b17f1bSmrg# -------------------
117490b17f1bSmrgm4_define([_LT_SHELL_INIT],
117590b17f1bSmrg[m4_divert_text([M4SH-INIT], [$1
117690b17f1bSmrg])])# _LT_SHELL_INIT
11777e6fb56fSmrg
117890b17f1bSmrg
117990b17f1bSmrg
118090b17f1bSmrg# _LT_PROG_ECHO_BACKSLASH
118190b17f1bSmrg# -----------------------
118290b17f1bSmrg# Find how we can fake an echo command that does not interpret backslash.
118390b17f1bSmrg# In particular, with Autoconf 2.60 or later we add some code to the start
1184983b4bf2Smrg# of the generated configure script which will find a shell with a builtin
1185983b4bf2Smrg# printf (which we can use as an echo command).
118690b17f1bSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
118790b17f1bSmrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
118890b17f1bSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
118990b17f1bSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
119090b17f1bSmrg
119190b17f1bSmrgAC_MSG_CHECKING([how to print strings])
119290b17f1bSmrg# Test print first, because it will be a builtin if present.
119390b17f1bSmrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
119490b17f1bSmrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
119590b17f1bSmrg  ECHO='print -r --'
119690b17f1bSmrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
119790b17f1bSmrg  ECHO='printf %s\n'
119890b17f1bSmrgelse
119990b17f1bSmrg  # Use this function as a fallback that always works.
120090b17f1bSmrg  func_fallback_echo ()
120190b17f1bSmrg  {
120290b17f1bSmrg    eval 'cat <<_LTECHO_EOF
120390b17f1bSmrg$[]1
120490b17f1bSmrg_LTECHO_EOF'
120590b17f1bSmrg  }
120690b17f1bSmrg  ECHO='func_fallback_echo'
120790b17f1bSmrgfi
120890b17f1bSmrg
120990b17f1bSmrg# func_echo_all arg...
121090b17f1bSmrg# Invoke $ECHO with all args, space-separated.
121190b17f1bSmrgfunc_echo_all ()
121290b17f1bSmrg{
1213983b4bf2Smrg    $ECHO "$*" 
121490b17f1bSmrg}
121590b17f1bSmrg
1216983b4bf2Smrgcase "$ECHO" in
121790b17f1bSmrg  printf*) AC_MSG_RESULT([printf]) ;;
121890b17f1bSmrg  print*) AC_MSG_RESULT([print -r]) ;;
121990b17f1bSmrg  *) AC_MSG_RESULT([cat]) ;;
122090b17f1bSmrgesac
122190b17f1bSmrg
122290b17f1bSmrgm4_ifdef([_AS_DETECT_SUGGESTED],
122390b17f1bSmrg[_AS_DETECT_SUGGESTED([
122490b17f1bSmrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
122590b17f1bSmrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
122690b17f1bSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
122790b17f1bSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
122890b17f1bSmrg    PATH=/empty FPATH=/empty; export PATH FPATH
122990b17f1bSmrg    test "X`printf %s $ECHO`" = "X$ECHO" \
123090b17f1bSmrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
123190b17f1bSmrg
123290b17f1bSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
123390b17f1bSmrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
123490b17f1bSmrg])# _LT_PROG_ECHO_BACKSLASH
123590b17f1bSmrg
123690b17f1bSmrg
123790b17f1bSmrg# _LT_WITH_SYSROOT
123890b17f1bSmrg# ----------------
123990b17f1bSmrgAC_DEFUN([_LT_WITH_SYSROOT],
124090b17f1bSmrg[AC_MSG_CHECKING([for sysroot])
124190b17f1bSmrgAC_ARG_WITH([sysroot],
1242983b4bf2Smrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
1243983b4bf2Smrg                        (or the compiler's sysroot if not specified).],
124490b17f1bSmrg[], [with_sysroot=no])
124590b17f1bSmrg
124690b17f1bSmrgdnl lt_sysroot will always be passed unquoted.  We quote it here
124790b17f1bSmrgdnl in case the user passed a directory name.
124890b17f1bSmrglt_sysroot=
1249983b4bf2Smrgcase ${with_sysroot} in #(
125090b17f1bSmrg yes)
1251983b4bf2Smrg   if test "$GCC" = yes; then
125290b17f1bSmrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
125390b17f1bSmrg   fi
125490b17f1bSmrg   ;; #(
125590b17f1bSmrg /*)
125690b17f1bSmrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
125790b17f1bSmrg   ;; #(
125890b17f1bSmrg no|'')
125990b17f1bSmrg   ;; #(
126090b17f1bSmrg *)
1261983b4bf2Smrg   AC_MSG_RESULT([${with_sysroot}])
126290b17f1bSmrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
126390b17f1bSmrg   ;;
126490b17f1bSmrgesac
126590b17f1bSmrg
126690b17f1bSmrg AC_MSG_RESULT([${lt_sysroot:-no}])
126790b17f1bSmrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1268983b4bf2Smrg[dependent libraries, and in which our libraries should be installed.])])
126990b17f1bSmrg
127090b17f1bSmrg# _LT_ENABLE_LOCK
127190b17f1bSmrg# ---------------
127290b17f1bSmrgm4_defun([_LT_ENABLE_LOCK],
127390b17f1bSmrg[AC_ARG_ENABLE([libtool-lock],
127490b17f1bSmrg  [AS_HELP_STRING([--disable-libtool-lock],
127590b17f1bSmrg    [avoid locking (might break parallel builds)])])
1276983b4bf2Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
127790b17f1bSmrg
127890b17f1bSmrg# Some flags need to be propagated to the compiler or linker for good
127990b17f1bSmrg# libtool support.
128090b17f1bSmrgcase $host in
128190b17f1bSmrgia64-*-hpux*)
1282983b4bf2Smrg  # Find out which ABI we are using.
128390b17f1bSmrg  echo 'int i;' > conftest.$ac_ext
128490b17f1bSmrg  if AC_TRY_EVAL(ac_compile); then
128590b17f1bSmrg    case `/usr/bin/file conftest.$ac_objext` in
128690b17f1bSmrg      *ELF-32*)
1287983b4bf2Smrg	HPUX_IA64_MODE="32"
128890b17f1bSmrg	;;
128990b17f1bSmrg      *ELF-64*)
1290983b4bf2Smrg	HPUX_IA64_MODE="64"
129190b17f1bSmrg	;;
129290b17f1bSmrg    esac
129390b17f1bSmrg  fi
129490b17f1bSmrg  rm -rf conftest*
129590b17f1bSmrg  ;;
129690b17f1bSmrg*-*-irix6*)
1297983b4bf2Smrg  # Find out which ABI we are using.
129890b17f1bSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
129990b17f1bSmrg  if AC_TRY_EVAL(ac_compile); then
1300983b4bf2Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
130190b17f1bSmrg      case `/usr/bin/file conftest.$ac_objext` in
130290b17f1bSmrg	*32-bit*)
130390b17f1bSmrg	  LD="${LD-ld} -melf32bsmip"
130490b17f1bSmrg	  ;;
130590b17f1bSmrg	*N32*)
130690b17f1bSmrg	  LD="${LD-ld} -melf32bmipn32"
130790b17f1bSmrg	  ;;
130890b17f1bSmrg	*64-bit*)
130990b17f1bSmrg	  LD="${LD-ld} -melf64bmip"
131090b17f1bSmrg	;;
131190b17f1bSmrg      esac
131290b17f1bSmrg    else
131390b17f1bSmrg      case `/usr/bin/file conftest.$ac_objext` in
131490b17f1bSmrg	*32-bit*)
131590b17f1bSmrg	  LD="${LD-ld} -32"
131690b17f1bSmrg	  ;;
131790b17f1bSmrg	*N32*)
131890b17f1bSmrg	  LD="${LD-ld} -n32"
131990b17f1bSmrg	  ;;
132090b17f1bSmrg	*64-bit*)
132190b17f1bSmrg	  LD="${LD-ld} -64"
132290b17f1bSmrg	  ;;
132390b17f1bSmrg      esac
13247e6fb56fSmrg    fi
132590b17f1bSmrg  fi
132690b17f1bSmrg  rm -rf conftest*
132790b17f1bSmrg  ;;
13287e6fb56fSmrg
1329983b4bf2Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
133090b17f1bSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1331983b4bf2Smrg  # Find out which ABI we are using.
133290b17f1bSmrg  echo 'int i;' > conftest.$ac_ext
133390b17f1bSmrg  if AC_TRY_EVAL(ac_compile); then
133490b17f1bSmrg    case `/usr/bin/file conftest.o` in
133590b17f1bSmrg      *32-bit*)
133690b17f1bSmrg	case $host in
133790b17f1bSmrg	  x86_64-*kfreebsd*-gnu)
133890b17f1bSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
133990b17f1bSmrg	    ;;
134090b17f1bSmrg	  x86_64-*linux*)
1341983b4bf2Smrg	    LD="${LD-ld} -m elf_i386"
1342963d66acSmrg	    ;;
1343983b4bf2Smrg	  ppc64-*linux*|powerpc64-*linux*)
134490b17f1bSmrg	    LD="${LD-ld} -m elf32ppclinux"
134590b17f1bSmrg	    ;;
134690b17f1bSmrg	  s390x-*linux*)
134790b17f1bSmrg	    LD="${LD-ld} -m elf_s390"
134890b17f1bSmrg	    ;;
134990b17f1bSmrg	  sparc64-*linux*)
135090b17f1bSmrg	    LD="${LD-ld} -m elf32_sparc"
135190b17f1bSmrg	    ;;
135290b17f1bSmrg	esac
135390b17f1bSmrg	;;
135490b17f1bSmrg      *64-bit*)
135590b17f1bSmrg	case $host in
135690b17f1bSmrg	  x86_64-*kfreebsd*-gnu)
135790b17f1bSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
135890b17f1bSmrg	    ;;
135990b17f1bSmrg	  x86_64-*linux*)
136090b17f1bSmrg	    LD="${LD-ld} -m elf_x86_64"
136190b17f1bSmrg	    ;;
1362983b4bf2Smrg	  ppc*-*linux*|powerpc*-*linux*)
136390b17f1bSmrg	    LD="${LD-ld} -m elf64ppc"
136490b17f1bSmrg	    ;;
136590b17f1bSmrg	  s390*-*linux*|s390*-*tpf*)
136690b17f1bSmrg	    LD="${LD-ld} -m elf64_s390"
136790b17f1bSmrg	    ;;
136890b17f1bSmrg	  sparc*-*linux*)
136990b17f1bSmrg	    LD="${LD-ld} -m elf64_sparc"
137090b17f1bSmrg	    ;;
137190b17f1bSmrg	esac
137290b17f1bSmrg	;;
137390b17f1bSmrg    esac
137490b17f1bSmrg  fi
137590b17f1bSmrg  rm -rf conftest*
137690b17f1bSmrg  ;;
13777e6fb56fSmrg
137890b17f1bSmrg*-*-sco3.2v5*)
137990b17f1bSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1380983b4bf2Smrg  SAVE_CFLAGS="$CFLAGS"
138190b17f1bSmrg  CFLAGS="$CFLAGS -belf"
138290b17f1bSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
138390b17f1bSmrg    [AC_LANG_PUSH(C)
138490b17f1bSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
138590b17f1bSmrg     AC_LANG_POP])
1386983b4bf2Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
138790b17f1bSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1388983b4bf2Smrg    CFLAGS="$SAVE_CFLAGS"
138990b17f1bSmrg  fi
139090b17f1bSmrg  ;;
139190b17f1bSmrg*-*solaris*)
1392983b4bf2Smrg  # Find out which ABI we are using.
139390b17f1bSmrg  echo 'int i;' > conftest.$ac_ext
139490b17f1bSmrg  if AC_TRY_EVAL(ac_compile); then
139590b17f1bSmrg    case `/usr/bin/file conftest.o` in
139690b17f1bSmrg    *64-bit*)
139790b17f1bSmrg      case $lt_cv_prog_gnu_ld in
139890b17f1bSmrg      yes*)
139990b17f1bSmrg        case $host in
1400983b4bf2Smrg        i?86-*-solaris*)
140190b17f1bSmrg          LD="${LD-ld} -m elf_x86_64"
140290b17f1bSmrg          ;;
140390b17f1bSmrg        sparc*-*-solaris*)
140490b17f1bSmrg          LD="${LD-ld} -m elf64_sparc"
140590b17f1bSmrg          ;;
140690b17f1bSmrg        esac
140790b17f1bSmrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
140890b17f1bSmrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1409983b4bf2Smrg          LD="${LD-ld}_sol2"
141090b17f1bSmrg        fi
141190b17f1bSmrg        ;;
141290b17f1bSmrg      *)
141390b17f1bSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
141490b17f1bSmrg	  LD="${LD-ld} -64"
141590b17f1bSmrg	fi
141690b17f1bSmrg	;;
141790b17f1bSmrg      esac
141890b17f1bSmrg      ;;
141990b17f1bSmrg    esac
142090b17f1bSmrg  fi
142190b17f1bSmrg  rm -rf conftest*
142290b17f1bSmrg  ;;
142390b17f1bSmrgesac
14247e6fb56fSmrg
1425983b4bf2Smrgneed_locks="$enable_libtool_lock"
142690b17f1bSmrg])# _LT_ENABLE_LOCK
142790b17f1bSmrg
142890b17f1bSmrg
142990b17f1bSmrg# _LT_PROG_AR
143090b17f1bSmrg# -----------
143190b17f1bSmrgm4_defun([_LT_PROG_AR],
143290b17f1bSmrg[AC_CHECK_TOOLS(AR, [ar], false)
143390b17f1bSmrg: ${AR=ar}
143490b17f1bSmrg: ${AR_FLAGS=cru}
143590b17f1bSmrg_LT_DECL([], [AR], [1], [The archiver])
143690b17f1bSmrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
143790b17f1bSmrg
143890b17f1bSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
143990b17f1bSmrg  [lt_cv_ar_at_file=no
144090b17f1bSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
144190b17f1bSmrg     [echo conftest.$ac_objext > conftest.lst
144290b17f1bSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
144390b17f1bSmrg      AC_TRY_EVAL([lt_ar_try])
1444983b4bf2Smrg      if test "$ac_status" -eq 0; then
144590b17f1bSmrg	# Ensure the archiver fails upon bogus file names.
144690b17f1bSmrg	rm -f conftest.$ac_objext libconftest.a
144790b17f1bSmrg	AC_TRY_EVAL([lt_ar_try])
1448983b4bf2Smrg	if test "$ac_status" -ne 0; then
144990b17f1bSmrg          lt_cv_ar_at_file=@
145090b17f1bSmrg        fi
145190b17f1bSmrg      fi
145290b17f1bSmrg      rm -f conftest.* libconftest.a
145390b17f1bSmrg     ])
145490b17f1bSmrg  ])
145590b17f1bSmrg
1456983b4bf2Smrgif test "x$lt_cv_ar_at_file" = xno; then
145790b17f1bSmrg  archiver_list_spec=
145890b17f1bSmrgelse
145990b17f1bSmrg  archiver_list_spec=$lt_cv_ar_at_file
146090b17f1bSmrgfi
146190b17f1bSmrg_LT_DECL([], [archiver_list_spec], [1],
146290b17f1bSmrg  [How to feed a file listing to the archiver])
146390b17f1bSmrg])# _LT_PROG_AR
146490b17f1bSmrg
146590b17f1bSmrg
146690b17f1bSmrg# _LT_CMD_OLD_ARCHIVE
146790b17f1bSmrg# -------------------
146890b17f1bSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
146990b17f1bSmrg[_LT_PROG_AR
147090b17f1bSmrg
147190b17f1bSmrgAC_CHECK_TOOL(STRIP, strip, :)
147290b17f1bSmrgtest -z "$STRIP" && STRIP=:
147390b17f1bSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
147490b17f1bSmrg
147590b17f1bSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
147690b17f1bSmrgtest -z "$RANLIB" && RANLIB=:
147790b17f1bSmrg_LT_DECL([], [RANLIB], [1],
147890b17f1bSmrg    [Commands used to install an old-style archive])
147990b17f1bSmrg
148090b17f1bSmrg# Determine commands to create old-style static archives.
148190b17f1bSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
148290b17f1bSmrgold_postinstall_cmds='chmod 644 $oldlib'
148390b17f1bSmrgold_postuninstall_cmds=
148490b17f1bSmrg
148590b17f1bSmrgif test -n "$RANLIB"; then
148690b17f1bSmrg  case $host_os in
1487983b4bf2Smrg  openbsd*)
148890b17f1bSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
148990b17f1bSmrg    ;;
149090b17f1bSmrg  *)
149190b17f1bSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
149290b17f1bSmrg    ;;
14937e6fb56fSmrg  esac
149490b17f1bSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
14957e6fb56fSmrgfi
149690b17f1bSmrg
149790b17f1bSmrgcase $host_os in
149890b17f1bSmrg  darwin*)
149990b17f1bSmrg    lock_old_archive_extraction=yes ;;
150090b17f1bSmrg  *)
150190b17f1bSmrg    lock_old_archive_extraction=no ;;
150290b17f1bSmrgesac
150390b17f1bSmrg_LT_DECL([], [old_postinstall_cmds], [2])
150490b17f1bSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
150590b17f1bSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
150690b17f1bSmrg    [Commands used to build an old-style archive])
150790b17f1bSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
150890b17f1bSmrg    [Whether to use a lock for old archive extraction])
150990b17f1bSmrg])# _LT_CMD_OLD_ARCHIVE
15107e6fb56fSmrg
15117e6fb56fSmrg
151290b17f1bSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
151390b17f1bSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
151490b17f1bSmrg# ----------------------------------------------------------------
151590b17f1bSmrg# Check whether the given compiler option works
151690b17f1bSmrgAC_DEFUN([_LT_COMPILER_OPTION],
151790b17f1bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
151890b17f1bSmrgm4_require([_LT_DECL_SED])dnl
151990b17f1bSmrgAC_CACHE_CHECK([$1], [$2],
152090b17f1bSmrg  [$2=no
152190b17f1bSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
15227e6fb56fSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1523983b4bf2Smrg   lt_compiler_flag="$3"
15247e6fb56fSmrg   # Insert the option either (1) after the last *FLAGS variable, or
15257e6fb56fSmrg   # (2) before a word containing "conftest.", or (3) at the end.
15267e6fb56fSmrg   # Note that $ac_compile itself does not contain backslashes and begins
15277e6fb56fSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
152890b17f1bSmrg   # The option is referenced via a variable to avoid confusing sed.
15297e6fb56fSmrg   lt_compile=`echo "$ac_compile" | $SED \
15307e6fb56fSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
15317e6fb56fSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
15327e6fb56fSmrg   -e 's:$: $lt_compiler_flag:'`
153390b17f1bSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
153490b17f1bSmrg   (eval "$lt_compile" 2>conftest.err)
15357e6fb56fSmrg   ac_status=$?
153690b17f1bSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
153790b17f1bSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
153890b17f1bSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
15397e6fb56fSmrg     # The compiler can only warn and ignore the option if not recognized
154090b17f1bSmrg     # So say no if there are warnings other than the usual output.
154190b17f1bSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
154290b17f1bSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
154390b17f1bSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
154490b17f1bSmrg       $2=yes
15457e6fb56fSmrg     fi
15467e6fb56fSmrg   fi
154790b17f1bSmrg   $RM conftest*
15487e6fb56fSmrg])
15497e6fb56fSmrg
1550983b4bf2Smrgif test x"[$]$2" = xyes; then
155190b17f1bSmrg    m4_if([$5], , :, [$5])
15527e6fb56fSmrgelse
155390b17f1bSmrg    m4_if([$6], , :, [$6])
15547e6fb56fSmrgfi
155590b17f1bSmrg])# _LT_COMPILER_OPTION
15567e6fb56fSmrg
155790b17f1bSmrg# Old name:
155890b17f1bSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
155990b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
156090b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
15617e6fb56fSmrg
15627e6fb56fSmrg
156390b17f1bSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
156490b17f1bSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
156590b17f1bSmrg# ----------------------------------------------------
156690b17f1bSmrg# Check whether the given linker option works
156790b17f1bSmrgAC_DEFUN([_LT_LINKER_OPTION],
156890b17f1bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
156990b17f1bSmrgm4_require([_LT_DECL_SED])dnl
157090b17f1bSmrgAC_CACHE_CHECK([$1], [$2],
157190b17f1bSmrg  [$2=no
1572983b4bf2Smrg   save_LDFLAGS="$LDFLAGS"
157390b17f1bSmrg   LDFLAGS="$LDFLAGS $3"
157490b17f1bSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
157590b17f1bSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
157690b17f1bSmrg     # The linker can only warn and ignore the option if not recognized
157790b17f1bSmrg     # So say no if there are warnings
157890b17f1bSmrg     if test -s conftest.err; then
157990b17f1bSmrg       # Append any errors to the config.log.
158090b17f1bSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
158190b17f1bSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
158290b17f1bSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
158390b17f1bSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
158490b17f1bSmrg         $2=yes
158590b17f1bSmrg       fi
158690b17f1bSmrg     else
158790b17f1bSmrg       $2=yes
158890b17f1bSmrg     fi
158990b17f1bSmrg   fi
159090b17f1bSmrg   $RM -r conftest*
1591983b4bf2Smrg   LDFLAGS="$save_LDFLAGS"
159290b17f1bSmrg])
15937e6fb56fSmrg
1594983b4bf2Smrgif test x"[$]$2" = xyes; then
159590b17f1bSmrg    m4_if([$4], , :, [$4])
15967e6fb56fSmrgelse
159790b17f1bSmrg    m4_if([$5], , :, [$5])
15987e6fb56fSmrgfi
159990b17f1bSmrg])# _LT_LINKER_OPTION
16007e6fb56fSmrg
160190b17f1bSmrg# Old name:
160290b17f1bSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
160390b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
160490b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
16057e6fb56fSmrg
16067e6fb56fSmrg
160790b17f1bSmrg# LT_CMD_MAX_LEN
160890b17f1bSmrg#---------------
160990b17f1bSmrgAC_DEFUN([LT_CMD_MAX_LEN],
161090b17f1bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
161190b17f1bSmrg# find the maximum length of command line arguments
161290b17f1bSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
161390b17f1bSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
161490b17f1bSmrg  i=0
1615983b4bf2Smrg  teststring="ABCD"
16167e6fb56fSmrg
161790b17f1bSmrg  case $build_os in
161890b17f1bSmrg  msdosdjgpp*)
161990b17f1bSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
162090b17f1bSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
162190b17f1bSmrg    # during glob expansion).  Even if it were fixed, the result of this
162290b17f1bSmrg    # check would be larger than it should be.
162390b17f1bSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
162490b17f1bSmrg    ;;
16257e6fb56fSmrg
162690b17f1bSmrg  gnu*)
162790b17f1bSmrg    # Under GNU Hurd, this test is not required because there is
162890b17f1bSmrg    # no limit to the length of command line arguments.
162990b17f1bSmrg    # Libtool will interpret -1 as no limit whatsoever
163090b17f1bSmrg    lt_cv_sys_max_cmd_len=-1;
163190b17f1bSmrg    ;;
16327e6fb56fSmrg
163390b17f1bSmrg  cygwin* | mingw* | cegcc*)
163490b17f1bSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
163590b17f1bSmrg    # about 5 minutes as the teststring grows exponentially.
163690b17f1bSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
163790b17f1bSmrg    # you end up with a "frozen" computer, even though with patience
163890b17f1bSmrg    # the test eventually succeeds (with a max line length of 256k).
163990b17f1bSmrg    # Instead, let's just punt: use the minimum linelength reported by
164090b17f1bSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
164190b17f1bSmrg    lt_cv_sys_max_cmd_len=8192;
164290b17f1bSmrg    ;;
16437e6fb56fSmrg
164490b17f1bSmrg  mint*)
164590b17f1bSmrg    # On MiNT this can take a long time and run out of memory.
164690b17f1bSmrg    lt_cv_sys_max_cmd_len=8192;
164790b17f1bSmrg    ;;
16487e6fb56fSmrg
164990b17f1bSmrg  amigaos*)
165090b17f1bSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
165190b17f1bSmrg    # So we just punt and use a minimum line length of 8192.
165290b17f1bSmrg    lt_cv_sys_max_cmd_len=8192;
165390b17f1bSmrg    ;;
16547e6fb56fSmrg
1655983b4bf2Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
165690b17f1bSmrg    # This has been around since 386BSD, at least.  Likely further.
165790b17f1bSmrg    if test -x /sbin/sysctl; then
165890b17f1bSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
165990b17f1bSmrg    elif test -x /usr/sbin/sysctl; then
166090b17f1bSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
16617e6fb56fSmrg    else
166290b17f1bSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
16637e6fb56fSmrg    fi
166490b17f1bSmrg    # And add a safety zone
166590b17f1bSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
166690b17f1bSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
166790b17f1bSmrg    ;;
16687e6fb56fSmrg
166990b17f1bSmrg  interix*)
167090b17f1bSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
167190b17f1bSmrg    lt_cv_sys_max_cmd_len=196608
167290b17f1bSmrg    ;;
16737e6fb56fSmrg
167490b17f1bSmrg  os2*)
167590b17f1bSmrg    # The test takes a long time on OS/2.
167690b17f1bSmrg    lt_cv_sys_max_cmd_len=8192
167790b17f1bSmrg    ;;
16787e6fb56fSmrg
167990b17f1bSmrg  osf*)
168090b17f1bSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
168190b17f1bSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
168290b17f1bSmrg    # nice to cause kernel panics so lets avoid the loop below.
168390b17f1bSmrg    # First set a reasonable default.
168490b17f1bSmrg    lt_cv_sys_max_cmd_len=16384
168590b17f1bSmrg    #
168690b17f1bSmrg    if test -x /sbin/sysconfig; then
168790b17f1bSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
168890b17f1bSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
168990b17f1bSmrg      esac
169090b17f1bSmrg    fi
169190b17f1bSmrg    ;;
169290b17f1bSmrg  sco3.2v5*)
169390b17f1bSmrg    lt_cv_sys_max_cmd_len=102400
169490b17f1bSmrg    ;;
169590b17f1bSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
169690b17f1bSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
169790b17f1bSmrg    if test -n "$kargmax"; then
169890b17f1bSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
169990b17f1bSmrg    else
170090b17f1bSmrg      lt_cv_sys_max_cmd_len=32768
170190b17f1bSmrg    fi
17027e6fb56fSmrg    ;;
17037e6fb56fSmrg  *)
170490b17f1bSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1705983b4bf2Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
170690b17f1bSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
170790b17f1bSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
170890b17f1bSmrg    else
170990b17f1bSmrg      # Make teststring a little bigger before we do anything with it.
171090b17f1bSmrg      # a 1K string should be a reasonable start.
1711983b4bf2Smrg      for i in 1 2 3 4 5 6 7 8 ; do
171290b17f1bSmrg        teststring=$teststring$teststring
171390b17f1bSmrg      done
171490b17f1bSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
171590b17f1bSmrg      # If test is not a shell built-in, we'll probably end up computing a
171690b17f1bSmrg      # maximum length that is only half of the actual maximum length, but
171790b17f1bSmrg      # we can't tell.
1718983b4bf2Smrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
171990b17f1bSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1720983b4bf2Smrg	      test $i != 17 # 1/2 MB should be enough
172190b17f1bSmrg      do
172290b17f1bSmrg        i=`expr $i + 1`
172390b17f1bSmrg        teststring=$teststring$teststring
172490b17f1bSmrg      done
172590b17f1bSmrg      # Only check the string length outside the loop.
172690b17f1bSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
172790b17f1bSmrg      teststring=
172890b17f1bSmrg      # Add a significant safety factor because C++ compilers can tack on
172990b17f1bSmrg      # massive amounts of additional arguments before passing them to the
173090b17f1bSmrg      # linker.  It appears as though 1/2 is a usable value.
173190b17f1bSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
173290b17f1bSmrg    fi
17337e6fb56fSmrg    ;;
17347e6fb56fSmrg  esac
173590b17f1bSmrg])
1736983b4bf2Smrgif test -n $lt_cv_sys_max_cmd_len ; then
173790b17f1bSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
173890b17f1bSmrgelse
173990b17f1bSmrg  AC_MSG_RESULT(none)
174090b17f1bSmrgfi
174190b17f1bSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
174290b17f1bSmrg_LT_DECL([], [max_cmd_len], [0],
174390b17f1bSmrg    [What is the maximum length of a command?])
174490b17f1bSmrg])# LT_CMD_MAX_LEN
17457e6fb56fSmrg
174690b17f1bSmrg# Old name:
174790b17f1bSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
174890b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
174990b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
17507e6fb56fSmrg
17517e6fb56fSmrg
175290b17f1bSmrg# _LT_HEADER_DLFCN
175390b17f1bSmrg# ----------------
175490b17f1bSmrgm4_defun([_LT_HEADER_DLFCN],
175590b17f1bSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
175690b17f1bSmrg])# _LT_HEADER_DLFCN
17577e6fb56fSmrg
175890b17f1bSmrg
175990b17f1bSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
176090b17f1bSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
176190b17f1bSmrg# ----------------------------------------------------------------
176290b17f1bSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
176390b17f1bSmrg[m4_require([_LT_HEADER_DLFCN])dnl
1764983b4bf2Smrgif test "$cross_compiling" = yes; then :
176590b17f1bSmrg  [$4]
176690b17f1bSmrgelse
176790b17f1bSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
176890b17f1bSmrg  lt_status=$lt_dlunknown
176990b17f1bSmrg  cat > conftest.$ac_ext <<_LT_EOF
177090b17f1bSmrg[#line $LINENO "configure"
177190b17f1bSmrg#include "confdefs.h"
177290b17f1bSmrg
177390b17f1bSmrg#if HAVE_DLFCN_H
177490b17f1bSmrg#include <dlfcn.h>
177590b17f1bSmrg#endif
177690b17f1bSmrg
177790b17f1bSmrg#include <stdio.h>
177890b17f1bSmrg
177990b17f1bSmrg#ifdef RTLD_GLOBAL
178090b17f1bSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
178190b17f1bSmrg#else
178290b17f1bSmrg#  ifdef DL_GLOBAL
178390b17f1bSmrg#    define LT_DLGLOBAL		DL_GLOBAL
178490b17f1bSmrg#  else
178590b17f1bSmrg#    define LT_DLGLOBAL		0
178690b17f1bSmrg#  endif
178790b17f1bSmrg#endif
178890b17f1bSmrg
178990b17f1bSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
179090b17f1bSmrg   find out it does not work in some platform. */
179190b17f1bSmrg#ifndef LT_DLLAZY_OR_NOW
179290b17f1bSmrg#  ifdef RTLD_LAZY
179390b17f1bSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
179490b17f1bSmrg#  else
179590b17f1bSmrg#    ifdef DL_LAZY
179690b17f1bSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
179790b17f1bSmrg#    else
179890b17f1bSmrg#      ifdef RTLD_NOW
179990b17f1bSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
180090b17f1bSmrg#      else
180190b17f1bSmrg#        ifdef DL_NOW
180290b17f1bSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
180390b17f1bSmrg#        else
180490b17f1bSmrg#          define LT_DLLAZY_OR_NOW	0
180590b17f1bSmrg#        endif
180690b17f1bSmrg#      endif
180790b17f1bSmrg#    endif
180890b17f1bSmrg#  endif
180990b17f1bSmrg#endif
181090b17f1bSmrg
1811983b4bf2Smrg/* When -fvisbility=hidden is used, assume the code has been annotated
181290b17f1bSmrg   correspondingly for the symbols needed.  */
1813983b4bf2Smrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
181490b17f1bSmrgint fnord () __attribute__((visibility("default")));
181590b17f1bSmrg#endif
181690b17f1bSmrg
181790b17f1bSmrgint fnord () { return 42; }
181890b17f1bSmrgint main ()
181990b17f1bSmrg{
182090b17f1bSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
182190b17f1bSmrg  int status = $lt_dlunknown;
182290b17f1bSmrg
182390b17f1bSmrg  if (self)
182490b17f1bSmrg    {
182590b17f1bSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
182690b17f1bSmrg      else
182790b17f1bSmrg        {
182890b17f1bSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
182990b17f1bSmrg          else puts (dlerror ());
183090b17f1bSmrg	}
183190b17f1bSmrg      /* dlclose (self); */
183290b17f1bSmrg    }
18337e6fb56fSmrg  else
183490b17f1bSmrg    puts (dlerror ());
183590b17f1bSmrg
183690b17f1bSmrg  return status;
183790b17f1bSmrg}]
183890b17f1bSmrg_LT_EOF
1839983b4bf2Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
184090b17f1bSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
184190b17f1bSmrg    lt_status=$?
184290b17f1bSmrg    case x$lt_status in
184390b17f1bSmrg      x$lt_dlno_uscore) $1 ;;
184490b17f1bSmrg      x$lt_dlneed_uscore) $2 ;;
184590b17f1bSmrg      x$lt_dlunknown|x*) $3 ;;
18467e6fb56fSmrg    esac
184790b17f1bSmrg  else :
184890b17f1bSmrg    # compilation failed
184990b17f1bSmrg    $3
18507e6fb56fSmrg  fi
185190b17f1bSmrgfi
185290b17f1bSmrgrm -fr conftest*
185390b17f1bSmrg])# _LT_TRY_DLOPEN_SELF
185490b17f1bSmrg
185590b17f1bSmrg
185690b17f1bSmrg# LT_SYS_DLOPEN_SELF
185790b17f1bSmrg# ------------------
185890b17f1bSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
185990b17f1bSmrg[m4_require([_LT_HEADER_DLFCN])dnl
1860983b4bf2Smrgif test "x$enable_dlopen" != xyes; then
186190b17f1bSmrg  enable_dlopen=unknown
186290b17f1bSmrg  enable_dlopen_self=unknown
186390b17f1bSmrg  enable_dlopen_self_static=unknown
186490b17f1bSmrgelse
186590b17f1bSmrg  lt_cv_dlopen=no
186690b17f1bSmrg  lt_cv_dlopen_libs=
186790b17f1bSmrg
18687e6fb56fSmrg  case $host_os in
186990b17f1bSmrg  beos*)
1870983b4bf2Smrg    lt_cv_dlopen="load_add_on"
187190b17f1bSmrg    lt_cv_dlopen_libs=
187290b17f1bSmrg    lt_cv_dlopen_self=yes
18737e6fb56fSmrg    ;;
187490b17f1bSmrg
187590b17f1bSmrg  mingw* | pw32* | cegcc*)
1876983b4bf2Smrg    lt_cv_dlopen="LoadLibrary"
187790b17f1bSmrg    lt_cv_dlopen_libs=
18787e6fb56fSmrg    ;;
187990b17f1bSmrg
188090b17f1bSmrg  cygwin*)
1881983b4bf2Smrg    lt_cv_dlopen="dlopen"
188290b17f1bSmrg    lt_cv_dlopen_libs=
18837e6fb56fSmrg    ;;
188490b17f1bSmrg
188590b17f1bSmrg  darwin*)
1886983b4bf2Smrg  # if libdl is installed we need to link against it
188790b17f1bSmrg    AC_CHECK_LIB([dl], [dlopen],
1888983b4bf2Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1889983b4bf2Smrg    lt_cv_dlopen="dyld"
189090b17f1bSmrg    lt_cv_dlopen_libs=
189190b17f1bSmrg    lt_cv_dlopen_self=yes
189290b17f1bSmrg    ])
189390b17f1bSmrg    ;;
189490b17f1bSmrg
189590b17f1bSmrg  *)
189690b17f1bSmrg    AC_CHECK_FUNC([shl_load],
1897983b4bf2Smrg	  [lt_cv_dlopen="shl_load"],
189890b17f1bSmrg      [AC_CHECK_LIB([dld], [shl_load],
1899983b4bf2Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
190090b17f1bSmrg	[AC_CHECK_FUNC([dlopen],
1901983b4bf2Smrg	      [lt_cv_dlopen="dlopen"],
190290b17f1bSmrg	  [AC_CHECK_LIB([dl], [dlopen],
1903983b4bf2Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
190490b17f1bSmrg	    [AC_CHECK_LIB([svld], [dlopen],
1905983b4bf2Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
190690b17f1bSmrg	      [AC_CHECK_LIB([dld], [dld_link],
1907983b4bf2Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
190890b17f1bSmrg	      ])
190990b17f1bSmrg	    ])
191090b17f1bSmrg	  ])
191190b17f1bSmrg	])
191290b17f1bSmrg      ])
19137e6fb56fSmrg    ;;
19147e6fb56fSmrg  esac
19157e6fb56fSmrg
1916983b4bf2Smrg  if test "x$lt_cv_dlopen" != xno; then
1917963d66acSmrg    enable_dlopen=yes
1918983b4bf2Smrg  else
1919983b4bf2Smrg    enable_dlopen=no
192090b17f1bSmrg  fi
19217e6fb56fSmrg
192290b17f1bSmrg  case $lt_cv_dlopen in
192390b17f1bSmrg  dlopen)
1924983b4bf2Smrg    save_CPPFLAGS="$CPPFLAGS"
1925983b4bf2Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
192690b17f1bSmrg
1927983b4bf2Smrg    save_LDFLAGS="$LDFLAGS"
192890b17f1bSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
192990b17f1bSmrg
1930983b4bf2Smrg    save_LIBS="$LIBS"
193190b17f1bSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
193290b17f1bSmrg
193390b17f1bSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
193490b17f1bSmrg	  lt_cv_dlopen_self, [dnl
193590b17f1bSmrg	  _LT_TRY_DLOPEN_SELF(
193690b17f1bSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
193790b17f1bSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
193890b17f1bSmrg    ])
193990b17f1bSmrg
1940983b4bf2Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
194190b17f1bSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
194290b17f1bSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
194390b17f1bSmrg	  lt_cv_dlopen_self_static, [dnl
194490b17f1bSmrg	  _LT_TRY_DLOPEN_SELF(
194590b17f1bSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
194690b17f1bSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
194790b17f1bSmrg      ])
19487e6fb56fSmrg    fi
194990b17f1bSmrg
1950983b4bf2Smrg    CPPFLAGS="$save_CPPFLAGS"
1951983b4bf2Smrg    LDFLAGS="$save_LDFLAGS"
1952983b4bf2Smrg    LIBS="$save_LIBS"
19537e6fb56fSmrg    ;;
19547e6fb56fSmrg  esac
19557e6fb56fSmrg
195690b17f1bSmrg  case $lt_cv_dlopen_self in
195790b17f1bSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
195890b17f1bSmrg  *) enable_dlopen_self=unknown ;;
19597e6fb56fSmrg  esac
196090b17f1bSmrg
196190b17f1bSmrg  case $lt_cv_dlopen_self_static in
196290b17f1bSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
196390b17f1bSmrg  *) enable_dlopen_self_static=unknown ;;
19647e6fb56fSmrg  esac
196590b17f1bSmrgfi
196690b17f1bSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
196790b17f1bSmrg	 [Whether dlopen is supported])
196890b17f1bSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
196990b17f1bSmrg	 [Whether dlopen of programs is supported])
197090b17f1bSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
197190b17f1bSmrg	 [Whether dlopen of statically linked programs is supported])
197290b17f1bSmrg])# LT_SYS_DLOPEN_SELF
19737e6fb56fSmrg
197490b17f1bSmrg# Old name:
197590b17f1bSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
197690b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
197790b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
19787e6fb56fSmrg
19797e6fb56fSmrg
198090b17f1bSmrg# _LT_COMPILER_C_O([TAGNAME])
198190b17f1bSmrg# ---------------------------
198290b17f1bSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
198390b17f1bSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
198490b17f1bSmrgm4_defun([_LT_COMPILER_C_O],
198590b17f1bSmrg[m4_require([_LT_DECL_SED])dnl
198690b17f1bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
198790b17f1bSmrgm4_require([_LT_TAG_COMPILER])dnl
198890b17f1bSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
198990b17f1bSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
199090b17f1bSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
199190b17f1bSmrg   $RM -r conftest 2>/dev/null
199290b17f1bSmrg   mkdir conftest
199390b17f1bSmrg   cd conftest
199490b17f1bSmrg   mkdir out
199590b17f1bSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
199690b17f1bSmrg
199790b17f1bSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
199890b17f1bSmrg   # Insert the option either (1) after the last *FLAGS variable, or
199990b17f1bSmrg   # (2) before a word containing "conftest.", or (3) at the end.
200090b17f1bSmrg   # Note that $ac_compile itself does not contain backslashes and begins
200190b17f1bSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
200290b17f1bSmrg   lt_compile=`echo "$ac_compile" | $SED \
200390b17f1bSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
200490b17f1bSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
200590b17f1bSmrg   -e 's:$: $lt_compiler_flag:'`
200690b17f1bSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
200790b17f1bSmrg   (eval "$lt_compile" 2>out/conftest.err)
200890b17f1bSmrg   ac_status=$?
200990b17f1bSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
201090b17f1bSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
201190b17f1bSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
201290b17f1bSmrg   then
201390b17f1bSmrg     # The compiler can only warn and ignore the option if not recognized
201490b17f1bSmrg     # So say no if there are warnings
201590b17f1bSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
201690b17f1bSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
201790b17f1bSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
201890b17f1bSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
201990b17f1bSmrg     fi
202090b17f1bSmrg   fi
202190b17f1bSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
202290b17f1bSmrg   $RM conftest*
202390b17f1bSmrg   # SGI C++ compiler will create directory out/ii_files/ for
202490b17f1bSmrg   # template instantiation
202590b17f1bSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
202690b17f1bSmrg   $RM out/* && rmdir out
202790b17f1bSmrg   cd ..
202890b17f1bSmrg   $RM -r conftest
202990b17f1bSmrg   $RM conftest*
203090b17f1bSmrg])
203190b17f1bSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
203290b17f1bSmrg	[Does compiler simultaneously support -c and -o options?])
203390b17f1bSmrg])# _LT_COMPILER_C_O
203490b17f1bSmrg
203590b17f1bSmrg
203690b17f1bSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
203790b17f1bSmrg# ----------------------------------
203890b17f1bSmrg# Check to see if we can do hard links to lock some files if needed
203990b17f1bSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
204090b17f1bSmrg[m4_require([_LT_ENABLE_LOCK])dnl
204190b17f1bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
204290b17f1bSmrg_LT_COMPILER_C_O([$1])
204390b17f1bSmrg
2044983b4bf2Smrghard_links="nottested"
2045983b4bf2Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
204690b17f1bSmrg  # do not overwrite the value of need_locks provided by the user
204790b17f1bSmrg  AC_MSG_CHECKING([if we can lock with hard links])
204890b17f1bSmrg  hard_links=yes
204990b17f1bSmrg  $RM conftest*
205090b17f1bSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
205190b17f1bSmrg  touch conftest.a
205290b17f1bSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
205390b17f1bSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
205490b17f1bSmrg  AC_MSG_RESULT([$hard_links])
2055983b4bf2Smrg  if test "$hard_links" = no; then
2056983b4bf2Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
205790b17f1bSmrg    need_locks=warn
20587e6fb56fSmrg  fi
205990b17f1bSmrgelse
206090b17f1bSmrg  need_locks=no
206190b17f1bSmrgfi
206290b17f1bSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
206390b17f1bSmrg])# _LT_COMPILER_FILE_LOCKS
20647e6fb56fSmrg
20657e6fb56fSmrg
206690b17f1bSmrg# _LT_CHECK_OBJDIR
206790b17f1bSmrg# ----------------
206890b17f1bSmrgm4_defun([_LT_CHECK_OBJDIR],
206990b17f1bSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
207090b17f1bSmrg[rm -f .libs 2>/dev/null
207190b17f1bSmrgmkdir .libs 2>/dev/null
207290b17f1bSmrgif test -d .libs; then
207390b17f1bSmrg  lt_cv_objdir=.libs
207490b17f1bSmrgelse
207590b17f1bSmrg  # MS-DOS does not allow filenames that begin with a dot.
207690b17f1bSmrg  lt_cv_objdir=_libs
207790b17f1bSmrgfi
207890b17f1bSmrgrmdir .libs 2>/dev/null])
207990b17f1bSmrgobjdir=$lt_cv_objdir
208090b17f1bSmrg_LT_DECL([], [objdir], [0],
208190b17f1bSmrg         [The name of the directory that contains temporary libtool files])dnl
208290b17f1bSmrgm4_pattern_allow([LT_OBJDIR])dnl
2083983b4bf2SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
2084983b4bf2Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
208590b17f1bSmrg])# _LT_CHECK_OBJDIR
208690b17f1bSmrg
208790b17f1bSmrg
208890b17f1bSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
208990b17f1bSmrg# --------------------------------------
209090b17f1bSmrg# Check hardcoding attributes.
209190b17f1bSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
209290b17f1bSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
209390b17f1bSmrg_LT_TAGVAR(hardcode_action, $1)=
209490b17f1bSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
209590b17f1bSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2096983b4bf2Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
209790b17f1bSmrg
209890b17f1bSmrg  # We can hardcode non-existent directories.
2099983b4bf2Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
210090b17f1bSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
210190b17f1bSmrg     # have to relink, otherwise we might link with an installed library
210290b17f1bSmrg     # when we should be linking with a yet-to-be-installed one
2103983b4bf2Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
2104983b4bf2Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
210590b17f1bSmrg    # Linking always hardcodes the temporary library directory.
210690b17f1bSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
21077e6fb56fSmrg  else
210890b17f1bSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
210990b17f1bSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
21107e6fb56fSmrg  fi
211190b17f1bSmrgelse
211290b17f1bSmrg  # We cannot hardcode anything, or else we can only hardcode existing
211390b17f1bSmrg  # directories.
211490b17f1bSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
211590b17f1bSmrgfi
211690b17f1bSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
21177e6fb56fSmrg
2118983b4bf2Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
2119983b4bf2Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
212090b17f1bSmrg  # Fast installation is not supported
212190b17f1bSmrg  enable_fast_install=no
2122983b4bf2Smrgelif test "$shlibpath_overrides_runpath" = yes ||
2123983b4bf2Smrg     test "$enable_shared" = no; then
212490b17f1bSmrg  # Fast installation is not necessary
212590b17f1bSmrg  enable_fast_install=needless
212690b17f1bSmrgfi
212790b17f1bSmrg_LT_TAGDECL([], [hardcode_action], [0],
212890b17f1bSmrg    [How to hardcode a shared library path into an executable])
212990b17f1bSmrg])# _LT_LINKER_HARDCODE_LIBPATH
21307e6fb56fSmrg
21317e6fb56fSmrg
213290b17f1bSmrg# _LT_CMD_STRIPLIB
213390b17f1bSmrg# ----------------
213490b17f1bSmrgm4_defun([_LT_CMD_STRIPLIB],
213590b17f1bSmrg[m4_require([_LT_DECL_EGREP])
213690b17f1bSmrgstriplib=
213790b17f1bSmrgold_striplib=
213890b17f1bSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
213990b17f1bSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
214090b17f1bSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
214190b17f1bSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
214290b17f1bSmrg  AC_MSG_RESULT([yes])
214390b17f1bSmrgelse
214490b17f1bSmrg# FIXME - insert some real tests, host_os isn't really good enough
21457e6fb56fSmrg  case $host_os in
214690b17f1bSmrg  darwin*)
2147983b4bf2Smrg    if test -n "$STRIP" ; then
214890b17f1bSmrg      striplib="$STRIP -x"
214990b17f1bSmrg      old_striplib="$STRIP -S"
215090b17f1bSmrg      AC_MSG_RESULT([yes])
215190b17f1bSmrg    else
215290b17f1bSmrg      AC_MSG_RESULT([no])
215390b17f1bSmrg    fi
215490b17f1bSmrg    ;;
215590b17f1bSmrg  *)
215690b17f1bSmrg    AC_MSG_RESULT([no])
215790b17f1bSmrg    ;;
21587e6fb56fSmrg  esac
215990b17f1bSmrgfi
216090b17f1bSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
216190b17f1bSmrg_LT_DECL([], [striplib], [1])
216290b17f1bSmrg])# _LT_CMD_STRIPLIB
21637e6fb56fSmrg
216490b17f1bSmrg
216590b17f1bSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
216690b17f1bSmrg# -----------------------------
216790b17f1bSmrg# PORTME Fill in your ld.so characteristics
216890b17f1bSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
216990b17f1bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
217090b17f1bSmrgm4_require([_LT_DECL_EGREP])dnl
217190b17f1bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
217290b17f1bSmrgm4_require([_LT_DECL_OBJDUMP])dnl
217390b17f1bSmrgm4_require([_LT_DECL_SED])dnl
217490b17f1bSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
217590b17f1bSmrgAC_MSG_CHECKING([dynamic linker characteristics])
217690b17f1bSmrgm4_if([$1],
217790b17f1bSmrg	[], [
2178983b4bf2Smrgif test "$GCC" = yes; then
217990b17f1bSmrg  case $host_os in
2180983b4bf2Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2181983b4bf2Smrg    *) lt_awk_arg="/^libraries:/" ;;
218290b17f1bSmrg  esac
218390b17f1bSmrg  case $host_os in
2184983b4bf2Smrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
2185983b4bf2Smrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
218690b17f1bSmrg  esac
218790b17f1bSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
218890b17f1bSmrg  case $lt_search_path_spec in
218990b17f1bSmrg  *\;*)
219090b17f1bSmrg    # if the path contains ";" then we assume it to be the separator
219190b17f1bSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
219290b17f1bSmrg    # assumed that no part of a normal pathname contains ";" but that should
219390b17f1bSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
219490b17f1bSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
219590b17f1bSmrg    ;;
219690b17f1bSmrg  *)
219790b17f1bSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
219890b17f1bSmrg    ;;
219990b17f1bSmrg  esac
220090b17f1bSmrg  # Ok, now we have the path, separated by spaces, we can step through it
2201983b4bf2Smrg  # and add multilib dir if necessary.
220290b17f1bSmrg  lt_tmp_lt_search_path_spec=
2203983b4bf2Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
220490b17f1bSmrg  for lt_sys_path in $lt_search_path_spec; do
2205983b4bf2Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2206983b4bf2Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2207983b4bf2Smrg    else
220890b17f1bSmrg      test -d "$lt_sys_path" && \
220990b17f1bSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
221090b17f1bSmrg    fi
221190b17f1bSmrg  done
221290b17f1bSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2213983b4bf2SmrgBEGIN {RS=" "; FS="/|\n";} {
2214983b4bf2Smrg  lt_foo="";
2215983b4bf2Smrg  lt_count=0;
221690b17f1bSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
221790b17f1bSmrg    if ($lt_i != "" && $lt_i != ".") {
221890b17f1bSmrg      if ($lt_i == "..") {
221990b17f1bSmrg        lt_count++;
222090b17f1bSmrg      } else {
222190b17f1bSmrg        if (lt_count == 0) {
2222983b4bf2Smrg          lt_foo="/" $lt_i lt_foo;
222390b17f1bSmrg        } else {
222490b17f1bSmrg          lt_count--;
222590b17f1bSmrg        }
222690b17f1bSmrg      }
222790b17f1bSmrg    }
222890b17f1bSmrg  }
222990b17f1bSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
223090b17f1bSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
223190b17f1bSmrg}'`
223290b17f1bSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
223390b17f1bSmrg  # for these hosts.
223490b17f1bSmrg  case $host_os in
223590b17f1bSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2236983b4bf2Smrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
223790b17f1bSmrg  esac
223890b17f1bSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
223990b17f1bSmrgelse
224090b17f1bSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
224190b17f1bSmrgfi])
224290b17f1bSmrglibrary_names_spec=
224390b17f1bSmrglibname_spec='lib$name'
224490b17f1bSmrgsoname_spec=
2245983b4bf2Smrgshrext_cmds=".so"
224690b17f1bSmrgpostinstall_cmds=
224790b17f1bSmrgpostuninstall_cmds=
224890b17f1bSmrgfinish_cmds=
224990b17f1bSmrgfinish_eval=
225090b17f1bSmrgshlibpath_var=
225190b17f1bSmrgshlibpath_overrides_runpath=unknown
225290b17f1bSmrgversion_type=none
225390b17f1bSmrgdynamic_linker="$host_os ld.so"
225490b17f1bSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
225590b17f1bSmrgneed_lib_prefix=unknown
225690b17f1bSmrghardcode_into_libs=no
225790b17f1bSmrg
225890b17f1bSmrg# when you set need_version to no, make sure it does not cause -set_version
225990b17f1bSmrg# flags to be left without arguments
226090b17f1bSmrgneed_version=unknown
226190b17f1bSmrg
226290b17f1bSmrgcase $host_os in
226390b17f1bSmrgaix3*)
226490b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2265983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
22667e6fb56fSmrg  shlibpath_var=LIBPATH
22677e6fb56fSmrg
226890b17f1bSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
2269983b4bf2Smrg  soname_spec='${libname}${release}${shared_ext}$major'
22707e6fb56fSmrg  ;;
22717e6fb56fSmrg
227290b17f1bSmrgaix[[4-9]]*)
227390b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
22747e6fb56fSmrg  need_lib_prefix=no
22757e6fb56fSmrg  need_version=no
22767e6fb56fSmrg  hardcode_into_libs=yes
2277983b4bf2Smrg  if test "$host_cpu" = ia64; then
227890b17f1bSmrg    # AIX 5 supports IA64
2279983b4bf2Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
228090b17f1bSmrg    shlibpath_var=LD_LIBRARY_PATH
228190b17f1bSmrg  else
228290b17f1bSmrg    # With GCC up to 2.95.x, collect2 would create an import file
228390b17f1bSmrg    # for dependence libraries.  The import file would start with
2284983b4bf2Smrg    # the line `#! .'.  This would cause the generated library to
2285983b4bf2Smrg    # depend on `.', always an invalid library.  This was fixed in
228690b17f1bSmrg    # development snapshots of GCC prior to 3.0.
228790b17f1bSmrg    case $host_os in
228890b17f1bSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
228990b17f1bSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
229090b17f1bSmrg	   echo ' yes '
2291983b4bf2Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
229290b17f1bSmrg	:
229390b17f1bSmrg      else
229490b17f1bSmrg	can_build_shared=no
229590b17f1bSmrg      fi
229690b17f1bSmrg      ;;
229790b17f1bSmrg    esac
2298983b4bf2Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
229990b17f1bSmrg    # soname into executable. Probably we can add versioning support to
230090b17f1bSmrg    # collect2, so additional links can be useful in future.
2301983b4bf2Smrg    if test "$aix_use_runtimelinking" = yes; then
230290b17f1bSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
230390b17f1bSmrg      # instead of lib<name>.a to let people know that these are not
230490b17f1bSmrg      # typical AIX shared libraries.
2305983b4bf2Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2306983b4bf2Smrg    else
230790b17f1bSmrg      # We preserve .a as extension for shared libraries through AIX4.2
230890b17f1bSmrg      # and later when we are not doing run time linking.
2309983b4bf2Smrg      library_names_spec='${libname}${release}.a $libname.a'
2310983b4bf2Smrg      soname_spec='${libname}${release}${shared_ext}$major'
2311983b4bf2Smrg    fi
231290b17f1bSmrg    shlibpath_var=LIBPATH
23137e6fb56fSmrg  fi
23147e6fb56fSmrg  ;;
23157e6fb56fSmrg
231690b17f1bSmrgamigaos*)
231790b17f1bSmrg  case $host_cpu in
231890b17f1bSmrg  powerpc)
231990b17f1bSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
232090b17f1bSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2321983b4bf2Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
232290b17f1bSmrg    ;;
232390b17f1bSmrg  m68k)
232490b17f1bSmrg    library_names_spec='$libname.ixlibrary $libname.a'
232590b17f1bSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2326983b4bf2Smrg    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'
232790b17f1bSmrg    ;;
23287e6fb56fSmrg  esac
23297e6fb56fSmrg  ;;
23307e6fb56fSmrg
233190b17f1bSmrgbeos*)
2332983b4bf2Smrg  library_names_spec='${libname}${shared_ext}'
233390b17f1bSmrg  dynamic_linker="$host_os ld.so"
233490b17f1bSmrg  shlibpath_var=LIBRARY_PATH
23357e6fb56fSmrg  ;;
23367e6fb56fSmrg
233790b17f1bSmrgbsdi[[45]]*)
233890b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
23397e6fb56fSmrg  need_version=no
2340983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2341983b4bf2Smrg  soname_spec='${libname}${release}${shared_ext}$major'
234290b17f1bSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
23437e6fb56fSmrg  shlibpath_var=LD_LIBRARY_PATH
234490b17f1bSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
234590b17f1bSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
234690b17f1bSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
234790b17f1bSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
234890b17f1bSmrg  # libtool to hard-code these into programs
23497e6fb56fSmrg  ;;
23507e6fb56fSmrg
235190b17f1bSmrgcygwin* | mingw* | pw32* | cegcc*)
235290b17f1bSmrg  version_type=windows
2353983b4bf2Smrg  shrext_cmds=".dll"
235490b17f1bSmrg  need_version=no
235590b17f1bSmrg  need_lib_prefix=no
23567e6fb56fSmrg
235790b17f1bSmrg  case $GCC,$cc_basename in
235890b17f1bSmrg  yes,*)
235990b17f1bSmrg    # gcc
236090b17f1bSmrg    library_names_spec='$libname.dll.a'
236190b17f1bSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2362983b4bf2Smrg    postinstall_cmds='base_file=`basename \${file}`~
2363983b4bf2Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
236490b17f1bSmrg      dldir=$destdir/`dirname \$dlpath`~
236590b17f1bSmrg      test -d \$dldir || mkdir -p \$dldir~
236690b17f1bSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
236790b17f1bSmrg      chmod a+x \$dldir/$dlname~
236890b17f1bSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
236990b17f1bSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
237090b17f1bSmrg      fi'
237190b17f1bSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
237290b17f1bSmrg      dlpath=$dir/\$dldll~
237390b17f1bSmrg       $RM \$dlpath'
237490b17f1bSmrg    shlibpath_overrides_runpath=yes
23757e6fb56fSmrg
237690b17f1bSmrg    case $host_os in
237790b17f1bSmrg    cygwin*)
237890b17f1bSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2379983b4bf2Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
238090b17f1bSmrgm4_if([$1], [],[
238190b17f1bSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
238290b17f1bSmrg      ;;
238390b17f1bSmrg    mingw* | cegcc*)
238490b17f1bSmrg      # MinGW DLLs use traditional 'lib' prefix
2385983b4bf2Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
238690b17f1bSmrg      ;;
238790b17f1bSmrg    pw32*)
238890b17f1bSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2389983b4bf2Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
239090b17f1bSmrg      ;;
23917e6fb56fSmrg    esac
239290b17f1bSmrg    dynamic_linker='Win32 ld.exe'
239390b17f1bSmrg    ;;
23947e6fb56fSmrg
239590b17f1bSmrg  *,cl*)
239690b17f1bSmrg    # Native MSVC
239790b17f1bSmrg    libname_spec='$name'
2398983b4bf2Smrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2399983b4bf2Smrg    library_names_spec='${libname}.dll.lib'
24007e6fb56fSmrg
240190b17f1bSmrg    case $build_os in
240290b17f1bSmrg    mingw*)
240390b17f1bSmrg      sys_lib_search_path_spec=
240490b17f1bSmrg      lt_save_ifs=$IFS
240590b17f1bSmrg      IFS=';'
240690b17f1bSmrg      for lt_path in $LIB
240790b17f1bSmrg      do
240890b17f1bSmrg        IFS=$lt_save_ifs
240990b17f1bSmrg        # Let DOS variable expansion print the short 8.3 style file name.
241090b17f1bSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
241190b17f1bSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
24127e6fb56fSmrg      done
241390b17f1bSmrg      IFS=$lt_save_ifs
241490b17f1bSmrg      # Convert to MSYS style.
241590b17f1bSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
24167e6fb56fSmrg      ;;
241790b17f1bSmrg    cygwin*)
241890b17f1bSmrg      # Convert to unix form, then to dos form, then back to unix form
241990b17f1bSmrg      # but this time dos style (no spaces!) so that the unix form looks
242090b17f1bSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
242190b17f1bSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
242290b17f1bSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
242390b17f1bSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
24247e6fb56fSmrg      ;;
24257e6fb56fSmrg    *)
2426983b4bf2Smrg      sys_lib_search_path_spec="$LIB"
242790b17f1bSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
242890b17f1bSmrg        # It is most probably a Windows format PATH.
242990b17f1bSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
243090b17f1bSmrg      else
243190b17f1bSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
243290b17f1bSmrg      fi
243390b17f1bSmrg      # FIXME: find the short name or the path components, as spaces are
243490b17f1bSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
24357e6fb56fSmrg      ;;
243690b17f1bSmrg    esac
24377e6fb56fSmrg
243890b17f1bSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2439983b4bf2Smrg    postinstall_cmds='base_file=`basename \${file}`~
2440983b4bf2Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
244190b17f1bSmrg      dldir=$destdir/`dirname \$dlpath`~
244290b17f1bSmrg      test -d \$dldir || mkdir -p \$dldir~
244390b17f1bSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
244490b17f1bSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
244590b17f1bSmrg      dlpath=$dir/\$dldll~
244690b17f1bSmrg       $RM \$dlpath'
244790b17f1bSmrg    shlibpath_overrides_runpath=yes
244890b17f1bSmrg    dynamic_linker='Win32 link.exe'
244990b17f1bSmrg    ;;
24507e6fb56fSmrg
245190b17f1bSmrg  *)
245290b17f1bSmrg    # Assume MSVC wrapper
2453983b4bf2Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
245490b17f1bSmrg    dynamic_linker='Win32 ld.exe'
245590b17f1bSmrg    ;;
245690b17f1bSmrg  esac
245790b17f1bSmrg  # FIXME: first we should search . and the directory the executable is in
245890b17f1bSmrg  shlibpath_var=PATH
24597e6fb56fSmrg  ;;
24607e6fb56fSmrg
246190b17f1bSmrgdarwin* | rhapsody*)
246290b17f1bSmrg  dynamic_linker="$host_os dyld"
246390b17f1bSmrg  version_type=darwin
246490b17f1bSmrg  need_lib_prefix=no
246590b17f1bSmrg  need_version=no
2466983b4bf2Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2467983b4bf2Smrg  soname_spec='${libname}${release}${major}$shared_ext'
246890b17f1bSmrg  shlibpath_overrides_runpath=yes
246990b17f1bSmrg  shlibpath_var=DYLD_LIBRARY_PATH
247090b17f1bSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
247190b17f1bSmrgm4_if([$1], [],[
247290b17f1bSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
247390b17f1bSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
24747e6fb56fSmrg  ;;
24757e6fb56fSmrg
247690b17f1bSmrgdgux*)
247790b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
247890b17f1bSmrg  need_lib_prefix=no
247990b17f1bSmrg  need_version=no
2480983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2481983b4bf2Smrg  soname_spec='${libname}${release}${shared_ext}$major'
248290b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
248390b17f1bSmrg  ;;
24847e6fb56fSmrg
248590b17f1bSmrgfreebsd* | dragonfly*)
248690b17f1bSmrg  # DragonFly does not have aout.  When/if they implement a new
248790b17f1bSmrg  # versioning mechanism, adjust this.
248890b17f1bSmrg  if test -x /usr/bin/objformat; then
248990b17f1bSmrg    objformat=`/usr/bin/objformat`
24907e6fb56fSmrg  else
249190b17f1bSmrg    case $host_os in
249290b17f1bSmrg    freebsd[[23]].*) objformat=aout ;;
249390b17f1bSmrg    *) objformat=elf ;;
249490b17f1bSmrg    esac
24957e6fb56fSmrg  fi
249690b17f1bSmrg  version_type=freebsd-$objformat
249790b17f1bSmrg  case $version_type in
249890b17f1bSmrg    freebsd-elf*)
2499983b4bf2Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
250090b17f1bSmrg      need_version=no
250190b17f1bSmrg      need_lib_prefix=no
25027e6fb56fSmrg      ;;
250390b17f1bSmrg    freebsd-*)
2504983b4bf2Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
250590b17f1bSmrg      need_version=yes
250690b17f1bSmrg      ;;
250790b17f1bSmrg  esac
250890b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
250990b17f1bSmrg  case $host_os in
251090b17f1bSmrg  freebsd2.*)
251190b17f1bSmrg    shlibpath_overrides_runpath=yes
25127e6fb56fSmrg    ;;
251390b17f1bSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
251490b17f1bSmrg    shlibpath_overrides_runpath=yes
251590b17f1bSmrg    hardcode_into_libs=yes
251690b17f1bSmrg    ;;
251790b17f1bSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
251890b17f1bSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
251990b17f1bSmrg    shlibpath_overrides_runpath=no
252090b17f1bSmrg    hardcode_into_libs=yes
252190b17f1bSmrg    ;;
252290b17f1bSmrg  *) # from 4.6 on, and DragonFly
252390b17f1bSmrg    shlibpath_overrides_runpath=yes
252490b17f1bSmrg    hardcode_into_libs=yes
25257e6fb56fSmrg    ;;
25267e6fb56fSmrg  esac
25277e6fb56fSmrg  ;;
252890b17f1bSmrg
2529983b4bf2Smrggnu*)
2530983b4bf2Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2531983b4bf2Smrg  need_lib_prefix=no
2532983b4bf2Smrg  need_version=no
2533983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2534983b4bf2Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2535983b4bf2Smrg  shlibpath_var=LD_LIBRARY_PATH
2536983b4bf2Smrg  shlibpath_overrides_runpath=no
2537983b4bf2Smrg  hardcode_into_libs=yes
2538983b4bf2Smrg  ;;
2539983b4bf2Smrg
254090b17f1bSmrghaiku*)
254190b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
254290b17f1bSmrg  need_lib_prefix=no
254390b17f1bSmrg  need_version=no
254490b17f1bSmrg  dynamic_linker="$host_os runtime_loader"
2545983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2546983b4bf2Smrg  soname_spec='${libname}${release}${shared_ext}$major'
254790b17f1bSmrg  shlibpath_var=LIBRARY_PATH
2548983b4bf2Smrg  shlibpath_overrides_runpath=yes
254990b17f1bSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
255090b17f1bSmrg  hardcode_into_libs=yes
255190b17f1bSmrg  ;;
25527e6fb56fSmrg
255390b17f1bSmrghpux9* | hpux10* | hpux11*)
255490b17f1bSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
255590b17f1bSmrg  # link against other versions.
255690b17f1bSmrg  version_type=sunos
255790b17f1bSmrg  need_lib_prefix=no
255890b17f1bSmrg  need_version=no
255990b17f1bSmrg  case $host_cpu in
256090b17f1bSmrg  ia64*)
256190b17f1bSmrg    shrext_cmds='.so'
256290b17f1bSmrg    hardcode_into_libs=yes
256390b17f1bSmrg    dynamic_linker="$host_os dld.so"
256490b17f1bSmrg    shlibpath_var=LD_LIBRARY_PATH
256590b17f1bSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2566983b4bf2Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2567983b4bf2Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2568983b4bf2Smrg    if test "X$HPUX_IA64_MODE" = X32; then
256990b17f1bSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
25707e6fb56fSmrg    else
257190b17f1bSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
25727e6fb56fSmrg    fi
2573983b4bf2Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
25747e6fb56fSmrg    ;;
257590b17f1bSmrg  hppa*64*)
257690b17f1bSmrg    shrext_cmds='.sl'
257790b17f1bSmrg    hardcode_into_libs=yes
257890b17f1bSmrg    dynamic_linker="$host_os dld.sl"
257990b17f1bSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
258090b17f1bSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2581983b4bf2Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2582983b4bf2Smrg    soname_spec='${libname}${release}${shared_ext}$major'
258390b17f1bSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
258490b17f1bSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
258590b17f1bSmrg    ;;
258690b17f1bSmrg  *)
258790b17f1bSmrg    shrext_cmds='.sl'
258890b17f1bSmrg    dynamic_linker="$host_os dld.sl"
258990b17f1bSmrg    shlibpath_var=SHLIB_PATH
259090b17f1bSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2591983b4bf2Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2592983b4bf2Smrg    soname_spec='${libname}${release}${shared_ext}$major'
259390b17f1bSmrg    ;;
259490b17f1bSmrg  esac
259590b17f1bSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
259690b17f1bSmrg  postinstall_cmds='chmod 555 $lib'
259790b17f1bSmrg  # or fails outright, so override atomically:
259890b17f1bSmrg  install_override_mode=555
259990b17f1bSmrg  ;;
26007e6fb56fSmrg
260190b17f1bSmrginterix[[3-9]]*)
260290b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
260390b17f1bSmrg  need_lib_prefix=no
260490b17f1bSmrg  need_version=no
2605983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2606983b4bf2Smrg  soname_spec='${libname}${release}${shared_ext}$major'
260790b17f1bSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
260890b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
260990b17f1bSmrg  shlibpath_overrides_runpath=no
261090b17f1bSmrg  hardcode_into_libs=yes
261190b17f1bSmrg  ;;
26127e6fb56fSmrg
261390b17f1bSmrgirix5* | irix6* | nonstopux*)
261490b17f1bSmrg  case $host_os in
261590b17f1bSmrg    nonstopux*) version_type=nonstopux ;;
261690b17f1bSmrg    *)
2617983b4bf2Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
261890b17f1bSmrg		version_type=linux # correct to gnu/linux during the next big refactor
261990b17f1bSmrg	else
262090b17f1bSmrg		version_type=irix
262190b17f1bSmrg	fi ;;
262290b17f1bSmrg  esac
262390b17f1bSmrg  need_lib_prefix=no
262490b17f1bSmrg  need_version=no
2625983b4bf2Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2626983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
262790b17f1bSmrg  case $host_os in
262890b17f1bSmrg  irix5* | nonstopux*)
262990b17f1bSmrg    libsuff= shlibsuff=
263090b17f1bSmrg    ;;
263190b17f1bSmrg  *)
263290b17f1bSmrg    case $LD in # libtool.m4 will add one of these switches to LD
263390b17f1bSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
263490b17f1bSmrg      libsuff= shlibsuff= libmagic=32-bit;;
263590b17f1bSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
263690b17f1bSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
263790b17f1bSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
263890b17f1bSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
263990b17f1bSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
264090b17f1bSmrg    esac
264190b17f1bSmrg    ;;
264290b17f1bSmrg  esac
264390b17f1bSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
264490b17f1bSmrg  shlibpath_overrides_runpath=no
2645983b4bf2Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2646983b4bf2Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
264790b17f1bSmrg  hardcode_into_libs=yes
26487e6fb56fSmrg  ;;
26497e6fb56fSmrg
265090b17f1bSmrg# No shared lib support for Linux oldld, aout, or coff.
265190b17f1bSmrglinux*oldld* | linux*aout* | linux*coff*)
265290b17f1bSmrg  dynamic_linker=no
26537e6fb56fSmrg  ;;
26547e6fb56fSmrg
265590b17f1bSmrg# This must be glibc/ELF.
2656983b4bf2Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
265790b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
265890b17f1bSmrg  need_lib_prefix=no
265990b17f1bSmrg  need_version=no
2660983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2661983b4bf2Smrg  soname_spec='${libname}${release}${shared_ext}$major'
266290b17f1bSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
266390b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
266490b17f1bSmrg  shlibpath_overrides_runpath=no
26657e6fb56fSmrg
266690b17f1bSmrg  # Some binutils ld are patched to set DT_RUNPATH
266790b17f1bSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
266890b17f1bSmrg    [lt_cv_shlibpath_overrides_runpath=no
266990b17f1bSmrg    save_LDFLAGS=$LDFLAGS
267090b17f1bSmrg    save_libdir=$libdir
267190b17f1bSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
267290b17f1bSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
267390b17f1bSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
267490b17f1bSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
267590b17f1bSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
267690b17f1bSmrg    LDFLAGS=$save_LDFLAGS
267790b17f1bSmrg    libdir=$save_libdir
267890b17f1bSmrg    ])
267990b17f1bSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
26807e6fb56fSmrg
268190b17f1bSmrg  # This implies no fast_install, which is unacceptable.
268290b17f1bSmrg  # Some rework will be needed to allow for fast_install
268390b17f1bSmrg  # before this can be enabled.
268490b17f1bSmrg  hardcode_into_libs=yes
26857e6fb56fSmrg
2686983b4bf2Smrg  # Append ld.so.conf contents to the search path
268790b17f1bSmrg  if test -f /etc/ld.so.conf; then
268890b17f1bSmrg    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' ' '`
2689983b4bf2Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
269090b17f1bSmrg  fi
26917e6fb56fSmrg
269290b17f1bSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
269390b17f1bSmrg  # powerpc, because MkLinux only supported shared libraries with the
269490b17f1bSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
269590b17f1bSmrg  # most powerpc-linux boxes support dynamic linking these days and
269690b17f1bSmrg  # people can always --disable-shared, the test was removed, and we
269790b17f1bSmrg  # assume the GNU/Linux dynamic linker is in use.
269890b17f1bSmrg  dynamic_linker='GNU/Linux ld.so'
26997e6fb56fSmrg  ;;
27007e6fb56fSmrg
2701983b4bf2Smrgnetbsdelf*-gnu)
2702983b4bf2Smrg  version_type=linux
2703983b4bf2Smrg  need_lib_prefix=no
2704983b4bf2Smrg  need_version=no
2705983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2706983b4bf2Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2707983b4bf2Smrg  shlibpath_var=LD_LIBRARY_PATH
2708983b4bf2Smrg  shlibpath_overrides_runpath=no
2709983b4bf2Smrg  hardcode_into_libs=yes
2710983b4bf2Smrg  dynamic_linker='NetBSD ld.elf_so'
2711983b4bf2Smrg  ;;
2712983b4bf2Smrg
27137e6fb56fSmrgnetbsd*)
271490b17f1bSmrg  version_type=sunos
271590b17f1bSmrg  need_lib_prefix=no
271690b17f1bSmrg  need_version=no
271790b17f1bSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2718983b4bf2Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
271990b17f1bSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
272090b17f1bSmrg    dynamic_linker='NetBSD (a.out) ld.so'
27217e6fb56fSmrg  else
2722983b4bf2Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2723983b4bf2Smrg    soname_spec='${libname}${release}${shared_ext}$major'
272490b17f1bSmrg    dynamic_linker='NetBSD ld.elf_so'
27257e6fb56fSmrg  fi
272690b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
272790b17f1bSmrg  shlibpath_overrides_runpath=yes
272890b17f1bSmrg  hardcode_into_libs=yes
27297e6fb56fSmrg  ;;
27307e6fb56fSmrg
273190b17f1bSmrgnewsos6)
273290b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2733983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
273490b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
273590b17f1bSmrg  shlibpath_overrides_runpath=yes
27367e6fb56fSmrg  ;;
27377e6fb56fSmrg
273890b17f1bSmrg*nto* | *qnx*)
273990b17f1bSmrg  version_type=qnx
274090b17f1bSmrg  need_lib_prefix=no
274190b17f1bSmrg  need_version=no
2742983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2743983b4bf2Smrg  soname_spec='${libname}${release}${shared_ext}$major'
274490b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
274590b17f1bSmrg  shlibpath_overrides_runpath=no
274690b17f1bSmrg  hardcode_into_libs=yes
274790b17f1bSmrg  dynamic_linker='ldqnx.so'
27487e6fb56fSmrg  ;;
27497e6fb56fSmrg
2750983b4bf2Smrgopenbsd*)
275190b17f1bSmrg  version_type=sunos
2752983b4bf2Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
275390b17f1bSmrg  need_lib_prefix=no
2754983b4bf2Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2755983b4bf2Smrg  case $host_os in
2756983b4bf2Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
2757983b4bf2Smrg    *)				need_version=no  ;;
2758983b4bf2Smrg  esac
2759983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2760963d66acSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2761963d66acSmrg  shlibpath_var=LD_LIBRARY_PATH
2762983b4bf2Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2763983b4bf2Smrg    case $host_os in
2764983b4bf2Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
2765983b4bf2Smrg	shlibpath_overrides_runpath=no
2766983b4bf2Smrg	;;
2767983b4bf2Smrg      *)
2768983b4bf2Smrg	shlibpath_overrides_runpath=yes
2769983b4bf2Smrg	;;
2770983b4bf2Smrg      esac
2771983b4bf2Smrg  else
2772983b4bf2Smrg    shlibpath_overrides_runpath=yes
2773983b4bf2Smrg  fi
27747e6fb56fSmrg  ;;
27757e6fb56fSmrg
277690b17f1bSmrgos2*)
277790b17f1bSmrg  libname_spec='$name'
2778983b4bf2Smrg  shrext_cmds=".dll"
277990b17f1bSmrg  need_lib_prefix=no
2780983b4bf2Smrg  library_names_spec='$libname${shared_ext} $libname.a'
278190b17f1bSmrg  dynamic_linker='OS/2 ld.exe'
2782983b4bf2Smrg  shlibpath_var=LIBPATH
278390b17f1bSmrg  ;;
278490b17f1bSmrg
27857e6fb56fSmrgosf3* | osf4* | osf5*)
278690b17f1bSmrg  version_type=osf
278790b17f1bSmrg  need_lib_prefix=no
278890b17f1bSmrg  need_version=no
2789983b4bf2Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2790983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
279190b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
279290b17f1bSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2793983b4bf2Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
27947e6fb56fSmrg  ;;
27957e6fb56fSmrg
27967e6fb56fSmrgrdos*)
279790b17f1bSmrg  dynamic_linker=no
27987e6fb56fSmrg  ;;
27997e6fb56fSmrg
28007e6fb56fSmrgsolaris*)
280190b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
280290b17f1bSmrg  need_lib_prefix=no
280390b17f1bSmrg  need_version=no
2804983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2805983b4bf2Smrg  soname_spec='${libname}${release}${shared_ext}$major'
280690b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
280790b17f1bSmrg  shlibpath_overrides_runpath=yes
280890b17f1bSmrg  hardcode_into_libs=yes
280990b17f1bSmrg  # ldd complains unless libraries are executable
281090b17f1bSmrg  postinstall_cmds='chmod +x $lib'
281190b17f1bSmrg  ;;
281290b17f1bSmrg
281390b17f1bSmrgsunos4*)
281490b17f1bSmrg  version_type=sunos
2815983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
281690b17f1bSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
281790b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
281890b17f1bSmrg  shlibpath_overrides_runpath=yes
2819983b4bf2Smrg  if test "$with_gnu_ld" = yes; then
282090b17f1bSmrg    need_lib_prefix=no
282190b17f1bSmrg  fi
282290b17f1bSmrg  need_version=yes
28237e6fb56fSmrg  ;;
28247e6fb56fSmrg
28257e6fb56fSmrgsysv4 | sysv4.3*)
282690b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2827983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2828983b4bf2Smrg  soname_spec='${libname}${release}${shared_ext}$major'
282990b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
28307e6fb56fSmrg  case $host_vendor in
283190b17f1bSmrg    sni)
283290b17f1bSmrg      shlibpath_overrides_runpath=no
283390b17f1bSmrg      need_lib_prefix=no
283490b17f1bSmrg      runpath_var=LD_RUN_PATH
283590b17f1bSmrg      ;;
283690b17f1bSmrg    siemens)
283790b17f1bSmrg      need_lib_prefix=no
283890b17f1bSmrg      ;;
283990b17f1bSmrg    motorola)
284090b17f1bSmrg      need_lib_prefix=no
284190b17f1bSmrg      need_version=no
284290b17f1bSmrg      shlibpath_overrides_runpath=no
284390b17f1bSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
284490b17f1bSmrg      ;;
28457e6fb56fSmrg  esac
28467e6fb56fSmrg  ;;
28477e6fb56fSmrg
284890b17f1bSmrgsysv4*MP*)
2849983b4bf2Smrg  if test -d /usr/nec ;then
285090b17f1bSmrg    version_type=linux # correct to gnu/linux during the next big refactor
2851983b4bf2Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2852983b4bf2Smrg    soname_spec='$libname${shared_ext}.$major'
285390b17f1bSmrg    shlibpath_var=LD_LIBRARY_PATH
285490b17f1bSmrg  fi
28557e6fb56fSmrg  ;;
28567e6fb56fSmrg
285790b17f1bSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2858983b4bf2Smrg  version_type=freebsd-elf
285990b17f1bSmrg  need_lib_prefix=no
286090b17f1bSmrg  need_version=no
2861983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2862983b4bf2Smrg  soname_spec='${libname}${release}${shared_ext}$major'
286390b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
286490b17f1bSmrg  shlibpath_overrides_runpath=yes
286590b17f1bSmrg  hardcode_into_libs=yes
2866983b4bf2Smrg  if test "$with_gnu_ld" = yes; then
286790b17f1bSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
286890b17f1bSmrg  else
286990b17f1bSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
287090b17f1bSmrg    case $host_os in
287190b17f1bSmrg      sco3.2v5*)
287290b17f1bSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
287390b17f1bSmrg	;;
287490b17f1bSmrg    esac
287590b17f1bSmrg  fi
287690b17f1bSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
287790b17f1bSmrg  ;;
28787e6fb56fSmrg
287990b17f1bSmrgtpf*)
288090b17f1bSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
288190b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
288290b17f1bSmrg  need_lib_prefix=no
288390b17f1bSmrg  need_version=no
2884983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
288590b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
288690b17f1bSmrg  shlibpath_overrides_runpath=no
288790b17f1bSmrg  hardcode_into_libs=yes
28887e6fb56fSmrg  ;;
288990b17f1bSmrg
289090b17f1bSmrguts4*)
289190b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2892983b4bf2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2893983b4bf2Smrg  soname_spec='${libname}${release}${shared_ext}$major'
289490b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
28957e6fb56fSmrg  ;;
289690b17f1bSmrg
28977e6fb56fSmrg*)
289890b17f1bSmrg  dynamic_linker=no
28997e6fb56fSmrg  ;;
29007e6fb56fSmrgesac
290190b17f1bSmrgAC_MSG_RESULT([$dynamic_linker])
2902983b4bf2Smrgtest "$dynamic_linker" = no && can_build_shared=no
29037e6fb56fSmrg
290490b17f1bSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2905983b4bf2Smrgif test "$GCC" = yes; then
290690b17f1bSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
290790b17f1bSmrgfi
29087e6fb56fSmrg
2909983b4bf2Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2910983b4bf2Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
291190b17f1bSmrgfi
2912983b4bf2Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2913983b4bf2Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
291490b17f1bSmrgfi
29157e6fb56fSmrg
291690b17f1bSmrg_LT_DECL([], [variables_saved_for_relink], [1],
291790b17f1bSmrg    [Variables whose values should be saved in libtool wrapper scripts and
291890b17f1bSmrg    restored at link time])
291990b17f1bSmrg_LT_DECL([], [need_lib_prefix], [0],
292090b17f1bSmrg    [Do we need the "lib" prefix for modules?])
292190b17f1bSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
292290b17f1bSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
292390b17f1bSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
292490b17f1bSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
292590b17f1bSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
292690b17f1bSmrg    [Is shlibpath searched before the hard-coded library search path?])
292790b17f1bSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
292890b17f1bSmrg_LT_DECL([], [library_names_spec], [1],
292990b17f1bSmrg    [[List of archive names.  First name is the real one, the rest are links.
293090b17f1bSmrg    The last name is the one that the linker finds with -lNAME]])
293190b17f1bSmrg_LT_DECL([], [soname_spec], [1],
293290b17f1bSmrg    [[The coded name of the library, if different from the real name]])
293390b17f1bSmrg_LT_DECL([], [install_override_mode], [1],
293490b17f1bSmrg    [Permission mode override for installation of shared libraries])
293590b17f1bSmrg_LT_DECL([], [postinstall_cmds], [2],
293690b17f1bSmrg    [Command to use after installation of a shared archive])
293790b17f1bSmrg_LT_DECL([], [postuninstall_cmds], [2],
293890b17f1bSmrg    [Command to use after uninstallation of a shared archive])
293990b17f1bSmrg_LT_DECL([], [finish_cmds], [2],
294090b17f1bSmrg    [Commands used to finish a libtool library installation in a directory])
294190b17f1bSmrg_LT_DECL([], [finish_eval], [1],
294290b17f1bSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
294390b17f1bSmrg    not shown]])
294490b17f1bSmrg_LT_DECL([], [hardcode_into_libs], [0],
294590b17f1bSmrg    [Whether we should hardcode library paths into libraries])
294690b17f1bSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
294790b17f1bSmrg    [Compile-time system search path for libraries])
2948983b4bf2Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2949983b4bf2Smrg    [Run-time system search path for libraries])
295090b17f1bSmrg])# _LT_SYS_DYNAMIC_LINKER
295190b17f1bSmrg
295290b17f1bSmrg
295390b17f1bSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
295490b17f1bSmrg# --------------------------
2955983b4bf2Smrg# find a file program which can recognize shared library
295690b17f1bSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
295790b17f1bSmrg[m4_require([_LT_DECL_EGREP])dnl
295890b17f1bSmrgAC_MSG_CHECKING([for $1])
295990b17f1bSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
296090b17f1bSmrg[case $MAGIC_CMD in
296190b17f1bSmrg[[\\/*] |  ?:[\\/]*])
2962983b4bf2Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
296390b17f1bSmrg  ;;
296490b17f1bSmrg*)
2965983b4bf2Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
2966983b4bf2Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
296790b17f1bSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
296890b17f1bSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
296990b17f1bSmrgdnl not every word.  This closes a longstanding sh security hole.
297090b17f1bSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
297190b17f1bSmrg  for ac_dir in $ac_dummy; do
2972983b4bf2Smrg    IFS="$lt_save_ifs"
297390b17f1bSmrg    test -z "$ac_dir" && ac_dir=.
2974983b4bf2Smrg    if test -f $ac_dir/$1; then
2975983b4bf2Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
297690b17f1bSmrg      if test -n "$file_magic_test_file"; then
297790b17f1bSmrg	case $deplibs_check_method in
297890b17f1bSmrg	"file_magic "*)
297990b17f1bSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2980983b4bf2Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
298190b17f1bSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
298290b17f1bSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
298390b17f1bSmrg	    :
298490b17f1bSmrg	  else
298590b17f1bSmrg	    cat <<_LT_EOF 1>&2
29867e6fb56fSmrg
298790b17f1bSmrg*** Warning: the command libtool uses to detect shared libraries,
298890b17f1bSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
298990b17f1bSmrg*** The result is that libtool may fail to recognize shared libraries
299090b17f1bSmrg*** as such.  This will affect the creation of libtool libraries that
299190b17f1bSmrg*** depend on shared libraries, but programs linked with such libtool
299290b17f1bSmrg*** libraries will work regardless of this problem.  Nevertheless, you
299390b17f1bSmrg*** may want to report the problem to your system manager and/or to
299490b17f1bSmrg*** bug-libtool@gnu.org
29957e6fb56fSmrg
299690b17f1bSmrg_LT_EOF
299790b17f1bSmrg	  fi ;;
299890b17f1bSmrg	esac
299990b17f1bSmrg      fi
300090b17f1bSmrg      break
300190b17f1bSmrg    fi
300290b17f1bSmrg  done
3003983b4bf2Smrg  IFS="$lt_save_ifs"
3004983b4bf2Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
300590b17f1bSmrg  ;;
300690b17f1bSmrgesac])
3007983b4bf2SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
300890b17f1bSmrgif test -n "$MAGIC_CMD"; then
300990b17f1bSmrg  AC_MSG_RESULT($MAGIC_CMD)
301090b17f1bSmrgelse
301190b17f1bSmrg  AC_MSG_RESULT(no)
30127e6fb56fSmrgfi
301390b17f1bSmrg_LT_DECL([], [MAGIC_CMD], [0],
301490b17f1bSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
301590b17f1bSmrg])# _LT_PATH_TOOL_PREFIX
30167e6fb56fSmrg
301790b17f1bSmrg# Old name:
301890b17f1bSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
301990b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
302090b17f1bSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
30217e6fb56fSmrg
30227e6fb56fSmrg
302390b17f1bSmrg# _LT_PATH_MAGIC
30247e6fb56fSmrg# --------------
3025983b4bf2Smrg# find a file program which can recognize a shared library
302690b17f1bSmrgm4_defun([_LT_PATH_MAGIC],
302790b17f1bSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
302890b17f1bSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
302990b17f1bSmrg  if test -n "$ac_tool_prefix"; then
303090b17f1bSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
303190b17f1bSmrg  else
303290b17f1bSmrg    MAGIC_CMD=:
303390b17f1bSmrg  fi
303490b17f1bSmrgfi
303590b17f1bSmrg])# _LT_PATH_MAGIC
30367e6fb56fSmrg
30377e6fb56fSmrg
303890b17f1bSmrg# LT_PATH_LD
303990b17f1bSmrg# ----------
304090b17f1bSmrg# find the pathname to the GNU or non-GNU linker
304190b17f1bSmrgAC_DEFUN([LT_PATH_LD],
304290b17f1bSmrg[AC_REQUIRE([AC_PROG_CC])dnl
304390b17f1bSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
304490b17f1bSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
304590b17f1bSmrgm4_require([_LT_DECL_SED])dnl
304690b17f1bSmrgm4_require([_LT_DECL_EGREP])dnl
304790b17f1bSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
30487e6fb56fSmrg
304990b17f1bSmrgAC_ARG_WITH([gnu-ld],
305090b17f1bSmrg    [AS_HELP_STRING([--with-gnu-ld],
305190b17f1bSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3052983b4bf2Smrg    [test "$withval" = no || with_gnu_ld=yes],
305390b17f1bSmrg    [with_gnu_ld=no])dnl
30547e6fb56fSmrg
305590b17f1bSmrgac_prog=ld
3056983b4bf2Smrgif test "$GCC" = yes; then
305790b17f1bSmrg  # Check if gcc -print-prog-name=ld gives a path.
305890b17f1bSmrg  AC_MSG_CHECKING([for ld used by $CC])
305990b17f1bSmrg  case $host in
306090b17f1bSmrg  *-*-mingw*)
3061983b4bf2Smrg    # gcc leaves a trailing carriage return which upsets mingw
306290b17f1bSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
306390b17f1bSmrg  *)
306490b17f1bSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
306590b17f1bSmrg  esac
306690b17f1bSmrg  case $ac_prog in
306790b17f1bSmrg    # Accept absolute paths.
306890b17f1bSmrg    [[\\/]]* | ?:[[\\/]]*)
306990b17f1bSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
307090b17f1bSmrg      # Canonicalize the pathname of ld
307190b17f1bSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
307290b17f1bSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
307390b17f1bSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
307490b17f1bSmrg      done
3075983b4bf2Smrg      test -z "$LD" && LD="$ac_prog"
307690b17f1bSmrg      ;;
307790b17f1bSmrg  "")
307890b17f1bSmrg    # If it fails, then pretend we aren't using GCC.
307990b17f1bSmrg    ac_prog=ld
308090b17f1bSmrg    ;;
308190b17f1bSmrg  *)
308290b17f1bSmrg    # If it is relative, then search for the first ld in PATH.
308390b17f1bSmrg    with_gnu_ld=unknown
308490b17f1bSmrg    ;;
308590b17f1bSmrg  esac
3086983b4bf2Smrgelif test "$with_gnu_ld" = yes; then
308790b17f1bSmrg  AC_MSG_CHECKING([for GNU ld])
308890b17f1bSmrgelse
308990b17f1bSmrg  AC_MSG_CHECKING([for non-GNU ld])
309090b17f1bSmrgfi
309190b17f1bSmrgAC_CACHE_VAL(lt_cv_path_LD,
309290b17f1bSmrg[if test -z "$LD"; then
3093983b4bf2Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
309490b17f1bSmrg  for ac_dir in $PATH; do
3095983b4bf2Smrg    IFS="$lt_save_ifs"
309690b17f1bSmrg    test -z "$ac_dir" && ac_dir=.
309790b17f1bSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3098983b4bf2Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
309990b17f1bSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
310090b17f1bSmrg      # but apparently some variants of GNU ld only accept -v.
310190b17f1bSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
310290b17f1bSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
310390b17f1bSmrg      *GNU* | *'with BFD'*)
3104983b4bf2Smrg	test "$with_gnu_ld" != no && break
310590b17f1bSmrg	;;
310690b17f1bSmrg      *)
3107983b4bf2Smrg	test "$with_gnu_ld" != yes && break
310890b17f1bSmrg	;;
310990b17f1bSmrg      esac
311090b17f1bSmrg    fi
311190b17f1bSmrg  done
3112983b4bf2Smrg  IFS="$lt_save_ifs"
311390b17f1bSmrgelse
3114983b4bf2Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
311590b17f1bSmrgfi])
3116983b4bf2SmrgLD="$lt_cv_path_LD"
311790b17f1bSmrgif test -n "$LD"; then
311890b17f1bSmrg  AC_MSG_RESULT($LD)
311990b17f1bSmrgelse
312090b17f1bSmrg  AC_MSG_RESULT(no)
312190b17f1bSmrgfi
312290b17f1bSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
312390b17f1bSmrg_LT_PATH_LD_GNU
312490b17f1bSmrgAC_SUBST([LD])
31257e6fb56fSmrg
312690b17f1bSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
312790b17f1bSmrg])# LT_PATH_LD
31287e6fb56fSmrg
312990b17f1bSmrg# Old names:
313090b17f1bSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
313190b17f1bSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
313290b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
313390b17f1bSmrgdnl AC_DEFUN([AM_PROG_LD], [])
313490b17f1bSmrgdnl AC_DEFUN([AC_PROG_LD], [])
31357e6fb56fSmrg
31367e6fb56fSmrg
313790b17f1bSmrg# _LT_PATH_LD_GNU
313890b17f1bSmrg#- --------------
313990b17f1bSmrgm4_defun([_LT_PATH_LD_GNU],
314090b17f1bSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
314190b17f1bSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
314290b17f1bSmrgcase `$LD -v 2>&1 </dev/null` in
314390b17f1bSmrg*GNU* | *'with BFD'*)
314490b17f1bSmrg  lt_cv_prog_gnu_ld=yes
314590b17f1bSmrg  ;;
314690b17f1bSmrg*)
314790b17f1bSmrg  lt_cv_prog_gnu_ld=no
314890b17f1bSmrg  ;;
314990b17f1bSmrgesac])
315090b17f1bSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
315190b17f1bSmrg])# _LT_PATH_LD_GNU
31527e6fb56fSmrg
31537e6fb56fSmrg
315490b17f1bSmrg# _LT_CMD_RELOAD
315590b17f1bSmrg# --------------
315690b17f1bSmrg# find reload flag for linker
315790b17f1bSmrg#   -- PORTME Some linkers may need a different reload flag.
315890b17f1bSmrgm4_defun([_LT_CMD_RELOAD],
315990b17f1bSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
316090b17f1bSmrg  lt_cv_ld_reload_flag,
316190b17f1bSmrg  [lt_cv_ld_reload_flag='-r'])
316290b17f1bSmrgreload_flag=$lt_cv_ld_reload_flag
316390b17f1bSmrgcase $reload_flag in
316490b17f1bSmrg"" | " "*) ;;
316590b17f1bSmrg*) reload_flag=" $reload_flag" ;;
316690b17f1bSmrgesac
316790b17f1bSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
31687e6fb56fSmrgcase $host_os in
316990b17f1bSmrg  cygwin* | mingw* | pw32* | cegcc*)
3170983b4bf2Smrg    if test "$GCC" != yes; then
317190b17f1bSmrg      reload_cmds=false
317290b17f1bSmrg    fi
317390b17f1bSmrg    ;;
317490b17f1bSmrg  darwin*)
3175983b4bf2Smrg    if test "$GCC" = yes; then
3176983b4bf2Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
317790b17f1bSmrg    else
317890b17f1bSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
317990b17f1bSmrg    fi
31807e6fb56fSmrg    ;;
31817e6fb56fSmrgesac
318290b17f1bSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
318390b17f1bSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
318490b17f1bSmrg])# _LT_CMD_RELOAD
31857e6fb56fSmrg
31867e6fb56fSmrg
318790b17f1bSmrg# _LT_CHECK_MAGIC_METHOD
318890b17f1bSmrg# ----------------------
318990b17f1bSmrg# how to check for library dependencies
319090b17f1bSmrg#  -- PORTME fill in with the dynamic library characteristics
319190b17f1bSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
319290b17f1bSmrg[m4_require([_LT_DECL_EGREP])
319390b17f1bSmrgm4_require([_LT_DECL_OBJDUMP])
319490b17f1bSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
319590b17f1bSmrglt_cv_deplibs_check_method,
319690b17f1bSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
319790b17f1bSmrglt_cv_file_magic_test_file=
319890b17f1bSmrglt_cv_deplibs_check_method='unknown'
319990b17f1bSmrg# Need to set the preceding variable on all platforms that support
320090b17f1bSmrg# interlibrary dependencies.
320190b17f1bSmrg# 'none' -- dependencies not supported.
3202983b4bf2Smrg# `unknown' -- same as none, but documents that we really don't know.
320390b17f1bSmrg# 'pass_all' -- all dependencies passed with no checks.
320490b17f1bSmrg# 'test_compile' -- check by making test program.
320590b17f1bSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
3206983b4bf2Smrg# which responds to the $file_magic_cmd with a given extended regex.
3207983b4bf2Smrg# If you have `file' or equivalent on your system and you're not sure
3208983b4bf2Smrg# whether `pass_all' will *always* work, you probably want this one.
32097e6fb56fSmrg
321090b17f1bSmrgcase $host_os in
321190b17f1bSmrgaix[[4-9]]*)
321290b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
321390b17f1bSmrg  ;;
32147e6fb56fSmrg
321590b17f1bSmrgbeos*)
321690b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
321790b17f1bSmrg  ;;
32187e6fb56fSmrg
321990b17f1bSmrgbsdi[[45]]*)
322090b17f1bSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
322190b17f1bSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
322290b17f1bSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
322390b17f1bSmrg  ;;
32247e6fb56fSmrg
322590b17f1bSmrgcygwin*)
322690b17f1bSmrg  # func_win32_libid is a shell function defined in ltmain.sh
322790b17f1bSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
322890b17f1bSmrg  lt_cv_file_magic_cmd='func_win32_libid'
322990b17f1bSmrg  ;;
32307e6fb56fSmrg
323190b17f1bSmrgmingw* | pw32*)
323290b17f1bSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
323390b17f1bSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
323490b17f1bSmrg  # unless we find 'file', for example because we are cross-compiling.
3235983b4bf2Smrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
3236983b4bf2Smrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
323790b17f1bSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
323890b17f1bSmrg    lt_cv_file_magic_cmd='func_win32_libid'
323990b17f1bSmrg  else
324090b17f1bSmrg    # Keep this pattern in sync with the one in func_win32_libid.
324190b17f1bSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
324290b17f1bSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
324390b17f1bSmrg  fi
324490b17f1bSmrg  ;;
32457e6fb56fSmrg
324690b17f1bSmrgcegcc*)
324790b17f1bSmrg  # use the weaker test based on 'objdump'. See mingw*.
324890b17f1bSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
324990b17f1bSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
325090b17f1bSmrg  ;;
32517e6fb56fSmrg
325290b17f1bSmrgdarwin* | rhapsody*)
325390b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
325490b17f1bSmrg  ;;
32557e6fb56fSmrg
325690b17f1bSmrgfreebsd* | dragonfly*)
325790b17f1bSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
325890b17f1bSmrg    case $host_cpu in
325990b17f1bSmrg    i*86 )
326090b17f1bSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
326190b17f1bSmrg      # Let's accept both of them until this is cleared up.
326290b17f1bSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
326390b17f1bSmrg      lt_cv_file_magic_cmd=/usr/bin/file
326490b17f1bSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
326590b17f1bSmrg      ;;
326690b17f1bSmrg    esac
326790b17f1bSmrg  else
326890b17f1bSmrg    lt_cv_deplibs_check_method=pass_all
326990b17f1bSmrg  fi
327090b17f1bSmrg  ;;
32717e6fb56fSmrg
3272983b4bf2Smrggnu*)
3273983b4bf2Smrg  lt_cv_deplibs_check_method=pass_all
3274983b4bf2Smrg  ;;
3275983b4bf2Smrg
327690b17f1bSmrghaiku*)
327790b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
327890b17f1bSmrg  ;;
32797e6fb56fSmrg
328090b17f1bSmrghpux10.20* | hpux11*)
328190b17f1bSmrg  lt_cv_file_magic_cmd=/usr/bin/file
328290b17f1bSmrg  case $host_cpu in
328390b17f1bSmrg  ia64*)
328490b17f1bSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
328590b17f1bSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
328690b17f1bSmrg    ;;
328790b17f1bSmrg  hppa*64*)
328890b17f1bSmrg    [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]']
328990b17f1bSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
329090b17f1bSmrg    ;;
329190b17f1bSmrg  *)
329290b17f1bSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
329390b17f1bSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
329490b17f1bSmrg    ;;
329590b17f1bSmrg  esac
329690b17f1bSmrg  ;;
32977e6fb56fSmrg
329890b17f1bSmrginterix[[3-9]]*)
329990b17f1bSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
330090b17f1bSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
330190b17f1bSmrg  ;;
33027e6fb56fSmrg
330390b17f1bSmrgirix5* | irix6* | nonstopux*)
330490b17f1bSmrg  case $LD in
330590b17f1bSmrg  *-32|*"-32 ") libmagic=32-bit;;
330690b17f1bSmrg  *-n32|*"-n32 ") libmagic=N32;;
330790b17f1bSmrg  *-64|*"-64 ") libmagic=64-bit;;
330890b17f1bSmrg  *) libmagic=never-match;;
330990b17f1bSmrg  esac
331090b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
331190b17f1bSmrg  ;;
33127e6fb56fSmrg
331390b17f1bSmrg# This must be glibc/ELF.
3314983b4bf2Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
331590b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
331690b17f1bSmrg  ;;
33177e6fb56fSmrg
3318983b4bf2Smrgnetbsd* | netbsdelf*-gnu)
331990b17f1bSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
332090b17f1bSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
332190b17f1bSmrg  else
332290b17f1bSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
332390b17f1bSmrg  fi
332490b17f1bSmrg  ;;
33257e6fb56fSmrg
332690b17f1bSmrgnewos6*)
332790b17f1bSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
332890b17f1bSmrg  lt_cv_file_magic_cmd=/usr/bin/file
332990b17f1bSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
333090b17f1bSmrg  ;;
33317e6fb56fSmrg
333290b17f1bSmrg*nto* | *qnx*)
333390b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
333490b17f1bSmrg  ;;
33357e6fb56fSmrg
3336983b4bf2Smrgopenbsd*)
3337983b4bf2Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
333890b17f1bSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
33397e6fb56fSmrg  else
334090b17f1bSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
33417e6fb56fSmrg  fi
334290b17f1bSmrg  ;;
33437e6fb56fSmrg
334490b17f1bSmrgosf3* | osf4* | osf5*)
334590b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
334690b17f1bSmrg  ;;
33477e6fb56fSmrg
334890b17f1bSmrgrdos*)
334990b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
335090b17f1bSmrg  ;;
33517e6fb56fSmrg
335290b17f1bSmrgsolaris*)
335390b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
335490b17f1bSmrg  ;;
335590b17f1bSmrg
335690b17f1bSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
335790b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
335890b17f1bSmrg  ;;
335990b17f1bSmrg
336090b17f1bSmrgsysv4 | sysv4.3*)
336190b17f1bSmrg  case $host_vendor in
336290b17f1bSmrg  motorola)
336390b17f1bSmrg    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]]'
336490b17f1bSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
33657e6fb56fSmrg    ;;
336690b17f1bSmrg  ncr)
336790b17f1bSmrg    lt_cv_deplibs_check_method=pass_all
336890b17f1bSmrg    ;;
336990b17f1bSmrg  sequent)
337090b17f1bSmrg    lt_cv_file_magic_cmd='/bin/file'
337190b17f1bSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
337290b17f1bSmrg    ;;
337390b17f1bSmrg  sni)
337490b17f1bSmrg    lt_cv_file_magic_cmd='/bin/file'
337590b17f1bSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
337690b17f1bSmrg    lt_cv_file_magic_test_file=/lib/libc.so
337790b17f1bSmrg    ;;
337890b17f1bSmrg  siemens)
337990b17f1bSmrg    lt_cv_deplibs_check_method=pass_all
338090b17f1bSmrg    ;;
338190b17f1bSmrg  pc)
338290b17f1bSmrg    lt_cv_deplibs_check_method=pass_all
338390b17f1bSmrg    ;;
338490b17f1bSmrg  esac
338590b17f1bSmrg  ;;
338690b17f1bSmrg
338790b17f1bSmrgtpf*)
338890b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
338990b17f1bSmrg  ;;
339090b17f1bSmrgesac
339190b17f1bSmrg])
33927e6fb56fSmrg
339390b17f1bSmrgfile_magic_glob=
339490b17f1bSmrgwant_nocaseglob=no
339590b17f1bSmrgif test "$build" = "$host"; then
339690b17f1bSmrg  case $host_os in
339790b17f1bSmrg  mingw* | pw32*)
339890b17f1bSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
339990b17f1bSmrg      want_nocaseglob=yes
340090b17f1bSmrg    else
340190b17f1bSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
34027e6fb56fSmrg    fi
340390b17f1bSmrg    ;;
340490b17f1bSmrg  esac
340590b17f1bSmrgfi
34067e6fb56fSmrg
340790b17f1bSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
340890b17f1bSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
340990b17f1bSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
34107e6fb56fSmrg
341190b17f1bSmrg_LT_DECL([], [deplibs_check_method], [1],
341290b17f1bSmrg    [Method to check whether dependent libraries are shared objects])
341390b17f1bSmrg_LT_DECL([], [file_magic_cmd], [1],
341490b17f1bSmrg    [Command to use when deplibs_check_method = "file_magic"])
341590b17f1bSmrg_LT_DECL([], [file_magic_glob], [1],
341690b17f1bSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
341790b17f1bSmrg_LT_DECL([], [want_nocaseglob], [1],
341890b17f1bSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
341990b17f1bSmrg])# _LT_CHECK_MAGIC_METHOD
34207e6fb56fSmrg
34217e6fb56fSmrg
342290b17f1bSmrg# LT_PATH_NM
342390b17f1bSmrg# ----------
342490b17f1bSmrg# find the pathname to a BSD- or MS-compatible name lister
342590b17f1bSmrgAC_DEFUN([LT_PATH_NM],
342690b17f1bSmrg[AC_REQUIRE([AC_PROG_CC])dnl
342790b17f1bSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
342890b17f1bSmrg[if test -n "$NM"; then
342990b17f1bSmrg  # Let the user override the test.
3430983b4bf2Smrg  lt_cv_path_NM="$NM"
343190b17f1bSmrgelse
3432983b4bf2Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
343390b17f1bSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
343490b17f1bSmrg    lt_nm_to_check="$lt_nm_to_check nm"
343590b17f1bSmrg  fi
343690b17f1bSmrg  for lt_tmp_nm in $lt_nm_to_check; do
3437983b4bf2Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
343890b17f1bSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3439983b4bf2Smrg      IFS="$lt_save_ifs"
344090b17f1bSmrg      test -z "$ac_dir" && ac_dir=.
3441983b4bf2Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
3442983b4bf2Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
344390b17f1bSmrg	# Check to see if the nm accepts a BSD-compat flag.
3444983b4bf2Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
344590b17f1bSmrg	#   nm: unknown option "B" ignored
344690b17f1bSmrg	# Tru64's nm complains that /dev/null is an invalid object file
3447983b4bf2Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3448983b4bf2Smrg	*/dev/null* | *'Invalid file or object type'*)
344990b17f1bSmrg	  lt_cv_path_NM="$tmp_nm -B"
3450983b4bf2Smrg	  break
345190b17f1bSmrg	  ;;
345290b17f1bSmrg	*)
345390b17f1bSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
345490b17f1bSmrg	  */dev/null*)
345590b17f1bSmrg	    lt_cv_path_NM="$tmp_nm -p"
3456983b4bf2Smrg	    break
345790b17f1bSmrg	    ;;
345890b17f1bSmrg	  *)
345990b17f1bSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
346090b17f1bSmrg	    continue # so that we can try to find one that supports BSD flags
346190b17f1bSmrg	    ;;
346290b17f1bSmrg	  esac
346390b17f1bSmrg	  ;;
346490b17f1bSmrg	esac
34657e6fb56fSmrg      fi
346690b17f1bSmrg    done
3467983b4bf2Smrg    IFS="$lt_save_ifs"
346890b17f1bSmrg  done
346990b17f1bSmrg  : ${lt_cv_path_NM=no}
347090b17f1bSmrgfi])
3471983b4bf2Smrgif test "$lt_cv_path_NM" != "no"; then
3472983b4bf2Smrg  NM="$lt_cv_path_NM"
347390b17f1bSmrgelse
347490b17f1bSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
347590b17f1bSmrg  if test -n "$DUMPBIN"; then :
347690b17f1bSmrg    # Let the user override the test.
347790b17f1bSmrg  else
347890b17f1bSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3479983b4bf2Smrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
348090b17f1bSmrg    *COFF*)
3481983b4bf2Smrg      DUMPBIN="$DUMPBIN -symbols"
34827e6fb56fSmrg      ;;
34837e6fb56fSmrg    *)
348490b17f1bSmrg      DUMPBIN=:
34857e6fb56fSmrg      ;;
34867e6fb56fSmrg    esac
348790b17f1bSmrg  fi
348890b17f1bSmrg  AC_SUBST([DUMPBIN])
3489983b4bf2Smrg  if test "$DUMPBIN" != ":"; then
3490983b4bf2Smrg    NM="$DUMPBIN"
349190b17f1bSmrg  fi
349290b17f1bSmrgfi
349390b17f1bSmrgtest -z "$NM" && NM=nm
349490b17f1bSmrgAC_SUBST([NM])
349590b17f1bSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
349690b17f1bSmrg
349790b17f1bSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
349890b17f1bSmrg  [lt_cv_nm_interface="BSD nm"
349990b17f1bSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
350090b17f1bSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
350190b17f1bSmrg  (eval "$ac_compile" 2>conftest.err)
350290b17f1bSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
350390b17f1bSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
350490b17f1bSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
350590b17f1bSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
350690b17f1bSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
350790b17f1bSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
350890b17f1bSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
350990b17f1bSmrg    lt_cv_nm_interface="MS dumpbin"
351090b17f1bSmrg  fi
351190b17f1bSmrg  rm -f conftest*])
351290b17f1bSmrg])# LT_PATH_NM
351390b17f1bSmrg
351490b17f1bSmrg# Old names:
351590b17f1bSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
351690b17f1bSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
351790b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
351890b17f1bSmrgdnl AC_DEFUN([AM_PROG_NM], [])
351990b17f1bSmrgdnl AC_DEFUN([AC_PROG_NM], [])
352090b17f1bSmrg
352190b17f1bSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
352290b17f1bSmrg# --------------------------------
352390b17f1bSmrg# how to determine the name of the shared library
352490b17f1bSmrg# associated with a specific link library.
352590b17f1bSmrg#  -- PORTME fill in with the dynamic library characteristics
352690b17f1bSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
352790b17f1bSmrg[m4_require([_LT_DECL_EGREP])
352890b17f1bSmrgm4_require([_LT_DECL_OBJDUMP])
352990b17f1bSmrgm4_require([_LT_DECL_DLLTOOL])
353090b17f1bSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
353190b17f1bSmrglt_cv_sharedlib_from_linklib_cmd,
353290b17f1bSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
35337e6fb56fSmrg
353490b17f1bSmrgcase $host_os in
353590b17f1bSmrgcygwin* | mingw* | pw32* | cegcc*)
3536983b4bf2Smrg  # two different shell functions defined in ltmain.sh
3537983b4bf2Smrg  # decide which to use based on capabilities of $DLLTOOL
353890b17f1bSmrg  case `$DLLTOOL --help 2>&1` in
353990b17f1bSmrg  *--identify-strict*)
354090b17f1bSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
35417e6fb56fSmrg    ;;
354290b17f1bSmrg  *)
354390b17f1bSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
35447e6fb56fSmrg    ;;
354590b17f1bSmrg  esac
354690b17f1bSmrg  ;;
354790b17f1bSmrg*)
354890b17f1bSmrg  # fallback: assume linklib IS sharedlib
3549983b4bf2Smrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
355090b17f1bSmrg  ;;
355190b17f1bSmrgesac
355290b17f1bSmrg])
355390b17f1bSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
355490b17f1bSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
35557e6fb56fSmrg
355690b17f1bSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
355790b17f1bSmrg    [Command to associate shared and link libraries])
355890b17f1bSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
35597e6fb56fSmrg
35607e6fb56fSmrg
356190b17f1bSmrg# _LT_PATH_MANIFEST_TOOL
356290b17f1bSmrg# ----------------------
356390b17f1bSmrg# locate the manifest tool
356490b17f1bSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
356590b17f1bSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
356690b17f1bSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
356790b17f1bSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
356890b17f1bSmrg  [lt_cv_path_mainfest_tool=no
356990b17f1bSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
357090b17f1bSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
357190b17f1bSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
357290b17f1bSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
357390b17f1bSmrg    lt_cv_path_mainfest_tool=yes
357490b17f1bSmrg  fi
357590b17f1bSmrg  rm -f conftest*])
3576983b4bf2Smrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
357790b17f1bSmrg  MANIFEST_TOOL=:
357890b17f1bSmrgfi
357990b17f1bSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
358090b17f1bSmrg])# _LT_PATH_MANIFEST_TOOL
35817e6fb56fSmrg
35827e6fb56fSmrg
358390b17f1bSmrg# LT_LIB_M
358490b17f1bSmrg# --------
358590b17f1bSmrg# check for math library
358690b17f1bSmrgAC_DEFUN([LT_LIB_M],
358790b17f1bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
358890b17f1bSmrgLIBM=
358990b17f1bSmrgcase $host in
359090b17f1bSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
359190b17f1bSmrg  # These system don't have libm, or don't need it
359290b17f1bSmrg  ;;
359390b17f1bSmrg*-ncr-sysv4.3*)
3594983b4bf2Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
359590b17f1bSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
359690b17f1bSmrg  ;;
359790b17f1bSmrg*)
3598983b4bf2Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
359990b17f1bSmrg  ;;
360090b17f1bSmrgesac
360190b17f1bSmrgAC_SUBST([LIBM])
360290b17f1bSmrg])# LT_LIB_M
36037e6fb56fSmrg
360490b17f1bSmrg# Old name:
360590b17f1bSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
360690b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
360790b17f1bSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
36087e6fb56fSmrg
36097e6fb56fSmrg
361090b17f1bSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
361190b17f1bSmrg# -------------------------------
361290b17f1bSmrgm4_defun([_LT_COMPILER_NO_RTTI],
361390b17f1bSmrg[m4_require([_LT_TAG_COMPILER])dnl
36147e6fb56fSmrg
361590b17f1bSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
36167e6fb56fSmrg
3617983b4bf2Smrgif test "$GCC" = yes; then
361890b17f1bSmrg  case $cc_basename in
361990b17f1bSmrg  nvcc*)
362090b17f1bSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
362190b17f1bSmrg  *)
362290b17f1bSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
362390b17f1bSmrg  esac
36247e6fb56fSmrg
362590b17f1bSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
362690b17f1bSmrg    lt_cv_prog_compiler_rtti_exceptions,
362790b17f1bSmrg    [-fno-rtti -fno-exceptions], [],
362890b17f1bSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
362990b17f1bSmrgfi
363090b17f1bSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
363190b17f1bSmrg	[Compiler flag to turn off builtin functions])
363290b17f1bSmrg])# _LT_COMPILER_NO_RTTI
36337e6fb56fSmrg
36347e6fb56fSmrg
363590b17f1bSmrg# _LT_CMD_GLOBAL_SYMBOLS
363690b17f1bSmrg# ----------------------
363790b17f1bSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
363890b17f1bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
363990b17f1bSmrgAC_REQUIRE([AC_PROG_CC])dnl
364090b17f1bSmrgAC_REQUIRE([AC_PROG_AWK])dnl
364190b17f1bSmrgAC_REQUIRE([LT_PATH_NM])dnl
364290b17f1bSmrgAC_REQUIRE([LT_PATH_LD])dnl
364390b17f1bSmrgm4_require([_LT_DECL_SED])dnl
364490b17f1bSmrgm4_require([_LT_DECL_EGREP])dnl
364590b17f1bSmrgm4_require([_LT_TAG_COMPILER])dnl
36467e6fb56fSmrg
364790b17f1bSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
364890b17f1bSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
364990b17f1bSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
365090b17f1bSmrg[
365190b17f1bSmrg# These are sane defaults that work on at least a few old systems.
365290b17f1bSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
36537e6fb56fSmrg
365490b17f1bSmrg# Character class describing NM global symbol codes.
365590b17f1bSmrgsymcode='[[BCDEGRST]]'
36567e6fb56fSmrg
365790b17f1bSmrg# Regexp to match symbols that can be accessed directly from C.
365890b17f1bSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
36597e6fb56fSmrg
366090b17f1bSmrg# Define system-specific variables.
366190b17f1bSmrgcase $host_os in
366290b17f1bSmrgaix*)
366390b17f1bSmrg  symcode='[[BCDT]]'
366490b17f1bSmrg  ;;
366590b17f1bSmrgcygwin* | mingw* | pw32* | cegcc*)
366690b17f1bSmrg  symcode='[[ABCDGISTW]]'
366790b17f1bSmrg  ;;
366890b17f1bSmrghpux*)
3669983b4bf2Smrg  if test "$host_cpu" = ia64; then
367090b17f1bSmrg    symcode='[[ABCDEGRST]]'
367190b17f1bSmrg  fi
367290b17f1bSmrg  ;;
367390b17f1bSmrgirix* | nonstopux*)
367490b17f1bSmrg  symcode='[[BCDEGRST]]'
367590b17f1bSmrg  ;;
367690b17f1bSmrgosf*)
367790b17f1bSmrg  symcode='[[BCDEGQRST]]'
367890b17f1bSmrg  ;;
367990b17f1bSmrgsolaris*)
368090b17f1bSmrg  symcode='[[BDRT]]'
368190b17f1bSmrg  ;;
368290b17f1bSmrgsco3.2v5*)
368390b17f1bSmrg  symcode='[[DT]]'
368490b17f1bSmrg  ;;
368590b17f1bSmrgsysv4.2uw2*)
368690b17f1bSmrg  symcode='[[DT]]'
368790b17f1bSmrg  ;;
368890b17f1bSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
368990b17f1bSmrg  symcode='[[ABDT]]'
369090b17f1bSmrg  ;;
369190b17f1bSmrgsysv4)
369290b17f1bSmrg  symcode='[[DFNSTU]]'
369390b17f1bSmrg  ;;
36947e6fb56fSmrgesac
36957e6fb56fSmrg
369690b17f1bSmrg# If we're using GNU nm, then use its standard symbol codes.
369790b17f1bSmrgcase `$NM -V 2>&1` in
369890b17f1bSmrg*GNU* | *'with BFD'*)
369990b17f1bSmrg  symcode='[[ABCDGIRSTW]]' ;;
370090b17f1bSmrgesac
37017e6fb56fSmrg
370290b17f1bSmrg# Transform an extracted symbol line into a proper C declaration.
370390b17f1bSmrg# Some systems (esp. on ia64) link data and code symbols differently,
370490b17f1bSmrg# so use this general approach.
3705983b4bf2Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
37067e6fb56fSmrg
370790b17f1bSmrg# Transform an extracted symbol line into symbol name and symbol address
3708983b4bf2Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
3709983b4bf2Smrglt_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'"
37107e6fb56fSmrg
371190b17f1bSmrg# Handle CRLF in mingw tool chain
371290b17f1bSmrgopt_cr=
371390b17f1bSmrgcase $build_os in
371490b17f1bSmrgmingw*)
371590b17f1bSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
371690b17f1bSmrg  ;;
371790b17f1bSmrgesac
37187e6fb56fSmrg
371990b17f1bSmrg# Try without a prefix underscore, then with it.
372090b17f1bSmrgfor ac_symprfx in "" "_"; do
37217e6fb56fSmrg
372290b17f1bSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
372390b17f1bSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
37247e6fb56fSmrg
372590b17f1bSmrg  # Write the raw and C identifiers.
372690b17f1bSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3727983b4bf2Smrg    # Fake it for dumpbin and say T for any non-static function
3728983b4bf2Smrg    # and D for any global variable.
372990b17f1bSmrg    # Also find C++ and __fastcall symbols from MSVC++,
373090b17f1bSmrg    # which start with @ or ?.
373190b17f1bSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
373290b17f1bSmrg"     {last_section=section; section=\$ 3};"\
373390b17f1bSmrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
373490b17f1bSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
373590b17f1bSmrg"     \$ 0!~/External *\|/{next};"\
373690b17f1bSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
373790b17f1bSmrg"     {if(hide[section]) next};"\
3738983b4bf2Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3739983b4bf2Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3740983b4bf2Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
3741983b4bf2Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
374290b17f1bSmrg"     ' prfx=^$ac_symprfx]"
374390b17f1bSmrg  else
374490b17f1bSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
374590b17f1bSmrg  fi
374690b17f1bSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
37477e6fb56fSmrg
374890b17f1bSmrg  # Check to see that the pipe works correctly.
374990b17f1bSmrg  pipe_works=no
37507e6fb56fSmrg
375190b17f1bSmrg  rm -f conftest*
375290b17f1bSmrg  cat > conftest.$ac_ext <<_LT_EOF
375390b17f1bSmrg#ifdef __cplusplus
375490b17f1bSmrgextern "C" {
375590b17f1bSmrg#endif
375690b17f1bSmrgchar nm_test_var;
375790b17f1bSmrgvoid nm_test_func(void);
375890b17f1bSmrgvoid nm_test_func(void){}
375990b17f1bSmrg#ifdef __cplusplus
376090b17f1bSmrg}
376190b17f1bSmrg#endif
376290b17f1bSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
376390b17f1bSmrg_LT_EOF
37647e6fb56fSmrg
376590b17f1bSmrg  if AC_TRY_EVAL(ac_compile); then
376690b17f1bSmrg    # Now try to grab the symbols.
376790b17f1bSmrg    nlist=conftest.nm
376890b17f1bSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
376990b17f1bSmrg      # Try sorting and uniquifying the output.
377090b17f1bSmrg      if sort "$nlist" | uniq > "$nlist"T; then
377190b17f1bSmrg	mv -f "$nlist"T "$nlist"
377290b17f1bSmrg      else
377390b17f1bSmrg	rm -f "$nlist"T
377490b17f1bSmrg      fi
37757e6fb56fSmrg
377690b17f1bSmrg      # Make sure that we snagged all the symbols we need.
377790b17f1bSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
377890b17f1bSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
377990b17f1bSmrg	  cat <<_LT_EOF > conftest.$ac_ext
378090b17f1bSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
3781983b4bf2Smrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3782983b4bf2Smrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
378390b17f1bSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
378490b17f1bSmrg# define LT@&t@_DLSYM_CONST
3785983b4bf2Smrg#elif defined(__osf__)
378690b17f1bSmrg/* This system does not cope well with relocations in const data.  */
378790b17f1bSmrg# define LT@&t@_DLSYM_CONST
378890b17f1bSmrg#else
378990b17f1bSmrg# define LT@&t@_DLSYM_CONST const
379090b17f1bSmrg#endif
37917e6fb56fSmrg
379290b17f1bSmrg#ifdef __cplusplus
379390b17f1bSmrgextern "C" {
379490b17f1bSmrg#endif
37957e6fb56fSmrg
379690b17f1bSmrg_LT_EOF
379790b17f1bSmrg	  # Now generate the symbol file.
379890b17f1bSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
37997e6fb56fSmrg
380090b17f1bSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
38017e6fb56fSmrg
380290b17f1bSmrg/* The mapping between symbol names and symbols.  */
380390b17f1bSmrgLT@&t@_DLSYM_CONST struct {
380490b17f1bSmrg  const char *name;
380590b17f1bSmrg  void       *address;
380690b17f1bSmrg}
380790b17f1bSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
380890b17f1bSmrg{
380990b17f1bSmrg  { "@PROGRAM@", (void *) 0 },
381090b17f1bSmrg_LT_EOF
3811983b4bf2Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
381290b17f1bSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
381390b17f1bSmrg  {0, (void *) 0}
381490b17f1bSmrg};
38157e6fb56fSmrg
381690b17f1bSmrg/* This works around a problem in FreeBSD linker */
381790b17f1bSmrg#ifdef FREEBSD_WORKAROUND
381890b17f1bSmrgstatic const void *lt_preloaded_setup() {
381990b17f1bSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
382090b17f1bSmrg}
382190b17f1bSmrg#endif
38227e6fb56fSmrg
382390b17f1bSmrg#ifdef __cplusplus
382490b17f1bSmrg}
382590b17f1bSmrg#endif
382690b17f1bSmrg_LT_EOF
382790b17f1bSmrg	  # Now try linking the two files.
382890b17f1bSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
382990b17f1bSmrg	  lt_globsym_save_LIBS=$LIBS
383090b17f1bSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
3831983b4bf2Smrg	  LIBS="conftstm.$ac_objext"
383290b17f1bSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3833983b4bf2Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
383490b17f1bSmrg	    pipe_works=yes
383590b17f1bSmrg	  fi
383690b17f1bSmrg	  LIBS=$lt_globsym_save_LIBS
383790b17f1bSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
383890b17f1bSmrg	else
383990b17f1bSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
384090b17f1bSmrg	fi
384190b17f1bSmrg      else
384290b17f1bSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
384390b17f1bSmrg      fi
384490b17f1bSmrg    else
384590b17f1bSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
38467e6fb56fSmrg    fi
384790b17f1bSmrg  else
384890b17f1bSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
384990b17f1bSmrg    cat conftest.$ac_ext >&5
38507e6fb56fSmrg  fi
385190b17f1bSmrg  rm -rf conftest* conftst*
38527e6fb56fSmrg
385390b17f1bSmrg  # Do not use the global_symbol_pipe unless it works.
3854983b4bf2Smrg  if test "$pipe_works" = yes; then
385590b17f1bSmrg    break
385690b17f1bSmrg  else
385790b17f1bSmrg    lt_cv_sys_global_symbol_pipe=
385890b17f1bSmrg  fi
385990b17f1bSmrgdone
386090b17f1bSmrg])
386190b17f1bSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
386290b17f1bSmrg  lt_cv_sys_global_symbol_to_cdecl=
386390b17f1bSmrgfi
386490b17f1bSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
386590b17f1bSmrg  AC_MSG_RESULT(failed)
386690b17f1bSmrgelse
386790b17f1bSmrg  AC_MSG_RESULT(ok)
386890b17f1bSmrgfi
38697e6fb56fSmrg
387090b17f1bSmrg# Response file support.
387190b17f1bSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
387290b17f1bSmrg  nm_file_list_spec='@'
387390b17f1bSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
387490b17f1bSmrg  nm_file_list_spec='@'
387590b17f1bSmrgfi
38767e6fb56fSmrg
387790b17f1bSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
387890b17f1bSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
387990b17f1bSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
388090b17f1bSmrg    [Transform the output of nm in a proper C declaration])
388190b17f1bSmrg_LT_DECL([global_symbol_to_c_name_address],
388290b17f1bSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
388390b17f1bSmrg    [Transform the output of nm in a C name address pair])
388490b17f1bSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
388590b17f1bSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
388690b17f1bSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
388790b17f1bSmrg_LT_DECL([], [nm_file_list_spec], [1],
388890b17f1bSmrg    [Specify filename containing input files for $NM])
388990b17f1bSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
389090b17f1bSmrg
389190b17f1bSmrg
389290b17f1bSmrg# _LT_COMPILER_PIC([TAGNAME])
389390b17f1bSmrg# ---------------------------
389490b17f1bSmrgm4_defun([_LT_COMPILER_PIC],
389590b17f1bSmrg[m4_require([_LT_TAG_COMPILER])dnl
389690b17f1bSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
389790b17f1bSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
389890b17f1bSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
38997e6fb56fSmrg
390090b17f1bSmrgm4_if([$1], [CXX], [
390190b17f1bSmrg  # C++ specific cases for pic, static, wl, etc.
3902983b4bf2Smrg  if test "$GXX" = yes; then
390390b17f1bSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
390490b17f1bSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
39057e6fb56fSmrg
390690b17f1bSmrg    case $host_os in
390790b17f1bSmrg    aix*)
390890b17f1bSmrg      # All AIX code is PIC.
3909983b4bf2Smrg      if test "$host_cpu" = ia64; then
391090b17f1bSmrg	# AIX 5 now supports IA64 processor
391190b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
391290b17f1bSmrg      fi
391390b17f1bSmrg      ;;
39147e6fb56fSmrg
391590b17f1bSmrg    amigaos*)
391690b17f1bSmrg      case $host_cpu in
391790b17f1bSmrg      powerpc)
391890b17f1bSmrg            # see comment about AmigaOS4 .so support
391990b17f1bSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
392090b17f1bSmrg        ;;
392190b17f1bSmrg      m68k)
392290b17f1bSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
3923983b4bf2Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
3924983b4bf2Smrg            # like `-m68040'.
392590b17f1bSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
392690b17f1bSmrg        ;;
392790b17f1bSmrg      esac
392890b17f1bSmrg      ;;
39297e6fb56fSmrg
393090b17f1bSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
393190b17f1bSmrg      # PIC is the default for these OSes.
393290b17f1bSmrg      ;;
393390b17f1bSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
393490b17f1bSmrg      # This hack is so that the source file can tell whether it is being
393590b17f1bSmrg      # built for inclusion in a dll (and should export symbols for example).
393690b17f1bSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
393790b17f1bSmrg      # (--disable-auto-import) libraries
393890b17f1bSmrg      m4_if([$1], [GCJ], [],
393990b17f1bSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
394090b17f1bSmrg      ;;
394190b17f1bSmrg    darwin* | rhapsody*)
394290b17f1bSmrg      # PIC is the default on this platform
394390b17f1bSmrg      # Common symbols not allowed in MH_DYLIB files
394490b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
394590b17f1bSmrg      ;;
394690b17f1bSmrg    *djgpp*)
394790b17f1bSmrg      # DJGPP does not support shared libraries at all
394890b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
394990b17f1bSmrg      ;;
395090b17f1bSmrg    haiku*)
395190b17f1bSmrg      # PIC is the default for Haiku.
395290b17f1bSmrg      # The "-static" flag exists, but is broken.
395390b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
395490b17f1bSmrg      ;;
395590b17f1bSmrg    interix[[3-9]]*)
395690b17f1bSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
395790b17f1bSmrg      # Instead, we relocate shared libraries at runtime.
395890b17f1bSmrg      ;;
395990b17f1bSmrg    sysv4*MP*)
396090b17f1bSmrg      if test -d /usr/nec; then
396190b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
396290b17f1bSmrg      fi
396390b17f1bSmrg      ;;
396490b17f1bSmrg    hpux*)
396590b17f1bSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
396690b17f1bSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
396790b17f1bSmrg      # sets the default TLS model and affects inlining.
396890b17f1bSmrg      case $host_cpu in
396990b17f1bSmrg      hppa*64*)
397090b17f1bSmrg	;;
397190b17f1bSmrg      *)
397290b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
397390b17f1bSmrg	;;
397490b17f1bSmrg      esac
397590b17f1bSmrg      ;;
397690b17f1bSmrg    *qnx* | *nto*)
397790b17f1bSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
397890b17f1bSmrg      # it will coredump.
397990b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
39807e6fb56fSmrg      ;;
39817e6fb56fSmrg    *)
398290b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39837e6fb56fSmrg      ;;
39847e6fb56fSmrg    esac
398590b17f1bSmrg  else
398690b17f1bSmrg    case $host_os in
398790b17f1bSmrg      aix[[4-9]]*)
398890b17f1bSmrg	# All AIX code is PIC.
3989983b4bf2Smrg	if test "$host_cpu" = ia64; then
399090b17f1bSmrg	  # AIX 5 now supports IA64 processor
399190b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
399290b17f1bSmrg	else
399390b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
399490b17f1bSmrg	fi
399590b17f1bSmrg	;;
399690b17f1bSmrg      chorus*)
399790b17f1bSmrg	case $cc_basename in
399890b17f1bSmrg	cxch68*)
399990b17f1bSmrg	  # Green Hills C++ Compiler
400090b17f1bSmrg	  # _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"
400190b17f1bSmrg	  ;;
400290b17f1bSmrg	esac
400390b17f1bSmrg	;;
400490b17f1bSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
400590b17f1bSmrg	# This hack is so that the source file can tell whether it is being
400690b17f1bSmrg	# built for inclusion in a dll (and should export symbols for example).
400790b17f1bSmrg	m4_if([$1], [GCJ], [],
400890b17f1bSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
400990b17f1bSmrg	;;
401090b17f1bSmrg      dgux*)
401190b17f1bSmrg	case $cc_basename in
401290b17f1bSmrg	  ec++*)
401390b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
401490b17f1bSmrg	    ;;
401590b17f1bSmrg	  ghcx*)
401690b17f1bSmrg	    # Green Hills C++ Compiler
401790b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
401890b17f1bSmrg	    ;;
401990b17f1bSmrg	  *)
402090b17f1bSmrg	    ;;
402190b17f1bSmrg	esac
402290b17f1bSmrg	;;
402390b17f1bSmrg      freebsd* | dragonfly*)
402490b17f1bSmrg	# FreeBSD uses GNU C++
402590b17f1bSmrg	;;
402690b17f1bSmrg      hpux9* | hpux10* | hpux11*)
402790b17f1bSmrg	case $cc_basename in
402890b17f1bSmrg	  CC*)
402990b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4030983b4bf2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4031983b4bf2Smrg	    if test "$host_cpu" != ia64; then
403290b17f1bSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
403390b17f1bSmrg	    fi
403490b17f1bSmrg	    ;;
403590b17f1bSmrg	  aCC*)
403690b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4037983b4bf2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
403890b17f1bSmrg	    case $host_cpu in
403990b17f1bSmrg	    hppa*64*|ia64*)
404090b17f1bSmrg	      # +Z the default
404190b17f1bSmrg	      ;;
404290b17f1bSmrg	    *)
404390b17f1bSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
404490b17f1bSmrg	      ;;
404590b17f1bSmrg	    esac
404690b17f1bSmrg	    ;;
404790b17f1bSmrg	  *)
404890b17f1bSmrg	    ;;
404990b17f1bSmrg	esac
405090b17f1bSmrg	;;
405190b17f1bSmrg      interix*)
405290b17f1bSmrg	# This is c89, which is MS Visual C++ (no shared libs)
405390b17f1bSmrg	# Anyone wants to do a port?
405490b17f1bSmrg	;;
405590b17f1bSmrg      irix5* | irix6* | nonstopux*)
405690b17f1bSmrg	case $cc_basename in
405790b17f1bSmrg	  CC*)
405890b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
405990b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
406090b17f1bSmrg	    # CC pic flag -KPIC is the default.
406190b17f1bSmrg	    ;;
406290b17f1bSmrg	  *)
406390b17f1bSmrg	    ;;
406490b17f1bSmrg	esac
406590b17f1bSmrg	;;
4066983b4bf2Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
406790b17f1bSmrg	case $cc_basename in
406890b17f1bSmrg	  KCC*)
406990b17f1bSmrg	    # KAI C++ Compiler
407090b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
407190b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
407290b17f1bSmrg	    ;;
407390b17f1bSmrg	  ecpc* )
4074983b4bf2Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
407590b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
407690b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
407790b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
407890b17f1bSmrg	    ;;
407990b17f1bSmrg	  icpc* )
408090b17f1bSmrg	    # Intel C++, used to be incompatible with GCC.
408190b17f1bSmrg	    # ICC 10 doesn't accept -KPIC any more.
408290b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
408390b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
408490b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
408590b17f1bSmrg	    ;;
408690b17f1bSmrg	  pgCC* | pgcpp*)
408790b17f1bSmrg	    # Portland Group C++ compiler
408890b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
408990b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
409090b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
409190b17f1bSmrg	    ;;
409290b17f1bSmrg	  cxx*)
409390b17f1bSmrg	    # Compaq C++
409490b17f1bSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
409590b17f1bSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
409690b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
409790b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
409890b17f1bSmrg	    ;;
409990b17f1bSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
410090b17f1bSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
410190b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
410290b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
410390b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
410490b17f1bSmrg	    ;;
410590b17f1bSmrg	  *)
410690b17f1bSmrg	    case `$CC -V 2>&1 | sed 5q` in
410790b17f1bSmrg	    *Sun\ C*)
410890b17f1bSmrg	      # Sun C++ 5.9
410990b17f1bSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
411090b17f1bSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
411190b17f1bSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
411290b17f1bSmrg	      ;;
411390b17f1bSmrg	    esac
411490b17f1bSmrg	    ;;
411590b17f1bSmrg	esac
411690b17f1bSmrg	;;
411790b17f1bSmrg      lynxos*)
411890b17f1bSmrg	;;
411990b17f1bSmrg      m88k*)
412090b17f1bSmrg	;;
412190b17f1bSmrg      mvs*)
412290b17f1bSmrg	case $cc_basename in
412390b17f1bSmrg	  cxx*)
412490b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
412590b17f1bSmrg	    ;;
412690b17f1bSmrg	  *)
412790b17f1bSmrg	    ;;
412890b17f1bSmrg	esac
412990b17f1bSmrg	;;
4130983b4bf2Smrg      netbsd* | netbsdelf*-gnu)
413190b17f1bSmrg	;;
413290b17f1bSmrg      *qnx* | *nto*)
413390b17f1bSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
413490b17f1bSmrg        # it will coredump.
413590b17f1bSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
413690b17f1bSmrg        ;;
413790b17f1bSmrg      osf3* | osf4* | osf5*)
413890b17f1bSmrg	case $cc_basename in
413990b17f1bSmrg	  KCC*)
414090b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
414190b17f1bSmrg	    ;;
414290b17f1bSmrg	  RCC*)
414390b17f1bSmrg	    # Rational C++ 2.4.1
414490b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
414590b17f1bSmrg	    ;;
414690b17f1bSmrg	  cxx*)
414790b17f1bSmrg	    # Digital/Compaq C++
414890b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
414990b17f1bSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
415090b17f1bSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
415190b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
415290b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
415390b17f1bSmrg	    ;;
415490b17f1bSmrg	  *)
415590b17f1bSmrg	    ;;
415690b17f1bSmrg	esac
415790b17f1bSmrg	;;
415890b17f1bSmrg      psos*)
415990b17f1bSmrg	;;
416090b17f1bSmrg      solaris*)
416190b17f1bSmrg	case $cc_basename in
416290b17f1bSmrg	  CC* | sunCC*)
416390b17f1bSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
416490b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
416590b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
416690b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
416790b17f1bSmrg	    ;;
416890b17f1bSmrg	  gcx*)
416990b17f1bSmrg	    # Green Hills C++ Compiler
417090b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
417190b17f1bSmrg	    ;;
417290b17f1bSmrg	  *)
417390b17f1bSmrg	    ;;
417490b17f1bSmrg	esac
417590b17f1bSmrg	;;
417690b17f1bSmrg      sunos4*)
417790b17f1bSmrg	case $cc_basename in
417890b17f1bSmrg	  CC*)
417990b17f1bSmrg	    # Sun C++ 4.x
418090b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
418190b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
418290b17f1bSmrg	    ;;
418390b17f1bSmrg	  lcc*)
418490b17f1bSmrg	    # Lucid
418590b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
418690b17f1bSmrg	    ;;
418790b17f1bSmrg	  *)
418890b17f1bSmrg	    ;;
418990b17f1bSmrg	esac
419090b17f1bSmrg	;;
419190b17f1bSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
419290b17f1bSmrg	case $cc_basename in
419390b17f1bSmrg	  CC*)
419490b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
419590b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
419690b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
419790b17f1bSmrg	    ;;
419890b17f1bSmrg	esac
419990b17f1bSmrg	;;
420090b17f1bSmrg      tandem*)
420190b17f1bSmrg	case $cc_basename in
420290b17f1bSmrg	  NCC*)
420390b17f1bSmrg	    # NonStop-UX NCC 3.20
420490b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
420590b17f1bSmrg	    ;;
420690b17f1bSmrg	  *)
420790b17f1bSmrg	    ;;
420890b17f1bSmrg	esac
420990b17f1bSmrg	;;
421090b17f1bSmrg      vxworks*)
421190b17f1bSmrg	;;
421290b17f1bSmrg      *)
421390b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
421490b17f1bSmrg	;;
421590b17f1bSmrg    esac
421690b17f1bSmrg  fi
421790b17f1bSmrg],
421890b17f1bSmrg[
4219983b4bf2Smrg  if test "$GCC" = yes; then
422090b17f1bSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
422190b17f1bSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
42227e6fb56fSmrg
422390b17f1bSmrg    case $host_os in
422490b17f1bSmrg      aix*)
422590b17f1bSmrg      # All AIX code is PIC.
4226983b4bf2Smrg      if test "$host_cpu" = ia64; then
422790b17f1bSmrg	# AIX 5 now supports IA64 processor
422890b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
422990b17f1bSmrg      fi
423090b17f1bSmrg      ;;
42317e6fb56fSmrg
423290b17f1bSmrg    amigaos*)
423390b17f1bSmrg      case $host_cpu in
423490b17f1bSmrg      powerpc)
423590b17f1bSmrg            # see comment about AmigaOS4 .so support
423690b17f1bSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
423790b17f1bSmrg        ;;
423890b17f1bSmrg      m68k)
423990b17f1bSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
4240983b4bf2Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
4241983b4bf2Smrg            # like `-m68040'.
424290b17f1bSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
424390b17f1bSmrg        ;;
424490b17f1bSmrg      esac
424590b17f1bSmrg      ;;
42467e6fb56fSmrg
424790b17f1bSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
424890b17f1bSmrg      # PIC is the default for these OSes.
424990b17f1bSmrg      ;;
42507e6fb56fSmrg
425190b17f1bSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
425290b17f1bSmrg      # This hack is so that the source file can tell whether it is being
425390b17f1bSmrg      # built for inclusion in a dll (and should export symbols for example).
425490b17f1bSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
425590b17f1bSmrg      # (--disable-auto-import) libraries
425690b17f1bSmrg      m4_if([$1], [GCJ], [],
425790b17f1bSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
425890b17f1bSmrg      ;;
42597e6fb56fSmrg
426090b17f1bSmrg    darwin* | rhapsody*)
426190b17f1bSmrg      # PIC is the default on this platform
426290b17f1bSmrg      # Common symbols not allowed in MH_DYLIB files
426390b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
426490b17f1bSmrg      ;;
42657e6fb56fSmrg
426690b17f1bSmrg    haiku*)
426790b17f1bSmrg      # PIC is the default for Haiku.
426890b17f1bSmrg      # The "-static" flag exists, but is broken.
426990b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
427090b17f1bSmrg      ;;
42717e6fb56fSmrg
427290b17f1bSmrg    hpux*)
427390b17f1bSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
427490b17f1bSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
427590b17f1bSmrg      # sets the default TLS model and affects inlining.
427690b17f1bSmrg      case $host_cpu in
427790b17f1bSmrg      hppa*64*)
427890b17f1bSmrg	# +Z the default
427990b17f1bSmrg	;;
428090b17f1bSmrg      *)
428190b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
428290b17f1bSmrg	;;
428390b17f1bSmrg      esac
428490b17f1bSmrg      ;;
42857e6fb56fSmrg
428690b17f1bSmrg    interix[[3-9]]*)
428790b17f1bSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
428890b17f1bSmrg      # Instead, we relocate shared libraries at runtime.
428990b17f1bSmrg      ;;
42907e6fb56fSmrg
429190b17f1bSmrg    msdosdjgpp*)
429290b17f1bSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
429390b17f1bSmrg      # on systems that don't support them.
429490b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
429590b17f1bSmrg      enable_shared=no
429690b17f1bSmrg      ;;
42977e6fb56fSmrg
429890b17f1bSmrg    *nto* | *qnx*)
429990b17f1bSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
430090b17f1bSmrg      # it will coredump.
430190b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
430290b17f1bSmrg      ;;
43037e6fb56fSmrg
430490b17f1bSmrg    sysv4*MP*)
430590b17f1bSmrg      if test -d /usr/nec; then
430690b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
430790b17f1bSmrg      fi
430890b17f1bSmrg      ;;
43097e6fb56fSmrg
431090b17f1bSmrg    *)
431190b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
431290b17f1bSmrg      ;;
431390b17f1bSmrg    esac
43147e6fb56fSmrg
431590b17f1bSmrg    case $cc_basename in
431690b17f1bSmrg    nvcc*) # Cuda Compiler Driver 2.2
431790b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
431890b17f1bSmrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
431990b17f1bSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
432090b17f1bSmrg      fi
432190b17f1bSmrg      ;;
432290b17f1bSmrg    esac
432390b17f1bSmrg  else
432490b17f1bSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
432590b17f1bSmrg    case $host_os in
432690b17f1bSmrg    aix*)
432790b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4328983b4bf2Smrg      if test "$host_cpu" = ia64; then
432990b17f1bSmrg	# AIX 5 now supports IA64 processor
433090b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
433190b17f1bSmrg      else
433290b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
433390b17f1bSmrg      fi
433490b17f1bSmrg      ;;
43357e6fb56fSmrg
433690b17f1bSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
433790b17f1bSmrg      # This hack is so that the source file can tell whether it is being
433890b17f1bSmrg      # built for inclusion in a dll (and should export symbols for example).
433990b17f1bSmrg      m4_if([$1], [GCJ], [],
434090b17f1bSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
434190b17f1bSmrg      ;;
43427e6fb56fSmrg
434390b17f1bSmrg    hpux9* | hpux10* | hpux11*)
434490b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
434590b17f1bSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
434690b17f1bSmrg      # not for PA HP-UX.
434790b17f1bSmrg      case $host_cpu in
434890b17f1bSmrg      hppa*64*|ia64*)
434990b17f1bSmrg	# +Z the default
435090b17f1bSmrg	;;
435190b17f1bSmrg      *)
435290b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
435390b17f1bSmrg	;;
435490b17f1bSmrg      esac
435590b17f1bSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4356983b4bf2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
435790b17f1bSmrg      ;;
43587e6fb56fSmrg
435990b17f1bSmrg    irix5* | irix6* | nonstopux*)
436090b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
436190b17f1bSmrg      # PIC (with -KPIC) is the default.
436290b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
436390b17f1bSmrg      ;;
43647e6fb56fSmrg
4365983b4bf2Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
436690b17f1bSmrg      case $cc_basename in
4367983b4bf2Smrg      # old Intel for x86_64 which still supported -KPIC.
436890b17f1bSmrg      ecc*)
436990b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
437090b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
437190b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
437290b17f1bSmrg        ;;
437390b17f1bSmrg      # icc used to be incompatible with GCC.
437490b17f1bSmrg      # ICC 10 doesn't accept -KPIC any more.
437590b17f1bSmrg      icc* | ifort*)
437690b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
437790b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
437890b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
437990b17f1bSmrg        ;;
438090b17f1bSmrg      # Lahey Fortran 8.1.
438190b17f1bSmrg      lf95*)
438290b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
438390b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
438490b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
438590b17f1bSmrg	;;
438690b17f1bSmrg      nagfor*)
438790b17f1bSmrg	# NAG Fortran compiler
438890b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
438990b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
439090b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
439190b17f1bSmrg	;;
439290b17f1bSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
439390b17f1bSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
439490b17f1bSmrg	# which looks to be a dead project)
439590b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
439690b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
439790b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
439890b17f1bSmrg        ;;
439990b17f1bSmrg      ccc*)
440090b17f1bSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
440190b17f1bSmrg        # All Alpha code is PIC.
440290b17f1bSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
440390b17f1bSmrg        ;;
440490b17f1bSmrg      xl* | bgxl* | bgf* | mpixl*)
440590b17f1bSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
440690b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
440790b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
440890b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
440990b17f1bSmrg	;;
441090b17f1bSmrg      *)
441190b17f1bSmrg	case `$CC -V 2>&1 | sed 5q` in
441290b17f1bSmrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
441390b17f1bSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
441490b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
441590b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
441690b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
441790b17f1bSmrg	  ;;
441890b17f1bSmrg	*Sun\ F* | *Sun*Fortran*)
441990b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
442090b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
442190b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
442290b17f1bSmrg	  ;;
442390b17f1bSmrg	*Sun\ C*)
442490b17f1bSmrg	  # Sun C 5.9
442590b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
442690b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
442790b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
442890b17f1bSmrg	  ;;
442990b17f1bSmrg        *Intel*\ [[CF]]*Compiler*)
443090b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
443190b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
443290b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
443390b17f1bSmrg	  ;;
443490b17f1bSmrg	*Portland\ Group*)
443590b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
443690b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
443790b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
443890b17f1bSmrg	  ;;
443990b17f1bSmrg	esac
444090b17f1bSmrg	;;
444190b17f1bSmrg      esac
444290b17f1bSmrg      ;;
44437e6fb56fSmrg
444490b17f1bSmrg    newsos6)
444590b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
444690b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
444790b17f1bSmrg      ;;
44487e6fb56fSmrg
444990b17f1bSmrg    *nto* | *qnx*)
445090b17f1bSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
445190b17f1bSmrg      # it will coredump.
445290b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
445390b17f1bSmrg      ;;
44547e6fb56fSmrg
445590b17f1bSmrg    osf3* | osf4* | osf5*)
445690b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
445790b17f1bSmrg      # All OSF/1 code is PIC.
445890b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
445990b17f1bSmrg      ;;
44607e6fb56fSmrg
446190b17f1bSmrg    rdos*)
446290b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
446390b17f1bSmrg      ;;
44647e6fb56fSmrg
446590b17f1bSmrg    solaris*)
446690b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
446790b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
446890b17f1bSmrg      case $cc_basename in
446990b17f1bSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
447090b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
447190b17f1bSmrg      *)
447290b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
447390b17f1bSmrg      esac
447490b17f1bSmrg      ;;
44757e6fb56fSmrg
447690b17f1bSmrg    sunos4*)
447790b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
447890b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
447990b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
448090b17f1bSmrg      ;;
44817e6fb56fSmrg
448290b17f1bSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
448390b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
448490b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
448590b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
448690b17f1bSmrg      ;;
44877e6fb56fSmrg
448890b17f1bSmrg    sysv4*MP*)
4489983b4bf2Smrg      if test -d /usr/nec ;then
449090b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
449190b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
449290b17f1bSmrg      fi
449390b17f1bSmrg      ;;
44947e6fb56fSmrg
449590b17f1bSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
449690b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
449790b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
449890b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
449990b17f1bSmrg      ;;
45007e6fb56fSmrg
450190b17f1bSmrg    unicos*)
450290b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
450390b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
450490b17f1bSmrg      ;;
45057e6fb56fSmrg
450690b17f1bSmrg    uts4*)
450790b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
450890b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
450990b17f1bSmrg      ;;
45107e6fb56fSmrg
451190b17f1bSmrg    *)
451290b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
451390b17f1bSmrg      ;;
451490b17f1bSmrg    esac
451590b17f1bSmrg  fi
451690b17f1bSmrg])
451790b17f1bSmrgcase $host_os in
4518983b4bf2Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
451990b17f1bSmrg  *djgpp*)
452090b17f1bSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
452190b17f1bSmrg    ;;
452290b17f1bSmrg  *)
452390b17f1bSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
452490b17f1bSmrg    ;;
452590b17f1bSmrgesac
45267e6fb56fSmrg
452790b17f1bSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
452890b17f1bSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
452990b17f1bSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
453090b17f1bSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
45317e6fb56fSmrg
453290b17f1bSmrg#
453390b17f1bSmrg# Check to make sure the PIC flag actually works.
453490b17f1bSmrg#
453590b17f1bSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
453690b17f1bSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
453790b17f1bSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
453890b17f1bSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
453990b17f1bSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
454090b17f1bSmrg     "" | " "*) ;;
454190b17f1bSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
454290b17f1bSmrg     esac],
454390b17f1bSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
454490b17f1bSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
454590b17f1bSmrgfi
454690b17f1bSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
454790b17f1bSmrg	[Additional compiler flags for building library objects])
45487e6fb56fSmrg
454990b17f1bSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
455090b17f1bSmrg	[How to pass a linker flag through the compiler])
455190b17f1bSmrg#
455290b17f1bSmrg# Check to make sure the static flag actually works.
455390b17f1bSmrg#
455490b17f1bSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
455590b17f1bSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
455690b17f1bSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
455790b17f1bSmrg  $lt_tmp_static_flag,
455890b17f1bSmrg  [],
455990b17f1bSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
456090b17f1bSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
456190b17f1bSmrg	[Compiler flag to prevent dynamic linking])
456290b17f1bSmrg])# _LT_COMPILER_PIC
45637e6fb56fSmrg
45647e6fb56fSmrg
456590b17f1bSmrg# _LT_LINKER_SHLIBS([TAGNAME])
456690b17f1bSmrg# ----------------------------
456790b17f1bSmrg# See if the linker supports building shared libraries.
456890b17f1bSmrgm4_defun([_LT_LINKER_SHLIBS],
456990b17f1bSmrg[AC_REQUIRE([LT_PATH_LD])dnl
457090b17f1bSmrgAC_REQUIRE([LT_PATH_NM])dnl
457190b17f1bSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
457290b17f1bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
457390b17f1bSmrgm4_require([_LT_DECL_EGREP])dnl
457490b17f1bSmrgm4_require([_LT_DECL_SED])dnl
457590b17f1bSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
457690b17f1bSmrgm4_require([_LT_TAG_COMPILER])dnl
457790b17f1bSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
457890b17f1bSmrgm4_if([$1], [CXX], [
457990b17f1bSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
458090b17f1bSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
458190b17f1bSmrg  case $host_os in
458290b17f1bSmrg  aix[[4-9]]*)
458390b17f1bSmrg    # If we're using GNU nm, then we don't want the "-C" option.
4584983b4bf2Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
4585983b4bf2Smrg    # Also, AIX nm treats weak defined symbols like other global defined
4586983b4bf2Smrg    # symbols, whereas GNU nm marks them as "W".
458790b17f1bSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4588983b4bf2Smrg      _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'
458990b17f1bSmrg    else
4590983b4bf2Smrg      _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'
459190b17f1bSmrg    fi
459290b17f1bSmrg    ;;
459390b17f1bSmrg  pw32*)
4594983b4bf2Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
459590b17f1bSmrg    ;;
459690b17f1bSmrg  cygwin* | mingw* | cegcc*)
459790b17f1bSmrg    case $cc_basename in
459890b17f1bSmrg    cl*)
459990b17f1bSmrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
460090b17f1bSmrg      ;;
460190b17f1bSmrg    *)
460290b17f1bSmrg      _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'
460390b17f1bSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
460490b17f1bSmrg      ;;
460590b17f1bSmrg    esac
460690b17f1bSmrg    ;;
4607983b4bf2Smrg  linux* | k*bsd*-gnu | gnu*)
4608983b4bf2Smrg    _LT_TAGVAR(link_all_deplibs, $1)=no
4609983b4bf2Smrg    ;;
461090b17f1bSmrg  *)
461190b17f1bSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
461290b17f1bSmrg    ;;
461390b17f1bSmrg  esac
461490b17f1bSmrg], [
461590b17f1bSmrg  runpath_var=
461690b17f1bSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
461790b17f1bSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
461890b17f1bSmrg  _LT_TAGVAR(archive_cmds, $1)=
461990b17f1bSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
462090b17f1bSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
462190b17f1bSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
462290b17f1bSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
462390b17f1bSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
462490b17f1bSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
462590b17f1bSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
462690b17f1bSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
462790b17f1bSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
462890b17f1bSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
462990b17f1bSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
463090b17f1bSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
463190b17f1bSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
463290b17f1bSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
463390b17f1bSmrg  _LT_TAGVAR(module_cmds, $1)=
463490b17f1bSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
463590b17f1bSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
463690b17f1bSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
463790b17f1bSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
463890b17f1bSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
463990b17f1bSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
464090b17f1bSmrg  # included in the symbol list
464190b17f1bSmrg  _LT_TAGVAR(include_expsyms, $1)=
464290b17f1bSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
4643983b4bf2Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
4644983b4bf2Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4645983b4bf2Smrg  # as well as any symbol that contains `d'.
464690b17f1bSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
464790b17f1bSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
464890b17f1bSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
464990b17f1bSmrg  # the symbol is explicitly referenced.  Since portable code cannot
465090b17f1bSmrg  # rely on this symbol name, it's probably fine to never include it in
465190b17f1bSmrg  # preloaded symbol tables.
465290b17f1bSmrg  # Exclude shared library initialization/finalization symbols.
465390b17f1bSmrgdnl Note also adjust exclude_expsyms for C++ above.
465490b17f1bSmrg  extract_expsyms_cmds=
46557e6fb56fSmrg
465690b17f1bSmrg  case $host_os in
465790b17f1bSmrg  cygwin* | mingw* | pw32* | cegcc*)
465890b17f1bSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
465990b17f1bSmrg    # When not using gcc, we currently assume that we are using
466090b17f1bSmrg    # Microsoft Visual C++.
4661983b4bf2Smrg    if test "$GCC" != yes; then
466290b17f1bSmrg      with_gnu_ld=no
466390b17f1bSmrg    fi
466490b17f1bSmrg    ;;
466590b17f1bSmrg  interix*)
466690b17f1bSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
466790b17f1bSmrg    with_gnu_ld=yes
466890b17f1bSmrg    ;;
4669983b4bf2Smrg  openbsd*)
467090b17f1bSmrg    with_gnu_ld=no
467190b17f1bSmrg    ;;
4672983b4bf2Smrg  linux* | k*bsd*-gnu | gnu*)
4673983b4bf2Smrg    _LT_TAGVAR(link_all_deplibs, $1)=no
4674983b4bf2Smrg    ;;
467590b17f1bSmrg  esac
46767e6fb56fSmrg
467790b17f1bSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
46787e6fb56fSmrg
467990b17f1bSmrg  # On some targets, GNU ld is compatible enough with the native linker
468090b17f1bSmrg  # that we're better off using the native interface for both.
468190b17f1bSmrg  lt_use_gnu_ld_interface=no
4682983b4bf2Smrg  if test "$with_gnu_ld" = yes; then
468390b17f1bSmrg    case $host_os in
468490b17f1bSmrg      aix*)
468590b17f1bSmrg	# The AIX port of GNU ld has always aspired to compatibility
468690b17f1bSmrg	# with the native linker.  However, as the warning in the GNU ld
468790b17f1bSmrg	# block says, versions before 2.19.5* couldn't really create working
468890b17f1bSmrg	# shared libraries, regardless of the interface used.
468990b17f1bSmrg	case `$LD -v 2>&1` in
469090b17f1bSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
469190b17f1bSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
469290b17f1bSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
469390b17f1bSmrg	  *)
469490b17f1bSmrg	    lt_use_gnu_ld_interface=yes
469590b17f1bSmrg	    ;;
469690b17f1bSmrg	esac
469790b17f1bSmrg	;;
469890b17f1bSmrg      *)
469990b17f1bSmrg	lt_use_gnu_ld_interface=yes
470090b17f1bSmrg	;;
470190b17f1bSmrg    esac
470290b17f1bSmrg  fi
47037e6fb56fSmrg
4704983b4bf2Smrg  if test "$lt_use_gnu_ld_interface" = yes; then
470590b17f1bSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
4706983b4bf2Smrg    wlarc='${wl}'
47077e6fb56fSmrg
470890b17f1bSmrg    # Set some defaults for GNU ld with shared library support. These
470990b17f1bSmrg    # are reset later if shared libraries are not supported. Putting them
471090b17f1bSmrg    # here allows them to be overridden if necessary.
471190b17f1bSmrg    runpath_var=LD_RUN_PATH
4712983b4bf2Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4713983b4bf2Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
471490b17f1bSmrg    # ancient GNU ld didn't support --whole-archive et. al.
471590b17f1bSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4716983b4bf2Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
471790b17f1bSmrg    else
471890b17f1bSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
471990b17f1bSmrg    fi
472090b17f1bSmrg    supports_anon_versioning=no
4721983b4bf2Smrg    case `$LD -v 2>&1` in
472290b17f1bSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
472390b17f1bSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
472490b17f1bSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
472590b17f1bSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
472690b17f1bSmrg      *\ 2.11.*) ;; # other 2.11 versions
472790b17f1bSmrg      *) supports_anon_versioning=yes ;;
472890b17f1bSmrg    esac
47297e6fb56fSmrg
473090b17f1bSmrg    # See if GNU ld supports shared libraries.
473190b17f1bSmrg    case $host_os in
473290b17f1bSmrg    aix[[3-9]]*)
473390b17f1bSmrg      # On AIX/PPC, the GNU linker is very broken
4734983b4bf2Smrg      if test "$host_cpu" != ia64; then
473590b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
473690b17f1bSmrg	cat <<_LT_EOF 1>&2
47377e6fb56fSmrg
473890b17f1bSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
473990b17f1bSmrg*** to be unable to reliably create shared libraries on AIX.
474090b17f1bSmrg*** Therefore, libtool is disabling shared libraries support.  If you
474190b17f1bSmrg*** really care for shared libraries, you may want to install binutils
474290b17f1bSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
474390b17f1bSmrg*** You will then need to restart the configuration process.
47447e6fb56fSmrg
474590b17f1bSmrg_LT_EOF
474690b17f1bSmrg      fi
474790b17f1bSmrg      ;;
47487e6fb56fSmrg
474990b17f1bSmrg    amigaos*)
475090b17f1bSmrg      case $host_cpu in
475190b17f1bSmrg      powerpc)
475290b17f1bSmrg            # see comment about AmigaOS4 .so support
4753983b4bf2Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
475490b17f1bSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
475590b17f1bSmrg        ;;
475690b17f1bSmrg      m68k)
475790b17f1bSmrg            _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)'
475890b17f1bSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
475990b17f1bSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
476090b17f1bSmrg        ;;
476190b17f1bSmrg      esac
476290b17f1bSmrg      ;;
47637e6fb56fSmrg
476490b17f1bSmrg    beos*)
476590b17f1bSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
476690b17f1bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
476790b17f1bSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
476890b17f1bSmrg	# support --undefined.  This deserves some investigation.  FIXME
4769983b4bf2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
477090b17f1bSmrg      else
477190b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
477290b17f1bSmrg      fi
477390b17f1bSmrg      ;;
47747e6fb56fSmrg
477590b17f1bSmrg    cygwin* | mingw* | pw32* | cegcc*)
477690b17f1bSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
477790b17f1bSmrg      # as there is no search path for DLLs.
477890b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4779983b4bf2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
478090b17f1bSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
478190b17f1bSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
478290b17f1bSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
478390b17f1bSmrg      _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'
478490b17f1bSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
478590b17f1bSmrg
478690b17f1bSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4787983b4bf2Smrg        _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'
4788983b4bf2Smrg	# If the export-symbols file already is a .def file (1st line
4789983b4bf2Smrg	# is EXPORTS), use it as is; otherwise, prepend...
4790983b4bf2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4791983b4bf2Smrg	  cp $export_symbols $output_objdir/$soname.def;
4792983b4bf2Smrg	else
4793983b4bf2Smrg	  echo EXPORTS > $output_objdir/$soname.def;
4794983b4bf2Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
4795983b4bf2Smrg	fi~
4796983b4bf2Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
479790b17f1bSmrg      else
479890b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
479990b17f1bSmrg      fi
480090b17f1bSmrg      ;;
48017e6fb56fSmrg
480290b17f1bSmrg    haiku*)
4803983b4bf2Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
480490b17f1bSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
480590b17f1bSmrg      ;;
48067e6fb56fSmrg
480790b17f1bSmrg    interix[[3-9]]*)
480890b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
480990b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4810983b4bf2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4811983b4bf2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
481290b17f1bSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
481390b17f1bSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
481490b17f1bSmrg      # default) and relocated if they conflict, which is a slow very memory
481590b17f1bSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
481690b17f1bSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
481790b17f1bSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
4818983b4bf2Smrg      _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'
4819983b4bf2Smrg      _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'
482090b17f1bSmrg      ;;
48217e6fb56fSmrg
482290b17f1bSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
482390b17f1bSmrg      tmp_diet=no
4824983b4bf2Smrg      if test "$host_os" = linux-dietlibc; then
482590b17f1bSmrg	case $cc_basename in
482690b17f1bSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
482790b17f1bSmrg	esac
482890b17f1bSmrg      fi
482990b17f1bSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4830983b4bf2Smrg	 && test "$tmp_diet" = no
483190b17f1bSmrg      then
483290b17f1bSmrg	tmp_addflag=' $pic_flag'
483390b17f1bSmrg	tmp_sharedflag='-shared'
483490b17f1bSmrg	case $cc_basename,$host_cpu in
483590b17f1bSmrg        pgcc*)				# Portland Group C compiler
4836983b4bf2Smrg	  _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'
483790b17f1bSmrg	  tmp_addflag=' $pic_flag'
483890b17f1bSmrg	  ;;
483990b17f1bSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
484090b17f1bSmrg					# Portland Group f77 and f90 compilers
4841983b4bf2Smrg	  _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'
484290b17f1bSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
484390b17f1bSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
484490b17f1bSmrg	  tmp_addflag=' -i_dynamic' ;;
484590b17f1bSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
484690b17f1bSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
484790b17f1bSmrg	ifc* | ifort*)			# Intel Fortran compiler
484890b17f1bSmrg	  tmp_addflag=' -nofor_main' ;;
484990b17f1bSmrg	lf95*)				# Lahey Fortran 8.1
485090b17f1bSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
485190b17f1bSmrg	  tmp_sharedflag='--shared' ;;
485290b17f1bSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
485390b17f1bSmrg	  tmp_sharedflag='-qmkshrobj'
485490b17f1bSmrg	  tmp_addflag= ;;
485590b17f1bSmrg	nvcc*)	# Cuda Compiler Driver 2.2
4856983b4bf2Smrg	  _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'
485790b17f1bSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
485890b17f1bSmrg	  ;;
485990b17f1bSmrg	esac
486090b17f1bSmrg	case `$CC -V 2>&1 | sed 5q` in
486190b17f1bSmrg	*Sun\ C*)			# Sun C 5.9
4862983b4bf2Smrg	  _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'
486390b17f1bSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
486490b17f1bSmrg	  tmp_sharedflag='-G' ;;
486590b17f1bSmrg	*Sun\ F*)			# Sun Fortran 8.3
486690b17f1bSmrg	  tmp_sharedflag='-G' ;;
486790b17f1bSmrg	esac
4868983b4bf2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
48697e6fb56fSmrg
4870983b4bf2Smrg        if test "x$supports_anon_versioning" = xyes; then
487190b17f1bSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4872983b4bf2Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4873983b4bf2Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
4874983b4bf2Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
487590b17f1bSmrg        fi
48767e6fb56fSmrg
487790b17f1bSmrg	case $cc_basename in
487890b17f1bSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
487990b17f1bSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
488090b17f1bSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4881983b4bf2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
488290b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
4883983b4bf2Smrg	  if test "x$supports_anon_versioning" = xyes; then
488490b17f1bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4885983b4bf2Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4886983b4bf2Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
4887983b4bf2Smrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
488890b17f1bSmrg	  fi
488990b17f1bSmrg	  ;;
489090b17f1bSmrg	esac
489190b17f1bSmrg      else
489290b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
489390b17f1bSmrg      fi
489490b17f1bSmrg      ;;
48957e6fb56fSmrg
4896983b4bf2Smrg    netbsd* | netbsdelf*-gnu)
489790b17f1bSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
489890b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
489990b17f1bSmrg	wlarc=
490090b17f1bSmrg      else
4901983b4bf2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4902983b4bf2Smrg	_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'
490390b17f1bSmrg      fi
490490b17f1bSmrg      ;;
49057e6fb56fSmrg
490690b17f1bSmrg    solaris*)
490790b17f1bSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
490890b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
490990b17f1bSmrg	cat <<_LT_EOF 1>&2
49107e6fb56fSmrg
491190b17f1bSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
491290b17f1bSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
491390b17f1bSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
491490b17f1bSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
491590b17f1bSmrg*** your PATH or compiler configuration so that the native linker is
491690b17f1bSmrg*** used, and then restart.
49177e6fb56fSmrg
491890b17f1bSmrg_LT_EOF
491990b17f1bSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4920983b4bf2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4921983b4bf2Smrg	_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'
492290b17f1bSmrg      else
492390b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
492490b17f1bSmrg      fi
492590b17f1bSmrg      ;;
49267e6fb56fSmrg
492790b17f1bSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
492890b17f1bSmrg      case `$LD -v 2>&1` in
492990b17f1bSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
493090b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
493190b17f1bSmrg	cat <<_LT_EOF 1>&2
49327e6fb56fSmrg
4933983b4bf2Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
493490b17f1bSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
493590b17f1bSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
493690b17f1bSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
493790b17f1bSmrg*** your PATH or compiler configuration so that the native linker is
493890b17f1bSmrg*** used, and then restart.
49397e6fb56fSmrg
494090b17f1bSmrg_LT_EOF
494190b17f1bSmrg	;;
494290b17f1bSmrg	*)
494390b17f1bSmrg	  # For security reasons, it is highly recommended that you always
494490b17f1bSmrg	  # use absolute paths for naming shared libraries, and exclude the
494590b17f1bSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
494690b17f1bSmrg	  # requires that you compile everything twice, which is a pain.
494790b17f1bSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4948983b4bf2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4949983b4bf2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4950983b4bf2Smrg	    _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'
495190b17f1bSmrg	  else
495290b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
495390b17f1bSmrg	  fi
495490b17f1bSmrg	;;
495590b17f1bSmrg      esac
495690b17f1bSmrg      ;;
49577e6fb56fSmrg
495890b17f1bSmrg    sunos4*)
495990b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
496090b17f1bSmrg      wlarc=
496190b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
496290b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
496390b17f1bSmrg      ;;
49647e6fb56fSmrg
496590b17f1bSmrg    *)
496690b17f1bSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4967983b4bf2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4968983b4bf2Smrg	_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'
496990b17f1bSmrg      else
497090b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
497190b17f1bSmrg      fi
497290b17f1bSmrg      ;;
497390b17f1bSmrg    esac
49747e6fb56fSmrg
4975983b4bf2Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
497690b17f1bSmrg      runpath_var=
497790b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
497890b17f1bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
497990b17f1bSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
498090b17f1bSmrg    fi
498190b17f1bSmrg  else
498290b17f1bSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
498390b17f1bSmrg    case $host_os in
498490b17f1bSmrg    aix3*)
498590b17f1bSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
498690b17f1bSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
498790b17f1bSmrg      _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'
498890b17f1bSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
498990b17f1bSmrg      # are no directories specified by -L.
499090b17f1bSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4991983b4bf2Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
499290b17f1bSmrg	# Neither direct hardcoding nor static linking is supported with a
499390b17f1bSmrg	# broken collect2.
499490b17f1bSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
499590b17f1bSmrg      fi
499690b17f1bSmrg      ;;
49977e6fb56fSmrg
499890b17f1bSmrg    aix[[4-9]]*)
4999983b4bf2Smrg      if test "$host_cpu" = ia64; then
500090b17f1bSmrg	# On IA64, the linker does run time linking by default, so we don't
500190b17f1bSmrg	# have to do anything special.
500290b17f1bSmrg	aix_use_runtimelinking=no
500390b17f1bSmrg	exp_sym_flag='-Bexport'
5004983b4bf2Smrg	no_entry_flag=""
500590b17f1bSmrg      else
500690b17f1bSmrg	# If we're using GNU nm, then we don't want the "-C" option.
5007983b4bf2Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
5008983b4bf2Smrg	# Also, AIX nm treats weak defined symbols like other global
5009983b4bf2Smrg	# defined symbols, whereas GNU nm marks them as "W".
501090b17f1bSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5011983b4bf2Smrg	  _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'
501290b17f1bSmrg	else
5013983b4bf2Smrg	  _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'
501490b17f1bSmrg	fi
501590b17f1bSmrg	aix_use_runtimelinking=no
50167e6fb56fSmrg
501790b17f1bSmrg	# Test if we are trying to use run time linking or normal
501890b17f1bSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5019983b4bf2Smrg	# need to do runtime linking.
502090b17f1bSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
502190b17f1bSmrg	  for ld_flag in $LDFLAGS; do
5022983b4bf2Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
502390b17f1bSmrg	    aix_use_runtimelinking=yes
502490b17f1bSmrg	    break
502590b17f1bSmrg	  fi
502690b17f1bSmrg	  done
502790b17f1bSmrg	  ;;
502890b17f1bSmrg	esac
50297e6fb56fSmrg
503090b17f1bSmrg	exp_sym_flag='-bexport'
503190b17f1bSmrg	no_entry_flag='-bnoentry'
503290b17f1bSmrg      fi
50337e6fb56fSmrg
503490b17f1bSmrg      # When large executables or shared objects are built, AIX ld can
503590b17f1bSmrg      # have problems creating the table of contents.  If linking a library
503690b17f1bSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
503790b17f1bSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
503890b17f1bSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
50397e6fb56fSmrg
504090b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)=''
504190b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
504290b17f1bSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
504390b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
504490b17f1bSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5045983b4bf2Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
50467e6fb56fSmrg
5047983b4bf2Smrg      if test "$GCC" = yes; then
504890b17f1bSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
504990b17f1bSmrg	# We only want to do this on AIX 4.2 and lower, the check
505090b17f1bSmrg	# below for broken collect2 doesn't work under 4.3+
5051983b4bf2Smrg	  collect2name=`${CC} -print-prog-name=collect2`
505290b17f1bSmrg	  if test -f "$collect2name" &&
505390b17f1bSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
505490b17f1bSmrg	  then
505590b17f1bSmrg	  # We have reworked collect2
505690b17f1bSmrg	  :
505790b17f1bSmrg	  else
505890b17f1bSmrg	  # We have old collect2
505990b17f1bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
506090b17f1bSmrg	  # It fails to find uninstalled libraries when the uninstalled
506190b17f1bSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
506290b17f1bSmrg	  # to unsupported forces relinking
506390b17f1bSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
506490b17f1bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
506590b17f1bSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
506690b17f1bSmrg	  fi
506790b17f1bSmrg	  ;;
506890b17f1bSmrg	esac
506990b17f1bSmrg	shared_flag='-shared'
5070983b4bf2Smrg	if test "$aix_use_runtimelinking" = yes; then
5071983b4bf2Smrg	  shared_flag="$shared_flag "'${wl}-G'
507290b17f1bSmrg	fi
5073983b4bf2Smrg	_LT_TAGVAR(link_all_deplibs, $1)=no
507490b17f1bSmrg      else
507590b17f1bSmrg	# not using gcc
5076983b4bf2Smrg	if test "$host_cpu" = ia64; then
507790b17f1bSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
507890b17f1bSmrg	# chokes on -Wl,-G. The following line is correct:
507990b17f1bSmrg	  shared_flag='-G'
508090b17f1bSmrg	else
5081983b4bf2Smrg	  if test "$aix_use_runtimelinking" = yes; then
5082983b4bf2Smrg	    shared_flag='${wl}-G'
508390b17f1bSmrg	  else
5084983b4bf2Smrg	    shared_flag='${wl}-bM:SRE'
508590b17f1bSmrg	  fi
508690b17f1bSmrg	fi
508790b17f1bSmrg      fi
50887e6fb56fSmrg
5089983b4bf2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
509090b17f1bSmrg      # It seems that -bexpall does not export symbols beginning with
509190b17f1bSmrg      # underscore (_), so it is better to generate a list of symbols to export.
509290b17f1bSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5093983b4bf2Smrg      if test "$aix_use_runtimelinking" = yes; then
509490b17f1bSmrg	# Warning - without using the other runtime loading flags (-brtl),
509590b17f1bSmrg	# -berok will link without error, but may produce a broken library.
509690b17f1bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
509790b17f1bSmrg        # Determine the default libpath from the value encoded in an
509890b17f1bSmrg        # empty executable.
509990b17f1bSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
5100983b4bf2Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5101983b4bf2Smrg        _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"
510290b17f1bSmrg      else
5103983b4bf2Smrg	if test "$host_cpu" = ia64; then
5104983b4bf2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
510590b17f1bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5106983b4bf2Smrg	  _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"
510790b17f1bSmrg	else
510890b17f1bSmrg	 # Determine the default libpath from the value encoded in an
510990b17f1bSmrg	 # empty executable.
511090b17f1bSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
5111983b4bf2Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
511290b17f1bSmrg	  # Warning - without using the other run time loading flags,
511390b17f1bSmrg	  # -berok will link without error, but may produce a broken library.
5114983b4bf2Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5115983b4bf2Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5116983b4bf2Smrg	  if test "$with_gnu_ld" = yes; then
511790b17f1bSmrg	    # We only use this code for GNU lds that support --whole-archive.
5118983b4bf2Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
511990b17f1bSmrg	  else
512090b17f1bSmrg	    # Exported symbols can be pulled into shared objects from archives
512190b17f1bSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
512290b17f1bSmrg	  fi
512390b17f1bSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5124983b4bf2Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
5125983b4bf2Smrg	  _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'
512690b17f1bSmrg	fi
512790b17f1bSmrg      fi
512890b17f1bSmrg      ;;
51297e6fb56fSmrg
513090b17f1bSmrg    amigaos*)
513190b17f1bSmrg      case $host_cpu in
513290b17f1bSmrg      powerpc)
513390b17f1bSmrg            # see comment about AmigaOS4 .so support
5134983b4bf2Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
513590b17f1bSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
513690b17f1bSmrg        ;;
513790b17f1bSmrg      m68k)
513890b17f1bSmrg            _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)'
513990b17f1bSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
514090b17f1bSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
514190b17f1bSmrg        ;;
514290b17f1bSmrg      esac
514390b17f1bSmrg      ;;
51447e6fb56fSmrg
514590b17f1bSmrg    bsdi[[45]]*)
514690b17f1bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
514790b17f1bSmrg      ;;
51487e6fb56fSmrg
514990b17f1bSmrg    cygwin* | mingw* | pw32* | cegcc*)
515090b17f1bSmrg      # When not using gcc, we currently assume that we are using
515190b17f1bSmrg      # Microsoft Visual C++.
515290b17f1bSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
515390b17f1bSmrg      # no search path for DLLs.
515490b17f1bSmrg      case $cc_basename in
515590b17f1bSmrg      cl*)
515690b17f1bSmrg	# Native MSVC
515790b17f1bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
515890b17f1bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
515990b17f1bSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
516090b17f1bSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
516190b17f1bSmrg	# Tell ltmain to make .lib files, not .a files.
516290b17f1bSmrg	libext=lib
516390b17f1bSmrg	# Tell ltmain to make .dll files, not .so files.
5164983b4bf2Smrg	shrext_cmds=".dll"
516590b17f1bSmrg	# FIXME: Setting linknames here is a bad hack.
5166983b4bf2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
5167983b4bf2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5168983b4bf2Smrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
5169983b4bf2Smrg	  else
5170983b4bf2Smrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
5171983b4bf2Smrg	  fi~
5172983b4bf2Smrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5173983b4bf2Smrg	  linknames='
517490b17f1bSmrg	# The linker will not automatically build a static lib if we build a DLL.
517590b17f1bSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
517690b17f1bSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
517790b17f1bSmrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
517890b17f1bSmrg	_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'
517990b17f1bSmrg	# Don't use ranlib
518090b17f1bSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
518190b17f1bSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5182983b4bf2Smrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
5183983b4bf2Smrg	  case $lt_outputfile in
5184983b4bf2Smrg	    *.exe|*.EXE) ;;
5185983b4bf2Smrg	    *)
5186983b4bf2Smrg	      lt_outputfile="$lt_outputfile.exe"
5187983b4bf2Smrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
5188983b4bf2Smrg	      ;;
5189983b4bf2Smrg	  esac~
5190983b4bf2Smrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
5191983b4bf2Smrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5192983b4bf2Smrg	    $RM "$lt_outputfile.manifest";
5193983b4bf2Smrg	  fi'
519490b17f1bSmrg	;;
519590b17f1bSmrg      *)
519690b17f1bSmrg	# Assume MSVC wrapper
519790b17f1bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
519890b17f1bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
519990b17f1bSmrg	# Tell ltmain to make .lib files, not .a files.
520090b17f1bSmrg	libext=lib
520190b17f1bSmrg	# Tell ltmain to make .dll files, not .so files.
5202983b4bf2Smrg	shrext_cmds=".dll"
520390b17f1bSmrg	# FIXME: Setting linknames here is a bad hack.
520490b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
520590b17f1bSmrg	# The linker will automatically build a .lib file if we build a DLL.
520690b17f1bSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
520790b17f1bSmrg	# FIXME: Should let the user specify the lib program.
520890b17f1bSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
520990b17f1bSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
521090b17f1bSmrg	;;
521190b17f1bSmrg      esac
521290b17f1bSmrg      ;;
52137e6fb56fSmrg
521490b17f1bSmrg    darwin* | rhapsody*)
521590b17f1bSmrg      _LT_DARWIN_LINKER_FEATURES($1)
521690b17f1bSmrg      ;;
52177e6fb56fSmrg
521890b17f1bSmrg    dgux*)
521990b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
522090b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
522190b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
522290b17f1bSmrg      ;;
52237e6fb56fSmrg
522490b17f1bSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
522590b17f1bSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
522690b17f1bSmrg    # does not break anything, and helps significantly (at the cost of a little
522790b17f1bSmrg    # extra space).
522890b17f1bSmrg    freebsd2.2*)
522990b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
523090b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
523190b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
523290b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
523390b17f1bSmrg      ;;
52347e6fb56fSmrg
523590b17f1bSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
523690b17f1bSmrg    freebsd2.*)
523790b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
523890b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
523990b17f1bSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
524090b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
524190b17f1bSmrg      ;;
52427e6fb56fSmrg
524390b17f1bSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
524490b17f1bSmrg    freebsd* | dragonfly*)
524590b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
524690b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
524790b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
524890b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
524990b17f1bSmrg      ;;
52507e6fb56fSmrg
525190b17f1bSmrg    hpux9*)
5252983b4bf2Smrg      if test "$GCC" = yes; then
5253983b4bf2Smrg	_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'
525490b17f1bSmrg      else
5255983b4bf2Smrg	_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'
525690b17f1bSmrg      fi
5257983b4bf2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
525890b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
525990b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52607e6fb56fSmrg
526190b17f1bSmrg      # hardcode_minus_L: Not really in the search PATH,
526290b17f1bSmrg      # but as the default location of the library.
526390b17f1bSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5264983b4bf2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
526590b17f1bSmrg      ;;
52667e6fb56fSmrg
526790b17f1bSmrg    hpux10*)
5268983b4bf2Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5269983b4bf2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
527090b17f1bSmrg      else
527190b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
527290b17f1bSmrg      fi
5273983b4bf2Smrg      if test "$with_gnu_ld" = no; then
5274983b4bf2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
527590b17f1bSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
527690b17f1bSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
527790b17f1bSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5278983b4bf2Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
527990b17f1bSmrg	# hardcode_minus_L: Not really in the search PATH,
528090b17f1bSmrg	# but as the default location of the library.
528190b17f1bSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
528290b17f1bSmrg      fi
528390b17f1bSmrg      ;;
52847e6fb56fSmrg
528590b17f1bSmrg    hpux11*)
5286983b4bf2Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
528790b17f1bSmrg	case $host_cpu in
528890b17f1bSmrg	hppa*64*)
5289983b4bf2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
529090b17f1bSmrg	  ;;
529190b17f1bSmrg	ia64*)
5292983b4bf2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
529390b17f1bSmrg	  ;;
529490b17f1bSmrg	*)
5295983b4bf2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
529690b17f1bSmrg	  ;;
529790b17f1bSmrg	esac
529890b17f1bSmrg      else
529990b17f1bSmrg	case $host_cpu in
530090b17f1bSmrg	hppa*64*)
5301983b4bf2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
530290b17f1bSmrg	  ;;
530390b17f1bSmrg	ia64*)
5304983b4bf2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
530590b17f1bSmrg	  ;;
530690b17f1bSmrg	*)
530790b17f1bSmrg	m4_if($1, [], [
530890b17f1bSmrg	  # Older versions of the 11.00 compiler do not understand -b yet
530990b17f1bSmrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
531090b17f1bSmrg	  _LT_LINKER_OPTION([if $CC understands -b],
531190b17f1bSmrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5312983b4bf2Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
531390b17f1bSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5314983b4bf2Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
531590b17f1bSmrg	  ;;
531690b17f1bSmrg	esac
531790b17f1bSmrg      fi
5318983b4bf2Smrg      if test "$with_gnu_ld" = no; then
5319983b4bf2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
532090b17f1bSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
53217e6fb56fSmrg
532290b17f1bSmrg	case $host_cpu in
532390b17f1bSmrg	hppa*64*|ia64*)
532490b17f1bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
532590b17f1bSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
532690b17f1bSmrg	  ;;
532790b17f1bSmrg	*)
532890b17f1bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
532990b17f1bSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5330983b4bf2Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
53317e6fb56fSmrg
533290b17f1bSmrg	  # hardcode_minus_L: Not really in the search PATH,
533390b17f1bSmrg	  # but as the default location of the library.
533490b17f1bSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
533590b17f1bSmrg	  ;;
533690b17f1bSmrg	esac
533790b17f1bSmrg      fi
533890b17f1bSmrg      ;;
53397e6fb56fSmrg
534090b17f1bSmrg    irix5* | irix6* | nonstopux*)
5341983b4bf2Smrg      if test "$GCC" = yes; then
5342983b4bf2Smrg	_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'
534390b17f1bSmrg	# Try to use the -exported_symbol ld option, if it does not
534490b17f1bSmrg	# work, assume that -exports_file does not work either and
534590b17f1bSmrg	# implicitly export all symbols.
534690b17f1bSmrg	# This should be the same for all languages, so no per-tag cache variable.
534790b17f1bSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
534890b17f1bSmrg	  [lt_cv_irix_exported_symbol],
5349983b4bf2Smrg	  [save_LDFLAGS="$LDFLAGS"
5350983b4bf2Smrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
535190b17f1bSmrg	   AC_LINK_IFELSE(
535290b17f1bSmrg	     [AC_LANG_SOURCE(
535390b17f1bSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
535490b17f1bSmrg			      [C++], [[int foo (void) { return 0; }]],
535590b17f1bSmrg			      [Fortran 77], [[
535690b17f1bSmrg      subroutine foo
535790b17f1bSmrg      end]],
535890b17f1bSmrg			      [Fortran], [[
535990b17f1bSmrg      subroutine foo
536090b17f1bSmrg      end]])])],
536190b17f1bSmrg	      [lt_cv_irix_exported_symbol=yes],
536290b17f1bSmrg	      [lt_cv_irix_exported_symbol=no])
5363983b4bf2Smrg           LDFLAGS="$save_LDFLAGS"])
5364983b4bf2Smrg	if test "$lt_cv_irix_exported_symbol" = yes; then
5365983b4bf2Smrg          _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'
536690b17f1bSmrg	fi
536790b17f1bSmrg      else
5368983b4bf2Smrg	_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'
5369983b4bf2Smrg	_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'
537090b17f1bSmrg      fi
537190b17f1bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5372983b4bf2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
537390b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
537490b17f1bSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
537590b17f1bSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
537690b17f1bSmrg      ;;
53777e6fb56fSmrg
5378983b4bf2Smrg    netbsd* | netbsdelf*-gnu)
537990b17f1bSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
538090b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
538190b17f1bSmrg      else
538290b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
538390b17f1bSmrg      fi
538490b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
538590b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
538690b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
538790b17f1bSmrg      ;;
53887e6fb56fSmrg
538990b17f1bSmrg    newsos6)
539090b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
539190b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5392983b4bf2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
539390b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
539490b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
539590b17f1bSmrg      ;;
53967e6fb56fSmrg
539790b17f1bSmrg    *nto* | *qnx*)
539890b17f1bSmrg      ;;
53997e6fb56fSmrg
5400983b4bf2Smrg    openbsd*)
540190b17f1bSmrg      if test -f /usr/libexec/ld.so; then
540290b17f1bSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
540390b17f1bSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
540490b17f1bSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5405983b4bf2Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
540690b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5407983b4bf2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
5408983b4bf2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5409983b4bf2Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
541090b17f1bSmrg	else
5411983b4bf2Smrg	  case $host_os in
5412983b4bf2Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
5413983b4bf2Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5414983b4bf2Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5415983b4bf2Smrg	     ;;
5416983b4bf2Smrg	   *)
5417983b4bf2Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5418983b4bf2Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5419983b4bf2Smrg	     ;;
5420983b4bf2Smrg	  esac
542190b17f1bSmrg	fi
542290b17f1bSmrg      else
542390b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
542490b17f1bSmrg      fi
542590b17f1bSmrg      ;;
54267e6fb56fSmrg
542790b17f1bSmrg    os2*)
542890b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
542990b17f1bSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
543090b17f1bSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5431983b4bf2Smrg      _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'
5432983b4bf2Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
543390b17f1bSmrg      ;;
54347e6fb56fSmrg
543590b17f1bSmrg    osf3*)
5436983b4bf2Smrg      if test "$GCC" = yes; then
5437983b4bf2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5438983b4bf2Smrg	_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'
543990b17f1bSmrg      else
544090b17f1bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5441983b4bf2Smrg	_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'
544290b17f1bSmrg      fi
544390b17f1bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5444983b4bf2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
544590b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
544690b17f1bSmrg      ;;
54477e6fb56fSmrg
544890b17f1bSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5449983b4bf2Smrg      if test "$GCC" = yes; then
5450983b4bf2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5451983b4bf2Smrg	_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'
5452983b4bf2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
545390b17f1bSmrg      else
545490b17f1bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5455983b4bf2Smrg	_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'
545690b17f1bSmrg	_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~
5457983b4bf2Smrg	$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'
54587e6fb56fSmrg
545990b17f1bSmrg	# Both c and cxx compiler support -rpath directly
546090b17f1bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
546190b17f1bSmrg      fi
546290b17f1bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
546390b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
546490b17f1bSmrg      ;;
54657e6fb56fSmrg
546690b17f1bSmrg    solaris*)
546790b17f1bSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5468983b4bf2Smrg      if test "$GCC" = yes; then
5469983b4bf2Smrg	wlarc='${wl}'
5470983b4bf2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
547190b17f1bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5472983b4bf2Smrg	  $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'
547390b17f1bSmrg      else
547490b17f1bSmrg	case `$CC -V 2>&1` in
547590b17f1bSmrg	*"Compilers 5.0"*)
547690b17f1bSmrg	  wlarc=''
5477983b4bf2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
547890b17f1bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5479983b4bf2Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
548090b17f1bSmrg	  ;;
548190b17f1bSmrg	*)
5482983b4bf2Smrg	  wlarc='${wl}'
5483983b4bf2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
548490b17f1bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5485983b4bf2Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
548690b17f1bSmrg	  ;;
548790b17f1bSmrg	esac
548890b17f1bSmrg      fi
548990b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
549090b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
549190b17f1bSmrg      case $host_os in
549290b17f1bSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
549390b17f1bSmrg      *)
549490b17f1bSmrg	# The compiler driver will combine and reorder linker options,
5495983b4bf2Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
549690b17f1bSmrg	# but is careful enough not to reorder.
549790b17f1bSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
5498983b4bf2Smrg	if test "$GCC" = yes; then
5499983b4bf2Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
550090b17f1bSmrg	else
550190b17f1bSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
550290b17f1bSmrg	fi
550390b17f1bSmrg	;;
550490b17f1bSmrg      esac
550590b17f1bSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
550690b17f1bSmrg      ;;
55077e6fb56fSmrg
550890b17f1bSmrg    sunos4*)
5509983b4bf2Smrg      if test "x$host_vendor" = xsequent; then
551090b17f1bSmrg	# Use $CC to link under sequent, because it throws in some extra .o
551190b17f1bSmrg	# files that make .init and .fini sections work.
5512983b4bf2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
551390b17f1bSmrg      else
551490b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
551590b17f1bSmrg      fi
551690b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
551790b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
551890b17f1bSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
551990b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
552090b17f1bSmrg      ;;
55217e6fb56fSmrg
552290b17f1bSmrg    sysv4)
552390b17f1bSmrg      case $host_vendor in
552490b17f1bSmrg	sni)
552590b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
552690b17f1bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
552790b17f1bSmrg	;;
552890b17f1bSmrg	siemens)
552990b17f1bSmrg	  ## LD is ld it makes a PLAMLIB
553090b17f1bSmrg	  ## CC just makes a GrossModule.
553190b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
553290b17f1bSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
553390b17f1bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
553490b17f1bSmrg        ;;
553590b17f1bSmrg	motorola)
553690b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
553790b17f1bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
553890b17f1bSmrg	;;
553990b17f1bSmrg      esac
554090b17f1bSmrg      runpath_var='LD_RUN_PATH'
554190b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
554290b17f1bSmrg      ;;
55437e6fb56fSmrg
554490b17f1bSmrg    sysv4.3*)
554590b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
554690b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
554790b17f1bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
554890b17f1bSmrg      ;;
55497e6fb56fSmrg
555090b17f1bSmrg    sysv4*MP*)
555190b17f1bSmrg      if test -d /usr/nec; then
555290b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
555390b17f1bSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
555490b17f1bSmrg	runpath_var=LD_RUN_PATH
555590b17f1bSmrg	hardcode_runpath_var=yes
555690b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
555790b17f1bSmrg      fi
555890b17f1bSmrg      ;;
55597e6fb56fSmrg
556090b17f1bSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5561983b4bf2Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
556290b17f1bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
556390b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
556490b17f1bSmrg      runpath_var='LD_RUN_PATH'
55657e6fb56fSmrg
5566983b4bf2Smrg      if test "$GCC" = yes; then
5567983b4bf2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5568983b4bf2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
556990b17f1bSmrg      else
5570983b4bf2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5571983b4bf2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
557290b17f1bSmrg      fi
557390b17f1bSmrg      ;;
55747e6fb56fSmrg
557590b17f1bSmrg    sysv5* | sco3.2v5* | sco5v6*)
5576983b4bf2Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
557790b17f1bSmrg      # link with -lc, and that would cause any symbols used from libc to
557890b17f1bSmrg      # always be unresolved, which means just about no library would
557990b17f1bSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
558090b17f1bSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
558190b17f1bSmrg      # as -z defs.
5582983b4bf2Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5583983b4bf2Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
558490b17f1bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
558590b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5586983b4bf2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
558790b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
558890b17f1bSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5589983b4bf2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
559090b17f1bSmrg      runpath_var='LD_RUN_PATH'
55917e6fb56fSmrg
5592983b4bf2Smrg      if test "$GCC" = yes; then
5593983b4bf2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5594983b4bf2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
559590b17f1bSmrg      else
5596983b4bf2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5597983b4bf2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
559890b17f1bSmrg      fi
559990b17f1bSmrg      ;;
56007e6fb56fSmrg
560190b17f1bSmrg    uts4*)
560290b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
560390b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
560490b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
560590b17f1bSmrg      ;;
56067e6fb56fSmrg
560790b17f1bSmrg    *)
560890b17f1bSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
560990b17f1bSmrg      ;;
561090b17f1bSmrg    esac
56117e6fb56fSmrg
5612983b4bf2Smrg    if test x$host_vendor = xsni; then
561390b17f1bSmrg      case $host in
561490b17f1bSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5615983b4bf2Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
561690b17f1bSmrg	;;
561790b17f1bSmrg      esac
561890b17f1bSmrg    fi
561990b17f1bSmrg  fi
562090b17f1bSmrg])
562190b17f1bSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5622983b4bf2Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
56237e6fb56fSmrg
562490b17f1bSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
56257e6fb56fSmrg
562690b17f1bSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
562790b17f1bSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
562890b17f1bSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
562990b17f1bSmrg    [The commands to extract the exported symbol list from a shared archive])
56307e6fb56fSmrg
563190b17f1bSmrg#
563290b17f1bSmrg# Do we need to explicitly link libc?
563390b17f1bSmrg#
563490b17f1bSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
563590b17f1bSmrgx|xyes)
563690b17f1bSmrg  # Assume -lc should be added
563790b17f1bSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
563890b17f1bSmrg
5639983b4bf2Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
564090b17f1bSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
564190b17f1bSmrg    *'~'*)
564290b17f1bSmrg      # FIXME: we may have to deal with multi-command sequences.
564390b17f1bSmrg      ;;
564490b17f1bSmrg    '$CC '*)
564590b17f1bSmrg      # Test whether the compiler implicitly links with -lc since on some
564690b17f1bSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
564790b17f1bSmrg      # to ld, don't add -lc before -lgcc.
564890b17f1bSmrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
564990b17f1bSmrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
565090b17f1bSmrg	[$RM conftest*
565190b17f1bSmrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
565290b17f1bSmrg
565390b17f1bSmrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
565490b17f1bSmrg	  soname=conftest
565590b17f1bSmrg	  lib=conftest
565690b17f1bSmrg	  libobjs=conftest.$ac_objext
565790b17f1bSmrg	  deplibs=
565890b17f1bSmrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
565990b17f1bSmrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
566090b17f1bSmrg	  compiler_flags=-v
566190b17f1bSmrg	  linker_flags=-v
566290b17f1bSmrg	  verstring=
566390b17f1bSmrg	  output_objdir=.
566490b17f1bSmrg	  libname=conftest
566590b17f1bSmrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
566690b17f1bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
566790b17f1bSmrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
566890b17f1bSmrg	  then
566990b17f1bSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
567090b17f1bSmrg	  else
567190b17f1bSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
567290b17f1bSmrg	  fi
567390b17f1bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
567490b17f1bSmrg	else
567590b17f1bSmrg	  cat conftest.err 1>&5
567690b17f1bSmrg	fi
567790b17f1bSmrg	$RM conftest*
567890b17f1bSmrg	])
567990b17f1bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
568090b17f1bSmrg      ;;
568190b17f1bSmrg    esac
56827e6fb56fSmrg  fi
56837e6fb56fSmrg  ;;
56847e6fb56fSmrgesac
56857e6fb56fSmrg
568690b17f1bSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
568790b17f1bSmrg    [Whether or not to add -lc for building shared libraries])
568890b17f1bSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
568990b17f1bSmrg    [enable_shared_with_static_runtimes], [0],
569090b17f1bSmrg    [Whether or not to disallow shared libs when runtime libs are static])
569190b17f1bSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
569290b17f1bSmrg    [Compiler flag to allow reflexive dlopens])
569390b17f1bSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
569490b17f1bSmrg    [Compiler flag to generate shared objects directly from archives])
569590b17f1bSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
569690b17f1bSmrg    [Whether the compiler copes with passing no objects directly])
569790b17f1bSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
569890b17f1bSmrg    [Create an old-style archive from a shared archive])
569990b17f1bSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
570090b17f1bSmrg    [Create a temporary old-style archive to link instead of a shared archive])
570190b17f1bSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
570290b17f1bSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
570390b17f1bSmrg_LT_TAGDECL([], [module_cmds], [2],
570490b17f1bSmrg    [Commands used to build a loadable module if different from building
570590b17f1bSmrg    a shared archive.])
570690b17f1bSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
570790b17f1bSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
570890b17f1bSmrg    [Whether we are building with GNU ld or not])
570990b17f1bSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
571090b17f1bSmrg    [Flag that allows shared libraries with undefined symbols to be built])
571190b17f1bSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
571290b17f1bSmrg    [Flag that enforces no undefined symbols])
571390b17f1bSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
571490b17f1bSmrg    [Flag to hardcode $libdir into a binary during linking.
571590b17f1bSmrg    This must work even if $libdir does not exist])
571690b17f1bSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
571790b17f1bSmrg    [Whether we need a single "-rpath" flag with a separated argument])
571890b17f1bSmrg_LT_TAGDECL([], [hardcode_direct], [0],
5719983b4bf2Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
572090b17f1bSmrg    DIR into the resulting binary])
572190b17f1bSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
5722983b4bf2Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
572390b17f1bSmrg    DIR into the resulting binary and the resulting library dependency is
5724983b4bf2Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
572590b17f1bSmrg    library is relocated])
572690b17f1bSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
572790b17f1bSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
572890b17f1bSmrg    into the resulting binary])
572990b17f1bSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
573090b17f1bSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
573190b17f1bSmrg    into the resulting binary])
573290b17f1bSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
573390b17f1bSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
573490b17f1bSmrg    into the library and all subsequent libraries and executables linked
573590b17f1bSmrg    against it])
573690b17f1bSmrg_LT_TAGDECL([], [inherit_rpath], [0],
573790b17f1bSmrg    [Set to yes if linker adds runtime paths of dependent libraries
573890b17f1bSmrg    to runtime path list])
573990b17f1bSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
574090b17f1bSmrg    [Whether libtool must link a program against all its dependency libraries])
574190b17f1bSmrg_LT_TAGDECL([], [always_export_symbols], [0],
574290b17f1bSmrg    [Set to "yes" if exported symbols are required])
574390b17f1bSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
574490b17f1bSmrg    [The commands to list exported symbols])
574590b17f1bSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
574690b17f1bSmrg    [Symbols that should not be listed in the preloaded symbols])
574790b17f1bSmrg_LT_TAGDECL([], [include_expsyms], [1],
574890b17f1bSmrg    [Symbols that must always be exported])
574990b17f1bSmrg_LT_TAGDECL([], [prelink_cmds], [2],
575090b17f1bSmrg    [Commands necessary for linking programs (against libraries) with templates])
575190b17f1bSmrg_LT_TAGDECL([], [postlink_cmds], [2],
575290b17f1bSmrg    [Commands necessary for finishing linking programs])
575390b17f1bSmrg_LT_TAGDECL([], [file_list_spec], [1],
575490b17f1bSmrg    [Specify filename containing input files])
575590b17f1bSmrgdnl FIXME: Not yet implemented
575690b17f1bSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
575790b17f1bSmrgdnl    [Compiler flag to generate thread safe objects])
575890b17f1bSmrg])# _LT_LINKER_SHLIBS
575990b17f1bSmrg
576090b17f1bSmrg
576190b17f1bSmrg# _LT_LANG_C_CONFIG([TAG])
576290b17f1bSmrg# ------------------------
576390b17f1bSmrg# Ensure that the configuration variables for a C compiler are suitably
576490b17f1bSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5765983b4bf2Smrg# the compiler configuration to `libtool'.
576690b17f1bSmrgm4_defun([_LT_LANG_C_CONFIG],
576790b17f1bSmrg[m4_require([_LT_DECL_EGREP])dnl
5768983b4bf2Smrglt_save_CC="$CC"
576990b17f1bSmrgAC_LANG_PUSH(C)
57707e6fb56fSmrg
577190b17f1bSmrg# Source file extension for C test sources.
577290b17f1bSmrgac_ext=c
57737e6fb56fSmrg
577490b17f1bSmrg# Object file extension for compiled C test sources.
577590b17f1bSmrgobjext=o
577690b17f1bSmrg_LT_TAGVAR(objext, $1)=$objext
57777e6fb56fSmrg
577890b17f1bSmrg# Code to be used in simple compile tests
577990b17f1bSmrglt_simple_compile_test_code="int some_variable = 0;"
57807e6fb56fSmrg
578190b17f1bSmrg# Code to be used in simple link tests
578290b17f1bSmrglt_simple_link_test_code='int main(){return(0);}'
57837e6fb56fSmrg
578490b17f1bSmrg_LT_TAG_COMPILER
578590b17f1bSmrg# Save the default compiler, since it gets overwritten when the other
578690b17f1bSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
578790b17f1bSmrgcompiler_DEFAULT=$CC
57887e6fb56fSmrg
578990b17f1bSmrg# save warnings/boilerplate of simple test code
579090b17f1bSmrg_LT_COMPILER_BOILERPLATE
579190b17f1bSmrg_LT_LINKER_BOILERPLATE
57927e6fb56fSmrg
579390b17f1bSmrgif test -n "$compiler"; then
579490b17f1bSmrg  _LT_COMPILER_NO_RTTI($1)
579590b17f1bSmrg  _LT_COMPILER_PIC($1)
579690b17f1bSmrg  _LT_COMPILER_C_O($1)
579790b17f1bSmrg  _LT_COMPILER_FILE_LOCKS($1)
579890b17f1bSmrg  _LT_LINKER_SHLIBS($1)
579990b17f1bSmrg  _LT_SYS_DYNAMIC_LINKER($1)
580090b17f1bSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
580190b17f1bSmrg  LT_SYS_DLOPEN_SELF
580290b17f1bSmrg  _LT_CMD_STRIPLIB
580390b17f1bSmrg
5804983b4bf2Smrg  # Report which library types will actually be built
580590b17f1bSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
580690b17f1bSmrg  AC_MSG_RESULT([$can_build_shared])
580790b17f1bSmrg
580890b17f1bSmrg  AC_MSG_CHECKING([whether to build shared libraries])
5809983b4bf2Smrg  test "$can_build_shared" = "no" && enable_shared=no
581090b17f1bSmrg
581190b17f1bSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
581290b17f1bSmrg  # are all built from PIC.
581390b17f1bSmrg  case $host_os in
581490b17f1bSmrg  aix3*)
5815983b4bf2Smrg    test "$enable_shared" = yes && enable_static=no
581690b17f1bSmrg    if test -n "$RANLIB"; then
581790b17f1bSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
581890b17f1bSmrg      postinstall_cmds='$RANLIB $lib'
581990b17f1bSmrg    fi
582090b17f1bSmrg    ;;
58217e6fb56fSmrg
582290b17f1bSmrg  aix[[4-9]]*)
5823983b4bf2Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5824983b4bf2Smrg      test "$enable_shared" = yes && enable_static=no
582590b17f1bSmrg    fi
582690b17f1bSmrg    ;;
582790b17f1bSmrg  esac
582890b17f1bSmrg  AC_MSG_RESULT([$enable_shared])
58297e6fb56fSmrg
583090b17f1bSmrg  AC_MSG_CHECKING([whether to build static libraries])
583190b17f1bSmrg  # Make sure either enable_shared or enable_static is yes.
5832983b4bf2Smrg  test "$enable_shared" = yes || enable_static=yes
583390b17f1bSmrg  AC_MSG_RESULT([$enable_static])
58347e6fb56fSmrg
583590b17f1bSmrg  _LT_CONFIG($1)
583690b17f1bSmrgfi
583790b17f1bSmrgAC_LANG_POP
5838983b4bf2SmrgCC="$lt_save_CC"
583990b17f1bSmrg])# _LT_LANG_C_CONFIG
58407e6fb56fSmrg
58417e6fb56fSmrg
584290b17f1bSmrg# _LT_LANG_CXX_CONFIG([TAG])
584390b17f1bSmrg# --------------------------
584490b17f1bSmrg# Ensure that the configuration variables for a C++ compiler are suitably
584590b17f1bSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5846983b4bf2Smrg# the compiler configuration to `libtool'.
584790b17f1bSmrgm4_defun([_LT_LANG_CXX_CONFIG],
584890b17f1bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
584990b17f1bSmrgm4_require([_LT_DECL_EGREP])dnl
585090b17f1bSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
5851983b4bf2Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5852983b4bf2Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5853983b4bf2Smrg    (test "X$CXX" != "Xg++"))) ; then
585490b17f1bSmrg  AC_PROG_CXXCPP
585590b17f1bSmrgelse
585690b17f1bSmrg  _lt_caught_CXX_error=yes
585790b17f1bSmrgfi
585890b17f1bSmrg
585990b17f1bSmrgAC_LANG_PUSH(C++)
586090b17f1bSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
586190b17f1bSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
586290b17f1bSmrg_LT_TAGVAR(always_export_symbols, $1)=no
586390b17f1bSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
586490b17f1bSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
586590b17f1bSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
586690b17f1bSmrg_LT_TAGVAR(hardcode_direct, $1)=no
586790b17f1bSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
586890b17f1bSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
586990b17f1bSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
587090b17f1bSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
587190b17f1bSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
587290b17f1bSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
587390b17f1bSmrg_LT_TAGVAR(inherit_rpath, $1)=no
587490b17f1bSmrg_LT_TAGVAR(module_cmds, $1)=
587590b17f1bSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
587690b17f1bSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
587790b17f1bSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
587890b17f1bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
587990b17f1bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
588090b17f1bSmrg_LT_TAGVAR(no_undefined_flag, $1)=
588190b17f1bSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
588290b17f1bSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
588390b17f1bSmrg
588490b17f1bSmrg# Source file extension for C++ test sources.
588590b17f1bSmrgac_ext=cpp
588690b17f1bSmrg
588790b17f1bSmrg# Object file extension for compiled C++ test sources.
588890b17f1bSmrgobjext=o
588990b17f1bSmrg_LT_TAGVAR(objext, $1)=$objext
589090b17f1bSmrg
589190b17f1bSmrg# No sense in running all these tests if we already determined that
589290b17f1bSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
589390b17f1bSmrg# are currently assumed to apply to all compilers on this platform,
589490b17f1bSmrg# and will be corrupted by setting them based on a non-working compiler.
5895983b4bf2Smrgif test "$_lt_caught_CXX_error" != yes; then
589690b17f1bSmrg  # Code to be used in simple compile tests
589790b17f1bSmrg  lt_simple_compile_test_code="int some_variable = 0;"
589890b17f1bSmrg
589990b17f1bSmrg  # Code to be used in simple link tests
590090b17f1bSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
590190b17f1bSmrg
590290b17f1bSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
590390b17f1bSmrg  _LT_TAG_COMPILER
590490b17f1bSmrg
590590b17f1bSmrg  # save warnings/boilerplate of simple test code
590690b17f1bSmrg  _LT_COMPILER_BOILERPLATE
590790b17f1bSmrg  _LT_LINKER_BOILERPLATE
590890b17f1bSmrg
590990b17f1bSmrg  # Allow CC to be a program name with arguments.
591090b17f1bSmrg  lt_save_CC=$CC
591190b17f1bSmrg  lt_save_CFLAGS=$CFLAGS
591290b17f1bSmrg  lt_save_LD=$LD
591390b17f1bSmrg  lt_save_GCC=$GCC
591490b17f1bSmrg  GCC=$GXX
591590b17f1bSmrg  lt_save_with_gnu_ld=$with_gnu_ld
591690b17f1bSmrg  lt_save_path_LD=$lt_cv_path_LD
591790b17f1bSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
591890b17f1bSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
59197e6fb56fSmrg  else
592090b17f1bSmrg    $as_unset lt_cv_prog_gnu_ld
59217e6fb56fSmrg  fi
592290b17f1bSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
592390b17f1bSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
59247e6fb56fSmrg  else
592590b17f1bSmrg    $as_unset lt_cv_path_LD
59267e6fb56fSmrg  fi
592790b17f1bSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
592890b17f1bSmrg  CC=${CXX-"c++"}
592990b17f1bSmrg  CFLAGS=$CXXFLAGS
593090b17f1bSmrg  compiler=$CC
593190b17f1bSmrg  _LT_TAGVAR(compiler, $1)=$CC
593290b17f1bSmrg  _LT_CC_BASENAME([$compiler])
59337e6fb56fSmrg
593490b17f1bSmrg  if test -n "$compiler"; then
593590b17f1bSmrg    # We don't want -fno-exception when compiling C++ code, so set the
593690b17f1bSmrg    # no_builtin_flag separately
5937983b4bf2Smrg    if test "$GXX" = yes; then
593890b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
593990b17f1bSmrg    else
594090b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
594190b17f1bSmrg    fi
59427e6fb56fSmrg
5943983b4bf2Smrg    if test "$GXX" = yes; then
594490b17f1bSmrg      # Set up default GNU C++ configuration
59457e6fb56fSmrg
594690b17f1bSmrg      LT_PATH_LD
59477e6fb56fSmrg
594890b17f1bSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
594990b17f1bSmrg      # archiving commands below assume that GNU ld is being used.
5950983b4bf2Smrg      if test "$with_gnu_ld" = yes; then
5951983b4bf2Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5952983b4bf2Smrg        _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'
595390b17f1bSmrg
5954983b4bf2Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5955983b4bf2Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
595690b17f1bSmrg
595790b17f1bSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
595890b17f1bSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
595990b17f1bSmrg        #     investigate it a little bit more. (MM)
5960983b4bf2Smrg        wlarc='${wl}'
596190b17f1bSmrg
596290b17f1bSmrg        # ancient GNU ld didn't support --whole-archive et. al.
596390b17f1bSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
596490b17f1bSmrg	  $GREP 'no-whole-archive' > /dev/null; then
5965983b4bf2Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
596690b17f1bSmrg        else
596790b17f1bSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
596890b17f1bSmrg        fi
596990b17f1bSmrg      else
597090b17f1bSmrg        with_gnu_ld=no
597190b17f1bSmrg        wlarc=
597290b17f1bSmrg
597390b17f1bSmrg        # A generic and very simple default shared library creation
597490b17f1bSmrg        # command for GNU C++ for the case where it uses the native
597590b17f1bSmrg        # linker, instead of GNU ld.  If possible, this setting should
597690b17f1bSmrg        # overridden to take advantage of the native linker features on
597790b17f1bSmrg        # the platform it is being used on.
597890b17f1bSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
59797e6fb56fSmrg      fi
598090b17f1bSmrg
598190b17f1bSmrg      # Commands to make compiler produce verbose output that lists
598290b17f1bSmrg      # what "hidden" libraries, object files and flags are used when
598390b17f1bSmrg      # linking a shared library.
598490b17f1bSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
598590b17f1bSmrg
598690b17f1bSmrg    else
598790b17f1bSmrg      GXX=no
598890b17f1bSmrg      with_gnu_ld=no
598990b17f1bSmrg      wlarc=
599090b17f1bSmrg    fi
599190b17f1bSmrg
599290b17f1bSmrg    # PORTME: fill in a description of your system's C++ link characteristics
599390b17f1bSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
599490b17f1bSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
59957e6fb56fSmrg    case $host_os in
599690b17f1bSmrg      aix3*)
599790b17f1bSmrg        # FIXME: insert proper C++ library support
599890b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
599990b17f1bSmrg        ;;
60007e6fb56fSmrg      aix[[4-9]]*)
6001983b4bf2Smrg        if test "$host_cpu" = ia64; then
600290b17f1bSmrg          # On IA64, the linker does run time linking by default, so we don't
600390b17f1bSmrg          # have to do anything special.
600490b17f1bSmrg          aix_use_runtimelinking=no
600590b17f1bSmrg          exp_sym_flag='-Bexport'
6006983b4bf2Smrg          no_entry_flag=""
600790b17f1bSmrg        else
600890b17f1bSmrg          aix_use_runtimelinking=no
600990b17f1bSmrg
601090b17f1bSmrg          # Test if we are trying to use run time linking or normal
601190b17f1bSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6012983b4bf2Smrg          # need to do runtime linking.
601390b17f1bSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
601490b17f1bSmrg	    for ld_flag in $LDFLAGS; do
601590b17f1bSmrg	      case $ld_flag in
601690b17f1bSmrg	      *-brtl*)
601790b17f1bSmrg	        aix_use_runtimelinking=yes
601890b17f1bSmrg	        break
601990b17f1bSmrg	        ;;
602090b17f1bSmrg	      esac
602190b17f1bSmrg	    done
602290b17f1bSmrg	    ;;
602390b17f1bSmrg          esac
602490b17f1bSmrg
602590b17f1bSmrg          exp_sym_flag='-bexport'
602690b17f1bSmrg          no_entry_flag='-bnoentry'
602790b17f1bSmrg        fi
602890b17f1bSmrg
602990b17f1bSmrg        # When large executables or shared objects are built, AIX ld can
603090b17f1bSmrg        # have problems creating the table of contents.  If linking a library
603190b17f1bSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
603290b17f1bSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
603390b17f1bSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
603490b17f1bSmrg
603590b17f1bSmrg        _LT_TAGVAR(archive_cmds, $1)=''
603690b17f1bSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
603790b17f1bSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
603890b17f1bSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
603990b17f1bSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6040983b4bf2Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
604190b17f1bSmrg
6042983b4bf2Smrg        if test "$GXX" = yes; then
604390b17f1bSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
604490b17f1bSmrg          # We only want to do this on AIX 4.2 and lower, the check
604590b17f1bSmrg          # below for broken collect2 doesn't work under 4.3+
6046983b4bf2Smrg	  collect2name=`${CC} -print-prog-name=collect2`
604790b17f1bSmrg	  if test -f "$collect2name" &&
604890b17f1bSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
604990b17f1bSmrg	  then
605090b17f1bSmrg	    # We have reworked collect2
605190b17f1bSmrg	    :
605290b17f1bSmrg	  else
605390b17f1bSmrg	    # We have old collect2
605490b17f1bSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
605590b17f1bSmrg	    # It fails to find uninstalled libraries when the uninstalled
605690b17f1bSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
605790b17f1bSmrg	    # to unsupported forces relinking
605890b17f1bSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
605990b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
606090b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
606190b17f1bSmrg	  fi
606290b17f1bSmrg          esac
606390b17f1bSmrg          shared_flag='-shared'
6064983b4bf2Smrg	  if test "$aix_use_runtimelinking" = yes; then
6065983b4bf2Smrg	    shared_flag="$shared_flag "'${wl}-G'
606690b17f1bSmrg	  fi
606790b17f1bSmrg        else
606890b17f1bSmrg          # not using gcc
6069983b4bf2Smrg          if test "$host_cpu" = ia64; then
607090b17f1bSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
607190b17f1bSmrg	  # chokes on -Wl,-G. The following line is correct:
607290b17f1bSmrg	  shared_flag='-G'
607390b17f1bSmrg          else
6074983b4bf2Smrg	    if test "$aix_use_runtimelinking" = yes; then
6075983b4bf2Smrg	      shared_flag='${wl}-G'
607690b17f1bSmrg	    else
6077983b4bf2Smrg	      shared_flag='${wl}-bM:SRE'
607890b17f1bSmrg	    fi
607990b17f1bSmrg          fi
608090b17f1bSmrg        fi
608190b17f1bSmrg
6082983b4bf2Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
608390b17f1bSmrg        # It seems that -bexpall does not export symbols beginning with
608490b17f1bSmrg        # underscore (_), so it is better to generate a list of symbols to
608590b17f1bSmrg	# export.
608690b17f1bSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
6087983b4bf2Smrg        if test "$aix_use_runtimelinking" = yes; then
608890b17f1bSmrg          # Warning - without using the other runtime loading flags (-brtl),
608990b17f1bSmrg          # -berok will link without error, but may produce a broken library.
6090983b4bf2Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
609190b17f1bSmrg          # Determine the default libpath from the value encoded in an empty
609290b17f1bSmrg          # executable.
609390b17f1bSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
6094983b4bf2Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
609590b17f1bSmrg
6096983b4bf2Smrg          _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"
609790b17f1bSmrg        else
6098983b4bf2Smrg          if test "$host_cpu" = ia64; then
6099983b4bf2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
610090b17f1bSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6101983b4bf2Smrg	    _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"
610290b17f1bSmrg          else
610390b17f1bSmrg	    # Determine the default libpath from the value encoded in an
610490b17f1bSmrg	    # empty executable.
610590b17f1bSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
6106983b4bf2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
610790b17f1bSmrg	    # Warning - without using the other run time loading flags,
610890b17f1bSmrg	    # -berok will link without error, but may produce a broken library.
6109983b4bf2Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6110983b4bf2Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6111983b4bf2Smrg	    if test "$with_gnu_ld" = yes; then
611290b17f1bSmrg	      # We only use this code for GNU lds that support --whole-archive.
6113983b4bf2Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
611490b17f1bSmrg	    else
611590b17f1bSmrg	      # Exported symbols can be pulled into shared objects from archives
611690b17f1bSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
611790b17f1bSmrg	    fi
611890b17f1bSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6119983b4bf2Smrg	    # This is similar to how AIX traditionally builds its shared
6120983b4bf2Smrg	    # libraries.
6121983b4bf2Smrg	    _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'
612290b17f1bSmrg          fi
612390b17f1bSmrg        fi
612490b17f1bSmrg        ;;
612590b17f1bSmrg
612690b17f1bSmrg      beos*)
612790b17f1bSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
612890b17f1bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
612990b17f1bSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
613090b17f1bSmrg	  # support --undefined.  This deserves some investigation.  FIXME
6131983b4bf2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
61327e6fb56fSmrg	else
613390b17f1bSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
61347e6fb56fSmrg	fi
61357e6fb56fSmrg	;;
613690b17f1bSmrg
61377e6fb56fSmrg      chorus*)
613890b17f1bSmrg        case $cc_basename in
613990b17f1bSmrg          *)
614090b17f1bSmrg	  # FIXME: insert proper C++ library support
614190b17f1bSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
614290b17f1bSmrg	  ;;
614390b17f1bSmrg        esac
614490b17f1bSmrg        ;;
614590b17f1bSmrg
614690b17f1bSmrg      cygwin* | mingw* | pw32* | cegcc*)
614790b17f1bSmrg	case $GXX,$cc_basename in
614890b17f1bSmrg	,cl* | no,cl*)
614990b17f1bSmrg	  # Native MSVC
615090b17f1bSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
615190b17f1bSmrg	  # no search path for DLLs.
615290b17f1bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
615390b17f1bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
615490b17f1bSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
615590b17f1bSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
615690b17f1bSmrg	  # Tell ltmain to make .lib files, not .a files.
615790b17f1bSmrg	  libext=lib
615890b17f1bSmrg	  # Tell ltmain to make .dll files, not .so files.
6159983b4bf2Smrg	  shrext_cmds=".dll"
616090b17f1bSmrg	  # FIXME: Setting linknames here is a bad hack.
6161983b4bf2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6162983b4bf2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6163983b4bf2Smrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6164983b4bf2Smrg	    else
6165983b4bf2Smrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6166983b4bf2Smrg	    fi~
6167983b4bf2Smrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6168983b4bf2Smrg	    linknames='
616990b17f1bSmrg	  # The linker will not automatically build a static lib if we build a DLL.
617090b17f1bSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
617190b17f1bSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
617290b17f1bSmrg	  # Don't use ranlib
617390b17f1bSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
617490b17f1bSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6175983b4bf2Smrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
6176983b4bf2Smrg	    case $lt_outputfile in
6177983b4bf2Smrg	      *.exe|*.EXE) ;;
6178983b4bf2Smrg	      *)
6179983b4bf2Smrg		lt_outputfile="$lt_outputfile.exe"
6180983b4bf2Smrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
6181983b4bf2Smrg		;;
6182983b4bf2Smrg	    esac~
6183983b4bf2Smrg	    func_to_tool_file "$lt_outputfile"~
6184983b4bf2Smrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6185983b4bf2Smrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6186983b4bf2Smrg	      $RM "$lt_outputfile.manifest";
6187983b4bf2Smrg	    fi'
618890b17f1bSmrg	  ;;
618990b17f1bSmrg	*)
619090b17f1bSmrg	  # g++
619190b17f1bSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
619290b17f1bSmrg	  # as there is no search path for DLLs.
619390b17f1bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6194983b4bf2Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
619590b17f1bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
619690b17f1bSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
619790b17f1bSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
619890b17f1bSmrg
619990b17f1bSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6200983b4bf2Smrg	    _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'
6201983b4bf2Smrg	    # If the export-symbols file already is a .def file (1st line
6202983b4bf2Smrg	    # is EXPORTS), use it as is; otherwise, prepend...
6203983b4bf2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6204983b4bf2Smrg	      cp $export_symbols $output_objdir/$soname.def;
6205983b4bf2Smrg	    else
6206983b4bf2Smrg	      echo EXPORTS > $output_objdir/$soname.def;
6207983b4bf2Smrg	      cat $export_symbols >> $output_objdir/$soname.def;
6208983b4bf2Smrg	    fi~
6209983b4bf2Smrg	    $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'
621090b17f1bSmrg	  else
621190b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
621290b17f1bSmrg	  fi
62137e6fb56fSmrg	  ;;
62147e6fb56fSmrg	esac
62157e6fb56fSmrg	;;
621690b17f1bSmrg      darwin* | rhapsody*)
621790b17f1bSmrg        _LT_DARWIN_LINKER_FEATURES($1)
621890b17f1bSmrg	;;
621990b17f1bSmrg
62207e6fb56fSmrg      dgux*)
622190b17f1bSmrg        case $cc_basename in
622290b17f1bSmrg          ec++*)
622390b17f1bSmrg	    # FIXME: insert proper C++ library support
622490b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62257e6fb56fSmrg	    ;;
622690b17f1bSmrg          ghcx*)
62277e6fb56fSmrg	    # Green Hills C++ Compiler
622890b17f1bSmrg	    # FIXME: insert proper C++ library support
622990b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62307e6fb56fSmrg	    ;;
623190b17f1bSmrg          *)
623290b17f1bSmrg	    # FIXME: insert proper C++ library support
623390b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62347e6fb56fSmrg	    ;;
623590b17f1bSmrg        esac
623690b17f1bSmrg        ;;
623790b17f1bSmrg
623890b17f1bSmrg      freebsd2.*)
623990b17f1bSmrg        # C++ shared libraries reported to be fairly broken before
624090b17f1bSmrg	# switch to ELF
624190b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
624290b17f1bSmrg        ;;
624390b17f1bSmrg
624490b17f1bSmrg      freebsd-elf*)
624590b17f1bSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
624690b17f1bSmrg        ;;
624790b17f1bSmrg
62487e6fb56fSmrg      freebsd* | dragonfly*)
624990b17f1bSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
625090b17f1bSmrg        # conventions
625190b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
625290b17f1bSmrg        ;;
625390b17f1bSmrg
6254983b4bf2Smrg      gnu*)
6255983b4bf2Smrg        ;;
6256983b4bf2Smrg
625790b17f1bSmrg      haiku*)
6258983b4bf2Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
625990b17f1bSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
626090b17f1bSmrg        ;;
626190b17f1bSmrg
626290b17f1bSmrg      hpux9*)
6263983b4bf2Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
626490b17f1bSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6265983b4bf2Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
626690b17f1bSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
626790b17f1bSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
626890b17f1bSmrg				             # but as the default
626990b17f1bSmrg				             # location of the library.
627090b17f1bSmrg
627190b17f1bSmrg        case $cc_basename in
627290b17f1bSmrg          CC*)
627390b17f1bSmrg            # FIXME: insert proper C++ library support
627490b17f1bSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
627590b17f1bSmrg            ;;
627690b17f1bSmrg          aCC*)
6277983b4bf2Smrg            _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'
627890b17f1bSmrg            # Commands to make compiler produce verbose output that lists
627990b17f1bSmrg            # what "hidden" libraries, object files and flags are used when
628090b17f1bSmrg            # linking a shared library.
628190b17f1bSmrg            #
628290b17f1bSmrg            # There doesn't appear to be a way to prevent this compiler from
628390b17f1bSmrg            # explicitly linking system object files so we need to strip them
628490b17f1bSmrg            # from the output so that they don't get included in the library
628590b17f1bSmrg            # dependencies.
6286983b4bf2Smrg            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"'
628790b17f1bSmrg            ;;
628890b17f1bSmrg          *)
6289983b4bf2Smrg            if test "$GXX" = yes; then
6290983b4bf2Smrg              _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'
629190b17f1bSmrg            else
629290b17f1bSmrg              # FIXME: insert proper C++ library support
629390b17f1bSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
629490b17f1bSmrg            fi
629590b17f1bSmrg            ;;
629690b17f1bSmrg        esac
629790b17f1bSmrg        ;;
629890b17f1bSmrg
629990b17f1bSmrg      hpux10*|hpux11*)
6300983b4bf2Smrg        if test $with_gnu_ld = no; then
6301983b4bf2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
630290b17f1bSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
630390b17f1bSmrg
630490b17f1bSmrg          case $host_cpu in
630590b17f1bSmrg            hppa*64*|ia64*)
630690b17f1bSmrg              ;;
630790b17f1bSmrg            *)
6308983b4bf2Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
630990b17f1bSmrg              ;;
631090b17f1bSmrg          esac
631190b17f1bSmrg        fi
631290b17f1bSmrg        case $host_cpu in
631390b17f1bSmrg          hppa*64*|ia64*)
631490b17f1bSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
631590b17f1bSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
631690b17f1bSmrg            ;;
631790b17f1bSmrg          *)
631890b17f1bSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
631990b17f1bSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
632090b17f1bSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
632190b17f1bSmrg					         # but as the default
632290b17f1bSmrg					         # location of the library.
632390b17f1bSmrg            ;;
632490b17f1bSmrg        esac
632590b17f1bSmrg
632690b17f1bSmrg        case $cc_basename in
632790b17f1bSmrg          CC*)
632890b17f1bSmrg	    # FIXME: insert proper C++ library support
632990b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
63307e6fb56fSmrg	    ;;
633190b17f1bSmrg          aCC*)
63327e6fb56fSmrg	    case $host_cpu in
633390b17f1bSmrg	      hppa*64*)
6334983b4bf2Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
633590b17f1bSmrg	        ;;
633690b17f1bSmrg	      ia64*)
6337983b4bf2Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
633890b17f1bSmrg	        ;;
633990b17f1bSmrg	      *)
6340983b4bf2Smrg	        _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'
634190b17f1bSmrg	        ;;
63427e6fb56fSmrg	    esac
634390b17f1bSmrg	    # Commands to make compiler produce verbose output that lists
634490b17f1bSmrg	    # what "hidden" libraries, object files and flags are used when
634590b17f1bSmrg	    # linking a shared library.
634690b17f1bSmrg	    #
634790b17f1bSmrg	    # There doesn't appear to be a way to prevent this compiler from
634890b17f1bSmrg	    # explicitly linking system object files so we need to strip them
634990b17f1bSmrg	    # from the output so that they don't get included in the library
635090b17f1bSmrg	    # dependencies.
6351983b4bf2Smrg	    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"'
63527e6fb56fSmrg	    ;;
635390b17f1bSmrg          *)
6354983b4bf2Smrg	    if test "$GXX" = yes; then
6355983b4bf2Smrg	      if test $with_gnu_ld = no; then
635690b17f1bSmrg	        case $host_cpu in
635790b17f1bSmrg	          hppa*64*)
6358983b4bf2Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
635990b17f1bSmrg	            ;;
636090b17f1bSmrg	          ia64*)
6361983b4bf2Smrg	            _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'
636290b17f1bSmrg	            ;;
636390b17f1bSmrg	          *)
6364983b4bf2Smrg	            _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'
636590b17f1bSmrg	            ;;
636690b17f1bSmrg	        esac
636790b17f1bSmrg	      fi
636890b17f1bSmrg	    else
636990b17f1bSmrg	      # FIXME: insert proper C++ library support
637090b17f1bSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
637190b17f1bSmrg	    fi
63727e6fb56fSmrg	    ;;
637390b17f1bSmrg        esac
637490b17f1bSmrg        ;;
637590b17f1bSmrg
637690b17f1bSmrg      interix[[3-9]]*)
637790b17f1bSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
637890b17f1bSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6379983b4bf2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6380983b4bf2Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
638190b17f1bSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
638290b17f1bSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
638390b17f1bSmrg	# default) and relocated if they conflict, which is a slow very memory
638490b17f1bSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
638590b17f1bSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
638690b17f1bSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6387983b4bf2Smrg	_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'
6388983b4bf2Smrg	_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'
63897e6fb56fSmrg	;;
639090b17f1bSmrg      irix5* | irix6*)
639190b17f1bSmrg        case $cc_basename in
639290b17f1bSmrg          CC*)
639390b17f1bSmrg	    # SGI C++
6394983b4bf2Smrg	    _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'
639590b17f1bSmrg
639690b17f1bSmrg	    # Archives containing C++ object files must be created using
639790b17f1bSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
639890b17f1bSmrg	    # necessary to make sure instantiated templates are included
639990b17f1bSmrg	    # in the archive.
640090b17f1bSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
64017e6fb56fSmrg	    ;;
640290b17f1bSmrg          *)
6403983b4bf2Smrg	    if test "$GXX" = yes; then
6404983b4bf2Smrg	      if test "$with_gnu_ld" = no; then
6405983b4bf2Smrg	        _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'
640690b17f1bSmrg	      else
6407983b4bf2Smrg	        _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'
640890b17f1bSmrg	      fi
640990b17f1bSmrg	    fi
641090b17f1bSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
64117e6fb56fSmrg	    ;;
641290b17f1bSmrg        esac
6413983b4bf2Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
641490b17f1bSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
641590b17f1bSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
641690b17f1bSmrg        ;;
641790b17f1bSmrg
6418983b4bf2Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
641990b17f1bSmrg        case $cc_basename in
642090b17f1bSmrg          KCC*)
642190b17f1bSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
642290b17f1bSmrg
642390b17f1bSmrg	    # KCC will only create a shared library if the output file
642490b17f1bSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
642590b17f1bSmrg	    # to its proper name (with version) after linking.
6426983b4bf2Smrg	    _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'
6427983b4bf2Smrg	    _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'
642890b17f1bSmrg	    # Commands to make compiler produce verbose output that lists
642990b17f1bSmrg	    # what "hidden" libraries, object files and flags are used when
643090b17f1bSmrg	    # linking a shared library.
643190b17f1bSmrg	    #
643290b17f1bSmrg	    # There doesn't appear to be a way to prevent this compiler from
643390b17f1bSmrg	    # explicitly linking system object files so we need to strip them
643490b17f1bSmrg	    # from the output so that they don't get included in the library
643590b17f1bSmrg	    # dependencies.
6436983b4bf2Smrg	    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"'
643790b17f1bSmrg
6438983b4bf2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6439983b4bf2Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
644090b17f1bSmrg
644190b17f1bSmrg	    # Archives containing C++ object files must be created using
644290b17f1bSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
644390b17f1bSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
64447e6fb56fSmrg	    ;;
644590b17f1bSmrg	  icpc* | ecpc* )
64467e6fb56fSmrg	    # Intel C++
644790b17f1bSmrg	    with_gnu_ld=yes
644890b17f1bSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
644990b17f1bSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
645090b17f1bSmrg	    # earlier do not add the objects themselves.
645190b17f1bSmrg	    case `$CC -V 2>&1` in
645290b17f1bSmrg	      *"Version 7."*)
6453983b4bf2Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6454983b4bf2Smrg		_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'
645590b17f1bSmrg		;;
645690b17f1bSmrg	      *)  # Version 8.0 or newer
645790b17f1bSmrg	        tmp_idyn=
645890b17f1bSmrg	        case $host_cpu in
645990b17f1bSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
646090b17f1bSmrg		esac
6461983b4bf2Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6462983b4bf2Smrg		_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'
646390b17f1bSmrg		;;
646490b17f1bSmrg	    esac
646590b17f1bSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6466983b4bf2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6467983b4bf2Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6468983b4bf2Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
64697e6fb56fSmrg	    ;;
647090b17f1bSmrg          pgCC* | pgcpp*)
647190b17f1bSmrg            # Portland Group C++ compiler
647290b17f1bSmrg	    case `$CC -V` in
647390b17f1bSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
647490b17f1bSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
6475983b4bf2Smrg		rm -rf $tpldir~
6476983b4bf2Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
6477983b4bf2Smrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
647890b17f1bSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
6479983b4bf2Smrg		rm -rf $tpldir~
6480983b4bf2Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
6481983b4bf2Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
6482983b4bf2Smrg		$RANLIB $oldlib'
648390b17f1bSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
6484983b4bf2Smrg		rm -rf $tpldir~
6485983b4bf2Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6486983b4bf2Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
648790b17f1bSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
6488983b4bf2Smrg		rm -rf $tpldir~
6489983b4bf2Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6490983b4bf2Smrg		$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'
649190b17f1bSmrg	      ;;
649290b17f1bSmrg	    *) # Version 6 and above use weak symbols
6493983b4bf2Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6494983b4bf2Smrg	      _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'
649590b17f1bSmrg	      ;;
649690b17f1bSmrg	    esac
649790b17f1bSmrg
6498983b4bf2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
6499983b4bf2Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6500983b4bf2Smrg	    _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'
650190b17f1bSmrg            ;;
65027e6fb56fSmrg	  cxx*)
65037e6fb56fSmrg	    # Compaq C++
6504983b4bf2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6505983b4bf2Smrg	    _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'
650690b17f1bSmrg
650790b17f1bSmrg	    runpath_var=LD_RUN_PATH
650890b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
650990b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
651090b17f1bSmrg
651190b17f1bSmrg	    # Commands to make compiler produce verbose output that lists
651290b17f1bSmrg	    # what "hidden" libraries, object files and flags are used when
651390b17f1bSmrg	    # linking a shared library.
651490b17f1bSmrg	    #
651590b17f1bSmrg	    # There doesn't appear to be a way to prevent this compiler from
651690b17f1bSmrg	    # explicitly linking system object files so we need to strip them
651790b17f1bSmrg	    # from the output so that they don't get included in the library
651890b17f1bSmrg	    # dependencies.
6519983b4bf2Smrg	    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'
652090b17f1bSmrg	    ;;
652190b17f1bSmrg	  xl* | mpixl* | bgxl*)
652290b17f1bSmrg	    # IBM XL 8.0 on PPC, with GNU ld
6523983b4bf2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6524983b4bf2Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6525983b4bf2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6526983b4bf2Smrg	    if test "x$supports_anon_versioning" = xyes; then
652790b17f1bSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
6528983b4bf2Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6529983b4bf2Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
6530983b4bf2Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
653190b17f1bSmrg	    fi
65327e6fb56fSmrg	    ;;
65337e6fb56fSmrg	  *)
65347e6fb56fSmrg	    case `$CC -V 2>&1 | sed 5q` in
65357e6fb56fSmrg	    *Sun\ C*)
65367e6fb56fSmrg	      # Sun C++ 5.9
653790b17f1bSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6538983b4bf2Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6539983b4bf2Smrg	      _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'
654090b17f1bSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6541983b4bf2Smrg	      _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'
654290b17f1bSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
654390b17f1bSmrg
654490b17f1bSmrg	      # Not sure whether something based on
654590b17f1bSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
654690b17f1bSmrg	      # would be better.
654790b17f1bSmrg	      output_verbose_link_cmd='func_echo_all'
654890b17f1bSmrg
654990b17f1bSmrg	      # Archives containing C++ object files must be created using
655090b17f1bSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
655190b17f1bSmrg	      # necessary to make sure instantiated templates are included
655290b17f1bSmrg	      # in the archive.
655390b17f1bSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
65547e6fb56fSmrg	      ;;
65557e6fb56fSmrg	    esac
65567e6fb56fSmrg	    ;;
65577e6fb56fSmrg	esac
65587e6fb56fSmrg	;;
655990b17f1bSmrg
65607e6fb56fSmrg      lynxos*)
656190b17f1bSmrg        # FIXME: insert proper C++ library support
656290b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
65637e6fb56fSmrg	;;
656490b17f1bSmrg
65657e6fb56fSmrg      m88k*)
656690b17f1bSmrg        # FIXME: insert proper C++ library support
656790b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
65687e6fb56fSmrg	;;
656990b17f1bSmrg
65707e6fb56fSmrg      mvs*)
657190b17f1bSmrg        case $cc_basename in
657290b17f1bSmrg          cxx*)
657390b17f1bSmrg	    # FIXME: insert proper C++ library support
657490b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
65757e6fb56fSmrg	    ;;
65767e6fb56fSmrg	  *)
657790b17f1bSmrg	    # FIXME: insert proper C++ library support
657890b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
65797e6fb56fSmrg	    ;;
65807e6fb56fSmrg	esac
65817e6fb56fSmrg	;;
658290b17f1bSmrg
65837e6fb56fSmrg      netbsd*)
658490b17f1bSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
658590b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
658690b17f1bSmrg	  wlarc=
658790b17f1bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
658890b17f1bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
658990b17f1bSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
659090b17f1bSmrg	fi
659190b17f1bSmrg	# Workaround some broken pre-1.5 toolchains
659290b17f1bSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
65937e6fb56fSmrg	;;
659490b17f1bSmrg
659590b17f1bSmrg      *nto* | *qnx*)
659690b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
659790b17f1bSmrg	;;
659890b17f1bSmrg
6599983b4bf2Smrg      openbsd2*)
6600983b4bf2Smrg        # C++ shared libraries are fairly broken
6601983b4bf2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6602983b4bf2Smrg	;;
6603983b4bf2Smrg
6604983b4bf2Smrg      openbsd*)
660590b17f1bSmrg	if test -f /usr/libexec/ld.so; then
660690b17f1bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
660790b17f1bSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
660890b17f1bSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
660990b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6610983b4bf2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6611983b4bf2Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6612983b4bf2Smrg	    _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'
6613983b4bf2Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6614983b4bf2Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
661590b17f1bSmrg	  fi
661690b17f1bSmrg	  output_verbose_link_cmd=func_echo_all
661790b17f1bSmrg	else
661890b17f1bSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
661990b17f1bSmrg	fi
662090b17f1bSmrg	;;
662190b17f1bSmrg
66227e6fb56fSmrg      osf3* | osf4* | osf5*)
662390b17f1bSmrg        case $cc_basename in
662490b17f1bSmrg          KCC*)
662590b17f1bSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
662690b17f1bSmrg
662790b17f1bSmrg	    # KCC will only create a shared library if the output file
662890b17f1bSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
662990b17f1bSmrg	    # to its proper name (with version) after linking.
6630983b4bf2Smrg	    _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'
663190b17f1bSmrg
6632983b4bf2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
663390b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
663490b17f1bSmrg
663590b17f1bSmrg	    # Archives containing C++ object files must be created using
663690b17f1bSmrg	    # the KAI C++ compiler.
663790b17f1bSmrg	    case $host in
663890b17f1bSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
663990b17f1bSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
664090b17f1bSmrg	    esac
66417e6fb56fSmrg	    ;;
664290b17f1bSmrg          RCC*)
66437e6fb56fSmrg	    # Rational C++ 2.4.1
664490b17f1bSmrg	    # FIXME: insert proper C++ library support
664590b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
66467e6fb56fSmrg	    ;;
664790b17f1bSmrg          cxx*)
664890b17f1bSmrg	    case $host in
664990b17f1bSmrg	      osf3*)
6650983b4bf2Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6651983b4bf2Smrg	        _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'
6652983b4bf2Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
665390b17f1bSmrg		;;
665490b17f1bSmrg	      *)
665590b17f1bSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6656983b4bf2Smrg	        _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'
665790b17f1bSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6658983b4bf2Smrg	          echo "-hidden">> $lib.exp~
6659983b4bf2Smrg	          $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~
6660983b4bf2Smrg	          $RM $lib.exp'
666190b17f1bSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
666290b17f1bSmrg		;;
666390b17f1bSmrg	    esac
666490b17f1bSmrg
666590b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
666690b17f1bSmrg
666790b17f1bSmrg	    # Commands to make compiler produce verbose output that lists
666890b17f1bSmrg	    # what "hidden" libraries, object files and flags are used when
666990b17f1bSmrg	    # linking a shared library.
667090b17f1bSmrg	    #
667190b17f1bSmrg	    # There doesn't appear to be a way to prevent this compiler from
667290b17f1bSmrg	    # explicitly linking system object files so we need to strip them
667390b17f1bSmrg	    # from the output so that they don't get included in the library
667490b17f1bSmrg	    # dependencies.
6675983b4bf2Smrg	    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"'
66767e6fb56fSmrg	    ;;
66777e6fb56fSmrg	  *)
6678983b4bf2Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6679983b4bf2Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
668090b17f1bSmrg	      case $host in
668190b17f1bSmrg	        osf3*)
6682983b4bf2Smrg	          _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'
668390b17f1bSmrg		  ;;
668490b17f1bSmrg	        *)
6685983b4bf2Smrg	          _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'
668690b17f1bSmrg		  ;;
668790b17f1bSmrg	      esac
668890b17f1bSmrg
6689983b4bf2Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
669090b17f1bSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
669190b17f1bSmrg
669290b17f1bSmrg	      # Commands to make compiler produce verbose output that lists
669390b17f1bSmrg	      # what "hidden" libraries, object files and flags are used when
669490b17f1bSmrg	      # linking a shared library.
669590b17f1bSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
669690b17f1bSmrg
669790b17f1bSmrg	    else
669890b17f1bSmrg	      # FIXME: insert proper C++ library support
669990b17f1bSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
670090b17f1bSmrg	    fi
67017e6fb56fSmrg	    ;;
670290b17f1bSmrg        esac
670390b17f1bSmrg        ;;
670490b17f1bSmrg
67057e6fb56fSmrg      psos*)
670690b17f1bSmrg        # FIXME: insert proper C++ library support
670790b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
670890b17f1bSmrg        ;;
670990b17f1bSmrg
671090b17f1bSmrg      sunos4*)
671190b17f1bSmrg        case $cc_basename in
671290b17f1bSmrg          CC*)
671390b17f1bSmrg	    # Sun C++ 4.x
671490b17f1bSmrg	    # FIXME: insert proper C++ library support
671590b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
671690b17f1bSmrg	    ;;
671790b17f1bSmrg          lcc*)
671890b17f1bSmrg	    # Lucid
671990b17f1bSmrg	    # FIXME: insert proper C++ library support
672090b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
672190b17f1bSmrg	    ;;
672290b17f1bSmrg          *)
672390b17f1bSmrg	    # FIXME: insert proper C++ library support
672490b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
672590b17f1bSmrg	    ;;
672690b17f1bSmrg        esac
672790b17f1bSmrg        ;;
672890b17f1bSmrg
67297e6fb56fSmrg      solaris*)
673090b17f1bSmrg        case $cc_basename in
673190b17f1bSmrg          CC* | sunCC*)
67327e6fb56fSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
673390b17f1bSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
673490b17f1bSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6735983b4bf2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
673690b17f1bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6737983b4bf2Smrg	      $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'
673890b17f1bSmrg
673990b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
674090b17f1bSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
674190b17f1bSmrg	    case $host_os in
674290b17f1bSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
674390b17f1bSmrg	      *)
674490b17f1bSmrg		# The compiler driver will combine and reorder linker options,
6745983b4bf2Smrg		# but understands `-z linker_flag'.
674690b17f1bSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
674790b17f1bSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
674890b17f1bSmrg	        ;;
674990b17f1bSmrg	    esac
675090b17f1bSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
675190b17f1bSmrg
675290b17f1bSmrg	    output_verbose_link_cmd='func_echo_all'
675390b17f1bSmrg
675490b17f1bSmrg	    # Archives containing C++ object files must be created using
675590b17f1bSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
675690b17f1bSmrg	    # necessary to make sure instantiated templates are included
675790b17f1bSmrg	    # in the archive.
675890b17f1bSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
67597e6fb56fSmrg	    ;;
676090b17f1bSmrg          gcx*)
67617e6fb56fSmrg	    # Green Hills C++ Compiler
6762983b4bf2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
676390b17f1bSmrg
676490b17f1bSmrg	    # The C++ compiler must be used to create the archive.
676590b17f1bSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
67667e6fb56fSmrg	    ;;
676790b17f1bSmrg          *)
676890b17f1bSmrg	    # GNU C++ compiler with Solaris linker
6769983b4bf2Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6770983b4bf2Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
677190b17f1bSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6772983b4bf2Smrg	        _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'
677390b17f1bSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6774983b4bf2Smrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
677590b17f1bSmrg
677690b17f1bSmrg	        # Commands to make compiler produce verbose output that lists
677790b17f1bSmrg	        # what "hidden" libraries, object files and flags are used when
677890b17f1bSmrg	        # linking a shared library.
677990b17f1bSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
678090b17f1bSmrg	      else
6781983b4bf2Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
678290b17f1bSmrg	        # platform.
6783983b4bf2Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
678490b17f1bSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6785983b4bf2Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
678690b17f1bSmrg
678790b17f1bSmrg	        # Commands to make compiler produce verbose output that lists
678890b17f1bSmrg	        # what "hidden" libraries, object files and flags are used when
678990b17f1bSmrg	        # linking a shared library.
679090b17f1bSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
679190b17f1bSmrg	      fi
679290b17f1bSmrg
6793983b4bf2Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
679490b17f1bSmrg	      case $host_os in
679590b17f1bSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
679690b17f1bSmrg		*)
6797983b4bf2Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
679890b17f1bSmrg		  ;;
679990b17f1bSmrg	      esac
680090b17f1bSmrg	    fi
68017e6fb56fSmrg	    ;;
680290b17f1bSmrg        esac
680390b17f1bSmrg        ;;
680490b17f1bSmrg
680590b17f1bSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6806983b4bf2Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
680790b17f1bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
680890b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
680990b17f1bSmrg      runpath_var='LD_RUN_PATH'
681090b17f1bSmrg
681190b17f1bSmrg      case $cc_basename in
681290b17f1bSmrg        CC*)
6813983b4bf2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6814983b4bf2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
681590b17f1bSmrg	  ;;
681690b17f1bSmrg	*)
6817983b4bf2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6818983b4bf2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
681990b17f1bSmrg	  ;;
682090b17f1bSmrg      esac
682190b17f1bSmrg      ;;
682290b17f1bSmrg
682390b17f1bSmrg      sysv5* | sco3.2v5* | sco5v6*)
6824983b4bf2Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
682590b17f1bSmrg	# link with -lc, and that would cause any symbols used from libc to
682690b17f1bSmrg	# always be unresolved, which means just about no library would
682790b17f1bSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
682890b17f1bSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
682990b17f1bSmrg	# as -z defs.
6830983b4bf2Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6831983b4bf2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
683290b17f1bSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
683390b17f1bSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6834983b4bf2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
683590b17f1bSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
683690b17f1bSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
6837983b4bf2Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
683890b17f1bSmrg	runpath_var='LD_RUN_PATH'
683990b17f1bSmrg
68407e6fb56fSmrg	case $cc_basename in
684190b17f1bSmrg          CC*)
6842983b4bf2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6843983b4bf2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
684490b17f1bSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
6845983b4bf2Smrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
684690b17f1bSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
6847983b4bf2Smrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
68487e6fb56fSmrg	    ;;
68497e6fb56fSmrg	  *)
6850983b4bf2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6851983b4bf2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68527e6fb56fSmrg	    ;;
68537e6fb56fSmrg	esac
685490b17f1bSmrg      ;;
685590b17f1bSmrg
68567e6fb56fSmrg      tandem*)
685790b17f1bSmrg        case $cc_basename in
685890b17f1bSmrg          NCC*)
68597e6fb56fSmrg	    # NonStop-UX NCC 3.20
686090b17f1bSmrg	    # FIXME: insert proper C++ library support
686190b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68627e6fb56fSmrg	    ;;
686390b17f1bSmrg          *)
686490b17f1bSmrg	    # FIXME: insert proper C++ library support
686590b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68667e6fb56fSmrg	    ;;
686790b17f1bSmrg        esac
686890b17f1bSmrg        ;;
686990b17f1bSmrg
68707e6fb56fSmrg      vxworks*)
687190b17f1bSmrg        # FIXME: insert proper C++ library support
687290b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
687390b17f1bSmrg        ;;
687490b17f1bSmrg
68757e6fb56fSmrg      *)
687690b17f1bSmrg        # FIXME: insert proper C++ library support
687790b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
687890b17f1bSmrg        ;;
68797e6fb56fSmrg    esac
68807e6fb56fSmrg
688190b17f1bSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6882983b4bf2Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
688390b17f1bSmrg
6884983b4bf2Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
6885983b4bf2Smrg    _LT_TAGVAR(LD, $1)="$LD"
688690b17f1bSmrg
688790b17f1bSmrg    ## CAVEAT EMPTOR:
688890b17f1bSmrg    ## There is no encapsulation within the following macros, do not change
688990b17f1bSmrg    ## the running order or otherwise move them around unless you know exactly
689090b17f1bSmrg    ## what you are doing...
689190b17f1bSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
689290b17f1bSmrg    _LT_COMPILER_PIC($1)
689390b17f1bSmrg    _LT_COMPILER_C_O($1)
689490b17f1bSmrg    _LT_COMPILER_FILE_LOCKS($1)
689590b17f1bSmrg    _LT_LINKER_SHLIBS($1)
689690b17f1bSmrg    _LT_SYS_DYNAMIC_LINKER($1)
689790b17f1bSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
689890b17f1bSmrg
689990b17f1bSmrg    _LT_CONFIG($1)
690090b17f1bSmrg  fi # test -n "$compiler"
690190b17f1bSmrg
690290b17f1bSmrg  CC=$lt_save_CC
690390b17f1bSmrg  CFLAGS=$lt_save_CFLAGS
690490b17f1bSmrg  LDCXX=$LD
690590b17f1bSmrg  LD=$lt_save_LD
690690b17f1bSmrg  GCC=$lt_save_GCC
690790b17f1bSmrg  with_gnu_ld=$lt_save_with_gnu_ld
690890b17f1bSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
690990b17f1bSmrg  lt_cv_path_LD=$lt_save_path_LD
691090b17f1bSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
691190b17f1bSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6912983b4bf2Smrgfi # test "$_lt_caught_CXX_error" != yes
691390b17f1bSmrg
691490b17f1bSmrgAC_LANG_POP
691590b17f1bSmrg])# _LT_LANG_CXX_CONFIG
691690b17f1bSmrg
691790b17f1bSmrg
691890b17f1bSmrg# _LT_FUNC_STRIPNAME_CNF
691990b17f1bSmrg# ----------------------
692090b17f1bSmrg# func_stripname_cnf prefix suffix name
692190b17f1bSmrg# strip PREFIX and SUFFIX off of NAME.
692290b17f1bSmrg# PREFIX and SUFFIX must not contain globbing or regex special
692390b17f1bSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
692490b17f1bSmrg# dot (in which case that matches only a dot).
692590b17f1bSmrg#
692690b17f1bSmrg# This function is identical to the (non-XSI) version of func_stripname,
692790b17f1bSmrg# except this one can be used by m4 code that may be executed by configure,
692890b17f1bSmrg# rather than the libtool script.
692990b17f1bSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
693090b17f1bSmrgAC_REQUIRE([_LT_DECL_SED])
693190b17f1bSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
693290b17f1bSmrgfunc_stripname_cnf ()
693390b17f1bSmrg{
6934983b4bf2Smrg  case ${2} in
6935983b4bf2Smrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
6936983b4bf2Smrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
693790b17f1bSmrg  esac
693890b17f1bSmrg} # func_stripname_cnf
693990b17f1bSmrg])# _LT_FUNC_STRIPNAME_CNF
694090b17f1bSmrg
694190b17f1bSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
694290b17f1bSmrg# ---------------------------------
694390b17f1bSmrg# Figure out "hidden" library dependencies from verbose
694490b17f1bSmrg# compiler output when linking a shared library.
694590b17f1bSmrg# Parse the compiler output and extract the necessary
694690b17f1bSmrg# objects, libraries and library flags.
694790b17f1bSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
694890b17f1bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
694990b17f1bSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
695090b17f1bSmrg# Dependencies to place before and after the object being linked:
695190b17f1bSmrg_LT_TAGVAR(predep_objects, $1)=
695290b17f1bSmrg_LT_TAGVAR(postdep_objects, $1)=
695390b17f1bSmrg_LT_TAGVAR(predeps, $1)=
695490b17f1bSmrg_LT_TAGVAR(postdeps, $1)=
695590b17f1bSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
695690b17f1bSmrg
695790b17f1bSmrgdnl we can't use the lt_simple_compile_test_code here,
695890b17f1bSmrgdnl because it contains code intended for an executable,
695990b17f1bSmrgdnl not a library.  It's possible we should let each
696090b17f1bSmrgdnl tag define a new lt_????_link_test_code variable,
696190b17f1bSmrgdnl but it's only used here...
696290b17f1bSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
696390b17f1bSmrgint a;
696490b17f1bSmrgvoid foo (void) { a = 0; }
696590b17f1bSmrg_LT_EOF
696690b17f1bSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
696790b17f1bSmrgclass Foo
696890b17f1bSmrg{
696990b17f1bSmrgpublic:
697090b17f1bSmrg  Foo (void) { a = 0; }
697190b17f1bSmrgprivate:
697290b17f1bSmrg  int a;
697390b17f1bSmrg};
697490b17f1bSmrg_LT_EOF
697590b17f1bSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
697690b17f1bSmrg      subroutine foo
697790b17f1bSmrg      implicit none
697890b17f1bSmrg      integer*4 a
697990b17f1bSmrg      a=0
698090b17f1bSmrg      return
698190b17f1bSmrg      end
698290b17f1bSmrg_LT_EOF
698390b17f1bSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
698490b17f1bSmrg      subroutine foo
698590b17f1bSmrg      implicit none
698690b17f1bSmrg      integer a
698790b17f1bSmrg      a=0
698890b17f1bSmrg      return
698990b17f1bSmrg      end
699090b17f1bSmrg_LT_EOF
699190b17f1bSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
699290b17f1bSmrgpublic class foo {
699390b17f1bSmrg  private int a;
699490b17f1bSmrg  public void bar (void) {
699590b17f1bSmrg    a = 0;
699690b17f1bSmrg  }
699790b17f1bSmrg};
699890b17f1bSmrg_LT_EOF
699990b17f1bSmrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
700090b17f1bSmrgpackage foo
700190b17f1bSmrgfunc foo() {
700290b17f1bSmrg}
700390b17f1bSmrg_LT_EOF
700490b17f1bSmrg])
700590b17f1bSmrg
700690b17f1bSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
700790b17f1bSmrgcase "$CC $CFLAGS " in #(
700890b17f1bSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
700990b17f1bSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
701090b17f1bSmrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
701190b17f1bSmrgesac
701290b17f1bSmrg
701390b17f1bSmrgdnl Parse the compiler output and extract the necessary
701490b17f1bSmrgdnl objects, libraries and library flags.
701590b17f1bSmrgif AC_TRY_EVAL(ac_compile); then
701690b17f1bSmrg  # Parse the compiler output and extract the necessary
701790b17f1bSmrg  # objects, libraries and library flags.
701890b17f1bSmrg
701990b17f1bSmrg  # Sentinel used to keep track of whether or not we are before
702090b17f1bSmrg  # the conftest object file.
702190b17f1bSmrg  pre_test_object_deps_done=no
702290b17f1bSmrg
702390b17f1bSmrg  for p in `eval "$output_verbose_link_cmd"`; do
7024983b4bf2Smrg    case ${prev}${p} in
702590b17f1bSmrg
702690b17f1bSmrg    -L* | -R* | -l*)
702790b17f1bSmrg       # Some compilers place space between "-{L,R}" and the path.
702890b17f1bSmrg       # Remove the space.
7029983b4bf2Smrg       if test $p = "-L" ||
7030983b4bf2Smrg          test $p = "-R"; then
703190b17f1bSmrg	 prev=$p
703290b17f1bSmrg	 continue
703390b17f1bSmrg       fi
703490b17f1bSmrg
703590b17f1bSmrg       # Expand the sysroot to ease extracting the directories later.
703690b17f1bSmrg       if test -z "$prev"; then
703790b17f1bSmrg         case $p in
703890b17f1bSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
703990b17f1bSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
704090b17f1bSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
704190b17f1bSmrg         esac
704290b17f1bSmrg       fi
704390b17f1bSmrg       case $p in
704490b17f1bSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
704590b17f1bSmrg       esac
7046983b4bf2Smrg       if test "$pre_test_object_deps_done" = no; then
7047983b4bf2Smrg	 case ${prev} in
704890b17f1bSmrg	 -L | -R)
704990b17f1bSmrg	   # Internal compiler library paths should come after those
705090b17f1bSmrg	   # provided the user.  The postdeps already come after the
705190b17f1bSmrg	   # user supplied libs so there is no need to process them.
705290b17f1bSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7053983b4bf2Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
705490b17f1bSmrg	   else
7055983b4bf2Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
705690b17f1bSmrg	   fi
705790b17f1bSmrg	   ;;
705890b17f1bSmrg	 # The "-l" case would never come before the object being
705990b17f1bSmrg	 # linked, so don't bother handling this case.
706090b17f1bSmrg	 esac
706190b17f1bSmrg       else
706290b17f1bSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7063983b4bf2Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
706490b17f1bSmrg	 else
7065983b4bf2Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
706690b17f1bSmrg	 fi
706790b17f1bSmrg       fi
706890b17f1bSmrg       prev=
706990b17f1bSmrg       ;;
707090b17f1bSmrg
707190b17f1bSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
707290b17f1bSmrg    *.$objext)
707390b17f1bSmrg       # This assumes that the test object file only shows up
707490b17f1bSmrg       # once in the compiler output.
707590b17f1bSmrg       if test "$p" = "conftest.$objext"; then
707690b17f1bSmrg	 pre_test_object_deps_done=yes
707790b17f1bSmrg	 continue
707890b17f1bSmrg       fi
707990b17f1bSmrg
7080983b4bf2Smrg       if test "$pre_test_object_deps_done" = no; then
708190b17f1bSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7082983b4bf2Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
708390b17f1bSmrg	 else
708490b17f1bSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
708590b17f1bSmrg	 fi
708690b17f1bSmrg       else
708790b17f1bSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7088983b4bf2Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
708990b17f1bSmrg	 else
709090b17f1bSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
709190b17f1bSmrg	 fi
709290b17f1bSmrg       fi
709390b17f1bSmrg       ;;
709490b17f1bSmrg
709590b17f1bSmrg    *) ;; # Ignore the rest.
709690b17f1bSmrg
709790b17f1bSmrg    esac
709890b17f1bSmrg  done
709990b17f1bSmrg
710090b17f1bSmrg  # Clean up.
710190b17f1bSmrg  rm -f a.out a.exe
710290b17f1bSmrgelse
710390b17f1bSmrg  echo "libtool.m4: error: problem compiling $1 test program"
710490b17f1bSmrgfi
710590b17f1bSmrg
710690b17f1bSmrg$RM -f confest.$objext
710790b17f1bSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
710890b17f1bSmrg
710990b17f1bSmrg# PORTME: override above test on systems where it is broken
711090b17f1bSmrgm4_if([$1], [CXX],
711190b17f1bSmrg[case $host_os in
711290b17f1bSmrginterix[[3-9]]*)
711390b17f1bSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
711490b17f1bSmrg  # hack all around it, let's just trust "g++" to DTRT.
711590b17f1bSmrg  _LT_TAGVAR(predep_objects,$1)=
711690b17f1bSmrg  _LT_TAGVAR(postdep_objects,$1)=
711790b17f1bSmrg  _LT_TAGVAR(postdeps,$1)=
711890b17f1bSmrg  ;;
7119983b4bf2Smrg
7120983b4bf2Smrglinux*)
7121983b4bf2Smrg  case `$CC -V 2>&1 | sed 5q` in
7122983b4bf2Smrg  *Sun\ C*)
7123983b4bf2Smrg    # Sun C++ 5.9
7124983b4bf2Smrg
7125983b4bf2Smrg    # The more standards-conforming stlport4 library is
7126983b4bf2Smrg    # incompatible with the Cstd library. Avoid specifying
7127983b4bf2Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
7128983b4bf2Smrg    # -library=stlport4 depends on it.
7129983b4bf2Smrg    case " $CXX $CXXFLAGS " in
7130983b4bf2Smrg    *" -library=stlport4 "*)
7131983b4bf2Smrg      solaris_use_stlport4=yes
7132983b4bf2Smrg      ;;
7133983b4bf2Smrg    esac
7134983b4bf2Smrg
7135983b4bf2Smrg    if test "$solaris_use_stlport4" != yes; then
7136983b4bf2Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7137983b4bf2Smrg    fi
7138983b4bf2Smrg    ;;
7139983b4bf2Smrg  esac
7140983b4bf2Smrg  ;;
7141983b4bf2Smrg
7142983b4bf2Smrgsolaris*)
7143983b4bf2Smrg  case $cc_basename in
7144983b4bf2Smrg  CC* | sunCC*)
7145983b4bf2Smrg    # The more standards-conforming stlport4 library is
7146983b4bf2Smrg    # incompatible with the Cstd library. Avoid specifying
7147983b4bf2Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
7148983b4bf2Smrg    # -library=stlport4 depends on it.
7149983b4bf2Smrg    case " $CXX $CXXFLAGS " in
7150983b4bf2Smrg    *" -library=stlport4 "*)
7151983b4bf2Smrg      solaris_use_stlport4=yes
7152983b4bf2Smrg      ;;
7153983b4bf2Smrg    esac
7154983b4bf2Smrg
7155983b4bf2Smrg    # Adding this requires a known-good setup of shared libraries for
7156983b4bf2Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
7157983b4bf2Smrg    # archive will be linked into the output, leading to subtle bugs.
7158983b4bf2Smrg    if test "$solaris_use_stlport4" != yes; then
7159983b4bf2Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7160983b4bf2Smrg    fi
7161983b4bf2Smrg    ;;
7162983b4bf2Smrg  esac
7163983b4bf2Smrg  ;;
716490b17f1bSmrgesac
716590b17f1bSmrg])
716690b17f1bSmrg
716790b17f1bSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
716890b17f1bSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
716990b17f1bSmrgesac
717090b17f1bSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
717190b17f1bSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7172983b4bf2Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
717390b17f1bSmrgfi
717490b17f1bSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
717590b17f1bSmrg    [The directories searched by this compiler when creating a shared library])
717690b17f1bSmrg_LT_TAGDECL([], [predep_objects], [1],
717790b17f1bSmrg    [Dependencies to place before and after the objects being linked to
717890b17f1bSmrg    create a shared library])
717990b17f1bSmrg_LT_TAGDECL([], [postdep_objects], [1])
718090b17f1bSmrg_LT_TAGDECL([], [predeps], [1])
718190b17f1bSmrg_LT_TAGDECL([], [postdeps], [1])
718290b17f1bSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
718390b17f1bSmrg    [The library search path used internally by the compiler when linking
718490b17f1bSmrg    a shared library])
718590b17f1bSmrg])# _LT_SYS_HIDDEN_LIBDEPS
718690b17f1bSmrg
718790b17f1bSmrg
718890b17f1bSmrg# _LT_LANG_F77_CONFIG([TAG])
718990b17f1bSmrg# --------------------------
719090b17f1bSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
719190b17f1bSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7192983b4bf2Smrg# to write the compiler configuration to `libtool'.
719390b17f1bSmrgm4_defun([_LT_LANG_F77_CONFIG],
719490b17f1bSmrg[AC_LANG_PUSH(Fortran 77)
7195983b4bf2Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
719690b17f1bSmrg  _lt_disable_F77=yes
719790b17f1bSmrgfi
719890b17f1bSmrg
719990b17f1bSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
720090b17f1bSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
720190b17f1bSmrg_LT_TAGVAR(always_export_symbols, $1)=no
720290b17f1bSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
720390b17f1bSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
720490b17f1bSmrg_LT_TAGVAR(hardcode_direct, $1)=no
720590b17f1bSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
720690b17f1bSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
720790b17f1bSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
720890b17f1bSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
720990b17f1bSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
721090b17f1bSmrg_LT_TAGVAR(inherit_rpath, $1)=no
721190b17f1bSmrg_LT_TAGVAR(module_cmds, $1)=
721290b17f1bSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
721390b17f1bSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
721490b17f1bSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
721590b17f1bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
721690b17f1bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
721790b17f1bSmrg_LT_TAGVAR(no_undefined_flag, $1)=
721890b17f1bSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
721990b17f1bSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
722090b17f1bSmrg
722190b17f1bSmrg# Source file extension for f77 test sources.
722290b17f1bSmrgac_ext=f
722390b17f1bSmrg
722490b17f1bSmrg# Object file extension for compiled f77 test sources.
722590b17f1bSmrgobjext=o
722690b17f1bSmrg_LT_TAGVAR(objext, $1)=$objext
722790b17f1bSmrg
722890b17f1bSmrg# No sense in running all these tests if we already determined that
722990b17f1bSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
723090b17f1bSmrg# are currently assumed to apply to all compilers on this platform,
723190b17f1bSmrg# and will be corrupted by setting them based on a non-working compiler.
7232983b4bf2Smrgif test "$_lt_disable_F77" != yes; then
723390b17f1bSmrg  # Code to be used in simple compile tests
723490b17f1bSmrg  lt_simple_compile_test_code="\
723590b17f1bSmrg      subroutine t
723690b17f1bSmrg      return
723790b17f1bSmrg      end
723890b17f1bSmrg"
723990b17f1bSmrg
724090b17f1bSmrg  # Code to be used in simple link tests
724190b17f1bSmrg  lt_simple_link_test_code="\
724290b17f1bSmrg      program t
724390b17f1bSmrg      end
724490b17f1bSmrg"
724590b17f1bSmrg
724690b17f1bSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
724790b17f1bSmrg  _LT_TAG_COMPILER
724890b17f1bSmrg
724990b17f1bSmrg  # save warnings/boilerplate of simple test code
725090b17f1bSmrg  _LT_COMPILER_BOILERPLATE
725190b17f1bSmrg  _LT_LINKER_BOILERPLATE
725290b17f1bSmrg
725390b17f1bSmrg  # Allow CC to be a program name with arguments.
7254983b4bf2Smrg  lt_save_CC="$CC"
725590b17f1bSmrg  lt_save_GCC=$GCC
725690b17f1bSmrg  lt_save_CFLAGS=$CFLAGS
725790b17f1bSmrg  CC=${F77-"f77"}
725890b17f1bSmrg  CFLAGS=$FFLAGS
725990b17f1bSmrg  compiler=$CC
726090b17f1bSmrg  _LT_TAGVAR(compiler, $1)=$CC
726190b17f1bSmrg  _LT_CC_BASENAME([$compiler])
726290b17f1bSmrg  GCC=$G77
726390b17f1bSmrg  if test -n "$compiler"; then
726490b17f1bSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
726590b17f1bSmrg    AC_MSG_RESULT([$can_build_shared])
726690b17f1bSmrg
726790b17f1bSmrg    AC_MSG_CHECKING([whether to build shared libraries])
7268983b4bf2Smrg    test "$can_build_shared" = "no" && enable_shared=no
726990b17f1bSmrg
727090b17f1bSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
727190b17f1bSmrg    # are all built from PIC.
727290b17f1bSmrg    case $host_os in
727390b17f1bSmrg      aix3*)
7274983b4bf2Smrg        test "$enable_shared" = yes && enable_static=no
727590b17f1bSmrg        if test -n "$RANLIB"; then
727690b17f1bSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
727790b17f1bSmrg          postinstall_cmds='$RANLIB $lib'
727890b17f1bSmrg        fi
727990b17f1bSmrg        ;;
728090b17f1bSmrg      aix[[4-9]]*)
7281983b4bf2Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7282983b4bf2Smrg	  test "$enable_shared" = yes && enable_static=no
728390b17f1bSmrg	fi
728490b17f1bSmrg        ;;
728590b17f1bSmrg    esac
728690b17f1bSmrg    AC_MSG_RESULT([$enable_shared])
728790b17f1bSmrg
728890b17f1bSmrg    AC_MSG_CHECKING([whether to build static libraries])
728990b17f1bSmrg    # Make sure either enable_shared or enable_static is yes.
7290983b4bf2Smrg    test "$enable_shared" = yes || enable_static=yes
729190b17f1bSmrg    AC_MSG_RESULT([$enable_static])
729290b17f1bSmrg
7293983b4bf2Smrg    _LT_TAGVAR(GCC, $1)="$G77"
7294983b4bf2Smrg    _LT_TAGVAR(LD, $1)="$LD"
729590b17f1bSmrg
729690b17f1bSmrg    ## CAVEAT EMPTOR:
729790b17f1bSmrg    ## There is no encapsulation within the following macros, do not change
729890b17f1bSmrg    ## the running order or otherwise move them around unless you know exactly
729990b17f1bSmrg    ## what you are doing...
730090b17f1bSmrg    _LT_COMPILER_PIC($1)
730190b17f1bSmrg    _LT_COMPILER_C_O($1)
730290b17f1bSmrg    _LT_COMPILER_FILE_LOCKS($1)
730390b17f1bSmrg    _LT_LINKER_SHLIBS($1)
730490b17f1bSmrg    _LT_SYS_DYNAMIC_LINKER($1)
730590b17f1bSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
730690b17f1bSmrg
730790b17f1bSmrg    _LT_CONFIG($1)
730890b17f1bSmrg  fi # test -n "$compiler"
730990b17f1bSmrg
731090b17f1bSmrg  GCC=$lt_save_GCC
7311983b4bf2Smrg  CC="$lt_save_CC"
7312983b4bf2Smrg  CFLAGS="$lt_save_CFLAGS"
7313983b4bf2Smrgfi # test "$_lt_disable_F77" != yes
731490b17f1bSmrg
731590b17f1bSmrgAC_LANG_POP
731690b17f1bSmrg])# _LT_LANG_F77_CONFIG
731790b17f1bSmrg
731890b17f1bSmrg
731990b17f1bSmrg# _LT_LANG_FC_CONFIG([TAG])
732090b17f1bSmrg# -------------------------
732190b17f1bSmrg# Ensure that the configuration variables for a Fortran compiler are
732290b17f1bSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7323983b4bf2Smrg# to write the compiler configuration to `libtool'.
732490b17f1bSmrgm4_defun([_LT_LANG_FC_CONFIG],
732590b17f1bSmrg[AC_LANG_PUSH(Fortran)
732690b17f1bSmrg
7327983b4bf2Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
732890b17f1bSmrg  _lt_disable_FC=yes
732990b17f1bSmrgfi
733090b17f1bSmrg
733190b17f1bSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
733290b17f1bSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
733390b17f1bSmrg_LT_TAGVAR(always_export_symbols, $1)=no
733490b17f1bSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
733590b17f1bSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
733690b17f1bSmrg_LT_TAGVAR(hardcode_direct, $1)=no
733790b17f1bSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
733890b17f1bSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
733990b17f1bSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
734090b17f1bSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
734190b17f1bSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
734290b17f1bSmrg_LT_TAGVAR(inherit_rpath, $1)=no
734390b17f1bSmrg_LT_TAGVAR(module_cmds, $1)=
734490b17f1bSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
734590b17f1bSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
734690b17f1bSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
734790b17f1bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
734890b17f1bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
734990b17f1bSmrg_LT_TAGVAR(no_undefined_flag, $1)=
735090b17f1bSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
735190b17f1bSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
735290b17f1bSmrg
735390b17f1bSmrg# Source file extension for fc test sources.
735490b17f1bSmrgac_ext=${ac_fc_srcext-f}
735590b17f1bSmrg
735690b17f1bSmrg# Object file extension for compiled fc test sources.
735790b17f1bSmrgobjext=o
735890b17f1bSmrg_LT_TAGVAR(objext, $1)=$objext
735990b17f1bSmrg
736090b17f1bSmrg# No sense in running all these tests if we already determined that
736190b17f1bSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
736290b17f1bSmrg# are currently assumed to apply to all compilers on this platform,
736390b17f1bSmrg# and will be corrupted by setting them based on a non-working compiler.
7364983b4bf2Smrgif test "$_lt_disable_FC" != yes; then
736590b17f1bSmrg  # Code to be used in simple compile tests
736690b17f1bSmrg  lt_simple_compile_test_code="\
736790b17f1bSmrg      subroutine t
736890b17f1bSmrg      return
736990b17f1bSmrg      end
737090b17f1bSmrg"
737190b17f1bSmrg
737290b17f1bSmrg  # Code to be used in simple link tests
737390b17f1bSmrg  lt_simple_link_test_code="\
737490b17f1bSmrg      program t
737590b17f1bSmrg      end
737690b17f1bSmrg"
737790b17f1bSmrg
737890b17f1bSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
737990b17f1bSmrg  _LT_TAG_COMPILER
738090b17f1bSmrg
738190b17f1bSmrg  # save warnings/boilerplate of simple test code
738290b17f1bSmrg  _LT_COMPILER_BOILERPLATE
738390b17f1bSmrg  _LT_LINKER_BOILERPLATE
738490b17f1bSmrg
738590b17f1bSmrg  # Allow CC to be a program name with arguments.
7386983b4bf2Smrg  lt_save_CC="$CC"
738790b17f1bSmrg  lt_save_GCC=$GCC
738890b17f1bSmrg  lt_save_CFLAGS=$CFLAGS
738990b17f1bSmrg  CC=${FC-"f95"}
739090b17f1bSmrg  CFLAGS=$FCFLAGS
739190b17f1bSmrg  compiler=$CC
739290b17f1bSmrg  GCC=$ac_cv_fc_compiler_gnu
739390b17f1bSmrg
739490b17f1bSmrg  _LT_TAGVAR(compiler, $1)=$CC
739590b17f1bSmrg  _LT_CC_BASENAME([$compiler])
739690b17f1bSmrg
739790b17f1bSmrg  if test -n "$compiler"; then
739890b17f1bSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
739990b17f1bSmrg    AC_MSG_RESULT([$can_build_shared])
740090b17f1bSmrg
740190b17f1bSmrg    AC_MSG_CHECKING([whether to build shared libraries])
7402983b4bf2Smrg    test "$can_build_shared" = "no" && enable_shared=no
740390b17f1bSmrg
740490b17f1bSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
740590b17f1bSmrg    # are all built from PIC.
740690b17f1bSmrg    case $host_os in
740790b17f1bSmrg      aix3*)
7408983b4bf2Smrg        test "$enable_shared" = yes && enable_static=no
740990b17f1bSmrg        if test -n "$RANLIB"; then
741090b17f1bSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
741190b17f1bSmrg          postinstall_cmds='$RANLIB $lib'
741290b17f1bSmrg        fi
741390b17f1bSmrg        ;;
741490b17f1bSmrg      aix[[4-9]]*)
7415983b4bf2Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7416983b4bf2Smrg	  test "$enable_shared" = yes && enable_static=no
741790b17f1bSmrg	fi
741890b17f1bSmrg        ;;
741990b17f1bSmrg    esac
742090b17f1bSmrg    AC_MSG_RESULT([$enable_shared])
742190b17f1bSmrg
742290b17f1bSmrg    AC_MSG_CHECKING([whether to build static libraries])
742390b17f1bSmrg    # Make sure either enable_shared or enable_static is yes.
7424983b4bf2Smrg    test "$enable_shared" = yes || enable_static=yes
742590b17f1bSmrg    AC_MSG_RESULT([$enable_static])
742690b17f1bSmrg
7427983b4bf2Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
7428983b4bf2Smrg    _LT_TAGVAR(LD, $1)="$LD"
742990b17f1bSmrg
743090b17f1bSmrg    ## CAVEAT EMPTOR:
743190b17f1bSmrg    ## There is no encapsulation within the following macros, do not change
743290b17f1bSmrg    ## the running order or otherwise move them around unless you know exactly
743390b17f1bSmrg    ## what you are doing...
743490b17f1bSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
743590b17f1bSmrg    _LT_COMPILER_PIC($1)
743690b17f1bSmrg    _LT_COMPILER_C_O($1)
743790b17f1bSmrg    _LT_COMPILER_FILE_LOCKS($1)
743890b17f1bSmrg    _LT_LINKER_SHLIBS($1)
743990b17f1bSmrg    _LT_SYS_DYNAMIC_LINKER($1)
744090b17f1bSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
744190b17f1bSmrg
744290b17f1bSmrg    _LT_CONFIG($1)
744390b17f1bSmrg  fi # test -n "$compiler"
744490b17f1bSmrg
744590b17f1bSmrg  GCC=$lt_save_GCC
744690b17f1bSmrg  CC=$lt_save_CC
744790b17f1bSmrg  CFLAGS=$lt_save_CFLAGS
7448983b4bf2Smrgfi # test "$_lt_disable_FC" != yes
744990b17f1bSmrg
745090b17f1bSmrgAC_LANG_POP
745190b17f1bSmrg])# _LT_LANG_FC_CONFIG
745290b17f1bSmrg
745390b17f1bSmrg
745490b17f1bSmrg# _LT_LANG_GCJ_CONFIG([TAG])
745590b17f1bSmrg# --------------------------
745690b17f1bSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
745790b17f1bSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7458983b4bf2Smrg# to write the compiler configuration to `libtool'.
745990b17f1bSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
746090b17f1bSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
746190b17f1bSmrgAC_LANG_SAVE
746290b17f1bSmrg
746390b17f1bSmrg# Source file extension for Java test sources.
746490b17f1bSmrgac_ext=java
746590b17f1bSmrg
746690b17f1bSmrg# Object file extension for compiled Java test sources.
746790b17f1bSmrgobjext=o
746890b17f1bSmrg_LT_TAGVAR(objext, $1)=$objext
746990b17f1bSmrg
747090b17f1bSmrg# Code to be used in simple compile tests
747190b17f1bSmrglt_simple_compile_test_code="class foo {}"
747290b17f1bSmrg
747390b17f1bSmrg# Code to be used in simple link tests
747490b17f1bSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
747590b17f1bSmrg
747690b17f1bSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
747790b17f1bSmrg_LT_TAG_COMPILER
747890b17f1bSmrg
747990b17f1bSmrg# save warnings/boilerplate of simple test code
748090b17f1bSmrg_LT_COMPILER_BOILERPLATE
748190b17f1bSmrg_LT_LINKER_BOILERPLATE
748290b17f1bSmrg
748390b17f1bSmrg# Allow CC to be a program name with arguments.
748490b17f1bSmrglt_save_CC=$CC
748590b17f1bSmrglt_save_CFLAGS=$CFLAGS
748690b17f1bSmrglt_save_GCC=$GCC
748790b17f1bSmrgGCC=yes
748890b17f1bSmrgCC=${GCJ-"gcj"}
748990b17f1bSmrgCFLAGS=$GCJFLAGS
749090b17f1bSmrgcompiler=$CC
749190b17f1bSmrg_LT_TAGVAR(compiler, $1)=$CC
7492983b4bf2Smrg_LT_TAGVAR(LD, $1)="$LD"
749390b17f1bSmrg_LT_CC_BASENAME([$compiler])
749490b17f1bSmrg
749590b17f1bSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
749690b17f1bSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
749790b17f1bSmrg
749890b17f1bSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
749990b17f1bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
750090b17f1bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
750190b17f1bSmrg
750290b17f1bSmrgif test -n "$compiler"; then
750390b17f1bSmrg  _LT_COMPILER_NO_RTTI($1)
750490b17f1bSmrg  _LT_COMPILER_PIC($1)
750590b17f1bSmrg  _LT_COMPILER_C_O($1)
750690b17f1bSmrg  _LT_COMPILER_FILE_LOCKS($1)
750790b17f1bSmrg  _LT_LINKER_SHLIBS($1)
750890b17f1bSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
750990b17f1bSmrg
751090b17f1bSmrg  _LT_CONFIG($1)
751190b17f1bSmrgfi
751290b17f1bSmrg
751390b17f1bSmrgAC_LANG_RESTORE
751490b17f1bSmrg
751590b17f1bSmrgGCC=$lt_save_GCC
751690b17f1bSmrgCC=$lt_save_CC
751790b17f1bSmrgCFLAGS=$lt_save_CFLAGS
751890b17f1bSmrg])# _LT_LANG_GCJ_CONFIG
751990b17f1bSmrg
752090b17f1bSmrg
752190b17f1bSmrg# _LT_LANG_GO_CONFIG([TAG])
752290b17f1bSmrg# --------------------------
752390b17f1bSmrg# Ensure that the configuration variables for the GNU Go compiler
752490b17f1bSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7525983b4bf2Smrg# to write the compiler configuration to `libtool'.
752690b17f1bSmrgm4_defun([_LT_LANG_GO_CONFIG],
752790b17f1bSmrg[AC_REQUIRE([LT_PROG_GO])dnl
752890b17f1bSmrgAC_LANG_SAVE
752990b17f1bSmrg
753090b17f1bSmrg# Source file extension for Go test sources.
753190b17f1bSmrgac_ext=go
753290b17f1bSmrg
753390b17f1bSmrg# Object file extension for compiled Go test sources.
753490b17f1bSmrgobjext=o
753590b17f1bSmrg_LT_TAGVAR(objext, $1)=$objext
753690b17f1bSmrg
753790b17f1bSmrg# Code to be used in simple compile tests
753890b17f1bSmrglt_simple_compile_test_code="package main; func main() { }"
753990b17f1bSmrg
754090b17f1bSmrg# Code to be used in simple link tests
754190b17f1bSmrglt_simple_link_test_code='package main; func main() { }'
754290b17f1bSmrg
754390b17f1bSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
754490b17f1bSmrg_LT_TAG_COMPILER
754590b17f1bSmrg
754690b17f1bSmrg# save warnings/boilerplate of simple test code
754790b17f1bSmrg_LT_COMPILER_BOILERPLATE
754890b17f1bSmrg_LT_LINKER_BOILERPLATE
754990b17f1bSmrg
755090b17f1bSmrg# Allow CC to be a program name with arguments.
755190b17f1bSmrglt_save_CC=$CC
755290b17f1bSmrglt_save_CFLAGS=$CFLAGS
755390b17f1bSmrglt_save_GCC=$GCC
755490b17f1bSmrgGCC=yes
755590b17f1bSmrgCC=${GOC-"gccgo"}
755690b17f1bSmrgCFLAGS=$GOFLAGS
755790b17f1bSmrgcompiler=$CC
755890b17f1bSmrg_LT_TAGVAR(compiler, $1)=$CC
7559983b4bf2Smrg_LT_TAGVAR(LD, $1)="$LD"
756090b17f1bSmrg_LT_CC_BASENAME([$compiler])
756190b17f1bSmrg
756290b17f1bSmrg# Go did not exist at the time GCC didn't implicitly link libc in.
756390b17f1bSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
756490b17f1bSmrg
756590b17f1bSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
756690b17f1bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
756790b17f1bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
756890b17f1bSmrg
756990b17f1bSmrgif test -n "$compiler"; then
757090b17f1bSmrg  _LT_COMPILER_NO_RTTI($1)
757190b17f1bSmrg  _LT_COMPILER_PIC($1)
757290b17f1bSmrg  _LT_COMPILER_C_O($1)
757390b17f1bSmrg  _LT_COMPILER_FILE_LOCKS($1)
757490b17f1bSmrg  _LT_LINKER_SHLIBS($1)
757590b17f1bSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
757690b17f1bSmrg
757790b17f1bSmrg  _LT_CONFIG($1)
757890b17f1bSmrgfi
757990b17f1bSmrg
758090b17f1bSmrgAC_LANG_RESTORE
758190b17f1bSmrg
758290b17f1bSmrgGCC=$lt_save_GCC
758390b17f1bSmrgCC=$lt_save_CC
758490b17f1bSmrgCFLAGS=$lt_save_CFLAGS
758590b17f1bSmrg])# _LT_LANG_GO_CONFIG
758690b17f1bSmrg
758790b17f1bSmrg
758890b17f1bSmrg# _LT_LANG_RC_CONFIG([TAG])
758990b17f1bSmrg# -------------------------
759090b17f1bSmrg# Ensure that the configuration variables for the Windows resource compiler
759190b17f1bSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7592983b4bf2Smrg# to write the compiler configuration to `libtool'.
759390b17f1bSmrgm4_defun([_LT_LANG_RC_CONFIG],
759490b17f1bSmrg[AC_REQUIRE([LT_PROG_RC])dnl
759590b17f1bSmrgAC_LANG_SAVE
759690b17f1bSmrg
759790b17f1bSmrg# Source file extension for RC test sources.
759890b17f1bSmrgac_ext=rc
759990b17f1bSmrg
760090b17f1bSmrg# Object file extension for compiled RC test sources.
760190b17f1bSmrgobjext=o
760290b17f1bSmrg_LT_TAGVAR(objext, $1)=$objext
760390b17f1bSmrg
760490b17f1bSmrg# Code to be used in simple compile tests
760590b17f1bSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
760690b17f1bSmrg
760790b17f1bSmrg# Code to be used in simple link tests
7608983b4bf2Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
760990b17f1bSmrg
761090b17f1bSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
761190b17f1bSmrg_LT_TAG_COMPILER
761290b17f1bSmrg
761390b17f1bSmrg# save warnings/boilerplate of simple test code
761490b17f1bSmrg_LT_COMPILER_BOILERPLATE
761590b17f1bSmrg_LT_LINKER_BOILERPLATE
761690b17f1bSmrg
761790b17f1bSmrg# Allow CC to be a program name with arguments.
7618983b4bf2Smrglt_save_CC="$CC"
761990b17f1bSmrglt_save_CFLAGS=$CFLAGS
762090b17f1bSmrglt_save_GCC=$GCC
762190b17f1bSmrgGCC=
762290b17f1bSmrgCC=${RC-"windres"}
762390b17f1bSmrgCFLAGS=
762490b17f1bSmrgcompiler=$CC
762590b17f1bSmrg_LT_TAGVAR(compiler, $1)=$CC
762690b17f1bSmrg_LT_CC_BASENAME([$compiler])
762790b17f1bSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
762890b17f1bSmrg
762990b17f1bSmrgif test -n "$compiler"; then
763090b17f1bSmrg  :
763190b17f1bSmrg  _LT_CONFIG($1)
763290b17f1bSmrgfi
763390b17f1bSmrg
763490b17f1bSmrgGCC=$lt_save_GCC
763590b17f1bSmrgAC_LANG_RESTORE
763690b17f1bSmrgCC=$lt_save_CC
763790b17f1bSmrgCFLAGS=$lt_save_CFLAGS
763890b17f1bSmrg])# _LT_LANG_RC_CONFIG
763990b17f1bSmrg
764090b17f1bSmrg
764190b17f1bSmrg# LT_PROG_GCJ
764290b17f1bSmrg# -----------
764390b17f1bSmrgAC_DEFUN([LT_PROG_GCJ],
764490b17f1bSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
764590b17f1bSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
764690b17f1bSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
7647983b4bf2Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
764890b17f1bSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
764990b17f1bSmrg])
765090b17f1bSmrg
765190b17f1bSmrg# Old name:
765290b17f1bSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
765390b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
765490b17f1bSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
765590b17f1bSmrg
765690b17f1bSmrg
765790b17f1bSmrg# LT_PROG_GO
765890b17f1bSmrg# ----------
765990b17f1bSmrgAC_DEFUN([LT_PROG_GO],
766090b17f1bSmrg[AC_CHECK_TOOL(GOC, gccgo,)
766190b17f1bSmrg])
766290b17f1bSmrg
766390b17f1bSmrg
766490b17f1bSmrg# LT_PROG_RC
766590b17f1bSmrg# ----------
766690b17f1bSmrgAC_DEFUN([LT_PROG_RC],
766790b17f1bSmrg[AC_CHECK_TOOL(RC, windres,)
766890b17f1bSmrg])
766990b17f1bSmrg
767090b17f1bSmrg# Old name:
767190b17f1bSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
767290b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
767390b17f1bSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
767490b17f1bSmrg
767590b17f1bSmrg
767690b17f1bSmrg# _LT_DECL_EGREP
767790b17f1bSmrg# --------------
767890b17f1bSmrg# If we don't have a new enough Autoconf to choose the best grep
767990b17f1bSmrg# available, choose the one first in the user's PATH.
768090b17f1bSmrgm4_defun([_LT_DECL_EGREP],
768190b17f1bSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
768290b17f1bSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
768390b17f1bSmrgtest -z "$GREP" && GREP=grep
768490b17f1bSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
768590b17f1bSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
768690b17f1bSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
768790b17f1bSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
768890b17f1bSmrgAC_SUBST([GREP])
768990b17f1bSmrg])
769090b17f1bSmrg
769190b17f1bSmrg
769290b17f1bSmrg# _LT_DECL_OBJDUMP
769390b17f1bSmrg# --------------
769490b17f1bSmrg# If we don't have a new enough Autoconf to choose the best objdump
769590b17f1bSmrg# available, choose the one first in the user's PATH.
769690b17f1bSmrgm4_defun([_LT_DECL_OBJDUMP],
769790b17f1bSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
769890b17f1bSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
769990b17f1bSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
770090b17f1bSmrgAC_SUBST([OBJDUMP])
770190b17f1bSmrg])
770290b17f1bSmrg
770390b17f1bSmrg# _LT_DECL_DLLTOOL
770490b17f1bSmrg# ----------------
770590b17f1bSmrg# Ensure DLLTOOL variable is set.
770690b17f1bSmrgm4_defun([_LT_DECL_DLLTOOL],
770790b17f1bSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
770890b17f1bSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
770990b17f1bSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
771090b17f1bSmrgAC_SUBST([DLLTOOL])
771190b17f1bSmrg])
771290b17f1bSmrg
771390b17f1bSmrg# _LT_DECL_SED
771490b17f1bSmrg# ------------
771590b17f1bSmrg# Check for a fully-functional sed program, that truncates
771690b17f1bSmrg# as few characters as possible.  Prefer GNU sed if found.
771790b17f1bSmrgm4_defun([_LT_DECL_SED],
771890b17f1bSmrg[AC_PROG_SED
771990b17f1bSmrgtest -z "$SED" && SED=sed
772090b17f1bSmrgXsed="$SED -e 1s/^X//"
772190b17f1bSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
772290b17f1bSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
772390b17f1bSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
772490b17f1bSmrg])# _LT_DECL_SED
772590b17f1bSmrg
772690b17f1bSmrgm4_ifndef([AC_PROG_SED], [
772790b17f1bSmrg# NOTE: This macro has been submitted for inclusion into   #
772890b17f1bSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
772990b17f1bSmrg#  a released version of Autoconf we should remove this    #
773090b17f1bSmrg#  macro and use it instead.                               #
773190b17f1bSmrg
773290b17f1bSmrgm4_defun([AC_PROG_SED],
773390b17f1bSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
773490b17f1bSmrgAC_CACHE_VAL(lt_cv_path_SED,
773590b17f1bSmrg[# Loop through the user's path and test for sed and gsed.
773690b17f1bSmrg# Then use that list of sed's as ones to test for truncation.
773790b17f1bSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
773890b17f1bSmrgfor as_dir in $PATH
773990b17f1bSmrgdo
774090b17f1bSmrg  IFS=$as_save_IFS
774190b17f1bSmrg  test -z "$as_dir" && as_dir=.
774290b17f1bSmrg  for lt_ac_prog in sed gsed; do
774390b17f1bSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
774490b17f1bSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
774590b17f1bSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
77467e6fb56fSmrg      fi
774790b17f1bSmrg    done
774890b17f1bSmrg  done
774990b17f1bSmrgdone
775090b17f1bSmrgIFS=$as_save_IFS
775190b17f1bSmrglt_ac_max=0
775290b17f1bSmrglt_ac_count=0
775390b17f1bSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
775490b17f1bSmrg# along with /bin/sed that truncates output.
775590b17f1bSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7756983b4bf2Smrg  test ! -f $lt_ac_sed && continue
775790b17f1bSmrg  cat /dev/null > conftest.in
775890b17f1bSmrg  lt_ac_count=0
775990b17f1bSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
776090b17f1bSmrg  # Check for GNU sed and select it if it is found.
776190b17f1bSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
776290b17f1bSmrg    lt_cv_path_SED=$lt_ac_sed
776390b17f1bSmrg    break
776490b17f1bSmrg  fi
776590b17f1bSmrg  while true; do
776690b17f1bSmrg    cat conftest.in conftest.in >conftest.tmp
776790b17f1bSmrg    mv conftest.tmp conftest.in
776890b17f1bSmrg    cp conftest.in conftest.nl
776990b17f1bSmrg    echo >>conftest.nl
777090b17f1bSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
777190b17f1bSmrg    cmp -s conftest.out conftest.nl || break
777290b17f1bSmrg    # 10000 chars as input seems more than enough
7773983b4bf2Smrg    test $lt_ac_count -gt 10 && break
777490b17f1bSmrg    lt_ac_count=`expr $lt_ac_count + 1`
7775983b4bf2Smrg    if test $lt_ac_count -gt $lt_ac_max; then
777690b17f1bSmrg      lt_ac_max=$lt_ac_count
777790b17f1bSmrg      lt_cv_path_SED=$lt_ac_sed
777890b17f1bSmrg    fi
777990b17f1bSmrg  done
778090b17f1bSmrgdone
778190b17f1bSmrg])
778290b17f1bSmrgSED=$lt_cv_path_SED
778390b17f1bSmrgAC_SUBST([SED])
778490b17f1bSmrgAC_MSG_RESULT([$SED])
778590b17f1bSmrg])#AC_PROG_SED
778690b17f1bSmrg])#m4_ifndef
77877e6fb56fSmrg
778890b17f1bSmrg# Old name:
778990b17f1bSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
779090b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
779190b17f1bSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
77927e6fb56fSmrg
77937e6fb56fSmrg
779490b17f1bSmrg# _LT_CHECK_SHELL_FEATURES
779590b17f1bSmrg# ------------------------
779690b17f1bSmrg# Find out whether the shell is Bourne or XSI compatible,
779790b17f1bSmrg# or has some other useful features.
779890b17f1bSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
7799983b4bf2Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7800983b4bf2Smrg# Try some XSI features
7801983b4bf2Smrgxsi_shell=no
7802983b4bf2Smrg( _lt_dummy="a/b/c"
7803983b4bf2Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
7804983b4bf2Smrg      = c,a/b,b/c, \
7805983b4bf2Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
7806983b4bf2Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7807983b4bf2Smrg  && xsi_shell=yes
7808983b4bf2SmrgAC_MSG_RESULT([$xsi_shell])
7809983b4bf2Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7810983b4bf2Smrg
7811983b4bf2SmrgAC_MSG_CHECKING([whether the shell understands "+="])
7812983b4bf2Smrglt_shell_append=no
7813983b4bf2Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7814983b4bf2Smrg    >/dev/null 2>&1 \
7815983b4bf2Smrg  && lt_shell_append=yes
7816983b4bf2SmrgAC_MSG_RESULT([$lt_shell_append])
7817983b4bf2Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7818983b4bf2Smrg
7819983b4bf2Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
782090b17f1bSmrg  lt_unset=unset
782190b17f1bSmrgelse
782290b17f1bSmrg  lt_unset=false
782390b17f1bSmrgfi
782490b17f1bSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
782590b17f1bSmrg
782690b17f1bSmrg# test EBCDIC or ASCII
782790b17f1bSmrgcase `echo X|tr X '\101'` in
782890b17f1bSmrg A) # ASCII based system
782990b17f1bSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
783090b17f1bSmrg  lt_SP2NL='tr \040 \012'
783190b17f1bSmrg  lt_NL2SP='tr \015\012 \040\040'
783290b17f1bSmrg  ;;
783390b17f1bSmrg *) # EBCDIC based system
783490b17f1bSmrg  lt_SP2NL='tr \100 \n'
783590b17f1bSmrg  lt_NL2SP='tr \r\n \100\100'
783690b17f1bSmrg  ;;
783790b17f1bSmrgesac
783890b17f1bSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
783990b17f1bSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
784090b17f1bSmrg])# _LT_CHECK_SHELL_FEATURES
784190b17f1bSmrg
784290b17f1bSmrg
7843983b4bf2Smrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
7844983b4bf2Smrg# ------------------------------------------------------
7845983b4bf2Smrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
7846983b4bf2Smrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
7847983b4bf2Smrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
7848983b4bf2Smrg[dnl {
7849983b4bf2Smrgsed -e '/^$1 ()$/,/^} # $1 /c\
7850983b4bf2Smrg$1 ()\
7851983b4bf2Smrg{\
7852983b4bf2Smrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
7853983b4bf2Smrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
7854983b4bf2Smrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
7855983b4bf2Smrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7856983b4bf2Smrgtest 0 -eq $? || _lt_function_replace_fail=:
7857983b4bf2Smrg])
7858983b4bf2Smrg
7859983b4bf2Smrg
7860983b4bf2Smrg# _LT_PROG_REPLACE_SHELLFNS
7861983b4bf2Smrg# -------------------------
7862983b4bf2Smrg# Replace existing portable implementations of several shell functions with
7863983b4bf2Smrg# equivalent extended shell implementations where those features are available..
7864983b4bf2Smrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
7865983b4bf2Smrg[if test x"$xsi_shell" = xyes; then
7866983b4bf2Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
7867983b4bf2Smrg    case ${1} in
7868983b4bf2Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
7869983b4bf2Smrg      *  ) func_dirname_result="${3}" ;;
7870983b4bf2Smrg    esac])
7871983b4bf2Smrg
7872983b4bf2Smrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
7873983b4bf2Smrg    func_basename_result="${1##*/}"])
7874983b4bf2Smrg
7875983b4bf2Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
7876983b4bf2Smrg    case ${1} in
7877983b4bf2Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
7878983b4bf2Smrg      *  ) func_dirname_result="${3}" ;;
7879983b4bf2Smrg    esac
7880983b4bf2Smrg    func_basename_result="${1##*/}"])
7881983b4bf2Smrg
7882983b4bf2Smrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
7883983b4bf2Smrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7884983b4bf2Smrg    # positional parameters, so assign one to ordinary parameter first.
7885983b4bf2Smrg    func_stripname_result=${3}
7886983b4bf2Smrg    func_stripname_result=${func_stripname_result#"${1}"}
7887983b4bf2Smrg    func_stripname_result=${func_stripname_result%"${2}"}])
7888983b4bf2Smrg
7889983b4bf2Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
7890983b4bf2Smrg    func_split_long_opt_name=${1%%=*}
7891983b4bf2Smrg    func_split_long_opt_arg=${1#*=}])
7892983b4bf2Smrg
7893983b4bf2Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
7894983b4bf2Smrg    func_split_short_opt_arg=${1#??}
7895983b4bf2Smrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
7896983b4bf2Smrg
7897983b4bf2Smrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
7898983b4bf2Smrg    case ${1} in
7899983b4bf2Smrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7900983b4bf2Smrg      *)    func_lo2o_result=${1} ;;
7901983b4bf2Smrg    esac])
7902983b4bf2Smrg
7903983b4bf2Smrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
7904983b4bf2Smrg
7905983b4bf2Smrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
7906983b4bf2Smrg
7907983b4bf2Smrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
7908983b4bf2Smrgfi
7909983b4bf2Smrg
7910983b4bf2Smrgif test x"$lt_shell_append" = xyes; then
7911983b4bf2Smrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
7912983b4bf2Smrg
7913983b4bf2Smrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
7914983b4bf2Smrg    func_quote_for_eval "${2}"
7915983b4bf2Smrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
7916983b4bf2Smrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
7917983b4bf2Smrg
7918983b4bf2Smrg  # Save a `func_append' function call where possible by direct use of '+='
7919983b4bf2Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
7920983b4bf2Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
7921983b4bf2Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7922983b4bf2Smrg  test 0 -eq $? || _lt_function_replace_fail=:
7923983b4bf2Smrgelse
7924983b4bf2Smrg  # Save a `func_append' function call even when '+=' is not available
7925983b4bf2Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
7926983b4bf2Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
7927983b4bf2Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7928983b4bf2Smrg  test 0 -eq $? || _lt_function_replace_fail=:
7929983b4bf2Smrgfi
7930983b4bf2Smrg
7931983b4bf2Smrgif test x"$_lt_function_replace_fail" = x":"; then
7932983b4bf2Smrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
7933983b4bf2Smrgfi
7934983b4bf2Smrg])
7935983b4bf2Smrg
793690b17f1bSmrg# _LT_PATH_CONVERSION_FUNCTIONS
793790b17f1bSmrg# -----------------------------
7938983b4bf2Smrg# Determine which file name conversion functions should be used by
793990b17f1bSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
794090b17f1bSmrg# for certain cross-compile configurations and native mingw.
794190b17f1bSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
794290b17f1bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
794390b17f1bSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
794490b17f1bSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
794590b17f1bSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
794690b17f1bSmrg[case $host in
794790b17f1bSmrg  *-*-mingw* )
794890b17f1bSmrg    case $build in
794990b17f1bSmrg      *-*-mingw* ) # actually msys
795090b17f1bSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
795190b17f1bSmrg        ;;
795290b17f1bSmrg      *-*-cygwin* )
795390b17f1bSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
795490b17f1bSmrg        ;;
795590b17f1bSmrg      * ) # otherwise, assume *nix
795690b17f1bSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
795790b17f1bSmrg        ;;
795890b17f1bSmrg    esac
795990b17f1bSmrg    ;;
796090b17f1bSmrg  *-*-cygwin* )
796190b17f1bSmrg    case $build in
796290b17f1bSmrg      *-*-mingw* ) # actually msys
796390b17f1bSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
796490b17f1bSmrg        ;;
796590b17f1bSmrg      *-*-cygwin* )
796690b17f1bSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
796790b17f1bSmrg        ;;
796890b17f1bSmrg      * ) # otherwise, assume *nix
796990b17f1bSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
797090b17f1bSmrg        ;;
797190b17f1bSmrg    esac
797290b17f1bSmrg    ;;
797390b17f1bSmrg  * ) # unhandled hosts (and "normal" native builds)
797490b17f1bSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
797590b17f1bSmrg    ;;
797690b17f1bSmrgesac
797790b17f1bSmrg])
797890b17f1bSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
797990b17f1bSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
798090b17f1bSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
798190b17f1bSmrg         [0], [convert $build file names to $host format])dnl
798290b17f1bSmrg
798390b17f1bSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
798490b17f1bSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
798590b17f1bSmrg[#assume ordinary cross tools, or native build.
798690b17f1bSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
798790b17f1bSmrgcase $host in
798890b17f1bSmrg  *-*-mingw* )
798990b17f1bSmrg    case $build in
799090b17f1bSmrg      *-*-mingw* ) # actually msys
799190b17f1bSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
799290b17f1bSmrg        ;;
799390b17f1bSmrg    esac
799490b17f1bSmrg    ;;
799590b17f1bSmrgesac
799690b17f1bSmrg])
799790b17f1bSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
799890b17f1bSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
799990b17f1bSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
800090b17f1bSmrg         [0], [convert $build files to toolchain format])dnl
800190b17f1bSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
800290b17f1bSmrg
800390b17f1bSmrg# Helper functions for option handling.                    -*- Autoconf -*-
800490b17f1bSmrg#
8005983b4bf2Smrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
8006983b4bf2Smrg#   Inc.
800790b17f1bSmrg#   Written by Gary V. Vaughan, 2004
800890b17f1bSmrg#
800990b17f1bSmrg# This file is free software; the Free Software Foundation gives
801090b17f1bSmrg# unlimited permission to copy and/or distribute it, with or without
801190b17f1bSmrg# modifications, as long as this notice is preserved.
801290b17f1bSmrg
8013983b4bf2Smrg# serial 7 ltoptions.m4
801490b17f1bSmrg
801590b17f1bSmrg# This is to help aclocal find these macros, as it can't see m4_define.
801690b17f1bSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
801790b17f1bSmrg
801890b17f1bSmrg
801990b17f1bSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
802090b17f1bSmrg# ------------------------------------------
802190b17f1bSmrgm4_define([_LT_MANGLE_OPTION],
802290b17f1bSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
802390b17f1bSmrg
802490b17f1bSmrg
802590b17f1bSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
802690b17f1bSmrg# ---------------------------------------
802790b17f1bSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
802890b17f1bSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
802990b17f1bSmrg# saved as a flag.
803090b17f1bSmrgm4_define([_LT_SET_OPTION],
803190b17f1bSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
803290b17f1bSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
803390b17f1bSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
8034983b4bf2Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
803590b17f1bSmrg])
803690b17f1bSmrg
803790b17f1bSmrg
803890b17f1bSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
803990b17f1bSmrg# ------------------------------------------------------------
804090b17f1bSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
804190b17f1bSmrgm4_define([_LT_IF_OPTION],
804290b17f1bSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
804390b17f1bSmrg
804490b17f1bSmrg
804590b17f1bSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
804690b17f1bSmrg# -------------------------------------------------------
804790b17f1bSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
804890b17f1bSmrg# are set.
804990b17f1bSmrgm4_define([_LT_UNLESS_OPTIONS],
805090b17f1bSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
805190b17f1bSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
805290b17f1bSmrg		      [m4_define([$0_found])])])[]dnl
805390b17f1bSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
805490b17f1bSmrg])[]dnl
805590b17f1bSmrg])
805690b17f1bSmrg
805790b17f1bSmrg
805890b17f1bSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
805990b17f1bSmrg# ----------------------------------------
806090b17f1bSmrg# OPTION-LIST is a space-separated list of Libtool options associated
806190b17f1bSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
806290b17f1bSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
806390b17f1bSmrg# the unknown option and exit.
806490b17f1bSmrgm4_defun([_LT_SET_OPTIONS],
806590b17f1bSmrg[# Set options
806690b17f1bSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
806790b17f1bSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
806890b17f1bSmrg
806990b17f1bSmrgm4_if([$1],[LT_INIT],[
807090b17f1bSmrg  dnl
807190b17f1bSmrg  dnl Simply set some default values (i.e off) if boolean options were not
807290b17f1bSmrg  dnl specified:
807390b17f1bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
807490b17f1bSmrg  ])
807590b17f1bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
807690b17f1bSmrg  ])
807790b17f1bSmrg  dnl
807890b17f1bSmrg  dnl If no reference was made to various pairs of opposing options, then
807990b17f1bSmrg  dnl we run the default mode handler for the pair.  For example, if neither
8080983b4bf2Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
808190b17f1bSmrg  dnl archives by default:
808290b17f1bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
808390b17f1bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
808490b17f1bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
808590b17f1bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
8086983b4bf2Smrg  		   [_LT_ENABLE_FAST_INSTALL])
808790b17f1bSmrg  ])
808890b17f1bSmrg])# _LT_SET_OPTIONS
808990b17f1bSmrg
809090b17f1bSmrg
809190b17f1bSmrg
809290b17f1bSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
809390b17f1bSmrg# -----------------------------------------
809490b17f1bSmrgm4_define([_LT_MANGLE_DEFUN],
809590b17f1bSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
809690b17f1bSmrg
809790b17f1bSmrg
809890b17f1bSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
809990b17f1bSmrg# -----------------------------------------------
810090b17f1bSmrgm4_define([LT_OPTION_DEFINE],
810190b17f1bSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
810290b17f1bSmrg])# LT_OPTION_DEFINE
810390b17f1bSmrg
810490b17f1bSmrg
810590b17f1bSmrg# dlopen
810690b17f1bSmrg# ------
810790b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
810890b17f1bSmrg])
810990b17f1bSmrg
811090b17f1bSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
811190b17f1bSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
811290b17f1bSmrgAC_DIAGNOSE([obsolete],
811390b17f1bSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8114983b4bf2Smrgput the `dlopen' option into LT_INIT's first parameter.])
811590b17f1bSmrg])
811690b17f1bSmrg
811790b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
811890b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
811990b17f1bSmrg
812090b17f1bSmrg
812190b17f1bSmrg# win32-dll
812290b17f1bSmrg# ---------
812390b17f1bSmrg# Declare package support for building win32 dll's.
812490b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
812590b17f1bSmrg[enable_win32_dll=yes
812690b17f1bSmrg
812790b17f1bSmrgcase $host in
812890b17f1bSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
812990b17f1bSmrg  AC_CHECK_TOOL(AS, as, false)
813090b17f1bSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
813190b17f1bSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
813290b17f1bSmrg  ;;
813390b17f1bSmrgesac
813490b17f1bSmrg
813590b17f1bSmrgtest -z "$AS" && AS=as
813690b17f1bSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
813790b17f1bSmrg
813890b17f1bSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
813990b17f1bSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
814090b17f1bSmrg
814190b17f1bSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
814290b17f1bSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
814390b17f1bSmrg])# win32-dll
814490b17f1bSmrg
814590b17f1bSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
814690b17f1bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
814790b17f1bSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
814890b17f1bSmrgAC_DIAGNOSE([obsolete],
814990b17f1bSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8150983b4bf2Smrgput the `win32-dll' option into LT_INIT's first parameter.])
815190b17f1bSmrg])
815290b17f1bSmrg
815390b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
815490b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
815590b17f1bSmrg
815690b17f1bSmrg
815790b17f1bSmrg# _LT_ENABLE_SHARED([DEFAULT])
815890b17f1bSmrg# ----------------------------
8159983b4bf2Smrg# implement the --enable-shared flag, and supports the `shared' and
8160983b4bf2Smrg# `disable-shared' LT_INIT options.
8161983b4bf2Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
816290b17f1bSmrgm4_define([_LT_ENABLE_SHARED],
816390b17f1bSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
816490b17f1bSmrgAC_ARG_ENABLE([shared],
816590b17f1bSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
816690b17f1bSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
816790b17f1bSmrg    [p=${PACKAGE-default}
816890b17f1bSmrg    case $enableval in
816990b17f1bSmrg    yes) enable_shared=yes ;;
817090b17f1bSmrg    no) enable_shared=no ;;
817190b17f1bSmrg    *)
81727e6fb56fSmrg      enable_shared=no
817390b17f1bSmrg      # Look at the argument we got.  We use all the common list separators.
8174983b4bf2Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
817590b17f1bSmrg      for pkg in $enableval; do
8176983b4bf2Smrg	IFS="$lt_save_ifs"
817790b17f1bSmrg	if test "X$pkg" = "X$p"; then
817890b17f1bSmrg	  enable_shared=yes
817990b17f1bSmrg	fi
818090b17f1bSmrg      done
8181983b4bf2Smrg      IFS="$lt_save_ifs"
81827e6fb56fSmrg      ;;
818390b17f1bSmrg    esac],
818490b17f1bSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
81857e6fb56fSmrg
818690b17f1bSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
818790b17f1bSmrg	[Whether or not to build shared libraries])
818890b17f1bSmrg])# _LT_ENABLE_SHARED
81897e6fb56fSmrg
819090b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
819190b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
819290b17f1bSmrg
819390b17f1bSmrg# Old names:
819490b17f1bSmrgAC_DEFUN([AC_ENABLE_SHARED],
819590b17f1bSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
819690b17f1bSmrg])
819790b17f1bSmrg
819890b17f1bSmrgAC_DEFUN([AC_DISABLE_SHARED],
819990b17f1bSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
820090b17f1bSmrg])
820190b17f1bSmrg
820290b17f1bSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
820390b17f1bSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
820490b17f1bSmrg
820590b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
820690b17f1bSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
820790b17f1bSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
82087e6fb56fSmrg
820990b17f1bSmrg
821090b17f1bSmrg
821190b17f1bSmrg# _LT_ENABLE_STATIC([DEFAULT])
821290b17f1bSmrg# ----------------------------
8213983b4bf2Smrg# implement the --enable-static flag, and support the `static' and
8214983b4bf2Smrg# `disable-static' LT_INIT options.
8215983b4bf2Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
821690b17f1bSmrgm4_define([_LT_ENABLE_STATIC],
821790b17f1bSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
821890b17f1bSmrgAC_ARG_ENABLE([static],
821990b17f1bSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
822090b17f1bSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
822190b17f1bSmrg    [p=${PACKAGE-default}
822290b17f1bSmrg    case $enableval in
822390b17f1bSmrg    yes) enable_static=yes ;;
822490b17f1bSmrg    no) enable_static=no ;;
82257e6fb56fSmrg    *)
822690b17f1bSmrg     enable_static=no
822790b17f1bSmrg      # Look at the argument we got.  We use all the common list separators.
8228983b4bf2Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
822990b17f1bSmrg      for pkg in $enableval; do
8230983b4bf2Smrg	IFS="$lt_save_ifs"
823190b17f1bSmrg	if test "X$pkg" = "X$p"; then
823290b17f1bSmrg	  enable_static=yes
823390b17f1bSmrg	fi
823490b17f1bSmrg      done
8235983b4bf2Smrg      IFS="$lt_save_ifs"
82367e6fb56fSmrg      ;;
823790b17f1bSmrg    esac],
823890b17f1bSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
82397e6fb56fSmrg
824090b17f1bSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
824190b17f1bSmrg	[Whether or not to build static libraries])
824290b17f1bSmrg])# _LT_ENABLE_STATIC
82437e6fb56fSmrg
824490b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
824590b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
82467e6fb56fSmrg
824790b17f1bSmrg# Old names:
824890b17f1bSmrgAC_DEFUN([AC_ENABLE_STATIC],
824990b17f1bSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
825090b17f1bSmrg])
82517e6fb56fSmrg
825290b17f1bSmrgAC_DEFUN([AC_DISABLE_STATIC],
825390b17f1bSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
825490b17f1bSmrg])
82557e6fb56fSmrg
825690b17f1bSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
825790b17f1bSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
82587e6fb56fSmrg
825990b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
826090b17f1bSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
826190b17f1bSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
82627e6fb56fSmrg
82637e6fb56fSmrg
82647e6fb56fSmrg
826590b17f1bSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
826690b17f1bSmrg# ----------------------------------
8267983b4bf2Smrg# implement the --enable-fast-install flag, and support the `fast-install'
8268983b4bf2Smrg# and `disable-fast-install' LT_INIT options.
8269983b4bf2Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
827090b17f1bSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
827190b17f1bSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
827290b17f1bSmrgAC_ARG_ENABLE([fast-install],
827390b17f1bSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
827490b17f1bSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
827590b17f1bSmrg    [p=${PACKAGE-default}
827690b17f1bSmrg    case $enableval in
827790b17f1bSmrg    yes) enable_fast_install=yes ;;
827890b17f1bSmrg    no) enable_fast_install=no ;;
827990b17f1bSmrg    *)
828090b17f1bSmrg      enable_fast_install=no
828190b17f1bSmrg      # Look at the argument we got.  We use all the common list separators.
8282983b4bf2Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
828390b17f1bSmrg      for pkg in $enableval; do
8284983b4bf2Smrg	IFS="$lt_save_ifs"
828590b17f1bSmrg	if test "X$pkg" = "X$p"; then
828690b17f1bSmrg	  enable_fast_install=yes
828790b17f1bSmrg	fi
828890b17f1bSmrg      done
8289983b4bf2Smrg      IFS="$lt_save_ifs"
82907e6fb56fSmrg      ;;
829190b17f1bSmrg    esac],
829290b17f1bSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
82937e6fb56fSmrg
829490b17f1bSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
829590b17f1bSmrg	 [Whether or not to optimize for fast installation])dnl
829690b17f1bSmrg])# _LT_ENABLE_FAST_INSTALL
82977e6fb56fSmrg
829890b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
829990b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
83007e6fb56fSmrg
830190b17f1bSmrg# Old names:
830290b17f1bSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
830390b17f1bSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
830490b17f1bSmrgAC_DIAGNOSE([obsolete],
830590b17f1bSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8306983b4bf2Smrgthe `fast-install' option into LT_INIT's first parameter.])
830790b17f1bSmrg])
83087e6fb56fSmrg
830990b17f1bSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
831090b17f1bSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
831190b17f1bSmrgAC_DIAGNOSE([obsolete],
831290b17f1bSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8313983b4bf2Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
831490b17f1bSmrg])
831590b17f1bSmrg
831690b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
831790b17f1bSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
831890b17f1bSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
83197e6fb56fSmrg
83207e6fb56fSmrg
832190b17f1bSmrg# _LT_WITH_PIC([MODE])
832290b17f1bSmrg# --------------------
8323983b4bf2Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
832490b17f1bSmrg# LT_INIT options.
8325983b4bf2Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
832690b17f1bSmrgm4_define([_LT_WITH_PIC],
832790b17f1bSmrg[AC_ARG_WITH([pic],
832890b17f1bSmrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
832990b17f1bSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
833090b17f1bSmrg    [lt_p=${PACKAGE-default}
833190b17f1bSmrg    case $withval in
833290b17f1bSmrg    yes|no) pic_mode=$withval ;;
83337e6fb56fSmrg    *)
833490b17f1bSmrg      pic_mode=default
833590b17f1bSmrg      # Look at the argument we got.  We use all the common list separators.
8336983b4bf2Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
833790b17f1bSmrg      for lt_pkg in $withval; do
8338983b4bf2Smrg	IFS="$lt_save_ifs"
833990b17f1bSmrg	if test "X$lt_pkg" = "X$lt_p"; then
834090b17f1bSmrg	  pic_mode=yes
834190b17f1bSmrg	fi
834290b17f1bSmrg      done
8343983b4bf2Smrg      IFS="$lt_save_ifs"
83447e6fb56fSmrg      ;;
834590b17f1bSmrg    esac],
8346983b4bf2Smrg    [pic_mode=default])
8347983b4bf2Smrg
8348983b4bf2Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
834990b17f1bSmrg
835090b17f1bSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
835190b17f1bSmrg])# _LT_WITH_PIC
835290b17f1bSmrg
835390b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
835490b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
835590b17f1bSmrg
835690b17f1bSmrg# Old name:
835790b17f1bSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
835890b17f1bSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
835990b17f1bSmrgAC_DIAGNOSE([obsolete],
836090b17f1bSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8361983b4bf2Smrgput the `pic-only' option into LT_INIT's first parameter.])
83627e6fb56fSmrg])
83637e6fb56fSmrg
836490b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
836590b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
836690b17f1bSmrg
836790b17f1bSmrg
836890b17f1bSmrgm4_define([_LTDL_MODE], [])
836990b17f1bSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
837090b17f1bSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
837190b17f1bSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
837290b17f1bSmrg		 [m4_define([_LTDL_MODE], [recursive])])
837390b17f1bSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
837490b17f1bSmrg		 [m4_define([_LTDL_MODE], [subproject])])
837590b17f1bSmrg
837690b17f1bSmrgm4_define([_LTDL_TYPE], [])
837790b17f1bSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
837890b17f1bSmrg		 [m4_define([_LTDL_TYPE], [installable])])
837990b17f1bSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
838090b17f1bSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
838190b17f1bSmrg
838290b17f1bSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
83837e6fb56fSmrg#
8384983b4bf2Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
838590b17f1bSmrg# Written by Gary V. Vaughan, 2004
83867e6fb56fSmrg#
838790b17f1bSmrg# This file is free software; the Free Software Foundation gives
838890b17f1bSmrg# unlimited permission to copy and/or distribute it, with or without
838990b17f1bSmrg# modifications, as long as this notice is preserved.
83907e6fb56fSmrg
839190b17f1bSmrg# serial 6 ltsugar.m4
839290b17f1bSmrg
839390b17f1bSmrg# This is to help aclocal find these macros, as it can't see m4_define.
839490b17f1bSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
839590b17f1bSmrg
839690b17f1bSmrg
839790b17f1bSmrg# lt_join(SEP, ARG1, [ARG2...])
839890b17f1bSmrg# -----------------------------
839990b17f1bSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
840090b17f1bSmrg# associated separator.
840190b17f1bSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
840290b17f1bSmrg# versions in m4sugar had bugs.
840390b17f1bSmrgm4_define([lt_join],
840490b17f1bSmrg[m4_if([$#], [1], [],
840590b17f1bSmrg       [$#], [2], [[$2]],
840690b17f1bSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
840790b17f1bSmrgm4_define([_lt_join],
840890b17f1bSmrg[m4_if([$#$2], [2], [],
840990b17f1bSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
841090b17f1bSmrg
841190b17f1bSmrg
841290b17f1bSmrg# lt_car(LIST)
841390b17f1bSmrg# lt_cdr(LIST)
841490b17f1bSmrg# ------------
841590b17f1bSmrg# Manipulate m4 lists.
841690b17f1bSmrg# These macros are necessary as long as will still need to support
8417983b4bf2Smrg# Autoconf-2.59 which quotes differently.
841890b17f1bSmrgm4_define([lt_car], [[$1]])
841990b17f1bSmrgm4_define([lt_cdr],
842090b17f1bSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
842190b17f1bSmrg       [$#], 1, [],
842290b17f1bSmrg       [m4_dquote(m4_shift($@))])])
842390b17f1bSmrgm4_define([lt_unquote], $1)
842490b17f1bSmrg
842590b17f1bSmrg
842690b17f1bSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
842790b17f1bSmrg# ------------------------------------------
8428983b4bf2Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
842990b17f1bSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
843090b17f1bSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
843190b17f1bSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
843290b17f1bSmrg# than defined and empty).
84337e6fb56fSmrg#
843490b17f1bSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
843590b17f1bSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
843690b17f1bSmrgm4_define([lt_append],
843790b17f1bSmrg[m4_define([$1],
843890b17f1bSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
843990b17f1bSmrg
844090b17f1bSmrg
844190b17f1bSmrg
844290b17f1bSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
844390b17f1bSmrg# ----------------------------------------------------------
844490b17f1bSmrg# Produce a SEP delimited list of all paired combinations of elements of
844590b17f1bSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
844690b17f1bSmrg# has the form PREFIXmINFIXSUFFIXn.
844790b17f1bSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
844890b17f1bSmrgm4_define([lt_combine],
844990b17f1bSmrg[m4_if(m4_eval([$# > 3]), [1],
845090b17f1bSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
845190b17f1bSmrg[[m4_foreach([_Lt_prefix], [$2],
845290b17f1bSmrg	     [m4_foreach([_Lt_suffix],
845390b17f1bSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
845490b17f1bSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
845590b17f1bSmrg
845690b17f1bSmrg
845790b17f1bSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
845890b17f1bSmrg# -----------------------------------------------------------------------
845990b17f1bSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
846090b17f1bSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
846190b17f1bSmrgm4_define([lt_if_append_uniq],
846290b17f1bSmrg[m4_ifdef([$1],
846390b17f1bSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
846490b17f1bSmrg		 [lt_append([$1], [$2], [$3])$4],
846590b17f1bSmrg		 [$5])],
846690b17f1bSmrg	  [lt_append([$1], [$2], [$3])$4])])
846790b17f1bSmrg
846890b17f1bSmrg
846990b17f1bSmrg# lt_dict_add(DICT, KEY, VALUE)
847090b17f1bSmrg# -----------------------------
847190b17f1bSmrgm4_define([lt_dict_add],
847290b17f1bSmrg[m4_define([$1($2)], [$3])])
84737e6fb56fSmrg
84747e6fb56fSmrg
847590b17f1bSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
847690b17f1bSmrg# --------------------------------------------
847790b17f1bSmrgm4_define([lt_dict_add_subkey],
847890b17f1bSmrg[m4_define([$1($2:$3)], [$4])])
84797e6fb56fSmrg
84807e6fb56fSmrg
848190b17f1bSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
848290b17f1bSmrg# ----------------------------------
848390b17f1bSmrgm4_define([lt_dict_fetch],
848490b17f1bSmrg[m4_ifval([$3],
848590b17f1bSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
848690b17f1bSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
84877e6fb56fSmrg
84887e6fb56fSmrg
848990b17f1bSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
849090b17f1bSmrg# -----------------------------------------------------------------
849190b17f1bSmrgm4_define([lt_if_dict_fetch],
849290b17f1bSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
849390b17f1bSmrg	[$5],
849490b17f1bSmrg    [$6])])
84957e6fb56fSmrg
84967e6fb56fSmrg
849790b17f1bSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
849890b17f1bSmrg# --------------------------------------------------------------
849990b17f1bSmrgm4_define([lt_dict_filter],
850090b17f1bSmrg[m4_if([$5], [], [],
850190b17f1bSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
850290b17f1bSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
850390b17f1bSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
850490b17f1bSmrg])
85057e6fb56fSmrg
850690b17f1bSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
850790b17f1bSmrg#
8508983b4bf2Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
850990b17f1bSmrg#   Written by Scott James Remnant, 2004
851090b17f1bSmrg#
851190b17f1bSmrg# This file is free software; the Free Software Foundation gives
851290b17f1bSmrg# unlimited permission to copy and/or distribute it, with or without
851390b17f1bSmrg# modifications, as long as this notice is preserved.
85147e6fb56fSmrg
851590b17f1bSmrg# @configure_input@
851690b17f1bSmrg
8517983b4bf2Smrg# serial 3337 ltversion.m4
851890b17f1bSmrg# This file is part of GNU Libtool
851990b17f1bSmrg
8520983b4bf2Smrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
8521983b4bf2Smrgm4_define([LT_PACKAGE_REVISION], [1.3337])
852290b17f1bSmrg
852390b17f1bSmrgAC_DEFUN([LTVERSION_VERSION],
8524983b4bf2Smrg[macro_version='2.4.2'
8525983b4bf2Smrgmacro_revision='1.3337'
852690b17f1bSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
852790b17f1bSmrg_LT_DECL(, macro_revision, 0)
852890b17f1bSmrg])
852990b17f1bSmrg
853090b17f1bSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
853190b17f1bSmrg#
8532983b4bf2Smrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
853390b17f1bSmrg#   Written by Scott James Remnant, 2004.
853490b17f1bSmrg#
853590b17f1bSmrg# This file is free software; the Free Software Foundation gives
853690b17f1bSmrg# unlimited permission to copy and/or distribute it, with or without
853790b17f1bSmrg# modifications, as long as this notice is preserved.
853890b17f1bSmrg
853990b17f1bSmrg# serial 5 lt~obsolete.m4
854090b17f1bSmrg
854190b17f1bSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
854290b17f1bSmrg#
8543983b4bf2Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
854490b17f1bSmrg# which have later been changed to m4_define as they aren't part of the
854590b17f1bSmrg# exported API, or moved to Autoconf or Automake where they belong.
854690b17f1bSmrg#
854790b17f1bSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
854890b17f1bSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
854990b17f1bSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
855090b17f1bSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
855190b17f1bSmrg# and doesn't know about Autoconf macros at all.)
855290b17f1bSmrg#
855390b17f1bSmrg# So we provide this file, which has a silly filename so it's always
855490b17f1bSmrg# included after everything else.  This provides aclocal with the
855590b17f1bSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
855690b17f1bSmrg# because those macros already exist, or will be overwritten later.
8557983b4bf2Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
855890b17f1bSmrg#
855990b17f1bSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
856090b17f1bSmrg# Yes, that means every name once taken will need to remain here until
856190b17f1bSmrg# we give up compatibility with versions before 1.7, at which point
856290b17f1bSmrg# we need to keep only those names which we still refer to.
856390b17f1bSmrg
856490b17f1bSmrg# This is to help aclocal find these macros, as it can't see m4_define.
856590b17f1bSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
856690b17f1bSmrg
856790b17f1bSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
856890b17f1bSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
856990b17f1bSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
857090b17f1bSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
857190b17f1bSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
857290b17f1bSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
857390b17f1bSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
857490b17f1bSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
857590b17f1bSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
857690b17f1bSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
857790b17f1bSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
857890b17f1bSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
857990b17f1bSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
858090b17f1bSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
858190b17f1bSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
858290b17f1bSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
858390b17f1bSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
858490b17f1bSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
858590b17f1bSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
858690b17f1bSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
858790b17f1bSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
858890b17f1bSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
858990b17f1bSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
859090b17f1bSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
859190b17f1bSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
859290b17f1bSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
859390b17f1bSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
859490b17f1bSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
859590b17f1bSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
859690b17f1bSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
859790b17f1bSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
859890b17f1bSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
859990b17f1bSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
860090b17f1bSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
860190b17f1bSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
860290b17f1bSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
860390b17f1bSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
860490b17f1bSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
860590b17f1bSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
860690b17f1bSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
860790b17f1bSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
860890b17f1bSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
860990b17f1bSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
861090b17f1bSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
861190b17f1bSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
861290b17f1bSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
861390b17f1bSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
861490b17f1bSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
861590b17f1bSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
861690b17f1bSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
861790b17f1bSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
861890b17f1bSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
861990b17f1bSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
862090b17f1bSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
862190b17f1bSmrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
862290b17f1bSmrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
862390b17f1bSmrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
862490b17f1bSmrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
862590b17f1bSmrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
862690b17f1bSmrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
862790b17f1bSmrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
86287e6fb56fSmrg
8629983b4bf2Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
8630983b4bf2Smrg# serial 1 (pkg-config-0.24)
8631983b4bf2Smrg# 
8632983b4bf2Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
8633983b4bf2Smrg#
8634983b4bf2Smrg# This program is free software; you can redistribute it and/or modify
8635983b4bf2Smrg# it under the terms of the GNU General Public License as published by
8636983b4bf2Smrg# the Free Software Foundation; either version 2 of the License, or
8637983b4bf2Smrg# (at your option) any later version.
8638983b4bf2Smrg#
8639983b4bf2Smrg# This program is distributed in the hope that it will be useful, but
8640983b4bf2Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
8641983b4bf2Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8642983b4bf2Smrg# General Public License for more details.
8643983b4bf2Smrg#
8644983b4bf2Smrg# You should have received a copy of the GNU General Public License
8645983b4bf2Smrg# along with this program; if not, write to the Free Software
8646983b4bf2Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
8647983b4bf2Smrg#
8648983b4bf2Smrg# As a special exception to the GNU General Public License, if you
8649983b4bf2Smrg# distribute this file as part of a program that contains a
8650983b4bf2Smrg# configuration script generated by Autoconf, you may include it under
8651983b4bf2Smrg# the same distribution terms that you use for the rest of that program.
8652983b4bf2Smrg
8653983b4bf2Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
8654983b4bf2Smrg# ----------------------------------
865590b17f1bSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
865690b17f1bSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
865790b17f1bSmrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
865890b17f1bSmrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
865990b17f1bSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
866090b17f1bSmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
866190b17f1bSmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
86627e6fb56fSmrg
866390b17f1bSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
866490b17f1bSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
866590b17f1bSmrgfi
866690b17f1bSmrgif test -n "$PKG_CONFIG"; then
866790b17f1bSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
866890b17f1bSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
866990b17f1bSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
867090b17f1bSmrg		AC_MSG_RESULT([yes])
867190b17f1bSmrg	else
867290b17f1bSmrg		AC_MSG_RESULT([no])
867390b17f1bSmrg		PKG_CONFIG=""
86747e6fb56fSmrg	fi
867590b17f1bSmrgfi[]dnl
8676983b4bf2Smrg])# PKG_PROG_PKG_CONFIG
86777e6fb56fSmrg
8678983b4bf2Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8679983b4bf2Smrg#
8680983b4bf2Smrg# Check to see whether a particular set of modules exists.  Similar
8681983b4bf2Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
8682983b4bf2Smrg#
8683983b4bf2Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8684983b4bf2Smrg# only at the first occurence in configure.ac, so if the first place
8685983b4bf2Smrg# it's called might be skipped (such as if it is within an "if", you
8686983b4bf2Smrg# have to call PKG_CHECK_EXISTS manually
8687983b4bf2Smrg# --------------------------------------------------------------
868890b17f1bSmrgAC_DEFUN([PKG_CHECK_EXISTS],
868990b17f1bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
869090b17f1bSmrgif test -n "$PKG_CONFIG" && \
869190b17f1bSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
869290b17f1bSmrg  m4_default([$2], [:])
869390b17f1bSmrgm4_ifvaln([$3], [else
869490b17f1bSmrg  $3])dnl
869590b17f1bSmrgfi])
86967e6fb56fSmrg
8697983b4bf2Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8698983b4bf2Smrg# ---------------------------------------------
869990b17f1bSmrgm4_define([_PKG_CONFIG],
870090b17f1bSmrg[if test -n "$$1"; then
870190b17f1bSmrg    pkg_cv_[]$1="$$1"
870290b17f1bSmrg elif test -n "$PKG_CONFIG"; then
870390b17f1bSmrg    PKG_CHECK_EXISTS([$3],
870490b17f1bSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
870590b17f1bSmrg		      test "x$?" != "x0" && pkg_failed=yes ],
870690b17f1bSmrg		     [pkg_failed=yes])
870790b17f1bSmrg else
870890b17f1bSmrg    pkg_failed=untried
870990b17f1bSmrgfi[]dnl
8710983b4bf2Smrg])# _PKG_CONFIG
87117e6fb56fSmrg
8712983b4bf2Smrg# _PKG_SHORT_ERRORS_SUPPORTED
8713983b4bf2Smrg# -----------------------------
871490b17f1bSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
871590b17f1bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
871690b17f1bSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
871790b17f1bSmrg        _pkg_short_errors_supported=yes
871890b17f1bSmrgelse
871990b17f1bSmrg        _pkg_short_errors_supported=no
872090b17f1bSmrgfi[]dnl
8721983b4bf2Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
87227e6fb56fSmrg
87237e6fb56fSmrg
8724983b4bf2Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
8725983b4bf2Smrg# [ACTION-IF-NOT-FOUND])
8726983b4bf2Smrg#
8727983b4bf2Smrg#
8728983b4bf2Smrg# Note that if there is a possibility the first call to
8729983b4bf2Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
8730983b4bf2Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
8731983b4bf2Smrg#
8732983b4bf2Smrg#
8733983b4bf2Smrg# --------------------------------------------------------------
873490b17f1bSmrgAC_DEFUN([PKG_CHECK_MODULES],
873590b17f1bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
873690b17f1bSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
873790b17f1bSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
87387e6fb56fSmrg
873990b17f1bSmrgpkg_failed=no
874090b17f1bSmrgAC_MSG_CHECKING([for $1])
87417e6fb56fSmrg
874290b17f1bSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
874390b17f1bSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
87447e6fb56fSmrg
874590b17f1bSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
874690b17f1bSmrgand $1[]_LIBS to avoid the need to call pkg-config.
874790b17f1bSmrgSee the pkg-config man page for more details.])
87487e6fb56fSmrg
874990b17f1bSmrgif test $pkg_failed = yes; then
875090b17f1bSmrg   	AC_MSG_RESULT([no])
875190b17f1bSmrg        _PKG_SHORT_ERRORS_SUPPORTED
875290b17f1bSmrg        if test $_pkg_short_errors_supported = yes; then
875390b17f1bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
875490b17f1bSmrg        else 
875590b17f1bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
875690b17f1bSmrg        fi
875790b17f1bSmrg	# Put the nasty error message in config.log where it belongs
875890b17f1bSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
87597e6fb56fSmrg
876090b17f1bSmrg	m4_default([$4], [AC_MSG_ERROR(
876190b17f1bSmrg[Package requirements ($2) were not met:
87627e6fb56fSmrg
876390b17f1bSmrg$$1_PKG_ERRORS
87647e6fb56fSmrg
876590b17f1bSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
876690b17f1bSmrginstalled software in a non-standard prefix.
87677e6fb56fSmrg
876890b17f1bSmrg_PKG_TEXT])[]dnl
876990b17f1bSmrg        ])
877090b17f1bSmrgelif test $pkg_failed = untried; then
877190b17f1bSmrg     	AC_MSG_RESULT([no])
877290b17f1bSmrg	m4_default([$4], [AC_MSG_FAILURE(
877390b17f1bSmrg[The pkg-config script could not be found or is too old.  Make sure it
877490b17f1bSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
877590b17f1bSmrgpath to pkg-config.
87767e6fb56fSmrg
877790b17f1bSmrg_PKG_TEXT
87787e6fb56fSmrg
877990b17f1bSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
878090b17f1bSmrg        ])
878190b17f1bSmrgelse
878290b17f1bSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
878390b17f1bSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
878490b17f1bSmrg        AC_MSG_RESULT([yes])
878590b17f1bSmrg	$3
878690b17f1bSmrgfi[]dnl
8787983b4bf2Smrg])# PKG_CHECK_MODULES
8788963d66acSmrg
878990b17f1bSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
879090b17f1bSmrgdnl
879190b17f1bSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
8792983b4bf2Smrgdnl 
879390b17f1bSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
879490b17f1bSmrgdnl copy of this software and associated documentation files (the "Software"),
879590b17f1bSmrgdnl to deal in the Software without restriction, including without limitation
879690b17f1bSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
879790b17f1bSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
879890b17f1bSmrgdnl Software is furnished to do so, subject to the following conditions:
879990b17f1bSmrgdnl
880090b17f1bSmrgdnl The above copyright notice and this permission notice (including the next
880190b17f1bSmrgdnl paragraph) shall be included in all copies or substantial portions of the
880290b17f1bSmrgdnl Software.
880390b17f1bSmrgdnl
880490b17f1bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
880590b17f1bSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
880690b17f1bSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
880790b17f1bSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
880890b17f1bSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
880990b17f1bSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
881090b17f1bSmrgdnl DEALINGS IN THE SOFTWARE.
881190b17f1bSmrg
881290b17f1bSmrg# XORG_MACROS_VERSION(required-version)
881390b17f1bSmrg# -------------------------------------
881490b17f1bSmrg# Minimum version: 1.1.0
881590b17f1bSmrg#
881690b17f1bSmrg# If you're using a macro added in Version 1.1 or newer, include this in
881790b17f1bSmrg# your configure.ac with the minimum required version, such as:
881890b17f1bSmrg# XORG_MACROS_VERSION(1.1)
881990b17f1bSmrg#
882090b17f1bSmrg# To ensure that this macro is defined, also add:
882190b17f1bSmrg# m4_ifndef([XORG_MACROS_VERSION],
882290b17f1bSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
882390b17f1bSmrg#
882490b17f1bSmrg#
8825983b4bf2Smrg# See the "minimum version" comment for each macro you use to see what 
882690b17f1bSmrg# version you require.
882790b17f1bSmrgm4_defun([XORG_MACROS_VERSION],[
8828983b4bf2Smrgm4_define([vers_have], [1.17])
882990b17f1bSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
883090b17f1bSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
883190b17f1bSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
883290b17f1bSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
883390b17f1bSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
883490b17f1bSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
883590b17f1bSmrgm4_undefine([vers_have])
883690b17f1bSmrgm4_undefine([maj_have])
883790b17f1bSmrgm4_undefine([maj_needed])
883890b17f1bSmrg]) # XORG_MACROS_VERSION
883990b17f1bSmrg
884090b17f1bSmrg# XORG_PROG_RAWCPP()
884190b17f1bSmrg# ------------------
884290b17f1bSmrg# Minimum version: 1.0.0
884390b17f1bSmrg#
884490b17f1bSmrg# Find cpp program and necessary flags for use in pre-processing text files
884590b17f1bSmrg# such as man pages and config files
884690b17f1bSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
884790b17f1bSmrgAC_REQUIRE([AC_PROG_CPP])
8848983b4bf2SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
884990b17f1bSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
885090b17f1bSmrg
885190b17f1bSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
885290b17f1bSmrg# which is not the best choice for supporting other OS'es, but covers most
885390b17f1bSmrg# of the ones we need for now.
885490b17f1bSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
885590b17f1bSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
885690b17f1bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
885790b17f1bSmrg	AC_MSG_RESULT([no])
885890b17f1bSmrgelse
885990b17f1bSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
886090b17f1bSmrg		RAWCPPFLAGS=-undef
886190b17f1bSmrg		AC_MSG_RESULT([yes])
886290b17f1bSmrg	# under Cygwin unix is still defined even with -undef
886390b17f1bSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
886490b17f1bSmrg		RAWCPPFLAGS="-undef -ansi"
886590b17f1bSmrg		AC_MSG_RESULT([yes, with -ansi])
88667e6fb56fSmrg	else
886790b17f1bSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
88687e6fb56fSmrg	fi
886990b17f1bSmrgfi
887090b17f1bSmrgrm -f conftest.$ac_ext
88717e6fb56fSmrg
887290b17f1bSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
887390b17f1bSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
887490b17f1bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
887590b17f1bSmrg	AC_MSG_RESULT([no])
887690b17f1bSmrgelse
887790b17f1bSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
887890b17f1bSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
887990b17f1bSmrg		AC_MSG_RESULT([yes])
88807e6fb56fSmrg	else
888190b17f1bSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
88827e6fb56fSmrg	fi
888390b17f1bSmrgfi
888490b17f1bSmrgrm -f conftest.$ac_ext
888590b17f1bSmrgAC_SUBST(RAWCPPFLAGS)
888690b17f1bSmrg]) # XORG_PROG_RAWCPP
88877e6fb56fSmrg
888890b17f1bSmrg# XORG_MANPAGE_SECTIONS()
888990b17f1bSmrg# -----------------------
889090b17f1bSmrg# Minimum version: 1.0.0
889190b17f1bSmrg#
889290b17f1bSmrg# Determine which sections man pages go in for the different man page types
889390b17f1bSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
889490b17f1bSmrg# Not sure if there's any better way than just hardcoding by OS name.
889590b17f1bSmrg# Override default settings by setting environment variables
889690b17f1bSmrg# Added MAN_SUBSTS in version 1.8
889790b17f1bSmrg# Added AC_PROG_SED in version 1.8
889890b17f1bSmrg
889990b17f1bSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
890090b17f1bSmrgAC_REQUIRE([AC_CANONICAL_HOST])
890190b17f1bSmrgAC_REQUIRE([AC_PROG_SED])
890290b17f1bSmrg
890390b17f1bSmrgif test x$APP_MAN_SUFFIX = x    ; then
890490b17f1bSmrg    APP_MAN_SUFFIX=1
890590b17f1bSmrgfi
890690b17f1bSmrgif test x$APP_MAN_DIR = x    ; then
890790b17f1bSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
890890b17f1bSmrgfi
89097e6fb56fSmrg
891090b17f1bSmrgif test x$LIB_MAN_SUFFIX = x    ; then
891190b17f1bSmrg    LIB_MAN_SUFFIX=3
891290b17f1bSmrgfi
891390b17f1bSmrgif test x$LIB_MAN_DIR = x    ; then
891490b17f1bSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
891590b17f1bSmrgfi
89167e6fb56fSmrg
891790b17f1bSmrgif test x$FILE_MAN_SUFFIX = x    ; then
891890b17f1bSmrg    case $host_os in
891990b17f1bSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
892090b17f1bSmrg	*)		FILE_MAN_SUFFIX=5  ;;
892190b17f1bSmrg    esac
892290b17f1bSmrgfi
892390b17f1bSmrgif test x$FILE_MAN_DIR = x    ; then
892490b17f1bSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
892590b17f1bSmrgfi
89267e6fb56fSmrg
892790b17f1bSmrgif test x$MISC_MAN_SUFFIX = x    ; then
892890b17f1bSmrg    case $host_os in
892990b17f1bSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
893090b17f1bSmrg	*)		MISC_MAN_SUFFIX=7  ;;
893190b17f1bSmrg    esac
893290b17f1bSmrgfi
893390b17f1bSmrgif test x$MISC_MAN_DIR = x    ; then
893490b17f1bSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
893590b17f1bSmrgfi
89367e6fb56fSmrg
893790b17f1bSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
893890b17f1bSmrg    case $host_os in
893990b17f1bSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
894090b17f1bSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
894190b17f1bSmrg    esac
894290b17f1bSmrgfi
894390b17f1bSmrgif test x$DRIVER_MAN_DIR = x    ; then
894490b17f1bSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
894590b17f1bSmrgfi
89467e6fb56fSmrg
894790b17f1bSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
894890b17f1bSmrg    case $host_os in
894990b17f1bSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
895090b17f1bSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
895190b17f1bSmrg    esac
895290b17f1bSmrgfi
895390b17f1bSmrgif test x$ADMIN_MAN_DIR = x    ; then
895490b17f1bSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
895590b17f1bSmrgfi
89567e6fb56fSmrg
89577e6fb56fSmrg
895890b17f1bSmrgAC_SUBST([APP_MAN_SUFFIX])
895990b17f1bSmrgAC_SUBST([LIB_MAN_SUFFIX])
896090b17f1bSmrgAC_SUBST([FILE_MAN_SUFFIX])
896190b17f1bSmrgAC_SUBST([MISC_MAN_SUFFIX])
896290b17f1bSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
896390b17f1bSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
896490b17f1bSmrgAC_SUBST([APP_MAN_DIR])
896590b17f1bSmrgAC_SUBST([LIB_MAN_DIR])
896690b17f1bSmrgAC_SUBST([FILE_MAN_DIR])
896790b17f1bSmrgAC_SUBST([MISC_MAN_DIR])
896890b17f1bSmrgAC_SUBST([DRIVER_MAN_DIR])
896990b17f1bSmrgAC_SUBST([ADMIN_MAN_DIR])
897090b17f1bSmrg
897190b17f1bSmrgXORG_MAN_PAGE="X Version 11"
897290b17f1bSmrgAC_SUBST([XORG_MAN_PAGE])
897390b17f1bSmrgMAN_SUBSTS="\
897490b17f1bSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
897590b17f1bSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
897690b17f1bSmrg	-e 's|__xservername__|Xorg|g' \
897790b17f1bSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
897890b17f1bSmrg	-e 's|__projectroot__|\$(prefix)|g' \
897990b17f1bSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
898090b17f1bSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
898190b17f1bSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
898290b17f1bSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
898390b17f1bSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
898490b17f1bSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
898590b17f1bSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
898690b17f1bSmrgAC_SUBST([MAN_SUBSTS])
898790b17f1bSmrg
898890b17f1bSmrg]) # XORG_MANPAGE_SECTIONS
898990b17f1bSmrg
899090b17f1bSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
899190b17f1bSmrg# ------------------------
899290b17f1bSmrg# Minimum version: 1.7.0
899390b17f1bSmrg#
899490b17f1bSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
899590b17f1bSmrg# provided by xorg-sgml-doctools, if installed.
899690b17f1bSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
899790b17f1bSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
899890b17f1bSmrgXORG_SGML_PATH=
899990b17f1bSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
900090b17f1bSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
900190b17f1bSmrg    [m4_ifval([$1],[:],
900290b17f1bSmrg        [if test x"$cross_compiling" != x"yes" ; then
900390b17f1bSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
900490b17f1bSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
900590b17f1bSmrg         fi])
900690b17f1bSmrg    ])
90077e6fb56fSmrg
900890b17f1bSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
900990b17f1bSmrg# the path and the name of the doc stylesheet
901090b17f1bSmrgif test "x$XORG_SGML_PATH" != "x" ; then
901190b17f1bSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
901290b17f1bSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
901390b17f1bSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
901490b17f1bSmrgelse
901590b17f1bSmrg   AC_MSG_RESULT([no])
901690b17f1bSmrgfi
90177e6fb56fSmrg
901890b17f1bSmrgAC_SUBST(XORG_SGML_PATH)
901990b17f1bSmrgAC_SUBST(STYLESHEET_SRCDIR)
902090b17f1bSmrgAC_SUBST(XSL_STYLESHEET)
902190b17f1bSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
902290b17f1bSmrg]) # XORG_CHECK_SGML_DOCTOOLS
90237e6fb56fSmrg
902490b17f1bSmrg# XORG_CHECK_LINUXDOC
902590b17f1bSmrg# -------------------
902690b17f1bSmrg# Minimum version: 1.0.0
902790b17f1bSmrg#
902890b17f1bSmrg# Defines the variable MAKE_TEXT if the necessary tools and
902990b17f1bSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
903090b17f1bSmrg# Whether or not the necessary tools and files are found can be checked
903190b17f1bSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
903290b17f1bSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
903390b17f1bSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
903490b17f1bSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
90357e6fb56fSmrg
903690b17f1bSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
90377e6fb56fSmrg
903890b17f1bSmrgAC_MSG_CHECKING([whether to build documentation])
90397e6fb56fSmrg
904090b17f1bSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
904190b17f1bSmrg   BUILDDOC=yes
904290b17f1bSmrgelse
904390b17f1bSmrg   BUILDDOC=no
904490b17f1bSmrgfi
90457e6fb56fSmrg
904690b17f1bSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
90477e6fb56fSmrg
904890b17f1bSmrgAC_MSG_RESULT([$BUILDDOC])
90497e6fb56fSmrg
905090b17f1bSmrgAC_MSG_CHECKING([whether to build pdf documentation])
90517e6fb56fSmrg
905290b17f1bSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
905390b17f1bSmrg   BUILDPDFDOC=yes
905490b17f1bSmrgelse
905590b17f1bSmrg   BUILDPDFDOC=no
905690b17f1bSmrgfi
90577e6fb56fSmrg
905890b17f1bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
90597e6fb56fSmrg
906090b17f1bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
90617e6fb56fSmrg
906290b17f1bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
906390b17f1bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
906490b17f1bSmrgMAKE_PDF="$PS2PDF"
906590b17f1bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
90667e6fb56fSmrg
906790b17f1bSmrgAC_SUBST(MAKE_TEXT)
906890b17f1bSmrgAC_SUBST(MAKE_PS)
906990b17f1bSmrgAC_SUBST(MAKE_PDF)
907090b17f1bSmrgAC_SUBST(MAKE_HTML)
907190b17f1bSmrg]) # XORG_CHECK_LINUXDOC
90727e6fb56fSmrg
907390b17f1bSmrg# XORG_CHECK_DOCBOOK
907490b17f1bSmrg# -------------------
907590b17f1bSmrg# Minimum version: 1.0.0
907690b17f1bSmrg#
907790b17f1bSmrg# Checks for the ability to build output formats from SGML DocBook source.
907890b17f1bSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
907990b17f1bSmrg# indicates whether the necessary tools and files are found and, if set,
908090b17f1bSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
908190b17f1bSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
908290b17f1bSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
908390b17f1bSmrg
908490b17f1bSmrgBUILDTXTDOC=no
908590b17f1bSmrgBUILDPDFDOC=no
908690b17f1bSmrgBUILDPSDOC=no
908790b17f1bSmrgBUILDHTMLDOC=no
908890b17f1bSmrg
908990b17f1bSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
909090b17f1bSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
909190b17f1bSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
909290b17f1bSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
909390b17f1bSmrg
909490b17f1bSmrgAC_MSG_CHECKING([whether to build text documentation])
909590b17f1bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
909690b17f1bSmrg   test x$BUILD_TXTDOC != xno; then
909790b17f1bSmrg	BUILDTXTDOC=yes
909890b17f1bSmrgfi
909990b17f1bSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
910090b17f1bSmrgAC_MSG_RESULT([$BUILDTXTDOC])
91017e6fb56fSmrg
910290b17f1bSmrgAC_MSG_CHECKING([whether to build PDF documentation])
910390b17f1bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
910490b17f1bSmrg   test x$BUILD_PDFDOC != xno; then
910590b17f1bSmrg	BUILDPDFDOC=yes
910690b17f1bSmrgfi
910790b17f1bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
910890b17f1bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
91097e6fb56fSmrg
911090b17f1bSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
911190b17f1bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
911290b17f1bSmrg   test x$BUILD_PSDOC != xno; then
911390b17f1bSmrg	BUILDPSDOC=yes
911490b17f1bSmrgfi
911590b17f1bSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
911690b17f1bSmrgAC_MSG_RESULT([$BUILDPSDOC])
91177e6fb56fSmrg
911890b17f1bSmrgAC_MSG_CHECKING([whether to build HTML documentation])
911990b17f1bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
912090b17f1bSmrg   test x$BUILD_HTMLDOC != xno; then
912190b17f1bSmrg	BUILDHTMLDOC=yes
912290b17f1bSmrgfi
912390b17f1bSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
912490b17f1bSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
91257e6fb56fSmrg
912690b17f1bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
912790b17f1bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
912890b17f1bSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
912990b17f1bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
91307e6fb56fSmrg
913190b17f1bSmrgAC_SUBST(MAKE_TEXT)
913290b17f1bSmrgAC_SUBST(MAKE_PS)
913390b17f1bSmrgAC_SUBST(MAKE_PDF)
913490b17f1bSmrgAC_SUBST(MAKE_HTML)
913590b17f1bSmrg]) # XORG_CHECK_DOCBOOK
91367e6fb56fSmrg
913790b17f1bSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
913890b17f1bSmrg# ----------------
913990b17f1bSmrg# Minimum version: 1.5.0
914090b17f1bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
914190b17f1bSmrg#
914290b17f1bSmrg# Documentation tools are not always available on all platforms and sometimes
914390b17f1bSmrg# not at the appropriate level. This macro enables a module to test for the
914490b17f1bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
914590b17f1bSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
914690b17f1bSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
914790b17f1bSmrg# --with-xmlto assumes 'auto'.
914890b17f1bSmrg#
914990b17f1bSmrg# Interface to module:
915090b17f1bSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
915190b17f1bSmrg# XMLTO:	returns the path of the xmlto program found
915290b17f1bSmrg#		returns the path set by the user in the environment
915390b17f1bSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
915490b17f1bSmrg#		'no' user instructs the module not to use xmlto
915590b17f1bSmrg#
915690b17f1bSmrg# Added in version 1.10.0
915790b17f1bSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
915890b17f1bSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
915990b17f1bSmrg#
916090b17f1bSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
916190b17f1bSmrg#
916290b17f1bSmrgAC_DEFUN([XORG_WITH_XMLTO],[
916390b17f1bSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
916490b17f1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
916590b17f1bSmrgAC_ARG_WITH(xmlto,
916690b17f1bSmrg	AS_HELP_STRING([--with-xmlto],
916790b17f1bSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
916890b17f1bSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
916990b17f1bSmrgm4_undefine([_defopt])
917090b17f1bSmrg
917190b17f1bSmrgif test "x$use_xmlto" = x"auto"; then
917290b17f1bSmrg   AC_PATH_PROG([XMLTO], [xmlto])
917390b17f1bSmrg   if test "x$XMLTO" = "x"; then
917490b17f1bSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
917590b17f1bSmrg	have_xmlto=no
917690b17f1bSmrg   else
917790b17f1bSmrg        have_xmlto=yes
917890b17f1bSmrg   fi
917990b17f1bSmrgelif test "x$use_xmlto" = x"yes" ; then
918090b17f1bSmrg   AC_PATH_PROG([XMLTO], [xmlto])
918190b17f1bSmrg   if test "x$XMLTO" = "x"; then
918290b17f1bSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
918390b17f1bSmrg   fi
918490b17f1bSmrg   have_xmlto=yes
918590b17f1bSmrgelif test "x$use_xmlto" = x"no" ; then
918690b17f1bSmrg   if test "x$XMLTO" != "x"; then
918790b17f1bSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
918890b17f1bSmrg   fi
918990b17f1bSmrg   have_xmlto=no
919090b17f1bSmrgelse
919190b17f1bSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
919290b17f1bSmrgfi
91937e6fb56fSmrg
919490b17f1bSmrg# Test for a minimum version of xmlto, if provided.
919590b17f1bSmrgm4_ifval([$1],
919690b17f1bSmrg[if test "$have_xmlto" = yes; then
919790b17f1bSmrg    # scrape the xmlto version
919890b17f1bSmrg    AC_MSG_CHECKING([the xmlto version])
919990b17f1bSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
920090b17f1bSmrg    AC_MSG_RESULT([$xmlto_version])
920190b17f1bSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
920290b17f1bSmrg        [if test "x$use_xmlto" = xauto; then
920390b17f1bSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
920490b17f1bSmrg            have_xmlto=no
920590b17f1bSmrg        else
920690b17f1bSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
920790b17f1bSmrg        fi])
920890b17f1bSmrgfi])
92097e6fb56fSmrg
921090b17f1bSmrg# Test for the ability of xmlto to generate a text target
921190b17f1bSmrghave_xmlto_text=no
921290b17f1bSmrgcat > conftest.xml << "EOF"
921390b17f1bSmrgEOF
921490b17f1bSmrgAS_IF([test "$have_xmlto" = yes],
921590b17f1bSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
921690b17f1bSmrg             [have_xmlto_text=yes],
921790b17f1bSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
921890b17f1bSmrgrm -f conftest.xml
921990b17f1bSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
922090b17f1bSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
922190b17f1bSmrg]) # XORG_WITH_XMLTO
922290b17f1bSmrg
922390b17f1bSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
922490b17f1bSmrg# --------------------------------------------
922590b17f1bSmrg# Minimum version: 1.12.0
922690b17f1bSmrg# Minimum version for optional DEFAULT argument: 1.12.0
922790b17f1bSmrg#
922890b17f1bSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
922990b17f1bSmrg# XML-based language used for the transformation of XML documents.
923090b17f1bSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
923190b17f1bSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
923290b17f1bSmrg# The XSLT processor is often used as a standalone tool for transformations.
923390b17f1bSmrg# It should not be assumed that this tool is used only to work with documnetation.
923490b17f1bSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
923590b17f1bSmrg#
923690b17f1bSmrg# Interface to module:
923790b17f1bSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
923890b17f1bSmrg# XSLTPROC:	 returns the path of the xsltproc program found
923990b17f1bSmrg#		 returns the path set by the user in the environment
924090b17f1bSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
924190b17f1bSmrg#		  'no' user instructs the module not to use xsltproc
924290b17f1bSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
924390b17f1bSmrg#
924490b17f1bSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
924590b17f1bSmrg#
924690b17f1bSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
924790b17f1bSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
924890b17f1bSmrg# Preserves the interface, should it be implemented later
924990b17f1bSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
925090b17f1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
925190b17f1bSmrgAC_ARG_WITH(xsltproc,
925290b17f1bSmrg	AS_HELP_STRING([--with-xsltproc],
925390b17f1bSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
925490b17f1bSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
925590b17f1bSmrgm4_undefine([_defopt])
925690b17f1bSmrg
925790b17f1bSmrgif test "x$use_xsltproc" = x"auto"; then
925890b17f1bSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
925990b17f1bSmrg   if test "x$XSLTPROC" = "x"; then
926090b17f1bSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
926190b17f1bSmrg	have_xsltproc=no
926290b17f1bSmrg   else
926390b17f1bSmrg        have_xsltproc=yes
926490b17f1bSmrg   fi
926590b17f1bSmrgelif test "x$use_xsltproc" = x"yes" ; then
926690b17f1bSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
926790b17f1bSmrg   if test "x$XSLTPROC" = "x"; then
926890b17f1bSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
926990b17f1bSmrg   fi
927090b17f1bSmrg   have_xsltproc=yes
927190b17f1bSmrgelif test "x$use_xsltproc" = x"no" ; then
927290b17f1bSmrg   if test "x$XSLTPROC" != "x"; then
927390b17f1bSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
927490b17f1bSmrg   fi
927590b17f1bSmrg   have_xsltproc=no
927690b17f1bSmrgelse
927790b17f1bSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
927890b17f1bSmrgfi
92797e6fb56fSmrg
928090b17f1bSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
928190b17f1bSmrg]) # XORG_WITH_XSLTPROC
92827e6fb56fSmrg
928390b17f1bSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
928490b17f1bSmrg# ----------------------------------------
928590b17f1bSmrg# Minimum version: 1.15.0
92867e6fb56fSmrg#
928790b17f1bSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
928890b17f1bSmrg# scanning arbitrary text files, extracting information from those text files,
928990b17f1bSmrg# and printing reports based on that information.
92907e6fb56fSmrg#
929190b17f1bSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
929290b17f1bSmrg#
929390b17f1bSmrg# Interface to module:
929490b17f1bSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
929590b17f1bSmrg# PERL:	     returns the path of the perl program found
929690b17f1bSmrg#	     returns the path set by the user in the environment
929790b17f1bSmrg# --with-perl: 'yes' user instructs the module to use perl
929890b17f1bSmrg#	       'no' user instructs the module not to use perl
929990b17f1bSmrg# have_perl: returns yes if perl found in PATH or no
930090b17f1bSmrg#
930190b17f1bSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
930290b17f1bSmrg#
930390b17f1bSmrgAC_DEFUN([XORG_WITH_PERL],[
930490b17f1bSmrgAC_ARG_VAR([PERL], [Path to perl command])
930590b17f1bSmrg# Preserves the interface, should it be implemented later
930690b17f1bSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
930790b17f1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
930890b17f1bSmrgAC_ARG_WITH(perl,
930990b17f1bSmrg	AS_HELP_STRING([--with-perl],
931090b17f1bSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
931190b17f1bSmrg	   [use_perl=$withval], [use_perl=]_defopt)
931290b17f1bSmrgm4_undefine([_defopt])
931390b17f1bSmrg
931490b17f1bSmrgif test "x$use_perl" = x"auto"; then
931590b17f1bSmrg   AC_PATH_PROG([PERL], [perl])
931690b17f1bSmrg   if test "x$PERL" = "x"; then
931790b17f1bSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
931890b17f1bSmrg	have_perl=no
931990b17f1bSmrg   else
932090b17f1bSmrg        have_perl=yes
932190b17f1bSmrg   fi
932290b17f1bSmrgelif test "x$use_perl" = x"yes" ; then
932390b17f1bSmrg   AC_PATH_PROG([PERL], [perl])
932490b17f1bSmrg   if test "x$PERL" = "x"; then
932590b17f1bSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
932690b17f1bSmrg   fi
932790b17f1bSmrg   have_perl=yes
932890b17f1bSmrgelif test "x$use_perl" = x"no" ; then
932990b17f1bSmrg   if test "x$PERL" != "x"; then
933090b17f1bSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
933190b17f1bSmrg   fi
933290b17f1bSmrg   have_perl=no
933390b17f1bSmrgelse
933490b17f1bSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
933590b17f1bSmrgfi
93367e6fb56fSmrg
933790b17f1bSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
933890b17f1bSmrg]) # XORG_WITH_PERL
93397e6fb56fSmrg
934090b17f1bSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
934190b17f1bSmrg# ----------------
934290b17f1bSmrg# Minimum version: 1.5.0
934390b17f1bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
934490b17f1bSmrg#
934590b17f1bSmrg# Documentation tools are not always available on all platforms and sometimes
934690b17f1bSmrg# not at the appropriate level. This macro enables a module to test for the
934790b17f1bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
934890b17f1bSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
934990b17f1bSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
935090b17f1bSmrg# --with-asciidoc assumes 'auto'.
935190b17f1bSmrg#
935290b17f1bSmrg# Interface to module:
935390b17f1bSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
935490b17f1bSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
935590b17f1bSmrg#		 returns the path set by the user in the environment
935690b17f1bSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
935790b17f1bSmrg#		  'no' user instructs the module not to use asciidoc
935890b17f1bSmrg#
935990b17f1bSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
936090b17f1bSmrg#
936190b17f1bSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
936290b17f1bSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
936390b17f1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
936490b17f1bSmrgAC_ARG_WITH(asciidoc,
936590b17f1bSmrg	AS_HELP_STRING([--with-asciidoc],
936690b17f1bSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
936790b17f1bSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
936890b17f1bSmrgm4_undefine([_defopt])
936990b17f1bSmrg
937090b17f1bSmrgif test "x$use_asciidoc" = x"auto"; then
937190b17f1bSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
937290b17f1bSmrg   if test "x$ASCIIDOC" = "x"; then
937390b17f1bSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
937490b17f1bSmrg	have_asciidoc=no
937590b17f1bSmrg   else
937690b17f1bSmrg        have_asciidoc=yes
937790b17f1bSmrg   fi
937890b17f1bSmrgelif test "x$use_asciidoc" = x"yes" ; then
937990b17f1bSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
938090b17f1bSmrg   if test "x$ASCIIDOC" = "x"; then
938190b17f1bSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
938290b17f1bSmrg   fi
938390b17f1bSmrg   have_asciidoc=yes
938490b17f1bSmrgelif test "x$use_asciidoc" = x"no" ; then
938590b17f1bSmrg   if test "x$ASCIIDOC" != "x"; then
938690b17f1bSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
938790b17f1bSmrg   fi
938890b17f1bSmrg   have_asciidoc=no
938990b17f1bSmrgelse
939090b17f1bSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
939190b17f1bSmrgfi
939290b17f1bSmrgm4_ifval([$1],
939390b17f1bSmrg[if test "$have_asciidoc" = yes; then
939490b17f1bSmrg    # scrape the asciidoc version
939590b17f1bSmrg    AC_MSG_CHECKING([the asciidoc version])
939690b17f1bSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
939790b17f1bSmrg    AC_MSG_RESULT([$asciidoc_version])
939890b17f1bSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
939990b17f1bSmrg        [if test "x$use_asciidoc" = xauto; then
940090b17f1bSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
940190b17f1bSmrg            have_asciidoc=no
940290b17f1bSmrg        else
940390b17f1bSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
940490b17f1bSmrg        fi])
940590b17f1bSmrgfi])
940690b17f1bSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
940790b17f1bSmrg]) # XORG_WITH_ASCIIDOC
94087e6fb56fSmrg
940990b17f1bSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
9410983b4bf2Smrg# --------------------------------
941190b17f1bSmrg# Minimum version: 1.5.0
941290b17f1bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
941390b17f1bSmrg#
941490b17f1bSmrg# Documentation tools are not always available on all platforms and sometimes
941590b17f1bSmrg# not at the appropriate level. This macro enables a module to test for the
941690b17f1bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
941790b17f1bSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
941890b17f1bSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
941990b17f1bSmrg# --with-doxygen assumes 'auto'.
942090b17f1bSmrg#
942190b17f1bSmrg# Interface to module:
942290b17f1bSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
942390b17f1bSmrg# DOXYGEN:	 returns the path of the doxygen program found
942490b17f1bSmrg#		 returns the path set by the user in the environment
942590b17f1bSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
942690b17f1bSmrg#		  'no' user instructs the module not to use doxygen
942790b17f1bSmrg#
942890b17f1bSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
942990b17f1bSmrg#
943090b17f1bSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
943190b17f1bSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
943290b17f1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
943390b17f1bSmrgAC_ARG_WITH(doxygen,
943490b17f1bSmrg	AS_HELP_STRING([--with-doxygen],
943590b17f1bSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
943690b17f1bSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
943790b17f1bSmrgm4_undefine([_defopt])
943890b17f1bSmrg
943990b17f1bSmrgif test "x$use_doxygen" = x"auto"; then
944090b17f1bSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
944190b17f1bSmrg   if test "x$DOXYGEN" = "x"; then
944290b17f1bSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
944390b17f1bSmrg	have_doxygen=no
944490b17f1bSmrg   else
944590b17f1bSmrg        have_doxygen=yes
944690b17f1bSmrg   fi
944790b17f1bSmrgelif test "x$use_doxygen" = x"yes" ; then
944890b17f1bSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
944990b17f1bSmrg   if test "x$DOXYGEN" = "x"; then
945090b17f1bSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
945190b17f1bSmrg   fi
945290b17f1bSmrg   have_doxygen=yes
945390b17f1bSmrgelif test "x$use_doxygen" = x"no" ; then
945490b17f1bSmrg   if test "x$DOXYGEN" != "x"; then
945590b17f1bSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
945690b17f1bSmrg   fi
945790b17f1bSmrg   have_doxygen=no
945890b17f1bSmrgelse
945990b17f1bSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
946090b17f1bSmrgfi
946190b17f1bSmrgm4_ifval([$1],
946290b17f1bSmrg[if test "$have_doxygen" = yes; then
946390b17f1bSmrg    # scrape the doxygen version
946490b17f1bSmrg    AC_MSG_CHECKING([the doxygen version])
946590b17f1bSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
946690b17f1bSmrg    AC_MSG_RESULT([$doxygen_version])
946790b17f1bSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
946890b17f1bSmrg        [if test "x$use_doxygen" = xauto; then
946990b17f1bSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
947090b17f1bSmrg            have_doxygen=no
947190b17f1bSmrg        else
947290b17f1bSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
947390b17f1bSmrg        fi])
947490b17f1bSmrgfi])
947590b17f1bSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
947690b17f1bSmrg]) # XORG_WITH_DOXYGEN
94777e6fb56fSmrg
947890b17f1bSmrg# XORG_WITH_GROFF([DEFAULT])
947990b17f1bSmrg# ----------------
948090b17f1bSmrg# Minimum version: 1.6.0
948190b17f1bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
948290b17f1bSmrg#
948390b17f1bSmrg# Documentation tools are not always available on all platforms and sometimes
948490b17f1bSmrg# not at the appropriate level. This macro enables a module to test for the
948590b17f1bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
948690b17f1bSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
948790b17f1bSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
948890b17f1bSmrg# --with-groff assumes 'auto'.
948990b17f1bSmrg#
949090b17f1bSmrg# Interface to module:
949190b17f1bSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
949290b17f1bSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
949390b17f1bSmrg# HAVE_GROFF_MS: the -ms macros package
949490b17f1bSmrg# GROFF:	 returns the path of the groff program found
949590b17f1bSmrg#		 returns the path set by the user in the environment
949690b17f1bSmrg# --with-groff:	 'yes' user instructs the module to use groff
949790b17f1bSmrg#		 'no' user instructs the module not to use groff
949890b17f1bSmrg#
949990b17f1bSmrg# Added in version 1.9.0:
950090b17f1bSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
950190b17f1bSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
950290b17f1bSmrg#		   psselect from the psutils package.
950390b17f1bSmrg#		   the ghostcript package. Refer to the grohtml man pages
950490b17f1bSmrg#
950590b17f1bSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
950690b17f1bSmrg#
950790b17f1bSmrg# OS and distros often splits groff in a basic and full package, the former
950890b17f1bSmrg# having the groff program and the later having devices, fonts and macros
950990b17f1bSmrg# Checking for the groff executable is not enough.
951090b17f1bSmrg#
951190b17f1bSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
951290b17f1bSmrg# unset HAVE_GROFF or GROFF env variables.
951390b17f1bSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
951490b17f1bSmrg#
951590b17f1bSmrgAC_DEFUN([XORG_WITH_GROFF],[
951690b17f1bSmrgAC_ARG_VAR([GROFF], [Path to groff command])
951790b17f1bSmrgm4_define([_defopt], m4_default([$1], [auto]))
951890b17f1bSmrgAC_ARG_WITH(groff,
951990b17f1bSmrg	AS_HELP_STRING([--with-groff],
952090b17f1bSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
952190b17f1bSmrg	   [use_groff=$withval], [use_groff=]_defopt)
952290b17f1bSmrgm4_undefine([_defopt])
952390b17f1bSmrg
952490b17f1bSmrgif test "x$use_groff" = x"auto"; then
952590b17f1bSmrg   AC_PATH_PROG([GROFF], [groff])
952690b17f1bSmrg   if test "x$GROFF" = "x"; then
952790b17f1bSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
952890b17f1bSmrg	have_groff=no
952990b17f1bSmrg   else
953090b17f1bSmrg        have_groff=yes
953190b17f1bSmrg   fi
953290b17f1bSmrgelif test "x$use_groff" = x"yes" ; then
953390b17f1bSmrg   AC_PATH_PROG([GROFF], [groff])
953490b17f1bSmrg   if test "x$GROFF" = "x"; then
953590b17f1bSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
953690b17f1bSmrg   fi
953790b17f1bSmrg   have_groff=yes
953890b17f1bSmrgelif test "x$use_groff" = x"no" ; then
953990b17f1bSmrg   if test "x$GROFF" != "x"; then
954090b17f1bSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
954190b17f1bSmrg   fi
954290b17f1bSmrg   have_groff=no
954390b17f1bSmrgelse
954490b17f1bSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
954590b17f1bSmrgfi
95467e6fb56fSmrg
954790b17f1bSmrg# We have groff, test for the presence of the macro packages
954890b17f1bSmrgif test "x$have_groff" = x"yes"; then
954990b17f1bSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
955090b17f1bSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
955190b17f1bSmrg        groff_ms_works=yes
955290b17f1bSmrg    else
955390b17f1bSmrg        groff_ms_works=no
955490b17f1bSmrg    fi
955590b17f1bSmrg    AC_MSG_RESULT([$groff_ms_works])
955690b17f1bSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
955790b17f1bSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
955890b17f1bSmrg        groff_mm_works=yes
955990b17f1bSmrg    else
956090b17f1bSmrg        groff_mm_works=no
956190b17f1bSmrg    fi
956290b17f1bSmrg    AC_MSG_RESULT([$groff_mm_works])
956390b17f1bSmrgfi
95647e6fb56fSmrg
956590b17f1bSmrg# We have groff, test for HTML dependencies, one command per package
956690b17f1bSmrgif test "x$have_groff" = x"yes"; then
956790b17f1bSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
956890b17f1bSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
956990b17f1bSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
957090b17f1bSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
957190b17f1bSmrg      have_groff_html=yes
957290b17f1bSmrg   else
957390b17f1bSmrg      have_groff_html=no
957490b17f1bSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
957590b17f1bSmrg   fi
957690b17f1bSmrgfi
95777e6fb56fSmrg
957890b17f1bSmrg# Set Automake conditionals for Makefiles
957990b17f1bSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
958090b17f1bSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
958190b17f1bSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
958290b17f1bSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
958390b17f1bSmrg]) # XORG_WITH_GROFF
95847e6fb56fSmrg
958590b17f1bSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
958690b17f1bSmrg# ---------------------------------------
958790b17f1bSmrg# Minimum version: 1.6.0
958890b17f1bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
958990b17f1bSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
959090b17f1bSmrg#
959190b17f1bSmrg# Documentation tools are not always available on all platforms and sometimes
959290b17f1bSmrg# not at the appropriate level. This macro enables a module to test for the
959390b17f1bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
959490b17f1bSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
959590b17f1bSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
959690b17f1bSmrg# --with-fop assumes 'auto'.
959790b17f1bSmrg#
959890b17f1bSmrg# Interface to module:
959990b17f1bSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
960090b17f1bSmrg# FOP:	 	returns the path of the fop program found
960190b17f1bSmrg#		returns the path set by the user in the environment
960290b17f1bSmrg# --with-fop: 	'yes' user instructs the module to use fop
960390b17f1bSmrg#		'no' user instructs the module not to use fop
960490b17f1bSmrg#
960590b17f1bSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
960690b17f1bSmrg#
960790b17f1bSmrgAC_DEFUN([XORG_WITH_FOP],[
960890b17f1bSmrgAC_ARG_VAR([FOP], [Path to fop command])
960990b17f1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
961090b17f1bSmrgAC_ARG_WITH(fop,
961190b17f1bSmrg	AS_HELP_STRING([--with-fop],
961290b17f1bSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
961390b17f1bSmrg	   [use_fop=$withval], [use_fop=]_defopt)
961490b17f1bSmrgm4_undefine([_defopt])
961590b17f1bSmrg
961690b17f1bSmrgif test "x$use_fop" = x"auto"; then
961790b17f1bSmrg   AC_PATH_PROG([FOP], [fop])
961890b17f1bSmrg   if test "x$FOP" = "x"; then
961990b17f1bSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
962090b17f1bSmrg	have_fop=no
962190b17f1bSmrg   else
962290b17f1bSmrg        have_fop=yes
962390b17f1bSmrg   fi
962490b17f1bSmrgelif test "x$use_fop" = x"yes" ; then
962590b17f1bSmrg   AC_PATH_PROG([FOP], [fop])
962690b17f1bSmrg   if test "x$FOP" = "x"; then
962790b17f1bSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
962890b17f1bSmrg   fi
962990b17f1bSmrg   have_fop=yes
963090b17f1bSmrgelif test "x$use_fop" = x"no" ; then
963190b17f1bSmrg   if test "x$FOP" != "x"; then
963290b17f1bSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
963390b17f1bSmrg   fi
963490b17f1bSmrg   have_fop=no
963590b17f1bSmrgelse
963690b17f1bSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
963790b17f1bSmrgfi
96387e6fb56fSmrg
963990b17f1bSmrg# Test for a minimum version of fop, if provided.
964090b17f1bSmrgm4_ifval([$1],
964190b17f1bSmrg[if test "$have_fop" = yes; then
964290b17f1bSmrg    # scrape the fop version
964390b17f1bSmrg    AC_MSG_CHECKING([for fop minimum version])
964490b17f1bSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
964590b17f1bSmrg    AC_MSG_RESULT([$fop_version])
964690b17f1bSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
964790b17f1bSmrg        [if test "x$use_fop" = xauto; then
964890b17f1bSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
964990b17f1bSmrg            have_fop=no
965090b17f1bSmrg        else
965190b17f1bSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
965290b17f1bSmrg        fi])
965390b17f1bSmrgfi])
965490b17f1bSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
965590b17f1bSmrg]) # XORG_WITH_FOP
96567e6fb56fSmrg
965790b17f1bSmrg# XORG_WITH_PS2PDF([DEFAULT])
96587e6fb56fSmrg# ----------------
965990b17f1bSmrg# Minimum version: 1.6.0
966090b17f1bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
966190b17f1bSmrg#
966290b17f1bSmrg# Documentation tools are not always available on all platforms and sometimes
966390b17f1bSmrg# not at the appropriate level. This macro enables a module to test for the
966490b17f1bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
966590b17f1bSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
966690b17f1bSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
966790b17f1bSmrg# --with-ps2pdf assumes 'auto'.
966890b17f1bSmrg#
966990b17f1bSmrg# Interface to module:
967090b17f1bSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
967190b17f1bSmrg# PS2PDF:	returns the path of the ps2pdf program found
967290b17f1bSmrg#		returns the path set by the user in the environment
967390b17f1bSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
967490b17f1bSmrg#		 'no' user instructs the module not to use ps2pdf
967590b17f1bSmrg#
967690b17f1bSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
967790b17f1bSmrg#
967890b17f1bSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
967990b17f1bSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
968090b17f1bSmrgm4_define([_defopt], m4_default([$1], [auto]))
968190b17f1bSmrgAC_ARG_WITH(ps2pdf,
968290b17f1bSmrg	AS_HELP_STRING([--with-ps2pdf],
968390b17f1bSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
968490b17f1bSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
968590b17f1bSmrgm4_undefine([_defopt])
968690b17f1bSmrg
968790b17f1bSmrgif test "x$use_ps2pdf" = x"auto"; then
968890b17f1bSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
968990b17f1bSmrg   if test "x$PS2PDF" = "x"; then
969090b17f1bSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
969190b17f1bSmrg	have_ps2pdf=no
969290b17f1bSmrg   else
969390b17f1bSmrg        have_ps2pdf=yes
969490b17f1bSmrg   fi
969590b17f1bSmrgelif test "x$use_ps2pdf" = x"yes" ; then
969690b17f1bSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
969790b17f1bSmrg   if test "x$PS2PDF" = "x"; then
969890b17f1bSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
969990b17f1bSmrg   fi
970090b17f1bSmrg   have_ps2pdf=yes
970190b17f1bSmrgelif test "x$use_ps2pdf" = x"no" ; then
970290b17f1bSmrg   if test "x$PS2PDF" != "x"; then
970390b17f1bSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
970490b17f1bSmrg   fi
970590b17f1bSmrg   have_ps2pdf=no
97067e6fb56fSmrgelse
970790b17f1bSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
97087e6fb56fSmrgfi
970990b17f1bSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
971090b17f1bSmrg]) # XORG_WITH_PS2PDF
97117e6fb56fSmrg
971290b17f1bSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
971390b17f1bSmrg# ----------------
971490b17f1bSmrg# Minimum version: 1.6.0
971590b17f1bSmrg#
971690b17f1bSmrg# Documentation tools are not always available on all platforms and sometimes
971790b17f1bSmrg# not at the appropriate level. This macro enables a builder to skip all
971890b17f1bSmrg# documentation targets except traditional man pages.
971990b17f1bSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
972090b17f1bSmrg# maximum flexibilty in controlling documentation building.
972190b17f1bSmrg# Refer to:
972290b17f1bSmrg# XORG_WITH_XMLTO         --with-xmlto
972390b17f1bSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
972490b17f1bSmrg# XORG_WITH_DOXYGEN       --with-doxygen
972590b17f1bSmrg# XORG_WITH_FOP           --with-fop
972690b17f1bSmrg# XORG_WITH_GROFF         --with-groff
972790b17f1bSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
972890b17f1bSmrg#
972990b17f1bSmrg# Interface to module:
973090b17f1bSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
973190b17f1bSmrg# --enable-docs: 'yes' user instructs the module to generate docs
973290b17f1bSmrg#		 'no' user instructs the module not to generate docs
973390b17f1bSmrg# parm1:	specify the default value, yes or no.
973490b17f1bSmrg#
973590b17f1bSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
973690b17f1bSmrgm4_define([docs_default], m4_default([$1], [yes]))
973790b17f1bSmrgAC_ARG_ENABLE(docs,
973890b17f1bSmrg	AS_HELP_STRING([--enable-docs],
973990b17f1bSmrg	   [Enable building the documentation (default: ]docs_default[)]),
974090b17f1bSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
974190b17f1bSmrgm4_undefine([docs_default])
974290b17f1bSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
974390b17f1bSmrgAC_MSG_CHECKING([whether to build documentation])
974490b17f1bSmrgAC_MSG_RESULT([$build_docs])
974590b17f1bSmrg]) # XORG_ENABLE_DOCS
974690b17f1bSmrg
974790b17f1bSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
974890b17f1bSmrg# ----------------
974990b17f1bSmrg# Minimum version: 1.6.0
975090b17f1bSmrg#
975190b17f1bSmrg# This macro enables a builder to skip all developer documentation.
975290b17f1bSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
975390b17f1bSmrg# maximum flexibilty in controlling documentation building.
975490b17f1bSmrg# Refer to:
975590b17f1bSmrg# XORG_WITH_XMLTO         --with-xmlto
975690b17f1bSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
975790b17f1bSmrg# XORG_WITH_DOXYGEN       --with-doxygen
975890b17f1bSmrg# XORG_WITH_FOP           --with-fop
975990b17f1bSmrg# XORG_WITH_GROFF         --with-groff
976090b17f1bSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
976190b17f1bSmrg#
976290b17f1bSmrg# Interface to module:
976390b17f1bSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
976490b17f1bSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
976590b17f1bSmrg#			'no' user instructs the module not to generate developer docs
976690b17f1bSmrg# parm1:		specify the default value, yes or no.
976790b17f1bSmrg#
976890b17f1bSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
976990b17f1bSmrgm4_define([devel_default], m4_default([$1], [yes]))
977090b17f1bSmrgAC_ARG_ENABLE(devel-docs,
977190b17f1bSmrg	AS_HELP_STRING([--enable-devel-docs],
977290b17f1bSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
977390b17f1bSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
977490b17f1bSmrgm4_undefine([devel_default])
977590b17f1bSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
977690b17f1bSmrgAC_MSG_CHECKING([whether to build developer documentation])
977790b17f1bSmrgAC_MSG_RESULT([$build_devel_docs])
977890b17f1bSmrg]) # XORG_ENABLE_DEVEL_DOCS
977990b17f1bSmrg
978090b17f1bSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
978190b17f1bSmrg# ----------------
978290b17f1bSmrg# Minimum version: 1.6.0
978390b17f1bSmrg#
978490b17f1bSmrg# This macro enables a builder to skip all functional specification targets.
978590b17f1bSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
978690b17f1bSmrg# maximum flexibilty in controlling documentation building.
978790b17f1bSmrg# Refer to:
978890b17f1bSmrg# XORG_WITH_XMLTO         --with-xmlto
978990b17f1bSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
979090b17f1bSmrg# XORG_WITH_DOXYGEN       --with-doxygen
979190b17f1bSmrg# XORG_WITH_FOP           --with-fop
979290b17f1bSmrg# XORG_WITH_GROFF         --with-groff
979390b17f1bSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
979490b17f1bSmrg#
979590b17f1bSmrg# Interface to module:
979690b17f1bSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
979790b17f1bSmrg# --enable-specs:	'yes' user instructs the module to generate specs
979890b17f1bSmrg#			'no' user instructs the module not to generate specs
979990b17f1bSmrg# parm1:		specify the default value, yes or no.
980090b17f1bSmrg#
980190b17f1bSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
980290b17f1bSmrgm4_define([spec_default], m4_default([$1], [yes]))
980390b17f1bSmrgAC_ARG_ENABLE(specs,
980490b17f1bSmrg	AS_HELP_STRING([--enable-specs],
980590b17f1bSmrg	   [Enable building the specs (default: ]spec_default[)]),
980690b17f1bSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
980790b17f1bSmrgm4_undefine([spec_default])
980890b17f1bSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
980990b17f1bSmrgAC_MSG_CHECKING([whether to build functional specifications])
981090b17f1bSmrgAC_MSG_RESULT([$build_specs])
981190b17f1bSmrg]) # XORG_ENABLE_SPECS
981290b17f1bSmrg
981390b17f1bSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
981490b17f1bSmrg# ----------------------------------------------
981590b17f1bSmrg# Minimum version: 1.13.0
981690b17f1bSmrg#
981790b17f1bSmrg# This macro enables a builder to enable/disable unit testing
981890b17f1bSmrg# It makes no assumption about the test cases implementation
981990b17f1bSmrg# Test cases may or may not use Automake "Support for test suites"
982090b17f1bSmrg# They may or may not use the software utility library GLib
982190b17f1bSmrg#
982290b17f1bSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
982390b17f1bSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
982490b17f1bSmrg# The variable enable_unit_tests is used by other macros in this file.
982590b17f1bSmrg#
982690b17f1bSmrg# Interface to module:
982790b17f1bSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
982890b17f1bSmrg# enable_unit_tests:    used in configure.ac for additional configuration
982990b17f1bSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
983090b17f1bSmrg#			'no' user instructs the module not to build tests
983190b17f1bSmrg# parm1:		specify the default value, yes or no.
983290b17f1bSmrg#
983390b17f1bSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
983490b17f1bSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
983590b17f1bSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
983690b17f1bSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
983790b17f1bSmrgm4_define([_defopt], m4_default([$1], [auto]))
983890b17f1bSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
983990b17f1bSmrg	[Enable building unit test cases (default: ]_defopt[)]),
984090b17f1bSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
984190b17f1bSmrgm4_undefine([_defopt])
984290b17f1bSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
984390b17f1bSmrgAC_MSG_CHECKING([whether to build unit test cases])
984490b17f1bSmrgAC_MSG_RESULT([$enable_unit_tests])
984590b17f1bSmrg]) # XORG_ENABLE_UNIT_TESTS
984690b17f1bSmrg
984790b17f1bSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
984890b17f1bSmrg# ------------------------------------------------------
984990b17f1bSmrg# Minimum version: 1.17.0
985090b17f1bSmrg#
985190b17f1bSmrg# This macro enables a builder to enable/disable integration testing
985290b17f1bSmrg# It makes no assumption about the test cases' implementation
985390b17f1bSmrg# Test cases may or may not use Automake "Support for test suites"
985490b17f1bSmrg#
985590b17f1bSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
985690b17f1bSmrg# usually requires less dependencies and may be built and run under less
985790b17f1bSmrg# stringent environments than integration tests.
985890b17f1bSmrg#
985990b17f1bSmrg# Interface to module:
986090b17f1bSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
986190b17f1bSmrg# enable_integration_tests:   used in configure.ac for additional configuration
986290b17f1bSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
986390b17f1bSmrg#                             'no' user instructs the module not to build tests
986490b17f1bSmrg# parm1:                      specify the default value, yes or no.
986590b17f1bSmrg#
986690b17f1bSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
986790b17f1bSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
986890b17f1bSmrgm4_define([_defopt], m4_default([$1], [auto]))
986990b17f1bSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
987090b17f1bSmrg	[Enable building integration test cases (default: ]_defopt[)]),
987190b17f1bSmrg	[enable_integration_tests=$enableval],
987290b17f1bSmrg	[enable_integration_tests=]_defopt)
987390b17f1bSmrgm4_undefine([_defopt])
987490b17f1bSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
987590b17f1bSmrg	[test "x$enable_integration_tests" != xno])
987690b17f1bSmrgAC_MSG_CHECKING([whether to build unit test cases])
987790b17f1bSmrgAC_MSG_RESULT([$enable_integration_tests])
987890b17f1bSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
987990b17f1bSmrg
988090b17f1bSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
988190b17f1bSmrg# ----------------------------------------
988290b17f1bSmrg# Minimum version: 1.13.0
988390b17f1bSmrg#
988490b17f1bSmrg# GLib is a library which provides advanced data structures and functions.
988590b17f1bSmrg# This macro enables a module to test for the presence of Glib.
988690b17f1bSmrg#
988790b17f1bSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
988890b17f1bSmrg# Otherwise the value of $enable_unit_tests is blank.
988990b17f1bSmrg#
989090b17f1bSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
989190b17f1bSmrg# test support usually requires less dependencies and may be built and run under
989290b17f1bSmrg# less stringent environments than integration tests.
989390b17f1bSmrg#
989490b17f1bSmrg# Interface to module:
989590b17f1bSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
989690b17f1bSmrg# with_glib: used in configure.ac to know if GLib has been found
989790b17f1bSmrg# --with-glib:	'yes' user instructs the module to use glib
989890b17f1bSmrg#		'no' user instructs the module not to use glib
989990b17f1bSmrg#
990090b17f1bSmrgAC_DEFUN([XORG_WITH_GLIB],[
990190b17f1bSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
990290b17f1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
990390b17f1bSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
990490b17f1bSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
990590b17f1bSmrg	[with_glib=$withval], [with_glib=]_defopt)
990690b17f1bSmrgm4_undefine([_defopt])
990790b17f1bSmrg
990890b17f1bSmrghave_glib=no
990990b17f1bSmrg# Do not probe GLib if user explicitly disabled unit testing
991090b17f1bSmrgif test "x$enable_unit_tests" != x"no"; then
991190b17f1bSmrg  # Do not probe GLib if user explicitly disabled it
991290b17f1bSmrg  if test "x$with_glib" != x"no"; then
991390b17f1bSmrg    m4_ifval(
991490b17f1bSmrg      [$1],
991590b17f1bSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
991690b17f1bSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
991790b17f1bSmrg    )
991890b17f1bSmrg  fi
991990b17f1bSmrgfi
99207e6fb56fSmrg
992190b17f1bSmrg# Not having GLib when unit testing has been explicitly requested is an error
992290b17f1bSmrgif test "x$enable_unit_tests" = x"yes"; then
992390b17f1bSmrg  if test "x$have_glib" = x"no"; then
992490b17f1bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
99257e6fb56fSmrg  fi
992690b17f1bSmrgfi
99277e6fb56fSmrg
992890b17f1bSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
992990b17f1bSmrgif test "x$enable_unit_tests" = x"no"; then
993090b17f1bSmrg  if test "x$with_glib" = x"yes"; then
993190b17f1bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
993290b17f1bSmrg  fi
993390b17f1bSmrgfi
993490b17f1bSmrg
993590b17f1bSmrg# Not having GLib when it has been explicitly requested is an error
993690b17f1bSmrgif test "x$with_glib" = x"yes"; then
993790b17f1bSmrg  if test "x$have_glib" = x"no"; then
993890b17f1bSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
993990b17f1bSmrg  fi
994090b17f1bSmrgfi
994190b17f1bSmrg
994290b17f1bSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
994390b17f1bSmrg]) # XORG_WITH_GLIB
994490b17f1bSmrg
994590b17f1bSmrg# XORG_LD_WRAP([required|optional])
994690b17f1bSmrg# ---------------------------------
994790b17f1bSmrg# Minimum version: 1.13.0
99487e6fb56fSmrg#
994990b17f1bSmrg# Check if linker supports -wrap, passed via compiler flags
995090b17f1bSmrg#
995190b17f1bSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
995290b17f1bSmrg# Otherwise the value of $enable_unit_tests is blank.
995390b17f1bSmrg#
995490b17f1bSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
995590b17f1bSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
995690b17f1bSmrg# available, an argument of "optional" allows use when some unit tests require
995790b17f1bSmrg# ld -wrap and others do not.
995890b17f1bSmrg#
995990b17f1bSmrgAC_DEFUN([XORG_LD_WRAP],[
996090b17f1bSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
996190b17f1bSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
996290b17f1bSmrg                      void __wrap_exit(int status) { return; }],
996390b17f1bSmrg                     [exit(0);])])
996490b17f1bSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
996590b17f1bSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
996690b17f1bSmrg  if test "x$have_ld_wrap" = x"no"; then
996790b17f1bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
996890b17f1bSmrg  fi
996990b17f1bSmrgfi
997090b17f1bSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
997190b17f1bSmrg#
997290b17f1bSmrg]) # XORG_LD_WRAP
997390b17f1bSmrg
997490b17f1bSmrg# XORG_CHECK_LINKER_FLAGS
997590b17f1bSmrg# -----------------------
997690b17f1bSmrg# SYNOPSIS
997790b17f1bSmrg#
997890b17f1bSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
997990b17f1bSmrg#
998090b17f1bSmrg# DESCRIPTION
998190b17f1bSmrg#
998290b17f1bSmrg#   Check whether the given linker FLAGS work with the current language's
998390b17f1bSmrg#   linker, or whether they give an error.
998490b17f1bSmrg#
998590b17f1bSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
998690b17f1bSmrg#   success/failure.
998790b17f1bSmrg#
998890b17f1bSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
998990b17f1bSmrg#
999090b17f1bSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
999190b17f1bSmrg#
999290b17f1bSmrg# LICENSE
999390b17f1bSmrg#
999490b17f1bSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
999590b17f1bSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
999690b17f1bSmrg#   Copyright (c) 2009 Matteo Frigo
999790b17f1bSmrg#
999890b17f1bSmrg#   This program is free software: you can redistribute it and/or modify it
999990b17f1bSmrg#   under the terms of the GNU General Public License as published by the
1000090b17f1bSmrg#   Free Software Foundation, either version 3 of the License, or (at your
1000190b17f1bSmrg#   option) any later version.
1000290b17f1bSmrg#
1000390b17f1bSmrg#   This program is distributed in the hope that it will be useful, but
1000490b17f1bSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
1000590b17f1bSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1000690b17f1bSmrg#   Public License for more details.
1000790b17f1bSmrg#
1000890b17f1bSmrg#   You should have received a copy of the GNU General Public License along
1000990b17f1bSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
1001090b17f1bSmrg#
1001190b17f1bSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
1001290b17f1bSmrg#   gives unlimited permission to copy, distribute and modify the configure
1001390b17f1bSmrg#   scripts that are the output of Autoconf when processing the Macro. You
1001490b17f1bSmrg#   need not follow the terms of the GNU General Public License when using
1001590b17f1bSmrg#   or distributing such scripts, even though portions of the text of the
1001690b17f1bSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
1001790b17f1bSmrg#   all other use of the material that constitutes the Autoconf Macro.
1001890b17f1bSmrg#
1001990b17f1bSmrg#   This special exception to the GPL applies to versions of the Autoconf
1002090b17f1bSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
1002190b17f1bSmrg#   modified version of the Autoconf Macro, you may extend this special
1002290b17f1bSmrg#   exception to the GPL to apply to your modified version as well.#
1002390b17f1bSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
1002490b17f1bSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
1002590b17f1bSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
1002690b17f1bSmrgAS_LITERAL_IF([$1],
1002790b17f1bSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
1002890b17f1bSmrg      ax_save_FLAGS=$LDFLAGS
1002990b17f1bSmrg      LDFLAGS="$1"
1003090b17f1bSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
1003190b17f1bSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1003290b17f1bSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1003390b17f1bSmrg      LDFLAGS=$ax_save_FLAGS])],
1003490b17f1bSmrg  [ax_save_FLAGS=$LDFLAGS
1003590b17f1bSmrg   LDFLAGS="$1"
1003690b17f1bSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1003790b17f1bSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1003890b17f1bSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1003990b17f1bSmrg   LDFLAGS=$ax_save_FLAGS])
1004090b17f1bSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
1004190b17f1bSmrgAC_MSG_RESULT($xorg_check_linker_flags)
1004290b17f1bSmrgif test "x$xorg_check_linker_flags" = xyes; then
1004390b17f1bSmrg	m4_default([$2], :)
1004490b17f1bSmrgelse
1004590b17f1bSmrg	m4_default([$3], :)
1004690b17f1bSmrgfi
1004790b17f1bSmrg]) # XORG_CHECK_LINKER_FLAGS
1004890b17f1bSmrg
1004990b17f1bSmrg# XORG_MEMORY_CHECK_FLAGS
1005090b17f1bSmrg# -----------------------
1005190b17f1bSmrg# Minimum version: 1.16.0
100527e6fb56fSmrg#
1005390b17f1bSmrg# This macro attempts to find appropriate memory checking functionality
1005490b17f1bSmrg# for various platforms which unit testing code may use to catch various
1005590b17f1bSmrg# forms of memory allocation and access errors in testing.
100567e6fb56fSmrg#
1005790b17f1bSmrg# Interface to module:
1005890b17f1bSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
1005990b17f1bSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
100607e6fb56fSmrg#
1006190b17f1bSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
1006290b17f1bSmrg#
1006390b17f1bSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
100647e6fb56fSmrg
1006590b17f1bSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1006690b17f1bSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
1006790b17f1bSmrg           [Environment variables to enable memory checking in tests])
1006890b17f1bSmrg
1006990b17f1bSmrg# Check for different types of support on different platforms
1007090b17f1bSmrgcase $host_os in
1007190b17f1bSmrg    solaris*)
1007290b17f1bSmrg        AC_CHECK_LIB([umem], [umem_alloc],
1007390b17f1bSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
1007490b17f1bSmrg        ;;
1007590b17f1bSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
1007690b17f1bSmrg        # both directly and inverted, so should not be 0 or 255.
1007790b17f1bSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
1007890b17f1bSmrg        ;;
1007990b17f1bSmrg    darwin*)
1008090b17f1bSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
1008190b17f1bSmrg        ;;
1008290b17f1bSmrg    *bsd*)
1008390b17f1bSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
1008490b17f1bSmrg        ;;
1008590b17f1bSmrgesac
1008690b17f1bSmrg
1008790b17f1bSmrg# User supplied flags override default flags
1008890b17f1bSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
1008990b17f1bSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
100907e6fb56fSmrgfi
100917e6fb56fSmrg
1009290b17f1bSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
1009390b17f1bSmrg]) # XORG_WITH_LINT
1009490b17f1bSmrg
1009590b17f1bSmrg# XORG_CHECK_MALLOC_ZERO
1009690b17f1bSmrg# ----------------------
1009790b17f1bSmrg# Minimum version: 1.0.0
100987e6fb56fSmrg#
1009990b17f1bSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1010090b17f1bSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1010190b17f1bSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1010290b17f1bSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1010390b17f1bSmrgAC_ARG_ENABLE(malloc0returnsnull,
1010490b17f1bSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1010590b17f1bSmrg		       [malloc(0) returns NULL (default: auto)]),
1010690b17f1bSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1010790b17f1bSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1010890b17f1bSmrg
1010990b17f1bSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1011090b17f1bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
10111983b4bf2Smrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
1011290b17f1bSmrg#include <stdlib.h>
1011390b17f1bSmrg],[
1011490b17f1bSmrg    char *m0, *r0, *c0, *p;
1011590b17f1bSmrg    m0 = malloc(0);
1011690b17f1bSmrg    p = malloc(10);
1011790b17f1bSmrg    r0 = realloc(p,0);
1011890b17f1bSmrg    c0 = calloc(0,10);
1011990b17f1bSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
1012090b17f1bSmrg])],
10121983b4bf2Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
10122983b4bf2Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
10123983b4bf2Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
1012490b17f1bSmrgfi
1012590b17f1bSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1012690b17f1bSmrg
1012790b17f1bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1012890b17f1bSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1012990b17f1bSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1013090b17f1bSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1013190b17f1bSmrgelse
1013290b17f1bSmrg	MALLOC_ZERO_CFLAGS=""
1013390b17f1bSmrg	XMALLOC_ZERO_CFLAGS=""
1013490b17f1bSmrg	XTMALLOC_ZERO_CFLAGS=""
1013590b17f1bSmrgfi
1013690b17f1bSmrg
1013790b17f1bSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1013890b17f1bSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1013990b17f1bSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1014090b17f1bSmrg]) # XORG_CHECK_MALLOC_ZERO
1014190b17f1bSmrg
1014290b17f1bSmrg# XORG_WITH_LINT()
1014390b17f1bSmrg# ----------------
1014490b17f1bSmrg# Minimum version: 1.1.0
101457e6fb56fSmrg#
1014690b17f1bSmrg# This macro enables the use of a tool that flags some suspicious and
1014790b17f1bSmrg# non-portable constructs (likely to be bugs) in C language source code.
1014890b17f1bSmrg# It will attempt to locate the tool and use appropriate options.
1014990b17f1bSmrg# There are various lint type tools on different platforms.
101507e6fb56fSmrg#
1015190b17f1bSmrg# Interface to module:
1015290b17f1bSmrg# LINT:		returns the path to the tool found on the platform
1015390b17f1bSmrg#		or the value set to LINT on the configure cmd line
1015490b17f1bSmrg#		also an Automake conditional
1015590b17f1bSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
1015690b17f1bSmrg#
1015790b17f1bSmrg# --with-lint:	'yes' user instructs the module to use lint
1015890b17f1bSmrg#		'no' user instructs the module not to use lint (default)
1015990b17f1bSmrg#
1016090b17f1bSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1016190b17f1bSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1016290b17f1bSmrg#
1016390b17f1bSmrgAC_DEFUN([XORG_WITH_LINT],[
101647e6fb56fSmrg
1016590b17f1bSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1016690b17f1bSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1016790b17f1bSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1016890b17f1bSmrg		[Use a lint-style source code checker (default: disabled)])],
1016990b17f1bSmrg		[use_lint=$withval], [use_lint=no])
101707e6fb56fSmrg
1017190b17f1bSmrg# Obtain platform specific info like program name and options
1017290b17f1bSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1017390b17f1bSmrgcase $host_os in
1017490b17f1bSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1017590b17f1bSmrg	lint_name=splint
1017690b17f1bSmrg	lint_options="-badflag"
1017790b17f1bSmrg	;;
1017890b17f1bSmrg  *freebsd* | *netbsd*)
1017990b17f1bSmrg	lint_name=lint
1018090b17f1bSmrg	lint_options="-u -b"
1018190b17f1bSmrg	;;
1018290b17f1bSmrg  *solaris*)
1018390b17f1bSmrg	lint_name=lint
1018490b17f1bSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1018590b17f1bSmrg	;;
1018690b17f1bSmrgesac
101877e6fb56fSmrg
1018890b17f1bSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
1018990b17f1bSmrgif test "x$use_lint" = x"yes" ; then
1019090b17f1bSmrg   AC_PATH_PROG([LINT], [$lint_name])
1019190b17f1bSmrg   if test "x$LINT" = "x"; then
1019290b17f1bSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1019390b17f1bSmrg   fi
1019490b17f1bSmrgelif test "x$use_lint" = x"no" ; then
1019590b17f1bSmrg   if test "x$LINT" != "x"; then
1019690b17f1bSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1019790b17f1bSmrg   fi
101987e6fb56fSmrgelse
1019990b17f1bSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1020090b17f1bSmrgfi
102017e6fb56fSmrg
1020290b17f1bSmrg# User supplied flags override default flags
1020390b17f1bSmrgif test "x$LINT_FLAGS" != "x"; then
1020490b17f1bSmrg   lint_options=$LINT_FLAGS
1020590b17f1bSmrgfi
102067e6fb56fSmrg
1020790b17f1bSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
1020890b17f1bSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
1020990b17f1bSmrg
1021090b17f1bSmrg]) # XORG_WITH_LINT
1021190b17f1bSmrg
1021290b17f1bSmrg# XORG_LINT_LIBRARY(LIBNAME)
1021390b17f1bSmrg# --------------------------
1021490b17f1bSmrg# Minimum version: 1.1.0
102157e6fb56fSmrg#
1021690b17f1bSmrg# Sets up flags for building lint libraries for checking programs that call
1021790b17f1bSmrg# functions in the library.
102187e6fb56fSmrg#
1021990b17f1bSmrg# Interface to module:
1022090b17f1bSmrg# LINTLIB		- Automake variable with the name of lint library file to make
1022190b17f1bSmrg# MAKE_LINT_LIB		- Automake conditional
102227e6fb56fSmrg#
1022390b17f1bSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
1022490b17f1bSmrg#			  - 'no' user instructs the module not to create a lint library (default)
1022590b17f1bSmrg
1022690b17f1bSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1022790b17f1bSmrgAC_REQUIRE([XORG_WITH_LINT])
1022890b17f1bSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1022990b17f1bSmrg	[Create lint library (default: disabled)])],
1023090b17f1bSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1023190b17f1bSmrg
1023290b17f1bSmrgif test "x$make_lint_lib" = x"yes" ; then
1023390b17f1bSmrg   LINTLIB=llib-l$1.ln
1023490b17f1bSmrg   if test "x$LINT" = "x"; then
1023590b17f1bSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
1023690b17f1bSmrg   fi
1023790b17f1bSmrgelif test "x$make_lint_lib" != x"no" ; then
1023890b17f1bSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1023990b17f1bSmrgfi
102407e6fb56fSmrg
1024190b17f1bSmrgAC_SUBST(LINTLIB)
1024290b17f1bSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
102437e6fb56fSmrg
1024490b17f1bSmrg]) # XORG_LINT_LIBRARY
102457e6fb56fSmrg
1024690b17f1bSmrg# XORG_COMPILER_BRAND
1024790b17f1bSmrg# -------------------
1024890b17f1bSmrg# Minimum version: 1.14.0
1024990b17f1bSmrg#
1025090b17f1bSmrg# Checks for various brands of compilers and sets flags as appropriate:
1025190b17f1bSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
1025290b17f1bSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
1025390b17f1bSmrg#   clang compiler - sets CLANGCC to "yes"
1025490b17f1bSmrg#   Intel compiler - sets INTELCC to "yes"
1025590b17f1bSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
1025690b17f1bSmrg#
1025790b17f1bSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
1025890b17f1bSmrgAC_LANG_CASE(
1025990b17f1bSmrg	[C], [
1026090b17f1bSmrg		AC_REQUIRE([AC_PROG_CC_C99])
1026190b17f1bSmrg	],
1026290b17f1bSmrg	[C++], [
1026390b17f1bSmrg		AC_REQUIRE([AC_PROG_CXX])
1026490b17f1bSmrg	]
1026590b17f1bSmrg)
1026690b17f1bSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
1026790b17f1bSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1026890b17f1bSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1026990b17f1bSmrg]) # XORG_COMPILER_BRAND
102707e6fb56fSmrg
1027190b17f1bSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
1027290b17f1bSmrg# ---------------
1027390b17f1bSmrg# Minimum version: 1.16.0
1027490b17f1bSmrg#
1027590b17f1bSmrg# Test if the compiler works when passed the given flag as a command line argument.
1027690b17f1bSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
1027790b17f1bSmrg# next flag in the list until there are no more options.
1027890b17f1bSmrg#
1027990b17f1bSmrg# Note that this does not guarantee that the compiler supports the flag as some
1028090b17f1bSmrg# compilers will simply ignore arguments that they do not understand, but we do
1028190b17f1bSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
1028290b17f1bSmrg# -Werror=unused-command-line-argument
1028390b17f1bSmrg#
1028490b17f1bSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
1028590b17f1bSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1028690b17f1bSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1028790b17f1bSmrg
1028890b17f1bSmrgAC_LANG_COMPILER_REQUIRE
1028990b17f1bSmrg
1029090b17f1bSmrgAC_LANG_CASE(
1029190b17f1bSmrg	[C], [
1029290b17f1bSmrg		AC_REQUIRE([AC_PROG_CC_C99])
1029390b17f1bSmrg		define([PREFIX], [C])
1029490b17f1bSmrg		define([CACHE_PREFIX], [cc])
1029590b17f1bSmrg		define([COMPILER], [$CC])
1029690b17f1bSmrg	],
1029790b17f1bSmrg	[C++], [
1029890b17f1bSmrg		define([PREFIX], [CXX])
1029990b17f1bSmrg		define([CACHE_PREFIX], [cxx])
1030090b17f1bSmrg		define([COMPILER], [$CXX])
1030190b17f1bSmrg	]
1030290b17f1bSmrg)
103037e6fb56fSmrg
1030490b17f1bSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
1030590b17f1bSmrg
1030690b17f1bSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
1030790b17f1bSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1030890b17f1bSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
1030990b17f1bSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
1031090b17f1bSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1031190b17f1bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
1031290b17f1bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
1031390b17f1bSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
1031490b17f1bSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1031590b17f1bSmrgfi
103167e6fb56fSmrg
1031790b17f1bSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
1031890b17f1bSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
1031990b17f1bSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1032090b17f1bSmrg	fi
1032190b17f1bSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1032290b17f1bSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
1032390b17f1bSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
1032490b17f1bSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1032590b17f1bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
1032690b17f1bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
1032790b17f1bSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
1032890b17f1bSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1032990b17f1bSmrgfi
103307e6fb56fSmrg
1033190b17f1bSmrgfound="no"
1033290b17f1bSmrgm4_foreach([flag], m4_cdr($@), [
1033390b17f1bSmrg	if test $found = "no" ; then
10334983b4bf2Smrg		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
1033590b17f1bSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1033690b17f1bSmrg		fi
1033790b17f1bSmrg
10338983b4bf2Smrg		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
1033990b17f1bSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1034090b17f1bSmrg		fi
1034190b17f1bSmrg
1034290b17f1bSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
1034390b17f1bSmrg
1034490b17f1bSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
10345983b4bf2Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports]flag[])
1034690b17f1bSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
1034790b17f1bSmrg		AC_CACHE_VAL($cacheid,
1034890b17f1bSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
1034990b17f1bSmrg					     [eval $cacheid=yes],
1035090b17f1bSmrg					     [eval $cacheid=no])])
1035190b17f1bSmrg
1035290b17f1bSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1035390b17f1bSmrg
1035490b17f1bSmrg		eval supported=\$$cacheid
1035590b17f1bSmrg		AC_MSG_RESULT([$supported])
1035690b17f1bSmrg		if test "$supported" = "yes" ; then
1035790b17f1bSmrg			$1="$$1 ]flag["
1035890b17f1bSmrg			found="yes"
1035990b17f1bSmrg		fi
1036090b17f1bSmrg	fi
1036190b17f1bSmrg])
1036290b17f1bSmrg]) # XORG_TESTSET_CFLAG
103637e6fb56fSmrg
1036490b17f1bSmrg# XORG_COMPILER_FLAGS
1036590b17f1bSmrg# ---------------
1036690b17f1bSmrg# Minimum version: 1.16.0
1036790b17f1bSmrg#
1036890b17f1bSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
1036990b17f1bSmrg# arguments supported by the selected compiler which do NOT alter the generated
1037090b17f1bSmrg# code.  These arguments will cause the compiler to print various warnings
1037190b17f1bSmrg# during compilation AND turn a conservative set of warnings into errors.
1037290b17f1bSmrg#
1037390b17f1bSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
1037490b17f1bSmrg# future versions of util-macros as options are added to new compilers.
1037590b17f1bSmrg#
1037690b17f1bSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
1037790b17f1bSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1037890b17f1bSmrg
1037990b17f1bSmrgAC_ARG_ENABLE(selective-werror,
1038090b17f1bSmrg              AS_HELP_STRING([--disable-selective-werror],
1038190b17f1bSmrg                             [Turn off selective compiler errors. (default: enabled)]),
1038290b17f1bSmrg              [SELECTIVE_WERROR=$enableval],
1038390b17f1bSmrg              [SELECTIVE_WERROR=yes])
1038490b17f1bSmrg
1038590b17f1bSmrgAC_LANG_CASE(
1038690b17f1bSmrg        [C], [
1038790b17f1bSmrg                define([PREFIX], [C])
1038890b17f1bSmrg        ],
1038990b17f1bSmrg        [C++], [
1039090b17f1bSmrg                define([PREFIX], [CXX])
1039190b17f1bSmrg        ]
1039290b17f1bSmrg)
1039390b17f1bSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
1039490b17f1bSmrgif test "x$SUNCC" = "xyes"; then
1039590b17f1bSmrg    [BASE_]PREFIX[FLAGS]="-v"
1039690b17f1bSmrgelse
1039790b17f1bSmrg    [BASE_]PREFIX[FLAGS]=""
1039890b17f1bSmrgfi
103997e6fb56fSmrg
1040090b17f1bSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
1040190b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
1040290b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
1040390b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
1040490b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
1040590b17f1bSmrg
1040690b17f1bSmrgAC_LANG_CASE(
1040790b17f1bSmrg	[C], [
1040890b17f1bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
1040990b17f1bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
1041090b17f1bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
1041190b17f1bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
10412983b4bf2Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
1041390b17f1bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
1041490b17f1bSmrg	]
1041590b17f1bSmrg)
104167e6fb56fSmrg
1041790b17f1bSmrg# This chunk adds additional warnings that could catch undesired effects.
1041890b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
1041990b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
1042090b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
10421983b4bf2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
1042290b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
1042390b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
1042490b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
1042590b17f1bSmrg
1042690b17f1bSmrg# These are currently disabled because they are noisy.  They will be enabled
1042790b17f1bSmrg# in the future once the codebase is sufficiently modernized to silence
1042890b17f1bSmrg# them.  For now, I don't want them to drown out the other warnings.
10429983b4bf2Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
1043090b17f1bSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
1043190b17f1bSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
1043290b17f1bSmrg
1043390b17f1bSmrg# Turn some warnings into errors, so we don't accidently get successful builds
1043490b17f1bSmrg# when there are problems that should be fixed.
1043590b17f1bSmrg
1043690b17f1bSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
1043790b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
1043890b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
1043990b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
1044090b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
1044190b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
1044290b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
1044390b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
1044490b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
1044590b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
1044690b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
1044790b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
1044890b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
1044990b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
104507e6fb56fSmrgelse
1045190b17f1bSmrgAC_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])
1045290b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
1045390b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
1045490b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
1045590b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
1045690b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
1045790b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
1045890b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
1045990b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
1046090b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
1046190b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
1046290b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
1046390b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
1046490b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
1046590b17f1bSmrgfi
1046690b17f1bSmrg
1046790b17f1bSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1046890b17f1bSmrg]) # XORG_COMPILER_FLAGS
1046990b17f1bSmrg
1047090b17f1bSmrg# XORG_CWARNFLAGS
1047190b17f1bSmrg# ---------------
1047290b17f1bSmrg# Minimum version: 1.2.0
1047390b17f1bSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
1047490b17f1bSmrg#
1047590b17f1bSmrg# Defines CWARNFLAGS to enable C compiler warnings.
1047690b17f1bSmrg#
1047790b17f1bSmrg# This function is deprecated because it defines -fno-strict-aliasing
1047890b17f1bSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
1047990b17f1bSmrg# is needed, then it should be added explicitly in the module when
1048090b17f1bSmrg# it is updated to use BASE_CFLAGS.
1048190b17f1bSmrg#
1048290b17f1bSmrgAC_DEFUN([XORG_CWARNFLAGS], [
1048390b17f1bSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1048490b17f1bSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1048590b17f1bSmrgAC_LANG_CASE(
1048690b17f1bSmrg	[C], [
1048790b17f1bSmrg		CWARNFLAGS="$BASE_CFLAGS"
1048890b17f1bSmrg		if  test "x$GCC" = xyes ; then
1048990b17f1bSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
1049090b17f1bSmrg		fi
1049190b17f1bSmrg		AC_SUBST(CWARNFLAGS)
1049290b17f1bSmrg	]
1049390b17f1bSmrg)
1049490b17f1bSmrg]) # XORG_CWARNFLAGS
1049590b17f1bSmrg
1049690b17f1bSmrg# XORG_STRICT_OPTION
1049790b17f1bSmrg# -----------------------
1049890b17f1bSmrg# Minimum version: 1.3.0
1049990b17f1bSmrg#
1050090b17f1bSmrg# Add configure option to enable strict compilation flags, such as treating
1050190b17f1bSmrg# warnings as fatal errors.
1050290b17f1bSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
1050390b17f1bSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
1050490b17f1bSmrg#
1050590b17f1bSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
1050690b17f1bSmrg# when strict compilation is unconditionally desired.
1050790b17f1bSmrgAC_DEFUN([XORG_STRICT_OPTION], [
1050890b17f1bSmrgAC_REQUIRE([XORG_CWARNFLAGS])
1050990b17f1bSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1051090b17f1bSmrg
1051190b17f1bSmrgAC_ARG_ENABLE(strict-compilation,
1051290b17f1bSmrg			  AS_HELP_STRING([--enable-strict-compilation],
1051390b17f1bSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1051490b17f1bSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1051590b17f1bSmrg
1051690b17f1bSmrgAC_LANG_CASE(
1051790b17f1bSmrg        [C], [
1051890b17f1bSmrg                define([PREFIX], [C])
1051990b17f1bSmrg        ],
1052090b17f1bSmrg        [C++], [
1052190b17f1bSmrg                define([PREFIX], [CXX])
1052290b17f1bSmrg        ]
1052390b17f1bSmrg)
1052490b17f1bSmrg
1052590b17f1bSmrg[STRICT_]PREFIX[FLAGS]=""
1052690b17f1bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
1052790b17f1bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
1052890b17f1bSmrg
1052990b17f1bSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
1053090b17f1bSmrg# activate it with -Werror, so we add it here explicitly.
1053190b17f1bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
1053290b17f1bSmrg
1053390b17f1bSmrgif test "x$STRICT_COMPILE" = "xyes"; then
1053490b17f1bSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
1053590b17f1bSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
1053690b17f1bSmrgfi
1053790b17f1bSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
1053890b17f1bSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1053990b17f1bSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
1054090b17f1bSmrg]) # XORG_STRICT_OPTION
1054190b17f1bSmrg
1054290b17f1bSmrg# XORG_DEFAULT_OPTIONS
1054390b17f1bSmrg# --------------------
1054490b17f1bSmrg# Minimum version: 1.3.0
1054590b17f1bSmrg#
1054690b17f1bSmrg# Defines default options for X.Org modules.
1054790b17f1bSmrg#
1054890b17f1bSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1054990b17f1bSmrgAC_REQUIRE([AC_PROG_INSTALL])
1055090b17f1bSmrgXORG_COMPILER_FLAGS
1055190b17f1bSmrgXORG_CWARNFLAGS
1055290b17f1bSmrgXORG_STRICT_OPTION
1055390b17f1bSmrgXORG_RELEASE_VERSION
1055490b17f1bSmrgXORG_CHANGELOG
1055590b17f1bSmrgXORG_INSTALL
1055690b17f1bSmrgXORG_MANPAGE_SECTIONS
1055790b17f1bSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1055890b17f1bSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1055990b17f1bSmrg]) # XORG_DEFAULT_OPTIONS
1056090b17f1bSmrg
1056190b17f1bSmrg# XORG_INSTALL()
1056290b17f1bSmrg# ----------------
1056390b17f1bSmrg# Minimum version: 1.4.0
1056490b17f1bSmrg#
1056590b17f1bSmrg# Defines the variable INSTALL_CMD as the command to copy
1056690b17f1bSmrg# INSTALL from $prefix/share/util-macros.
1056790b17f1bSmrg#
1056890b17f1bSmrgAC_DEFUN([XORG_INSTALL], [
1056990b17f1bSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1057090b17f1bSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1057190b17f1bSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1057290b17f1bSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1057390b17f1bSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1057490b17f1bSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1057590b17f1bSmrgAC_SUBST([INSTALL_CMD])
1057690b17f1bSmrg]) # XORG_INSTALL
1057790b17f1bSmrgdnl Copyright 2005 Red Hat, Inc
1057890b17f1bSmrgdnl
1057990b17f1bSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1058090b17f1bSmrgdnl documentation for any purpose is hereby granted without fee, provided that
1058190b17f1bSmrgdnl the above copyright notice appear in all copies and that both that
1058290b17f1bSmrgdnl copyright notice and this permission notice appear in supporting
1058390b17f1bSmrgdnl documentation.
1058490b17f1bSmrgdnl
1058590b17f1bSmrgdnl The above copyright notice and this permission notice shall be included
1058690b17f1bSmrgdnl in all copies or substantial portions of the Software.
1058790b17f1bSmrgdnl
1058890b17f1bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1058990b17f1bSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1059090b17f1bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1059190b17f1bSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1059290b17f1bSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1059390b17f1bSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1059490b17f1bSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
1059590b17f1bSmrgdnl
1059690b17f1bSmrgdnl Except as contained in this notice, the name of the copyright holders shall
1059790b17f1bSmrgdnl not be used in advertising or otherwise to promote the sale, use or
1059890b17f1bSmrgdnl other dealings in this Software without prior written authorization
1059990b17f1bSmrgdnl from the copyright holders.
1060090b17f1bSmrgdnl
1060190b17f1bSmrg
1060290b17f1bSmrg# XORG_RELEASE_VERSION
1060390b17f1bSmrg# --------------------
1060490b17f1bSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
10605983b4bf2Smrg 
1060690b17f1bSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1060790b17f1bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1060890b17f1bSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1060990b17f1bSmrg		[Major version of this package])
1061090b17f1bSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1061190b17f1bSmrg	if test "x$PVM" = "x"; then
1061290b17f1bSmrg		PVM="0"
1061390b17f1bSmrg	fi
1061490b17f1bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1061590b17f1bSmrg		[$PVM],
1061690b17f1bSmrg		[Minor version of this package])
1061790b17f1bSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1061890b17f1bSmrg	if test "x$PVP" = "x"; then
1061990b17f1bSmrg		PVP="0"
1062090b17f1bSmrg	fi
1062190b17f1bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1062290b17f1bSmrg		[$PVP],
1062390b17f1bSmrg		[Patch version of this package])
1062490b17f1bSmrg])
106257e6fb56fSmrg
1062690b17f1bSmrg# XORG_CHANGELOG()
1062790b17f1bSmrg# ----------------
1062890b17f1bSmrg# Minimum version: 1.2.0
1062990b17f1bSmrg#
1063090b17f1bSmrg# Defines the variable CHANGELOG_CMD as the command to generate
1063190b17f1bSmrg# ChangeLog from git.
1063290b17f1bSmrg#
1063390b17f1bSmrg#
1063490b17f1bSmrgAC_DEFUN([XORG_CHANGELOG], [
1063590b17f1bSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1063690b17f1bSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1063790b17f1bSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1063890b17f1bSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1063990b17f1bSmrgAC_SUBST([CHANGELOG_CMD])
1064090b17f1bSmrg]) # XORG_CHANGELOG
1064190b17f1bSmrg
10642983b4bf2Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
10643983b4bf2Smrg# Foundation, Inc.
106447e6fb56fSmrg#
106457e6fb56fSmrg# This file is free software; the Free Software Foundation
106467e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
106477e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
106487e6fb56fSmrg
10649983b4bf2Smrg# serial 1
10650983b4bf2Smrg
106517e6fb56fSmrg# AM_AUTOMAKE_VERSION(VERSION)
106527e6fb56fSmrg# ----------------------------
106537e6fb56fSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
106547e6fb56fSmrg# generated from the m4 files accompanying Automake X.Y.
106557e6fb56fSmrg# (This private macro should not be called outside this file.)
106567e6fb56fSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
10657983b4bf2Smrg[am__api_version='1.11'
106587e6fb56fSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
106597e6fb56fSmrgdnl require some minimum version.  Point them to the right macro.
10660983b4bf2Smrgm4_if([$1], [1.11.3], [],
106617e6fb56fSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
106627e6fb56fSmrg])
106637e6fb56fSmrg
106647e6fb56fSmrg# _AM_AUTOCONF_VERSION(VERSION)
106657e6fb56fSmrg# -----------------------------
106667e6fb56fSmrg# aclocal traces this macro to find the Autoconf version.
106677e6fb56fSmrg# This is a private macro too.  Using m4_define simplifies
106687e6fb56fSmrg# the logic in aclocal, which can simply ignore this definition.
106697e6fb56fSmrgm4_define([_AM_AUTOCONF_VERSION], [])
106707e6fb56fSmrg
106717e6fb56fSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
106727e6fb56fSmrg# -------------------------------
106737e6fb56fSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
106747e6fb56fSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
106757e6fb56fSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
10676983b4bf2Smrg[AM_AUTOMAKE_VERSION([1.11.3])dnl
106777e6fb56fSmrgm4_ifndef([AC_AUTOCONF_VERSION],
106787e6fb56fSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
106797e6fb56fSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
106807e6fb56fSmrg
106817e6fb56fSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
106827e6fb56fSmrg
10683983b4bf2Smrg# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
106847e6fb56fSmrg#
106857e6fb56fSmrg# This file is free software; the Free Software Foundation
106867e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
106877e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
106887e6fb56fSmrg
10689983b4bf2Smrg# serial 1
10690983b4bf2Smrg
106917e6fb56fSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
10692983b4bf2Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
10693983b4bf2Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
106947e6fb56fSmrg#
106957e6fb56fSmrg# Of course, Automake must honor this variable whenever it calls a
106967e6fb56fSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
106977e6fb56fSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
106987e6fb56fSmrg# depending on how configure is run.  This is pretty annoying, since
106997e6fb56fSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
107007e6fb56fSmrg# source directory, any form will work fine, but in subdirectories a
107017e6fb56fSmrg# relative path needs to be adjusted first.
107027e6fb56fSmrg#
107037e6fb56fSmrg# $ac_aux_dir/missing
107047e6fb56fSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
107057e6fb56fSmrg# $top_srcdir/$ac_aux_dir/missing
107067e6fb56fSmrg#    fails if $ac_aux_dir is absolute,
107077e6fb56fSmrg#    fails when called from a subdirectory in a VPATH build with
107087e6fb56fSmrg#          a relative $ac_aux_dir
107097e6fb56fSmrg#
107107e6fb56fSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
107117e6fb56fSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
10712983b4bf2Smrg# harmless because $srcdir is `.', but things will broke when you
107137e6fb56fSmrg# start a VPATH build or use an absolute $srcdir.
107147e6fb56fSmrg#
107157e6fb56fSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
107167e6fb56fSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
107177e6fb56fSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
107187e6fb56fSmrg# and then we would define $MISSING as
107197e6fb56fSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
107207e6fb56fSmrg# This will work as long as MISSING is not called from configure, because
107217e6fb56fSmrg# unfortunately $(top_srcdir) has no meaning in configure.
107227e6fb56fSmrg# However there are other variables, like CC, which are often used in
107237e6fb56fSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
107247e6fb56fSmrg#
107257e6fb56fSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
107267e6fb56fSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
107277e6fb56fSmrg# configured tree to be moved without reconfiguration.
107287e6fb56fSmrg
107297e6fb56fSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10730983b4bf2Smrg[dnl Rely on autoconf to set up CDPATH properly.
10731983b4bf2SmrgAC_PREREQ([2.50])dnl
10732983b4bf2Smrg# expand $ac_aux_dir to an absolute path
10733983b4bf2Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
107347e6fb56fSmrg])
107357e6fb56fSmrg
107367e6fb56fSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
107377e6fb56fSmrg
10738983b4bf2Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
10739983b4bf2Smrg# Free Software Foundation, Inc.
107407e6fb56fSmrg#
107417e6fb56fSmrg# This file is free software; the Free Software Foundation
107427e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
107437e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
107447e6fb56fSmrg
10745983b4bf2Smrg# serial 9
10746983b4bf2Smrg
107477e6fb56fSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
107487e6fb56fSmrg# -------------------------------------
107497e6fb56fSmrg# Define a conditional.
107507e6fb56fSmrgAC_DEFUN([AM_CONDITIONAL],
10751983b4bf2Smrg[AC_PREREQ(2.52)dnl
10752983b4bf2Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
10753983b4bf2Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
107547e6fb56fSmrgAC_SUBST([$1_TRUE])dnl
107557e6fb56fSmrgAC_SUBST([$1_FALSE])dnl
107567e6fb56fSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
107577e6fb56fSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
107587e6fb56fSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
107597e6fb56fSmrgif $2; then
107607e6fb56fSmrg  $1_TRUE=
107617e6fb56fSmrg  $1_FALSE='#'
107627e6fb56fSmrgelse
107637e6fb56fSmrg  $1_TRUE='#'
107647e6fb56fSmrg  $1_FALSE=
107657e6fb56fSmrgfi
107667e6fb56fSmrgAC_CONFIG_COMMANDS_PRE(
107677e6fb56fSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
107687e6fb56fSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
107697e6fb56fSmrgUsually this means the macro was only invoked conditionally.]])
107707e6fb56fSmrgfi])])
107717e6fb56fSmrg
10772983b4bf2Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
10773983b4bf2Smrg# 2010, 2011 Free Software Foundation, Inc.
107747e6fb56fSmrg#
107757e6fb56fSmrg# This file is free software; the Free Software Foundation
107767e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
107777e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
107787e6fb56fSmrg
10779983b4bf2Smrg# serial 12
107807e6fb56fSmrg
10781983b4bf2Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
107827e6fb56fSmrg# written in clear, in which case automake, when reading aclocal.m4,
107837e6fb56fSmrg# will think it sees a *use*, and therefore will trigger all it's
107847e6fb56fSmrg# C support machinery.  Also note that it means that autoscan, seeing
107857e6fb56fSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
107867e6fb56fSmrg
107877e6fb56fSmrg
107887e6fb56fSmrg# _AM_DEPENDENCIES(NAME)
107897e6fb56fSmrg# ----------------------
107907e6fb56fSmrg# See how the compiler implements dependency checking.
10791983b4bf2Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
107927e6fb56fSmrg# We try a few techniques and use that to set a single cache variable.
107937e6fb56fSmrg#
107947e6fb56fSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
107957e6fb56fSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
107967e6fb56fSmrg# dependency, and given that the user is not expected to run this macro,
107977e6fb56fSmrg# just rely on AC_PROG_CC.
107987e6fb56fSmrgAC_DEFUN([_AM_DEPENDENCIES],
107997e6fb56fSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
108007e6fb56fSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
108017e6fb56fSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
108027e6fb56fSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
108037e6fb56fSmrg
10804983b4bf2Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
10805983b4bf2Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
10806983b4bf2Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
10807983b4bf2Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
10808983b4bf2Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
10809983b4bf2Smrg                   [depcc="$$1"   am_compiler_list=])
108107e6fb56fSmrg
108117e6fb56fSmrgAC_CACHE_CHECK([dependency style of $depcc],
108127e6fb56fSmrg               [am_cv_$1_dependencies_compiler_type],
108137e6fb56fSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
108147e6fb56fSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
108157e6fb56fSmrg  # making bogus files that we don't know about and never remove.  For
108167e6fb56fSmrg  # instance it was reported that on HP-UX the gcc test will end up
10817983b4bf2Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
10818983b4bf2Smrg  # in D'.
1081990b17f1bSmrg  rm -rf conftest.dir
108207e6fb56fSmrg  mkdir conftest.dir
108217e6fb56fSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
108227e6fb56fSmrg  # using a relative directory.
108237e6fb56fSmrg  cp "$am_depcomp" conftest.dir
108247e6fb56fSmrg  cd conftest.dir
108257e6fb56fSmrg  # We will build objects and dependencies in a subdirectory because
108267e6fb56fSmrg  # it helps to detect inapplicable dependency modes.  For instance
108277e6fb56fSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
108287e6fb56fSmrg  # side effect of compilation, but ICC will put the dependencies in
108297e6fb56fSmrg  # the current directory while Tru64 will put them in the object
108307e6fb56fSmrg  # directory.
108317e6fb56fSmrg  mkdir sub
108327e6fb56fSmrg
108337e6fb56fSmrg  am_cv_$1_dependencies_compiler_type=none
108347e6fb56fSmrg  if test "$am_compiler_list" = ""; then
108357e6fb56fSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
108367e6fb56fSmrg  fi
108377e6fb56fSmrg  am__universal=false
108387e6fb56fSmrg  m4_case([$1], [CC],
108397e6fb56fSmrg    [case " $depcc " in #(
108407e6fb56fSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
108417e6fb56fSmrg     esac],
108427e6fb56fSmrg    [CXX],
108437e6fb56fSmrg    [case " $depcc " in #(
108447e6fb56fSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
108457e6fb56fSmrg     esac])
108467e6fb56fSmrg
108477e6fb56fSmrg  for depmode in $am_compiler_list; do
108487e6fb56fSmrg    # Setup a source with many dependencies, because some compilers
108497e6fb56fSmrg    # like to wrap large dependency lists on column 80 (with \), and
108507e6fb56fSmrg    # we should not choose a depcomp mode which is confused by this.
108517e6fb56fSmrg    #
108527e6fb56fSmrg    # We need to recreate these files for each test, as the compiler may
108537e6fb56fSmrg    # overwrite some of them when testing with obscure command lines.
108547e6fb56fSmrg    # This happens at least with the AIX C compiler.
108557e6fb56fSmrg    : > sub/conftest.c
108567e6fb56fSmrg    for i in 1 2 3 4 5 6; do
108577e6fb56fSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
10858983b4bf2Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
10859983b4bf2Smrg      # Solaris 8's {/usr,}/bin/sh.
10860983b4bf2Smrg      touch sub/conftst$i.h
108617e6fb56fSmrg    done
108627e6fb56fSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
108637e6fb56fSmrg
10864983b4bf2Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
108657e6fb56fSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
10866983b4bf2Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
10867983b4bf2Smrg    # versions had trouble with output in subdirs
108687e6fb56fSmrg    am__obj=sub/conftest.${OBJEXT-o}
108697e6fb56fSmrg    am__minus_obj="-o $am__obj"
108707e6fb56fSmrg    case $depmode in
108717e6fb56fSmrg    gcc)
108727e6fb56fSmrg      # This depmode causes a compiler race in universal mode.
108737e6fb56fSmrg      test "$am__universal" = false || continue
108747e6fb56fSmrg      ;;
108757e6fb56fSmrg    nosideeffect)
10876983b4bf2Smrg      # after this tag, mechanisms are not by side-effect, so they'll
10877983b4bf2Smrg      # only be used when explicitly requested
108787e6fb56fSmrg      if test "x$enable_dependency_tracking" = xyes; then
108797e6fb56fSmrg	continue
108807e6fb56fSmrg      else
108817e6fb56fSmrg	break
108827e6fb56fSmrg      fi
108837e6fb56fSmrg      ;;
1088490b17f1bSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
10885983b4bf2Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
108867e6fb56fSmrg      # not run yet.  These depmodes are late enough in the game, and
108877e6fb56fSmrg      # so weak that their functioning should not be impacted.
108887e6fb56fSmrg      am__obj=conftest.${OBJEXT-o}
108897e6fb56fSmrg      am__minus_obj=
108907e6fb56fSmrg      ;;
108917e6fb56fSmrg    none) break ;;
108927e6fb56fSmrg    esac
108937e6fb56fSmrg    if depmode=$depmode \
108947e6fb56fSmrg       source=sub/conftest.c object=$am__obj \
108957e6fb56fSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
108967e6fb56fSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
108977e6fb56fSmrg         >/dev/null 2>conftest.err &&
108987e6fb56fSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
108997e6fb56fSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
109007e6fb56fSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
109017e6fb56fSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
109027e6fb56fSmrg      # icc doesn't choke on unknown options, it will just issue warnings
109037e6fb56fSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
109047e6fb56fSmrg      # that says an option was ignored or not supported.
109057e6fb56fSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
109067e6fb56fSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
109077e6fb56fSmrg      # The diagnosis changed in icc 8.0:
109087e6fb56fSmrg      #   icc: Command line remark: option '-MP' not supported
109097e6fb56fSmrg      if (grep 'ignoring option' conftest.err ||
109107e6fb56fSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
109117e6fb56fSmrg        am_cv_$1_dependencies_compiler_type=$depmode
109127e6fb56fSmrg        break
109137e6fb56fSmrg      fi
109147e6fb56fSmrg    fi
109157e6fb56fSmrg  done
109167e6fb56fSmrg
109177e6fb56fSmrg  cd ..
109187e6fb56fSmrg  rm -rf conftest.dir
109197e6fb56fSmrgelse
109207e6fb56fSmrg  am_cv_$1_dependencies_compiler_type=none
109217e6fb56fSmrgfi
109227e6fb56fSmrg])
109237e6fb56fSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
109247e6fb56fSmrgAM_CONDITIONAL([am__fastdep$1], [
109257e6fb56fSmrg  test "x$enable_dependency_tracking" != xno \
109267e6fb56fSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
109277e6fb56fSmrg])
109287e6fb56fSmrg
109297e6fb56fSmrg
109307e6fb56fSmrg# AM_SET_DEPDIR
109317e6fb56fSmrg# -------------
109327e6fb56fSmrg# Choose a directory name for dependency files.
10933983b4bf2Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
109347e6fb56fSmrgAC_DEFUN([AM_SET_DEPDIR],
109357e6fb56fSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
109367e6fb56fSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
109377e6fb56fSmrg])
109387e6fb56fSmrg
109397e6fb56fSmrg
109407e6fb56fSmrg# AM_DEP_TRACK
109417e6fb56fSmrg# ------------
109427e6fb56fSmrgAC_DEFUN([AM_DEP_TRACK],
10943983b4bf2Smrg[AC_ARG_ENABLE(dependency-tracking,
10944983b4bf2Smrg[  --disable-dependency-tracking  speeds up one-time build
10945983b4bf2Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
109467e6fb56fSmrgif test "x$enable_dependency_tracking" != xno; then
109477e6fb56fSmrg  am_depcomp="$ac_aux_dir/depcomp"
109487e6fb56fSmrg  AMDEPBACKSLASH='\'
1094990b17f1bSmrg  am__nodep='_no'
109507e6fb56fSmrgfi
109517e6fb56fSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
109527e6fb56fSmrgAC_SUBST([AMDEPBACKSLASH])dnl
109537e6fb56fSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1095490b17f1bSmrgAC_SUBST([am__nodep])dnl
1095590b17f1bSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
109567e6fb56fSmrg])
109577e6fb56fSmrg
109587e6fb56fSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
109597e6fb56fSmrg
10960983b4bf2Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
10961983b4bf2Smrg# Free Software Foundation, Inc.
109627e6fb56fSmrg#
109637e6fb56fSmrg# This file is free software; the Free Software Foundation
109647e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
109657e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
109667e6fb56fSmrg
10967983b4bf2Smrg#serial 5
109687e6fb56fSmrg
109697e6fb56fSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
109707e6fb56fSmrg# ------------------------------
109717e6fb56fSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
109727e6fb56fSmrg[{
10973983b4bf2Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
109747e6fb56fSmrg  # are listed without --file.  Let's play safe and only enable the eval
109757e6fb56fSmrg  # if we detect the quoting.
109767e6fb56fSmrg  case $CONFIG_FILES in
109777e6fb56fSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
109787e6fb56fSmrg  *)   set x $CONFIG_FILES ;;
109797e6fb56fSmrg  esac
109807e6fb56fSmrg  shift
109817e6fb56fSmrg  for mf
109827e6fb56fSmrg  do
109837e6fb56fSmrg    # Strip MF so we end up with the name of the file.
109847e6fb56fSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
109857e6fb56fSmrg    # Check whether this is an Automake generated Makefile or not.
10986983b4bf2Smrg    # We used to match only the files named `Makefile.in', but
109877e6fb56fSmrg    # some people rename them; so instead we look at the file content.
109887e6fb56fSmrg    # Grep'ing the first line is not enough: some people post-process
109897e6fb56fSmrg    # each Makefile.in and add a new line on top of each file to say so.
109907e6fb56fSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
109917e6fb56fSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
109927e6fb56fSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
109937e6fb56fSmrg      dirpart=`AS_DIRNAME("$mf")`
109947e6fb56fSmrg    else
109957e6fb56fSmrg      continue
109967e6fb56fSmrg    fi
109977e6fb56fSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
10998983b4bf2Smrg    # from the Makefile without running `make'.
109997e6fb56fSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
110007e6fb56fSmrg    test -z "$DEPDIR" && continue
110017e6fb56fSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
11002983b4bf2Smrg    test -z "am__include" && continue
110037e6fb56fSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
11004983b4bf2Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
11005983b4bf2Smrg    U=`sed -n 's/^U = //p' < "$mf"`
110067e6fb56fSmrg    # Find all dependency output files, they are included files with
110077e6fb56fSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
110087e6fb56fSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
110097e6fb56fSmrg    # expansion.
110107e6fb56fSmrg    for file in `sed -n "
110117e6fb56fSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
11012983b4bf2Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
110137e6fb56fSmrg      # Make sure the directory exists.
110147e6fb56fSmrg      test -f "$dirpart/$file" && continue
110157e6fb56fSmrg      fdir=`AS_DIRNAME(["$file"])`
110167e6fb56fSmrg      AS_MKDIR_P([$dirpart/$fdir])
110177e6fb56fSmrg      # echo "creating $dirpart/$file"
110187e6fb56fSmrg      echo '# dummy' > "$dirpart/$file"
110197e6fb56fSmrg    done
110207e6fb56fSmrg  done
110217e6fb56fSmrg}
110227e6fb56fSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
110237e6fb56fSmrg
110247e6fb56fSmrg
110257e6fb56fSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
110267e6fb56fSmrg# -----------------------------
110277e6fb56fSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
110287e6fb56fSmrg#
110297e6fb56fSmrg# This code is only required when automatic dependency tracking
11030983b4bf2Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
110317e6fb56fSmrg# need in order to bootstrap the dependency handling code.
110327e6fb56fSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
110337e6fb56fSmrg[AC_CONFIG_COMMANDS([depfiles],
110347e6fb56fSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
110357e6fb56fSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
110367e6fb56fSmrg])
110377e6fb56fSmrg
110387e6fb56fSmrg# Do all the work for Automake.                             -*- Autoconf -*-
110397e6fb56fSmrg
11040983b4bf2Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
11041983b4bf2Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
110427e6fb56fSmrg#
110437e6fb56fSmrg# This file is free software; the Free Software Foundation
110447e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
110457e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
110467e6fb56fSmrg
11047983b4bf2Smrg# serial 16
11048983b4bf2Smrg
110497e6fb56fSmrg# This macro actually does too much.  Some checks are only needed if
110507e6fb56fSmrg# your package does certain things.  But this isn't really a big deal.
110517e6fb56fSmrg
110527e6fb56fSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
110537e6fb56fSmrg# AM_INIT_AUTOMAKE([OPTIONS])
110547e6fb56fSmrg# -----------------------------------------------
110557e6fb56fSmrg# The call with PACKAGE and VERSION arguments is the old style
110567e6fb56fSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
110577e6fb56fSmrg# and VERSION should now be passed to AC_INIT and removed from
110587e6fb56fSmrg# the call to AM_INIT_AUTOMAKE.
110597e6fb56fSmrg# We support both call styles for the transition.  After
110607e6fb56fSmrg# the next Automake release, Autoconf can make the AC_INIT
110617e6fb56fSmrg# arguments mandatory, and then we can depend on a new Autoconf
110627e6fb56fSmrg# release and drop the old call support.
110637e6fb56fSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
11064983b4bf2Smrg[AC_PREREQ([2.62])dnl
110657e6fb56fSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
110667e6fb56fSmrgdnl the ones we care about.
110677e6fb56fSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
110687e6fb56fSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
110697e6fb56fSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
110707e6fb56fSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
110717e6fb56fSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
110727e6fb56fSmrg  # is not polluted with repeated "-I."
110737e6fb56fSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
110747e6fb56fSmrg  # test to see if srcdir already configured
110757e6fb56fSmrg  if test -f $srcdir/config.status; then
110767e6fb56fSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
110777e6fb56fSmrg  fi
110787e6fb56fSmrgfi
110797e6fb56fSmrg
110807e6fb56fSmrg# test whether we have cygpath
110817e6fb56fSmrgif test -z "$CYGPATH_W"; then
110827e6fb56fSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
110837e6fb56fSmrg    CYGPATH_W='cygpath -w'
110847e6fb56fSmrg  else
110857e6fb56fSmrg    CYGPATH_W=echo
110867e6fb56fSmrg  fi
110877e6fb56fSmrgfi
110887e6fb56fSmrgAC_SUBST([CYGPATH_W])
110897e6fb56fSmrg
110907e6fb56fSmrg# Define the identity of the package.
110917e6fb56fSmrgdnl Distinguish between old-style and new-style calls.
110927e6fb56fSmrgm4_ifval([$2],
11093983b4bf2Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
110947e6fb56fSmrg AC_SUBST([PACKAGE], [$1])dnl
110957e6fb56fSmrg AC_SUBST([VERSION], [$2])],
110967e6fb56fSmrg[_AM_SET_OPTIONS([$1])dnl
110977e6fb56fSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
11098983b4bf2Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
110997e6fb56fSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
111007e6fb56fSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
111017e6fb56fSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
111027e6fb56fSmrg
111037e6fb56fSmrg_AM_IF_OPTION([no-define],,
11104983b4bf2Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
11105983b4bf2Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
111067e6fb56fSmrg
111077e6fb56fSmrg# Some tools Automake needs.
111087e6fb56fSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
111097e6fb56fSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
11110983b4bf2SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
11111983b4bf2SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
11112983b4bf2SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
11113983b4bf2SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
11114983b4bf2SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
111157e6fb56fSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
111167e6fb56fSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
11117983b4bf2SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
11118983b4bf2Smrg# We need awk for the "check" target.  The system "awk" is bad on
11119983b4bf2Smrg# some platforms.
111207e6fb56fSmrgAC_REQUIRE([AC_PROG_AWK])dnl
111217e6fb56fSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
111227e6fb56fSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
111237e6fb56fSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
111247e6fb56fSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
111257e6fb56fSmrg			     [_AM_PROG_TAR([v7])])])
111267e6fb56fSmrg_AM_IF_OPTION([no-dependencies],,
111277e6fb56fSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
11128983b4bf2Smrg		  [_AM_DEPENDENCIES(CC)],
11129983b4bf2Smrg		  [define([AC_PROG_CC],
11130983b4bf2Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
111317e6fb56fSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
11132983b4bf2Smrg		  [_AM_DEPENDENCIES(CXX)],
11133983b4bf2Smrg		  [define([AC_PROG_CXX],
11134983b4bf2Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
111357e6fb56fSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
11136983b4bf2Smrg		  [_AM_DEPENDENCIES(OBJC)],
11137983b4bf2Smrg		  [define([AC_PROG_OBJC],
11138983b4bf2Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
111397e6fb56fSmrg])
11140983b4bf2Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
11141983b4bf2Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
11142983b4bf2Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
11143983b4bf2Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
111447e6fb56fSmrgAC_CONFIG_COMMANDS_PRE(dnl
111457e6fb56fSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
111467e6fb56fSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
111477e6fb56fSmrg])
111487e6fb56fSmrg
11149983b4bf2Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
111507e6fb56fSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
111517e6fb56fSmrgdnl mangled by Autoconf and run in a shell conditional statement.
111527e6fb56fSmrgm4_define([_AC_COMPILER_EXEEXT],
111537e6fb56fSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
111547e6fb56fSmrg
11155983b4bf2Smrg
111567e6fb56fSmrg# When config.status generates a header, we must update the stamp-h file.
111577e6fb56fSmrg# This file resides in the same directory as the config header
111587e6fb56fSmrg# that is generated.  The stamp files are numbered to have different names.
111597e6fb56fSmrg
111607e6fb56fSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
111617e6fb56fSmrg# loop where config.status creates the headers, so we can generate
111627e6fb56fSmrg# our stamp files there.
111637e6fb56fSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
111647e6fb56fSmrg[# Compute $1's index in $config_headers.
111657e6fb56fSmrg_am_arg=$1
111667e6fb56fSmrg_am_stamp_count=1
111677e6fb56fSmrgfor _am_header in $config_headers :; do
111687e6fb56fSmrg  case $_am_header in
111697e6fb56fSmrg    $_am_arg | $_am_arg:* )
111707e6fb56fSmrg      break ;;
111717e6fb56fSmrg    * )
111727e6fb56fSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
111737e6fb56fSmrg  esac
111747e6fb56fSmrgdone
111757e6fb56fSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
111767e6fb56fSmrg
11177983b4bf2Smrg# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
11178983b4bf2Smrg# Inc.
111797e6fb56fSmrg#
111807e6fb56fSmrg# This file is free software; the Free Software Foundation
111817e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
111827e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
111837e6fb56fSmrg
11184983b4bf2Smrg# serial 1
11185983b4bf2Smrg
111867e6fb56fSmrg# AM_PROG_INSTALL_SH
111877e6fb56fSmrg# ------------------
111887e6fb56fSmrg# Define $install_sh.
111897e6fb56fSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
111907e6fb56fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11191983b4bf2Smrgif test x"${install_sh}" != xset; then
111927e6fb56fSmrg  case $am_aux_dir in
111937e6fb56fSmrg  *\ * | *\	*)
111947e6fb56fSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
111957e6fb56fSmrg  *)
111967e6fb56fSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
111977e6fb56fSmrg  esac
111987e6fb56fSmrgfi
11199983b4bf2SmrgAC_SUBST(install_sh)])
112007e6fb56fSmrg
11201983b4bf2Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
112027e6fb56fSmrg#
112037e6fb56fSmrg# This file is free software; the Free Software Foundation
112047e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
112057e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
112067e6fb56fSmrg
11207983b4bf2Smrg# serial 2
11208983b4bf2Smrg
112097e6fb56fSmrg# Check whether the underlying file-system supports filenames
112107e6fb56fSmrg# with a leading dot.  For instance MS-DOS doesn't.
112117e6fb56fSmrgAC_DEFUN([AM_SET_LEADING_DOT],
112127e6fb56fSmrg[rm -rf .tst 2>/dev/null
112137e6fb56fSmrgmkdir .tst 2>/dev/null
112147e6fb56fSmrgif test -d .tst; then
112157e6fb56fSmrg  am__leading_dot=.
112167e6fb56fSmrgelse
112177e6fb56fSmrg  am__leading_dot=_
112187e6fb56fSmrgfi
112197e6fb56fSmrgrmdir .tst 2>/dev/null
112207e6fb56fSmrgAC_SUBST([am__leading_dot])])
112217e6fb56fSmrg
112227e6fb56fSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
112237e6fb56fSmrg# From Jim Meyering
112247e6fb56fSmrg
11225983b4bf2Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
11226983b4bf2Smrg# 2011 Free Software Foundation, Inc.
112277e6fb56fSmrg#
112287e6fb56fSmrg# This file is free software; the Free Software Foundation
112297e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
112307e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
112317e6fb56fSmrg
11232983b4bf2Smrg# serial 5
11233983b4bf2Smrg
112347e6fb56fSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
112357e6fb56fSmrg# ----------------------------------
112367e6fb56fSmrg# Control maintainer-specific portions of Makefiles.
11237983b4bf2Smrg# Default is to disable them, unless `enable' is passed literally.
11238983b4bf2Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
112397e6fb56fSmrg# can override the default with the --enable/--disable switch.
112407e6fb56fSmrgAC_DEFUN([AM_MAINTAINER_MODE],
112417e6fb56fSmrg[m4_case(m4_default([$1], [disable]),
112427e6fb56fSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
112437e6fb56fSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
112447e6fb56fSmrg       [m4_define([am_maintainer_other], [enable])
112457e6fb56fSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
1124690b17f1bSmrgAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
112477e6fb56fSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
112487e6fb56fSmrg  AC_ARG_ENABLE([maintainer-mode],
11249983b4bf2Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
11250983b4bf2Smrg			  (and sometimes confusing) to the casual installer],
11251983b4bf2Smrg      [USE_MAINTAINER_MODE=$enableval],
11252983b4bf2Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
112537e6fb56fSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
112547e6fb56fSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
112557e6fb56fSmrg  MAINT=$MAINTAINER_MODE_TRUE
112567e6fb56fSmrg  AC_SUBST([MAINT])dnl
112577e6fb56fSmrg]
112587e6fb56fSmrg)
112597e6fb56fSmrg
11260983b4bf2SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
11261983b4bf2Smrg
112627e6fb56fSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
112637e6fb56fSmrg
11264983b4bf2Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
112657e6fb56fSmrg#
112667e6fb56fSmrg# This file is free software; the Free Software Foundation
112677e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
112687e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
112697e6fb56fSmrg
11270983b4bf2Smrg# serial 4
11271983b4bf2Smrg
112727e6fb56fSmrg# AM_MAKE_INCLUDE()
112737e6fb56fSmrg# -----------------
112747e6fb56fSmrg# Check to see how make treats includes.
112757e6fb56fSmrgAC_DEFUN([AM_MAKE_INCLUDE],
112767e6fb56fSmrg[am_make=${MAKE-make}
112777e6fb56fSmrgcat > confinc << 'END'
112787e6fb56fSmrgam__doit:
112797e6fb56fSmrg	@echo this is the am__doit target
112807e6fb56fSmrg.PHONY: am__doit
112817e6fb56fSmrgEND
112827e6fb56fSmrg# If we don't find an include directive, just comment out the code.
112837e6fb56fSmrgAC_MSG_CHECKING([for style of include used by $am_make])
112847e6fb56fSmrgam__include="#"
112857e6fb56fSmrgam__quote=
112867e6fb56fSmrg_am_result=none
112877e6fb56fSmrg# First try GNU make style include.
112887e6fb56fSmrgecho "include confinc" > confmf
11289983b4bf2Smrg# Ignore all kinds of additional output from `make'.
112907e6fb56fSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
112917e6fb56fSmrg*the\ am__doit\ target*)
112927e6fb56fSmrg  am__include=include
112937e6fb56fSmrg  am__quote=
112947e6fb56fSmrg  _am_result=GNU
112957e6fb56fSmrg  ;;
112967e6fb56fSmrgesac
112977e6fb56fSmrg# Now try BSD make style include.
112987e6fb56fSmrgif test "$am__include" = "#"; then
112997e6fb56fSmrg   echo '.include "confinc"' > confmf
113007e6fb56fSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
113017e6fb56fSmrg   *the\ am__doit\ target*)
113027e6fb56fSmrg     am__include=.include
113037e6fb56fSmrg     am__quote="\""
113047e6fb56fSmrg     _am_result=BSD
113057e6fb56fSmrg     ;;
113067e6fb56fSmrg   esac
113077e6fb56fSmrgfi
113087e6fb56fSmrgAC_SUBST([am__include])
113097e6fb56fSmrgAC_SUBST([am__quote])
113107e6fb56fSmrgAC_MSG_RESULT([$_am_result])
113117e6fb56fSmrgrm -f confinc confmf
113127e6fb56fSmrg])
113137e6fb56fSmrg
113147e6fb56fSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
113157e6fb56fSmrg
11316983b4bf2Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
11317983b4bf2Smrg# Free Software Foundation, Inc.
113187e6fb56fSmrg#
113197e6fb56fSmrg# This file is free software; the Free Software Foundation
113207e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
113217e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
113227e6fb56fSmrg
11323983b4bf2Smrg# serial 6
11324983b4bf2Smrg
113257e6fb56fSmrg# AM_MISSING_PROG(NAME, PROGRAM)
113267e6fb56fSmrg# ------------------------------
113277e6fb56fSmrgAC_DEFUN([AM_MISSING_PROG],
113287e6fb56fSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
113297e6fb56fSmrg$1=${$1-"${am_missing_run}$2"}
113307e6fb56fSmrgAC_SUBST($1)])
113317e6fb56fSmrg
11332983b4bf2Smrg
113337e6fb56fSmrg# AM_MISSING_HAS_RUN
113347e6fb56fSmrg# ------------------
11335983b4bf2Smrg# Define MISSING if not defined so far and test if it supports --run.
11336983b4bf2Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
113377e6fb56fSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
113387e6fb56fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
113397e6fb56fSmrgAC_REQUIRE_AUX_FILE([missing])dnl
113407e6fb56fSmrgif test x"${MISSING+set}" != xset; then
113417e6fb56fSmrg  case $am_aux_dir in
113427e6fb56fSmrg  *\ * | *\	*)
113437e6fb56fSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
113447e6fb56fSmrg  *)
113457e6fb56fSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
113467e6fb56fSmrg  esac
113477e6fb56fSmrgfi
113487e6fb56fSmrg# Use eval to expand $SHELL
11349983b4bf2Smrgif eval "$MISSING --run true"; then
11350983b4bf2Smrg  am_missing_run="$MISSING --run "
113517e6fb56fSmrgelse
113527e6fb56fSmrg  am_missing_run=
11353983b4bf2Smrg  AC_MSG_WARN([`missing' script is too old or missing])
113547e6fb56fSmrgfi
113557e6fb56fSmrg])
113567e6fb56fSmrg
11357983b4bf2Smrg# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
11358983b4bf2Smrg# Inc.
11359983b4bf2Smrg#
11360983b4bf2Smrg# This file is free software; the Free Software Foundation
11361983b4bf2Smrg# gives unlimited permission to copy and/or distribute it,
11362983b4bf2Smrg# with or without modifications, as long as this notice is preserved.
11363983b4bf2Smrg
11364983b4bf2Smrg# serial 1
11365983b4bf2Smrg
11366983b4bf2Smrg# AM_PROG_MKDIR_P
11367983b4bf2Smrg# ---------------
11368983b4bf2Smrg# Check for `mkdir -p'.
11369983b4bf2SmrgAC_DEFUN([AM_PROG_MKDIR_P],
11370983b4bf2Smrg[AC_PREREQ([2.60])dnl
11371983b4bf2SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
11372983b4bf2Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
11373983b4bf2Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
11374983b4bf2Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
11375983b4bf2Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
11376983b4bf2Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
11377983b4bf2Smrgdnl adjustment using top_builddir (which is defined more often than
11378983b4bf2Smrgdnl MKDIR_P).
11379983b4bf2SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
11380983b4bf2Smrgcase $mkdir_p in
11381983b4bf2Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
11382983b4bf2Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
11383983b4bf2Smrgesac
11384983b4bf2Smrg])
11385983b4bf2Smrg
113867e6fb56fSmrg# Helper functions for option handling.                     -*- Autoconf -*-
113877e6fb56fSmrg
11388983b4bf2Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
11389983b4bf2Smrg# Foundation, Inc.
113907e6fb56fSmrg#
113917e6fb56fSmrg# This file is free software; the Free Software Foundation
113927e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
113937e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
113947e6fb56fSmrg
11395983b4bf2Smrg# serial 5
11396983b4bf2Smrg
113977e6fb56fSmrg# _AM_MANGLE_OPTION(NAME)
113987e6fb56fSmrg# -----------------------
113997e6fb56fSmrgAC_DEFUN([_AM_MANGLE_OPTION],
114007e6fb56fSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
114017e6fb56fSmrg
114027e6fb56fSmrg# _AM_SET_OPTION(NAME)
1140390b17f1bSmrg# --------------------
114047e6fb56fSmrg# Set option NAME.  Presently that only means defining a flag for this option.
114057e6fb56fSmrgAC_DEFUN([_AM_SET_OPTION],
11406983b4bf2Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
114077e6fb56fSmrg
114087e6fb56fSmrg# _AM_SET_OPTIONS(OPTIONS)
1140990b17f1bSmrg# ------------------------
114107e6fb56fSmrg# OPTIONS is a space-separated list of Automake options.
114117e6fb56fSmrgAC_DEFUN([_AM_SET_OPTIONS],
114127e6fb56fSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
114137e6fb56fSmrg
114147e6fb56fSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
114157e6fb56fSmrg# -------------------------------------------
114167e6fb56fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
114177e6fb56fSmrgAC_DEFUN([_AM_IF_OPTION],
114187e6fb56fSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
114197e6fb56fSmrg
11420963d66acSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
11421963d66acSmrg
11422983b4bf2Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
11423983b4bf2Smrg# Free Software Foundation, Inc.
11424963d66acSmrg#
11425963d66acSmrg# This file is free software; the Free Software Foundation
11426963d66acSmrg# gives unlimited permission to copy and/or distribute it,
11427963d66acSmrg# with or without modifications, as long as this notice is preserved.
114287e6fb56fSmrg
11429983b4bf2Smrg# serial 5
11430983b4bf2Smrg
114317e6fb56fSmrg# AM_SANITY_CHECK
114327e6fb56fSmrg# ---------------
114337e6fb56fSmrgAC_DEFUN([AM_SANITY_CHECK],
114347e6fb56fSmrg[AC_MSG_CHECKING([whether build environment is sane])
11435983b4bf2Smrg# Just in case
11436983b4bf2Smrgsleep 1
11437983b4bf2Smrgecho timestamp > conftest.file
114387e6fb56fSmrg# Reject unsafe characters in $srcdir or the absolute working directory
114397e6fb56fSmrg# name.  Accept space and tab only in the latter.
114407e6fb56fSmrgam_lf='
114417e6fb56fSmrg'
114427e6fb56fSmrgcase `pwd` in
114437e6fb56fSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
114447e6fb56fSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
114457e6fb56fSmrgesac
114467e6fb56fSmrgcase $srcdir in
114477e6fb56fSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
11448983b4bf2Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
114497e6fb56fSmrgesac
114507e6fb56fSmrg
11451983b4bf2Smrg# Do `set' in a subshell so we don't clobber the current shell's
114527e6fb56fSmrg# arguments.  Must try -L first in case configure is actually a
114537e6fb56fSmrg# symlink; some systems play weird games with the mod time of symlinks
114547e6fb56fSmrg# (eg FreeBSD returns the mod time of the symlink's containing
114557e6fb56fSmrg# directory).
114567e6fb56fSmrgif (
11457983b4bf2Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
11458983b4bf2Smrg   if test "$[*]" = "X"; then
11459983b4bf2Smrg      # -L didn't work.
11460983b4bf2Smrg      set X `ls -t "$srcdir/configure" conftest.file`
11461983b4bf2Smrg   fi
11462983b4bf2Smrg   rm -f conftest.file
11463983b4bf2Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
11464983b4bf2Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
11465983b4bf2Smrg
11466983b4bf2Smrg      # If neither matched, then we have a broken ls.  This can happen
11467983b4bf2Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
11468983b4bf2Smrg      # broken ls alias from the environment.  This has actually
11469983b4bf2Smrg      # happened.  Such a system could not be considered "sane".
11470983b4bf2Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
11471983b4bf2Smrgalias in your environment])
11472983b4bf2Smrg   fi
11473983b4bf2Smrg
114747e6fb56fSmrg   test "$[2]" = conftest.file
114757e6fb56fSmrg   )
114767e6fb56fSmrgthen
114777e6fb56fSmrg   # Ok.
114787e6fb56fSmrg   :
114797e6fb56fSmrgelse
114807e6fb56fSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
114817e6fb56fSmrgCheck your system clock])
114827e6fb56fSmrgfi
11483983b4bf2SmrgAC_MSG_RESULT(yes)])
114847e6fb56fSmrg
11485983b4bf2Smrg# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
114867e6fb56fSmrg#
114877e6fb56fSmrg# This file is free software; the Free Software Foundation
114887e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
114897e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
114907e6fb56fSmrg
11491983b4bf2Smrg# serial 1
1149290b17f1bSmrg
114937e6fb56fSmrg# AM_PROG_INSTALL_STRIP
114947e6fb56fSmrg# ---------------------
11495983b4bf2Smrg# One issue with vendor `install' (even GNU) is that you can't
114967e6fb56fSmrg# specify the program used to strip binaries.  This is especially
114977e6fb56fSmrg# annoying in cross-compiling environments, where the build's strip
114987e6fb56fSmrg# is unlikely to handle the host's binaries.
114997e6fb56fSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
11500983b4bf2Smrg# always use install-sh in `make install-strip', and initialize
115017e6fb56fSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
115027e6fb56fSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
115037e6fb56fSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
11504983b4bf2Smrg# Installed binaries are usually stripped using `strip' when the user
11505983b4bf2Smrg# run `make install-strip'.  However `strip' might not be the right
115067e6fb56fSmrg# tool to use in cross-compilation environments, therefore Automake
11507983b4bf2Smrg# will honor the `STRIP' environment variable to overrule this program.
11508983b4bf2Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
115097e6fb56fSmrgif test "$cross_compiling" != no; then
115107e6fb56fSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
115117e6fb56fSmrgfi
115127e6fb56fSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
115137e6fb56fSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
115147e6fb56fSmrg
11515983b4bf2Smrg# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
115167e6fb56fSmrg#
115177e6fb56fSmrg# This file is free software; the Free Software Foundation
115187e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
115197e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
115207e6fb56fSmrg
11521983b4bf2Smrg# serial 3
11522983b4bf2Smrg
115237e6fb56fSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
115247e6fb56fSmrg# ---------------------------
115257e6fb56fSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
115267e6fb56fSmrg# This macro is traced by Automake.
115277e6fb56fSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
115287e6fb56fSmrg
115297e6fb56fSmrg# AM_SUBST_NOTMAKE(VARIABLE)
1153090b17f1bSmrg# --------------------------
115317e6fb56fSmrg# Public sister of _AM_SUBST_NOTMAKE.
115327e6fb56fSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
115337e6fb56fSmrg
115347e6fb56fSmrg# Check how to create a tarball.                            -*- Autoconf -*-
115357e6fb56fSmrg
11536983b4bf2Smrg# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
115377e6fb56fSmrg#
115387e6fb56fSmrg# This file is free software; the Free Software Foundation
115397e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
115407e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
115417e6fb56fSmrg
11542983b4bf2Smrg# serial 2
11543983b4bf2Smrg
115447e6fb56fSmrg# _AM_PROG_TAR(FORMAT)
115457e6fb56fSmrg# --------------------
115467e6fb56fSmrg# Check how to create a tarball in format FORMAT.
11547983b4bf2Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
115487e6fb56fSmrg#
115497e6fb56fSmrg# Substitute a variable $(am__tar) that is a command
115507e6fb56fSmrg# writing to stdout a FORMAT-tarball containing the directory
115517e6fb56fSmrg# $tardir.
115527e6fb56fSmrg#     tardir=directory && $(am__tar) > result.tar
115537e6fb56fSmrg#
115547e6fb56fSmrg# Substitute a variable $(am__untar) that extract such
115557e6fb56fSmrg# a tarball read from stdin.
115567e6fb56fSmrg#     $(am__untar) < result.tar
115577e6fb56fSmrgAC_DEFUN([_AM_PROG_TAR],
1155890b17f1bSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
1155990b17f1bSmrg# in the wild :-(  We should find a proper way to deprecate it ...
1156090b17f1bSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
11561963d66acSmrgm4_if([$1], [v7],
11562983b4bf2Smrg     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
11563983b4bf2Smrg     [m4_case([$1], [ustar],, [pax],,
11564983b4bf2Smrg              [m4_fatal([Unknown tar format])])
11565983b4bf2SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
11566983b4bf2Smrg# Loop over all known methods to create a tar archive until one works.
11567983b4bf2Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
11568983b4bf2Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
11569983b4bf2Smrg# Do not fold the above two line into one, because Tru64 sh and
11570983b4bf2Smrg# Solaris sh will not grok spaces in the rhs of `-'.
11571983b4bf2Smrgfor _am_tool in $_am_tools
11572983b4bf2Smrgdo
11573983b4bf2Smrg  case $_am_tool in
11574983b4bf2Smrg  gnutar)
11575983b4bf2Smrg    for _am_tar in tar gnutar gtar;
11576983b4bf2Smrg    do
11577983b4bf2Smrg      AM_RUN_LOG([$_am_tar --version]) && break
11578983b4bf2Smrg    done
11579983b4bf2Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
11580983b4bf2Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
11581983b4bf2Smrg    am__untar="$_am_tar -xf -"
11582983b4bf2Smrg    ;;
11583983b4bf2Smrg  plaintar)
11584983b4bf2Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
11585983b4bf2Smrg    # ustar tarball either.
11586983b4bf2Smrg    (tar --version) >/dev/null 2>&1 && continue
11587983b4bf2Smrg    am__tar='tar chf - "$$tardir"'
11588983b4bf2Smrg    am__tar_='tar chf - "$tardir"'
11589983b4bf2Smrg    am__untar='tar xf -'
11590983b4bf2Smrg    ;;
11591983b4bf2Smrg  pax)
11592983b4bf2Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
11593983b4bf2Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
11594983b4bf2Smrg    am__untar='pax -r'
11595983b4bf2Smrg    ;;
11596983b4bf2Smrg  cpio)
11597983b4bf2Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
11598983b4bf2Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
11599983b4bf2Smrg    am__untar='cpio -i -H $1 -d'
11600983b4bf2Smrg    ;;
11601983b4bf2Smrg  none)
11602983b4bf2Smrg    am__tar=false
11603983b4bf2Smrg    am__tar_=false
11604983b4bf2Smrg    am__untar=false
11605983b4bf2Smrg    ;;
11606983b4bf2Smrg  esac
11607963d66acSmrg
11608983b4bf2Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
11609983b4bf2Smrg  # and am__untar set.
11610983b4bf2Smrg  test -n "${am_cv_prog_tar_$1}" && break
11611963d66acSmrg
11612983b4bf2Smrg  # tar/untar a dummy directory, and stop if the command works
116137e6fb56fSmrg  rm -rf conftest.dir
11614983b4bf2Smrg  mkdir conftest.dir
11615983b4bf2Smrg  echo GrepMe > conftest.dir/file
11616983b4bf2Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
11617983b4bf2Smrg  rm -rf conftest.dir
11618983b4bf2Smrg  if test -s conftest.tar; then
11619983b4bf2Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
11620983b4bf2Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
11621983b4bf2Smrg  fi
11622983b4bf2Smrgdone
11623983b4bf2Smrgrm -rf conftest.dir
116247e6fb56fSmrg
11625983b4bf2SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
11626983b4bf2SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
116277e6fb56fSmrgAC_SUBST([am__tar])
116287e6fb56fSmrgAC_SUBST([am__untar])
116297e6fb56fSmrg]) # _AM_PROG_TAR
116307e6fb56fSmrg
116317e6fb56fSmrgm4_include([acinclude.m4])
11632