aclocal.m4 revision 90b17f1b
190b17f1bSmrg# generated automatically by aclocal 1.12.2 -*- Autoconf -*-
290b17f1bSmrg
390b17f1bSmrg# Copyright (C) 1996-2012 Free Software Foundation, Inc.
47e6fb56fSmrg
57e6fb56fSmrg# This file is free software; the Free Software Foundation
67e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
77e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
87e6fb56fSmrg
97e6fb56fSmrg# This program is distributed in the hope that it will be useful,
107e6fb56fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
117e6fb56fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
127e6fb56fSmrg# PARTICULAR PURPOSE.
137e6fb56fSmrg
147e6fb56fSmrgm4_ifndef([AC_AUTOCONF_VERSION],
157e6fb56fSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1690b17f1bSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
1790b17f1bSmrg[m4_warning([this file was generated for autoconf 2.69.
187e6fb56fSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
197e6fb56fSmrgIf you have problems, you may need to regenerate the build system entirely.
2090b17f1bSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
217e6fb56fSmrg
227e6fb56fSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2390b17f1bSmrg#
2490b17f1bSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
2590b17f1bSmrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
2690b17f1bSmrg#                 Foundation, Inc.
2790b17f1bSmrg#   Written by Gordon Matzigkeit, 1996
2890b17f1bSmrg#
2990b17f1bSmrg# This file is free software; the Free Software Foundation gives
3090b17f1bSmrg# unlimited permission to copy and/or distribute it, with or without
3190b17f1bSmrg# modifications, as long as this notice is preserved.
3290b17f1bSmrg
3390b17f1bSmrgm4_define([_LT_COPYING], [dnl
3490b17f1bSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
3590b17f1bSmrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
3690b17f1bSmrg#                 Foundation, Inc.
3790b17f1bSmrg#   Written by Gordon Matzigkeit, 1996
3890b17f1bSmrg#
3990b17f1bSmrg#   This file is part of GNU Libtool.
4090b17f1bSmrg#
4190b17f1bSmrg# GNU Libtool is free software; you can redistribute it and/or
4290b17f1bSmrg# modify it under the terms of the GNU General Public License as
4390b17f1bSmrg# published by the Free Software Foundation; either version 2 of
4490b17f1bSmrg# the License, or (at your option) any later version.
4590b17f1bSmrg#
4690b17f1bSmrg# As a special exception to the GNU General Public License,
4790b17f1bSmrg# if you distribute this file as part of a program or library that
4890b17f1bSmrg# is built using GNU Libtool, you may include this file under the
4990b17f1bSmrg# same distribution terms that you use for the rest of that program.
5090b17f1bSmrg#
5190b17f1bSmrg# GNU Libtool is distributed in the hope that it will be useful,
5290b17f1bSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
5390b17f1bSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5490b17f1bSmrg# GNU General Public License for more details.
5590b17f1bSmrg#
5690b17f1bSmrg# You should have received a copy of the GNU General Public License
5790b17f1bSmrg# along with GNU Libtool; see the file COPYING.  If not, a copy
5890b17f1bSmrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
5990b17f1bSmrg# obtained by writing to the Free Software Foundation, Inc.,
6090b17f1bSmrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
6190b17f1bSmrg])
627e6fb56fSmrg
6390b17f1bSmrg# serial 57 LT_INIT
647e6fb56fSmrg
657e6fb56fSmrg
6690b17f1bSmrg# LT_PREREQ(VERSION)
6790b17f1bSmrg# ------------------
6890b17f1bSmrg# Complain and exit if this libtool version is less that VERSION.
6990b17f1bSmrgm4_defun([LT_PREREQ],
7090b17f1bSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
7190b17f1bSmrg       [m4_default([$3],
7290b17f1bSmrg		   [m4_fatal([Libtool version $1 or higher is required],
7390b17f1bSmrg		             63)])],
7490b17f1bSmrg       [$2])])
757e6fb56fSmrg
767e6fb56fSmrg
7790b17f1bSmrg# _LT_CHECK_BUILDDIR
7890b17f1bSmrg# ------------------
7990b17f1bSmrg# Complain if the absolute build directory name contains unusual characters
8090b17f1bSmrgm4_defun([_LT_CHECK_BUILDDIR],
8190b17f1bSmrg[case `pwd` in
8290b17f1bSmrg  *\ * | *\	*)
8390b17f1bSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
8490b17f1bSmrgesac
8590b17f1bSmrg])
8690b17f1bSmrg
8790b17f1bSmrg
8890b17f1bSmrg# LT_INIT([OPTIONS])
8990b17f1bSmrg# ------------------
9090b17f1bSmrgAC_DEFUN([LT_INIT],
9190b17f1bSmrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
9290b17f1bSmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
9390b17f1bSmrgAC_BEFORE([$0], [LT_LANG])dnl
9490b17f1bSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
9590b17f1bSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
9690b17f1bSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
9790b17f1bSmrg
9890b17f1bSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
9990b17f1bSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
10090b17f1bSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
10190b17f1bSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
10290b17f1bSmrgdnl unless we require an AC_DEFUNed macro:
10390b17f1bSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
10490b17f1bSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
10590b17f1bSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
10690b17f1bSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
10790b17f1bSmrgm4_require([_LT_PROG_LTMAIN])dnl
10890b17f1bSmrg
10990b17f1bSmrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
11090b17f1bSmrg
11190b17f1bSmrgdnl Parse OPTIONS
11290b17f1bSmrg_LT_SET_OPTIONS([$0], [$1])
1137e6fb56fSmrg
1147e6fb56fSmrg# This can be used to rebuild libtool when needed
11590b17f1bSmrgLIBTOOL_DEPS="$ltmain"
1167e6fb56fSmrg
1177e6fb56fSmrg# Always use our own libtool.
1187e6fb56fSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
1197e6fb56fSmrgAC_SUBST(LIBTOOL)dnl
1207e6fb56fSmrg
12190b17f1bSmrg_LT_SETUP
1227e6fb56fSmrg
12390b17f1bSmrg# Only expand once:
12490b17f1bSmrgm4_define([LT_INIT])
12590b17f1bSmrg])# LT_INIT
1267e6fb56fSmrg
12790b17f1bSmrg# Old names:
12890b17f1bSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
12990b17f1bSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
13090b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
13190b17f1bSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
13290b17f1bSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
13390b17f1bSmrg
13490b17f1bSmrg
13590b17f1bSmrg# _LT_CC_BASENAME(CC)
13690b17f1bSmrg# -------------------
13790b17f1bSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
13890b17f1bSmrgm4_defun([_LT_CC_BASENAME],
13990b17f1bSmrg[for cc_temp in $1""; do
14090b17f1bSmrg  case $cc_temp in
14190b17f1bSmrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
14290b17f1bSmrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
14390b17f1bSmrg    \-*) ;;
14490b17f1bSmrg    *) break;;
14590b17f1bSmrg  esac
14690b17f1bSmrgdone
14790b17f1bSmrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
14890b17f1bSmrg])
14990b17f1bSmrg
15090b17f1bSmrg
15190b17f1bSmrg# _LT_FILEUTILS_DEFAULTS
15290b17f1bSmrg# ----------------------
15390b17f1bSmrg# It is okay to use these file commands and assume they have been set
15490b17f1bSmrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
15590b17f1bSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
15690b17f1bSmrg[: ${CP="cp -f"}
15790b17f1bSmrg: ${MV="mv -f"}
15890b17f1bSmrg: ${RM="rm -f"}
15990b17f1bSmrg])# _LT_FILEUTILS_DEFAULTS
16090b17f1bSmrg
16190b17f1bSmrg
16290b17f1bSmrg# _LT_SETUP
16390b17f1bSmrg# ---------
16490b17f1bSmrgm4_defun([_LT_SETUP],
16590b17f1bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1667e6fb56fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
16790b17f1bSmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
16890b17f1bSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1697e6fb56fSmrg
17090b17f1bSmrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
17190b17f1bSmrgdnl
17290b17f1bSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
17390b17f1bSmrg_LT_DECL([], [host], [0])dnl
17490b17f1bSmrg_LT_DECL([], [host_os], [0])dnl
17590b17f1bSmrgdnl
17690b17f1bSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
17790b17f1bSmrg_LT_DECL([], [build], [0])dnl
17890b17f1bSmrg_LT_DECL([], [build_os], [0])dnl
17990b17f1bSmrgdnl
18090b17f1bSmrgAC_REQUIRE([AC_PROG_CC])dnl
18190b17f1bSmrgAC_REQUIRE([LT_PATH_LD])dnl
18290b17f1bSmrgAC_REQUIRE([LT_PATH_NM])dnl
18390b17f1bSmrgdnl
1847e6fb56fSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
18590b17f1bSmrgtest -z "$LN_S" && LN_S="ln -s"
18690b17f1bSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
18790b17f1bSmrgdnl
18890b17f1bSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
18990b17f1bSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
19090b17f1bSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1917e6fb56fSmrgdnl
19290b17f1bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
19390b17f1bSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
19490b17f1bSmrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
19590b17f1bSmrgm4_require([_LT_CMD_RELOAD])dnl
19690b17f1bSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
19790b17f1bSmrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
19890b17f1bSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
19990b17f1bSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
20090b17f1bSmrgm4_require([_LT_WITH_SYSROOT])dnl
20190b17f1bSmrg
20290b17f1bSmrg_LT_CONFIG_LIBTOOL_INIT([
20390b17f1bSmrg# See if we are running on zsh, and set the options which allow our
20490b17f1bSmrg# commands through without removal of \ escapes INIT.
20590b17f1bSmrgif test -n "\${ZSH_VERSION+set}" ; then
20690b17f1bSmrg   setopt NO_GLOB_SUBST
20790b17f1bSmrgfi
20890b17f1bSmrg])
20990b17f1bSmrgif test -n "${ZSH_VERSION+set}" ; then
21090b17f1bSmrg   setopt NO_GLOB_SUBST
21190b17f1bSmrgfi
21290b17f1bSmrg
21390b17f1bSmrg_LT_CHECK_OBJDIR
2147e6fb56fSmrg
21590b17f1bSmrgm4_require([_LT_TAG_COMPILER])dnl
2167e6fb56fSmrg
2177e6fb56fSmrgcase $host_os in
2187e6fb56fSmrgaix3*)
2197e6fb56fSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
2207e6fb56fSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
2217e6fb56fSmrg  # vanish in a puff of smoke.
2227e6fb56fSmrg  if test "X${COLLECT_NAMES+set}" != Xset; then
2237e6fb56fSmrg    COLLECT_NAMES=
2247e6fb56fSmrg    export COLLECT_NAMES
2257e6fb56fSmrg  fi
2267e6fb56fSmrg  ;;
2277e6fb56fSmrgesac
2287e6fb56fSmrg
2297e6fb56fSmrg# Global variables:
23090b17f1bSmrgofile=libtool
2317e6fb56fSmrgcan_build_shared=yes
2327e6fb56fSmrg
2337e6fb56fSmrg# All known linkers require a `.a' archive for static linking (except MSVC,
2347e6fb56fSmrg# which needs '.lib').
2357e6fb56fSmrglibext=a
2367e6fb56fSmrg
23790b17f1bSmrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
2387e6fb56fSmrg
2397e6fb56fSmrgold_CC="$CC"
2407e6fb56fSmrgold_CFLAGS="$CFLAGS"
2417e6fb56fSmrg
2427e6fb56fSmrg# Set sane defaults for various variables
2437e6fb56fSmrgtest -z "$CC" && CC=cc
2447e6fb56fSmrgtest -z "$LTCC" && LTCC=$CC
2457e6fb56fSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
2467e6fb56fSmrgtest -z "$LD" && LD=ld
2477e6fb56fSmrgtest -z "$ac_objext" && ac_objext=o
2487e6fb56fSmrg
2497e6fb56fSmrg_LT_CC_BASENAME([$compiler])
2507e6fb56fSmrg
2517e6fb56fSmrg# Only perform the check for file, if the check method requires it
25290b17f1bSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
2537e6fb56fSmrgcase $deplibs_check_method in
2547e6fb56fSmrgfile_magic*)
2557e6fb56fSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
25690b17f1bSmrg    _LT_PATH_MAGIC
2577e6fb56fSmrg  fi
2587e6fb56fSmrg  ;;
2597e6fb56fSmrgesac
2607e6fb56fSmrg
26190b17f1bSmrg# Use C for the default configuration in the libtool script
26290b17f1bSmrgLT_SUPPORTED_TAG([CC])
26390b17f1bSmrg_LT_LANG_C_CONFIG
26490b17f1bSmrg_LT_LANG_DEFAULT_CONFIG
26590b17f1bSmrg_LT_CONFIG_COMMANDS
26690b17f1bSmrg])# _LT_SETUP
2677e6fb56fSmrg
2687e6fb56fSmrg
26990b17f1bSmrg# _LT_PREPARE_SED_QUOTE_VARS
27090b17f1bSmrg# --------------------------
27190b17f1bSmrg# Define a few sed substitution that help us do robust quoting.
27290b17f1bSmrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
27390b17f1bSmrg[# Backslashify metacharacters that are still active within
27490b17f1bSmrg# double-quoted strings.
27590b17f1bSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
2767e6fb56fSmrg
27790b17f1bSmrg# Same as above, but do not quote variable references.
27890b17f1bSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
2797e6fb56fSmrg
28090b17f1bSmrg# Sed substitution to delay expansion of an escaped shell variable in a
28190b17f1bSmrg# double_quote_subst'ed string.
28290b17f1bSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
2837e6fb56fSmrg
28490b17f1bSmrg# Sed substitution to delay expansion of an escaped single quote.
28590b17f1bSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
2867e6fb56fSmrg
28790b17f1bSmrg# Sed substitution to avoid accidental globbing in evaled expressions
28890b17f1bSmrgno_glob_subst='s/\*/\\\*/g'
28990b17f1bSmrg])
2907e6fb56fSmrg
29190b17f1bSmrg# _LT_PROG_LTMAIN
29290b17f1bSmrg# ---------------
29390b17f1bSmrg# Note that this code is called both from `configure', and `config.status'
29490b17f1bSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
29590b17f1bSmrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
29690b17f1bSmrg# so we pass a copy along to make sure it has a sensible value anyway.
29790b17f1bSmrgm4_defun([_LT_PROG_LTMAIN],
29890b17f1bSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
29990b17f1bSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
30090b17f1bSmrgltmain="$ac_aux_dir/ltmain.sh"
30190b17f1bSmrg])# _LT_PROG_LTMAIN
3027e6fb56fSmrg
3037e6fb56fSmrg
3047e6fb56fSmrg
30590b17f1bSmrg# So that we can recreate a full libtool script including additional
30690b17f1bSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
30790b17f1bSmrg# in macros and then make a single call at the end using the `libtool'
30890b17f1bSmrg# label.
3097e6fb56fSmrg
3107e6fb56fSmrg
31190b17f1bSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
31290b17f1bSmrg# ----------------------------------------
31390b17f1bSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
31490b17f1bSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
31590b17f1bSmrg[m4_ifval([$1],
31690b17f1bSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
31790b17f1bSmrg                     [$1
31890b17f1bSmrg])])])
3197e6fb56fSmrg
32090b17f1bSmrg# Initialize.
32190b17f1bSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
3227e6fb56fSmrg
3237e6fb56fSmrg
32490b17f1bSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
32590b17f1bSmrg# ------------------------------
32690b17f1bSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
32790b17f1bSmrgm4_define([_LT_CONFIG_LIBTOOL],
32890b17f1bSmrg[m4_ifval([$1],
32990b17f1bSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
33090b17f1bSmrg                     [$1
33190b17f1bSmrg])])])
33290b17f1bSmrg
33390b17f1bSmrg# Initialize.
33490b17f1bSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
33590b17f1bSmrg
33690b17f1bSmrg
33790b17f1bSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
33890b17f1bSmrg# -----------------------------------------------------
33990b17f1bSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
34090b17f1bSmrg[_LT_CONFIG_LIBTOOL([$1])
34190b17f1bSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
34290b17f1bSmrg])
3437e6fb56fSmrg
3447e6fb56fSmrg
34590b17f1bSmrg# _LT_FORMAT_COMMENT([COMMENT])
34690b17f1bSmrg# -----------------------------
34790b17f1bSmrg# Add leading comment marks to the start of each line, and a trailing
34890b17f1bSmrg# full-stop to the whole comment if one is not present already.
34990b17f1bSmrgm4_define([_LT_FORMAT_COMMENT],
35090b17f1bSmrg[m4_ifval([$1], [
35190b17f1bSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
35290b17f1bSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
35390b17f1bSmrg)])
35490b17f1bSmrg
35590b17f1bSmrg
35690b17f1bSmrg
35790b17f1bSmrg
35890b17f1bSmrg
35990b17f1bSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
36090b17f1bSmrg# -------------------------------------------------------------------
36190b17f1bSmrg# CONFIGNAME is the name given to the value in the libtool script.
36290b17f1bSmrg# VARNAME is the (base) name used in the configure script.
36390b17f1bSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
36490b17f1bSmrg# VARNAME.  Any other value will be used directly.
36590b17f1bSmrgm4_define([_LT_DECL],
36690b17f1bSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
36790b17f1bSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
36890b17f1bSmrg	[m4_ifval([$1], [$1], [$2])])
36990b17f1bSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
37090b17f1bSmrg    m4_ifval([$4],
37190b17f1bSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
37290b17f1bSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
37390b17f1bSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
3747e6fb56fSmrg])
3757e6fb56fSmrg
3767e6fb56fSmrg
37790b17f1bSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
37890b17f1bSmrg# --------------------------------------------------------
37990b17f1bSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
3807e6fb56fSmrg
3817e6fb56fSmrg
38290b17f1bSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
38390b17f1bSmrg# ------------------------------------------------
38490b17f1bSmrgm4_define([lt_decl_tag_varnames],
38590b17f1bSmrg[_lt_decl_filter([tagged?], [yes], $@)])
3867e6fb56fSmrg
3877e6fb56fSmrg
38890b17f1bSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
38990b17f1bSmrg# ---------------------------------------------------------
39090b17f1bSmrgm4_define([_lt_decl_filter],
39190b17f1bSmrg[m4_case([$#],
39290b17f1bSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
39390b17f1bSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
39490b17f1bSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
39590b17f1bSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
39690b17f1bSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
39790b17f1bSmrg])
3987e6fb56fSmrg
3997e6fb56fSmrg
40090b17f1bSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
40190b17f1bSmrg# --------------------------------------------------
40290b17f1bSmrgm4_define([lt_decl_quote_varnames],
40390b17f1bSmrg[_lt_decl_filter([value], [1], $@)])
4047e6fb56fSmrg
4057e6fb56fSmrg
40690b17f1bSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
40790b17f1bSmrg# ---------------------------------------------------
40890b17f1bSmrgm4_define([lt_decl_dquote_varnames],
40990b17f1bSmrg[_lt_decl_filter([value], [2], $@)])
4107e6fb56fSmrg
4117e6fb56fSmrg
41290b17f1bSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
41390b17f1bSmrg# ---------------------------------------------------
41490b17f1bSmrgm4_define([lt_decl_varnames_tagged],
41590b17f1bSmrg[m4_assert([$# <= 2])dnl
41690b17f1bSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
41790b17f1bSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
41890b17f1bSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
41990b17f1bSmrgm4_define([_lt_decl_varnames_tagged],
42090b17f1bSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
4217e6fb56fSmrg
4227e6fb56fSmrg
42390b17f1bSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
42490b17f1bSmrg# ------------------------------------------------
42590b17f1bSmrgm4_define([lt_decl_all_varnames],
42690b17f1bSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
42790b17f1bSmrg     m4_if([$2], [],
42890b17f1bSmrg	   m4_quote(lt_decl_varnames),
42990b17f1bSmrg	m4_quote(m4_shift($@))))[]dnl
43090b17f1bSmrg])
43190b17f1bSmrgm4_define([_lt_decl_all_varnames],
43290b17f1bSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
43390b17f1bSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
43490b17f1bSmrg])
4357e6fb56fSmrg
4367e6fb56fSmrg
43790b17f1bSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
43890b17f1bSmrg# ------------------------------------
43990b17f1bSmrg# Quote a variable value, and forward it to `config.status' so that its
44090b17f1bSmrg# declaration there will have the same value as in `configure'.  VARNAME
44190b17f1bSmrg# must have a single quote delimited value for this to work.
44290b17f1bSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
44390b17f1bSmrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
4447e6fb56fSmrg
4457e6fb56fSmrg
44690b17f1bSmrg# _LT_CONFIG_STATUS_DECLARATIONS
44790b17f1bSmrg# ------------------------------
44890b17f1bSmrg# We delimit libtool config variables with single quotes, so when
44990b17f1bSmrg# we write them to config.status, we have to be sure to quote all
45090b17f1bSmrg# embedded single quotes properly.  In configure, this macro expands
45190b17f1bSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
45290b17f1bSmrg#
45390b17f1bSmrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
45490b17f1bSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
45590b17f1bSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
45690b17f1bSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
4577e6fb56fSmrg
45890b17f1bSmrg
45990b17f1bSmrg# _LT_LIBTOOL_TAGS
46090b17f1bSmrg# ----------------
46190b17f1bSmrg# Output comment and list of tags supported by the script
46290b17f1bSmrgm4_defun([_LT_LIBTOOL_TAGS],
46390b17f1bSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
46490b17f1bSmrgavailable_tags="_LT_TAGS"dnl
46590b17f1bSmrg])
46690b17f1bSmrg
46790b17f1bSmrg
46890b17f1bSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
46990b17f1bSmrg# -----------------------------------
47090b17f1bSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
47190b17f1bSmrg# expand to a commented shell variable setting:
47290b17f1bSmrg#
47390b17f1bSmrg#    # Some comment about what VAR is for.
47490b17f1bSmrg#    visible_name=$lt_internal_name
47590b17f1bSmrgm4_define([_LT_LIBTOOL_DECLARE],
47690b17f1bSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
47790b17f1bSmrg					   [description])))[]dnl
47890b17f1bSmrgm4_pushdef([_libtool_name],
47990b17f1bSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
48090b17f1bSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
48190b17f1bSmrg    [0], [_libtool_name=[$]$1],
48290b17f1bSmrg    [1], [_libtool_name=$lt_[]$1],
48390b17f1bSmrg    [2], [_libtool_name=$lt_[]$1],
48490b17f1bSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
48590b17f1bSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
48690b17f1bSmrg])
48790b17f1bSmrg
48890b17f1bSmrg
48990b17f1bSmrg# _LT_LIBTOOL_CONFIG_VARS
49090b17f1bSmrg# -----------------------
49190b17f1bSmrg# Produce commented declarations of non-tagged libtool config variables
49290b17f1bSmrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
49390b17f1bSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
49490b17f1bSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
49590b17f1bSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
49690b17f1bSmrg[m4_foreach([_lt_var],
49790b17f1bSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
49890b17f1bSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
49990b17f1bSmrg
50090b17f1bSmrg
50190b17f1bSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
50290b17f1bSmrg# -------------------------
50390b17f1bSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
50490b17f1bSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
50590b17f1bSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
50690b17f1bSmrg
50790b17f1bSmrg
50890b17f1bSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
50990b17f1bSmrg# ------------------------------
51090b17f1bSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
51190b17f1bSmrg
51290b17f1bSmrg
51390b17f1bSmrg# _LT_CONFIG_COMMANDS
51490b17f1bSmrg# -------------------
51590b17f1bSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
51690b17f1bSmrg# variables for single and double quote escaping we saved from calls
51790b17f1bSmrg# to _LT_DECL, we can put quote escaped variables declarations
51890b17f1bSmrg# into `config.status', and then the shell code to quote escape them in
51990b17f1bSmrg# for loops in `config.status'.  Finally, any additional code accumulated
52090b17f1bSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
52190b17f1bSmrgm4_defun([_LT_CONFIG_COMMANDS],
52290b17f1bSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
52390b17f1bSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
52490b17f1bSmrg	dnl instead of duplicating it all over again into config.status,
52590b17f1bSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
52690b17f1bSmrg	dnl needs to know what name is stored there:
52790b17f1bSmrg        [AC_CONFIG_COMMANDS([libtool],
52890b17f1bSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
52990b17f1bSmrg    dnl If the libtool generation code is destined for config.status,
53090b17f1bSmrg    dnl expand the accumulated commands and init code now:
53190b17f1bSmrg    [AC_CONFIG_COMMANDS([libtool],
53290b17f1bSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
53390b17f1bSmrg])#_LT_CONFIG_COMMANDS
53490b17f1bSmrg
53590b17f1bSmrg
53690b17f1bSmrg# Initialize.
53790b17f1bSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
53890b17f1bSmrg[
53990b17f1bSmrg
54090b17f1bSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
54190b17f1bSmrg# if CDPATH is set.
54290b17f1bSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
54390b17f1bSmrg
54490b17f1bSmrgsed_quote_subst='$sed_quote_subst'
54590b17f1bSmrgdouble_quote_subst='$double_quote_subst'
54690b17f1bSmrgdelay_variable_subst='$delay_variable_subst'
54790b17f1bSmrg_LT_CONFIG_STATUS_DECLARATIONS
54890b17f1bSmrgLTCC='$LTCC'
54990b17f1bSmrgLTCFLAGS='$LTCFLAGS'
55090b17f1bSmrgcompiler='$compiler_DEFAULT'
55190b17f1bSmrg
55290b17f1bSmrg# A function that is used when there is no print builtin or printf.
55390b17f1bSmrgfunc_fallback_echo ()
55490b17f1bSmrg{
55590b17f1bSmrg  eval 'cat <<_LTECHO_EOF
55690b17f1bSmrg\$[]1
55790b17f1bSmrg_LTECHO_EOF'
55890b17f1bSmrg}
55990b17f1bSmrg
56090b17f1bSmrg# Quote evaled strings.
56190b17f1bSmrgfor var in lt_decl_all_varnames([[ \
56290b17f1bSmrg]], lt_decl_quote_varnames); do
56390b17f1bSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
56490b17f1bSmrg    *[[\\\\\\\`\\"\\\$]]*)
56590b17f1bSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
5667e6fb56fSmrg      ;;
56790b17f1bSmrg    *)
56890b17f1bSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5697e6fb56fSmrg      ;;
5707e6fb56fSmrg    esac
57190b17f1bSmrgdone
5727e6fb56fSmrg
57390b17f1bSmrg# Double-quote double-evaled strings.
57490b17f1bSmrgfor var in lt_decl_all_varnames([[ \
57590b17f1bSmrg]], lt_decl_dquote_varnames); do
57690b17f1bSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
57790b17f1bSmrg    *[[\\\\\\\`\\"\\\$]]*)
57890b17f1bSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
5797e6fb56fSmrg      ;;
58090b17f1bSmrg    *)
58190b17f1bSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5827e6fb56fSmrg      ;;
5837e6fb56fSmrg    esac
58490b17f1bSmrgdone
5857e6fb56fSmrg
58690b17f1bSmrg_LT_OUTPUT_LIBTOOL_INIT
58790b17f1bSmrg])
5887e6fb56fSmrg
58990b17f1bSmrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
59090b17f1bSmrg# ------------------------------------
59190b17f1bSmrg# Generate a child script FILE with all initialization necessary to
59290b17f1bSmrg# reuse the environment learned by the parent script, and make the
59390b17f1bSmrg# file executable.  If COMMENT is supplied, it is inserted after the
59490b17f1bSmrg# `#!' sequence but before initialization text begins.  After this
59590b17f1bSmrg# macro, additional text can be appended to FILE to form the body of
59690b17f1bSmrg# the child script.  The macro ends with non-zero status if the
59790b17f1bSmrg# file could not be fully written (such as if the disk is full).
59890b17f1bSmrgm4_ifdef([AS_INIT_GENERATED],
59990b17f1bSmrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
60090b17f1bSmrg[m4_defun([_LT_GENERATED_FILE_INIT],
60190b17f1bSmrg[m4_require([AS_PREPARE])]dnl
60290b17f1bSmrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
60390b17f1bSmrg[lt_write_fail=0
60490b17f1bSmrgcat >$1 <<_ASEOF || lt_write_fail=1
60590b17f1bSmrg#! $SHELL
60690b17f1bSmrg# Generated by $as_me.
60790b17f1bSmrg$2
60890b17f1bSmrgSHELL=\${CONFIG_SHELL-$SHELL}
60990b17f1bSmrgexport SHELL
61090b17f1bSmrg_ASEOF
61190b17f1bSmrgcat >>$1 <<\_ASEOF || lt_write_fail=1
61290b17f1bSmrgAS_SHELL_SANITIZE
61390b17f1bSmrg_AS_PREPARE
61490b17f1bSmrgexec AS_MESSAGE_FD>&1
61590b17f1bSmrg_ASEOF
61690b17f1bSmrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
61790b17f1bSmrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
61890b17f1bSmrg
61990b17f1bSmrg# LT_OUTPUT
62090b17f1bSmrg# ---------
62190b17f1bSmrg# This macro allows early generation of the libtool script (before
62290b17f1bSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
62390b17f1bSmrg# tests.
62490b17f1bSmrgAC_DEFUN([LT_OUTPUT],
62590b17f1bSmrg[: ${CONFIG_LT=./config.lt}
62690b17f1bSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
62790b17f1bSmrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
62890b17f1bSmrg[# Run this file to recreate a libtool stub with the current configuration.])
62990b17f1bSmrg
63090b17f1bSmrgcat >>"$CONFIG_LT" <<\_LTEOF
63190b17f1bSmrglt_cl_silent=false
63290b17f1bSmrgexec AS_MESSAGE_LOG_FD>>config.log
63390b17f1bSmrg{
63490b17f1bSmrg  echo
63590b17f1bSmrg  AS_BOX([Running $as_me.])
63690b17f1bSmrg} >&AS_MESSAGE_LOG_FD
6377e6fb56fSmrg
63890b17f1bSmrglt_cl_help="\
63990b17f1bSmrg\`$as_me' creates a local libtool stub from the current configuration,
64090b17f1bSmrgfor use in further configure time tests before the real libtool is
64190b17f1bSmrggenerated.
6427e6fb56fSmrg
64390b17f1bSmrgUsage: $[0] [[OPTIONS]]
6447e6fb56fSmrg
64590b17f1bSmrg  -h, --help      print this help, then exit
64690b17f1bSmrg  -V, --version   print version number, then exit
64790b17f1bSmrg  -q, --quiet     do not print progress messages
64890b17f1bSmrg  -d, --debug     don't remove temporary files
6497e6fb56fSmrg
65090b17f1bSmrgReport bugs to <bug-libtool@gnu.org>."
6517e6fb56fSmrg
65290b17f1bSmrglt_cl_version="\
65390b17f1bSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
65490b17f1bSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
65590b17f1bSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
6567e6fb56fSmrg
65790b17f1bSmrgCopyright (C) 2011 Free Software Foundation, Inc.
65890b17f1bSmrgThis config.lt script is free software; the Free Software Foundation
65990b17f1bSmrggives unlimited permision to copy, distribute and modify it."
6607e6fb56fSmrg
66190b17f1bSmrgwhile test $[#] != 0
66290b17f1bSmrgdo
66390b17f1bSmrg  case $[1] in
66490b17f1bSmrg    --version | --v* | -V )
66590b17f1bSmrg      echo "$lt_cl_version"; exit 0 ;;
66690b17f1bSmrg    --help | --h* | -h )
66790b17f1bSmrg      echo "$lt_cl_help"; exit 0 ;;
66890b17f1bSmrg    --debug | --d* | -d )
66990b17f1bSmrg      debug=: ;;
67090b17f1bSmrg    --quiet | --q* | --silent | --s* | -q )
67190b17f1bSmrg      lt_cl_silent=: ;;
67290b17f1bSmrg
67390b17f1bSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
67490b17f1bSmrgTry \`$[0] --help' for more information.]) ;;
67590b17f1bSmrg
67690b17f1bSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
67790b17f1bSmrgTry \`$[0] --help' for more information.]) ;;
67890b17f1bSmrg  esac
67990b17f1bSmrg  shift
68090b17f1bSmrgdone
6817e6fb56fSmrg
68290b17f1bSmrgif $lt_cl_silent; then
68390b17f1bSmrg  exec AS_MESSAGE_FD>/dev/null
6847e6fb56fSmrgfi
68590b17f1bSmrg_LTEOF
68690b17f1bSmrg
68790b17f1bSmrgcat >>"$CONFIG_LT" <<_LTEOF
68890b17f1bSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
68990b17f1bSmrg_LTEOF
69090b17f1bSmrg
69190b17f1bSmrgcat >>"$CONFIG_LT" <<\_LTEOF
69290b17f1bSmrgAC_MSG_NOTICE([creating $ofile])
69390b17f1bSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
69490b17f1bSmrgAS_EXIT(0)
69590b17f1bSmrg_LTEOF
69690b17f1bSmrgchmod +x "$CONFIG_LT"
69790b17f1bSmrg
69890b17f1bSmrg# configure is writing to config.log, but config.lt does its own redirection,
69990b17f1bSmrg# appending to config.log, which fails on DOS, as config.log is still kept
70090b17f1bSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
70190b17f1bSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
70290b17f1bSmrglt_cl_success=:
70390b17f1bSmrgtest "$silent" = yes &&
70490b17f1bSmrg  lt_config_lt_args="$lt_config_lt_args --quiet"
70590b17f1bSmrgexec AS_MESSAGE_LOG_FD>/dev/null
70690b17f1bSmrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
70790b17f1bSmrgexec AS_MESSAGE_LOG_FD>>config.log
70890b17f1bSmrg$lt_cl_success || AS_EXIT(1)
70990b17f1bSmrg])# LT_OUTPUT
71090b17f1bSmrg
71190b17f1bSmrg
71290b17f1bSmrg# _LT_CONFIG(TAG)
71390b17f1bSmrg# ---------------
71490b17f1bSmrg# If TAG is the built-in tag, create an initial libtool script with a
71590b17f1bSmrg# default configuration from the untagged config vars.  Otherwise add code
71690b17f1bSmrg# to config.status for appending the configuration named by TAG from the
71790b17f1bSmrg# matching tagged config vars.
71890b17f1bSmrgm4_defun([_LT_CONFIG],
71990b17f1bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
72090b17f1bSmrg_LT_CONFIG_SAVE_COMMANDS([
72190b17f1bSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
72290b17f1bSmrg  m4_if(_LT_TAG, [C], [
72390b17f1bSmrg    # See if we are running on zsh, and set the options which allow our
72490b17f1bSmrg    # commands through without removal of \ escapes.
72590b17f1bSmrg    if test -n "${ZSH_VERSION+set}" ; then
72690b17f1bSmrg      setopt NO_GLOB_SUBST
72790b17f1bSmrg    fi
7287e6fb56fSmrg
72990b17f1bSmrg    cfgfile="${ofile}T"
73090b17f1bSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
73190b17f1bSmrg    $RM "$cfgfile"
7327e6fb56fSmrg
73390b17f1bSmrg    cat <<_LT_EOF >> "$cfgfile"
73490b17f1bSmrg#! $SHELL
7357e6fb56fSmrg
73690b17f1bSmrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
73790b17f1bSmrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
73890b17f1bSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
73990b17f1bSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
74090b17f1bSmrg#
74190b17f1bSmrg_LT_COPYING
74290b17f1bSmrg_LT_LIBTOOL_TAGS
7437e6fb56fSmrg
74490b17f1bSmrg# ### BEGIN LIBTOOL CONFIG
74590b17f1bSmrg_LT_LIBTOOL_CONFIG_VARS
74690b17f1bSmrg_LT_LIBTOOL_TAG_VARS
74790b17f1bSmrg# ### END LIBTOOL CONFIG
7487e6fb56fSmrg
74990b17f1bSmrg_LT_EOF
7507e6fb56fSmrg
75190b17f1bSmrg  case $host_os in
75290b17f1bSmrg  aix3*)
75390b17f1bSmrg    cat <<\_LT_EOF >> "$cfgfile"
75490b17f1bSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
75590b17f1bSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
75690b17f1bSmrg# vanish in a puff of smoke.
75790b17f1bSmrgif test "X${COLLECT_NAMES+set}" != Xset; then
75890b17f1bSmrg  COLLECT_NAMES=
75990b17f1bSmrg  export COLLECT_NAMES
76090b17f1bSmrgfi
76190b17f1bSmrg_LT_EOF
7627e6fb56fSmrg    ;;
76390b17f1bSmrg  esac
7647e6fb56fSmrg
76590b17f1bSmrg  _LT_PROG_LTMAIN
7667e6fb56fSmrg
76790b17f1bSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
76890b17f1bSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
76990b17f1bSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
77090b17f1bSmrg  # is reportedly fixed, but why not run on old versions too?
77190b17f1bSmrg  sed '$q' "$ltmain" >> "$cfgfile" \
77290b17f1bSmrg     || (rm -f "$cfgfile"; exit 1)
7737e6fb56fSmrg
77490b17f1bSmrg  _LT_PROG_REPLACE_SHELLFNS
77590b17f1bSmrg
77690b17f1bSmrg   mv -f "$cfgfile" "$ofile" ||
77790b17f1bSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
77890b17f1bSmrg  chmod +x "$ofile"
77990b17f1bSmrg],
78090b17f1bSmrg[cat <<_LT_EOF >> "$ofile"
78190b17f1bSmrg
78290b17f1bSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
78390b17f1bSmrgdnl in a comment (ie after a #).
78490b17f1bSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
78590b17f1bSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
78690b17f1bSmrg# ### END LIBTOOL TAG CONFIG: $1
78790b17f1bSmrg_LT_EOF
78890b17f1bSmrg])dnl /m4_if
78990b17f1bSmrg],
79090b17f1bSmrg[m4_if([$1], [], [
79190b17f1bSmrg    PACKAGE='$PACKAGE'
79290b17f1bSmrg    VERSION='$VERSION'
79390b17f1bSmrg    TIMESTAMP='$TIMESTAMP'
79490b17f1bSmrg    RM='$RM'
79590b17f1bSmrg    ofile='$ofile'], [])
79690b17f1bSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
79790b17f1bSmrg])# _LT_CONFIG
7987e6fb56fSmrg
7997e6fb56fSmrg
80090b17f1bSmrg# LT_SUPPORTED_TAG(TAG)
80190b17f1bSmrg# ---------------------
80290b17f1bSmrg# Trace this macro to discover what tags are supported by the libtool
80390b17f1bSmrg# --tag option, using:
80490b17f1bSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
80590b17f1bSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
80690b17f1bSmrg
80790b17f1bSmrg
80890b17f1bSmrg# C support is built-in for now
80990b17f1bSmrgm4_define([_LT_LANG_C_enabled], [])
81090b17f1bSmrgm4_define([_LT_TAGS], [])
81190b17f1bSmrg
81290b17f1bSmrg
81390b17f1bSmrg# LT_LANG(LANG)
81490b17f1bSmrg# -------------
81590b17f1bSmrg# Enable libtool support for the given language if not already enabled.
81690b17f1bSmrgAC_DEFUN([LT_LANG],
81790b17f1bSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
81890b17f1bSmrgm4_case([$1],
81990b17f1bSmrg  [C],			[_LT_LANG(C)],
82090b17f1bSmrg  [C++],		[_LT_LANG(CXX)],
82190b17f1bSmrg  [Go],			[_LT_LANG(GO)],
82290b17f1bSmrg  [Java],		[_LT_LANG(GCJ)],
82390b17f1bSmrg  [Fortran 77],		[_LT_LANG(F77)],
82490b17f1bSmrg  [Fortran],		[_LT_LANG(FC)],
82590b17f1bSmrg  [Windows Resource],	[_LT_LANG(RC)],
82690b17f1bSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
82790b17f1bSmrg    [_LT_LANG($1)],
82890b17f1bSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
82990b17f1bSmrg])# LT_LANG
83090b17f1bSmrg
83190b17f1bSmrg
83290b17f1bSmrg# _LT_LANG(LANGNAME)
8337e6fb56fSmrg# ------------------
83490b17f1bSmrgm4_defun([_LT_LANG],
83590b17f1bSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
83690b17f1bSmrg  [LT_SUPPORTED_TAG([$1])dnl
83790b17f1bSmrg  m4_append([_LT_TAGS], [$1 ])dnl
83890b17f1bSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
83990b17f1bSmrg  _LT_LANG_$1_CONFIG($1)])dnl
84090b17f1bSmrg])# _LT_LANG
8417e6fb56fSmrg
8427e6fb56fSmrg
84390b17f1bSmrgm4_ifndef([AC_PROG_GO], [
84490b17f1bSmrg# NOTE: This macro has been submitted for inclusion into   #
84590b17f1bSmrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
84690b17f1bSmrg#  a released version of Autoconf we should remove this    #
84790b17f1bSmrg#  macro and use it instead.                               #
84890b17f1bSmrgm4_defun([AC_PROG_GO],
84990b17f1bSmrg[AC_LANG_PUSH(Go)dnl
85090b17f1bSmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
85190b17f1bSmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
85290b17f1bSmrg_AC_ARG_VAR_LDFLAGS()dnl
85390b17f1bSmrgAC_CHECK_TOOL(GOC, gccgo)
85490b17f1bSmrgif test -z "$GOC"; then
85590b17f1bSmrg  if test -n "$ac_tool_prefix"; then
85690b17f1bSmrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
85790b17f1bSmrg  fi
85890b17f1bSmrgfi
85990b17f1bSmrgif test -z "$GOC"; then
86090b17f1bSmrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
86190b17f1bSmrgfi
86290b17f1bSmrg])#m4_defun
86390b17f1bSmrg])#m4_ifndef
8647e6fb56fSmrg
8657e6fb56fSmrg
86690b17f1bSmrg# _LT_LANG_DEFAULT_CONFIG
86790b17f1bSmrg# -----------------------
86890b17f1bSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
86990b17f1bSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
87090b17f1bSmrg  [LT_LANG(CXX)],
87190b17f1bSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
87290b17f1bSmrg
87390b17f1bSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
87490b17f1bSmrg  [LT_LANG(F77)],
87590b17f1bSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
87690b17f1bSmrg
87790b17f1bSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
87890b17f1bSmrg  [LT_LANG(FC)],
87990b17f1bSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
88090b17f1bSmrg
88190b17f1bSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
88290b17f1bSmrgdnl pulling things in needlessly.
88390b17f1bSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
88490b17f1bSmrg  [LT_LANG(GCJ)],
88590b17f1bSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
88690b17f1bSmrg    [LT_LANG(GCJ)],
88790b17f1bSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
88890b17f1bSmrg      [LT_LANG(GCJ)],
88990b17f1bSmrg      [m4_ifdef([AC_PROG_GCJ],
89090b17f1bSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
89190b17f1bSmrg       m4_ifdef([A][M_PROG_GCJ],
89290b17f1bSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
89390b17f1bSmrg       m4_ifdef([LT_PROG_GCJ],
89490b17f1bSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
89590b17f1bSmrg
89690b17f1bSmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
89790b17f1bSmrg  [LT_LANG(GO)],
89890b17f1bSmrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
89990b17f1bSmrg
90090b17f1bSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
90190b17f1bSmrg  [LT_LANG(RC)],
90290b17f1bSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
90390b17f1bSmrg])# _LT_LANG_DEFAULT_CONFIG
90490b17f1bSmrg
90590b17f1bSmrg# Obsolete macros:
90690b17f1bSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
90790b17f1bSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
90890b17f1bSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
90990b17f1bSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
91090b17f1bSmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
91190b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
91290b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
91390b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
91490b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
91590b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
91690b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
91790b17f1bSmrg
91890b17f1bSmrg
91990b17f1bSmrg# _LT_TAG_COMPILER
92090b17f1bSmrg# ----------------
92190b17f1bSmrgm4_defun([_LT_TAG_COMPILER],
92290b17f1bSmrg[AC_REQUIRE([AC_PROG_CC])dnl
9237e6fb56fSmrg
92490b17f1bSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
92590b17f1bSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
92690b17f1bSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
92790b17f1bSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
9287e6fb56fSmrg
92990b17f1bSmrg# If no C compiler was specified, use CC.
93090b17f1bSmrgLTCC=${LTCC-"$CC"}
9317e6fb56fSmrg
93290b17f1bSmrg# If no C compiler flags were specified, use CFLAGS.
93390b17f1bSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
9347e6fb56fSmrg
93590b17f1bSmrg# Allow CC to be a program name with arguments.
93690b17f1bSmrgcompiler=$CC
93790b17f1bSmrg])# _LT_TAG_COMPILER
9387e6fb56fSmrg
9397e6fb56fSmrg
94090b17f1bSmrg# _LT_COMPILER_BOILERPLATE
94190b17f1bSmrg# ------------------------
94290b17f1bSmrg# Check for compiler boilerplate output or warnings with
94390b17f1bSmrg# the simple compiler test code.
94490b17f1bSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
94590b17f1bSmrg[m4_require([_LT_DECL_SED])dnl
94690b17f1bSmrgac_outfile=conftest.$ac_objext
94790b17f1bSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
94890b17f1bSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
94990b17f1bSmrg_lt_compiler_boilerplate=`cat conftest.err`
95090b17f1bSmrg$RM conftest*
95190b17f1bSmrg])# _LT_COMPILER_BOILERPLATE
9527e6fb56fSmrg
9537e6fb56fSmrg
95490b17f1bSmrg# _LT_LINKER_BOILERPLATE
9557e6fb56fSmrg# ----------------------
95690b17f1bSmrg# Check for linker boilerplate output or warnings with
95790b17f1bSmrg# the simple link test code.
95890b17f1bSmrgm4_defun([_LT_LINKER_BOILERPLATE],
95990b17f1bSmrg[m4_require([_LT_DECL_SED])dnl
96090b17f1bSmrgac_outfile=conftest.$ac_objext
96190b17f1bSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
96290b17f1bSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
96390b17f1bSmrg_lt_linker_boilerplate=`cat conftest.err`
96490b17f1bSmrg$RM -r conftest*
96590b17f1bSmrg])# _LT_LINKER_BOILERPLATE
9667e6fb56fSmrg
96790b17f1bSmrg# _LT_REQUIRED_DARWIN_CHECKS
96890b17f1bSmrg# -------------------------
96990b17f1bSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
9707e6fb56fSmrg  case $host_os in
97190b17f1bSmrg    rhapsody* | darwin*)
97290b17f1bSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
97390b17f1bSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
97490b17f1bSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
97590b17f1bSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
97690b17f1bSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
97790b17f1bSmrg    _LT_DECL([], [DSYMUTIL], [1],
97890b17f1bSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
97990b17f1bSmrg    _LT_DECL([], [NMEDIT], [1],
98090b17f1bSmrg      [Tool to change global to local symbols on Mac OS X])
98190b17f1bSmrg    _LT_DECL([], [LIPO], [1],
98290b17f1bSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
98390b17f1bSmrg    _LT_DECL([], [OTOOL], [1],
98490b17f1bSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
98590b17f1bSmrg    _LT_DECL([], [OTOOL64], [1],
98690b17f1bSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
9877e6fb56fSmrg
98890b17f1bSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
98990b17f1bSmrg      [lt_cv_apple_cc_single_mod=no
99090b17f1bSmrg      if test -z "${LT_MULTI_MODULE}"; then
99190b17f1bSmrg	# By default we will add the -single_module flag. You can override
99290b17f1bSmrg	# by either setting the environment variable LT_MULTI_MODULE
99390b17f1bSmrg	# non-empty at configure time, or by adding -multi_module to the
99490b17f1bSmrg	# link flags.
99590b17f1bSmrg	rm -rf libconftest.dylib*
99690b17f1bSmrg	echo "int foo(void){return 1;}" > conftest.c
99790b17f1bSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
99890b17f1bSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
99990b17f1bSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
100090b17f1bSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
100190b17f1bSmrg        _lt_result=$?
100290b17f1bSmrg	# If there is a non-empty error log, and "single_module"
100390b17f1bSmrg	# appears in it, assume the flag caused a linker warning
100490b17f1bSmrg        if test -s conftest.err && $GREP single_module conftest.err; then
100590b17f1bSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
100690b17f1bSmrg	# Otherwise, if the output was created with a 0 exit code from
100790b17f1bSmrg	# the compiler, it worked.
100890b17f1bSmrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
100990b17f1bSmrg	  lt_cv_apple_cc_single_mod=yes
101090b17f1bSmrg	else
101190b17f1bSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
101290b17f1bSmrg	fi
101390b17f1bSmrg	rm -rf libconftest.dylib*
101490b17f1bSmrg	rm -f conftest.*
101590b17f1bSmrg      fi])
10167e6fb56fSmrg
101790b17f1bSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
101890b17f1bSmrg      [lt_cv_ld_exported_symbols_list],
101990b17f1bSmrg      [lt_cv_ld_exported_symbols_list=no
102090b17f1bSmrg      save_LDFLAGS=$LDFLAGS
102190b17f1bSmrg      echo "_main" > conftest.sym
102290b17f1bSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
102390b17f1bSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
102490b17f1bSmrg	[lt_cv_ld_exported_symbols_list=yes],
102590b17f1bSmrg	[lt_cv_ld_exported_symbols_list=no])
102690b17f1bSmrg	LDFLAGS="$save_LDFLAGS"
10277e6fb56fSmrg    ])
10287e6fb56fSmrg
102990b17f1bSmrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
103090b17f1bSmrg      [lt_cv_ld_force_load=no
103190b17f1bSmrg      cat > conftest.c << _LT_EOF
103290b17f1bSmrgint forced_loaded() { return 2;}
103390b17f1bSmrg_LT_EOF
103490b17f1bSmrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
103590b17f1bSmrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
103690b17f1bSmrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
103790b17f1bSmrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
103890b17f1bSmrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
103990b17f1bSmrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
104090b17f1bSmrg      cat > conftest.c << _LT_EOF
104190b17f1bSmrgint main() { return 0;}
104290b17f1bSmrg_LT_EOF
104390b17f1bSmrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
104490b17f1bSmrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
104590b17f1bSmrg      _lt_result=$?
104690b17f1bSmrg      if test -s conftest.err && $GREP force_load conftest.err; then
104790b17f1bSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
104890b17f1bSmrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
104990b17f1bSmrg	lt_cv_ld_force_load=yes
105090b17f1bSmrg      else
105190b17f1bSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
105290b17f1bSmrg      fi
105390b17f1bSmrg        rm -f conftest.err libconftest.a conftest conftest.c
105490b17f1bSmrg        rm -rf conftest.dSYM
105590b17f1bSmrg    ])
105690b17f1bSmrg    case $host_os in
105790b17f1bSmrg    rhapsody* | darwin1.[[012]])
105890b17f1bSmrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
105990b17f1bSmrg    darwin1.*)
106090b17f1bSmrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
106190b17f1bSmrg    darwin*) # darwin 5.x on
106290b17f1bSmrg      # if running on 10.5 or later, the deployment target defaults
106390b17f1bSmrg      # to the OS version, if on x86, and 10.4, the deployment
106490b17f1bSmrg      # target defaults to 10.4. Don't you love it?
106590b17f1bSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
106690b17f1bSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
106790b17f1bSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
106890b17f1bSmrg	10.[[012]]*)
106990b17f1bSmrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
107090b17f1bSmrg	10.*)
107190b17f1bSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
107290b17f1bSmrg      esac
107390b17f1bSmrg    ;;
107490b17f1bSmrg  esac
107590b17f1bSmrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
107690b17f1bSmrg      _lt_dar_single_mod='$single_module'
107790b17f1bSmrg    fi
107890b17f1bSmrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
107990b17f1bSmrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
108090b17f1bSmrg    else
108190b17f1bSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
108290b17f1bSmrg    fi
108390b17f1bSmrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
108490b17f1bSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
108590b17f1bSmrg    else
108690b17f1bSmrg      _lt_dsymutil=
108790b17f1bSmrg    fi
10887e6fb56fSmrg    ;;
10897e6fb56fSmrg  esac
109090b17f1bSmrg])
10917e6fb56fSmrg
109290b17f1bSmrg
109390b17f1bSmrg# _LT_DARWIN_LINKER_FEATURES([TAG])
109490b17f1bSmrg# ---------------------------------
109590b17f1bSmrg# Checks for linker and compiler features on darwin
109690b17f1bSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
109790b17f1bSmrg[
109890b17f1bSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
109990b17f1bSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
110090b17f1bSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
110190b17f1bSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
110290b17f1bSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
110390b17f1bSmrg  if test "$lt_cv_ld_force_load" = "yes"; then
110490b17f1bSmrg    _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\"`'
110590b17f1bSmrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
110690b17f1bSmrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
11077e6fb56fSmrg  else
110890b17f1bSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
11097e6fb56fSmrg  fi
111090b17f1bSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
111190b17f1bSmrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
111290b17f1bSmrg  case $cc_basename in
111390b17f1bSmrg     ifort*) _lt_dar_can_shared=yes ;;
111490b17f1bSmrg     *) _lt_dar_can_shared=$GCC ;;
111590b17f1bSmrg  esac
111690b17f1bSmrg  if test "$_lt_dar_can_shared" = "yes"; then
111790b17f1bSmrg    output_verbose_link_cmd=func_echo_all
111890b17f1bSmrg    _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}"
111990b17f1bSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
112090b17f1bSmrg    _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}"
112190b17f1bSmrg    _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}"
112290b17f1bSmrg    m4_if([$1], [CXX],
112390b17f1bSmrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
112490b17f1bSmrg      _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}"
112590b17f1bSmrg      _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}"
112690b17f1bSmrg    fi
112790b17f1bSmrg],[])
112890b17f1bSmrg  else
112990b17f1bSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
113090b17f1bSmrg  fi
113190b17f1bSmrg])
11327e6fb56fSmrg
113390b17f1bSmrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
113490b17f1bSmrg# ----------------------------------
113590b17f1bSmrg# Links a minimal program and checks the executable
113690b17f1bSmrg# for the system default hardcoded library path. In most cases,
113790b17f1bSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
113890b17f1bSmrg# the location of the communication and MPI libs are included too.
113990b17f1bSmrg# If we don't find anything, use the default library path according
114090b17f1bSmrg# to the aix ld manual.
114190b17f1bSmrg# Store the results from the different compilers for each TAGNAME.
114290b17f1bSmrg# Allow to override them for all tags through lt_cv_aix_libpath.
114390b17f1bSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
114490b17f1bSmrg[m4_require([_LT_DECL_SED])dnl
114590b17f1bSmrgif test "${lt_cv_aix_libpath+set}" = set; then
114690b17f1bSmrg  aix_libpath=$lt_cv_aix_libpath
114790b17f1bSmrgelse
114890b17f1bSmrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
114990b17f1bSmrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
115090b17f1bSmrg  lt_aix_libpath_sed='[
115190b17f1bSmrg      /Import File Strings/,/^$/ {
115290b17f1bSmrg	  /^0/ {
115390b17f1bSmrg	      s/^0  *\([^ ]*\) *$/\1/
115490b17f1bSmrg	      p
115590b17f1bSmrg	  }
115690b17f1bSmrg      }]'
115790b17f1bSmrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
115890b17f1bSmrg  # Check for a 64-bit object if we didn't find anything.
115990b17f1bSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
116090b17f1bSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
116190b17f1bSmrg  fi],[])
116290b17f1bSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
116390b17f1bSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
116490b17f1bSmrg  fi
116590b17f1bSmrg  ])
116690b17f1bSmrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
116790b17f1bSmrgfi
116890b17f1bSmrg])# _LT_SYS_MODULE_PATH_AIX
11697e6fb56fSmrg
11707e6fb56fSmrg
117190b17f1bSmrg# _LT_SHELL_INIT(ARG)
117290b17f1bSmrg# -------------------
117390b17f1bSmrgm4_define([_LT_SHELL_INIT],
117490b17f1bSmrg[m4_divert_text([M4SH-INIT], [$1
117590b17f1bSmrg])])# _LT_SHELL_INIT
11767e6fb56fSmrg
117790b17f1bSmrg
117890b17f1bSmrg
117990b17f1bSmrg# _LT_PROG_ECHO_BACKSLASH
118090b17f1bSmrg# -----------------------
118190b17f1bSmrg# Find how we can fake an echo command that does not interpret backslash.
118290b17f1bSmrg# In particular, with Autoconf 2.60 or later we add some code to the start
118390b17f1bSmrg# of the generated configure script which will find a shell with a builtin
118490b17f1bSmrg# printf (which we can use as an echo command).
118590b17f1bSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
118690b17f1bSmrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
118790b17f1bSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
118890b17f1bSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
118990b17f1bSmrg
119090b17f1bSmrgAC_MSG_CHECKING([how to print strings])
119190b17f1bSmrg# Test print first, because it will be a builtin if present.
119290b17f1bSmrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
119390b17f1bSmrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
119490b17f1bSmrg  ECHO='print -r --'
119590b17f1bSmrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
119690b17f1bSmrg  ECHO='printf %s\n'
119790b17f1bSmrgelse
119890b17f1bSmrg  # Use this function as a fallback that always works.
119990b17f1bSmrg  func_fallback_echo ()
120090b17f1bSmrg  {
120190b17f1bSmrg    eval 'cat <<_LTECHO_EOF
120290b17f1bSmrg$[]1
120390b17f1bSmrg_LTECHO_EOF'
120490b17f1bSmrg  }
120590b17f1bSmrg  ECHO='func_fallback_echo'
120690b17f1bSmrgfi
120790b17f1bSmrg
120890b17f1bSmrg# func_echo_all arg...
120990b17f1bSmrg# Invoke $ECHO with all args, space-separated.
121090b17f1bSmrgfunc_echo_all ()
121190b17f1bSmrg{
121290b17f1bSmrg    $ECHO "$*" 
121390b17f1bSmrg}
121490b17f1bSmrg
121590b17f1bSmrgcase "$ECHO" in
121690b17f1bSmrg  printf*) AC_MSG_RESULT([printf]) ;;
121790b17f1bSmrg  print*) AC_MSG_RESULT([print -r]) ;;
121890b17f1bSmrg  *) AC_MSG_RESULT([cat]) ;;
121990b17f1bSmrgesac
122090b17f1bSmrg
122190b17f1bSmrgm4_ifdef([_AS_DETECT_SUGGESTED],
122290b17f1bSmrg[_AS_DETECT_SUGGESTED([
122390b17f1bSmrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
122490b17f1bSmrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
122590b17f1bSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
122690b17f1bSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
122790b17f1bSmrg    PATH=/empty FPATH=/empty; export PATH FPATH
122890b17f1bSmrg    test "X`printf %s $ECHO`" = "X$ECHO" \
122990b17f1bSmrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
123090b17f1bSmrg
123190b17f1bSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
123290b17f1bSmrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
123390b17f1bSmrg])# _LT_PROG_ECHO_BACKSLASH
123490b17f1bSmrg
123590b17f1bSmrg
123690b17f1bSmrg# _LT_WITH_SYSROOT
123790b17f1bSmrg# ----------------
123890b17f1bSmrgAC_DEFUN([_LT_WITH_SYSROOT],
123990b17f1bSmrg[AC_MSG_CHECKING([for sysroot])
124090b17f1bSmrgAC_ARG_WITH([sysroot],
124190b17f1bSmrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
124290b17f1bSmrg                        (or the compiler's sysroot if not specified).],
124390b17f1bSmrg[], [with_sysroot=no])
124490b17f1bSmrg
124590b17f1bSmrgdnl lt_sysroot will always be passed unquoted.  We quote it here
124690b17f1bSmrgdnl in case the user passed a directory name.
124790b17f1bSmrglt_sysroot=
124890b17f1bSmrgcase ${with_sysroot} in #(
124990b17f1bSmrg yes)
125090b17f1bSmrg   if test "$GCC" = yes; then
125190b17f1bSmrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
125290b17f1bSmrg   fi
125390b17f1bSmrg   ;; #(
125490b17f1bSmrg /*)
125590b17f1bSmrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
125690b17f1bSmrg   ;; #(
125790b17f1bSmrg no|'')
125890b17f1bSmrg   ;; #(
125990b17f1bSmrg *)
126090b17f1bSmrg   AC_MSG_RESULT([${with_sysroot}])
126190b17f1bSmrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
126290b17f1bSmrg   ;;
126390b17f1bSmrgesac
126490b17f1bSmrg
126590b17f1bSmrg AC_MSG_RESULT([${lt_sysroot:-no}])
126690b17f1bSmrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
126790b17f1bSmrg[dependent libraries, and in which our libraries should be installed.])])
126890b17f1bSmrg
126990b17f1bSmrg# _LT_ENABLE_LOCK
127090b17f1bSmrg# ---------------
127190b17f1bSmrgm4_defun([_LT_ENABLE_LOCK],
127290b17f1bSmrg[AC_ARG_ENABLE([libtool-lock],
127390b17f1bSmrg  [AS_HELP_STRING([--disable-libtool-lock],
127490b17f1bSmrg    [avoid locking (might break parallel builds)])])
127590b17f1bSmrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
127690b17f1bSmrg
127790b17f1bSmrg# Some flags need to be propagated to the compiler or linker for good
127890b17f1bSmrg# libtool support.
127990b17f1bSmrgcase $host in
128090b17f1bSmrgia64-*-hpux*)
128190b17f1bSmrg  # Find out which ABI we are using.
128290b17f1bSmrg  echo 'int i;' > conftest.$ac_ext
128390b17f1bSmrg  if AC_TRY_EVAL(ac_compile); then
128490b17f1bSmrg    case `/usr/bin/file conftest.$ac_objext` in
128590b17f1bSmrg      *ELF-32*)
128690b17f1bSmrg	HPUX_IA64_MODE="32"
128790b17f1bSmrg	;;
128890b17f1bSmrg      *ELF-64*)
128990b17f1bSmrg	HPUX_IA64_MODE="64"
129090b17f1bSmrg	;;
129190b17f1bSmrg    esac
129290b17f1bSmrg  fi
129390b17f1bSmrg  rm -rf conftest*
129490b17f1bSmrg  ;;
129590b17f1bSmrg*-*-irix6*)
129690b17f1bSmrg  # Find out which ABI we are using.
129790b17f1bSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
129890b17f1bSmrg  if AC_TRY_EVAL(ac_compile); then
129990b17f1bSmrg    if test "$lt_cv_prog_gnu_ld" = yes; then
130090b17f1bSmrg      case `/usr/bin/file conftest.$ac_objext` in
130190b17f1bSmrg	*32-bit*)
130290b17f1bSmrg	  LD="${LD-ld} -melf32bsmip"
130390b17f1bSmrg	  ;;
130490b17f1bSmrg	*N32*)
130590b17f1bSmrg	  LD="${LD-ld} -melf32bmipn32"
130690b17f1bSmrg	  ;;
130790b17f1bSmrg	*64-bit*)
130890b17f1bSmrg	  LD="${LD-ld} -melf64bmip"
130990b17f1bSmrg	;;
131090b17f1bSmrg      esac
131190b17f1bSmrg    else
131290b17f1bSmrg      case `/usr/bin/file conftest.$ac_objext` in
131390b17f1bSmrg	*32-bit*)
131490b17f1bSmrg	  LD="${LD-ld} -32"
131590b17f1bSmrg	  ;;
131690b17f1bSmrg	*N32*)
131790b17f1bSmrg	  LD="${LD-ld} -n32"
131890b17f1bSmrg	  ;;
131990b17f1bSmrg	*64-bit*)
132090b17f1bSmrg	  LD="${LD-ld} -64"
132190b17f1bSmrg	  ;;
132290b17f1bSmrg      esac
13237e6fb56fSmrg    fi
132490b17f1bSmrg  fi
132590b17f1bSmrg  rm -rf conftest*
132690b17f1bSmrg  ;;
13277e6fb56fSmrg
132890b17f1bSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
132990b17f1bSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
133090b17f1bSmrg  # Find out which ABI we are using.
133190b17f1bSmrg  echo 'int i;' > conftest.$ac_ext
133290b17f1bSmrg  if AC_TRY_EVAL(ac_compile); then
133390b17f1bSmrg    case `/usr/bin/file conftest.o` in
133490b17f1bSmrg      *32-bit*)
133590b17f1bSmrg	case $host in
133690b17f1bSmrg	  x86_64-*kfreebsd*-gnu)
133790b17f1bSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
133890b17f1bSmrg	    ;;
133990b17f1bSmrg	  x86_64-*linux*)
134090b17f1bSmrg	    LD="${LD-ld} -m elf_i386"
134190b17f1bSmrg	    ;;
134290b17f1bSmrg	  ppc64-*linux*|powerpc64-*linux*)
134390b17f1bSmrg	    LD="${LD-ld} -m elf32ppclinux"
134490b17f1bSmrg	    ;;
134590b17f1bSmrg	  s390x-*linux*)
134690b17f1bSmrg	    LD="${LD-ld} -m elf_s390"
134790b17f1bSmrg	    ;;
134890b17f1bSmrg	  sparc64-*linux*)
134990b17f1bSmrg	    LD="${LD-ld} -m elf32_sparc"
135090b17f1bSmrg	    ;;
135190b17f1bSmrg	esac
135290b17f1bSmrg	;;
135390b17f1bSmrg      *64-bit*)
135490b17f1bSmrg	case $host in
135590b17f1bSmrg	  x86_64-*kfreebsd*-gnu)
135690b17f1bSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
135790b17f1bSmrg	    ;;
135890b17f1bSmrg	  x86_64-*linux*)
135990b17f1bSmrg	    LD="${LD-ld} -m elf_x86_64"
136090b17f1bSmrg	    ;;
136190b17f1bSmrg	  ppc*-*linux*|powerpc*-*linux*)
136290b17f1bSmrg	    LD="${LD-ld} -m elf64ppc"
136390b17f1bSmrg	    ;;
136490b17f1bSmrg	  s390*-*linux*|s390*-*tpf*)
136590b17f1bSmrg	    LD="${LD-ld} -m elf64_s390"
136690b17f1bSmrg	    ;;
136790b17f1bSmrg	  sparc*-*linux*)
136890b17f1bSmrg	    LD="${LD-ld} -m elf64_sparc"
136990b17f1bSmrg	    ;;
137090b17f1bSmrg	esac
137190b17f1bSmrg	;;
137290b17f1bSmrg    esac
137390b17f1bSmrg  fi
137490b17f1bSmrg  rm -rf conftest*
137590b17f1bSmrg  ;;
13767e6fb56fSmrg
137790b17f1bSmrg*-*-sco3.2v5*)
137890b17f1bSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
137990b17f1bSmrg  SAVE_CFLAGS="$CFLAGS"
138090b17f1bSmrg  CFLAGS="$CFLAGS -belf"
138190b17f1bSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
138290b17f1bSmrg    [AC_LANG_PUSH(C)
138390b17f1bSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
138490b17f1bSmrg     AC_LANG_POP])
138590b17f1bSmrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
138690b17f1bSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
138790b17f1bSmrg    CFLAGS="$SAVE_CFLAGS"
138890b17f1bSmrg  fi
138990b17f1bSmrg  ;;
139090b17f1bSmrg*-*solaris*)
139190b17f1bSmrg  # Find out which ABI we are using.
139290b17f1bSmrg  echo 'int i;' > conftest.$ac_ext
139390b17f1bSmrg  if AC_TRY_EVAL(ac_compile); then
139490b17f1bSmrg    case `/usr/bin/file conftest.o` in
139590b17f1bSmrg    *64-bit*)
139690b17f1bSmrg      case $lt_cv_prog_gnu_ld in
139790b17f1bSmrg      yes*)
139890b17f1bSmrg        case $host in
139990b17f1bSmrg        i?86-*-solaris*)
140090b17f1bSmrg          LD="${LD-ld} -m elf_x86_64"
140190b17f1bSmrg          ;;
140290b17f1bSmrg        sparc*-*-solaris*)
140390b17f1bSmrg          LD="${LD-ld} -m elf64_sparc"
140490b17f1bSmrg          ;;
140590b17f1bSmrg        esac
140690b17f1bSmrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
140790b17f1bSmrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
140890b17f1bSmrg          LD="${LD-ld}_sol2"
140990b17f1bSmrg        fi
141090b17f1bSmrg        ;;
141190b17f1bSmrg      *)
141290b17f1bSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
141390b17f1bSmrg	  LD="${LD-ld} -64"
141490b17f1bSmrg	fi
141590b17f1bSmrg	;;
141690b17f1bSmrg      esac
141790b17f1bSmrg      ;;
141890b17f1bSmrg    esac
141990b17f1bSmrg  fi
142090b17f1bSmrg  rm -rf conftest*
142190b17f1bSmrg  ;;
142290b17f1bSmrgesac
14237e6fb56fSmrg
142490b17f1bSmrgneed_locks="$enable_libtool_lock"
142590b17f1bSmrg])# _LT_ENABLE_LOCK
142690b17f1bSmrg
142790b17f1bSmrg
142890b17f1bSmrg# _LT_PROG_AR
142990b17f1bSmrg# -----------
143090b17f1bSmrgm4_defun([_LT_PROG_AR],
143190b17f1bSmrg[AC_CHECK_TOOLS(AR, [ar], false)
143290b17f1bSmrg: ${AR=ar}
143390b17f1bSmrg: ${AR_FLAGS=cru}
143490b17f1bSmrg_LT_DECL([], [AR], [1], [The archiver])
143590b17f1bSmrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
143690b17f1bSmrg
143790b17f1bSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
143890b17f1bSmrg  [lt_cv_ar_at_file=no
143990b17f1bSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
144090b17f1bSmrg     [echo conftest.$ac_objext > conftest.lst
144190b17f1bSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
144290b17f1bSmrg      AC_TRY_EVAL([lt_ar_try])
144390b17f1bSmrg      if test "$ac_status" -eq 0; then
144490b17f1bSmrg	# Ensure the archiver fails upon bogus file names.
144590b17f1bSmrg	rm -f conftest.$ac_objext libconftest.a
144690b17f1bSmrg	AC_TRY_EVAL([lt_ar_try])
144790b17f1bSmrg	if test "$ac_status" -ne 0; then
144890b17f1bSmrg          lt_cv_ar_at_file=@
144990b17f1bSmrg        fi
145090b17f1bSmrg      fi
145190b17f1bSmrg      rm -f conftest.* libconftest.a
145290b17f1bSmrg     ])
145390b17f1bSmrg  ])
145490b17f1bSmrg
145590b17f1bSmrgif test "x$lt_cv_ar_at_file" = xno; then
145690b17f1bSmrg  archiver_list_spec=
145790b17f1bSmrgelse
145890b17f1bSmrg  archiver_list_spec=$lt_cv_ar_at_file
145990b17f1bSmrgfi
146090b17f1bSmrg_LT_DECL([], [archiver_list_spec], [1],
146190b17f1bSmrg  [How to feed a file listing to the archiver])
146290b17f1bSmrg])# _LT_PROG_AR
146390b17f1bSmrg
146490b17f1bSmrg
146590b17f1bSmrg# _LT_CMD_OLD_ARCHIVE
146690b17f1bSmrg# -------------------
146790b17f1bSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
146890b17f1bSmrg[_LT_PROG_AR
146990b17f1bSmrg
147090b17f1bSmrgAC_CHECK_TOOL(STRIP, strip, :)
147190b17f1bSmrgtest -z "$STRIP" && STRIP=:
147290b17f1bSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
147390b17f1bSmrg
147490b17f1bSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
147590b17f1bSmrgtest -z "$RANLIB" && RANLIB=:
147690b17f1bSmrg_LT_DECL([], [RANLIB], [1],
147790b17f1bSmrg    [Commands used to install an old-style archive])
147890b17f1bSmrg
147990b17f1bSmrg# Determine commands to create old-style static archives.
148090b17f1bSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
148190b17f1bSmrgold_postinstall_cmds='chmod 644 $oldlib'
148290b17f1bSmrgold_postuninstall_cmds=
148390b17f1bSmrg
148490b17f1bSmrgif test -n "$RANLIB"; then
148590b17f1bSmrg  case $host_os in
148690b17f1bSmrg  openbsd*)
148790b17f1bSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
148890b17f1bSmrg    ;;
148990b17f1bSmrg  *)
149090b17f1bSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
149190b17f1bSmrg    ;;
14927e6fb56fSmrg  esac
149390b17f1bSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
14947e6fb56fSmrgfi
149590b17f1bSmrg
149690b17f1bSmrgcase $host_os in
149790b17f1bSmrg  darwin*)
149890b17f1bSmrg    lock_old_archive_extraction=yes ;;
149990b17f1bSmrg  *)
150090b17f1bSmrg    lock_old_archive_extraction=no ;;
150190b17f1bSmrgesac
150290b17f1bSmrg_LT_DECL([], [old_postinstall_cmds], [2])
150390b17f1bSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
150490b17f1bSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
150590b17f1bSmrg    [Commands used to build an old-style archive])
150690b17f1bSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
150790b17f1bSmrg    [Whether to use a lock for old archive extraction])
150890b17f1bSmrg])# _LT_CMD_OLD_ARCHIVE
15097e6fb56fSmrg
15107e6fb56fSmrg
151190b17f1bSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
151290b17f1bSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
151390b17f1bSmrg# ----------------------------------------------------------------
151490b17f1bSmrg# Check whether the given compiler option works
151590b17f1bSmrgAC_DEFUN([_LT_COMPILER_OPTION],
151690b17f1bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
151790b17f1bSmrgm4_require([_LT_DECL_SED])dnl
151890b17f1bSmrgAC_CACHE_CHECK([$1], [$2],
151990b17f1bSmrg  [$2=no
152090b17f1bSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
15217e6fb56fSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
152290b17f1bSmrg   lt_compiler_flag="$3"
15237e6fb56fSmrg   # Insert the option either (1) after the last *FLAGS variable, or
15247e6fb56fSmrg   # (2) before a word containing "conftest.", or (3) at the end.
15257e6fb56fSmrg   # Note that $ac_compile itself does not contain backslashes and begins
15267e6fb56fSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
152790b17f1bSmrg   # The option is referenced via a variable to avoid confusing sed.
15287e6fb56fSmrg   lt_compile=`echo "$ac_compile" | $SED \
15297e6fb56fSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
15307e6fb56fSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
15317e6fb56fSmrg   -e 's:$: $lt_compiler_flag:'`
153290b17f1bSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
153390b17f1bSmrg   (eval "$lt_compile" 2>conftest.err)
15347e6fb56fSmrg   ac_status=$?
153590b17f1bSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
153690b17f1bSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
153790b17f1bSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
15387e6fb56fSmrg     # The compiler can only warn and ignore the option if not recognized
153990b17f1bSmrg     # So say no if there are warnings other than the usual output.
154090b17f1bSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
154190b17f1bSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
154290b17f1bSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
154390b17f1bSmrg       $2=yes
15447e6fb56fSmrg     fi
15457e6fb56fSmrg   fi
154690b17f1bSmrg   $RM conftest*
15477e6fb56fSmrg])
15487e6fb56fSmrg
154990b17f1bSmrgif test x"[$]$2" = xyes; then
155090b17f1bSmrg    m4_if([$5], , :, [$5])
15517e6fb56fSmrgelse
155290b17f1bSmrg    m4_if([$6], , :, [$6])
15537e6fb56fSmrgfi
155490b17f1bSmrg])# _LT_COMPILER_OPTION
15557e6fb56fSmrg
155690b17f1bSmrg# Old name:
155790b17f1bSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
155890b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
155990b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
15607e6fb56fSmrg
15617e6fb56fSmrg
156290b17f1bSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
156390b17f1bSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
156490b17f1bSmrg# ----------------------------------------------------
156590b17f1bSmrg# Check whether the given linker option works
156690b17f1bSmrgAC_DEFUN([_LT_LINKER_OPTION],
156790b17f1bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
156890b17f1bSmrgm4_require([_LT_DECL_SED])dnl
156990b17f1bSmrgAC_CACHE_CHECK([$1], [$2],
157090b17f1bSmrg  [$2=no
157190b17f1bSmrg   save_LDFLAGS="$LDFLAGS"
157290b17f1bSmrg   LDFLAGS="$LDFLAGS $3"
157390b17f1bSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
157490b17f1bSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
157590b17f1bSmrg     # The linker can only warn and ignore the option if not recognized
157690b17f1bSmrg     # So say no if there are warnings
157790b17f1bSmrg     if test -s conftest.err; then
157890b17f1bSmrg       # Append any errors to the config.log.
157990b17f1bSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
158090b17f1bSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
158190b17f1bSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
158290b17f1bSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
158390b17f1bSmrg         $2=yes
158490b17f1bSmrg       fi
158590b17f1bSmrg     else
158690b17f1bSmrg       $2=yes
158790b17f1bSmrg     fi
158890b17f1bSmrg   fi
158990b17f1bSmrg   $RM -r conftest*
159090b17f1bSmrg   LDFLAGS="$save_LDFLAGS"
159190b17f1bSmrg])
15927e6fb56fSmrg
159390b17f1bSmrgif test x"[$]$2" = xyes; then
159490b17f1bSmrg    m4_if([$4], , :, [$4])
15957e6fb56fSmrgelse
159690b17f1bSmrg    m4_if([$5], , :, [$5])
15977e6fb56fSmrgfi
159890b17f1bSmrg])# _LT_LINKER_OPTION
15997e6fb56fSmrg
160090b17f1bSmrg# Old name:
160190b17f1bSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
160290b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
160390b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
16047e6fb56fSmrg
16057e6fb56fSmrg
160690b17f1bSmrg# LT_CMD_MAX_LEN
160790b17f1bSmrg#---------------
160890b17f1bSmrgAC_DEFUN([LT_CMD_MAX_LEN],
160990b17f1bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
161090b17f1bSmrg# find the maximum length of command line arguments
161190b17f1bSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
161290b17f1bSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
161390b17f1bSmrg  i=0
161490b17f1bSmrg  teststring="ABCD"
16157e6fb56fSmrg
161690b17f1bSmrg  case $build_os in
161790b17f1bSmrg  msdosdjgpp*)
161890b17f1bSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
161990b17f1bSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
162090b17f1bSmrg    # during glob expansion).  Even if it were fixed, the result of this
162190b17f1bSmrg    # check would be larger than it should be.
162290b17f1bSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
162390b17f1bSmrg    ;;
16247e6fb56fSmrg
162590b17f1bSmrg  gnu*)
162690b17f1bSmrg    # Under GNU Hurd, this test is not required because there is
162790b17f1bSmrg    # no limit to the length of command line arguments.
162890b17f1bSmrg    # Libtool will interpret -1 as no limit whatsoever
162990b17f1bSmrg    lt_cv_sys_max_cmd_len=-1;
163090b17f1bSmrg    ;;
16317e6fb56fSmrg
163290b17f1bSmrg  cygwin* | mingw* | cegcc*)
163390b17f1bSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
163490b17f1bSmrg    # about 5 minutes as the teststring grows exponentially.
163590b17f1bSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
163690b17f1bSmrg    # you end up with a "frozen" computer, even though with patience
163790b17f1bSmrg    # the test eventually succeeds (with a max line length of 256k).
163890b17f1bSmrg    # Instead, let's just punt: use the minimum linelength reported by
163990b17f1bSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
164090b17f1bSmrg    lt_cv_sys_max_cmd_len=8192;
164190b17f1bSmrg    ;;
16427e6fb56fSmrg
164390b17f1bSmrg  mint*)
164490b17f1bSmrg    # On MiNT this can take a long time and run out of memory.
164590b17f1bSmrg    lt_cv_sys_max_cmd_len=8192;
164690b17f1bSmrg    ;;
16477e6fb56fSmrg
164890b17f1bSmrg  amigaos*)
164990b17f1bSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
165090b17f1bSmrg    # So we just punt and use a minimum line length of 8192.
165190b17f1bSmrg    lt_cv_sys_max_cmd_len=8192;
165290b17f1bSmrg    ;;
16537e6fb56fSmrg
165490b17f1bSmrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
165590b17f1bSmrg    # This has been around since 386BSD, at least.  Likely further.
165690b17f1bSmrg    if test -x /sbin/sysctl; then
165790b17f1bSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
165890b17f1bSmrg    elif test -x /usr/sbin/sysctl; then
165990b17f1bSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
16607e6fb56fSmrg    else
166190b17f1bSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
16627e6fb56fSmrg    fi
166390b17f1bSmrg    # And add a safety zone
166490b17f1bSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
166590b17f1bSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
166690b17f1bSmrg    ;;
16677e6fb56fSmrg
166890b17f1bSmrg  interix*)
166990b17f1bSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
167090b17f1bSmrg    lt_cv_sys_max_cmd_len=196608
167190b17f1bSmrg    ;;
16727e6fb56fSmrg
167390b17f1bSmrg  os2*)
167490b17f1bSmrg    # The test takes a long time on OS/2.
167590b17f1bSmrg    lt_cv_sys_max_cmd_len=8192
167690b17f1bSmrg    ;;
16777e6fb56fSmrg
167890b17f1bSmrg  osf*)
167990b17f1bSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
168090b17f1bSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
168190b17f1bSmrg    # nice to cause kernel panics so lets avoid the loop below.
168290b17f1bSmrg    # First set a reasonable default.
168390b17f1bSmrg    lt_cv_sys_max_cmd_len=16384
168490b17f1bSmrg    #
168590b17f1bSmrg    if test -x /sbin/sysconfig; then
168690b17f1bSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
168790b17f1bSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
168890b17f1bSmrg      esac
168990b17f1bSmrg    fi
169090b17f1bSmrg    ;;
169190b17f1bSmrg  sco3.2v5*)
169290b17f1bSmrg    lt_cv_sys_max_cmd_len=102400
169390b17f1bSmrg    ;;
169490b17f1bSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
169590b17f1bSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
169690b17f1bSmrg    if test -n "$kargmax"; then
169790b17f1bSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
169890b17f1bSmrg    else
169990b17f1bSmrg      lt_cv_sys_max_cmd_len=32768
170090b17f1bSmrg    fi
17017e6fb56fSmrg    ;;
17027e6fb56fSmrg  *)
170390b17f1bSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
170490b17f1bSmrg    if test -n "$lt_cv_sys_max_cmd_len"; then
170590b17f1bSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
170690b17f1bSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
170790b17f1bSmrg    else
170890b17f1bSmrg      # Make teststring a little bigger before we do anything with it.
170990b17f1bSmrg      # a 1K string should be a reasonable start.
171090b17f1bSmrg      for i in 1 2 3 4 5 6 7 8 ; do
171190b17f1bSmrg        teststring=$teststring$teststring
171290b17f1bSmrg      done
171390b17f1bSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
171490b17f1bSmrg      # If test is not a shell built-in, we'll probably end up computing a
171590b17f1bSmrg      # maximum length that is only half of the actual maximum length, but
171690b17f1bSmrg      # we can't tell.
171790b17f1bSmrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
171890b17f1bSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
171990b17f1bSmrg	      test $i != 17 # 1/2 MB should be enough
172090b17f1bSmrg      do
172190b17f1bSmrg        i=`expr $i + 1`
172290b17f1bSmrg        teststring=$teststring$teststring
172390b17f1bSmrg      done
172490b17f1bSmrg      # Only check the string length outside the loop.
172590b17f1bSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
172690b17f1bSmrg      teststring=
172790b17f1bSmrg      # Add a significant safety factor because C++ compilers can tack on
172890b17f1bSmrg      # massive amounts of additional arguments before passing them to the
172990b17f1bSmrg      # linker.  It appears as though 1/2 is a usable value.
173090b17f1bSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
173190b17f1bSmrg    fi
17327e6fb56fSmrg    ;;
17337e6fb56fSmrg  esac
173490b17f1bSmrg])
173590b17f1bSmrgif test -n $lt_cv_sys_max_cmd_len ; then
173690b17f1bSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
173790b17f1bSmrgelse
173890b17f1bSmrg  AC_MSG_RESULT(none)
173990b17f1bSmrgfi
174090b17f1bSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
174190b17f1bSmrg_LT_DECL([], [max_cmd_len], [0],
174290b17f1bSmrg    [What is the maximum length of a command?])
174390b17f1bSmrg])# LT_CMD_MAX_LEN
17447e6fb56fSmrg
174590b17f1bSmrg# Old name:
174690b17f1bSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
174790b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
174890b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
17497e6fb56fSmrg
17507e6fb56fSmrg
175190b17f1bSmrg# _LT_HEADER_DLFCN
175290b17f1bSmrg# ----------------
175390b17f1bSmrgm4_defun([_LT_HEADER_DLFCN],
175490b17f1bSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
175590b17f1bSmrg])# _LT_HEADER_DLFCN
17567e6fb56fSmrg
175790b17f1bSmrg
175890b17f1bSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
175990b17f1bSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
176090b17f1bSmrg# ----------------------------------------------------------------
176190b17f1bSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
176290b17f1bSmrg[m4_require([_LT_HEADER_DLFCN])dnl
176390b17f1bSmrgif test "$cross_compiling" = yes; then :
176490b17f1bSmrg  [$4]
176590b17f1bSmrgelse
176690b17f1bSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
176790b17f1bSmrg  lt_status=$lt_dlunknown
176890b17f1bSmrg  cat > conftest.$ac_ext <<_LT_EOF
176990b17f1bSmrg[#line $LINENO "configure"
177090b17f1bSmrg#include "confdefs.h"
177190b17f1bSmrg
177290b17f1bSmrg#if HAVE_DLFCN_H
177390b17f1bSmrg#include <dlfcn.h>
177490b17f1bSmrg#endif
177590b17f1bSmrg
177690b17f1bSmrg#include <stdio.h>
177790b17f1bSmrg
177890b17f1bSmrg#ifdef RTLD_GLOBAL
177990b17f1bSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
178090b17f1bSmrg#else
178190b17f1bSmrg#  ifdef DL_GLOBAL
178290b17f1bSmrg#    define LT_DLGLOBAL		DL_GLOBAL
178390b17f1bSmrg#  else
178490b17f1bSmrg#    define LT_DLGLOBAL		0
178590b17f1bSmrg#  endif
178690b17f1bSmrg#endif
178790b17f1bSmrg
178890b17f1bSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
178990b17f1bSmrg   find out it does not work in some platform. */
179090b17f1bSmrg#ifndef LT_DLLAZY_OR_NOW
179190b17f1bSmrg#  ifdef RTLD_LAZY
179290b17f1bSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
179390b17f1bSmrg#  else
179490b17f1bSmrg#    ifdef DL_LAZY
179590b17f1bSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
179690b17f1bSmrg#    else
179790b17f1bSmrg#      ifdef RTLD_NOW
179890b17f1bSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
179990b17f1bSmrg#      else
180090b17f1bSmrg#        ifdef DL_NOW
180190b17f1bSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
180290b17f1bSmrg#        else
180390b17f1bSmrg#          define LT_DLLAZY_OR_NOW	0
180490b17f1bSmrg#        endif
180590b17f1bSmrg#      endif
180690b17f1bSmrg#    endif
180790b17f1bSmrg#  endif
180890b17f1bSmrg#endif
180990b17f1bSmrg
181090b17f1bSmrg/* When -fvisbility=hidden is used, assume the code has been annotated
181190b17f1bSmrg   correspondingly for the symbols needed.  */
181290b17f1bSmrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
181390b17f1bSmrgint fnord () __attribute__((visibility("default")));
181490b17f1bSmrg#endif
181590b17f1bSmrg
181690b17f1bSmrgint fnord () { return 42; }
181790b17f1bSmrgint main ()
181890b17f1bSmrg{
181990b17f1bSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
182090b17f1bSmrg  int status = $lt_dlunknown;
182190b17f1bSmrg
182290b17f1bSmrg  if (self)
182390b17f1bSmrg    {
182490b17f1bSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
182590b17f1bSmrg      else
182690b17f1bSmrg        {
182790b17f1bSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
182890b17f1bSmrg          else puts (dlerror ());
182990b17f1bSmrg	}
183090b17f1bSmrg      /* dlclose (self); */
183190b17f1bSmrg    }
18327e6fb56fSmrg  else
183390b17f1bSmrg    puts (dlerror ());
183490b17f1bSmrg
183590b17f1bSmrg  return status;
183690b17f1bSmrg}]
183790b17f1bSmrg_LT_EOF
183890b17f1bSmrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
183990b17f1bSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
184090b17f1bSmrg    lt_status=$?
184190b17f1bSmrg    case x$lt_status in
184290b17f1bSmrg      x$lt_dlno_uscore) $1 ;;
184390b17f1bSmrg      x$lt_dlneed_uscore) $2 ;;
184490b17f1bSmrg      x$lt_dlunknown|x*) $3 ;;
18457e6fb56fSmrg    esac
184690b17f1bSmrg  else :
184790b17f1bSmrg    # compilation failed
184890b17f1bSmrg    $3
18497e6fb56fSmrg  fi
185090b17f1bSmrgfi
185190b17f1bSmrgrm -fr conftest*
185290b17f1bSmrg])# _LT_TRY_DLOPEN_SELF
185390b17f1bSmrg
185490b17f1bSmrg
185590b17f1bSmrg# LT_SYS_DLOPEN_SELF
185690b17f1bSmrg# ------------------
185790b17f1bSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
185890b17f1bSmrg[m4_require([_LT_HEADER_DLFCN])dnl
185990b17f1bSmrgif test "x$enable_dlopen" != xyes; then
186090b17f1bSmrg  enable_dlopen=unknown
186190b17f1bSmrg  enable_dlopen_self=unknown
186290b17f1bSmrg  enable_dlopen_self_static=unknown
186390b17f1bSmrgelse
186490b17f1bSmrg  lt_cv_dlopen=no
186590b17f1bSmrg  lt_cv_dlopen_libs=
186690b17f1bSmrg
18677e6fb56fSmrg  case $host_os in
186890b17f1bSmrg  beos*)
186990b17f1bSmrg    lt_cv_dlopen="load_add_on"
187090b17f1bSmrg    lt_cv_dlopen_libs=
187190b17f1bSmrg    lt_cv_dlopen_self=yes
18727e6fb56fSmrg    ;;
187390b17f1bSmrg
187490b17f1bSmrg  mingw* | pw32* | cegcc*)
187590b17f1bSmrg    lt_cv_dlopen="LoadLibrary"
187690b17f1bSmrg    lt_cv_dlopen_libs=
18777e6fb56fSmrg    ;;
187890b17f1bSmrg
187990b17f1bSmrg  cygwin*)
188090b17f1bSmrg    lt_cv_dlopen="dlopen"
188190b17f1bSmrg    lt_cv_dlopen_libs=
18827e6fb56fSmrg    ;;
188390b17f1bSmrg
188490b17f1bSmrg  darwin*)
188590b17f1bSmrg  # if libdl is installed we need to link against it
188690b17f1bSmrg    AC_CHECK_LIB([dl], [dlopen],
188790b17f1bSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
188890b17f1bSmrg    lt_cv_dlopen="dyld"
188990b17f1bSmrg    lt_cv_dlopen_libs=
189090b17f1bSmrg    lt_cv_dlopen_self=yes
189190b17f1bSmrg    ])
189290b17f1bSmrg    ;;
189390b17f1bSmrg
189490b17f1bSmrg  *)
189590b17f1bSmrg    AC_CHECK_FUNC([shl_load],
189690b17f1bSmrg	  [lt_cv_dlopen="shl_load"],
189790b17f1bSmrg      [AC_CHECK_LIB([dld], [shl_load],
189890b17f1bSmrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
189990b17f1bSmrg	[AC_CHECK_FUNC([dlopen],
190090b17f1bSmrg	      [lt_cv_dlopen="dlopen"],
190190b17f1bSmrg	  [AC_CHECK_LIB([dl], [dlopen],
190290b17f1bSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
190390b17f1bSmrg	    [AC_CHECK_LIB([svld], [dlopen],
190490b17f1bSmrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
190590b17f1bSmrg	      [AC_CHECK_LIB([dld], [dld_link],
190690b17f1bSmrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
190790b17f1bSmrg	      ])
190890b17f1bSmrg	    ])
190990b17f1bSmrg	  ])
191090b17f1bSmrg	])
191190b17f1bSmrg      ])
19127e6fb56fSmrg    ;;
19137e6fb56fSmrg  esac
19147e6fb56fSmrg
191590b17f1bSmrg  if test "x$lt_cv_dlopen" != xno; then
191690b17f1bSmrg    enable_dlopen=yes
191790b17f1bSmrg  else
191890b17f1bSmrg    enable_dlopen=no
191990b17f1bSmrg  fi
19207e6fb56fSmrg
192190b17f1bSmrg  case $lt_cv_dlopen in
192290b17f1bSmrg  dlopen)
192390b17f1bSmrg    save_CPPFLAGS="$CPPFLAGS"
192490b17f1bSmrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
192590b17f1bSmrg
192690b17f1bSmrg    save_LDFLAGS="$LDFLAGS"
192790b17f1bSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
192890b17f1bSmrg
192990b17f1bSmrg    save_LIBS="$LIBS"
193090b17f1bSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
193190b17f1bSmrg
193290b17f1bSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
193390b17f1bSmrg	  lt_cv_dlopen_self, [dnl
193490b17f1bSmrg	  _LT_TRY_DLOPEN_SELF(
193590b17f1bSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
193690b17f1bSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
193790b17f1bSmrg    ])
193890b17f1bSmrg
193990b17f1bSmrg    if test "x$lt_cv_dlopen_self" = xyes; then
194090b17f1bSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
194190b17f1bSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
194290b17f1bSmrg	  lt_cv_dlopen_self_static, [dnl
194390b17f1bSmrg	  _LT_TRY_DLOPEN_SELF(
194490b17f1bSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
194590b17f1bSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
194690b17f1bSmrg      ])
19477e6fb56fSmrg    fi
194890b17f1bSmrg
194990b17f1bSmrg    CPPFLAGS="$save_CPPFLAGS"
195090b17f1bSmrg    LDFLAGS="$save_LDFLAGS"
195190b17f1bSmrg    LIBS="$save_LIBS"
19527e6fb56fSmrg    ;;
19537e6fb56fSmrg  esac
19547e6fb56fSmrg
195590b17f1bSmrg  case $lt_cv_dlopen_self in
195690b17f1bSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
195790b17f1bSmrg  *) enable_dlopen_self=unknown ;;
19587e6fb56fSmrg  esac
195990b17f1bSmrg
196090b17f1bSmrg  case $lt_cv_dlopen_self_static in
196190b17f1bSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
196290b17f1bSmrg  *) enable_dlopen_self_static=unknown ;;
19637e6fb56fSmrg  esac
196490b17f1bSmrgfi
196590b17f1bSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
196690b17f1bSmrg	 [Whether dlopen is supported])
196790b17f1bSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
196890b17f1bSmrg	 [Whether dlopen of programs is supported])
196990b17f1bSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
197090b17f1bSmrg	 [Whether dlopen of statically linked programs is supported])
197190b17f1bSmrg])# LT_SYS_DLOPEN_SELF
19727e6fb56fSmrg
197390b17f1bSmrg# Old name:
197490b17f1bSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
197590b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
197690b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
19777e6fb56fSmrg
19787e6fb56fSmrg
197990b17f1bSmrg# _LT_COMPILER_C_O([TAGNAME])
198090b17f1bSmrg# ---------------------------
198190b17f1bSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
198290b17f1bSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
198390b17f1bSmrgm4_defun([_LT_COMPILER_C_O],
198490b17f1bSmrg[m4_require([_LT_DECL_SED])dnl
198590b17f1bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
198690b17f1bSmrgm4_require([_LT_TAG_COMPILER])dnl
198790b17f1bSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
198890b17f1bSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
198990b17f1bSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
199090b17f1bSmrg   $RM -r conftest 2>/dev/null
199190b17f1bSmrg   mkdir conftest
199290b17f1bSmrg   cd conftest
199390b17f1bSmrg   mkdir out
199490b17f1bSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
199590b17f1bSmrg
199690b17f1bSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
199790b17f1bSmrg   # Insert the option either (1) after the last *FLAGS variable, or
199890b17f1bSmrg   # (2) before a word containing "conftest.", or (3) at the end.
199990b17f1bSmrg   # Note that $ac_compile itself does not contain backslashes and begins
200090b17f1bSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
200190b17f1bSmrg   lt_compile=`echo "$ac_compile" | $SED \
200290b17f1bSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
200390b17f1bSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
200490b17f1bSmrg   -e 's:$: $lt_compiler_flag:'`
200590b17f1bSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
200690b17f1bSmrg   (eval "$lt_compile" 2>out/conftest.err)
200790b17f1bSmrg   ac_status=$?
200890b17f1bSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
200990b17f1bSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
201090b17f1bSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
201190b17f1bSmrg   then
201290b17f1bSmrg     # The compiler can only warn and ignore the option if not recognized
201390b17f1bSmrg     # So say no if there are warnings
201490b17f1bSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
201590b17f1bSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
201690b17f1bSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
201790b17f1bSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
201890b17f1bSmrg     fi
201990b17f1bSmrg   fi
202090b17f1bSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
202190b17f1bSmrg   $RM conftest*
202290b17f1bSmrg   # SGI C++ compiler will create directory out/ii_files/ for
202390b17f1bSmrg   # template instantiation
202490b17f1bSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
202590b17f1bSmrg   $RM out/* && rmdir out
202690b17f1bSmrg   cd ..
202790b17f1bSmrg   $RM -r conftest
202890b17f1bSmrg   $RM conftest*
202990b17f1bSmrg])
203090b17f1bSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
203190b17f1bSmrg	[Does compiler simultaneously support -c and -o options?])
203290b17f1bSmrg])# _LT_COMPILER_C_O
203390b17f1bSmrg
203490b17f1bSmrg
203590b17f1bSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
203690b17f1bSmrg# ----------------------------------
203790b17f1bSmrg# Check to see if we can do hard links to lock some files if needed
203890b17f1bSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
203990b17f1bSmrg[m4_require([_LT_ENABLE_LOCK])dnl
204090b17f1bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
204190b17f1bSmrg_LT_COMPILER_C_O([$1])
204290b17f1bSmrg
204390b17f1bSmrghard_links="nottested"
204490b17f1bSmrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
204590b17f1bSmrg  # do not overwrite the value of need_locks provided by the user
204690b17f1bSmrg  AC_MSG_CHECKING([if we can lock with hard links])
204790b17f1bSmrg  hard_links=yes
204890b17f1bSmrg  $RM conftest*
204990b17f1bSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
205090b17f1bSmrg  touch conftest.a
205190b17f1bSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
205290b17f1bSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
205390b17f1bSmrg  AC_MSG_RESULT([$hard_links])
205490b17f1bSmrg  if test "$hard_links" = no; then
205590b17f1bSmrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
205690b17f1bSmrg    need_locks=warn
20577e6fb56fSmrg  fi
205890b17f1bSmrgelse
205990b17f1bSmrg  need_locks=no
206090b17f1bSmrgfi
206190b17f1bSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
206290b17f1bSmrg])# _LT_COMPILER_FILE_LOCKS
20637e6fb56fSmrg
20647e6fb56fSmrg
206590b17f1bSmrg# _LT_CHECK_OBJDIR
206690b17f1bSmrg# ----------------
206790b17f1bSmrgm4_defun([_LT_CHECK_OBJDIR],
206890b17f1bSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
206990b17f1bSmrg[rm -f .libs 2>/dev/null
207090b17f1bSmrgmkdir .libs 2>/dev/null
207190b17f1bSmrgif test -d .libs; then
207290b17f1bSmrg  lt_cv_objdir=.libs
207390b17f1bSmrgelse
207490b17f1bSmrg  # MS-DOS does not allow filenames that begin with a dot.
207590b17f1bSmrg  lt_cv_objdir=_libs
207690b17f1bSmrgfi
207790b17f1bSmrgrmdir .libs 2>/dev/null])
207890b17f1bSmrgobjdir=$lt_cv_objdir
207990b17f1bSmrg_LT_DECL([], [objdir], [0],
208090b17f1bSmrg         [The name of the directory that contains temporary libtool files])dnl
208190b17f1bSmrgm4_pattern_allow([LT_OBJDIR])dnl
208290b17f1bSmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
208390b17f1bSmrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
208490b17f1bSmrg])# _LT_CHECK_OBJDIR
208590b17f1bSmrg
208690b17f1bSmrg
208790b17f1bSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
208890b17f1bSmrg# --------------------------------------
208990b17f1bSmrg# Check hardcoding attributes.
209090b17f1bSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
209190b17f1bSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
209290b17f1bSmrg_LT_TAGVAR(hardcode_action, $1)=
209390b17f1bSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
209490b17f1bSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
209590b17f1bSmrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
209690b17f1bSmrg
209790b17f1bSmrg  # We can hardcode non-existent directories.
209890b17f1bSmrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
209990b17f1bSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
210090b17f1bSmrg     # have to relink, otherwise we might link with an installed library
210190b17f1bSmrg     # when we should be linking with a yet-to-be-installed one
210290b17f1bSmrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
210390b17f1bSmrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
210490b17f1bSmrg    # Linking always hardcodes the temporary library directory.
210590b17f1bSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
21067e6fb56fSmrg  else
210790b17f1bSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
210890b17f1bSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
21097e6fb56fSmrg  fi
211090b17f1bSmrgelse
211190b17f1bSmrg  # We cannot hardcode anything, or else we can only hardcode existing
211290b17f1bSmrg  # directories.
211390b17f1bSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
211490b17f1bSmrgfi
211590b17f1bSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
21167e6fb56fSmrg
211790b17f1bSmrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
211890b17f1bSmrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
211990b17f1bSmrg  # Fast installation is not supported
212090b17f1bSmrg  enable_fast_install=no
212190b17f1bSmrgelif test "$shlibpath_overrides_runpath" = yes ||
212290b17f1bSmrg     test "$enable_shared" = no; then
212390b17f1bSmrg  # Fast installation is not necessary
212490b17f1bSmrg  enable_fast_install=needless
212590b17f1bSmrgfi
212690b17f1bSmrg_LT_TAGDECL([], [hardcode_action], [0],
212790b17f1bSmrg    [How to hardcode a shared library path into an executable])
212890b17f1bSmrg])# _LT_LINKER_HARDCODE_LIBPATH
21297e6fb56fSmrg
21307e6fb56fSmrg
213190b17f1bSmrg# _LT_CMD_STRIPLIB
213290b17f1bSmrg# ----------------
213390b17f1bSmrgm4_defun([_LT_CMD_STRIPLIB],
213490b17f1bSmrg[m4_require([_LT_DECL_EGREP])
213590b17f1bSmrgstriplib=
213690b17f1bSmrgold_striplib=
213790b17f1bSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
213890b17f1bSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
213990b17f1bSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
214090b17f1bSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
214190b17f1bSmrg  AC_MSG_RESULT([yes])
214290b17f1bSmrgelse
214390b17f1bSmrg# FIXME - insert some real tests, host_os isn't really good enough
21447e6fb56fSmrg  case $host_os in
214590b17f1bSmrg  darwin*)
214690b17f1bSmrg    if test -n "$STRIP" ; then
214790b17f1bSmrg      striplib="$STRIP -x"
214890b17f1bSmrg      old_striplib="$STRIP -S"
214990b17f1bSmrg      AC_MSG_RESULT([yes])
215090b17f1bSmrg    else
215190b17f1bSmrg      AC_MSG_RESULT([no])
215290b17f1bSmrg    fi
215390b17f1bSmrg    ;;
215490b17f1bSmrg  *)
215590b17f1bSmrg    AC_MSG_RESULT([no])
215690b17f1bSmrg    ;;
21577e6fb56fSmrg  esac
215890b17f1bSmrgfi
215990b17f1bSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
216090b17f1bSmrg_LT_DECL([], [striplib], [1])
216190b17f1bSmrg])# _LT_CMD_STRIPLIB
21627e6fb56fSmrg
216390b17f1bSmrg
216490b17f1bSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
216590b17f1bSmrg# -----------------------------
216690b17f1bSmrg# PORTME Fill in your ld.so characteristics
216790b17f1bSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
216890b17f1bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
216990b17f1bSmrgm4_require([_LT_DECL_EGREP])dnl
217090b17f1bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
217190b17f1bSmrgm4_require([_LT_DECL_OBJDUMP])dnl
217290b17f1bSmrgm4_require([_LT_DECL_SED])dnl
217390b17f1bSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
217490b17f1bSmrgAC_MSG_CHECKING([dynamic linker characteristics])
217590b17f1bSmrgm4_if([$1],
217690b17f1bSmrg	[], [
217790b17f1bSmrgif test "$GCC" = yes; then
217890b17f1bSmrg  case $host_os in
217990b17f1bSmrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
218090b17f1bSmrg    *) lt_awk_arg="/^libraries:/" ;;
218190b17f1bSmrg  esac
218290b17f1bSmrg  case $host_os in
218390b17f1bSmrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
218490b17f1bSmrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
218590b17f1bSmrg  esac
218690b17f1bSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
218790b17f1bSmrg  case $lt_search_path_spec in
218890b17f1bSmrg  *\;*)
218990b17f1bSmrg    # if the path contains ";" then we assume it to be the separator
219090b17f1bSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
219190b17f1bSmrg    # assumed that no part of a normal pathname contains ";" but that should
219290b17f1bSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
219390b17f1bSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
219490b17f1bSmrg    ;;
219590b17f1bSmrg  *)
219690b17f1bSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
219790b17f1bSmrg    ;;
219890b17f1bSmrg  esac
219990b17f1bSmrg  # Ok, now we have the path, separated by spaces, we can step through it
220090b17f1bSmrg  # and add multilib dir if necessary.
220190b17f1bSmrg  lt_tmp_lt_search_path_spec=
220290b17f1bSmrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
220390b17f1bSmrg  for lt_sys_path in $lt_search_path_spec; do
220490b17f1bSmrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
220590b17f1bSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
220690b17f1bSmrg    else
220790b17f1bSmrg      test -d "$lt_sys_path" && \
220890b17f1bSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
220990b17f1bSmrg    fi
221090b17f1bSmrg  done
221190b17f1bSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
221290b17f1bSmrgBEGIN {RS=" "; FS="/|\n";} {
221390b17f1bSmrg  lt_foo="";
221490b17f1bSmrg  lt_count=0;
221590b17f1bSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
221690b17f1bSmrg    if ($lt_i != "" && $lt_i != ".") {
221790b17f1bSmrg      if ($lt_i == "..") {
221890b17f1bSmrg        lt_count++;
221990b17f1bSmrg      } else {
222090b17f1bSmrg        if (lt_count == 0) {
222190b17f1bSmrg          lt_foo="/" $lt_i lt_foo;
222290b17f1bSmrg        } else {
222390b17f1bSmrg          lt_count--;
222490b17f1bSmrg        }
222590b17f1bSmrg      }
222690b17f1bSmrg    }
222790b17f1bSmrg  }
222890b17f1bSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
222990b17f1bSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
223090b17f1bSmrg}'`
223190b17f1bSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
223290b17f1bSmrg  # for these hosts.
223390b17f1bSmrg  case $host_os in
223490b17f1bSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
223590b17f1bSmrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
223690b17f1bSmrg  esac
223790b17f1bSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
223890b17f1bSmrgelse
223990b17f1bSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
224090b17f1bSmrgfi])
224190b17f1bSmrglibrary_names_spec=
224290b17f1bSmrglibname_spec='lib$name'
224390b17f1bSmrgsoname_spec=
224490b17f1bSmrgshrext_cmds=".so"
224590b17f1bSmrgpostinstall_cmds=
224690b17f1bSmrgpostuninstall_cmds=
224790b17f1bSmrgfinish_cmds=
224890b17f1bSmrgfinish_eval=
224990b17f1bSmrgshlibpath_var=
225090b17f1bSmrgshlibpath_overrides_runpath=unknown
225190b17f1bSmrgversion_type=none
225290b17f1bSmrgdynamic_linker="$host_os ld.so"
225390b17f1bSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
225490b17f1bSmrgneed_lib_prefix=unknown
225590b17f1bSmrghardcode_into_libs=no
225690b17f1bSmrg
225790b17f1bSmrg# when you set need_version to no, make sure it does not cause -set_version
225890b17f1bSmrg# flags to be left without arguments
225990b17f1bSmrgneed_version=unknown
226090b17f1bSmrg
226190b17f1bSmrgcase $host_os in
226290b17f1bSmrgaix3*)
226390b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
226490b17f1bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
22657e6fb56fSmrg  shlibpath_var=LIBPATH
22667e6fb56fSmrg
226790b17f1bSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
22687e6fb56fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
22697e6fb56fSmrg  ;;
22707e6fb56fSmrg
227190b17f1bSmrgaix[[4-9]]*)
227290b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
22737e6fb56fSmrg  need_lib_prefix=no
22747e6fb56fSmrg  need_version=no
22757e6fb56fSmrg  hardcode_into_libs=yes
227690b17f1bSmrg  if test "$host_cpu" = ia64; then
227790b17f1bSmrg    # AIX 5 supports IA64
227890b17f1bSmrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
227990b17f1bSmrg    shlibpath_var=LD_LIBRARY_PATH
228090b17f1bSmrg  else
228190b17f1bSmrg    # With GCC up to 2.95.x, collect2 would create an import file
228290b17f1bSmrg    # for dependence libraries.  The import file would start with
228390b17f1bSmrg    # the line `#! .'.  This would cause the generated library to
228490b17f1bSmrg    # depend on `.', always an invalid library.  This was fixed in
228590b17f1bSmrg    # development snapshots of GCC prior to 3.0.
228690b17f1bSmrg    case $host_os in
228790b17f1bSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
228890b17f1bSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
228990b17f1bSmrg	   echo ' yes '
229090b17f1bSmrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
229190b17f1bSmrg	:
229290b17f1bSmrg      else
229390b17f1bSmrg	can_build_shared=no
229490b17f1bSmrg      fi
229590b17f1bSmrg      ;;
229690b17f1bSmrg    esac
229790b17f1bSmrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
229890b17f1bSmrg    # soname into executable. Probably we can add versioning support to
229990b17f1bSmrg    # collect2, so additional links can be useful in future.
230090b17f1bSmrg    if test "$aix_use_runtimelinking" = yes; then
230190b17f1bSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
230290b17f1bSmrg      # instead of lib<name>.a to let people know that these are not
230390b17f1bSmrg      # typical AIX shared libraries.
230490b17f1bSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
230590b17f1bSmrg    else
230690b17f1bSmrg      # We preserve .a as extension for shared libraries through AIX4.2
230790b17f1bSmrg      # and later when we are not doing run time linking.
230890b17f1bSmrg      library_names_spec='${libname}${release}.a $libname.a'
230990b17f1bSmrg      soname_spec='${libname}${release}${shared_ext}$major'
231090b17f1bSmrg    fi
231190b17f1bSmrg    shlibpath_var=LIBPATH
23127e6fb56fSmrg  fi
23137e6fb56fSmrg  ;;
23147e6fb56fSmrg
231590b17f1bSmrgamigaos*)
231690b17f1bSmrg  case $host_cpu in
231790b17f1bSmrg  powerpc)
231890b17f1bSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
231990b17f1bSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
232090b17f1bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
232190b17f1bSmrg    ;;
232290b17f1bSmrg  m68k)
232390b17f1bSmrg    library_names_spec='$libname.ixlibrary $libname.a'
232490b17f1bSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
232590b17f1bSmrg    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'
232690b17f1bSmrg    ;;
23277e6fb56fSmrg  esac
23287e6fb56fSmrg  ;;
23297e6fb56fSmrg
233090b17f1bSmrgbeos*)
233190b17f1bSmrg  library_names_spec='${libname}${shared_ext}'
233290b17f1bSmrg  dynamic_linker="$host_os ld.so"
233390b17f1bSmrg  shlibpath_var=LIBRARY_PATH
23347e6fb56fSmrg  ;;
23357e6fb56fSmrg
233690b17f1bSmrgbsdi[[45]]*)
233790b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
23387e6fb56fSmrg  need_version=no
23397e6fb56fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23407e6fb56fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
234190b17f1bSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
23427e6fb56fSmrg  shlibpath_var=LD_LIBRARY_PATH
234390b17f1bSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
234490b17f1bSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
234590b17f1bSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
234690b17f1bSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
234790b17f1bSmrg  # libtool to hard-code these into programs
23487e6fb56fSmrg  ;;
23497e6fb56fSmrg
235090b17f1bSmrgcygwin* | mingw* | pw32* | cegcc*)
235190b17f1bSmrg  version_type=windows
235290b17f1bSmrg  shrext_cmds=".dll"
235390b17f1bSmrg  need_version=no
235490b17f1bSmrg  need_lib_prefix=no
23557e6fb56fSmrg
235690b17f1bSmrg  case $GCC,$cc_basename in
235790b17f1bSmrg  yes,*)
235890b17f1bSmrg    # gcc
235990b17f1bSmrg    library_names_spec='$libname.dll.a'
236090b17f1bSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
236190b17f1bSmrg    postinstall_cmds='base_file=`basename \${file}`~
236290b17f1bSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
236390b17f1bSmrg      dldir=$destdir/`dirname \$dlpath`~
236490b17f1bSmrg      test -d \$dldir || mkdir -p \$dldir~
236590b17f1bSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
236690b17f1bSmrg      chmod a+x \$dldir/$dlname~
236790b17f1bSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
236890b17f1bSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
236990b17f1bSmrg      fi'
237090b17f1bSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
237190b17f1bSmrg      dlpath=$dir/\$dldll~
237290b17f1bSmrg       $RM \$dlpath'
237390b17f1bSmrg    shlibpath_overrides_runpath=yes
23747e6fb56fSmrg
237590b17f1bSmrg    case $host_os in
237690b17f1bSmrg    cygwin*)
237790b17f1bSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
237890b17f1bSmrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
237990b17f1bSmrgm4_if([$1], [],[
238090b17f1bSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
238190b17f1bSmrg      ;;
238290b17f1bSmrg    mingw* | cegcc*)
238390b17f1bSmrg      # MinGW DLLs use traditional 'lib' prefix
238490b17f1bSmrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
238590b17f1bSmrg      ;;
238690b17f1bSmrg    pw32*)
238790b17f1bSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
238890b17f1bSmrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
238990b17f1bSmrg      ;;
23907e6fb56fSmrg    esac
239190b17f1bSmrg    dynamic_linker='Win32 ld.exe'
239290b17f1bSmrg    ;;
23937e6fb56fSmrg
239490b17f1bSmrg  *,cl*)
239590b17f1bSmrg    # Native MSVC
239690b17f1bSmrg    libname_spec='$name'
239790b17f1bSmrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
239890b17f1bSmrg    library_names_spec='${libname}.dll.lib'
23997e6fb56fSmrg
240090b17f1bSmrg    case $build_os in
240190b17f1bSmrg    mingw*)
240290b17f1bSmrg      sys_lib_search_path_spec=
240390b17f1bSmrg      lt_save_ifs=$IFS
240490b17f1bSmrg      IFS=';'
240590b17f1bSmrg      for lt_path in $LIB
240690b17f1bSmrg      do
240790b17f1bSmrg        IFS=$lt_save_ifs
240890b17f1bSmrg        # Let DOS variable expansion print the short 8.3 style file name.
240990b17f1bSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
241090b17f1bSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
24117e6fb56fSmrg      done
241290b17f1bSmrg      IFS=$lt_save_ifs
241390b17f1bSmrg      # Convert to MSYS style.
241490b17f1bSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
24157e6fb56fSmrg      ;;
241690b17f1bSmrg    cygwin*)
241790b17f1bSmrg      # Convert to unix form, then to dos form, then back to unix form
241890b17f1bSmrg      # but this time dos style (no spaces!) so that the unix form looks
241990b17f1bSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
242090b17f1bSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
242190b17f1bSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
242290b17f1bSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
24237e6fb56fSmrg      ;;
24247e6fb56fSmrg    *)
242590b17f1bSmrg      sys_lib_search_path_spec="$LIB"
242690b17f1bSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
242790b17f1bSmrg        # It is most probably a Windows format PATH.
242890b17f1bSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
242990b17f1bSmrg      else
243090b17f1bSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
243190b17f1bSmrg      fi
243290b17f1bSmrg      # FIXME: find the short name or the path components, as spaces are
243390b17f1bSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
24347e6fb56fSmrg      ;;
243590b17f1bSmrg    esac
24367e6fb56fSmrg
243790b17f1bSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
243890b17f1bSmrg    postinstall_cmds='base_file=`basename \${file}`~
243990b17f1bSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
244090b17f1bSmrg      dldir=$destdir/`dirname \$dlpath`~
244190b17f1bSmrg      test -d \$dldir || mkdir -p \$dldir~
244290b17f1bSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
244390b17f1bSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
244490b17f1bSmrg      dlpath=$dir/\$dldll~
244590b17f1bSmrg       $RM \$dlpath'
244690b17f1bSmrg    shlibpath_overrides_runpath=yes
244790b17f1bSmrg    dynamic_linker='Win32 link.exe'
244890b17f1bSmrg    ;;
24497e6fb56fSmrg
245090b17f1bSmrg  *)
245190b17f1bSmrg    # Assume MSVC wrapper
245290b17f1bSmrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
245390b17f1bSmrg    dynamic_linker='Win32 ld.exe'
245490b17f1bSmrg    ;;
245590b17f1bSmrg  esac
245690b17f1bSmrg  # FIXME: first we should search . and the directory the executable is in
245790b17f1bSmrg  shlibpath_var=PATH
24587e6fb56fSmrg  ;;
24597e6fb56fSmrg
246090b17f1bSmrgdarwin* | rhapsody*)
246190b17f1bSmrg  dynamic_linker="$host_os dyld"
246290b17f1bSmrg  version_type=darwin
246390b17f1bSmrg  need_lib_prefix=no
246490b17f1bSmrg  need_version=no
246590b17f1bSmrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
246690b17f1bSmrg  soname_spec='${libname}${release}${major}$shared_ext'
246790b17f1bSmrg  shlibpath_overrides_runpath=yes
246890b17f1bSmrg  shlibpath_var=DYLD_LIBRARY_PATH
246990b17f1bSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
247090b17f1bSmrgm4_if([$1], [],[
247190b17f1bSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
247290b17f1bSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
24737e6fb56fSmrg  ;;
24747e6fb56fSmrg
247590b17f1bSmrgdgux*)
247690b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
247790b17f1bSmrg  need_lib_prefix=no
247890b17f1bSmrg  need_version=no
247990b17f1bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
248090b17f1bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
248190b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
248290b17f1bSmrg  ;;
24837e6fb56fSmrg
248490b17f1bSmrgfreebsd* | dragonfly*)
248590b17f1bSmrg  # DragonFly does not have aout.  When/if they implement a new
248690b17f1bSmrg  # versioning mechanism, adjust this.
248790b17f1bSmrg  if test -x /usr/bin/objformat; then
248890b17f1bSmrg    objformat=`/usr/bin/objformat`
24897e6fb56fSmrg  else
249090b17f1bSmrg    case $host_os in
249190b17f1bSmrg    freebsd[[23]].*) objformat=aout ;;
249290b17f1bSmrg    *) objformat=elf ;;
249390b17f1bSmrg    esac
24947e6fb56fSmrg  fi
249590b17f1bSmrg  version_type=freebsd-$objformat
249690b17f1bSmrg  case $version_type in
249790b17f1bSmrg    freebsd-elf*)
249890b17f1bSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
249990b17f1bSmrg      need_version=no
250090b17f1bSmrg      need_lib_prefix=no
25017e6fb56fSmrg      ;;
250290b17f1bSmrg    freebsd-*)
250390b17f1bSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
250490b17f1bSmrg      need_version=yes
250590b17f1bSmrg      ;;
250690b17f1bSmrg  esac
250790b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
250890b17f1bSmrg  case $host_os in
250990b17f1bSmrg  freebsd2.*)
251090b17f1bSmrg    shlibpath_overrides_runpath=yes
25117e6fb56fSmrg    ;;
251290b17f1bSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
251390b17f1bSmrg    shlibpath_overrides_runpath=yes
251490b17f1bSmrg    hardcode_into_libs=yes
251590b17f1bSmrg    ;;
251690b17f1bSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
251790b17f1bSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
251890b17f1bSmrg    shlibpath_overrides_runpath=no
251990b17f1bSmrg    hardcode_into_libs=yes
252090b17f1bSmrg    ;;
252190b17f1bSmrg  *) # from 4.6 on, and DragonFly
252290b17f1bSmrg    shlibpath_overrides_runpath=yes
252390b17f1bSmrg    hardcode_into_libs=yes
25247e6fb56fSmrg    ;;
25257e6fb56fSmrg  esac
25267e6fb56fSmrg  ;;
252790b17f1bSmrg
252890b17f1bSmrggnu*)
252990b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
253090b17f1bSmrg  need_lib_prefix=no
253190b17f1bSmrg  need_version=no
253290b17f1bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
253390b17f1bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
253490b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
253590b17f1bSmrg  shlibpath_overrides_runpath=no
253690b17f1bSmrg  hardcode_into_libs=yes
25377e6fb56fSmrg  ;;
25387e6fb56fSmrg
253990b17f1bSmrghaiku*)
254090b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
254190b17f1bSmrg  need_lib_prefix=no
254290b17f1bSmrg  need_version=no
254390b17f1bSmrg  dynamic_linker="$host_os runtime_loader"
254490b17f1bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
254590b17f1bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
254690b17f1bSmrg  shlibpath_var=LIBRARY_PATH
254790b17f1bSmrg  shlibpath_overrides_runpath=yes
254890b17f1bSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
254990b17f1bSmrg  hardcode_into_libs=yes
255090b17f1bSmrg  ;;
25517e6fb56fSmrg
255290b17f1bSmrghpux9* | hpux10* | hpux11*)
255390b17f1bSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
255490b17f1bSmrg  # link against other versions.
255590b17f1bSmrg  version_type=sunos
255690b17f1bSmrg  need_lib_prefix=no
255790b17f1bSmrg  need_version=no
255890b17f1bSmrg  case $host_cpu in
255990b17f1bSmrg  ia64*)
256090b17f1bSmrg    shrext_cmds='.so'
256190b17f1bSmrg    hardcode_into_libs=yes
256290b17f1bSmrg    dynamic_linker="$host_os dld.so"
256390b17f1bSmrg    shlibpath_var=LD_LIBRARY_PATH
256490b17f1bSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
256590b17f1bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
256690b17f1bSmrg    soname_spec='${libname}${release}${shared_ext}$major'
256790b17f1bSmrg    if test "X$HPUX_IA64_MODE" = X32; then
256890b17f1bSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
25697e6fb56fSmrg    else
257090b17f1bSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
25717e6fb56fSmrg    fi
257290b17f1bSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
25737e6fb56fSmrg    ;;
257490b17f1bSmrg  hppa*64*)
257590b17f1bSmrg    shrext_cmds='.sl'
257690b17f1bSmrg    hardcode_into_libs=yes
257790b17f1bSmrg    dynamic_linker="$host_os dld.sl"
257890b17f1bSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
257990b17f1bSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
258090b17f1bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
258190b17f1bSmrg    soname_spec='${libname}${release}${shared_ext}$major'
258290b17f1bSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
258390b17f1bSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
258490b17f1bSmrg    ;;
258590b17f1bSmrg  *)
258690b17f1bSmrg    shrext_cmds='.sl'
258790b17f1bSmrg    dynamic_linker="$host_os dld.sl"
258890b17f1bSmrg    shlibpath_var=SHLIB_PATH
258990b17f1bSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
259090b17f1bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
259190b17f1bSmrg    soname_spec='${libname}${release}${shared_ext}$major'
259290b17f1bSmrg    ;;
259390b17f1bSmrg  esac
259490b17f1bSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
259590b17f1bSmrg  postinstall_cmds='chmod 555 $lib'
259690b17f1bSmrg  # or fails outright, so override atomically:
259790b17f1bSmrg  install_override_mode=555
259890b17f1bSmrg  ;;
25997e6fb56fSmrg
260090b17f1bSmrginterix[[3-9]]*)
260190b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
260290b17f1bSmrg  need_lib_prefix=no
260390b17f1bSmrg  need_version=no
260490b17f1bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
260590b17f1bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
260690b17f1bSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
260790b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
260890b17f1bSmrg  shlibpath_overrides_runpath=no
260990b17f1bSmrg  hardcode_into_libs=yes
261090b17f1bSmrg  ;;
26117e6fb56fSmrg
261290b17f1bSmrgirix5* | irix6* | nonstopux*)
261390b17f1bSmrg  case $host_os in
261490b17f1bSmrg    nonstopux*) version_type=nonstopux ;;
261590b17f1bSmrg    *)
261690b17f1bSmrg	if test "$lt_cv_prog_gnu_ld" = yes; then
261790b17f1bSmrg		version_type=linux # correct to gnu/linux during the next big refactor
261890b17f1bSmrg	else
261990b17f1bSmrg		version_type=irix
262090b17f1bSmrg	fi ;;
262190b17f1bSmrg  esac
262290b17f1bSmrg  need_lib_prefix=no
262390b17f1bSmrg  need_version=no
262490b17f1bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
262590b17f1bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
262690b17f1bSmrg  case $host_os in
262790b17f1bSmrg  irix5* | nonstopux*)
262890b17f1bSmrg    libsuff= shlibsuff=
262990b17f1bSmrg    ;;
263090b17f1bSmrg  *)
263190b17f1bSmrg    case $LD in # libtool.m4 will add one of these switches to LD
263290b17f1bSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
263390b17f1bSmrg      libsuff= shlibsuff= libmagic=32-bit;;
263490b17f1bSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
263590b17f1bSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
263690b17f1bSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
263790b17f1bSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
263890b17f1bSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
263990b17f1bSmrg    esac
264090b17f1bSmrg    ;;
264190b17f1bSmrg  esac
264290b17f1bSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
264390b17f1bSmrg  shlibpath_overrides_runpath=no
264490b17f1bSmrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
264590b17f1bSmrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
264690b17f1bSmrg  hardcode_into_libs=yes
26477e6fb56fSmrg  ;;
26487e6fb56fSmrg
264990b17f1bSmrg# No shared lib support for Linux oldld, aout, or coff.
265090b17f1bSmrglinux*oldld* | linux*aout* | linux*coff*)
265190b17f1bSmrg  dynamic_linker=no
26527e6fb56fSmrg  ;;
26537e6fb56fSmrg
265490b17f1bSmrg# This must be glibc/ELF.
265590b17f1bSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
265690b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
265790b17f1bSmrg  need_lib_prefix=no
265890b17f1bSmrg  need_version=no
265990b17f1bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
266090b17f1bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
266190b17f1bSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
266290b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
266390b17f1bSmrg  shlibpath_overrides_runpath=no
26647e6fb56fSmrg
266590b17f1bSmrg  # Some binutils ld are patched to set DT_RUNPATH
266690b17f1bSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
266790b17f1bSmrg    [lt_cv_shlibpath_overrides_runpath=no
266890b17f1bSmrg    save_LDFLAGS=$LDFLAGS
266990b17f1bSmrg    save_libdir=$libdir
267090b17f1bSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
267190b17f1bSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
267290b17f1bSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
267390b17f1bSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
267490b17f1bSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
267590b17f1bSmrg    LDFLAGS=$save_LDFLAGS
267690b17f1bSmrg    libdir=$save_libdir
267790b17f1bSmrg    ])
267890b17f1bSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
26797e6fb56fSmrg
268090b17f1bSmrg  # This implies no fast_install, which is unacceptable.
268190b17f1bSmrg  # Some rework will be needed to allow for fast_install
268290b17f1bSmrg  # before this can be enabled.
268390b17f1bSmrg  hardcode_into_libs=yes
26847e6fb56fSmrg
268590b17f1bSmrg  # Add ABI-specific directories to the system library path.
268690b17f1bSmrg  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
26877e6fb56fSmrg
268890b17f1bSmrg  # Append ld.so.conf contents to the search path
268990b17f1bSmrg  if test -f /etc/ld.so.conf; then
269090b17f1bSmrg    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' ' '`
269190b17f1bSmrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
26927e6fb56fSmrg
269390b17f1bSmrg  fi
26947e6fb56fSmrg
269590b17f1bSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
269690b17f1bSmrg  # powerpc, because MkLinux only supported shared libraries with the
269790b17f1bSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
269890b17f1bSmrg  # most powerpc-linux boxes support dynamic linking these days and
269990b17f1bSmrg  # people can always --disable-shared, the test was removed, and we
270090b17f1bSmrg  # assume the GNU/Linux dynamic linker is in use.
270190b17f1bSmrg  dynamic_linker='GNU/Linux ld.so'
27027e6fb56fSmrg  ;;
27037e6fb56fSmrg
27047e6fb56fSmrgnetbsd*)
270590b17f1bSmrg  version_type=sunos
270690b17f1bSmrg  need_lib_prefix=no
270790b17f1bSmrg  need_version=no
270890b17f1bSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
270990b17f1bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
271090b17f1bSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
271190b17f1bSmrg    dynamic_linker='NetBSD (a.out) ld.so'
27127e6fb56fSmrg  else
271390b17f1bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
271490b17f1bSmrg    soname_spec='${libname}${release}${shared_ext}$major'
271590b17f1bSmrg    dynamic_linker='NetBSD ld.elf_so'
27167e6fb56fSmrg  fi
271790b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
271890b17f1bSmrg  shlibpath_overrides_runpath=yes
271990b17f1bSmrg  hardcode_into_libs=yes
27207e6fb56fSmrg  ;;
27217e6fb56fSmrg
272290b17f1bSmrgnewsos6)
272390b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
272490b17f1bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
272590b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
272690b17f1bSmrg  shlibpath_overrides_runpath=yes
27277e6fb56fSmrg  ;;
27287e6fb56fSmrg
272990b17f1bSmrg*nto* | *qnx*)
273090b17f1bSmrg  version_type=qnx
273190b17f1bSmrg  need_lib_prefix=no
273290b17f1bSmrg  need_version=no
273390b17f1bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
273490b17f1bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
273590b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
273690b17f1bSmrg  shlibpath_overrides_runpath=no
273790b17f1bSmrg  hardcode_into_libs=yes
273890b17f1bSmrg  dynamic_linker='ldqnx.so'
27397e6fb56fSmrg  ;;
27407e6fb56fSmrg
27417e6fb56fSmrgopenbsd*)
274290b17f1bSmrg  version_type=sunos
274390b17f1bSmrg  sys_lib_dlsearch_path_spec="/usr/lib"
274490b17f1bSmrg  need_lib_prefix=no
274590b17f1bSmrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
274690b17f1bSmrg  case $host_os in
274790b17f1bSmrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
274890b17f1bSmrg    *)				need_version=no  ;;
274990b17f1bSmrg  esac
275090b17f1bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
275190b17f1bSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
275290b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
275390b17f1bSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
275490b17f1bSmrg    case $host_os in
275590b17f1bSmrg      openbsd2.[[89]] | openbsd2.[[89]].*)
275690b17f1bSmrg	shlibpath_overrides_runpath=no
275790b17f1bSmrg	;;
275890b17f1bSmrg      *)
275990b17f1bSmrg	shlibpath_overrides_runpath=yes
276090b17f1bSmrg	;;
276190b17f1bSmrg      esac
27627e6fb56fSmrg  else
276390b17f1bSmrg    shlibpath_overrides_runpath=yes
27647e6fb56fSmrg  fi
27657e6fb56fSmrg  ;;
27667e6fb56fSmrg
276790b17f1bSmrgos2*)
276890b17f1bSmrg  libname_spec='$name'
276990b17f1bSmrg  shrext_cmds=".dll"
277090b17f1bSmrg  need_lib_prefix=no
277190b17f1bSmrg  library_names_spec='$libname${shared_ext} $libname.a'
277290b17f1bSmrg  dynamic_linker='OS/2 ld.exe'
277390b17f1bSmrg  shlibpath_var=LIBPATH
277490b17f1bSmrg  ;;
277590b17f1bSmrg
27767e6fb56fSmrgosf3* | osf4* | osf5*)
277790b17f1bSmrg  version_type=osf
277890b17f1bSmrg  need_lib_prefix=no
277990b17f1bSmrg  need_version=no
278090b17f1bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
278190b17f1bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
278290b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
278390b17f1bSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
278490b17f1bSmrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
27857e6fb56fSmrg  ;;
27867e6fb56fSmrg
27877e6fb56fSmrgrdos*)
278890b17f1bSmrg  dynamic_linker=no
27897e6fb56fSmrg  ;;
27907e6fb56fSmrg
27917e6fb56fSmrgsolaris*)
279290b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
279390b17f1bSmrg  need_lib_prefix=no
279490b17f1bSmrg  need_version=no
279590b17f1bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
279690b17f1bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
279790b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
279890b17f1bSmrg  shlibpath_overrides_runpath=yes
279990b17f1bSmrg  hardcode_into_libs=yes
280090b17f1bSmrg  # ldd complains unless libraries are executable
280190b17f1bSmrg  postinstall_cmds='chmod +x $lib'
280290b17f1bSmrg  ;;
280390b17f1bSmrg
280490b17f1bSmrgsunos4*)
280590b17f1bSmrg  version_type=sunos
280690b17f1bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
280790b17f1bSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
280890b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
280990b17f1bSmrg  shlibpath_overrides_runpath=yes
281090b17f1bSmrg  if test "$with_gnu_ld" = yes; then
281190b17f1bSmrg    need_lib_prefix=no
281290b17f1bSmrg  fi
281390b17f1bSmrg  need_version=yes
28147e6fb56fSmrg  ;;
28157e6fb56fSmrg
28167e6fb56fSmrgsysv4 | sysv4.3*)
281790b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
281890b17f1bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
281990b17f1bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
282090b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
28217e6fb56fSmrg  case $host_vendor in
282290b17f1bSmrg    sni)
282390b17f1bSmrg      shlibpath_overrides_runpath=no
282490b17f1bSmrg      need_lib_prefix=no
282590b17f1bSmrg      runpath_var=LD_RUN_PATH
282690b17f1bSmrg      ;;
282790b17f1bSmrg    siemens)
282890b17f1bSmrg      need_lib_prefix=no
282990b17f1bSmrg      ;;
283090b17f1bSmrg    motorola)
283190b17f1bSmrg      need_lib_prefix=no
283290b17f1bSmrg      need_version=no
283390b17f1bSmrg      shlibpath_overrides_runpath=no
283490b17f1bSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
283590b17f1bSmrg      ;;
28367e6fb56fSmrg  esac
28377e6fb56fSmrg  ;;
28387e6fb56fSmrg
283990b17f1bSmrgsysv4*MP*)
284090b17f1bSmrg  if test -d /usr/nec ;then
284190b17f1bSmrg    version_type=linux # correct to gnu/linux during the next big refactor
284290b17f1bSmrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
284390b17f1bSmrg    soname_spec='$libname${shared_ext}.$major'
284490b17f1bSmrg    shlibpath_var=LD_LIBRARY_PATH
284590b17f1bSmrg  fi
28467e6fb56fSmrg  ;;
28477e6fb56fSmrg
284890b17f1bSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
284990b17f1bSmrg  version_type=freebsd-elf
285090b17f1bSmrg  need_lib_prefix=no
285190b17f1bSmrg  need_version=no
285290b17f1bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
285390b17f1bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
285490b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
285590b17f1bSmrg  shlibpath_overrides_runpath=yes
285690b17f1bSmrg  hardcode_into_libs=yes
285790b17f1bSmrg  if test "$with_gnu_ld" = yes; then
285890b17f1bSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
285990b17f1bSmrg  else
286090b17f1bSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
286190b17f1bSmrg    case $host_os in
286290b17f1bSmrg      sco3.2v5*)
286390b17f1bSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
286490b17f1bSmrg	;;
286590b17f1bSmrg    esac
286690b17f1bSmrg  fi
286790b17f1bSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
286890b17f1bSmrg  ;;
28697e6fb56fSmrg
287090b17f1bSmrgtpf*)
287190b17f1bSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
287290b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
287390b17f1bSmrg  need_lib_prefix=no
287490b17f1bSmrg  need_version=no
287590b17f1bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
287690b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
287790b17f1bSmrg  shlibpath_overrides_runpath=no
287890b17f1bSmrg  hardcode_into_libs=yes
28797e6fb56fSmrg  ;;
288090b17f1bSmrg
288190b17f1bSmrguts4*)
288290b17f1bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
288390b17f1bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
288490b17f1bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
288590b17f1bSmrg  shlibpath_var=LD_LIBRARY_PATH
28867e6fb56fSmrg  ;;
288790b17f1bSmrg
28887e6fb56fSmrg*)
288990b17f1bSmrg  dynamic_linker=no
28907e6fb56fSmrg  ;;
28917e6fb56fSmrgesac
289290b17f1bSmrgAC_MSG_RESULT([$dynamic_linker])
289390b17f1bSmrgtest "$dynamic_linker" = no && can_build_shared=no
28947e6fb56fSmrg
289590b17f1bSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
289690b17f1bSmrgif test "$GCC" = yes; then
289790b17f1bSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
289890b17f1bSmrgfi
28997e6fb56fSmrg
290090b17f1bSmrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
290190b17f1bSmrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
290290b17f1bSmrgfi
290390b17f1bSmrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
290490b17f1bSmrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
290590b17f1bSmrgfi
29067e6fb56fSmrg
290790b17f1bSmrg_LT_DECL([], [variables_saved_for_relink], [1],
290890b17f1bSmrg    [Variables whose values should be saved in libtool wrapper scripts and
290990b17f1bSmrg    restored at link time])
291090b17f1bSmrg_LT_DECL([], [need_lib_prefix], [0],
291190b17f1bSmrg    [Do we need the "lib" prefix for modules?])
291290b17f1bSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
291390b17f1bSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
291490b17f1bSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
291590b17f1bSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
291690b17f1bSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
291790b17f1bSmrg    [Is shlibpath searched before the hard-coded library search path?])
291890b17f1bSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
291990b17f1bSmrg_LT_DECL([], [library_names_spec], [1],
292090b17f1bSmrg    [[List of archive names.  First name is the real one, the rest are links.
292190b17f1bSmrg    The last name is the one that the linker finds with -lNAME]])
292290b17f1bSmrg_LT_DECL([], [soname_spec], [1],
292390b17f1bSmrg    [[The coded name of the library, if different from the real name]])
292490b17f1bSmrg_LT_DECL([], [install_override_mode], [1],
292590b17f1bSmrg    [Permission mode override for installation of shared libraries])
292690b17f1bSmrg_LT_DECL([], [postinstall_cmds], [2],
292790b17f1bSmrg    [Command to use after installation of a shared archive])
292890b17f1bSmrg_LT_DECL([], [postuninstall_cmds], [2],
292990b17f1bSmrg    [Command to use after uninstallation of a shared archive])
293090b17f1bSmrg_LT_DECL([], [finish_cmds], [2],
293190b17f1bSmrg    [Commands used to finish a libtool library installation in a directory])
293290b17f1bSmrg_LT_DECL([], [finish_eval], [1],
293390b17f1bSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
293490b17f1bSmrg    not shown]])
293590b17f1bSmrg_LT_DECL([], [hardcode_into_libs], [0],
293690b17f1bSmrg    [Whether we should hardcode library paths into libraries])
293790b17f1bSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
293890b17f1bSmrg    [Compile-time system search path for libraries])
293990b17f1bSmrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
294090b17f1bSmrg    [Run-time system search path for libraries])
294190b17f1bSmrg])# _LT_SYS_DYNAMIC_LINKER
294290b17f1bSmrg
294390b17f1bSmrg
294490b17f1bSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
294590b17f1bSmrg# --------------------------
294690b17f1bSmrg# find a file program which can recognize shared library
294790b17f1bSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
294890b17f1bSmrg[m4_require([_LT_DECL_EGREP])dnl
294990b17f1bSmrgAC_MSG_CHECKING([for $1])
295090b17f1bSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
295190b17f1bSmrg[case $MAGIC_CMD in
295290b17f1bSmrg[[\\/*] |  ?:[\\/]*])
295390b17f1bSmrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
295490b17f1bSmrg  ;;
295590b17f1bSmrg*)
295690b17f1bSmrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
295790b17f1bSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
295890b17f1bSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
295990b17f1bSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
296090b17f1bSmrgdnl not every word.  This closes a longstanding sh security hole.
296190b17f1bSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
296290b17f1bSmrg  for ac_dir in $ac_dummy; do
296390b17f1bSmrg    IFS="$lt_save_ifs"
296490b17f1bSmrg    test -z "$ac_dir" && ac_dir=.
296590b17f1bSmrg    if test -f $ac_dir/$1; then
296690b17f1bSmrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
296790b17f1bSmrg      if test -n "$file_magic_test_file"; then
296890b17f1bSmrg	case $deplibs_check_method in
296990b17f1bSmrg	"file_magic "*)
297090b17f1bSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
297190b17f1bSmrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
297290b17f1bSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
297390b17f1bSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
297490b17f1bSmrg	    :
297590b17f1bSmrg	  else
297690b17f1bSmrg	    cat <<_LT_EOF 1>&2
29777e6fb56fSmrg
297890b17f1bSmrg*** Warning: the command libtool uses to detect shared libraries,
297990b17f1bSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
298090b17f1bSmrg*** The result is that libtool may fail to recognize shared libraries
298190b17f1bSmrg*** as such.  This will affect the creation of libtool libraries that
298290b17f1bSmrg*** depend on shared libraries, but programs linked with such libtool
298390b17f1bSmrg*** libraries will work regardless of this problem.  Nevertheless, you
298490b17f1bSmrg*** may want to report the problem to your system manager and/or to
298590b17f1bSmrg*** bug-libtool@gnu.org
29867e6fb56fSmrg
298790b17f1bSmrg_LT_EOF
298890b17f1bSmrg	  fi ;;
298990b17f1bSmrg	esac
299090b17f1bSmrg      fi
299190b17f1bSmrg      break
299290b17f1bSmrg    fi
299390b17f1bSmrg  done
299490b17f1bSmrg  IFS="$lt_save_ifs"
299590b17f1bSmrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
299690b17f1bSmrg  ;;
299790b17f1bSmrgesac])
299890b17f1bSmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
299990b17f1bSmrgif test -n "$MAGIC_CMD"; then
300090b17f1bSmrg  AC_MSG_RESULT($MAGIC_CMD)
300190b17f1bSmrgelse
300290b17f1bSmrg  AC_MSG_RESULT(no)
30037e6fb56fSmrgfi
300490b17f1bSmrg_LT_DECL([], [MAGIC_CMD], [0],
300590b17f1bSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
300690b17f1bSmrg])# _LT_PATH_TOOL_PREFIX
30077e6fb56fSmrg
300890b17f1bSmrg# Old name:
300990b17f1bSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
301090b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
301190b17f1bSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
30127e6fb56fSmrg
30137e6fb56fSmrg
301490b17f1bSmrg# _LT_PATH_MAGIC
30157e6fb56fSmrg# --------------
301690b17f1bSmrg# find a file program which can recognize a shared library
301790b17f1bSmrgm4_defun([_LT_PATH_MAGIC],
301890b17f1bSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
301990b17f1bSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
302090b17f1bSmrg  if test -n "$ac_tool_prefix"; then
302190b17f1bSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
302290b17f1bSmrg  else
302390b17f1bSmrg    MAGIC_CMD=:
302490b17f1bSmrg  fi
302590b17f1bSmrgfi
302690b17f1bSmrg])# _LT_PATH_MAGIC
30277e6fb56fSmrg
30287e6fb56fSmrg
302990b17f1bSmrg# LT_PATH_LD
303090b17f1bSmrg# ----------
303190b17f1bSmrg# find the pathname to the GNU or non-GNU linker
303290b17f1bSmrgAC_DEFUN([LT_PATH_LD],
303390b17f1bSmrg[AC_REQUIRE([AC_PROG_CC])dnl
303490b17f1bSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
303590b17f1bSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
303690b17f1bSmrgm4_require([_LT_DECL_SED])dnl
303790b17f1bSmrgm4_require([_LT_DECL_EGREP])dnl
303890b17f1bSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
30397e6fb56fSmrg
304090b17f1bSmrgAC_ARG_WITH([gnu-ld],
304190b17f1bSmrg    [AS_HELP_STRING([--with-gnu-ld],
304290b17f1bSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
304390b17f1bSmrg    [test "$withval" = no || with_gnu_ld=yes],
304490b17f1bSmrg    [with_gnu_ld=no])dnl
30457e6fb56fSmrg
304690b17f1bSmrgac_prog=ld
304790b17f1bSmrgif test "$GCC" = yes; then
304890b17f1bSmrg  # Check if gcc -print-prog-name=ld gives a path.
304990b17f1bSmrg  AC_MSG_CHECKING([for ld used by $CC])
305090b17f1bSmrg  case $host in
305190b17f1bSmrg  *-*-mingw*)
305290b17f1bSmrg    # gcc leaves a trailing carriage return which upsets mingw
305390b17f1bSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
305490b17f1bSmrg  *)
305590b17f1bSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
305690b17f1bSmrg  esac
305790b17f1bSmrg  case $ac_prog in
305890b17f1bSmrg    # Accept absolute paths.
305990b17f1bSmrg    [[\\/]]* | ?:[[\\/]]*)
306090b17f1bSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
306190b17f1bSmrg      # Canonicalize the pathname of ld
306290b17f1bSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
306390b17f1bSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
306490b17f1bSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
306590b17f1bSmrg      done
306690b17f1bSmrg      test -z "$LD" && LD="$ac_prog"
306790b17f1bSmrg      ;;
306890b17f1bSmrg  "")
306990b17f1bSmrg    # If it fails, then pretend we aren't using GCC.
307090b17f1bSmrg    ac_prog=ld
307190b17f1bSmrg    ;;
307290b17f1bSmrg  *)
307390b17f1bSmrg    # If it is relative, then search for the first ld in PATH.
307490b17f1bSmrg    with_gnu_ld=unknown
307590b17f1bSmrg    ;;
307690b17f1bSmrg  esac
307790b17f1bSmrgelif test "$with_gnu_ld" = yes; then
307890b17f1bSmrg  AC_MSG_CHECKING([for GNU ld])
307990b17f1bSmrgelse
308090b17f1bSmrg  AC_MSG_CHECKING([for non-GNU ld])
308190b17f1bSmrgfi
308290b17f1bSmrgAC_CACHE_VAL(lt_cv_path_LD,
308390b17f1bSmrg[if test -z "$LD"; then
308490b17f1bSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
308590b17f1bSmrg  for ac_dir in $PATH; do
308690b17f1bSmrg    IFS="$lt_save_ifs"
308790b17f1bSmrg    test -z "$ac_dir" && ac_dir=.
308890b17f1bSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
308990b17f1bSmrg      lt_cv_path_LD="$ac_dir/$ac_prog"
309090b17f1bSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
309190b17f1bSmrg      # but apparently some variants of GNU ld only accept -v.
309290b17f1bSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
309390b17f1bSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
309490b17f1bSmrg      *GNU* | *'with BFD'*)
309590b17f1bSmrg	test "$with_gnu_ld" != no && break
309690b17f1bSmrg	;;
309790b17f1bSmrg      *)
309890b17f1bSmrg	test "$with_gnu_ld" != yes && break
309990b17f1bSmrg	;;
310090b17f1bSmrg      esac
310190b17f1bSmrg    fi
310290b17f1bSmrg  done
310390b17f1bSmrg  IFS="$lt_save_ifs"
310490b17f1bSmrgelse
310590b17f1bSmrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
310690b17f1bSmrgfi])
310790b17f1bSmrgLD="$lt_cv_path_LD"
310890b17f1bSmrgif test -n "$LD"; then
310990b17f1bSmrg  AC_MSG_RESULT($LD)
311090b17f1bSmrgelse
311190b17f1bSmrg  AC_MSG_RESULT(no)
311290b17f1bSmrgfi
311390b17f1bSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
311490b17f1bSmrg_LT_PATH_LD_GNU
311590b17f1bSmrgAC_SUBST([LD])
31167e6fb56fSmrg
311790b17f1bSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
311890b17f1bSmrg])# LT_PATH_LD
31197e6fb56fSmrg
312090b17f1bSmrg# Old names:
312190b17f1bSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
312290b17f1bSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
312390b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
312490b17f1bSmrgdnl AC_DEFUN([AM_PROG_LD], [])
312590b17f1bSmrgdnl AC_DEFUN([AC_PROG_LD], [])
31267e6fb56fSmrg
31277e6fb56fSmrg
312890b17f1bSmrg# _LT_PATH_LD_GNU
312990b17f1bSmrg#- --------------
313090b17f1bSmrgm4_defun([_LT_PATH_LD_GNU],
313190b17f1bSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
313290b17f1bSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
313390b17f1bSmrgcase `$LD -v 2>&1 </dev/null` in
313490b17f1bSmrg*GNU* | *'with BFD'*)
313590b17f1bSmrg  lt_cv_prog_gnu_ld=yes
313690b17f1bSmrg  ;;
313790b17f1bSmrg*)
313890b17f1bSmrg  lt_cv_prog_gnu_ld=no
313990b17f1bSmrg  ;;
314090b17f1bSmrgesac])
314190b17f1bSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
314290b17f1bSmrg])# _LT_PATH_LD_GNU
31437e6fb56fSmrg
31447e6fb56fSmrg
314590b17f1bSmrg# _LT_CMD_RELOAD
314690b17f1bSmrg# --------------
314790b17f1bSmrg# find reload flag for linker
314890b17f1bSmrg#   -- PORTME Some linkers may need a different reload flag.
314990b17f1bSmrgm4_defun([_LT_CMD_RELOAD],
315090b17f1bSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
315190b17f1bSmrg  lt_cv_ld_reload_flag,
315290b17f1bSmrg  [lt_cv_ld_reload_flag='-r'])
315390b17f1bSmrgreload_flag=$lt_cv_ld_reload_flag
315490b17f1bSmrgcase $reload_flag in
315590b17f1bSmrg"" | " "*) ;;
315690b17f1bSmrg*) reload_flag=" $reload_flag" ;;
315790b17f1bSmrgesac
315890b17f1bSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
31597e6fb56fSmrgcase $host_os in
316090b17f1bSmrg  cygwin* | mingw* | pw32* | cegcc*)
316190b17f1bSmrg    if test "$GCC" != yes; then
316290b17f1bSmrg      reload_cmds=false
316390b17f1bSmrg    fi
316490b17f1bSmrg    ;;
316590b17f1bSmrg  darwin*)
316690b17f1bSmrg    if test "$GCC" = yes; then
316790b17f1bSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
316890b17f1bSmrg    else
316990b17f1bSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
317090b17f1bSmrg    fi
31717e6fb56fSmrg    ;;
31727e6fb56fSmrgesac
317390b17f1bSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
317490b17f1bSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
317590b17f1bSmrg])# _LT_CMD_RELOAD
31767e6fb56fSmrg
31777e6fb56fSmrg
317890b17f1bSmrg# _LT_CHECK_MAGIC_METHOD
317990b17f1bSmrg# ----------------------
318090b17f1bSmrg# how to check for library dependencies
318190b17f1bSmrg#  -- PORTME fill in with the dynamic library characteristics
318290b17f1bSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
318390b17f1bSmrg[m4_require([_LT_DECL_EGREP])
318490b17f1bSmrgm4_require([_LT_DECL_OBJDUMP])
318590b17f1bSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
318690b17f1bSmrglt_cv_deplibs_check_method,
318790b17f1bSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
318890b17f1bSmrglt_cv_file_magic_test_file=
318990b17f1bSmrglt_cv_deplibs_check_method='unknown'
319090b17f1bSmrg# Need to set the preceding variable on all platforms that support
319190b17f1bSmrg# interlibrary dependencies.
319290b17f1bSmrg# 'none' -- dependencies not supported.
319390b17f1bSmrg# `unknown' -- same as none, but documents that we really don't know.
319490b17f1bSmrg# 'pass_all' -- all dependencies passed with no checks.
319590b17f1bSmrg# 'test_compile' -- check by making test program.
319690b17f1bSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
319790b17f1bSmrg# which responds to the $file_magic_cmd with a given extended regex.
319890b17f1bSmrg# If you have `file' or equivalent on your system and you're not sure
319990b17f1bSmrg# whether `pass_all' will *always* work, you probably want this one.
32007e6fb56fSmrg
320190b17f1bSmrgcase $host_os in
320290b17f1bSmrgaix[[4-9]]*)
320390b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
320490b17f1bSmrg  ;;
32057e6fb56fSmrg
320690b17f1bSmrgbeos*)
320790b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
320890b17f1bSmrg  ;;
32097e6fb56fSmrg
321090b17f1bSmrgbsdi[[45]]*)
321190b17f1bSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
321290b17f1bSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
321390b17f1bSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
321490b17f1bSmrg  ;;
32157e6fb56fSmrg
321690b17f1bSmrgcygwin*)
321790b17f1bSmrg  # func_win32_libid is a shell function defined in ltmain.sh
321890b17f1bSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
321990b17f1bSmrg  lt_cv_file_magic_cmd='func_win32_libid'
322090b17f1bSmrg  ;;
32217e6fb56fSmrg
322290b17f1bSmrgmingw* | pw32*)
322390b17f1bSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
322490b17f1bSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
322590b17f1bSmrg  # unless we find 'file', for example because we are cross-compiling.
322690b17f1bSmrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
322790b17f1bSmrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
322890b17f1bSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
322990b17f1bSmrg    lt_cv_file_magic_cmd='func_win32_libid'
323090b17f1bSmrg  else
323190b17f1bSmrg    # Keep this pattern in sync with the one in func_win32_libid.
323290b17f1bSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
323390b17f1bSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
323490b17f1bSmrg  fi
323590b17f1bSmrg  ;;
32367e6fb56fSmrg
323790b17f1bSmrgcegcc*)
323890b17f1bSmrg  # use the weaker test based on 'objdump'. See mingw*.
323990b17f1bSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
324090b17f1bSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
324190b17f1bSmrg  ;;
32427e6fb56fSmrg
324390b17f1bSmrgdarwin* | rhapsody*)
324490b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
324590b17f1bSmrg  ;;
32467e6fb56fSmrg
324790b17f1bSmrgfreebsd* | dragonfly*)
324890b17f1bSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
324990b17f1bSmrg    case $host_cpu in
325090b17f1bSmrg    i*86 )
325190b17f1bSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
325290b17f1bSmrg      # Let's accept both of them until this is cleared up.
325390b17f1bSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
325490b17f1bSmrg      lt_cv_file_magic_cmd=/usr/bin/file
325590b17f1bSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
325690b17f1bSmrg      ;;
325790b17f1bSmrg    esac
325890b17f1bSmrg  else
325990b17f1bSmrg    lt_cv_deplibs_check_method=pass_all
326090b17f1bSmrg  fi
326190b17f1bSmrg  ;;
32627e6fb56fSmrg
326390b17f1bSmrggnu*)
326490b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
326590b17f1bSmrg  ;;
32667e6fb56fSmrg
326790b17f1bSmrghaiku*)
326890b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
326990b17f1bSmrg  ;;
32707e6fb56fSmrg
327190b17f1bSmrghpux10.20* | hpux11*)
327290b17f1bSmrg  lt_cv_file_magic_cmd=/usr/bin/file
327390b17f1bSmrg  case $host_cpu in
327490b17f1bSmrg  ia64*)
327590b17f1bSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
327690b17f1bSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
327790b17f1bSmrg    ;;
327890b17f1bSmrg  hppa*64*)
327990b17f1bSmrg    [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]']
328090b17f1bSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
328190b17f1bSmrg    ;;
328290b17f1bSmrg  *)
328390b17f1bSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
328490b17f1bSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
328590b17f1bSmrg    ;;
328690b17f1bSmrg  esac
328790b17f1bSmrg  ;;
32887e6fb56fSmrg
328990b17f1bSmrginterix[[3-9]]*)
329090b17f1bSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
329190b17f1bSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
329290b17f1bSmrg  ;;
32937e6fb56fSmrg
329490b17f1bSmrgirix5* | irix6* | nonstopux*)
329590b17f1bSmrg  case $LD in
329690b17f1bSmrg  *-32|*"-32 ") libmagic=32-bit;;
329790b17f1bSmrg  *-n32|*"-n32 ") libmagic=N32;;
329890b17f1bSmrg  *-64|*"-64 ") libmagic=64-bit;;
329990b17f1bSmrg  *) libmagic=never-match;;
330090b17f1bSmrg  esac
330190b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
330290b17f1bSmrg  ;;
33037e6fb56fSmrg
330490b17f1bSmrg# This must be glibc/ELF.
330590b17f1bSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
330690b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
330790b17f1bSmrg  ;;
33087e6fb56fSmrg
330990b17f1bSmrgnetbsd*)
331090b17f1bSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
331190b17f1bSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
331290b17f1bSmrg  else
331390b17f1bSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
331490b17f1bSmrg  fi
331590b17f1bSmrg  ;;
33167e6fb56fSmrg
331790b17f1bSmrgnewos6*)
331890b17f1bSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
331990b17f1bSmrg  lt_cv_file_magic_cmd=/usr/bin/file
332090b17f1bSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
332190b17f1bSmrg  ;;
33227e6fb56fSmrg
332390b17f1bSmrg*nto* | *qnx*)
332490b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
332590b17f1bSmrg  ;;
33267e6fb56fSmrg
332790b17f1bSmrgopenbsd*)
332890b17f1bSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
332990b17f1bSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
33307e6fb56fSmrg  else
333190b17f1bSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
33327e6fb56fSmrg  fi
333390b17f1bSmrg  ;;
33347e6fb56fSmrg
333590b17f1bSmrgosf3* | osf4* | osf5*)
333690b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
333790b17f1bSmrg  ;;
33387e6fb56fSmrg
333990b17f1bSmrgrdos*)
334090b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
334190b17f1bSmrg  ;;
33427e6fb56fSmrg
334390b17f1bSmrgsolaris*)
334490b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
334590b17f1bSmrg  ;;
334690b17f1bSmrg
334790b17f1bSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
334890b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
334990b17f1bSmrg  ;;
335090b17f1bSmrg
335190b17f1bSmrgsysv4 | sysv4.3*)
335290b17f1bSmrg  case $host_vendor in
335390b17f1bSmrg  motorola)
335490b17f1bSmrg    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]]'
335590b17f1bSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
33567e6fb56fSmrg    ;;
335790b17f1bSmrg  ncr)
335890b17f1bSmrg    lt_cv_deplibs_check_method=pass_all
335990b17f1bSmrg    ;;
336090b17f1bSmrg  sequent)
336190b17f1bSmrg    lt_cv_file_magic_cmd='/bin/file'
336290b17f1bSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
336390b17f1bSmrg    ;;
336490b17f1bSmrg  sni)
336590b17f1bSmrg    lt_cv_file_magic_cmd='/bin/file'
336690b17f1bSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
336790b17f1bSmrg    lt_cv_file_magic_test_file=/lib/libc.so
336890b17f1bSmrg    ;;
336990b17f1bSmrg  siemens)
337090b17f1bSmrg    lt_cv_deplibs_check_method=pass_all
337190b17f1bSmrg    ;;
337290b17f1bSmrg  pc)
337390b17f1bSmrg    lt_cv_deplibs_check_method=pass_all
337490b17f1bSmrg    ;;
337590b17f1bSmrg  esac
337690b17f1bSmrg  ;;
337790b17f1bSmrg
337890b17f1bSmrgtpf*)
337990b17f1bSmrg  lt_cv_deplibs_check_method=pass_all
338090b17f1bSmrg  ;;
338190b17f1bSmrgesac
338290b17f1bSmrg])
33837e6fb56fSmrg
338490b17f1bSmrgfile_magic_glob=
338590b17f1bSmrgwant_nocaseglob=no
338690b17f1bSmrgif test "$build" = "$host"; then
338790b17f1bSmrg  case $host_os in
338890b17f1bSmrg  mingw* | pw32*)
338990b17f1bSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
339090b17f1bSmrg      want_nocaseglob=yes
339190b17f1bSmrg    else
339290b17f1bSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
33937e6fb56fSmrg    fi
339490b17f1bSmrg    ;;
339590b17f1bSmrg  esac
339690b17f1bSmrgfi
33977e6fb56fSmrg
339890b17f1bSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
339990b17f1bSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
340090b17f1bSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
34017e6fb56fSmrg
340290b17f1bSmrg_LT_DECL([], [deplibs_check_method], [1],
340390b17f1bSmrg    [Method to check whether dependent libraries are shared objects])
340490b17f1bSmrg_LT_DECL([], [file_magic_cmd], [1],
340590b17f1bSmrg    [Command to use when deplibs_check_method = "file_magic"])
340690b17f1bSmrg_LT_DECL([], [file_magic_glob], [1],
340790b17f1bSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
340890b17f1bSmrg_LT_DECL([], [want_nocaseglob], [1],
340990b17f1bSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
341090b17f1bSmrg])# _LT_CHECK_MAGIC_METHOD
34117e6fb56fSmrg
34127e6fb56fSmrg
341390b17f1bSmrg# LT_PATH_NM
341490b17f1bSmrg# ----------
341590b17f1bSmrg# find the pathname to a BSD- or MS-compatible name lister
341690b17f1bSmrgAC_DEFUN([LT_PATH_NM],
341790b17f1bSmrg[AC_REQUIRE([AC_PROG_CC])dnl
341890b17f1bSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
341990b17f1bSmrg[if test -n "$NM"; then
342090b17f1bSmrg  # Let the user override the test.
342190b17f1bSmrg  lt_cv_path_NM="$NM"
342290b17f1bSmrgelse
342390b17f1bSmrg  lt_nm_to_check="${ac_tool_prefix}nm"
342490b17f1bSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
342590b17f1bSmrg    lt_nm_to_check="$lt_nm_to_check nm"
342690b17f1bSmrg  fi
342790b17f1bSmrg  for lt_tmp_nm in $lt_nm_to_check; do
342890b17f1bSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
342990b17f1bSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
343090b17f1bSmrg      IFS="$lt_save_ifs"
343190b17f1bSmrg      test -z "$ac_dir" && ac_dir=.
343290b17f1bSmrg      tmp_nm="$ac_dir/$lt_tmp_nm"
343390b17f1bSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
343490b17f1bSmrg	# Check to see if the nm accepts a BSD-compat flag.
343590b17f1bSmrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
343690b17f1bSmrg	#   nm: unknown option "B" ignored
343790b17f1bSmrg	# Tru64's nm complains that /dev/null is an invalid object file
343890b17f1bSmrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
343990b17f1bSmrg	*/dev/null* | *'Invalid file or object type'*)
344090b17f1bSmrg	  lt_cv_path_NM="$tmp_nm -B"
344190b17f1bSmrg	  break
344290b17f1bSmrg	  ;;
344390b17f1bSmrg	*)
344490b17f1bSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
344590b17f1bSmrg	  */dev/null*)
344690b17f1bSmrg	    lt_cv_path_NM="$tmp_nm -p"
344790b17f1bSmrg	    break
344890b17f1bSmrg	    ;;
344990b17f1bSmrg	  *)
345090b17f1bSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
345190b17f1bSmrg	    continue # so that we can try to find one that supports BSD flags
345290b17f1bSmrg	    ;;
345390b17f1bSmrg	  esac
345490b17f1bSmrg	  ;;
345590b17f1bSmrg	esac
34567e6fb56fSmrg      fi
345790b17f1bSmrg    done
345890b17f1bSmrg    IFS="$lt_save_ifs"
345990b17f1bSmrg  done
346090b17f1bSmrg  : ${lt_cv_path_NM=no}
346190b17f1bSmrgfi])
346290b17f1bSmrgif test "$lt_cv_path_NM" != "no"; then
346390b17f1bSmrg  NM="$lt_cv_path_NM"
346490b17f1bSmrgelse
346590b17f1bSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
346690b17f1bSmrg  if test -n "$DUMPBIN"; then :
346790b17f1bSmrg    # Let the user override the test.
346890b17f1bSmrg  else
346990b17f1bSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
347090b17f1bSmrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
347190b17f1bSmrg    *COFF*)
347290b17f1bSmrg      DUMPBIN="$DUMPBIN -symbols"
34737e6fb56fSmrg      ;;
34747e6fb56fSmrg    *)
347590b17f1bSmrg      DUMPBIN=:
34767e6fb56fSmrg      ;;
34777e6fb56fSmrg    esac
347890b17f1bSmrg  fi
347990b17f1bSmrg  AC_SUBST([DUMPBIN])
348090b17f1bSmrg  if test "$DUMPBIN" != ":"; then
348190b17f1bSmrg    NM="$DUMPBIN"
348290b17f1bSmrg  fi
348390b17f1bSmrgfi
348490b17f1bSmrgtest -z "$NM" && NM=nm
348590b17f1bSmrgAC_SUBST([NM])
348690b17f1bSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
348790b17f1bSmrg
348890b17f1bSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
348990b17f1bSmrg  [lt_cv_nm_interface="BSD nm"
349090b17f1bSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
349190b17f1bSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
349290b17f1bSmrg  (eval "$ac_compile" 2>conftest.err)
349390b17f1bSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
349490b17f1bSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
349590b17f1bSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
349690b17f1bSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
349790b17f1bSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
349890b17f1bSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
349990b17f1bSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
350090b17f1bSmrg    lt_cv_nm_interface="MS dumpbin"
350190b17f1bSmrg  fi
350290b17f1bSmrg  rm -f conftest*])
350390b17f1bSmrg])# LT_PATH_NM
350490b17f1bSmrg
350590b17f1bSmrg# Old names:
350690b17f1bSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
350790b17f1bSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
350890b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
350990b17f1bSmrgdnl AC_DEFUN([AM_PROG_NM], [])
351090b17f1bSmrgdnl AC_DEFUN([AC_PROG_NM], [])
351190b17f1bSmrg
351290b17f1bSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
351390b17f1bSmrg# --------------------------------
351490b17f1bSmrg# how to determine the name of the shared library
351590b17f1bSmrg# associated with a specific link library.
351690b17f1bSmrg#  -- PORTME fill in with the dynamic library characteristics
351790b17f1bSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
351890b17f1bSmrg[m4_require([_LT_DECL_EGREP])
351990b17f1bSmrgm4_require([_LT_DECL_OBJDUMP])
352090b17f1bSmrgm4_require([_LT_DECL_DLLTOOL])
352190b17f1bSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
352290b17f1bSmrglt_cv_sharedlib_from_linklib_cmd,
352390b17f1bSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
35247e6fb56fSmrg
352590b17f1bSmrgcase $host_os in
352690b17f1bSmrgcygwin* | mingw* | pw32* | cegcc*)
352790b17f1bSmrg  # two different shell functions defined in ltmain.sh
352890b17f1bSmrg  # decide which to use based on capabilities of $DLLTOOL
352990b17f1bSmrg  case `$DLLTOOL --help 2>&1` in
353090b17f1bSmrg  *--identify-strict*)
353190b17f1bSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
35327e6fb56fSmrg    ;;
353390b17f1bSmrg  *)
353490b17f1bSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
35357e6fb56fSmrg    ;;
353690b17f1bSmrg  esac
353790b17f1bSmrg  ;;
353890b17f1bSmrg*)
353990b17f1bSmrg  # fallback: assume linklib IS sharedlib
354090b17f1bSmrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
354190b17f1bSmrg  ;;
354290b17f1bSmrgesac
354390b17f1bSmrg])
354490b17f1bSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
354590b17f1bSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
35467e6fb56fSmrg
354790b17f1bSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
354890b17f1bSmrg    [Command to associate shared and link libraries])
354990b17f1bSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
35507e6fb56fSmrg
35517e6fb56fSmrg
355290b17f1bSmrg# _LT_PATH_MANIFEST_TOOL
355390b17f1bSmrg# ----------------------
355490b17f1bSmrg# locate the manifest tool
355590b17f1bSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
355690b17f1bSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
355790b17f1bSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
355890b17f1bSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
355990b17f1bSmrg  [lt_cv_path_mainfest_tool=no
356090b17f1bSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
356190b17f1bSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
356290b17f1bSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
356390b17f1bSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
356490b17f1bSmrg    lt_cv_path_mainfest_tool=yes
356590b17f1bSmrg  fi
356690b17f1bSmrg  rm -f conftest*])
356790b17f1bSmrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
356890b17f1bSmrg  MANIFEST_TOOL=:
356990b17f1bSmrgfi
357090b17f1bSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
357190b17f1bSmrg])# _LT_PATH_MANIFEST_TOOL
35727e6fb56fSmrg
35737e6fb56fSmrg
357490b17f1bSmrg# LT_LIB_M
357590b17f1bSmrg# --------
357690b17f1bSmrg# check for math library
357790b17f1bSmrgAC_DEFUN([LT_LIB_M],
357890b17f1bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
357990b17f1bSmrgLIBM=
358090b17f1bSmrgcase $host in
358190b17f1bSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
358290b17f1bSmrg  # These system don't have libm, or don't need it
358390b17f1bSmrg  ;;
358490b17f1bSmrg*-ncr-sysv4.3*)
358590b17f1bSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
358690b17f1bSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
358790b17f1bSmrg  ;;
358890b17f1bSmrg*)
358990b17f1bSmrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
359090b17f1bSmrg  ;;
359190b17f1bSmrgesac
359290b17f1bSmrgAC_SUBST([LIBM])
359390b17f1bSmrg])# LT_LIB_M
35947e6fb56fSmrg
359590b17f1bSmrg# Old name:
359690b17f1bSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
359790b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
359890b17f1bSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
35997e6fb56fSmrg
36007e6fb56fSmrg
360190b17f1bSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
360290b17f1bSmrg# -------------------------------
360390b17f1bSmrgm4_defun([_LT_COMPILER_NO_RTTI],
360490b17f1bSmrg[m4_require([_LT_TAG_COMPILER])dnl
36057e6fb56fSmrg
360690b17f1bSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
36077e6fb56fSmrg
360890b17f1bSmrgif test "$GCC" = yes; then
360990b17f1bSmrg  case $cc_basename in
361090b17f1bSmrg  nvcc*)
361190b17f1bSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
361290b17f1bSmrg  *)
361390b17f1bSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
361490b17f1bSmrg  esac
36157e6fb56fSmrg
361690b17f1bSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
361790b17f1bSmrg    lt_cv_prog_compiler_rtti_exceptions,
361890b17f1bSmrg    [-fno-rtti -fno-exceptions], [],
361990b17f1bSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
362090b17f1bSmrgfi
362190b17f1bSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
362290b17f1bSmrg	[Compiler flag to turn off builtin functions])
362390b17f1bSmrg])# _LT_COMPILER_NO_RTTI
36247e6fb56fSmrg
36257e6fb56fSmrg
362690b17f1bSmrg# _LT_CMD_GLOBAL_SYMBOLS
362790b17f1bSmrg# ----------------------
362890b17f1bSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
362990b17f1bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
363090b17f1bSmrgAC_REQUIRE([AC_PROG_CC])dnl
363190b17f1bSmrgAC_REQUIRE([AC_PROG_AWK])dnl
363290b17f1bSmrgAC_REQUIRE([LT_PATH_NM])dnl
363390b17f1bSmrgAC_REQUIRE([LT_PATH_LD])dnl
363490b17f1bSmrgm4_require([_LT_DECL_SED])dnl
363590b17f1bSmrgm4_require([_LT_DECL_EGREP])dnl
363690b17f1bSmrgm4_require([_LT_TAG_COMPILER])dnl
36377e6fb56fSmrg
363890b17f1bSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
363990b17f1bSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
364090b17f1bSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
364190b17f1bSmrg[
364290b17f1bSmrg# These are sane defaults that work on at least a few old systems.
364390b17f1bSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
36447e6fb56fSmrg
364590b17f1bSmrg# Character class describing NM global symbol codes.
364690b17f1bSmrgsymcode='[[BCDEGRST]]'
36477e6fb56fSmrg
364890b17f1bSmrg# Regexp to match symbols that can be accessed directly from C.
364990b17f1bSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
36507e6fb56fSmrg
365190b17f1bSmrg# Define system-specific variables.
365290b17f1bSmrgcase $host_os in
365390b17f1bSmrgaix*)
365490b17f1bSmrg  symcode='[[BCDT]]'
365590b17f1bSmrg  ;;
365690b17f1bSmrgcygwin* | mingw* | pw32* | cegcc*)
365790b17f1bSmrg  symcode='[[ABCDGISTW]]'
365890b17f1bSmrg  ;;
365990b17f1bSmrghpux*)
366090b17f1bSmrg  if test "$host_cpu" = ia64; then
366190b17f1bSmrg    symcode='[[ABCDEGRST]]'
366290b17f1bSmrg  fi
366390b17f1bSmrg  ;;
366490b17f1bSmrgirix* | nonstopux*)
366590b17f1bSmrg  symcode='[[BCDEGRST]]'
366690b17f1bSmrg  ;;
366790b17f1bSmrgosf*)
366890b17f1bSmrg  symcode='[[BCDEGQRST]]'
366990b17f1bSmrg  ;;
367090b17f1bSmrgsolaris*)
367190b17f1bSmrg  symcode='[[BDRT]]'
367290b17f1bSmrg  ;;
367390b17f1bSmrgsco3.2v5*)
367490b17f1bSmrg  symcode='[[DT]]'
367590b17f1bSmrg  ;;
367690b17f1bSmrgsysv4.2uw2*)
367790b17f1bSmrg  symcode='[[DT]]'
367890b17f1bSmrg  ;;
367990b17f1bSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
368090b17f1bSmrg  symcode='[[ABDT]]'
368190b17f1bSmrg  ;;
368290b17f1bSmrgsysv4)
368390b17f1bSmrg  symcode='[[DFNSTU]]'
368490b17f1bSmrg  ;;
36857e6fb56fSmrgesac
36867e6fb56fSmrg
368790b17f1bSmrg# If we're using GNU nm, then use its standard symbol codes.
368890b17f1bSmrgcase `$NM -V 2>&1` in
368990b17f1bSmrg*GNU* | *'with BFD'*)
369090b17f1bSmrg  symcode='[[ABCDGIRSTW]]' ;;
369190b17f1bSmrgesac
36927e6fb56fSmrg
369390b17f1bSmrg# Transform an extracted symbol line into a proper C declaration.
369490b17f1bSmrg# Some systems (esp. on ia64) link data and code symbols differently,
369590b17f1bSmrg# so use this general approach.
369690b17f1bSmrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
36977e6fb56fSmrg
369890b17f1bSmrg# Transform an extracted symbol line into symbol name and symbol address
369990b17f1bSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
370090b17f1bSmrglt_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'"
37017e6fb56fSmrg
370290b17f1bSmrg# Handle CRLF in mingw tool chain
370390b17f1bSmrgopt_cr=
370490b17f1bSmrgcase $build_os in
370590b17f1bSmrgmingw*)
370690b17f1bSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
370790b17f1bSmrg  ;;
370890b17f1bSmrgesac
37097e6fb56fSmrg
371090b17f1bSmrg# Try without a prefix underscore, then with it.
371190b17f1bSmrgfor ac_symprfx in "" "_"; do
37127e6fb56fSmrg
371390b17f1bSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
371490b17f1bSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
37157e6fb56fSmrg
371690b17f1bSmrg  # Write the raw and C identifiers.
371790b17f1bSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
371890b17f1bSmrg    # Fake it for dumpbin and say T for any non-static function
371990b17f1bSmrg    # and D for any global variable.
372090b17f1bSmrg    # Also find C++ and __fastcall symbols from MSVC++,
372190b17f1bSmrg    # which start with @ or ?.
372290b17f1bSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
372390b17f1bSmrg"     {last_section=section; section=\$ 3};"\
372490b17f1bSmrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
372590b17f1bSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
372690b17f1bSmrg"     \$ 0!~/External *\|/{next};"\
372790b17f1bSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
372890b17f1bSmrg"     {if(hide[section]) next};"\
372990b17f1bSmrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
373090b17f1bSmrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
373190b17f1bSmrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
373290b17f1bSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
373390b17f1bSmrg"     ' prfx=^$ac_symprfx]"
373490b17f1bSmrg  else
373590b17f1bSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
373690b17f1bSmrg  fi
373790b17f1bSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
37387e6fb56fSmrg
373990b17f1bSmrg  # Check to see that the pipe works correctly.
374090b17f1bSmrg  pipe_works=no
37417e6fb56fSmrg
374290b17f1bSmrg  rm -f conftest*
374390b17f1bSmrg  cat > conftest.$ac_ext <<_LT_EOF
374490b17f1bSmrg#ifdef __cplusplus
374590b17f1bSmrgextern "C" {
374690b17f1bSmrg#endif
374790b17f1bSmrgchar nm_test_var;
374890b17f1bSmrgvoid nm_test_func(void);
374990b17f1bSmrgvoid nm_test_func(void){}
375090b17f1bSmrg#ifdef __cplusplus
375190b17f1bSmrg}
375290b17f1bSmrg#endif
375390b17f1bSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
375490b17f1bSmrg_LT_EOF
37557e6fb56fSmrg
375690b17f1bSmrg  if AC_TRY_EVAL(ac_compile); then
375790b17f1bSmrg    # Now try to grab the symbols.
375890b17f1bSmrg    nlist=conftest.nm
375990b17f1bSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
376090b17f1bSmrg      # Try sorting and uniquifying the output.
376190b17f1bSmrg      if sort "$nlist" | uniq > "$nlist"T; then
376290b17f1bSmrg	mv -f "$nlist"T "$nlist"
376390b17f1bSmrg      else
376490b17f1bSmrg	rm -f "$nlist"T
376590b17f1bSmrg      fi
37667e6fb56fSmrg
376790b17f1bSmrg      # Make sure that we snagged all the symbols we need.
376890b17f1bSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
376990b17f1bSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
377090b17f1bSmrg	  cat <<_LT_EOF > conftest.$ac_ext
377190b17f1bSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
377290b17f1bSmrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
377390b17f1bSmrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
377490b17f1bSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
377590b17f1bSmrg# define LT@&t@_DLSYM_CONST
377690b17f1bSmrg#elif defined(__osf__)
377790b17f1bSmrg/* This system does not cope well with relocations in const data.  */
377890b17f1bSmrg# define LT@&t@_DLSYM_CONST
377990b17f1bSmrg#else
378090b17f1bSmrg# define LT@&t@_DLSYM_CONST const
378190b17f1bSmrg#endif
37827e6fb56fSmrg
378390b17f1bSmrg#ifdef __cplusplus
378490b17f1bSmrgextern "C" {
378590b17f1bSmrg#endif
37867e6fb56fSmrg
378790b17f1bSmrg_LT_EOF
378890b17f1bSmrg	  # Now generate the symbol file.
378990b17f1bSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
37907e6fb56fSmrg
379190b17f1bSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
37927e6fb56fSmrg
379390b17f1bSmrg/* The mapping between symbol names and symbols.  */
379490b17f1bSmrgLT@&t@_DLSYM_CONST struct {
379590b17f1bSmrg  const char *name;
379690b17f1bSmrg  void       *address;
379790b17f1bSmrg}
379890b17f1bSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
379990b17f1bSmrg{
380090b17f1bSmrg  { "@PROGRAM@", (void *) 0 },
380190b17f1bSmrg_LT_EOF
380290b17f1bSmrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
380390b17f1bSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
380490b17f1bSmrg  {0, (void *) 0}
380590b17f1bSmrg};
38067e6fb56fSmrg
380790b17f1bSmrg/* This works around a problem in FreeBSD linker */
380890b17f1bSmrg#ifdef FREEBSD_WORKAROUND
380990b17f1bSmrgstatic const void *lt_preloaded_setup() {
381090b17f1bSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
381190b17f1bSmrg}
381290b17f1bSmrg#endif
38137e6fb56fSmrg
381490b17f1bSmrg#ifdef __cplusplus
381590b17f1bSmrg}
381690b17f1bSmrg#endif
381790b17f1bSmrg_LT_EOF
381890b17f1bSmrg	  # Now try linking the two files.
381990b17f1bSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
382090b17f1bSmrg	  lt_globsym_save_LIBS=$LIBS
382190b17f1bSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
382290b17f1bSmrg	  LIBS="conftstm.$ac_objext"
382390b17f1bSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
382490b17f1bSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
382590b17f1bSmrg	    pipe_works=yes
382690b17f1bSmrg	  fi
382790b17f1bSmrg	  LIBS=$lt_globsym_save_LIBS
382890b17f1bSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
382990b17f1bSmrg	else
383090b17f1bSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
383190b17f1bSmrg	fi
383290b17f1bSmrg      else
383390b17f1bSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
383490b17f1bSmrg      fi
383590b17f1bSmrg    else
383690b17f1bSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
38377e6fb56fSmrg    fi
383890b17f1bSmrg  else
383990b17f1bSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
384090b17f1bSmrg    cat conftest.$ac_ext >&5
38417e6fb56fSmrg  fi
384290b17f1bSmrg  rm -rf conftest* conftst*
38437e6fb56fSmrg
384490b17f1bSmrg  # Do not use the global_symbol_pipe unless it works.
384590b17f1bSmrg  if test "$pipe_works" = yes; then
384690b17f1bSmrg    break
384790b17f1bSmrg  else
384890b17f1bSmrg    lt_cv_sys_global_symbol_pipe=
384990b17f1bSmrg  fi
385090b17f1bSmrgdone
385190b17f1bSmrg])
385290b17f1bSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
385390b17f1bSmrg  lt_cv_sys_global_symbol_to_cdecl=
385490b17f1bSmrgfi
385590b17f1bSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
385690b17f1bSmrg  AC_MSG_RESULT(failed)
385790b17f1bSmrgelse
385890b17f1bSmrg  AC_MSG_RESULT(ok)
385990b17f1bSmrgfi
38607e6fb56fSmrg
386190b17f1bSmrg# Response file support.
386290b17f1bSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
386390b17f1bSmrg  nm_file_list_spec='@'
386490b17f1bSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
386590b17f1bSmrg  nm_file_list_spec='@'
386690b17f1bSmrgfi
38677e6fb56fSmrg
386890b17f1bSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
386990b17f1bSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
387090b17f1bSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
387190b17f1bSmrg    [Transform the output of nm in a proper C declaration])
387290b17f1bSmrg_LT_DECL([global_symbol_to_c_name_address],
387390b17f1bSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
387490b17f1bSmrg    [Transform the output of nm in a C name address pair])
387590b17f1bSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
387690b17f1bSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
387790b17f1bSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
387890b17f1bSmrg_LT_DECL([], [nm_file_list_spec], [1],
387990b17f1bSmrg    [Specify filename containing input files for $NM])
388090b17f1bSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
388190b17f1bSmrg
388290b17f1bSmrg
388390b17f1bSmrg# _LT_COMPILER_PIC([TAGNAME])
388490b17f1bSmrg# ---------------------------
388590b17f1bSmrgm4_defun([_LT_COMPILER_PIC],
388690b17f1bSmrg[m4_require([_LT_TAG_COMPILER])dnl
388790b17f1bSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
388890b17f1bSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
388990b17f1bSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
38907e6fb56fSmrg
389190b17f1bSmrgm4_if([$1], [CXX], [
389290b17f1bSmrg  # C++ specific cases for pic, static, wl, etc.
389390b17f1bSmrg  if test "$GXX" = yes; then
389490b17f1bSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
389590b17f1bSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
38967e6fb56fSmrg
389790b17f1bSmrg    case $host_os in
389890b17f1bSmrg    aix*)
389990b17f1bSmrg      # All AIX code is PIC.
390090b17f1bSmrg      if test "$host_cpu" = ia64; then
390190b17f1bSmrg	# AIX 5 now supports IA64 processor
390290b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
390390b17f1bSmrg      fi
390490b17f1bSmrg      ;;
39057e6fb56fSmrg
390690b17f1bSmrg    amigaos*)
390790b17f1bSmrg      case $host_cpu in
390890b17f1bSmrg      powerpc)
390990b17f1bSmrg            # see comment about AmigaOS4 .so support
391090b17f1bSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
391190b17f1bSmrg        ;;
391290b17f1bSmrg      m68k)
391390b17f1bSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
391490b17f1bSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
391590b17f1bSmrg            # like `-m68040'.
391690b17f1bSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
391790b17f1bSmrg        ;;
391890b17f1bSmrg      esac
391990b17f1bSmrg      ;;
39207e6fb56fSmrg
392190b17f1bSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
392290b17f1bSmrg      # PIC is the default for these OSes.
392390b17f1bSmrg      ;;
392490b17f1bSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
392590b17f1bSmrg      # This hack is so that the source file can tell whether it is being
392690b17f1bSmrg      # built for inclusion in a dll (and should export symbols for example).
392790b17f1bSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
392890b17f1bSmrg      # (--disable-auto-import) libraries
392990b17f1bSmrg      m4_if([$1], [GCJ], [],
393090b17f1bSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
393190b17f1bSmrg      ;;
393290b17f1bSmrg    darwin* | rhapsody*)
393390b17f1bSmrg      # PIC is the default on this platform
393490b17f1bSmrg      # Common symbols not allowed in MH_DYLIB files
393590b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
393690b17f1bSmrg      ;;
393790b17f1bSmrg    *djgpp*)
393890b17f1bSmrg      # DJGPP does not support shared libraries at all
393990b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
394090b17f1bSmrg      ;;
394190b17f1bSmrg    haiku*)
394290b17f1bSmrg      # PIC is the default for Haiku.
394390b17f1bSmrg      # The "-static" flag exists, but is broken.
394490b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
394590b17f1bSmrg      ;;
394690b17f1bSmrg    interix[[3-9]]*)
394790b17f1bSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
394890b17f1bSmrg      # Instead, we relocate shared libraries at runtime.
394990b17f1bSmrg      ;;
395090b17f1bSmrg    sysv4*MP*)
395190b17f1bSmrg      if test -d /usr/nec; then
395290b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
395390b17f1bSmrg      fi
395490b17f1bSmrg      ;;
395590b17f1bSmrg    hpux*)
395690b17f1bSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
395790b17f1bSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
395890b17f1bSmrg      # sets the default TLS model and affects inlining.
395990b17f1bSmrg      case $host_cpu in
396090b17f1bSmrg      hppa*64*)
396190b17f1bSmrg	;;
396290b17f1bSmrg      *)
396390b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
396490b17f1bSmrg	;;
396590b17f1bSmrg      esac
396690b17f1bSmrg      ;;
396790b17f1bSmrg    *qnx* | *nto*)
396890b17f1bSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
396990b17f1bSmrg      # it will coredump.
397090b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
39717e6fb56fSmrg      ;;
39727e6fb56fSmrg    *)
397390b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39747e6fb56fSmrg      ;;
39757e6fb56fSmrg    esac
397690b17f1bSmrg  else
397790b17f1bSmrg    case $host_os in
397890b17f1bSmrg      aix[[4-9]]*)
397990b17f1bSmrg	# All AIX code is PIC.
398090b17f1bSmrg	if test "$host_cpu" = ia64; then
398190b17f1bSmrg	  # AIX 5 now supports IA64 processor
398290b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
398390b17f1bSmrg	else
398490b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
398590b17f1bSmrg	fi
398690b17f1bSmrg	;;
398790b17f1bSmrg      chorus*)
398890b17f1bSmrg	case $cc_basename in
398990b17f1bSmrg	cxch68*)
399090b17f1bSmrg	  # Green Hills C++ Compiler
399190b17f1bSmrg	  # _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"
399290b17f1bSmrg	  ;;
399390b17f1bSmrg	esac
399490b17f1bSmrg	;;
399590b17f1bSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
399690b17f1bSmrg	# This hack is so that the source file can tell whether it is being
399790b17f1bSmrg	# built for inclusion in a dll (and should export symbols for example).
399890b17f1bSmrg	m4_if([$1], [GCJ], [],
399990b17f1bSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
400090b17f1bSmrg	;;
400190b17f1bSmrg      dgux*)
400290b17f1bSmrg	case $cc_basename in
400390b17f1bSmrg	  ec++*)
400490b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
400590b17f1bSmrg	    ;;
400690b17f1bSmrg	  ghcx*)
400790b17f1bSmrg	    # Green Hills C++ Compiler
400890b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
400990b17f1bSmrg	    ;;
401090b17f1bSmrg	  *)
401190b17f1bSmrg	    ;;
401290b17f1bSmrg	esac
401390b17f1bSmrg	;;
401490b17f1bSmrg      freebsd* | dragonfly*)
401590b17f1bSmrg	# FreeBSD uses GNU C++
401690b17f1bSmrg	;;
401790b17f1bSmrg      hpux9* | hpux10* | hpux11*)
401890b17f1bSmrg	case $cc_basename in
401990b17f1bSmrg	  CC*)
402090b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
402190b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
402290b17f1bSmrg	    if test "$host_cpu" != ia64; then
402390b17f1bSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
402490b17f1bSmrg	    fi
402590b17f1bSmrg	    ;;
402690b17f1bSmrg	  aCC*)
402790b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
402890b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
402990b17f1bSmrg	    case $host_cpu in
403090b17f1bSmrg	    hppa*64*|ia64*)
403190b17f1bSmrg	      # +Z the default
403290b17f1bSmrg	      ;;
403390b17f1bSmrg	    *)
403490b17f1bSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
403590b17f1bSmrg	      ;;
403690b17f1bSmrg	    esac
403790b17f1bSmrg	    ;;
403890b17f1bSmrg	  *)
403990b17f1bSmrg	    ;;
404090b17f1bSmrg	esac
404190b17f1bSmrg	;;
404290b17f1bSmrg      interix*)
404390b17f1bSmrg	# This is c89, which is MS Visual C++ (no shared libs)
404490b17f1bSmrg	# Anyone wants to do a port?
404590b17f1bSmrg	;;
404690b17f1bSmrg      irix5* | irix6* | nonstopux*)
404790b17f1bSmrg	case $cc_basename in
404890b17f1bSmrg	  CC*)
404990b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
405090b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
405190b17f1bSmrg	    # CC pic flag -KPIC is the default.
405290b17f1bSmrg	    ;;
405390b17f1bSmrg	  *)
405490b17f1bSmrg	    ;;
405590b17f1bSmrg	esac
405690b17f1bSmrg	;;
405790b17f1bSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
405890b17f1bSmrg	case $cc_basename in
405990b17f1bSmrg	  KCC*)
406090b17f1bSmrg	    # KAI C++ Compiler
406190b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
406290b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
406390b17f1bSmrg	    ;;
406490b17f1bSmrg	  ecpc* )
406590b17f1bSmrg	    # old Intel C++ for x86_64 which still supported -KPIC.
406690b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
406790b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
406890b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
406990b17f1bSmrg	    ;;
407090b17f1bSmrg	  icpc* )
407190b17f1bSmrg	    # Intel C++, used to be incompatible with GCC.
407290b17f1bSmrg	    # ICC 10 doesn't accept -KPIC any more.
407390b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
407490b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
407590b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
407690b17f1bSmrg	    ;;
407790b17f1bSmrg	  pgCC* | pgcpp*)
407890b17f1bSmrg	    # Portland Group C++ compiler
407990b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
408090b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
408190b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
408290b17f1bSmrg	    ;;
408390b17f1bSmrg	  cxx*)
408490b17f1bSmrg	    # Compaq C++
408590b17f1bSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
408690b17f1bSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
408790b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
408890b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
408990b17f1bSmrg	    ;;
409090b17f1bSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
409190b17f1bSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
409290b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
409390b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
409490b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
409590b17f1bSmrg	    ;;
409690b17f1bSmrg	  *)
409790b17f1bSmrg	    case `$CC -V 2>&1 | sed 5q` in
409890b17f1bSmrg	    *Sun\ C*)
409990b17f1bSmrg	      # Sun C++ 5.9
410090b17f1bSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
410190b17f1bSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
410290b17f1bSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
410390b17f1bSmrg	      ;;
410490b17f1bSmrg	    esac
410590b17f1bSmrg	    ;;
410690b17f1bSmrg	esac
410790b17f1bSmrg	;;
410890b17f1bSmrg      lynxos*)
410990b17f1bSmrg	;;
411090b17f1bSmrg      m88k*)
411190b17f1bSmrg	;;
411290b17f1bSmrg      mvs*)
411390b17f1bSmrg	case $cc_basename in
411490b17f1bSmrg	  cxx*)
411590b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
411690b17f1bSmrg	    ;;
411790b17f1bSmrg	  *)
411890b17f1bSmrg	    ;;
411990b17f1bSmrg	esac
412090b17f1bSmrg	;;
412190b17f1bSmrg      netbsd*)
412290b17f1bSmrg	;;
412390b17f1bSmrg      *qnx* | *nto*)
412490b17f1bSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
412590b17f1bSmrg        # it will coredump.
412690b17f1bSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
412790b17f1bSmrg        ;;
412890b17f1bSmrg      osf3* | osf4* | osf5*)
412990b17f1bSmrg	case $cc_basename in
413090b17f1bSmrg	  KCC*)
413190b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
413290b17f1bSmrg	    ;;
413390b17f1bSmrg	  RCC*)
413490b17f1bSmrg	    # Rational C++ 2.4.1
413590b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
413690b17f1bSmrg	    ;;
413790b17f1bSmrg	  cxx*)
413890b17f1bSmrg	    # Digital/Compaq C++
413990b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
414090b17f1bSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
414190b17f1bSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
414290b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
414390b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
414490b17f1bSmrg	    ;;
414590b17f1bSmrg	  *)
414690b17f1bSmrg	    ;;
414790b17f1bSmrg	esac
414890b17f1bSmrg	;;
414990b17f1bSmrg      psos*)
415090b17f1bSmrg	;;
415190b17f1bSmrg      solaris*)
415290b17f1bSmrg	case $cc_basename in
415390b17f1bSmrg	  CC* | sunCC*)
415490b17f1bSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
415590b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
415690b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
415790b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
415890b17f1bSmrg	    ;;
415990b17f1bSmrg	  gcx*)
416090b17f1bSmrg	    # Green Hills C++ Compiler
416190b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
416290b17f1bSmrg	    ;;
416390b17f1bSmrg	  *)
416490b17f1bSmrg	    ;;
416590b17f1bSmrg	esac
416690b17f1bSmrg	;;
416790b17f1bSmrg      sunos4*)
416890b17f1bSmrg	case $cc_basename in
416990b17f1bSmrg	  CC*)
417090b17f1bSmrg	    # Sun C++ 4.x
417190b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
417290b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
417390b17f1bSmrg	    ;;
417490b17f1bSmrg	  lcc*)
417590b17f1bSmrg	    # Lucid
417690b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
417790b17f1bSmrg	    ;;
417890b17f1bSmrg	  *)
417990b17f1bSmrg	    ;;
418090b17f1bSmrg	esac
418190b17f1bSmrg	;;
418290b17f1bSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
418390b17f1bSmrg	case $cc_basename in
418490b17f1bSmrg	  CC*)
418590b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
418690b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
418790b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
418890b17f1bSmrg	    ;;
418990b17f1bSmrg	esac
419090b17f1bSmrg	;;
419190b17f1bSmrg      tandem*)
419290b17f1bSmrg	case $cc_basename in
419390b17f1bSmrg	  NCC*)
419490b17f1bSmrg	    # NonStop-UX NCC 3.20
419590b17f1bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
419690b17f1bSmrg	    ;;
419790b17f1bSmrg	  *)
419890b17f1bSmrg	    ;;
419990b17f1bSmrg	esac
420090b17f1bSmrg	;;
420190b17f1bSmrg      vxworks*)
420290b17f1bSmrg	;;
420390b17f1bSmrg      *)
420490b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
420590b17f1bSmrg	;;
420690b17f1bSmrg    esac
420790b17f1bSmrg  fi
420890b17f1bSmrg],
420990b17f1bSmrg[
421090b17f1bSmrg  if test "$GCC" = yes; then
421190b17f1bSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
421290b17f1bSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
42137e6fb56fSmrg
421490b17f1bSmrg    case $host_os in
421590b17f1bSmrg      aix*)
421690b17f1bSmrg      # All AIX code is PIC.
421790b17f1bSmrg      if test "$host_cpu" = ia64; then
421890b17f1bSmrg	# AIX 5 now supports IA64 processor
421990b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
422090b17f1bSmrg      fi
422190b17f1bSmrg      ;;
42227e6fb56fSmrg
422390b17f1bSmrg    amigaos*)
422490b17f1bSmrg      case $host_cpu in
422590b17f1bSmrg      powerpc)
422690b17f1bSmrg            # see comment about AmigaOS4 .so support
422790b17f1bSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
422890b17f1bSmrg        ;;
422990b17f1bSmrg      m68k)
423090b17f1bSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
423190b17f1bSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
423290b17f1bSmrg            # like `-m68040'.
423390b17f1bSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
423490b17f1bSmrg        ;;
423590b17f1bSmrg      esac
423690b17f1bSmrg      ;;
42377e6fb56fSmrg
423890b17f1bSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
423990b17f1bSmrg      # PIC is the default for these OSes.
424090b17f1bSmrg      ;;
42417e6fb56fSmrg
424290b17f1bSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
424390b17f1bSmrg      # This hack is so that the source file can tell whether it is being
424490b17f1bSmrg      # built for inclusion in a dll (and should export symbols for example).
424590b17f1bSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
424690b17f1bSmrg      # (--disable-auto-import) libraries
424790b17f1bSmrg      m4_if([$1], [GCJ], [],
424890b17f1bSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
424990b17f1bSmrg      ;;
42507e6fb56fSmrg
425190b17f1bSmrg    darwin* | rhapsody*)
425290b17f1bSmrg      # PIC is the default on this platform
425390b17f1bSmrg      # Common symbols not allowed in MH_DYLIB files
425490b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
425590b17f1bSmrg      ;;
42567e6fb56fSmrg
425790b17f1bSmrg    haiku*)
425890b17f1bSmrg      # PIC is the default for Haiku.
425990b17f1bSmrg      # The "-static" flag exists, but is broken.
426090b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
426190b17f1bSmrg      ;;
42627e6fb56fSmrg
426390b17f1bSmrg    hpux*)
426490b17f1bSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
426590b17f1bSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
426690b17f1bSmrg      # sets the default TLS model and affects inlining.
426790b17f1bSmrg      case $host_cpu in
426890b17f1bSmrg      hppa*64*)
426990b17f1bSmrg	# +Z the default
427090b17f1bSmrg	;;
427190b17f1bSmrg      *)
427290b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
427390b17f1bSmrg	;;
427490b17f1bSmrg      esac
427590b17f1bSmrg      ;;
42767e6fb56fSmrg
427790b17f1bSmrg    interix[[3-9]]*)
427890b17f1bSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
427990b17f1bSmrg      # Instead, we relocate shared libraries at runtime.
428090b17f1bSmrg      ;;
42817e6fb56fSmrg
428290b17f1bSmrg    msdosdjgpp*)
428390b17f1bSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
428490b17f1bSmrg      # on systems that don't support them.
428590b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
428690b17f1bSmrg      enable_shared=no
428790b17f1bSmrg      ;;
42887e6fb56fSmrg
428990b17f1bSmrg    *nto* | *qnx*)
429090b17f1bSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
429190b17f1bSmrg      # it will coredump.
429290b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
429390b17f1bSmrg      ;;
42947e6fb56fSmrg
429590b17f1bSmrg    sysv4*MP*)
429690b17f1bSmrg      if test -d /usr/nec; then
429790b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
429890b17f1bSmrg      fi
429990b17f1bSmrg      ;;
43007e6fb56fSmrg
430190b17f1bSmrg    *)
430290b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
430390b17f1bSmrg      ;;
430490b17f1bSmrg    esac
43057e6fb56fSmrg
430690b17f1bSmrg    case $cc_basename in
430790b17f1bSmrg    nvcc*) # Cuda Compiler Driver 2.2
430890b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
430990b17f1bSmrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
431090b17f1bSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
431190b17f1bSmrg      fi
431290b17f1bSmrg      ;;
431390b17f1bSmrg    esac
431490b17f1bSmrg  else
431590b17f1bSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
431690b17f1bSmrg    case $host_os in
431790b17f1bSmrg    aix*)
431890b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
431990b17f1bSmrg      if test "$host_cpu" = ia64; then
432090b17f1bSmrg	# AIX 5 now supports IA64 processor
432190b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
432290b17f1bSmrg      else
432390b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
432490b17f1bSmrg      fi
432590b17f1bSmrg      ;;
43267e6fb56fSmrg
432790b17f1bSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
432890b17f1bSmrg      # This hack is so that the source file can tell whether it is being
432990b17f1bSmrg      # built for inclusion in a dll (and should export symbols for example).
433090b17f1bSmrg      m4_if([$1], [GCJ], [],
433190b17f1bSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
433290b17f1bSmrg      ;;
43337e6fb56fSmrg
433490b17f1bSmrg    hpux9* | hpux10* | hpux11*)
433590b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
433690b17f1bSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
433790b17f1bSmrg      # not for PA HP-UX.
433890b17f1bSmrg      case $host_cpu in
433990b17f1bSmrg      hppa*64*|ia64*)
434090b17f1bSmrg	# +Z the default
434190b17f1bSmrg	;;
434290b17f1bSmrg      *)
434390b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
434490b17f1bSmrg	;;
434590b17f1bSmrg      esac
434690b17f1bSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
434790b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
434890b17f1bSmrg      ;;
43497e6fb56fSmrg
435090b17f1bSmrg    irix5* | irix6* | nonstopux*)
435190b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
435290b17f1bSmrg      # PIC (with -KPIC) is the default.
435390b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
435490b17f1bSmrg      ;;
43557e6fb56fSmrg
435690b17f1bSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
435790b17f1bSmrg      case $cc_basename in
435890b17f1bSmrg      # old Intel for x86_64 which still supported -KPIC.
435990b17f1bSmrg      ecc*)
436090b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
436190b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
436290b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
436390b17f1bSmrg        ;;
436490b17f1bSmrg      # icc used to be incompatible with GCC.
436590b17f1bSmrg      # ICC 10 doesn't accept -KPIC any more.
436690b17f1bSmrg      icc* | ifort*)
436790b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
436890b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
436990b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
437090b17f1bSmrg        ;;
437190b17f1bSmrg      # Lahey Fortran 8.1.
437290b17f1bSmrg      lf95*)
437390b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
437490b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
437590b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
437690b17f1bSmrg	;;
437790b17f1bSmrg      nagfor*)
437890b17f1bSmrg	# NAG Fortran compiler
437990b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
438090b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
438190b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
438290b17f1bSmrg	;;
438390b17f1bSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
438490b17f1bSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
438590b17f1bSmrg	# which looks to be a dead project)
438690b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
438790b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
438890b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
438990b17f1bSmrg        ;;
439090b17f1bSmrg      ccc*)
439190b17f1bSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
439290b17f1bSmrg        # All Alpha code is PIC.
439390b17f1bSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
439490b17f1bSmrg        ;;
439590b17f1bSmrg      xl* | bgxl* | bgf* | mpixl*)
439690b17f1bSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
439790b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
439890b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
439990b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
440090b17f1bSmrg	;;
440190b17f1bSmrg      *)
440290b17f1bSmrg	case `$CC -V 2>&1 | sed 5q` in
440390b17f1bSmrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
440490b17f1bSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
440590b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
440690b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
440790b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
440890b17f1bSmrg	  ;;
440990b17f1bSmrg	*Sun\ F* | *Sun*Fortran*)
441090b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
441190b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
441290b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
441390b17f1bSmrg	  ;;
441490b17f1bSmrg	*Sun\ C*)
441590b17f1bSmrg	  # Sun C 5.9
441690b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
441790b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
441890b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
441990b17f1bSmrg	  ;;
442090b17f1bSmrg        *Intel*\ [[CF]]*Compiler*)
442190b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
442290b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
442390b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
442490b17f1bSmrg	  ;;
442590b17f1bSmrg	*Portland\ Group*)
442690b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
442790b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
442890b17f1bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
442990b17f1bSmrg	  ;;
443090b17f1bSmrg	esac
443190b17f1bSmrg	;;
443290b17f1bSmrg      esac
443390b17f1bSmrg      ;;
44347e6fb56fSmrg
443590b17f1bSmrg    newsos6)
443690b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
443790b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
443890b17f1bSmrg      ;;
44397e6fb56fSmrg
444090b17f1bSmrg    *nto* | *qnx*)
444190b17f1bSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
444290b17f1bSmrg      # it will coredump.
444390b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
444490b17f1bSmrg      ;;
44457e6fb56fSmrg
444690b17f1bSmrg    osf3* | osf4* | osf5*)
444790b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
444890b17f1bSmrg      # All OSF/1 code is PIC.
444990b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
445090b17f1bSmrg      ;;
44517e6fb56fSmrg
445290b17f1bSmrg    rdos*)
445390b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
445490b17f1bSmrg      ;;
44557e6fb56fSmrg
445690b17f1bSmrg    solaris*)
445790b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
445890b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
445990b17f1bSmrg      case $cc_basename in
446090b17f1bSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
446190b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
446290b17f1bSmrg      *)
446390b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
446490b17f1bSmrg      esac
446590b17f1bSmrg      ;;
44667e6fb56fSmrg
446790b17f1bSmrg    sunos4*)
446890b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
446990b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
447090b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
447190b17f1bSmrg      ;;
44727e6fb56fSmrg
447390b17f1bSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
447490b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
447590b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
447690b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
447790b17f1bSmrg      ;;
44787e6fb56fSmrg
447990b17f1bSmrg    sysv4*MP*)
448090b17f1bSmrg      if test -d /usr/nec ;then
448190b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
448290b17f1bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
448390b17f1bSmrg      fi
448490b17f1bSmrg      ;;
44857e6fb56fSmrg
448690b17f1bSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
448790b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
448890b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
448990b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
449090b17f1bSmrg      ;;
44917e6fb56fSmrg
449290b17f1bSmrg    unicos*)
449390b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
449490b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
449590b17f1bSmrg      ;;
44967e6fb56fSmrg
449790b17f1bSmrg    uts4*)
449890b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
449990b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
450090b17f1bSmrg      ;;
45017e6fb56fSmrg
450290b17f1bSmrg    *)
450390b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
450490b17f1bSmrg      ;;
450590b17f1bSmrg    esac
450690b17f1bSmrg  fi
450790b17f1bSmrg])
450890b17f1bSmrgcase $host_os in
450990b17f1bSmrg  # For platforms which do not support PIC, -DPIC is meaningless:
451090b17f1bSmrg  *djgpp*)
451190b17f1bSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
451290b17f1bSmrg    ;;
451390b17f1bSmrg  *)
451490b17f1bSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
451590b17f1bSmrg    ;;
451690b17f1bSmrgesac
45177e6fb56fSmrg
451890b17f1bSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
451990b17f1bSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
452090b17f1bSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
452190b17f1bSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
45227e6fb56fSmrg
452390b17f1bSmrg#
452490b17f1bSmrg# Check to make sure the PIC flag actually works.
452590b17f1bSmrg#
452690b17f1bSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
452790b17f1bSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
452890b17f1bSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
452990b17f1bSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
453090b17f1bSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
453190b17f1bSmrg     "" | " "*) ;;
453290b17f1bSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
453390b17f1bSmrg     esac],
453490b17f1bSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
453590b17f1bSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
453690b17f1bSmrgfi
453790b17f1bSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
453890b17f1bSmrg	[Additional compiler flags for building library objects])
45397e6fb56fSmrg
454090b17f1bSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
454190b17f1bSmrg	[How to pass a linker flag through the compiler])
454290b17f1bSmrg#
454390b17f1bSmrg# Check to make sure the static flag actually works.
454490b17f1bSmrg#
454590b17f1bSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
454690b17f1bSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
454790b17f1bSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
454890b17f1bSmrg  $lt_tmp_static_flag,
454990b17f1bSmrg  [],
455090b17f1bSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
455190b17f1bSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
455290b17f1bSmrg	[Compiler flag to prevent dynamic linking])
455390b17f1bSmrg])# _LT_COMPILER_PIC
45547e6fb56fSmrg
45557e6fb56fSmrg
455690b17f1bSmrg# _LT_LINKER_SHLIBS([TAGNAME])
455790b17f1bSmrg# ----------------------------
455890b17f1bSmrg# See if the linker supports building shared libraries.
455990b17f1bSmrgm4_defun([_LT_LINKER_SHLIBS],
456090b17f1bSmrg[AC_REQUIRE([LT_PATH_LD])dnl
456190b17f1bSmrgAC_REQUIRE([LT_PATH_NM])dnl
456290b17f1bSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
456390b17f1bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
456490b17f1bSmrgm4_require([_LT_DECL_EGREP])dnl
456590b17f1bSmrgm4_require([_LT_DECL_SED])dnl
456690b17f1bSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
456790b17f1bSmrgm4_require([_LT_TAG_COMPILER])dnl
456890b17f1bSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
456990b17f1bSmrgm4_if([$1], [CXX], [
457090b17f1bSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
457190b17f1bSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
457290b17f1bSmrg  case $host_os in
457390b17f1bSmrg  aix[[4-9]]*)
457490b17f1bSmrg    # If we're using GNU nm, then we don't want the "-C" option.
457590b17f1bSmrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
457690b17f1bSmrg    # Also, AIX nm treats weak defined symbols like other global defined
457790b17f1bSmrg    # symbols, whereas GNU nm marks them as "W".
457890b17f1bSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
457990b17f1bSmrg      _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'
458090b17f1bSmrg    else
458190b17f1bSmrg      _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'
458290b17f1bSmrg    fi
458390b17f1bSmrg    ;;
458490b17f1bSmrg  pw32*)
458590b17f1bSmrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
458690b17f1bSmrg    ;;
458790b17f1bSmrg  cygwin* | mingw* | cegcc*)
458890b17f1bSmrg    case $cc_basename in
458990b17f1bSmrg    cl*)
459090b17f1bSmrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
459190b17f1bSmrg      ;;
459290b17f1bSmrg    *)
459390b17f1bSmrg      _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'
459490b17f1bSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
459590b17f1bSmrg      ;;
459690b17f1bSmrg    esac
459790b17f1bSmrg    ;;
459890b17f1bSmrg  *)
459990b17f1bSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
460090b17f1bSmrg    ;;
460190b17f1bSmrg  esac
460290b17f1bSmrg], [
460390b17f1bSmrg  runpath_var=
460490b17f1bSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
460590b17f1bSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
460690b17f1bSmrg  _LT_TAGVAR(archive_cmds, $1)=
460790b17f1bSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
460890b17f1bSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
460990b17f1bSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
461090b17f1bSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
461190b17f1bSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
461290b17f1bSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
461390b17f1bSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
461490b17f1bSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
461590b17f1bSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
461690b17f1bSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
461790b17f1bSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
461890b17f1bSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
461990b17f1bSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
462090b17f1bSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
462190b17f1bSmrg  _LT_TAGVAR(module_cmds, $1)=
462290b17f1bSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
462390b17f1bSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
462490b17f1bSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
462590b17f1bSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
462690b17f1bSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
462790b17f1bSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
462890b17f1bSmrg  # included in the symbol list
462990b17f1bSmrg  _LT_TAGVAR(include_expsyms, $1)=
463090b17f1bSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
463190b17f1bSmrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
463290b17f1bSmrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
463390b17f1bSmrg  # as well as any symbol that contains `d'.
463490b17f1bSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
463590b17f1bSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
463690b17f1bSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
463790b17f1bSmrg  # the symbol is explicitly referenced.  Since portable code cannot
463890b17f1bSmrg  # rely on this symbol name, it's probably fine to never include it in
463990b17f1bSmrg  # preloaded symbol tables.
464090b17f1bSmrg  # Exclude shared library initialization/finalization symbols.
464190b17f1bSmrgdnl Note also adjust exclude_expsyms for C++ above.
464290b17f1bSmrg  extract_expsyms_cmds=
46437e6fb56fSmrg
464490b17f1bSmrg  case $host_os in
464590b17f1bSmrg  cygwin* | mingw* | pw32* | cegcc*)
464690b17f1bSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
464790b17f1bSmrg    # When not using gcc, we currently assume that we are using
464890b17f1bSmrg    # Microsoft Visual C++.
464990b17f1bSmrg    if test "$GCC" != yes; then
465090b17f1bSmrg      with_gnu_ld=no
465190b17f1bSmrg    fi
465290b17f1bSmrg    ;;
465390b17f1bSmrg  interix*)
465490b17f1bSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
465590b17f1bSmrg    with_gnu_ld=yes
465690b17f1bSmrg    ;;
465790b17f1bSmrg  openbsd*)
465890b17f1bSmrg    with_gnu_ld=no
465990b17f1bSmrg    ;;
466090b17f1bSmrg  esac
46617e6fb56fSmrg
466290b17f1bSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
46637e6fb56fSmrg
466490b17f1bSmrg  # On some targets, GNU ld is compatible enough with the native linker
466590b17f1bSmrg  # that we're better off using the native interface for both.
466690b17f1bSmrg  lt_use_gnu_ld_interface=no
466790b17f1bSmrg  if test "$with_gnu_ld" = yes; then
466890b17f1bSmrg    case $host_os in
466990b17f1bSmrg      aix*)
467090b17f1bSmrg	# The AIX port of GNU ld has always aspired to compatibility
467190b17f1bSmrg	# with the native linker.  However, as the warning in the GNU ld
467290b17f1bSmrg	# block says, versions before 2.19.5* couldn't really create working
467390b17f1bSmrg	# shared libraries, regardless of the interface used.
467490b17f1bSmrg	case `$LD -v 2>&1` in
467590b17f1bSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
467690b17f1bSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
467790b17f1bSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
467890b17f1bSmrg	  *)
467990b17f1bSmrg	    lt_use_gnu_ld_interface=yes
468090b17f1bSmrg	    ;;
468190b17f1bSmrg	esac
468290b17f1bSmrg	;;
468390b17f1bSmrg      *)
468490b17f1bSmrg	lt_use_gnu_ld_interface=yes
468590b17f1bSmrg	;;
468690b17f1bSmrg    esac
468790b17f1bSmrg  fi
46887e6fb56fSmrg
468990b17f1bSmrg  if test "$lt_use_gnu_ld_interface" = yes; then
469090b17f1bSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
469190b17f1bSmrg    wlarc='${wl}'
46927e6fb56fSmrg
469390b17f1bSmrg    # Set some defaults for GNU ld with shared library support. These
469490b17f1bSmrg    # are reset later if shared libraries are not supported. Putting them
469590b17f1bSmrg    # here allows them to be overridden if necessary.
469690b17f1bSmrg    runpath_var=LD_RUN_PATH
469790b17f1bSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
469890b17f1bSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
469990b17f1bSmrg    # ancient GNU ld didn't support --whole-archive et. al.
470090b17f1bSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
470190b17f1bSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
470290b17f1bSmrg    else
470390b17f1bSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
470490b17f1bSmrg    fi
470590b17f1bSmrg    supports_anon_versioning=no
470690b17f1bSmrg    case `$LD -v 2>&1` in
470790b17f1bSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
470890b17f1bSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
470990b17f1bSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
471090b17f1bSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
471190b17f1bSmrg      *\ 2.11.*) ;; # other 2.11 versions
471290b17f1bSmrg      *) supports_anon_versioning=yes ;;
471390b17f1bSmrg    esac
47147e6fb56fSmrg
471590b17f1bSmrg    # See if GNU ld supports shared libraries.
471690b17f1bSmrg    case $host_os in
471790b17f1bSmrg    aix[[3-9]]*)
471890b17f1bSmrg      # On AIX/PPC, the GNU linker is very broken
471990b17f1bSmrg      if test "$host_cpu" != ia64; then
472090b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
472190b17f1bSmrg	cat <<_LT_EOF 1>&2
47227e6fb56fSmrg
472390b17f1bSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
472490b17f1bSmrg*** to be unable to reliably create shared libraries on AIX.
472590b17f1bSmrg*** Therefore, libtool is disabling shared libraries support.  If you
472690b17f1bSmrg*** really care for shared libraries, you may want to install binutils
472790b17f1bSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
472890b17f1bSmrg*** You will then need to restart the configuration process.
47297e6fb56fSmrg
473090b17f1bSmrg_LT_EOF
473190b17f1bSmrg      fi
473290b17f1bSmrg      ;;
47337e6fb56fSmrg
473490b17f1bSmrg    amigaos*)
473590b17f1bSmrg      case $host_cpu in
473690b17f1bSmrg      powerpc)
473790b17f1bSmrg            # see comment about AmigaOS4 .so support
473890b17f1bSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
473990b17f1bSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
474090b17f1bSmrg        ;;
474190b17f1bSmrg      m68k)
474290b17f1bSmrg            _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)'
474390b17f1bSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
474490b17f1bSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
474590b17f1bSmrg        ;;
474690b17f1bSmrg      esac
474790b17f1bSmrg      ;;
47487e6fb56fSmrg
474990b17f1bSmrg    beos*)
475090b17f1bSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
475190b17f1bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
475290b17f1bSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
475390b17f1bSmrg	# support --undefined.  This deserves some investigation.  FIXME
475490b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
475590b17f1bSmrg      else
475690b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
475790b17f1bSmrg      fi
475890b17f1bSmrg      ;;
47597e6fb56fSmrg
476090b17f1bSmrg    cygwin* | mingw* | pw32* | cegcc*)
476190b17f1bSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
476290b17f1bSmrg      # as there is no search path for DLLs.
476390b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
476490b17f1bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
476590b17f1bSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
476690b17f1bSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
476790b17f1bSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
476890b17f1bSmrg      _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'
476990b17f1bSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
477090b17f1bSmrg
477190b17f1bSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
477290b17f1bSmrg        _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'
477390b17f1bSmrg	# If the export-symbols file already is a .def file (1st line
477490b17f1bSmrg	# is EXPORTS), use it as is; otherwise, prepend...
477590b17f1bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
477690b17f1bSmrg	  cp $export_symbols $output_objdir/$soname.def;
477790b17f1bSmrg	else
477890b17f1bSmrg	  echo EXPORTS > $output_objdir/$soname.def;
477990b17f1bSmrg	  cat $export_symbols >> $output_objdir/$soname.def;
478090b17f1bSmrg	fi~
478190b17f1bSmrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
478290b17f1bSmrg      else
478390b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
478490b17f1bSmrg      fi
478590b17f1bSmrg      ;;
47867e6fb56fSmrg
478790b17f1bSmrg    haiku*)
478890b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
478990b17f1bSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
479090b17f1bSmrg      ;;
47917e6fb56fSmrg
479290b17f1bSmrg    interix[[3-9]]*)
479390b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
479490b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
479590b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
479690b17f1bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
479790b17f1bSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
479890b17f1bSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
479990b17f1bSmrg      # default) and relocated if they conflict, which is a slow very memory
480090b17f1bSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
480190b17f1bSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
480290b17f1bSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
480390b17f1bSmrg      _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'
480490b17f1bSmrg      _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'
480590b17f1bSmrg      ;;
48067e6fb56fSmrg
480790b17f1bSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
480890b17f1bSmrg      tmp_diet=no
480990b17f1bSmrg      if test "$host_os" = linux-dietlibc; then
481090b17f1bSmrg	case $cc_basename in
481190b17f1bSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
481290b17f1bSmrg	esac
481390b17f1bSmrg      fi
481490b17f1bSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
481590b17f1bSmrg	 && test "$tmp_diet" = no
481690b17f1bSmrg      then
481790b17f1bSmrg	tmp_addflag=' $pic_flag'
481890b17f1bSmrg	tmp_sharedflag='-shared'
481990b17f1bSmrg	case $cc_basename,$host_cpu in
482090b17f1bSmrg        pgcc*)				# Portland Group C compiler
482190b17f1bSmrg	  _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'
482290b17f1bSmrg	  tmp_addflag=' $pic_flag'
482390b17f1bSmrg	  ;;
482490b17f1bSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
482590b17f1bSmrg					# Portland Group f77 and f90 compilers
482690b17f1bSmrg	  _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'
482790b17f1bSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
482890b17f1bSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
482990b17f1bSmrg	  tmp_addflag=' -i_dynamic' ;;
483090b17f1bSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
483190b17f1bSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
483290b17f1bSmrg	ifc* | ifort*)			# Intel Fortran compiler
483390b17f1bSmrg	  tmp_addflag=' -nofor_main' ;;
483490b17f1bSmrg	lf95*)				# Lahey Fortran 8.1
483590b17f1bSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
483690b17f1bSmrg	  tmp_sharedflag='--shared' ;;
483790b17f1bSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
483890b17f1bSmrg	  tmp_sharedflag='-qmkshrobj'
483990b17f1bSmrg	  tmp_addflag= ;;
484090b17f1bSmrg	nvcc*)	# Cuda Compiler Driver 2.2
484190b17f1bSmrg	  _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	  _LT_TAGVAR(compiler_needs_object, $1)=yes
484390b17f1bSmrg	  ;;
484490b17f1bSmrg	esac
484590b17f1bSmrg	case `$CC -V 2>&1 | sed 5q` in
484690b17f1bSmrg	*Sun\ C*)			# Sun C 5.9
484790b17f1bSmrg	  _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'
484890b17f1bSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
484990b17f1bSmrg	  tmp_sharedflag='-G' ;;
485090b17f1bSmrg	*Sun\ F*)			# Sun Fortran 8.3
485190b17f1bSmrg	  tmp_sharedflag='-G' ;;
485290b17f1bSmrg	esac
485390b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
48547e6fb56fSmrg
485590b17f1bSmrg        if test "x$supports_anon_versioning" = xyes; then
485690b17f1bSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
485790b17f1bSmrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
485890b17f1bSmrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
485990b17f1bSmrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
486090b17f1bSmrg        fi
48617e6fb56fSmrg
486290b17f1bSmrg	case $cc_basename in
486390b17f1bSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
486490b17f1bSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
486590b17f1bSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
486690b17f1bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
486790b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
486890b17f1bSmrg	  if test "x$supports_anon_versioning" = xyes; then
486990b17f1bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
487090b17f1bSmrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
487190b17f1bSmrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
487290b17f1bSmrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
487390b17f1bSmrg	  fi
487490b17f1bSmrg	  ;;
487590b17f1bSmrg	esac
487690b17f1bSmrg      else
487790b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
487890b17f1bSmrg      fi
487990b17f1bSmrg      ;;
48807e6fb56fSmrg
488190b17f1bSmrg    netbsd*)
488290b17f1bSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
488390b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
488490b17f1bSmrg	wlarc=
488590b17f1bSmrg      else
488690b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
488790b17f1bSmrg	_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'
488890b17f1bSmrg      fi
488990b17f1bSmrg      ;;
48907e6fb56fSmrg
489190b17f1bSmrg    solaris*)
489290b17f1bSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
489390b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
489490b17f1bSmrg	cat <<_LT_EOF 1>&2
48957e6fb56fSmrg
489690b17f1bSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
489790b17f1bSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
489890b17f1bSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
489990b17f1bSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
490090b17f1bSmrg*** your PATH or compiler configuration so that the native linker is
490190b17f1bSmrg*** used, and then restart.
49027e6fb56fSmrg
490390b17f1bSmrg_LT_EOF
490490b17f1bSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
490590b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
490690b17f1bSmrg	_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'
490790b17f1bSmrg      else
490890b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
490990b17f1bSmrg      fi
491090b17f1bSmrg      ;;
49117e6fb56fSmrg
491290b17f1bSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
491390b17f1bSmrg      case `$LD -v 2>&1` in
491490b17f1bSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
491590b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
491690b17f1bSmrg	cat <<_LT_EOF 1>&2
49177e6fb56fSmrg
491890b17f1bSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
491990b17f1bSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
492090b17f1bSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
492190b17f1bSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
492290b17f1bSmrg*** your PATH or compiler configuration so that the native linker is
492390b17f1bSmrg*** used, and then restart.
49247e6fb56fSmrg
492590b17f1bSmrg_LT_EOF
492690b17f1bSmrg	;;
492790b17f1bSmrg	*)
492890b17f1bSmrg	  # For security reasons, it is highly recommended that you always
492990b17f1bSmrg	  # use absolute paths for naming shared libraries, and exclude the
493090b17f1bSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
493190b17f1bSmrg	  # requires that you compile everything twice, which is a pain.
493290b17f1bSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
493390b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
493490b17f1bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
493590b17f1bSmrg	    _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'
493690b17f1bSmrg	  else
493790b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
493890b17f1bSmrg	  fi
493990b17f1bSmrg	;;
494090b17f1bSmrg      esac
494190b17f1bSmrg      ;;
49427e6fb56fSmrg
494390b17f1bSmrg    sunos4*)
494490b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
494590b17f1bSmrg      wlarc=
494690b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
494790b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
494890b17f1bSmrg      ;;
49497e6fb56fSmrg
495090b17f1bSmrg    *)
495190b17f1bSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
495290b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
495390b17f1bSmrg	_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'
495490b17f1bSmrg      else
495590b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
495690b17f1bSmrg      fi
495790b17f1bSmrg      ;;
495890b17f1bSmrg    esac
49597e6fb56fSmrg
496090b17f1bSmrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
496190b17f1bSmrg      runpath_var=
496290b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
496390b17f1bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
496490b17f1bSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
496590b17f1bSmrg    fi
496690b17f1bSmrg  else
496790b17f1bSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
496890b17f1bSmrg    case $host_os in
496990b17f1bSmrg    aix3*)
497090b17f1bSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
497190b17f1bSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
497290b17f1bSmrg      _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'
497390b17f1bSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
497490b17f1bSmrg      # are no directories specified by -L.
497590b17f1bSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
497690b17f1bSmrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
497790b17f1bSmrg	# Neither direct hardcoding nor static linking is supported with a
497890b17f1bSmrg	# broken collect2.
497990b17f1bSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
498090b17f1bSmrg      fi
498190b17f1bSmrg      ;;
49827e6fb56fSmrg
498390b17f1bSmrg    aix[[4-9]]*)
498490b17f1bSmrg      if test "$host_cpu" = ia64; then
498590b17f1bSmrg	# On IA64, the linker does run time linking by default, so we don't
498690b17f1bSmrg	# have to do anything special.
498790b17f1bSmrg	aix_use_runtimelinking=no
498890b17f1bSmrg	exp_sym_flag='-Bexport'
498990b17f1bSmrg	no_entry_flag=""
499090b17f1bSmrg      else
499190b17f1bSmrg	# If we're using GNU nm, then we don't want the "-C" option.
499290b17f1bSmrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
499390b17f1bSmrg	# Also, AIX nm treats weak defined symbols like other global
499490b17f1bSmrg	# defined symbols, whereas GNU nm marks them as "W".
499590b17f1bSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
499690b17f1bSmrg	  _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'
499790b17f1bSmrg	else
499890b17f1bSmrg	  _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'
499990b17f1bSmrg	fi
500090b17f1bSmrg	aix_use_runtimelinking=no
50017e6fb56fSmrg
500290b17f1bSmrg	# Test if we are trying to use run time linking or normal
500390b17f1bSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
500490b17f1bSmrg	# need to do runtime linking.
500590b17f1bSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
500690b17f1bSmrg	  for ld_flag in $LDFLAGS; do
500790b17f1bSmrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
500890b17f1bSmrg	    aix_use_runtimelinking=yes
500990b17f1bSmrg	    break
501090b17f1bSmrg	  fi
501190b17f1bSmrg	  done
501290b17f1bSmrg	  ;;
501390b17f1bSmrg	esac
50147e6fb56fSmrg
501590b17f1bSmrg	exp_sym_flag='-bexport'
501690b17f1bSmrg	no_entry_flag='-bnoentry'
501790b17f1bSmrg      fi
50187e6fb56fSmrg
501990b17f1bSmrg      # When large executables or shared objects are built, AIX ld can
502090b17f1bSmrg      # have problems creating the table of contents.  If linking a library
502190b17f1bSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
502290b17f1bSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
502390b17f1bSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
50247e6fb56fSmrg
502590b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)=''
502690b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
502790b17f1bSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
502890b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
502990b17f1bSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
503090b17f1bSmrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
50317e6fb56fSmrg
503290b17f1bSmrg      if test "$GCC" = yes; then
503390b17f1bSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
503490b17f1bSmrg	# We only want to do this on AIX 4.2 and lower, the check
503590b17f1bSmrg	# below for broken collect2 doesn't work under 4.3+
503690b17f1bSmrg	  collect2name=`${CC} -print-prog-name=collect2`
503790b17f1bSmrg	  if test -f "$collect2name" &&
503890b17f1bSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
503990b17f1bSmrg	  then
504090b17f1bSmrg	  # We have reworked collect2
504190b17f1bSmrg	  :
504290b17f1bSmrg	  else
504390b17f1bSmrg	  # We have old collect2
504490b17f1bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
504590b17f1bSmrg	  # It fails to find uninstalled libraries when the uninstalled
504690b17f1bSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
504790b17f1bSmrg	  # to unsupported forces relinking
504890b17f1bSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
504990b17f1bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
505090b17f1bSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
505190b17f1bSmrg	  fi
505290b17f1bSmrg	  ;;
505390b17f1bSmrg	esac
505490b17f1bSmrg	shared_flag='-shared'
505590b17f1bSmrg	if test "$aix_use_runtimelinking" = yes; then
505690b17f1bSmrg	  shared_flag="$shared_flag "'${wl}-G'
505790b17f1bSmrg	fi
505890b17f1bSmrg      else
505990b17f1bSmrg	# not using gcc
506090b17f1bSmrg	if test "$host_cpu" = ia64; then
506190b17f1bSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
506290b17f1bSmrg	# chokes on -Wl,-G. The following line is correct:
506390b17f1bSmrg	  shared_flag='-G'
506490b17f1bSmrg	else
506590b17f1bSmrg	  if test "$aix_use_runtimelinking" = yes; then
506690b17f1bSmrg	    shared_flag='${wl}-G'
506790b17f1bSmrg	  else
506890b17f1bSmrg	    shared_flag='${wl}-bM:SRE'
506990b17f1bSmrg	  fi
507090b17f1bSmrg	fi
507190b17f1bSmrg      fi
50727e6fb56fSmrg
507390b17f1bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
507490b17f1bSmrg      # It seems that -bexpall does not export symbols beginning with
507590b17f1bSmrg      # underscore (_), so it is better to generate a list of symbols to export.
507690b17f1bSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
507790b17f1bSmrg      if test "$aix_use_runtimelinking" = yes; then
507890b17f1bSmrg	# Warning - without using the other runtime loading flags (-brtl),
507990b17f1bSmrg	# -berok will link without error, but may produce a broken library.
508090b17f1bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
508190b17f1bSmrg        # Determine the default libpath from the value encoded in an
508290b17f1bSmrg        # empty executable.
508390b17f1bSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
508490b17f1bSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
508590b17f1bSmrg        _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"
508690b17f1bSmrg      else
508790b17f1bSmrg	if test "$host_cpu" = ia64; then
508890b17f1bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
508990b17f1bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
509090b17f1bSmrg	  _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"
509190b17f1bSmrg	else
509290b17f1bSmrg	 # Determine the default libpath from the value encoded in an
509390b17f1bSmrg	 # empty executable.
509490b17f1bSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
509590b17f1bSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
509690b17f1bSmrg	  # Warning - without using the other run time loading flags,
509790b17f1bSmrg	  # -berok will link without error, but may produce a broken library.
509890b17f1bSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
509990b17f1bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
510090b17f1bSmrg	  if test "$with_gnu_ld" = yes; then
510190b17f1bSmrg	    # We only use this code for GNU lds that support --whole-archive.
510290b17f1bSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
510390b17f1bSmrg	  else
510490b17f1bSmrg	    # Exported symbols can be pulled into shared objects from archives
510590b17f1bSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
510690b17f1bSmrg	  fi
510790b17f1bSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
510890b17f1bSmrg	  # This is similar to how AIX traditionally builds its shared libraries.
510990b17f1bSmrg	  _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'
511090b17f1bSmrg	fi
511190b17f1bSmrg      fi
511290b17f1bSmrg      ;;
51137e6fb56fSmrg
511490b17f1bSmrg    amigaos*)
511590b17f1bSmrg      case $host_cpu in
511690b17f1bSmrg      powerpc)
511790b17f1bSmrg            # see comment about AmigaOS4 .so support
511890b17f1bSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
511990b17f1bSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
512090b17f1bSmrg        ;;
512190b17f1bSmrg      m68k)
512290b17f1bSmrg            _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)'
512390b17f1bSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
512490b17f1bSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
512590b17f1bSmrg        ;;
512690b17f1bSmrg      esac
512790b17f1bSmrg      ;;
51287e6fb56fSmrg
512990b17f1bSmrg    bsdi[[45]]*)
513090b17f1bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
513190b17f1bSmrg      ;;
51327e6fb56fSmrg
513390b17f1bSmrg    cygwin* | mingw* | pw32* | cegcc*)
513490b17f1bSmrg      # When not using gcc, we currently assume that we are using
513590b17f1bSmrg      # Microsoft Visual C++.
513690b17f1bSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
513790b17f1bSmrg      # no search path for DLLs.
513890b17f1bSmrg      case $cc_basename in
513990b17f1bSmrg      cl*)
514090b17f1bSmrg	# Native MSVC
514190b17f1bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
514290b17f1bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
514390b17f1bSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
514490b17f1bSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
514590b17f1bSmrg	# Tell ltmain to make .lib files, not .a files.
514690b17f1bSmrg	libext=lib
514790b17f1bSmrg	# Tell ltmain to make .dll files, not .so files.
514890b17f1bSmrg	shrext_cmds=".dll"
514990b17f1bSmrg	# FIXME: Setting linknames here is a bad hack.
515090b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
515190b17f1bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
515290b17f1bSmrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
515390b17f1bSmrg	  else
515490b17f1bSmrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
515590b17f1bSmrg	  fi~
515690b17f1bSmrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
515790b17f1bSmrg	  linknames='
515890b17f1bSmrg	# The linker will not automatically build a static lib if we build a DLL.
515990b17f1bSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
516090b17f1bSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
516190b17f1bSmrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
516290b17f1bSmrg	_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'
516390b17f1bSmrg	# Don't use ranlib
516490b17f1bSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
516590b17f1bSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
516690b17f1bSmrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
516790b17f1bSmrg	  case $lt_outputfile in
516890b17f1bSmrg	    *.exe|*.EXE) ;;
516990b17f1bSmrg	    *)
517090b17f1bSmrg	      lt_outputfile="$lt_outputfile.exe"
517190b17f1bSmrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
517290b17f1bSmrg	      ;;
517390b17f1bSmrg	  esac~
517490b17f1bSmrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
517590b17f1bSmrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
517690b17f1bSmrg	    $RM "$lt_outputfile.manifest";
517790b17f1bSmrg	  fi'
517890b17f1bSmrg	;;
517990b17f1bSmrg      *)
518090b17f1bSmrg	# Assume MSVC wrapper
518190b17f1bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
518290b17f1bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
518390b17f1bSmrg	# Tell ltmain to make .lib files, not .a files.
518490b17f1bSmrg	libext=lib
518590b17f1bSmrg	# Tell ltmain to make .dll files, not .so files.
518690b17f1bSmrg	shrext_cmds=".dll"
518790b17f1bSmrg	# FIXME: Setting linknames here is a bad hack.
518890b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
518990b17f1bSmrg	# The linker will automatically build a .lib file if we build a DLL.
519090b17f1bSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
519190b17f1bSmrg	# FIXME: Should let the user specify the lib program.
519290b17f1bSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
519390b17f1bSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
519490b17f1bSmrg	;;
519590b17f1bSmrg      esac
519690b17f1bSmrg      ;;
51977e6fb56fSmrg
519890b17f1bSmrg    darwin* | rhapsody*)
519990b17f1bSmrg      _LT_DARWIN_LINKER_FEATURES($1)
520090b17f1bSmrg      ;;
52017e6fb56fSmrg
520290b17f1bSmrg    dgux*)
520390b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
520490b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
520590b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
520690b17f1bSmrg      ;;
52077e6fb56fSmrg
520890b17f1bSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
520990b17f1bSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
521090b17f1bSmrg    # does not break anything, and helps significantly (at the cost of a little
521190b17f1bSmrg    # extra space).
521290b17f1bSmrg    freebsd2.2*)
521390b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
521490b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
521590b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
521690b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
521790b17f1bSmrg      ;;
52187e6fb56fSmrg
521990b17f1bSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
522090b17f1bSmrg    freebsd2.*)
522190b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
522290b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
522390b17f1bSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
522490b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
522590b17f1bSmrg      ;;
52267e6fb56fSmrg
522790b17f1bSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
522890b17f1bSmrg    freebsd* | dragonfly*)
522990b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
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    hpux9*)
523690b17f1bSmrg      if test "$GCC" = yes; then
523790b17f1bSmrg	_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'
523890b17f1bSmrg      else
523990b17f1bSmrg	_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'
524090b17f1bSmrg      fi
524190b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
524290b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
524390b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52447e6fb56fSmrg
524590b17f1bSmrg      # hardcode_minus_L: Not really in the search PATH,
524690b17f1bSmrg      # but as the default location of the library.
524790b17f1bSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
524890b17f1bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
524990b17f1bSmrg      ;;
52507e6fb56fSmrg
525190b17f1bSmrg    hpux10*)
525290b17f1bSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
525390b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
525490b17f1bSmrg      else
525590b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
525690b17f1bSmrg      fi
525790b17f1bSmrg      if test "$with_gnu_ld" = no; then
525890b17f1bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
525990b17f1bSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
526090b17f1bSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
526190b17f1bSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
526290b17f1bSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
526390b17f1bSmrg	# hardcode_minus_L: Not really in the search PATH,
526490b17f1bSmrg	# but as the default location of the library.
526590b17f1bSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
526690b17f1bSmrg      fi
526790b17f1bSmrg      ;;
52687e6fb56fSmrg
526990b17f1bSmrg    hpux11*)
527090b17f1bSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
527190b17f1bSmrg	case $host_cpu in
527290b17f1bSmrg	hppa*64*)
527390b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
527490b17f1bSmrg	  ;;
527590b17f1bSmrg	ia64*)
527690b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
527790b17f1bSmrg	  ;;
527890b17f1bSmrg	*)
527990b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
528090b17f1bSmrg	  ;;
528190b17f1bSmrg	esac
528290b17f1bSmrg      else
528390b17f1bSmrg	case $host_cpu in
528490b17f1bSmrg	hppa*64*)
528590b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
528690b17f1bSmrg	  ;;
528790b17f1bSmrg	ia64*)
528890b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
528990b17f1bSmrg	  ;;
529090b17f1bSmrg	*)
529190b17f1bSmrg	m4_if($1, [], [
529290b17f1bSmrg	  # Older versions of the 11.00 compiler do not understand -b yet
529390b17f1bSmrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
529490b17f1bSmrg	  _LT_LINKER_OPTION([if $CC understands -b],
529590b17f1bSmrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
529690b17f1bSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
529790b17f1bSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
529890b17f1bSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
529990b17f1bSmrg	  ;;
530090b17f1bSmrg	esac
530190b17f1bSmrg      fi
530290b17f1bSmrg      if test "$with_gnu_ld" = no; then
530390b17f1bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
530490b17f1bSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
53057e6fb56fSmrg
530690b17f1bSmrg	case $host_cpu in
530790b17f1bSmrg	hppa*64*|ia64*)
530890b17f1bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
530990b17f1bSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
531090b17f1bSmrg	  ;;
531190b17f1bSmrg	*)
531290b17f1bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
531390b17f1bSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
531490b17f1bSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
53157e6fb56fSmrg
531690b17f1bSmrg	  # hardcode_minus_L: Not really in the search PATH,
531790b17f1bSmrg	  # but as the default location of the library.
531890b17f1bSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
531990b17f1bSmrg	  ;;
532090b17f1bSmrg	esac
532190b17f1bSmrg      fi
532290b17f1bSmrg      ;;
53237e6fb56fSmrg
532490b17f1bSmrg    irix5* | irix6* | nonstopux*)
532590b17f1bSmrg      if test "$GCC" = yes; then
532690b17f1bSmrg	_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'
532790b17f1bSmrg	# Try to use the -exported_symbol ld option, if it does not
532890b17f1bSmrg	# work, assume that -exports_file does not work either and
532990b17f1bSmrg	# implicitly export all symbols.
533090b17f1bSmrg	# This should be the same for all languages, so no per-tag cache variable.
533190b17f1bSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
533290b17f1bSmrg	  [lt_cv_irix_exported_symbol],
533390b17f1bSmrg	  [save_LDFLAGS="$LDFLAGS"
533490b17f1bSmrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
533590b17f1bSmrg	   AC_LINK_IFELSE(
533690b17f1bSmrg	     [AC_LANG_SOURCE(
533790b17f1bSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
533890b17f1bSmrg			      [C++], [[int foo (void) { return 0; }]],
533990b17f1bSmrg			      [Fortran 77], [[
534090b17f1bSmrg      subroutine foo
534190b17f1bSmrg      end]],
534290b17f1bSmrg			      [Fortran], [[
534390b17f1bSmrg      subroutine foo
534490b17f1bSmrg      end]])])],
534590b17f1bSmrg	      [lt_cv_irix_exported_symbol=yes],
534690b17f1bSmrg	      [lt_cv_irix_exported_symbol=no])
534790b17f1bSmrg           LDFLAGS="$save_LDFLAGS"])
534890b17f1bSmrg	if test "$lt_cv_irix_exported_symbol" = yes; then
534990b17f1bSmrg          _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'
535090b17f1bSmrg	fi
535190b17f1bSmrg      else
535290b17f1bSmrg	_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'
535390b17f1bSmrg	_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'
535490b17f1bSmrg      fi
535590b17f1bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
535690b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
535790b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
535890b17f1bSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
535990b17f1bSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
536090b17f1bSmrg      ;;
53617e6fb56fSmrg
536290b17f1bSmrg    netbsd*)
536390b17f1bSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
536490b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
536590b17f1bSmrg      else
536690b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
536790b17f1bSmrg      fi
536890b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
536990b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
537090b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
537190b17f1bSmrg      ;;
53727e6fb56fSmrg
537390b17f1bSmrg    newsos6)
537490b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
537590b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
537690b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
537790b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
537890b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
537990b17f1bSmrg      ;;
53807e6fb56fSmrg
538190b17f1bSmrg    *nto* | *qnx*)
538290b17f1bSmrg      ;;
53837e6fb56fSmrg
538490b17f1bSmrg    openbsd*)
538590b17f1bSmrg      if test -f /usr/libexec/ld.so; then
538690b17f1bSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
538790b17f1bSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
538890b17f1bSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
538990b17f1bSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
539090b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
539190b17f1bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
539290b17f1bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
539390b17f1bSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
539490b17f1bSmrg	else
539590b17f1bSmrg	  case $host_os in
539690b17f1bSmrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
539790b17f1bSmrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
539890b17f1bSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
539990b17f1bSmrg	     ;;
540090b17f1bSmrg	   *)
540190b17f1bSmrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
540290b17f1bSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
540390b17f1bSmrg	     ;;
540490b17f1bSmrg	  esac
540590b17f1bSmrg	fi
540690b17f1bSmrg      else
540790b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
540890b17f1bSmrg      fi
540990b17f1bSmrg      ;;
54107e6fb56fSmrg
541190b17f1bSmrg    os2*)
541290b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
541390b17f1bSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
541490b17f1bSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
541590b17f1bSmrg      _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'
541690b17f1bSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
541790b17f1bSmrg      ;;
54187e6fb56fSmrg
541990b17f1bSmrg    osf3*)
542090b17f1bSmrg      if test "$GCC" = yes; then
542190b17f1bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
542290b17f1bSmrg	_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'
542390b17f1bSmrg      else
542490b17f1bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
542590b17f1bSmrg	_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'
542690b17f1bSmrg      fi
542790b17f1bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
542890b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
542990b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
543090b17f1bSmrg      ;;
54317e6fb56fSmrg
543290b17f1bSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
543390b17f1bSmrg      if test "$GCC" = yes; then
543490b17f1bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
543590b17f1bSmrg	_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'
543690b17f1bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
543790b17f1bSmrg      else
543890b17f1bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
543990b17f1bSmrg	_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'
544090b17f1bSmrg	_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~
544190b17f1bSmrg	$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'
54427e6fb56fSmrg
544390b17f1bSmrg	# Both c and cxx compiler support -rpath directly
544490b17f1bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
544590b17f1bSmrg      fi
544690b17f1bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
544790b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
544890b17f1bSmrg      ;;
54497e6fb56fSmrg
545090b17f1bSmrg    solaris*)
545190b17f1bSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
545290b17f1bSmrg      if test "$GCC" = yes; then
545390b17f1bSmrg	wlarc='${wl}'
545490b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
545590b17f1bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
545690b17f1bSmrg	  $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'
545790b17f1bSmrg      else
545890b17f1bSmrg	case `$CC -V 2>&1` in
545990b17f1bSmrg	*"Compilers 5.0"*)
546090b17f1bSmrg	  wlarc=''
546190b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
546290b17f1bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
546390b17f1bSmrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
546490b17f1bSmrg	  ;;
546590b17f1bSmrg	*)
546690b17f1bSmrg	  wlarc='${wl}'
546790b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
546890b17f1bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
546990b17f1bSmrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
547090b17f1bSmrg	  ;;
547190b17f1bSmrg	esac
547290b17f1bSmrg      fi
547390b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
547490b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
547590b17f1bSmrg      case $host_os in
547690b17f1bSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
547790b17f1bSmrg      *)
547890b17f1bSmrg	# The compiler driver will combine and reorder linker options,
547990b17f1bSmrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
548090b17f1bSmrg	# but is careful enough not to reorder.
548190b17f1bSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
548290b17f1bSmrg	if test "$GCC" = yes; then
548390b17f1bSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
548490b17f1bSmrg	else
548590b17f1bSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
548690b17f1bSmrg	fi
548790b17f1bSmrg	;;
548890b17f1bSmrg      esac
548990b17f1bSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
549090b17f1bSmrg      ;;
54917e6fb56fSmrg
549290b17f1bSmrg    sunos4*)
549390b17f1bSmrg      if test "x$host_vendor" = xsequent; then
549490b17f1bSmrg	# Use $CC to link under sequent, because it throws in some extra .o
549590b17f1bSmrg	# files that make .init and .fini sections work.
549690b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
549790b17f1bSmrg      else
549890b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
549990b17f1bSmrg      fi
550090b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
550190b17f1bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
550290b17f1bSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
550390b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
550490b17f1bSmrg      ;;
55057e6fb56fSmrg
550690b17f1bSmrg    sysv4)
550790b17f1bSmrg      case $host_vendor in
550890b17f1bSmrg	sni)
550990b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
551090b17f1bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
551190b17f1bSmrg	;;
551290b17f1bSmrg	siemens)
551390b17f1bSmrg	  ## LD is ld it makes a PLAMLIB
551490b17f1bSmrg	  ## CC just makes a GrossModule.
551590b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
551690b17f1bSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
551790b17f1bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
551890b17f1bSmrg        ;;
551990b17f1bSmrg	motorola)
552090b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
552190b17f1bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
552290b17f1bSmrg	;;
552390b17f1bSmrg      esac
552490b17f1bSmrg      runpath_var='LD_RUN_PATH'
552590b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
552690b17f1bSmrg      ;;
55277e6fb56fSmrg
552890b17f1bSmrg    sysv4.3*)
552990b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
553090b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
553190b17f1bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
553290b17f1bSmrg      ;;
55337e6fb56fSmrg
553490b17f1bSmrg    sysv4*MP*)
553590b17f1bSmrg      if test -d /usr/nec; then
553690b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
553790b17f1bSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
553890b17f1bSmrg	runpath_var=LD_RUN_PATH
553990b17f1bSmrg	hardcode_runpath_var=yes
554090b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
554190b17f1bSmrg      fi
554290b17f1bSmrg      ;;
55437e6fb56fSmrg
554490b17f1bSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
554590b17f1bSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
554690b17f1bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
554790b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
554890b17f1bSmrg      runpath_var='LD_RUN_PATH'
55497e6fb56fSmrg
555090b17f1bSmrg      if test "$GCC" = yes; then
555190b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
555290b17f1bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
555390b17f1bSmrg      else
555490b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
555590b17f1bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
555690b17f1bSmrg      fi
555790b17f1bSmrg      ;;
55587e6fb56fSmrg
555990b17f1bSmrg    sysv5* | sco3.2v5* | sco5v6*)
556090b17f1bSmrg      # Note: We can NOT use -z defs as we might desire, because we do not
556190b17f1bSmrg      # link with -lc, and that would cause any symbols used from libc to
556290b17f1bSmrg      # always be unresolved, which means just about no library would
556390b17f1bSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
556490b17f1bSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
556590b17f1bSmrg      # as -z defs.
556690b17f1bSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
556790b17f1bSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
556890b17f1bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
556990b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
557090b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
557190b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
557290b17f1bSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
557390b17f1bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
557490b17f1bSmrg      runpath_var='LD_RUN_PATH'
55757e6fb56fSmrg
557690b17f1bSmrg      if test "$GCC" = yes; then
557790b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
557890b17f1bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
557990b17f1bSmrg      else
558090b17f1bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
558190b17f1bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
558290b17f1bSmrg      fi
558390b17f1bSmrg      ;;
55847e6fb56fSmrg
558590b17f1bSmrg    uts4*)
558690b17f1bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
558790b17f1bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
558890b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
558990b17f1bSmrg      ;;
55907e6fb56fSmrg
559190b17f1bSmrg    *)
559290b17f1bSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
559390b17f1bSmrg      ;;
559490b17f1bSmrg    esac
55957e6fb56fSmrg
559690b17f1bSmrg    if test x$host_vendor = xsni; then
559790b17f1bSmrg      case $host in
559890b17f1bSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
559990b17f1bSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
560090b17f1bSmrg	;;
560190b17f1bSmrg      esac
560290b17f1bSmrg    fi
560390b17f1bSmrg  fi
560490b17f1bSmrg])
560590b17f1bSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
560690b17f1bSmrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
56077e6fb56fSmrg
560890b17f1bSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
56097e6fb56fSmrg
561090b17f1bSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
561190b17f1bSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
561290b17f1bSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
561390b17f1bSmrg    [The commands to extract the exported symbol list from a shared archive])
56147e6fb56fSmrg
561590b17f1bSmrg#
561690b17f1bSmrg# Do we need to explicitly link libc?
561790b17f1bSmrg#
561890b17f1bSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
561990b17f1bSmrgx|xyes)
562090b17f1bSmrg  # Assume -lc should be added
562190b17f1bSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
562290b17f1bSmrg
562390b17f1bSmrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
562490b17f1bSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
562590b17f1bSmrg    *'~'*)
562690b17f1bSmrg      # FIXME: we may have to deal with multi-command sequences.
562790b17f1bSmrg      ;;
562890b17f1bSmrg    '$CC '*)
562990b17f1bSmrg      # Test whether the compiler implicitly links with -lc since on some
563090b17f1bSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
563190b17f1bSmrg      # to ld, don't add -lc before -lgcc.
563290b17f1bSmrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
563390b17f1bSmrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
563490b17f1bSmrg	[$RM conftest*
563590b17f1bSmrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
563690b17f1bSmrg
563790b17f1bSmrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
563890b17f1bSmrg	  soname=conftest
563990b17f1bSmrg	  lib=conftest
564090b17f1bSmrg	  libobjs=conftest.$ac_objext
564190b17f1bSmrg	  deplibs=
564290b17f1bSmrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
564390b17f1bSmrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
564490b17f1bSmrg	  compiler_flags=-v
564590b17f1bSmrg	  linker_flags=-v
564690b17f1bSmrg	  verstring=
564790b17f1bSmrg	  output_objdir=.
564890b17f1bSmrg	  libname=conftest
564990b17f1bSmrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
565090b17f1bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
565190b17f1bSmrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
565290b17f1bSmrg	  then
565390b17f1bSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
565490b17f1bSmrg	  else
565590b17f1bSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
565690b17f1bSmrg	  fi
565790b17f1bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
565890b17f1bSmrg	else
565990b17f1bSmrg	  cat conftest.err 1>&5
566090b17f1bSmrg	fi
566190b17f1bSmrg	$RM conftest*
566290b17f1bSmrg	])
566390b17f1bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
566490b17f1bSmrg      ;;
566590b17f1bSmrg    esac
56667e6fb56fSmrg  fi
56677e6fb56fSmrg  ;;
56687e6fb56fSmrgesac
56697e6fb56fSmrg
567090b17f1bSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
567190b17f1bSmrg    [Whether or not to add -lc for building shared libraries])
567290b17f1bSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
567390b17f1bSmrg    [enable_shared_with_static_runtimes], [0],
567490b17f1bSmrg    [Whether or not to disallow shared libs when runtime libs are static])
567590b17f1bSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
567690b17f1bSmrg    [Compiler flag to allow reflexive dlopens])
567790b17f1bSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
567890b17f1bSmrg    [Compiler flag to generate shared objects directly from archives])
567990b17f1bSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
568090b17f1bSmrg    [Whether the compiler copes with passing no objects directly])
568190b17f1bSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
568290b17f1bSmrg    [Create an old-style archive from a shared archive])
568390b17f1bSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
568490b17f1bSmrg    [Create a temporary old-style archive to link instead of a shared archive])
568590b17f1bSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
568690b17f1bSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
568790b17f1bSmrg_LT_TAGDECL([], [module_cmds], [2],
568890b17f1bSmrg    [Commands used to build a loadable module if different from building
568990b17f1bSmrg    a shared archive.])
569090b17f1bSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
569190b17f1bSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
569290b17f1bSmrg    [Whether we are building with GNU ld or not])
569390b17f1bSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
569490b17f1bSmrg    [Flag that allows shared libraries with undefined symbols to be built])
569590b17f1bSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
569690b17f1bSmrg    [Flag that enforces no undefined symbols])
569790b17f1bSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
569890b17f1bSmrg    [Flag to hardcode $libdir into a binary during linking.
569990b17f1bSmrg    This must work even if $libdir does not exist])
570090b17f1bSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
570190b17f1bSmrg    [Whether we need a single "-rpath" flag with a separated argument])
570290b17f1bSmrg_LT_TAGDECL([], [hardcode_direct], [0],
570390b17f1bSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
570490b17f1bSmrg    DIR into the resulting binary])
570590b17f1bSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
570690b17f1bSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
570790b17f1bSmrg    DIR into the resulting binary and the resulting library dependency is
570890b17f1bSmrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
570990b17f1bSmrg    library is relocated])
571090b17f1bSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
571190b17f1bSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
571290b17f1bSmrg    into the resulting binary])
571390b17f1bSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
571490b17f1bSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
571590b17f1bSmrg    into the resulting binary])
571690b17f1bSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
571790b17f1bSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
571890b17f1bSmrg    into the library and all subsequent libraries and executables linked
571990b17f1bSmrg    against it])
572090b17f1bSmrg_LT_TAGDECL([], [inherit_rpath], [0],
572190b17f1bSmrg    [Set to yes if linker adds runtime paths of dependent libraries
572290b17f1bSmrg    to runtime path list])
572390b17f1bSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
572490b17f1bSmrg    [Whether libtool must link a program against all its dependency libraries])
572590b17f1bSmrg_LT_TAGDECL([], [always_export_symbols], [0],
572690b17f1bSmrg    [Set to "yes" if exported symbols are required])
572790b17f1bSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
572890b17f1bSmrg    [The commands to list exported symbols])
572990b17f1bSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
573090b17f1bSmrg    [Symbols that should not be listed in the preloaded symbols])
573190b17f1bSmrg_LT_TAGDECL([], [include_expsyms], [1],
573290b17f1bSmrg    [Symbols that must always be exported])
573390b17f1bSmrg_LT_TAGDECL([], [prelink_cmds], [2],
573490b17f1bSmrg    [Commands necessary for linking programs (against libraries) with templates])
573590b17f1bSmrg_LT_TAGDECL([], [postlink_cmds], [2],
573690b17f1bSmrg    [Commands necessary for finishing linking programs])
573790b17f1bSmrg_LT_TAGDECL([], [file_list_spec], [1],
573890b17f1bSmrg    [Specify filename containing input files])
573990b17f1bSmrgdnl FIXME: Not yet implemented
574090b17f1bSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
574190b17f1bSmrgdnl    [Compiler flag to generate thread safe objects])
574290b17f1bSmrg])# _LT_LINKER_SHLIBS
574390b17f1bSmrg
574490b17f1bSmrg
574590b17f1bSmrg# _LT_LANG_C_CONFIG([TAG])
574690b17f1bSmrg# ------------------------
574790b17f1bSmrg# Ensure that the configuration variables for a C compiler are suitably
574890b17f1bSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
574990b17f1bSmrg# the compiler configuration to `libtool'.
575090b17f1bSmrgm4_defun([_LT_LANG_C_CONFIG],
575190b17f1bSmrg[m4_require([_LT_DECL_EGREP])dnl
575290b17f1bSmrglt_save_CC="$CC"
575390b17f1bSmrgAC_LANG_PUSH(C)
57547e6fb56fSmrg
575590b17f1bSmrg# Source file extension for C test sources.
575690b17f1bSmrgac_ext=c
57577e6fb56fSmrg
575890b17f1bSmrg# Object file extension for compiled C test sources.
575990b17f1bSmrgobjext=o
576090b17f1bSmrg_LT_TAGVAR(objext, $1)=$objext
57617e6fb56fSmrg
576290b17f1bSmrg# Code to be used in simple compile tests
576390b17f1bSmrglt_simple_compile_test_code="int some_variable = 0;"
57647e6fb56fSmrg
576590b17f1bSmrg# Code to be used in simple link tests
576690b17f1bSmrglt_simple_link_test_code='int main(){return(0);}'
57677e6fb56fSmrg
576890b17f1bSmrg_LT_TAG_COMPILER
576990b17f1bSmrg# Save the default compiler, since it gets overwritten when the other
577090b17f1bSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
577190b17f1bSmrgcompiler_DEFAULT=$CC
57727e6fb56fSmrg
577390b17f1bSmrg# save warnings/boilerplate of simple test code
577490b17f1bSmrg_LT_COMPILER_BOILERPLATE
577590b17f1bSmrg_LT_LINKER_BOILERPLATE
57767e6fb56fSmrg
577790b17f1bSmrgif test -n "$compiler"; then
577890b17f1bSmrg  _LT_COMPILER_NO_RTTI($1)
577990b17f1bSmrg  _LT_COMPILER_PIC($1)
578090b17f1bSmrg  _LT_COMPILER_C_O($1)
578190b17f1bSmrg  _LT_COMPILER_FILE_LOCKS($1)
578290b17f1bSmrg  _LT_LINKER_SHLIBS($1)
578390b17f1bSmrg  _LT_SYS_DYNAMIC_LINKER($1)
578490b17f1bSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
578590b17f1bSmrg  LT_SYS_DLOPEN_SELF
578690b17f1bSmrg  _LT_CMD_STRIPLIB
578790b17f1bSmrg
578890b17f1bSmrg  # Report which library types will actually be built
578990b17f1bSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
579090b17f1bSmrg  AC_MSG_RESULT([$can_build_shared])
579190b17f1bSmrg
579290b17f1bSmrg  AC_MSG_CHECKING([whether to build shared libraries])
579390b17f1bSmrg  test "$can_build_shared" = "no" && enable_shared=no
579490b17f1bSmrg
579590b17f1bSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
579690b17f1bSmrg  # are all built from PIC.
579790b17f1bSmrg  case $host_os in
579890b17f1bSmrg  aix3*)
579990b17f1bSmrg    test "$enable_shared" = yes && enable_static=no
580090b17f1bSmrg    if test -n "$RANLIB"; then
580190b17f1bSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
580290b17f1bSmrg      postinstall_cmds='$RANLIB $lib'
580390b17f1bSmrg    fi
580490b17f1bSmrg    ;;
58057e6fb56fSmrg
580690b17f1bSmrg  aix[[4-9]]*)
580790b17f1bSmrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
580890b17f1bSmrg      test "$enable_shared" = yes && enable_static=no
580990b17f1bSmrg    fi
581090b17f1bSmrg    ;;
581190b17f1bSmrg  esac
581290b17f1bSmrg  AC_MSG_RESULT([$enable_shared])
58137e6fb56fSmrg
581490b17f1bSmrg  AC_MSG_CHECKING([whether to build static libraries])
581590b17f1bSmrg  # Make sure either enable_shared or enable_static is yes.
581690b17f1bSmrg  test "$enable_shared" = yes || enable_static=yes
581790b17f1bSmrg  AC_MSG_RESULT([$enable_static])
58187e6fb56fSmrg
581990b17f1bSmrg  _LT_CONFIG($1)
582090b17f1bSmrgfi
582190b17f1bSmrgAC_LANG_POP
582290b17f1bSmrgCC="$lt_save_CC"
582390b17f1bSmrg])# _LT_LANG_C_CONFIG
58247e6fb56fSmrg
58257e6fb56fSmrg
582690b17f1bSmrg# _LT_LANG_CXX_CONFIG([TAG])
582790b17f1bSmrg# --------------------------
582890b17f1bSmrg# Ensure that the configuration variables for a C++ compiler are suitably
582990b17f1bSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
583090b17f1bSmrg# the compiler configuration to `libtool'.
583190b17f1bSmrgm4_defun([_LT_LANG_CXX_CONFIG],
583290b17f1bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
583390b17f1bSmrgm4_require([_LT_DECL_EGREP])dnl
583490b17f1bSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
583590b17f1bSmrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
583690b17f1bSmrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
583790b17f1bSmrg    (test "X$CXX" != "Xg++"))) ; then
583890b17f1bSmrg  AC_PROG_CXXCPP
583990b17f1bSmrgelse
584090b17f1bSmrg  _lt_caught_CXX_error=yes
584190b17f1bSmrgfi
584290b17f1bSmrg
584390b17f1bSmrgAC_LANG_PUSH(C++)
584490b17f1bSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
584590b17f1bSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
584690b17f1bSmrg_LT_TAGVAR(always_export_symbols, $1)=no
584790b17f1bSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
584890b17f1bSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
584990b17f1bSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
585090b17f1bSmrg_LT_TAGVAR(hardcode_direct, $1)=no
585190b17f1bSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
585290b17f1bSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
585390b17f1bSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
585490b17f1bSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
585590b17f1bSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
585690b17f1bSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
585790b17f1bSmrg_LT_TAGVAR(inherit_rpath, $1)=no
585890b17f1bSmrg_LT_TAGVAR(module_cmds, $1)=
585990b17f1bSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
586090b17f1bSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
586190b17f1bSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
586290b17f1bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
586390b17f1bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
586490b17f1bSmrg_LT_TAGVAR(no_undefined_flag, $1)=
586590b17f1bSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
586690b17f1bSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
586790b17f1bSmrg
586890b17f1bSmrg# Source file extension for C++ test sources.
586990b17f1bSmrgac_ext=cpp
587090b17f1bSmrg
587190b17f1bSmrg# Object file extension for compiled C++ test sources.
587290b17f1bSmrgobjext=o
587390b17f1bSmrg_LT_TAGVAR(objext, $1)=$objext
587490b17f1bSmrg
587590b17f1bSmrg# No sense in running all these tests if we already determined that
587690b17f1bSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
587790b17f1bSmrg# are currently assumed to apply to all compilers on this platform,
587890b17f1bSmrg# and will be corrupted by setting them based on a non-working compiler.
587990b17f1bSmrgif test "$_lt_caught_CXX_error" != yes; then
588090b17f1bSmrg  # Code to be used in simple compile tests
588190b17f1bSmrg  lt_simple_compile_test_code="int some_variable = 0;"
588290b17f1bSmrg
588390b17f1bSmrg  # Code to be used in simple link tests
588490b17f1bSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
588590b17f1bSmrg
588690b17f1bSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
588790b17f1bSmrg  _LT_TAG_COMPILER
588890b17f1bSmrg
588990b17f1bSmrg  # save warnings/boilerplate of simple test code
589090b17f1bSmrg  _LT_COMPILER_BOILERPLATE
589190b17f1bSmrg  _LT_LINKER_BOILERPLATE
589290b17f1bSmrg
589390b17f1bSmrg  # Allow CC to be a program name with arguments.
589490b17f1bSmrg  lt_save_CC=$CC
589590b17f1bSmrg  lt_save_CFLAGS=$CFLAGS
589690b17f1bSmrg  lt_save_LD=$LD
589790b17f1bSmrg  lt_save_GCC=$GCC
589890b17f1bSmrg  GCC=$GXX
589990b17f1bSmrg  lt_save_with_gnu_ld=$with_gnu_ld
590090b17f1bSmrg  lt_save_path_LD=$lt_cv_path_LD
590190b17f1bSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
590290b17f1bSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
59037e6fb56fSmrg  else
590490b17f1bSmrg    $as_unset lt_cv_prog_gnu_ld
59057e6fb56fSmrg  fi
590690b17f1bSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
590790b17f1bSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
59087e6fb56fSmrg  else
590990b17f1bSmrg    $as_unset lt_cv_path_LD
59107e6fb56fSmrg  fi
591190b17f1bSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
591290b17f1bSmrg  CC=${CXX-"c++"}
591390b17f1bSmrg  CFLAGS=$CXXFLAGS
591490b17f1bSmrg  compiler=$CC
591590b17f1bSmrg  _LT_TAGVAR(compiler, $1)=$CC
591690b17f1bSmrg  _LT_CC_BASENAME([$compiler])
59177e6fb56fSmrg
591890b17f1bSmrg  if test -n "$compiler"; then
591990b17f1bSmrg    # We don't want -fno-exception when compiling C++ code, so set the
592090b17f1bSmrg    # no_builtin_flag separately
592190b17f1bSmrg    if test "$GXX" = yes; then
592290b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
592390b17f1bSmrg    else
592490b17f1bSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
592590b17f1bSmrg    fi
59267e6fb56fSmrg
592790b17f1bSmrg    if test "$GXX" = yes; then
592890b17f1bSmrg      # Set up default GNU C++ configuration
59297e6fb56fSmrg
593090b17f1bSmrg      LT_PATH_LD
59317e6fb56fSmrg
593290b17f1bSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
593390b17f1bSmrg      # archiving commands below assume that GNU ld is being used.
593490b17f1bSmrg      if test "$with_gnu_ld" = yes; then
593590b17f1bSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
593690b17f1bSmrg        _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'
593790b17f1bSmrg
593890b17f1bSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
593990b17f1bSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
594090b17f1bSmrg
594190b17f1bSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
594290b17f1bSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
594390b17f1bSmrg        #     investigate it a little bit more. (MM)
594490b17f1bSmrg        wlarc='${wl}'
594590b17f1bSmrg
594690b17f1bSmrg        # ancient GNU ld didn't support --whole-archive et. al.
594790b17f1bSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
594890b17f1bSmrg	  $GREP 'no-whole-archive' > /dev/null; then
594990b17f1bSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
595090b17f1bSmrg        else
595190b17f1bSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
595290b17f1bSmrg        fi
595390b17f1bSmrg      else
595490b17f1bSmrg        with_gnu_ld=no
595590b17f1bSmrg        wlarc=
595690b17f1bSmrg
595790b17f1bSmrg        # A generic and very simple default shared library creation
595890b17f1bSmrg        # command for GNU C++ for the case where it uses the native
595990b17f1bSmrg        # linker, instead of GNU ld.  If possible, this setting should
596090b17f1bSmrg        # overridden to take advantage of the native linker features on
596190b17f1bSmrg        # the platform it is being used on.
596290b17f1bSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
59637e6fb56fSmrg      fi
596490b17f1bSmrg
596590b17f1bSmrg      # Commands to make compiler produce verbose output that lists
596690b17f1bSmrg      # what "hidden" libraries, object files and flags are used when
596790b17f1bSmrg      # linking a shared library.
596890b17f1bSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
596990b17f1bSmrg
597090b17f1bSmrg    else
597190b17f1bSmrg      GXX=no
597290b17f1bSmrg      with_gnu_ld=no
597390b17f1bSmrg      wlarc=
597490b17f1bSmrg    fi
597590b17f1bSmrg
597690b17f1bSmrg    # PORTME: fill in a description of your system's C++ link characteristics
597790b17f1bSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
597890b17f1bSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
59797e6fb56fSmrg    case $host_os in
598090b17f1bSmrg      aix3*)
598190b17f1bSmrg        # FIXME: insert proper C++ library support
598290b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
598390b17f1bSmrg        ;;
59847e6fb56fSmrg      aix[[4-9]]*)
598590b17f1bSmrg        if test "$host_cpu" = ia64; then
598690b17f1bSmrg          # On IA64, the linker does run time linking by default, so we don't
598790b17f1bSmrg          # have to do anything special.
598890b17f1bSmrg          aix_use_runtimelinking=no
598990b17f1bSmrg          exp_sym_flag='-Bexport'
599090b17f1bSmrg          no_entry_flag=""
599190b17f1bSmrg        else
599290b17f1bSmrg          aix_use_runtimelinking=no
599390b17f1bSmrg
599490b17f1bSmrg          # Test if we are trying to use run time linking or normal
599590b17f1bSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
599690b17f1bSmrg          # need to do runtime linking.
599790b17f1bSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
599890b17f1bSmrg	    for ld_flag in $LDFLAGS; do
599990b17f1bSmrg	      case $ld_flag in
600090b17f1bSmrg	      *-brtl*)
600190b17f1bSmrg	        aix_use_runtimelinking=yes
600290b17f1bSmrg	        break
600390b17f1bSmrg	        ;;
600490b17f1bSmrg	      esac
600590b17f1bSmrg	    done
600690b17f1bSmrg	    ;;
600790b17f1bSmrg          esac
600890b17f1bSmrg
600990b17f1bSmrg          exp_sym_flag='-bexport'
601090b17f1bSmrg          no_entry_flag='-bnoentry'
601190b17f1bSmrg        fi
601290b17f1bSmrg
601390b17f1bSmrg        # When large executables or shared objects are built, AIX ld can
601490b17f1bSmrg        # have problems creating the table of contents.  If linking a library
601590b17f1bSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
601690b17f1bSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
601790b17f1bSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
601890b17f1bSmrg
601990b17f1bSmrg        _LT_TAGVAR(archive_cmds, $1)=''
602090b17f1bSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
602190b17f1bSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
602290b17f1bSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
602390b17f1bSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
602490b17f1bSmrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
602590b17f1bSmrg
602690b17f1bSmrg        if test "$GXX" = yes; then
602790b17f1bSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
602890b17f1bSmrg          # We only want to do this on AIX 4.2 and lower, the check
602990b17f1bSmrg          # below for broken collect2 doesn't work under 4.3+
603090b17f1bSmrg	  collect2name=`${CC} -print-prog-name=collect2`
603190b17f1bSmrg	  if test -f "$collect2name" &&
603290b17f1bSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
603390b17f1bSmrg	  then
603490b17f1bSmrg	    # We have reworked collect2
603590b17f1bSmrg	    :
603690b17f1bSmrg	  else
603790b17f1bSmrg	    # We have old collect2
603890b17f1bSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
603990b17f1bSmrg	    # It fails to find uninstalled libraries when the uninstalled
604090b17f1bSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
604190b17f1bSmrg	    # to unsupported forces relinking
604290b17f1bSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
604390b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
604490b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
604590b17f1bSmrg	  fi
604690b17f1bSmrg          esac
604790b17f1bSmrg          shared_flag='-shared'
604890b17f1bSmrg	  if test "$aix_use_runtimelinking" = yes; then
604990b17f1bSmrg	    shared_flag="$shared_flag "'${wl}-G'
605090b17f1bSmrg	  fi
605190b17f1bSmrg        else
605290b17f1bSmrg          # not using gcc
605390b17f1bSmrg          if test "$host_cpu" = ia64; then
605490b17f1bSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
605590b17f1bSmrg	  # chokes on -Wl,-G. The following line is correct:
605690b17f1bSmrg	  shared_flag='-G'
605790b17f1bSmrg          else
605890b17f1bSmrg	    if test "$aix_use_runtimelinking" = yes; then
605990b17f1bSmrg	      shared_flag='${wl}-G'
606090b17f1bSmrg	    else
606190b17f1bSmrg	      shared_flag='${wl}-bM:SRE'
606290b17f1bSmrg	    fi
606390b17f1bSmrg          fi
606490b17f1bSmrg        fi
606590b17f1bSmrg
606690b17f1bSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
606790b17f1bSmrg        # It seems that -bexpall does not export symbols beginning with
606890b17f1bSmrg        # underscore (_), so it is better to generate a list of symbols to
606990b17f1bSmrg	# export.
607090b17f1bSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
607190b17f1bSmrg        if test "$aix_use_runtimelinking" = yes; then
607290b17f1bSmrg          # Warning - without using the other runtime loading flags (-brtl),
607390b17f1bSmrg          # -berok will link without error, but may produce a broken library.
607490b17f1bSmrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
607590b17f1bSmrg          # Determine the default libpath from the value encoded in an empty
607690b17f1bSmrg          # executable.
607790b17f1bSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
607890b17f1bSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
607990b17f1bSmrg
608090b17f1bSmrg          _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"
608190b17f1bSmrg        else
608290b17f1bSmrg          if test "$host_cpu" = ia64; then
608390b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
608490b17f1bSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
608590b17f1bSmrg	    _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"
608690b17f1bSmrg          else
608790b17f1bSmrg	    # Determine the default libpath from the value encoded in an
608890b17f1bSmrg	    # empty executable.
608990b17f1bSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
609090b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
609190b17f1bSmrg	    # Warning - without using the other run time loading flags,
609290b17f1bSmrg	    # -berok will link without error, but may produce a broken library.
609390b17f1bSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
609490b17f1bSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
609590b17f1bSmrg	    if test "$with_gnu_ld" = yes; then
609690b17f1bSmrg	      # We only use this code for GNU lds that support --whole-archive.
609790b17f1bSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
609890b17f1bSmrg	    else
609990b17f1bSmrg	      # Exported symbols can be pulled into shared objects from archives
610090b17f1bSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
610190b17f1bSmrg	    fi
610290b17f1bSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
610390b17f1bSmrg	    # This is similar to how AIX traditionally builds its shared
610490b17f1bSmrg	    # libraries.
610590b17f1bSmrg	    _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'
610690b17f1bSmrg          fi
610790b17f1bSmrg        fi
610890b17f1bSmrg        ;;
610990b17f1bSmrg
611090b17f1bSmrg      beos*)
611190b17f1bSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
611290b17f1bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
611390b17f1bSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
611490b17f1bSmrg	  # support --undefined.  This deserves some investigation.  FIXME
611590b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
61167e6fb56fSmrg	else
611790b17f1bSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
61187e6fb56fSmrg	fi
61197e6fb56fSmrg	;;
612090b17f1bSmrg
61217e6fb56fSmrg      chorus*)
612290b17f1bSmrg        case $cc_basename in
612390b17f1bSmrg          *)
612490b17f1bSmrg	  # FIXME: insert proper C++ library support
612590b17f1bSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
612690b17f1bSmrg	  ;;
612790b17f1bSmrg        esac
612890b17f1bSmrg        ;;
612990b17f1bSmrg
613090b17f1bSmrg      cygwin* | mingw* | pw32* | cegcc*)
613190b17f1bSmrg	case $GXX,$cc_basename in
613290b17f1bSmrg	,cl* | no,cl*)
613390b17f1bSmrg	  # Native MSVC
613490b17f1bSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
613590b17f1bSmrg	  # no search path for DLLs.
613690b17f1bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
613790b17f1bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
613890b17f1bSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
613990b17f1bSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
614090b17f1bSmrg	  # Tell ltmain to make .lib files, not .a files.
614190b17f1bSmrg	  libext=lib
614290b17f1bSmrg	  # Tell ltmain to make .dll files, not .so files.
614390b17f1bSmrg	  shrext_cmds=".dll"
614490b17f1bSmrg	  # FIXME: Setting linknames here is a bad hack.
614590b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
614690b17f1bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
614790b17f1bSmrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
614890b17f1bSmrg	    else
614990b17f1bSmrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
615090b17f1bSmrg	    fi~
615190b17f1bSmrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
615290b17f1bSmrg	    linknames='
615390b17f1bSmrg	  # The linker will not automatically build a static lib if we build a DLL.
615490b17f1bSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
615590b17f1bSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
615690b17f1bSmrg	  # Don't use ranlib
615790b17f1bSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
615890b17f1bSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
615990b17f1bSmrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
616090b17f1bSmrg	    case $lt_outputfile in
616190b17f1bSmrg	      *.exe|*.EXE) ;;
616290b17f1bSmrg	      *)
616390b17f1bSmrg		lt_outputfile="$lt_outputfile.exe"
616490b17f1bSmrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
616590b17f1bSmrg		;;
616690b17f1bSmrg	    esac~
616790b17f1bSmrg	    func_to_tool_file "$lt_outputfile"~
616890b17f1bSmrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
616990b17f1bSmrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
617090b17f1bSmrg	      $RM "$lt_outputfile.manifest";
617190b17f1bSmrg	    fi'
617290b17f1bSmrg	  ;;
617390b17f1bSmrg	*)
617490b17f1bSmrg	  # g++
617590b17f1bSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
617690b17f1bSmrg	  # as there is no search path for DLLs.
617790b17f1bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
617890b17f1bSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
617990b17f1bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
618090b17f1bSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
618190b17f1bSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
618290b17f1bSmrg
618390b17f1bSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
618490b17f1bSmrg	    _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'
618590b17f1bSmrg	    # If the export-symbols file already is a .def file (1st line
618690b17f1bSmrg	    # is EXPORTS), use it as is; otherwise, prepend...
618790b17f1bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
618890b17f1bSmrg	      cp $export_symbols $output_objdir/$soname.def;
618990b17f1bSmrg	    else
619090b17f1bSmrg	      echo EXPORTS > $output_objdir/$soname.def;
619190b17f1bSmrg	      cat $export_symbols >> $output_objdir/$soname.def;
619290b17f1bSmrg	    fi~
619390b17f1bSmrg	    $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'
619490b17f1bSmrg	  else
619590b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
619690b17f1bSmrg	  fi
61977e6fb56fSmrg	  ;;
61987e6fb56fSmrg	esac
61997e6fb56fSmrg	;;
620090b17f1bSmrg      darwin* | rhapsody*)
620190b17f1bSmrg        _LT_DARWIN_LINKER_FEATURES($1)
620290b17f1bSmrg	;;
620390b17f1bSmrg
62047e6fb56fSmrg      dgux*)
620590b17f1bSmrg        case $cc_basename in
620690b17f1bSmrg          ec++*)
620790b17f1bSmrg	    # FIXME: insert proper C++ library support
620890b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62097e6fb56fSmrg	    ;;
621090b17f1bSmrg          ghcx*)
62117e6fb56fSmrg	    # Green Hills C++ Compiler
621290b17f1bSmrg	    # FIXME: insert proper C++ library support
621390b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62147e6fb56fSmrg	    ;;
621590b17f1bSmrg          *)
621690b17f1bSmrg	    # FIXME: insert proper C++ library support
621790b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62187e6fb56fSmrg	    ;;
621990b17f1bSmrg        esac
622090b17f1bSmrg        ;;
622190b17f1bSmrg
622290b17f1bSmrg      freebsd2.*)
622390b17f1bSmrg        # C++ shared libraries reported to be fairly broken before
622490b17f1bSmrg	# switch to ELF
622590b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
622690b17f1bSmrg        ;;
622790b17f1bSmrg
622890b17f1bSmrg      freebsd-elf*)
622990b17f1bSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
623090b17f1bSmrg        ;;
623190b17f1bSmrg
62327e6fb56fSmrg      freebsd* | dragonfly*)
623390b17f1bSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
623490b17f1bSmrg        # conventions
623590b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
623690b17f1bSmrg        ;;
623790b17f1bSmrg
623890b17f1bSmrg      gnu*)
623990b17f1bSmrg        ;;
624090b17f1bSmrg
624190b17f1bSmrg      haiku*)
624290b17f1bSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
624390b17f1bSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
624490b17f1bSmrg        ;;
624590b17f1bSmrg
624690b17f1bSmrg      hpux9*)
624790b17f1bSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
624890b17f1bSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
624990b17f1bSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
625090b17f1bSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
625190b17f1bSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
625290b17f1bSmrg				             # but as the default
625390b17f1bSmrg				             # location of the library.
625490b17f1bSmrg
625590b17f1bSmrg        case $cc_basename in
625690b17f1bSmrg          CC*)
625790b17f1bSmrg            # FIXME: insert proper C++ library support
625890b17f1bSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
625990b17f1bSmrg            ;;
626090b17f1bSmrg          aCC*)
626190b17f1bSmrg            _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'
626290b17f1bSmrg            # Commands to make compiler produce verbose output that lists
626390b17f1bSmrg            # what "hidden" libraries, object files and flags are used when
626490b17f1bSmrg            # linking a shared library.
626590b17f1bSmrg            #
626690b17f1bSmrg            # There doesn't appear to be a way to prevent this compiler from
626790b17f1bSmrg            # explicitly linking system object files so we need to strip them
626890b17f1bSmrg            # from the output so that they don't get included in the library
626990b17f1bSmrg            # dependencies.
627090b17f1bSmrg            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"'
627190b17f1bSmrg            ;;
627290b17f1bSmrg          *)
627390b17f1bSmrg            if test "$GXX" = yes; then
627490b17f1bSmrg              _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'
627590b17f1bSmrg            else
627690b17f1bSmrg              # FIXME: insert proper C++ library support
627790b17f1bSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
627890b17f1bSmrg            fi
627990b17f1bSmrg            ;;
628090b17f1bSmrg        esac
628190b17f1bSmrg        ;;
628290b17f1bSmrg
628390b17f1bSmrg      hpux10*|hpux11*)
628490b17f1bSmrg        if test $with_gnu_ld = no; then
628590b17f1bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
628690b17f1bSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
628790b17f1bSmrg
628890b17f1bSmrg          case $host_cpu in
628990b17f1bSmrg            hppa*64*|ia64*)
629090b17f1bSmrg              ;;
629190b17f1bSmrg            *)
629290b17f1bSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
629390b17f1bSmrg              ;;
629490b17f1bSmrg          esac
629590b17f1bSmrg        fi
629690b17f1bSmrg        case $host_cpu in
629790b17f1bSmrg          hppa*64*|ia64*)
629890b17f1bSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
629990b17f1bSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
630090b17f1bSmrg            ;;
630190b17f1bSmrg          *)
630290b17f1bSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
630390b17f1bSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
630490b17f1bSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
630590b17f1bSmrg					         # but as the default
630690b17f1bSmrg					         # location of the library.
630790b17f1bSmrg            ;;
630890b17f1bSmrg        esac
630990b17f1bSmrg
631090b17f1bSmrg        case $cc_basename in
631190b17f1bSmrg          CC*)
631290b17f1bSmrg	    # FIXME: insert proper C++ library support
631390b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
63147e6fb56fSmrg	    ;;
631590b17f1bSmrg          aCC*)
63167e6fb56fSmrg	    case $host_cpu in
631790b17f1bSmrg	      hppa*64*)
631890b17f1bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
631990b17f1bSmrg	        ;;
632090b17f1bSmrg	      ia64*)
632190b17f1bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
632290b17f1bSmrg	        ;;
632390b17f1bSmrg	      *)
632490b17f1bSmrg	        _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'
632590b17f1bSmrg	        ;;
63267e6fb56fSmrg	    esac
632790b17f1bSmrg	    # Commands to make compiler produce verbose output that lists
632890b17f1bSmrg	    # what "hidden" libraries, object files and flags are used when
632990b17f1bSmrg	    # linking a shared library.
633090b17f1bSmrg	    #
633190b17f1bSmrg	    # There doesn't appear to be a way to prevent this compiler from
633290b17f1bSmrg	    # explicitly linking system object files so we need to strip them
633390b17f1bSmrg	    # from the output so that they don't get included in the library
633490b17f1bSmrg	    # dependencies.
633590b17f1bSmrg	    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"'
63367e6fb56fSmrg	    ;;
633790b17f1bSmrg          *)
633890b17f1bSmrg	    if test "$GXX" = yes; then
633990b17f1bSmrg	      if test $with_gnu_ld = no; then
634090b17f1bSmrg	        case $host_cpu in
634190b17f1bSmrg	          hppa*64*)
634290b17f1bSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
634390b17f1bSmrg	            ;;
634490b17f1bSmrg	          ia64*)
634590b17f1bSmrg	            _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'
634690b17f1bSmrg	            ;;
634790b17f1bSmrg	          *)
634890b17f1bSmrg	            _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'
634990b17f1bSmrg	            ;;
635090b17f1bSmrg	        esac
635190b17f1bSmrg	      fi
635290b17f1bSmrg	    else
635390b17f1bSmrg	      # FIXME: insert proper C++ library support
635490b17f1bSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
635590b17f1bSmrg	    fi
63567e6fb56fSmrg	    ;;
635790b17f1bSmrg        esac
635890b17f1bSmrg        ;;
635990b17f1bSmrg
636090b17f1bSmrg      interix[[3-9]]*)
636190b17f1bSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
636290b17f1bSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
636390b17f1bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
636490b17f1bSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
636590b17f1bSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
636690b17f1bSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
636790b17f1bSmrg	# default) and relocated if they conflict, which is a slow very memory
636890b17f1bSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
636990b17f1bSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
637090b17f1bSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
637190b17f1bSmrg	_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'
637290b17f1bSmrg	_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'
63737e6fb56fSmrg	;;
637490b17f1bSmrg      irix5* | irix6*)
637590b17f1bSmrg        case $cc_basename in
637690b17f1bSmrg          CC*)
637790b17f1bSmrg	    # SGI C++
637890b17f1bSmrg	    _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'
637990b17f1bSmrg
638090b17f1bSmrg	    # Archives containing C++ object files must be created using
638190b17f1bSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
638290b17f1bSmrg	    # necessary to make sure instantiated templates are included
638390b17f1bSmrg	    # in the archive.
638490b17f1bSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
63857e6fb56fSmrg	    ;;
638690b17f1bSmrg          *)
638790b17f1bSmrg	    if test "$GXX" = yes; then
638890b17f1bSmrg	      if test "$with_gnu_ld" = no; then
638990b17f1bSmrg	        _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'
639090b17f1bSmrg	      else
639190b17f1bSmrg	        _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'
639290b17f1bSmrg	      fi
639390b17f1bSmrg	    fi
639490b17f1bSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
63957e6fb56fSmrg	    ;;
639690b17f1bSmrg        esac
639790b17f1bSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
639890b17f1bSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
639990b17f1bSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
640090b17f1bSmrg        ;;
640190b17f1bSmrg
640290b17f1bSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
640390b17f1bSmrg        case $cc_basename in
640490b17f1bSmrg          KCC*)
640590b17f1bSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
640690b17f1bSmrg
640790b17f1bSmrg	    # KCC will only create a shared library if the output file
640890b17f1bSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
640990b17f1bSmrg	    # to its proper name (with version) after linking.
641090b17f1bSmrg	    _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'
641190b17f1bSmrg	    _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'
641290b17f1bSmrg	    # Commands to make compiler produce verbose output that lists
641390b17f1bSmrg	    # what "hidden" libraries, object files and flags are used when
641490b17f1bSmrg	    # linking a shared library.
641590b17f1bSmrg	    #
641690b17f1bSmrg	    # There doesn't appear to be a way to prevent this compiler from
641790b17f1bSmrg	    # explicitly linking system object files so we need to strip them
641890b17f1bSmrg	    # from the output so that they don't get included in the library
641990b17f1bSmrg	    # dependencies.
642090b17f1bSmrg	    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"'
642190b17f1bSmrg
642290b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
642390b17f1bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
642490b17f1bSmrg
642590b17f1bSmrg	    # Archives containing C++ object files must be created using
642690b17f1bSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
642790b17f1bSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
64287e6fb56fSmrg	    ;;
642990b17f1bSmrg	  icpc* | ecpc* )
64307e6fb56fSmrg	    # Intel C++
643190b17f1bSmrg	    with_gnu_ld=yes
643290b17f1bSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
643390b17f1bSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
643490b17f1bSmrg	    # earlier do not add the objects themselves.
643590b17f1bSmrg	    case `$CC -V 2>&1` in
643690b17f1bSmrg	      *"Version 7."*)
643790b17f1bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
643890b17f1bSmrg		_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'
643990b17f1bSmrg		;;
644090b17f1bSmrg	      *)  # Version 8.0 or newer
644190b17f1bSmrg	        tmp_idyn=
644290b17f1bSmrg	        case $host_cpu in
644390b17f1bSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
644490b17f1bSmrg		esac
644590b17f1bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
644690b17f1bSmrg		_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'
644790b17f1bSmrg		;;
644890b17f1bSmrg	    esac
644990b17f1bSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
645090b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
645190b17f1bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
645290b17f1bSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
64537e6fb56fSmrg	    ;;
645490b17f1bSmrg          pgCC* | pgcpp*)
645590b17f1bSmrg            # Portland Group C++ compiler
645690b17f1bSmrg	    case `$CC -V` in
645790b17f1bSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
645890b17f1bSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
645990b17f1bSmrg		rm -rf $tpldir~
646090b17f1bSmrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
646190b17f1bSmrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
646290b17f1bSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
646390b17f1bSmrg		rm -rf $tpldir~
646490b17f1bSmrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
646590b17f1bSmrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
646690b17f1bSmrg		$RANLIB $oldlib'
646790b17f1bSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
646890b17f1bSmrg		rm -rf $tpldir~
646990b17f1bSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
647090b17f1bSmrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
647190b17f1bSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
647290b17f1bSmrg		rm -rf $tpldir~
647390b17f1bSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
647490b17f1bSmrg		$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'
647590b17f1bSmrg	      ;;
647690b17f1bSmrg	    *) # Version 6 and above use weak symbols
647790b17f1bSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
647890b17f1bSmrg	      _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'
647990b17f1bSmrg	      ;;
648090b17f1bSmrg	    esac
648190b17f1bSmrg
648290b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
648390b17f1bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
648490b17f1bSmrg	    _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'
648590b17f1bSmrg            ;;
64867e6fb56fSmrg	  cxx*)
64877e6fb56fSmrg	    # Compaq C++
648890b17f1bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
648990b17f1bSmrg	    _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'
649090b17f1bSmrg
649190b17f1bSmrg	    runpath_var=LD_RUN_PATH
649290b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
649390b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
649490b17f1bSmrg
649590b17f1bSmrg	    # Commands to make compiler produce verbose output that lists
649690b17f1bSmrg	    # what "hidden" libraries, object files and flags are used when
649790b17f1bSmrg	    # linking a shared library.
649890b17f1bSmrg	    #
649990b17f1bSmrg	    # There doesn't appear to be a way to prevent this compiler from
650090b17f1bSmrg	    # explicitly linking system object files so we need to strip them
650190b17f1bSmrg	    # from the output so that they don't get included in the library
650290b17f1bSmrg	    # dependencies.
650390b17f1bSmrg	    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'
650490b17f1bSmrg	    ;;
650590b17f1bSmrg	  xl* | mpixl* | bgxl*)
650690b17f1bSmrg	    # IBM XL 8.0 on PPC, with GNU ld
650790b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
650890b17f1bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
650990b17f1bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
651090b17f1bSmrg	    if test "x$supports_anon_versioning" = xyes; then
651190b17f1bSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
651290b17f1bSmrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
651390b17f1bSmrg		echo "local: *; };" >> $output_objdir/$libname.ver~
651490b17f1bSmrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
651590b17f1bSmrg	    fi
65167e6fb56fSmrg	    ;;
65177e6fb56fSmrg	  *)
65187e6fb56fSmrg	    case `$CC -V 2>&1 | sed 5q` in
65197e6fb56fSmrg	    *Sun\ C*)
65207e6fb56fSmrg	      # Sun C++ 5.9
652190b17f1bSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
652290b17f1bSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
652390b17f1bSmrg	      _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'
652490b17f1bSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
652590b17f1bSmrg	      _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'
652690b17f1bSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
652790b17f1bSmrg
652890b17f1bSmrg	      # Not sure whether something based on
652990b17f1bSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
653090b17f1bSmrg	      # would be better.
653190b17f1bSmrg	      output_verbose_link_cmd='func_echo_all'
653290b17f1bSmrg
653390b17f1bSmrg	      # Archives containing C++ object files must be created using
653490b17f1bSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
653590b17f1bSmrg	      # necessary to make sure instantiated templates are included
653690b17f1bSmrg	      # in the archive.
653790b17f1bSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
65387e6fb56fSmrg	      ;;
65397e6fb56fSmrg	    esac
65407e6fb56fSmrg	    ;;
65417e6fb56fSmrg	esac
65427e6fb56fSmrg	;;
654390b17f1bSmrg
65447e6fb56fSmrg      lynxos*)
654590b17f1bSmrg        # FIXME: insert proper C++ library support
654690b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
65477e6fb56fSmrg	;;
654890b17f1bSmrg
65497e6fb56fSmrg      m88k*)
655090b17f1bSmrg        # FIXME: insert proper C++ library support
655190b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
65527e6fb56fSmrg	;;
655390b17f1bSmrg
65547e6fb56fSmrg      mvs*)
655590b17f1bSmrg        case $cc_basename in
655690b17f1bSmrg          cxx*)
655790b17f1bSmrg	    # FIXME: insert proper C++ library support
655890b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
65597e6fb56fSmrg	    ;;
65607e6fb56fSmrg	  *)
656190b17f1bSmrg	    # FIXME: insert proper C++ library support
656290b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
65637e6fb56fSmrg	    ;;
65647e6fb56fSmrg	esac
65657e6fb56fSmrg	;;
656690b17f1bSmrg
65677e6fb56fSmrg      netbsd*)
656890b17f1bSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
656990b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
657090b17f1bSmrg	  wlarc=
657190b17f1bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
657290b17f1bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
657390b17f1bSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
657490b17f1bSmrg	fi
657590b17f1bSmrg	# Workaround some broken pre-1.5 toolchains
657690b17f1bSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
65777e6fb56fSmrg	;;
657890b17f1bSmrg
657990b17f1bSmrg      *nto* | *qnx*)
658090b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
658190b17f1bSmrg	;;
658290b17f1bSmrg
658390b17f1bSmrg      openbsd2*)
658490b17f1bSmrg        # C++ shared libraries are fairly broken
658590b17f1bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
658690b17f1bSmrg	;;
658790b17f1bSmrg
658890b17f1bSmrg      openbsd*)
658990b17f1bSmrg	if test -f /usr/libexec/ld.so; then
659090b17f1bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
659190b17f1bSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
659290b17f1bSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
659390b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
659490b17f1bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
659590b17f1bSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
659690b17f1bSmrg	    _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'
659790b17f1bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
659890b17f1bSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
659990b17f1bSmrg	  fi
660090b17f1bSmrg	  output_verbose_link_cmd=func_echo_all
660190b17f1bSmrg	else
660290b17f1bSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
660390b17f1bSmrg	fi
660490b17f1bSmrg	;;
660590b17f1bSmrg
66067e6fb56fSmrg      osf3* | osf4* | osf5*)
660790b17f1bSmrg        case $cc_basename in
660890b17f1bSmrg          KCC*)
660990b17f1bSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
661090b17f1bSmrg
661190b17f1bSmrg	    # KCC will only create a shared library if the output file
661290b17f1bSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
661390b17f1bSmrg	    # to its proper name (with version) after linking.
661490b17f1bSmrg	    _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'
661590b17f1bSmrg
661690b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
661790b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
661890b17f1bSmrg
661990b17f1bSmrg	    # Archives containing C++ object files must be created using
662090b17f1bSmrg	    # the KAI C++ compiler.
662190b17f1bSmrg	    case $host in
662290b17f1bSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
662390b17f1bSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
662490b17f1bSmrg	    esac
66257e6fb56fSmrg	    ;;
662690b17f1bSmrg          RCC*)
66277e6fb56fSmrg	    # Rational C++ 2.4.1
662890b17f1bSmrg	    # FIXME: insert proper C++ library support
662990b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
66307e6fb56fSmrg	    ;;
663190b17f1bSmrg          cxx*)
663290b17f1bSmrg	    case $host in
663390b17f1bSmrg	      osf3*)
663490b17f1bSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
663590b17f1bSmrg	        _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'
663690b17f1bSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
663790b17f1bSmrg		;;
663890b17f1bSmrg	      *)
663990b17f1bSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
664090b17f1bSmrg	        _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'
664190b17f1bSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
664290b17f1bSmrg	          echo "-hidden">> $lib.exp~
664390b17f1bSmrg	          $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~
664490b17f1bSmrg	          $RM $lib.exp'
664590b17f1bSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
664690b17f1bSmrg		;;
664790b17f1bSmrg	    esac
664890b17f1bSmrg
664990b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
665090b17f1bSmrg
665190b17f1bSmrg	    # Commands to make compiler produce verbose output that lists
665290b17f1bSmrg	    # what "hidden" libraries, object files and flags are used when
665390b17f1bSmrg	    # linking a shared library.
665490b17f1bSmrg	    #
665590b17f1bSmrg	    # There doesn't appear to be a way to prevent this compiler from
665690b17f1bSmrg	    # explicitly linking system object files so we need to strip them
665790b17f1bSmrg	    # from the output so that they don't get included in the library
665890b17f1bSmrg	    # dependencies.
665990b17f1bSmrg	    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"'
66607e6fb56fSmrg	    ;;
66617e6fb56fSmrg	  *)
666290b17f1bSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
666390b17f1bSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
666490b17f1bSmrg	      case $host in
666590b17f1bSmrg	        osf3*)
666690b17f1bSmrg	          _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'
666790b17f1bSmrg		  ;;
666890b17f1bSmrg	        *)
666990b17f1bSmrg	          _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'
667090b17f1bSmrg		  ;;
667190b17f1bSmrg	      esac
667290b17f1bSmrg
667390b17f1bSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
667490b17f1bSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
667590b17f1bSmrg
667690b17f1bSmrg	      # Commands to make compiler produce verbose output that lists
667790b17f1bSmrg	      # what "hidden" libraries, object files and flags are used when
667890b17f1bSmrg	      # linking a shared library.
667990b17f1bSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
668090b17f1bSmrg
668190b17f1bSmrg	    else
668290b17f1bSmrg	      # FIXME: insert proper C++ library support
668390b17f1bSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
668490b17f1bSmrg	    fi
66857e6fb56fSmrg	    ;;
668690b17f1bSmrg        esac
668790b17f1bSmrg        ;;
668890b17f1bSmrg
66897e6fb56fSmrg      psos*)
669090b17f1bSmrg        # FIXME: insert proper C++ library support
669190b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
669290b17f1bSmrg        ;;
669390b17f1bSmrg
669490b17f1bSmrg      sunos4*)
669590b17f1bSmrg        case $cc_basename in
669690b17f1bSmrg          CC*)
669790b17f1bSmrg	    # Sun C++ 4.x
669890b17f1bSmrg	    # FIXME: insert proper C++ library support
669990b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
670090b17f1bSmrg	    ;;
670190b17f1bSmrg          lcc*)
670290b17f1bSmrg	    # Lucid
670390b17f1bSmrg	    # FIXME: insert proper C++ library support
670490b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
670590b17f1bSmrg	    ;;
670690b17f1bSmrg          *)
670790b17f1bSmrg	    # FIXME: insert proper C++ library support
670890b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
670990b17f1bSmrg	    ;;
671090b17f1bSmrg        esac
671190b17f1bSmrg        ;;
671290b17f1bSmrg
67137e6fb56fSmrg      solaris*)
671490b17f1bSmrg        case $cc_basename in
671590b17f1bSmrg          CC* | sunCC*)
67167e6fb56fSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
671790b17f1bSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
671890b17f1bSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
671990b17f1bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
672090b17f1bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
672190b17f1bSmrg	      $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'
672290b17f1bSmrg
672390b17f1bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
672490b17f1bSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
672590b17f1bSmrg	    case $host_os in
672690b17f1bSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
672790b17f1bSmrg	      *)
672890b17f1bSmrg		# The compiler driver will combine and reorder linker options,
672990b17f1bSmrg		# but understands `-z linker_flag'.
673090b17f1bSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
673190b17f1bSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
673290b17f1bSmrg	        ;;
673390b17f1bSmrg	    esac
673490b17f1bSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
673590b17f1bSmrg
673690b17f1bSmrg	    output_verbose_link_cmd='func_echo_all'
673790b17f1bSmrg
673890b17f1bSmrg	    # Archives containing C++ object files must be created using
673990b17f1bSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
674090b17f1bSmrg	    # necessary to make sure instantiated templates are included
674190b17f1bSmrg	    # in the archive.
674290b17f1bSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
67437e6fb56fSmrg	    ;;
674490b17f1bSmrg          gcx*)
67457e6fb56fSmrg	    # Green Hills C++ Compiler
674690b17f1bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
674790b17f1bSmrg
674890b17f1bSmrg	    # The C++ compiler must be used to create the archive.
674990b17f1bSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
67507e6fb56fSmrg	    ;;
675190b17f1bSmrg          *)
675290b17f1bSmrg	    # GNU C++ compiler with Solaris linker
675390b17f1bSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
675490b17f1bSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
675590b17f1bSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
675690b17f1bSmrg	        _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'
675790b17f1bSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
675890b17f1bSmrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
675990b17f1bSmrg
676090b17f1bSmrg	        # Commands to make compiler produce verbose output that lists
676190b17f1bSmrg	        # what "hidden" libraries, object files and flags are used when
676290b17f1bSmrg	        # linking a shared library.
676390b17f1bSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
676490b17f1bSmrg	      else
676590b17f1bSmrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
676690b17f1bSmrg	        # platform.
676790b17f1bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
676890b17f1bSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
676990b17f1bSmrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
677090b17f1bSmrg
677190b17f1bSmrg	        # Commands to make compiler produce verbose output that lists
677290b17f1bSmrg	        # what "hidden" libraries, object files and flags are used when
677390b17f1bSmrg	        # linking a shared library.
677490b17f1bSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
677590b17f1bSmrg	      fi
677690b17f1bSmrg
677790b17f1bSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
677890b17f1bSmrg	      case $host_os in
677990b17f1bSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
678090b17f1bSmrg		*)
678190b17f1bSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
678290b17f1bSmrg		  ;;
678390b17f1bSmrg	      esac
678490b17f1bSmrg	    fi
67857e6fb56fSmrg	    ;;
678690b17f1bSmrg        esac
678790b17f1bSmrg        ;;
678890b17f1bSmrg
678990b17f1bSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
679090b17f1bSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
679190b17f1bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
679290b17f1bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
679390b17f1bSmrg      runpath_var='LD_RUN_PATH'
679490b17f1bSmrg
679590b17f1bSmrg      case $cc_basename in
679690b17f1bSmrg        CC*)
679790b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
679890b17f1bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
679990b17f1bSmrg	  ;;
680090b17f1bSmrg	*)
680190b17f1bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
680290b17f1bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
680390b17f1bSmrg	  ;;
680490b17f1bSmrg      esac
680590b17f1bSmrg      ;;
680690b17f1bSmrg
680790b17f1bSmrg      sysv5* | sco3.2v5* | sco5v6*)
680890b17f1bSmrg	# Note: We can NOT use -z defs as we might desire, because we do not
680990b17f1bSmrg	# link with -lc, and that would cause any symbols used from libc to
681090b17f1bSmrg	# always be unresolved, which means just about no library would
681190b17f1bSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
681290b17f1bSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
681390b17f1bSmrg	# as -z defs.
681490b17f1bSmrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
681590b17f1bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
681690b17f1bSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
681790b17f1bSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
681890b17f1bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
681990b17f1bSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
682090b17f1bSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
682190b17f1bSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
682290b17f1bSmrg	runpath_var='LD_RUN_PATH'
682390b17f1bSmrg
68247e6fb56fSmrg	case $cc_basename in
682590b17f1bSmrg          CC*)
682690b17f1bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
682790b17f1bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
682890b17f1bSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
682990b17f1bSmrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
683090b17f1bSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
683190b17f1bSmrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
68327e6fb56fSmrg	    ;;
68337e6fb56fSmrg	  *)
683490b17f1bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
683590b17f1bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68367e6fb56fSmrg	    ;;
68377e6fb56fSmrg	esac
683890b17f1bSmrg      ;;
683990b17f1bSmrg
68407e6fb56fSmrg      tandem*)
684190b17f1bSmrg        case $cc_basename in
684290b17f1bSmrg          NCC*)
68437e6fb56fSmrg	    # NonStop-UX NCC 3.20
684490b17f1bSmrg	    # FIXME: insert proper C++ library support
684590b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68467e6fb56fSmrg	    ;;
684790b17f1bSmrg          *)
684890b17f1bSmrg	    # FIXME: insert proper C++ library support
684990b17f1bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68507e6fb56fSmrg	    ;;
685190b17f1bSmrg        esac
685290b17f1bSmrg        ;;
685390b17f1bSmrg
68547e6fb56fSmrg      vxworks*)
685590b17f1bSmrg        # FIXME: insert proper C++ library support
685690b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
685790b17f1bSmrg        ;;
685890b17f1bSmrg
68597e6fb56fSmrg      *)
686090b17f1bSmrg        # FIXME: insert proper C++ library support
686190b17f1bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
686290b17f1bSmrg        ;;
68637e6fb56fSmrg    esac
68647e6fb56fSmrg
686590b17f1bSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
686690b17f1bSmrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
686790b17f1bSmrg
686890b17f1bSmrg    _LT_TAGVAR(GCC, $1)="$GXX"
686990b17f1bSmrg    _LT_TAGVAR(LD, $1)="$LD"
687090b17f1bSmrg
687190b17f1bSmrg    ## CAVEAT EMPTOR:
687290b17f1bSmrg    ## There is no encapsulation within the following macros, do not change
687390b17f1bSmrg    ## the running order or otherwise move them around unless you know exactly
687490b17f1bSmrg    ## what you are doing...
687590b17f1bSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
687690b17f1bSmrg    _LT_COMPILER_PIC($1)
687790b17f1bSmrg    _LT_COMPILER_C_O($1)
687890b17f1bSmrg    _LT_COMPILER_FILE_LOCKS($1)
687990b17f1bSmrg    _LT_LINKER_SHLIBS($1)
688090b17f1bSmrg    _LT_SYS_DYNAMIC_LINKER($1)
688190b17f1bSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
688290b17f1bSmrg
688390b17f1bSmrg    _LT_CONFIG($1)
688490b17f1bSmrg  fi # test -n "$compiler"
688590b17f1bSmrg
688690b17f1bSmrg  CC=$lt_save_CC
688790b17f1bSmrg  CFLAGS=$lt_save_CFLAGS
688890b17f1bSmrg  LDCXX=$LD
688990b17f1bSmrg  LD=$lt_save_LD
689090b17f1bSmrg  GCC=$lt_save_GCC
689190b17f1bSmrg  with_gnu_ld=$lt_save_with_gnu_ld
689290b17f1bSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
689390b17f1bSmrg  lt_cv_path_LD=$lt_save_path_LD
689490b17f1bSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
689590b17f1bSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
689690b17f1bSmrgfi # test "$_lt_caught_CXX_error" != yes
689790b17f1bSmrg
689890b17f1bSmrgAC_LANG_POP
689990b17f1bSmrg])# _LT_LANG_CXX_CONFIG
690090b17f1bSmrg
690190b17f1bSmrg
690290b17f1bSmrg# _LT_FUNC_STRIPNAME_CNF
690390b17f1bSmrg# ----------------------
690490b17f1bSmrg# func_stripname_cnf prefix suffix name
690590b17f1bSmrg# strip PREFIX and SUFFIX off of NAME.
690690b17f1bSmrg# PREFIX and SUFFIX must not contain globbing or regex special
690790b17f1bSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
690890b17f1bSmrg# dot (in which case that matches only a dot).
690990b17f1bSmrg#
691090b17f1bSmrg# This function is identical to the (non-XSI) version of func_stripname,
691190b17f1bSmrg# except this one can be used by m4 code that may be executed by configure,
691290b17f1bSmrg# rather than the libtool script.
691390b17f1bSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
691490b17f1bSmrgAC_REQUIRE([_LT_DECL_SED])
691590b17f1bSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
691690b17f1bSmrgfunc_stripname_cnf ()
691790b17f1bSmrg{
691890b17f1bSmrg  case ${2} in
691990b17f1bSmrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
692090b17f1bSmrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
692190b17f1bSmrg  esac
692290b17f1bSmrg} # func_stripname_cnf
692390b17f1bSmrg])# _LT_FUNC_STRIPNAME_CNF
692490b17f1bSmrg
692590b17f1bSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
692690b17f1bSmrg# ---------------------------------
692790b17f1bSmrg# Figure out "hidden" library dependencies from verbose
692890b17f1bSmrg# compiler output when linking a shared library.
692990b17f1bSmrg# Parse the compiler output and extract the necessary
693090b17f1bSmrg# objects, libraries and library flags.
693190b17f1bSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
693290b17f1bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
693390b17f1bSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
693490b17f1bSmrg# Dependencies to place before and after the object being linked:
693590b17f1bSmrg_LT_TAGVAR(predep_objects, $1)=
693690b17f1bSmrg_LT_TAGVAR(postdep_objects, $1)=
693790b17f1bSmrg_LT_TAGVAR(predeps, $1)=
693890b17f1bSmrg_LT_TAGVAR(postdeps, $1)=
693990b17f1bSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
694090b17f1bSmrg
694190b17f1bSmrgdnl we can't use the lt_simple_compile_test_code here,
694290b17f1bSmrgdnl because it contains code intended for an executable,
694390b17f1bSmrgdnl not a library.  It's possible we should let each
694490b17f1bSmrgdnl tag define a new lt_????_link_test_code variable,
694590b17f1bSmrgdnl but it's only used here...
694690b17f1bSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
694790b17f1bSmrgint a;
694890b17f1bSmrgvoid foo (void) { a = 0; }
694990b17f1bSmrg_LT_EOF
695090b17f1bSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
695190b17f1bSmrgclass Foo
695290b17f1bSmrg{
695390b17f1bSmrgpublic:
695490b17f1bSmrg  Foo (void) { a = 0; }
695590b17f1bSmrgprivate:
695690b17f1bSmrg  int a;
695790b17f1bSmrg};
695890b17f1bSmrg_LT_EOF
695990b17f1bSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
696090b17f1bSmrg      subroutine foo
696190b17f1bSmrg      implicit none
696290b17f1bSmrg      integer*4 a
696390b17f1bSmrg      a=0
696490b17f1bSmrg      return
696590b17f1bSmrg      end
696690b17f1bSmrg_LT_EOF
696790b17f1bSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
696890b17f1bSmrg      subroutine foo
696990b17f1bSmrg      implicit none
697090b17f1bSmrg      integer a
697190b17f1bSmrg      a=0
697290b17f1bSmrg      return
697390b17f1bSmrg      end
697490b17f1bSmrg_LT_EOF
697590b17f1bSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
697690b17f1bSmrgpublic class foo {
697790b17f1bSmrg  private int a;
697890b17f1bSmrg  public void bar (void) {
697990b17f1bSmrg    a = 0;
698090b17f1bSmrg  }
698190b17f1bSmrg};
698290b17f1bSmrg_LT_EOF
698390b17f1bSmrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
698490b17f1bSmrgpackage foo
698590b17f1bSmrgfunc foo() {
698690b17f1bSmrg}
698790b17f1bSmrg_LT_EOF
698890b17f1bSmrg])
698990b17f1bSmrg
699090b17f1bSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
699190b17f1bSmrgcase "$CC $CFLAGS " in #(
699290b17f1bSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
699390b17f1bSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
699490b17f1bSmrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
699590b17f1bSmrgesac
699690b17f1bSmrg
699790b17f1bSmrgdnl Parse the compiler output and extract the necessary
699890b17f1bSmrgdnl objects, libraries and library flags.
699990b17f1bSmrgif AC_TRY_EVAL(ac_compile); then
700090b17f1bSmrg  # Parse the compiler output and extract the necessary
700190b17f1bSmrg  # objects, libraries and library flags.
700290b17f1bSmrg
700390b17f1bSmrg  # Sentinel used to keep track of whether or not we are before
700490b17f1bSmrg  # the conftest object file.
700590b17f1bSmrg  pre_test_object_deps_done=no
700690b17f1bSmrg
700790b17f1bSmrg  for p in `eval "$output_verbose_link_cmd"`; do
700890b17f1bSmrg    case ${prev}${p} in
700990b17f1bSmrg
701090b17f1bSmrg    -L* | -R* | -l*)
701190b17f1bSmrg       # Some compilers place space between "-{L,R}" and the path.
701290b17f1bSmrg       # Remove the space.
701390b17f1bSmrg       if test $p = "-L" ||
701490b17f1bSmrg          test $p = "-R"; then
701590b17f1bSmrg	 prev=$p
701690b17f1bSmrg	 continue
701790b17f1bSmrg       fi
701890b17f1bSmrg
701990b17f1bSmrg       # Expand the sysroot to ease extracting the directories later.
702090b17f1bSmrg       if test -z "$prev"; then
702190b17f1bSmrg         case $p in
702290b17f1bSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
702390b17f1bSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
702490b17f1bSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
702590b17f1bSmrg         esac
702690b17f1bSmrg       fi
702790b17f1bSmrg       case $p in
702890b17f1bSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
702990b17f1bSmrg       esac
703090b17f1bSmrg       if test "$pre_test_object_deps_done" = no; then
703190b17f1bSmrg	 case ${prev} in
703290b17f1bSmrg	 -L | -R)
703390b17f1bSmrg	   # Internal compiler library paths should come after those
703490b17f1bSmrg	   # provided the user.  The postdeps already come after the
703590b17f1bSmrg	   # user supplied libs so there is no need to process them.
703690b17f1bSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
703790b17f1bSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
703890b17f1bSmrg	   else
703990b17f1bSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
704090b17f1bSmrg	   fi
704190b17f1bSmrg	   ;;
704290b17f1bSmrg	 # The "-l" case would never come before the object being
704390b17f1bSmrg	 # linked, so don't bother handling this case.
704490b17f1bSmrg	 esac
704590b17f1bSmrg       else
704690b17f1bSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
704790b17f1bSmrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
704890b17f1bSmrg	 else
704990b17f1bSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
705090b17f1bSmrg	 fi
705190b17f1bSmrg       fi
705290b17f1bSmrg       prev=
705390b17f1bSmrg       ;;
705490b17f1bSmrg
705590b17f1bSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
705690b17f1bSmrg    *.$objext)
705790b17f1bSmrg       # This assumes that the test object file only shows up
705890b17f1bSmrg       # once in the compiler output.
705990b17f1bSmrg       if test "$p" = "conftest.$objext"; then
706090b17f1bSmrg	 pre_test_object_deps_done=yes
706190b17f1bSmrg	 continue
706290b17f1bSmrg       fi
706390b17f1bSmrg
706490b17f1bSmrg       if test "$pre_test_object_deps_done" = no; then
706590b17f1bSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
706690b17f1bSmrg	   _LT_TAGVAR(predep_objects, $1)="$p"
706790b17f1bSmrg	 else
706890b17f1bSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
706990b17f1bSmrg	 fi
707090b17f1bSmrg       else
707190b17f1bSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
707290b17f1bSmrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
707390b17f1bSmrg	 else
707490b17f1bSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
707590b17f1bSmrg	 fi
707690b17f1bSmrg       fi
707790b17f1bSmrg       ;;
707890b17f1bSmrg
707990b17f1bSmrg    *) ;; # Ignore the rest.
708090b17f1bSmrg
708190b17f1bSmrg    esac
708290b17f1bSmrg  done
708390b17f1bSmrg
708490b17f1bSmrg  # Clean up.
708590b17f1bSmrg  rm -f a.out a.exe
708690b17f1bSmrgelse
708790b17f1bSmrg  echo "libtool.m4: error: problem compiling $1 test program"
708890b17f1bSmrgfi
708990b17f1bSmrg
709090b17f1bSmrg$RM -f confest.$objext
709190b17f1bSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
709290b17f1bSmrg
709390b17f1bSmrg# PORTME: override above test on systems where it is broken
709490b17f1bSmrgm4_if([$1], [CXX],
709590b17f1bSmrg[case $host_os in
709690b17f1bSmrginterix[[3-9]]*)
709790b17f1bSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
709890b17f1bSmrg  # hack all around it, let's just trust "g++" to DTRT.
709990b17f1bSmrg  _LT_TAGVAR(predep_objects,$1)=
710090b17f1bSmrg  _LT_TAGVAR(postdep_objects,$1)=
710190b17f1bSmrg  _LT_TAGVAR(postdeps,$1)=
710290b17f1bSmrg  ;;
710390b17f1bSmrg
710490b17f1bSmrglinux*)
710590b17f1bSmrg  case `$CC -V 2>&1 | sed 5q` in
710690b17f1bSmrg  *Sun\ C*)
710790b17f1bSmrg    # Sun C++ 5.9
710890b17f1bSmrg
710990b17f1bSmrg    # The more standards-conforming stlport4 library is
711090b17f1bSmrg    # incompatible with the Cstd library. Avoid specifying
711190b17f1bSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
711290b17f1bSmrg    # -library=stlport4 depends on it.
711390b17f1bSmrg    case " $CXX $CXXFLAGS " in
711490b17f1bSmrg    *" -library=stlport4 "*)
711590b17f1bSmrg      solaris_use_stlport4=yes
711690b17f1bSmrg      ;;
711790b17f1bSmrg    esac
711890b17f1bSmrg
711990b17f1bSmrg    if test "$solaris_use_stlport4" != yes; then
712090b17f1bSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
712190b17f1bSmrg    fi
712290b17f1bSmrg    ;;
712390b17f1bSmrg  esac
712490b17f1bSmrg  ;;
712590b17f1bSmrg
712690b17f1bSmrgsolaris*)
712790b17f1bSmrg  case $cc_basename in
712890b17f1bSmrg  CC* | sunCC*)
712990b17f1bSmrg    # The more standards-conforming stlport4 library is
713090b17f1bSmrg    # incompatible with the Cstd library. Avoid specifying
713190b17f1bSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
713290b17f1bSmrg    # -library=stlport4 depends on it.
713390b17f1bSmrg    case " $CXX $CXXFLAGS " in
713490b17f1bSmrg    *" -library=stlport4 "*)
713590b17f1bSmrg      solaris_use_stlport4=yes
713690b17f1bSmrg      ;;
713790b17f1bSmrg    esac
713890b17f1bSmrg
713990b17f1bSmrg    # Adding this requires a known-good setup of shared libraries for
714090b17f1bSmrg    # Sun compiler versions before 5.6, else PIC objects from an old
714190b17f1bSmrg    # archive will be linked into the output, leading to subtle bugs.
714290b17f1bSmrg    if test "$solaris_use_stlport4" != yes; then
714390b17f1bSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
714490b17f1bSmrg    fi
714590b17f1bSmrg    ;;
714690b17f1bSmrg  esac
714790b17f1bSmrg  ;;
714890b17f1bSmrgesac
714990b17f1bSmrg])
715090b17f1bSmrg
715190b17f1bSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
715290b17f1bSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
715390b17f1bSmrgesac
715490b17f1bSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
715590b17f1bSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
715690b17f1bSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
715790b17f1bSmrgfi
715890b17f1bSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
715990b17f1bSmrg    [The directories searched by this compiler when creating a shared library])
716090b17f1bSmrg_LT_TAGDECL([], [predep_objects], [1],
716190b17f1bSmrg    [Dependencies to place before and after the objects being linked to
716290b17f1bSmrg    create a shared library])
716390b17f1bSmrg_LT_TAGDECL([], [postdep_objects], [1])
716490b17f1bSmrg_LT_TAGDECL([], [predeps], [1])
716590b17f1bSmrg_LT_TAGDECL([], [postdeps], [1])
716690b17f1bSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
716790b17f1bSmrg    [The library search path used internally by the compiler when linking
716890b17f1bSmrg    a shared library])
716990b17f1bSmrg])# _LT_SYS_HIDDEN_LIBDEPS
717090b17f1bSmrg
717190b17f1bSmrg
717290b17f1bSmrg# _LT_LANG_F77_CONFIG([TAG])
717390b17f1bSmrg# --------------------------
717490b17f1bSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
717590b17f1bSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
717690b17f1bSmrg# to write the compiler configuration to `libtool'.
717790b17f1bSmrgm4_defun([_LT_LANG_F77_CONFIG],
717890b17f1bSmrg[AC_LANG_PUSH(Fortran 77)
717990b17f1bSmrgif test -z "$F77" || test "X$F77" = "Xno"; then
718090b17f1bSmrg  _lt_disable_F77=yes
718190b17f1bSmrgfi
718290b17f1bSmrg
718390b17f1bSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
718490b17f1bSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
718590b17f1bSmrg_LT_TAGVAR(always_export_symbols, $1)=no
718690b17f1bSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
718790b17f1bSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
718890b17f1bSmrg_LT_TAGVAR(hardcode_direct, $1)=no
718990b17f1bSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
719090b17f1bSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
719190b17f1bSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
719290b17f1bSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
719390b17f1bSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
719490b17f1bSmrg_LT_TAGVAR(inherit_rpath, $1)=no
719590b17f1bSmrg_LT_TAGVAR(module_cmds, $1)=
719690b17f1bSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
719790b17f1bSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
719890b17f1bSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
719990b17f1bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
720090b17f1bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
720190b17f1bSmrg_LT_TAGVAR(no_undefined_flag, $1)=
720290b17f1bSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
720390b17f1bSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
720490b17f1bSmrg
720590b17f1bSmrg# Source file extension for f77 test sources.
720690b17f1bSmrgac_ext=f
720790b17f1bSmrg
720890b17f1bSmrg# Object file extension for compiled f77 test sources.
720990b17f1bSmrgobjext=o
721090b17f1bSmrg_LT_TAGVAR(objext, $1)=$objext
721190b17f1bSmrg
721290b17f1bSmrg# No sense in running all these tests if we already determined that
721390b17f1bSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
721490b17f1bSmrg# are currently assumed to apply to all compilers on this platform,
721590b17f1bSmrg# and will be corrupted by setting them based on a non-working compiler.
721690b17f1bSmrgif test "$_lt_disable_F77" != yes; then
721790b17f1bSmrg  # Code to be used in simple compile tests
721890b17f1bSmrg  lt_simple_compile_test_code="\
721990b17f1bSmrg      subroutine t
722090b17f1bSmrg      return
722190b17f1bSmrg      end
722290b17f1bSmrg"
722390b17f1bSmrg
722490b17f1bSmrg  # Code to be used in simple link tests
722590b17f1bSmrg  lt_simple_link_test_code="\
722690b17f1bSmrg      program t
722790b17f1bSmrg      end
722890b17f1bSmrg"
722990b17f1bSmrg
723090b17f1bSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
723190b17f1bSmrg  _LT_TAG_COMPILER
723290b17f1bSmrg
723390b17f1bSmrg  # save warnings/boilerplate of simple test code
723490b17f1bSmrg  _LT_COMPILER_BOILERPLATE
723590b17f1bSmrg  _LT_LINKER_BOILERPLATE
723690b17f1bSmrg
723790b17f1bSmrg  # Allow CC to be a program name with arguments.
723890b17f1bSmrg  lt_save_CC="$CC"
723990b17f1bSmrg  lt_save_GCC=$GCC
724090b17f1bSmrg  lt_save_CFLAGS=$CFLAGS
724190b17f1bSmrg  CC=${F77-"f77"}
724290b17f1bSmrg  CFLAGS=$FFLAGS
724390b17f1bSmrg  compiler=$CC
724490b17f1bSmrg  _LT_TAGVAR(compiler, $1)=$CC
724590b17f1bSmrg  _LT_CC_BASENAME([$compiler])
724690b17f1bSmrg  GCC=$G77
724790b17f1bSmrg  if test -n "$compiler"; then
724890b17f1bSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
724990b17f1bSmrg    AC_MSG_RESULT([$can_build_shared])
725090b17f1bSmrg
725190b17f1bSmrg    AC_MSG_CHECKING([whether to build shared libraries])
725290b17f1bSmrg    test "$can_build_shared" = "no" && enable_shared=no
725390b17f1bSmrg
725490b17f1bSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
725590b17f1bSmrg    # are all built from PIC.
725690b17f1bSmrg    case $host_os in
725790b17f1bSmrg      aix3*)
725890b17f1bSmrg        test "$enable_shared" = yes && enable_static=no
725990b17f1bSmrg        if test -n "$RANLIB"; then
726090b17f1bSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
726190b17f1bSmrg          postinstall_cmds='$RANLIB $lib'
726290b17f1bSmrg        fi
726390b17f1bSmrg        ;;
726490b17f1bSmrg      aix[[4-9]]*)
726590b17f1bSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
726690b17f1bSmrg	  test "$enable_shared" = yes && enable_static=no
726790b17f1bSmrg	fi
726890b17f1bSmrg        ;;
726990b17f1bSmrg    esac
727090b17f1bSmrg    AC_MSG_RESULT([$enable_shared])
727190b17f1bSmrg
727290b17f1bSmrg    AC_MSG_CHECKING([whether to build static libraries])
727390b17f1bSmrg    # Make sure either enable_shared or enable_static is yes.
727490b17f1bSmrg    test "$enable_shared" = yes || enable_static=yes
727590b17f1bSmrg    AC_MSG_RESULT([$enable_static])
727690b17f1bSmrg
727790b17f1bSmrg    _LT_TAGVAR(GCC, $1)="$G77"
727890b17f1bSmrg    _LT_TAGVAR(LD, $1)="$LD"
727990b17f1bSmrg
728090b17f1bSmrg    ## CAVEAT EMPTOR:
728190b17f1bSmrg    ## There is no encapsulation within the following macros, do not change
728290b17f1bSmrg    ## the running order or otherwise move them around unless you know exactly
728390b17f1bSmrg    ## what you are doing...
728490b17f1bSmrg    _LT_COMPILER_PIC($1)
728590b17f1bSmrg    _LT_COMPILER_C_O($1)
728690b17f1bSmrg    _LT_COMPILER_FILE_LOCKS($1)
728790b17f1bSmrg    _LT_LINKER_SHLIBS($1)
728890b17f1bSmrg    _LT_SYS_DYNAMIC_LINKER($1)
728990b17f1bSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
729090b17f1bSmrg
729190b17f1bSmrg    _LT_CONFIG($1)
729290b17f1bSmrg  fi # test -n "$compiler"
729390b17f1bSmrg
729490b17f1bSmrg  GCC=$lt_save_GCC
729590b17f1bSmrg  CC="$lt_save_CC"
729690b17f1bSmrg  CFLAGS="$lt_save_CFLAGS"
729790b17f1bSmrgfi # test "$_lt_disable_F77" != yes
729890b17f1bSmrg
729990b17f1bSmrgAC_LANG_POP
730090b17f1bSmrg])# _LT_LANG_F77_CONFIG
730190b17f1bSmrg
730290b17f1bSmrg
730390b17f1bSmrg# _LT_LANG_FC_CONFIG([TAG])
730490b17f1bSmrg# -------------------------
730590b17f1bSmrg# Ensure that the configuration variables for a Fortran compiler are
730690b17f1bSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
730790b17f1bSmrg# to write the compiler configuration to `libtool'.
730890b17f1bSmrgm4_defun([_LT_LANG_FC_CONFIG],
730990b17f1bSmrg[AC_LANG_PUSH(Fortran)
731090b17f1bSmrg
731190b17f1bSmrgif test -z "$FC" || test "X$FC" = "Xno"; then
731290b17f1bSmrg  _lt_disable_FC=yes
731390b17f1bSmrgfi
731490b17f1bSmrg
731590b17f1bSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
731690b17f1bSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
731790b17f1bSmrg_LT_TAGVAR(always_export_symbols, $1)=no
731890b17f1bSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
731990b17f1bSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
732090b17f1bSmrg_LT_TAGVAR(hardcode_direct, $1)=no
732190b17f1bSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
732290b17f1bSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
732390b17f1bSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
732490b17f1bSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
732590b17f1bSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
732690b17f1bSmrg_LT_TAGVAR(inherit_rpath, $1)=no
732790b17f1bSmrg_LT_TAGVAR(module_cmds, $1)=
732890b17f1bSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
732990b17f1bSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
733090b17f1bSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
733190b17f1bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
733290b17f1bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
733390b17f1bSmrg_LT_TAGVAR(no_undefined_flag, $1)=
733490b17f1bSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
733590b17f1bSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
733690b17f1bSmrg
733790b17f1bSmrg# Source file extension for fc test sources.
733890b17f1bSmrgac_ext=${ac_fc_srcext-f}
733990b17f1bSmrg
734090b17f1bSmrg# Object file extension for compiled fc test sources.
734190b17f1bSmrgobjext=o
734290b17f1bSmrg_LT_TAGVAR(objext, $1)=$objext
734390b17f1bSmrg
734490b17f1bSmrg# No sense in running all these tests if we already determined that
734590b17f1bSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
734690b17f1bSmrg# are currently assumed to apply to all compilers on this platform,
734790b17f1bSmrg# and will be corrupted by setting them based on a non-working compiler.
734890b17f1bSmrgif test "$_lt_disable_FC" != yes; then
734990b17f1bSmrg  # Code to be used in simple compile tests
735090b17f1bSmrg  lt_simple_compile_test_code="\
735190b17f1bSmrg      subroutine t
735290b17f1bSmrg      return
735390b17f1bSmrg      end
735490b17f1bSmrg"
735590b17f1bSmrg
735690b17f1bSmrg  # Code to be used in simple link tests
735790b17f1bSmrg  lt_simple_link_test_code="\
735890b17f1bSmrg      program t
735990b17f1bSmrg      end
736090b17f1bSmrg"
736190b17f1bSmrg
736290b17f1bSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
736390b17f1bSmrg  _LT_TAG_COMPILER
736490b17f1bSmrg
736590b17f1bSmrg  # save warnings/boilerplate of simple test code
736690b17f1bSmrg  _LT_COMPILER_BOILERPLATE
736790b17f1bSmrg  _LT_LINKER_BOILERPLATE
736890b17f1bSmrg
736990b17f1bSmrg  # Allow CC to be a program name with arguments.
737090b17f1bSmrg  lt_save_CC="$CC"
737190b17f1bSmrg  lt_save_GCC=$GCC
737290b17f1bSmrg  lt_save_CFLAGS=$CFLAGS
737390b17f1bSmrg  CC=${FC-"f95"}
737490b17f1bSmrg  CFLAGS=$FCFLAGS
737590b17f1bSmrg  compiler=$CC
737690b17f1bSmrg  GCC=$ac_cv_fc_compiler_gnu
737790b17f1bSmrg
737890b17f1bSmrg  _LT_TAGVAR(compiler, $1)=$CC
737990b17f1bSmrg  _LT_CC_BASENAME([$compiler])
738090b17f1bSmrg
738190b17f1bSmrg  if test -n "$compiler"; then
738290b17f1bSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
738390b17f1bSmrg    AC_MSG_RESULT([$can_build_shared])
738490b17f1bSmrg
738590b17f1bSmrg    AC_MSG_CHECKING([whether to build shared libraries])
738690b17f1bSmrg    test "$can_build_shared" = "no" && enable_shared=no
738790b17f1bSmrg
738890b17f1bSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
738990b17f1bSmrg    # are all built from PIC.
739090b17f1bSmrg    case $host_os in
739190b17f1bSmrg      aix3*)
739290b17f1bSmrg        test "$enable_shared" = yes && enable_static=no
739390b17f1bSmrg        if test -n "$RANLIB"; then
739490b17f1bSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
739590b17f1bSmrg          postinstall_cmds='$RANLIB $lib'
739690b17f1bSmrg        fi
739790b17f1bSmrg        ;;
739890b17f1bSmrg      aix[[4-9]]*)
739990b17f1bSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
740090b17f1bSmrg	  test "$enable_shared" = yes && enable_static=no
740190b17f1bSmrg	fi
740290b17f1bSmrg        ;;
740390b17f1bSmrg    esac
740490b17f1bSmrg    AC_MSG_RESULT([$enable_shared])
740590b17f1bSmrg
740690b17f1bSmrg    AC_MSG_CHECKING([whether to build static libraries])
740790b17f1bSmrg    # Make sure either enable_shared or enable_static is yes.
740890b17f1bSmrg    test "$enable_shared" = yes || enable_static=yes
740990b17f1bSmrg    AC_MSG_RESULT([$enable_static])
741090b17f1bSmrg
741190b17f1bSmrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
741290b17f1bSmrg    _LT_TAGVAR(LD, $1)="$LD"
741390b17f1bSmrg
741490b17f1bSmrg    ## CAVEAT EMPTOR:
741590b17f1bSmrg    ## There is no encapsulation within the following macros, do not change
741690b17f1bSmrg    ## the running order or otherwise move them around unless you know exactly
741790b17f1bSmrg    ## what you are doing...
741890b17f1bSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
741990b17f1bSmrg    _LT_COMPILER_PIC($1)
742090b17f1bSmrg    _LT_COMPILER_C_O($1)
742190b17f1bSmrg    _LT_COMPILER_FILE_LOCKS($1)
742290b17f1bSmrg    _LT_LINKER_SHLIBS($1)
742390b17f1bSmrg    _LT_SYS_DYNAMIC_LINKER($1)
742490b17f1bSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
742590b17f1bSmrg
742690b17f1bSmrg    _LT_CONFIG($1)
742790b17f1bSmrg  fi # test -n "$compiler"
742890b17f1bSmrg
742990b17f1bSmrg  GCC=$lt_save_GCC
743090b17f1bSmrg  CC=$lt_save_CC
743190b17f1bSmrg  CFLAGS=$lt_save_CFLAGS
743290b17f1bSmrgfi # test "$_lt_disable_FC" != yes
743390b17f1bSmrg
743490b17f1bSmrgAC_LANG_POP
743590b17f1bSmrg])# _LT_LANG_FC_CONFIG
743690b17f1bSmrg
743790b17f1bSmrg
743890b17f1bSmrg# _LT_LANG_GCJ_CONFIG([TAG])
743990b17f1bSmrg# --------------------------
744090b17f1bSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
744190b17f1bSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
744290b17f1bSmrg# to write the compiler configuration to `libtool'.
744390b17f1bSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
744490b17f1bSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
744590b17f1bSmrgAC_LANG_SAVE
744690b17f1bSmrg
744790b17f1bSmrg# Source file extension for Java test sources.
744890b17f1bSmrgac_ext=java
744990b17f1bSmrg
745090b17f1bSmrg# Object file extension for compiled Java test sources.
745190b17f1bSmrgobjext=o
745290b17f1bSmrg_LT_TAGVAR(objext, $1)=$objext
745390b17f1bSmrg
745490b17f1bSmrg# Code to be used in simple compile tests
745590b17f1bSmrglt_simple_compile_test_code="class foo {}"
745690b17f1bSmrg
745790b17f1bSmrg# Code to be used in simple link tests
745890b17f1bSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
745990b17f1bSmrg
746090b17f1bSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
746190b17f1bSmrg_LT_TAG_COMPILER
746290b17f1bSmrg
746390b17f1bSmrg# save warnings/boilerplate of simple test code
746490b17f1bSmrg_LT_COMPILER_BOILERPLATE
746590b17f1bSmrg_LT_LINKER_BOILERPLATE
746690b17f1bSmrg
746790b17f1bSmrg# Allow CC to be a program name with arguments.
746890b17f1bSmrglt_save_CC=$CC
746990b17f1bSmrglt_save_CFLAGS=$CFLAGS
747090b17f1bSmrglt_save_GCC=$GCC
747190b17f1bSmrgGCC=yes
747290b17f1bSmrgCC=${GCJ-"gcj"}
747390b17f1bSmrgCFLAGS=$GCJFLAGS
747490b17f1bSmrgcompiler=$CC
747590b17f1bSmrg_LT_TAGVAR(compiler, $1)=$CC
747690b17f1bSmrg_LT_TAGVAR(LD, $1)="$LD"
747790b17f1bSmrg_LT_CC_BASENAME([$compiler])
747890b17f1bSmrg
747990b17f1bSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
748090b17f1bSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
748190b17f1bSmrg
748290b17f1bSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
748390b17f1bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
748490b17f1bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
748590b17f1bSmrg
748690b17f1bSmrgif test -n "$compiler"; then
748790b17f1bSmrg  _LT_COMPILER_NO_RTTI($1)
748890b17f1bSmrg  _LT_COMPILER_PIC($1)
748990b17f1bSmrg  _LT_COMPILER_C_O($1)
749090b17f1bSmrg  _LT_COMPILER_FILE_LOCKS($1)
749190b17f1bSmrg  _LT_LINKER_SHLIBS($1)
749290b17f1bSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
749390b17f1bSmrg
749490b17f1bSmrg  _LT_CONFIG($1)
749590b17f1bSmrgfi
749690b17f1bSmrg
749790b17f1bSmrgAC_LANG_RESTORE
749890b17f1bSmrg
749990b17f1bSmrgGCC=$lt_save_GCC
750090b17f1bSmrgCC=$lt_save_CC
750190b17f1bSmrgCFLAGS=$lt_save_CFLAGS
750290b17f1bSmrg])# _LT_LANG_GCJ_CONFIG
750390b17f1bSmrg
750490b17f1bSmrg
750590b17f1bSmrg# _LT_LANG_GO_CONFIG([TAG])
750690b17f1bSmrg# --------------------------
750790b17f1bSmrg# Ensure that the configuration variables for the GNU Go compiler
750890b17f1bSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
750990b17f1bSmrg# to write the compiler configuration to `libtool'.
751090b17f1bSmrgm4_defun([_LT_LANG_GO_CONFIG],
751190b17f1bSmrg[AC_REQUIRE([LT_PROG_GO])dnl
751290b17f1bSmrgAC_LANG_SAVE
751390b17f1bSmrg
751490b17f1bSmrg# Source file extension for Go test sources.
751590b17f1bSmrgac_ext=go
751690b17f1bSmrg
751790b17f1bSmrg# Object file extension for compiled Go test sources.
751890b17f1bSmrgobjext=o
751990b17f1bSmrg_LT_TAGVAR(objext, $1)=$objext
752090b17f1bSmrg
752190b17f1bSmrg# Code to be used in simple compile tests
752290b17f1bSmrglt_simple_compile_test_code="package main; func main() { }"
752390b17f1bSmrg
752490b17f1bSmrg# Code to be used in simple link tests
752590b17f1bSmrglt_simple_link_test_code='package main; func main() { }'
752690b17f1bSmrg
752790b17f1bSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
752890b17f1bSmrg_LT_TAG_COMPILER
752990b17f1bSmrg
753090b17f1bSmrg# save warnings/boilerplate of simple test code
753190b17f1bSmrg_LT_COMPILER_BOILERPLATE
753290b17f1bSmrg_LT_LINKER_BOILERPLATE
753390b17f1bSmrg
753490b17f1bSmrg# Allow CC to be a program name with arguments.
753590b17f1bSmrglt_save_CC=$CC
753690b17f1bSmrglt_save_CFLAGS=$CFLAGS
753790b17f1bSmrglt_save_GCC=$GCC
753890b17f1bSmrgGCC=yes
753990b17f1bSmrgCC=${GOC-"gccgo"}
754090b17f1bSmrgCFLAGS=$GOFLAGS
754190b17f1bSmrgcompiler=$CC
754290b17f1bSmrg_LT_TAGVAR(compiler, $1)=$CC
754390b17f1bSmrg_LT_TAGVAR(LD, $1)="$LD"
754490b17f1bSmrg_LT_CC_BASENAME([$compiler])
754590b17f1bSmrg
754690b17f1bSmrg# Go did not exist at the time GCC didn't implicitly link libc in.
754790b17f1bSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
754890b17f1bSmrg
754990b17f1bSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
755090b17f1bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
755190b17f1bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
755290b17f1bSmrg
755390b17f1bSmrgif test -n "$compiler"; then
755490b17f1bSmrg  _LT_COMPILER_NO_RTTI($1)
755590b17f1bSmrg  _LT_COMPILER_PIC($1)
755690b17f1bSmrg  _LT_COMPILER_C_O($1)
755790b17f1bSmrg  _LT_COMPILER_FILE_LOCKS($1)
755890b17f1bSmrg  _LT_LINKER_SHLIBS($1)
755990b17f1bSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
756090b17f1bSmrg
756190b17f1bSmrg  _LT_CONFIG($1)
756290b17f1bSmrgfi
756390b17f1bSmrg
756490b17f1bSmrgAC_LANG_RESTORE
756590b17f1bSmrg
756690b17f1bSmrgGCC=$lt_save_GCC
756790b17f1bSmrgCC=$lt_save_CC
756890b17f1bSmrgCFLAGS=$lt_save_CFLAGS
756990b17f1bSmrg])# _LT_LANG_GO_CONFIG
757090b17f1bSmrg
757190b17f1bSmrg
757290b17f1bSmrg# _LT_LANG_RC_CONFIG([TAG])
757390b17f1bSmrg# -------------------------
757490b17f1bSmrg# Ensure that the configuration variables for the Windows resource compiler
757590b17f1bSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
757690b17f1bSmrg# to write the compiler configuration to `libtool'.
757790b17f1bSmrgm4_defun([_LT_LANG_RC_CONFIG],
757890b17f1bSmrg[AC_REQUIRE([LT_PROG_RC])dnl
757990b17f1bSmrgAC_LANG_SAVE
758090b17f1bSmrg
758190b17f1bSmrg# Source file extension for RC test sources.
758290b17f1bSmrgac_ext=rc
758390b17f1bSmrg
758490b17f1bSmrg# Object file extension for compiled RC test sources.
758590b17f1bSmrgobjext=o
758690b17f1bSmrg_LT_TAGVAR(objext, $1)=$objext
758790b17f1bSmrg
758890b17f1bSmrg# Code to be used in simple compile tests
758990b17f1bSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
759090b17f1bSmrg
759190b17f1bSmrg# Code to be used in simple link tests
759290b17f1bSmrglt_simple_link_test_code="$lt_simple_compile_test_code"
759390b17f1bSmrg
759490b17f1bSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
759590b17f1bSmrg_LT_TAG_COMPILER
759690b17f1bSmrg
759790b17f1bSmrg# save warnings/boilerplate of simple test code
759890b17f1bSmrg_LT_COMPILER_BOILERPLATE
759990b17f1bSmrg_LT_LINKER_BOILERPLATE
760090b17f1bSmrg
760190b17f1bSmrg# Allow CC to be a program name with arguments.
760290b17f1bSmrglt_save_CC="$CC"
760390b17f1bSmrglt_save_CFLAGS=$CFLAGS
760490b17f1bSmrglt_save_GCC=$GCC
760590b17f1bSmrgGCC=
760690b17f1bSmrgCC=${RC-"windres"}
760790b17f1bSmrgCFLAGS=
760890b17f1bSmrgcompiler=$CC
760990b17f1bSmrg_LT_TAGVAR(compiler, $1)=$CC
761090b17f1bSmrg_LT_CC_BASENAME([$compiler])
761190b17f1bSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
761290b17f1bSmrg
761390b17f1bSmrgif test -n "$compiler"; then
761490b17f1bSmrg  :
761590b17f1bSmrg  _LT_CONFIG($1)
761690b17f1bSmrgfi
761790b17f1bSmrg
761890b17f1bSmrgGCC=$lt_save_GCC
761990b17f1bSmrgAC_LANG_RESTORE
762090b17f1bSmrgCC=$lt_save_CC
762190b17f1bSmrgCFLAGS=$lt_save_CFLAGS
762290b17f1bSmrg])# _LT_LANG_RC_CONFIG
762390b17f1bSmrg
762490b17f1bSmrg
762590b17f1bSmrg# LT_PROG_GCJ
762690b17f1bSmrg# -----------
762790b17f1bSmrgAC_DEFUN([LT_PROG_GCJ],
762890b17f1bSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
762990b17f1bSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
763090b17f1bSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
763190b17f1bSmrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
763290b17f1bSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
763390b17f1bSmrg])
763490b17f1bSmrg
763590b17f1bSmrg# Old name:
763690b17f1bSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
763790b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
763890b17f1bSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
763990b17f1bSmrg
764090b17f1bSmrg
764190b17f1bSmrg# LT_PROG_GO
764290b17f1bSmrg# ----------
764390b17f1bSmrgAC_DEFUN([LT_PROG_GO],
764490b17f1bSmrg[AC_CHECK_TOOL(GOC, gccgo,)
764590b17f1bSmrg])
764690b17f1bSmrg
764790b17f1bSmrg
764890b17f1bSmrg# LT_PROG_RC
764990b17f1bSmrg# ----------
765090b17f1bSmrgAC_DEFUN([LT_PROG_RC],
765190b17f1bSmrg[AC_CHECK_TOOL(RC, windres,)
765290b17f1bSmrg])
765390b17f1bSmrg
765490b17f1bSmrg# Old name:
765590b17f1bSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
765690b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
765790b17f1bSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
765890b17f1bSmrg
765990b17f1bSmrg
766090b17f1bSmrg# _LT_DECL_EGREP
766190b17f1bSmrg# --------------
766290b17f1bSmrg# If we don't have a new enough Autoconf to choose the best grep
766390b17f1bSmrg# available, choose the one first in the user's PATH.
766490b17f1bSmrgm4_defun([_LT_DECL_EGREP],
766590b17f1bSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
766690b17f1bSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
766790b17f1bSmrgtest -z "$GREP" && GREP=grep
766890b17f1bSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
766990b17f1bSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
767090b17f1bSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
767190b17f1bSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
767290b17f1bSmrgAC_SUBST([GREP])
767390b17f1bSmrg])
767490b17f1bSmrg
767590b17f1bSmrg
767690b17f1bSmrg# _LT_DECL_OBJDUMP
767790b17f1bSmrg# --------------
767890b17f1bSmrg# If we don't have a new enough Autoconf to choose the best objdump
767990b17f1bSmrg# available, choose the one first in the user's PATH.
768090b17f1bSmrgm4_defun([_LT_DECL_OBJDUMP],
768190b17f1bSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
768290b17f1bSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
768390b17f1bSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
768490b17f1bSmrgAC_SUBST([OBJDUMP])
768590b17f1bSmrg])
768690b17f1bSmrg
768790b17f1bSmrg# _LT_DECL_DLLTOOL
768890b17f1bSmrg# ----------------
768990b17f1bSmrg# Ensure DLLTOOL variable is set.
769090b17f1bSmrgm4_defun([_LT_DECL_DLLTOOL],
769190b17f1bSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
769290b17f1bSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
769390b17f1bSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
769490b17f1bSmrgAC_SUBST([DLLTOOL])
769590b17f1bSmrg])
769690b17f1bSmrg
769790b17f1bSmrg# _LT_DECL_SED
769890b17f1bSmrg# ------------
769990b17f1bSmrg# Check for a fully-functional sed program, that truncates
770090b17f1bSmrg# as few characters as possible.  Prefer GNU sed if found.
770190b17f1bSmrgm4_defun([_LT_DECL_SED],
770290b17f1bSmrg[AC_PROG_SED
770390b17f1bSmrgtest -z "$SED" && SED=sed
770490b17f1bSmrgXsed="$SED -e 1s/^X//"
770590b17f1bSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
770690b17f1bSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
770790b17f1bSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
770890b17f1bSmrg])# _LT_DECL_SED
770990b17f1bSmrg
771090b17f1bSmrgm4_ifndef([AC_PROG_SED], [
771190b17f1bSmrg# NOTE: This macro has been submitted for inclusion into   #
771290b17f1bSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
771390b17f1bSmrg#  a released version of Autoconf we should remove this    #
771490b17f1bSmrg#  macro and use it instead.                               #
771590b17f1bSmrg
771690b17f1bSmrgm4_defun([AC_PROG_SED],
771790b17f1bSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
771890b17f1bSmrgAC_CACHE_VAL(lt_cv_path_SED,
771990b17f1bSmrg[# Loop through the user's path and test for sed and gsed.
772090b17f1bSmrg# Then use that list of sed's as ones to test for truncation.
772190b17f1bSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
772290b17f1bSmrgfor as_dir in $PATH
772390b17f1bSmrgdo
772490b17f1bSmrg  IFS=$as_save_IFS
772590b17f1bSmrg  test -z "$as_dir" && as_dir=.
772690b17f1bSmrg  for lt_ac_prog in sed gsed; do
772790b17f1bSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
772890b17f1bSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
772990b17f1bSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
77307e6fb56fSmrg      fi
773190b17f1bSmrg    done
773290b17f1bSmrg  done
773390b17f1bSmrgdone
773490b17f1bSmrgIFS=$as_save_IFS
773590b17f1bSmrglt_ac_max=0
773690b17f1bSmrglt_ac_count=0
773790b17f1bSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
773890b17f1bSmrg# along with /bin/sed that truncates output.
773990b17f1bSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
774090b17f1bSmrg  test ! -f $lt_ac_sed && continue
774190b17f1bSmrg  cat /dev/null > conftest.in
774290b17f1bSmrg  lt_ac_count=0
774390b17f1bSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
774490b17f1bSmrg  # Check for GNU sed and select it if it is found.
774590b17f1bSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
774690b17f1bSmrg    lt_cv_path_SED=$lt_ac_sed
774790b17f1bSmrg    break
774890b17f1bSmrg  fi
774990b17f1bSmrg  while true; do
775090b17f1bSmrg    cat conftest.in conftest.in >conftest.tmp
775190b17f1bSmrg    mv conftest.tmp conftest.in
775290b17f1bSmrg    cp conftest.in conftest.nl
775390b17f1bSmrg    echo >>conftest.nl
775490b17f1bSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
775590b17f1bSmrg    cmp -s conftest.out conftest.nl || break
775690b17f1bSmrg    # 10000 chars as input seems more than enough
775790b17f1bSmrg    test $lt_ac_count -gt 10 && break
775890b17f1bSmrg    lt_ac_count=`expr $lt_ac_count + 1`
775990b17f1bSmrg    if test $lt_ac_count -gt $lt_ac_max; then
776090b17f1bSmrg      lt_ac_max=$lt_ac_count
776190b17f1bSmrg      lt_cv_path_SED=$lt_ac_sed
776290b17f1bSmrg    fi
776390b17f1bSmrg  done
776490b17f1bSmrgdone
776590b17f1bSmrg])
776690b17f1bSmrgSED=$lt_cv_path_SED
776790b17f1bSmrgAC_SUBST([SED])
776890b17f1bSmrgAC_MSG_RESULT([$SED])
776990b17f1bSmrg])#AC_PROG_SED
777090b17f1bSmrg])#m4_ifndef
77717e6fb56fSmrg
777290b17f1bSmrg# Old name:
777390b17f1bSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
777490b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
777590b17f1bSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
77767e6fb56fSmrg
77777e6fb56fSmrg
777890b17f1bSmrg# _LT_CHECK_SHELL_FEATURES
777990b17f1bSmrg# ------------------------
778090b17f1bSmrg# Find out whether the shell is Bourne or XSI compatible,
778190b17f1bSmrg# or has some other useful features.
778290b17f1bSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
778390b17f1bSmrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
778490b17f1bSmrg# Try some XSI features
778590b17f1bSmrgxsi_shell=no
778690b17f1bSmrg( _lt_dummy="a/b/c"
778790b17f1bSmrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
778890b17f1bSmrg      = c,a/b,b/c, \
778990b17f1bSmrg    && eval 'test $(( 1 + 1 )) -eq 2 \
779090b17f1bSmrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
779190b17f1bSmrg  && xsi_shell=yes
779290b17f1bSmrgAC_MSG_RESULT([$xsi_shell])
779390b17f1bSmrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
779490b17f1bSmrg
779590b17f1bSmrgAC_MSG_CHECKING([whether the shell understands "+="])
779690b17f1bSmrglt_shell_append=no
779790b17f1bSmrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
779890b17f1bSmrg    >/dev/null 2>&1 \
779990b17f1bSmrg  && lt_shell_append=yes
780090b17f1bSmrgAC_MSG_RESULT([$lt_shell_append])
780190b17f1bSmrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
780290b17f1bSmrg
780390b17f1bSmrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
780490b17f1bSmrg  lt_unset=unset
780590b17f1bSmrgelse
780690b17f1bSmrg  lt_unset=false
780790b17f1bSmrgfi
780890b17f1bSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
780990b17f1bSmrg
781090b17f1bSmrg# test EBCDIC or ASCII
781190b17f1bSmrgcase `echo X|tr X '\101'` in
781290b17f1bSmrg A) # ASCII based system
781390b17f1bSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
781490b17f1bSmrg  lt_SP2NL='tr \040 \012'
781590b17f1bSmrg  lt_NL2SP='tr \015\012 \040\040'
781690b17f1bSmrg  ;;
781790b17f1bSmrg *) # EBCDIC based system
781890b17f1bSmrg  lt_SP2NL='tr \100 \n'
781990b17f1bSmrg  lt_NL2SP='tr \r\n \100\100'
782090b17f1bSmrg  ;;
782190b17f1bSmrgesac
782290b17f1bSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
782390b17f1bSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
782490b17f1bSmrg])# _LT_CHECK_SHELL_FEATURES
782590b17f1bSmrg
782690b17f1bSmrg
782790b17f1bSmrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
782890b17f1bSmrg# ------------------------------------------------------
782990b17f1bSmrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
783090b17f1bSmrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
783190b17f1bSmrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
783290b17f1bSmrg[dnl {
783390b17f1bSmrgsed -e '/^$1 ()$/,/^} # $1 /c\
783490b17f1bSmrg$1 ()\
783590b17f1bSmrg{\
783690b17f1bSmrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
783790b17f1bSmrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
783890b17f1bSmrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
783990b17f1bSmrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
784090b17f1bSmrgtest 0 -eq $? || _lt_function_replace_fail=:
784190b17f1bSmrg])
78427e6fb56fSmrg
78437e6fb56fSmrg
784490b17f1bSmrg# _LT_PROG_REPLACE_SHELLFNS
784590b17f1bSmrg# -------------------------
784690b17f1bSmrg# Replace existing portable implementations of several shell functions with
784790b17f1bSmrg# equivalent extended shell implementations where those features are available..
784890b17f1bSmrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
784990b17f1bSmrg[if test x"$xsi_shell" = xyes; then
785090b17f1bSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
785190b17f1bSmrg    case ${1} in
785290b17f1bSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
785390b17f1bSmrg      *  ) func_dirname_result="${3}" ;;
785490b17f1bSmrg    esac])
785590b17f1bSmrg
785690b17f1bSmrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
785790b17f1bSmrg    func_basename_result="${1##*/}"])
785890b17f1bSmrg
785990b17f1bSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
786090b17f1bSmrg    case ${1} in
786190b17f1bSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
786290b17f1bSmrg      *  ) func_dirname_result="${3}" ;;
786390b17f1bSmrg    esac
786490b17f1bSmrg    func_basename_result="${1##*/}"])
78657e6fb56fSmrg
786690b17f1bSmrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
786790b17f1bSmrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
786890b17f1bSmrg    # positional parameters, so assign one to ordinary parameter first.
786990b17f1bSmrg    func_stripname_result=${3}
787090b17f1bSmrg    func_stripname_result=${func_stripname_result#"${1}"}
787190b17f1bSmrg    func_stripname_result=${func_stripname_result%"${2}"}])
787290b17f1bSmrg
787390b17f1bSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
787490b17f1bSmrg    func_split_long_opt_name=${1%%=*}
787590b17f1bSmrg    func_split_long_opt_arg=${1#*=}])
787690b17f1bSmrg
787790b17f1bSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
787890b17f1bSmrg    func_split_short_opt_arg=${1#??}
787990b17f1bSmrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
788090b17f1bSmrg
788190b17f1bSmrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
788290b17f1bSmrg    case ${1} in
788390b17f1bSmrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
788490b17f1bSmrg      *)    func_lo2o_result=${1} ;;
788590b17f1bSmrg    esac])
788690b17f1bSmrg
788790b17f1bSmrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
788890b17f1bSmrg
788990b17f1bSmrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
789090b17f1bSmrg
789190b17f1bSmrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
789290b17f1bSmrgfi
789390b17f1bSmrg
789490b17f1bSmrgif test x"$lt_shell_append" = xyes; then
789590b17f1bSmrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
789690b17f1bSmrg
789790b17f1bSmrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
789890b17f1bSmrg    func_quote_for_eval "${2}"
789990b17f1bSmrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
790090b17f1bSmrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
790190b17f1bSmrg
790290b17f1bSmrg  # Save a `func_append' function call where possible by direct use of '+='
790390b17f1bSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
790490b17f1bSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
790590b17f1bSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
790690b17f1bSmrg  test 0 -eq $? || _lt_function_replace_fail=:
790790b17f1bSmrgelse
790890b17f1bSmrg  # Save a `func_append' function call even when '+=' is not available
790990b17f1bSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
791090b17f1bSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
791190b17f1bSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
791290b17f1bSmrg  test 0 -eq $? || _lt_function_replace_fail=:
791390b17f1bSmrgfi
791490b17f1bSmrg
791590b17f1bSmrgif test x"$_lt_function_replace_fail" = x":"; then
791690b17f1bSmrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
791790b17f1bSmrgfi
791890b17f1bSmrg])
791990b17f1bSmrg
792090b17f1bSmrg# _LT_PATH_CONVERSION_FUNCTIONS
792190b17f1bSmrg# -----------------------------
792290b17f1bSmrg# Determine which file name conversion functions should be used by
792390b17f1bSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
792490b17f1bSmrg# for certain cross-compile configurations and native mingw.
792590b17f1bSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
792690b17f1bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
792790b17f1bSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
792890b17f1bSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
792990b17f1bSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
793090b17f1bSmrg[case $host in
793190b17f1bSmrg  *-*-mingw* )
793290b17f1bSmrg    case $build in
793390b17f1bSmrg      *-*-mingw* ) # actually msys
793490b17f1bSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
793590b17f1bSmrg        ;;
793690b17f1bSmrg      *-*-cygwin* )
793790b17f1bSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
793890b17f1bSmrg        ;;
793990b17f1bSmrg      * ) # otherwise, assume *nix
794090b17f1bSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
794190b17f1bSmrg        ;;
794290b17f1bSmrg    esac
794390b17f1bSmrg    ;;
794490b17f1bSmrg  *-*-cygwin* )
794590b17f1bSmrg    case $build in
794690b17f1bSmrg      *-*-mingw* ) # actually msys
794790b17f1bSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
794890b17f1bSmrg        ;;
794990b17f1bSmrg      *-*-cygwin* )
795090b17f1bSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
795190b17f1bSmrg        ;;
795290b17f1bSmrg      * ) # otherwise, assume *nix
795390b17f1bSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
795490b17f1bSmrg        ;;
795590b17f1bSmrg    esac
795690b17f1bSmrg    ;;
795790b17f1bSmrg  * ) # unhandled hosts (and "normal" native builds)
795890b17f1bSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
795990b17f1bSmrg    ;;
796090b17f1bSmrgesac
796190b17f1bSmrg])
796290b17f1bSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
796390b17f1bSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
796490b17f1bSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
796590b17f1bSmrg         [0], [convert $build file names to $host format])dnl
796690b17f1bSmrg
796790b17f1bSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
796890b17f1bSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
796990b17f1bSmrg[#assume ordinary cross tools, or native build.
797090b17f1bSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
797190b17f1bSmrgcase $host in
797290b17f1bSmrg  *-*-mingw* )
797390b17f1bSmrg    case $build in
797490b17f1bSmrg      *-*-mingw* ) # actually msys
797590b17f1bSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
797690b17f1bSmrg        ;;
797790b17f1bSmrg    esac
797890b17f1bSmrg    ;;
797990b17f1bSmrgesac
798090b17f1bSmrg])
798190b17f1bSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
798290b17f1bSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
798390b17f1bSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
798490b17f1bSmrg         [0], [convert $build files to toolchain format])dnl
798590b17f1bSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
798690b17f1bSmrg
798790b17f1bSmrg# Helper functions for option handling.                    -*- Autoconf -*-
798890b17f1bSmrg#
798990b17f1bSmrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
799090b17f1bSmrg#   Inc.
799190b17f1bSmrg#   Written by Gary V. Vaughan, 2004
799290b17f1bSmrg#
799390b17f1bSmrg# This file is free software; the Free Software Foundation gives
799490b17f1bSmrg# unlimited permission to copy and/or distribute it, with or without
799590b17f1bSmrg# modifications, as long as this notice is preserved.
799690b17f1bSmrg
799790b17f1bSmrg# serial 7 ltoptions.m4
799890b17f1bSmrg
799990b17f1bSmrg# This is to help aclocal find these macros, as it can't see m4_define.
800090b17f1bSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
800190b17f1bSmrg
800290b17f1bSmrg
800390b17f1bSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
800490b17f1bSmrg# ------------------------------------------
800590b17f1bSmrgm4_define([_LT_MANGLE_OPTION],
800690b17f1bSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
800790b17f1bSmrg
800890b17f1bSmrg
800990b17f1bSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
801090b17f1bSmrg# ---------------------------------------
801190b17f1bSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
801290b17f1bSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
801390b17f1bSmrg# saved as a flag.
801490b17f1bSmrgm4_define([_LT_SET_OPTION],
801590b17f1bSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
801690b17f1bSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
801790b17f1bSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
801890b17f1bSmrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
801990b17f1bSmrg])
802090b17f1bSmrg
802190b17f1bSmrg
802290b17f1bSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
802390b17f1bSmrg# ------------------------------------------------------------
802490b17f1bSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
802590b17f1bSmrgm4_define([_LT_IF_OPTION],
802690b17f1bSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
802790b17f1bSmrg
802890b17f1bSmrg
802990b17f1bSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
803090b17f1bSmrg# -------------------------------------------------------
803190b17f1bSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
803290b17f1bSmrg# are set.
803390b17f1bSmrgm4_define([_LT_UNLESS_OPTIONS],
803490b17f1bSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
803590b17f1bSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
803690b17f1bSmrg		      [m4_define([$0_found])])])[]dnl
803790b17f1bSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
803890b17f1bSmrg])[]dnl
803990b17f1bSmrg])
804090b17f1bSmrg
804190b17f1bSmrg
804290b17f1bSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
804390b17f1bSmrg# ----------------------------------------
804490b17f1bSmrg# OPTION-LIST is a space-separated list of Libtool options associated
804590b17f1bSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
804690b17f1bSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
804790b17f1bSmrg# the unknown option and exit.
804890b17f1bSmrgm4_defun([_LT_SET_OPTIONS],
804990b17f1bSmrg[# Set options
805090b17f1bSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
805190b17f1bSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
805290b17f1bSmrg
805390b17f1bSmrgm4_if([$1],[LT_INIT],[
805490b17f1bSmrg  dnl
805590b17f1bSmrg  dnl Simply set some default values (i.e off) if boolean options were not
805690b17f1bSmrg  dnl specified:
805790b17f1bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
805890b17f1bSmrg  ])
805990b17f1bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
806090b17f1bSmrg  ])
806190b17f1bSmrg  dnl
806290b17f1bSmrg  dnl If no reference was made to various pairs of opposing options, then
806390b17f1bSmrg  dnl we run the default mode handler for the pair.  For example, if neither
806490b17f1bSmrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
806590b17f1bSmrg  dnl archives by default:
806690b17f1bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
806790b17f1bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
806890b17f1bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
806990b17f1bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
807090b17f1bSmrg  		   [_LT_ENABLE_FAST_INSTALL])
807190b17f1bSmrg  ])
807290b17f1bSmrg])# _LT_SET_OPTIONS
807390b17f1bSmrg
807490b17f1bSmrg
807590b17f1bSmrg
807690b17f1bSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
807790b17f1bSmrg# -----------------------------------------
807890b17f1bSmrgm4_define([_LT_MANGLE_DEFUN],
807990b17f1bSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
808090b17f1bSmrg
808190b17f1bSmrg
808290b17f1bSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
808390b17f1bSmrg# -----------------------------------------------
808490b17f1bSmrgm4_define([LT_OPTION_DEFINE],
808590b17f1bSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
808690b17f1bSmrg])# LT_OPTION_DEFINE
808790b17f1bSmrg
808890b17f1bSmrg
808990b17f1bSmrg# dlopen
809090b17f1bSmrg# ------
809190b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
809290b17f1bSmrg])
809390b17f1bSmrg
809490b17f1bSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
809590b17f1bSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
809690b17f1bSmrgAC_DIAGNOSE([obsolete],
809790b17f1bSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
809890b17f1bSmrgput the `dlopen' option into LT_INIT's first parameter.])
809990b17f1bSmrg])
810090b17f1bSmrg
810190b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
810290b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
810390b17f1bSmrg
810490b17f1bSmrg
810590b17f1bSmrg# win32-dll
810690b17f1bSmrg# ---------
810790b17f1bSmrg# Declare package support for building win32 dll's.
810890b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
810990b17f1bSmrg[enable_win32_dll=yes
811090b17f1bSmrg
811190b17f1bSmrgcase $host in
811290b17f1bSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
811390b17f1bSmrg  AC_CHECK_TOOL(AS, as, false)
811490b17f1bSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
811590b17f1bSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
811690b17f1bSmrg  ;;
811790b17f1bSmrgesac
811890b17f1bSmrg
811990b17f1bSmrgtest -z "$AS" && AS=as
812090b17f1bSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
812190b17f1bSmrg
812290b17f1bSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
812390b17f1bSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
812490b17f1bSmrg
812590b17f1bSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
812690b17f1bSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
812790b17f1bSmrg])# win32-dll
812890b17f1bSmrg
812990b17f1bSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
813090b17f1bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
813190b17f1bSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
813290b17f1bSmrgAC_DIAGNOSE([obsolete],
813390b17f1bSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
813490b17f1bSmrgput the `win32-dll' option into LT_INIT's first parameter.])
813590b17f1bSmrg])
813690b17f1bSmrg
813790b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
813890b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
813990b17f1bSmrg
814090b17f1bSmrg
814190b17f1bSmrg# _LT_ENABLE_SHARED([DEFAULT])
814290b17f1bSmrg# ----------------------------
814390b17f1bSmrg# implement the --enable-shared flag, and supports the `shared' and
814490b17f1bSmrg# `disable-shared' LT_INIT options.
814590b17f1bSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
814690b17f1bSmrgm4_define([_LT_ENABLE_SHARED],
814790b17f1bSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
814890b17f1bSmrgAC_ARG_ENABLE([shared],
814990b17f1bSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
815090b17f1bSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
815190b17f1bSmrg    [p=${PACKAGE-default}
815290b17f1bSmrg    case $enableval in
815390b17f1bSmrg    yes) enable_shared=yes ;;
815490b17f1bSmrg    no) enable_shared=no ;;
815590b17f1bSmrg    *)
81567e6fb56fSmrg      enable_shared=no
815790b17f1bSmrg      # Look at the argument we got.  We use all the common list separators.
815890b17f1bSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
815990b17f1bSmrg      for pkg in $enableval; do
816090b17f1bSmrg	IFS="$lt_save_ifs"
816190b17f1bSmrg	if test "X$pkg" = "X$p"; then
816290b17f1bSmrg	  enable_shared=yes
816390b17f1bSmrg	fi
816490b17f1bSmrg      done
816590b17f1bSmrg      IFS="$lt_save_ifs"
81667e6fb56fSmrg      ;;
816790b17f1bSmrg    esac],
816890b17f1bSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
81697e6fb56fSmrg
817090b17f1bSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
817190b17f1bSmrg	[Whether or not to build shared libraries])
817290b17f1bSmrg])# _LT_ENABLE_SHARED
81737e6fb56fSmrg
817490b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
817590b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
817690b17f1bSmrg
817790b17f1bSmrg# Old names:
817890b17f1bSmrgAC_DEFUN([AC_ENABLE_SHARED],
817990b17f1bSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
818090b17f1bSmrg])
818190b17f1bSmrg
818290b17f1bSmrgAC_DEFUN([AC_DISABLE_SHARED],
818390b17f1bSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
818490b17f1bSmrg])
818590b17f1bSmrg
818690b17f1bSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
818790b17f1bSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
818890b17f1bSmrg
818990b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
819090b17f1bSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
819190b17f1bSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
81927e6fb56fSmrg
819390b17f1bSmrg
819490b17f1bSmrg
819590b17f1bSmrg# _LT_ENABLE_STATIC([DEFAULT])
819690b17f1bSmrg# ----------------------------
819790b17f1bSmrg# implement the --enable-static flag, and support the `static' and
819890b17f1bSmrg# `disable-static' LT_INIT options.
819990b17f1bSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
820090b17f1bSmrgm4_define([_LT_ENABLE_STATIC],
820190b17f1bSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
820290b17f1bSmrgAC_ARG_ENABLE([static],
820390b17f1bSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
820490b17f1bSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
820590b17f1bSmrg    [p=${PACKAGE-default}
820690b17f1bSmrg    case $enableval in
820790b17f1bSmrg    yes) enable_static=yes ;;
820890b17f1bSmrg    no) enable_static=no ;;
82097e6fb56fSmrg    *)
821090b17f1bSmrg     enable_static=no
821190b17f1bSmrg      # Look at the argument we got.  We use all the common list separators.
821290b17f1bSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
821390b17f1bSmrg      for pkg in $enableval; do
821490b17f1bSmrg	IFS="$lt_save_ifs"
821590b17f1bSmrg	if test "X$pkg" = "X$p"; then
821690b17f1bSmrg	  enable_static=yes
821790b17f1bSmrg	fi
821890b17f1bSmrg      done
821990b17f1bSmrg      IFS="$lt_save_ifs"
82207e6fb56fSmrg      ;;
822190b17f1bSmrg    esac],
822290b17f1bSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
82237e6fb56fSmrg
822490b17f1bSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
822590b17f1bSmrg	[Whether or not to build static libraries])
822690b17f1bSmrg])# _LT_ENABLE_STATIC
82277e6fb56fSmrg
822890b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
822990b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
82307e6fb56fSmrg
823190b17f1bSmrg# Old names:
823290b17f1bSmrgAC_DEFUN([AC_ENABLE_STATIC],
823390b17f1bSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
823490b17f1bSmrg])
82357e6fb56fSmrg
823690b17f1bSmrgAC_DEFUN([AC_DISABLE_STATIC],
823790b17f1bSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
823890b17f1bSmrg])
82397e6fb56fSmrg
824090b17f1bSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
824190b17f1bSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
82427e6fb56fSmrg
824390b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
824490b17f1bSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
824590b17f1bSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
82467e6fb56fSmrg
82477e6fb56fSmrg
82487e6fb56fSmrg
824990b17f1bSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
825090b17f1bSmrg# ----------------------------------
825190b17f1bSmrg# implement the --enable-fast-install flag, and support the `fast-install'
825290b17f1bSmrg# and `disable-fast-install' LT_INIT options.
825390b17f1bSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
825490b17f1bSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
825590b17f1bSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
825690b17f1bSmrgAC_ARG_ENABLE([fast-install],
825790b17f1bSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
825890b17f1bSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
825990b17f1bSmrg    [p=${PACKAGE-default}
826090b17f1bSmrg    case $enableval in
826190b17f1bSmrg    yes) enable_fast_install=yes ;;
826290b17f1bSmrg    no) enable_fast_install=no ;;
826390b17f1bSmrg    *)
826490b17f1bSmrg      enable_fast_install=no
826590b17f1bSmrg      # Look at the argument we got.  We use all the common list separators.
826690b17f1bSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
826790b17f1bSmrg      for pkg in $enableval; do
826890b17f1bSmrg	IFS="$lt_save_ifs"
826990b17f1bSmrg	if test "X$pkg" = "X$p"; then
827090b17f1bSmrg	  enable_fast_install=yes
827190b17f1bSmrg	fi
827290b17f1bSmrg      done
827390b17f1bSmrg      IFS="$lt_save_ifs"
82747e6fb56fSmrg      ;;
827590b17f1bSmrg    esac],
827690b17f1bSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
82777e6fb56fSmrg
827890b17f1bSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
827990b17f1bSmrg	 [Whether or not to optimize for fast installation])dnl
828090b17f1bSmrg])# _LT_ENABLE_FAST_INSTALL
82817e6fb56fSmrg
828290b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
828390b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
82847e6fb56fSmrg
828590b17f1bSmrg# Old names:
828690b17f1bSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
828790b17f1bSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
828890b17f1bSmrgAC_DIAGNOSE([obsolete],
828990b17f1bSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
829090b17f1bSmrgthe `fast-install' option into LT_INIT's first parameter.])
829190b17f1bSmrg])
82927e6fb56fSmrg
829390b17f1bSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
829490b17f1bSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
829590b17f1bSmrgAC_DIAGNOSE([obsolete],
829690b17f1bSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
829790b17f1bSmrgthe `disable-fast-install' option into LT_INIT's first parameter.])
829890b17f1bSmrg])
829990b17f1bSmrg
830090b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
830190b17f1bSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
830290b17f1bSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
83037e6fb56fSmrg
83047e6fb56fSmrg
830590b17f1bSmrg# _LT_WITH_PIC([MODE])
830690b17f1bSmrg# --------------------
830790b17f1bSmrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
830890b17f1bSmrg# LT_INIT options.
830990b17f1bSmrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
831090b17f1bSmrgm4_define([_LT_WITH_PIC],
831190b17f1bSmrg[AC_ARG_WITH([pic],
831290b17f1bSmrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
831390b17f1bSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
831490b17f1bSmrg    [lt_p=${PACKAGE-default}
831590b17f1bSmrg    case $withval in
831690b17f1bSmrg    yes|no) pic_mode=$withval ;;
83177e6fb56fSmrg    *)
831890b17f1bSmrg      pic_mode=default
831990b17f1bSmrg      # Look at the argument we got.  We use all the common list separators.
832090b17f1bSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
832190b17f1bSmrg      for lt_pkg in $withval; do
832290b17f1bSmrg	IFS="$lt_save_ifs"
832390b17f1bSmrg	if test "X$lt_pkg" = "X$lt_p"; then
832490b17f1bSmrg	  pic_mode=yes
832590b17f1bSmrg	fi
832690b17f1bSmrg      done
832790b17f1bSmrg      IFS="$lt_save_ifs"
83287e6fb56fSmrg      ;;
832990b17f1bSmrg    esac],
833090b17f1bSmrg    [pic_mode=default])
833190b17f1bSmrg
833290b17f1bSmrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
833390b17f1bSmrg
833490b17f1bSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
833590b17f1bSmrg])# _LT_WITH_PIC
833690b17f1bSmrg
833790b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
833890b17f1bSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
833990b17f1bSmrg
834090b17f1bSmrg# Old name:
834190b17f1bSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
834290b17f1bSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
834390b17f1bSmrgAC_DIAGNOSE([obsolete],
834490b17f1bSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
834590b17f1bSmrgput the `pic-only' option into LT_INIT's first parameter.])
83467e6fb56fSmrg])
83477e6fb56fSmrg
834890b17f1bSmrgdnl aclocal-1.4 backwards compatibility:
834990b17f1bSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
835090b17f1bSmrg
835190b17f1bSmrg
835290b17f1bSmrgm4_define([_LTDL_MODE], [])
835390b17f1bSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
835490b17f1bSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
835590b17f1bSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
835690b17f1bSmrg		 [m4_define([_LTDL_MODE], [recursive])])
835790b17f1bSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
835890b17f1bSmrg		 [m4_define([_LTDL_MODE], [subproject])])
835990b17f1bSmrg
836090b17f1bSmrgm4_define([_LTDL_TYPE], [])
836190b17f1bSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
836290b17f1bSmrg		 [m4_define([_LTDL_TYPE], [installable])])
836390b17f1bSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
836490b17f1bSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
836590b17f1bSmrg
836690b17f1bSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
83677e6fb56fSmrg#
836890b17f1bSmrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
836990b17f1bSmrg# Written by Gary V. Vaughan, 2004
83707e6fb56fSmrg#
837190b17f1bSmrg# This file is free software; the Free Software Foundation gives
837290b17f1bSmrg# unlimited permission to copy and/or distribute it, with or without
837390b17f1bSmrg# modifications, as long as this notice is preserved.
83747e6fb56fSmrg
837590b17f1bSmrg# serial 6 ltsugar.m4
837690b17f1bSmrg
837790b17f1bSmrg# This is to help aclocal find these macros, as it can't see m4_define.
837890b17f1bSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
837990b17f1bSmrg
838090b17f1bSmrg
838190b17f1bSmrg# lt_join(SEP, ARG1, [ARG2...])
838290b17f1bSmrg# -----------------------------
838390b17f1bSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
838490b17f1bSmrg# associated separator.
838590b17f1bSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
838690b17f1bSmrg# versions in m4sugar had bugs.
838790b17f1bSmrgm4_define([lt_join],
838890b17f1bSmrg[m4_if([$#], [1], [],
838990b17f1bSmrg       [$#], [2], [[$2]],
839090b17f1bSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
839190b17f1bSmrgm4_define([_lt_join],
839290b17f1bSmrg[m4_if([$#$2], [2], [],
839390b17f1bSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
839490b17f1bSmrg
839590b17f1bSmrg
839690b17f1bSmrg# lt_car(LIST)
839790b17f1bSmrg# lt_cdr(LIST)
839890b17f1bSmrg# ------------
839990b17f1bSmrg# Manipulate m4 lists.
840090b17f1bSmrg# These macros are necessary as long as will still need to support
840190b17f1bSmrg# Autoconf-2.59 which quotes differently.
840290b17f1bSmrgm4_define([lt_car], [[$1]])
840390b17f1bSmrgm4_define([lt_cdr],
840490b17f1bSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
840590b17f1bSmrg       [$#], 1, [],
840690b17f1bSmrg       [m4_dquote(m4_shift($@))])])
840790b17f1bSmrgm4_define([lt_unquote], $1)
840890b17f1bSmrg
840990b17f1bSmrg
841090b17f1bSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
841190b17f1bSmrg# ------------------------------------------
841290b17f1bSmrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
841390b17f1bSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
841490b17f1bSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
841590b17f1bSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
841690b17f1bSmrg# than defined and empty).
84177e6fb56fSmrg#
841890b17f1bSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
841990b17f1bSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
842090b17f1bSmrgm4_define([lt_append],
842190b17f1bSmrg[m4_define([$1],
842290b17f1bSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
842390b17f1bSmrg
842490b17f1bSmrg
842590b17f1bSmrg
842690b17f1bSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
842790b17f1bSmrg# ----------------------------------------------------------
842890b17f1bSmrg# Produce a SEP delimited list of all paired combinations of elements of
842990b17f1bSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
843090b17f1bSmrg# has the form PREFIXmINFIXSUFFIXn.
843190b17f1bSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
843290b17f1bSmrgm4_define([lt_combine],
843390b17f1bSmrg[m4_if(m4_eval([$# > 3]), [1],
843490b17f1bSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
843590b17f1bSmrg[[m4_foreach([_Lt_prefix], [$2],
843690b17f1bSmrg	     [m4_foreach([_Lt_suffix],
843790b17f1bSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
843890b17f1bSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
843990b17f1bSmrg
844090b17f1bSmrg
844190b17f1bSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
844290b17f1bSmrg# -----------------------------------------------------------------------
844390b17f1bSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
844490b17f1bSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
844590b17f1bSmrgm4_define([lt_if_append_uniq],
844690b17f1bSmrg[m4_ifdef([$1],
844790b17f1bSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
844890b17f1bSmrg		 [lt_append([$1], [$2], [$3])$4],
844990b17f1bSmrg		 [$5])],
845090b17f1bSmrg	  [lt_append([$1], [$2], [$3])$4])])
845190b17f1bSmrg
845290b17f1bSmrg
845390b17f1bSmrg# lt_dict_add(DICT, KEY, VALUE)
845490b17f1bSmrg# -----------------------------
845590b17f1bSmrgm4_define([lt_dict_add],
845690b17f1bSmrg[m4_define([$1($2)], [$3])])
84577e6fb56fSmrg
84587e6fb56fSmrg
845990b17f1bSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
846090b17f1bSmrg# --------------------------------------------
846190b17f1bSmrgm4_define([lt_dict_add_subkey],
846290b17f1bSmrg[m4_define([$1($2:$3)], [$4])])
84637e6fb56fSmrg
84647e6fb56fSmrg
846590b17f1bSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
846690b17f1bSmrg# ----------------------------------
846790b17f1bSmrgm4_define([lt_dict_fetch],
846890b17f1bSmrg[m4_ifval([$3],
846990b17f1bSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
847090b17f1bSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
84717e6fb56fSmrg
84727e6fb56fSmrg
847390b17f1bSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
847490b17f1bSmrg# -----------------------------------------------------------------
847590b17f1bSmrgm4_define([lt_if_dict_fetch],
847690b17f1bSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
847790b17f1bSmrg	[$5],
847890b17f1bSmrg    [$6])])
84797e6fb56fSmrg
84807e6fb56fSmrg
848190b17f1bSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
848290b17f1bSmrg# --------------------------------------------------------------
848390b17f1bSmrgm4_define([lt_dict_filter],
848490b17f1bSmrg[m4_if([$5], [], [],
848590b17f1bSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
848690b17f1bSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
848790b17f1bSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
848890b17f1bSmrg])
84897e6fb56fSmrg
849090b17f1bSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
849190b17f1bSmrg#
849290b17f1bSmrg#   Copyright (C) 2004 Free Software Foundation, Inc.
849390b17f1bSmrg#   Written by Scott James Remnant, 2004
849490b17f1bSmrg#
849590b17f1bSmrg# This file is free software; the Free Software Foundation gives
849690b17f1bSmrg# unlimited permission to copy and/or distribute it, with or without
849790b17f1bSmrg# modifications, as long as this notice is preserved.
84987e6fb56fSmrg
849990b17f1bSmrg# @configure_input@
850090b17f1bSmrg
850190b17f1bSmrg# serial 3337 ltversion.m4
850290b17f1bSmrg# This file is part of GNU Libtool
850390b17f1bSmrg
850490b17f1bSmrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
850590b17f1bSmrgm4_define([LT_PACKAGE_REVISION], [1.3337])
850690b17f1bSmrg
850790b17f1bSmrgAC_DEFUN([LTVERSION_VERSION],
850890b17f1bSmrg[macro_version='2.4.2'
850990b17f1bSmrgmacro_revision='1.3337'
851090b17f1bSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
851190b17f1bSmrg_LT_DECL(, macro_revision, 0)
851290b17f1bSmrg])
851390b17f1bSmrg
851490b17f1bSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
851590b17f1bSmrg#
851690b17f1bSmrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
851790b17f1bSmrg#   Written by Scott James Remnant, 2004.
851890b17f1bSmrg#
851990b17f1bSmrg# This file is free software; the Free Software Foundation gives
852090b17f1bSmrg# unlimited permission to copy and/or distribute it, with or without
852190b17f1bSmrg# modifications, as long as this notice is preserved.
852290b17f1bSmrg
852390b17f1bSmrg# serial 5 lt~obsolete.m4
852490b17f1bSmrg
852590b17f1bSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
852690b17f1bSmrg#
852790b17f1bSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
852890b17f1bSmrg# which have later been changed to m4_define as they aren't part of the
852990b17f1bSmrg# exported API, or moved to Autoconf or Automake where they belong.
853090b17f1bSmrg#
853190b17f1bSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
853290b17f1bSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
853390b17f1bSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
853490b17f1bSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
853590b17f1bSmrg# and doesn't know about Autoconf macros at all.)
853690b17f1bSmrg#
853790b17f1bSmrg# So we provide this file, which has a silly filename so it's always
853890b17f1bSmrg# included after everything else.  This provides aclocal with the
853990b17f1bSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
854090b17f1bSmrg# because those macros already exist, or will be overwritten later.
854190b17f1bSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
854290b17f1bSmrg#
854390b17f1bSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
854490b17f1bSmrg# Yes, that means every name once taken will need to remain here until
854590b17f1bSmrg# we give up compatibility with versions before 1.7, at which point
854690b17f1bSmrg# we need to keep only those names which we still refer to.
854790b17f1bSmrg
854890b17f1bSmrg# This is to help aclocal find these macros, as it can't see m4_define.
854990b17f1bSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
855090b17f1bSmrg
855190b17f1bSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
855290b17f1bSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
855390b17f1bSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
855490b17f1bSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
855590b17f1bSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
855690b17f1bSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
855790b17f1bSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
855890b17f1bSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
855990b17f1bSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
856090b17f1bSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
856190b17f1bSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
856290b17f1bSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
856390b17f1bSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
856490b17f1bSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
856590b17f1bSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
856690b17f1bSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
856790b17f1bSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
856890b17f1bSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
856990b17f1bSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
857090b17f1bSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
857190b17f1bSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
857290b17f1bSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
857390b17f1bSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
857490b17f1bSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
857590b17f1bSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
857690b17f1bSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
857790b17f1bSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
857890b17f1bSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
857990b17f1bSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
858090b17f1bSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
858190b17f1bSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
858290b17f1bSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
858390b17f1bSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
858490b17f1bSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
858590b17f1bSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
858690b17f1bSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
858790b17f1bSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
858890b17f1bSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
858990b17f1bSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
859090b17f1bSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
859190b17f1bSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
859290b17f1bSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
859390b17f1bSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
859490b17f1bSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
859590b17f1bSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
859690b17f1bSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
859790b17f1bSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
859890b17f1bSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
859990b17f1bSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
860090b17f1bSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
860190b17f1bSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
860290b17f1bSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
860390b17f1bSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
860490b17f1bSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
860590b17f1bSmrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
860690b17f1bSmrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
860790b17f1bSmrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
860890b17f1bSmrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
860990b17f1bSmrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
861090b17f1bSmrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
861190b17f1bSmrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
86127e6fb56fSmrg
861390b17f1bSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
861490b17f1bSmrg# serial 1 (pkg-config-0.24)
861590b17f1bSmrg# 
861690b17f1bSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
861790b17f1bSmrg#
861890b17f1bSmrg# This program is free software; you can redistribute it and/or modify
861990b17f1bSmrg# it under the terms of the GNU General Public License as published by
862090b17f1bSmrg# the Free Software Foundation; either version 2 of the License, or
862190b17f1bSmrg# (at your option) any later version.
862290b17f1bSmrg#
862390b17f1bSmrg# This program is distributed in the hope that it will be useful, but
862490b17f1bSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
862590b17f1bSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
862690b17f1bSmrg# General Public License for more details.
862790b17f1bSmrg#
862890b17f1bSmrg# You should have received a copy of the GNU General Public License
862990b17f1bSmrg# along with this program; if not, write to the Free Software
863090b17f1bSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
863190b17f1bSmrg#
863290b17f1bSmrg# As a special exception to the GNU General Public License, if you
863390b17f1bSmrg# distribute this file as part of a program that contains a
863490b17f1bSmrg# configuration script generated by Autoconf, you may include it under
863590b17f1bSmrg# the same distribution terms that you use for the rest of that program.
86367e6fb56fSmrg
863790b17f1bSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
863890b17f1bSmrg# ----------------------------------
863990b17f1bSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
864090b17f1bSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
864190b17f1bSmrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
864290b17f1bSmrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
864390b17f1bSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
864490b17f1bSmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
864590b17f1bSmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
86467e6fb56fSmrg
864790b17f1bSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
864890b17f1bSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
864990b17f1bSmrgfi
865090b17f1bSmrgif test -n "$PKG_CONFIG"; then
865190b17f1bSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
865290b17f1bSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
865390b17f1bSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
865490b17f1bSmrg		AC_MSG_RESULT([yes])
865590b17f1bSmrg	else
865690b17f1bSmrg		AC_MSG_RESULT([no])
865790b17f1bSmrg		PKG_CONFIG=""
86587e6fb56fSmrg	fi
865990b17f1bSmrgfi[]dnl
866090b17f1bSmrg])# PKG_PROG_PKG_CONFIG
86617e6fb56fSmrg
866290b17f1bSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
866390b17f1bSmrg#
866490b17f1bSmrg# Check to see whether a particular set of modules exists.  Similar
866590b17f1bSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
866690b17f1bSmrg#
866790b17f1bSmrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
866890b17f1bSmrg# only at the first occurence in configure.ac, so if the first place
866990b17f1bSmrg# it's called might be skipped (such as if it is within an "if", you
867090b17f1bSmrg# have to call PKG_CHECK_EXISTS manually
867190b17f1bSmrg# --------------------------------------------------------------
867290b17f1bSmrgAC_DEFUN([PKG_CHECK_EXISTS],
867390b17f1bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
867490b17f1bSmrgif test -n "$PKG_CONFIG" && \
867590b17f1bSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
867690b17f1bSmrg  m4_default([$2], [:])
867790b17f1bSmrgm4_ifvaln([$3], [else
867890b17f1bSmrg  $3])dnl
867990b17f1bSmrgfi])
86807e6fb56fSmrg
868190b17f1bSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
868290b17f1bSmrg# ---------------------------------------------
868390b17f1bSmrgm4_define([_PKG_CONFIG],
868490b17f1bSmrg[if test -n "$$1"; then
868590b17f1bSmrg    pkg_cv_[]$1="$$1"
868690b17f1bSmrg elif test -n "$PKG_CONFIG"; then
868790b17f1bSmrg    PKG_CHECK_EXISTS([$3],
868890b17f1bSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
868990b17f1bSmrg		      test "x$?" != "x0" && pkg_failed=yes ],
869090b17f1bSmrg		     [pkg_failed=yes])
869190b17f1bSmrg else
869290b17f1bSmrg    pkg_failed=untried
869390b17f1bSmrgfi[]dnl
869490b17f1bSmrg])# _PKG_CONFIG
86957e6fb56fSmrg
869690b17f1bSmrg# _PKG_SHORT_ERRORS_SUPPORTED
869790b17f1bSmrg# -----------------------------
869890b17f1bSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
869990b17f1bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
870090b17f1bSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
870190b17f1bSmrg        _pkg_short_errors_supported=yes
870290b17f1bSmrgelse
870390b17f1bSmrg        _pkg_short_errors_supported=no
870490b17f1bSmrgfi[]dnl
870590b17f1bSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
87067e6fb56fSmrg
87077e6fb56fSmrg
870890b17f1bSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
870990b17f1bSmrg# [ACTION-IF-NOT-FOUND])
871090b17f1bSmrg#
871190b17f1bSmrg#
871290b17f1bSmrg# Note that if there is a possibility the first call to
871390b17f1bSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
871490b17f1bSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
871590b17f1bSmrg#
871690b17f1bSmrg#
871790b17f1bSmrg# --------------------------------------------------------------
871890b17f1bSmrgAC_DEFUN([PKG_CHECK_MODULES],
871990b17f1bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
872090b17f1bSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
872190b17f1bSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
87227e6fb56fSmrg
872390b17f1bSmrgpkg_failed=no
872490b17f1bSmrgAC_MSG_CHECKING([for $1])
87257e6fb56fSmrg
872690b17f1bSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
872790b17f1bSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
87287e6fb56fSmrg
872990b17f1bSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
873090b17f1bSmrgand $1[]_LIBS to avoid the need to call pkg-config.
873190b17f1bSmrgSee the pkg-config man page for more details.])
87327e6fb56fSmrg
873390b17f1bSmrgif test $pkg_failed = yes; then
873490b17f1bSmrg   	AC_MSG_RESULT([no])
873590b17f1bSmrg        _PKG_SHORT_ERRORS_SUPPORTED
873690b17f1bSmrg        if test $_pkg_short_errors_supported = yes; then
873790b17f1bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
873890b17f1bSmrg        else 
873990b17f1bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
874090b17f1bSmrg        fi
874190b17f1bSmrg	# Put the nasty error message in config.log where it belongs
874290b17f1bSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
87437e6fb56fSmrg
874490b17f1bSmrg	m4_default([$4], [AC_MSG_ERROR(
874590b17f1bSmrg[Package requirements ($2) were not met:
87467e6fb56fSmrg
874790b17f1bSmrg$$1_PKG_ERRORS
87487e6fb56fSmrg
874990b17f1bSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
875090b17f1bSmrginstalled software in a non-standard prefix.
87517e6fb56fSmrg
875290b17f1bSmrg_PKG_TEXT])[]dnl
875390b17f1bSmrg        ])
875490b17f1bSmrgelif test $pkg_failed = untried; then
875590b17f1bSmrg     	AC_MSG_RESULT([no])
875690b17f1bSmrg	m4_default([$4], [AC_MSG_FAILURE(
875790b17f1bSmrg[The pkg-config script could not be found or is too old.  Make sure it
875890b17f1bSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
875990b17f1bSmrgpath to pkg-config.
87607e6fb56fSmrg
876190b17f1bSmrg_PKG_TEXT
87627e6fb56fSmrg
876390b17f1bSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
876490b17f1bSmrg        ])
876590b17f1bSmrgelse
876690b17f1bSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
876790b17f1bSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
876890b17f1bSmrg        AC_MSG_RESULT([yes])
876990b17f1bSmrg	$3
877090b17f1bSmrgfi[]dnl
877190b17f1bSmrg])# PKG_CHECK_MODULES
87727e6fb56fSmrg
877390b17f1bSmrg
877490b17f1bSmrg# PKG_INSTALLDIR(DIRECTORY)
877590b17f1bSmrg# -------------------------
877690b17f1bSmrg# Substitutes the variable pkgconfigdir as the location where a module
877790b17f1bSmrg# should install pkg-config .pc files. By default the directory is
877890b17f1bSmrg# $libdir/pkgconfig, but the default can be changed by passing
877990b17f1bSmrg# DIRECTORY. The user can override through the --with-pkgconfigdir
878090b17f1bSmrg# parameter.
878190b17f1bSmrgAC_DEFUN([PKG_INSTALLDIR],
878290b17f1bSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
878390b17f1bSmrgm4_pushdef([pkg_description],
878490b17f1bSmrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
878590b17f1bSmrgAC_ARG_WITH([pkgconfigdir],
878690b17f1bSmrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
878790b17f1bSmrg    [with_pkgconfigdir=]pkg_default)
878890b17f1bSmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
878990b17f1bSmrgm4_popdef([pkg_default])
879090b17f1bSmrgm4_popdef([pkg_description])
879190b17f1bSmrg]) dnl PKG_INSTALLDIR
879290b17f1bSmrg
879390b17f1bSmrg
879490b17f1bSmrg# PKG_NOARCH_INSTALLDIR(DIRECTORY)
879590b17f1bSmrg# -------------------------
879690b17f1bSmrg# Substitutes the variable noarch_pkgconfigdir as the location where a
879790b17f1bSmrg# module should install arch-independent pkg-config .pc files. By
879890b17f1bSmrg# default the directory is $datadir/pkgconfig, but the default can be
879990b17f1bSmrg# changed by passing DIRECTORY. The user can override through the
880090b17f1bSmrg# --with-noarch-pkgconfigdir parameter.
880190b17f1bSmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
880290b17f1bSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
880390b17f1bSmrgm4_pushdef([pkg_description],
880490b17f1bSmrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
880590b17f1bSmrgAC_ARG_WITH([noarch-pkgconfigdir],
880690b17f1bSmrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
880790b17f1bSmrg    [with_noarch_pkgconfigdir=]pkg_default)
880890b17f1bSmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
880990b17f1bSmrgm4_popdef([pkg_default])
881090b17f1bSmrgm4_popdef([pkg_description])
881190b17f1bSmrg]) dnl PKG_NOARCH_INSTALLDIR
881290b17f1bSmrg
881390b17f1bSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
881490b17f1bSmrgdnl
881590b17f1bSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
881690b17f1bSmrgdnl 
881790b17f1bSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
881890b17f1bSmrgdnl copy of this software and associated documentation files (the "Software"),
881990b17f1bSmrgdnl to deal in the Software without restriction, including without limitation
882090b17f1bSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
882190b17f1bSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
882290b17f1bSmrgdnl Software is furnished to do so, subject to the following conditions:
882390b17f1bSmrgdnl
882490b17f1bSmrgdnl The above copyright notice and this permission notice (including the next
882590b17f1bSmrgdnl paragraph) shall be included in all copies or substantial portions of the
882690b17f1bSmrgdnl Software.
882790b17f1bSmrgdnl
882890b17f1bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
882990b17f1bSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
883090b17f1bSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
883190b17f1bSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
883290b17f1bSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
883390b17f1bSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
883490b17f1bSmrgdnl DEALINGS IN THE SOFTWARE.
883590b17f1bSmrg
883690b17f1bSmrg# XORG_MACROS_VERSION(required-version)
883790b17f1bSmrg# -------------------------------------
883890b17f1bSmrg# Minimum version: 1.1.0
883990b17f1bSmrg#
884090b17f1bSmrg# If you're using a macro added in Version 1.1 or newer, include this in
884190b17f1bSmrg# your configure.ac with the minimum required version, such as:
884290b17f1bSmrg# XORG_MACROS_VERSION(1.1)
884390b17f1bSmrg#
884490b17f1bSmrg# To ensure that this macro is defined, also add:
884590b17f1bSmrg# m4_ifndef([XORG_MACROS_VERSION],
884690b17f1bSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
884790b17f1bSmrg#
884890b17f1bSmrg#
884990b17f1bSmrg# See the "minimum version" comment for each macro you use to see what 
885090b17f1bSmrg# version you require.
885190b17f1bSmrgm4_defun([XORG_MACROS_VERSION],[
885290b17f1bSmrgm4_define([vers_have], [1.17])
885390b17f1bSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
885490b17f1bSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
885590b17f1bSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
885690b17f1bSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
885790b17f1bSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
885890b17f1bSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
885990b17f1bSmrgm4_undefine([vers_have])
886090b17f1bSmrgm4_undefine([maj_have])
886190b17f1bSmrgm4_undefine([maj_needed])
886290b17f1bSmrg]) # XORG_MACROS_VERSION
886390b17f1bSmrg
886490b17f1bSmrg# XORG_PROG_RAWCPP()
886590b17f1bSmrg# ------------------
886690b17f1bSmrg# Minimum version: 1.0.0
886790b17f1bSmrg#
886890b17f1bSmrg# Find cpp program and necessary flags for use in pre-processing text files
886990b17f1bSmrg# such as man pages and config files
887090b17f1bSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
887190b17f1bSmrgAC_REQUIRE([AC_PROG_CPP])
887290b17f1bSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
887390b17f1bSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
887490b17f1bSmrg
887590b17f1bSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
887690b17f1bSmrg# which is not the best choice for supporting other OS'es, but covers most
887790b17f1bSmrg# of the ones we need for now.
887890b17f1bSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
887990b17f1bSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
888090b17f1bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
888190b17f1bSmrg	AC_MSG_RESULT([no])
888290b17f1bSmrgelse
888390b17f1bSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
888490b17f1bSmrg		RAWCPPFLAGS=-undef
888590b17f1bSmrg		AC_MSG_RESULT([yes])
888690b17f1bSmrg	# under Cygwin unix is still defined even with -undef
888790b17f1bSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
888890b17f1bSmrg		RAWCPPFLAGS="-undef -ansi"
888990b17f1bSmrg		AC_MSG_RESULT([yes, with -ansi])
88907e6fb56fSmrg	else
889190b17f1bSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
88927e6fb56fSmrg	fi
889390b17f1bSmrgfi
889490b17f1bSmrgrm -f conftest.$ac_ext
88957e6fb56fSmrg
889690b17f1bSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
889790b17f1bSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
889890b17f1bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
889990b17f1bSmrg	AC_MSG_RESULT([no])
890090b17f1bSmrgelse
890190b17f1bSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
890290b17f1bSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
890390b17f1bSmrg		AC_MSG_RESULT([yes])
89047e6fb56fSmrg	else
890590b17f1bSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
89067e6fb56fSmrg	fi
890790b17f1bSmrgfi
890890b17f1bSmrgrm -f conftest.$ac_ext
890990b17f1bSmrgAC_SUBST(RAWCPPFLAGS)
891090b17f1bSmrg]) # XORG_PROG_RAWCPP
89117e6fb56fSmrg
891290b17f1bSmrg# XORG_MANPAGE_SECTIONS()
891390b17f1bSmrg# -----------------------
891490b17f1bSmrg# Minimum version: 1.0.0
891590b17f1bSmrg#
891690b17f1bSmrg# Determine which sections man pages go in for the different man page types
891790b17f1bSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
891890b17f1bSmrg# Not sure if there's any better way than just hardcoding by OS name.
891990b17f1bSmrg# Override default settings by setting environment variables
892090b17f1bSmrg# Added MAN_SUBSTS in version 1.8
892190b17f1bSmrg# Added AC_PROG_SED in version 1.8
892290b17f1bSmrg
892390b17f1bSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
892490b17f1bSmrgAC_REQUIRE([AC_CANONICAL_HOST])
892590b17f1bSmrgAC_REQUIRE([AC_PROG_SED])
892690b17f1bSmrg
892790b17f1bSmrgif test x$APP_MAN_SUFFIX = x    ; then
892890b17f1bSmrg    APP_MAN_SUFFIX=1
892990b17f1bSmrgfi
893090b17f1bSmrgif test x$APP_MAN_DIR = x    ; then
893190b17f1bSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
893290b17f1bSmrgfi
89337e6fb56fSmrg
893490b17f1bSmrgif test x$LIB_MAN_SUFFIX = x    ; then
893590b17f1bSmrg    LIB_MAN_SUFFIX=3
893690b17f1bSmrgfi
893790b17f1bSmrgif test x$LIB_MAN_DIR = x    ; then
893890b17f1bSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
893990b17f1bSmrgfi
89407e6fb56fSmrg
894190b17f1bSmrgif test x$FILE_MAN_SUFFIX = x    ; then
894290b17f1bSmrg    case $host_os in
894390b17f1bSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
894490b17f1bSmrg	*)		FILE_MAN_SUFFIX=5  ;;
894590b17f1bSmrg    esac
894690b17f1bSmrgfi
894790b17f1bSmrgif test x$FILE_MAN_DIR = x    ; then
894890b17f1bSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
894990b17f1bSmrgfi
89507e6fb56fSmrg
895190b17f1bSmrgif test x$MISC_MAN_SUFFIX = x    ; then
895290b17f1bSmrg    case $host_os in
895390b17f1bSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
895490b17f1bSmrg	*)		MISC_MAN_SUFFIX=7  ;;
895590b17f1bSmrg    esac
895690b17f1bSmrgfi
895790b17f1bSmrgif test x$MISC_MAN_DIR = x    ; then
895890b17f1bSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
895990b17f1bSmrgfi
89607e6fb56fSmrg
896190b17f1bSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
896290b17f1bSmrg    case $host_os in
896390b17f1bSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
896490b17f1bSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
896590b17f1bSmrg    esac
896690b17f1bSmrgfi
896790b17f1bSmrgif test x$DRIVER_MAN_DIR = x    ; then
896890b17f1bSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
896990b17f1bSmrgfi
89707e6fb56fSmrg
897190b17f1bSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
897290b17f1bSmrg    case $host_os in
897390b17f1bSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
897490b17f1bSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
897590b17f1bSmrg    esac
897690b17f1bSmrgfi
897790b17f1bSmrgif test x$ADMIN_MAN_DIR = x    ; then
897890b17f1bSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
897990b17f1bSmrgfi
89807e6fb56fSmrg
89817e6fb56fSmrg
898290b17f1bSmrgAC_SUBST([APP_MAN_SUFFIX])
898390b17f1bSmrgAC_SUBST([LIB_MAN_SUFFIX])
898490b17f1bSmrgAC_SUBST([FILE_MAN_SUFFIX])
898590b17f1bSmrgAC_SUBST([MISC_MAN_SUFFIX])
898690b17f1bSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
898790b17f1bSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
898890b17f1bSmrgAC_SUBST([APP_MAN_DIR])
898990b17f1bSmrgAC_SUBST([LIB_MAN_DIR])
899090b17f1bSmrgAC_SUBST([FILE_MAN_DIR])
899190b17f1bSmrgAC_SUBST([MISC_MAN_DIR])
899290b17f1bSmrgAC_SUBST([DRIVER_MAN_DIR])
899390b17f1bSmrgAC_SUBST([ADMIN_MAN_DIR])
899490b17f1bSmrg
899590b17f1bSmrgXORG_MAN_PAGE="X Version 11"
899690b17f1bSmrgAC_SUBST([XORG_MAN_PAGE])
899790b17f1bSmrgMAN_SUBSTS="\
899890b17f1bSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
899990b17f1bSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
900090b17f1bSmrg	-e 's|__xservername__|Xorg|g' \
900190b17f1bSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
900290b17f1bSmrg	-e 's|__projectroot__|\$(prefix)|g' \
900390b17f1bSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
900490b17f1bSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
900590b17f1bSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
900690b17f1bSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
900790b17f1bSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
900890b17f1bSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
900990b17f1bSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
901090b17f1bSmrgAC_SUBST([MAN_SUBSTS])
901190b17f1bSmrg
901290b17f1bSmrg]) # XORG_MANPAGE_SECTIONS
901390b17f1bSmrg
901490b17f1bSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
901590b17f1bSmrg# ------------------------
901690b17f1bSmrg# Minimum version: 1.7.0
901790b17f1bSmrg#
901890b17f1bSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
901990b17f1bSmrg# provided by xorg-sgml-doctools, if installed.
902090b17f1bSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
902190b17f1bSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
902290b17f1bSmrgXORG_SGML_PATH=
902390b17f1bSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
902490b17f1bSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
902590b17f1bSmrg    [m4_ifval([$1],[:],
902690b17f1bSmrg        [if test x"$cross_compiling" != x"yes" ; then
902790b17f1bSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
902890b17f1bSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
902990b17f1bSmrg         fi])
903090b17f1bSmrg    ])
90317e6fb56fSmrg
903290b17f1bSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
903390b17f1bSmrg# the path and the name of the doc stylesheet
903490b17f1bSmrgif test "x$XORG_SGML_PATH" != "x" ; then
903590b17f1bSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
903690b17f1bSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
903790b17f1bSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
903890b17f1bSmrgelse
903990b17f1bSmrg   AC_MSG_RESULT([no])
904090b17f1bSmrgfi
90417e6fb56fSmrg
904290b17f1bSmrgAC_SUBST(XORG_SGML_PATH)
904390b17f1bSmrgAC_SUBST(STYLESHEET_SRCDIR)
904490b17f1bSmrgAC_SUBST(XSL_STYLESHEET)
904590b17f1bSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
904690b17f1bSmrg]) # XORG_CHECK_SGML_DOCTOOLS
90477e6fb56fSmrg
904890b17f1bSmrg# XORG_CHECK_LINUXDOC
904990b17f1bSmrg# -------------------
905090b17f1bSmrg# Minimum version: 1.0.0
905190b17f1bSmrg#
905290b17f1bSmrg# Defines the variable MAKE_TEXT if the necessary tools and
905390b17f1bSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
905490b17f1bSmrg# Whether or not the necessary tools and files are found can be checked
905590b17f1bSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
905690b17f1bSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
905790b17f1bSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
905890b17f1bSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
90597e6fb56fSmrg
906090b17f1bSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
90617e6fb56fSmrg
906290b17f1bSmrgAC_MSG_CHECKING([whether to build documentation])
90637e6fb56fSmrg
906490b17f1bSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
906590b17f1bSmrg   BUILDDOC=yes
906690b17f1bSmrgelse
906790b17f1bSmrg   BUILDDOC=no
906890b17f1bSmrgfi
90697e6fb56fSmrg
907090b17f1bSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
90717e6fb56fSmrg
907290b17f1bSmrgAC_MSG_RESULT([$BUILDDOC])
90737e6fb56fSmrg
907490b17f1bSmrgAC_MSG_CHECKING([whether to build pdf documentation])
90757e6fb56fSmrg
907690b17f1bSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
907790b17f1bSmrg   BUILDPDFDOC=yes
907890b17f1bSmrgelse
907990b17f1bSmrg   BUILDPDFDOC=no
908090b17f1bSmrgfi
90817e6fb56fSmrg
908290b17f1bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
90837e6fb56fSmrg
908490b17f1bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
90857e6fb56fSmrg
908690b17f1bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
908790b17f1bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
908890b17f1bSmrgMAKE_PDF="$PS2PDF"
908990b17f1bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
90907e6fb56fSmrg
909190b17f1bSmrgAC_SUBST(MAKE_TEXT)
909290b17f1bSmrgAC_SUBST(MAKE_PS)
909390b17f1bSmrgAC_SUBST(MAKE_PDF)
909490b17f1bSmrgAC_SUBST(MAKE_HTML)
909590b17f1bSmrg]) # XORG_CHECK_LINUXDOC
90967e6fb56fSmrg
909790b17f1bSmrg# XORG_CHECK_DOCBOOK
909890b17f1bSmrg# -------------------
909990b17f1bSmrg# Minimum version: 1.0.0
910090b17f1bSmrg#
910190b17f1bSmrg# Checks for the ability to build output formats from SGML DocBook source.
910290b17f1bSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
910390b17f1bSmrg# indicates whether the necessary tools and files are found and, if set,
910490b17f1bSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
910590b17f1bSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
910690b17f1bSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
910790b17f1bSmrg
910890b17f1bSmrgBUILDTXTDOC=no
910990b17f1bSmrgBUILDPDFDOC=no
911090b17f1bSmrgBUILDPSDOC=no
911190b17f1bSmrgBUILDHTMLDOC=no
911290b17f1bSmrg
911390b17f1bSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
911490b17f1bSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
911590b17f1bSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
911690b17f1bSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
911790b17f1bSmrg
911890b17f1bSmrgAC_MSG_CHECKING([whether to build text documentation])
911990b17f1bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
912090b17f1bSmrg   test x$BUILD_TXTDOC != xno; then
912190b17f1bSmrg	BUILDTXTDOC=yes
912290b17f1bSmrgfi
912390b17f1bSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
912490b17f1bSmrgAC_MSG_RESULT([$BUILDTXTDOC])
91257e6fb56fSmrg
912690b17f1bSmrgAC_MSG_CHECKING([whether to build PDF documentation])
912790b17f1bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
912890b17f1bSmrg   test x$BUILD_PDFDOC != xno; then
912990b17f1bSmrg	BUILDPDFDOC=yes
913090b17f1bSmrgfi
913190b17f1bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
913290b17f1bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
91337e6fb56fSmrg
913490b17f1bSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
913590b17f1bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
913690b17f1bSmrg   test x$BUILD_PSDOC != xno; then
913790b17f1bSmrg	BUILDPSDOC=yes
913890b17f1bSmrgfi
913990b17f1bSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
914090b17f1bSmrgAC_MSG_RESULT([$BUILDPSDOC])
91417e6fb56fSmrg
914290b17f1bSmrgAC_MSG_CHECKING([whether to build HTML documentation])
914390b17f1bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
914490b17f1bSmrg   test x$BUILD_HTMLDOC != xno; then
914590b17f1bSmrg	BUILDHTMLDOC=yes
914690b17f1bSmrgfi
914790b17f1bSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
914890b17f1bSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
91497e6fb56fSmrg
915090b17f1bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
915190b17f1bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
915290b17f1bSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
915390b17f1bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
91547e6fb56fSmrg
915590b17f1bSmrgAC_SUBST(MAKE_TEXT)
915690b17f1bSmrgAC_SUBST(MAKE_PS)
915790b17f1bSmrgAC_SUBST(MAKE_PDF)
915890b17f1bSmrgAC_SUBST(MAKE_HTML)
915990b17f1bSmrg]) # XORG_CHECK_DOCBOOK
91607e6fb56fSmrg
916190b17f1bSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
916290b17f1bSmrg# ----------------
916390b17f1bSmrg# Minimum version: 1.5.0
916490b17f1bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
916590b17f1bSmrg#
916690b17f1bSmrg# Documentation tools are not always available on all platforms and sometimes
916790b17f1bSmrg# not at the appropriate level. This macro enables a module to test for the
916890b17f1bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
916990b17f1bSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
917090b17f1bSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
917190b17f1bSmrg# --with-xmlto assumes 'auto'.
917290b17f1bSmrg#
917390b17f1bSmrg# Interface to module:
917490b17f1bSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
917590b17f1bSmrg# XMLTO:	returns the path of the xmlto program found
917690b17f1bSmrg#		returns the path set by the user in the environment
917790b17f1bSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
917890b17f1bSmrg#		'no' user instructs the module not to use xmlto
917990b17f1bSmrg#
918090b17f1bSmrg# Added in version 1.10.0
918190b17f1bSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
918290b17f1bSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
918390b17f1bSmrg#
918490b17f1bSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
918590b17f1bSmrg#
918690b17f1bSmrgAC_DEFUN([XORG_WITH_XMLTO],[
918790b17f1bSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
918890b17f1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
918990b17f1bSmrgAC_ARG_WITH(xmlto,
919090b17f1bSmrg	AS_HELP_STRING([--with-xmlto],
919190b17f1bSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
919290b17f1bSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
919390b17f1bSmrgm4_undefine([_defopt])
919490b17f1bSmrg
919590b17f1bSmrgif test "x$use_xmlto" = x"auto"; then
919690b17f1bSmrg   AC_PATH_PROG([XMLTO], [xmlto])
919790b17f1bSmrg   if test "x$XMLTO" = "x"; then
919890b17f1bSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
919990b17f1bSmrg	have_xmlto=no
920090b17f1bSmrg   else
920190b17f1bSmrg        have_xmlto=yes
920290b17f1bSmrg   fi
920390b17f1bSmrgelif test "x$use_xmlto" = x"yes" ; then
920490b17f1bSmrg   AC_PATH_PROG([XMLTO], [xmlto])
920590b17f1bSmrg   if test "x$XMLTO" = "x"; then
920690b17f1bSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
920790b17f1bSmrg   fi
920890b17f1bSmrg   have_xmlto=yes
920990b17f1bSmrgelif test "x$use_xmlto" = x"no" ; then
921090b17f1bSmrg   if test "x$XMLTO" != "x"; then
921190b17f1bSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
921290b17f1bSmrg   fi
921390b17f1bSmrg   have_xmlto=no
921490b17f1bSmrgelse
921590b17f1bSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
921690b17f1bSmrgfi
92177e6fb56fSmrg
921890b17f1bSmrg# Test for a minimum version of xmlto, if provided.
921990b17f1bSmrgm4_ifval([$1],
922090b17f1bSmrg[if test "$have_xmlto" = yes; then
922190b17f1bSmrg    # scrape the xmlto version
922290b17f1bSmrg    AC_MSG_CHECKING([the xmlto version])
922390b17f1bSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
922490b17f1bSmrg    AC_MSG_RESULT([$xmlto_version])
922590b17f1bSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
922690b17f1bSmrg        [if test "x$use_xmlto" = xauto; then
922790b17f1bSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
922890b17f1bSmrg            have_xmlto=no
922990b17f1bSmrg        else
923090b17f1bSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
923190b17f1bSmrg        fi])
923290b17f1bSmrgfi])
92337e6fb56fSmrg
923490b17f1bSmrg# Test for the ability of xmlto to generate a text target
923590b17f1bSmrghave_xmlto_text=no
923690b17f1bSmrgcat > conftest.xml << "EOF"
923790b17f1bSmrgEOF
923890b17f1bSmrgAS_IF([test "$have_xmlto" = yes],
923990b17f1bSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
924090b17f1bSmrg             [have_xmlto_text=yes],
924190b17f1bSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
924290b17f1bSmrgrm -f conftest.xml
924390b17f1bSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
924490b17f1bSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
924590b17f1bSmrg]) # XORG_WITH_XMLTO
924690b17f1bSmrg
924790b17f1bSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
924890b17f1bSmrg# --------------------------------------------
924990b17f1bSmrg# Minimum version: 1.12.0
925090b17f1bSmrg# Minimum version for optional DEFAULT argument: 1.12.0
925190b17f1bSmrg#
925290b17f1bSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
925390b17f1bSmrg# XML-based language used for the transformation of XML documents.
925490b17f1bSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
925590b17f1bSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
925690b17f1bSmrg# The XSLT processor is often used as a standalone tool for transformations.
925790b17f1bSmrg# It should not be assumed that this tool is used only to work with documnetation.
925890b17f1bSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
925990b17f1bSmrg#
926090b17f1bSmrg# Interface to module:
926190b17f1bSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
926290b17f1bSmrg# XSLTPROC:	 returns the path of the xsltproc program found
926390b17f1bSmrg#		 returns the path set by the user in the environment
926490b17f1bSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
926590b17f1bSmrg#		  'no' user instructs the module not to use xsltproc
926690b17f1bSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
926790b17f1bSmrg#
926890b17f1bSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
926990b17f1bSmrg#
927090b17f1bSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
927190b17f1bSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
927290b17f1bSmrg# Preserves the interface, should it be implemented later
927390b17f1bSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
927490b17f1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
927590b17f1bSmrgAC_ARG_WITH(xsltproc,
927690b17f1bSmrg	AS_HELP_STRING([--with-xsltproc],
927790b17f1bSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
927890b17f1bSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
927990b17f1bSmrgm4_undefine([_defopt])
928090b17f1bSmrg
928190b17f1bSmrgif test "x$use_xsltproc" = x"auto"; then
928290b17f1bSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
928390b17f1bSmrg   if test "x$XSLTPROC" = "x"; then
928490b17f1bSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
928590b17f1bSmrg	have_xsltproc=no
928690b17f1bSmrg   else
928790b17f1bSmrg        have_xsltproc=yes
928890b17f1bSmrg   fi
928990b17f1bSmrgelif test "x$use_xsltproc" = x"yes" ; then
929090b17f1bSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
929190b17f1bSmrg   if test "x$XSLTPROC" = "x"; then
929290b17f1bSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
929390b17f1bSmrg   fi
929490b17f1bSmrg   have_xsltproc=yes
929590b17f1bSmrgelif test "x$use_xsltproc" = x"no" ; then
929690b17f1bSmrg   if test "x$XSLTPROC" != "x"; then
929790b17f1bSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
929890b17f1bSmrg   fi
929990b17f1bSmrg   have_xsltproc=no
930090b17f1bSmrgelse
930190b17f1bSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
930290b17f1bSmrgfi
93037e6fb56fSmrg
930490b17f1bSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
930590b17f1bSmrg]) # XORG_WITH_XSLTPROC
93067e6fb56fSmrg
930790b17f1bSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
930890b17f1bSmrg# ----------------------------------------
930990b17f1bSmrg# Minimum version: 1.15.0
93107e6fb56fSmrg#
931190b17f1bSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
931290b17f1bSmrg# scanning arbitrary text files, extracting information from those text files,
931390b17f1bSmrg# and printing reports based on that information.
93147e6fb56fSmrg#
931590b17f1bSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
931690b17f1bSmrg#
931790b17f1bSmrg# Interface to module:
931890b17f1bSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
931990b17f1bSmrg# PERL:	     returns the path of the perl program found
932090b17f1bSmrg#	     returns the path set by the user in the environment
932190b17f1bSmrg# --with-perl: 'yes' user instructs the module to use perl
932290b17f1bSmrg#	       'no' user instructs the module not to use perl
932390b17f1bSmrg# have_perl: returns yes if perl found in PATH or no
932490b17f1bSmrg#
932590b17f1bSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
932690b17f1bSmrg#
932790b17f1bSmrgAC_DEFUN([XORG_WITH_PERL],[
932890b17f1bSmrgAC_ARG_VAR([PERL], [Path to perl command])
932990b17f1bSmrg# Preserves the interface, should it be implemented later
933090b17f1bSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
933190b17f1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
933290b17f1bSmrgAC_ARG_WITH(perl,
933390b17f1bSmrg	AS_HELP_STRING([--with-perl],
933490b17f1bSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
933590b17f1bSmrg	   [use_perl=$withval], [use_perl=]_defopt)
933690b17f1bSmrgm4_undefine([_defopt])
933790b17f1bSmrg
933890b17f1bSmrgif test "x$use_perl" = x"auto"; then
933990b17f1bSmrg   AC_PATH_PROG([PERL], [perl])
934090b17f1bSmrg   if test "x$PERL" = "x"; then
934190b17f1bSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
934290b17f1bSmrg	have_perl=no
934390b17f1bSmrg   else
934490b17f1bSmrg        have_perl=yes
934590b17f1bSmrg   fi
934690b17f1bSmrgelif test "x$use_perl" = x"yes" ; then
934790b17f1bSmrg   AC_PATH_PROG([PERL], [perl])
934890b17f1bSmrg   if test "x$PERL" = "x"; then
934990b17f1bSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
935090b17f1bSmrg   fi
935190b17f1bSmrg   have_perl=yes
935290b17f1bSmrgelif test "x$use_perl" = x"no" ; then
935390b17f1bSmrg   if test "x$PERL" != "x"; then
935490b17f1bSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
935590b17f1bSmrg   fi
935690b17f1bSmrg   have_perl=no
935790b17f1bSmrgelse
935890b17f1bSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
935990b17f1bSmrgfi
93607e6fb56fSmrg
936190b17f1bSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
936290b17f1bSmrg]) # XORG_WITH_PERL
93637e6fb56fSmrg
936490b17f1bSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
936590b17f1bSmrg# ----------------
936690b17f1bSmrg# Minimum version: 1.5.0
936790b17f1bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
936890b17f1bSmrg#
936990b17f1bSmrg# Documentation tools are not always available on all platforms and sometimes
937090b17f1bSmrg# not at the appropriate level. This macro enables a module to test for the
937190b17f1bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
937290b17f1bSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
937390b17f1bSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
937490b17f1bSmrg# --with-asciidoc assumes 'auto'.
937590b17f1bSmrg#
937690b17f1bSmrg# Interface to module:
937790b17f1bSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
937890b17f1bSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
937990b17f1bSmrg#		 returns the path set by the user in the environment
938090b17f1bSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
938190b17f1bSmrg#		  'no' user instructs the module not to use asciidoc
938290b17f1bSmrg#
938390b17f1bSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
938490b17f1bSmrg#
938590b17f1bSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
938690b17f1bSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
938790b17f1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
938890b17f1bSmrgAC_ARG_WITH(asciidoc,
938990b17f1bSmrg	AS_HELP_STRING([--with-asciidoc],
939090b17f1bSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
939190b17f1bSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
939290b17f1bSmrgm4_undefine([_defopt])
939390b17f1bSmrg
939490b17f1bSmrgif test "x$use_asciidoc" = x"auto"; then
939590b17f1bSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
939690b17f1bSmrg   if test "x$ASCIIDOC" = "x"; then
939790b17f1bSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
939890b17f1bSmrg	have_asciidoc=no
939990b17f1bSmrg   else
940090b17f1bSmrg        have_asciidoc=yes
940190b17f1bSmrg   fi
940290b17f1bSmrgelif test "x$use_asciidoc" = x"yes" ; then
940390b17f1bSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
940490b17f1bSmrg   if test "x$ASCIIDOC" = "x"; then
940590b17f1bSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
940690b17f1bSmrg   fi
940790b17f1bSmrg   have_asciidoc=yes
940890b17f1bSmrgelif test "x$use_asciidoc" = x"no" ; then
940990b17f1bSmrg   if test "x$ASCIIDOC" != "x"; then
941090b17f1bSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
941190b17f1bSmrg   fi
941290b17f1bSmrg   have_asciidoc=no
941390b17f1bSmrgelse
941490b17f1bSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
941590b17f1bSmrgfi
941690b17f1bSmrgm4_ifval([$1],
941790b17f1bSmrg[if test "$have_asciidoc" = yes; then
941890b17f1bSmrg    # scrape the asciidoc version
941990b17f1bSmrg    AC_MSG_CHECKING([the asciidoc version])
942090b17f1bSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
942190b17f1bSmrg    AC_MSG_RESULT([$asciidoc_version])
942290b17f1bSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
942390b17f1bSmrg        [if test "x$use_asciidoc" = xauto; then
942490b17f1bSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
942590b17f1bSmrg            have_asciidoc=no
942690b17f1bSmrg        else
942790b17f1bSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
942890b17f1bSmrg        fi])
942990b17f1bSmrgfi])
943090b17f1bSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
943190b17f1bSmrg]) # XORG_WITH_ASCIIDOC
94327e6fb56fSmrg
943390b17f1bSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
943490b17f1bSmrg# --------------------------------
943590b17f1bSmrg# Minimum version: 1.5.0
943690b17f1bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
943790b17f1bSmrg#
943890b17f1bSmrg# Documentation tools are not always available on all platforms and sometimes
943990b17f1bSmrg# not at the appropriate level. This macro enables a module to test for the
944090b17f1bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
944190b17f1bSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
944290b17f1bSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
944390b17f1bSmrg# --with-doxygen assumes 'auto'.
944490b17f1bSmrg#
944590b17f1bSmrg# Interface to module:
944690b17f1bSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
944790b17f1bSmrg# DOXYGEN:	 returns the path of the doxygen program found
944890b17f1bSmrg#		 returns the path set by the user in the environment
944990b17f1bSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
945090b17f1bSmrg#		  'no' user instructs the module not to use doxygen
945190b17f1bSmrg#
945290b17f1bSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
945390b17f1bSmrg#
945490b17f1bSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
945590b17f1bSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
945690b17f1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
945790b17f1bSmrgAC_ARG_WITH(doxygen,
945890b17f1bSmrg	AS_HELP_STRING([--with-doxygen],
945990b17f1bSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
946090b17f1bSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
946190b17f1bSmrgm4_undefine([_defopt])
946290b17f1bSmrg
946390b17f1bSmrgif test "x$use_doxygen" = x"auto"; then
946490b17f1bSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
946590b17f1bSmrg   if test "x$DOXYGEN" = "x"; then
946690b17f1bSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
946790b17f1bSmrg	have_doxygen=no
946890b17f1bSmrg   else
946990b17f1bSmrg        have_doxygen=yes
947090b17f1bSmrg   fi
947190b17f1bSmrgelif test "x$use_doxygen" = x"yes" ; then
947290b17f1bSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
947390b17f1bSmrg   if test "x$DOXYGEN" = "x"; then
947490b17f1bSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
947590b17f1bSmrg   fi
947690b17f1bSmrg   have_doxygen=yes
947790b17f1bSmrgelif test "x$use_doxygen" = x"no" ; then
947890b17f1bSmrg   if test "x$DOXYGEN" != "x"; then
947990b17f1bSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
948090b17f1bSmrg   fi
948190b17f1bSmrg   have_doxygen=no
948290b17f1bSmrgelse
948390b17f1bSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
948490b17f1bSmrgfi
948590b17f1bSmrgm4_ifval([$1],
948690b17f1bSmrg[if test "$have_doxygen" = yes; then
948790b17f1bSmrg    # scrape the doxygen version
948890b17f1bSmrg    AC_MSG_CHECKING([the doxygen version])
948990b17f1bSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
949090b17f1bSmrg    AC_MSG_RESULT([$doxygen_version])
949190b17f1bSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
949290b17f1bSmrg        [if test "x$use_doxygen" = xauto; then
949390b17f1bSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
949490b17f1bSmrg            have_doxygen=no
949590b17f1bSmrg        else
949690b17f1bSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
949790b17f1bSmrg        fi])
949890b17f1bSmrgfi])
949990b17f1bSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
950090b17f1bSmrg]) # XORG_WITH_DOXYGEN
95017e6fb56fSmrg
950290b17f1bSmrg# XORG_WITH_GROFF([DEFAULT])
950390b17f1bSmrg# ----------------
950490b17f1bSmrg# Minimum version: 1.6.0
950590b17f1bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
950690b17f1bSmrg#
950790b17f1bSmrg# Documentation tools are not always available on all platforms and sometimes
950890b17f1bSmrg# not at the appropriate level. This macro enables a module to test for the
950990b17f1bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
951090b17f1bSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
951190b17f1bSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
951290b17f1bSmrg# --with-groff assumes 'auto'.
951390b17f1bSmrg#
951490b17f1bSmrg# Interface to module:
951590b17f1bSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
951690b17f1bSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
951790b17f1bSmrg# HAVE_GROFF_MS: the -ms macros package
951890b17f1bSmrg# GROFF:	 returns the path of the groff program found
951990b17f1bSmrg#		 returns the path set by the user in the environment
952090b17f1bSmrg# --with-groff:	 'yes' user instructs the module to use groff
952190b17f1bSmrg#		 'no' user instructs the module not to use groff
952290b17f1bSmrg#
952390b17f1bSmrg# Added in version 1.9.0:
952490b17f1bSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
952590b17f1bSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
952690b17f1bSmrg#		   psselect from the psutils package.
952790b17f1bSmrg#		   the ghostcript package. Refer to the grohtml man pages
952890b17f1bSmrg#
952990b17f1bSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
953090b17f1bSmrg#
953190b17f1bSmrg# OS and distros often splits groff in a basic and full package, the former
953290b17f1bSmrg# having the groff program and the later having devices, fonts and macros
953390b17f1bSmrg# Checking for the groff executable is not enough.
953490b17f1bSmrg#
953590b17f1bSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
953690b17f1bSmrg# unset HAVE_GROFF or GROFF env variables.
953790b17f1bSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
953890b17f1bSmrg#
953990b17f1bSmrgAC_DEFUN([XORG_WITH_GROFF],[
954090b17f1bSmrgAC_ARG_VAR([GROFF], [Path to groff command])
954190b17f1bSmrgm4_define([_defopt], m4_default([$1], [auto]))
954290b17f1bSmrgAC_ARG_WITH(groff,
954390b17f1bSmrg	AS_HELP_STRING([--with-groff],
954490b17f1bSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
954590b17f1bSmrg	   [use_groff=$withval], [use_groff=]_defopt)
954690b17f1bSmrgm4_undefine([_defopt])
954790b17f1bSmrg
954890b17f1bSmrgif test "x$use_groff" = x"auto"; then
954990b17f1bSmrg   AC_PATH_PROG([GROFF], [groff])
955090b17f1bSmrg   if test "x$GROFF" = "x"; then
955190b17f1bSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
955290b17f1bSmrg	have_groff=no
955390b17f1bSmrg   else
955490b17f1bSmrg        have_groff=yes
955590b17f1bSmrg   fi
955690b17f1bSmrgelif test "x$use_groff" = x"yes" ; then
955790b17f1bSmrg   AC_PATH_PROG([GROFF], [groff])
955890b17f1bSmrg   if test "x$GROFF" = "x"; then
955990b17f1bSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
956090b17f1bSmrg   fi
956190b17f1bSmrg   have_groff=yes
956290b17f1bSmrgelif test "x$use_groff" = x"no" ; then
956390b17f1bSmrg   if test "x$GROFF" != "x"; then
956490b17f1bSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
956590b17f1bSmrg   fi
956690b17f1bSmrg   have_groff=no
956790b17f1bSmrgelse
956890b17f1bSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
956990b17f1bSmrgfi
95707e6fb56fSmrg
957190b17f1bSmrg# We have groff, test for the presence of the macro packages
957290b17f1bSmrgif test "x$have_groff" = x"yes"; then
957390b17f1bSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
957490b17f1bSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
957590b17f1bSmrg        groff_ms_works=yes
957690b17f1bSmrg    else
957790b17f1bSmrg        groff_ms_works=no
957890b17f1bSmrg    fi
957990b17f1bSmrg    AC_MSG_RESULT([$groff_ms_works])
958090b17f1bSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
958190b17f1bSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
958290b17f1bSmrg        groff_mm_works=yes
958390b17f1bSmrg    else
958490b17f1bSmrg        groff_mm_works=no
958590b17f1bSmrg    fi
958690b17f1bSmrg    AC_MSG_RESULT([$groff_mm_works])
958790b17f1bSmrgfi
95887e6fb56fSmrg
958990b17f1bSmrg# We have groff, test for HTML dependencies, one command per package
959090b17f1bSmrgif test "x$have_groff" = x"yes"; then
959190b17f1bSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
959290b17f1bSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
959390b17f1bSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
959490b17f1bSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
959590b17f1bSmrg      have_groff_html=yes
959690b17f1bSmrg   else
959790b17f1bSmrg      have_groff_html=no
959890b17f1bSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
959990b17f1bSmrg   fi
960090b17f1bSmrgfi
96017e6fb56fSmrg
960290b17f1bSmrg# Set Automake conditionals for Makefiles
960390b17f1bSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
960490b17f1bSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
960590b17f1bSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
960690b17f1bSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
960790b17f1bSmrg]) # XORG_WITH_GROFF
96087e6fb56fSmrg
960990b17f1bSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
961090b17f1bSmrg# ---------------------------------------
961190b17f1bSmrg# Minimum version: 1.6.0
961290b17f1bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
961390b17f1bSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
961490b17f1bSmrg#
961590b17f1bSmrg# Documentation tools are not always available on all platforms and sometimes
961690b17f1bSmrg# not at the appropriate level. This macro enables a module to test for the
961790b17f1bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
961890b17f1bSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
961990b17f1bSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
962090b17f1bSmrg# --with-fop assumes 'auto'.
962190b17f1bSmrg#
962290b17f1bSmrg# Interface to module:
962390b17f1bSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
962490b17f1bSmrg# FOP:	 	returns the path of the fop program found
962590b17f1bSmrg#		returns the path set by the user in the environment
962690b17f1bSmrg# --with-fop: 	'yes' user instructs the module to use fop
962790b17f1bSmrg#		'no' user instructs the module not to use fop
962890b17f1bSmrg#
962990b17f1bSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
963090b17f1bSmrg#
963190b17f1bSmrgAC_DEFUN([XORG_WITH_FOP],[
963290b17f1bSmrgAC_ARG_VAR([FOP], [Path to fop command])
963390b17f1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
963490b17f1bSmrgAC_ARG_WITH(fop,
963590b17f1bSmrg	AS_HELP_STRING([--with-fop],
963690b17f1bSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
963790b17f1bSmrg	   [use_fop=$withval], [use_fop=]_defopt)
963890b17f1bSmrgm4_undefine([_defopt])
963990b17f1bSmrg
964090b17f1bSmrgif test "x$use_fop" = x"auto"; then
964190b17f1bSmrg   AC_PATH_PROG([FOP], [fop])
964290b17f1bSmrg   if test "x$FOP" = "x"; then
964390b17f1bSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
964490b17f1bSmrg	have_fop=no
964590b17f1bSmrg   else
964690b17f1bSmrg        have_fop=yes
964790b17f1bSmrg   fi
964890b17f1bSmrgelif test "x$use_fop" = x"yes" ; then
964990b17f1bSmrg   AC_PATH_PROG([FOP], [fop])
965090b17f1bSmrg   if test "x$FOP" = "x"; then
965190b17f1bSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
965290b17f1bSmrg   fi
965390b17f1bSmrg   have_fop=yes
965490b17f1bSmrgelif test "x$use_fop" = x"no" ; then
965590b17f1bSmrg   if test "x$FOP" != "x"; then
965690b17f1bSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
965790b17f1bSmrg   fi
965890b17f1bSmrg   have_fop=no
965990b17f1bSmrgelse
966090b17f1bSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
966190b17f1bSmrgfi
96627e6fb56fSmrg
966390b17f1bSmrg# Test for a minimum version of fop, if provided.
966490b17f1bSmrgm4_ifval([$1],
966590b17f1bSmrg[if test "$have_fop" = yes; then
966690b17f1bSmrg    # scrape the fop version
966790b17f1bSmrg    AC_MSG_CHECKING([for fop minimum version])
966890b17f1bSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
966990b17f1bSmrg    AC_MSG_RESULT([$fop_version])
967090b17f1bSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
967190b17f1bSmrg        [if test "x$use_fop" = xauto; then
967290b17f1bSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
967390b17f1bSmrg            have_fop=no
967490b17f1bSmrg        else
967590b17f1bSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
967690b17f1bSmrg        fi])
967790b17f1bSmrgfi])
967890b17f1bSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
967990b17f1bSmrg]) # XORG_WITH_FOP
96807e6fb56fSmrg
968190b17f1bSmrg# XORG_WITH_PS2PDF([DEFAULT])
96827e6fb56fSmrg# ----------------
968390b17f1bSmrg# Minimum version: 1.6.0
968490b17f1bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
968590b17f1bSmrg#
968690b17f1bSmrg# Documentation tools are not always available on all platforms and sometimes
968790b17f1bSmrg# not at the appropriate level. This macro enables a module to test for the
968890b17f1bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
968990b17f1bSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
969090b17f1bSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
969190b17f1bSmrg# --with-ps2pdf assumes 'auto'.
969290b17f1bSmrg#
969390b17f1bSmrg# Interface to module:
969490b17f1bSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
969590b17f1bSmrg# PS2PDF:	returns the path of the ps2pdf program found
969690b17f1bSmrg#		returns the path set by the user in the environment
969790b17f1bSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
969890b17f1bSmrg#		 'no' user instructs the module not to use ps2pdf
969990b17f1bSmrg#
970090b17f1bSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
970190b17f1bSmrg#
970290b17f1bSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
970390b17f1bSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
970490b17f1bSmrgm4_define([_defopt], m4_default([$1], [auto]))
970590b17f1bSmrgAC_ARG_WITH(ps2pdf,
970690b17f1bSmrg	AS_HELP_STRING([--with-ps2pdf],
970790b17f1bSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
970890b17f1bSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
970990b17f1bSmrgm4_undefine([_defopt])
971090b17f1bSmrg
971190b17f1bSmrgif test "x$use_ps2pdf" = x"auto"; then
971290b17f1bSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
971390b17f1bSmrg   if test "x$PS2PDF" = "x"; then
971490b17f1bSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
971590b17f1bSmrg	have_ps2pdf=no
971690b17f1bSmrg   else
971790b17f1bSmrg        have_ps2pdf=yes
971890b17f1bSmrg   fi
971990b17f1bSmrgelif test "x$use_ps2pdf" = x"yes" ; then
972090b17f1bSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
972190b17f1bSmrg   if test "x$PS2PDF" = "x"; then
972290b17f1bSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
972390b17f1bSmrg   fi
972490b17f1bSmrg   have_ps2pdf=yes
972590b17f1bSmrgelif test "x$use_ps2pdf" = x"no" ; then
972690b17f1bSmrg   if test "x$PS2PDF" != "x"; then
972790b17f1bSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
972890b17f1bSmrg   fi
972990b17f1bSmrg   have_ps2pdf=no
97307e6fb56fSmrgelse
973190b17f1bSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
97327e6fb56fSmrgfi
973390b17f1bSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
973490b17f1bSmrg]) # XORG_WITH_PS2PDF
97357e6fb56fSmrg
973690b17f1bSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
973790b17f1bSmrg# ----------------
973890b17f1bSmrg# Minimum version: 1.6.0
973990b17f1bSmrg#
974090b17f1bSmrg# Documentation tools are not always available on all platforms and sometimes
974190b17f1bSmrg# not at the appropriate level. This macro enables a builder to skip all
974290b17f1bSmrg# documentation targets except traditional man pages.
974390b17f1bSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
974490b17f1bSmrg# maximum flexibilty in controlling documentation building.
974590b17f1bSmrg# Refer to:
974690b17f1bSmrg# XORG_WITH_XMLTO         --with-xmlto
974790b17f1bSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
974890b17f1bSmrg# XORG_WITH_DOXYGEN       --with-doxygen
974990b17f1bSmrg# XORG_WITH_FOP           --with-fop
975090b17f1bSmrg# XORG_WITH_GROFF         --with-groff
975190b17f1bSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
975290b17f1bSmrg#
975390b17f1bSmrg# Interface to module:
975490b17f1bSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
975590b17f1bSmrg# --enable-docs: 'yes' user instructs the module to generate docs
975690b17f1bSmrg#		 'no' user instructs the module not to generate docs
975790b17f1bSmrg# parm1:	specify the default value, yes or no.
975890b17f1bSmrg#
975990b17f1bSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
976090b17f1bSmrgm4_define([docs_default], m4_default([$1], [yes]))
976190b17f1bSmrgAC_ARG_ENABLE(docs,
976290b17f1bSmrg	AS_HELP_STRING([--enable-docs],
976390b17f1bSmrg	   [Enable building the documentation (default: ]docs_default[)]),
976490b17f1bSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
976590b17f1bSmrgm4_undefine([docs_default])
976690b17f1bSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
976790b17f1bSmrgAC_MSG_CHECKING([whether to build documentation])
976890b17f1bSmrgAC_MSG_RESULT([$build_docs])
976990b17f1bSmrg]) # XORG_ENABLE_DOCS
977090b17f1bSmrg
977190b17f1bSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
977290b17f1bSmrg# ----------------
977390b17f1bSmrg# Minimum version: 1.6.0
977490b17f1bSmrg#
977590b17f1bSmrg# This macro enables a builder to skip all developer documentation.
977690b17f1bSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
977790b17f1bSmrg# maximum flexibilty in controlling documentation building.
977890b17f1bSmrg# Refer to:
977990b17f1bSmrg# XORG_WITH_XMLTO         --with-xmlto
978090b17f1bSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
978190b17f1bSmrg# XORG_WITH_DOXYGEN       --with-doxygen
978290b17f1bSmrg# XORG_WITH_FOP           --with-fop
978390b17f1bSmrg# XORG_WITH_GROFF         --with-groff
978490b17f1bSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
978590b17f1bSmrg#
978690b17f1bSmrg# Interface to module:
978790b17f1bSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
978890b17f1bSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
978990b17f1bSmrg#			'no' user instructs the module not to generate developer docs
979090b17f1bSmrg# parm1:		specify the default value, yes or no.
979190b17f1bSmrg#
979290b17f1bSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
979390b17f1bSmrgm4_define([devel_default], m4_default([$1], [yes]))
979490b17f1bSmrgAC_ARG_ENABLE(devel-docs,
979590b17f1bSmrg	AS_HELP_STRING([--enable-devel-docs],
979690b17f1bSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
979790b17f1bSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
979890b17f1bSmrgm4_undefine([devel_default])
979990b17f1bSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
980090b17f1bSmrgAC_MSG_CHECKING([whether to build developer documentation])
980190b17f1bSmrgAC_MSG_RESULT([$build_devel_docs])
980290b17f1bSmrg]) # XORG_ENABLE_DEVEL_DOCS
980390b17f1bSmrg
980490b17f1bSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
980590b17f1bSmrg# ----------------
980690b17f1bSmrg# Minimum version: 1.6.0
980790b17f1bSmrg#
980890b17f1bSmrg# This macro enables a builder to skip all functional specification targets.
980990b17f1bSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
981090b17f1bSmrg# maximum flexibilty in controlling documentation building.
981190b17f1bSmrg# Refer to:
981290b17f1bSmrg# XORG_WITH_XMLTO         --with-xmlto
981390b17f1bSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
981490b17f1bSmrg# XORG_WITH_DOXYGEN       --with-doxygen
981590b17f1bSmrg# XORG_WITH_FOP           --with-fop
981690b17f1bSmrg# XORG_WITH_GROFF         --with-groff
981790b17f1bSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
981890b17f1bSmrg#
981990b17f1bSmrg# Interface to module:
982090b17f1bSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
982190b17f1bSmrg# --enable-specs:	'yes' user instructs the module to generate specs
982290b17f1bSmrg#			'no' user instructs the module not to generate specs
982390b17f1bSmrg# parm1:		specify the default value, yes or no.
982490b17f1bSmrg#
982590b17f1bSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
982690b17f1bSmrgm4_define([spec_default], m4_default([$1], [yes]))
982790b17f1bSmrgAC_ARG_ENABLE(specs,
982890b17f1bSmrg	AS_HELP_STRING([--enable-specs],
982990b17f1bSmrg	   [Enable building the specs (default: ]spec_default[)]),
983090b17f1bSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
983190b17f1bSmrgm4_undefine([spec_default])
983290b17f1bSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
983390b17f1bSmrgAC_MSG_CHECKING([whether to build functional specifications])
983490b17f1bSmrgAC_MSG_RESULT([$build_specs])
983590b17f1bSmrg]) # XORG_ENABLE_SPECS
983690b17f1bSmrg
983790b17f1bSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
983890b17f1bSmrg# ----------------------------------------------
983990b17f1bSmrg# Minimum version: 1.13.0
984090b17f1bSmrg#
984190b17f1bSmrg# This macro enables a builder to enable/disable unit testing
984290b17f1bSmrg# It makes no assumption about the test cases implementation
984390b17f1bSmrg# Test cases may or may not use Automake "Support for test suites"
984490b17f1bSmrg# They may or may not use the software utility library GLib
984590b17f1bSmrg#
984690b17f1bSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
984790b17f1bSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
984890b17f1bSmrg# The variable enable_unit_tests is used by other macros in this file.
984990b17f1bSmrg#
985090b17f1bSmrg# Interface to module:
985190b17f1bSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
985290b17f1bSmrg# enable_unit_tests:    used in configure.ac for additional configuration
985390b17f1bSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
985490b17f1bSmrg#			'no' user instructs the module not to build tests
985590b17f1bSmrg# parm1:		specify the default value, yes or no.
985690b17f1bSmrg#
985790b17f1bSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
985890b17f1bSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
985990b17f1bSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
986090b17f1bSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
986190b17f1bSmrgm4_define([_defopt], m4_default([$1], [auto]))
986290b17f1bSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
986390b17f1bSmrg	[Enable building unit test cases (default: ]_defopt[)]),
986490b17f1bSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
986590b17f1bSmrgm4_undefine([_defopt])
986690b17f1bSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
986790b17f1bSmrgAC_MSG_CHECKING([whether to build unit test cases])
986890b17f1bSmrgAC_MSG_RESULT([$enable_unit_tests])
986990b17f1bSmrg]) # XORG_ENABLE_UNIT_TESTS
987090b17f1bSmrg
987190b17f1bSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
987290b17f1bSmrg# ------------------------------------------------------
987390b17f1bSmrg# Minimum version: 1.17.0
987490b17f1bSmrg#
987590b17f1bSmrg# This macro enables a builder to enable/disable integration testing
987690b17f1bSmrg# It makes no assumption about the test cases' implementation
987790b17f1bSmrg# Test cases may or may not use Automake "Support for test suites"
987890b17f1bSmrg#
987990b17f1bSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
988090b17f1bSmrg# usually requires less dependencies and may be built and run under less
988190b17f1bSmrg# stringent environments than integration tests.
988290b17f1bSmrg#
988390b17f1bSmrg# Interface to module:
988490b17f1bSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
988590b17f1bSmrg# enable_integration_tests:   used in configure.ac for additional configuration
988690b17f1bSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
988790b17f1bSmrg#                             'no' user instructs the module not to build tests
988890b17f1bSmrg# parm1:                      specify the default value, yes or no.
988990b17f1bSmrg#
989090b17f1bSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
989190b17f1bSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
989290b17f1bSmrgm4_define([_defopt], m4_default([$1], [auto]))
989390b17f1bSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
989490b17f1bSmrg	[Enable building integration test cases (default: ]_defopt[)]),
989590b17f1bSmrg	[enable_integration_tests=$enableval],
989690b17f1bSmrg	[enable_integration_tests=]_defopt)
989790b17f1bSmrgm4_undefine([_defopt])
989890b17f1bSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
989990b17f1bSmrg	[test "x$enable_integration_tests" != xno])
990090b17f1bSmrgAC_MSG_CHECKING([whether to build unit test cases])
990190b17f1bSmrgAC_MSG_RESULT([$enable_integration_tests])
990290b17f1bSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
990390b17f1bSmrg
990490b17f1bSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
990590b17f1bSmrg# ----------------------------------------
990690b17f1bSmrg# Minimum version: 1.13.0
990790b17f1bSmrg#
990890b17f1bSmrg# GLib is a library which provides advanced data structures and functions.
990990b17f1bSmrg# This macro enables a module to test for the presence of Glib.
991090b17f1bSmrg#
991190b17f1bSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
991290b17f1bSmrg# Otherwise the value of $enable_unit_tests is blank.
991390b17f1bSmrg#
991490b17f1bSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
991590b17f1bSmrg# test support usually requires less dependencies and may be built and run under
991690b17f1bSmrg# less stringent environments than integration tests.
991790b17f1bSmrg#
991890b17f1bSmrg# Interface to module:
991990b17f1bSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
992090b17f1bSmrg# with_glib: used in configure.ac to know if GLib has been found
992190b17f1bSmrg# --with-glib:	'yes' user instructs the module to use glib
992290b17f1bSmrg#		'no' user instructs the module not to use glib
992390b17f1bSmrg#
992490b17f1bSmrgAC_DEFUN([XORG_WITH_GLIB],[
992590b17f1bSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
992690b17f1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
992790b17f1bSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
992890b17f1bSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
992990b17f1bSmrg	[with_glib=$withval], [with_glib=]_defopt)
993090b17f1bSmrgm4_undefine([_defopt])
993190b17f1bSmrg
993290b17f1bSmrghave_glib=no
993390b17f1bSmrg# Do not probe GLib if user explicitly disabled unit testing
993490b17f1bSmrgif test "x$enable_unit_tests" != x"no"; then
993590b17f1bSmrg  # Do not probe GLib if user explicitly disabled it
993690b17f1bSmrg  if test "x$with_glib" != x"no"; then
993790b17f1bSmrg    m4_ifval(
993890b17f1bSmrg      [$1],
993990b17f1bSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
994090b17f1bSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
994190b17f1bSmrg    )
994290b17f1bSmrg  fi
994390b17f1bSmrgfi
99447e6fb56fSmrg
994590b17f1bSmrg# Not having GLib when unit testing has been explicitly requested is an error
994690b17f1bSmrgif test "x$enable_unit_tests" = x"yes"; then
994790b17f1bSmrg  if test "x$have_glib" = x"no"; then
994890b17f1bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
99497e6fb56fSmrg  fi
995090b17f1bSmrgfi
99517e6fb56fSmrg
995290b17f1bSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
995390b17f1bSmrgif test "x$enable_unit_tests" = x"no"; then
995490b17f1bSmrg  if test "x$with_glib" = x"yes"; then
995590b17f1bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
995690b17f1bSmrg  fi
995790b17f1bSmrgfi
995890b17f1bSmrg
995990b17f1bSmrg# Not having GLib when it has been explicitly requested is an error
996090b17f1bSmrgif test "x$with_glib" = x"yes"; then
996190b17f1bSmrg  if test "x$have_glib" = x"no"; then
996290b17f1bSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
996390b17f1bSmrg  fi
996490b17f1bSmrgfi
996590b17f1bSmrg
996690b17f1bSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
996790b17f1bSmrg]) # XORG_WITH_GLIB
996890b17f1bSmrg
996990b17f1bSmrg# XORG_LD_WRAP([required|optional])
997090b17f1bSmrg# ---------------------------------
997190b17f1bSmrg# Minimum version: 1.13.0
99727e6fb56fSmrg#
997390b17f1bSmrg# Check if linker supports -wrap, passed via compiler flags
997490b17f1bSmrg#
997590b17f1bSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
997690b17f1bSmrg# Otherwise the value of $enable_unit_tests is blank.
997790b17f1bSmrg#
997890b17f1bSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
997990b17f1bSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
998090b17f1bSmrg# available, an argument of "optional" allows use when some unit tests require
998190b17f1bSmrg# ld -wrap and others do not.
998290b17f1bSmrg#
998390b17f1bSmrgAC_DEFUN([XORG_LD_WRAP],[
998490b17f1bSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
998590b17f1bSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
998690b17f1bSmrg                      void __wrap_exit(int status) { return; }],
998790b17f1bSmrg                     [exit(0);])])
998890b17f1bSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
998990b17f1bSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
999090b17f1bSmrg  if test "x$have_ld_wrap" = x"no"; then
999190b17f1bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
999290b17f1bSmrg  fi
999390b17f1bSmrgfi
999490b17f1bSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
999590b17f1bSmrg#
999690b17f1bSmrg]) # XORG_LD_WRAP
999790b17f1bSmrg
999890b17f1bSmrg# XORG_CHECK_LINKER_FLAGS
999990b17f1bSmrg# -----------------------
1000090b17f1bSmrg# SYNOPSIS
1000190b17f1bSmrg#
1000290b17f1bSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
1000390b17f1bSmrg#
1000490b17f1bSmrg# DESCRIPTION
1000590b17f1bSmrg#
1000690b17f1bSmrg#   Check whether the given linker FLAGS work with the current language's
1000790b17f1bSmrg#   linker, or whether they give an error.
1000890b17f1bSmrg#
1000990b17f1bSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
1001090b17f1bSmrg#   success/failure.
1001190b17f1bSmrg#
1001290b17f1bSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
1001390b17f1bSmrg#
1001490b17f1bSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
1001590b17f1bSmrg#
1001690b17f1bSmrg# LICENSE
1001790b17f1bSmrg#
1001890b17f1bSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
1001990b17f1bSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
1002090b17f1bSmrg#   Copyright (c) 2009 Matteo Frigo
1002190b17f1bSmrg#
1002290b17f1bSmrg#   This program is free software: you can redistribute it and/or modify it
1002390b17f1bSmrg#   under the terms of the GNU General Public License as published by the
1002490b17f1bSmrg#   Free Software Foundation, either version 3 of the License, or (at your
1002590b17f1bSmrg#   option) any later version.
1002690b17f1bSmrg#
1002790b17f1bSmrg#   This program is distributed in the hope that it will be useful, but
1002890b17f1bSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
1002990b17f1bSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1003090b17f1bSmrg#   Public License for more details.
1003190b17f1bSmrg#
1003290b17f1bSmrg#   You should have received a copy of the GNU General Public License along
1003390b17f1bSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
1003490b17f1bSmrg#
1003590b17f1bSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
1003690b17f1bSmrg#   gives unlimited permission to copy, distribute and modify the configure
1003790b17f1bSmrg#   scripts that are the output of Autoconf when processing the Macro. You
1003890b17f1bSmrg#   need not follow the terms of the GNU General Public License when using
1003990b17f1bSmrg#   or distributing such scripts, even though portions of the text of the
1004090b17f1bSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
1004190b17f1bSmrg#   all other use of the material that constitutes the Autoconf Macro.
1004290b17f1bSmrg#
1004390b17f1bSmrg#   This special exception to the GPL applies to versions of the Autoconf
1004490b17f1bSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
1004590b17f1bSmrg#   modified version of the Autoconf Macro, you may extend this special
1004690b17f1bSmrg#   exception to the GPL to apply to your modified version as well.#
1004790b17f1bSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
1004890b17f1bSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
1004990b17f1bSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
1005090b17f1bSmrgAS_LITERAL_IF([$1],
1005190b17f1bSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
1005290b17f1bSmrg      ax_save_FLAGS=$LDFLAGS
1005390b17f1bSmrg      LDFLAGS="$1"
1005490b17f1bSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
1005590b17f1bSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1005690b17f1bSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1005790b17f1bSmrg      LDFLAGS=$ax_save_FLAGS])],
1005890b17f1bSmrg  [ax_save_FLAGS=$LDFLAGS
1005990b17f1bSmrg   LDFLAGS="$1"
1006090b17f1bSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1006190b17f1bSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1006290b17f1bSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1006390b17f1bSmrg   LDFLAGS=$ax_save_FLAGS])
1006490b17f1bSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
1006590b17f1bSmrgAC_MSG_RESULT($xorg_check_linker_flags)
1006690b17f1bSmrgif test "x$xorg_check_linker_flags" = xyes; then
1006790b17f1bSmrg	m4_default([$2], :)
1006890b17f1bSmrgelse
1006990b17f1bSmrg	m4_default([$3], :)
1007090b17f1bSmrgfi
1007190b17f1bSmrg]) # XORG_CHECK_LINKER_FLAGS
1007290b17f1bSmrg
1007390b17f1bSmrg# XORG_MEMORY_CHECK_FLAGS
1007490b17f1bSmrg# -----------------------
1007590b17f1bSmrg# Minimum version: 1.16.0
100767e6fb56fSmrg#
1007790b17f1bSmrg# This macro attempts to find appropriate memory checking functionality
1007890b17f1bSmrg# for various platforms which unit testing code may use to catch various
1007990b17f1bSmrg# forms of memory allocation and access errors in testing.
100807e6fb56fSmrg#
1008190b17f1bSmrg# Interface to module:
1008290b17f1bSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
1008390b17f1bSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
100847e6fb56fSmrg#
1008590b17f1bSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
1008690b17f1bSmrg#
1008790b17f1bSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
100887e6fb56fSmrg
1008990b17f1bSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1009090b17f1bSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
1009190b17f1bSmrg           [Environment variables to enable memory checking in tests])
1009290b17f1bSmrg
1009390b17f1bSmrg# Check for different types of support on different platforms
1009490b17f1bSmrgcase $host_os in
1009590b17f1bSmrg    solaris*)
1009690b17f1bSmrg        AC_CHECK_LIB([umem], [umem_alloc],
1009790b17f1bSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
1009890b17f1bSmrg        ;;
1009990b17f1bSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
1010090b17f1bSmrg        # both directly and inverted, so should not be 0 or 255.
1010190b17f1bSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
1010290b17f1bSmrg        ;;
1010390b17f1bSmrg    darwin*)
1010490b17f1bSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
1010590b17f1bSmrg        ;;
1010690b17f1bSmrg    *bsd*)
1010790b17f1bSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
1010890b17f1bSmrg        ;;
1010990b17f1bSmrgesac
1011090b17f1bSmrg
1011190b17f1bSmrg# User supplied flags override default flags
1011290b17f1bSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
1011390b17f1bSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
101147e6fb56fSmrgfi
101157e6fb56fSmrg
1011690b17f1bSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
1011790b17f1bSmrg]) # XORG_WITH_LINT
1011890b17f1bSmrg
1011990b17f1bSmrg# XORG_CHECK_MALLOC_ZERO
1012090b17f1bSmrg# ----------------------
1012190b17f1bSmrg# Minimum version: 1.0.0
101227e6fb56fSmrg#
1012390b17f1bSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1012490b17f1bSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1012590b17f1bSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1012690b17f1bSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1012790b17f1bSmrgAC_ARG_ENABLE(malloc0returnsnull,
1012890b17f1bSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1012990b17f1bSmrg		       [malloc(0) returns NULL (default: auto)]),
1013090b17f1bSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1013190b17f1bSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1013290b17f1bSmrg
1013390b17f1bSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1013490b17f1bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1013590b17f1bSmrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
1013690b17f1bSmrg#include <stdlib.h>
1013790b17f1bSmrg],[
1013890b17f1bSmrg    char *m0, *r0, *c0, *p;
1013990b17f1bSmrg    m0 = malloc(0);
1014090b17f1bSmrg    p = malloc(10);
1014190b17f1bSmrg    r0 = realloc(p,0);
1014290b17f1bSmrg    c0 = calloc(0,10);
1014390b17f1bSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
1014490b17f1bSmrg])],
1014590b17f1bSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1014690b17f1bSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
1014790b17f1bSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
1014890b17f1bSmrgfi
1014990b17f1bSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1015090b17f1bSmrg
1015190b17f1bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1015290b17f1bSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1015390b17f1bSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1015490b17f1bSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1015590b17f1bSmrgelse
1015690b17f1bSmrg	MALLOC_ZERO_CFLAGS=""
1015790b17f1bSmrg	XMALLOC_ZERO_CFLAGS=""
1015890b17f1bSmrg	XTMALLOC_ZERO_CFLAGS=""
1015990b17f1bSmrgfi
1016090b17f1bSmrg
1016190b17f1bSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1016290b17f1bSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1016390b17f1bSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1016490b17f1bSmrg]) # XORG_CHECK_MALLOC_ZERO
1016590b17f1bSmrg
1016690b17f1bSmrg# XORG_WITH_LINT()
1016790b17f1bSmrg# ----------------
1016890b17f1bSmrg# Minimum version: 1.1.0
101697e6fb56fSmrg#
1017090b17f1bSmrg# This macro enables the use of a tool that flags some suspicious and
1017190b17f1bSmrg# non-portable constructs (likely to be bugs) in C language source code.
1017290b17f1bSmrg# It will attempt to locate the tool and use appropriate options.
1017390b17f1bSmrg# There are various lint type tools on different platforms.
101747e6fb56fSmrg#
1017590b17f1bSmrg# Interface to module:
1017690b17f1bSmrg# LINT:		returns the path to the tool found on the platform
1017790b17f1bSmrg#		or the value set to LINT on the configure cmd line
1017890b17f1bSmrg#		also an Automake conditional
1017990b17f1bSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
1018090b17f1bSmrg#
1018190b17f1bSmrg# --with-lint:	'yes' user instructs the module to use lint
1018290b17f1bSmrg#		'no' user instructs the module not to use lint (default)
1018390b17f1bSmrg#
1018490b17f1bSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1018590b17f1bSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1018690b17f1bSmrg#
1018790b17f1bSmrgAC_DEFUN([XORG_WITH_LINT],[
101887e6fb56fSmrg
1018990b17f1bSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1019090b17f1bSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1019190b17f1bSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1019290b17f1bSmrg		[Use a lint-style source code checker (default: disabled)])],
1019390b17f1bSmrg		[use_lint=$withval], [use_lint=no])
101947e6fb56fSmrg
1019590b17f1bSmrg# Obtain platform specific info like program name and options
1019690b17f1bSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1019790b17f1bSmrgcase $host_os in
1019890b17f1bSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1019990b17f1bSmrg	lint_name=splint
1020090b17f1bSmrg	lint_options="-badflag"
1020190b17f1bSmrg	;;
1020290b17f1bSmrg  *freebsd* | *netbsd*)
1020390b17f1bSmrg	lint_name=lint
1020490b17f1bSmrg	lint_options="-u -b"
1020590b17f1bSmrg	;;
1020690b17f1bSmrg  *solaris*)
1020790b17f1bSmrg	lint_name=lint
1020890b17f1bSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1020990b17f1bSmrg	;;
1021090b17f1bSmrgesac
102117e6fb56fSmrg
1021290b17f1bSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
1021390b17f1bSmrgif test "x$use_lint" = x"yes" ; then
1021490b17f1bSmrg   AC_PATH_PROG([LINT], [$lint_name])
1021590b17f1bSmrg   if test "x$LINT" = "x"; then
1021690b17f1bSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1021790b17f1bSmrg   fi
1021890b17f1bSmrgelif test "x$use_lint" = x"no" ; then
1021990b17f1bSmrg   if test "x$LINT" != "x"; then
1022090b17f1bSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1022190b17f1bSmrg   fi
102227e6fb56fSmrgelse
1022390b17f1bSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1022490b17f1bSmrgfi
102257e6fb56fSmrg
1022690b17f1bSmrg# User supplied flags override default flags
1022790b17f1bSmrgif test "x$LINT_FLAGS" != "x"; then
1022890b17f1bSmrg   lint_options=$LINT_FLAGS
1022990b17f1bSmrgfi
102307e6fb56fSmrg
1023190b17f1bSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
1023290b17f1bSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
1023390b17f1bSmrg
1023490b17f1bSmrg]) # XORG_WITH_LINT
1023590b17f1bSmrg
1023690b17f1bSmrg# XORG_LINT_LIBRARY(LIBNAME)
1023790b17f1bSmrg# --------------------------
1023890b17f1bSmrg# Minimum version: 1.1.0
102397e6fb56fSmrg#
1024090b17f1bSmrg# Sets up flags for building lint libraries for checking programs that call
1024190b17f1bSmrg# functions in the library.
102427e6fb56fSmrg#
1024390b17f1bSmrg# Interface to module:
1024490b17f1bSmrg# LINTLIB		- Automake variable with the name of lint library file to make
1024590b17f1bSmrg# MAKE_LINT_LIB		- Automake conditional
102467e6fb56fSmrg#
1024790b17f1bSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
1024890b17f1bSmrg#			  - 'no' user instructs the module not to create a lint library (default)
1024990b17f1bSmrg
1025090b17f1bSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1025190b17f1bSmrgAC_REQUIRE([XORG_WITH_LINT])
1025290b17f1bSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1025390b17f1bSmrg	[Create lint library (default: disabled)])],
1025490b17f1bSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1025590b17f1bSmrg
1025690b17f1bSmrgif test "x$make_lint_lib" = x"yes" ; then
1025790b17f1bSmrg   LINTLIB=llib-l$1.ln
1025890b17f1bSmrg   if test "x$LINT" = "x"; then
1025990b17f1bSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
1026090b17f1bSmrg   fi
1026190b17f1bSmrgelif test "x$make_lint_lib" != x"no" ; then
1026290b17f1bSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1026390b17f1bSmrgfi
102647e6fb56fSmrg
1026590b17f1bSmrgAC_SUBST(LINTLIB)
1026690b17f1bSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
102677e6fb56fSmrg
1026890b17f1bSmrg]) # XORG_LINT_LIBRARY
102697e6fb56fSmrg
1027090b17f1bSmrg# XORG_COMPILER_BRAND
1027190b17f1bSmrg# -------------------
1027290b17f1bSmrg# Minimum version: 1.14.0
1027390b17f1bSmrg#
1027490b17f1bSmrg# Checks for various brands of compilers and sets flags as appropriate:
1027590b17f1bSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
1027690b17f1bSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
1027790b17f1bSmrg#   clang compiler - sets CLANGCC to "yes"
1027890b17f1bSmrg#   Intel compiler - sets INTELCC to "yes"
1027990b17f1bSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
1028090b17f1bSmrg#
1028190b17f1bSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
1028290b17f1bSmrgAC_LANG_CASE(
1028390b17f1bSmrg	[C], [
1028490b17f1bSmrg		AC_REQUIRE([AC_PROG_CC_C99])
1028590b17f1bSmrg	],
1028690b17f1bSmrg	[C++], [
1028790b17f1bSmrg		AC_REQUIRE([AC_PROG_CXX])
1028890b17f1bSmrg	]
1028990b17f1bSmrg)
1029090b17f1bSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
1029190b17f1bSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1029290b17f1bSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1029390b17f1bSmrg]) # XORG_COMPILER_BRAND
102947e6fb56fSmrg
1029590b17f1bSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
1029690b17f1bSmrg# ---------------
1029790b17f1bSmrg# Minimum version: 1.16.0
1029890b17f1bSmrg#
1029990b17f1bSmrg# Test if the compiler works when passed the given flag as a command line argument.
1030090b17f1bSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
1030190b17f1bSmrg# next flag in the list until there are no more options.
1030290b17f1bSmrg#
1030390b17f1bSmrg# Note that this does not guarantee that the compiler supports the flag as some
1030490b17f1bSmrg# compilers will simply ignore arguments that they do not understand, but we do
1030590b17f1bSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
1030690b17f1bSmrg# -Werror=unused-command-line-argument
1030790b17f1bSmrg#
1030890b17f1bSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
1030990b17f1bSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1031090b17f1bSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1031190b17f1bSmrg
1031290b17f1bSmrgAC_LANG_COMPILER_REQUIRE
1031390b17f1bSmrg
1031490b17f1bSmrgAC_LANG_CASE(
1031590b17f1bSmrg	[C], [
1031690b17f1bSmrg		AC_REQUIRE([AC_PROG_CC_C99])
1031790b17f1bSmrg		define([PREFIX], [C])
1031890b17f1bSmrg		define([CACHE_PREFIX], [cc])
1031990b17f1bSmrg		define([COMPILER], [$CC])
1032090b17f1bSmrg	],
1032190b17f1bSmrg	[C++], [
1032290b17f1bSmrg		define([PREFIX], [CXX])
1032390b17f1bSmrg		define([CACHE_PREFIX], [cxx])
1032490b17f1bSmrg		define([COMPILER], [$CXX])
1032590b17f1bSmrg	]
1032690b17f1bSmrg)
103277e6fb56fSmrg
1032890b17f1bSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
1032990b17f1bSmrg
1033090b17f1bSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
1033190b17f1bSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1033290b17f1bSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
1033390b17f1bSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
1033490b17f1bSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1033590b17f1bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
1033690b17f1bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
1033790b17f1bSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
1033890b17f1bSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1033990b17f1bSmrgfi
103407e6fb56fSmrg
1034190b17f1bSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
1034290b17f1bSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
1034390b17f1bSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1034490b17f1bSmrg	fi
1034590b17f1bSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1034690b17f1bSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
1034790b17f1bSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
1034890b17f1bSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1034990b17f1bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
1035090b17f1bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
1035190b17f1bSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
1035290b17f1bSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1035390b17f1bSmrgfi
103547e6fb56fSmrg
1035590b17f1bSmrgfound="no"
1035690b17f1bSmrgm4_foreach([flag], m4_cdr($@), [
1035790b17f1bSmrg	if test $found = "no" ; then
1035890b17f1bSmrg		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
1035990b17f1bSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1036090b17f1bSmrg		fi
1036190b17f1bSmrg
1036290b17f1bSmrg		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
1036390b17f1bSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1036490b17f1bSmrg		fi
1036590b17f1bSmrg
1036690b17f1bSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
1036790b17f1bSmrg
1036890b17f1bSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
1036990b17f1bSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports]flag[])
1037090b17f1bSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
1037190b17f1bSmrg		AC_CACHE_VAL($cacheid,
1037290b17f1bSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
1037390b17f1bSmrg					     [eval $cacheid=yes],
1037490b17f1bSmrg					     [eval $cacheid=no])])
1037590b17f1bSmrg
1037690b17f1bSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1037790b17f1bSmrg
1037890b17f1bSmrg		eval supported=\$$cacheid
1037990b17f1bSmrg		AC_MSG_RESULT([$supported])
1038090b17f1bSmrg		if test "$supported" = "yes" ; then
1038190b17f1bSmrg			$1="$$1 ]flag["
1038290b17f1bSmrg			found="yes"
1038390b17f1bSmrg		fi
1038490b17f1bSmrg	fi
1038590b17f1bSmrg])
1038690b17f1bSmrg]) # XORG_TESTSET_CFLAG
103877e6fb56fSmrg
1038890b17f1bSmrg# XORG_COMPILER_FLAGS
1038990b17f1bSmrg# ---------------
1039090b17f1bSmrg# Minimum version: 1.16.0
1039190b17f1bSmrg#
1039290b17f1bSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
1039390b17f1bSmrg# arguments supported by the selected compiler which do NOT alter the generated
1039490b17f1bSmrg# code.  These arguments will cause the compiler to print various warnings
1039590b17f1bSmrg# during compilation AND turn a conservative set of warnings into errors.
1039690b17f1bSmrg#
1039790b17f1bSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
1039890b17f1bSmrg# future versions of util-macros as options are added to new compilers.
1039990b17f1bSmrg#
1040090b17f1bSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
1040190b17f1bSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1040290b17f1bSmrg
1040390b17f1bSmrgAC_ARG_ENABLE(selective-werror,
1040490b17f1bSmrg              AS_HELP_STRING([--disable-selective-werror],
1040590b17f1bSmrg                             [Turn off selective compiler errors. (default: enabled)]),
1040690b17f1bSmrg              [SELECTIVE_WERROR=$enableval],
1040790b17f1bSmrg              [SELECTIVE_WERROR=yes])
1040890b17f1bSmrg
1040990b17f1bSmrgAC_LANG_CASE(
1041090b17f1bSmrg        [C], [
1041190b17f1bSmrg                define([PREFIX], [C])
1041290b17f1bSmrg        ],
1041390b17f1bSmrg        [C++], [
1041490b17f1bSmrg                define([PREFIX], [CXX])
1041590b17f1bSmrg        ]
1041690b17f1bSmrg)
1041790b17f1bSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
1041890b17f1bSmrgif test "x$SUNCC" = "xyes"; then
1041990b17f1bSmrg    [BASE_]PREFIX[FLAGS]="-v"
1042090b17f1bSmrgelse
1042190b17f1bSmrg    [BASE_]PREFIX[FLAGS]=""
1042290b17f1bSmrgfi
104237e6fb56fSmrg
1042490b17f1bSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
1042590b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
1042690b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
1042790b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
1042890b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
1042990b17f1bSmrg
1043090b17f1bSmrgAC_LANG_CASE(
1043190b17f1bSmrg	[C], [
1043290b17f1bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
1043390b17f1bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
1043490b17f1bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
1043590b17f1bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
1043690b17f1bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
1043790b17f1bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
1043890b17f1bSmrg	]
1043990b17f1bSmrg)
104407e6fb56fSmrg
1044190b17f1bSmrg# This chunk adds additional warnings that could catch undesired effects.
1044290b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
1044390b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
1044490b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
1044590b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
1044690b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
1044790b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
1044890b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
1044990b17f1bSmrg
1045090b17f1bSmrg# These are currently disabled because they are noisy.  They will be enabled
1045190b17f1bSmrg# in the future once the codebase is sufficiently modernized to silence
1045290b17f1bSmrg# them.  For now, I don't want them to drown out the other warnings.
1045390b17f1bSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
1045490b17f1bSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
1045590b17f1bSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
1045690b17f1bSmrg
1045790b17f1bSmrg# Turn some warnings into errors, so we don't accidently get successful builds
1045890b17f1bSmrg# when there are problems that should be fixed.
1045990b17f1bSmrg
1046090b17f1bSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
1046190b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
1046290b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
1046390b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
1046490b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
1046590b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
1046690b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
1046790b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
1046890b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
1046990b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
1047090b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
1047190b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
1047290b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
1047390b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
104747e6fb56fSmrgelse
1047590b17f1bSmrgAC_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])
1047690b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
1047790b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
1047890b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
1047990b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
1048090b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
1048190b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
1048290b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
1048390b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
1048490b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
1048590b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
1048690b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
1048790b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
1048890b17f1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
1048990b17f1bSmrgfi
1049090b17f1bSmrg
1049190b17f1bSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1049290b17f1bSmrg]) # XORG_COMPILER_FLAGS
1049390b17f1bSmrg
1049490b17f1bSmrg# XORG_CWARNFLAGS
1049590b17f1bSmrg# ---------------
1049690b17f1bSmrg# Minimum version: 1.2.0
1049790b17f1bSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
1049890b17f1bSmrg#
1049990b17f1bSmrg# Defines CWARNFLAGS to enable C compiler warnings.
1050090b17f1bSmrg#
1050190b17f1bSmrg# This function is deprecated because it defines -fno-strict-aliasing
1050290b17f1bSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
1050390b17f1bSmrg# is needed, then it should be added explicitly in the module when
1050490b17f1bSmrg# it is updated to use BASE_CFLAGS.
1050590b17f1bSmrg#
1050690b17f1bSmrgAC_DEFUN([XORG_CWARNFLAGS], [
1050790b17f1bSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1050890b17f1bSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1050990b17f1bSmrgAC_LANG_CASE(
1051090b17f1bSmrg	[C], [
1051190b17f1bSmrg		CWARNFLAGS="$BASE_CFLAGS"
1051290b17f1bSmrg		if  test "x$GCC" = xyes ; then
1051390b17f1bSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
1051490b17f1bSmrg		fi
1051590b17f1bSmrg		AC_SUBST(CWARNFLAGS)
1051690b17f1bSmrg	]
1051790b17f1bSmrg)
1051890b17f1bSmrg]) # XORG_CWARNFLAGS
1051990b17f1bSmrg
1052090b17f1bSmrg# XORG_STRICT_OPTION
1052190b17f1bSmrg# -----------------------
1052290b17f1bSmrg# Minimum version: 1.3.0
1052390b17f1bSmrg#
1052490b17f1bSmrg# Add configure option to enable strict compilation flags, such as treating
1052590b17f1bSmrg# warnings as fatal errors.
1052690b17f1bSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
1052790b17f1bSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
1052890b17f1bSmrg#
1052990b17f1bSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
1053090b17f1bSmrg# when strict compilation is unconditionally desired.
1053190b17f1bSmrgAC_DEFUN([XORG_STRICT_OPTION], [
1053290b17f1bSmrgAC_REQUIRE([XORG_CWARNFLAGS])
1053390b17f1bSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1053490b17f1bSmrg
1053590b17f1bSmrgAC_ARG_ENABLE(strict-compilation,
1053690b17f1bSmrg			  AS_HELP_STRING([--enable-strict-compilation],
1053790b17f1bSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1053890b17f1bSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1053990b17f1bSmrg
1054090b17f1bSmrgAC_LANG_CASE(
1054190b17f1bSmrg        [C], [
1054290b17f1bSmrg                define([PREFIX], [C])
1054390b17f1bSmrg        ],
1054490b17f1bSmrg        [C++], [
1054590b17f1bSmrg                define([PREFIX], [CXX])
1054690b17f1bSmrg        ]
1054790b17f1bSmrg)
1054890b17f1bSmrg
1054990b17f1bSmrg[STRICT_]PREFIX[FLAGS]=""
1055090b17f1bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
1055190b17f1bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
1055290b17f1bSmrg
1055390b17f1bSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
1055490b17f1bSmrg# activate it with -Werror, so we add it here explicitly.
1055590b17f1bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
1055690b17f1bSmrg
1055790b17f1bSmrgif test "x$STRICT_COMPILE" = "xyes"; then
1055890b17f1bSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
1055990b17f1bSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
1056090b17f1bSmrgfi
1056190b17f1bSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
1056290b17f1bSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1056390b17f1bSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
1056490b17f1bSmrg]) # XORG_STRICT_OPTION
1056590b17f1bSmrg
1056690b17f1bSmrg# XORG_DEFAULT_OPTIONS
1056790b17f1bSmrg# --------------------
1056890b17f1bSmrg# Minimum version: 1.3.0
1056990b17f1bSmrg#
1057090b17f1bSmrg# Defines default options for X.Org modules.
1057190b17f1bSmrg#
1057290b17f1bSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1057390b17f1bSmrgAC_REQUIRE([AC_PROG_INSTALL])
1057490b17f1bSmrgXORG_COMPILER_FLAGS
1057590b17f1bSmrgXORG_CWARNFLAGS
1057690b17f1bSmrgXORG_STRICT_OPTION
1057790b17f1bSmrgXORG_RELEASE_VERSION
1057890b17f1bSmrgXORG_CHANGELOG
1057990b17f1bSmrgXORG_INSTALL
1058090b17f1bSmrgXORG_MANPAGE_SECTIONS
1058190b17f1bSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1058290b17f1bSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1058390b17f1bSmrg]) # XORG_DEFAULT_OPTIONS
1058490b17f1bSmrg
1058590b17f1bSmrg# XORG_INSTALL()
1058690b17f1bSmrg# ----------------
1058790b17f1bSmrg# Minimum version: 1.4.0
1058890b17f1bSmrg#
1058990b17f1bSmrg# Defines the variable INSTALL_CMD as the command to copy
1059090b17f1bSmrg# INSTALL from $prefix/share/util-macros.
1059190b17f1bSmrg#
1059290b17f1bSmrgAC_DEFUN([XORG_INSTALL], [
1059390b17f1bSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1059490b17f1bSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1059590b17f1bSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1059690b17f1bSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1059790b17f1bSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1059890b17f1bSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1059990b17f1bSmrgAC_SUBST([INSTALL_CMD])
1060090b17f1bSmrg]) # XORG_INSTALL
1060190b17f1bSmrgdnl Copyright 2005 Red Hat, Inc
1060290b17f1bSmrgdnl
1060390b17f1bSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1060490b17f1bSmrgdnl documentation for any purpose is hereby granted without fee, provided that
1060590b17f1bSmrgdnl the above copyright notice appear in all copies and that both that
1060690b17f1bSmrgdnl copyright notice and this permission notice appear in supporting
1060790b17f1bSmrgdnl documentation.
1060890b17f1bSmrgdnl
1060990b17f1bSmrgdnl The above copyright notice and this permission notice shall be included
1061090b17f1bSmrgdnl in all copies or substantial portions of the Software.
1061190b17f1bSmrgdnl
1061290b17f1bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1061390b17f1bSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1061490b17f1bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1061590b17f1bSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1061690b17f1bSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1061790b17f1bSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1061890b17f1bSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
1061990b17f1bSmrgdnl
1062090b17f1bSmrgdnl Except as contained in this notice, the name of the copyright holders shall
1062190b17f1bSmrgdnl not be used in advertising or otherwise to promote the sale, use or
1062290b17f1bSmrgdnl other dealings in this Software without prior written authorization
1062390b17f1bSmrgdnl from the copyright holders.
1062490b17f1bSmrgdnl
1062590b17f1bSmrg
1062690b17f1bSmrg# XORG_RELEASE_VERSION
1062790b17f1bSmrg# --------------------
1062890b17f1bSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1062990b17f1bSmrg 
1063090b17f1bSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1063190b17f1bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1063290b17f1bSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1063390b17f1bSmrg		[Major version of this package])
1063490b17f1bSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1063590b17f1bSmrg	if test "x$PVM" = "x"; then
1063690b17f1bSmrg		PVM="0"
1063790b17f1bSmrg	fi
1063890b17f1bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1063990b17f1bSmrg		[$PVM],
1064090b17f1bSmrg		[Minor version of this package])
1064190b17f1bSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1064290b17f1bSmrg	if test "x$PVP" = "x"; then
1064390b17f1bSmrg		PVP="0"
1064490b17f1bSmrg	fi
1064590b17f1bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1064690b17f1bSmrg		[$PVP],
1064790b17f1bSmrg		[Patch version of this package])
1064890b17f1bSmrg])
106497e6fb56fSmrg
1065090b17f1bSmrg# XORG_CHANGELOG()
1065190b17f1bSmrg# ----------------
1065290b17f1bSmrg# Minimum version: 1.2.0
1065390b17f1bSmrg#
1065490b17f1bSmrg# Defines the variable CHANGELOG_CMD as the command to generate
1065590b17f1bSmrg# ChangeLog from git.
1065690b17f1bSmrg#
1065790b17f1bSmrg#
1065890b17f1bSmrgAC_DEFUN([XORG_CHANGELOG], [
1065990b17f1bSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1066090b17f1bSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1066190b17f1bSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1066290b17f1bSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1066390b17f1bSmrgAC_SUBST([CHANGELOG_CMD])
1066490b17f1bSmrg]) # XORG_CHANGELOG
1066590b17f1bSmrg
1066690b17f1bSmrg# Copyright (C) 2002-2012 Free Software Foundation, Inc.
106677e6fb56fSmrg#
106687e6fb56fSmrg# This file is free software; the Free Software Foundation
106697e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
106707e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
106717e6fb56fSmrg
1067290b17f1bSmrg# serial 8
1067390b17f1bSmrg
106747e6fb56fSmrg# AM_AUTOMAKE_VERSION(VERSION)
106757e6fb56fSmrg# ----------------------------
106767e6fb56fSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
106777e6fb56fSmrg# generated from the m4 files accompanying Automake X.Y.
106787e6fb56fSmrg# (This private macro should not be called outside this file.)
106797e6fb56fSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
1068090b17f1bSmrg[am__api_version='1.12'
106817e6fb56fSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
106827e6fb56fSmrgdnl require some minimum version.  Point them to the right macro.
1068390b17f1bSmrgm4_if([$1], [1.12.2], [],
106847e6fb56fSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
106857e6fb56fSmrg])
106867e6fb56fSmrg
106877e6fb56fSmrg# _AM_AUTOCONF_VERSION(VERSION)
106887e6fb56fSmrg# -----------------------------
106897e6fb56fSmrg# aclocal traces this macro to find the Autoconf version.
106907e6fb56fSmrg# This is a private macro too.  Using m4_define simplifies
106917e6fb56fSmrg# the logic in aclocal, which can simply ignore this definition.
106927e6fb56fSmrgm4_define([_AM_AUTOCONF_VERSION], [])
106937e6fb56fSmrg
106947e6fb56fSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
106957e6fb56fSmrg# -------------------------------
106967e6fb56fSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
106977e6fb56fSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
106987e6fb56fSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1069990b17f1bSmrg[AM_AUTOMAKE_VERSION([1.12.2])dnl
107007e6fb56fSmrgm4_ifndef([AC_AUTOCONF_VERSION],
107017e6fb56fSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
107027e6fb56fSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
107037e6fb56fSmrg
107047e6fb56fSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
107057e6fb56fSmrg
1070690b17f1bSmrg# Copyright (C) 2001-2012 Free Software Foundation, Inc.
107077e6fb56fSmrg#
107087e6fb56fSmrg# This file is free software; the Free Software Foundation
107097e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
107107e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
107117e6fb56fSmrg
1071290b17f1bSmrg# serial 2
1071390b17f1bSmrg
107147e6fb56fSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1071590b17f1bSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
1071690b17f1bSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
107177e6fb56fSmrg#
107187e6fb56fSmrg# Of course, Automake must honor this variable whenever it calls a
107197e6fb56fSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
107207e6fb56fSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
107217e6fb56fSmrg# depending on how configure is run.  This is pretty annoying, since
107227e6fb56fSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
107237e6fb56fSmrg# source directory, any form will work fine, but in subdirectories a
107247e6fb56fSmrg# relative path needs to be adjusted first.
107257e6fb56fSmrg#
107267e6fb56fSmrg# $ac_aux_dir/missing
107277e6fb56fSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
107287e6fb56fSmrg# $top_srcdir/$ac_aux_dir/missing
107297e6fb56fSmrg#    fails if $ac_aux_dir is absolute,
107307e6fb56fSmrg#    fails when called from a subdirectory in a VPATH build with
107317e6fb56fSmrg#          a relative $ac_aux_dir
107327e6fb56fSmrg#
107337e6fb56fSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
107347e6fb56fSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
1073590b17f1bSmrg# harmless because $srcdir is '.', but things will broke when you
107367e6fb56fSmrg# start a VPATH build or use an absolute $srcdir.
107377e6fb56fSmrg#
107387e6fb56fSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
107397e6fb56fSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
107407e6fb56fSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
107417e6fb56fSmrg# and then we would define $MISSING as
107427e6fb56fSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
107437e6fb56fSmrg# This will work as long as MISSING is not called from configure, because
107447e6fb56fSmrg# unfortunately $(top_srcdir) has no meaning in configure.
107457e6fb56fSmrg# However there are other variables, like CC, which are often used in
107467e6fb56fSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
107477e6fb56fSmrg#
107487e6fb56fSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
107497e6fb56fSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
107507e6fb56fSmrg# configured tree to be moved without reconfiguration.
107517e6fb56fSmrg
107527e6fb56fSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
107537e6fb56fSmrg[dnl Rely on autoconf to set up CDPATH properly.
107547e6fb56fSmrgAC_PREREQ([2.50])dnl
107557e6fb56fSmrg# expand $ac_aux_dir to an absolute path
107567e6fb56fSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
107577e6fb56fSmrg])
107587e6fb56fSmrg
107597e6fb56fSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
107607e6fb56fSmrg
1076190b17f1bSmrg# Copyright (C) 1997-2012 Free Software Foundation, Inc.
107627e6fb56fSmrg#
107637e6fb56fSmrg# This file is free software; the Free Software Foundation
107647e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
107657e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
107667e6fb56fSmrg
1076790b17f1bSmrg# serial 10
107687e6fb56fSmrg
107697e6fb56fSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
107707e6fb56fSmrg# -------------------------------------
107717e6fb56fSmrg# Define a conditional.
107727e6fb56fSmrgAC_DEFUN([AM_CONDITIONAL],
1077390b17f1bSmrg[AC_PREREQ([2.52])dnl
1077490b17f1bSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1077590b17f1bSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
107767e6fb56fSmrgAC_SUBST([$1_TRUE])dnl
107777e6fb56fSmrgAC_SUBST([$1_FALSE])dnl
107787e6fb56fSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
107797e6fb56fSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
107807e6fb56fSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
107817e6fb56fSmrgif $2; then
107827e6fb56fSmrg  $1_TRUE=
107837e6fb56fSmrg  $1_FALSE='#'
107847e6fb56fSmrgelse
107857e6fb56fSmrg  $1_TRUE='#'
107867e6fb56fSmrg  $1_FALSE=
107877e6fb56fSmrgfi
107887e6fb56fSmrgAC_CONFIG_COMMANDS_PRE(
107897e6fb56fSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
107907e6fb56fSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
107917e6fb56fSmrgUsually this means the macro was only invoked conditionally.]])
107927e6fb56fSmrgfi])])
107937e6fb56fSmrg
1079490b17f1bSmrg# Copyright (C) 1999-2012 Free Software Foundation, Inc.
107957e6fb56fSmrg#
107967e6fb56fSmrg# This file is free software; the Free Software Foundation
107977e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
107987e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
107997e6fb56fSmrg
1080090b17f1bSmrg# serial 17
108017e6fb56fSmrg
1080290b17f1bSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
108037e6fb56fSmrg# written in clear, in which case automake, when reading aclocal.m4,
108047e6fb56fSmrg# will think it sees a *use*, and therefore will trigger all it's
108057e6fb56fSmrg# C support machinery.  Also note that it means that autoscan, seeing
108067e6fb56fSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
108077e6fb56fSmrg
108087e6fb56fSmrg
108097e6fb56fSmrg# _AM_DEPENDENCIES(NAME)
108107e6fb56fSmrg# ----------------------
108117e6fb56fSmrg# See how the compiler implements dependency checking.
1081290b17f1bSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
108137e6fb56fSmrg# We try a few techniques and use that to set a single cache variable.
108147e6fb56fSmrg#
108157e6fb56fSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
108167e6fb56fSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
108177e6fb56fSmrg# dependency, and given that the user is not expected to run this macro,
108187e6fb56fSmrg# just rely on AC_PROG_CC.
108197e6fb56fSmrgAC_DEFUN([_AM_DEPENDENCIES],
108207e6fb56fSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
108217e6fb56fSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
108227e6fb56fSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
108237e6fb56fSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
108247e6fb56fSmrg
1082590b17f1bSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
1082690b17f1bSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
1082790b17f1bSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1082890b17f1bSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
1082990b17f1bSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
1083090b17f1bSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1083190b17f1bSmrg                    [depcc="$$1"   am_compiler_list=])
108327e6fb56fSmrg
108337e6fb56fSmrgAC_CACHE_CHECK([dependency style of $depcc],
108347e6fb56fSmrg               [am_cv_$1_dependencies_compiler_type],
108357e6fb56fSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
108367e6fb56fSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
108377e6fb56fSmrg  # making bogus files that we don't know about and never remove.  For
108387e6fb56fSmrg  # instance it was reported that on HP-UX the gcc test will end up
1083990b17f1bSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
1084090b17f1bSmrg  # in D".
1084190b17f1bSmrg  rm -rf conftest.dir
108427e6fb56fSmrg  mkdir conftest.dir
108437e6fb56fSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
108447e6fb56fSmrg  # using a relative directory.
108457e6fb56fSmrg  cp "$am_depcomp" conftest.dir
108467e6fb56fSmrg  cd conftest.dir
108477e6fb56fSmrg  # We will build objects and dependencies in a subdirectory because
108487e6fb56fSmrg  # it helps to detect inapplicable dependency modes.  For instance
108497e6fb56fSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
108507e6fb56fSmrg  # side effect of compilation, but ICC will put the dependencies in
108517e6fb56fSmrg  # the current directory while Tru64 will put them in the object
108527e6fb56fSmrg  # directory.
108537e6fb56fSmrg  mkdir sub
108547e6fb56fSmrg
108557e6fb56fSmrg  am_cv_$1_dependencies_compiler_type=none
108567e6fb56fSmrg  if test "$am_compiler_list" = ""; then
108577e6fb56fSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
108587e6fb56fSmrg  fi
108597e6fb56fSmrg  am__universal=false
108607e6fb56fSmrg  m4_case([$1], [CC],
108617e6fb56fSmrg    [case " $depcc " in #(
108627e6fb56fSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
108637e6fb56fSmrg     esac],
108647e6fb56fSmrg    [CXX],
108657e6fb56fSmrg    [case " $depcc " in #(
108667e6fb56fSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
108677e6fb56fSmrg     esac])
108687e6fb56fSmrg
108697e6fb56fSmrg  for depmode in $am_compiler_list; do
108707e6fb56fSmrg    # Setup a source with many dependencies, because some compilers
108717e6fb56fSmrg    # like to wrap large dependency lists on column 80 (with \), and
108727e6fb56fSmrg    # we should not choose a depcomp mode which is confused by this.
108737e6fb56fSmrg    #
108747e6fb56fSmrg    # We need to recreate these files for each test, as the compiler may
108757e6fb56fSmrg    # overwrite some of them when testing with obscure command lines.
108767e6fb56fSmrg    # This happens at least with the AIX C compiler.
108777e6fb56fSmrg    : > sub/conftest.c
108787e6fb56fSmrg    for i in 1 2 3 4 5 6; do
108797e6fb56fSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
1088090b17f1bSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
1088190b17f1bSmrg      # Solaris 10 /bin/sh.
1088290b17f1bSmrg      echo '/* dummy */' > sub/conftst$i.h
108837e6fb56fSmrg    done
108847e6fb56fSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
108857e6fb56fSmrg
1088690b17f1bSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
108877e6fb56fSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
1088890b17f1bSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
1088990b17f1bSmrg    # versions had trouble with output in subdirs.
108907e6fb56fSmrg    am__obj=sub/conftest.${OBJEXT-o}
108917e6fb56fSmrg    am__minus_obj="-o $am__obj"
108927e6fb56fSmrg    case $depmode in
108937e6fb56fSmrg    gcc)
108947e6fb56fSmrg      # This depmode causes a compiler race in universal mode.
108957e6fb56fSmrg      test "$am__universal" = false || continue
108967e6fb56fSmrg      ;;
108977e6fb56fSmrg    nosideeffect)
1089890b17f1bSmrg      # After this tag, mechanisms are not by side-effect, so they'll
1089990b17f1bSmrg      # only be used when explicitly requested.
109007e6fb56fSmrg      if test "x$enable_dependency_tracking" = xyes; then
109017e6fb56fSmrg	continue
109027e6fb56fSmrg      else
109037e6fb56fSmrg	break
109047e6fb56fSmrg      fi
109057e6fb56fSmrg      ;;
1090690b17f1bSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
1090790b17f1bSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
109087e6fb56fSmrg      # not run yet.  These depmodes are late enough in the game, and
109097e6fb56fSmrg      # so weak that their functioning should not be impacted.
109107e6fb56fSmrg      am__obj=conftest.${OBJEXT-o}
109117e6fb56fSmrg      am__minus_obj=
109127e6fb56fSmrg      ;;
109137e6fb56fSmrg    none) break ;;
109147e6fb56fSmrg    esac
109157e6fb56fSmrg    if depmode=$depmode \
109167e6fb56fSmrg       source=sub/conftest.c object=$am__obj \
109177e6fb56fSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
109187e6fb56fSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
109197e6fb56fSmrg         >/dev/null 2>conftest.err &&
109207e6fb56fSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
109217e6fb56fSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
109227e6fb56fSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
109237e6fb56fSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
109247e6fb56fSmrg      # icc doesn't choke on unknown options, it will just issue warnings
109257e6fb56fSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
109267e6fb56fSmrg      # that says an option was ignored or not supported.
109277e6fb56fSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
109287e6fb56fSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
109297e6fb56fSmrg      # The diagnosis changed in icc 8.0:
109307e6fb56fSmrg      #   icc: Command line remark: option '-MP' not supported
109317e6fb56fSmrg      if (grep 'ignoring option' conftest.err ||
109327e6fb56fSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
109337e6fb56fSmrg        am_cv_$1_dependencies_compiler_type=$depmode
109347e6fb56fSmrg        break
109357e6fb56fSmrg      fi
109367e6fb56fSmrg    fi
109377e6fb56fSmrg  done
109387e6fb56fSmrg
109397e6fb56fSmrg  cd ..
109407e6fb56fSmrg  rm -rf conftest.dir
109417e6fb56fSmrgelse
109427e6fb56fSmrg  am_cv_$1_dependencies_compiler_type=none
109437e6fb56fSmrgfi
109447e6fb56fSmrg])
109457e6fb56fSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
109467e6fb56fSmrgAM_CONDITIONAL([am__fastdep$1], [
109477e6fb56fSmrg  test "x$enable_dependency_tracking" != xno \
109487e6fb56fSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
109497e6fb56fSmrg])
109507e6fb56fSmrg
109517e6fb56fSmrg
109527e6fb56fSmrg# AM_SET_DEPDIR
109537e6fb56fSmrg# -------------
109547e6fb56fSmrg# Choose a directory name for dependency files.
1095590b17f1bSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
109567e6fb56fSmrgAC_DEFUN([AM_SET_DEPDIR],
109577e6fb56fSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
109587e6fb56fSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
109597e6fb56fSmrg])
109607e6fb56fSmrg
109617e6fb56fSmrg
109627e6fb56fSmrg# AM_DEP_TRACK
109637e6fb56fSmrg# ------------
109647e6fb56fSmrgAC_DEFUN([AM_DEP_TRACK],
1096590b17f1bSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
1096690b17f1bSmrgAS_HELP_STRING(
1096790b17f1bSmrg  [--enable-dependency-tracking],
1096890b17f1bSmrg  [do not reject slow dependency extractors])
1096990b17f1bSmrgAS_HELP_STRING(
1097090b17f1bSmrg  [--disable-dependency-tracking],
1097190b17f1bSmrg  [speeds up one-time build])])
109727e6fb56fSmrgif test "x$enable_dependency_tracking" != xno; then
109737e6fb56fSmrg  am_depcomp="$ac_aux_dir/depcomp"
109747e6fb56fSmrg  AMDEPBACKSLASH='\'
1097590b17f1bSmrg  am__nodep='_no'
109767e6fb56fSmrgfi
109777e6fb56fSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
109787e6fb56fSmrgAC_SUBST([AMDEPBACKSLASH])dnl
109797e6fb56fSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1098090b17f1bSmrgAC_SUBST([am__nodep])dnl
1098190b17f1bSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
109827e6fb56fSmrg])
109837e6fb56fSmrg
109847e6fb56fSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
109857e6fb56fSmrg
1098690b17f1bSmrg# Copyright (C) 1999-2012 Free Software Foundation, Inc.
109877e6fb56fSmrg#
109887e6fb56fSmrg# This file is free software; the Free Software Foundation
109897e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
109907e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
109917e6fb56fSmrg
1099290b17f1bSmrg# serial 6
109937e6fb56fSmrg
109947e6fb56fSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
109957e6fb56fSmrg# ------------------------------
109967e6fb56fSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
109977e6fb56fSmrg[{
109987e6fb56fSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
109997e6fb56fSmrg  # are listed without --file.  Let's play safe and only enable the eval
110007e6fb56fSmrg  # if we detect the quoting.
110017e6fb56fSmrg  case $CONFIG_FILES in
110027e6fb56fSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
110037e6fb56fSmrg  *)   set x $CONFIG_FILES ;;
110047e6fb56fSmrg  esac
110057e6fb56fSmrg  shift
110067e6fb56fSmrg  for mf
110077e6fb56fSmrg  do
110087e6fb56fSmrg    # Strip MF so we end up with the name of the file.
110097e6fb56fSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
110107e6fb56fSmrg    # Check whether this is an Automake generated Makefile or not.
1101190b17f1bSmrg    # We used to match only the files named 'Makefile.in', but
110127e6fb56fSmrg    # some people rename them; so instead we look at the file content.
110137e6fb56fSmrg    # Grep'ing the first line is not enough: some people post-process
110147e6fb56fSmrg    # each Makefile.in and add a new line on top of each file to say so.
110157e6fb56fSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
110167e6fb56fSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
110177e6fb56fSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
110187e6fb56fSmrg      dirpart=`AS_DIRNAME("$mf")`
110197e6fb56fSmrg    else
110207e6fb56fSmrg      continue
110217e6fb56fSmrg    fi
110227e6fb56fSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
1102390b17f1bSmrg    # from the Makefile without running 'make'.
110247e6fb56fSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
110257e6fb56fSmrg    test -z "$DEPDIR" && continue
110267e6fb56fSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
110277e6fb56fSmrg    test -z "am__include" && continue
110287e6fb56fSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
110297e6fb56fSmrg    # Find all dependency output files, they are included files with
110307e6fb56fSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
110317e6fb56fSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
110327e6fb56fSmrg    # expansion.
110337e6fb56fSmrg    for file in `sed -n "
110347e6fb56fSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1103590b17f1bSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
110367e6fb56fSmrg      # Make sure the directory exists.
110377e6fb56fSmrg      test -f "$dirpart/$file" && continue
110387e6fb56fSmrg      fdir=`AS_DIRNAME(["$file"])`
110397e6fb56fSmrg      AS_MKDIR_P([$dirpart/$fdir])
110407e6fb56fSmrg      # echo "creating $dirpart/$file"
110417e6fb56fSmrg      echo '# dummy' > "$dirpart/$file"
110427e6fb56fSmrg    done
110437e6fb56fSmrg  done
110447e6fb56fSmrg}
110457e6fb56fSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
110467e6fb56fSmrg
110477e6fb56fSmrg
110487e6fb56fSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
110497e6fb56fSmrg# -----------------------------
110507e6fb56fSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
110517e6fb56fSmrg#
110527e6fb56fSmrg# This code is only required when automatic dependency tracking
1105390b17f1bSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
110547e6fb56fSmrg# need in order to bootstrap the dependency handling code.
110557e6fb56fSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
110567e6fb56fSmrg[AC_CONFIG_COMMANDS([depfiles],
110577e6fb56fSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
110587e6fb56fSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
110597e6fb56fSmrg])
110607e6fb56fSmrg
110617e6fb56fSmrg# Do all the work for Automake.                             -*- Autoconf -*-
110627e6fb56fSmrg
1106390b17f1bSmrg# Copyright (C) 1996-2012 Free Software Foundation, Inc.
110647e6fb56fSmrg#
110657e6fb56fSmrg# This file is free software; the Free Software Foundation
110667e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
110677e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
110687e6fb56fSmrg
1106990b17f1bSmrg# serial 19
110707e6fb56fSmrg
110717e6fb56fSmrg# This macro actually does too much.  Some checks are only needed if
110727e6fb56fSmrg# your package does certain things.  But this isn't really a big deal.
110737e6fb56fSmrg
110747e6fb56fSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
110757e6fb56fSmrg# AM_INIT_AUTOMAKE([OPTIONS])
110767e6fb56fSmrg# -----------------------------------------------
110777e6fb56fSmrg# The call with PACKAGE and VERSION arguments is the old style
110787e6fb56fSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
110797e6fb56fSmrg# and VERSION should now be passed to AC_INIT and removed from
110807e6fb56fSmrg# the call to AM_INIT_AUTOMAKE.
110817e6fb56fSmrg# We support both call styles for the transition.  After
110827e6fb56fSmrg# the next Automake release, Autoconf can make the AC_INIT
110837e6fb56fSmrg# arguments mandatory, and then we can depend on a new Autoconf
110847e6fb56fSmrg# release and drop the old call support.
110857e6fb56fSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
110867e6fb56fSmrg[AC_PREREQ([2.62])dnl
110877e6fb56fSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
110887e6fb56fSmrgdnl the ones we care about.
110897e6fb56fSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
110907e6fb56fSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
110917e6fb56fSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
110927e6fb56fSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
110937e6fb56fSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
110947e6fb56fSmrg  # is not polluted with repeated "-I."
110957e6fb56fSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
110967e6fb56fSmrg  # test to see if srcdir already configured
110977e6fb56fSmrg  if test -f $srcdir/config.status; then
110987e6fb56fSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
110997e6fb56fSmrg  fi
111007e6fb56fSmrgfi
111017e6fb56fSmrg
111027e6fb56fSmrg# test whether we have cygpath
111037e6fb56fSmrgif test -z "$CYGPATH_W"; then
111047e6fb56fSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
111057e6fb56fSmrg    CYGPATH_W='cygpath -w'
111067e6fb56fSmrg  else
111077e6fb56fSmrg    CYGPATH_W=echo
111087e6fb56fSmrg  fi
111097e6fb56fSmrgfi
111107e6fb56fSmrgAC_SUBST([CYGPATH_W])
111117e6fb56fSmrg
111127e6fb56fSmrg# Define the identity of the package.
111137e6fb56fSmrgdnl Distinguish between old-style and new-style calls.
111147e6fb56fSmrgm4_ifval([$2],
1111590b17f1bSmrg[AC_DIAGNOSE([obsolete],
1111690b17f1bSmrg[$0: two- and three-arguments forms are deprecated.  For more info, see:
1111790b17f1bSmrghttp://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
1111890b17f1bSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
111197e6fb56fSmrg AC_SUBST([PACKAGE], [$1])dnl
111207e6fb56fSmrg AC_SUBST([VERSION], [$2])],
111217e6fb56fSmrg[_AM_SET_OPTIONS([$1])dnl
111227e6fb56fSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1112390b17f1bSmrgm4_if(
1112490b17f1bSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
1112590b17f1bSmrg  [ok:ok],,
111267e6fb56fSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
111277e6fb56fSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
111287e6fb56fSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
111297e6fb56fSmrg
111307e6fb56fSmrg_AM_IF_OPTION([no-define],,
1113190b17f1bSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
1113290b17f1bSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
111337e6fb56fSmrg
111347e6fb56fSmrg# Some tools Automake needs.
111357e6fb56fSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
111367e6fb56fSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
1113790b17f1bSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
1113890b17f1bSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
1113990b17f1bSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
1114090b17f1bSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
1114190b17f1bSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
111427e6fb56fSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
111437e6fb56fSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1114490b17f1bSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
1114590b17f1bSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
1114690b17f1bSmrg# dies out for good.  For more background, see:
1114790b17f1bSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
1114890b17f1bSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
1114990b17f1bSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
111507e6fb56fSmrg# We need awk for the "check" target.  The system "awk" is bad on
111517e6fb56fSmrg# some platforms.
111527e6fb56fSmrgAC_REQUIRE([AC_PROG_AWK])dnl
111537e6fb56fSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
111547e6fb56fSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
111557e6fb56fSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
111567e6fb56fSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
111577e6fb56fSmrg			     [_AM_PROG_TAR([v7])])])
111587e6fb56fSmrg_AM_IF_OPTION([no-dependencies],,
111597e6fb56fSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
1116090b17f1bSmrg		  [_AM_DEPENDENCIES([CC])],
1116190b17f1bSmrg		  [m4_define([AC_PROG_CC],
1116290b17f1bSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
111637e6fb56fSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
1116490b17f1bSmrg		  [_AM_DEPENDENCIES([CXX])],
1116590b17f1bSmrg		  [m4_define([AC_PROG_CXX],
1116690b17f1bSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
111677e6fb56fSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
1116890b17f1bSmrg		  [_AM_DEPENDENCIES([OBJC])],
1116990b17f1bSmrg		  [m4_define([AC_PROG_OBJC],
1117090b17f1bSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
1117190b17f1bSmrgdnl Support for Objective C++ was only introduced in Autoconf 2.65,
1117290b17f1bSmrgdnl but we still cater to Autoconf 2.62.
1117390b17f1bSmrgm4_ifdef([AC_PROG_OBJCXX],
1117490b17f1bSmrg[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
1117590b17f1bSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
1117690b17f1bSmrg		  [m4_define([AC_PROG_OBJCXX],
1117790b17f1bSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
111787e6fb56fSmrg])
111797e6fb56fSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
1118090b17f1bSmrgdnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
1118190b17f1bSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
111827e6fb56fSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
111837e6fb56fSmrgAC_CONFIG_COMMANDS_PRE(dnl
111847e6fb56fSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
111857e6fb56fSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
111867e6fb56fSmrg])
111877e6fb56fSmrg
1118890b17f1bSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
111897e6fb56fSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
111907e6fb56fSmrgdnl mangled by Autoconf and run in a shell conditional statement.
111917e6fb56fSmrgm4_define([_AC_COMPILER_EXEEXT],
111927e6fb56fSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
111937e6fb56fSmrg
111947e6fb56fSmrg
111957e6fb56fSmrg# When config.status generates a header, we must update the stamp-h file.
111967e6fb56fSmrg# This file resides in the same directory as the config header
111977e6fb56fSmrg# that is generated.  The stamp files are numbered to have different names.
111987e6fb56fSmrg
111997e6fb56fSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
112007e6fb56fSmrg# loop where config.status creates the headers, so we can generate
112017e6fb56fSmrg# our stamp files there.
112027e6fb56fSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
112037e6fb56fSmrg[# Compute $1's index in $config_headers.
112047e6fb56fSmrg_am_arg=$1
112057e6fb56fSmrg_am_stamp_count=1
112067e6fb56fSmrgfor _am_header in $config_headers :; do
112077e6fb56fSmrg  case $_am_header in
112087e6fb56fSmrg    $_am_arg | $_am_arg:* )
112097e6fb56fSmrg      break ;;
112107e6fb56fSmrg    * )
112117e6fb56fSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
112127e6fb56fSmrg  esac
112137e6fb56fSmrgdone
112147e6fb56fSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
112157e6fb56fSmrg
1121690b17f1bSmrg# Copyright (C) 2001-2012 Free Software Foundation, Inc.
112177e6fb56fSmrg#
112187e6fb56fSmrg# This file is free software; the Free Software Foundation
112197e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
112207e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
112217e6fb56fSmrg
1122290b17f1bSmrg# serial 8
1122390b17f1bSmrg
112247e6fb56fSmrg# AM_PROG_INSTALL_SH
112257e6fb56fSmrg# ------------------
112267e6fb56fSmrg# Define $install_sh.
112277e6fb56fSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
112287e6fb56fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
112297e6fb56fSmrgif test x"${install_sh}" != xset; then
112307e6fb56fSmrg  case $am_aux_dir in
112317e6fb56fSmrg  *\ * | *\	*)
112327e6fb56fSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
112337e6fb56fSmrg  *)
112347e6fb56fSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
112357e6fb56fSmrg  esac
112367e6fb56fSmrgfi
1123790b17f1bSmrgAC_SUBST([install_sh])])
112387e6fb56fSmrg
1123990b17f1bSmrg# Copyright (C) 2003-2012 Free Software Foundation, Inc.
112407e6fb56fSmrg#
112417e6fb56fSmrg# This file is free software; the Free Software Foundation
112427e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
112437e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
112447e6fb56fSmrg
112457e6fb56fSmrg# serial 2
112467e6fb56fSmrg
112477e6fb56fSmrg# Check whether the underlying file-system supports filenames
112487e6fb56fSmrg# with a leading dot.  For instance MS-DOS doesn't.
112497e6fb56fSmrgAC_DEFUN([AM_SET_LEADING_DOT],
112507e6fb56fSmrg[rm -rf .tst 2>/dev/null
112517e6fb56fSmrgmkdir .tst 2>/dev/null
112527e6fb56fSmrgif test -d .tst; then
112537e6fb56fSmrg  am__leading_dot=.
112547e6fb56fSmrgelse
112557e6fb56fSmrg  am__leading_dot=_
112567e6fb56fSmrgfi
112577e6fb56fSmrgrmdir .tst 2>/dev/null
112587e6fb56fSmrgAC_SUBST([am__leading_dot])])
112597e6fb56fSmrg
112607e6fb56fSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
112617e6fb56fSmrg# From Jim Meyering
112627e6fb56fSmrg
1126390b17f1bSmrg# Copyright (C) 1996-2012 Free Software Foundation, Inc.
112647e6fb56fSmrg#
112657e6fb56fSmrg# This file is free software; the Free Software Foundation
112667e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
112677e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
112687e6fb56fSmrg
1126990b17f1bSmrg# serial 7
112707e6fb56fSmrg
112717e6fb56fSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
112727e6fb56fSmrg# ----------------------------------
112737e6fb56fSmrg# Control maintainer-specific portions of Makefiles.
1127490b17f1bSmrg# Default is to disable them, unless 'enable' is passed literally.
1127590b17f1bSmrg# For symmetry, 'disable' may be passed as well.  Anyway, the user
112767e6fb56fSmrg# can override the default with the --enable/--disable switch.
112777e6fb56fSmrgAC_DEFUN([AM_MAINTAINER_MODE],
112787e6fb56fSmrg[m4_case(m4_default([$1], [disable]),
112797e6fb56fSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
112807e6fb56fSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
112817e6fb56fSmrg       [m4_define([am_maintainer_other], [enable])
112827e6fb56fSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
1128390b17f1bSmrgAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
112847e6fb56fSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
112857e6fb56fSmrg  AC_ARG_ENABLE([maintainer-mode],
1128690b17f1bSmrg    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
1128790b17f1bSmrg      am_maintainer_other[ make rules and dependencies not useful
1128890b17f1bSmrg      (and sometimes confusing) to the casual installer])],
1128990b17f1bSmrg    [USE_MAINTAINER_MODE=$enableval],
1129090b17f1bSmrg    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
112917e6fb56fSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
112927e6fb56fSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
112937e6fb56fSmrg  MAINT=$MAINTAINER_MODE_TRUE
112947e6fb56fSmrg  AC_SUBST([MAINT])dnl
112957e6fb56fSmrg]
112967e6fb56fSmrg)
112977e6fb56fSmrg
112987e6fb56fSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
112997e6fb56fSmrg
113007e6fb56fSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
113017e6fb56fSmrg
1130290b17f1bSmrg# Copyright (C) 2001-2012 Free Software Foundation, Inc.
113037e6fb56fSmrg#
113047e6fb56fSmrg# This file is free software; the Free Software Foundation
113057e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
113067e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
113077e6fb56fSmrg
1130890b17f1bSmrg# serial 5
113097e6fb56fSmrg
113107e6fb56fSmrg# AM_MAKE_INCLUDE()
113117e6fb56fSmrg# -----------------
113127e6fb56fSmrg# Check to see how make treats includes.
113137e6fb56fSmrgAC_DEFUN([AM_MAKE_INCLUDE],
113147e6fb56fSmrg[am_make=${MAKE-make}
113157e6fb56fSmrgcat > confinc << 'END'
113167e6fb56fSmrgam__doit:
113177e6fb56fSmrg	@echo this is the am__doit target
113187e6fb56fSmrg.PHONY: am__doit
113197e6fb56fSmrgEND
113207e6fb56fSmrg# If we don't find an include directive, just comment out the code.
113217e6fb56fSmrgAC_MSG_CHECKING([for style of include used by $am_make])
113227e6fb56fSmrgam__include="#"
113237e6fb56fSmrgam__quote=
113247e6fb56fSmrg_am_result=none
113257e6fb56fSmrg# First try GNU make style include.
113267e6fb56fSmrgecho "include confinc" > confmf
1132790b17f1bSmrg# Ignore all kinds of additional output from 'make'.
113287e6fb56fSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
113297e6fb56fSmrg*the\ am__doit\ target*)
113307e6fb56fSmrg  am__include=include
113317e6fb56fSmrg  am__quote=
113327e6fb56fSmrg  _am_result=GNU
113337e6fb56fSmrg  ;;
113347e6fb56fSmrgesac
113357e6fb56fSmrg# Now try BSD make style include.
113367e6fb56fSmrgif test "$am__include" = "#"; then
113377e6fb56fSmrg   echo '.include "confinc"' > confmf
113387e6fb56fSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
113397e6fb56fSmrg   *the\ am__doit\ target*)
113407e6fb56fSmrg     am__include=.include
113417e6fb56fSmrg     am__quote="\""
113427e6fb56fSmrg     _am_result=BSD
113437e6fb56fSmrg     ;;
113447e6fb56fSmrg   esac
113457e6fb56fSmrgfi
113467e6fb56fSmrgAC_SUBST([am__include])
113477e6fb56fSmrgAC_SUBST([am__quote])
113487e6fb56fSmrgAC_MSG_RESULT([$_am_result])
113497e6fb56fSmrgrm -f confinc confmf
113507e6fb56fSmrg])
113517e6fb56fSmrg
113527e6fb56fSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
113537e6fb56fSmrg
1135490b17f1bSmrg# Copyright (C) 1997-2012 Free Software Foundation, Inc.
113557e6fb56fSmrg#
113567e6fb56fSmrg# This file is free software; the Free Software Foundation
113577e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
113587e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
113597e6fb56fSmrg
1136090b17f1bSmrg# serial 7
113617e6fb56fSmrg
113627e6fb56fSmrg# AM_MISSING_PROG(NAME, PROGRAM)
113637e6fb56fSmrg# ------------------------------
113647e6fb56fSmrgAC_DEFUN([AM_MISSING_PROG],
113657e6fb56fSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
113667e6fb56fSmrg$1=${$1-"${am_missing_run}$2"}
113677e6fb56fSmrgAC_SUBST($1)])
113687e6fb56fSmrg
113697e6fb56fSmrg
113707e6fb56fSmrg# AM_MISSING_HAS_RUN
113717e6fb56fSmrg# ------------------
113727e6fb56fSmrg# Define MISSING if not defined so far and test if it supports --run.
113737e6fb56fSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
113747e6fb56fSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
113757e6fb56fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
113767e6fb56fSmrgAC_REQUIRE_AUX_FILE([missing])dnl
113777e6fb56fSmrgif test x"${MISSING+set}" != xset; then
113787e6fb56fSmrg  case $am_aux_dir in
113797e6fb56fSmrg  *\ * | *\	*)
113807e6fb56fSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
113817e6fb56fSmrg  *)
113827e6fb56fSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
113837e6fb56fSmrg  esac
113847e6fb56fSmrgfi
113857e6fb56fSmrg# Use eval to expand $SHELL
113867e6fb56fSmrgif eval "$MISSING --run true"; then
113877e6fb56fSmrg  am_missing_run="$MISSING --run "
113887e6fb56fSmrgelse
113897e6fb56fSmrg  am_missing_run=
1139090b17f1bSmrg  AC_MSG_WARN(['missing' script is too old or missing])
113917e6fb56fSmrgfi
113927e6fb56fSmrg])
113937e6fb56fSmrg
113947e6fb56fSmrg# Helper functions for option handling.                     -*- Autoconf -*-
113957e6fb56fSmrg
1139690b17f1bSmrg# Copyright (C) 2001-2012 Free Software Foundation, Inc.
113977e6fb56fSmrg#
113987e6fb56fSmrg# This file is free software; the Free Software Foundation
113997e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
114007e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
114017e6fb56fSmrg
1140290b17f1bSmrg# serial 6
114037e6fb56fSmrg
114047e6fb56fSmrg# _AM_MANGLE_OPTION(NAME)
114057e6fb56fSmrg# -----------------------
114067e6fb56fSmrgAC_DEFUN([_AM_MANGLE_OPTION],
114077e6fb56fSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
114087e6fb56fSmrg
114097e6fb56fSmrg# _AM_SET_OPTION(NAME)
1141090b17f1bSmrg# --------------------
114117e6fb56fSmrg# Set option NAME.  Presently that only means defining a flag for this option.
114127e6fb56fSmrgAC_DEFUN([_AM_SET_OPTION],
1141390b17f1bSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
114147e6fb56fSmrg
114157e6fb56fSmrg# _AM_SET_OPTIONS(OPTIONS)
1141690b17f1bSmrg# ------------------------
114177e6fb56fSmrg# OPTIONS is a space-separated list of Automake options.
114187e6fb56fSmrgAC_DEFUN([_AM_SET_OPTIONS],
114197e6fb56fSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
114207e6fb56fSmrg
114217e6fb56fSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
114227e6fb56fSmrg# -------------------------------------------
114237e6fb56fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
114247e6fb56fSmrgAC_DEFUN([_AM_IF_OPTION],
114257e6fb56fSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
114267e6fb56fSmrg
114277e6fb56fSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
114287e6fb56fSmrg
1142990b17f1bSmrg# Copyright (C) 1996-2012 Free Software Foundation, Inc.
114307e6fb56fSmrg#
114317e6fb56fSmrg# This file is free software; the Free Software Foundation
114327e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
114337e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
114347e6fb56fSmrg
1143590b17f1bSmrg# serial 9
114367e6fb56fSmrg
114377e6fb56fSmrg# AM_SANITY_CHECK
114387e6fb56fSmrg# ---------------
114397e6fb56fSmrgAC_DEFUN([AM_SANITY_CHECK],
114407e6fb56fSmrg[AC_MSG_CHECKING([whether build environment is sane])
114417e6fb56fSmrg# Reject unsafe characters in $srcdir or the absolute working directory
114427e6fb56fSmrg# name.  Accept space and tab only in the latter.
114437e6fb56fSmrgam_lf='
114447e6fb56fSmrg'
114457e6fb56fSmrgcase `pwd` in
114467e6fb56fSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
114477e6fb56fSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
114487e6fb56fSmrgesac
114497e6fb56fSmrgcase $srcdir in
114507e6fb56fSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
1145190b17f1bSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
114527e6fb56fSmrgesac
114537e6fb56fSmrg
1145490b17f1bSmrg# Do 'set' in a subshell so we don't clobber the current shell's
114557e6fb56fSmrg# arguments.  Must try -L first in case configure is actually a
114567e6fb56fSmrg# symlink; some systems play weird games with the mod time of symlinks
114577e6fb56fSmrg# (eg FreeBSD returns the mod time of the symlink's containing
114587e6fb56fSmrg# directory).
114597e6fb56fSmrgif (
1146090b17f1bSmrg   am_has_slept=no
1146190b17f1bSmrg   for am_try in 1 2; do
1146290b17f1bSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
1146390b17f1bSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
1146490b17f1bSmrg     if test "$[*]" = "X"; then
1146590b17f1bSmrg	# -L didn't work.
1146690b17f1bSmrg	set X `ls -t "$srcdir/configure" conftest.file`
1146790b17f1bSmrg     fi
1146890b17f1bSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
1146990b17f1bSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
1147090b17f1bSmrg
1147190b17f1bSmrg	# If neither matched, then we have a broken ls.  This can happen
1147290b17f1bSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
1147390b17f1bSmrg	# broken ls alias from the environment.  This has actually
1147490b17f1bSmrg	# happened.  Such a system could not be considered "sane".
1147590b17f1bSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1147690b17f1bSmrg  alias in your environment])
1147790b17f1bSmrg     fi
1147890b17f1bSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
1147990b17f1bSmrg       break
1148090b17f1bSmrg     fi
1148190b17f1bSmrg     # Just in case.
1148290b17f1bSmrg     sleep 1
1148390b17f1bSmrg     am_has_slept=yes
1148490b17f1bSmrg   done
114857e6fb56fSmrg   test "$[2]" = conftest.file
114867e6fb56fSmrg   )
114877e6fb56fSmrgthen
114887e6fb56fSmrg   # Ok.
114897e6fb56fSmrg   :
114907e6fb56fSmrgelse
114917e6fb56fSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
114927e6fb56fSmrgCheck your system clock])
114937e6fb56fSmrgfi
1149490b17f1bSmrgAC_MSG_RESULT([yes])
1149590b17f1bSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
1149690b17f1bSmrg# generated files are strictly newer.
1149790b17f1bSmrgam_sleep_pid=
1149890b17f1bSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
1149990b17f1bSmrg  ( sleep 1 ) &
1150090b17f1bSmrg  am_sleep_pid=$!
1150190b17f1bSmrgfi
1150290b17f1bSmrgAC_CONFIG_COMMANDS_PRE(
1150390b17f1bSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
1150490b17f1bSmrg   if test -n "$am_sleep_pid"; then
1150590b17f1bSmrg     # Hide warnings about reused PIDs.
1150690b17f1bSmrg     wait $am_sleep_pid 2>/dev/null
1150790b17f1bSmrg   fi
1150890b17f1bSmrg   AC_MSG_RESULT([done])])
1150990b17f1bSmrgrm -f conftest.file
1151090b17f1bSmrg])
115117e6fb56fSmrg
1151290b17f1bSmrg# Copyright (C) 2001-2012 Free Software Foundation, Inc.
115137e6fb56fSmrg#
115147e6fb56fSmrg# This file is free software; the Free Software Foundation
115157e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
115167e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
115177e6fb56fSmrg
1151890b17f1bSmrg# serial 2
1151990b17f1bSmrg
115207e6fb56fSmrg# AM_PROG_INSTALL_STRIP
115217e6fb56fSmrg# ---------------------
1152290b17f1bSmrg# One issue with vendor 'install' (even GNU) is that you can't
115237e6fb56fSmrg# specify the program used to strip binaries.  This is especially
115247e6fb56fSmrg# annoying in cross-compiling environments, where the build's strip
115257e6fb56fSmrg# is unlikely to handle the host's binaries.
115267e6fb56fSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
1152790b17f1bSmrg# always use install-sh in "make install-strip", and initialize
115287e6fb56fSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
115297e6fb56fSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
115307e6fb56fSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1153190b17f1bSmrg# Installed binaries are usually stripped using 'strip' when the user
1153290b17f1bSmrg# run "make install-strip".  However 'strip' might not be the right
115337e6fb56fSmrg# tool to use in cross-compilation environments, therefore Automake
1153490b17f1bSmrg# will honor the 'STRIP' environment variable to overrule this program.
1153590b17f1bSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
115367e6fb56fSmrgif test "$cross_compiling" != no; then
115377e6fb56fSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
115387e6fb56fSmrgfi
115397e6fb56fSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
115407e6fb56fSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
115417e6fb56fSmrg
1154290b17f1bSmrg# Copyright (C) 2006-2012 Free Software Foundation, Inc.
115437e6fb56fSmrg#
115447e6fb56fSmrg# This file is free software; the Free Software Foundation
115457e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
115467e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
115477e6fb56fSmrg
1154890b17f1bSmrg# serial 3
115497e6fb56fSmrg
115507e6fb56fSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
115517e6fb56fSmrg# ---------------------------
115527e6fb56fSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
115537e6fb56fSmrg# This macro is traced by Automake.
115547e6fb56fSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
115557e6fb56fSmrg
115567e6fb56fSmrg# AM_SUBST_NOTMAKE(VARIABLE)
1155790b17f1bSmrg# --------------------------
115587e6fb56fSmrg# Public sister of _AM_SUBST_NOTMAKE.
115597e6fb56fSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
115607e6fb56fSmrg
115617e6fb56fSmrg# Check how to create a tarball.                            -*- Autoconf -*-
115627e6fb56fSmrg
1156390b17f1bSmrg# Copyright (C) 2004-2012 Free Software Foundation, Inc.
115647e6fb56fSmrg#
115657e6fb56fSmrg# This file is free software; the Free Software Foundation
115667e6fb56fSmrg# gives unlimited permission to copy and/or distribute it,
115677e6fb56fSmrg# with or without modifications, as long as this notice is preserved.
115687e6fb56fSmrg
1156990b17f1bSmrg# serial 3
115707e6fb56fSmrg
115717e6fb56fSmrg# _AM_PROG_TAR(FORMAT)
115727e6fb56fSmrg# --------------------
115737e6fb56fSmrg# Check how to create a tarball in format FORMAT.
1157490b17f1bSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
115757e6fb56fSmrg#
115767e6fb56fSmrg# Substitute a variable $(am__tar) that is a command
115777e6fb56fSmrg# writing to stdout a FORMAT-tarball containing the directory
115787e6fb56fSmrg# $tardir.
115797e6fb56fSmrg#     tardir=directory && $(am__tar) > result.tar
115807e6fb56fSmrg#
115817e6fb56fSmrg# Substitute a variable $(am__untar) that extract such
115827e6fb56fSmrg# a tarball read from stdin.
115837e6fb56fSmrg#     $(am__untar) < result.tar
115847e6fb56fSmrgAC_DEFUN([_AM_PROG_TAR],
1158590b17f1bSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
1158690b17f1bSmrg# in the wild :-(  We should find a proper way to deprecate it ...
1158790b17f1bSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
115887e6fb56fSmrgm4_if([$1], [v7],
1158990b17f1bSmrg     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
115907e6fb56fSmrg     [m4_case([$1], [ustar],, [pax],,
115917e6fb56fSmrg              [m4_fatal([Unknown tar format])])
115927e6fb56fSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
115937e6fb56fSmrg# Loop over all known methods to create a tar archive until one works.
115947e6fb56fSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
115957e6fb56fSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
115967e6fb56fSmrg# Do not fold the above two line into one, because Tru64 sh and
1159790b17f1bSmrg# Solaris sh will not grok spaces in the rhs of '-'.
115987e6fb56fSmrgfor _am_tool in $_am_tools
115997e6fb56fSmrgdo
116007e6fb56fSmrg  case $_am_tool in
116017e6fb56fSmrg  gnutar)
116027e6fb56fSmrg    for _am_tar in tar gnutar gtar;
116037e6fb56fSmrg    do
116047e6fb56fSmrg      AM_RUN_LOG([$_am_tar --version]) && break
116057e6fb56fSmrg    done
116067e6fb56fSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
116077e6fb56fSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
116087e6fb56fSmrg    am__untar="$_am_tar -xf -"
116097e6fb56fSmrg    ;;
116107e6fb56fSmrg  plaintar)
116117e6fb56fSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
116127e6fb56fSmrg    # ustar tarball either.
116137e6fb56fSmrg    (tar --version) >/dev/null 2>&1 && continue
116147e6fb56fSmrg    am__tar='tar chf - "$$tardir"'
116157e6fb56fSmrg    am__tar_='tar chf - "$tardir"'
116167e6fb56fSmrg    am__untar='tar xf -'
116177e6fb56fSmrg    ;;
116187e6fb56fSmrg  pax)
116197e6fb56fSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
116207e6fb56fSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
116217e6fb56fSmrg    am__untar='pax -r'
116227e6fb56fSmrg    ;;
116237e6fb56fSmrg  cpio)
116247e6fb56fSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
116257e6fb56fSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
116267e6fb56fSmrg    am__untar='cpio -i -H $1 -d'
116277e6fb56fSmrg    ;;
116287e6fb56fSmrg  none)
116297e6fb56fSmrg    am__tar=false
116307e6fb56fSmrg    am__tar_=false
116317e6fb56fSmrg    am__untar=false
116327e6fb56fSmrg    ;;
116337e6fb56fSmrg  esac
116347e6fb56fSmrg
116357e6fb56fSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
116367e6fb56fSmrg  # and am__untar set.
116377e6fb56fSmrg  test -n "${am_cv_prog_tar_$1}" && break
116387e6fb56fSmrg
116397e6fb56fSmrg  # tar/untar a dummy directory, and stop if the command works
116407e6fb56fSmrg  rm -rf conftest.dir
116417e6fb56fSmrg  mkdir conftest.dir
116427e6fb56fSmrg  echo GrepMe > conftest.dir/file
116437e6fb56fSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
116447e6fb56fSmrg  rm -rf conftest.dir
116457e6fb56fSmrg  if test -s conftest.tar; then
116467e6fb56fSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
116477e6fb56fSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
116487e6fb56fSmrg  fi
116497e6fb56fSmrgdone
116507e6fb56fSmrgrm -rf conftest.dir
116517e6fb56fSmrg
116527e6fb56fSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
116537e6fb56fSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
116547e6fb56fSmrgAC_SUBST([am__tar])
116557e6fb56fSmrgAC_SUBST([am__untar])
116567e6fb56fSmrg]) # _AM_PROG_TAR
116577e6fb56fSmrg
116587e6fb56fSmrgm4_include([acinclude.m4])
11659